query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} | [
"@XmlElementDecl(namespace = \"http://docs.oasis-open.org/ns/cmis/messaging/200908/\", name = \"orderBy\", scope = GetCheckedOutDocs.class)\r\n\tpublic JAXBElement<String> createGetCheckedOutDocsOrderBy(String value) {\r\n\t\treturn new JAXBElement<String>(_GetChildrenOrderBy_QNAME, String.class,\r\n\t\t\t\tGetChec... | [
"@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
for compatibility we can't use BuildWrapperDescriptor | [
"public static DescriptorExtensionList<BuildWrapper,Descriptor<BuildWrapper>> all() {\n // use getDescriptorList and not getExtensionList to pick up legacy instances\n return Jenkins.getInstance().<BuildWrapper,Descriptor<BuildWrapper>>getDescriptorList(BuildWrapper.class);\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates a hash pair by the {@link ComparableEntry}.
@param <K>
the type of the key
@param <V>
the type of the value
@param key
of entry
@param value
of entry
@return Entry | [
"public static <K, V> Entry<K, V> hp(K key, V value) {\n return new ComparableEntry<>(key, value);\n }"
] | [
"private static Object copy(Object object) {\n if (object instanceof byte[]) {\n byte[] data = (byte[]) object;\n return Arrays.copyOf(data, data.length);\n }\n return object;\n }\n\n /**\n * Makes a deep copy of a {@link Map}. Immutable objects in the map will b... | codesearchnet | {
"query": "Represent the Github summarization about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
// SetFilter sets the Filter field's value. | [
"func (s *ListFindingsInput) SetFilter(v *FindingFilter) *ListFindingsInput {\n\ts.Filter = 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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// InsertOrUpdate adds or updates a user to the (memory) storage.
//
// Returns the new user and an error if any. | [
"func (r *userMemoryRepository) InsertOrUpdate(user datamodels.User) (datamodels.User, error) {\n\tid := user.ID\n\n\tif id == 0 { // Create new action\n\t\tvar lastID int64\n\t\t// find the biggest ID in order to not have duplications\n\t\t// in productions apps you can use a third-party\n\t\t// library to generat... | [
"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 about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Asynchronously fetches all components needed for the given router
state and calls callback(error, components) when finished.
Note: This operation may finish synchronously if no routes have an
asynchronous getComponents method. | [
"function getComponents(nextState, callback) {\n mapAsync(nextState.routes, function (route, index, callback) {\n getComponentsForRoute(nextState, route, callback)\n }, callback)\n}"
] | [
"function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
get 'component' of all orbits in order primary -> secondary | [
"def get_orbits(self):\n \n #~ l = re.findall(r\"[\\w']+\", self.get_value())\n # now search for indices of orbit and take the next entry from this flat list\n #~ return [l[i+1] for i,s in enumerate(l) if s=='orbit']\n orbits = []\n for star in self.get_stars():\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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetAZMode sets the AZMode field's value. | [
"func (s *CreateCacheClusterInput) SetAZMode(v string) *CreateCacheClusterInput {\n\ts.AZMode = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public NotificationChain basicSetAlternatives(AbstractElement newAlternatives, NotificationChain msgs) {\n\t\tAbstractElement oldAlternatives = alternatives;\n\t\talternatives = newAlternatives;\n\t\tif (eNotificationRequired()) {\n\t\t\tENotificationImpl notification = new ENotificationImpl(this, Notification.SET... | [
"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 sentence about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Run the callbacks | [
"function run_callbacks (object, key) {\n var callbacks = object[key];\n var callback;\n // Mark the module is ready\n // `delete module.c` is not safe\n // #135\n // Android 2.2 might treat `null` as [object Global] and equal it to true,\n // So, never confuse `null` and `false`\n object[key] = FALSE;\n w... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// LoadGIFRW loads a GIF image from an SDL data source for use as a surface.
// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_21.html) | [
"func LoadGIFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadGIF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}"
] | [
"def save_as(self, filename: str) -> None:\n \n lib.TCOD_image_save(self.image_c, filename.encode(\"utf-8\"))"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(StreamDescription streamDescription, ProtocolMarshaller protocolMarshaller) {\n\n if (streamDescription == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(streamDescript... | [
"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:"
} |
Result: the function to get `Result` instance. The request result object.
- xhrObj: the xhr obj which can get the xhr result.
How to use it? if `r` is the instance of `Result`.
var r_json = r.json();
var status = r.status_code;
var headers = r.headers; | [
"function(xhrObj) {\n var headers = {}, header;\n // code from https://github.com/developit/unfetch/blob/master/src/index.js\n xhrObj.getAllResponseHeaders().replace(/^(.*?):\\s*([\\s\\S]*?)$/gm, function(m, key, value) {\n header = headers[key];\n headers[key] = header ? header + ',' + value : v... | [
"function(e,d){\n if(e){\n console.log(\"User set add data response: %s\", d)\n e && console.error(e)\n return\n }\n console.log(\"User set add data response with no error: %s\", d) \n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the class name of a {@link PageFlowController}, given the URI to it.
@param uri the URI to the {@link PageFlowController}, which should be relative to the
web application root (i.e., it should not include the context path). | [
"public static String getPageFlowClassName( String uri )\n {\n assert uri != null;\n assert uri.length() > 0;\n \n if ( uri.charAt( 0 ) == '/' ) uri = uri.substring( 1 );\n \n assert FileUtils.osSensitiveEndsWith( uri, PAGEFLOW_EXTENSION ) : uri;\n if ( FileUtils.... | [
"public static String getName(DistributedObject distributedObject) {\n /*\n * The motivation of this behaviour is that some distributed objects (`ICache`) can have prefixed name.\n * For example, for the point of view of cache,\n * it has pure name and full name which contains prefixe... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
No regex parsing. Or at least, mostly, not regex. | [
"def find_version_by_string_lib(\n line, version_token=\"__version__\"\n): # type: (str,str)->Optional[str]\n \n if not line:\n return None\n simplified_line = simplify_line(line)\n version = None\n if simplified_line.strip().startswith(version_token):\n if '\"' not in simplified_li... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
:return: Returns a GPJobSpec used to launch a job of this task type | [
"def make_job_spec(self):\n \n # If the parameters haven't been loaded yet, do so\n if not self._params_loaded and self.server_data is not None:\n self.param_load()\n\n return GPJobSpec(self.server_data, self.lsid)"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Select earthquakes within a specied distance of the fault | [
"def select_catalogue(self, selector, distance, distance_metric=\"rupture\",\n upper_eq_depth=None, lower_eq_depth=None):\n \n if selector.catalogue.get_number_events() < 1:\n raise ValueError('No events found in catalogue!')\n\n # rupture metric is selected\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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Closes stream, unsubscribes provides, sends stoppage notifications and broadcast close notification. | [
"public void close() {\r\n //log.debug(\"Stream close: {}\", publishedName);\r\n if (closed.compareAndSet(false, true)) {\r\n if (livePipe != null) {\r\n livePipe.unsubscribe((IProvider) this);\r\n }\r\n // if we have a recording listener, inform that th... | [
"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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// Get the list of all images available on the this host. | [
"func (dh *Client) Images() (images []*docker.Image, e error) {\n\te = dh.getJSON(dh.Address+\"/images/json\", &images)\n\treturn images, e\n}"
] | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Retrieve values for graphs. | [
"def retrieveVals(self):\n \"\"\"\"\"\"\n for graph_name in self.getGraphList():\n for field_name in self.getGraphFieldList(graph_name):\n self.setGraphVal(graph_name, field_name, self._stats.get(field_name))"
] | [
"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 comment about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
Use Jetty's aliased KeyManager for consistency between server/client TLS configs | [
"private static KeyManager[] createAliasedKeyManagers(KeyManager[] delegates, String certAlias)\n {\n KeyManager[] aliasedManagers = new KeyManager[delegates.length];\n for (int i = 0; i < delegates.length; i++) {\n if (delegates[i] instanceof X509ExtendedKeyManager) {\n aliasedManagers[i] = new ... | [
"private Class<?> resolveClassWithCL(String name) throws ClassNotFoundException {\n SecurityManager security = System.getSecurityManager();\n if (security != null) {\n return Class.forName(name, false, getClassLoader(thisClass));\n }\n\n // The platform classloader is null if ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
<pre>
Versioning of the tensor bundle format.
</pre>
<code>optional .tensorflow.VersionDef version = 3;</code> | [
"public org.tensorflow.framework.VersionDef getVersion() {\n return version_ == null ? org.tensorflow.framework.VersionDef.getDefaultInstance() : version_;\n }"
] | [
"func (m *NamedMethod) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m.Name != \"\" {\n\t\tinfo = append(info, yaml.MapItem{Key: \"name\", Value: m.Name})\n\t}\n\t// &{Name:value Type:Method StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}\n\treturn info\n}"... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Выполнить агента
@return $this | [
"protected function _executeAgent(CmsAgentModel $cmsAgent)\n {\n\n\n //Если уже запщен, то не будем запускать еще раз.\n if ($cmsAgent->is_running == Cms::BOOL_Y) {\n $this->stdout('Agent is already running: ' . $cmsAgent->name, Console::BOLD);\n return $this;\n }\n\n ... | [
"final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
:type span_datas: list of :class:
`~opencensus.trace.span_data.SpanData`
:param list of opencensus.trace.span_data.SpanData span_datas:
SpanData tuples to emit | [
"def emit(self, span_datas):\n \n # convert to the legacy trace json for easier refactoring\n # TODO: refactor this to use the span data directly\n legacy_trace_json = span_data.format_legacy_trace_json(span_datas)\n self.logger.info(legacy_trace_json)"
] | [
"protected void initFollowsFrom(APMSpanBuilder builder, TraceRecorder recorder, Reference ref, ContextSampler sampler) {\n APMSpan referenced = (APMSpan) ref.getReferredTo();\n\n initTopLevelState(referenced.getTraceContext().getTopSpan(), recorder, sampler);\n\n // Top level node in spawned fr... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Normalize for comparison. | [
"def normalize(self, text, **kwargs):\n \"\"\"\"\"\"\n identifiers = []\n for ident in super(IdentifierType, self).normalize(text, **kwargs):\n identifiers.append(normalize(ident))\n return identifiers"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Wrap sets the connection on the UAAAuthentication and returns itself | [
"func (t *UAAAuthentication) Wrap(innerconnection cloudcontroller.Connection) cloudcontroller.Connection {\n\tt.connection = innerconnection\n\treturn t\n}"
] | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
get response as array.
@return array | [
"public function toArray()\n {\n $data = array(\n 'added' => $this->getAdded(true),\n 'api' => $this->getApi(),\n 'cwd' => $this->getCwd(true),\n 'debug' => $this->getDebug(),\n 'files' => $this->getFiles(true),\n 'list' => $this->getList()... | [
"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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// GetAllAWSIAMServiceLinkedRoleResources retrieves all AWSIAMServiceLinkedRole items from an AWS CloudFormation template | [
"func (t *Template) GetAllAWSIAMServiceLinkedRoleResources() map[string]*resources.AWSIAMServiceLinkedRole {\n\tresults := map[string]*resources.AWSIAMServiceLinkedRole{}\n\tfor name, untyped := range t.Resources {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resources.AWSIAMServiceLinkedRole:\n\t\t\tresults... | [
"function addDispatchSupport(template, options) {\n if (!template.Conditions) {\n template.Conditions = {};\n }\n\n if (!('HasDispatchSnsArn' in template.Conditions)) {\n template.Conditions['HasDispatchSnsArn'] = {\n 'Fn::Not': [\n {\n 'Fn::Equals': [\n '',\n cf.... | codesearchnet | {
"query": "Represent the Github instruction about Cloud Foundry API:",
"pos": "Represent the Github code about Cloud Foundry API:",
"neg": "Represent the Github code about Software development:"
} |
Abbreviates the given text, removes any trailing punctuation except for
the ellipsis appended if the text was truncated, and sanitizes the text
for delivery to IRC.
@param text [String] the text to process
@return [String] the processed text | [
"def prettify(text)\n pretty = abbreviate(text) { |short| short.sub!(/[[:punct:]]+\\z/, '') }\n sanitize pretty\n end"
] | [
"def _sanitize(self, value):\n \n if isinstance(value, six.binary_type):\n value = value.decode('utf-8')\n if isinstance(value, six.text_type):\n new_value = ''.join(ch for ch in value if self._valid_char(ch))\n else:\n return value\n # The new str... | codesearchnet | {
"query": "Represent the Github instruction about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Move this vector towards the given towards the target by the given
extent. The extent should be between 0 and 1. | [
"def interpolate(self, target, extent):\n \n target = cast_anything_to_vector(target)\n self += extent * (target - self)"
] | [
"def radiansBetween(self, other):\n '''\n \n\n '''\n # a dot b = |a||b| * cos(theta)\n # a dot b / |a||b| = cos(theta)\n # cos-1(a dot b / |a||b|) = theta\n\n # translate each line so that it passes through the origin and\n # produce a new point whose distance... | codesearchnet | {
"query": "Represent the summarization about mathematics:",
"pos": "Represent the code about mathematics:",
"neg": "Represent the code about mathematics:"
} |
Asserts that a specific node with the given absolute path exists in the session
@param session
the session to search for the node
@param absPath
the absolute path to look for a node
@throws RepositoryException
if the repository access failed | [
"public static void assertNodeExistByPath(final Session session, final String absPath) throws RepositoryException {\n try {\n session.getNode(absPath);\n } catch (final PathNotFoundException e) {\n LOG.debug(\"Node path {} does not exist\", absPath, e);\n fail(e.getMes... | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Returns whether this Key is an ancestor of `other`.
>>> john = Key('/Comedy/MontyPython/Actor:JohnCleese')
>>> Key('/Comedy').isAncestorOf(john)
True | [
"def isAncestorOf(self, other):\n '''\n\n '''\n if isinstance(other, Key):\n return other._string.startswith(self._string + '/')\n raise TypeError('%s is not of type %s' % (other, Key))"
] | [
"def parent_child_paths(path, some_path):\n \n return PathFilterUtil.is_child(path, some_path) or PathFilterUtil.is_child(some_path, path)"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Check DB for delta cache
@return void | [
"private function checkDB() {\n\t\t$res = $this->query('select * from sqlite_master where type=\\'table\\' and name=\\'dropbox\\'; ');\n\t\tif (! $res) {\n\t\t\ttry {\n\t\t\t\t$this->DB->exec('create table '.$this->DB_TableName.'(path text, fname text, dat blob, isdir integer);');\n\t\t\t\t$this->DB->exec('create i... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Finish a list of pre-assembled documents | [
"def finish(self, blueprint, documents):\n \"\"\"\"\"\"\n\n # Reset the blueprint\n blueprint.reset()\n\n # Finish the documents\n finished = []\n for document in documents:\n finished.append(blueprint.finish(document))\n\n return finished"
] | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Initialize the reinforcement learning loop from a checkpoint. | [
"def initialize_from_checkpoint(state):\n \"\"\"\"\"\"\n\n # The checkpoint's work_dir should contain the most recently trained model.\n model_paths = glob.glob(os.path.join(FLAGS.checkpoint_dir,\n 'work_dir/model.ckpt-*.pb'))\n if len(model_paths) != 1:\n raise RuntimeE... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Load data fixtures with the passed EntityManager.
@param ObjectManager $manager | [
"public function load(ObjectManager $manager)\n {\n /**\n * @var ObjectDirector $configurationDirector\n */\n $configurationDirector = $this->getDirector('configuration');\n\n /**\n * Parameter.\n */\n $parameter = $configurationDirector\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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get client secret for service
:param client: Accounts Service API Client
:param service_id: Service ID
:return: Client secret (if available) | [
"def _get_client_secret(client, service_id):\n \n try:\n response = client.accounts.services[service_id].secrets.get()\n except httpclient.HTTPError as exc:\n if exc.code == 404:\n # If error is a 404 then this means the service_id is not recognised. Raise this error immediately\n ... | [
"def get_user(self, validated_token):\n \n if api_settings.USER_ID_CLAIM not in validated_token:\n # The TokenUser class assumes tokens will have a recognizable user\n # identifier claim.\n raise InvalidToken(_('Token contained no recognizable user identification'))\n\... | codesearchnet | {
"query": "Represent the Github description about accounts.authinfo:",
"pos": "Represent the Github code about accounts.authinfo:",
"neg": "Represent the Github code about Programming:"
} |
// IsControllerMounted returns whether a controller is mounted by checking that
// cgroup.procs is accessible | [
"func IsControllerMounted(c string) (bool, error) {\n\tcgroupProcsPath := filepath.Join(\"/sys/fs/cgroup\", c, \"cgroup.procs\")\n\tif _, err := os.Stat(cgroupProcsPath); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn false, err\n\t\t}\n\t\treturn false, nil\n\t}\n\n\treturn true, nil\n}"
] | [
"function containerRefreshStart(index) {\n previousOrParentNode = loadElement(index);\n ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);\n isParent = true;\n previousOrParentNode.data[ACTIVE_INDEX] = 0;\n if (!checkNoChangesMode) {\n // We need to execute init hooks here s... | codesearchnet | {
"query": "Represent the post about container management:",
"pos": "Represent the code about container management:",
"neg": "Represent the code about programming:"
} |
Writes a line of text
@see TextWriter::writeln()
@param string $text
@param array $formatOptions
@return Console | [
"public function writeln($text = '', $pipe = TextWriter::STDOUT)\n {\n $this->textWriter->writeln($text, $pipe);\n return $this;\n }"
] | [
"public function render($renderer)\n {\n $renderer->setCurrentStyle('footnotenum');\n $renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Provides the list of capabilities a Pod fulfills. See [[SoftLayer_Network_Pod/listCapabilities]] for more information on capabilities. | [
"func (r Network_Pod) GetCapabilities() (resp []string, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Network_Pod\", \"getCapabilities\", nil, &r.Options, &resp)\n\treturn\n}"
] | [
"function API (parameters) {\n // Own API resource prefix (e.g. '/resource').\n this.path = parameters.path || null;\n\n // Own documentation.\n this.title = parameters.title || null;\n this.description = parameters.description || null;\n\n // Own test setup functions.\n this.beforeEachTest = parameters.befo... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setNumCdPts(Integer newNumCdPts) {\n\t\tInteger oldNumCdPts = numCdPts;\n\t\tnumCdPts = newNumCdPts;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.CPD__NUM_CD_PTS, oldNumCdPts, numCdPts));\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github comment about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Write this sample to a WAV file.
:param filename: the file to which to write | [
"def write_wav(self, filename):\n \n\n wave_output = None\n try:\n wave_output = wave.open(filename, 'w')\n\n wave_output.setparams(WAVE_PARAMS)\n\n frames = bytearray([x << 4 for x in self.sample_data])\n\n wave_output.writeframes(frames)\n fi... | [
"def open(self, mode=MODE_READ):\n \n if mode not in [MODE_READ, MODE_WRITE]:\n error = \"Open mode must be '{}' or '{}'\".format(\n MODE_READ, MODE_WRITE)\n raise ValueError(error)\n self._openMode = mode\n if mode == MODE_READ:\n self.ass... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// ParseRelayFactor validates and converts the given relay factor to uint8 | [
"func ParseRelayFactor(n int) (uint8, error) {\n\tif n < 0 || n > 5 {\n\t\treturn 0, fmt.Errorf(\"Relay factor must be in range: [0, 5]\")\n\t}\n\treturn uint8(n), nil\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 sentence about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
// XXX_OneofFuncs is for the internal use of the proto package. | [
"func (*SharedSetOperation) 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 _SharedSetOperation_OneofMarshaler, _SharedSetOperation_OneofUnmarshaler, _SharedSetOperati... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Replies the preference store for the given project.
@param project the project.
@return the preference store or <code>null</code>. | [
"public static IPreferenceStore getSARLPreferencesFor(IProject project) {\n\t\tif (project != null) {\n\t\t\tfinal Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL);\n\t\t\tfinal IPreferenceStoreAccess preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.cla... | [
"def get_value_from_session(key):\n \n def value_from_session_function(service, message):\n \"\"\"Actual implementation of get_value_from_session function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Get the endpoints primary key, if one is not set, fetch it from the schema
@return array|string
@throws \Muffin\Webservice\Exception\UnexpectedDriverException When no schema exists to fetch the key from | [
"public function getPrimaryKey()\n {\n if ($this->_primaryKey === null) {\n $schema = $this->getSchema();\n if (!$schema) {\n throw new UnexpectedDriverException(__('No schema has been defined for this endpoint'));\n }\n $key = (array)$schema->pri... | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Sets the machine to boot to boot_device on its next reboot
Will default back to normal boot list on the reboot that follows. | [
"def set_next_boot(self, boot_device):\n \n payload = amt.wsman.change_boot_order_request(self.uri, boot_device)\n self.post(payload)\n\n payload = amt.wsman.enable_boot_config_request(self.uri)\n self.post(payload)"
] | [
"def initrd(self, initrd):\n \n\n initrd = self.manager.get_abs_image_path(initrd)\n\n log.info('QEMU VM \"{name}\" [{id}] has set the QEMU initrd path to {initrd}'.format(name=self._name,\n id=self._id,\n... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set file view finder base path.
@param $path | [
"public function setBasePath($path)\n {\n $this->basePath = $path;\n\n array_unshift($this->paths, $this->basePath);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Clear remove the fd from the set | [
"func (fds *FDSet) Clear(fd uintptr) {\n\tfds.X__fds_bits[fd/NFDBITS] &^= (1 << (fd % NFDBITS))\n}"
] | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@!group Actions
@example Request syntax with placeholder values
notification_configuration.delete()
@param [Hash] options ({})
@return [EmptyStructure] | [
"def delete(options = {})\n options = options.merge(\n auto_scaling_group_name: @group_name,\n topic_arn: @topic_arn\n )\n resp = @client.delete_notification_configuration(options)\n resp.data\n end"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Lists a queue.
@link http://msdn.microsoft.com/en-us/library/windowsazure/hh780759
@param ListQueuesOptions|null $listQueuesOptions The options to list the
queues
@return ListQueuesResult | [
"public function listQueues(ListQueuesOptions $listQueuesOptions = null)\n {\n $response = $this->_listOptions(\n $listQueuesOptions,\n Resources::LIST_QUEUES_PATH\n );\n\n $listQueuesResult = new ListQueuesResult();\n $listQueuesResult->parseXml($response->getBo... | [
"def get_event(self, event_id):\n \n mask = \"\"\"mask[\n acknowledgedFlag,\n attachments,\n impactedResources,\n statusCode,\n updates,\n notificationOccurrenceEventType]\n \"\"\"\n return self.client.call('Notification_O... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Iterate over the resource as row proxy objects, which allow acessing colums as attributes. Like iterrows,
but allows for setting a specific RowProxy class. | [
"def iterrowproxy(self, cls=RowProxy):\n \n\n row_proxy = None\n\n headers = None\n\n for row in self:\n\n if not headers:\n headers = row\n row_proxy = cls(headers)\n continue\n\n yield row_proxy.set_row(row)"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Write the metadata to disk
Returns nothing. | [
"def write_metadata\n unless disabled?\n Jekyll.logger.debug \"Writing Metadata:\", \".jekyll-metadata\"\n File.binwrite(metadata_file, Marshal.dump(metadata))\n end\n end"
] | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
transform the HTML String
@param html HTML String to transform
@param url Absolute URL path to set
@return transformed HTMl String
@throws PageException | [
"public String transform(String html, URL url, boolean setBaseTag) throws PageException {\n\tStringBuffer target = new StringBuffer();\n\tSourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML);\n\twhile (!cfml.isAfterLast()) {\n\t if (cfml.forwardIfCurrent('<')) {\n\t\ttarget.append('<');\n\t\ttr... | [
"@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 description about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about Programming:"
} |
Renders checkboxes.
Disable checkbox for parent item navigation link. | [
"def action_checkbox(self, obj):\n \n if getattr(obj, Hierarchy.UPPER_LEVEL_MODEL_ATTR, False):\n return ''\n\n return super(HierarchicalModelAdmin, self).action_checkbox(obj)"
] | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set path from root
Args: path: (str) items to add to path
Returns: None | [
"def set(self, *path):\n \n self.path = [self.channel_name]\n self.path.extend(list(path))"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Causes of death in the nation, as percentages.
Returns
-------
an :class:`ApiQuery` of dict with keys of str and values of float | [
"async def deaths(self, root):\n \n return {\n elem.get('type'): float(elem.text)\n for elem in root.find('DEATHS')\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
NOTE: this is used for incremental updates only | [
"function _disposeChild (child) {\n child.triggerDispose()\n if (child._owner && child._ref) {\n console.assert(child._owner.refs[child._ref] === child, \"Owner's ref should point to this child instance.\")\n delete child._owner.refs[child._ref]\n }\n}"
] | [
"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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Keep refreshing the service every 30sec | [
"func (ep *EtcdClient) refreshService(srvState *etcdServiceState, keyVal string) {\n\t// Set it via etcd client\n\t_, err := ep.kapi.Set(context.Background(), srvState.KeyName, keyVal, &client.SetOptions{TTL: srvState.TTL})\n\tif err != nil {\n\t\tlog.Errorf(\"Error setting key %s, Err: %v\", srvState.KeyName, err)... | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Finds the parent address, everything before the last address part.
@param address the address to get the parent
@return the parent address
@throws IllegalArgumentException if the address is not of type {@link ModelType#LIST} or is empty | [
"public static ModelNode getParentAddress(final ModelNode address) {\n if (address.getType() != ModelType.LIST) {\n throw new IllegalArgumentException(\"The address type must be a list.\");\n }\n final ModelNode result = new ModelNode();\n final List<Property> addressParts = a... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github sentence about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about programming:"
} |
Get array.length elements from the set, and put them into the array. | [
"@SuppressWarnings(\"unchecked\")\n public T[] pollToArray(T[] array) {\n int currentIndex = 0;\n LinkedElement<T> current = null;\n\n if (array.length == 0) {\n return array;\n }\n if (array.length > size) {\n array = (T[]) java.lang.reflect.Array.newInstance(array.getClass()\n .... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Update Media Display | [
"function() {\n\t\t//this.el.content_item = document.getElementById(this._el.content_item.id);\n\t\tthis._el.content_item.style.height = TL.Util.ratio.r16_9({w:this.options.width}) + \"px\";\n\t\tthis._el.content_item.style.width = this.options.width + \"px\";\n\t}"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
@Route("/api/v{version}/_action/version/merge/{entity}/{versionId}", name="api.mergeVersion", methods={"POST"},
requirements={"version"="\d+", "entity"="[a-zA-Z-]+", "versionId"="[0-9a-f]{32}"
})
@throws InvalidUuidException | [
"public function mergeVersion(Context $context, string $entity, string $versionId): JsonResponse\n {\n if (!Uuid::isValid($versionId)) {\n throw new InvalidUuidException($versionId);\n }\n\n $entityDefinition = $this->getEntityDefinition($entity);\n $repository = $this->def... | [
"def reset(self, rabaClass, namespace = None) :\n\t\t\"\"\"\"\"\"\n\n\t\tif type(rabaClass) is types.StringType :\n\t\t\tself._raba_namespace = namespace\n\t\t\tself.con = stp.RabaConnection(self._raba_namespace)\n\t\t\tself.rabaClass = self.con.getClass(rabaClass)\n\t\telse :\n\t\t\tself.rabaClass = rabaClass\n\t\... | codesearchnet | {
"query": "Represent the post about Sales Channel API:",
"pos": "Represent the code about Sales Channel API:",
"neg": "Represent the code:"
} |
// MeasureSinceWithLabels method for execution time recording with custom labels | [
"func (mw *Stats) MeasureSinceWithLabels(key string, start time.Time, labels []Label) {\n\tlabels = append(labels, Label{\"host\", mw.Hostname})\n\telapsed := time.Since(start)\n\n\tmw.mu.Lock()\n\tdefer mw.mu.Unlock()\n\n\tmw.MetricsCounts[key]++\n\tmw.MetricsTimers[key] = mw.MetricsTimers[key].Add(elapsed)\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
remove an SSH key | [
"function remove(keyId, callback) {\n commons.del(format('/%s/keys/%s', deis.version, keyId), callback);\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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Dump file
@param string $path
@param string $declaration
@param string $ref
@param boolean $replaceBefore | [
"protected function dumpFile($path, $declaration, $ref = null, $replaceBefore = true)\n {\n $fileSystem = new Filesystem();\n\n if (is_null($ref)) {\n $fileSystem->dumpFile($path, $declaration);\n\n return;\n }\n\n $content = file_get_contents($path);\n\n ... | [
"protected static function parseMethodExec($data = null){\n self::$input = AnnotationFun::replaceMethodStr(self::$body , AnnotationFun::createClosure(self::$body , self::$argv['methodName'], $data) , self::$input);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about PHP:"
} |
// FormatPayload converts the Payload into a FormattedPayload. | [
"func FormatPayload(payload payload.FullPayloadInfo) FormattedPayload {\n\tvar labels []string\n\tif len(payload.Labels) > 0 {\n\t\tlabels = make([]string, len(payload.Labels))\n\t\tcopy(labels, payload.Labels)\n\t}\n\treturn FormattedPayload{\n\t\tUnit: payload.Unit,\n\t\tMachine: payload.Machine,\n\t\tID: ... | [
"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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Send HTTP response
@param DispatcherResponseInterface $response
@return boolean | [
"public function send(DispatcherResponseInterface $response)\n {\n $request = $response->getRequest();\n\n if($response->isStreamable())\n {\n //Explicitly set the Accept Ranges header to bytes to inform client we accept range requests\n $response->headers->set('Accept... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github text about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Programming:"
} |
Get the access token.
@return AccessToken|null Oauth2 access token | [
"public function getAccessToken()\n {\n if ($this->accessToken && $this->accessToken->isExpired()) {\n // The access token has expired.\n $this->accessToken = null;\n }\n\n if (null === $this->accessToken) {\n // Try to acquire a new access token from the ser... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// UpdateConfiguration is part of the throttlerclient.Client interface. | [
"func (c *client) UpdateConfiguration(ctx context.Context, throttlerName string, configuration *throttlerdatapb.Configuration, copyZeroValues bool) ([]string, error) {\n\tresponse, err := c.gRPCClient.UpdateConfiguration(ctx, &throttlerdatapb.UpdateConfigurationRequest{\n\t\tThrottlerName: throttlerName,\n\t\tConf... | [
"@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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Запускаем проверку
@param array $data Массив данных
@param array $user_roles Массив ролей пользователя
@return array
@version 29.12.2018
@author Дмитрий Щербаков <atomcms@ya.ru> | [
"public function run($data, $user_roles)\n {\n if (is_array($user_roles) && count($user_roles) > 0) {\n if (isset($user_roles['admin'])) {\n return [];\n } else {\n if (isset($data['page']) && isset($data['access']) && $data['page'] !== '' && $data['acce... | [
"function getValue() {\n\t\t$chosen = parent::getValue(); /** @var string|null $chosen */\n\t\t$allowed = $this->dfValues(); /** @var string[] $allowed */\n\t\t// 2016-11-13\n\t\t// Обрабатываем тот случай, когда значения self::$ORDER и self::$BASE были разрешены\n\t\t// в предыдущих версиях модуля, а потом стали з... | codesearchnet | {
"query": "Represent the Github instruction about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
// SetEc2KeyName sets the Ec2KeyName field's value. | [
"func (s *ServerLaunchConfiguration) SetEc2KeyName(v string) *ServerLaunchConfiguration {\n\ts.Ec2KeyName = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get the key manager factory algorithm default from Security.
@return String | [
"public static String getKeyManagerFactoryAlgorithm() {\n if (keyManagerFactoryAlgorithm == null) {\n keyManagerFactoryAlgorithm = AccessController.doPrivileged(new PrivilegedAction<String>() {\n @Override\n public String run() {\n return Security.g... | [
"@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 about Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code about Programming:"
} |
// Remove removes a key from the working tree. | [
"func (tree *MutableTree) Remove(key []byte) ([]byte, bool) {\n\tval, orphaned, removed := tree.remove(key)\n\ttree.addOrphans(orphaned)\n\treturn val, removed\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
TODO: add @Transactional annotation and respective aspect for Hazelcast transactions | [
"@Override\n public void deleteInstance(String instanceId) {\n modifyInstance(instanceId, map -> {\n Instance deletedInstance = map.remove(instanceId);\n getDeletedInstancesByIdMap().put(deletedInstance.getId(), deletedInstance);\n });\n }"
] | [
"@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Assert that the index is unique
Parameters
==========
df : DataFrame
Returns
=======
df : DataFrame | [
"def unique_index(df):\n \n try:\n assert df.index.is_unique\n except AssertionError as e:\n e.args = df.index.get_duplicates()\n raise\n return df"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Detects a device running the Meego OS. | [
"function DetectMeego()\r\n {\r\n if (stripos($this->useragent, $this->deviceMeego) > -1)\r\n return $this->true; \r\n else\r\n return $this->false; \r\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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns alias
@param string $alias
@return string | [
"public function alias($alias = null)\r\n {\r\n if ($alias !== null) {\r\n $this->alias = $alias;\r\n }\r\n\r\n return $this->alias;\r\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 instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Get PyPI long description from the .rst file. | [
"def get_long_description():\n \"\"\"\"\"\"\n pkg_dir = get_package_dir()\n with open(os.path.join(pkg_dir, '.pypi_long_desc.rst')) as readme_file:\n long_description = readme_file.read()\n return long_description"
] | [
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// This will clear any pending flush calls and release pending calls.
// Lock is assumed to be held by the caller. | [
"func (nc *Conn) clearPendingFlushCalls() {\n\t// Clear any queued pongs, e.g. pending flush calls.\n\tfor _, ch := range nc.pongs {\n\t\tif ch != nil {\n\t\t\tclose(ch)\n\t\t}\n\t}\n\tnc.pongs = nil\n}"
] | [
"@Override\n public void destroy() // PK20881\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"destroy\");\n\n // Dummy transactionWrappers may not be in any table and so\n // will not have a resourceCallback registered to remove them.\n if (_resourceCallback != null)\n ... | codesearchnet | {
"query": "Represent the comment about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about Database management:"
} |
Allow a client to begin a commit and acquire the write lock | [
"def begin_commit():\n \n\n session_token = request.headers['session_token']\n repository = request.headers['repository']\n\n #===\n current_user = have_authenticated_user(request.environ['REMOTE_ADDR'], repository, session_token)\n if current_user is False: return fail(user_auth_fail_msg)\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// UnmarshalJSON implements json.Unmarshaler interface. | [
"func (p *condition) UnmarshalJSON(data []byte) error {\n\tvar d []json.RawMessage\n\tif err := json.Unmarshal(data, &d); err != nil {\n\t\treturn err\n\t}\n\tif len(d) != 2 {\n\t\treturn errors.New(\"condition must be a list with two items\")\n\t}\n\tif err := json.Unmarshal(d[0], &p.Condition); err != nil {\n\t\t... | [
"func DecodeJSONFromReader(r io.Reader, out interface{}) error {\n\tif r == nil {\n\t\treturn fmt.Errorf(\"'io.Reader' being decoded is nil\")\n\t}\n\tif out == nil {\n\t\treturn fmt.Errorf(\"output parameter 'out' is nil\")\n\t}\n\n\tdec := json.NewDecoder(r)\n\n\t// While decoding JSON values, interpret the integ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Parses the command line arguments and determines which action to perform.
@param array $args command line arguments
@return array the action name, named options (name=>value), and unnamed options
@since 1.1.5 | [
"protected function resolveRequest($args)\n\t{\n\t\t$options=array();\t// named parameters\n\t\t$params=array();\t// unnamed parameters\n\t\tforeach($args as $arg)\n\t\t{\n\t\t\tif(preg_match('/^--(\\w+)(=(.*))?$/',$arg,$matches)) // an option\n\t\t\t{\n\t\t\t\t$name=$matches[1];\n\t\t\t\t$value=isset($matches[3])... | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetLaunchPath sets the LaunchPath field's value. | [
"func (s *Application) SetLaunchPath(v string) *Application {\n\ts.LaunchPath = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
转换微信XML为Map(仅支持2级)
@param readers xmlReaders
@return Map对象 | [
"public static Map<String, Object> toMap(XmlReaders readers){\n Node root = readers.getNode(\"xml\");\n if (root == null){\n return Collections.emptyMap();\n }\n NodeList children = root.getChildNodes();\n if (children.getLength() == 0){\n return Collections.... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Add an index to a database table.
In $options you can specific unique = true/false or name (index name).
@param string|array|\Phinx\Db\Table\Index $columns Table Column(s)
@param array $options Index Options
@return \Phinx\Db\Table | [
"public function addIndex($columns, array $options = [])\n {\n $action = AddIndex::build($this->table, $columns, $options);\n $this->actions->addAction($action);\n\n return $this;\n }"
] | [
"public function toSql(\\Doctrine\\DBAL\\Schema\\SchemaDiff $schema) //Doctrine\\DBAL\\Schema\\SchemaDiff | \\Doctrine\\DBAL\\Schema\\Schema\n {\n return $schema->toSaveSql($this->getPlatform());\n //return $schema->toSql($this->getPlatform()); //it can return with DROP TABLE\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Returns true if this user is the current user.
@return boolean | [
"public function isCurrent()\n {\n if (AVUser::getCurrentUser() && $this->getObjectId())\n {\n if ($this->getObjectId() == AVUser::getCurrentUser()->getObjectId())\n {\n return true;\n }\n }\n\n return false;\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 text about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about programming:"
} |
Remove the specified resource from storage.
@param Request $request
@param $page
@return Response | [
"public function restore(Request $request, $page)\n {\n // Set roles that have access\n $request->user()->authorizeRoles(['admin', 'editor']);\n\n $page = Page::withTrashed()->findOrFail($page);\n $page->restore();\n\n flash('Page has been successfully restored')->success();\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
This is slow, so we should cache to avoid killing perf:
See: http://www.jguru.com/faq/view.jsp?EID=246569 | [
"protected Method getParse(Class cls) throws Exception {\n Method meth = methodCache.get(cls);\n if (null == meth) {\n meth = cls.getMethod(\"parseFrom\", new Class[]{ byte[].class });\n methodCache.put(cls, meth);\n }\n return meth;\n }"
] | [
"def network_device_name\n return @network_device_name if @network_device_name\n major, minor, build = ::RightScale::Platform.release.split(\".\").map(&:to_i)\n @network_device_name = (major == 6 && minor <= 1) ? \"Local Area Connection\" : \"Ethernet\" # http://msdn.microsoft.com/en-us/library/ms724... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets and unsets value (flash value) for given or default namespace
@param string $name
@param string $namespace
@return mixed | [
"public function getUnsetValue($name, $namespace = self::DEFAULT_NAMESPACE)\n {\n $value = $this->getValue($name, $namespace);\n $this->unsetValue($name, $namespace);\n\n return $value;\n }"
] | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retrieve current user networks | [
"public function getNetworks($user = null)\n {\n if ($user == null) {\n $user = $this->container->get('security.context')->getToken()->getUser();\n }\n if ($user === 'anon.') {\n return (array());\n }\n $perimeters = $user->getCustomer()->getPerimeters();\... | [
"@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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Looks at each row, and calculates the mean. Honours
the Trump override/failsafe logic. | [
"def mean_fill(adf):\n \n ordpt = adf.values[0]\n if not pd.isnull(ordpt):\n return ordpt\n\n fdmn = adf.iloc[1:-1].mean()\n if not pd.isnull(fdmn):\n return fdmn\n\n flspt = adf.values[-1]\n if not pd.isnull(flspt):\n return flspt\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get element ID list from cache or database
@return array|null | [
"protected function getIDList() : array\n {\n //Get element ID list from cache\n $arElementIDList = $this->getIDListFromCache();\n if (!empty($arElementIDList) && is_array($arElementIDList)) {\n return $arElementIDList;\n }\n\n $arElementIDList = $this->getIDListFrom... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return the AudioInputStream from the given InputStream.
@param inputStream
@param totalms
@param medialength
@return
@throws javax.sound.sampled.UnsupportedAudioFileException
@throws java.io.IOException | [
"public AudioInputStream getAudioInputStream(InputStream inputStream, int medialength, int totalms) throws UnsupportedAudioFileException, IOException {\n LOG.log(Level.FINE, \"getAudioInputStream(InputStream inputStreamint medialength, int totalms)\");\n try {\n if (!inputStream.markSupport... | [
"private void readPackageListFromURL(String urlpath, URL pkglisturlpath) throws Fault {\n try {\n URL link = pkglisturlpath.toURI().resolve(DocPaths.PACKAGE_LIST.getPath()).toURL();\n readPackageList(link.openStream(), urlpath, false);\n } catch (URISyntaxException | MalformedURL... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Checks if the given object is a Certificate
@param {*} obj
@returns {Boolean} | [
"function (obj) {\n return Boolean(obj) && ((obj instanceof Certificate) ||\n _.inSuperChain(obj.constructor, '_postman_propertyName', Certificate._postman_propertyName));\n }"
] | [
"function validateConfig (config) {\n var type = typeOf(config);\n\n if (type.hasValue && !type.isPOJO) {\n throw ono('Invalid arguments. Expected a configuration object.');\n }\n}"
] | codesearchnet | {
"query": "Represent the post about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Software development:"
} |
Gets the foreign key for a given class.
@param string the class name
@param bool $use_underscore whether to use an underscore or not
@return string the foreign key | [
"public function foreignKey($class_name, $use_underscore = true)\n\t{\n\t\t$class_name = $this->denamespace($this->str->lower($class_name));\n\t\tif (strncasecmp($class_name, 'Model_', 6) === 0)\n\t\t{\n\t\t\t$class_name = substr($class_name, 6);\n\t\t}\n\t\treturn $this->underscore($this->demodulize($class_name)).... | [
"public function wrap($value, $prefixAlias = false)\n {\n // We will only wrap the value unless it has parentheses\n // in it which is the case where we're matching a node by id, or an *\n // and last whether this is a pre-formatted key.\n if (preg_match('/[(|)]/', $value) || $value =... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// assignPod assigns the given pod to the given machine. | [
"func (r *BindingREST) assignPod(ctx context.Context, podID string, machine string, annotations map[string]string, dryRun bool) (err error) {\n\tif _, err = r.setPodHostAndAnnotations(ctx, podID, \"\", machine, annotations, dryRun); err != nil {\n\t\terr = storeerr.InterpretGetError(err, api.Resource(\"pods\"), pod... | [
"@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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
A convenience method to check that the form-posted data is valid; just
in case you don't want to jump directly to the save if the data *is*
valid.
@param string $FormPostValues
@todo $FormPostValues needs a description and correct variable type. | [
"public function Validate($FormPostValues) {\n $this->Validation->ApplySchema($this->Data);\n // Validate the form posted values\n return $this->Validation->Validate($FormPostValues);\n }"
] | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software Development:"
} |
Filter results that intersect a given GeoFeature or Vector. | [
"def filter(self, intersects):\n \n try:\n crs = self.crs\n vector = intersects.geometry if isinstance(intersects, GeoFeature) else intersects\n prepared_shape = prep(vector.get_shape(crs))\n hits = []\n\n for feature in self:\n tar... | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Checks the cache to see if there's a cached entry for this pk. If not, fetches
using super then stores the result in cache.
Most of the logic here was gathered from a careful reading of
``django.db.models.sql.query.add_filter`` | [
"def get(self, *args, **kwargs):\n \n if self.query.where:\n # If there is any other ``where`` filter on this QuerySet just call\n # super. There will be a where clause if this QuerySet has already\n # been filtered/cloned.\n return super(CachingQuerySet, se... | [
"def _get_metadata_path_for_display(self, name):\n \n try:\n # We need to access _get_metadata_path() on the provider object\n # directly rather than through this class's __getattr__()\n # since _get_metadata_path() is marked private.\n path = self._provider... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.