query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// XXX_OneofFuncs is for the internal use of the proto package.
[ "func (*VideoAdInfo) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _VideoAdInfo_OneofMarshaler, _VideoAdInfo_OneofUnmarshaler, _VideoAdInfo_OneofSizer, []interface{}...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
This moves the sliding window @param sketch the given sketch @param newOffset the new offset, which must be oldOffset + 1
[ "private static void modifyOffset(final CpcSketch sketch, final int newOffset) {\n assert ((newOffset >= 0) && (newOffset <= 56));\n assert (newOffset == (sketch.windowOffset + 1));\n assert (newOffset == CpcUtil.determineCorrectOffset(sketch.lgK, sketch.numCoupons));\n\n assert (sketch.slidingWindow !=...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Connect to FTP server @return bool
[ "public function connect()\n {\n $func = $this->ssl ? 'ftp_ssl_connect' : 'ftp_connect';\n $this->_stream = $func($this->_host, $this->_port, $this->_timeout);\n\n if (!$this->_stream) {\n $this->error = 'Failed to connect '.$this->_host.'.';\n\n return false;\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
str: Root URL for IBM Streams REST API
[ "def resource_url(self):\n \"\"\"\"\"\"\n if self._iam:\n self._resource_url = self._resource_url or _get_iam_rest_api_url_from_creds(self.rest_client, self.credentials)\n else:\n self._resource_url = self._resource_url or _get_rest_api_url_from_creds(self.session, self.cr...
[ "@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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
// Validate finalizer names
[ "func ValidateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\tfor _, msg := range validation.IsQualifiedName(stringValue) {\n\t\tallErrs = append(allErrs, field.Invalid(fldPath, stringValue, msg))\n\t}\n\n\treturn allErrs\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Set 'Payer' value @param \AgentSIB\Diadoc\Api\Proto\Invoicing\OrganizationInfo $value
[ "public function setPayer(\\AgentSIB\\Diadoc\\Api\\Proto\\Invoicing\\OrganizationInfo $value = null)\n {\n $this->Payer = $value;\n }" ]
[ "def DeserializeExclusiveData(self, reader):\n \n self.Type = TransactionType.StateTransaction\n\n self.Descriptors = reader.ReadSerializableArray('neo.Core.State.StateDescriptor.StateDescriptor')" ]
codesearchnet
{ "query": "Represent the Github sentence about invoice calculation:", "pos": "Represent the Github code about invoice calculation:", "neg": "Represent the Github code about Software development:" }
// listenLoop runs in its own goroutine and accepts // inbound connections.
[ "func (srv *Server) listenLoop() {\n\tdefer srv.loopWG.Done()\n\tsrv.log.Debug(\"TCP listener up\", \"addr\", srv.listener.Addr())\n\n\ttokens := defaultMaxPendingPeers\n\tif srv.MaxPendingPeers > 0 {\n\t\ttokens = srv.MaxPendingPeers\n\t}\n\tslots := make(chan struct{}, tokens)\n\tfor i := 0; i < tokens; i++ {\n\t...
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Visits only children[1], since children[0] points to the current function being returned from (if any), and might cause infinite recursion.
[ "def visit_RETURN(self, node):\n \n if len(node.children) == 2:\n node.children[1] = (yield ToVisit(node.children[1]))\n yield node" ]
[ "function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down t...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
设置cell文本对齐样式 @param halign 横向位置 @param valign 纵向位置 @return this @since 4.0.0
[ "public StyleSet setAlign(HorizontalAlignment halign, VerticalAlignment valign) {\r\n\t\tStyleUtil.setAlign(this.headCellStyle, halign, valign);\r\n\t\tStyleUtil.setAlign(this.cellStyle, halign, valign);\r\n\t\tStyleUtil.setAlign(this.cellStyleForNumber, halign, valign);\r\n\t\tStyleUtil.setAlign(this.cellStyleForD...
[ "def _build_msg_content(self, msgtype='text', **kwargs):\n \n data = {'msgtype': msgtype}\n if msgtype == 'text':\n data[msgtype] = {'content': kwargs.get('content')}\n elif msgtype == 'image' or msgtype == 'voice' or msgtype == 'file':\n data[msgtype] = {'media_id'...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Sprawdza czy klucz powinien zostać usunięty (rozgłoszony w buforze rozproszonym) @param string $key klucz @return boolean @throws CacheException
[ "protected final function _keyShouldBeDeleted($key)\n {\n //brak informacji o usunięciu klucza\n if (null === $remoteTime = $this->_distributedStorage->getOption($key)) {\n return false;\n }\n //jeśli czas lokalnego usunięcia jest wyższy niż zdalnego, nie wolno usuwać\n ...
[ "public function send($headers = true)\n {\n //wysłanie nagłówków\n $headers ? $this->sendHeaders() : null;\n //opcjonalne uruchomienie panelu deweloperskiego\n if ($this->_debug) {\n //debugger wykonuje zmianę w contencie\n new \\Mmi\\Http\\ResponseDebugger;\n ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Call Zypper. :param state: :return:
[ "def __call(self, *args, **kwargs):\n '''\n \n '''\n self.__called = True\n if self.__xml:\n self.__cmd.append('--xmlout')\n if not self.__refresh and '--no-refresh' not in args:\n self.__cmd.append('--no-refresh')\n if self.__root:\n ...
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Uint64 returns the value associated with the key as a uint64.
[ "func (s *Session) Uint64(key string) uint64 {\n\ts.RLock()\n\tdefer s.RUnlock()\n\n\tv, ok := s.data[key]\n\tif !ok {\n\t\treturn 0\n\t}\n\n\tvalue, ok := v.(uint64)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn value\n}" ]
[ "func estimateUnknownSize(unk *runtime.Unknown, byteSize uint64) uint64 {\n\tsize := uint64(unk.Size())\n\t// protobuf uses 1 byte for the tag, a varint for the length of the array (at most 8 bytes - uint64 - here),\n\t// and the size of the array.\n\tsize += 1 + 8 + byteSize\n\treturn size\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Convert matrix labels that contain ids to label attribute values. Keeps in mind that the last label on a axis is "Total".
[ "private void convertIdtoLabelLabels(\n List<Object> idLabels, EntityType entityType, DataService dataService) {\n final int nrLabels = idLabels.size();\n if (nrLabels > 0) {\n // Get entities for ids\n // Use Iterables.transform to work around List<String> to Iterable<Object> cast error\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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Determine if the MAC for the given payload is valid. @param array $payload @return bool
[ "protected function _validMac(array $payload)\n {\n $bytes = function_exists('random_bytes') ? random_bytes(16) : openssl_random_pseudo_bytes(16);\n $calcMac = hash_hmac('sha256', $this->_hash($payload['iv'], $payload['value']), $bytes, true);\n return hash_equals(hash_hmac('sha256', $payloa...
[ "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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Find term. @param string $key @param int $id @return \Illuminate\Support\Collection
[ "public function find($id)\n {\n if (is_numeric($id)) {\n return $this->findBy('id', $id);\n }\n\n return $this->findBy('slug', $id);\n }" ]
[ "public static function getDomainAuthority($url = false)\n {\n $data = static::getCols('68719476736', Helper\\Url::parseHost($url));\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['pda'];\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Recursively creates a tree with a given height containing only the given item.
[ "function create(item, h)\n{\n\tif (h === 0)\n\t{\n\t\treturn {\n\t\t\tctor: '_Array',\n\t\t\theight: 0,\n\t\t\ttable: [item]\n\t\t};\n\t}\n\treturn {\n\t\tctor: '_Array',\n\t\theight: h,\n\t\ttable: [create(item, h - 1)],\n\t\tlengths: [1]\n\t};\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Lookup lemma in a dictionary. Outputs "O" if not found. @param word the token @param postag the postag @return the lemma
[ "public String apply(final String word, final String postag) {\n String lemma = null;\n final List<String> keys = this.getDictKeys(word, postag);\n // lookup lemma as value of the map\n final String keyValue = this.dictMap.get(keys);\n if (keyValue != null) {\n lemma = keyValue;\n } else {\n ...
[ "def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
加密 @param data 被加密的bytes @param keyType 私钥或公钥 {@link KeyType} @return 加密后的bytes
[ "@Override\r\n\tpublic byte[] encrypt(byte[] data, KeyType keyType) {\r\n\t\tfinal Key key = getKeyByType(keyType);\r\n\t\tfinal int inputLen = data.length;\r\n\t\tfinal int maxBlockSize = this.encryptBlockSize < 0 ? inputLen : this.encryptBlockSize;\r\n\r\n\t\tlock.lock();\r\n\t\ttry (ByteArrayOutputStream out = n...
[ "public static String encode(String content, String secret) {\n try {\n //1.构造密钥生成器,指定为AES算法,不区分大小写\n KeyGenerator keygen = KeyGenerator.getInstance(\"AES\");\n //2.根据encodeRules规则初始化密钥生成器\n //生成一个256位的随机源,根据传入的字节数组\n keygen.init(256, new SecureRandom(se...
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
TODO:- Multiple copies going on here.
[ "public String unpackString() {\n int size = data.getInt();\n byte[] bytes = new byte[size];\n data.get(bytes);\n return new String(bytes);\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 summarization about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code about programming:" }
// NewExponentialBackoff returns a ExponentialBackoff backoff policy. // Use initialTimeout to set the first/minimal interval // and maxTimeout to set the maximum wait interval.
[ "func NewExponentialBackoff(initialTimeout, maxTimeout time.Duration) *ExponentialBackoff {\n\treturn &ExponentialBackoff{\n\t\tt: float64(int64(initialTimeout / time.Millisecond)),\n\t\tf: 2.0,\n\t\tm: float64(int64(maxTimeout / time.Millisecond)),\n\t}\n}" ]
[ "func (j *Job) NextTime() int64 {\n\tif !j.IsRecurring() {\n\t\treturn 0\n\t}\n\t// NOTE: is this the proper way to handle rescheduling?\n\t// What if we schedule jobs faster than they can be executed?\n\t// Should we just let them build up and expect the end user to\n\t// allocate more workers? Or should we schedu...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
+other+ graph node to edge to +weight+ positive float denoting edge weight Creates a two way edge between this node and another.
[ "def create_edge_to_and_from(other, weight = 1.0)\n self.class.edge_class.create!(:from_id => id, :to_id => other.id, :weight => weight)\n self.class.edge_class.create!(:from_id => other.id, :to_id => id, :weight => weight)\n end" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns a Structure with species decorated with spin values instead of using magmom site properties. :return: Structure
[ "def get_structure_with_spin(self):\n \n\n structure = self.structure.copy()\n structure.add_spin_by_site(structure.site_properties[\"magmom\"])\n structure.remove_site_property(\"magmom\")\n\n return structure" ]
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
// Next sets the step after the wait delay
[ "func (wd *WaitDelay) Next(nextState MachineState) MachineState {\n\twd.next = nextState\n\treturn wd\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Check if the url match with a specific pattern. The patterns only accepts * and ? @param string|array $patterns The pattern or an array with various patterns @return bool
[ "public function match($patterns)\n {\n if (!is_array($patterns)) {\n $patterns = [$patterns];\n }\n\n //Remove scheme and query\n $long_url = preg_replace('|^(\\w+://)|', '', (string) $this);\n $short_url = preg_replace('|(\\?.*)?$|', '', $long_url);\n\n fore...
[ "public function normalizeRules($rules)\n {\n // If you want to use a pipe in a regex, custom message etc,\n // single-quote the string (escaping would be too confusing in regexes):\n //\n // This works with:\n //\n // 'foo?\\'my piped | string\\''\n // \"foo?'my ...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// Patterns return a list of the loaded patterns, as they've been parsed
[ "func (m *Matcher) Patterns() []string {\n\tm.mut.Lock()\n\tdefer m.mut.Unlock()\n\n\tpatterns := make([]string, len(m.patterns))\n\tfor i, pat := range m.patterns {\n\t\tpatterns[i] = pat.String()\n\t}\n\treturn patterns\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// RunScans iterates over AllScans, running each scan that matches the family // and scanner regular expressions concurrently.
[ "func (fs FamilySet) RunScans(host, ip, family, scanner string, timeout time.Duration) (map[string]FamilyResult, error) {\n\thostname, port, err := net.SplitHostPort(host)\n\tif err != nil {\n\t\thostname = host\n\t\tport = \"443\"\n\t}\n\n\tvar addr string\n\tif net.ParseIP(ip) != nil {\n\t\taddr = net.JoinHostPor...
[ "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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// ChannelMessageSendComplex sends a message to the given channel. // channelID : The ID of a Channel. // data : The message struct to send.
[ "func (s *Session) ChannelMessageSendComplex(channelID string, data *MessageSend) (st *Message, err error) {\n\tif data.Embed != nil && data.Embed.Type == \"\" {\n\t\tdata.Embed.Type = \"rich\"\n\t}\n\n\tendpoint := EndpointChannelMessages(channelID)\n\n\t// TODO: Remove this when compatibility is not required.\n\t...
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Deletes all the services on the registry. This operation cannot be undone. Use with care. @return @throws uk.ac.open.kmi.iserve.sal.exception.ServiceException
[ "@Override\n public boolean clearServices() throws ServiceException {\n\n if (!this.graphStoreManager.canBeModified()) {\n log.warn(\"The dataset cannot be modified.\");\n return false;\n }\n\n log.info(\"Clearing services registry.\");\n this.graphStoreManager.c...
[ "def create_snapshot(self, systemId, snapshotSpecificationObject):\n \n self.conn.connection._check_login()\n #try:\n response = self.conn.connection._do_post(\"{}/{}{}/{}\".format(self.conn.connection._api_url, \"instances/System::\", systemId, 'action/snapshotVolumes'), json=snapshotSp...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about AWS Redshift:" }
// SetAuthenticationType sets the AuthenticationType field's value.
[ "func (s *CreateGraphqlApiInput) SetAuthenticationType(v string) *CreateGraphqlApiInput {\n\ts.AuthenticationType = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Splits the input lines into slices, based on the batch_size of the current command. Executes the given block for each of the batches.
[ "def normal_iterator(first_line, next_lines, &block)\n Enumerator.new do |y|\n y << first_line\n loop do\n y << next_lines.next\n end\n end.each_slice(batch_size).with_index(&block)\n end" ]
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Note that this is unrelated to the general pants artifact cache.
[ "def artifact_cache_dir(self):\n \"\"\"\"\"\"\n return (self.get_options().artifact_cache_dir or\n os.path.join(self.scratch_dir, 'artifacts'))" ]
[ "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:" }
菜单权限检查 @access public @return array
[ "public static function menuCheck(){\n\n $uid = self::sessionGet('user.uid');\n\n if(empty($uid)){\n return false;\n }\n $where['status'] = 1;\n\n if($uid != 1){\n $authMenu = self::authMenu('',false);\n\n if(is_array($authMenu)){\n ...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Checks the immutability of the elements type @return boolean
[ "protected function checkType($item)\n {\n $type = $this->getItemType($item);\n if (! $this->type) {\n $this->type = $type;\n\n return true;\n }\n\n if ($this->type != $type) {\n return false;\n }\n\n return true;\n }" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Include the grading.xml only if the module supports advanced grading
[ "protected function execute_condition() {\n\n // No grades on the front page.\n if ($this->get_courseid() == SITEID) {\n return false;\n }\n\n return plugin_supports('mod', $this->get_task()->get_modulename(), FEATURE_ADVANCED_GRADING, false);\n }" ]
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Data synchronization:" }
Extract an array of assets, optionally filtered by tag. Use it as /extract/assets?taxonomy=RC&taxonomy=MSBC&occupancy=RES
[ "def extract_assets(dstore, what):\n \n qdict = parse(what)\n dic = {}\n dic1, dic2 = dstore['assetcol/tagcol'].__toh5__()\n dic.update(dic1)\n dic.update(dic2)\n arr = dstore['assetcol/array'].value\n for tag, vals in qdict.items():\n cond = numpy.zeros(len(arr), bool)\n for v...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Check if cache is valid, lock cache if required @param \Smarty_Internal_Template $_template @return bool flag true if cache is valid
[ "public function isCached(Smarty_Internal_Template $_template)\n {\n if ($this->valid !== null) {\n return $this->valid;\n }\n while (true) {\n while (true) {\n if ($this->exists === false || $_template->smarty->force_compile || $_template->smarty->force_...
[ "protected function prepare () {\n\t\t$request = & $this->request;\n\n\t\t// store original path value for later use\n\t\t$request->SetOriginalPath($request->GetPath(TRUE));\n\n\t\t// switching media site version and targeting localized version \n\t\t// will be only by GET method, other methods are not very useful ...
codesearchnet
{ "query": "Represent the Github sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software development:" }
{@inheritDoc} @see \n2n\persistence\meta\structure\MetaEntityFactory::createView() @return View
[ "public function createView(string $name, string $query): View {\r\n\t\t$newView = new CommonView($name, $query);\r\n\t\t$this->database->addMetaEntity($newView);\r\n\t\treturn $newView;\r\n\t}" ]
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// AddPortToInstanceGroup adds a port to the given instance group.
[ "func (gce *Cloud) AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error) {\n\tfor _, np := range ig.NamedPorts {\n\t\tif np.Port == port {\n\t\t\tglog.V(3).Infof(\"Instance group %v already has named port %+v\", ig.Name, np)\n\t\t\treturn np, nil\n\t\t}\n\t}\n\tglog.Infof(\"Addin...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Sets the context path @param contextPath the contextPath to set
[ "public void setContextPath(String contextPath) {\n\n\t\tif (contextPath != null && !contextPath.endsWith(\"/\")) {\n\t\t\tcontextPath += \"/\";\n\t\t}\n\t\tthis.contextPath = contextPath;\n\t}" ]
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// SetLocale sets the Locale field's value.
[ "func (s *User) SetLocale(v string) *User {\n\ts.Locale = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Dot double. @param a the a @param b the b @return the double
[ "public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }" ]
[ "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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Natural Language Processing:" }
Sets an entire row of data @param integer $row_index The 1 based row index to use @param array $values_arr An array of values @param string $type ss:Type attribute @return DOMElement The row
[ "public function setRow($row_index, $values_arr, $type=null)\n {\n $cell = null;\n foreach($values_arr as $col_index=>$val){\n $cell = $this->setCell($col_index+1, $row_index, $val, $type);\n }\n\n if($cell){\n return $cell->parentNode;\n }\n return...
[ "def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Loads interface for RLBot, prepares environment and agent, and calls the update for the agent.
[ "def run(self):\n \n self.logger.debug('initializing agent')\n self.game_interface.load_interface()\n\n self.prepare_for_run()\n\n # Create Ratelimiter\n rate_limit = rate_limiter.RateLimiter(GAME_TICK_PACKET_POLLS_PER_SECOND)\n last_tick_game_time = None # What the...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Shuffle the data and split by proportion @param trainingData whole data collection. @param proportion scale from 0.1 - 1.0. @return Left- small chunk. Right - large chunk.
[ "public static Pair<List<Tuple>, List<Tuple>> splitData(final List<Tuple> trainingData, double proportion) {\n if (proportion < 0 || proportion > 1) {\n throw new RuntimeException(\"Proportion should between 0.0 - 1.0\");\n }\n\n if (proportion > 0.5) {\n proportion = 1 - ...
[ "def get_initial_centroids(self):\n ''''''\n if self.seed is not None: # useful for obtaining consistent results\n np.random.seed(self.seed)\n n = self.data.shape[0] # number of data points\n \n # Pick K indices from range [0, N).\n rand_indices = np.random.randi...
codesearchnet
{ "query": "Represent the text about Signal Processing:", "pos": "Represent the code about Signal Processing:", "neg": "Represent the code:" }
Read the next central file header Assumes the current file pointer is pointing at the right position @return array
[ "protected function readCentralFileHeader()\n {\n $binary_data = fread($this->fh, 46);\n $header = unpack(\n 'vchkid/vid/vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset',...
[ "public List<Pair<UIEvent, Table>> readEvents() throws IOException {\n //TODO eventually we'll support working out the offset for files that were not written in this session\n Preconditions.checkState(endStaticInfoOffset >= 0, \"Cannot read events - have not written end of static info marker\");\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Inserts data from a data migration file in a table @param string $tableName @param string $fields
[ "public function batchInsert(\\Phalcon\\Db\\Adapter $connection, $tableName, $fields)\n {\n $migrationData = $this->migrationsDir . '/' . $this->version . '/' . $tableName . '.dat';\n if (file_exists($migrationData)) {\n $connection->begin();\n $batchHandler = fopen($migration...
[ "@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ...
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// FindReviewIssueForCommit returns the review issue // associated with the given commit.
[ "func FindReviewIssueForCommit(\n\tclient *github.Client,\n\towner string,\n\trepo string,\n\tcommitSHA string,\n) (*github.Issue, error) {\n\n\t// Find the relevant review issue.\n\tsubstring := fmt.Sprintf(\"Review commit %v:\", commitSHA[:7])\n\treturn findReviewIssue(client, owner, repo, substring, \"in:title\"...
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Returns the most specific assigned level for the given classloader, i.e. children override parents.
[ "private Level getAssignedLevel(ClassLoader loader)\n {\n Level level = null;\n \n if (_localLevel != null) {\n return _localLevel.get(loader);\n }\n \n return null;\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// SetMaximumNormalizedUnitsUsedPerHour sets the MaximumNormalizedUnitsUsedPerHour field's value.
[ "func (s *ReservationPurchaseRecommendationDetail) SetMaximumNormalizedUnitsUsedPerHour(v string) *ReservationPurchaseRecommendationDetail {\n\ts.MaximumNormalizedUnitsUsedPerHour = &v\n\treturn s\n}" ]
[ "func NewMetricWithConfig(tmc TrustMetricConfig) *TrustMetric {\n\ttm := new(TrustMetric)\n\tconfig := customConfig(tmc)\n\n\t// Setup using the configuration values\n\ttm.proportionalWeight = config.ProportionalWeight\n\ttm.integralWeight = config.IntegralWeight\n\ttm.intervalLen = config.IntervalLength\n\t// The ...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True).
[ "def is_protected_type(obj):\n \n return isinstance(obj, (\n types.NoneType,\n int, long,\n datetime.datetime, datetime.date, datetime.time,\n float, Decimal)\n )" ]
[ "def write_repr(self, out, visited):\n '''\n \n '''\n # Default implementation: generate a proxy value and write its repr\n # However, this could involve a lot of work for complicated objects,\n # so for derived classes we specialize this\n return out.write(repr(self...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
Return a dict of output files.
[ "def _get_result_paths(self, output_dir):\n \n # Only include the properties file here. Add the other result\n # paths in the __call__ method, so we can catch errors if an\n # output file is not written.\n self._write_properties_file()\n properties_fp = os.path.join(self.Mo...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Maps the objects in the stream by block using the given function @param <R> the component type of the returning stream @param function the function to use to map objects @return the new stream
[ "public <R> SparkStream<R> mapPartitions(@NonNull SerializableFunction<Iterator<? super T>, ? extends R> function) {\n return new SparkStream<>(rdd.mapPartitions(iterator -> {\n Configurator.INSTANCE.configure(configBroadcast.value());\n return Cast.as(function.apply(iterator));\n }));\n ...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
returns output from a command as it occurs @param string $command @param string $redirect optional how to redirect error output @return \Generator @since 6.0.0
[ "public function outputOf(string $command, string $redirect = '2>&1')\n {\n $pd = $this->runCommand($command, $redirect);\n while (!feof($pd) && false !== ($line = fgets($pd, 4096))) {\n yield rtrim($line);\n }\n\n $returnCode = pclose($pd);\n if (0 != $returnCode) {...
[ "protected function help()\n {\n $style = new Style(' *** RUN - HELP ***');\n Out::std($style->color('fg', Style::COLOR_GREEN)->get());\n Out::std('');\n\n $help = new Help('...', true);\n $help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// SetCreatedDate sets the CreatedDate field's value.
[ "func (s *PutSlotTypeOutput) SetCreatedDate(v time.Time) *PutSlotTypeOutput {\n\ts.CreatedDate = &v\n\treturn s\n}" ]
[ "function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetProxy only working for FCM server.
[ "func SetProxy(proxy string) error {\n\n\tproxyURL, err := url.ParseRequestURI(proxy)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\thttp.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxyURL)}\n\tLogAccess.Debug(\"Set http proxy as \" + proxy)\n\n\treturn nil\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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
has anything been set in the map
[ "function( map ){\n var empty = true;\n\n if( map != null ){\n for(var i in map){\n empty = false;\n break;\n }\n }\n\n return empty;\n }" ]
[ "func (rl *resignLeadership) Execute(state State) (*State, error) {\n\t// TODO(fwereade): this hits a lot of interestingly intersecting problems.\n\t//\n\t// 1) we can't yet create a sufficiently dumbed-down hook context for a\n\t// leader-deposed hook to run as specced. (This is the proximate issue,\n\t// an...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Get document info REST: GET /store/document/{documentId} @param documentId [required] Id of the document to fetch API beta
[ "public OvhDocument document_documentId_GET(String documentId) throws IOException {\n\t\tString qPath = \"/store/document/{documentId}\";\n\t\tStringBuilder sb = path(qPath, documentId);\n\t\tString resp = exec(qPath, \"GET\", sb.toString(), null);\n\t\treturn convertTo(resp, OvhDocument.class);\n\t}" ]
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Make collection @param array $attributes @return \Illuminate\Support\Collection
[ "protected function makeCollection(array $attributes)\n {\n $files = [];\n\n for ($i=0; $i < $this->amount; $i++) {\n $files[] = $this->makeInstance($attributes);\n }\n\n return collect($files);\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
NOTE: This function can be easily bound as .bind(file, classRef, superRef) to make it easier to use it in a loop.
[ "function extractElementDescriptor(/* this: File, */ classRef, superRef, path) {\n const { node, scope } = path;\n const isMethod = path.isClassMethod();\n\n if (path.isPrivate()) {\n throw path.buildCodeFrameError(\n `Private ${\n isMethod ? \"methods\" : \"fields\"\n } in decorated classes ...
[ "function(obj, method, args) {\n if (obj) {\n log.events && console.group('[%s] dispatch [%s]', obj.localName, method);\n var fn = typeof method === 'function' ? method : obj[method];\n if (fn) {\n fn[args ? 'apply' : 'call'](obj, args);\n }\n log.events && console.g...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Introspect this object for FFDC output. @return List<String>
[ "public List<String> introspect() {\n List<String> rc = new LinkedList<String>();\n String prefix = getClass().getSimpleName() + \"@\" + hashCode() + \": \";\n rc.add(prefix + \"tcpChannel=\" + this.tcpChannel);\n rc.add(prefix + \"closed=\" + this.closed);\n rc.add(prefix + \"soc...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Returns the layer data. @param int $id
[ "protected function getInfoWindowContent($strTable, $intId)\n {\n $stringClass = $GLOBALS['con4gis']['stringClass'];\n $arrData = array();\n $strInfoWindowContent = \"\";\n\n switch ($strTable)\n {\n case \"tl_c4g_maps\":\n\n $objLayer = C4gMapsModel::...
[ "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:" }
Sends binary data to the Growl server. @throws NetworkException Throws an exception if the server connection could not be written to. @param string $data The raw binary data to send to the Growl server. @return boolean Always returns `true`.
[ "protected function _send($data) {\n\t\tif (fwrite($this->_connection(), $data, strlen($data)) === false) {\n\t\t\tthrow new NetworkException('Could not send registration to Growl Server.');\n\t\t}\n\t\treturn true;\n\t}" ]
[ "function onmessage(data) {\n if (!handshaked) {\n handshaked = true;\n // The handshake output is in the form of URI.\n var result = url.parse(data, true).query;\n // A newly issued id for HTTP transport. It is used to identify which HTTP transport\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Sets the factory for this {@link javax.cache.integration.CacheLoader}. @param cacheLoaderFactory the factory to set for this {@link javax.cache.integration.CacheLoader} @return the current cache config instance
[ "public CacheSimpleConfig setCacheLoaderFactory(String cacheLoaderFactory) {\n if (cacheLoader != null && cacheLoaderFactory != null) {\n throw new IllegalStateException(\"Cannot set cacheLoaderFactory to '\" + cacheLoaderFactory\n + \"', because cacheLoader is already set to '\...
[ "private void determineChannelAccessor() throws ChannelFrameworkException, ChannelFactoryException {\n // Extract the factory class from the application side channel definition.\n OutboundChannelDefinition first = this.outboundChannelDefs.getFirst();\n Class<?> factoryClass = first.getOutboundF...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// SessionRead Get SessionStore in cooke. // decode cooke string to map and put into SessionStore with sid.
[ "func (pder *CookieProvider) SessionRead(sid string) (Store, error) {\n\tmaps, _ := decodeCookie(pder.block,\n\t\tpder.config.SecurityKey,\n\t\tpder.config.SecurityName,\n\t\tsid, pder.maxlifetime)\n\tif maps == nil {\n\t\tmaps = make(map[interface{}]interface{})\n\t}\n\trs := &CookieSessionStore{sid: sid, values: ...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Remove sub-property aliases from layer object
[ "function _removeSubPropAliases(layer) {\n\tvar propName;\n\tfor (propName in layer) {\n\t\tif (Object.prototype.hasOwnProperty.call(layer, propName)) {\n\t\t\tif (propName.indexOf('.') !== -1) {\n\t\t\t\tdelete layer[propName];\n\t\t\t}\n\t\t}\n\t}\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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetDialogState sets the DialogState field's value.
[ "func (s *PostTextOutput) SetDialogState(v string) *PostTextOutput {\n\ts.DialogState = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns the path array for provided location ID. @param int|string $locationId
[ "public function getPath($locationId, array $options = []): array\n {\n $optionsResolver = new OptionsResolver();\n $this->configureOptions($optionsResolver);\n $options = $optionsResolver->resolve($options);\n\n $excludedContentTypes = [];\n if (\n !$options['use_al...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
// bucketResourceExists - checks if at least one bucket resource exists in the set.
[ "func (resourceSet ResourceSet) bucketResourceExists() bool {\n\tfor resource := range resourceSet {\n\t\tif resource.isBucketPattern() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the description about AWS S3:", "pos": "Represent the code about AWS S3:", "neg": "Represent the code about AWS S3:" }
//SetGrayFill set the grayscale for the fill, takes a float64 between 0.0 and 1.0
[ "func (gp *GoPdf) SetGrayFill(grayScale float64) {\n\tgp.curr.grayFill = grayScale\n\tgp.getContent().AppendStreamSetGrayFill(grayScale)\n}" ]
[ "def get_hs_color(self):\n \n # Get the color from homematic. In general this is just the hue parameter.\n hm_color = self.getCachedOrUpdatedValue(\"COLOR\", channel=self._color_channel)\n\n if hm_color >= 200:\n # 200 is a special case (white), so we have a saturation of 0.\n...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
@param \Iterator $files @return \SplPriorityQueue
[ "protected function sort(\\Iterator $files)\n {\n $sorted = new \\SplPriorityQueue();\n foreach ($files as $file) {\n preg_match(\n '/\\d+/',\n $files->current(),\n $priority\n );\n if (empty($priority))\n ...
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// uint32 returns the uint32 value at the given offset in the index data.
[ "func (ix *Index) uint32(off uint32) uint32 {\n\treturn binary.BigEndian.Uint32(ix.slice(off, 4))\n}" ]
[ "func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}" ]
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Instrument an HTTP span after a message is sent. Typically called for every chunk of request or response is sent. @param context request specific {@link HttpRequestContext} @param bytes bytes sent. @since 0.19
[ "public final void handleMessageSent(HttpRequestContext context, long bytes) {\n checkNotNull(context, \"context\");\n context.sentMessageSize.addAndGet(bytes);\n if (context.span.getOptions().contains(Options.RECORD_EVENTS)) {\n // record compressed size\n recordMessageEvent(context.span, contex...
[ "private static List<InterfaceHttpData> formpost(\n Bootstrap bootstrap,\n String host, int port, URI uriSimple, File file, HttpDataFactory factory,\n List<Entry<String, String>> headers) throws Exception {\n // XXX /formpost\n // Start the connection attempt.\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Retrieve the hash of tags for this span
[ "def tags(key = nil)\n if custom?\n tags = @data[:data][:sdk][:custom][:tags]\n else\n tags = @data[:data][key]\n end\n key ? tags[key] : tags\n end" ]
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Builds a message to be logged based on the error handler params @param Request $request @param Response $response @param \Throwable|null $err @return string
[ "public function buildMessage(Request $request, Response $response, Throwable $err = null): string\n {\n $base = 'Error occurred while dispatching request';\n if ($err === null) {\n return $base;\n }\n\n return sprintf('%s:%s%s', $base, PHP_EOL, $err);\n }" ]
[ "public function exceptionActionDispatcher(MbRequest $mbRequest, MbResponse $mbResponse, \\Exception $exception)\n {\n $className = static::class;\n $methodName = __METHOD__;\n throw new MbException(\"{$methodName} not allowed in! {$className}.\");\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Create a new detached JPQLQuery instance with the given projection @param expr projection @param <T> @return select(expr)
[ "public static <T> JPQLQuery<T> select(Expression<T> expr) {\n return new JPASubQuery<Void>().select(expr);\n }" ]
[ "@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get the last error message from the payment attempts @return bool|string
[ "public function getPaymentErrorMessage()\n {\n /** @var Payment $lastPayment */\n // Get the last payment\n if (!$lastPayment = $this->reservation->Payments()->first()) {\n return false;\n }\n\n // Find the gateway error\n $lastErrorMessage = null;\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
get attribute name @param {String} attribute @return {String}
[ "function _getAttribute(attribute) {\n if (is_string(_attributes[attribute])) {\n return _attributes[attribute];\n }\n\n if ((line = _translator.trans(attribute)) !== attribute) {\n return line;\n } else {\n return attribute.replace('_', ' ');\n }\n }" ]
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Read a competency framework by id. @param int $id The id of the framework. @return \stdClass
[ "public static function read_competency_framework($id) {\n global $PAGE;\n\n $params = self::validate_parameters(self::read_competency_framework_parameters(), array(\n 'id' => $id,\n ));\n\n $framework = api::read_framework($params['id']);\n self::validate_context($fram...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
print substitution rate data to table genomes[genome][contig][sample] = \ {'bp_stats':{}, 'sub_rates'[locus] = {ref PnPs, consensus PnPs}}
[ "def print_stats(genomes):\n \n header = ['#genome', 'contig', 'locus', 'position', 'strand', 'length', \\\n 'sample', 'coverage', \\\n 'ref. Pn/Ps', 'ref SNP density', \\\n 'consensus Pn/Ps', 'consensus SNP density', \\\n 'product']\n print('\\t'...
[ "def get_prtfmt(self, key=\"fmta\"):\n \"\"\"\"\"\"\n prtfmt = self.sortobj.grprobj.gosubdag.prt_attr[key]\n prtfmt = prtfmt.replace(\"{NS}\", \"{NS} {num_usrgos:>4} uGOs\")\n return \"\".join(['{hdr1usr01:2}', prtfmt, '\\n'])" ]
codesearchnet
{ "query": "Represent the Github text about Data Science:", "pos": "Represent the Github code about Data Science:", "neg": "Represent the Github code:" }
// SetKey sets the Key field's value.
[ "func (s *DeleteItemInput) SetKey(v map[string]*AttributeValue) *DeleteItemInput {\n\ts.Key = v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns the list of past assignments the user did not submit for before the hard deadline.
[ "def gone_assignments(self):\n '''\n \n '''\n # Include only assignments with past hard deadline\n qs = Assignment.objects.filter(hard_deadline__lt=timezone.now())\n # Include only assignments from courses this user is registered for\n qs = qs.filter(course__in=s...
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Data synchronization:" }
// NewSliceFloat64Stats returns a new initialized SliceFloat64Stats struct.
[ "func NewSliceFloat64Stats() SliceFloat64Stats {\n\tstats := SliceFloat64Stats{\n\t\tLen: 0,\n\t\tMax: 0,\n\t\tMean: 0,\n\t\tMedian: 0,\n\t\tMin: 0,\n\t\tSum: 0}\n\treturn stats\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
<p> Information about the port states resulting from your request. </p> @param portStates Information about the port states resulting from your request.
[ "public void setPortStates(java.util.Collection<InstancePortState> portStates) {\n if (portStates == null) {\n this.portStates = null;\n return;\n }\n\n this.portStates = new java.util.ArrayList<InstancePortState>(portStates);\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Returns a new RemoteHistoryContaoQuery object. @param string $modelAlias The alias of a model in the query @param RemoteHistoryContaoQuery|Criteria $criteria Optional Criteria to build the query from @return RemoteHistoryContaoQuery
[ "public static function create($modelAlias = null, $criteria = null)\n {\n if ($criteria instanceof RemoteHistoryContaoQuery) {\n return $criteria;\n }\n $query = new RemoteHistoryContaoQuery(null, null, $modelAlias);\n\n if ($criteria instanceof Criteria) {\n $q...
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
@param string $string String to check @return mixed
[ "public static function removeDisallowedJavaScriptInLinksOrImgTags($string)\n {\n $string = preg_replace(\n \"#<a.+?href=.*?(alert\\(|alert&\\#40;|javascript\\:|window\\.|document\\.|\\.cookie|<script|<xss).*?\\>.*?</a>#si\",\n \"\",\n $string\n );\n $string ...
[ "public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }" ]
codesearchnet
{ "query": "Represent the Github text about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about Software development:" }
Reorders `string` according to `salt`.
[ "def _reorder(string, salt):\n \"\"\"\"\"\"\n len_salt = len(salt)\n\n if len_salt != 0:\n string = list(string)\n index, integer_sum = 0, 0\n for i in range(len(string) - 1, 0, -1):\n integer = ord(salt[index])\n integer_sum += integer\n j = (integer +...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Ensure the 'mime_type' property of artifact objects comes from the Template column in the IANA media type registry.
[ "def artifact_mime_type(instance):\n \n for key, obj in instance['objects'].items():\n if ('type' in obj and obj['type'] == 'artifact' and 'mime_type' in obj):\n if enums.media_types():\n if obj['mime_type'] not in enums.media_types():\n yield JSONError(\"Th...
[ "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 post about Java programming:", "pos": "Represent the Github code about Java programming:", "neg": "Represent the Github code:" }
// NewReporter instantiates a new reporter that submits spans to the collector
[ "func (rc *ReporterConfig) NewReporter(\n\tserviceName string,\n\tmetrics *jaeger.Metrics,\n\tlogger jaeger.Logger,\n) (jaeger.Reporter, error) {\n\tsender, err := rc.newTransport()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treporter := jaeger.NewRemoteReporter(\n\t\tsender,\n\t\tjaeger.ReporterOptions.QueueSi...
[ "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 description about Technical writing:", "pos": "Represent the code about Technical writing:", "neg": "Represent the code about programming:" }
Get all organisations :param state: State of organisation :param include_deactivated: Flag to include deactivated :returns: list of Organisation instances :raises: SocketError, CouchException
[ "def all(cls, state=None, include_deactivated=False):\n \n if state and state not in validators.VALID_STATES:\n raise exceptions.ValidationError('Invalid \"state\"')\n elif state:\n organisations = yield views.organisations.get(key=state,\n ...
[ "def find_project_by_short_name(short_name, pbclient, all=None):\n \"\"\"\"\"\"\n try:\n response = pbclient.find_project(short_name=short_name, all=all)\n check_api_error(response)\n if (len(response) == 0):\n msg = '%s not found! You can use the all=1 argument to \\\n ...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
:returns: list of dicts
[ "def get_bindings(self):\n \n path = Client.urls['all_bindings']\n bindings = self._call(path, 'GET')\n return bindings" ]
[ "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 about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code:" }
Regenerate from the source file into the output file
[ "def regenerateToOutputFile(outFile, checkNoChanges = false)\n executeRubyComponents\n @pageObject.process\n writeRegeneratedFile(outFile, checkNoChanges, checkNoChanges)\n end" ]
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Get block header by block number. :param number: :return:
[ "def eth_getBlockHeaderByNumber(self, number):\n \n block_hash = self.reader._get_block_hash(number)\n block_number = _format_block_number(number)\n return self.reader._get_block_header(block_hash, block_number)" ]
[ "def search_db(self, search):\n \n\n def search_callback(_, address, balance):\n \"\"\"\n\n :param _:\n :param address: The address of the contract with the code in search\n :param balance: The balance of the corresponding contract\n \"\"\"\n ...
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Get anniversary If no "anniversary" value has been set, this method will set and return a default "anniversary" value, if any such value is available @see getDefaultAnniversary() @return int|null anniversary or null if no anniversary has been set
[ "public function getAnniversary() : ?int \n {\n if ( ! $this->hasAnniversary()) {\n $this->setAnniversary($this->getDefaultAnniversary());\n }\n return $this->anniversary;\n }" ]
[ "def resolve(self, year: int = YEAR_ANY) -> MDate:\n \n year = year or self.year\n if year:\n return self._resolve(year)\n raise ValueError('Unable resolve the date without a specified year.')" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Returns the classmap array. This map associates the name of the classes and the PHP file they are declared in. @param string $mode Mode can be "NO_FILTER", "ROOT_PACKAGE" or "VENDOR" @return array<string, string>
[ "public function getClassMap($mode = 'NO_FILTER') {\n\t\tif (isset($this->classMap[$mode])) {\n\t\t\treturn $this->classMap[$mode];\n\t\t}\n\n\t\tif (!in_array($mode, array('NO_FILTER', 'ROOT_PACKAGE', 'VENDOR'), true)) {\n\t\t\tthrow new \\Exception('Unexpected mode passed to getClassMap');\n\t\t}\n\n\t\t$composer...
[ "private static function getReferencePrefix(string $storeAs) : string\n {\n if (! in_array($storeAs, [self::REFERENCE_STORE_AS_REF, self::REFERENCE_STORE_AS_DB_REF, self::REFERENCE_STORE_AS_DB_REF_WITH_DB])) {\n throw new LogicException('Can only get a reference prefix for DBRef and reference a...
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
@param string $classname @param array $config @param string $alternative_classname @return mixed
[ "public static function factory($classname, array $config = [], $alternative_classname = '')\n {\n $object = null;\n if (class_exists($classname)) {\n $reflect = new \\ReflectionClass($classname);\n\n $object = $reflect->newInstanceArgs($config);\n } else {\n ...
[ "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }" ]
codesearchnet
{ "query": "Represent the Github text about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about Software development:" }
Called to perform recovery action during a warm start of the objectManager. @param ObjectManagerState of the ObjectManager performing recovery.
[ "public void performRecovery(ObjectManagerState objectManagerState)\n throws ObjectManagerException\n {\n if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())\n trace.entry(this,\n cclass,\n \"performRecovery\",\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:" }
args: sets the javac arguments
[ "@Configurable\n public void setArgs(String arg)\n {\n int i = 0;\n int len = arg.length();\n\n CharBuffer cb = new CharBuffer();\n \n while (i < len) {\n char ch;\n for (; i < len && Character.isWhitespace(ch = arg.charAt(i)); i++) {\n }\n\n if (len <= i)\n return;\n\n ...
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetOrganizationId sets the OrganizationId field's value.
[ "func (s *ListGroupsInput) SetOrganizationId(v string) *ListGroupsInput {\n\ts.OrganizationId = &v\n\treturn s\n}" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
为一个 BaseRoBot 生成 Django view。 :param robot: 一个 BaseRoBot 实例。 :return: 一个标准的 Django view
[ "def make_view(robot):\n \n\n @csrf_exempt\n def werobot_view(request):\n timestamp = request.GET.get(\"timestamp\", \"\")\n nonce = request.GET.get(\"nonce\", \"\")\n signature = request.GET.get(\"signature\", \"\")\n\n if not robot.check_signature(\n timestamp=times...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Build a Criteria object containing the values of all modified columns in this object. @return Criteria The Criteria object containing all modified values.
[ "public function buildCriteria()\n {\n $criteria = new Criteria(DealerBrandVersionTableMap::DATABASE_NAME);\n\n if ($this->isColumnModified(DealerBrandVersionTableMap::ID)) $criteria->add(DealerBrandVersionTableMap::ID, $this->id);\n if ($this->isColumnModified(DealerBrandVersionTableMap::DE...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }