query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// update modifies the rep for bu via the supplied function.
[ "func (bu *Binutils) update(fn func(r *binrep)) {\n\tr := &binrep{}\n\tbu.mu.Lock()\n\tdefer bu.mu.Unlock()\n\tif bu.rep == nil {\n\t\tinitTools(r, \"\")\n\t} else {\n\t\t*r = *bu.rep\n\t}\n\tfn(r)\n\tbu.rep = r\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Gets a dataset. @param \Google\Cloud\AutoMl\V1beta1\GetDatasetRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "public function GetDataset(\\Google\\Cloud\\AutoMl\\V1beta1\\GetDatasetRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.automl.v1beta1.AutoMl/GetDataset',\n $argument,\n ['\\Google\\Cloud\\AutoMl\\V1beta1\\Dataset', 'decode'],\n $m...
[ "public function GetGroup(\\Google\\Cloud\\ErrorReporting\\V1beta1\\GetGroupRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup',\n $argument,\n ['\\Google\\Cloud\\ErrorReporting\\V1be...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// NewStochRsiWithSrcLen creates a Stochastic Relative Strength Indicator (StochRsi) for offline usage
[ "func NewStochRsiWithSrcLen(sourceLength uint, timePeriod int, fastKTimePeriod int, fastDTimePeriod int) (indicator *StochRsi, err error) {\n\tind, err := NewStochRsi(timePeriod, fastKTimePeriod, fastDTimePeriod)\n\n\t// only initialise the storage if there is enough source data to require it\n\tif sourceLength-uin...
[ "func NewDefaultSma() (indicator *Sma, err error) {\n\ttimePeriod := 10\n\treturn NewSma(timePeriod, gotrade.UseClosePrice)\n}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Walk traverses nodes // Walk is invoked recursively until v.EnterNode returns true
[ "func (n *ClassExtends) Walk(v walker.Visitor) {\n\tif v.EnterNode(n) == false {\n\t\treturn\n\t}\n\n\tif n.ClassName != nil {\n\t\tv.EnterChildNode(\"ClassName\", n)\n\t\tn.ClassName.Walk(v)\n\t\tv.LeaveChildNode(\"ClassName\", n)\n\t}\n\n\tv.LeaveNode(n)\n}" ]
[ "final Node<E> pred(Node<E> p) {\n Node<E> q = p.prev;\n // j2objc: q == p.prev == sentinel means node GC-unlinked\n return (sentinel() == q) ? last() : q;\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Logs a message to stderr only if verbose is enabled.
[ "def vlog(self, msg, *args):\n \"\"\"\"\"\"\n if self.verbose:\n self.log(msg, *args)" ]
[ "def get_modernrpc_logger(name):\n \"\"\"\"\"\"\n logger = logging.getLogger(name)\n if not logger_has_handlers(logger):\n # If logging is not configured in the current project, configure this logger to discard all logs messages.\n # This will prevent the 'No handlers could be found for logge...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Converts a {@link VAlarm} component to a vCal alarm property. @param valarm the component @param parent the component's parent @return the vCal alarm property or null if it cannot be converted
[ "private static VCalAlarmProperty convert(VAlarm valarm, ICalComponent parent) {\n\t\tVCalAlarmProperty property = create(valarm);\n\t\tif (property == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tproperty.setStart(determineStartDate(valarm, parent));\n\n\t\tDurationProperty duration = valarm.getDuration();\n\t\tif (d...
[ "public String getNotifierClass()\n {\n StringBuffer sb = new StringBuffer(getShortName());\n sb.append(\"Notifier\");\n\n //\n // If the event set declaration has any parameterized types, then include them on\n // the notifier class as well. Currently, these can only be param...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Checks whether the given file can be parsed by any parser.
[ "public boolean canParse(File file) {\n\t\tfor(XParser parser : XParserRegistry.instance().getAvailable()) {\n\t\t\tif(parser.canParse(file)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
/* Implementation to remove an item from the storage engine. @see YAHOO.util.Storage._removeItem
[ "function(key) {\n\t\t\t_engine.execute('BEGIN');\n\t\t\t_engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE key=\"' + eURI(key) + '\" AND location=\"' + eURI(this._location) + '\"');\n\t\t\t_engine.execute('COMMIT');\n\t\t\tthis._removeKey(key);\n\t\t}" ]
[ "function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
Sets the retry interval
[ "public void setRetryInterval(String retryInterval)\n {\n _retryInterval = (retryInterval == null ? null : Integer.valueOf(retryInterval));\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Is used to load server data, you have to run it manually !
[ "public function loadFromServer()\n {\n $this\n ->setUrl(Server::fullUrl($_SERVER))\n ->setBot(Server::detectBot($_SERVER));\n }" ]
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
==========================================================================
[ "public void delete_device_property(String name, String propname) throws DevFailed {\n\t\tdatabaseDAO.delete_device_property(this, name, propname);\n\t}" ]
[ "def closeEvent(self, event):\n \n\n self.save_config(self.gui_settings['gui_settings'])\n self.script_thread.quit()\n self.read_probes.quit()\n event.accept()\n\n print('\\n\\n======================================================')\n print('================= Closin...
codesearchnet
{ "query": "Represent the description about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
Executed prior to processing a request.
[ "def prepare(self, context):\n\t\t\"\"\"\"\"\"\n\t\tif __debug__:\n\t\t\tlog.debug(\"Assigning thread local request context.\")\n\t\t\n\t\tself.local.context = context" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Helper function to remove the branch and version information from the given value, which could be a single object or a list.
[ "def _strip_value(value, lookup='exact'):\n \n if lookup == 'in':\n stripped_value = [_strip_object(el) for el in value]\n else:\n stripped_value = _strip_object(value)\n return stripped_value" ]
[ "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 comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
:type geolocation: object_.Geolocation :rtype: dict
[ "def serialize(cls, geolocation):\n \n\n obj = {}\n\n cls.add_if_not_none(obj, cls._FIELD_LATITUDE, geolocation.latitude)\n cls.add_if_not_none(obj, cls._FIELD_LONGITUDE, geolocation.longitude)\n cls.add_if_not_none(obj, cls._FIELD_ALTITUDE, geolocation.altitude)\n cls.add_...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about AWS Route 53:", "pos": "Represent the Github code about AWS Route 53:", "neg": "Represent the Github code:" }
Return the member for the auto login hash @param string $hash The hash key @param bool $login Should the member be logged in? @return Member the matching member, if valid @return Member
[ "public static function member_from_autologinhash($hash, $login = false)\n {\n /** @var Member $member */\n $member = static::get()->filter([\n 'AutoLoginHash' => $hash,\n 'AutoLoginExpired:GreaterThan' => DBDatetime::now()->getValue(),\n ])->first();\n\n if ($lo...
[ "public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
TODO: Dynamically load UDFs
[ "private void registerUDFs() {\n DateParseUDF.register(this.mHiveContext);\n DateTimeExtractUDF.register(this.mHiveContext);\n DateUDF.registerUDFs(this.mHiveContext);\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:" }
session in listening (server) mode. Called by the Activity onResume()
[ "public synchronized void start(boolean isAndroid) {\n // Cancel any thread attempting to make a connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThr...
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Restore model of all {@link Bean}s currently live in the {@link Mvc#graph()} @Bundle savedState the saved state
[ "static void restoreState(Bundle savedState) {\n stateKeeper.bundle = savedState;\n\n MvcComponent root = getRootComponent();\n doRestoreState(root);\n\n stateKeeper.bundle = null;\n }" ]
[ "public void removeLinks(ServiceReference<D> declarationSRef) {\n D declaration = getDeclaration(declarationSRef);\n for (ServiceReference serviceReference : declaration.getStatus().getServiceReferencesBounded()) {\n // FIXME : In case of multiples Linker, we will remove the link of all the...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Convert gradients of image obtained using `get_image_grad` into image. This shows parts of the image that is most strongly activating the output neurons.
[ "def grad_to_image(gradient):\n \"\"\"\"\"\"\n gradient = gradient - gradient.min()\n gradient /= gradient.max()\n gradient = np.uint8(gradient * 255).transpose(1, 2, 0)\n gradient = gradient[..., ::-1]\n return gradient" ]
[ "def input_sensitivity(self, summarize=True):\n \n if not summarize:\n num_params = [0]\n parts = []\n def sum_params(x):\n if (not isinstance(x, CombinationKernel)) and isinstance(x, Kern):\n num_params[0] += 1\n pa...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Write the submission script. Return (script, num_flows_in_batch)
[ "def _get_script_nflows(self):\n \n flows_torun = [f for f in self.flows if not f.all_ok]\n if not flows_torun:\n return \"\", 0\n\n executable = [\n 'export _LOG=%s' % self.log_file.path,\n 'date1=$(date +\"%s\")',\n 'echo Running abirun.py in...
[ "def masters(self):\n \"\"\"\"\"\"\n fut = self.execute(b'MASTERS', encoding='utf-8')\n # TODO: process masters: we can adjust internal state\n return wait_convert(fut, parse_sentinel_masters)" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Converts the given value so that it can be hydrated by the hydrator. @param array|\Traversable|null $value The original value. @return \ArrayAccess|null Returns the value that should be hydrated.
[ "public function hydrate($value)\n {\n if ($this->nullable && $value === null) {\n return null;\n }\n\n $this->hasOneStrategy->setPrototypeStrategy($this->getPrototypeStrategy());\n $return = clone $this->arrayObjectPrototype;\n if (is_array($value) || $value instanc...
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software Development:" }
// Watch function watch the keys having `prefix` prefix, it watch all the keys when prefix is '*'. // it return a event channel. error wil be returned only when key is empty. // the return channel have the newest data with init action in it.
[ "func (w *BaseWatcher) Watch(prefix string, ctx context.Context) (<-chan *Event, error) {\n\tswitch prefix {\n\tcase \"\":\n\t\treturn nil, fmt.Errorf(\"empty key\")\n\tcase \"*\":\n\t\treturn w.Sender.Watch(\"\", ctx), nil\n\tdefault:\n\t\treturn w.Sender.Watch(prefix, ctx), nil\n\t}\n}" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *BatchGetRepositoriesInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"BatchGetRepositoriesInput\"}\n\tif s.RepositoryNames == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RepositoryNames\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* gcloud compute images create example-image --source-disk example-disk --source-disk-zone ZONE Can do this with the command line utility, but not with the API Partially implemented code to do it with the API once it catches up...
[ "@Override\n public MachineImage capture(@Nonnull ImageCreateOptions options, @Nullable AsynchronousTask<MachineImage> task) throws CloudException, InternalException {\n Compute gce = provider.getGoogleCompute();\n ServerSupport server = new ServerSupport(provider);\n Image imageContent = ne...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewWorker returns a Worker that tracks the validity of the Model's cloud // credential, as exposed by the Facade.
[ "func NewWorker(config Config) (worker.Worker, error) {\n\tif err := config.Validate(); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tmc, err := modelCredential(config.Facade)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\t// This worker needs to monitor both the changes to the credenti...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get the angle between the three pharmacophore groups that make up the constraint. @return The angle in degrees between the two groups
[ "public double getBondLength() {\n double epsilon = 1e-3;\n PharmacophoreAtom atom1 = (PharmacophoreAtom) getAtom(0);\n PharmacophoreAtom atom2 = (PharmacophoreAtom) getAtom(1);\n PharmacophoreAtom atom3 = (PharmacophoreAtom) getAtom(2);\n\n double a2 = atom3.getPoint3d().distance...
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the Github instruction about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code:" }
// SetDomainIAMRoleName sets the DomainIAMRoleName field's value.
[ "func (s *RestoreDBInstanceToPointInTimeInput) SetDomainIAMRoleName(v string) *RestoreDBInstanceToPointInTimeInput {\n\ts.DomainIAMRoleName = &v\n\treturn s\n}" ]
[ "def lambda_handler(event, context):\n # incoming token value\n token = event['authorizationToken']\n print(\"Method ARN: \" + event['methodArn'])\n\n '''\n \n '''\n principalId = 'user|a1b2c3d4'\n\n '''\n You can send a 401 Unauthorized response to the client by failing like so:\n\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
List all known metrics
[ "def list():\n ''''''\n for cls, metrics in metric_catalog.items():\n echo(white(cls.__name__))\n\n for metric in metrics.keys():\n echo('> {0}'.format(metric))" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetMaxLogFileSize sets the maximal size of the info log file. // // If the log file is larger than `max_log_file_size`, a new info log // file will be created. // If max_log_file_size == 0, all logs will be written to one log file. // Default: 0
[ "func (opts *Options) SetMaxLogFileSize(value int) {\n\tC.rocksdb_options_set_max_log_file_size(opts.c, C.size_t(value))\n}" ]
[ "func (f *RecordFlags) AddFlags(cmd *cobra.Command) {\n\tif f == nil {\n\t\treturn\n\t}\n\n\tif f.Record != nil {\n\t\tcmd.Flags().BoolVar(f.Record, \"record\", *f.Record, \"Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Generic method that posts a plugin to the metrics website
[ "private void postPlugin(final boolean isPing) throws IOException {\n String serverVersion = getFullServerVersion();\n int playersOnline = getPlayersOnline();\n\n // END server software specific section -- all code below does not use any code outside of this class / Java\n\n // Construct...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param $class @return string @throws \InvalidArgumentException
[ "private function getFullyQualifiedName($class)\n {\n if (class_exists($class)) {\n return $class;\n }\n\n //determine if class belongs to the default namespace\n if (class_exists($this->defaultNamespace . '\\\\' . $class)) {\n return $this->defaultNamespace . '\...
[ "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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
/* create_field() Create the HTML interface for your field @type action @since 3.6 @date 23/01/13 @param $field - an array holding all the field's data
[ "function create_field( $field )\n\t{\n\t\t// vars\n\t\t$single_name = $field['name'];\n\t\t\t\n\t\t\t\n\t\t// multi select?\n\t\tif( $field['field_type'] == 'multi_select' )\n\t\t{\n\t\t\t$field['multiple'] = 1;\n\t\t\t$field['field_type'] = 'select';\n\t\t\t$field['name'] .= '[]';\n\t\t}\n\t\telseif( $field['fiel...
[ "function Api(config) {\n // config\n this._config = config || {};\n this._config.transforms = _.merge(this._config.transforms || {},{\n defaults: {\n serialize: JSON.stringify,\n deserialize: JSON.parse\n }\n });\n\n this._config.headers = this._config.headers || {};\n\n // stack of [('one' |...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Get the matching encoder for the given encoding @param encoding Encoding @return Matching encoder
[ "protected IEncoder getAppliedEncoder(DataUrlEncoding encoding) {\n switch (encoding) {\n case BASE64:\n return base64Encoder;\n case URL:\n return urlEncodedEncoder;\n }\n throw new IllegalArgumentException();\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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Include class corresponding to given class file in package, unless (1) we already have one the same kind (.class or .java), or (2) we have one of the other kind, and the given class file is older.
[ "protected void includeClassFile(PackageSymbol p, JavaFileObject file) {\n if ((p.flags_field & EXISTS) == 0)\n for (Symbol q = p; q != null && q.kind == PCK; q = q.owner)\n q.flags_field |= EXISTS;\n JavaFileObject.Kind kind = file.getKind();\n int seen;\n if (...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Send a GET request to a URL @param string $url URL to send the GET request to @param array $headers additional headers to send @param mixed $parameters parameters to send in the querystring @return \Ws\Http\Response
[ "public static function get($url, $headers = [], $parameters = null)\n {\n return Request::create('default')->get($url, $headers, $parameters);\n }" ]
[ "protected function prepareBody(array $query)\n {\n $method = isset($query['from']['method']) ? $query['from']['method'] : null;\n\n if ($method === 'POST') {\n // The query grammar already parsed the body for us.\n // We return the value of the query and guzzle does the rest....
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about PHP:" }
Create an instance of {@link JAXBElement }{@code <} {@link CmisAccessControlListType }{@code >}
[ "@XmlElementDecl(namespace = \"http://docs.oasis-open.org/ns/cmis/messaging/200908/\", name = \"removeACEs\", scope = CreateItem.class)\r\n\tpublic JAXBElement<CmisAccessControlListType> createCreateItemRemoveACEs(\r\n\t\t\tCmisAccessControlListType value) {\r\n\t\treturn new JAXBElement<CmisAccessControlListType>(...
[ "@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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
remove board. :param board_id: board id (e.g. 'diecimila') :rtype: None
[ "def remove_board(board_id):\n \n\n log.debug('remove %s', board_id)\n lines = boards_txt().lines()\n lines = filter(lambda x: not x.strip().startswith(board_id + '.'), lines)\n boards_txt().write_lines(lines)" ]
[ "def invalidate_and_update_screen(self, screen_id):\n \n if not isinstance(screen_id, baseinteger):\n raise TypeError(\"screen_id can only be an instance of type baseinteger\")\n self._call(\"invalidateAndUpdateScreen\",\n in_p=[screen_id])" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Extract Bookmark object from $row. @param array $row @return \eZ\Publish\SPI\Persistence\Bookmark\Bookmark
[ "private function extractBookmarkFromRow(array $row): Bookmark\n {\n $bookmark = new Bookmark();\n $bookmark->id = (int)$row['id'];\n $bookmark->name = $row['name'];\n $bookmark->userId = (int)$row['user_id'];\n $bookmark->locationId = (int)$row['node_id'];\n\n return $b...
[ "public function choices(): HasMany\n {\n return $this->hasMany(\\Iocaste\\Microservice\\Foundation\\Data\\Models\\Parameter\\Choice::class);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Internally used to accept input from the user. Plays pre prompt messages, prompt, and waits for a complete input or cancel. @return void
[ "protected function doInput()\n {\n /* @var $result IReadResult */\n $this->resetInput();\n $this->inputAttemptsUsed++;\n $result = $this->playPrePromptMessages();\n if (!$this->acceptPrePromptInputAsInput) {\n $result = $this->playPromptMessages();\n if (...
[ "def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Returns instance of parsed parameters.
[ "private function getParameters() : Parameters\n\t{\n\t\tif ($this->parameters === NULL) {\n\t\t\t$this->parameters = new Parameters(Parameters::parseParameters($this->method));\n\t\t}\n\n\t\treturn $this->parameters;\n\t}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Open the SIGRES file located in the in self.outdir. Returns :class:`SigresFile` object, None if file could not be found or file is not readable.
[ "def open_sigres(self):\n \n sigres_path = self.sigres_path\n\n if not sigres_path:\n logger.critical(\"%s didn't produce a SIGRES file in %s\" % (self, self.outdir))\n return None\n\n # Open the SIGRES file and add its data to results.out\n from abipy.electr...
[ "def getMetadata(L):\n \n _l = {}\n try:\n # Create a copy. Do not affect the original data.\n _l = copy.deepcopy(L)\n # Remove values fields\n _l = rm_values_fields(_l)\n except Exception as e:\n # Input likely not formatted correctly, though other problems can occur....
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Computer Science:" }
* @param $str_xml @return PagSeguroInstallment
[ "public static function readInstallments($str_xml)\n {\n\n // Parser\n $parser = new PagSeguroXmlParser($str_xml);\n \n \n // <installment>\n $data = $parser->getResult('installments');\n \n \n // <installment><installments>\n if (isset($data)...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Put a numeric field into map. @param field a field to be added into map or replace already exists one, it must not be null @throws NullPointerException if the field is null or if it is an anonymous field
[ "public void putField(final JBBPNumericField field) {\n JBBPUtils.assertNotNull(field, \"Field must not be null\");\n final JBBPNamedFieldInfo fieldName = field.getNameInfo();\n JBBPUtils.assertNotNull(fieldName, \"Field name info must not be null\");\n this.fieldMap.put(fieldName, field);\n }" ]
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get related category. @return \Illuminate\Database\Eloquent\Model|\Yajra\CMS\Entities\Article
[ "public function category()\n {\n $category = $this->param('category_id', 0);\n $categoryId = explode(':', $category)[0];\n\n return Category::query()->findOrNew($categoryId);\n }" ]
[ "public function choices(): HasMany\n {\n return $this->hasMany(\\Iocaste\\Microservice\\Foundation\\Data\\Models\\Parameter\\Choice::class);\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Retrieve Search Query for a category @param ContainerConfigurationInterface $containerConfigurationInterface Container Configuration @param CategoryInterface $category Category @return QueryInterface
[ "public function getCategorySearchQuery(\n ContainerConfigurationInterface $containerConfigurationInterface,\n CategoryInterface $category\n ) {\n $filters = array_merge(\n ['category' => $this->categoryFilterProvider->getQueryFilter($category)],\n $containerConfigurati...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
touch: function (sid, sess, callback) { this.set(sid, sess, callback); },
[ "function (sid, callback) {\n this.sessions.findOne({\n _id: sid,\n $or: [\n { expires: { $exists: false } },\n { expires: { $gt: new Date() } }\n ]\n }, function (err, session_data) {\n if (err) {\n if (callback) callback(err);\n return;\n }\n session...
[ "function handleRefreshResponse (key, data, err, response) {\n if(!err) {\n this.set(key, response, (data.lifeSpan / 1000), data.refresh, function(){});\n }\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
关闭订单 @param closeorder closeorder @param key 商户支付密钥 @return MchBaseResult
[ "public static MchBaseResult payCloseorder(Closeorder closeorder,String key){\n\t\tMap<String,String> map = MapUtil.objectToMap(closeorder);\n\t\tString sign = SignatureUtil.generateSign(map,closeorder.getSign_type(),key);\n\t\tcloseorder.setSign(sign);\n\t\tString closeorderXML = XMLConverUtil.convertToXML(closeor...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Sets new configuration for the loader @param ConfigInterface|array $config @return $this
[ "public function setConfig($config)\n {\n $configObject = $this->getConfig();\n\n if (is_object($config)) {\n $config = get_object_vars($config);\n }\n\n foreach ((array)$config as $key => $value) {\n $configObject->$key = $value;\n }\n\n return $th...
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
add attributes to segment nodes, as well as edges to/from other segments/groups. add segment to list of EDUs. Parameters ---------- segment : ??? etree Element
[ "def __add_segment(self, segment):\n \n segment_id = self.ns+':'+segment.attrib['id']\n self.edus.append(segment_id) # store RST segment in list of EDUs\n\n # A URML file can be tokenized, partially tokenized or not tokenized\n # at all. The \"tokenized tokens\" in the URML file ...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param $groups @param array $constraints @return array Replaces validation groups in constraints
[ "protected function replaceGroups($groups, array $constraints)\n {\n if (!\\is_array($groups)) {\n $groups = [$groups];\n }\n\n /** @var \\Symfony\\Component\\Validator\\Constraint $constraint */\n foreach ($constraints as &$constraint) {\n $constraint->groups = ...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Show all items. @return void
[ "public function getTaggedQuestions($tag)\n {\n $question = new Question($this->di->get(\"db\"));\n\n $questions = $question->getQuestions();\n\n\n\n $filteredQuestions = array_filter($questions, function ($value) use ($tag) {\n return in_array($tag, $value->tags);\n });\n\...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// matchProperty implements PhysicalPlan matchProperty interface.
[ "func (p *PhysicalUnionScan) matchProperty(prop *requiredProperty, childPlanInfo ...*physicalPlanInfo) *physicalPlanInfo {\n\tlimit := prop.limit\n\tres := p.GetChildByIndex(0).(PhysicalPlan).matchProperty(convertLimitOffsetToCount(prop), childPlanInfo...)\n\tnp := *p\n\tnp.SetChildren(res.p)\n\tres.p = &np\n\tif l...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetDefaultInterfaces returns IfAddrs of the addresses attached to the default // route.
[ "func GetDefaultInterfaces() (IfAddrs, error) {\n\tri, err := NewRouteInfo()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefaultIfName, err := ri.GetDefaultInterfaceName()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar defaultIfs, ifAddrs IfAddrs\n\tifAddrs, err = GetAllInterfaces()\n\tfor _, ifAddr :=...
[ "public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {\n routes.put(nm, links); // Only one route between two nodes (replace the old route)\n }" ]
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, it is made to fit the screen according to the dimensions of the previous image matrix. This allows the image to maintain its zoom after rotation.
[ "private void fitImageToView() {\n Drawable drawable = getDrawable();\n if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) {\n return;\n }\n if (matrix == null || prevMatrix == null) {\n return;\n }\n\n int...
[ "function (containerWidth, containerHeight, imageSizes) {\n\n var devicePixelRatio = window.devicePixelRatio || 1;\n var deviceOrientation = getDeviceOrientation();\n var windowOrientation = getWindowOrientation();\n var wrapperOrientation = (containerHeight > containerWidth) ?\n 'portrai...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Science:" }
// FlatHandleHandler returns a flatchain that wraps a http.Handler
[ "func FlatHandleHandler(methods, pattern string, r http.Handler, lg *log.Logger) FlatChains {\n\treturn FlatRoute(methods, pattern, FlatHandlerWrap(r), lg)\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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewNoteAclTeamLinkType returns a new NoteAclTeamLinkType instance
[ "func NewNoteAclTeamLinkType(Description string) *NoteAclTeamLinkType {\n\ts := new(NoteAclTeamLinkType)\n\ts.Description = Description\n\treturn s\n}" ]
[ "@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// Normalize returns an error iff this GraphQuery is not valid.
[ "func (g *GraphQuery) Normalize() error {\n\tif err := g.AttemptList.Normalize(); err != nil {\n\t\treturn err\n\t}\n\tif len(g.AttemptRange) > 0 {\n\t\tlme := errors.NewLazyMultiError(len(g.AttemptRange))\n\t\tfor i, rng := range g.AttemptRange {\n\t\t\tlme.Assign(i, rng.Normalize())\n\t\t}\n\t\tif err := lme.Get(...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retrieves the cookie domain in the application with the provided cookieName. If the cookie doesn't exist, a null value will be returned. @param expectedCookieName - the name of the cookie @return String - the domain of the cookie
[ "public String cookieDomain(String expectedCookieName) {\n Cookie cookie = cookie(expectedCookieName);\n if (cookie != null) {\n return cookie.getDomain();\n }\n return null;\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Update the job with details about the file split @param job the job configuration to update @param inputSplit the file split
[ "private void updateJobWithSplit(final JobConf job, InputSplit inputSplit) {\n if (inputSplit instanceof FileSplit) {\n FileSplit fileSplit = (FileSplit) inputSplit;\n job.set(\"map.input.file\", fileSplit.getPath().toString());\n job.setLong(\"map.input.start\", fileSplit.getStart());\n job....
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Override base function to suite Bootstrap 3 alert naming. @param $messages - message text @param $type - message type: success, info, warning, error @return string
[ "public function wrapMessages($messages, $type)\n {\n $type = ($type == 'info') ? 'primary' : $type;\n\n return sprintf($this->getWrapper(), $type, $messages);\n }" ]
[ "function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n // Validating the options\n this.options.text = options.text || \"Hi there!\"; // Display message\n thi...
codesearchnet
{ "query": "Represent the summarization about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Computer Science:" }
// DeserializeCellBlocks deserializes mutate result from cell blocks
[ "func (m *Mutate) DeserializeCellBlocks(pm proto.Message, b []byte) (uint32, error) {\n\tresp := pm.(*pb.MutateResponse)\n\tif resp.Result == nil {\n\t\t// TODO: is this possible?\n\t\treturn 0, nil\n\t}\n\tcells, read, err := deserializeCellBlocks(b, uint32(resp.Result.GetAssociatedCellCount()))\n\tif err != nil {...
[ "@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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Converts the value into object if needed. @param int $index
[ "private function internalDataListUpdateValueIfNeeded(&$data, $index)\n {\n $value = $data[$index];\n if (is_callable($value)) {\n $value = call_user_func($value);\n $data[$index] = $value;\n }\n if (is_object($value)) {\n return $value;\n }\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns the path to the {@link Pipeline} configuration for this environment. Uses the same path and filename as the capistrano config, but with .yml extension. @return string
[ "public function getPipelineFilename() {\n\t\t$name = $this->getConfigFilename();\n\t\tif(!$name) return null;\n\t\t$path = pathinfo($name);\n\t\tif($path) return $path['dirname'] . '/' . $path['filename'] . '.yml';\n\t}" ]
[ "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 comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Bingham statistics lookup table.
[ "def binglookup(w1i, w2i):\n \n K = {'0.06': {'0.02': ['-25.58', '-8.996'], '0.06': ['-9.043', '-9.043'], '0.04': ['-13.14', '-9.019']}, '0.22': {'0.08': ['-6.944', '-2.644'], '0.02': ['-25.63', '-2.712'], '0.20': ['-2.649', '-2.354'], '0.06': ['-9.027', '-2.673'], '0.04': ['-13.17', '-2.695'], '0.14': ['-4.0...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Check to see whether actual_seq has same elements as expected_seq. Args: actual_seq: sequence Returns: bool
[ "def equals(self, actual_seq):\n \n\n try:\n expected = dict([(element, None) for element in self._expected_seq])\n actual = dict([(element, None) for element in actual_seq])\n except TypeError:\n # Fall back to slower list-compare if any of the objects are unhashable.\n expected = list...
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Return a new instance of {@code {@link BeadledomWebTarget}} with the given URI path by using the default builder implementation on the classpath found using SPI.
[ "public BeadledomWebTarget buildTarget(URI baseUrl) {\n BeadledomClient beadledomClient = build();\n return beadledomClient.target(baseUrl);\n }" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(DeleteApnsChannelRequest deleteApnsChannelRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteApnsChannelRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.ma...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Recursively remove any empty replacement values in the response array. @param array $input @return array
[ "protected function recursivelyRemoveEmptyReplacements(array $input)\n {\n foreach ($input as &$value) {\n if (is_array($value)) {\n $value = $this->recursivelyRemoveEmptyReplacements($value);\n }\n }\n\n return array_filter($input, function ($value) {\n ...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
First, check for JSON support If there is no JSON, we no-op the core features of Raven since JSON is required to encode the payload
[ "function Raven() {\n this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);\n // Raven can run in contexts where there's no document (react-native)\n this._hasDocument = !isUndefined(_document);\n this._hasNavigator = !isUndefined(_navigator);\n this._lastCapturedException = null;\n this._lastData =...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// pastActiveDeadline checks if job has ActiveDeadlineSeconds field set and if it is exceeded.
[ "func pastActiveDeadline(job *batch.Job) bool {\n\tif job.Spec.ActiveDeadlineSeconds == nil || job.Status.StartTime == nil {\n\t\treturn false\n\t}\n\tnow := metav1.Now()\n\tstart := job.Status.StartTime.Time\n\tduration := now.Time.Sub(start)\n\tallowedDuration := time.Duration(*job.Spec.ActiveDeadlineSeconds) * t...
[ "def can_pull(self, initial, scheduled):\n \n if not initial and self.config.is_valid_schedule():\n # if the config has a valid schedule, return True if this is a scheduled run\n return scheduled\n return True" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
// Do applies f to itself. This is because Row is a flux.ColReader. // It is used to implement flux.Table.
[ "func (r *queryTable) Do(f func(flux.ColReader) error) error {\n\treturn f(r)\n}" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// UnmarshalJSON sets the object from the provided JSON representation
[ "func (l *EC2LaunchTemplateTagSpecificationList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := EC2LaunchTemplateTagSpecification{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = EC2LaunchTemplateTagSpecificationList{item}...
[ "@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:" }
// SetDashConfiguration sets the DashConfiguration field's value.
[ "func (s *PlaybackConfiguration) SetDashConfiguration(v *DashConfiguration) *PlaybackConfiguration {\n\ts.DashConfiguration = 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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// keyValueInstruction builds a Dockerfile instruction from the mapping m. Keys // and values are serialized as JSON strings to ensure compatibility with the // Dockerfile parser. Syntax: // COMMAND "KEY"="VALUE" "may"="contain spaces"
[ "func keyValueInstruction(cmd string, m []KeyValue) (string, error) {\n\ts := []string{strings.ToUpper(cmd)}\n\tfor _, kv := range m {\n\t\t// Marshal kv.Key and kv.Value as JSON strings to cover cases\n\t\t// like when the values contain spaces or special characters.\n\t\tk, err := json.Marshal(kv.Key)\n\t\tif err...
[ "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 Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Prepare the executor for shutdown. @param respMap json response object
[ "private void shutdown(final Map<String, Object> respMap) {\n try {\n logger.warn(\"Shutting down executor...\");\n\n // Set the executor to inactive. Will receive no new flows.\n setActiveInternal(false);\n this.application.shutdown();\n respMap.put(ConnectorParams.STATUS_PARAM, Connect...
[ "@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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
3-loop computation of alpha_s for f flavours with initial condition alpha_s(MZ) = 0.1185
[ "def alpha_s(scale, f, alphasMZ=0.1185, loop=3):\n \"\"\"\"\"\"\n if scale == MZ and f == 5:\n return alphasMZ # nothing to do\n _sane(scale, f)\n crd = rundec.CRunDec()\n if f == 5:\n return_value = crd.AlphasExact(alphasMZ, MZ, scale, f, loop)\n elif f == 6:\n crd.nfMmu.Mth...
[ "def tau3_from_mass1_mass2(mass1, mass2, f_lower):\n \n \"\"\"\n mtotal = mass1 + mass2\n eta = eta_from_mass1_mass2(mass1, mass2)\n return tau3_from_mtotal_eta(mtotal, eta, f_lower)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer programming or scientific field:" }
Update the current message of the service task related to the given wave. @param wave the wave that trigger the service task call @param message the current message of the service task processed
[ "public void updateMessage(final Wave wave, final String message) {\n\n // Update the current task message\n JRebirth.runIntoJAT(\"Service Task Mesage => \" + message,\n () -> wave.get(JRebirthWaves.SERVICE_TASK).updateMessage(message));\n }" ]
[ "def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Create a function which can be used to create ClientStreamingCall @param Channel|InterceptorChannel $channel @param callable $deserialize A function that deserializes the response @return \Closure
[ "private function _StreamUnaryCallFactory($channel)\n {\n if (is_a($channel, 'Grpc\\Internal\\InterceptorChannel')) {\n return function ($method,\n $deserialize,\n array $metadata = [],\n array $options = []) us...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// Next implements the Iterator interface.
[ "func (it *Iterator4Chunk) Next() Row {\n\tif it.cursor >= it.numRows {\n\t\tit.cursor = it.numRows + 1\n\t\treturn it.End()\n\t}\n\trow := it.chk.GetRow(int(it.cursor))\n\tit.cursor++\n\treturn row\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Converts the map format of the environment variables to the K=V format in the array.
[ "@Nonnull\n public static String[] mapToEnv(@Nonnull Map<String,String> m) {\n String[] r = new String[m.size()];\n int idx=0;\n\n for (final Map.Entry<String,String> e : m.entrySet()) {\n r[idx++] = e.getKey() + '=' + e.getValue();\n }\n return r;\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:" }
<p> The list of abort criteria to define rules to abort the job. </p> @param criteriaList The list of abort criteria to define rules to abort the job.
[ "public void setCriteriaList(java.util.Collection<AbortCriteria> criteriaList) {\n if (criteriaList == null) {\n this.criteriaList = null;\n return;\n }\n\n this.criteriaList = new java.util.ArrayList<AbortCriteria>(criteriaList);\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Required validator Validates if the attribute is required or not This can be specified as either a boolean value or a function that returns a boolean value
[ "function(value, attr, required, model, computed) {\n var isRequired = _.isFunction(required) ? required.call(model, value, attr, computed) : required;\n if(!isRequired && !hasValue(value)) {\n return false; // overrides all other validators\n }\n if (isRequired && !hasValue(val...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetTags sets the Tags field's value.
[ "func (s *CreateRelationalDatabaseFromSnapshotInput) SetTags(v []*Tag) *CreateRelationalDatabaseFromSnapshotInput {\n\ts.Tags = v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
=========================================================================
[ "public static function getSelectOptions ()\n\t{\n\t\treturn [\n\t\t\t['optgroup' => SimpleMap::t('Open Source')],\n\n\t\t\tself::Wikimedia => SimpleMap::t('Wikimedia'),\n\n\t\t\tself::OpenStreetMap => SimpleMap::t('OpenStreetMap'),\n\n\t\t\tself::CartoVoyager => SimpleMap::t('Carto: Voyager'),\n\t\t\tself::CartoPo...
[ "public static function protect()\n\t{\n\t\t$eye = \\Cli::color(\"*\", 'green');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"PROTECT ALL HUMANS\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli:...
codesearchnet
{ "query": "Represent the Github summarization about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code about Programming:" }
Set the phenotype_label column according to our rules for mutual exclusion
[ "def fill_phenotype_label(self,inplace=False):\n \n def _get_phenotype(d):\n vals = [k for k,v in d.items() if v == 1]\n return np.nan if len(vals) == 0 else vals[0]\n if inplace:\n if self.shape[0] == 0: return self\n self['phenotype_label'] = self....
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns an array of countries @return array
[ "protected function getListCountry()\n {\n $conditions = $this->query_filter;\n $conditions['limit'] = $this->data_limit;\n\n return (array) $this->country->getList($conditions);\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 instruction about database:", "pos": "Represent the code about database:", "neg": "Represent the code about programming:" }
Declare an environment variable which is linked to the given Bootique variable, and has its name defined from the name of the Bootique variable. @param bootiqueVariable the name of the bootique variable. @return the Bootique extender.
[ "public VariableDecls declareVar(String bootiqueVariable) {\n\t\tthis.extender.declareVar(bootiqueVariable, VariableNames.toEnvironmentVariableName(bootiqueVariable));\n\t\treturn this;\n\t}" ]
[ "private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Gets the tag size. @param tag the tag @return the tag size
[ "private int getTagSize(TagValue tag) {\n int n = tag.getCardinality();\n int id = tag.getId();\n\n // Calculate tag size\n int type = tag.getType();\n\n if (id == 330) {\n // SubIFD\n n = 1000;\n }\n if (id == 700) {\n // XMP\n if (tag.getValue().size() > 0)\n n = ta...
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// durationToTimespec prepares a timeout value
[ "func durationToTimespec(d time.Duration) unix.Timespec {\n\treturn unix.NsecToTimespec(d.Nanoseconds())\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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Gets the current window width. @returns {Number|number} The current window width in pixel.
[ "function() {\n return window.innerWidth || document.documentElement[LEXICON.cW] || document.body[LEXICON.cW];\n }" ]
[ "function () {\n Layer.call(this, \"ScreenCreditController\");\n\n /**\n * An {@link Offset} indicating where to place the attributions on the screen.\n * @type {Offset}\n * @default The lower left corner of the window with an 11px left margin and a 2px bott...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see org.jsmpp.PDUSender#sendUnbind(java.io.OutputStream, int)
[ "public byte[] sendUnbind(OutputStream os, int sequenceNumber)\n throws IOException {\n byte[] b = pduComposer.unbind(sequenceNumber);\n writeAndFlush(os, b);\n return b;\n }" ]
[ "protected void sendMergeResponse(Address sender, View view, Digest digest, MergeId merge_id) {\n Message msg=new Message(sender).setBuffer(GMS.marshal(view, digest)).setFlag(Message.Flag.OOB,Message.Flag.INTERNAL)\n .putHeader(gms.getId(), new GMS.GmsHeader(GMS.GmsHeader.MERGE_RSP).mergeId(merge_id...
codesearchnet
{ "query": "Represent the summarization about Java programming:", "pos": "Represent the code about Java programming:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(ListFacetAttributesRequest listFacetAttributesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listFacetAttributesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshal...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Normal selection, as opposed to text dragging.
[ "function leftButtonSelect(cm,event,start,behavior){var display=cm.display,doc=cm.doc;e_preventDefault(event);var ourRange,ourIndex,startSel=doc.sel,ranges=startSel.ranges;if(behavior.addNew&&!behavior.extend){ourIndex=doc.sel.contains(start);if(ourIndex>-1){ourRange=ranges[ourIndex];}else{ourRange=new Range(start,...
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Extracts the messages and translations from the MO file @throws \Aimeos\MW\Translation\Exception If file content is invalid @return array Associative list of original singular as keys and one or more translations as values
[ "protected function extract()\n\t{\n\t\t$magic = $this->readInt( 'V' );\n\n\t\tif( ( $magic === self::MAGIC1 ) || ( $magic === self::MAGIC3 ) ) { //to make sure it works for 64-bit platforms\n\t\t\t$byteOrder = 'V'; //low endian\n\t\t} elseif( $magic === ( self::MAGIC2 & 0xFFFFFFFF ) ) {\n\t\t\t$byteOrder = 'N'; //...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get a tile image, respecting current animations :param x: x coordinate :param y: y coordinate :param l: layer :type x: int :type y: int :type l: int :rtype: pygame.Surface
[ "def get_tile_image(self, x, y, l):\n \n # disabled for now, re-enable when support for generic maps is restored\n # # since the tile has been queried, assume it wants to be checked\n # # for animations sometime in the future\n # if self._animation_queue:\n # self._trac...
[ "def notify_update(self, x, y, width, height):\n \n if not isinstance(x, baseinteger):\n raise TypeError(\"x can only be an instance of type baseinteger\")\n if not isinstance(y, baseinteger):\n raise TypeError(\"y can only be an instance of type baseinteger\")\n if...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Return base entityKey in case of sub entity (for instance: returns car in car:hybrid) @param string $entityKey @return string
[ "protected function getBaseEntityKey(string $entityKey): string\n {\n if(($pos = strpos($entityKey, ':')) !== false) {\n return substr($entityKey, 0, $pos);\n }\n\n return $entityKey;\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetName sets the Name field's value.
[ "func (s *AlarmIdentifier) SetName(v string) *AlarmIdentifier {\n\ts.Name = &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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Deletes a file or a directory. If the target is a directory, it must be empty. @param string $path @return void @throws IoException If an error occurs.
[ "public static function delete(string $path) : void\n {\n $exception = null;\n\n try {\n $success = ErrorCatcher::run(static function() use ($path) {\n if (is_dir($path)) {\n return rmdir($path);\n }\n\n return unlink($path)...
[ "public function setSource(string $source)\n {\n if (!file_exists($source)) {\n throw new Server500(new \\ArrayObject(array(\"explain\" =>\n \"The source $source for the ZIP archive does not exist.\",\n \"Please check the source validity.\")));\n }\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Modify an entity before update @param LifecycleEventArgs $args
[ "public function preUpdate(LifecycleEventArgs $args) : void\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof UpdatedInterface) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Log an HTTP response. @param array|WP_Error $response The HTTP response. @param array $args HTTP request arguments. @param string $url The request URL.
[ "public function log_http_response( $response, array $args, $url ) {\n\t\t$this->data['http'][ $args['_qm_key'] ]['end'] = microtime( true );\n\t\t$this->data['http'][ $args['_qm_key'] ]['response'] = $response;\n\t\t$this->data['http'][ $args['_qm_key'] ]['args'] = $args;\n\t\tif ( isset( $args['_qm_origi...
[ "public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }