query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// acquireChan wraps a signal chan with a func that can be used with rateLimit. // should only be called by rate limiting funcs (that implement deadlock avoidance).
[ "func acquireChan(tokenCh <-chan struct{}) func(context.Context, bool) bool {\n\tif tokenCh == nil {\n\t\t// always false: acquire never succeeds; panic if told to block (to avoid deadlock)\n\t\treturn func(ctx context.Context, block bool) bool {\n\t\t\tif block {\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t...
[ "func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(\n\t_ context.Context, _ DiskBlockCacheType) (bool, error) {\n\t// We won't be kicking off long syncing prefetching via the remote\n\t// cache, so just pretend the cache has space.\n\treturn true, nil\n}" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Collects garbage - removes files from the file system. @return \Zend\Stdlib\ResponseInterface
[ "public function collectAction()\n {\n // @todo json\n $service = $this->getGarbageCollector();\n if ($service->collect()) {\n return $this->redirect()->toRoute('sc-admin/content-manager');\n }\n return $this->redirect()\n ->toRoute(\n 'sc-a...
[ "public function close()\n {\n $this->started = false;\n \n \\Wslim\\Ioc::logger('session')->debug(sprintf('[%s]close', static::getId()));\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Str2JSType extract a JavaScript type from a string
[ "func Str2JSType(s string) JSType {\n\tvar (\n\t\toutput JSType\n\t)\n\ts = strings.TrimSpace(s) // santize the given string\n\tswitch {\n\tcase isBool(s):\n\t\toutput = Bool\n\tcase isFloat(s):\n\t\toutput = Float\n\tcase isInt(s):\n\t\toutput = Int\n\tcase isNull(s):\n\t\toutput = Null\n\tdefault:\n\t\toutput = S...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
The parser fires this each time one path has been parsed @param string $path xml path which parsing has ended
[ "public function after_path($path) {\n $toprocess = false;\n // If the path being closed matches (same or parent) the first path in the stack\n // we process pending startend notifications until one matching end is found\n if ($element = reset($this->startendinfo)) {\n $elepat...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// sendCommand is an auxiliary function to send commands to the AIP1640Driver module
[ "func (a *AIP1640Driver) sendCommand(cmd byte) {\n\ta.pinData.Off()\n\ta.send(cmd)\n\ta.pinData.On()\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// MULTI-SOURCE - Type D: copy([](f|d...), d) -> []B // prepareCopyURLsTypeE - prepares target and source clientURLs for copying.
[ "func prepareCopyURLsTypeD(sourceURLs []string, targetURL string, isRecursive bool, encKeyDB map[string][]prefixSSEPair) <-chan URLs {\n\tcopyURLsCh := make(chan URLs)\n\tgo func(sourceURLs []string, targetURL string, copyURLsCh chan URLs) {\n\t\tdefer close(copyURLsCh)\n\t\tfor _, sourceURL := range sourceURLs {\n...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceStrategyOptions.
[ "func (in *SourceStrategyOptions) DeepCopy() *SourceStrategyOptions {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SourceStrategyOptions)\n\tin.DeepCopyInto(out)\n\treturn out\n}" ]
[ "func (resource *Bundle) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Bundle\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Bundle), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
/* $order array of the fields and the order
[ "public function selectAll($where=false, $order=false, $limit=false) {\n $clause = false;\n $values = array();\n if ( is_array($where) ) {\n $retval = self::extractWhere($where, $clause, $values);\n if ( is_string($retval) ) throw new \\Exception($val);\n }\n ...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Write current root class hierarchy with resolved generics. Use custom writer to modify type rendering (on each line). @param typeWriter custom type writer @return current hierarchy with resolved generics
[ "public String toStringHierarchy(final TypeWriter typeWriter) {\n final StringBuilder res = new StringBuilder(types.size() * 50);\n writeHierarchy(root, \"\", \"\", res, typeWriter);\n return res.toString();\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the instruction about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code about programming:" }
Start application.
[ "def main(args=None):\n \"\"\"\"\"\"\n parser = _parser()\n\n # Python 2 will error 'too few arguments' if no subcommand is supplied.\n # No such error occurs in Python 3, which makes it feasible to check\n # whether a subcommand was provided (displaying a help message if not).\n # argparse intern...
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Displace this atom in place
[ "def displace!(x,y,z)\n self.x += x\n self.y += y\n self.z += z\n end" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
--------------------------------------------------------- private functions /* get message or service definition class
[ "function getMessageFromPackage(messageType, type, callback) {\n var packageName = getPackageNameFromMessageType(messageType);\n var messageName = getMessageNameFromMessageType(messageType);\n packages.findPackage(packageName, function(error, directory) {\n var filePath;\n filePath = path.join(directory, t...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Figure out the sections in drbdadm status
[ "def _analyse_status_type(line):\n '''\n \n '''\n spaces = _count_spaces_startswith(line)\n\n if spaces is None:\n return ''\n\n switch = {\n 0: 'RESOURCE',\n 2: {' disk:': 'LOCALDISK', ' role:': 'PEERNODE', ' connection:': 'PEERNODE'},\n 4: {' peer-disk:': 'PEERDISK'}\...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
Build the client from a dsn Examples: udp+influxdb://username:pass@localhost:4444/databasename @param string $dsn @return Client|Database @throws ClientException
[ "public static function fromDSN($dsn)\n {\n $connParams = parse_url($dsn);\n $schemeInfo = explode('+', $connParams['scheme']);\n $modifier = null;\n $scheme = $schemeInfo[0];\n $dbName = isset($connParams['path']) ? substr($connParams['path'], 1) : null;\n\n if (isset($...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param InputInterface $input @param OutputInterface $output @return bool|int|null
[ "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->init($input);\n $function = $input->getArgument('function');\n $idChart = $input->getOption('idChart');\n\n switch ($function) {\n case 'maj-player':\n if ($idChart) {\n...
[ "public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "@XmlElementDecl(namespace = \"http://www.drugbank.ca\", name = \"rs-id\", scope = SnpAdverseDrugReactionType.class)\n public JAXBElement<String> createSnpAdverseDrugReactionTypeRsId(String value) {\n return new JAXBElement<String>(_SnpAdverseDrugReactionTypeRsId_QNAME, String.class, SnpAdverseDrugReactio...
[ "@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getGCBEZ() {\n\t\tif (gcbezEClass == null) {\n\t\t\tgcbezEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(488);\n\t\t}\n\t\treturn gcbezEClass;\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 comment about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Get a firmware image with provided image_id. :param str image_id: The firmware ID for the image to retrieve (Required) :return: FirmwareImage
[ "def get_firmware_image(self, image_id):\n \n api = self._get_api(update_service.DefaultApi)\n return FirmwareImage(api.firmware_image_retrieve(image_id))" ]
[ "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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see com.ibm.ws.sib.processor.runtime.SIMPTopicSpaceControllable#deleteLocalSubscriptionControlByID(java.lang.String)
[ "public void deleteLocalSubscriptionControlByID(String id) \n throws SIMPInvalidRuntimeIDException, SIMPControllableNotFoundException, SIMPException, \n SIDurableSubscriptionNotFoundException, SIDestinationLockedException, SIResourceException, SIIncorrectCallException\n {\n if (TraceComponent.isAnyTrac...
[ "protected InvokerExtensionProcessor getInvokerExtensionProcessor(com.ibm.ws.webcontainer.webapp.WebApp app)\n {\n return new com.ibm.ws.webcontainer.osgi.extension.InvokerExtensionProcessor(app, config.getInvokerAttributes());\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
使用账号密码方式登录授权 @param string $username 用户名 @param string $password 密码 @return void
[ "public function login($username, $password)\n\t{\n\t\t$response = $this->http->get($this->getUrl('oauth2/access_token'), array(\n\t\t\t'grant_type'\t=>\t'password ',\n\t\t\t'username'\t\t=>\t$username,\n\t\t\t'password'\t\t=>\t$password,\n\t\t\t'client_id'\t\t=>\t$this->appid,\n\t\t\t'client_secret'\t=>\t$this->ap...
[ "public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Automatically generated run method @param Request $request @return Response
[ "public function run(Request $request) {\n\t\t$id = $this->getParam('id');\n\t\t$sport = SportQuery::create()\n\t\t\t->leftJoinGroup()\n\t\t\t->leftJoinSkill()\n\t\t\t->findOneById($id);\n\n\t\t$pictures = PictureQuery::create()\n\t\t\t->useSkillQuery()\n\t\t\t\t->filterBySportId($id)\n\t\t\t->endUse()\n\t\t\t->cou...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
把资源存放到当前上下文 @param IPoolResource $resource @return void
[ "private static function pushResourceToRequestContext(IPoolResource $resource)\n {\n $poolResources = RequestContext::get('poolResources', []);\n $instance = $resource->getInstance();\n $poolResources[spl_object_hash($instance)] = $resource;\n RequestContext::set('poolResources', $poo...
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Emit an alert monitor.down, which is in the OK state. @param ctx Rule evaluation context.
[ "@Override\n public void transform(Context<MutableTimeSeriesCollectionPair> ctx) {\n DateTime now = ctx.getTSData().getCurrentCollection().getTimestamp();\n\n ctx.getTSData().getCurrentCollection().addMetrics(MONITOR_GROUP, get_metrics_(now, ctx));\n\n ctx.getAlertManager().accept(new Alert(...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
MySQL SELECT Query/Statement. @param string $table @param array $column @param array $arrayWhere @param string $other @return self type: array/error
[ "public function select($table = '', $column = [], $arrayWhere = [], $other = '')\n {\n // handle column array data\n if (!is_array($column)) {\n $column = [];\n }\n // get field if pass otherwise use *\n $sField = count($column) > 0 ? implode(', ', $column) : '*';\n...
[ "public static function MakeInsertRow (array $merge_row = [], $forced_obtain = false, $options = []) {\n\t\t$options += $options + static::GetDefaultOptions();\n\t\treturn DBI::MakeInsertRow($options, static::GetName(), $merge_row, $forced_obtain);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Is required to repaint the control or its snippet? @param string snippet name @return bool
[ "public function isControlInvalid($snippet = NULL)\n\t{\n\t\tif ($snippet === NULL) {\n\t\t\tif (count($this->invalidSnippets) > 0) {\n\t\t\t\treturn TRUE;\n\n\t\t\t} else {\n\t\t\t\t$queue = [$this];\n\t\t\t\tdo {\n\t\t\t\t\tforeach (array_shift($queue)->getComponents() as $component) {\n\t\t\t\t\t\tif ($component...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
This method removes the option-bar widget from DOM and re-attaches it at it's original position.<p> Use to avoid mouse-over and mouse-down malfunction.<p>
[ "private void resetOptionbar() {\n\n if (m_elementOptionBar != null) {\n if (getWidgetIndex(m_elementOptionBar) >= 0) {\n m_elementOptionBar.removeFromParent();\n }\n updateOptionBarPosition();\n insert(m_elementOptionBar, 0);\n }\n }" ]
[ "public void discardHeaderClick(ClickEvent event) {\n if (event == null) return;\n\n // Example: we use radioset on collapsible header, so stopPropagation() is needed\n // to suppress collapsible open/close behavior.\n // But preventDefault() is not needed, otherwise radios won't switch....
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// GetBucketNotification - get bucket notification at a given path.
[ "func (c Client) GetBucketNotification(bucketName string) (bucketNotification BucketNotification, err error) {\n\t// Input validation.\n\tif err := s3utils.CheckValidBucketName(bucketName); err != nil {\n\t\treturn BucketNotification{}, err\n\t}\n\tnotification, err := c.getBucketNotification(bucketName)\n\tif err ...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the text about AWS S3:", "pos": "Represent the code about AWS S3:", "neg": "Represent the code about Programming:" }
Get the documentation name. @return string
[ "protected function getDocName()\n {\n $name = $this->option('name') ?: $this->name;\n\n if (! $name) {\n $this->comment('A name for the documentation was not supplied. Use the --name option or set a default in the configuration.');\n\n exit;\n }\n\n return $name...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
run all patterns in the playbook
[ "def run(self):\n ''' '''\n plays = []\n matched_tags_all = set()\n unmatched_tags_all = set()\n\n # loop through all patterns and run them\n self.callbacks.on_start()\n for (play_ds, play_basedir) in zip(self.playbook, self.play_basedirs):\n play = Play(...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Calls jsonrpc service's method and returns its return value in a JSON string or None if there is none. Arguments: jsondata -- remote method call in jsonrpc format
[ "def call(self, jsondata):\n \n result = yield self.call_py(jsondata)\n if result is None:\n defer.returnValue(None)\n else:\n defer.returnValue(json.dumps(result))" ]
[ "def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// RemoveAllBlocksForController removes all the blocks for the controller. // It does not prevent new blocks from being added during / after // removal.
[ "func (st *State) RemoveAllBlocksForController() error {\n\tblocks, err := st.AllBlocksForController()\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\tops := []txn.Op{}\n\tfor _, blk := range blocks {\n\t\tops = append(ops, txn.Op{\n\t\t\tC: blocksC,\n\t\t\tId: blk.Id(),\n\t\t\tRemove: true,\n\t...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
/* (non-Javadoc) @see org.mobicents.isup.messages.ISUPMessage#decodeOptionalBody(byte[], byte)
[ "protected void decodeOptionalBody(ISUPParameterFactory parameterFactory, byte[] parameterBody, byte parameterCode)\n throws ParameterException {\n\n switch (parameterCode & 0xFF) {\n case CauseIndicators._PARAMETER_CODE:\n CauseIndicators cpn = parameterFactory.createCau...
[ "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 instruction about Java programming:", "pos": "Represent the code about Java programming:", "neg": "Represent the code:" }
handle layout command
[ "def cmd_layout(self, args):\n ''''''\n from MAVProxy.modules.lib import win_layout\n if len(args) < 1:\n print(\"usage: layout <save|load>\")\n return\n if args[0] == \"load\":\n win_layout.load_layout(self.mpstate.settings.vehicle_name)\n elif ar...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the filename and key of the config name @param $name @return array
[ "public function getInfo($name)\n {\n $keys = explode('.', $name);\n if (is_array($keys)) {\n $file = array_shift($keys);\n $key = implode('.', $keys);\n } else {\n $file = $name;\n $key = null;\n }\n\n return ['file' => $file, 'key' ...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SetOptions sets the Options field's value.
[ "func (s *IndexFieldStatus) SetOptions(v *IndexField) *IndexFieldStatus {\n\ts.Options = v\n\treturn s\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 Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Checks if a logged event is to be muted for debugging purposes. Also goes through the solo list - only items in there will be logged! :param what: :return:
[ "def is_muted(what):\n \n\n state = False\n\n for item in solo:\n if item not in what:\n state = True\n else:\n state = False\n break\n\n for item in mute:\n if item in what:\n state = True\n break\n\n return state" ]
[ "def is_active(self):\n \n if not self._multiplexer:\n return False\n\n if self._index_cached is not None:\n # If we already have computed the index, use it to determine whether\n # the plugin should be active, and if so, return immediately.\n if any(self._index_cached.values()):\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *JobOperation) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"JobOperation\"}\n\tif s.LambdaInvoke != nil {\n\t\tif err := s.LambdaInvoke.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"LambdaInvoke\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.S3PutObjectAcl ...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Differential cross section dsigma/dEg = Amax(Tp) * F(Tp,Egamma)
[ "def _diffsigma(self, Ep, Egamma):\n \n Tp = Ep - self._m_p\n\n diffsigma = self._Amax(Tp) * self._F(Tp, Egamma)\n\n if self.nuclear_enhancement:\n diffsigma *= self._nuclear_factor(Tp)\n\n return diffsigma" ]
[ "def plogdet(K):\n \n \"\"\"\n egvals = eigvalsh(K)\n return npsum(log(egvals[egvals > epsilon]))" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// MarshalBinary implements encoding BinaryMarshaler interface
[ "func (l *Locale) MarshalBinary() ([]byte, error) {\n\tobj := new(LocaleEncoding)\n\tobj.DefaultDomain = l.defaultDomain\n\tobj.Domains = make(map[string][]byte)\n\tfor k, v := range l.Domains {\n\t\tvar err error\n\t\tobj.Domains[k], err = v.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n...
[ "func (pl *Payload) Decode(data []byte) error {\n\t// Note that this method can't be named UnmarshalBinary, because the gob encoder would call\n\t// this method, resulting in infinite recursion.\n\treturn pl.ReadBinary(bytes.NewBuffer(data))\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Function to publish staging or prod version from local tree, or to promote staging to prod, per passed arg. @param {string} pubScope the scope to publish to.
[ "function mdlPublish(pubScope) {\n let cacheTtl = null;\n let src = null;\n let dest = null;\n\n if (pubScope === 'staging') {\n // Set staging specific vars here.\n cacheTtl = 0;\n src = 'dist/*';\n dest = bucketStaging;\n } else if (pubScope === 'prod') {\n // Set prod specific vars here.\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Generates chunks of audio that represent the wakeword stream
[ "def generate_wakeword_pieces(self, volume):\n \"\"\"\"\"\"\n while True:\n target = 1 if random() > 0.5 else 0\n it = self.pos_files_it if target else self.neg_files_it\n sample_file = next(it)\n yield self.layer_with(self.normalize_volume_to(load_audio(sam...
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Called by TransitionManager to play the transition. This calls createAnimators() to set things up and create all of the animations and then runAnimations() to actually start the animations.
[ "void playTransition(@NonNull ViewGroup sceneRoot) {\n mStartValuesList = new ArrayList<TransitionValues>();\n mEndValuesList = new ArrayList<TransitionValues>();\n matchStartAndEnd(mStartValues, mEndValues);\n\n ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();...
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Gets the after advice result. @param <T> the generic type @param aspectId the aspect id @return the after advice result
[ "@SuppressWarnings(\"unchecked\")\n public <T> T getAfterAdviceResult(String aspectId) {\n return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAfterAdviceResult(aspectId) : null);\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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
将Json转换成对象. @param json @param valueType @return
[ "@Override\r\n\tpublic <T> T toObject(String json, Class<T> clazz) {\r\n\t\treturn toObject(json, clazz, false);\r\n\t}" ]
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code:" }
Adds a command to the library @return Application
[ "public function add($command)\n {\n $tasks = $this->prepper\n ->load(get_class($command))\n ->describe();\n\n $this->library->add(['task' => $tasks, 'class' => $command]);\n\n return $this;\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Warn等级日志,小于Error @param log 日志对象 @param format 格式文本,{} 代表变量 @param arguments 变量对应的参数
[ "public static void warn(Log log, String format, Object... arguments) {\r\n\t\twarn(log, null, format, arguments);\r\n\t}" ]
[ "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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about text processing:" }
sets paragraph format @param PHPRtfLite_ParFormat $parFormat
[ "public function setParFormat(PHPRtfLite_ParFormat $parFormat)\n {\n $this->_rtf->registerParFormat($parFormat);\n $this->_parFormat = $parFormat;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Performs a pre-processing operation on the input string in the given input language @param input The input text @param inputLanguage The language of the input @return The post-processed text
[ "public final String apply(String input, Language inputLanguage) {\n if (input != null && Config.get(this.getClass(), inputLanguage, \"apply\").asBoolean(true)) {\n return performNormalization(input, inputLanguage);\n }\n return input;\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Requests permissions immediately, <b>must be invoked during initialization phase of your application</b>.
[ "@Override @NonNull @CheckReturnValue public Observable<Permission> requestEach(@NonNull final String... permissions) {\n return Observable.just(TRIGGER)\n .compose(ensureEach(permissions));\n }" ]
[ "@Deprecated\n public void startTask(String taskId, String callbackUrl) {\n if (taskId==null || callbackUrl == null) {\n if (FacesContext.getCurrentInstance().isPostback()) {\n // if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added\n // as pr...
codesearchnet
{ "query": "Represent the Github sentence about Access control:", "pos": "Represent the Github code about Access control:", "neg": "Represent the Github code about programming:" }
Retrieve the information for a zone entity.
[ "def get(self, zone_id):\n \"\"\"\"\"\"\n path = '/'.join(['zone', zone_id])\n return self.rachio.get(path)" ]
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Counts additional occurrences of a property as property in references. @param usageStatistics statistics object where count is stored @param property the property to count @param count the number of times to count the property
[ "private void countPropertyReference(UsageStatistics usageStatistics,\n\t\t\tPropertyIdValue property, int count) {\n\t\taddPropertyCounters(usageStatistics, property);\n\t\tusageStatistics.propertyCountsReferences.put(property,\n\t\t\t\tusageStatistics.propertyCountsReferences.get(property) + count);\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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Retrieve all data of repository, paginated @param int $per_page @param array $columns @param string $page_name @param int|null $page @return \Illuminate\Contracts\Pagination\Paginator
[ "public function simplePaginate($per_page = null, $columns = ['*'], $page_name = 'page', $page = null)\n {\n $this->newQuery();\n\n // Get the default per page when not set\n $per_page = $per_page ?: config('repositories.per_page', 15);\n\n return $this->query->simplePaginate($per_pag...
[ "abstract public function __construct(DataAccessInterface $dataSource);\n \n /**\n * Returns an array with all entities for the given data request.\n * \n * @param \\Zepi\\DataSource\\Core\\DataRequest $dataRequest\n * @return false|array\n */\n public function find(DataRequest $dataReq...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Private function to get the common type from the information of the field @param string $fieldName @param string $nativeType @return string
[ "private function getCommonType($fieldName, $nativeType)\n {\n static $types = [\n // integers\n 'int' => CommonTypes::TINT,\n 'tinyint' => CommonTypes::TINT,\n 'smallint' => CommonTypes::TINT,\n 'bigint' => CommonTypes::TINT,\n // floats\n...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Filters a context This will return a new context with only the resources that are actually available for use. Uses tags and command line options to make determination.
[ "def filtered_context(context):\n \"\"\"\"\"\"\n\n ctx = Context(context.opt)\n for resource in context.resources():\n if resource.child:\n continue\n\n if resource.filtered():\n ctx.add(resource)\n\n return ctx" ]
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the summarization about Go programming language:", "pos": "Represent the code about Go programming language:", "neg": "Represent the code:" }
Runs this {@see DayEnumExample}. @param integer $argc The number of arguments. @param string[] $argv The arguments. @return integer Always `0`.
[ "public static function main($argc, array $argv = [])\n {\n $firstDay = new self(DayEnum::MONDAY());\n $firstDay->tellItLikeItIs();\n $thirdDay = new self(DayEnum::WEDNESDAY());\n $thirdDay->tellItLikeItIs();\n $fifthDay = new self(DayEnum::FRIDAY());\n $fifthDay->tellIt...
[ "public void help() {\n p(\"\");\n p(\"Command Description\");\n p(\"======= ===========\");\n p(\"help() Display usage and help messages. \");\n p(\"defineClass(className) Define an extension using the Java class\");\n p(\" ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
@param int $level @throws \OutOfBoundsException
[ "private function checkLevel(int $level)\n {\n if ($level <= 0 || $level > self::MAX_LEVEL_DEPTH) {\n throw new OutOfBounds(\n sprintf('Administrative level should be an integer in [1,%d], %d given', self::MAX_LEVEL_DEPTH, $level)\n );\n }\n }" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Filters out boolish items that resemble none "truthy" values. @return array
[ "public static function compact($array, $reindex = false)\n {\n $out = array_filter($array, function ($item) {\n return false !== (bool)$item;\n });\n\n return false !== $reindex && self::isList($out) ? array_values($out) : $out;\n }" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Handles adding a contact. @param int $userid The id of the user who requested to be a contact @param int $contactid The id of the contact
[ "public static function add_contact(int $userid, int $contactid) {\n global $DB;\n\n $messagecontact = new \\stdClass();\n $messagecontact->userid = $userid;\n $messagecontact->contactid = $contactid;\n $messagecontact->timecreated = time();\n $messagecontact->id = $DB->ins...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(ExportSnapshotRecord exportSnapshotRecord, ProtocolMarshaller protocolMarshaller) {\n\n if (exportSnapshotRecord == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(expor...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Validates that x is a multiple of the reference (`x % ref == 0`)
[ "def is_multiple_of(ref):\n \n def is_multiple_of_ref(x):\n if x % ref == 0:\n return True\n else:\n raise IsNotMultipleOf(wrong_value=x, ref=ref)\n # raise Failure('x % {ref} == 0 does not hold for x={val}'.format(ref=ref, val=x))\n\n is_multiple_of_ref.__nam...
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
// AddFunc takes a function and runs it repeatedly, adding the return values // as fields. // The function should return error when it has exhausted its values
[ "func (f *fieldHolder) AddFunc(fn func() (string, interface{}, error)) error {\n\tfor {\n\t\tkey, rawVal, err := fn()\n\t\tif err != nil {\n\t\t\t// fn is done giving us data\n\t\t\tbreak\n\t\t}\n\t\tf.AddField(key, rawVal)\n\t}\n\treturn nil\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Deregister removed documents. @param RemoveEvent $event
[ "public function handleRemove(RemoveEvent $event)\n {\n $document = $event->getDocument();\n $this->documentRegistry->deregisterDocument($document);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// CheckAddresses returns the uri scheme if the address is valid.
[ "func CheckAddresses(uriList []string, schemes []string) (scheme string) {\n\tcount := len(uriList)\n\tif count < 1 {\n\t\tpanic(ErrURIListEmpty)\n\t}\n\tu, err := url.Parse(uriList[0])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tscheme = u.Scheme\n\tif sort.SearchStrings(schemes, scheme) == len(schemes) {\n\t\tpani...
[ "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 comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
// SetBudgetName sets the BudgetName field's value.
[ "func (s *Budget) SetBudgetName(v string) *Budget {\n\ts.BudgetName = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
redis key: records:tablename: id1 | id2 | id3... eg: the user has three primarykeys id1=1,id2=2,id3=3, so the redisKey is 'records:user:1|2|3'. @return redis key
[ "private String redisKey(ModelExt<?> m) {\n\t\tTable table = m.table();\n\t\tStringBuilder key = new StringBuilder();\n\t\tkey.append(RECORDS);\n\t\tkey.append(table.getName());\n\t\tkey.append(\":\");\n\t\t//fetch primary keys' values\n\t\tString[] primaryKeys = table.getPrimaryKey();\n\t\t//format key\n\t\tfor (i...
[ "def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return a deferred.
[ "def delete(self, **params):\n \"\"\"\"\"\"\n d = self.request('delete', self.instance_url(), params)\n return d.addCallback(self.refresh_from).addCallback(lambda _: self)" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
file can be null, meaning stdin
[ "function readSpecFile(file, options) {\n if (options.verbose > 1) {\n file ? console.error('GET ' + file) : console.error('GET <stdin>');\n }\n if (!file) {\n // standard input\n return readFileStdinAsync();\n } else if (file && file.startsWith('http')) {\n // remote file\n ...
[ "def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Returns the renderer for the given format. @param string $format @throws \AltThree\Badger\Exceptions\InvalidRendererException @return \AltThree\Badger\Render\RenderInterface
[ "protected function getRendererForFormat(string $format)\n {\n if (!isset($this->renderers[$format])) {\n throw new InvalidRendererException('No renders found for the given format: '.$format);\n }\n\n return $this->renderers[$format];\n }" ]
[ "public function PrepareTheDefaultParametersForGeneration() {\n $this->params = array(\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::NameSpaceKey => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::ClassNameKey => null,\n \\Puzzl...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Preprocess string to transform all diacritics and remove other special characters than appropriate :param string: :return:
[ "def preprocess(string):\n \n string = unicode(string, encoding=\"utf-8\")\n # convert diacritics to simpler forms\n string = regex1.sub(lambda x: accents[x.group()], string)\n # remove all rest of the unwanted characters\n return regex2.sub('', string).encode('utf-8')" ]
[ "def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Build a summary list of all the methods in this context
[ "def build_method_summary_list(path_prefix=\"\")\n collect_methods unless @methods\n meths = @methods.sort\n res = []\n meths.each do |meth|\n\tres << {\n \"name\" => CGI.escapeHTML(meth.name),\n \"aref\" => \"#{path_prefix}\\##{meth.aref}\" \n }\n end\n res\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:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the first subset of a given set in this UBTree. @param set the set to search for @return the first subset which is found for the given set or {@code null} if there is none
[ "public SortedSet<T> firstSubset(SortedSet<T> set) {\n if (this.rootNodes.isEmpty() || set == null || set.isEmpty()) {\n return null;\n }\n return firstSubset(set, this.rootNodes);\n }" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Extracts task enterprise column values. @param id task unique ID @param task task instance @param taskVarData task var data @param metaData2 task meta data
[ "private void processTaskEnterpriseColumns(Integer id, Task task, Var2Data taskVarData, byte[] metaData2)\n {\n if (metaData2 != null)\n {\n int bits = MPPUtility.getInt(metaData2, 29);\n task.set(TaskField.ENTERPRISE_FLAG1, Boolean.valueOf((bits & 0x0000800) != 0));\n task.set(T...
[ "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 summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Parse service name from request @return string|boolean
[ "protected function fetchService()\n\t{\n $service = $this->getRouteParam('service');\n $service = $this->parseCanonicalName($service, true);\n \n if (preg_match($this->servicePattern, $service)) {\n return $service;\n } else {\n return false;\n }\n ...
[ "def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetIdentityAttributeValues sets the IdentityAttributeValues field's value.
[ "func (s *TypedLinkSpecifier) SetIdentityAttributeValues(v []*AttributeNameAndValue) *TypedLinkSpecifier {\n\ts.IdentityAttributeValues = 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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
This is more expensive than normal.
[ "@Override\r\n public void clear() {\r\n // iterate over all keys in originalMap and set them to null in deltaMap\r\n for (K key : originalMap.keySet()) {\r\n deltaMap.put(key, ErasureUtils.<Collection<V>>uncheckedCast(removedValue));\r\n }\r\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// removeOpcode will remove any opcode matching ``opcode'' from the opcode // stream in pkscript
[ "func removeOpcode(pkscript []parsedOpcode, opcode byte) []parsedOpcode {\n\tretScript := make([]parsedOpcode, 0, len(pkscript))\n\tfor _, pop := range pkscript {\n\t\tif pop.opcode.value != opcode {\n\t\t\tretScript = append(retScript, pop)\n\t\t}\n\t}\n\treturn retScript\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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set language. @param \BlackForest\PiwikBundle\Entity\PiwikLanguage|null $language @return PiwikVisit
[ "public function setLanguage(\\BlackForest\\PiwikBundle\\Entity\\PiwikLanguage $language = null)\n {\n $this->language = $language;\n\n return $this;\n }" ]
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
:nocov: @visibility private
[ "def inspect\n ['{config', *each.map{|key, value| \" \"+qualified_key(*key)+\" => \"+value.inspect },'}'].join(\"\\n\")\n end" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetBudgetName sets the BudgetName field's value.
[ "func (s *DeleteSubscriberInput) SetBudgetName(v string) *DeleteSubscriberInput {\n\ts.BudgetName = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get the extension that matches given mimetype. @param string $mimetype @return mixed null when not found, extension (string) when found.
[ "public function getExtension($mimetype)\n {\n if (!($extension = array_search($mimetype, $this->mainMimeTypes))) {\n $extension = array_search($mimetype, $this->mimeTypes);\n }\n\n return !$extension ? null : $extension;\n }" ]
[ "private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Public API for generating a URL pathname from a path and parameters.
[ "function generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}" ]
[ "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 about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// SetScheduleTimezone sets the ScheduleTimezone field's value.
[ "func (s *GetMaintenanceWindowOutput) SetScheduleTimezone(v string) *GetMaintenanceWindowOutput {\n\ts.ScheduleTimezone = &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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get a dimension. @param Image $image The source image. @param string $field The requested field. @return double|null The dimension.
[ "public function getDimension(Image $image, $field)\n {\n if ($this->{$field}) {\n return (new Dimension($image, $this->getDpr()))->get($this->{$field});\n }\n }" ]
[ "function parseFormulaData (nulls, operation, result) {\n /**\n * @description\n * Object containing formula data\n *\n * @typedef {object} carto.dataview.FormulaData\n * @property {number} nulls - Number of null values in the column\n * @property {string} operation - Operation used\n * @property {nu...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Remove HashTable item @param PHPExcel_IComparable $pSource Item to remove @throws PHPExcel_Exception
[ "public function remove(PHPExcel_IComparable $pSource = null) {\n\t\t$hash = $pSource->getHashCode();\n\t\tif (isset($this->_items[$hash])) {\n\t\t\tunset($this->_items[$hash]);\n\n\t\t\t$deleteKey = -1;\n\t\t\tforeach ($this->_keyMap as $key => $value) {\n\t\t\t\tif ($deleteKey >= 0) {\n\t\t\t\t\t$this->_keyMap[$k...
[ "public function isImplemented($pFunction = '')\n {\n $pFunction = strtoupper($pFunction);\n if (isset(self::$PHPExcelFunctions[$pFunction])) {\n return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY');\n } else {\n retur...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Loop forever, pushing out stats.
[ "def run(self):\n \"\"\"\"\"\"\n self.graphite.start()\n while True:\n log.debug('Graphite pusher is sleeping for %d seconds', self.period)\n time.sleep(self.period)\n log.debug('Pushing stats to Graphite')\n try:\n self.push()\n log.debug('Done pushing stats to Graphite')...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// CheckShell checks that a shell is supported, and returns the correct command name
[ "func CheckShell(shell string) (string, error) {\n\tif _, ok := ValidShells[shell]; !ok {\n\t\treturn \"\", fmt.Errorf(\"unsupported shell: %q\", shell)\n\t}\n\tswitch shell {\n\tcase \"powershell\":\n\t\tif _, err := exec.LookPath(\"powershell\"); err == nil {\n\t\t\treturn \"powershell\", nil\n\t\t} else if _, er...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Roll updates the checksum of the window from the entering byte. You // MUST initialize a window with Write() before calling this method.
[ "func (d *Adler32) Roll(b byte) {\n\t// This check costs 10-15% performance. If we disable it, we crash\n\t// when the window is empty. If we enable it, we are always correct\n\t// (an empty window never changes no matter how much you roll it).\n\t//if len(d.window) == 0 {\n\t//\treturn\n\t//}\n\t// extract the ent...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Delete a single item with the given ID
[ "def delete(self, id):\n ''''''\n if not self._item_path:\n raise AttributeError('delete is not available for %s' % self._item_name)\n target = self._item_path % id\n self._redmine.delete(target)\n return None" ]
[ "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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Refer to the Mailgun documentation for more information.
[ "func (m *Message) SetTrackingOpens(trackingOpens bool) {\n\tm.trackingOpens = trackingOpens\n\tm.trackingOpensSet = true\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Not reverses the results of its given child matcher. // // Example usage: // Not(Eq(5)).Matches(4) // returns true // Not(Eq(5)).Matches(5) // returns false
[ "func Not(x interface{}) Matcher {\n\tif m, ok := x.(Matcher); ok {\n\t\treturn notMatcher{m}\n\t}\n\treturn notMatcher{Eq(x)}\n}" ]
[ "@SuppressWarnings(\"GoodTime\") // false positive; b/122617528\n public void containsAnyOf(int first, int second, int... rest) {\n check().that(actualList).containsAnyOf(first, second, box(rest));\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set limit on the number of propagations.
[ "def prop_budget(self, budget):\n \n\n if self.minisat:\n pysolvers.minisatgh_pbudget(self.minisat, budget)" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
设置缓存 @param string $key @param mixed $value @param int $expire -1 永不过期 0默认配置 @throws \Error
[ "public static function set($key, $value, $expire = 0) {\n try {\n self::getCache()->set($key, $value, $expire);\n self::release();\n } catch (\\RuntimeException $e) {\n self::release();\n throw $e;\n } catch (\\Error $e) {\n self::release(...
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Outputs the FontAwesomeText object as an HTML string @access protected @return string HTML string of text element
[ "protected function output()\n {\n $attrs = '';\n $classes = 'fa-layers-text';\n $transforms = '';\n\n if (!empty($this->classes) && count($this->classes) > 0) {\n $classes .= ' ' . implode(' ', $this->classes);\n }\n\n if (!empty($this->attributes) && count...
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Return a single frame.
[ "@SuppressWarnings(\"unused\") // called through reflection by RequestServer\n public FramesV3 fetch(int version, FramesV3 s) {\n FramesV3 frames = doFetch(version, s);\n\n // Summary data is big, and not always there: null it out here. You have to call columnSummary\n // to force computation of the summ...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Performs all data validation that is appicable to the data value itself @param object - the data value @throws DataValidationException if any of the data constraints are violated
[ "@SuppressWarnings(\"unchecked\")\r\n public void postValidate(Object object) throws DataValidationException {\r\n if (_values != null || _ranges != null) {\r\n if (_values != null) for (Object value: _values) {\r\n if (value.equals(object)) return;\r\n }\r\n\r\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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
@param ContentInterface $content @return array
[ "protected function extractMediasFromContentType(ContentTypeInterface $contentType)\n {\n $mediaIds = array();\n $fields = $contentType->getFields();\n\n foreach ($fields as $field) {\n if ($this->isMediaAttribute($field->getDefaultValue())) {\n $mediaIds[] = $field...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Setter for **self.__splitters** attribute. :param value: Attribute value. :type value: tuple or list
[ "def splitters(self, value):\n \n\n if value is not None:\n assert type(value) in (tuple, list), \"'{0}' attribute: '{1}' type is not 'tuple' or 'list'!\".format(\n \"splitters\", value)\n for element in value:\n assert type(element) is unicode, \"'{...
[ "def start_index(self, value):\n \"\"\"\"\"\"\n # TODO: Validate contents? (May want to set before adding the data.)\n if not isinstance(value, dict):\n raise TypeError('start_index attribute must be a dict.')\n self._start_index = value" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Assign float value to inputOutput SFFloat field named speed. Note that our implementation with ExoPlayer that pitch and speed will be set to the same value. @param newValue
[ "public void setSpeed(float newValue) {\n if (newValue < 0) newValue = 0;\n this.pitch.setValue( newValue );\n this.speed.setValue( newValue );\n }" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
set loglevel based on NODE_DEBUG env variable and create exported methods
[ "function initialize() {\n var flags = [];\n\n Object.keys( levels ).forEach(function( type, level ) {\n var method = type.toLowerCase();\n exports[ method ] = log.bind( exports, type, level, false );\n exports[ method ].json = log.bind( exports, type, level, true );\n if ( new RegExp( '\\\\b' + type ...
[ "def get_project() -> Optional[str]:\n \n project = SETTINGS.project\n if not project:\n require_test_mode_enabled()\n raise RunError('Missing project name; for test mode, please set PULUMI_NODEJS_PROJECT')\n return project" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Create presets of an image @param string $path
[ "public static function createPresets($path = null, $callback = null) {\n $moufManager = MoufManager::getMoufManager();\n $instances = $moufManager->findInstances('Mouf\\\\Utils\\\\Graphics\\\\MoufImagine\\\\Controller\\\\ImagePresetController');\n foreach ($instances as $instanceName) {\n ...
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }