query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Find all possible orientations for an item. @param Item $item @param OrientatedItem|null $prevItem @param int $widthLeft @param int $lengthLeft @param int $depthLeft @return OrientatedItem[]
[ "public function getPossibleOrientations(\n Item $item,\n ?OrientatedItem $prevItem,\n int $widthLeft,\n int $lengthLeft,\n int $depthLeft\n ): array {\n $orientations = [];\n\n //Special case items that are the same as what we just packed - keep orientation\n ...
[ "public static function fromComponent(IColumnComponent $component) : ChartAxis\n {\n return new self($component->getName(), $component->getLabel(), [$component]);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Getter for possible incorrect extension info in metadata.php. If the module patches a namespace class it must either belong to the shop Unified Namespace or to another module. @param \OxidEsales\Eshop\Core\Module\Module $module @return array
[ "public function getIncorrectExtensions(\\OxidEsales\\Eshop\\Core\\Module\\Module $module)\n {\n $incorrect = [];\n $rawExtensions = $module->getExtensions();\n\n foreach ($rawExtensions as $classToBePatched => $moduleClass) {\n if (NamespaceInformationProvider::isNamespacedClass(...
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Handle outside image pixels by extending the image.
[ "public static float safeGet( GrayF32 input , int x , int y ) {\n\t\tif( x < 0 )\n\t\t\tx = 0;\n\t\telse if( x >= input.width )\n\t\t\tx = input.width-1;\n\t\tif( y < 0 )\n\t\t\ty = 0;\n\t\telse if( y >= input.height )\n\t\t\ty = input.height-1;\n\n\t\treturn input.unsafe_get(x,y);\n\t}" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set up a calculated instance ready to store a slot question's stats. @param int $slot @param object $question @param int|null $variant Is this to keep track of a variant's stats? If so what is the variant, if not null.
[ "public function initialise_for_slot($slot, $question, $variant = null) {\n $newqstat = new calculated($question, $slot, $variant);\n if ($variant === null) {\n $this->questionstats[$slot] = $newqstat;\n } else {\n $this->questionstats[$slot]->variantstats[$variant] = $new...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Shows a list of all the blocks & widgets. @return void
[ "public function index()\n {\n $this->loadModel('Block.Blocks');\n if ($this->request->isPost()) {\n if ($this->_reorder()) {\n $this->Flash->success(__d('block', 'Blocks ordering updated!'));\n }\n $this->redirect(['plugin' => 'Block', 'controller' =...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Converts a C pre-processor expression into an equivalent Python expression that can be evaluated.
[ "def CPP_to_Python(s):\n \n s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s)\n for expr, repl in CPP_to_Python_Eval_List:\n s = expr.sub(repl, s)\n return 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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Call one of libsndfile's read/write functions.
[ "def _cdata_io(self, action, data, ctype, frames):\n \"\"\"\"\"\"\n assert ctype in _ffi_types.values()\n self._check_if_closed()\n if self.seekable():\n curr = self.tell()\n func = getattr(_snd, 'sf_' + action + 'f_' + ctype)\n frames = func(self._file, data, fr...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Define property with inheritance value of the property :param prop: property :type prop: str :return: None
[ "def apply_partial_inheritance(self, prop):\n \n for i in itertools.chain(iter(list(self.items.values())),\n iter(list(self.templates.values()))):\n self.get_property_by_inheritance(i, prop)\n # If a \"null\" attribute was inherited, delete it\n ...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
///////////////////////////////////
[ "public void write(DataOutput out) throws IOException {\n if (getDataTransferVersion() >= DataTransferProtocol.FEDERATION_VERSION) {\n out.writeInt(namespaceId);\n }\n out.writeLong(blockId);\n out.writeLong(numBytes);\n out.writeLong(genStamp);\n out.writeInt(pipelineDepth);\n getWritePip...
[ "func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}" ]
codesearchnet
{ "query": "Represent the comment about Language and Writing:", "pos": "Represent the code about Language and Writing:", "neg": "Represent the code about programming:" }
// findTableByPartitionID finds the partition-table info by the partitionID. // This function will traverse all the tables to find the partitionID partition in which partition-table.
[ "func findTableByPartitionID(schema infoschema.InfoSchema, partitionID int64) (*model.TableInfo, *model.DBInfo) {\n\tallDBs := schema.AllSchemas()\n\tfor _, db := range allDBs {\n\t\tallTables := schema.SchemaTables(db.Name)\n\t\tfor _, tbl := range allTables {\n\t\t\tif tbl.Meta().ID > partitionID || tbl.Meta().Ge...
[ "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 comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Returns an absolute path for the given
[ "def relative_to_absolute(path)\n if Pathname.new(path).absolute?\n Pathname.new(path)\n else\n Pathname.new(\"#{Pathname.pwd}/#{path}\")\n end\n end" ]
[ "@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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return whether there is a path leading from me to ``dest``. With ``weight``, only consider edges that have a stat by the given name. Raise ``ValueError`` if ``dest`` is not a node in my character or the name of one.
[ "def path_exists(self, dest, weight=None):\n \n try:\n return bool(self.shortest_path_length(dest, weight))\n except KeyError:\n return False" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
テーブル定義ファイルを解析する @param string $path_definition_file Path to Table Definition File (default to `$config->path_definition_file`) @return object Table Definition Info.
[ "public function parse_definition_file( $path_definition_file = null ){\n\t\tif(!strlen($path_definition_file)){\n\t\t\t$path_definition_file = $this->config->path_definition_file;\n\t\t}\n\t\tif( !is_file($path_definition_file) || !is_readable($path_definition_file) ){\n\t\t\ttrigger_error('File NOT found, or NOT ...
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Deployment ///////////////////////////////////////////////
[ "public AuthorizationEntity[] newDeployment(Deployment deployment) {\n ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();\n IdentityService identityService = processEngineConfiguration.getIdentityService();\n Authentication currentAuthentication = identityS...
[ "protected function welcomeMessage ()\n {\n $this->comment ('');\n $this->comment ('**************************************************');\n $this->comment (' Welcome to HoneyComb CMS initial configuration!!!');\n $this->comment ('**************************************************');\n...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Add oauth2 server
[ "function(serverName, config, options) {\n this.methods[serverName] = {};\n this.config.servers[serverName] = config;\n var self = this;\n ['valid_grant', 'treat_access_token', 'transform_token_response'].forEach(function(fctName) {\n self.methods[serverName][fctName] = options[fctName] || self[fct...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eSet(int featureID, Object newValue)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase TypesPackage.JVM_MEMBER__DECLARING_TYPE:\n\t\t\t\tsetDeclaringType((JvmDeclaredType)newValue);\n\t\t\t\treturn;\n\t\t\tcase TypesPackage.JVM_MEMBER__VISIBILITY:\n\t\t\t\tsetVisibility((JvmVisibility)newVal...
[ "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 instruction about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
// SetPolicyId sets the PolicyId field's value.
[ "func (s *DescribePolicyInput) SetPolicyId(v string) *DescribePolicyInput {\n\ts.PolicyId = &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:" }
Returns array of size (2, nparam, naq)
[ "def disvec(self, x, y, aq=None):\n ''''''\n if aq is None: aq = self.model.aq.find_aquifer_data(x, y)\n return np.sum(self.parameters * self.disvecinf(x, y, aq), 1)" ]
[ "def block_sep0(self, Y):\n \n \"\"\"\n\n return Y[(slice(None),)*self.blkaxis + (slice(0, self.blkidx),)]" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
打开SSH会话,并绑定远程端口到本地的一个随机端口 @param sshConn SSH连接信息对象 @param remoteHost 远程主机 @param remotePort 远程端口 @return 映射后的本地端口 @throws JschRuntimeException 连接异常
[ "public static int openAndBindPortToLocal(Connector sshConn, String remoteHost, int remotePort) throws JschRuntimeException {\r\n\t\tfinal Session session = openSession(sshConn.getHost(), sshConn.getPort(), sshConn.getUser(), sshConn.getPassword());\r\n\t\tif (session == null) {\r\n\t\t\tthrow new JschRuntimeExcept...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Verify that the handler options have been set to meaningful values. @param mixed $fromHandlers @param mixed $toHandlers @param OutputInterface $output @return bool
[ "protected function validateHandlerOptions(\n $fromHandlers,\n $toHandlers,\n OutputInterface $output\n ) {\n foreach (['From' => $fromHandlers, 'To' => $toHandlers] as $direction => $handlers) {\n $lowerDirection = strtolower($direction);\n if (count($handlers) ...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Configurable parallel map context manager. Returns appropriate map compatible function based on configuration: - Local single core (the default) - Multiple local cores
[ "def cpmap(cores=1):\n \n if int(cores) == 1:\n yield itertools.imap\n else:\n if futures is None:\n raise ImportError(\"concurrent.futures not available\")\n pool = futures.ProcessPoolExecutor(cores)\n yield pool.map\n pool.shutdown()" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Try to get the sup/inf of two functions by looking at the piecewise components.
[ "private FunctionType tryMergeFunctionPiecewise(FunctionType other, boolean leastSuper) {\n Node newParamsNode = null;\n if (call.hasEqualParameters(other.call, EquivalenceMethod.IDENTITY, EqCache.create())) {\n newParamsNode = call.parameters;\n } else {\n // If the parameters are not equal, don...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Gets the relationship view for the given relationship. @param relationship the Relationship to find the RelationshipView for @return an RelationshipView object, or null if the relationship doesn't exist in the view
[ "public RelationshipView getRelationshipView(@Nonnull Relationship relationship) {\n Optional<RelationshipView> relationshipView = this.relationshipViews.stream().filter(rv -> rv.getId().equals(relationship.getId())).findFirst();\n return relationshipView.orElse(null);\n }" ]
[ "private function getColumnFromName($name)\n {\n foreach ($this->columnConfiguration as $i => $col) {\n if ($col->getName() == $name) {\n return $col;\n }\n }\n\n // This exception should never happen. If it does, something is\n // wrong w/ the rel...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// ReportError is a function that can be used to report errors to // ErrorHandler. It is used in ShutdownManagers.
[ "func (gs *GracefulShutdown) ReportError(err error) {\n\tif err != nil && gs.errorHandler != nil {\n\t\tgs.errorHandler.OnError(err)\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Função responsável por gerar um cpf válido @return string
[ "public static function gerar()\n {\n $cpf = array ();\n for ($i = 0; $i < 9; $i++) {\n $cpf[$i] = rand(0, 9);\n }\n\n // Primeiro dígito\n $soma = 0;\n for ($i = 0; $i < 9; $i++) {\n $soma += ((10 - $i) * $cpf[$i]);\n }\n $d1 = 11 - (...
[ "def associar_assinatura(self, sequencia_cnpj, assinatura_ac):\n \n retorno = super(ClienteSATLocal, self).\\\n associar_assinatura(sequencia_cnpj, assinatura_ac)\n # (!) resposta baseada na redação com efeitos até 31-12-2016\n return RespostaSAT.associar_assinatura(retorn...
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Returns PortRange instance for UDP source sockets. If the udp.source.port.range property is set, the class will be initialized with the specified port ranges. @return PortRange the default instace of this class.
[ "public static synchronized PortRange getUdpSourceInstance() {\n if (udpSourcePortRange == null) {\n udpSourcePortRange = new PortRange();\n udpSourcePortRange.init(\n CoGProperties.getDefault().getUdpSourcePortRange());\n }\n return udpSourcePortRange;\n ...
[ "def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Gets the ``Grade`` corresponding to the assessment difficulty. return: (osid.grading.Grade) - the level raise: OperationFailed - unable to complete request *compliance: mandatory -- This method must be implemented.*
[ "def get_level(self):\n \n # Implemented from template for osid.resource.Resource.get_avatar_template\n if not bool(self._my_map['levelId']):\n raise errors.IllegalState('this Assessment has no level')\n mgr = self._get_provider_manager('GRADING')\n if not mgr.supports_...
[ "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 comment about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about Software development:" }
SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ } @return SchemaDefinitionNode @throws SyntaxErrorException
[ "protected function lexSchemaDefinition(): SchemaDefinitionNode\n {\n $start = $this->lexer->getToken();\n\n $this->expectKeyword(KeywordEnum::SCHEMA);\n\n return new SchemaDefinitionNode(\n $this->lexDirectives(),\n $this->many(\n TokenKindEnum::BRACE_L,...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// Convert from sparse Sketch to dense Sketch.
[ "func (sk *Sketch) toNormal() {\n\tif len(sk.tmpSet) > 0 {\n\t\tsk.mergeSparse()\n\t}\n\n\tsk.regs = newRegisters(sk.m)\n\tfor iter := sk.sparseList.Iter(); iter.HasNext(); {\n\t\ti, r := decodeHash(iter.Next(), sk.p, pp)\n\t\tsk.insert(i, r)\n\t}\n\n\tsk.sparse = false\n\tsk.tmpSet = nil\n\tsk.sparseList = nil\n}"...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Adapted from pandas.tseries.index._field_accessor
[ "def _field_accessor(name, docstring=None, min_cftime_version='0.0'):\n \"\"\"\"\"\"\n\n def f(self, min_cftime_version=min_cftime_version):\n import cftime\n\n version = cftime.__version__\n\n if LooseVersion(version) >= LooseVersion(min_cftime_version):\n return get_date_fiel...
[ "def execute_cast_simple_literal_to_timestamp(op, data, type, **kwargs):\n \"\"\"\"\"\"\n return pd.Timestamp(data, tz=type.timezone)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetReaderWithRange retrieves an object from an S3 bucket using the specified range, // returning the body of the HTTP response. // It is the caller's responsibility to call Close on rc when // finished reading.
[ "func (b *Bucket) GetReaderWithRange(ctx context.Context, path string, begin, end int64) (rc io.ReadCloser, err error) {\n\theader := make(http.Header)\n\theader.Add(\"Range\", fmt.Sprintf(\"bytes=%d-%d\", begin, end-1))\n\tresp, err := b.GetResponseWithHeaders(ctx, path, header)\n\tif resp != nil {\n\t\treturn res...
[ "void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a...
codesearchnet
{ "query": "Represent the Github instruction about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code:" }
Set the piwik url. @param string $url @return self
[ "public function piwikUrl($url)\n {\n $this->piwikUrl = (string) $url;\n\n //ensure the url is ending by \"/\"\n if (substr($this->piwikUrl, -1) !== '/') {\n $this->piwikUrl .= '/';\n }\n\n return $this;\n }" ]
[ "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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Run all due jobs in the foreground.
[ "public function runInForeground(DateTime $now = null) : array\n {\n $jobs = $this->getDueJobs($now);\n\n $outputs = [];\n\n foreach ($jobs as $job) {\n $outputs[] = $job->runInForeground();\n }\n\n return $outputs;\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Add an unqualified edge to the network.
[ "def _add_unqualified_edge(self, source: Node, target: Node, key: str, bel: str, data: EdgeData) -> Edge:\n \"\"\"\"\"\"\n return self.get_or_create_edge(\n source=source,\n target=target,\n relation=data[RELATION],\n bel=bel,\n sha512=key,\n ...
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Format. @param str String @return String
[ "public static String format(final String str) {\r\n\t\tfinal NumericShaper shaper = NumericShaper.getContextualShaper(NumericShaper.EASTERN_ARABIC);\r\n\t\tfinal char[] c = str.toCharArray();\r\n\t\tshaper.shape(c, 0, c.length, NumericShaper.EASTERN_ARABIC);\r\n\t\treturn new String(c);\r\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Runs stage four injecting of homology knowledge. @param pn {@link ProtoNetwork} @return the {@link ProtoNetwork} with homology knowledge injected
[ "private ProtoNetwork stage4(final ProtoNetwork pn) {\n beginStage(PHASE3_STAGE4_HDR, \"4\", NUM_PHASES);\n\n if (!getPhaseConfiguration().getInjectOrthology()) {\n final StringBuilder bldr = new StringBuilder();\n bldr.append(ORTHO_INJECTION_DISABLED);\n markEndStage(...
[ "public void setLossVariables(String... lossVariableNames){\n this.lossVariables.clear();\n for(String s : lossVariableNames){\n addLossVariable(s);\n }\n //After changing loss function variables, we (probably) need to recreate gradient function - as gradient\n // funct...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
アプリケーション変数を削除します。 @param string $name アプリケーション変数名
[ "public static function RemoveClassVar ($name) {\n\t\t$name = Arrays::AdjustArray($name);\n\t\tif (Arrays::AdjustValue(static::$_ApplicationVariableTrait_ConstList, implode('=>', Arrays::AdjustArray($name)))) {\n\t\t\tthrow CoreException::RaiseSystemError('%s is constant', [implode(' => ', $name)]);\n\t\t}\n\t\tsta...
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Implementation of :py:func:`pynspect.traversers.RuleTreeTraverser.function` interface.
[ "def function(self, rule, args, **kwargs):\n \n fname = rule.function\n try:\n return self.functions[fname](args)\n except KeyError:\n raise FilteringRuleException(\"Invalid function name '{}'\".format(fname))" ]
[ "def setup():\n \n if None in [RTs._rt, RTs._rtp]:\n RTs._rt = RefactoringTool(myfixes)\n RTs._rtp = RefactoringTool(myfixes, {'print_function': True})" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Insert or update without dealing with mass assignment @param array $attributes @param string|array $key @param array $options @return \Laranix\Support\Database\Model
[ "public function updateOrCreateNew(array $attributes, $key, array $options = []) : Model\n {\n $query = $this->newQuery();\n\n if (is_array($key)) {\n foreach ($key as $column) {\n $query->where($column, $attributes[$column]);\n }\n } else {\n ...
[ "protected function isQueryAttribute()\n {\n if( $query = ($this->settings['query'] ?? NULL) )\n {\n $this->settings['getrow'] = Singleton::class('ZN\\Database\\DB')->query($query)->row();\n }\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// cleanupOldDeployments deletes old replication controller deployments if their quota has been reached
[ "func (c *DeploymentConfigController) cleanupOldDeployments(existingDeployments []*v1.ReplicationController, deploymentConfig *appsv1.DeploymentConfig) error {\n\tif deploymentConfig.Spec.RevisionHistoryLimit == nil {\n\t\t// there is no past deplyoment quota set\n\t\treturn nil\n\t}\n\n\tprunableDeployments := app...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
@param $status @param string $groupSlug @return \Illuminate\Database\Eloquent\Collection
[ "private function findFollowedBy($status = null)\n {\n\n $query = Follower::where(function ($query) {\n $query->whereFollowing($this);\n });\n\n //if $status is passed, add where clause\n if (!is_null($status)) {\n $query->where('status', $status);\n }\n\n...
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
{@inheritDoc} @see \Duktig\Core\Exception\Handler\HandlerInterface::throwableToResponse() If a template is not available for this throwable instance, it sets a simple default HTML in the response body. @param \Throwable $e @return ResponseInterface
[ "public function throwableToResponse(\\Throwable $e) : ResponseInterface\n {\n $response = $this->responseFactory->createResponse();\n \n if ($e instanceof HttpException) {\n $statusCode = $e->getStatusCode();\n } else {\n $statusCode = $e->getCode() != 0 ? $e->g...
[ "public function routeByObject($object) : array\n {\n Assert::isObject($object, \"Passed non object value to Commmand Bus: \" . TypeDescriptor::createFromVariable($object)->toString() . \". Did you wanted to use convertAndSend?\");\n\n $className = get_class($object);\n if (!array_key_exists...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Return the path to the solc compiler. This funtion will search for the solc binary in the $PATH and return the path of the first executable occurence.
[ "def get_compiler_path():\n \n # If the user provides a specific solc binary let's use that\n given_binary = os.environ.get('SOLC_BINARY')\n if given_binary:\n return given_binary\n\n for path in os.getenv('PATH', '').split(os.pathsep):\n path = path.strip('\"')\n executable_path...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
[解析路径] @param {[type]} path [路径] @return {[type]} [路径+参数数组]
[ "function parsePath(path) {\n if (!path) return\n if (path.indexOf(',') == -1) {\n return {\n path : path.replace(/\\s/g, '')\n }\n } else {\n let segments = path.split(\",\"),\n vars = segments.slice(1)\n return {\n path: segments[0].replace(/\\...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Transform cell data (i.e., data specified per cell) into point data (i.e., data specified at cell points). The method of transformation is based on averaging the data values of all cells using a particular point.
[ "def mapCellsToPoints(self):\n \n c2p = vtk.vtkCellDataToPointData()\n c2p.SetInputData(self.polydata(False))\n c2p.Update()\n return self.updateMesh(c2p.GetOutput())" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Resets the password associated with the user's login profile. :type user_name: string :param user_name: The name of the user :type password: string :param password: The new password for the user
[ "def update_login_profile(self, user_name, password):\n \n params = {'UserName' : user_name,\n 'Password' : password}\n return self.get_response('UpdateLoginProfile', params)" ]
[ "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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Parses the MSON input into an array. @param string $data Must be valid MSON @param string $format Format to decode. Defaults to `json` @return array Array of MSON data
[ "public static function parse($data, $format = 'json')\n {\n if (!array_key_exists($format, self::$decoders)) {\n throw new Exception('Invalid decoder.');\n }\n $decoder = self::$decoders[$format];\n\n $input = file_put_contents('/tmp/input', $data);\n $params = \"dr...
[ "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:" }
Truncates a file to a given length @param string $file @param int $limit = 0 @param string $mode = 'r+'
[ "public static function truncate(String $file, Int $limit = 0, String $mode = 'r+')\n {\n $file = Info::rpath($file);\n\n if( ! is_file($file) )\n {\n throw new Exception\\FileNotFoundException(NULL, $file);\n }\n\n $fileOpen = fopen($file, $mode);\n $fileWri...
[ "function toString()\n {\n $ModeXXX = implode('', $this->mode_xxx);\n if (!array_key_exists($ModeXXX, $this->mode_available))\n throw new \\Exception(sprintf(\n 'Invalid Open Mode Statement (%s). it`s must readable/writable or both with optional flags.'\n .'...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Documentation:" }
/* (non-Javadoc) @see com.ibm.ws.objectManager.ObjectStore#clear()
[ "protected synchronized void clear()\n throws ObjectManagerException\n {\n final String methodName = \"clear\";\n if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())\n trace.entry(this, cclass, methodName);\n\n super.clear();\n inMemoryManagedObj...
[ "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:" }
Builds and returns the external link form @return Form
[ "public function EditorExternalLink()\n {\n // Show link text field if requested\n $showLinkText = $this->controller->getRequest()->getVar('requireLinkText');\n $factory = EditorExternalLinkFormFactory::singleton();\n return $factory->getForm(\n $this->controller,\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Returns a list of all values for the field with the given $key @param string $key @return array
[ "public function getFieldValues($key)\n {\n $values = array();\n $key = strtolower($key);\n\n foreach ($this->fields as $part => $value) {\n if (strtolower($part) === $key) {\n if (is_array($value)) {\n foreach ($value as $v) {\n ...
[ "protected function process()\n {\n\n // query whether or not, we've found a new path => means we've found a new category\n if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {\n return;\n }\n\n // process the parent instance\n parent::process();...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// SetMarker sets the Marker field's value.
[ "func (s *ListLayerVersionsInput) SetMarker(v string) *ListLayerVersionsInput {\n\ts.Marker = &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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
创建只输出非Null且非Empty(如List.isEmpty)的属性到Json字符串的Mapper,建议在外部接口中使用.
[ "public synchronized static JsonMapper nonEmptyMapper() {\r\n if (nonEmptyJsonMapper == null) {\r\n nonEmptyJsonMapper = new JsonMapper(JsonInclude.Include.NON_EMPTY, false);\r\n }\r\n return nonEmptyJsonMapper;\r\n }" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Decodes the hostname component according to parser mode. @param string $hostname The parsed hostname @return string The decoded hostname @throws \InvalidArgumentException If the hostname is not valid
[ "private function decodeHost($hostname)\n {\n if (preg_match('/^[\\\\x00-\\\\x7F]*$/', $hostname)) {\n return $hostname;\n } elseif ($this->mode !== self::MODE_IDNA2003) {\n throw new \\InvalidArgumentException(\"Invalid hostname '$hostname'\");\n }\n\n $hostname...
[ "def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Takes the default title. @return string
[ "public function getDefaultTitle()\n {\n if (empty($this->title_default)) {\n return $this->config->get('defaults.title', null);\n }\n\n return $this->title_default;\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:" }
Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code. @param fromPath from path @param toPath to path @param status status code
[ "public void delete(String fromPath, String toPath, Status status) {\n http.delete(fromPath, redirectRoute(toPath, status));\n }" ]
[ "function createServer () {\n\n // Create server\n\n var server = express.createServer();\n\n // Configure Server\n\n server.configure(function () {\n\n // Built-in\n\n server.use(express.methodOverride()); // Allow method override using _method form parameter\n ...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Create an instance of {@link JAXBElement }{@code <}{@link CurvePropertyType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link CurvePropertyType }{@code >}
[ "@XmlElementDecl(namespace = \"http://www.opengis.net/gml\", name = \"curveMember\")\n public JAXBElement<CurvePropertyType> createCurveMember(CurvePropertyType value) {\n return new JAXBElement<CurvePropertyType>(_CurveMember_QNAME, CurvePropertyType.class, null, value);\n }" ]
[ "@Nonnull\n public static <T> UBL21WriterBuilder <T> create (@Nonnull final Class <T> aClass)\n {\n return new UBL21WriterBuilder <> (aClass);\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returned expression results in true if the array contains value.
[ "public static Expression arrayContains(String expression, Expression value) {\n return arrayContains(x(expression), value);\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get the action for a "url" option. @param array|string $options @return string
[ "protected function getUrl($options)\n {\n foreach ($options as $key => $value) {\n $$key = $value;\n }\n\n $secure = null;\n if (isset($options['secure'])) {\n $secure = true === $options['secure'] ? true : false;\n }\n\n if (is_array($url)) {\n ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Sets any non-user authentication information associated with the request, such as an authentication token.
[ "def auth(self, value):\n \n self._auth = value\n self._request.auth = value" ]
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
use this method to add any variables to the render method that you may require for some view. @param string $sViewName - the view being requested @param string $sViewType - the location of the view (Core, Custom-Core, Customer) @return array
[ "protected function &GetAdditionalViewVariables($sViewName, $sViewType)\n {\n $aViewVariables = &parent::GetAdditionalViewVariables($sViewName, $sViewType);\n\n $aViewVariables['bShowNewsletterSignup'] = true;\n $aViewVariables['newsletter'] = false;\n $aInput = TGlobal::instance()->G...
[ "public function getTemplateFile($filename, $data)\n {\n $data['getRegion'] = function($name) { \n return $this->getRegion($name); \n }; // This is for mustache compatibility\n\n // Push the data into regions and then pass a pointer to this class to the layout\n // $thi...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
invoke that the method has been called. You really shouldn't use this method.
[ "def invoke(object, args, block, called_from)\n check_arity!(args.size)\n\n if base_object.is_a? Class\n result = if @plan\n check_for_too_many_arguments!(@plan)\n @plan.call(object, *args, &block)\n end\n else\n result = if @plan\n ...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Orders installers by dependencies @return void
[ "private function orderInstallersByDependencies()\n {\n $sequenceForClasses = [];\n\n // If installers were already ordered by number then we need\n // to remove classes which are not instances of OrderedInstallerInterface\n // in case installers implementing DependentInstallerInterfa...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns all found resolvers @return
[ "public static List<ObjectModelResolver> getResolvers() {\n if (resolvers == null) {\n synchronized (serviceLoader) {\n if (resolvers == null) {\n List<ObjectModelResolver> foundResolvers = new ArrayList<ObjectModelResolver>();\n for (ObjectMode...
[ "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 description about database:", "pos": "Represent the code about database:", "neg": "Represent the code:" }
@param string[] $definedApiClassNames @return iterable|Change[]
[ "private function makeSymbolsIterator(\n array $definedApiClassNames,\n ClassReflector $pastSourcesWithDependencies,\n ClassReflector $newSourcesWithDependencies\n ) : iterable {\n foreach ($definedApiClassNames as $apiClassName) {\n /** @var ReflectionClass $oldSymbol */\n...
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Remember visitor ID per user. We use it to fill metadata before actual inserting rows to DB. @param array $row
[ "private function rememberVisitorId($row)\n {\n if (!empty($row[self::USER_ID_FIELD]) && !empty($row[self::VISITOR_ID_FIELD])) {\n $this->visitorIdsUserIdsMap[$row[self::USER_ID_FIELD]] = $row[self::VISITOR_ID_FIELD];\n }\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Load AND activates the specified plugins. It will also overwrite all previously loaded plugins, so it acts as a setter. @param array $pluginsToLoad Array of plugins to load.
[ "public function loadPlugins(array $pluginsToLoad)\n {\n $this->resetTransientCache();\n $this->pluginsToLoad = $this->makePluginsToLoad($pluginsToLoad);\n $this->reloadActivatedPlugins();\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Get a given layer by name.
[ "public Layer getLayer(String name) {\n Preconditions.checkState(verticesMap.containsKey(name), \"Layer with name %s does not exist in the network\", name);\n return verticesMap.get(name).getLayer();\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetDatum sets the MutRow with colIdx and datum.
[ "func (mr MutRow) SetDatum(colIdx int, d types.Datum) {\n\tcol := mr.c.columns[colIdx]\n\tif d.IsNull() {\n\t\tcol.nullBitmap[0] = 0\n\t\treturn\n\t}\n\tswitch d.Kind() {\n\tcase types.KindInt64, types.KindUint64, types.KindFloat64:\n\t\tbinary.LittleEndian.PutUint64(mr.c.columns[colIdx].data, d.GetUint64())\n\tcas...
[ "AtomSymbol alignTo(SymbolAlignment alignment) {\n return new AtomSymbol(element, adjuncts, annotationAdjuncts, alignment, hull);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
read the layer Data @ignore
[ "function readLayer(map, data, z) {\n var layer = new me.TMXLayer(data, map.tilewidth, map.tileheight, map.orientation, map.tilesets, z);\n // set a renderer\n layer.setRenderer(map.getRenderer());\n return layer;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// AppendDatum appends a datum into the chunk.
[ "func (c *Chunk) AppendDatum(colIdx int, d *types.Datum) {\n\tswitch d.Kind() {\n\tcase types.KindNull:\n\t\tc.AppendNull(colIdx)\n\tcase types.KindInt64:\n\t\tc.AppendInt64(colIdx, d.GetInt64())\n\tcase types.KindUint64:\n\t\tc.AppendUint64(colIdx, d.GetUint64())\n\tcase types.KindFloat32:\n\t\tc.AppendFloat32(col...
[ "@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 instruction about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code:" }
// Equal returns true if two Amounts are equal in value
[ "func (a Amount) Equal(o Amount) bool {\n\treturn (&a).Cmp(&o.Rat) == 0\n}" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
HeaderCharset setter/getter @deprecated 3.4.0 Use setHeaderCharset()/getHeaderCharset() instead. @param string|null $charset Character set. @return string Charset
[ "public function headerCharset($charset = null)\n {\n deprecationWarning('Email::headerCharset() is deprecated. Use Email::setHeaderCharset() or Email::getHeaderCharset() instead.');\n\n if ($charset === null) {\n return $this->getHeaderCharset();\n }\n\n $this->setHeaderCh...
[ "public static Attribute createFromEncoded(String unencodedKey, String encodedValue) {\n String value = Entities.unescape(encodedValue, true);\n return new Attribute(unencodedKey, value, null); // parent will get set when Put\n }" ]
codesearchnet
{ "query": "Represent the text about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Programming:" }
Merges the ds config from druid_config into one stored in the db.
[ "def sync_to_db_from_config(\n cls,\n druid_config,\n user,\n cluster,\n refresh=True):\n \"\"\"\"\"\"\n session = db.session\n datasource = (\n session.query(cls)\n .filter_by(datasource_name=druid_config['name'])\n ...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
// Addr returns the provider config address corresponding to the receiving // config reference. // // This is a trivial conversion, essentially just discarding the source // location information and keeping just the addressing information.
[ "func (r *ProviderConfigRef) Addr() addrs.ProviderConfig {\n\treturn addrs.ProviderConfig{\n\t\tType: r.Name,\n\t\tAlias: r.Alias,\n\t}\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 sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
raco resolver returns factory if no arguments @param {function} genFn - generator function or factory options @param {object} [opts] - options object @returns {promise} if no callback provided
[ "function raco (genFn, opts) {\n if (!isGeneratorFunction(genFn)) {\n if (isFunction(genFn)) throw new Error('Generator function required')\n else if (!isGenerator(genFn)) return factory(genFn)\n }\n opts = Object.assign({}, _opts, opts)\n opts.Promise = null\n return _raco.call(this, genFn...
[ "function proxyFunction (call, args) {\n // get clone of call and reset original\n call = resetCall(call)\n // require immutable core\n assert.ok(GLOBAL.immutableCore !== undefined, 'ImmutableAI configuration error: immutableCore required')\n // require call properties\n assert.ok(call.namespace !...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
toArray @param array $ignore @return mixed
[ "public function toArray($ignore = ['pages', 'containers', 'sitePlugins'])\n {\n $data = parent::toArray($ignore);\n\n if (!in_array('pages', $ignore)) {\n $data['pages'] = $this->modelArrayToArray(\n $this->getPages()->toArray(),\n ['parent', 'site', 'revis...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Gets the value of a field key. @param string $name the name of the field @param string $key the value of the key @param mixed $default the default value to return if nothing is found @return mixed the value of the field key or null if not existing
[ "public function getField($name, $key, $default = null)\n {\n if (array_key_exists($name, $this->fields) && array_key_exists($key, $this->fields[$name])) {\n return $this->fields[$name][$key];\n }\n return $default;\n }" ]
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\r\n\tpublic EClass getIfcMomentOfInertiaMeasure() {\r\n\t\tif (ifcMomentOfInertiaMeasureEClass == null) {\r\n\t\t\tifcMomentOfInertiaMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(844);\r\n\t\t}\r\n\t\treturn ifcMomentOfInertiaMeas...
[ "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 sentence about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Encode this command into a byte array that can be sent The actual command this is encoded into depends on the data that was added.
[ "def encode_data(self):\n \n assert self.get_empty() is False\n self._data_encoded = True\n if self._block_allowed:\n data = self._encode_transfer_block_data()\n else:\n data = self._encode_transfer_data()\n return data" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Commit implements core.ChainIndexerBackend
[ "func (b *BloomTrieIndexerBackend) Commit() error {\n\tvar compSize, decompSize uint64\n\n\tfor i := uint(0); i < types.BloomBitLength; i++ {\n\t\tvar encKey [10]byte\n\t\tbinary.BigEndian.PutUint16(encKey[0:2], uint16(i))\n\t\tbinary.BigEndian.PutUint64(encKey[2:10], b.section)\n\t\tvar decomp []byte\n\t\tfor j :=...
[ "func (api *CoreAPI) getSession(ctx context.Context) *CoreAPI {\n\tsesApi := *api\n\n\t// TODO: We could also apply this to api.blocks, and compose into writable api,\n\t// but this requires some changes in blockservice/merkledag\n\tsesApi.dag = dag.NewReadOnlyDagService(dag.NewSession(ctx, api.dag))\n\n\treturn &s...
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Get the selected choices. @param ChoiceGroupView[]|ChoiceView[] $choiceViews The choice views @param string[] $values The selected values @return ChoiceView[] The selected choices
[ "protected function getSelectedChoices($choiceViews, array $values)\n {\n $selectedChoices = [];\n\n foreach ($choiceViews as $index => $choiceView) {\n if ($choiceView instanceof ChoiceGroupView) {\n $selectedChoices = array_merge($selectedChoices, $this->getSelectedChoic...
[ "public function setTable($table)\n {\n if (!is_array($table)\n && !($table instanceof DataTableInterface)\n ) {\n throw new Exception(\"DataTable renderers renderer accepts only DataTable, Simple and Map instances, and arrays.\");\n }\n $this->table = $table;\n ...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// SetOperation sets the Operation field's value.
[ "func (s *CreateJobInput) SetOperation(v *JobOperation) *CreateJobInput {\n\ts.Operation = 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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
提供精确的加法运算 @param v1 被加数 @param v2 加数 @return 和 @since 3.1.1
[ "public static double add(Double v1, Double v2) {\r\n\t\treturn add((Number) v1, (Number) v2).doubleValue();\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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
Build the options parser. Has to be synchronized because of the way Options are constructed. @return an options parser.
[ "@SuppressWarnings(\"static-access\")\n private static synchronized Options buildOptions() {\n Options options = new Options();\n options.addOption(OptionBuilder.hasArg().withArgName(\"path\").withDescription(\"Specify where to find the class files - must be first argument\").create(\"classpath\"))...
[ "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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Returns the private shared key used for callback function. @return string
[ "public function getPrivateSharedKey() {\n return (string) $this->encryptor->decrypt($this->getValue(\n self::KEY_PRIVATE_SHARED_KEY,\n $this->storeManager->getStore()\n ));\n }" ]
[ "@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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Create list of all gene products as sbml readable elements.
[ "def _add_gene_list(self, parent_tag, gene_id_dict):\n \"\"\"\"\"\"\n list_all_genes = ET.SubElement(parent_tag, _tag(\n 'listOfGeneProducts', FBC_V2))\n for id, label in sorted(iteritems(gene_id_dict)):\n gene_tag = ET.SubElement(\n list_all_genes, _tag('ge...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// ListedPaths returns the paths that should be shown under /
[ "func (a *APIServerHandler) ListedPaths() []string {\n\tvar handledPaths []string\n\t// Extract the paths handled using restful.WebService\n\tfor _, ws := range a.GoRestfulContainer.RegisteredWebServices() {\n\t\thandledPaths = append(handledPaths, ws.RootPath())\n\t}\n\thandledPaths = append(handledPaths, a.NonGoR...
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Encodes an array of bytes as String representation of hexadecimal. @param bytes an array of bytes to convert to a hex string. @return generated hex string.
[ "public static String encodeHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = HEX_CHARS[v >>> 4];\n hexChars[j * 2 + 1] = HEX_CHARS[v & 0x0F];\n }\n ...
[ "protected function makeKeyString($key): string {\n //convert numbers to strings.\n $stringValue = (string)$key;\n $length = strlen( $stringValue );\n if( $length == 0 ){\n throw new \\Exception(\"Key values must be string values of at least 1 character. Empty strings cannot b...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about AWS S3:" }
The end of the definition (position of &#39;}&#39;) @return Optional of the <code>end_pos</code> field value.
[ "@javax.annotation.Nonnull\n public java.util.Optional<net.morimekta.providence.model.FilePos> optionalEndPos() {\n return java.util.Optional.ofNullable(mEndPos);\n }" ]
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// newInterface creates a new bridge interface structure. It attempts to find // an already existing device identified by the configuration BridgeName field, // or the default bridge name when unspecified, but doesn't attempt to create // one when missing
[ "func newInterface(nlh *netlink.Handle, config *networkConfiguration) (*bridgeInterface, error) {\n\tvar err error\n\ti := &bridgeInterface{nlh: nlh}\n\n\t// Initialize the bridge name to the default if unspecified.\n\tif config.BridgeName == \"\" {\n\t\tconfig.BridgeName = DefaultBridgeName\n\t}\n\n\t// Attempt to...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the Github summarization about network configuration:", "pos": "Represent the Github code about network configuration:", "neg": "Represent the Github code about programming:" }
Check if has filter. @author Vova Feldman (@svovaf) @since 1.1.4 @param string $tag @param callable|bool $function_to_check Optional. The callback to check for. Default false. @return false|int @uses has_filter()
[ "function has_filter( $tag, $function_to_check = false ) {\r\n $this->_logger->entrance( $tag );\r\n\r\n return has_filter( $this->get_action_tag( $tag ), $function_to_check );\r\n }" ]
[ "protected function stringOrCallback($content)\n {\n if( is_scalar($content) )\n {\n return $content;\n }\n elseif( is_callable($content) )\n {\n return Buffering\\Callback::do($content);\n }\n\n throw new Exception\\InvalidArgumentException(...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// The number of bytes this request requires.
[ "func (req *MCRequest) Size() int {\n\treturn HDR_LEN + len(req.Extras) + len(req.Key) + len(req.Body)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
returns a fog color from a specific sky type and sun height
[ "function (skyType, sunHeight) {\n\n var fogColor;\n if (skyType == 'color' || skyType == 'none'){\n fogColor = new THREE.Color(this.data.skyColor);\n }\n else if (skyType == 'gradient'){\n fogColor = new THREE.Color(this.data.horizonColor);\n }\n else if (skyType == 'atmosphere')\n {...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Configure Horizon. This includes the access rules for the dashboard, as well as the number of workers to use for the job processor.
[ "public function configure_horizon()\n {\n\n // Require the queue_manager role to view the dashboard\n Horizon::auth(function ($request) {\n\n if (is_null($request->user()))\n return false;\n\n return $request->user()->has('queue_manager', false);\n });\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 comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Discover custom settings for ZMQ path
[ "def discover_settings(conf_base=None):\n \n settings = {\n 'zmq_prefix': '',\n 'libzmq_extension': False,\n 'no_libzmq_extension': False,\n 'skip_check_zmq': False,\n 'build_ext': {},\n 'bdist_egg': {},\n }\n if sys.platform.startswith('win'):\n settings...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetLastUpdateCheckTime touches file to set last update time.
[ "func (c config) SetLastUpdateCheckTime() {\n\tpath, err := c.updateCheckTouchPath()\n\tif err != nil {\n\t\tc.log.Errorf(\"Error getting check path: %s\", err)\n\t\treturn\n\t}\n\tterr := util.Touch(path)\n\tif terr != nil {\n\t\tc.log.Errorf(\"Error setting last update time: %s\", terr)\n\t\treturn\n\t}\n\tc.log....
[ "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 post about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code about programming:" }
/* Copies over all state/transition from other. The state numbers are sequentially assigned (appended). */
[ "func (a *Automaton) copy(other *Automaton) {\n\t// bulk copy and then fixup the state pointers\n\tstateOffset := a.numStates()\n\ta.states = append(a.states, other.states...)\n\tfor i := 0; i < len(other.states); i += 2 {\n\t\tif a.states[stateOffset*2+i] != -1 {\n\t\t\ta.states[stateOffset*2+i] += len(a.transitio...
[ "def initialize(self, calc_reg):\n \n self._isinitialized = True\n # TODO: if calculations are edited, loaded, added, etc. then reset\n self.calc_order = topological_sort(calc_reg.dependencies)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Write a {@link Token} to a given file. @param token the token to write @param tokenFilePath the token file path @param configuration a {@link Configuration} object carrying Hadoop configuration properties @throws IOException
[ "public static void writeTokenToFile(Token<? extends TokenIdentifier> token, Path tokenFilePath,\n Configuration configuration) throws IOException {\n Credentials credentials = new Credentials();\n credentials.addToken(token.getService(), token);\n credentials.writeTokenStorageFile(tokenFilePath, conf...
[ "@SuppressWarnings(\"unused\")\n @Internal\n protected final void warnMissingProperty(Class type, String method, String property) {\n if (LOG.isWarnEnabled()) {\n LOG.warn(\"Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usuall...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Do the actual process of transferring students.
[ "def transfer_students_action(request):\n \"\"\"\"\"\"\n if \"source_act\" in request.GET:\n source_act = EighthScheduledActivity.objects.get(id=request.GET.get(\"source_act\"))\n elif \"source_act\" in request.POST:\n source_act = EighthScheduledActivity.objects.get(id=request.POST.get(\"sou...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }