repository_name
stringlengths
7
48
func_path_in_repository
stringlengths
5
155
func_name
stringlengths
0
100
whole_func_string
stringlengths
71
27.8k
language
stringclasses
6 values
func_code_string
stringlengths
71
27.8k
func_code_tokens
listlengths
22
3.12k
func_documentation_string
stringlengths
1
9.31k
func_documentation_tokens
listlengths
1
1.37k
split_name
stringclasses
1 value
func_code_url
stringlengths
90
255
formatted_text
stringlengths
188
27.9k
boltdb/bolt
cmd/bolt/main.go
leafPageElement
func (p *page) leafPageElement(index uint16) *leafPageElement { n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index] return n }
go
func (p *page) leafPageElement(index uint16) *leafPageElement { n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index] return n }
[ "func", "(", "p", "*", "page", ")", "leafPageElement", "(", "index", "uint16", ")", "*", "leafPageElement", "{", "n", ":=", "&", "(", "(", "*", "[", "0x7FFFFFF", "]", "leafPageElement", ")", "(", "unsafe", ".", "Pointer", "(", "&", "p", ".", "ptr", ...
// DO NOT EDIT. Copied from the "bolt" package.
[ "DO", "NOT", "EDIT", ".", "Copied", "from", "the", "bolt", "package", "." ]
train
https://github.com/boltdb/bolt/blob/fd01fc79c553a8e99d512a07e8e0c63d4a3ccfc5/cmd/bolt/main.go#L1494-L1497
<s>[INST] Here is the documentation: // DO NOT EDIT. Copied from the "bolt" package. What code implements this? [/INST] func (p *page) leafPageElement(index uint16) *leafPageElement { n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index] return n } </s>
garfunkel/go-tvdb
tvdb.go
GetDetail
func (seriesList *SeriesList) GetDetail() (err error) { for seriesIndex := range seriesList.Series { if err = seriesList.Series[seriesIndex].GetDetail(); err != nil { return } } return }
go
func (seriesList *SeriesList) GetDetail() (err error) { for seriesIndex := range seriesList.Series { if err = seriesList.Series[seriesIndex].GetDetail(); err != nil { return } } return }
[ "func", "(", "seriesList", "*", "SeriesList", ")", "GetDetail", "(", ")", "(", "err", "error", ")", "{", "for", "seriesIndex", ":=", "range", "seriesList", ".", "Series", "{", "if", "err", "=", "seriesList", ".", "Series", "[", "seriesIndex", "]", ".", ...
// GetDetail gets more detail for all TV shows in a list.
[ "GetDetail", "gets", "more", "detail", "for", "all", "TV", "shows", "in", "a", "list", "." ]
train
https://github.com/garfunkel/go-tvdb/blob/59b4220a6dad5aa6d153d3b373a8020de417b9d7/tvdb.go#L132-L140
<s>[INST] Here is the documentation: // GetDetail gets more detail for all TV shows in a list. What code implements this? [/INST] func (seriesList *SeriesList) GetDetail() (err error) { for seriesIndex := range seriesList.Series { if err = seriesList.Series[seriesIndex].GetDetail(); err != nil { return } } r...
crazedsanity/core
src/core/ToolBox.class.php
ToolBox.string_from_array
static public function string_from_array($array,$style=NULL,$separator=NULL, $cleanString=NULL, $removeEmptyVals=FALSE) { $retval = NULL; //precheck... if it's not an array, kill it. if(!is_array($array)) { return(NULL); } //make sure $style is valid. $style = strtolower($style); if(is_array($...
php
static public function string_from_array($array,$style=NULL,$separator=NULL, $cleanString=NULL, $removeEmptyVals=FALSE) { $retval = NULL; //precheck... if it's not an array, kill it. if(!is_array($array)) { return(NULL); } //make sure $style is valid. $style = strtolower($style); if(is_array($...
[ "static", "public", "function", "string_from_array", "(", "$", "array", ",", "$", "style", "=", "NULL", ",", "$", "separator", "=", "NULL", ",", "$", "cleanString", "=", "NULL", ",", "$", "removeEmptyVals", "=", "FALSE", ")", "{", "$", "retval", "=", "...
Basically, just a wrapper for create_list(), which returns a list or an array of lists, depending upon what was requested. @param $array <array> list for the array... @param $style <str,optional> what "style" it should be returned as (select, update, etc). @param $separator <str,optional> what separattes key from va...
[ "Basically", "just", "a", "wrapper", "for", "create_list", "()", "which", "returns", "a", "list", "or", "an", "array", "of", "lists", "depending", "upon", "what", "was", "requested", "." ]
train
https://github.com/crazedsanity/core/blob/f3053467edc6d105ebdaca146325b79329aa1d63/src/core/ToolBox.class.php#L92-L302
<s>[INST] Here is the documentation: Basically, just a wrapper for create_list(), which returns a list or an array of lists, depending upon what was requested. @param $array <array> list for the array... @param $style <str,optional> what "style" it should be returned as (select, update, etc). @param $separator <str,...
wiredrive/wtframework
wtframework/wtf/assets.py
AssetManager.get_asset_path
def get_asset_path(self, filename): """ Get the full system path of a given asset if it exists. Otherwise it throws an error. Args: filename (str) - File name of a file in /assets folder to fetch the path for. Returns: str - path to the target file. ...
python
def get_asset_path(self, filename): """ Get the full system path of a given asset if it exists. Otherwise it throws an error. Args: filename (str) - File name of a file in /assets folder to fetch the path for. Returns: str - path to the target file. ...
[ "def", "get_asset_path", "(", "self", ",", "filename", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_asset_path", ",", "filename", ")", ")", ":", "return", "os", ".", "path", ".", "join",...
Get the full system path of a given asset if it exists. Otherwise it throws an error. Args: filename (str) - File name of a file in /assets folder to fetch the path for. Returns: str - path to the target file. Raises: AssetNotFoundError - if asset...
[ "Get", "the", "full", "system", "path", "of", "a", "given", "asset", "if", "it", "exists", ".", "Otherwise", "it", "throws", "an", "error", "." ]
train
https://github.com/wiredrive/wtframework/blob/ef7f86c4d4cf7fb17745fd627b3cc4a41f4c0216/wtframework/wtf/assets.py#L47-L70
<s>[INST] Here is the documentation: Get the full system path of a given asset if it exists. Otherwise it throws an error. Args: filename (str) - File name of a file in /assets folder to fetch the path for. Returns: str - path to the target file. Raises: ...
sbunce/bson
decode.go
readInt64
func readInt64(rd io.Reader) (int64, error) { var i int64 if err := binary.Read(rd, binary.LittleEndian, &i); err != nil { return 0, err } return i, nil }
go
func readInt64(rd io.Reader) (int64, error) { var i int64 if err := binary.Read(rd, binary.LittleEndian, &i); err != nil { return 0, err } return i, nil }
[ "func", "readInt64", "(", "rd", "io", ".", "Reader", ")", "(", "int64", ",", "error", ")", "{", "var", "i", "int64", "\n", "if", "err", ":=", "binary", ".", "Read", "(", "rd", ",", "binary", ".", "LittleEndian", ",", "&", "i", ")", ";", "err", ...
// readInt64 reads one int64. This is not a BSON element.
[ "readInt64", "reads", "one", "int64", ".", "This", "is", "not", "a", "BSON", "element", "." ]
train
https://github.com/sbunce/bson/blob/2aa5ebe749b24e053f742541fe8242e80f40c4a0/decode.go#L776-L782
<s>[INST] Here is the documentation: // readInt64 reads one int64. This is not a BSON element. What code implements this? [/INST] func readInt64(rd io.Reader) (int64, error) { var i int64 if err := binary.Read(rd, binary.LittleEndian, &i); err != nil { return 0, err } return i, nil } </s>
greggman/twgl.js
src/primitives.js
createCubeVertices
function createCubeVertices(size) { size = size || 1; const k = size / 2; const cornerVertices = [ [-k, -k, -k], [+k, -k, -k], [-k, +k, -k], [+k, +k, -k], [-k, -k, +k], [+k, -k, +k], [-k, +k, +k], [+k, +k, +k], ]; const faceNormals = [ [+1, +0, +0], [-1, +0, +0], ...
javascript
function createCubeVertices(size) { size = size || 1; const k = size / 2; const cornerVertices = [ [-k, -k, -k], [+k, -k, -k], [-k, +k, -k], [+k, +k, -k], [-k, -k, +k], [+k, -k, +k], [-k, +k, +k], [+k, +k, +k], ]; const faceNormals = [ [+1, +0, +0], [-1, +0, +0], ...
[ "function", "createCubeVertices", "(", "size", ")", "{", "size", "=", "size", "||", "1", ";", "const", "k", "=", "size", "/", "2", ";", "const", "cornerVertices", "=", "[", "[", "-", "k", ",", "-", "k", ",", "-", "k", "]", ",", "[", "+", "k", ...
Creates the buffers and indices for a cube. The cube is created around the origin. (-size / 2, size / 2). @param {WebGLRenderingContext} gl The WebGLRenderingContext. @param {number} [size] width, height and depth of the cube. @return {Object.<string, WebGLBuffer>} The created buffers. @memberOf module:twgl/primitive...
[ "Creates", "the", "buffers", "and", "indices", "for", "a", "cube", "." ]
train
https://github.com/greggman/twgl.js/blob/ae88dfe4d7a7d44a5b739fcbe50bccccd0e1a1fd/src/primitives.js#L689-L752
<s>[INST] Here is the documentation: Creates the buffers and indices for a cube. The cube is created around the origin. (-size / 2, size / 2). @param {WebGLRenderingContext} gl The WebGLRenderingContext. @param {number} [size] width, height and depth of the cube. @return {Object.<string, WebGLBuffer>} The created buf...
glycerine/go-unsnap-stream
snap.go
Write
func (sf *SnappyFile) Write(p []byte) (n int, err error) { if sf.SnappyEncodeDecodeOff { return sf.Writer.Write(p) } if !sf.Writing { panic("Writing on a read-only SnappyFile") } // encoding in snappy can apparently go beyond the original size, beware. // so our buffers must be sized 2*max snappy chunk => ...
go
func (sf *SnappyFile) Write(p []byte) (n int, err error) { if sf.SnappyEncodeDecodeOff { return sf.Writer.Write(p) } if !sf.Writing { panic("Writing on a read-only SnappyFile") } // encoding in snappy can apparently go beyond the original size, beware. // so our buffers must be sized 2*max snappy chunk => ...
[ "func", "(", "sf", "*", "SnappyFile", ")", "Write", "(", "p", "[", "]", "byte", ")", "(", "n", "int", ",", "err", "error", ")", "{", "if", "sf", ".", "SnappyEncodeDecodeOff", "{", "return", "sf", ".", "Writer", ".", "Write", "(", "p", ")", "\n", ...
// add Write() method for SnappyFile (see unsnap.go) // reference for snappy framing/streaming format: // http://code.google.com/p/snappy/source/browse/trunk/framing_format.txt // ?spec=svn68&r=71 // // Write writes len(p) bytes from p to the underlying data stream. // It returns the number of bytes...
[ "add", "Write", "()", "method", "for", "SnappyFile", "(", "see", "unsnap", ".", "go", ")", "reference", "for", "snappy", "framing", "/", "streaming", "format", ":", "http", ":", "//", "code", ".", "google", ".", "com", "/", "p", "/", "snappy", "/", "...
train
https://github.com/glycerine/go-unsnap-stream/blob/f9677308dec2b35e76737f9713df328ad11b1fea/snap.go#L24-L93
<s>[INST] Here is the documentation: // add Write() method for SnappyFile (see unsnap.go) // reference for snappy framing/streaming format: // http://code.google.com/p/snappy/source/browse/trunk/framing_format.txt // ?spec=svn68&r=71 // // Write writes len(p) bytes from p to the underlying data stre...
AtteqCom/zsl
src/zsl/resource/model_resource.py
ModelResource.read
def read(self, params=None, args=None, data=None): # type: (str, dict, dict) -> Union[List[AppModel], AppModel] """ GET /resource/model_cls/[params:id]?[args:{limit,offset,page,per_page,filter_by,order_by,related,fields}] Get resource/s :param params :type params list ...
python
def read(self, params=None, args=None, data=None): # type: (str, dict, dict) -> Union[List[AppModel], AppModel] """ GET /resource/model_cls/[params:id]?[args:{limit,offset,page,per_page,filter_by,order_by,related,fields}] Get resource/s :param params :type params list ...
[ "def", "read", "(", "self", ",", "params", "=", "None", ",", "args", "=", "None", ",", "data", "=", "None", ")", ":", "# type: (str, dict, dict) -> Union[List[AppModel], AppModel]", "if", "params", "is", "None", ":", "params", "=", "[", "]", "if", "args", ...
GET /resource/model_cls/[params:id]?[args:{limit,offset,page,per_page,filter_by,order_by,related,fields}] Get resource/s :param params :type params list :param args :type args dict :param data :type data: dict
[ "GET", "/", "resource", "/", "model_cls", "/", "[", "params", ":", "id", "]", "?", "[", "args", ":", "{", "limit", "offset", "page", "per_page", "filter_by", "order_by", "related", "fields", "}", "]" ]
train
https://github.com/AtteqCom/zsl/blob/ab51a96da1780ff642912396d4b85bdcb72560c1/src/zsl/resource/model_resource.py#L215-L250
<s>[INST] Here is the documentation: GET /resource/model_cls/[params:id]?[args:{limit,offset,page,per_page,filter_by,order_by,related,fields}] Get resource/s :param params :type params list :param args :type args dict :param data :type data: dict What code imple...
openpermissions/koi
koi/utils.py
add_path_part
def add_path_part(url, regex=PATH_PART): """ replace the variables in a url template with regex named groups :param url: string of a url template :param regex: regex of the named group :returns: regex """ formatter = string.Formatter() url_var_template = "(?P<{var_name}>{regex})" fo...
python
def add_path_part(url, regex=PATH_PART): """ replace the variables in a url template with regex named groups :param url: string of a url template :param regex: regex of the named group :returns: regex """ formatter = string.Formatter() url_var_template = "(?P<{var_name}>{regex})" fo...
[ "def", "add_path_part", "(", "url", ",", "regex", "=", "PATH_PART", ")", ":", "formatter", "=", "string", ".", "Formatter", "(", ")", "url_var_template", "=", "\"(?P<{var_name}>{regex})\"", "for", "part", "in", "formatter", ".", "parse", "(", "url", ")", ":"...
replace the variables in a url template with regex named groups :param url: string of a url template :param regex: regex of the named group :returns: regex
[ "replace", "the", "variables", "in", "a", "url", "template", "with", "regex", "named", "groups", ":", "param", "url", ":", "string", "of", "a", "url", "template", ":", "param", "regex", ":", "regex", "of", "the", "named", "group", ":", "returns", ":", ...
train
https://github.com/openpermissions/koi/blob/d721f8e1dfa8f07ad265d9dec32e8aaf80a9f281/koi/utils.py#L85-L100
<s>[INST] Here is the documentation: replace the variables in a url template with regex named groups :param url: string of a url template :param regex: regex of the named group :returns: regex What code implements this? [/INST] def add_path_part(url, regex=PATH_PART): """ replace the variables in a ...
aws/aws-sdk-go
service/swf/api.go
SetStatus
func (s *ActivityTypeInfo) SetStatus(v string) *ActivityTypeInfo { s.Status = &v return s }
go
func (s *ActivityTypeInfo) SetStatus(v string) *ActivityTypeInfo { s.Status = &v return s }
[ "func", "(", "s", "*", "ActivityTypeInfo", ")", "SetStatus", "(", "v", "string", ")", "*", "ActivityTypeInfo", "{", "s", ".", "Status", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetStatus sets the Status field's value.
[ "SetStatus", "sets", "the", "Status", "field", "s", "value", "." ]
train
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/swf/api.go#L4594-L4597
<s>[INST] Here is the documentation: // SetStatus sets the Status field's value. What code implements this? [/INST] func (s *ActivityTypeInfo) SetStatus(v string) *ActivityTypeInfo { s.Status = &v return s } </s>
lcobucci/content-negotiation-middleware
src/Formatter/StringCast.php
StringCast.format
public function format($content, array $attributes = []): string { if (is_object($content) && ! method_exists($content, '__toString')) { throw new ContentCouldNotBeFormatted('Given data could not be cast to string'); } return (string) $content; }
php
public function format($content, array $attributes = []): string { if (is_object($content) && ! method_exists($content, '__toString')) { throw new ContentCouldNotBeFormatted('Given data could not be cast to string'); } return (string) $content; }
[ "public", "function", "format", "(", "$", "content", ",", "array", "$", "attributes", "=", "[", "]", ")", ":", "string", "{", "if", "(", "is_object", "(", "$", "content", ")", "&&", "!", "method_exists", "(", "$", "content", ",", "'__toString'", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/lcobucci/content-negotiation-middleware/blob/fdbe268786af4c59bbf82de92eab87a69855715b/src/Formatter/StringCast.php#L16-L23
<s>[INST] Here is the documentation: {@inheritdoc} What code implements this? [/INST] public function format($content, array $attributes = []): string { if (is_object($content) && ! method_exists($content, '__toString')) { throw new ContentCouldNotBeFormatted('Given data could not be cast to str...
markstory/asset_compress
src/View/Helper/AssetCompressHelper.php
AssetCompressHelper.url
public function url($file = null, $full = false) { $collection = $this->collection(); if (!$collection->contains($file)) { throw new RuntimeException('Cannot get URL for build file that does not exist.'); } $options = $full; if (!is_array($full)) { $o...
php
public function url($file = null, $full = false) { $collection = $this->collection(); if (!$collection->contains($file)) { throw new RuntimeException('Cannot get URL for build file that does not exist.'); } $options = $full; if (!is_array($full)) { $o...
[ "public", "function", "url", "(", "$", "file", "=", "null", ",", "$", "full", "=", "false", ")", "{", "$", "collection", "=", "$", "this", "->", "collection", "(", ")", ";", "if", "(", "!", "$", "collection", "->", "contains", "(", "$", "file", "...
Get the URL for a given asset name. Takes an build filename, and returns the URL to that build file. @param string $file The build file that you want a URL for. @param bool|array $full Whether or not the URL should have the full base path. @return string The generated URL. @throws RuntimeException when the build file...
[ "Get", "the", "URL", "for", "a", "given", "asset", "name", "." ]
train
https://github.com/markstory/asset_compress/blob/81851833233ad05a283d36c5564d1cc13d297af6/src/View/Helper/AssetCompressHelper.php#L274-L323
<s>[INST] Here is the documentation: Get the URL for a given asset name. Takes an build filename, and returns the URL to that build file. @param string $file The build file that you want a URL for. @param bool|array $full Whether or not the URL should have the full base path. @return string The generated URL. @throws...
metadelta/metadelta
packages/solver/lib/simplifyExpression/collectAndCombineSearch/addLikeTerms.js
addPositiveOneCoefficient
function addPositiveOneCoefficient(node) { const newNode = clone(node, false); let change = false; let changeGroup = 1; newNode.args.forEach((child, i) => { const polyTerm = new Node.PolynomialTerm(child); if (polyTerm.getCoeffValue() === 1) { newNode.args[i] = Node.Creator.polynomialTerm( ...
javascript
function addPositiveOneCoefficient(node) { const newNode = clone(node, false); let change = false; let changeGroup = 1; newNode.args.forEach((child, i) => { const polyTerm = new Node.PolynomialTerm(child); if (polyTerm.getCoeffValue() === 1) { newNode.args[i] = Node.Creator.polynomialTerm( ...
[ "function", "addPositiveOneCoefficient", "(", "node", ")", "{", "const", "newNode", "=", "clone", "(", "node", ",", "false", ")", ";", "let", "change", "=", "false", ";", "let", "changeGroup", "=", "1", ";", "newNode", ".", "args", ".", "forEach", "(", ...
Given a sum of like polynomial terms, changes any term with no coefficient into a term with an explicit coefficient of 1. This is for pedagogy, and makes the adding coefficients step clearer. e.g. 2x + x -> 2x + 1x Returns a Node.Status object.
[ "Given", "a", "sum", "of", "like", "polynomial", "terms", "changes", "any", "term", "with", "no", "coefficient", "into", "a", "term", "with", "an", "explicit", "coefficient", "of", "1", ".", "This", "is", "for", "pedagogy", "and", "makes", "the", "adding",...
train
https://github.com/metadelta/metadelta/blob/ce0de09f5ab9b82da62f09f7807320a6989b9070/packages/solver/lib/simplifyExpression/collectAndCombineSearch/addLikeTerms.js#L77-L105
<s>[INST] Here is the documentation: Given a sum of like polynomial terms, changes any term with no coefficient into a term with an explicit coefficient of 1. This is for pedagogy, and makes the adding coefficients step clearer. e.g. 2x + x -> 2x + 1x Returns a Node.Status object. What code implements this? [/INST] fun...
lanthaler/JsonLD
Processor.php
Processor.objectToJsonLd
private static function objectToJsonLd($object, $useNativeTypes = true) { if ($object instanceof IRI) { $result = new JsonObject(); $result->{'@id'} = (string) $object; return $result; } elseif ($object instanceof Value) { return $object->toJsonLd($us...
php
private static function objectToJsonLd($object, $useNativeTypes = true) { if ($object instanceof IRI) { $result = new JsonObject(); $result->{'@id'} = (string) $object; return $result; } elseif ($object instanceof Value) { return $object->toJsonLd($us...
[ "private", "static", "function", "objectToJsonLd", "(", "$", "object", ",", "$", "useNativeTypes", "=", "true", ")", "{", "if", "(", "$", "object", "instanceof", "IRI", ")", "{", "$", "result", "=", "new", "JsonObject", "(", ")", ";", "$", "result", "-...
Converts an object to a JSON-LD representation Only {@link IRI IRIs}, {@link LanguageTaggedString language-tagged strings}, and {@link TypedValue typed values} are converted by this method. All other objects are returned as-is. @param JsonObject $object The object to convert. @param boolean $useNativeTyp...
[ "Converts", "an", "object", "to", "a", "JSON", "-", "LD", "representation" ]
train
https://github.com/lanthaler/JsonLD/blob/b5f82820c255cb64067b1c7adbb819cad4afa70a/Processor.php#L2944-L2956
<s>[INST] Here is the documentation: Converts an object to a JSON-LD representation Only {@link IRI IRIs}, {@link LanguageTaggedString language-tagged strings}, and {@link TypedValue typed values} are converted by this method. All other objects are returned as-is. @param JsonObject $object The object to conv...
zeaphoo/reston
reston/core/zipfile.py
ZipFile.close
def close(self): """Close the file, and for mode "w" and "a" write the ending records.""" if self.fp is None: return if self.mode in ("w", "a") and self._didModify: # write ending records count = 0 pos1 = self.fp.tell() for zinfo in self.f...
python
def close(self): """Close the file, and for mode "w" and "a" write the ending records.""" if self.fp is None: return if self.mode in ("w", "a") and self._didModify: # write ending records count = 0 pos1 = self.fp.tell() for zinfo in self.f...
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "fp", "is", "None", ":", "return", "if", "self", ".", "mode", "in", "(", "\"w\"", ",", "\"a\"", ")", "and", "self", ".", "_didModify", ":", "# write ending records", "count", "=", "0", "pos1",...
Close the file, and for mode "w" and "a" write the ending records.
[ "Close", "the", "file", "and", "for", "mode", "w", "and", "a", "write", "the", "ending", "records", "." ]
train
https://github.com/zeaphoo/reston/blob/96502487b2259572df55237c9526f92627465088/reston/core/zipfile.py#L1153-L1261
<s>[INST] Here is the documentation: Close the file, and for mode "w" and "a" write the ending records. What code implements this? [/INST] def close(self): """Close the file, and for mode "w" and "a" write the ending records.""" if self.fp is None: return if self.mod...
google/dotty
efilter/parsers/common/tokenizer.py
LazyTokenizer.next_token
def next_token(self): """Returns the next logical token, advancing the tokenizer.""" if self.lookahead: self.current_token = self.lookahead.popleft() return self.current_token self.current_token = self._parse_next_token() return self.current_token
python
def next_token(self): """Returns the next logical token, advancing the tokenizer.""" if self.lookahead: self.current_token = self.lookahead.popleft() return self.current_token self.current_token = self._parse_next_token() return self.current_token
[ "def", "next_token", "(", "self", ")", ":", "if", "self", ".", "lookahead", ":", "self", ".", "current_token", "=", "self", ".", "lookahead", ".", "popleft", "(", ")", "return", "self", ".", "current_token", "self", ".", "current_token", "=", "self", "."...
Returns the next logical token, advancing the tokenizer.
[ "Returns", "the", "next", "logical", "token", "advancing", "the", "tokenizer", "." ]
train
https://github.com/google/dotty/blob/b145131499be0c4b755fc2e2ac19be11a50bce6a/efilter/parsers/common/tokenizer.py#L242-L249
<s>[INST] Here is the documentation: Returns the next logical token, advancing the tokenizer. What code implements this? [/INST] def next_token(self): """Returns the next logical token, advancing the tokenizer.""" if self.lookahead: self.current_token = self.lookahead.popleft() r...
bearded-web/bearded
pkg/manager/manager.go
New
func New(db *mgo.Database, cfg ...ManagerConfig) *Manager { m := &Manager{ db: db, managers: []ManagerInterface{}, } if len(cfg) > 0 { m.Cfg = cfg[0] } // initialize different managers m.Users = &UserManager{manager: m, col: db.C("users")} m.Plugins = &PluginManager{manager: m, col: db.C("plugins")}...
go
func New(db *mgo.Database, cfg ...ManagerConfig) *Manager { m := &Manager{ db: db, managers: []ManagerInterface{}, } if len(cfg) > 0 { m.Cfg = cfg[0] } // initialize different managers m.Users = &UserManager{manager: m, col: db.C("users")} m.Plugins = &PluginManager{manager: m, col: db.C("plugins")}...
[ "func", "New", "(", "db", "*", "mgo", ".", "Database", ",", "cfg", "...", "ManagerConfig", ")", "*", "Manager", "{", "m", ":=", "&", "Manager", "{", "db", ":", "db", ",", "managers", ":", "[", "]", "ManagerInterface", "{", "}", ",", "}", "\n", "i...
// Manager contains all available managers for different models // and hidden all db related operations
[ "Manager", "contains", "all", "available", "managers", "for", "different", "models", "and", "hidden", "all", "db", "related", "operations" ]
train
https://github.com/bearded-web/bearded/blob/c937b9e05d299400e95143a433836214a6ffa649/pkg/manager/manager.go#L52-L101
<s>[INST] Here is the documentation: // Manager contains all available managers for different models // and hidden all db related operations What code implements this? [/INST] func New(db *mgo.Database, cfg ...ManagerConfig) *Manager { m := &Manager{ db: db, managers: []ManagerInterface{}, } if len(cfg) > ...
mssola/user_agent
user_agent.go
Parse
func (p *UserAgent) Parse(ua string) { var sections []section p.initialize() p.ua = ua for index, limit := 0, len(ua); index < limit; { s := parseSection(ua, &index) if !p.mobile && s.name == "Mobile" { p.mobile = true } sections = append(sections, s) } if len(sections) > 0 { if sections[0].name ==...
go
func (p *UserAgent) Parse(ua string) { var sections []section p.initialize() p.ua = ua for index, limit := 0, len(ua); index < limit; { s := parseSection(ua, &index) if !p.mobile && s.name == "Mobile" { p.mobile = true } sections = append(sections, s) } if len(sections) > 0 { if sections[0].name ==...
[ "func", "(", "p", "*", "UserAgent", ")", "Parse", "(", "ua", "string", ")", "{", "var", "sections", "[", "]", "section", "\n\n", "p", ".", "initialize", "(", ")", "\n", "p", ".", "ua", "=", "ua", "\n", "for", "index", ",", "limit", ":=", "0", "...
// Parse the given User-Agent string. After calling this function, the // receiver will be setted up with all the information that we've extracted.
[ "Parse", "the", "given", "User", "-", "Agent", "string", ".", "After", "calling", "this", "function", "the", "receiver", "will", "be", "setted", "up", "with", "all", "the", "information", "that", "we", "ve", "extracted", "." ]
train
https://github.com/mssola/user_agent/blob/74451004a1beb37221bccd8a3931c6acf4a2e80e/user_agent.go#L140-L165
<s>[INST] Here is the documentation: // Parse the given User-Agent string. After calling this function, the // receiver will be setted up with all the information that we've extracted. What code implements this? [/INST] func (p *UserAgent) Parse(ua string) { var sections []section p.initialize() p.ua = ua for inde...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_csvserver_binding.java
sslpolicy_csvserver_binding.get
public static sslpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_csvserver_binding obj = new sslpolicy_csvserver_binding(); obj.set_name(name); sslpolicy_csvserver_binding response[] = (sslpolicy_csvserver_binding[]) obj.get_resources(service); return response; }
java
public static sslpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_csvserver_binding obj = new sslpolicy_csvserver_binding(); obj.set_name(name); sslpolicy_csvserver_binding response[] = (sslpolicy_csvserver_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "sslpolicy_csvserver_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "sslpolicy_csvserver_binding", "obj", "=", "new", "sslpolicy_csvserver_binding", "(", ")", ";", "obj", ".", ...
Use this API to fetch sslpolicy_csvserver_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "sslpolicy_csvserver_binding", "resources", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_csvserver_binding.java#L162-L167
<s>[INST] Here is the documentation: Use this API to fetch sslpolicy_csvserver_binding resources of given name . What code implements this? [/INST] public static sslpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_csvserver_binding obj = new sslpolicy_csvserver_binding();...
vijayvarma392/surfinBH
surfinBH/surfinBH.py
SurFinBH._evaluate_fits
def _evaluate_fits(self, x, fit_key): """ Evaluates a particular fit by passing fit_key to self.fits. Assumes self._get_fit_params() has been overriden. """ fit = self.fits[fit_key] fit_params = self._get_fit_params(np.copy(x), fit_key) if type(fit) == list: ...
python
def _evaluate_fits(self, x, fit_key): """ Evaluates a particular fit by passing fit_key to self.fits. Assumes self._get_fit_params() has been overriden. """ fit = self.fits[fit_key] fit_params = self._get_fit_params(np.copy(x), fit_key) if type(fit) == list: ...
[ "def", "_evaluate_fits", "(", "self", ",", "x", ",", "fit_key", ")", ":", "fit", "=", "self", ".", "fits", "[", "fit_key", "]", "fit_params", "=", "self", ".", "_get_fit_params", "(", "np", ".", "copy", "(", "x", ")", ",", "fit_key", ")", "if", "ty...
Evaluates a particular fit by passing fit_key to self.fits. Assumes self._get_fit_params() has been overriden.
[ "Evaluates", "a", "particular", "fit", "by", "passing", "fit_key", "to", "self", ".", "fits", ".", "Assumes", "self", ".", "_get_fit_params", "()", "has", "been", "overriden", "." ]
train
https://github.com/vijayvarma392/surfinBH/blob/9f2d25d00f894ee2ce9ffbb02f4e4a41fa7989eb/surfinBH/surfinBH.py#L134-L146
<s>[INST] Here is the documentation: Evaluates a particular fit by passing fit_key to self.fits. Assumes self._get_fit_params() has been overriden. What code implements this? [/INST] def _evaluate_fits(self, x, fit_key): """ Evaluates a particular fit by passing fit_key to self.fits. Ass...
benhoff/vexbot
vexbot/adapters/shell/interfaces.py
_add_word
def _add_word(completer): """ Used to add words to the completors """ def inner(word: str): completer.words.add(word) return inner
python
def _add_word(completer): """ Used to add words to the completors """ def inner(word: str): completer.words.add(word) return inner
[ "def", "_add_word", "(", "completer", ")", ":", "def", "inner", "(", "word", ":", "str", ")", ":", "completer", ".", "words", ".", "add", "(", "word", ")", "return", "inner" ]
Used to add words to the completors
[ "Used", "to", "add", "words", "to", "the", "completors" ]
train
https://github.com/benhoff/vexbot/blob/9b844eb20e84eea92a0e7db7d86a90094956c38f/vexbot/adapters/shell/interfaces.py#L8-L14
<s>[INST] Here is the documentation: Used to add words to the completors What code implements this? [/INST] def _add_word(completer): """ Used to add words to the completors """ def inner(word: str): completer.words.add(word) return inner </s>
bbangert/lettuce_webdriver
lettuce_webdriver/webdriver.py
element_not_focused
def element_not_focused(step, id): """ Check if the element is not focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_active_element() assert_false(step, elem == focused)
python
def element_not_focused(step, id): """ Check if the element is not focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_active_element() assert_false(step, elem == focused)
[ "def", "element_not_focused", "(", "step", ",", "id", ")", ":", "elem", "=", "world", ".", "browser", ".", "find_element_by_xpath", "(", "str", "(", "'id(\"{id}\")'", ".", "format", "(", "id", "=", "id", ")", ")", ")", "focused", "=", "world", ".", "br...
Check if the element is not focused
[ "Check", "if", "the", "element", "is", "not", "focused" ]
train
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L282-L290
<s>[INST] Here is the documentation: Check if the element is not focused What code implements this? [/INST] def element_not_focused(step, id): """ Check if the element is not focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_ac...
LAS-IT/open_directory_utils
lib/open_directory_utils/commands_groups.rb
OpenDirectoryUtils.CommandsGroups.user_in_group?
def user_in_group?(attribs, dir_info) temp = user_record_name_alternatives(attribs) username = temp[:record_name] # pp username # pp attribs attribs = group_record_name_alternatives(attribs) # groupname = attribs[:record_name] attribs[:value] = username # pp ...
ruby
def user_in_group?(attribs, dir_info) temp = user_record_name_alternatives(attribs) username = temp[:record_name] # pp username # pp attribs attribs = group_record_name_alternatives(attribs) # groupname = attribs[:record_name] attribs[:value] = username # pp ...
[ "def", "user_in_group?", "(", "attribs", ",", "dir_info", ")", "temp", "=", "user_record_name_alternatives", "(", "attribs", ")", "username", "=", "temp", "[", ":record_name", "]", "# pp username", "# pp attribs", "attribs", "=", "group_record_name_alternatives", "(",...
dscl . -read /Groups/ladmins TODO: switch to dseditgroup -o checkmember -m username groupname dseditgroup -o checkmember -m btihen employee yes btihen is a member of employee dseditgroup -o checkmember -m btihen student no btihen is NOT a member of student
[ "dscl", ".", "-", "read", "/", "Groups", "/", "ladmins", "TODO", ":", "switch", "to", "dseditgroup", "-", "o", "checkmember", "-", "m", "username", "groupname", "dseditgroup", "-", "o", "checkmember", "-", "m", "btihen", "employee", "yes", "btihen", "is", ...
train
https://github.com/LAS-IT/open_directory_utils/blob/dd29b04728fa261c755577af066c9f817642998a/lib/open_directory_utils/commands_groups.rb#L40-L59
<s>[INST] Here is the documentation: dscl . -read /Groups/ladmins TODO: switch to dseditgroup -o checkmember -m username groupname dseditgroup -o checkmember -m btihen employee yes btihen is a member of employee dseditgroup -o checkmember -m btihen student no btihen is NOT a member of student What code impleme...
hyperledger-archives/indy-ledger
ledger/compact_merkle_tree.py
CompactMerkleTree._push_subtree
def _push_subtree(self, leaves: List[bytes]): """Extend with a full subtree <= the current minimum subtree. The leaves must form a full subtree, i.e. of size 2^k for some k. If there is a minimum subtree (i.e. __mintree_height > 0), then the input subtree must be smaller or of equal siz...
python
def _push_subtree(self, leaves: List[bytes]): """Extend with a full subtree <= the current minimum subtree. The leaves must form a full subtree, i.e. of size 2^k for some k. If there is a minimum subtree (i.e. __mintree_height > 0), then the input subtree must be smaller or of equal siz...
[ "def", "_push_subtree", "(", "self", ",", "leaves", ":", "List", "[", "bytes", "]", ")", ":", "size", "=", "len", "(", "leaves", ")", "if", "count_bits_set", "(", "size", ")", "!=", "1", ":", "raise", "ValueError", "(", "\"invalid subtree with size != 2^k:...
Extend with a full subtree <= the current minimum subtree. The leaves must form a full subtree, i.e. of size 2^k for some k. If there is a minimum subtree (i.e. __mintree_height > 0), then the input subtree must be smaller or of equal size to the minimum subtree. If the subtree is smal...
[ "Extend", "with", "a", "full", "subtree", "<", "=", "the", "current", "minimum", "subtree", "." ]
train
https://github.com/hyperledger-archives/indy-ledger/blob/7210c3b288e07f940eddad09b1dfc6a56be846df/ledger/compact_merkle_tree.py#L91-L132
<s>[INST] Here is the documentation: Extend with a full subtree <= the current minimum subtree. The leaves must form a full subtree, i.e. of size 2^k for some k. If there is a minimum subtree (i.e. __mintree_height > 0), then the input subtree must be smaller or of equal size to the minimum sub...
BlueBrain/bluima
modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Header.java
Header.getAuthors
public AuthorInfo getAuthors(int i) { if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_authors == null) jcasType.jcas.throwFeatMissing("authors", "de.julielab.jules.types.Header"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Header_Type)jcasType).casFeatCode_authors),...
java
public AuthorInfo getAuthors(int i) { if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_authors == null) jcasType.jcas.throwFeatMissing("authors", "de.julielab.jules.types.Header"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Header_Type)jcasType).casFeatCode_authors),...
[ "public", "AuthorInfo", "getAuthors", "(", "int", "i", ")", "{", "if", "(", "Header_Type", ".", "featOkTst", "&&", "(", "(", "Header_Type", ")", "jcasType", ")", ".", "casFeat_authors", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "...
indexed getter for authors - gets an indexed value - The authors of the document, O @generated @param i index in the array to get @return value of the element at index i
[ "indexed", "getter", "for", "authors", "-", "gets", "an", "indexed", "value", "-", "The", "authors", "of", "the", "document", "O" ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Header.java#L215-L219
<s>[INST] Here is the documentation: indexed getter for authors - gets an indexed value - The authors of the document, O @generated @param i index in the array to get @return value of the element at index i What code implements this? [/INST] public AuthorInfo getAuthors(int i) { if (Header_Type.featOkTst && ((Heade...
cykl/infoqscraper
infoqscraper/convert.py
Converter.download_video
def download_video(self): """Downloads the video. If self.client.cache_enabled is True, then the disk cache is used. Returns: The path where the video has been saved. Raises: DownloadError: If the video cannot be downloaded. """ rvideo_path = se...
python
def download_video(self): """Downloads the video. If self.client.cache_enabled is True, then the disk cache is used. Returns: The path where the video has been saved. Raises: DownloadError: If the video cannot be downloaded. """ rvideo_path = se...
[ "def", "download_video", "(", "self", ")", ":", "rvideo_path", "=", "self", ".", "presentation", ".", "metadata", "[", "'video_path'", "]", "if", "self", ".", "presentation", ".", "client", ".", "cache", ":", "video_path", "=", "self", ".", "presentation", ...
Downloads the video. If self.client.cache_enabled is True, then the disk cache is used. Returns: The path where the video has been saved. Raises: DownloadError: If the video cannot be downloaded.
[ "Downloads", "the", "video", "." ]
train
https://github.com/cykl/infoqscraper/blob/4fc026b994f98a0a7fe8578e0c9a3a9664982b2e/infoqscraper/convert.py#L92-L113
<s>[INST] Here is the documentation: Downloads the video. If self.client.cache_enabled is True, then the disk cache is used. Returns: The path where the video has been saved. Raises: DownloadError: If the video cannot be downloaded. What code implements this? [/INST] d...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/LinkedList.java
LinkedList.linkFirst
private void linkFirst(E e) { final Node<E> f = first; final Node<E> newNode = new Node<>(null, e, f); first = newNode; if (f == null) last = newNode; else f.prev = newNode; size++; modCount++; }
java
private void linkFirst(E e) { final Node<E> f = first; final Node<E> newNode = new Node<>(null, e, f); first = newNode; if (f == null) last = newNode; else f.prev = newNode; size++; modCount++; }
[ "private", "void", "linkFirst", "(", "E", "e", ")", "{", "final", "Node", "<", "E", ">", "f", "=", "first", ";", "final", "Node", "<", "E", ">", "newNode", "=", "new", "Node", "<>", "(", "null", ",", "e", ",", "f", ")", ";", "first", "=", "ne...
Links e as first element.
[ "Links", "e", "as", "first", "element", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/LinkedList.java#L127-L137
<s>[INST] Here is the documentation: Links e as first element. What code implements this? [/INST] private void linkFirst(E e) { final Node<E> f = first; final Node<E> newNode = new Node<>(null, e, f); first = newNode; if (f == null) last = newNode; else f....
Ordinastie/MalisisCore
src/main/java/net/malisis/core/client/gui/component/interaction/UITextField.java
UITextField.deleteSelectedText
public void deleteSelectedText() { if (!selectingText) return; int start = Math.min(selectionCursor.index, cursor.index); int end = Math.max(selectionCursor.index, cursor.index); String oldValue = this.text.toString(); String newValue = new StringBuilder(oldValue).delete(start, end).toString(); if (!...
java
public void deleteSelectedText() { if (!selectingText) return; int start = Math.min(selectionCursor.index, cursor.index); int end = Math.max(selectionCursor.index, cursor.index); String oldValue = this.text.toString(); String newValue = new StringBuilder(oldValue).delete(start, end).toString(); if (!...
[ "public", "void", "deleteSelectedText", "(", ")", "{", "if", "(", "!", "selectingText", ")", "return", ";", "int", "start", "=", "Math", ".", "min", "(", "selectionCursor", ".", "index", ",", "cursor", ".", "index", ")", ";", "int", "end", "=", "Math",...
Deletes the text currently selected.
[ "Deletes", "the", "text", "currently", "selected", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/component/interaction/UITextField.java#L437-L455
<s>[INST] Here is the documentation: Deletes the text currently selected. What code implements this? [/INST] public void deleteSelectedText() { if (!selectingText) return; int start = Math.min(selectionCursor.index, cursor.index); int end = Math.max(selectionCursor.index, cursor.index); String oldValue = ...
hyperledger/fabric-sdk-go
pkg/fab/channel/ledger.go
NewLedger
func NewLedger(chName string) (*Ledger, error) { l := Ledger{ chName: chName, } return &l, nil }
go
func NewLedger(chName string) (*Ledger, error) { l := Ledger{ chName: chName, } return &l, nil }
[ "func", "NewLedger", "(", "chName", "string", ")", "(", "*", "Ledger", ",", "error", ")", "{", "l", ":=", "Ledger", "{", "chName", ":", "chName", ",", "}", "\n", "return", "&", "l", ",", "nil", "\n", "}" ]
// NewLedger constructs a Ledger client for the current context and named channel.
[ "NewLedger", "constructs", "a", "Ledger", "client", "for", "the", "current", "context", "and", "named", "channel", "." ]
train
https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/channel/ledger.go#L45-L50
<s>[INST] Here is the documentation: // NewLedger constructs a Ledger client for the current context and named channel. What code implements this? [/INST] func NewLedger(chName string) (*Ledger, error) { l := Ledger{ chName: chName, } return &l, nil } </s>
bdurand/seamless_database_pool
lib/seamless_database_pool/controller_filter.rb
SeamlessDatabasePool.ControllerFilter.set_read_only_connection_for_block
def set_read_only_connection_for_block(action) read_pool_method = nil if session read_pool_method = session[:next_request_db_connection] session.delete(:next_request_db_connection) if session[:next_request_db_connection] end read_pool_method ||= seamless_database_pool_options[ac...
ruby
def set_read_only_connection_for_block(action) read_pool_method = nil if session read_pool_method = session[:next_request_db_connection] session.delete(:next_request_db_connection) if session[:next_request_db_connection] end read_pool_method ||= seamless_database_pool_options[ac...
[ "def", "set_read_only_connection_for_block", "(", "action", ")", "read_pool_method", "=", "nil", "if", "session", "read_pool_method", "=", "session", "[", ":next_request_db_connection", "]", "session", ".", "delete", "(", ":next_request_db_connection", ")", "if", "sessi...
Set the read only connection for a block. Used to set the connection for a controller action.
[ "Set", "the", "read", "only", "connection", "for", "a", "block", ".", "Used", "to", "set", "the", "connection", "for", "a", "controller", "action", "." ]
train
https://github.com/bdurand/seamless_database_pool/blob/529c1d49b2c6029de7444830bce72917de79ebff/lib/seamless_database_pool/controller_filter.rb#L72-L87
<s>[INST] Here is the documentation: Set the read only connection for a block. Used to set the connection for a controller action. What code implements this? [/INST] def set_read_only_connection_for_block(action) read_pool_method = nil if session read_pool_method = session[:next_request_db_connectio...
google/seesaw
common/conn/rpc.go
Backends
func (c *engineRPC) Backends() (map[string]*seesaw.Backend, error) { var bm seesaw.BackendMap if err := c.client.Call("SeesawECU.Backends", c.ctx, &bm); err != nil { return nil, err } return bm.Backends, nil }
go
func (c *engineRPC) Backends() (map[string]*seesaw.Backend, error) { var bm seesaw.BackendMap if err := c.client.Call("SeesawECU.Backends", c.ctx, &bm); err != nil { return nil, err } return bm.Backends, nil }
[ "func", "(", "c", "*", "engineRPC", ")", "Backends", "(", ")", "(", "map", "[", "string", "]", "*", "seesaw", ".", "Backend", ",", "error", ")", "{", "var", "bm", "seesaw", ".", "BackendMap", "\n", "if", "err", ":=", "c", ".", "client", ".", "Cal...
// Backends requests a list of all backends that are configured on the cluster.
[ "Backends", "requests", "a", "list", "of", "all", "backends", "that", "are", "configured", "on", "the", "cluster", "." ]
train
https://github.com/google/seesaw/blob/34716af0775ecb1fad239a726390d63d6b0742dd/common/conn/rpc.go#L148-L154
<s>[INST] Here is the documentation: // Backends requests a list of all backends that are configured on the cluster. What code implements this? [/INST] func (c *engineRPC) Backends() (map[string]*seesaw.Backend, error) { var bm seesaw.BackendMap if err := c.client.Call("SeesawECU.Backends", c.ctx, &bm); err != nil { ...
ezsystems/ezpublish-kernel
eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php
DoctrineDatabase.loadAutogeneratedEntry
public function loadAutogeneratedEntry($action, $parentId = null) { /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ $query = $this->dbHandler->createSelectQuery(); $query->select( '*' )->from( $this->dbHandler->quoteTable($this->table) ...
php
public function loadAutogeneratedEntry($action, $parentId = null) { /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ $query = $this->dbHandler->createSelectQuery(); $query->select( '*' )->from( $this->dbHandler->quoteTable($this->table) ...
[ "public", "function", "loadAutogeneratedEntry", "(", "$", "action", ",", "$", "parentId", "=", "null", ")", "{", "/** @var $query \\eZ\\Publish\\Core\\Persistence\\Database\\SelectQuery */", "$", "query", "=", "$", "this", "->", "dbHandler", "->", "createSelectQuery", "...
Loads autogenerated entry id by given $action and optionally $parentId. @param string $action @param mixed|null $parentId @return array
[ "Loads", "autogenerated", "entry", "id", "by", "given", "$action", "and", "optionally", "$parentId", "." ]
train
https://github.com/ezsystems/ezpublish-kernel/blob/ef2ae730a46e9718ebd80f1047c0f8b866209ce9/eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php#L832-L870
<s>[INST] Here is the documentation: Loads autogenerated entry id by given $action and optionally $parentId. @param string $action @param mixed|null $parentId @return array What code implements this? [/INST] public function loadAutogeneratedEntry($action, $parentId = null) { /** @var $query \eZ\Publish\Co...
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java
AppServicePlansInner.listVnets
public List<VnetInfoInner> listVnets(String resourceGroupName, String name) { return listVnetsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); }
java
public List<VnetInfoInner> listVnets(String resourceGroupName, String name) { return listVnetsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); }
[ "public", "List", "<", "VnetInfoInner", ">", "listVnets", "(", "String", "resourceGroupName", ",", "String", "name", ")", "{", "return", "listVnetsWithServiceResponseAsync", "(", "resourceGroupName", ",", "name", ")", ".", "toBlocking", "(", ")", ".", "single", ...
Get all Virtual Networks associated with an App Service plan. Get all Virtual Networks associated with an App Service plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @throws IllegalArgumentException thrown if parameters fail the validat...
[ "Get", "all", "Virtual", "Networks", "associated", "with", "an", "App", "Service", "plan", ".", "Get", "all", "Virtual", "Networks", "associated", "with", "an", "App", "Service", "plan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2984-L2986
<s>[INST] Here is the documentation: Get all Virtual Networks associated with an App Service plan. Get all Virtual Networks associated with an App Service plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @throws IllegalArgumentException ...
neonbug/meexo-common
src/Helpers/CroppaHelpers.php
CroppaHelpers.url
public function url($url, $width = null, $height = null, $options = null) { $config_ignore = Config::get('croppa.ignore'); return (($width == null && $height == null) || preg_match('#'.$config_ignore.'#', $url) ? $this->rawUrl($url) : parent::url($url, $width, $height, $options)); }
php
public function url($url, $width = null, $height = null, $options = null) { $config_ignore = Config::get('croppa.ignore'); return (($width == null && $height == null) || preg_match('#'.$config_ignore.'#', $url) ? $this->rawUrl($url) : parent::url($url, $width, $height, $options)); }
[ "public", "function", "url", "(", "$", "url", ",", "$", "width", "=", "null", ",", "$", "height", "=", "null", ",", "$", "options", "=", "null", ")", "{", "$", "config_ignore", "=", "Config", "::", "get", "(", "'croppa.ignore'", ")", ";", "return", ...
Pass through URL requrests to URL->generate(). @param string $url URL of an image that should be cropped @param integer $width Target width @param integer $height Target height @param array $options Addtional Croppa options, passed as key/value pairs. Like array('resize') @return string The new path to your thumbnail...
[ "Pass", "through", "URL", "requrests", "to", "URL", "-", ">", "generate", "()", "." ]
train
https://github.com/neonbug/meexo-common/blob/8fe9a5d1b73311c65a7c5a0ce8a4e859d39351c6/src/Helpers/CroppaHelpers.php#L21-L27
<s>[INST] Here is the documentation: Pass through URL requrests to URL->generate(). @param string $url URL of an image that should be cropped @param integer $width Target width @param integer $height Target height @param array $options Addtional Croppa options, passed as key/value pairs. Like array('resize') @return ...
Alluxio/alluxio
core/server/common/src/main/java/alluxio/RestUtils.java
RestUtils.createErrorResponse
private static Response createErrorResponse(Exception e, AlluxioConfiguration alluxioConf) { AlluxioStatusException se = AlluxioStatusException.fromThrowable(e); ErrorResponse response = new ErrorResponse(se.getStatus().getCode(), se.getMessage()); Response.ResponseBuilder rb = Response.serverError().entit...
java
private static Response createErrorResponse(Exception e, AlluxioConfiguration alluxioConf) { AlluxioStatusException se = AlluxioStatusException.fromThrowable(e); ErrorResponse response = new ErrorResponse(se.getStatus().getCode(), se.getMessage()); Response.ResponseBuilder rb = Response.serverError().entit...
[ "private", "static", "Response", "createErrorResponse", "(", "Exception", "e", ",", "AlluxioConfiguration", "alluxioConf", ")", "{", "AlluxioStatusException", "se", "=", "AlluxioStatusException", ".", "fromThrowable", "(", "e", ")", ";", "ErrorResponse", "response", "...
Creates an error response using the given exception. @param e the exception to be converted into {@link ErrorResponse} and encoded into json @return the response
[ "Creates", "an", "error", "response", "using", "the", "given", "exception", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/RestUtils.java#L174-L184
<s>[INST] Here is the documentation: Creates an error response using the given exception. @param e the exception to be converted into {@link ErrorResponse} and encoded into json @return the response What code implements this? [/INST] private static Response createErrorResponse(Exception e, AlluxioConfiguration alluxio...
asticode/go-astilectron
astilectron.go
Start
func (a *Astilectron) Start() (err error) { // Log astilog.Debug("Starting...") // Provision if err = a.provision(); err != nil { return errors.Wrap(err, "provisioning failed") } // Unfortunately communicating with Electron through stdin/stdout doesn't work on Windows so all communications // will be done th...
go
func (a *Astilectron) Start() (err error) { // Log astilog.Debug("Starting...") // Provision if err = a.provision(); err != nil { return errors.Wrap(err, "provisioning failed") } // Unfortunately communicating with Electron through stdin/stdout doesn't work on Windows so all communications // will be done th...
[ "func", "(", "a", "*", "Astilectron", ")", "Start", "(", ")", "(", "err", "error", ")", "{", "// Log", "astilog", ".", "Debug", "(", "\"", "\"", ")", "\n\n", "// Provision", "if", "err", "=", "a", ".", "provision", "(", ")", ";", "err", "!=", "ni...
// Start starts Astilectron
[ "Start", "starts", "Astilectron" ]
train
https://github.com/asticode/go-astilectron/blob/5d5f1436743467b9a7cd9e9c90dc4ab47b96be90/astilectron.go#L155-L176
<s>[INST] Here is the documentation: // Start starts Astilectron What code implements this? [/INST] func (a *Astilectron) Start() (err error) { // Log astilog.Debug("Starting...") // Provision if err = a.provision(); err != nil { return errors.Wrap(err, "provisioning failed") } // Unfortunately communicating ...
lessthanoptimal/ddogleg
src/org/ddogleg/combinatorics/Permute.java
Permute.previous
public boolean previous() { if( indexes.length <= 1 || permutation <= 0 ) return false; int N = indexes.length-2; int k = N; while( counters[k] <= k ) { k--; } swap(counters[k], k); counters[k]--; swap(k, counters[k]); int foo = k+1; while( counters[k+1] == k+1 && k < indexes.length-2) { ...
java
public boolean previous() { if( indexes.length <= 1 || permutation <= 0 ) return false; int N = indexes.length-2; int k = N; while( counters[k] <= k ) { k--; } swap(counters[k], k); counters[k]--; swap(k, counters[k]); int foo = k+1; while( counters[k+1] == k+1 && k < indexes.length-2) { ...
[ "public", "boolean", "previous", "(", ")", "{", "if", "(", "indexes", ".", "length", "<=", "1", "||", "permutation", "<=", "0", ")", "return", "false", ";", "int", "N", "=", "indexes", ".", "length", "-", "2", ";", "int", "k", "=", "N", ";", "whi...
This will undo a permutation.
[ "This", "will", "undo", "a", "permutation", "." ]
train
https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/combinatorics/Permute.java#L141-L168
<s>[INST] Here is the documentation: This will undo a permutation. What code implements this? [/INST] public boolean previous() { if( indexes.length <= 1 || permutation <= 0 ) return false; int N = indexes.length-2; int k = N; while( counters[k] <= k ) { k--; } swap(counters[k], k); counters[k]-...
istresearch/scrapy-cluster
redis-monitor/redis_monitor.py
RedisMonitor._dump_crawl_stats
def _dump_crawl_stats(self): ''' Dumps flattened crawling stats so the spiders do not have to ''' extras = {} spiders = {} spider_set = set() total_spider_count = 0 keys = self.redis_conn.keys('stats:crawler:*:*:*') for key in keys: #...
python
def _dump_crawl_stats(self): ''' Dumps flattened crawling stats so the spiders do not have to ''' extras = {} spiders = {} spider_set = set() total_spider_count = 0 keys = self.redis_conn.keys('stats:crawler:*:*:*') for key in keys: #...
[ "def", "_dump_crawl_stats", "(", "self", ")", ":", "extras", "=", "{", "}", "spiders", "=", "{", "}", "spider_set", "=", "set", "(", ")", "total_spider_count", "=", "0", "keys", "=", "self", ".", "redis_conn", ".", "keys", "(", "'stats:crawler:*:*:*'", "...
Dumps flattened crawling stats so the spiders do not have to
[ "Dumps", "flattened", "crawling", "stats", "so", "the", "spiders", "do", "not", "have", "to" ]
train
https://github.com/istresearch/scrapy-cluster/blob/13aaed2349af5d792d6bcbfcadc5563158aeb599/redis-monitor/redis_monitor.py#L398-L451
<s>[INST] Here is the documentation: Dumps flattened crawling stats so the spiders do not have to What code implements this? [/INST] def _dump_crawl_stats(self): ''' Dumps flattened crawling stats so the spiders do not have to ''' extras = {} spiders = {} spider_set = se...
greggman/twgl.js
src/twgl.js
createContext
function createContext(canvas, opt_attribs) { const names = ["webgl2", "webgl", "experimental-webgl"]; let context = null; for (let ii = 0; ii < names.length; ++ii) { context = canvas.getContext(names[ii], opt_attribs); if (context) { if (defaults.addExtensionsToContext) { addExtensionsToCon...
javascript
function createContext(canvas, opt_attribs) { const names = ["webgl2", "webgl", "experimental-webgl"]; let context = null; for (let ii = 0; ii < names.length; ++ii) { context = canvas.getContext(names[ii], opt_attribs); if (context) { if (defaults.addExtensionsToContext) { addExtensionsToCon...
[ "function", "createContext", "(", "canvas", ",", "opt_attribs", ")", "{", "const", "names", "=", "[", "\"webgl2\"", ",", "\"webgl\"", ",", "\"experimental-webgl\"", "]", ";", "let", "context", "=", "null", ";", "for", "(", "let", "ii", "=", "0", ";", "ii...
Creates a webgl context. Will return a WebGL2 context if possible. You can check if it's WebGL2 with twgl.isWebGL2(gl); @param {HTMLCanvasElement} canvas The canvas tag to get context from. If one is not passed in one will be created. @return {WebGLRenderingContext} The created context.
[ "Creates", "a", "webgl", "context", "." ]
train
https://github.com/greggman/twgl.js/blob/ae88dfe4d7a7d44a5b739fcbe50bccccd0e1a1fd/src/twgl.js#L327-L340
<s>[INST] Here is the documentation: Creates a webgl context. Will return a WebGL2 context if possible. You can check if it's WebGL2 with twgl.isWebGL2(gl); @param {HTMLCanvasElement} canvas The canvas tag to get context from. If one is not passed in one will be created. @return {WebGLRenderingContext} The created ...
balzaczyy/golucene
core/index/merge.go
SetMaxMergeAtOnceExplicit
func (tmp *TieredMergePolicy) SetMaxMergeAtOnceExplicit(v int) *TieredMergePolicy { assert2(v >= 2, fmt.Sprintf("maxMergeAtonceExplicit must be > 1 (got %v)", v)) tmp.maxMergeAtOnceExplicit = v return tmp }
go
func (tmp *TieredMergePolicy) SetMaxMergeAtOnceExplicit(v int) *TieredMergePolicy { assert2(v >= 2, fmt.Sprintf("maxMergeAtonceExplicit must be > 1 (got %v)", v)) tmp.maxMergeAtOnceExplicit = v return tmp }
[ "func", "(", "tmp", "*", "TieredMergePolicy", ")", "SetMaxMergeAtOnceExplicit", "(", "v", "int", ")", "*", "TieredMergePolicy", "{", "assert2", "(", "v", ">=", "2", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "v", ")", ")", "\n", "tmp", ".", "m...
/* Maximum number of segments to be merged at a time, during forceMerge or forceMergeDeletes. Default is 30. */
[ "/", "*", "Maximum", "number", "of", "segments", "to", "be", "merged", "at", "a", "time", "during", "forceMerge", "or", "forceMergeDeletes", ".", "Default", "is", "30", "." ]
train
https://github.com/balzaczyy/golucene/blob/d0be9ee89713717392b5b089e18a5a6fb6a63562/core/index/merge.go#L397-L401
<s>[INST] Here is the documentation: /* Maximum number of segments to be merged at a time, during forceMerge or forceMergeDeletes. Default is 30. */ What code implements this? [/INST] func (tmp *TieredMergePolicy) SetMaxMergeAtOnceExplicit(v int) *TieredMergePolicy { assert2(v >= 2, fmt.Sprintf("maxMergeAtonceExplicit...
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Version.java
Version.toReleaseDateTimeString
private String toReleaseDateTimeString() { LocalDateTime releaseDateTime = getReleaseDateTime(); return (releaseDateTime == null ? StringUtils.EMPTY_STRING : String.format(" on %s", releaseDateTime.format(DateTimeFormatter.ofPattern(RELEASE_DATE_TIME_FORMAT)))); }
java
private String toReleaseDateTimeString() { LocalDateTime releaseDateTime = getReleaseDateTime(); return (releaseDateTime == null ? StringUtils.EMPTY_STRING : String.format(" on %s", releaseDateTime.format(DateTimeFormatter.ofPattern(RELEASE_DATE_TIME_FORMAT)))); }
[ "private", "String", "toReleaseDateTimeString", "(", ")", "{", "LocalDateTime", "releaseDateTime", "=", "getReleaseDateTime", "(", ")", ";", "return", "(", "releaseDateTime", "==", "null", "?", "StringUtils", ".", "EMPTY_STRING", ":", "String", ".", "format", "(",...
Returns a {@link String} containing the release date and time for this {@link Version}. @return a {@link String} containing the software release date and time for this {@link Version}, or an empty {@link String} if the software release date and time is unknown.
[ "Returns", "a", "{", "@link", "String", "}", "containing", "the", "release", "date", "and", "time", "for", "this", "{", "@link", "Version", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Version.java#L567-L573
<s>[INST] Here is the documentation: Returns a {@link String} containing the release date and time for this {@link Version}. @return a {@link String} containing the software release date and time for this {@link Version}, or an empty {@link String} if the software release date and time is unknown. What code implements...
baratine/baratine
core/src/main/java/com/caucho/v5/lifecycle/Lifecycle.java
Lifecycle.toNextState
private boolean toNextState(LifecycleState newState) { LifecycleState state; synchronized (this) { state = _state; if (newState.ordinal() <= state.ordinal()) { return false; } _state = newState; _lastChangeTime = CurrentTime.currentTime(); } i...
java
private boolean toNextState(LifecycleState newState) { LifecycleState state; synchronized (this) { state = _state; if (newState.ordinal() <= state.ordinal()) { return false; } _state = newState; _lastChangeTime = CurrentTime.currentTime(); } i...
[ "private", "boolean", "toNextState", "(", "LifecycleState", "newState", ")", "{", "LifecycleState", "state", ";", "synchronized", "(", "this", ")", "{", "state", "=", "_state", ";", "if", "(", "newState", ".", "ordinal", "(", ")", "<=", "state", ".", "ordi...
Changes to the next state. @return true if the transition is allowed
[ "Changes", "to", "the", "next", "state", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/lifecycle/Lifecycle.java#L663-L686
<s>[INST] Here is the documentation: Changes to the next state. @return true if the transition is allowed What code implements this? [/INST] private boolean toNextState(LifecycleState newState) { LifecycleState state; synchronized (this) { state = _state; if (newState.ordinal() <= sta...
webmozart/console
src/Api/Args/Format/ArgsFormat.php
ArgsFormat.getCommandOptions
public function getCommandOptions($includeBase = true) { Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s'); $commandOptions = array_values($this->commandOptions); if ($includeBase && $this->baseFormat) { // prepend base command options ...
php
public function getCommandOptions($includeBase = true) { Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s'); $commandOptions = array_values($this->commandOptions); if ($includeBase && $this->baseFormat) { // prepend base command options ...
[ "public", "function", "getCommandOptions", "(", "$", "includeBase", "=", "true", ")", "{", "Assert", "::", "boolean", "(", "$", "includeBase", ",", "'The parameter $includeBase must be a boolean. Got: %s'", ")", ";", "$", "commandOptions", "=", "array_values", "(", ...
Returns all command options of the format. @param bool $includeBase Whether to include options of the base format in the result. @return CommandOption[] The command options.
[ "Returns", "all", "command", "options", "of", "the", "format", "." ]
train
https://github.com/webmozart/console/blob/3211236e0eea7c5afb437ef1c2b36b923ad25c37/src/Api/Args/Format/ArgsFormat.php#L301-L313
<s>[INST] Here is the documentation: Returns all command options of the format. @param bool $includeBase Whether to include options of the base format in the result. @return CommandOption[] The command options. What code implements this? [/INST] public function getCommandOptions($includeBase = true) { Ass...
alekseykulikov/storage
lib/index.js
storage
function storage(key, val, cb) { var length = arguments.length; if (type(arguments[length - 1]) != 'function') length += 1; switch (length) { case 3: return val === null ? del(key, cb) : set(key, val, cb); case 2: return type(key) == 'object' ? set(key, val) : get(key, val); d...
javascript
function storage(key, val, cb) { var length = arguments.length; if (type(arguments[length - 1]) != 'function') length += 1; switch (length) { case 3: return val === null ? del(key, cb) : set(key, val, cb); case 2: return type(key) == 'object' ? set(key, val) : get(key, val); d...
[ "function", "storage", "(", "key", ",", "val", ",", "cb", ")", "{", "var", "length", "=", "arguments", ".", "length", ";", "if", "(", "type", "(", "arguments", "[", "length", "-", "1", "]", ")", "!=", "'function'", ")", "length", "+=", "1", ";", ...
Facade to get/set/del/count methods. @param {String|Array|Object} key @param {Mixed|Null} val @param {Function} cb
[ "Facade", "to", "get", "/", "set", "/", "del", "/", "count", "methods", "." ]
train
https://github.com/alekseykulikov/storage/blob/7ce45bcd9b3f61ae94914fd63fcacd06760e00b1/lib/index.js#L27-L41
<s>[INST] Here is the documentation: Facade to get/set/del/count methods. @param {String|Array|Object} key @param {Mixed|Null} val @param {Function} cb What code implements this? [/INST] function storage(key, val, cb) { var length = arguments.length; if (type(arguments[length - 1]) != 'function') length += 1; s...
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.inverse
@SuppressWarnings({ "unchecked" }) public static <C extends Compound> SequenceView<C> inverse(Sequence<C> sequence) { SequenceView<C> reverse = new ReversedSequenceView<C>(sequence); if(sequence.getCompoundSet().isComplementable()) { return new ComplementSequenceView(reverse); } return reverse; }
java
@SuppressWarnings({ "unchecked" }) public static <C extends Compound> SequenceView<C> inverse(Sequence<C> sequence) { SequenceView<C> reverse = new ReversedSequenceView<C>(sequence); if(sequence.getCompoundSet().isComplementable()) { return new ComplementSequenceView(reverse); } return reverse; }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", "}", ")", "public", "static", "<", "C", "extends", "Compound", ">", "SequenceView", "<", "C", ">", "inverse", "(", "Sequence", "<", "C", ">", "sequence", ")", "{", "SequenceView", "<", "C", ">", "revers...
A method which attempts to do the right thing when is comes to a reverse/reverse complement @param <C> The type of compound @param sequence The input sequence @return The inverted sequence which is optionally complemented
[ "A", "method", "which", "attempts", "to", "do", "the", "right", "thing", "when", "is", "comes", "to", "a", "reverse", "/", "reverse", "complement" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L334-L341
<s>[INST] Here is the documentation: A method which attempts to do the right thing when is comes to a reverse/reverse complement @param <C> The type of compound @param sequence The input sequence @return The inverted sequence which is optionally complemented What code implements this? [/INST] @SuppressWarnings({ "unch...
montanaflynn/stats
percentile.go
PercentileNearestRank
func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error) { // Find the length of items in the slice il := input.Len() // Return an error for empty slices if il == 0 { return math.NaN(), EmptyInputErr } // Return error for less than 0 or greater than 100 percentages if p...
go
func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error) { // Find the length of items in the slice il := input.Len() // Return an error for empty slices if il == 0 { return math.NaN(), EmptyInputErr } // Return error for less than 0 or greater than 100 percentages if p...
[ "func", "PercentileNearestRank", "(", "input", "Float64Data", ",", "percent", "float64", ")", "(", "percentile", "float64", ",", "err", "error", ")", "{", "// Find the length of items in the slice", "il", ":=", "input", ".", "Len", "(", ")", "\n\n", "// Return an ...
// PercentileNearestRank finds the relative standing in a slice of floats using the Nearest Rank method
[ "PercentileNearestRank", "finds", "the", "relative", "standing", "in", "a", "slice", "of", "floats", "using", "the", "Nearest", "Rank", "method" ]
train
https://github.com/montanaflynn/stats/blob/38304a2645bb6bd10153d518e10a9b69190ff730/percentile.go#L50-L82
<s>[INST] Here is the documentation: // PercentileNearestRank finds the relative standing in a slice of floats using the Nearest Rank method What code implements this? [/INST] func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error) { // Find the length of items in the slice il ...
getyoti/yoti-php-sdk
src/protobuflib/Google/Protobuf/Internal/DescriptorProto.php
DescriptorProto.setField
public function setField($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); $this->field = $arr; $this->has_field = true; return $this; }
php
public function setField($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); $this->field = $arr; $this->has_field = true; return $this; }
[ "public", "function", "setField", "(", "$", "var", ")", "{", "$", "arr", "=", "GPBUtil", "::", "checkRepeatedField", "(", "$", "var", ",", "\\", "Google", "\\", "Protobuf", "\\", "Internal", "\\", "GPBType", "::", "MESSAGE", ",", "\\", "Google", "\\", ...
Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code> @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var @return $this
[ "Generated", "from", "protobuf", "field", "<code", ">", "repeated", ".", "google", ".", "protobuf", ".", "FieldDescriptorProto", "field", "=", "2", ";", "<", "/", "code", ">" ]
train
https://github.com/getyoti/yoti-php-sdk/blob/f3c770c1df2cbba3dc76a1f329938c379191ad7a/src/protobuflib/Google/Protobuf/Internal/DescriptorProto.php#L142-L149
<s>[INST] Here is the documentation: Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code> @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var @return $this What code implements this? [/INST] public function setField($var) ...
szastupov/aiotg
aiotg/chat.py
Chat.edit_text
def edit_text(self, message_id, text, markup=None, parse_mode=None): """ Edit the message in this chat. :param int message_id: ID of the message to edit :param str text: Text to edit the message to :param dict markup: Markup options :param str parse_mode: Text parsing mo...
python
def edit_text(self, message_id, text, markup=None, parse_mode=None): """ Edit the message in this chat. :param int message_id: ID of the message to edit :param str text: Text to edit the message to :param dict markup: Markup options :param str parse_mode: Text parsing mo...
[ "def", "edit_text", "(", "self", ",", "message_id", ",", "text", ",", "markup", "=", "None", ",", "parse_mode", "=", "None", ")", ":", "if", "markup", "is", "None", ":", "markup", "=", "{", "}", "return", "self", ".", "bot", ".", "edit_message_text", ...
Edit the message in this chat. :param int message_id: ID of the message to edit :param str text: Text to edit the message to :param dict markup: Markup options :param str parse_mode: Text parsing mode (``"Markdown"``, ``"HTML"`` or ``None``)
[ "Edit", "the", "message", "in", "this", "chat", "." ]
train
https://github.com/szastupov/aiotg/blob/eed81a6a728c02120f1d730a6e8b8fe50263c010/aiotg/chat.py#L41-L60
<s>[INST] Here is the documentation: Edit the message in this chat. :param int message_id: ID of the message to edit :param str text: Text to edit the message to :param dict markup: Markup options :param str parse_mode: Text parsing mode (``"Markdown"``, ``"HTML"`` or ``None...
longseespace/react-qml
packages/react-qml-cli/vendor/polyfills/console.js
inspect
function inspect(obj, opts) { var ctx = { seen: [], stylize: stylizeNoColor }; return formatValue(ctx, obj, opts.depth); }
javascript
function inspect(obj, opts) { var ctx = { seen: [], stylize: stylizeNoColor }; return formatValue(ctx, obj, opts.depth); }
[ "function", "inspect", "(", "obj", ",", "opts", ")", "{", "var", "ctx", "=", "{", "seen", ":", "[", "]", ",", "stylize", ":", "stylizeNoColor", "}", ";", "return", "formatValue", "(", "ctx", ",", "obj", ",", "opts", ".", "depth", ")", ";", "}" ]
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
[ "Copyright", "Joyent", "Inc", ".", "and", "other", "Node", "contributors", ".", "Permission", "is", "hereby", "granted", "free", "of", "charge", "to", "any", "person", "obtaining", "a", "copy", "of", "this", "software", "and", "associated", "documentation", "f...
train
https://github.com/longseespace/react-qml/blob/682dae6778d65305956fb40324b7ec59afa57a77/packages/react-qml-cli/vendor/polyfills/console.js#L43-L49
<s>[INST] Here is the documentation: Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the right...
prebid/Prebid.js
modules/adkernelBidAdapter.js
formatAdMarkup
function formatAdMarkup(bid) { let adm = bid.adm; if ('nurl' in bid) { adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`); } return adm; }
javascript
function formatAdMarkup(bid) { let adm = bid.adm; if ('nurl' in bid) { adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`); } return adm; }
[ "function", "formatAdMarkup", "(", "bid", ")", "{", "let", "adm", "=", "bid", ".", "adm", ";", "if", "(", "'nurl'", "in", "bid", ")", "{", "adm", "+=", "utils", ".", "createTrackPixelHtml", "(", "`", "${", "bid", ".", "nurl", "}", "`", ")", ";", ...
Format creative with optional nurl call @param bid rtb Bid object
[ "Format", "creative", "with", "optional", "nurl", "call" ]
train
https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L219-L225
<s>[INST] Here is the documentation: Format creative with optional nurl call @param bid rtb Bid object What code implements this? [/INST] function formatAdMarkup(bid) { let adm = bid.adm; if ('nurl' in bid) { adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`); } return adm; } </s>
phalcon/zephir
Library/Statements/Let/Variable.php
Variable.doDoubleAssignment
private function doDoubleAssignment( CodePrinter $codePrinter, CompiledExpression $resolvedExpr, $variable, array $statement, CompilationContext $compilationContext ) { switch ($resolvedExpr->getType()) { case 'null': switch ($statement['op...
php
private function doDoubleAssignment( CodePrinter $codePrinter, CompiledExpression $resolvedExpr, $variable, array $statement, CompilationContext $compilationContext ) { switch ($resolvedExpr->getType()) { case 'null': switch ($statement['op...
[ "private", "function", "doDoubleAssignment", "(", "CodePrinter", "$", "codePrinter", ",", "CompiledExpression", "$", "resolvedExpr", ",", "$", "variable", ",", "array", "$", "statement", ",", "CompilationContext", "$", "compilationContext", ")", "{", "switch", "(", ...
Performs double assignment. @param CodePrinter $codePrinter @param CompiledExpression $resolvedExpr @param string $variable @param array $statement @param CompilationContext $compilationContext @throws CompilerException @throws IllegalOperationException
[ "Performs", "double", "assignment", "." ]
train
https://github.com/phalcon/zephir/blob/2a5b0f3c9d936a0a7d8477adda6cb8aa0fe28773/Library/Statements/Let/Variable.php#L358-L530
<s>[INST] Here is the documentation: Performs double assignment. @param CodePrinter $codePrinter @param CompiledExpression $resolvedExpr @param string $variable @param array $statement @param CompilationContext $compilationContext @throws CompilerException @throws IllegalOperationExcep...
Doozer-Framework/Doozr
src/Doozr/Kernel.php
Doozr_Kernel.initResponse
protected static function initResponse() { if (true === self::$registry->getParameter('doozr.kernel.debugging')) { self::$registry->getDebugbar()['time']->startMeasure('preparing-response', 'Preparing response'); } self::$registry->setResponse( self::$registry->getCo...
php
protected static function initResponse() { if (true === self::$registry->getParameter('doozr.kernel.debugging')) { self::$registry->getDebugbar()['time']->startMeasure('preparing-response', 'Preparing response'); } self::$registry->setResponse( self::$registry->getCo...
[ "protected", "static", "function", "initResponse", "(", ")", "{", "if", "(", "true", "===", "self", "::", "$", "registry", "->", "getParameter", "(", "'doozr.kernel.debugging'", ")", ")", "{", "self", "::", "$", "registry", "->", "getDebugbar", "(", ")", "...
Initialize the response state. @author Benjamin Carl <opensource@clickalicious.de> @return bool TRUE on success @static
[ "Initialize", "the", "response", "state", "." ]
train
https://github.com/Doozer-Framework/Doozr/blob/e90399b043a0b955ca71c619c22fb667a2a91a65/src/Doozr/Kernel.php#L940-L958
<s>[INST] Here is the documentation: Initialize the response state. @author Benjamin Carl <opensource@clickalicious.de> @return bool TRUE on success @static What code implements this? [/INST] protected static function initResponse() { if (true === self::$registry->getParameter('doozr.kernel.debugging')) {...
flarum/core
src/User/Search/Gambit/EmailGambit.php
EmailGambit.conditions
protected function conditions(AbstractSearch $search, array $matches, $negate) { if (! $search instanceof UserSearch) { throw new LogicException('This gambit can only be applied on a UserSearch'); } $email = trim($matches[1], '"'); $search->getQuery()->where('email', $n...
php
protected function conditions(AbstractSearch $search, array $matches, $negate) { if (! $search instanceof UserSearch) { throw new LogicException('This gambit can only be applied on a UserSearch'); } $email = trim($matches[1], '"'); $search->getQuery()->where('email', $n...
[ "protected", "function", "conditions", "(", "AbstractSearch", "$", "search", ",", "array", "$", "matches", ",", "$", "negate", ")", "{", "if", "(", "!", "$", "search", "instanceof", "UserSearch", ")", "{", "throw", "new", "LogicException", "(", "'This gambit...
{@inheritdoc}
[ "{" ]
train
https://github.com/flarum/core/blob/99a6066f96899c15145eff80bb3ad3e97ff24c29/src/User/Search/Gambit/EmailGambit.php#L55-L64
<s>[INST] Here is the documentation: {@inheritdoc} What code implements this? [/INST] protected function conditions(AbstractSearch $search, array $matches, $negate) { if (! $search instanceof UserSearch) { throw new LogicException('This gambit can only be applied on a UserSearch'); } ...
xkxd/gulp-html-partial
gulp-html-partial.js
getTags
function getTags(html) { const closed = html.match(new RegExp(`<${options.tagName}(.*)/${options.tagName}>`, 'g')) || []; const selfClosed = html.match(new RegExp(`<${options.tagName}(.*?)\/>`, 'g')) || []; return [].concat(closed, selfClosed); }
javascript
function getTags(html) { const closed = html.match(new RegExp(`<${options.tagName}(.*)/${options.tagName}>`, 'g')) || []; const selfClosed = html.match(new RegExp(`<${options.tagName}(.*?)\/>`, 'g')) || []; return [].concat(closed, selfClosed); }
[ "function", "getTags", "(", "html", ")", "{", "const", "closed", "=", "html", ".", "match", "(", "new", "RegExp", "(", "`", "${", "options", ".", "tagName", "}", "${", "options", ".", "tagName", "}", "`", ",", "'g'", ")", ")", "||", "[", "]", ";"...
Matches <tagName></tagName> and <tagName /> @param {String} html - stringified file content @returns {Array.<String>}
[ "Matches", "<tagName", ">", "<", "/", "tagName", ">", "and", "<tagName", "/", ">" ]
train
https://github.com/xkxd/gulp-html-partial/blob/0ff4ac130cbfb4c6c898e83d933df5dbb416be78/gulp-html-partial.js#L31-L36
<s>[INST] Here is the documentation: Matches <tagName></tagName> and <tagName /> @param {String} html - stringified file content @returns {Array.<String>} What code implements this? [/INST] function getTags(html) { const closed = html.match(new RegExp(`<${options.tagName}(.*)/${options.tagName}>`, 'g')) || [];...
googleapis/google-cloud-java
google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
DatabaseAdminClient.createDatabaseAsync
@BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsync( CreateDatabaseRequest request) { return createDatabaseOperationCallable().futureCall(request); }
java
@BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsync( CreateDatabaseRequest request) { return createDatabaseOperationCallable().futureCall(request); }
[ "@", "BetaApi", "(", "\"The surface for long-running operations is not stable yet and may change in the future.\"", ")", "public", "final", "OperationFuture", "<", "Database", ",", "CreateDatabaseMetadata", ">", "createDatabaseAsync", "(", "CreateDatabaseRequest", "request", ")", ...
Creates a new Cloud Spanner database and starts to prepare it for serving. The returned [long-running operation][google.longrunning.Operation] will have a name of the format `&lt;database_name&gt;/operations/&lt;operation_id&gt;` and can be used to track preparation of the database. The [metadata][google.longrunning.Op...
[ "Creates", "a", "new", "Cloud", "Spanner", "database", "and", "starts", "to", "prepare", "it", "for", "serving", ".", "The", "returned", "[", "long", "-", "running", "operation", "]", "[", "google", ".", "longrunning", ".", "Operation", "]", "will", "have"...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java#L438-L443
<s>[INST] Here is the documentation: Creates a new Cloud Spanner database and starts to prepare it for serving. The returned [long-running operation][google.longrunning.Operation] will have a name of the format `&lt;database_name&gt;/operations/&lt;operation_id&gt;` and can be used to track preparation of the database....
huggingface/pytorch-pretrained-BERT
pytorch_pretrained_bert/optimization_openai.py
OpenAIAdam.step
def step(self, closure=None): """Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model and returns the loss. """ loss = None if closure is not None: loss = closure() for...
python
def step(self, closure=None): """Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model and returns the loss. """ loss = None if closure is not None: loss = closure() for...
[ "def", "step", "(", "self", ",", "closure", "=", "None", ")", ":", "loss", "=", "None", "if", "closure", "is", "not", "None", ":", "loss", "=", "closure", "(", ")", "for", "group", "in", "self", ".", "param_groups", ":", "for", "p", "in", "group", ...
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model and returns the loss.
[ "Performs", "a", "single", "optimization", "step", "." ]
train
https://github.com/huggingface/pytorch-pretrained-BERT/blob/b832d5bb8a6dfc5965015b828e577677eace601e/pytorch_pretrained_bert/optimization_openai.py#L70-L127
<s>[INST] Here is the documentation: Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model and returns the loss. What code implements this? [/INST] def step(self, closure=None): """Performs a single optimization st...
mage/mage
lib/serviceDiscovery/engines/mdns/index.js
normalizeHost
function normalizeHost(host) { if (!host) { return host; } if (host[host.length - 1] === '.') { host = host.substring(0, host.length - 1); } return host; }
javascript
function normalizeHost(host) { if (!host) { return host; } if (host[host.length - 1] === '.') { host = host.substring(0, host.length - 1); } return host; }
[ "function", "normalizeHost", "(", "host", ")", "{", "if", "(", "!", "host", ")", "{", "return", "host", ";", "}", "if", "(", "host", "[", "host", ".", "length", "-", "1", "]", "===", "'.'", ")", "{", "host", "=", "host", ".", "substring", "(", ...
Hosts in mDNS are announced with a trailing dot, remove it @param {string} host @returns {string}
[ "Hosts", "in", "mDNS", "are", "announced", "with", "a", "trailing", "dot", "remove", "it" ]
train
https://github.com/mage/mage/blob/617968b6b9ebfa5371ae7e9115a5d1e0733a0ff9/lib/serviceDiscovery/engines/mdns/index.js#L20-L30
<s>[INST] Here is the documentation: Hosts in mDNS are announced with a trailing dot, remove it @param {string} host @returns {string} What code implements this? [/INST] function normalizeHost(host) { if (!host) { return host; } if (host[host.length - 1] === '.') { host = host.substring(0, host.length - 1); }...
CPIGroup/phpAmazonMWS
includes/classes/AmazonShipmentItemList.php
AmazonShipmentItemList.setUseToken
public function setUseToken($b = true){ if (is_bool($b)){ $this->tokenUseFlag = $b; $this->tokenItemFlag = $b; } else { return false; } }
php
public function setUseToken($b = true){ if (is_bool($b)){ $this->tokenUseFlag = $b; $this->tokenItemFlag = $b; } else { return false; } }
[ "public", "function", "setUseToken", "(", "$", "b", "=", "true", ")", "{", "if", "(", "is_bool", "(", "$", "b", ")", ")", "{", "$", "this", "->", "tokenUseFlag", "=", "$", "b", ";", "$", "this", "->", "tokenItemFlag", "=", "$", "b", ";", "}", "...
Sets whether or not the object should automatically use tokens if it receives one. If this option is set to <b>TRUE</b>, the object will automatically perform the necessary operations to retrieve the rest of the list using tokens. If this option is off, the object will only ever retrieve the first section of the list....
[ "Sets", "whether", "or", "not", "the", "object", "should", "automatically", "use", "tokens", "if", "it", "receives", "one", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonShipmentItemList.php#L75-L82
<s>[INST] Here is the documentation: Sets whether or not the object should automatically use tokens if it receives one. If this option is set to <b>TRUE</b>, the object will automatically perform the necessary operations to retrieve the rest of the list using tokens. If this option is off, the object will only ever re...
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java
JPAEMPool.getEntityManager
public EntityManager getEntityManager(boolean jtaTxExists, boolean unsynchronized) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "getEntityManager : [" + ivPoolSize + "] tx = " + jtaTxExists + " unsynchronized = " + unsynchronized); ...
java
public EntityManager getEntityManager(boolean jtaTxExists, boolean unsynchronized) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "getEntityManager : [" + ivPoolSize + "] tx = " + jtaTxExists + " unsynchronized = " + unsynchronized); ...
[ "public", "EntityManager", "getEntityManager", "(", "boolean", "jtaTxExists", ",", "boolean", "unsynchronized", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "...
Returns an EntityManager instance from the pool, or a newly created instance if the pool is empty. <p> If a global JTA transaction is present, the EntityManager will have joined that transaction. <p> @param jtaTxExists true if a global jta transaction exists; otherwise false. @param unsynchronized true if Synchroniza...
[ "Returns", "an", "EntityManager", "instance", "from", "the", "pool", "or", "a", "newly", "created", "instance", "if", "the", "pool", "is", "empty", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java#L133-L162
<s>[INST] Here is the documentation: Returns an EntityManager instance from the pool, or a newly created instance if the pool is empty. <p> If a global JTA transaction is present, the EntityManager will have joined that transaction. <p> @param jtaTxExists true if a global jta transaction exists; otherwise false. @par...
erenmustafaozdal/laravel-modules-base
src/LaravelModulesBaseServiceProvider.php
LaravelModulesBaseServiceProvider.register
public function register() { $this->app->register('Laracasts\Flash\FlashServiceProvider'); $this->app->register('Yajra\Datatables\DatatablesServiceProvider'); $this->app->register('Cartalyst\Sentinel\Laravel\SentinelServiceProvider'); $this->app->register('Intervention\Image\ImageSer...
php
public function register() { $this->app->register('Laracasts\Flash\FlashServiceProvider'); $this->app->register('Yajra\Datatables\DatatablesServiceProvider'); $this->app->register('Cartalyst\Sentinel\Laravel\SentinelServiceProvider'); $this->app->register('Intervention\Image\ImageSer...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "app", "->", "register", "(", "'Laracasts\\Flash\\FlashServiceProvider'", ")", ";", "$", "this", "->", "app", "->", "register", "(", "'Yajra\\Datatables\\DatatablesServiceProvider'", ")", ";", "$"...
Register the application services. @return void
[ "Register", "the", "application", "services", "." ]
train
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/LaravelModulesBaseServiceProvider.php#L47-L89
<s>[INST] Here is the documentation: Register the application services. @return void What code implements this? [/INST] public function register() { $this->app->register('Laracasts\Flash\FlashServiceProvider'); $this->app->register('Yajra\Datatables\DatatablesServiceProvider'); $this->app->...
Mammut-FE/nejm
src/util/form/form.js
function(_smap,_new,_key,_dmap){ var _old = _smap[_key]; if (_u._$isFunction(_new)&& _u._$isFunction(_old)){ _smap[_key] = _old._$aop(_new); return; } _smap[_key] = _new; }
javascript
function(_smap,_new,_key,_dmap){ var _old = _smap[_key]; if (_u._$isFunction(_new)&& _u._$isFunction(_old)){ _smap[_key] = _old._$aop(_new); return; } _smap[_key] = _new; }
[ "function", "(", "_smap", ",", "_new", ",", "_key", ",", "_dmap", ")", "{", "var", "_old", "=", "_smap", "[", "_key", "]", ";", "if", "(", "_u", ".", "_$isFunction", "(", "_new", ")", "&&", "_u", ".", "_$isFunction", "(", "_old", ")", ")", "{", ...
merge extend
[ "merge", "extend" ]
train
https://github.com/Mammut-FE/nejm/blob/dfc09ac66a8d67620a7aea65e34d8a179976b3fb/src/util/form/form.js#L696-L704
<s>[INST] Here is the documentation: merge extend What code implements this? [/INST] function(_smap,_new,_key,_dmap){ var _old = _smap[_key]; if (_u._$isFunction(_new)&& _u._$isFunction(_old)){ _smap[_key] = _old._$aop(_new); return; } ...
igniterealtime/Smack
smack-experimental/src/main/java/org/jivesoftware/smackx/iot/data/IoTDataManager.java
IoTDataManager.requestMomentaryValuesReadOut
public List<IoTFieldsExtension> requestMomentaryValuesReadOut(EntityFullJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { final XMPPConnection connection = connection(); final int seqNr = nextSeqNr.incrementAndGet(); IoTDat...
java
public List<IoTFieldsExtension> requestMomentaryValuesReadOut(EntityFullJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { final XMPPConnection connection = connection(); final int seqNr = nextSeqNr.incrementAndGet(); IoTDat...
[ "public", "List", "<", "IoTFieldsExtension", ">", "requestMomentaryValuesReadOut", "(", "EntityFullJid", "jid", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "final", "XMPPConnection", "conne...
Try to read out a things momentary values. @param jid the full JID of the thing to read data from. @return a list with the read out data. @throws NoResponseException @throws XMPPErrorException @throws NotConnectedException @throws InterruptedException
[ "Try", "to", "read", "out", "a", "things", "momentary", "values", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/data/IoTDataManager.java#L172-L209
<s>[INST] Here is the documentation: Try to read out a things momentary values. @param jid the full JID of the thing to read data from. @return a list with the read out data. @throws NoResponseException @throws XMPPErrorException @throws NotConnectedException @throws InterruptedException What code implements this? [/I...
google/skylark
syntax/parse.go
parseList
func (p *parser) parseList() Expr { lbrack := p.nextToken() if p.tok == RBRACK { // empty List rbrack := p.nextToken() return &ListExpr{Lbrack: lbrack, Rbrack: rbrack} } x := p.parseTest() if p.tok == FOR { // list comprehension return p.parseComprehensionSuffix(lbrack, x, RBRACK) } exprs := []Expr{...
go
func (p *parser) parseList() Expr { lbrack := p.nextToken() if p.tok == RBRACK { // empty List rbrack := p.nextToken() return &ListExpr{Lbrack: lbrack, Rbrack: rbrack} } x := p.parseTest() if p.tok == FOR { // list comprehension return p.parseComprehensionSuffix(lbrack, x, RBRACK) } exprs := []Expr{...
[ "func", "(", "p", "*", "parser", ")", "parseList", "(", ")", "Expr", "{", "lbrack", ":=", "p", ".", "nextToken", "(", ")", "\n", "if", "p", ".", "tok", "==", "RBRACK", "{", "// empty List", "rbrack", ":=", "p", ".", "nextToken", "(", ")", "\n", "...
// list = '[' ']' // | '[' expr ']' // | '[' expr expr_list ']' // | '[' expr (FOR loop_variables IN expr)+ ']'
[ "list", "=", "[", "]", "|", "[", "expr", "]", "|", "[", "expr", "expr_list", "]", "|", "[", "expr", "(", "FOR", "loop_variables", "IN", "expr", ")", "+", "]" ]
train
https://github.com/google/skylark/blob/a5f7082aabed29c0e429c722292c66ec8ecf9591/syntax/parse.go#L826-L849
<s>[INST] Here is the documentation: // list = '[' ']' // | '[' expr ']' // | '[' expr expr_list ']' // | '[' expr (FOR loop_variables IN expr)+ ']' What code implements this? [/INST] func (p *parser) parseList() Expr { lbrack := p.nextToken() if p.tok == RBRACK { // empty List rbrack := p.nextToke...
go-delve/delve
pkg/proc/breakpoints.go
Clear
func (bpmap *BreakpointMap) Clear(addr uint64, clearBreakpoint clearBreakpointFn) (*Breakpoint, error) { bp, ok := bpmap.M[addr] if !ok { return nil, NoBreakpointError{Addr: addr} } bp.Kind &= ^UserBreakpoint bp.Cond = nil if bp.Kind != 0 { return bp, nil } if err := clearBreakpoint(bp); err != nil { re...
go
func (bpmap *BreakpointMap) Clear(addr uint64, clearBreakpoint clearBreakpointFn) (*Breakpoint, error) { bp, ok := bpmap.M[addr] if !ok { return nil, NoBreakpointError{Addr: addr} } bp.Kind &= ^UserBreakpoint bp.Cond = nil if bp.Kind != 0 { return bp, nil } if err := clearBreakpoint(bp); err != nil { re...
[ "func", "(", "bpmap", "*", "BreakpointMap", ")", "Clear", "(", "addr", "uint64", ",", "clearBreakpoint", "clearBreakpointFn", ")", "(", "*", "Breakpoint", ",", "error", ")", "{", "bp", ",", "ok", ":=", "bpmap", ".", "M", "[", "addr", "]", "\n", "if", ...
// Clear clears the breakpoint at addr. // Do not call this function call proc.Process.ClearBreakpoint instead.
[ "Clear", "clears", "the", "breakpoint", "at", "addr", ".", "Do", "not", "call", "this", "function", "call", "proc", ".", "Process", ".", "ClearBreakpoint", "instead", "." ]
train
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L297-L316
<s>[INST] Here is the documentation: // Clear clears the breakpoint at addr. // Do not call this function call proc.Process.ClearBreakpoint instead. What code implements this? [/INST] func (bpmap *BreakpointMap) Clear(addr uint64, clearBreakpoint clearBreakpointFn) (*Breakpoint, error) { bp, ok := bpmap.M[addr] if !o...
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); var iCount = aSteps.length; for (var i = 0; i < aSteps.length; i++) { if (!aSteps[i].getVisible()) { iCount--; } } return iCount; }
javascript
function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); var iCount = aSteps.length; for (var i = 0; i < aSteps.length; i++) { if (!aSteps[i].getVisible()) { iCount--; } } return iCount; }
[ "function", "(", "oStep", ")", "{", "var", "bIsTopLevel", "=", "oStep", ".", "getParent", "(", ")", "instanceof", "sap", ".", "ui", ".", "commons", ".", "RoadMap", ";", "var", "aSteps", "=", "oStep", ".", "getParent", "(", ")", "[", "bIsTopLevel", "?",...
Computes how the aria-setsize property should be set for the given step
[ "Computes", "how", "the", "aria", "-", "setsize", "property", "should", "be", "set", "for", "the", "given", "step" ]
train
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L704-L714
<s>[INST] Here is the documentation: Computes how the aria-setsize property should be set for the given step What code implements this? [/INST] function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); var iC...
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java
AbstractEntityReader.getPersistedRelations
private Map<String, Object> getPersistedRelations(Object relationEntity) { return relationEntity != null && relationEntity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) relationEntity) .getRelations() : null; }
java
private Map<String, Object> getPersistedRelations(Object relationEntity) { return relationEntity != null && relationEntity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) relationEntity) .getRelations() : null; }
[ "private", "Map", "<", "String", ",", "Object", ">", "getPersistedRelations", "(", "Object", "relationEntity", ")", "{", "return", "relationEntity", "!=", "null", "&&", "relationEntity", ".", "getClass", "(", ")", ".", "isAssignableFrom", "(", "EnhanceEntity", "...
Returns wrapped relations. @param relationEntity @return
[ "Returns", "wrapped", "relations", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java#L531-L535
<s>[INST] Here is the documentation: Returns wrapped relations. @param relationEntity @return What code implements this? [/INST] private Map<String, Object> getPersistedRelations(Object relationEntity) { return relationEntity != null && relationEntity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((En...
pipermerriam/flex
flex/decorators.py
rewrite_reserved_words
def rewrite_reserved_words(func): """ Given a function whos kwargs need to contain a reserved word such as `in`, allow calling that function with the keyword as `in_`, such that function kwargs are rewritten to use the reserved word. """ @partial_safe_wraps(func) def inner(*args, **kwargs): ...
python
def rewrite_reserved_words(func): """ Given a function whos kwargs need to contain a reserved word such as `in`, allow calling that function with the keyword as `in_`, such that function kwargs are rewritten to use the reserved word. """ @partial_safe_wraps(func) def inner(*args, **kwargs): ...
[ "def", "rewrite_reserved_words", "(", "func", ")", ":", "@", "partial_safe_wraps", "(", "func", ")", "def", "inner", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "word", "in", "RESERVED_WORDS", ":", "key", "=", "\"{0}_\"", ".", "format", ...
Given a function whos kwargs need to contain a reserved word such as `in`, allow calling that function with the keyword as `in_`, such that function kwargs are rewritten to use the reserved word.
[ "Given", "a", "function", "whos", "kwargs", "need", "to", "contain", "a", "reserved", "word", "such", "as", "in", "allow", "calling", "that", "function", "with", "the", "keyword", "as", "in_", "such", "that", "function", "kwargs", "are", "rewritten", "to", ...
train
https://github.com/pipermerriam/flex/blob/233f8149fb851a6255753bcec948cb6fefb2723b/flex/decorators.py#L74-L87
<s>[INST] Here is the documentation: Given a function whos kwargs need to contain a reserved word such as `in`, allow calling that function with the keyword as `in_`, such that function kwargs are rewritten to use the reserved word. What code implements this? [/INST] def rewrite_reserved_words(func): """ ...
kt3k/cli-dispatch
index.js
main
function main (action, argv, options) { options = options || {} const cli = new CliDispatch(action, options.actions || 'actions', options.base || callersDir()) setImmediate(() => cli.dispatch(argv)) return cli }
javascript
function main (action, argv, options) { options = options || {} const cli = new CliDispatch(action, options.actions || 'actions', options.base || callersDir()) setImmediate(() => cli.dispatch(argv)) return cli }
[ "function", "main", "(", "action", ",", "argv", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", "const", "cli", "=", "new", "CliDispatch", "(", "action", ",", "options", ".", "actions", "||", "'actions'", ",", "options", ".", "base...
Dispatches the action by the given paramters. @param {string} action The action name @param {object} argv The parameters for the actions @param {string} [options.actions] The action's directory (relative path) @param {string} [options.base] The action's base directory (absolute path) @return {CliDispatch}
[ "Dispatches", "the", "action", "by", "the", "given", "paramters", "." ]
train
https://github.com/kt3k/cli-dispatch/blob/26ff44ab019f49bf977f5113cf261129743efcef/index.js#L21-L28
<s>[INST] Here is the documentation: Dispatches the action by the given paramters. @param {string} action The action name @param {object} argv The parameters for the actions @param {string} [options.actions] The action's directory (relative path) @param {string} [options.base] The action's base directory (absolute path...
openego/eDisGo
edisgo/tools/geo.py
calc_geo_lines_in_buffer
def calc_geo_lines_in_buffer(network, node, grid, radius, radius_inc): """Determines lines in nodes' associated graph that are at least partly within buffer of radius from node. If there are no lines, the buffer is successively extended by radius_inc until lines are found. Parameters ---------- ...
python
def calc_geo_lines_in_buffer(network, node, grid, radius, radius_inc): """Determines lines in nodes' associated graph that are at least partly within buffer of radius from node. If there are no lines, the buffer is successively extended by radius_inc until lines are found. Parameters ---------- ...
[ "def", "calc_geo_lines_in_buffer", "(", "network", ",", "node", ",", "grid", ",", "radius", ",", "radius_inc", ")", ":", "lines", "=", "[", "]", "while", "not", "lines", ":", "node_shp", "=", "transform", "(", "proj2equidistant", "(", "network", ")", ",", ...
Determines lines in nodes' associated graph that are at least partly within buffer of radius from node. If there are no lines, the buffer is successively extended by radius_inc until lines are found. Parameters ---------- network : :class:`~.grid.network.Network` The eDisGo container object...
[ "Determines", "lines", "in", "nodes", "associated", "graph", "that", "are", "at", "least", "partly", "within", "buffer", "of", "radius", "from", "node", ".", "If", "there", "are", "no", "lines", "the", "buffer", "is", "successively", "extended", "by", "radiu...
train
https://github.com/openego/eDisGo/blob/e6245bdaf236f9c49dbda5a18c1c458290f41e2b/edisgo/tools/geo.py#L58-L101
<s>[INST] Here is the documentation: Determines lines in nodes' associated graph that are at least partly within buffer of radius from node. If there are no lines, the buffer is successively extended by radius_inc until lines are found. Parameters ---------- network : :class:`~.grid.network.Network...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessagePattern.java
MessagePattern.parsePluralStyle
public MessagePattern parsePluralStyle(String pattern) { preParse(pattern); parsePluralOrSelectStyle(ArgType.PLURAL, 0, 0); postParse(); return this; }
java
public MessagePattern parsePluralStyle(String pattern) { preParse(pattern); parsePluralOrSelectStyle(ArgType.PLURAL, 0, 0); postParse(); return this; }
[ "public", "MessagePattern", "parsePluralStyle", "(", "String", "pattern", ")", "{", "preParse", "(", "pattern", ")", ";", "parsePluralOrSelectStyle", "(", "ArgType", ".", "PLURAL", ",", "0", ",", "0", ")", ";", "postParse", "(", ")", ";", "return", "this", ...
Parses a PluralFormat pattern string. @param pattern a PluralFormat pattern string @return this @throws IllegalArgumentException for syntax errors in the pattern string @throws IndexOutOfBoundsException if certain limits are exceeded (e.g., argument number too high, argument name too long, etc.) @throws NumberFormatExc...
[ "Parses", "a", "PluralFormat", "pattern", "string", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessagePattern.java#L209-L214
<s>[INST] Here is the documentation: Parses a PluralFormat pattern string. @param pattern a PluralFormat pattern string @return this @throws IllegalArgumentException for syntax errors in the pattern string @throws IndexOutOfBoundsException if certain limits are exceeded (e.g., argument number too high, argument name to...
Big-Shark/sql-to-builder
src/Converter/Converter.php
Converter.format
protected function format($name, array $args = null) { $result = ['name' => $name]; if ($args !== null) { $result['args'] = $args; } return $result; }
php
protected function format($name, array $args = null) { $result = ['name' => $name]; if ($args !== null) { $result['args'] = $args; } return $result; }
[ "protected", "function", "format", "(", "$", "name", ",", "array", "$", "args", "=", "null", ")", "{", "$", "result", "=", "[", "'name'", "=>", "$", "name", "]", ";", "if", "(", "$", "args", "!==", "null", ")", "{", "$", "result", "[", "'args'", ...
@param $name @param $args @return array
[ "@param", "$name", "@param", "$args" ]
train
https://github.com/Big-Shark/sql-to-builder/blob/c5e7d4a7b682981f59b6f2efaa3fd688dd80418d/src/Converter/Converter.php#L52-L60
<s>[INST] Here is the documentation: @param $name @param $args @return array What code implements this? [/INST] protected function format($name, array $args = null) { $result = ['name' => $name]; if ($args !== null) { $result['args'] = $args; } return $result; } </s...
mgutz/logxi
v1/defaultLogger.go
Debug
func (l *DefaultLogger) Debug(msg string, args ...interface{}) { l.Log(LevelDebug, msg, args) }
go
func (l *DefaultLogger) Debug(msg string, args ...interface{}) { l.Log(LevelDebug, msg, args) }
[ "func", "(", "l", "*", "DefaultLogger", ")", "Debug", "(", "msg", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "l", ".", "Log", "(", "LevelDebug", ",", "msg", ",", "args", ")", "\n", "}" ]
// Debug logs a debug entry.
[ "Debug", "logs", "a", "debug", "entry", "." ]
train
https://github.com/mgutz/logxi/blob/aebf8a7d67ab4625e0fd4a665766fef9a709161b/v1/defaultLogger.go#L64-L66
<s>[INST] Here is the documentation: // Debug logs a debug entry. What code implements this? [/INST] func (l *DefaultLogger) Debug(msg string, args ...interface{}) { l.Log(LevelDebug, msg, args) } </s>
aws/aws-sdk-go
service/route53resolver/api.go
ListResolverRuleAssociationsPages
func (c *Route53Resolver) ListResolverRuleAssociationsPages(input *ListResolverRuleAssociationsInput, fn func(*ListResolverRuleAssociationsOutput, bool) bool) error { return c.ListResolverRuleAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) }
go
func (c *Route53Resolver) ListResolverRuleAssociationsPages(input *ListResolverRuleAssociationsInput, fn func(*ListResolverRuleAssociationsOutput, bool) bool) error { return c.ListResolverRuleAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) }
[ "func", "(", "c", "*", "Route53Resolver", ")", "ListResolverRuleAssociationsPages", "(", "input", "*", "ListResolverRuleAssociationsInput", ",", "fn", "func", "(", "*", "ListResolverRuleAssociationsOutput", ",", "bool", ")", "bool", ")", "error", "{", "return", "c",...
// ListResolverRuleAssociationsPages iterates over the pages of a ListResolverRuleAssociations operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListResolverRuleAssociations method for more information on how to use this oper...
[ "ListResolverRuleAssociationsPages", "iterates", "over", "the", "pages", "of", "a", "ListResolverRuleAssociations", "operation", "calling", "the", "fn", "function", "with", "the", "response", "data", "for", "each", "page", ".", "To", "stop", "iterating", "return", "...
train
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/route53resolver/api.go#L1570-L1572
<s>[INST] Here is the documentation: // ListResolverRuleAssociationsPages iterates over the pages of a ListResolverRuleAssociations operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListResolverRuleAssociations method for mor...
Adldap2/Adldap2
src/Models/Concerns/HasAttributes.php
HasAttributes.setRawAttributes
public function setRawAttributes(array $attributes = []) { // We'll filter out those annoying 'count' keys returned with LDAP results, // and lowercase all root array keys to prevent any casing issues. $this->attributes = array_change_key_case($this->filterRawAttributes($attributes), CASE_LO...
php
public function setRawAttributes(array $attributes = []) { // We'll filter out those annoying 'count' keys returned with LDAP results, // and lowercase all root array keys to prevent any casing issues. $this->attributes = array_change_key_case($this->filterRawAttributes($attributes), CASE_LO...
[ "public", "function", "setRawAttributes", "(", "array", "$", "attributes", "=", "[", "]", ")", "{", "// We'll filter out those annoying 'count' keys returned with LDAP results,", "// and lowercase all root array keys to prevent any casing issues.", "$", "this", "->", "attributes", ...
Sets the attributes property. Used when constructing an existing LDAP record. @param array $attributes @return $this
[ "Sets", "the", "attributes", "property", "." ]
train
https://github.com/Adldap2/Adldap2/blob/a6089f508b2a94cb7ff8c98ab381ff983d5f0347/src/Models/Concerns/HasAttributes.php#L195-L223
<s>[INST] Here is the documentation: Sets the attributes property. Used when constructing an existing LDAP record. @param array $attributes @return $this What code implements this? [/INST] public function setRawAttributes(array $attributes = []) { // We'll filter out those annoying 'count' keys returned ...
dwilhelm89/RandomGeoJSON
index.js
generateFeatures
function generateFeatures() { var collection = { type: 'FeatureCollection', features: [] }; for (var i = 0; i < options.number; i++) { collection.features.push(generateFeature(randomType())); } return collection; }
javascript
function generateFeatures() { var collection = { type: 'FeatureCollection', features: [] }; for (var i = 0; i < options.number; i++) { collection.features.push(generateFeature(randomType())); } return collection; }
[ "function", "generateFeatures", "(", ")", "{", "var", "collection", "=", "{", "type", ":", "'FeatureCollection'", ",", "features", ":", "[", "]", "}", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "options", ".", "number", ";", "i", "++", "...
Creates a FeatureCollection and adds features @return {Object} GeoJSON FeatureCollection
[ "Creates", "a", "FeatureCollection", "and", "adds", "features" ]
train
https://github.com/dwilhelm89/RandomGeoJSON/blob/539070dcbf6e67fcb6c4047c24dfb9588a702de9/index.js#L115-L125
<s>[INST] Here is the documentation: Creates a FeatureCollection and adds features @return {Object} GeoJSON FeatureCollection What code implements this? [/INST] function generateFeatures() { var collection = { type: 'FeatureCollection', features: [] }; for (var i = 0; i < options.number; i++) { colle...
aws/aws-sdk-go
service/opsworks/api.go
RegisterEcsClusterWithContext
func (c *OpsWorks) RegisterEcsClusterWithContext(ctx aws.Context, input *RegisterEcsClusterInput, opts ...request.Option) (*RegisterEcsClusterOutput, error) { req, out := c.RegisterEcsClusterRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() }
go
func (c *OpsWorks) RegisterEcsClusterWithContext(ctx aws.Context, input *RegisterEcsClusterInput, opts ...request.Option) (*RegisterEcsClusterOutput, error) { req, out := c.RegisterEcsClusterRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() }
[ "func", "(", "c", "*", "OpsWorks", ")", "RegisterEcsClusterWithContext", "(", "ctx", "aws", ".", "Context", ",", "input", "*", "RegisterEcsClusterInput", ",", "opts", "...", "request", ".", "Option", ")", "(", "*", "RegisterEcsClusterOutput", ",", "error", ")"...
// RegisterEcsClusterWithContext is the same as RegisterEcsCluster with the addition of // the ability to pass a context and additional request options. // // See RegisterEcsCluster for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the conte...
[ "RegisterEcsClusterWithContext", "is", "the", "same", "as", "RegisterEcsCluster", "with", "the", "addition", "of", "the", "ability", "to", "pass", "a", "context", "and", "additional", "request", "options", ".", "See", "RegisterEcsCluster", "for", "details", "on", ...
train
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/opsworks/api.go#L4467-L4472
<s>[INST] Here is the documentation: // RegisterEcsClusterWithContext is the same as RegisterEcsCluster with the addition of // the ability to pass a context and additional request options. // // See RegisterEcsCluster for details on how to use this API operation. // // The context must be non-nil and will be used for ...
mdscruggs/ga
ga/algorithms.py
BaseGeneticAlgorithm.mutate
def mutate(self, chromosomes, p_mutate): """ Call every chromosome's ``mutate`` method. p_mutate: probability of mutation in [0, 1] """ assert 0 <= p_mutate <= 1 for chromosome in chromosomes: chromosome.mutate(p_mutate)
python
def mutate(self, chromosomes, p_mutate): """ Call every chromosome's ``mutate`` method. p_mutate: probability of mutation in [0, 1] """ assert 0 <= p_mutate <= 1 for chromosome in chromosomes: chromosome.mutate(p_mutate)
[ "def", "mutate", "(", "self", ",", "chromosomes", ",", "p_mutate", ")", ":", "assert", "0", "<=", "p_mutate", "<=", "1", "for", "chromosome", "in", "chromosomes", ":", "chromosome", ".", "mutate", "(", "p_mutate", ")" ]
Call every chromosome's ``mutate`` method. p_mutate: probability of mutation in [0, 1]
[ "Call", "every", "chromosome", "s", "mutate", "method", ".", "p_mutate", ":", "probability", "of", "mutation", "in", "[", "0", "1", "]" ]
train
https://github.com/mdscruggs/ga/blob/adac7a004e5e22d888e44ab39f313064c3803b38/ga/algorithms.py#L199-L208
<s>[INST] Here is the documentation: Call every chromosome's ``mutate`` method. p_mutate: probability of mutation in [0, 1] What code implements this? [/INST] def mutate(self, chromosomes, p_mutate): """ Call every chromosome's ``mutate`` method. p_mutate: probabil...
chriso/timeseries
timeseries/time_series.py
TimeSeries.trend_coefficients
def trend_coefficients(self, order=LINEAR): '''Calculate trend coefficients for the specified order.''' if not len(self.points): raise ArithmeticError('Cannot calculate the trend of an empty series') return LazyImport.numpy().polyfit(self.timestamps, self.values, order)
python
def trend_coefficients(self, order=LINEAR): '''Calculate trend coefficients for the specified order.''' if not len(self.points): raise ArithmeticError('Cannot calculate the trend of an empty series') return LazyImport.numpy().polyfit(self.timestamps, self.values, order)
[ "def", "trend_coefficients", "(", "self", ",", "order", "=", "LINEAR", ")", ":", "if", "not", "len", "(", "self", ".", "points", ")", ":", "raise", "ArithmeticError", "(", "'Cannot calculate the trend of an empty series'", ")", "return", "LazyImport", ".", "nump...
Calculate trend coefficients for the specified order.
[ "Calculate", "trend", "coefficients", "for", "the", "specified", "order", "." ]
train
https://github.com/chriso/timeseries/blob/8b81e6cfd955a7cf75a421dfdb71b3f9e53be64d/timeseries/time_series.py#L62-L66
<s>[INST] Here is the documentation: Calculate trend coefficients for the specified order. What code implements this? [/INST] def trend_coefficients(self, order=LINEAR): '''Calculate trend coefficients for the specified order.''' if not len(self.points): raise ArithmeticError('Cannot calcula...
jmoiron/sqlx
reflectx/reflect.go
NewMapperFunc
func NewMapperFunc(tagName string, f func(string) string) *Mapper { return &Mapper{ cache: make(map[reflect.Type]*StructMap), tagName: tagName, mapFunc: f, } }
go
func NewMapperFunc(tagName string, f func(string) string) *Mapper { return &Mapper{ cache: make(map[reflect.Type]*StructMap), tagName: tagName, mapFunc: f, } }
[ "func", "NewMapperFunc", "(", "tagName", "string", ",", "f", "func", "(", "string", ")", "string", ")", "*", "Mapper", "{", "return", "&", "Mapper", "{", "cache", ":", "make", "(", "map", "[", "reflect", ".", "Type", "]", "*", "StructMap", ")", ",", ...
// NewMapperFunc returns a new mapper which optionally obeys a field tag and // a struct field name mapper func given by f. Tags will take precedence, but // for any other field, the mapped name will be f(field.Name)
[ "NewMapperFunc", "returns", "a", "new", "mapper", "which", "optionally", "obeys", "a", "field", "tag", "and", "a", "struct", "field", "name", "mapper", "func", "given", "by", "f", ".", "Tags", "will", "take", "precedence", "but", "for", "any", "other", "fi...
train
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/reflectx/reflect.go#L95-L101
<s>[INST] Here is the documentation: // NewMapperFunc returns a new mapper which optionally obeys a field tag and // a struct field name mapper func given by f. Tags will take precedence, but // for any other field, the mapped name will be f(field.Name) What code implements this? [/INST] func NewMapperFunc(tagName str...
OpenLiberty/open-liberty
dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/OidcCommonClientRequest.java
OidcCommonClientRequest.errorCommon
public void errorCommon(String msgCode, Object[] objects) { if (!bInboundSupported) { Tr.error(tcCommon, msgCode, objects); } }
java
public void errorCommon(String msgCode, Object[] objects) { if (!bInboundSupported) { Tr.error(tcCommon, msgCode, objects); } }
[ "public", "void", "errorCommon", "(", "String", "msgCode", ",", "Object", "[", "]", "objects", ")", "{", "if", "(", "!", "bInboundSupported", ")", "{", "Tr", ".", "error", "(", "tcCommon", ",", "msgCode", ",", "objects", ")", ";", "}", "}" ]
do not overridden
[ "do", "not", "overridden" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/OidcCommonClientRequest.java#L98-L102
<s>[INST] Here is the documentation: do not overridden What code implements this? [/INST] public void errorCommon(String msgCode, Object[] objects) { if (!bInboundSupported) { Tr.error(tcCommon, msgCode, objects); } } </s>
aws/aws-sdk-go
service/inspector/api.go
SetBeginDate
func (s *TimestampRange) SetBeginDate(v time.Time) *TimestampRange { s.BeginDate = &v return s }
go
func (s *TimestampRange) SetBeginDate(v time.Time) *TimestampRange { s.BeginDate = &v return s }
[ "func", "(", "s", "*", "TimestampRange", ")", "SetBeginDate", "(", "v", "time", ".", "Time", ")", "*", "TimestampRange", "{", "s", ".", "BeginDate", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetBeginDate sets the BeginDate field's value.
[ "SetBeginDate", "sets", "the", "BeginDate", "field", "s", "value", "." ]
train
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/inspector/api.go#L9387-L9390
<s>[INST] Here is the documentation: // SetBeginDate sets the BeginDate field's value. What code implements this? [/INST] func (s *TimestampRange) SetBeginDate(v time.Time) *TimestampRange { s.BeginDate = &v return s } </s>
koala-framework/sourcemaps
Kwf/SourceMaps/Base64VLQ.php
Kwf_SourceMaps_Base64VLQ.decode
public static function decode(&$encoded) { $vlq = 0; $i = 0; do { $digit = self::base64Decode($encoded[$i]); $vlq |= ($digit & self::$MASK) << ($i*self::$SHIFT); $i++; } while ($digit & self::$CONTINUATION_BIT); $encoded = substr($encoded...
php
public static function decode(&$encoded) { $vlq = 0; $i = 0; do { $digit = self::base64Decode($encoded[$i]); $vlq |= ($digit & self::$MASK) << ($i*self::$SHIFT); $i++; } while ($digit & self::$CONTINUATION_BIT); $encoded = substr($encoded...
[ "public", "static", "function", "decode", "(", "&", "$", "encoded", ")", "{", "$", "vlq", "=", "0", ";", "$", "i", "=", "0", ";", "do", "{", "$", "digit", "=", "self", "::", "base64Decode", "(", "$", "encoded", "[", "$", "i", "]", ")", ";", "...
Return the value decoded from base 64 VLQ.
[ "Return", "the", "value", "decoded", "from", "base", "64", "VLQ", "." ]
train
https://github.com/koala-framework/sourcemaps/blob/d6e573412a693978fda6bd97dbbe40d335adae7e/Kwf/SourceMaps/Base64VLQ.php#L72-L85
<s>[INST] Here is the documentation: Return the value decoded from base 64 VLQ. What code implements this? [/INST] public static function decode(&$encoded) { $vlq = 0; $i = 0; do { $digit = self::base64Decode($encoded[$i]); $vlq |= ($digit & self::$MASK) << ($i*self:...
jcuga/golongpoll
longpoll.go
priorityQueueUpdateBufferCreated
func (sm *subscriptionManager) priorityQueueUpdateBufferCreated(expiringBuf *expiringBuffer) error { if sm.EventTimeToLiveSeconds == FOREVER { // don't bother keeping track return nil } // NOTE: this call has a complexity of O(log(n)) where n is len of heap heap.Push(&sm.bufferPriorityQueue, expiringBuf) retur...
go
func (sm *subscriptionManager) priorityQueueUpdateBufferCreated(expiringBuf *expiringBuffer) error { if sm.EventTimeToLiveSeconds == FOREVER { // don't bother keeping track return nil } // NOTE: this call has a complexity of O(log(n)) where n is len of heap heap.Push(&sm.bufferPriorityQueue, expiringBuf) retur...
[ "func", "(", "sm", "*", "subscriptionManager", ")", "priorityQueueUpdateBufferCreated", "(", "expiringBuf", "*", "expiringBuffer", ")", "error", "{", "if", "sm", ".", "EventTimeToLiveSeconds", "==", "FOREVER", "{", "// don't bother keeping track", "return", "nil", "\n...
// Wraps updates to SubscriptionManager.bufferPriorityQueue when a new // eventBuffer is created for a given category. In the event that we don't // expire events (TTL == FOREVER), we don't bother paying the price of keeping // the priority queue.
[ "Wraps", "updates", "to", "SubscriptionManager", ".", "bufferPriorityQueue", "when", "a", "new", "eventBuffer", "is", "created", "for", "a", "given", "category", ".", "In", "the", "event", "that", "we", "don", "t", "expire", "events", "(", "TTL", "==", "FORE...
train
https://github.com/jcuga/golongpoll/blob/939e3befd837556f948f5deff4f387c07cfe9df8/longpoll.go#L626-L634
<s>[INST] Here is the documentation: // Wraps updates to SubscriptionManager.bufferPriorityQueue when a new // eventBuffer is created for a given category. In the event that we don't // expire events (TTL == FOREVER), we don't bother paying the price of keeping // the priority queue. What code implements this? [/INST]...
gin-gonic/gin
context.go
File
func (c *Context) File(filepath string) { http.ServeFile(c.Writer, c.Request, filepath) }
go
func (c *Context) File(filepath string) { http.ServeFile(c.Writer, c.Request, filepath) }
[ "func", "(", "c", "*", "Context", ")", "File", "(", "filepath", "string", ")", "{", "http", ".", "ServeFile", "(", "c", ".", "Writer", ",", "c", ".", "Request", ",", "filepath", ")", "\n", "}" ]
// File writes the specified file into the body stream in a efficient way.
[ "File", "writes", "the", "specified", "file", "into", "the", "body", "stream", "in", "a", "efficient", "way", "." ]
train
https://github.com/gin-gonic/gin/blob/202f8fc58af47ab5c8e834662ee7fc46deacc37d/context.go#L880-L882
<s>[INST] Here is the documentation: // File writes the specified file into the body stream in a efficient way. What code implements this? [/INST] func (c *Context) File(filepath string) { http.ServeFile(c.Writer, c.Request, filepath) } </s>
googleapis/google-cloud-php
Spanner/src/Session/CacheSessionPool.php
CacheSessionPool.getSession
private function getSession(array &$data) { $session = array_shift($data['queue']); if ($session) { if ($session['expiration'] - self::DURATION_ONE_MINUTE < $this->time()) { return $this->getSession($data); } $data['inUse'][$session['name']] = $s...
php
private function getSession(array &$data) { $session = array_shift($data['queue']); if ($session) { if ($session['expiration'] - self::DURATION_ONE_MINUTE < $this->time()) { return $this->getSession($data); } $data['inUse'][$session['name']] = $s...
[ "private", "function", "getSession", "(", "array", "&", "$", "data", ")", "{", "$", "session", "=", "array_shift", "(", "$", "data", "[", "'queue'", "]", ")", ";", "if", "(", "$", "session", ")", "{", "if", "(", "$", "session", "[", "'expiration'", ...
Gets the next session in the queue, clearing out any which are expired. @param array $data @return array|null
[ "Gets", "the", "next", "session", "in", "the", "queue", "clearing", "out", "any", "which", "are", "expired", "." ]
train
https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Session/CacheSessionPool.php#L616-L635
<s>[INST] Here is the documentation: Gets the next session in the queue, clearing out any which are expired. @param array $data @return array|null What code implements this? [/INST] private function getSession(array &$data) { $session = array_shift($data['queue']); if ($session) { if (...
apache/incubator-shardingsphere
sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java
LogicSchemas.getLogicSchema
public LogicSchema getLogicSchema(final String schemaName) { return Strings.isNullOrEmpty(schemaName) ? null : logicSchemas.get(schemaName); }
java
public LogicSchema getLogicSchema(final String schemaName) { return Strings.isNullOrEmpty(schemaName) ? null : logicSchemas.get(schemaName); }
[ "public", "LogicSchema", "getLogicSchema", "(", "final", "String", "schemaName", ")", "{", "return", "Strings", ".", "isNullOrEmpty", "(", "schemaName", ")", "?", "null", ":", "logicSchemas", ".", "get", "(", "schemaName", ")", ";", "}" ]
Get logic schema. @param schemaName schema name @return sharding schema
[ "Get", "logic", "schema", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java#L142-L144
<s>[INST] Here is the documentation: Get logic schema. @param schemaName schema name @return sharding schema What code implements this? [/INST] public LogicSchema getLogicSchema(final String schemaName) { return Strings.isNullOrEmpty(schemaName) ? null : logicSchemas.get(schemaName); } </s>
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java
X500Name.generateRFC1779DN
private String generateRFC1779DN(Map<String, String> oidMap) { if (names.length == 1) { return names[0].toRFC1779String(oidMap); } StringBuilder sb = new StringBuilder(48); if (names != null) { for (int i = names.length - 1; i >= 0; i--) { if (i !...
java
private String generateRFC1779DN(Map<String, String> oidMap) { if (names.length == 1) { return names[0].toRFC1779String(oidMap); } StringBuilder sb = new StringBuilder(48); if (names != null) { for (int i = names.length - 1; i >= 0; i--) { if (i !...
[ "private", "String", "generateRFC1779DN", "(", "Map", "<", "String", ",", "String", ">", "oidMap", ")", "{", "if", "(", "names", ".", "length", "==", "1", ")", "{", "return", "names", "[", "0", "]", ".", "toRFC1779String", "(", "oidMap", ")", ";", "}...
/* Dump the printable form of a distinguished name. Each relative name is separated from the next by a ",", and assertions in the relative names have "label=value" syntax. Uses RFC 1779 syntax (i.e. little-endian, comma separators) Valid keywords from RFC 1779 are used. Additional keywords can be specified in the OID...
[ "/", "*", "Dump", "the", "printable", "form", "of", "a", "distinguished", "name", ".", "Each", "relative", "name", "is", "separated", "from", "the", "next", "by", "a", "and", "assertions", "in", "the", "relative", "names", "have", "label", "=", "value", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java#L1113-L1128
<s>[INST] Here is the documentation: /* Dump the printable form of a distinguished name. Each relative name is separated from the next by a ",", and assertions in the relative names have "label=value" syntax. Uses RFC 1779 syntax (i.e. little-endian, comma separators) Valid keywords from RFC 1779 are used. Additional...
docker/cli
cli/command/stack/swarm/remove.go
RunRemove
func RunRemove(dockerCli command.Cli, opts options.Remove) error { client := dockerCli.Client() ctx := context.Background() var errs []string for _, namespace := range opts.Namespaces { services, err := getStackServices(ctx, client, namespace) if err != nil { return err } networks, err := getStackNetwo...
go
func RunRemove(dockerCli command.Cli, opts options.Remove) error { client := dockerCli.Client() ctx := context.Background() var errs []string for _, namespace := range opts.Namespaces { services, err := getStackServices(ctx, client, namespace) if err != nil { return err } networks, err := getStackNetwo...
[ "func", "RunRemove", "(", "dockerCli", "command", ".", "Cli", ",", "opts", "options", ".", "Remove", ")", "error", "{", "client", ":=", "dockerCli", ".", "Client", "(", ")", "\n", "ctx", ":=", "context", ".", "Background", "(", ")", "\n\n", "var", "err...
// RunRemove is the swarm implementation of docker stack remove
[ "RunRemove", "is", "the", "swarm", "implementation", "of", "docker", "stack", "remove" ]
train
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/swarm/remove.go#L18-L69
<s>[INST] Here is the documentation: // RunRemove is the swarm implementation of docker stack remove What code implements this? [/INST] func RunRemove(dockerCli command.Cli, opts options.Remove) error { client := dockerCli.Client() ctx := context.Background() var errs []string for _, namespace := range opts.Namesp...
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/core/UIResults.java
UIResults.getLocale
public Locale getLocale() { Locale l = wbRequest.getLocale(); if (l == null) { l = Locale.getAvailableLocales()[0]; } return l; }
java
public Locale getLocale() { Locale l = wbRequest.getLocale(); if (l == null) { l = Locale.getAvailableLocales()[0]; } return l; }
[ "public", "Locale", "getLocale", "(", ")", "{", "Locale", "l", "=", "wbRequest", ".", "getLocale", "(", ")", ";", "if", "(", "l", "==", "null", ")", "{", "l", "=", "Locale", ".", "getAvailableLocales", "(", ")", "[", "0", "]", ";", "}", "return", ...
return {@code Locale} for request being processed. @return Locale, never {@code null} @see WaybackRequest#getLocale() @see AccessPoint#getLocale()
[ "return", "{" ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java#L679-L685
<s>[INST] Here is the documentation: return {@code Locale} for request being processed. @return Locale, never {@code null} @see WaybackRequest#getLocale() @see AccessPoint#getLocale() What code implements this? [/INST] public Locale getLocale() { Locale l = wbRequest.getLocale(); if (l == null) { l = Locale.getA...
modulusphp/framework
Auth/RedirectsUsers.php
RedirectsUsers.redirectPath
public function redirectPath() { $desiredUrl = $this->getDesiredUrl(); if ($desiredUrl !== false) return $desiredUrl; if (method_exists($this, 'redirectTo')) { return $this->redirectTo(); } return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home'; }
php
public function redirectPath() { $desiredUrl = $this->getDesiredUrl(); if ($desiredUrl !== false) return $desiredUrl; if (method_exists($this, 'redirectTo')) { return $this->redirectTo(); } return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home'; }
[ "public", "function", "redirectPath", "(", ")", "{", "$", "desiredUrl", "=", "$", "this", "->", "getDesiredUrl", "(", ")", ";", "if", "(", "$", "desiredUrl", "!==", "false", ")", "return", "$", "desiredUrl", ";", "if", "(", "method_exists", "(", "$", "...
Get the post register / login redirect path. @return string
[ "Get", "the", "post", "register", "/", "login", "redirect", "path", "." ]
train
https://github.com/modulusphp/framework/blob/ac331b89da0ff717655f8c1149fe87d8f3dbd871/Auth/RedirectsUsers.php#L12-L22
<s>[INST] Here is the documentation: Get the post register / login redirect path. @return string What code implements this? [/INST] public function redirectPath() { $desiredUrl = $this->getDesiredUrl(); if ($desiredUrl !== false) return $desiredUrl; if (method_exists($this, 'redirectTo')) { return...
aporeto-inc/trireme-lib
monitor/internal/docker/mockdocker/mockdocker.go
PluginEnable
func (m *MockPluginAPIClient) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { ret := m.ctrl.Call(m, "PluginEnable", ctx, name, options) ret0, _ := ret[0].(error) return ret0 }
go
func (m *MockPluginAPIClient) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { ret := m.ctrl.Call(m, "PluginEnable", ctx, name, options) ret0, _ := ret[0].(error) return ret0 }
[ "func", "(", "m", "*", "MockPluginAPIClient", ")", "PluginEnable", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "options", "types", ".", "PluginEnableOptions", ")", "error", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m",...
// PluginEnable mocks base method
[ "PluginEnable", "mocks", "base", "method" ]
train
https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2218-L2222
<s>[INST] Here is the documentation: // PluginEnable mocks base method What code implements this? [/INST] func (m *MockPluginAPIClient) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { ret := m.ctrl.Call(m, "PluginEnable", ctx, name, options) ret0, _ := ret[0].(error) return ...
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalConsumer.java
JournalConsumer.purgeObject
public Date purgeObject(Context context, String pid, String logMessage) throws ServerException { throw rejectCallsFromOutsideWhileInRecoveryMode(); }
java
public Date purgeObject(Context context, String pid, String logMessage) throws ServerException { throw rejectCallsFromOutsideWhileInRecoveryMode(); }
[ "public", "Date", "purgeObject", "(", "Context", "context", ",", "String", "pid", ",", "String", "logMessage", ")", "throws", "ServerException", "{", "throw", "rejectCallsFromOutsideWhileInRecoveryMode", "(", ")", ";", "}" ]
Reject API calls from outside while we are in recovery mode.
[ "Reject", "API", "calls", "from", "outside", "while", "we", "are", "in", "recovery", "mode", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalConsumer.java#L131-L135
<s>[INST] Here is the documentation: Reject API calls from outside while we are in recovery mode. What code implements this? [/INST] public Date purgeObject(Context context, String pid, String logMessage) throws ServerException { throw rejectCallsFromOutsi...
dangunter/smoqe
smoqe/query.py
MongoQuery.add_clause
def add_clause(self, clause): """Add a new clause to the existing query. :param clause: The clause to add :type clause: MongoClause :return: None """ if clause.query_loc == MongoClause.LOC_MAIN: self._main.append(clause) elif clause.query_loc == Mongo...
python
def add_clause(self, clause): """Add a new clause to the existing query. :param clause: The clause to add :type clause: MongoClause :return: None """ if clause.query_loc == MongoClause.LOC_MAIN: self._main.append(clause) elif clause.query_loc == Mongo...
[ "def", "add_clause", "(", "self", ",", "clause", ")", ":", "if", "clause", ".", "query_loc", "==", "MongoClause", ".", "LOC_MAIN", ":", "self", ".", "_main", ".", "append", "(", "clause", ")", "elif", "clause", ".", "query_loc", "==", "MongoClause", ".",...
Add a new clause to the existing query. :param clause: The clause to add :type clause: MongoClause :return: None
[ "Add", "a", "new", "clause", "to", "the", "existing", "query", "." ]
train
https://github.com/dangunter/smoqe/blob/70aa8ec1e9df875b9d21c71cbded95c595fe2aad/smoqe/query.py#L684-L698
<s>[INST] Here is the documentation: Add a new clause to the existing query. :param clause: The clause to add :type clause: MongoClause :return: None What code implements this? [/INST] def add_clause(self, clause): """Add a new clause to the existing query. :param clause: The c...
taoh/linodego
linode_service.go
Shutdown
func (t *LinodeService) Shutdown(linodeId int) (*JobResponse, error) { u := &url.Values{} u.Add("LinodeID", strconv.Itoa(linodeId)) v := JobResponse{} if err := t.client.do("linode.shutdown", u, &v.Response); err != nil { return nil, err } if err := json.Unmarshal(v.RawData, &v.JobId); err != nil { return ni...
go
func (t *LinodeService) Shutdown(linodeId int) (*JobResponse, error) { u := &url.Values{} u.Add("LinodeID", strconv.Itoa(linodeId)) v := JobResponse{} if err := t.client.do("linode.shutdown", u, &v.Response); err != nil { return nil, err } if err := json.Unmarshal(v.RawData, &v.JobId); err != nil { return ni...
[ "func", "(", "t", "*", "LinodeService", ")", "Shutdown", "(", "linodeId", "int", ")", "(", "*", "JobResponse", ",", "error", ")", "{", "u", ":=", "&", "url", ".", "Values", "{", "}", "\n", "u", ".", "Add", "(", "\"", "\"", ",", "strconv", ".", ...
// Shutdown Linode
[ "Shutdown", "Linode" ]
train
https://github.com/taoh/linodego/blob/a7137ee37a7a7e0becff1e89a23fd34e8b8c3e5f/linode_service.go#L70-L82
<s>[INST] Here is the documentation: // Shutdown Linode What code implements this? [/INST] func (t *LinodeService) Shutdown(linodeId int) (*JobResponse, error) { u := &url.Values{} u.Add("LinodeID", strconv.Itoa(linodeId)) v := JobResponse{} if err := t.client.do("linode.shutdown", u, &v.Response); err != nil { r...
ongr-io/FilterManagerBundle
Filter/Widget/Dynamic/DynamicAggregate.php
DynamicAggregate.modifySearch
public function modifySearch(Search $search, FilterState $state = null, SearchRequest $request = null) { list($path, $field) = explode('>', $this->getDocumentField()); if ($state && $state->isActive()) { $boolQuery = new BoolQuery(); foreach ($state->getValue() as $groupName...
php
public function modifySearch(Search $search, FilterState $state = null, SearchRequest $request = null) { list($path, $field) = explode('>', $this->getDocumentField()); if ($state && $state->isActive()) { $boolQuery = new BoolQuery(); foreach ($state->getValue() as $groupName...
[ "public", "function", "modifySearch", "(", "Search", "$", "search", ",", "FilterState", "$", "state", "=", "null", ",", "SearchRequest", "$", "request", "=", "null", ")", "{", "list", "(", "$", "path", ",", "$", "field", ")", "=", "explode", "(", "'>'"...
{@inheritdoc}
[ "{" ]
train
https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Filter/Widget/Dynamic/DynamicAggregate.php#L77-L96
<s>[INST] Here is the documentation: {@inheritdoc} What code implements this? [/INST] public function modifySearch(Search $search, FilterState $state = null, SearchRequest $request = null) { list($path, $field) = explode('>', $this->getDocumentField()); if ($state && $state->isActive()) { ...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeInstanceStatusResult.java
DescribeInstanceStatusResult.setInstanceStatuses
public void setInstanceStatuses(java.util.Collection<InstanceStatus> instanceStatuses) { if (instanceStatuses == null) { this.instanceStatuses = null; return; } this.instanceStatuses = new com.amazonaws.internal.SdkInternalList<InstanceStatus>(instanceStatuses); }
java
public void setInstanceStatuses(java.util.Collection<InstanceStatus> instanceStatuses) { if (instanceStatuses == null) { this.instanceStatuses = null; return; } this.instanceStatuses = new com.amazonaws.internal.SdkInternalList<InstanceStatus>(instanceStatuses); }
[ "public", "void", "setInstanceStatuses", "(", "java", ".", "util", ".", "Collection", "<", "InstanceStatus", ">", "instanceStatuses", ")", "{", "if", "(", "instanceStatuses", "==", "null", ")", "{", "this", ".", "instanceStatuses", "=", "null", ";", "return", ...
<p> Information about the status of the instances. </p> @param instanceStatuses Information about the status of the instances.
[ "<p", ">", "Information", "about", "the", "status", "of", "the", "instances", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeInstanceStatusResult.java#L64-L71
<s>[INST] Here is the documentation: <p> Information about the status of the instances. </p> @param instanceStatuses Information about the status of the instances. What code implements this? [/INST] public void setInstanceStatuses(java.util.Collection<InstanceStatus> instanceStatuses) { if (instanceStatuses ==...
oat-sa/extension-tao-itemqti
model/portableElement/PortableElementService.php
PortableElementService.unregisterModel
public function unregisterModel(PortableElementObject $object){ $registry = $object->getModel()->getRegistry(); $registry->delete($object); return true; }
php
public function unregisterModel(PortableElementObject $object){ $registry = $object->getModel()->getRegistry(); $registry->delete($object); return true; }
[ "public", "function", "unregisterModel", "(", "PortableElementObject", "$", "object", ")", "{", "$", "registry", "=", "$", "object", "->", "getModel", "(", ")", "->", "getRegistry", "(", ")", ";", "$", "registry", "->", "delete", "(", "$", "object", ")", ...
Unregister the portable element @param PortableElementObject $object @return bool @throws PortableElementVersionIncompatibilityException
[ "Unregister", "the", "portable", "element" ]
train
https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L100-L104
<s>[INST] Here is the documentation: Unregister the portable element @param PortableElementObject $object @return bool @throws PortableElementVersionIncompatibilityException What code implements this? [/INST] public function unregisterModel(PortableElementObject $object){ $registry = $object->getModel()->getRe...
codefog/tags-bundle
src/Collection/ModelCollection.php
ModelCollection.createTagFromModel
public static function createTagFromModel(Model $model) { return new Tag((string) $model->id, $model->name, $model->row()); }
php
public static function createTagFromModel(Model $model) { return new Tag((string) $model->id, $model->name, $model->row()); }
[ "public", "static", "function", "createTagFromModel", "(", "Model", "$", "model", ")", "{", "return", "new", "Tag", "(", "(", "string", ")", "$", "model", "->", "id", ",", "$", "model", "->", "name", ",", "$", "model", "->", "row", "(", ")", ")", "...
Create the tag from model. @param Model $model @return Tag
[ "Create", "the", "tag", "from", "model", "." ]
train
https://github.com/codefog/tags-bundle/blob/5fca40497b3a921c2cae28446753185adb240a5c/src/Collection/ModelCollection.php#L40-L43
<s>[INST] Here is the documentation: Create the tag from model. @param Model $model @return Tag What code implements this? [/INST] public static function createTagFromModel(Model $model) { return new Tag((string) $model->id, $model->name, $model->row()); } </s>
aws/aws-sdk-java
aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/AddJobFlowStepsRequest.java
AddJobFlowStepsRequest.setSteps
public void setSteps(java.util.Collection<StepConfig> steps) { if (steps == null) { this.steps = null; return; } this.steps = new com.amazonaws.internal.SdkInternalList<StepConfig>(steps); }
java
public void setSteps(java.util.Collection<StepConfig> steps) { if (steps == null) { this.steps = null; return; } this.steps = new com.amazonaws.internal.SdkInternalList<StepConfig>(steps); }
[ "public", "void", "setSteps", "(", "java", ".", "util", ".", "Collection", "<", "StepConfig", ">", "steps", ")", "{", "if", "(", "steps", "==", "null", ")", "{", "this", ".", "steps", "=", "null", ";", "return", ";", "}", "this", ".", "steps", "=",...
<p> A list of <a>StepConfig</a> to be executed by the job flow. </p> @param steps A list of <a>StepConfig</a> to be executed by the job flow.
[ "<p", ">", "A", "list", "of", "<a", ">", "StepConfig<", "/", "a", ">", "to", "be", "executed", "by", "the", "job", "flow", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/AddJobFlowStepsRequest.java#L149-L156
<s>[INST] Here is the documentation: <p> A list of <a>StepConfig</a> to be executed by the job flow. </p> @param steps A list of <a>StepConfig</a> to be executed by the job flow. What code implements this? [/INST] public void setSteps(java.util.Collection<StepConfig> steps) { if (steps == null) { t...
jkphl/rdfa-lite-microdata
src/RdfaLiteMicrodata/Ports/Parser/RdfaLite.php
RdfaLite.parseDom
public function parseDom(\DOMDocument $dom) { return $this->parseSource( $dom, new DomDocumentFactory(), (new RdfaLiteElementProcessor())->setHtml(true), new RdfaLiteContext() ); }
php
public function parseDom(\DOMDocument $dom) { return $this->parseSource( $dom, new DomDocumentFactory(), (new RdfaLiteElementProcessor())->setHtml(true), new RdfaLiteContext() ); }
[ "public", "function", "parseDom", "(", "\\", "DOMDocument", "$", "dom", ")", "{", "return", "$", "this", "->", "parseSource", "(", "$", "dom", ",", "new", "DomDocumentFactory", "(", ")", ",", "(", "new", "RdfaLiteElementProcessor", "(", ")", ")", "->", "...
Parse a DOM document @param \DOMDocument $dom DOM document @return \stdClass Extracted things
[ "Parse", "a", "DOM", "document" ]
train
https://github.com/jkphl/rdfa-lite-microdata/blob/12ea2dcc2bc9d3b78784530b08205c79b2dd7bd8/src/RdfaLiteMicrodata/Ports/Parser/RdfaLite.php#L114-L122
<s>[INST] Here is the documentation: Parse a DOM document @param \DOMDocument $dom DOM document @return \stdClass Extracted things What code implements this? [/INST] public function parseDom(\DOMDocument $dom) { return $this->parseSource( $dom, new DomDocumentFactory(), ...