query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Set the year field of the date object @param int the year @return int the year
[ "public function year($value = null)\n {\n if ($value !== null) {\n if ($value < 0 || $value > 9999) {\n $this->year = 0;\n } else {\n $this->year = $value;\n }\n }\n return $this->year;\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns true if object is cached. Args: objpath: Filename relative to buildroot. metahash: hash object
[ "def in_cache(self, objpath, metahash):\n \n try:\n self.path_in_cache(objpath, metahash)\n return True\n except CacheMiss:\n return False" ]
[ "def get_docs_url(self, role, name):\n \n\n # Expand partial names to full names\n name = self.get_full_name(role, name)\n # Look up domain corresponding to role\n dom = IntersphinxInventory.roledomain[role]\n # Get the inventory entry tuple corresponding to the name\n ...
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Find all return tags that contain 'self' or '$this' and replace those terms for the name of the current class' type. @param \DOMDocument $xml Structure source to apply behaviour onto. @return \DOMDocument
[ "public function process(\\DOMDocument $xml)\n {\n $licenseMap = array(\n '#^\\s*(GPL|GNU General Public License)((\\s?v?|version)?2)\\s*$#i'\n => 'http://opensource.org/licenses/GPL-2.0',\n '#^\\s*(GPL|GNU General Public License)((\\s?v?|version)?3?)\\s*$#i'\n ...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software Development:" }
// Validate verifies that SSH connection credentials were properly configured.
[ "func (client *SSHClient) Validate() error {\n\tif client.Creds.SSHUser == \"\" {\n\t\treturn ErrInvalidUsername\n\t}\n\n\tif client.Creds.SSHPrivateKey == \"\" && client.Creds.SSHPassword == \"\" {\n\t\treturn ErrInvalidAuth\n\t}\n\n\treturn nil\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 Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Show toast on the UI thread. @param applicationContext the application context. @param message the message to show. @param duration the display duration.
[ "public static void showOnUiThread(Context applicationContext, String message, int duration) {\n Handler handler = HandlerUtils.getMainHandler();\n showOnUiThread(applicationContext, message, duration, handler);\n }" ]
[ "@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
WebInspector Event: DOM.characterDataModified
[ "function _onCharacterDataModified(event, res) {\n // res = {nodeId, characterData}\n if (_editedNode.nodeId !== res.nodeId) {\n return;\n }\n\n GotoAgent.open(DOMAgent.url);\n var editor = EditorManager.getCurrentFullEditor();\n var codeMirror = editor._codeMirr...
[ "@Override\n public void performFileBasedAction(Collection<File> files) {\n Tr.audit(tc, \"LTPA_KEYS_TO_LOAD\", keyImportFile);\n submitTaskToCreateLTPAKeys();\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
adds join column name to the table Info of entity. @param joinColumn @param targetTableInfo @param targetTableInfos
[ "private void addJoinColumnToInfo(String joinColumn, TableInfo targetTableInfo, List<TableInfo> targetTableInfos,\n EntityMetadata m)\n {\n if (!joinColumn.equals(targetTableInfo.getIdColumnName()))\n {\n\n if (!targetTableInfos.isEmpty() && targetTableInfos.contains(targetTab...
[ "public FluentSelect selectByValue(final String value) {\n executeAndWrapReThrowIfNeeded(new SelectByValue(value), Context.singular(context, \"selectByValue\", null, value), true);\n return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfNotFoundExcep...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
The centroid is also known as the "center of gravity" or the "center of mass". @param geometry The other geometry to calculate the centroid for. @return Return the center point.
[ "public static Coordinate getCentroid(Geometry geometry) {\n\t\tif (Geometry.POINT.equals(geometry.getGeometryType())) {\n\t\t\treturn getCentroidPoint(geometry);\n\t\t} else if (Geometry.LINE_STRING.equals(geometry.getGeometryType())) {\n\t\t\treturn getCentroidLineString(geometry);\n\t\t} else if (Geometry.LINEAR...
[ "def point(self):\n \n if not self.geometry:\n raise ValueError('geometry attribute must be set before trying to get point property')\n if self.geometry.geom_type == 'Point':\n return self.geometry\n else:\n try:\n # point_on_surface guaran...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
@param bool $not @return WhereStatement|Select|Delete|Update
[ "protected function addNullCondition(bool $not): WhereStatement\n {\n $this->sql->addWhereNullCondition($this->column, $this->separator, $not);\n return $this->statement;\n }" ]
[ "private function ClearOptions()\n {\n $sql = Access::SqlBuilder();\n $tblOptions = SelectOption::Schema()->Table();\n $where = $sql->Equals($tblOptions->Field('SelectField'), $sql->Value($this->select->GetID()));\n $opts = SelectOption::Schema()->Delete($where);\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
A thin wrapper layer over {@link DataStream#filter(FilterFunction)}. @param filter The FilterFunction that is called for each element of the DataStream. @return The filtered {@link PythonDataStream}.
[ "public PythonSingleOutputStreamOperator filter(FilterFunction<PyObject> filter) throws IOException {\n\t\treturn new PythonSingleOutputStreamOperator(stream.filter(new PythonFilterFunction(filter)));\n\t}" ]
[ "@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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Format URL. @param string $url @return string
[ "protected function formatUrl(string $url): string\n {\n $uri = $this->urlPrefix.$url;\n\n return $uri === '/' ? '/' : ltrim(rtrim($uri, '/'), '/');\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 instruction about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Callback froma the log API when data arrives
[ "def _stab_log_data(self, timestamp, data, logconf):\n \"\"\"\"\"\"\n print('[%d][%s]: %s' % (timestamp, logconf.name, data))" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Logger sets a logger to use for internal logging. // // The default is to not write any logs.
[ "func Logger(logger *zap.Logger) TransportOption {\n\treturn func(t *transportOptions) {\n\t\tt.logger = logger\n\t}\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
读取编译编译 @param string $cacheFile 缓存的文件名 @param array $vars 变量数组 @return void
[ "protected function read($cacheFile, $vars = []) {\r\n if (!empty($vars) && is_array($vars)) {\r\n // 模板阵列变量分解成为独立变量\r\n extract($vars, EXTR_OVERWRITE);\r\n }\r\n //载入模版缓存文件\r\n include $cacheFile;\r\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// AddKnownHostKeys adds a new entry to 'known_hosts' file
[ "func (fs *FSLocalKeyStore) AddKnownHostKeys(hostname string, hostKeys []ssh.PublicKey) error {\n\tfp, err := os.OpenFile(filepath.Join(fs.KeyDir, fileNameKnownHosts), os.O_CREATE|os.O_RDWR, 0640)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tdefer fp.Sync()\n\tdefer fp.Close()\n\t// read all existing entr...
[ "function Cli(opts) {\n _.extend(this, {\n logger: require('./logger'),\n Interview: require('./interview'),\n service: Service,\n rimraf: require('rimraf'),\n yargs: require('yargs'), // overridable parsed arguments.\n takenFlags: [],\n commands: {\n 'install': \"ask user about environme...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Science:" }
Clears all methods @return $this
[ "public function clearMethods() {\n\t\tforeach ($this->methods as $method) {\n\t\t\t$method->setParent(null);\n\t\t}\n\t\t$this->methods->clear();\n\n\t\treturn $this;\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// this function aims to check if the service's ClusterIP is set or not // the objective is not to perform validation here
[ "func IsServiceIPSet(service *Service) bool {\n\treturn service.Spec.ClusterIP != ClusterIPNone && service.Spec.ClusterIP != \"\"\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the summarization about Networking:", "pos": "Represent the code about Networking:", "neg": "Represent the code about Software development:" }
Decode an entity from the initialized Avro Decoder using the DatumReader. @param decoder The decoder to decode the entity fields @param reader The Avro DatumReader that will read the entity with the decoder. @return The entity.
[ "public static <T> T readAvroEntity(Decoder decoder, DatumReader<T> reader) {\n try {\n return reader.read(null, decoder);\n } catch (IOException e) {\n throw new SerializationException(\"Could not deserialize Avro entity\", e);\n }\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Ensures the behat dir exists in moodledata @param int $runprocess run process for which behat dir is returned. @return string Full path
[ "public static function get_behat_dir($runprocess = 0) {\n global $CFG;\n\n // If not set then return empty string.\n if (!isset($CFG->behat_dataroot)) {\n return \"\";\n }\n\n // If $CFG->behat_parallel_run starts with index 0 and $runprocess for parallel run starts wi...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Get watermark image @param ImagineInterface $imagine @return ImageInterface|null @throws \Imagine\Exception\RuntimeException @throws \UnexpectedValueException @throws \ErrorException
[ "private function getWatermark(ImagineInterface $imagine): ?ImageInterface\n {\n $resource = null;\n if ($this->getMarkFilepath() !== null) {\n $resource = fopen($this->getMarkFilepath(), 'rb');\n } elseif (\\is_string($this->markContent)) {\n $resource = 'a'; // TODO: ...
[ "protected function addSql($sql, array $params = [], array $types = [])\n {\n $message = 'Calling method \"addSql\" is not allowed. Use \"sql\" method instead';\n throw new \\Shopsys\\MigrationBundle\\Component\\Doctrine\\Migrations\\Exception\\MethodIsNotAllowedException($message);\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:" }
// SetStatus sets the Status field's value.
[ "func (s *ResolverRule) SetStatus(v string) *ResolverRule {\n\ts.Status = &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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Clear theme choice if reset variable is present in request.
[ "public static function check_reset() {\n\n\t\tif ( ! empty( filter_input( INPUT_GET, 'tts_reset' ) ) ) {\n\t\t\tsetcookie( self::get_cookie_name(), '', 1 );\n\t\t\tnocache_headers();\n\t\t\twp_safe_redirect( home_url() );\n\t\t\tdie;\n\t\t}\n\t}" ]
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Build the transfromation graph once.
[ "def start_bundle(self, element=None):\n \"\"\"\"\"\"\n import tensorflow as tf\n from trainer import feature_transforms\n\n g = tf.Graph()\n session = tf.Session(graph=g)\n\n # Build the transformation graph\n with g.as_default():\n transformed_features, _, placeholders = (\n fea...
[ "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:" }
Converts given array to an {@link Iterable} @param obj an array @return an Iterable that iterates over the entries of an array
[ "@SuppressWarnings(\"unchecked\")\n public Iterable<?> toIterable(Object obj) {\n if (isArray(obj))\n return ((Iterable) obj);\n else\n throw new JsonPathException(\"Cannot iterate over \" + obj!=null?obj.getClass().getName():\"null\");\n }" ]
[ "function () {\n __objCount++;\n /**\n * Counter to be used as an index in each map. Is incremented each time a new entry is added to the object.\n * @protected\n * @type Number\n */\n this._nextIndex = 0;\n /**\n ...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Adds a destination to this message bus. @param destination the destination of bus messages. @return the object itself, for method chaining.
[ "public Bus<M> addDestination(Destination<M> destination) {\n\t\tif(destination != null) {\n\t\t\tlogger.info(\"adding destination '{}' of class '{}'\", destination.getId(), destination.getClass().getSimpleName());\n\t\t\tdestinations.add(destination);\n\t\t}\n\t\treturn this;\n\t}" ]
[ "def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Returns the last error occurred (e.g. when updating/inserting failed) @return array Hash array with the following fields: type, message
[ "function get_error()\n {\n $err = $this->error;\n\n // check ldap connection for errors\n if (!$err && $this->ldap->get_error()) {\n $err = array(self::ERROR_SEARCH, $this->ldap->get_error());\n }\n\n return $err;\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Creates a new XBMC Addon directory based on user input
[ "def create_new_project():\n ''''''\n readline.parse_and_bind('tab: complete')\n\n print \\\n'''\n xbmcswift2 - A micro-framework for creating XBMC plugins.\n xbmc@jonathanbeluch.com\n --\n'''\n print 'I\\'m going to ask you a few questions to get this project' \\\n ' started.'\n\n op...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
New ldaptive search executor search executor. @param baseDn the base dn @param filterQuery the filter query @param params the params @param returnAttributes the return attributes @return the search executor
[ "public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery,\n final List<String> params,\n final List<String> returnAttributes) {\n return newLdaptive...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Bind object to {@link PreparedStatement}. Can be overridden by subclasses to implement custom argument binding. @param ps statement to bind object to @param index index of the parameter @param value to bind @throws SQLException if something fails
[ "public void bindArgument(@NotNull PreparedStatement ps, int index, @Nullable Object value) throws SQLException {\n ArgumentBinder.bindArgument(ps, index, value);\n }" ]
[ "public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Calculates the coordinates of {@link android.graphics.RectF} that are perfectly within the available window @param offset Half the width of the pain stroke @return The rectF
[ "private RectF getArcRect(float offset) {\n RectF workingSurface = new RectF();\n workingSurface.left = getPaddingLeft() + offset;\n workingSurface.top = getPaddingTop() + offset;\n workingSurface.right = getWidth() - getPaddingRight() - offset;\n workingSurface.bottom = getHeight...
[ "def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
<p> Gets an appropriate rule for the padding required. </p> @param field the field to get a rule for @param padding the padding required @return a new rule with the correct padding
[ "protected NumberRule selectNumberRule(final int field, final int padding) {\n\t\tswitch (padding) {\n\t\t\tcase 1:\n\t\t\t\treturn new UnpaddedNumberField(field);\n\t\t\tcase 2:\n\t\t\t\treturn new TwoDigitNumberField(field);\n\t\t\tdefault:\n\t\t\t\treturn new PaddedNumberField(field, padding);\n\t\t}\n\t}" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Generate Priors. Generate the label priors. @param L number of labels @param z desired label cardinality @param r random number generator @param skew whether to be very skewed or not (@NOTE not currently used) @return P label prior distribution
[ "private double[] generatePriors(Random r, int L, double z, boolean skew) {\n double P[] = new double[L];\n for (int i = 0; i < L; i++) {\n P[i] = r.nextDouble();\n //P[i] = 1.0; // @temp\n }\n // normalise to z\n do {\n double c = Utils.sum(P) / z...
[ "def is_stationary(self):\n \"\"\"\n # for disconnected matrices, the stationary distribution depends on the estimator, so we can't compute\n # it directly. Therefore we test whether the initial distribution is stationary.\n return np.allclose(np.dot(self._Pi, self._Tij), self._Pi)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Terminate the child process. It is not an error to call this method when the child has already exited.
[ "def terminate(self):\n \n try:\n self.send_signal(signal.SIGTERM)\n except pyuv.error.ProcessError as e:\n if e.args[0] != pyuv.errno.UV_ESRCH:\n raise" ]
[ "function startDeamon () {\n // ps aux | grep yourscript\n // kill -s SIGINT [process_id]\n process.stdin.resume()\n process.on('SIGINT', function (err) {\n // An easy way to send the SIGINT signal is with Control-C in most terminal programs.\n // Note:\n // SIGUSR1 is reserved by node.js to start th...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// CoInitializeEx initializes COM library with concurrency model.
[ "func CoInitializeEx(p uintptr, coinit uint32) (err error) {\n\t// Avoid any variable not used errors.\n\tp = uintptr(0)\n\treturn coInitializeEx(coinit)\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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Função de processamento dos Helpers setados no controller @param \Zend\Mvc\MvcEvent $e
[ "public static function processViewHelpersInControllers($e) {\n $viewHelperManager = $e->getApplication()->getServiceManager()->get('ViewHelperManager');\n\n if (isset($_SESSION['processHead'])) {\n $process = $_SESSION['processHead'];\n unset($_SESSION['processHead']);\n ...
[ "private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Common exception handling behavior across all exceptions. .. note:: This for internal use and should not be extended or used directly.
[ "def _handle_exception(self, exc):\n \n exc_info = sys.exc_info()\n self.logger.exception(\n '%s while processing message #%s',\n exc.__class__.__name__, self._message.delivery_tag,\n exc_info=exc_info)\n self._measurement.set_tag('exception', exc.__class...
[ "static ImmutableSet<ExecutableElement> abstractMethodsIn(\n ImmutableSet<ExecutableElement> methods) {\n Set<Name> noArgMethods = new HashSet<>();\n ImmutableSet.Builder<ExecutableElement> abstracts = ImmutableSet.builder();\n for (ExecutableElement method : methods) {\n if (method.getModifiers(...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// ContainsLetter checks if a string contains a letter
[ "func ContainsLetter(s string) bool {\n\tfor _, v := range s {\n\t\tif unicode.IsLetter(v) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set the status of this job, both in self.jobs and in the `JobArchive` if it is present.
[ "def _set_status_self(self, key=JobDetails.topkey, status=JobStatus.unknown):\n \n fullkey = JobDetails.make_fullkey(self.full_linkname, key)\n if fullkey in self.jobs:\n self.jobs[fullkey].status = status\n if self._job_archive:\n self._job_archive.register...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Makes a request to recaptcha service and checks if recaptcha field is valid. @param string $challengeField @param string $responseField @return boolean
[ "protected function check($challengeField, $responseField) {\n \n $server = $this->request->server;\n \n $data = array(\n 'privatekey' => $this->options['private_key'],\n 'remoteip' => $server->get('REMOTE_ADDR') ,\n 'challenge' => $challengeField,\n ...
[ "def get_session_key(self, username, password_hash):\n \n\n params = {\"username\": username, \"authToken\": md5(username + password_hash)}\n request = _Request(self.network, \"auth.getMobileSession\", params)\n\n # default action is that a request is signed only when\n # a sessio...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Add --params options for given command line programs
[ "def set_params(self, prog=None, params=\"\"):\n \n dest_prog = \"to {0}\".format(prog) if prog else \"\"\n self.add_option(\"--params\", dest=\"extra\", default=params,\n help=\"Extra parameters to pass {0}\".format(dest_prog) + \\\n \" (these WILL NOT be val...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Returns the character set from the <tt>Content-Type</tt> header. @param contentheader The content header. @return String The character set.
[ "protected String getContentCharSet(Header contentheader) {\n LOG.trace(\"enter getContentCharSet( Header contentheader )\");\n String charset = null;\n if (contentheader != null) {\n HeaderElement values[] = contentheader.getElements();\n // I expect only one header eleme...
[ "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 description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
/* Convert attributes array to a map. Note: parse5 will have already handled multiple attrs of the same name.
[ "function getAttrMap(attrs)\n{\n\tvar i;\n\tvar map = {};\n\tvar numAttrs = attrs.length;\n\t\n\tfor (i=0; i<numAttrs; i++)\n\t{\n\t\tmap[ attrs[i].name ] = attrs[i].value;\n\t}\n\t\n\treturn map;\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
检查配置是否存在 @access public @param string $key 形似a.b.c的key @return bool
[ "public function has($key) {\n\t\t$this->refresh();\n\t\t$keys = explode('.', $key);\n\t\t$conf = $this->cache;\n\t\tforeach ($keys as $v) {\n\t\t\tif (isset($conf[$v])) {\n\t\t\t\t$conf = $conf[$v];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}" ]
[ "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 Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
UMLRoleBindingView @constructor @extends UMLGeneralEdgeView
[ "function UMLRoleBindingView() {\n UMLGeneralEdgeView.apply(this, arguments);\n this.tailEndStyle = Core.ES_FLAT;\n this.headEndStyle = Core.ES_STICK_ARROW;\n this.lineMode = Core.LM_DOT;\n\n /** @member {EdgeLabelView} */\n this.roleNameLabel = new EdgeLabelView();\n ...
[ "public static List<ListViewColumn> createDefaultInitialColumnList(Class<? extends View> context) {\n return createDefaultInitialColumnList(DescriptorVisibilityFilter.applyType(context, ListViewColumn.all()));\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set convetions callable for route. Convertions allow to freely transform the route’s parameters before passing them to the dispatcher. @param Route $route @param array $convertions
[ "protected function setConvertions(Route $route, array $convertions)\n {\n foreach ($convertions as $convertionName => $convertConfig) {\n $obj = $this->getInstanceHelper($convertConfig);\n $isCallable = is_callable($obj);\n if (!$isCallable && !$obj instanceof Conv...
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Compiles route path @param string $path
[ "public function compilePath($path)\n {\n if(preg_match_all('/\\{(\\w+)\\}/', $path, $matches, PREG_SET_ORDER) == false)\n {\n return $path;\n }\n else\n {\n foreach($matches as $match)\n {\n $this->params[] = $match[1];\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Calculates the z-index value below open popups. If there are no open popups it returns the value from sap.ui.core.Popup.getNextZIndex() @returns {int} z-index below open popups @public
[ "function () {\n\t\t\tvar aOpenPopups = fnGetPopups();\n\t\t\tvar iLowestPopupZIndex;\n\n\t\t\tif (aOpenPopups.length > 0) {\n\t\t\t\tiLowestPopupZIndex = Math.min.apply(null, fnGetZIndexFromPopups(aOpenPopups));\n\t\t\t}\n\n\t\t\t// if no open popups\n\t\t\tif (!Util.isInteger(iLowestPopupZIndex)) {\n\t\t\t\tretur...
[ "function () {\n this._proxyFixSize();\n\n if (!this._sInitialFocusId) {\n var sInitFocusId = _fnGetInitialFocus(this);\n\n // Compare the initial focus id with the current focus that is\n // stored in the FocusHandler in the cor...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
FIXME maybe add a margin around viewport to prevent too many updates
[ "function updateMarks(editor, diff, state, type, classes) {\n var vp = editor.getViewport();\n editor.operation(function() {\n if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {\n clearMarks(editor, state.marked, classes);\n markChanges(editor, diff, type, s...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Splits a String into substrings along the provided char delimiter and returns the result as an Array of Substrings.<p> @param source the String to split @param delimiter the delimiter to split at @return the Array of splitted Substrings
[ "public static String[] splitAsArray(String source, char delimiter) {\n\n List<String> result = splitAsList(source, delimiter);\n return result.toArray(new String[result.size()]);\n }" ]
[ "protected function makeKeyString($key): string {\n //convert numbers to strings.\n $stringValue = (string)$key;\n $length = strlen( $stringValue );\n if( $length == 0 ){\n throw new \\Exception(\"Key values must be string values of at least 1 character. Empty strings cannot b...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about AWS S3:" }
Returns an array of indexes for of matches of higher precedence than the existing pairing. @param MatchedPreferenceInterface[] $matchingList @param PreferenceInterface $clientPref @return int[]
[ "private function getMatchingIndexes(array $matchingList, PreferenceInterface $clientPref)\n {\n $matchingIndexList = array();\n\n foreach ($matchingList as $key => $matching) {\n $serverPref = $matching->getServerPreference();\n list($clientMimeType) = explode('/', $clientPre...
[ "public UnfilledDependency replaceObject(IndexedPredicate newObject) {\n return new UnfilledDependency(subject, subjectSyntax, subjectFunctionVarIndex,\n subjectArgIndex, newObject, -1);\n }" ]
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Preview all parameters for all hosts (for testing) @param [Array<Hash>] hosts Host parameters (read from host list file). @param [Array<String>] commands Commands (read from command list file).
[ "def previewed_data(hosts, commands)\n @commands = commands\n hosts.map do |each|\n @host_param = each\n # [for a host] operation\n ready_to_open_host_session do |spawn_cmd|\n whole_previewed_parameters(spawn_cmd)\n end\n end\n end" ]
[ "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 text about AWS Redshift:", "pos": "Represent the Github code about AWS Redshift:", "neg": "Represent the Github code about Software development:" }
// SplitCondenseSpace splits a string and trims spaces on // remaining elements, removing empty elements.
[ "func SplitCondenseSpace(s, sep string) []string {\n\tsplit := strings.Split(s, sep)\n\tstrs := []string{}\n\tfor _, str := range split {\n\t\tstr = strings.TrimSpace(str)\n\t\tif len(str) > 0 {\n\t\t\tstrs = append(strs, str)\n\t\t}\n\t}\n\treturn strs\n}" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Check package access on the proxy interfaces that the given proxy class implements. @param clazz Proxy class object
[ "public static void checkProxyPackageAccess(Class<?> clazz) {\n SecurityManager s = System.getSecurityManager();\n if (s != null) {\n // check proxy interfaces if the given class is a proxy class\n if (Proxy.isProxyClass(clazz)) {\n for (Class<?> intf : clazz.getIn...
[ "@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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Create a user understandable string like count(stream) >= X. Args: stream (DataStream): The stream to use to format ourselves. Returns: str: The formatted string
[ "def format_trigger(self, stream):\n \n\n src = u'value'\n if self.use_count:\n src = u'count'\n\n return u\"{}({}) {} {}\".format(src, stream, self.comp_string, self.reference)" ]
[ "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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Mix multiple hashcodes into one. @param hash1 First hashcode to mix @param hash2 Second hashcode to mix @param hash3 Third hashcode to mix @return Mixed hash code
[ "public static int mixHashCodes(int hash1, int hash2, int hash3) {\n long result = hash1 * HASHPRIME + hash2;\n return (int) (result * HASHPRIME + hash3);\n }" ]
[ "public synchronized void addAll(T... nodes) {\n for (T node : nodes)\n addInternal(node,defaultReplication);\n refreshTable();\n }\n\n /**\n * \n */\n public synchronized void addAll(Collection<? extends T> nodes) {\n for (T node : nodes)\n addInternal(no...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Should handle execution of the task, taking as much (optional) parameters as needed The parameters should be optional and failing to provide them should be handled by the task
[ "public function execute($lineNr = null, $fieldId = null, $fieldSub = null, $fieldCalc = null)\n {\n $batch = $this->getBatch();\n $import = $batch->getVariable('import');\n\n if (! (isset($import['trackId']) && $import['trackId'] && $fieldId)) {\n // Do nothing\n retu...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// GetType returns the Type field if it's non-nil, zero value otherwise.
[ "func (f *FeedLink) GetType() string {\n\tif f == nil || f.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.Type\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return a driver for a Neo4j instance with the default configuration settings @param uri the URL to a Neo4j instance @param authToken authentication to use, see {@link AuthTokens} @return a new driver to the database instance specified by the URL
[ "public static Driver driver( String uri, AuthToken authToken )\n {\n return driver( uri, authToken, Config.defaultConfig() );\n }" ]
[ "function createConnection(connectionOptions, config)\n {\n // create a new ConnectionConfig and skip credential-validation if a config\n // object has been specified; this is because if a config object has been\n // specified, we're trying to deserialize a connection and the account name,\n // usernam...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Parse a timestamp value. @param value string representation @return date value
[ "public static final Date parseTimestamp(String value)\n {\n Date result = null;\n\n if (value != null && value.length() != 0)\n {\n try\n {\n result = TIMESTAMP_FORMAT.get().parse(value);\n }\n\n catch (ParseException ex)\n {\n // Ignor...
[ "function (value) {\n var date = new Date(value)\n assertErr(!isNaN(date.getTime()), TypeError, 'Field error: value is an invalid Date')\n return date\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Registers a new command. @param string $command The command name. @param \Callable|string $callable The function called when the command is executed. @param array $options An array of options. @return Command The command instance.
[ "public function registerSubCommand($command, $callable, array $options = [])\n {\n if (array_key_exists($command, $this->subCommands)) {\n throw new \\Exception(\"A sub-command with the name {$command} already exists.\");\n }\n\n list($commandInstance, $options) = $this->client->...
[ "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 Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Error can be either of the following types: // // - InvalidObjectFault // - RuntimeFault
[ "func (service *VboxPortType) IGuestSessionStateChangedEventgetId(request *IGuestSessionStateChangedEventgetId) (*IGuestSessionStateChangedEventgetIdResponse, error) {\n\tresponse := new(IGuestSessionStateChangedEventgetIdResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\tretur...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
// https://github.com/gogs/go-gogs-client/wiki/Organizations#list-user-organizations
[ "func ListUserOrgs(c *context.APIContext) {\n\tu := user.GetUserByParams(c)\n\tif c.Written() {\n\t\treturn\n\t}\n\tlistUserOrgs(c, u, false)\n}" ]
[ "def setup(app):\n \n app.info('Initializing GitHub plugin')\n app.add_role('ghissue', ghissue_role)\n app.add_role('ghpull', ghissue_role)\n app.add_role('ghuser', ghuser_role)\n app.add_role('ghcommit', ghcommit_role)\n app.add_config_value('github_project_url', None, 'env')\n return" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewMockRPCClient creates a new mock instance
[ "func NewMockRPCClient(ctrl *gomock.Controller) *MockRPCClient {\n\tmock := &MockRPCClient{ctrl: ctrl}\n\tmock.recorder = &MockRPCClientMockRecorder{mock}\n\treturn mock\n}" ]
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns a list of enabled LibraryHook class names. Only class names are returned, any object creation happens in the VCRFactory. @return string[] List of LibraryHook class names.
[ "public function getLibraryHooks()\n {\n if (is_null($this->enabledLibraryHooks)) {\n return array_values($this->availableLibraryHooks);\n }\n\n return array_values(array_intersect_key(\n $this->availableLibraryHooks,\n array_flip($this->enabledLibraryHooks)\...
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sends the cookie to the HTTP client Stores the cookie definition in session @return Cookie
[ "public function send()\n {\n if ($this->useEncryption && !empty($this->value)) {\n $value = $this->encrypt($this->value);\n } else {\n $value = $this->value;\n }\n\n setcookie($this->name, $value, $this->expire, $this->path, $this->domain, $this->secure, $this->...
[ "@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 text:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
set <INSTRUCTION> instr_key to instr_value :param instr_key: str, label key :param instr_value: str or None, new label/env value or None to remove
[ "def _modify_instruction_label_env(self, instruction, instr_key, instr_value):\n \n if instruction == 'LABEL':\n instructions = self.labels\n elif instruction == 'ENV':\n instructions = self.envs\n else:\n raise ValueError(\"Unknown instruction '%s'\" % i...
[ "def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
/* exclude complex objects from $.data() before pass to config
[ "function($element) {\n var data = {};\n $.each($element.data(), function(k, v) {\n if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {\n data[k] = v;\n }\n });\n ...
[ "function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Applies CoSE layout to the given SBGN PD model. @param sbgn model where layout is performed and stored @param doLayout whether to actually run the CoSE or just complete the SBGN model
[ "public void createLayout(final Sbgn sbgn, boolean doLayout)\n {\n viewToLayout = new HashMap();\n glyphToVNode = new HashMap();\n idToGLyph = new HashMap();\n idToCompartmentGlyphs = new HashMap();\n portIDToOwnerGlyph = new HashMap();\n layoutToView = new HashMap();\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Run a task. @param {string} taskName @param {string[]} directories @param {Object} options @param {Object} [argv] @returns {Promise}
[ "function runTask(taskName, directories, options, argv) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst modulePath = tryResolve(\n\t\t\ttryFile(directories, `${taskName}/index.js`),\n\t\t\t`mrm-task-${taskName}`,\n\t\t\ttaskName\n\t\t);\n\n\t\tif (!modulePath) {\n\t\t\treject(new MrmUnknownTask(`Task “${t...
[ "function (jobName, param, customParams, callback) {\n [jobName, param, customParams, callback] = doArgs(arguments, ['string', ['string', 'id,timestamp,result,duration'], ['object', {}], 'function']);\n\n // TODO better name and handle the \"param\" ???\n doRequest({\n urlPattern: [ALL_BUILDS,...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Increment the progress bar. @param int $num The amount of progress to advance by. @return $this
[ "public function increment($num = 1)\n {\n $this->_progress = min(max(0, $this->_progress + $num), $this->_total);\n\n return $this;\n }" ]
[ "def output(ret, bar, **kwargs): # pylint: disable=unused-argument\n '''\n \n '''\n if 'return_count' in ret:\n val = ret['return_count']\n # Avoid to fail if targets are behind a syndic. In this case actual return count will be\n # higher than targeted by MoM itself.\n # TO...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// EnvFilePath returns the path to the environment file for the given app name.
[ "func EnvFilePath(root string, appName types.ACName) string {\n\treturn filepath.Join(common.Stage1RootfsPath(root), RelEnvFilePath(appName))\n}" ]
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Converts framework options into corresponding arguments (--platform, --version). @param frameworks framework options @return converted Pax Runner collection of arguments @throws IllegalArgumentException - If there are more then one framework options
[ "private Collection<String> extractArguments( final FrameworkOption[] frameworks )\n {\n final List<String> arguments = new ArrayList<String>();\n if( frameworks.length > 1 )\n {\n throw new IllegalArgumentException( \"Configuration cannot contain more then one platform\" );\n ...
[ "def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// SetMaster sets the Master field's value.
[ "func (s *GetMasterAccountOutput) SetMaster(v *Master) *GetMasterAccountOutput {\n\ts.Master = 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:" }
Create a new {@link ArrayList} instance containing all elements of the given list. This is not a deep clone operation, so the underlying elements are copied by memory and not cloned. @param list The list to copy @return The newly created list
[ "public <T> List<T> cloneList(List<T> list) {\n return new ArrayList<T>(list);\n }" ]
[ "@Override\n public Object[] swapParameters(final Object[] emptyReplacement) {\n Object[] result;\n if (varargs == null) {\n result = params;\n if (emptyReplacement.length >= MAX_PARMS) {\n params = emptyReplacement;\n } else {\n // Bad...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// sendData is an auxiliary function to send data to the TM1638 module
[ "func (t *TM1638Driver) sendData(address byte, data byte) {\n\tt.sendCommand(TM1638DataCmd | TM1638FixedAddr)\n\tt.pinStrobe.Off()\n\tt.send(TM1638AddrCmd | address)\n\tt.send(data)\n\tt.pinStrobe.On()\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Gets a component scribe by name. @param componentName the component name (e.g. "VEVENT") @param version the version of the iCalendar object being parsed @return the component scribe or a {@link RawComponentScribe} if not found
[ "public ICalComponentScribe<? extends ICalComponent> getComponentScribe(String componentName, ICalVersion version) {\n\t\tcomponentName = componentName.toUpperCase();\n\n\t\tICalComponentScribe<? extends ICalComponent> scribe = experimentalCompByName.get(componentName);\n\t\tif (scribe == null) {\n\t\t\tscribe = st...
[ "private void required(String attributeName, String attributValue) throws ApplicationException {\n\tif (StringUtil.isEmpty(attributValue))\n\t throw new ApplicationException(\"invalid attribute constellation for the tag zip\", \"attribute [\" + attributeName + \"] is required, if action is [\" + action + \"]\");...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Set WebHook URL @param string $url @return $this
[ "public function setWebHook($url)\n {\n $this->data->target = $url;\n $this->data->media = self::DEFAULT_MEDIA;\n\n return $this;\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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param string|int $key @param mixed $value @return bool
[ "public function set($key, $value)\n {\n $setter = 'set'.ucfirst($key);\n\n if (is_array($this->current)) {\n $this->current[$key] = $value;\n } elseif ($this->isObjectWithMethod($this->current, $key)) {\n $this->current->$key($value);\n } elseif ($this->isObject...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Stop an instance @param home The home directory @return The exit code
[ "public int stop(String home)\n {\n Process p = instances.get(home);\n if (p != null)\n {\n try\n {\n p.destroy();\n return p.exitValue();\n\n }\n catch (Throwable t)\n {\n return -1;\n }\n finally\n {\...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about AWS Auto Scaling:" }
This method is used to change the credentials of CleverTap account Id and token programmatically @param accountID CleverTap Account Id @param token CleverTap Account Token
[ "@SuppressWarnings(\"unused\")\n public static void changeCredentials(String accountID, String token) {\n changeCredentials(accountID, token, null);\n }" ]
[ "public function getRefreshToken()\n {\n if ($this->has('refresh_token')) {\n $token = $this->get('refresh_token');\n\n return Crypt::decrypt($token);\n }\n\n throw new MissingRefreshTokenException(sprintf('No refresh token stored in current session. Verify you have add...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Similar to format_float, formats the numbers and list separators according to locale specifics. @param string $formula @return string localised formula
[ "public static function localize($formula) {\n $formula = str_replace('.', '$', $formula); // temp placeholder\n $formula = str_replace(',', get_string('listsep', 'langconfig'), $formula);\n $formula = str_replace('$', get_string('decsep', 'langconfig'), $formula);\n return $formula;\n ...
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Same but returns null instead throwing a NoInstanceException
[ "Type instantiate(Env<AttrContext> env,\n Type site,\n Symbol m,\n ResultInfo resultInfo,\n List<Type> argtypes,\n List<Type> typeargtypes,\n boolean allowBoxing,\n boolean use...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parses Accept header @param string $accept Accept header @return float[] With 'type' => priority Keys may contain '*'
[ "public static function parseAccept(string $accept)\n {\n $result = [];\n\n foreach (explode(',', $accept) as $directive) {\n $parts = explode(';', $directive, 2);\n\n $type = trim($parts[0]);\n\n $priority = ((float) filter_var(\n $parts[1] ?? 1,\n ...
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the sentence about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
:param inpaths: List of input file paths :param itype: Input type or None :param fmsg: message if it cannot detect otype by 'inpath' :return: Output type :: str
[ "def _output_type_by_input_path(inpaths, itype, fmsg):\n \n msg = (\"Specify inpath and/or outpath type[s] with -I/--itype \"\n \"or -O/--otype option explicitly\")\n if itype is None:\n try:\n otype = API.find(inpaths[0]).type()\n except API.UnknownFileTypeError:\n ...
[ "def _get_parsing_plan_for_multifile_children(self, obj_on_fs: PersistedObject, desired_type: Type[Any],\n logger: Logger) -> Dict[str, Any]:\n \n raise Exception('This should never happen, since this parser relies on underlying parsers')" ]
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Is given object <i>empty</i> (null or empty string)?
[ "protected boolean isEmpty(Object o) {\n\t\tif (o == null) {\n\t\t\treturn true;\n\t\t} else if (o instanceof String) {\n\t\t\treturn !StringUtils.hasText((String) o);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Resets all draft achievements for all players. This method is only available to user accounts for your developer console. (achievements.resetAllForAllPlayers) @param array $optParams Optional parameters.
[ "public function resetAllForAllPlayers($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('resetAllForAllPlayers', array($params));\n }" ]
[ "def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
_inherit_context(self, node) -> list Scan ancestors of attribute and namespace context. Used only for single element node canonicalization, not for subset canonicalization.
[ "def _inherit_context(self, node):\n ''''''\n\n # Collect the initial list of xml:foo attributes.\n xmlattrs = filter(_IN_XML_NS, _attrs(node))\n\n # Walk up and get all xml:XXX attributes we inherit.\n inherited, parent = [], node.parentNode\n while parent and parent.nodeT...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github instruction about Go programming language:", "pos": "Represent the Github code about Go programming language:", "neg": "Represent the Github code:" }
Append the provided string quoted or unquoted if it is <code>null</code>. @param aTarget The target to write to. May not be <code>null</code>. @param sSource Source string. May be <code>null</code>. @see #getQuoted(String) @since 9.2.0
[ "public static void appendQuoted (@Nonnull final StringBuilder aTarget, @Nullable final String sSource)\n {\n if (sSource == null)\n aTarget.append (\"null\");\n else\n aTarget.append ('\\'').append (sSource).append ('\\'');\n }" ]
[ "public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about writing:" }
Transforms string (from database) -> File @param mixed $value @return array|mixed|null
[ "public function transform($value)\n {\n if (is_array($value)) {\n $value = $value[FileType::UPLOAD_FIELDNAME];\n }\n\n try {\n return array(\n FileType::UPLOAD_FIELDNAME => new File(call_user_func($this->callback, $value, $this->property))\n )...
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// GetBody returns the value of Body if it is set or its // zero value if it is unset.
[ "func (v *RPC) GetBody() (o []byte) {\n\tif v != nil && v.Body != nil {\n\t\treturn v.Body\n\t}\n\n\treturn\n}" ]
[ "private void init() {\n // defaults for internal bookkeeping\n index = 0; // internal index always starts at 0\n count = 1; // internal count always starts at 1\n status = null; // we clear status on release()\n item = null; // item w...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
// recv is necessary to receive errors from the // server, otherwise no errors will be propagated
[ "func (k *streamKeepAliver) recv() {\n\terr := k.stream.RecvMsg(&empty.Empty{})\n\tk.closeWithError(trail.FromGRPC(err))\n}" ]
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns a collection of userland configuration files (including path). @author Benjamin Carl <opensource@clickalicious.de> @return array Collection of userland configuration files @static
[ "protected static function retrieveUserlandConfigurationFiles()\n {\n $appEnvironment = self::$registry->getParameter('doozr.app.environment');\n $caching = self::$registry->getParameter('doozr.kernel.caching');\n $exists = null;\n $stale = false;\n $fil...
[ "public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n\n $parser->addSubcommand('makedocs', [\n 'description' => __('Crawl-generate fresh swagger file system documents for all entries found in the library.')\n ])\n ->addArgument('host', [\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
parse a <code>&lt;process-archive .../&gt;</code> element and add it to the list of parsed elements
[ "protected void parseProcessArchive(Element element, List<ProcessArchiveXml> parsedProcessArchives) {\n\n ProcessArchiveXmlImpl processArchive = new ProcessArchiveXmlImpl();\n\n processArchive.setName(element.attribute(NAME));\n processArchive.setTenantId(element.attribute(TENANT_ID));\n\n List<String> ...
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Whether the plugin is configured and requirements are met. @return bool
[ "public static function are_requirements_met() {\n $issuerid = get_config('fileconverter_googledrive', 'issuerid');\n if (empty($issuerid)) {\n return false;\n }\n\n $issuer = \\core\\oauth2\\api::get_issuer($issuerid);\n if (empty($issuer)) {\n return false;...
[ "@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 summarization about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about programming:" }
Внедряет зависимости от контекста в фабрику расширений шаблонизатора. @param IViewExtensionFactory $factory
[ "protected function injectContextToViewExtensionFactory(IViewExtensionFactory $factory)\n {\n if ($factory instanceof IContextAware) {\n $factory->clearContext();\n\n if ($this->hasContext()) {\n $factory->setContext($this->getContext());\n }\n }\n\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Get an activity object config. @param string $object The object name. @return KObjectConfig
[ "protected function _getConfig($object)\n {\n $config = new KObjectConfig();\n\n $method = '_' . strtolower($object) . 'Config';\n\n // Call config setter if any.\n if (method_exists($this, $method)) {\n $this->$method($config);\n }\n\n return $config;\n }"...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Get value {@link Long} value @param label target label @return {@link Long} value of the label. If it is not null.
[ "public Long getValueLong(String label) {\n PrimitiveObject o = getPrimitiveObject(VALUE, label, ObjectUtil.LONG, \"Long\");\n if (o == null) {\n return null;\n }\n return (Long) o.getObject();\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 sentence about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Disconnect and stop the event loop @return \React\Promise\Promise|\React\Promise\PromiseInterface
[ "public function stop()\n {\n $deferred = new Deferred();\n\n $onStop = $this->onStop;\n $onStop()\n ->then(function () use (&$deferred) {\n $this->ariClient->onClose(function () use (&$deferred) {\n $this->eventLoop->stop();\n ...
[ "private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Deletes the language with $id. @param int $id
[ "public function deleteLanguage($id)\n {\n try {\n return $this->innerGateway->deleteLanguage($id);\n } catch (DBALException $e) {\n throw new RuntimeException('Database error', 0, $e);\n } catch (PDOException $e) {\n throw new RuntimeException('Database erro...
[ "def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Set user status. @param int $id - userId @param string $presence - status @param string $sessionId - session id @throws InvalidArgumentException @throws Exception
[ "public function setPresence($id, $presence, $sessionId)\n {\n if ($this->isEmptyId($id)) {\n throw new InvalidArgumentException;\n }\n\n if (!in_array($presence, User::getPresences())) {\n throw new InvalidArgumentException;\n }\n\n if (!$sessionId) {\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 description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }