query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// WriteSSF writes an SSF span with a preceding v0 frame onto a stream // and returns the number of bytes written, as well as an error. // // If the error matches IsFramingError, the stream must be considered // poisoned and should not be re-used.
[ "func WriteSSF(out io.Writer, ssf *ssf.SSFSpan) (int, error) {\n\tpbuf := pbufPool.Get().(*proto.Buffer)\n\terr := pbuf.Marshal(ssf)\n\tif err != nil {\n\t\t// This is not a framing error, as we haven't written\n\t\t// anything to the stream yet.\n\t\treturn 0, err\n\t}\n\tdefer func() {\n\t\t// Make sure we reset ...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Transform the current region into a {@link GridGeometry2D}. @param crs the {@link CoordinateReferenceSystem} to apply. @return the gridgeometry.
[ "public GridGeometry2D getGridGeometry( CoordinateReferenceSystem crs ) {\n GridGeometry2D gridGeometry = CoverageUtilities.gridGeometryFromRegionParams(getRegionParams(), crs);\n return gridGeometry;\n }" ]
[ "public FeatureIndexResults queryFeatures(BoundingBox boundingBox, Projection projection) {\n\n if (projection == null) {\n projection = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);\n }\n\n // Query for features\n FeatureIndexManager indexMa...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Adds new properties to phing project with data about version number.
[ "private function setProjectVersionProperties()\n {\n if ($this->myVersionProperty)\n {\n $this->project->setProperty($this->myVersionProperty, $this->myNewVersion['version']);\n }\n\n if ($this->myReleaseProperty)\n {\n $this->project->setProperty($this->myReleaseProperty, $this->myNewVer...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Increments the position values of records with a lower position value than the given. Note that 'below' means a smaller position value. @param integer $position if null, uses this record's current position
[ "protected function incrementPositionsOfItemsBelow($position)\n {\n $this->listifyScopedQuery()\n ->where($this->positionColumn(), '>=', $position)\n ->increment($this->positionColumn());\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Download the content provided at URL url and store the result to a local file, using a temp file to cache the content in case something goes wrong in download @param url @param destination @throws IOException
[ "public static void downloadFile(URL url, File destination) throws IOException {\n\t\tint count = 0;\n\t\tint maxTries = 10;\n\t\tint timeout = 60000; //60 sec\n\n\t\tFile tempFile = File.createTempFile(getFilePrefix(destination), \".\" + getFileExtension(destination));\n\n\t\t// Took following recipe from stackove...
[ "def spec(self):\n \"\"\"\"\"\"\n from ambry_sources.sources import SourceSpec\n\n d = self.dict\n d['url'] = self.url\n\n # Will get the URL twice; once as ref and once as URL, but the ref is ignored\n\n return SourceSpec(**d)" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Converts the bytes into a string. @param str string bytes @return decoded String
[ "private final String bufferToString(byte[] str) {\n\t\tString string = null;\n\t\tif (str != null) {\n\t\t\tstring = AMF.CHARSET.decode(ByteBuffer.wrap(str)).toString();\n\t\t\tlog.debug(\"String: {}\", string);\n\t\t} else {\n\t\t\tlog.warn(\"ByteBuffer was null attempting to read String\");\n\t\t}\n\t\treturn st...
[ "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:" }
Setter for **self.__destination** attribute. :param value: Attribute value. :type value: unicode
[ "def destination(self, value):\n \n\n if value is not None:\n assert type(value) is unicode, \"'{0}' attribute: '{1}' type is not 'unicode'!\".format(\n \"destination\", value)\n self.__destination = value" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs)\n {\n Expression oldExpression = expression;\n expression = newExpression;\n if (eNotificationRequired())\n {\n ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimpleExpres...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github summarization about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
@param array $payload @return \Kerox\Messenger\Event\PaymentEvent
[ "public static function create(array $payload): self\n {\n $senderId = $payload['sender']['id'];\n $recipientId = $payload['recipient']['id'];\n $timestamp = $payload['timestamp'];\n $payment = Payment::create($payload['payment']);\n\n return new static($senderId, $recipientId,...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Get property name containing the cropping parameters @param mediaRequest Media request @return Property name @deprecated Use {@link #getMediaCropProperty(MediaRequest, MediaHandlerConfig)}
[ "@Deprecated\n protected final @NotNull String getMediaCropProperty(@NotNull MediaRequest mediaRequest) {\n return getMediaCropProperty(mediaRequest, null);\n }" ]
[ "public BoxRequestsFile.FilePreviewed getFilePreviewedRequest(String fileId) {\n return new BoxRequestsFile.FilePreviewed(fileId, getPreviewFileUrl(), mSession);\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Parses a PHP string. @param string $str @return PhpParser
[ "public function parseString($str) {\n $parser = (new \\PhpParser\\ParserFactory())->create(\\PhpParser\\ParserFactory::PREFER_PHP7);\n $this->ast = $parser->parse($str);\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Makes a normalized storable file instance from a local file path. @param string $path @param string|null $name @param string|null $mimeType @return StorableFileInterface
[ "public function makeFromLocalPath($path, $name = null, $mimeType = null)\n {\n $info = new SplFileInfo($path);\n\n return $this->makeFromFileInfo($info, $name, $mimeType);\n }" ]
[ "static function of($resource)\n {\n if (!is_resource($resource) && get_resource_type($resource) !== 'stream-context')\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Context Resource Passed, given: \"%s\".'\n , \\Poirot\\Std\\flatten($resource)\n ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// SignURL creates a time-expiring URL that can be shared with others. // This is useful to generate HTML links, for example.
[ "func (s *StorageClient) SignURL(input *SignURLInput) (*SignURLOutput, error) {\n\toutput := &SignURLOutput{\n\t\thost: s.Client.MantaURL.Host,\n\t\tobjectPath: fmt.Sprintf(\"/%s%s\", s.Client.AccountName, input.ObjectPath),\n\t\tMethod: input.Method,\n\t\tAlgorithm: strings.ToUpper(s.Client.Authorizers[...
[ "def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. o...
codesearchnet
{ "query": "Represent the Github post about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code:" }
/* Checks the target value for an embeded hex, rgb, or rgba string if found, returns the given value in hex otherwise it returns the provided value.
[ "function getValue(value) {\n\t\t//hex\n\t\tif (extractHexRegEx.test(value))\n\t\t{\n\t\t\treturn value.match(extractHexRegEx)[0];\n\t\t} \n\t\t//rgb \\ rgba\n\t\tvar rgba = value.match(rgbaExtractRegEx);\n\t\tif (rgba) {\n var red = parseInt(rgba[2], 10);\n var green = parseInt(rgba[3], 10);\...
[ "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 post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(GetKeyRotationStatusRequest getKeyRotationStatusRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (getKeyRotationStatusRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMars...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
脚步运行完后用,乱码为防止用户调用
[ "public static function _shutdown_write_H7alziM1dsOz0d84()\n {\n if (empty(self::$data)) {\n return true;\n }\n $config = Linker::Config()::get('lin')['log'];\n switch ($config['use']) {\n case 'sql':\n $Driver = new SQLHandler;\n $c...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about text processing:" }
Remove a child from this element. The child element is returned, and it's parentNode element is reset. If the child will not be used any more, you should call its unlink() method to promote garbage collection.
[ "def removeChild(self, child):\n\t\t\n\t\tfor i, childNode in enumerate(self.childNodes):\n\t\t\tif childNode is child:\n\t\t\t\tdel self.childNodes[i]\n\t\t\t\tchild.parentNode = None\n\t\t\t\treturn child\n\t\traise ValueError(child)" ]
[ "private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\...
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Maps given Content to a Document. @param \eZ\Publish\SPI\Persistence\Content $content @return \eZ\Publish\Core\Search\Elasticsearch\Content\Document
[ "public function mapContent(Content $content)\n {\n $locations = $this->locationHandler->loadLocationsByContent($content->versionInfo->contentInfo->id);\n $section = $this->sectionHandler->load($content->versionInfo->contentInfo->sectionId);\n $mainLocation = null;\n $locationDocument...
[ "protected function getLimitationByIdentifier($identifier)\n {\n switch ($identifier) {\n case APILimitation::CONTENTTYPE:\n return new \\eZ\\Publish\\API\\Repository\\Values\\User\\Limitation\\ContentTypeLimitation();\n\n case APILimitation::LANGUAGE:\n ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Writes the contents of the pool entry.
[ "void write(ByteCodeWriter out)\n throws IOException\n {\n out.write(ConstantPool.CP_NAME_AND_TYPE);\n out.writeShort(_nameIndex);\n out.writeShort(_descriptorIndex);\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
// SecretList returns the list of secrets.
[ "func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {\n\tif err := cli.NewVersionError(\"1.25\", \"secret list\"); err != nil {\n\t\treturn nil, err\n\t}\n\tquery := url.Values{}\n\n\tif options.Filters.Len() > 0 {\n\t\tfilterJSON, err := filters.ToJSON(optio...
[ "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 about Agent Identity Management:", "pos": "Represent the code about Agent Identity Management:", "neg": "Represent the code about programming:" }
Invokes service method with single response. @param message request service message @param dataDecoder function to create new service message with decoded data @return mono of service message
[ "public Mono<ServiceMessage> invokeOne(\n ServiceMessage message, BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {\n return Mono.defer(() -> Mono.from(invoke(toRequest(message, dataDecoder))))\n .map(this::toResponse)\n .onErrorResume(throwable -> Mono.just(errorMapper.toMes...
[ "def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp" ]
codesearchnet
{ "query": "Represent the Github sentence about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about Computer Science:" }
<p> The names of tables that have not been yet imported. </p> <p> Valid Values: List of table names </p> @return The names of tables that have not been yet imported.</p> <p> Valid Values: List of table names
[ "public java.util.List<String> getImportTablesNotStarted() {\n if (importTablesNotStarted == null) {\n importTablesNotStarted = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return importTablesNotStarted;\n }" ]
[ "function (parameters) {\n\n /**\n * Job identifier.\n * @type {string}\n */\n this.hash = parameters.hash;\n\n /**\n * Array of hashes to {@link Artifact}s containing each requested result.\n * @type {string[]}\n */\n this.resultHashes = p...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public void setRLENGTH(Integer newRLENGTH) {\n\t\tInteger oldRLENGTH = rlength;\n\t\trlength = newRLENGTH;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.RPS__RLENGTH, oldRLENGTH, rlength));\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github summarization about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Get an item from the cache, or store the default value. @param string $method @param array $args @param \Closure $callback @param int $time @return mixed
[ "public function cacheCallback($method, $args, Closure $callback, $time = null)\n {\n // Cache disabled, just execute query & return result\n if ($this->skippedCache() === true) {\n return call_user_func($callback);\n }\n\n // Use the called class name as the tag\n $...
[ "protected static function getField(\n ParticleInterface $particle,\n FieldsCargo $cargo,\n string $name,\n array $args = []\n )/*: mixed*/\n {\n $name = Utils::findFieldName($cargo, $name);\n return $particle->attributes()->$name; // test with null.\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Apply several rules to reduce the number of hydrophobic interactions.
[ "def refine_hydrophobic(self, all_h, pistacks):\n \"\"\"\"\"\"\n sel = {}\n # 1. Rings interacting via stacking can't have additional hydrophobic contacts between each other.\n for pistack, h in itertools.product(pistacks, all_h):\n h1, h2 = h.bsatom.idx, h.ligatom.idx\n ...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
返回数据给客户端 @param response 响应对象{@link HttpServletResponse} @param text 返回的内容 @param contentType 返回的类型
[ "public static void write(HttpServletResponse response, String text, String contentType) {\r\n\t\tresponse.setContentType(contentType);\r\n\t\tWriter writer = null;\r\n\t\ttry {\r\n\t\t\twriter = response.getWriter();\r\n\t\t\twriter.write(text);\r\n\t\t\twriter.flush();\r\n\t\t} catch (IOException e) {\r\n\t\t\tth...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the post about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
// GetBranchCommitID returns last commit ID string of given branch.
[ "func (repo *Repository) GetBranchCommitID(name string) (string, error) {\n\treturn repo.getRefCommitID(BRANCH_PREFIX + name)\n}" ]
[ "function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get instances http://tyr.dev.canaltp.fr/v0/instances/ @return array
[ "private function getInstances()\n {\n $response = $this->call($this->tyrUrl . '/' . $this->version . '/instances/');\n\n $instancesN = json_decode($response);\n if (is_array($instancesN)) {\n $instances = array();\n foreach ($instancesN as $instance) {\n ...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
读取字符串, 必须是"或者'包围的字符串值 @return String值
[ "@Override\r\n public String readString() {\r\n final char[] text0 = this.text;\r\n int currpos = this.position;\r\n char expected = text0[++currpos];\r\n if (expected <= ' ') {\r\n for (;;) {\r\n expected = text0[++currpos];\r\n if (expected >...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the Github summarization about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about text processing:" }
Determines if the provided string is OSGi bundle URL or not. @param str string to check @return true if the string is OSGi bundle URL, otherwise false
[ "public static boolean isOsgiBundleUrl(String str) {\n if (str == null) {\n throw new NullPointerException(\"Specified string can not be null!\");\n }\n return str.startsWith(\"bundle\") && str.contains(\"://\");\n }" ]
[ "function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Generate a random node mapping. Args: candidate_mapping: candidate_mapping: candidate node match list Returns: randomly-generated node mapping between two AMRs
[ "def random_init_mapping(candidate_mapping):\n \n # if needed, a fixed seed could be passed here to generate same random (to help debugging)\n random.seed()\n matched_dict = {}\n result = []\n for c in candidate_mapping:\n candidates = list(c)\n if not candidates:\n # -1 i...
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// NewFile returns a new File for the given file with the given Config options
[ "func NewFile(filename string, opts ...FileConfig) (*File, error) {\n\tvar (\n\t\tpath string\n\t\tf *os.File\n\t\terr error\n\t)\n\n\tif path, err = filepath.Abs(filename); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif f, err = os.OpenFile(filename, os.O_RDONLY, 0); err != nil {\n\t\treturn nil, err\n\t}\n\n\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// Delete an event by ID and all of its readings // 404 - Event not found // 503 - Unexpected problems
[ "func (mc MongoClient) DeleteEventById(id string) error {\n\treturn mc.deleteById(db.EventsCollection, id)\n}" ]
[ "def raise_errors(self, response):\n \"\"\"\"\"\"\n # Errors: 400, 403 permissions or REQUEST_LIMIT_EXCEEDED, 404, 405, 415, 500)\n # TODO extract a case ID for Salesforce support from code 500 messages\n\n # TODO disabled 'debug_verbs' temporarily, after writing better default messages\...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Natural Language Processing:" }
// SetDescription sets the Description field's value.
[ "func (s *RegisterDomainInput) SetDescription(v string) *RegisterDomainInput {\n\ts.Description = &v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
override the inner charts will handle adding opacity to their color schemes
[ "function(list, map, legendSize) {\n var hexColor;\n this.colorList = [];\n this.hcConfig.colors = [];\n for(i = 0; i < list.length; i++) {\n hexColor = this.colorPalette.getColor(list[i], map[list[i]], legendSize);\n this.colorList.push(hexC...
[ "def fill_between(self, canvas, X, lower, upper, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Data analysis:" }
// Write data to the UDP connection with no error handling
[ "func (w *udpWriter) Write(data []byte) (int, error) {\n\treturn w.conn.Write(data)\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Gets the value of a vairable @TODO: this is missnamed becasue it does not check the global paused variable @return [Boolean]
[ "def globally_paused?\n paused = false\n current_path = '/api/v1/variables?name=wip_pause_global'\n begin\n res = @conn.get(current_path)\n paused = res['wip_pause_global']\n rescue SFRest::SFError => error\n paused = false if error.message =~ /Variable not found/\n end...
[ "def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Checks if given ou is manageable.<p> @param ou to check @return true is it is manageable
[ "public boolean isOUManagable(String ou) {\n\n if (m_isRootAccountManager) {\n return true;\n }\n\n if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.ACCOUNT_MANAGER.forOrgUnit(\"\"))) {\n System.out.println(\"easy\");\n return true;\n }\n\n retu...
[ "public function getPropertyValue($propertyName, $objectId = null)\n {\n\n //You can return this protected properties as objects too.\n if (in_array($propertyName, array(\"objectId\", \"objectType\", \"objectURI\")) && isset($this->$propertyName)) {\n return $this->$propertyName;\n ...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// Provide allows the rancher provider to provide configurations to traefik using the given configuration channel.
[ "func (p *Provider) Provide(configurationChan chan<- config.Message, pool *safe.Pool) error {\n\tpool.GoCtx(func(routineCtx context.Context) {\n\t\tctxLog := log.With(routineCtx, log.Str(log.ProviderName, \"rancher\"))\n\t\tlogger := log.FromContext(ctxLog)\n\n\t\toperation := func() error {\n\t\t\tclient, err := p...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Reads and discards {@code size} bytes. @throws ProtobufException The end of the stream or the current limit was reached.
[ "public void skipRawBytes(final int size) throws IOException {\n if (size < 0) {\n throw ProtobufException.negativeSize();\n }\n\n if (totalBytesRetired + bufferPos + size > currentLimit) {\n // Read to the end of the stream anyway.\n skipRawBytes(currentLimit - totalBytesRetired - bufferPos...
[ "@Override\n public DataFrameRecord<T> getNext() throws DataCorruptionException, DurableDataLogException {\n Exceptions.checkNotClosed(this.closed, closed);\n\n try {\n while (!this.dataFrameInputStream.isClosed()) {\n try {\n if (!this.dataFrameInputStr...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// do performs an *http.Request respecting redirects, and handles the response // as defined in c.handleResponse. Notably, it does not alter the headers for // the request argument in any way.
[ "func (c *Client) do(req *http.Request, remote string, via []*http.Request) (*http.Response, error) {\n\treq.Header.Set(\"User-Agent\", UserAgent)\n\n\tres, err := c.doWithRedirects(c.HttpClient(req.Host), req, remote, via)\n\tif err != nil {\n\t\treturn res, err\n\t}\n\n\treturn res, c.handleResponse(res)\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github post about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code about Software development:" }
Dumps step example. @param string $keywords Item keyword @param string $text Step text @param Boolean $short Dump short version? @return string
[ "protected function dumpStep($keywords, $text, $short = true, $excludeAsterisk = false)\n {\n $dump = '';\n\n $keywords = explode('|', $keywords);\n if ($short) {\n $keywords = array_map(\n function ($keyword) {\n return str_replace('<', '', $keyw...
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// SetQualificationTypeId sets the QualificationTypeId field's value.
[ "func (s *DisassociateQualificationFromWorkerInput) SetQualificationTypeId(v string) *DisassociateQualificationFromWorkerInput {\n\ts.QualificationTypeId = &v\n\treturn s\n}" ]
[ "public void addClass(ClassDescriptorDef classDef)\r\n {\r\n classDef.setOwner(this);\r\n // Regardless of the format of the class name, we're using the fully qualified format\r\n // This is safe because of the package & class naming constraints of the Java language\r\n _classDefs.put...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Revert migration
[ "def revert(ctx, name, verbose):\n \n\n try:\n app_name, target_migration = name.split('/', 2)\n except ValueError:\n raise click.ClickException('NAME format is <app>/<migration>')\n\n apps = ctx.obj['config']['apps']\n if app_name not in apps.keys():\n raise click.ClickException...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Adds create project command to task runner if project doesn't already exist.
[ "def visit_project(self, item):\n \n if not item.remote_id:\n command = CreateProjectCommand(self.settings, item)\n self.task_runner_add(None, item, command)\n else:\n self.settings.project_id = item.remote_id" ]
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value.
[ "func (s *Layer) SetInstallUpdatesOnBoot(v bool) *Layer {\n\ts.InstallUpdatesOnBoot = &v\n\treturn s\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Admit determines if the service should be admitted based on the configured network CIDR.
[ "func (r *externalIPRanger) Validate(a admission.Attributes) error {\n\tif a.GetResource().GroupResource() != kapi.Resource(\"services\") {\n\t\treturn nil\n\t}\n\n\tsvc, ok := a.GetObject().(*kapi.Service)\n\t// if we can't convert then we don't handle this object so just return\n\tif !ok {\n\t\treturn nil\n\t}\n\...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github description about network configuration:", "pos": "Represent the Github code about network configuration:", "neg": "Represent the Github code about Software development:" }
// Create a new *log.Logger wrapping w in a wlog.Writer
[ "func New(w io.Writer, prefix string, flag int) *log.Logger {\n\treturn log.New(NewWriter(w), prefix, flag)\n}" ]
[ "func init() {\n\t// take an output from a print function\n\toutput := pio.Wrap(logrus.Errorf)\n\t// register a new printer with name \"logrus\"\n\t// which will be able to read text and print as string.\n\tpio.Register(\"logrus\", output).Marshal(pio.Text)\n\n\t// p := pio.Register(\"logrus\", output).Marshal(pio....
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// Deprecated: UnmarshalMsg implements msgp.Unmarshaler
[ "func (z *bitmapContainer) UnmarshalMsg(bts []byte) (o []byte, err error) {\n\tvar field []byte\n\t_ = field\n\tvar zcmr uint32\n\tzcmr, bts, err = msgp.ReadMapHeaderBytes(bts)\n\tif err != nil {\n\t\treturn\n\t}\n\tfor zcmr > 0 {\n\t\tzcmr--\n\t\tfield, bts, err = msgp.ReadMapKeyZC(bts)\n\t\tif err != nil {\n\t\t\...
[ "func GobDecode(b []byte) (store Store, err error) {\n\tdec := gob.NewDecoder(bytes.NewBuffer(b))\n\t// no reference because of:\n\t// gob: decoding into local type *memstore.Store, received remote type Entry\n\terr = dec.Decode(&store)\n\treturn\n}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Generate the changelog using the templates defined in options.
[ "function getChangelog(log) {\n var data = {\n date: moment().format('YYYY-MM-DD'),\n features: getChanges(log, options.featureRegex),\n fixes: getChanges(log, options.fixRegex)\n };\n\n return template(data);\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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Assert that a given model follows the mongoose model format. @param model @param logger @returns {boolean}
[ "function(model, logger) {\n assert(\n model.schema,\n \"model not mongoose format. 'schema' property required.\"\n )\n assert(\n model.schema.paths,\n \"model not mongoose format. 'schema.paths' property required.\"\n )\n assert(\n model.schema.tree,\n \"model not mongo...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Parses an XML file and returns properties @param PhingFile $file @throws IOException @return Properties
[ "private function getProperties(PhingFile $file)\n {\n // load() already made sure that file is readable\n // but we'll double check that when reading the file into\n // an array\n\n if ((@file($file)) === false) {\n throw new IOException(\"Unable to parse contents of $file...
[ "@Override\n @Deprecated\n public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {\n throw new UnsupportedOperationException(\"Use `execute(parameters, body, output)`\");\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Push functions to step node
[ "function pushHandlers (chain, args) {\n return pushNode.apply(chain, utils.type(args[0]) == 'array' ? args[0]:args)\n}" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
InternalXtype.g:267:1: ruleJvmLowerBound : ( ( rule__JvmLowerBound__Group__0 ) ) ;
[ "public final void ruleJvmLowerBound() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalXtype.g:271:2: ( ( ( rule__JvmLowerBound__Group__0 ) ) )\n // InternalXtype.g:272:2: ( ( rule__JvmLowerBound__Group__0 ) )\n {...
[ "Rule xyDescriptor() {\n return NodeSequence(\n xyType(),\n push(new XYNode()),\n ZeroOrMore(Sequence(xyElement(), Newline()))\n );\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about language and writing:" }
Make this application publicly available over the network.
[ "async def expose(self):\n \n app_facade = client.ApplicationFacade.from_connection(self.connection)\n\n log.debug(\n 'Exposing %s', self.name)\n\n return await app_facade.Expose(self.name)" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get pair of the keys from relation in order to join the table. @param \Illuminate\Database\Eloquent\Relations\Relation $relation @return array @throws \LogicException
[ "protected function getJoinKeys(Relation $relation)\n {\n if ($relation instanceof MorphTo) {\n throw new LogicException(\"MorphTo relation cannot be joined.\");\n }\n\n if ($relation instanceof HasOneOrMany) {\n return [$relation->getQualifiedForeignKeyName(), $relatio...
[ "public function applyFilters($filters, FilterFactory $filterFactory, ConditionAwareRepository $repository)\n {\n // @see Ipunkt\\LaravelJsonApi\\Services\\FilterApplier\\FilterApplier\n \\FilterApplier::applyFiltersToRepository($filters, $filterFactory, $repository);\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Finish up the initialization of the Browser History Manager. @method _initialize @private
[ "function _initialize() {\n\n var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash;\n\n // Decode the content of our storage field...\n parts = _stateField.value.split(\"|\");\n\n if (parts.length > 1) {\n\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Removes an array of NodeRefs from the deferrered request. @param NodeRef[] $nodeRefs
[ "public function removeNodeRefs(array $nodeRefs): void\n {\n if (null === $this->getNodeBatchRequest) {\n return;\n }\n\n $this->getNodeBatchRequest->removeFromSet('node_refs', $nodeRefs);\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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Get player ranking for the give title @param string $titleId @param string $login @return Object @throws Exception
[ "function getMultiplayerPlayer($titleId, $login)\n\t{\n\t\tif(!$login)\n\t\t{\n\t\t\tthrow new Exception('Invalid login');\n\t\t}\n\t\treturn $this->execute('GET', $this->getPrefixEndpoint($titleId).'/rankings/multiplayer/player/%s/?title=%s', array($login, $titleId));\n\t}" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Set the default color for map elements. @param color is the default color for map elements.
[ "public static void setPreferredColor(int color) {\n\t\tfinal Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);\n\t\tif (prefs != null) {\n\t\t\tprefs.putInt(\"COLOR\", color); //$NON-NLS-1$\n\t\t\ttry {\n\t\t\t\tprefs.flush();\n\t\t\t} catch (BackingStoreException exception) {\n\t\t\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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Idiosynractic method for adding an element to a list
[ "def append(self, el):\n \n if self.value is None:\n self.value = [el]\n else:\n self.value.append(el)" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get a single user @param WP_REST_Request $request Full details about the request. @return WP_Error|WP_REST_Response
[ "public function get_item( $request ) {\n\t\t$id = (int) $request['id'];\n\t\t$user = get_userdata( $id );\n\n\t\tif ( empty( $id ) || empty( $user->ID ) ) {\n\t\t\treturn new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource id.' ), array( 'status' => 404 ) );\n\t\t}\n\n\t\t$user = $this->prepare_item_for_re...
[ "public function callback( $params ) {\r\n\t\t/** @var \\Technote\\Classes\\Models\\Lib\\Loader\\Controller\\Api $api */\r\n\t\t$api = \\Technote\\Classes\\Models\\Lib\\Loader\\Controller\\Api::get_instance( $this->app );\r\n\r\n\t\treturn new \\WP_REST_Response( $api->get_nonce_data() );\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about PHP programming:" }
Remove all vertices and edges.
[ "public void clear() {\n vertices.clear();\n vertexModCount++;\n Arrays.matrixFill(edges, null);\n edgeCount = 0;\n edgesArr = null;\n edgeModCount++;\n freeList.clear();\n for (int row = capacity - 1; row >= 0; row--) {\n freeList.add(row);\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Generates pagination template data @param array $queryParams @param array $viewParams @return array
[ "public function render($pagination, array $queryParams = array(), array $viewParams = array())\n {\n $data = $pagination->getPaginationData();\n\n $data['route'] = $pagination->getRoute();\n $data['query'] = array_merge($pagination->getParams(), $queryParams);\n\n return array_merge(...
[ "public function LinkingMode()\n {\n /** @var Page_Controller $controller */\n $controller = Controller::curr();\n $params = $controller->getURLParams();\n\n return $params['ID'] === $this->URLSegment ? 'current' : 'link';\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
This action displays a specific Prize page among those associated to the game
[ "public function prizeAction()\n {\n $prizeIdentifier = $this->getEvent()->getRouteMatch()->getParam('prize');\n $prize = $this->getPrizeService()->getPrizeMapper()->findByIdentifier($prizeIdentifier);\n\n if (!$prize) {\n return $this->notFoundAction();\n }\n\n ...
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Data synchronization:" }
Fetch the provider's endpoint URL for the supplied resource. @param string $url The provider's endpoint URL for the supplied resource. @return string @throws \Ttree\Oembed\Exception @todo is not endpoint is found try other format (supportedFormat)
[ "protected function fetchEndpointForUrl($url)\n {\n $endPoint = null;\n\n try {\n $content = $this->browser->getContent($url);\n } catch (Exception $exception) {\n throw new Exception(\n 'Unable to fetch the page body for \"' . $url . '\": ' . $exception-...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Natural Language Processing:" }
// ValueOf returns the reflect.Value of "o". // If "o" is already a reflect.Value returns "o".
[ "func ValueOf(o interface{}) reflect.Value {\n\tif v, ok := o.(reflect.Value); ok {\n\t\treturn v\n\t}\n\n\treturn reflect.ValueOf(o)\n}" ]
[ "func ensureValidHelper(name string, funcValue reflect.Value) {\n\tif funcValue.Kind() != reflect.Func {\n\t\tpanic(fmt.Errorf(\"Helper must be a function: %s\", name))\n\t}\n\n\tfuncType := funcValue.Type()\n\n\tif funcType.NumOut() != 1 {\n\t\tpanic(fmt.Errorf(\"Helper function must return a string or a SafeStrin...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Reg registers ipPort to DNS cache.
[ "func (d *DnsCache) Reg(addr, ipPort string) {\n\td.ipPortLib.Store(addr, ipPort)\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 Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Pushes a single metrics through the Graphite protocol to the underlying backend @param name metric name @param value metric value @param timestamp associated timestamp @throws IOException
[ "public void push(String name, String value, long timestamp) throws IOException {\n graphiteSender.send(name, value, timestamp);\n }" ]
[ "def metric(self, measurement_name, values, tags=None, timestamp=None):\n \n if not measurement_name or values in (None, {}):\n # Don't try to send empty data\n return\n\n tags = tags or {}\n\n # Do a shallow merge of the metric tags and global tags\n all_tag...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns a subset pf {@link #getMonitors()} that are {@linkplain NodeMonitor#isIgnored() not ignored}.
[ "public static Map<Descriptor<NodeMonitor>,NodeMonitor> getNonIgnoredMonitors() {\n Map<Descriptor<NodeMonitor>,NodeMonitor> r = new HashMap<>();\n for (NodeMonitor m : monitors) {\n if(!m.isIgnored())\n r.put(m.getDescriptor(),m);\n }\n return r;\n }" ]
[ "synchronized void activate(ComponentContext componentContext) throws Exception {\n this.componentContext = componentContext;\n this.classAvailableTransformer = new ClassAvailableTransformer(this, instrumentation, includeBootstrap);\n this.transformer = new ProbeClassFileTransformer(this, instr...
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
\ get @param mixed $id @return mixed|ApiJsonModel|\Zend\Stdlib\ResponseInterface
[ "public function get($id)\n {\n $site = $this->getCurrentSite();\n\n $result = $this->buildSiteApiResponse($site);\n\n return new ApiJsonModel($result, 0, 'Success');\n }" ]
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
Fisher-Yates "inside-out" shuffle. Randomize order of modules and their properties when minifying. @function shuffleArray @param {Object} options @param {Array} arr @api private
[ "function shuffleArray (options, arr) {\n if (!options.minify) { return undefined; }\n\n for (let i = 0, max = arr.length; i < max; i++) {\n let j = randomInt(max);\n\n if (arr[j] !== arr[i]) {\n let source = arr[i];\n\n arr[i] = arr[j];\n arr[j] = source;\n ...
[ "function exported (options) {\n var exp = arrayify(options.data.root).find(where({ '!kind': 'module', id: this.id }))\n return exp || this\n}" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Find the next row that contains given string @return row and col offset of match, or nil @param String to find
[ "def next_regex str\n first = nil\n ## content can be string or Chunkline, so we had to write <tt>index</tt> for this.\n ## =~ does not give an error, but it does not work.\n @list.each_with_index do |line, ix|\n col = line =~ /#{str}/\n if col\n first ||= [ ix, col ]\n ...
[ "def _init_model array\n # clear the column data -- this line should be called otherwise previous tables stuff will remain.\n @chash.clear\n array.each_with_index { |e,i|\n # if columns added later we could be overwriting the width\n c = get_column(i)\n c.width ||= 10\n }\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get TrackingEvents DomElement @return \DOMElement
[ "protected function getTrackingEventsDomElement()\n {\n // create container\n if ($this->trackingEventsDomElement) {\n return $this->trackingEventsDomElement;\n }\n \n $this->trackingEventsDomElement = $this->linearCreativeDomElement\n ->getElementsByTagNa...
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Shortcut for {@link #createTable(CqlIdentifier,CqlIdentifier) createTable(CqlIdentifier.fromCql(keyspaceName),CqlIdentifier.fromCql(tableName)}
[ "@NonNull\n public static CreateTableStart createTable(@Nullable String keyspace, @NonNull String tableName) {\n return createTable(\n keyspace == null ? null : CqlIdentifier.fromCql(keyspace),\n CqlIdentifier.fromCql(tableName));\n }" ]
[ "public boolean exists(){\n return null != new DB(metaModelLocal.getDbName()).firstCell(metaModelLocal.getDialect().selectExists(metaModelLocal), getId());\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Redirect a call to the specified destination. @param connId The connection ID of the call to redirect. @param destination The number where Workspace should redirect the call.
[ "public void redirectCall(String connId, String destination) throws WorkspaceApiException {\r\n this.redirectCall(connId, destination, null, null);\r\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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get faultactor, faultstring, faultcode and detail elements
[ "function _parseSoapFaultDetail(detailNode){\n var errors = [];\n var i, childNodes = detailNode.childNodes, n = childNodes.length, childNode;\n for (i = 0; i < n; i++) {\n childNode = childNodes[i];\n if (childNode.nodeType !== 1) {\n continue;\n }\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Convert_kops_HookSpec_To_v1alpha2_HookSpec is an autogenerated conversion function.
[ "func Convert_kops_HookSpec_To_v1alpha2_HookSpec(in *kops.HookSpec, out *HookSpec, s conversion.Scope) error {\n\treturn autoConvert_kops_HookSpec_To_v1alpha2_HookSpec(in, out, s)\n}" ]
[ "func NewProtoWrapperWithSerializer(db keyval.CoreBrokerWatcher, serializer keyval.Serializer) *ProtoWrapper {\n\t// OBSOLETE, use NewProtoWrapper\n\treturn NewProtoWrapper(db, serializer)\n}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param source @param token @return
[ "public static List<String> parseStringToStringList(String source,\n String token) {\n\n if (StringUtils.isBlank(source) || StringUtils.isEmpty(token)) {\n return null;\n }\n\n List<String> result = new ArrayList<String>();\n\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
// SetServerId sets the ServerId field's value.
[ "func (s *ImportSshPublicKeyInput) SetServerId(v string) *ImportSshPublicKeyInput {\n\ts.ServerId = &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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Standard input components that implement react-backbone model awareness
[ "function(type, attributes, isCheckable, classAttributes) {\n return React.createClass(_.extend({\n mixins: ['modelAware'],\n render: function() {\n var props = {};\n var defaultValue = getModelValue(this);\n if (isCheckable) {\n ...
[ "def push(self):\r\n \"\"\"\"\"\"\r\n print `request.body`\r\n yield request.environ['cogen.call'](pubsub.publish)(\r\n \"%s: %s\" % (session['client'].name, request.body)\r\n )\r\n # the request.environ['cogen.*'] objects are the the asynchronous\r\n # make the ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Returns: Calendar: an exact deep copy of self
[ "def clone(self):\n \n clone = copy.copy(self)\n clone._unused = clone._unused.clone()\n clone.events = copy.copy(self.events)\n clone.todos = copy.copy(self.todos)\n clone._timezones = copy.copy(self._timezones)\n return clone" ]
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* @see java.util.Map#keySet()
[ "@Override\n public Set<K> keySet() {\n final Set<K> localSet = this.localMap.keySet();\n\n if (isReadyOnly())\n return Collections.unmodifiableSet(localSet);\n\n return localSet;\n }" ]
[ "@Inline(value=\"$2.$3unmodifiableSet($1)\", imported=Collections.class)\n\tpublic static <T> Set<T> unmodifiableView(Set<? extends T> set) {\n\t\treturn Collections.unmodifiableSet(set);\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Documentation:" }
@param AbstractWidget $widget @param string $widgetType @param array $parameters @param string $env @return array
[ "public function handle(AbstractWidget $widget, $widgetType, array $parameters, $env = 'prod')\n {\n $originalChildren = new ArrayCollection();\n\n foreach ($widget->getChildren() as $child) {\n $originalChildren->add($child);\n }\n\n $data = array();\n\n $form = $th...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Prepare suite and determine test ordering
[ "def prepare_suite(self, suite):\n \"\"\"\"\"\"\n all_tests = {}\n for s in suite:\n m = re.match(r'(\\w+)\\s+\\(.+\\)', str(s))\n if m:\n name = m.group(1)\n else:\n name = str(s).split('.')[-1]\n all_tests[name] = s\n\n...
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Validate the form element value according a ruleset. @param array $rules validation rules. @param Form|null $form the parent form. @return boolean true if all rules pass, else false.
[ "public function validate($rules, $form = null)\n {\n $regExpEmailAddress = '/\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i';\n $tests = [\n 'fail' => [\n 'message' => 'Will always fail.',\n 'test' => 'return false;'\n ],\n\n 'pass' =...
[ "public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about PHP programming:" }
/* FETCHING LIST METHODS ***********************************************************************
[ "public function fetchByField($field, $value, $limit = null, $order = null, $offset = null, &$count = false)\n {\n $fetch = $this->getBaseFetch()\n ->where()\n ->equal($field, ':' . $field);\n $parameters = array(':' . $field => $value);\n return $this->fetch($fetch, $p...
[ "@Override\n\tpublic void toPDB(StringBuffer buf){\n\t\t// 1 2 3 4 5 6 7\n\t\t//01234567890123456789012345678901234567890123456789012345678901234567890123456789\n\t\t//HEADER COMPLEX (SERINE PROTEASE/INHIBITORS) 06-FEB-98 1A4W\n\t\t//TITLE CRYSTAL...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Construct the splits, etc. This is invoked from an async thread so that split-computation doesn't block anyone.
[ "public synchronized void initTasks()\n throws IOException, KillInterruptedException {\n if (tasksInited.get() || isComplete()) {\n return;\n }\n synchronized(jobInitKillStatus){\n if(jobInitKillStatus.killed || jobInitKillStatus.initStarted) {\n return;\n }\n jobInitKillStatus....
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
wrap the content if needed @param FilterResponseEvent $event
[ "public function onResponseLate(FilterResponseEvent $event)\n {\n if (!$this->eventRequestMatches($event)) {\n return;\n }\n $this->responseTransformer->transformLate($event->getRequest(), $event->getResponse());\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetDetailedErrorCode sets the DetailedErrorCode field's value.
[ "func (s *ErrorDetail) SetDetailedErrorCode(v string) *ErrorDetail {\n\ts.DetailedErrorCode = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Converts the given NodeList to a metadata map. @param blocks the NodeList to convert @return metadata map
[ "private Map<String, String> toMetadata( NodeList blocks ) {\n Map<String, String> dimensions = new HashMap<String, String>();\n\n for( int i = 0; i < blocks.getLength(); i++ ) {\n Node dimensionNode = blocks.item(i);\n\n if( dimensionNode.getNodeName().equals(\"member\") ) {\n ...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Helper function to parse query string (e.g. ?param1=value&parm2=...).
[ "function parseQueryString(query) {\n var parts = query.split('&');\n var params = {};\n for (var i = 0, ii = parts.length; i < ii; ++i) {\n var param = parts[i].split('=');\n var key = param[0].toLowerCase();\n var value = param.length > 1 ? param[1] : null;\n params[decodeURIComponent(key)] = decod...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return a function that calls the given method (first parameter) on any given object with the given arguments (remaining parameters). @return callable @throws \InvalidArgumentException
[ "public static function method()\n {\n $partialArgs = func_get_args();\n if (count($partialArgs) < 1) {\n throw new \\InvalidArgumentException();\n }\n $name = array_shift($partialArgs);\n return function () use ($name, $partialArgs) {\n $args = func_get_a...
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// Put handles saving the item
[ "func (svc *DynamoAccessor) Put(ctx context.Context, keyPath string, object interface{}) error {\n\n\t// What's the type of the object?\n\tif object == nil {\n\t\treturn errors.New(\"DynamoAccessor Put object must not be nil\")\n\t}\n\t// Map it...\n\tmarshal, marshalErr := dynamodbattribute.MarshalMap(object)\n\ti...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the description about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code:" }
Applies parsing functions to each input as specified in init before returning a tuple with first entry being a boolean which specifies if the user entered all values and a second entry which is a dictionary of input names to parsed values.
[ "def get_values(self):\n \n return_dict = {}\n for i,ctrl in enumerate(self.list_ctrls):\n if hasattr(self.parse_funcs,'__getitem__') and len(self.parse_funcs)>i and hasattr(self.parse_funcs[i],'__call__'):\n try: return_dict[self.inputs[i]] = self.parse_funcs[i](ctrl....
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github instruction about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code:" }
Provide modelOn and modelOnce argument with proxied arguments arguments are event, callback, context
[ "function modelOrCollectionOnOrOnce(modelType, type, args, _this, _modelOrCollection) {\n var modelEvents = getModelAndCollectionEvents(modelType, _this);\n var ev = args[0];\n var cb = args[1];\n var ctx = args[2];\n modelEvents[ev] = {\n type: type,\n ev: e...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// WithTag combines the name from "name" and the tag from "tag" to form a // reference incorporating both the name and the tag.
[ "func WithTag(name Named, tag string) (NamedTagged, error) {\n\tif !anchoredTagRegexp.MatchString(tag) {\n\t\treturn nil, ErrTagInvalidFormat\n\t}\n\tif canonical, ok := name.(Canonical); ok {\n\t\treturn reference{\n\t\t\tname: name.Name(),\n\t\t\ttag: tag,\n\t\t\tdigest: canonical.Digest(),\n\t\t}, nil\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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
@param string $fileName @throws \Exception
[ "public function loadExpectationFromFile($fileName)\n {\n $this->logger->debug(\"Loading expectation file $fileName\");\n $content = file_get_contents($fileName);\n $data = @json_decode($content, true);\n if (JSON_ERROR_NONE !== json_last_error()) {\n throw new \\Exception(...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Connects to the given smtp and says hello to the other server.
[ "protected function smtp_connect()\n\t{\n\t\t// re-use the existing connection\n\t\tif ( ! empty($this->smtp_connection))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// add a transport if not given\n\t\tif (strpos($this->config['smtp']['host'], '://') === false)\n\t\t{\n\t\t\t$this->config['smtp']['host'] = 'tcp://'.$this-...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Populate the database with some data useful for development.
[ "def populate_database():\n \"\"\"\"\"\"\n if User.fetch_by(username='admin'):\n return\n\n # Admin user\n admin = User(name='Administrator', password='password',\n username='admin', is_admin=True)\n # Class\n class_ = Class(name='CS32')\n Session.add(class_)\n Session...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }