query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.EFN__RS_NAME:\n\t\t\t\tsetRSName(RS_NAME_EDEFAULT);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the instruction about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Returns a list of validated URLs found in the attribute's value.
@param attributeValue the value of the attribute
@return the list of found URLs | [
"private List<String> findUrlsInAttributeValue(final String attributeValue) {\n List<String> foundUrls = new ArrayList<>();\n\n urlPatterns.stream()\n .map((Pattern urlPattern) -> urlPattern.matcher(attributeValue))\n .forEach((Matcher urlPatternMatcher) -> {\n ... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Deactivate user accounts based on Active Directory's
userAccountControl flags. Requires 'userAccountControl'
to be included in LDAP_SYNC_USER_EXTRA_ATTRIBUTES. | [
"def user_active_directory_deactivate(user, attributes, created, updated):\r\n \r\n try:\r\n user_account_control = int(attributes['userAccountControl'][0])\r\n if user_account_control & 2:\r\n user.is_active = False\r\n except KeyError:\r\n pass"
] | [
"public Map<String, MethodConstraint> getUserDataMap(int table) {\n if (tc.isDebugEnabled())\n Tr.debug(tc, \"Getting user data map of which attribute is either confidential or integral\");\n return getMethodSet(table, UD_CONFIDENTIAL_OR_INTEGRAL_NO_EX_CHECK);\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// TODO: handle odd number of elements in args | [
"func TupleToMap(args []interface{}) (map[interface{}]interface{}, error) {\n\tif len(args)%2 != 0 {\n\t\treturn nil, errors.New(\"Odd number of elements in args for TupleToMap\")\n\t}\n\tm := make(map[interface{}]interface{})\n\tvar key interface{}\n\tfor i, o := range args {\n\t\tif i%2 == 1 {\n\t\t\tm[key] = o\n... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param Event\PreExecuteEvent $event
@throws \Exception | [
"public function onPreExecute(Event\\PreExecuteEvent $event)\n {\n $task = $event->getTask();\n\n if (!($task instanceof AbstractTask) || !($task instanceof ExecuteTask)) {\n return;\n }\n\n if (!$task->hasParameter('remote')) {\n return;\n }\n\n\n\n ... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
git diff {--cached} --name-only {--diff-filter=} | [
"def diff model: nil, filter: nil\n cmd = 'git diff '\n if !model.nil? && model.downcase == 'cached'\n cmd = cmd + '--cached '\n end\n cmd = cmd + '--name-only '\n if !filter.nil?\n cmd = cmd + '--diff-filter=' + filter\n end\n `#{cmd}`.chomp.split\n end"
] | [
"def finish_rel_branch(relver):\n \"\"\"\"\"\"\n print('finish release branch', relver)\n run('git flow release finish --keepremote -F -p -m \"version {ver}\" {ver}'.format(ver=relver), hide=True)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Convert <?= ?> to long-form <?php echo ?> when needed
@param string
@return LibBaseTemplateFilterShorttag | [
"public function read(&$text)\n {\n if (!ini_get('short_open_tag')) {\n /**\n \t* We could also convert <%= like the real T_OPEN_TAG_WITH_ECHO\n \t* but that's not necessary.\n \t*\n \t* It might be nice to also convert PHP code blocks <? ?> but\n \t* let... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github comment about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
// createVersionFromWildcard will convert a wildcard version
// into a regular version, replacing 'x's with '0's, handling
// special cases like '1.x.x' and '1.x' | [
"func createVersionFromWildcard(vStr string) string {\n\t// handle 1.x.x\n\tvStr2 := strings.Replace(vStr, \".x.x\", \".x\", 1)\n\tvStr2 = strings.Replace(vStr2, \".x\", \".0\", 1)\n\tparts := strings.Split(vStr2, \".\")\n\n\t// handle 1.x\n\tif len(parts) == 2 {\n\t\treturn vStr2 + \".0\"\n\t}\n\n\treturn vStr2\n}... | [
"def collect_manifest_dependencies(manifest_data, lockfile_data):\n \"\"\"\"\"\"\n output = {}\n\n for dependencyName, dependencyConstraint in manifest_data.items():\n output[dependencyName] = {\n # identifies where this dependency is installed from\n 'source': 'example-package... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// AddSSHKeyToAllInstances is currently not implemented. | [
"func (c *Cloud) AddSSHKeyToAllInstances(user string, keyData []byte) error {\n\treturn errors.New(\"unimplemented\")\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Runs all the validation or callback functions and collects errors | [
"func run(name string, value string, fns []setFn) error {\n\tvar errors []error\n\tfor _, fn := range fns {\n\t\terr := fn(name, value)\n\t\tif err != nil {\n\t\t\terrors = append(errors, err)\n\t\t}\n\t}\n\tif len(errors) > 0 {\n\t\treturn fmt.Errorf(\"%v\", errors)\n\t}\n\treturn nil\n}"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Remove the highlights that are associated with the given points
@param points The points | [
"private void removeHighlights(Collection<? extends Point> points)\r\n {\r\n Set<Object> highlightsToRemove = new LinkedHashSet<Object>();\r\n for (Point point : points)\r\n {\r\n Object oldHighlight = highlights.remove(point);\r\n if (oldHighlight != null)\r\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param $source
@param $dest
@return bool | [
"protected function copy($source, $dest)\n {\n // Check for symlinks\n if ( is_link($source) ) {\n return symlink(readlink($source), $dest);\n }\n\n // Simple copy for a file\n if ( is_file($source) ) {\n\n if (!file_exists($dest)) {\n copy(... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Store a newly created newsletter_user in storage.
@return Response | [
"public function store()\n\t{\n\t\t$attributes = request()->validate(NewsletterSubscriber::$rules, NewsletterSubscriber::$messages);\n\n $subscriber = $this->createEntry(NewsletterSubscriber::class, $attributes);\n\n return redirect_to_resource();\n\t}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
creates a hash with each index mapped to the value at that index | [
"def jobs_hash\n hash = {}\n jobs.each_with_index { |job, idx| hash[idx.to_s] = job }\n hash\n end"
] | [
"def reify_from_row(row)\n #the tap method allows preconfigured methods and values to\n #be associated with the instance during instantiation while also automatically returning\n #the object after its creation is concluded.\n self.new.tap do |card|\n self.attributes.keys.each.with_index d... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Возвращает повторно используемый обработчик cURL или создает новый
@return resource
@throws NetworkException | [
"public function open()\n {\n if ($this->handle !== null) {\n return $this->handle;\n }\n\n if (!function_exists('curl_init')) {\n throw new NetworkException('The cURL PHP extension was not loaded.');\n }\n $this->handle = curl_init();\n\n return $t... | [
"private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить... | codesearchnet | {
"query": "Represent the Github comment about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Programming:"
} |
// ParseSecret is used to parse a secret value from JSON from an io.Reader. | [
"func ParseSecret(r io.Reader) (*Secret, error) {\n\t// First read the data into a buffer. Not super efficient but we want to\n\t// know if we actually have a body or not.\n\tvar buf bytes.Buffer\n\t_, err := buf.ReadFrom(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif buf.Len() == 0 {\n\t\treturn nil, nil\n\... | [
"func NewHTTPCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command {\n\tcom, err := cobrafy.Command(http.NewMain())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcom.Use = `http`\n\tcom.Short = `listens for and indexes arbitrary JSON data in Pilosa`\n\tcom.Long = `\npdk http listens for and indexes arbitra... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// interceptLink is intended to be used as a callback function. It stops
// the default behavior of event and instead calls r.Navigate, passing through
// the link's href property. | [
"func (r *Router) interceptLink(event dom.Event) {\n\tpath := event.CurrentTarget().GetAttribute(\"href\")\n\t// Only intercept the click event if we have a route which matches\n\t// Otherwise, just do the default.\n\tif bestRoute, _, _ := r.findBestRoute(path); bestRoute != nil {\n\t\tevent.PreventDefault()\n\t\tg... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param \Spryker\Shared\Kernel\Transfer\AbstractTransfer $quoteTransfer
@return array | [
"public function getOptions(AbstractTransfer $quoteTransfer)\n {\n return [\n CreditCardSubForm::OPTION_CARD_EXPIRES_CHOICES_MONTH => $this->getMonthChoices(),\n CreditCardSubForm::OPTION_CARD_EXPIRES_CHOICES_YEAR => $this->getYearChoices(),\n CreditCardSubForm::OPTION_CAR... | [
"public function importProductPackagingUnitTypes(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer\n {\n return $this->getFactory()->createProductPackagingUnitTypeDataImport()->import($dataImporterConfigurationTransfer);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software Development:"
} |
Get a postgres runtime parameter
@return string | [
"public function getParameter( $parameter )\n {\n\n self::isParameterAllowed( $parameter );\n\n $value = $this->query(new Raw(\"SHOW {$parameter}\"))->fetch( Result::FETCH_SINGLE );\n\n return ( $value === 'true' or $value === 'false' )\n ? \\Bond\\boolval( $value )\n :... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Build the network using the significant pathways dataframe
by identifying pairwise direct (same-side) relationships. | [
"def _construct_from_dataframe(self):\n \n direct_edges = {}\n feature_side_grouping = self.feature_pathway_df.groupby(\n [\"feature\", \"side\"])\n for (feature, _), group in feature_side_grouping:\n co_occurring_pathways = group[\"pathway\"].tolist()\n ... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// findAssets recursively scans pkgDir for asset files. | [
"func findAssets(pkgDir string, exts []string) (assetMap, error) {\n\tassets := assetMap{}\n\n\terr := filepath.Walk(pkgDir, func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil || info.IsDir() || !isAssetFile(path, exts) {\n\t\t\treturn err\n\t\t}\n\t\trel, err := filepath.Rel(pkgDir, path)\n\... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// numEdges reports the total number of edges in all clipped shapes in this cell. | [
"func (s *ShapeIndexCell) numEdges() int {\n\tvar e int\n\tfor _, cs := range s.shapes {\n\t\te += cs.numEdges()\n\t}\n\treturn e\n}"
] | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get a list of your Platform.sh subscriptions.
@return Subscription[] | [
"public function getSubscriptions()\n {\n $url = $this->accountsEndpoint . 'subscriptions';\n return Subscription::getCollection($url, 0, [], $this->connector->getClient());\n }"
] | [
"def planner(self, *, resource=''):\n \n\n if not isinstance(self.protocol, MSGraphProtocol):\n # TODO: Custom protocol accessing OneDrive/Sharepoint Api fails here\n raise RuntimeError(\n 'planner api only works on Microsoft Graph API')\n\n return Planner(p... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Create an Image based icon from a String.
@param urlProvider
The URL provider.
@param fileName
the name of the file.
@return an Icon.
@throws UrlProviderException if there is a problem to deal with. | [
"public static Icon getImageIcon(UrlProvider urlProvider, String fileName) throws UrlProviderException\n\t{\n\t\tURL _icon = urlProvider.getUrl(fileName);\n\t\treturn new ImageIcon(_icon);\n\t}"
] | [
"public Query fromUrl(String uri) throws UrlBeautifier.UrlBeautificationException {\n Query query = fromUrl(uri, null);\n if (query == null) {\n throw new IllegalStateException(\"URL reference block is invalid, could not convert to query\");\n }\n return query;\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Retorna verdadeiro se o array for associativo do tipo ["nome" => "Edinei"]
@param array $arr
@return bool | [
"public static function isAssoc(array $arr): bool\n {\n if (array() === $arr)\n return false;\n return array_keys($arr) !== range(0, count($arr) - 1);\n }"
] | [
"def bloquear_sat(retorno):\n \n resposta = analisar_retorno(forcar_unicode(retorno),\n funcao='BloquearSAT')\n if resposta.EEEEE not in ('16000',):\n raise ExcecaoRespostaSAT(resposta)\n return resposta"
] | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Install new patches from official Slackware mirrors | [
"def start(self):\n \n self.store()\n self.msg.done()\n if self.upgrade_all:\n if \"--checklist\" in self.flag:\n self.dialog_checklist()\n print(\"\\nThese packages need upgrading:\\n\")\n self.msg.template(78)\n print(\"{0}{1}{... | [
"def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Prepare to create a stream to carry {@code request}. This prefers to use the existing
connection if it exists. | [
"public void prepareToConnect(Request request) {\n if (this.request != null) {\n if (sameConnection(this.request.url(), request.url()) && exchangeFinder.hasRouteToTry()) {\n return; // Already ready.\n }\n if (exchange != null) throw new IllegalStateException();\n\n if (exchangeFinder ... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// toKubeContainerState converts runtimeapi.ContainerState to kubecontainer.ContainerState. | [
"func toKubeContainerState(state runtimeapi.ContainerState) kubecontainer.ContainerState {\n\tswitch state {\n\tcase runtimeapi.ContainerState_CONTAINER_CREATED:\n\t\treturn kubecontainer.ContainerStateCreated\n\tcase runtimeapi.ContainerState_CONTAINER_RUNNING:\n\t\treturn kubecontainer.ContainerStateRunning\n\tca... | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return available size of given input stream up to given expected read size. If less data is available than
expected read size, it returns how much data available to read. | [
"private int getAvailableSize(Object inputStream, int expectedReadSize) throws IOException, InternalException {\n RandomAccessFile file = null;\n BufferedInputStream stream = null;\n if (inputStream instanceof RandomAccessFile) {\n file = (RandomAccessFile) inputStream;\n } else if (inputStream ins... | [
"private void deliver() {\n // We can have reentrancy here when using a direct executor, triggered by calls to\n // request more messages. This is safe as we simply loop until pendingDelivers = 0\n if (inDelivery) {\n return;\n }\n inDelivery = true;\n try {\n ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// KillGracefully kills a container gracefully. | [
"func KillGracefully(c KubernetesClientInterface, containerID string) error {\n\tlog.Infof(\"SIGTERM containerID %q: %s\", containerID, syscall.SIGTERM.String())\n\terr := TerminatePodWithContainerID(c, containerID, syscall.SIGTERM)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = WaitForTermination(c, containerID,... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the instruction about Container management:",
"pos": "Represent the code about Container management:",
"neg": "Represent the code about programming:"
} |
Creates a new request object containing the current request data
@param exchange The Undertow HttpServerExchange | [
"protected Request getRequest(HttpServerExchange exchange) {\n final String authenticity = Optional.ofNullable(this.attachment.getRequestParameter()\n .get(Default.AUTHENTICITY.toString()))\n .orElse(this.attachment.getForm().get(Default.AUTHENTICITY.toString()));\n \n ... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Create favorites the specified tweet.
// Requires a user auth context.
// https://dev.twitter.com/rest/reference/post/favorites/create | [
"func (s *FavoriteService) Create(params *FavoriteCreateParams) (*Tweet, *http.Response, error) {\n\ttweet := new(Tweet)\n\tapiError := new(APIError)\n\tresp, err := s.sling.New().Post(\"create.json\").QueryStruct(params).Receive(tweet, apiError)\n\treturn tweet, resp, relevantError(err, *apiError)\n}"
] | [
"def filter(self, **params):\n \n url = 'https://stream.twitter.com/%s/statuses/filter.json' \\\n % self.streamer.api_version\n self.streamer._request(url, 'POST', params=params)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add a command line switch. This method is for adding options that do not
require an argument.
@param option
the option, must start with "-"
@param description
single line description of the option | [
"public void addSwitch(String option, String description) {\n optionList.add(option);\n optionDescriptionMap.put(option, description);\n\n if (option.length() > maxWidth) {\n maxWidth = option.length();\n }\n }"
] | [
"public function getHelp()\n {\n $msg = $this->opts->getUsageMessage();\n // Amend the auto-generated help message:\n $options = \"[ options ] [ target ]\\n\"\n . \"Where [ target ] is the name of a section of the configuration\\n\"\n . \"specified by the ini option, or... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Get the `meta` field value.
@param int $object_id Object ID to fetch meta for.
@param WP_REST_Request $request Full details about the request.
@return WP_Error|object | [
"public function get_value( $object_id, $request ) {\n\t\t$fields = $this->get_registered_fields();\n\t\t$response = array();\n\n\t\tforeach ( $fields as $name => $args ) {\n\t\t\t$all_values = get_metadata( $this->get_meta_type(), $object_id, $name, false );\n\t\t\tif ( $args['single'] ) {\n\t\t\t\tif ( empty( $... | [
"public function prepare_item_for_response( $status, $request ) {\n\n\t\t$data = array(\n\t\t\t'name' => $status->label,\n\t\t\t'private' => (bool) $status->private,\n\t\t\t'protected' => (bool) $status->protected,\n\t\t\t'public' => (bool) $status->public,\n\t\t\t'queryable' => (bool) $sta... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// OptionSwitchKeyBindMode set a key bind mode. | [
"func OptionSwitchKeyBindMode(m KeyBindMode) Option {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}"
] | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get / set hybridauth user profile instance.
@param \Hybrid_User_Profile $profile Hybrid auth user profile instance
@return \Hybrid_User_Profile|void | [
"public function profile($profile = null)\n {\n if ($profile === null) {\n return $this->_providerProfile;\n }\n\n $this->_providerProfile = $profile;\n }"
] | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
rubocop:disable Metrics/MethodLength | [
"def parse_cli_options!(args)\n unknown_opts = []\n\n parser = build_cli_parser\n\n begin\n parser.parse!(args)\n rescue OptionParser::InvalidOption => e\n unknown_opts << e.args[0]\n unless args.size.zero?\n unknown_opts << args.shift unless args.first.start_with?(... | [
"def link_file(filename, title = nil, anchor = nil) # rubocop:disable Lint/UnusedMethodArgument\n return filename.filename if CodeObjects::ExtraFileObject === filename\n filename\n end"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
Boot up the class.
The hooks are registered, then boot is run.
This gives some extra options for conditionally adding filters.
@since 1.0.0 | [
"final public function run()\n {\n if ($this->admin === false && \\is_admin() === true) {\n return;\n }\n\n if ($this->public === false && \\is_admin() === false) {\n return;\n }\n\n $this->parse_filters();\n $this->parse_actions();\n\n if (\... | [
"public function finish($results)\n {\n if ($return = $this->saveFile($results))\n {\n $this->command->info('New .env file was saved.');\n\n /*\n * \"Rebootstrap\" Application to load new env variables to the config\n * using native Application::bootstr... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Create a PrintableImage from a PIL Image
:param image: a PIL Image
:return: | [
"def from_image(cls, image):\n \n (w, h) = image.size\n\n # Thermal paper is 512 pixels wide\n if w > 512:\n ratio = 512. / w\n h = int(h * ratio)\n image = image.resize((512, h), Image.ANTIALIAS)\n if image.mode != '1':\n image = image.... | [
"def to_array(self):\n \n array = super(InputMediaDocument, self).to_array()\n # 'type' given by superclass\n # 'media' given by superclass\n if self.thumb is not None:\n if isinstance(self.thumb, InputFile):\n array['thumb'] = None # type InputFile\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Fails if the map contains the given entry. | [
"public void doesNotContainEntry(@NullableDecl Object key, @NullableDecl Object value) {\n checkNoNeedToDisplayBothValues(\"entrySet()\")\n .that(actual().entrySet())\n .doesNotContain(immutableEntry(key, value));\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Block for 'for' loop.
@this Blockly.Block | [
"function() {\n this.jsonInit({\n \"message0\": Blockly.Msg.CONTROLS_FOR_TITLE,\n \"args0\": [\n {\n \"type\": \"field_variable\",\n \"name\": \"VAR\",\n \"variable\": null\n },\n {\n \"type\": \"input_value\",\n \"name\": \"FROM\",\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the price of address move option fee
REST: GET /price/xdsl/addressMove/fee/{option}
@param option [required] The option name | [
"public OvhPrice xdsl_addressMove_fee_option_GET(net.minidev.ovh.api.price.xdsl.addressmove.OvhFeeEnum option) throws IOException {\n\t\tString qPath = \"/price/xdsl/addressMove/fee/{option}\";\n\t\tStringBuilder sb = path(qPath, option);\n\t\tString resp = exec(qPath, \"GET\", sb.toString(), null);\n\t\treturn con... | [
"def networkName(self):\n \n copsMatch = lineMatching(r'^\\+COPS: (\\d),(\\d),\"(.+)\",{0,1}\\d*$', self.write('AT+COPS?')) # response format: +COPS: mode,format,\"operator_name\",x\n if copsMatch:\n return copsMatch.group(3)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Display a batch widget for the access level selector.
@return string The necessary HTML for the widget. | [
"public static function access()\n\t{\n\t\t// Create the batch selector to change an access level on a selection list.\n\t\t$lines = array(\n\t\t\t'<label id=\"batch-access-lbl\" for=\"batch-access\" class=\"hasTip\" title=\"' . Lang::txt('JLIB_HTML_BATCH_ACCESS_LABEL') . '::' . Lang::txt('JLIB_HTML_BATCH_ACCESS_LA... | [
"def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Releases the trap before each render and on destroy so
that Marko can update normally without the inserted dom nodes. | [
"function release() {\n if (this.isTrapped) {\n this.restoreTrap = this.state.open;\n screenReaderTrap.untrap(this.windowEl);\n keyboardTrap.untrap(this.windowEl);\n } else {\n this.restoreTrap = false;\n }\n}"
] | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the relative luminance of the given `color`,
see http://www.w3.org/TR/WCAG20/#relativeluminancedef
Examples:
luminosity(white)
// => 1
luminosity(#000)
// => 0
luminosity(red)
// => 0.2126
@param {RGBA|HSLA} color
@return {Unit}
@api public | [
"function luminosity(color){\n utils.assertColor(color);\n color = color.rgba;\n function processChannel(channel) {\n channel = channel / 255;\n return (0.03928 > channel)\n ? channel / 12.92\n : Math.pow(((channel + 0.055) / 1.055), 2.4);\n }\n return new nodes.Unit(\n 0.2126 * processChann... | [
"function(fillColor) {\n var fillColorHex = this.colorUtils.hexFromColor(fillColor),\n luminanceThreshold = 128,\n darkColor = 'black',\n lightColor = 'white',\n fillLuminance = this.colorUtils.getLuminance(fillColorHex);\n\n return (... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Generates a URI based on a serial stored in the database.
@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@return string
@throws common_UriProviderException | [
"public function provide()\n {\n $returnValue = (string) '';\n \n $nextId = $this->getPersistence()->incr(self::PERSISTENCE_KEY);\n list($usec, $sec) = explode(\" \", microtime());\n $uri = $this->getOption(self::OPTION_NAMESPACE) .'i'. (str_replace(\".\",\"\",$sec.\"\".$usec))... | [
"private function write(string $file_contains):int\n {\n $header = \"/*\\n * This is an iumio Framework component\\n *\\n * (c) RAFINA DANY <dany.rafina@iumio.com>\";\n $headersub = \"\\n *\\n * iumio Framework, an iumio component [https://iumio.com]\\n *\\n\";\n $headersub2 = \" * To get... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Convert wrapping modes from GL constants.
@param wrap The GL constant.
@return The value. | [
"public static JCGLTextureWrapT textureWrapTFromGL(\n final int wrap)\n {\n switch (wrap) {\n case GL12.GL_CLAMP_TO_EDGE:\n return JCGLTextureWrapT.TEXTURE_WRAP_CLAMP_TO_EDGE;\n case GL11.GL_REPEAT:\n return JCGLTextureWrapT.TEXTURE_WRAP_REPEAT;\n case GL14.GL_MIRRORED_REPEAT:\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Formats the items in an <code>Iterator</code>.
@param itr The iterator to format
@return A String representing the single DSV formatted row | [
"public String format(Iterator<?> itr) {\n StringBuilder rowString = new StringBuilder();\n\n for (; itr.hasNext(); ) {\n Object n = itr.next();\n String s = n == null ? StringUtils.EMPTY : n.toString();\n if (escape.equals(\"\\\\\")) {\n s = s.replaceAll(Pattern.quote(escape), doubleEsc... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the text about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about Software development:"
} |
Gets the rights of given user.
@param integer $id Id of the user
@param array $options Optional arguments
@return array | [
"public function getUserRights($id, array $options = [])\n {\n $data = [\n '_id' => $id\n ];\n\n $response = $this->kuzzle->query(\n $this->buildQueryArgs('getUserRights'),\n $data,\n $options\n );\n\n return $response['result']['hits... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Overridable method. | [
"def _matches_docs(self, docs, other_docs):\n \"\"\"\"\"\"\n for doc, other_doc in zip(docs, other_docs):\n if not self._match_map(doc, other_doc):\n return False\n\n return True"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Get the active model.
@return \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface|null | [
"private function getActiveModel()\n {\n $input = $this->getEnvironment()->getInputProvider();\n if (false === $input->hasParameter('id')) {\n return null;\n }\n\n $modelId = ModelId::fromSerialized($input->getParameter('id'));\n $dataProvider = $this->getEnviro... | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Adds a dependency | [
"public ExtensionFeatureOptions withDependency(ExtensionFeature feature) {\n Set<String> existing = this.dependencies;\n Set<String> newDependencies;\n if (existing == null) {\n newDependencies = new HashSet<>();\n } else {\n newDependencies = new HashSet<>(existing... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Marshall the first line.
@return WsByteBuffer[] of line ready to be written. | [
"@Override\n public WsByteBuffer[] marshallLine() {\n WsByteBuffer[] firstLine = new WsByteBuffer[1];\n firstLine[0] = allocateBuffer(getOutgoingBufferSize());\n\n firstLine = putBytes(getVersionValue().getByteArray(), firstLine);\n firstLine = putByte(SPACE, firstLine);\n if (... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Executes request on link.
@param string $url
@param string $method
@param array $postfields
@return string | [
"private function request($url, $method = 'GET', $postfields = array())\n {\n curl_setopt_array($this->ch, array(\n CURLOPT_USERAGENT => 'VK/1.0 (+https://github.com/vladkens/VK))',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_P... | [
"public function setRequestHeader($name, $value) {\n $header = array();\n $header[$name] = $value;\n //TODO: as a limitation of the driver it self, we will send permanent for the moment\n $this->browser->addHeader($header, true);\n }"
] | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Detect integrator template modes - check selectors in current url. | [
"private void detectIntegratorTemplateModes() {\n // integrator mode cannot be active if no modes defined\n if (urlHandlerConfig.getIntegratorModes().isEmpty()) {\n return;\n }\n if (request != null && RequestPath.hasSelector(request, SELECTOR_INTEGRATORTEMPLATE_SECURE)) {\n integratorTemplate... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param string $target
@return string
@throws BadResponseException
@throws WebsocketException | [
"public function connect($target = '/')\n {\n $this->target = $target;\n\n if ($this->connected) {\n return $this->sessionId;\n }\n\n $this->socket = @stream_socket_client($this->endpoint, $errno, $errstr);\n\n if (!$this->socket) {\n throw new BadResponse... | [
"private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }"
] | codesearchnet | {
"query": "Represent the summarization about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Software development:"
} |
// RegisterGraphQLService is a utility function to construct a new service and register it against a node. | [
"func RegisterGraphQLService(stack *node.Node, endpoint string, cors, vhosts []string, timeouts rpc.HTTPTimeouts) error {\n\treturn stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {\n\t\tvar ethereum *eth.Ethereum\n\t\tif err := ctx.Service(ðereum); err != nil {\n\t\t\treturn nil, err\n\t\t}\... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Called at clean up. Is used to disconnect signals. | [
"def finalize(self):\n \n self.spinBox.valueChanged.disconnect(self.commitChangedValue)\n super(SnFloatCtiEditor, self).finalize()"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Return true if column values for the given namespace/store name are binary.
@param namespace Namespace (Keyspace) name.
@param storeName Store (ColumnFamily) name.
@return True if the given table's column values are binary. | [
"public boolean columnValueIsBinary(String namespace, String storeName) {\n Boolean cachedValue = getCachedValueIsBinary(namespace, storeName);\n if(cachedValue != null) return cachedValue.booleanValue();\n \n String cqlKeyspace = CQLService.storeToCQLName(namespace);\n String tab... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Automatically sets owners 'owner_id' from current user owner_id | [
"public function beforeSave()\n {\n if ($this->owner->hasAttribute($this->attribute) && !$this->owner->{$this->attribute}) {\n $this->owner->setAttribute($this->attribute, Yii::$app->user->identity->{$this->attribute});\n }\n }"
] | [
"def relation_ids(self):\n \n if self.scope == scopes.GLOBAL:\n # the namespace is the relation name and this conv speaks for all\n # connected instances of that relation\n return hookenv.relation_ids(self.namespace)\n else:\n # the namespace is the r... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Reads the next header line.
@param aHeaders
String with all headers.
@param sHeader
Map where to store the current header. | [
"private static void _parseHeaderLine (@Nonnull final FileItemHeaders aHeaders, @Nonnull final String sHeader)\n {\n final int nColonOffset = sHeader.indexOf (':');\n if (nColonOffset == -1)\n {\n // This header line is malformed, skip it.\n if (LOGGER.isWarnEnabled ())\n LOGGER.warn (\"F... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Sort match list.
@param list
the list | [
"private static void sortMatchList(List<Match> list) {\n if (list != null) {\n // light sorting on start position\n Collections.sort(list, (Match m1,\n Match m2) -> (Integer.compare(m1.startPosition, m2.startPosition)));\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetAppliedSchemaArn sets the AppliedSchemaArn field's value. | [
"func (s *GetAppliedSchemaVersionOutput) SetAppliedSchemaArn(v string) *GetAppliedSchemaVersionOutput {\n\ts.AppliedSchemaArn = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// GetSortedKeys returns the keys of the map in a sorted order. This function assumes that the keys are string | [
"func GetSortedKeys(m interface{}) []string {\n\tmapVal := reflect.ValueOf(m)\n\tkeyVals := mapVal.MapKeys()\n\tkeys := []string{}\n\tfor _, keyVal := range keyVals {\n\t\tkeys = append(keys, keyVal.String())\n\t}\n\tsort.Strings(keys)\n\treturn keys\n}"
] | [
"function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object.... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Subtract o value from this
@param o | [
"void subtract(Scalar o)\r\n {\r\n if (!type.equals(o.type))\r\n {\r\n throw new UnsupportedOperationException(\"Action with wrong kind of class\");\r\n }\r\n value -= o.value;\r\n }"
] | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Gets the forced variation for a given user and experiment.
Args:
experiment_key: A string key identifying the experiment.
user_id: The user ID.
Returns:
The forced variation key. None if no forced variation key. | [
"def get_forced_variation(self, experiment_key, user_id):\n \n\n if not self.is_valid:\n self.logger.error(enums.Errors.INVALID_DATAFILE.format('get_forced_variation'))\n return None\n\n if not validator.is_non_empty_string(experiment_key):\n self.logger.error(enums.Errors.INVALID_INPUT_ERRO... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Destroy given event.
@param \Cortex\Bookings\Models\Event $event
@param \Cortex\Bookings\Models\EventBooking $eventBooking
@throws \Exception
@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse | [
"public function destroy(Event $event, EventBooking $eventBooking)\n {\n $event->bookings()->where($eventBooking->getKeyName(), $eventBooking->getKey())->first()->delete();\n\n return intend([\n 'url' => route('adminarea.events.bookings.index', ['event' => $event]),\n 'with' =... | [
"protected function registerClientInterface()\n\t{\n\t\t$this->app->bind('Mgallegos\\DecimaAccounting\\Accounting\\Repositories\\Client\\ClientInterface', function($app)\n\t\t{\n\t\t\t$AuthenticationManager = $app->make('App\\Kwaai\\Security\\Services\\AuthenticationManagement\\AuthenticationManagementInterface');\... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Sends a standard HTTP response.
@param string $code Code and Code-text
@param string $mime MIME-Type
@param string $message Response text | [
"public function sendResult($code, $mime, $message)\n {\n $this->sendHeader('HTTP/1.0 ' . $code);\n $this->sendHeader('Content-Type: ' . $mime);\n $this->sendResponse($message);\n }"
] | [
"public function prepareResponse(): void\n {\n // change default HTTP status code\n $this->response->setStatusCode(200);\n\n // clear default response headers\n $this->response->resetHeaders();\n\n // add your response headers\n $this->response->setCharset('UTF-8');\n ... | codesearchnet | {
"query": "Represent the comment about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Programming:"
} |
Longitud
ô (93H - ASCII 147)
FS
No de línea de comprobante original (1-2)
0: borra ambas líneas (sólo modelos SMH/P-PR5F -versión 2.01-, SMH/P-715F
-versiones 3.02 y posteriores-, y SMH/P-441F)
FS
Texto de hasta 20 caracteres
Ejemplo: ô∟1∟00000118 | [
"public function setEmbarkNumber($numeroTicket, $nlinea = 1){\n return chr(147).$this->cm('FS') . $nlinea . $this->cm('FS') . trim($numeroTicket);\n }"
] | [
"def CrearPlantillaPDF(self, papel=\"A4\", orientacion=\"portrait\"):\n \"\"\n \n # genero el renderizador con propiedades del PDF\n t = Template(\n format=papel, orientation=orientacion,\n title=\"F 1116 B/C %s\" % (self.NroOrden),\n autho... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<code>.google.privacy.dlp.v2.BucketingConfig bucketing_config = 6;</code> | [
"public com.google.privacy.dlp.v2.BucketingConfigOrBuilder getBucketingConfigOrBuilder() {\n if (transformationCase_ == 6) {\n return (com.google.privacy.dlp.v2.BucketingConfig) transformation_;\n }\n return com.google.privacy.dlp.v2.BucketingConfig.getDefaultInstance();\n }"
] | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.cloud.automl.v1beta1.DataType> getFields() {\n return getFieldsMap();\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Attempts to close the provided client, checking the options first for a close block
then checking the known clients | [
"def close_client(clnt)\n @close_client = (known_client_action(clnt,:close) || false) if @close_client.nil?\n if @close_client\n begin\n perform_action(clnt,@close_client)\n rescue => e\n HotTub.logger.error \"[HotTub] There was an error closing one of your #{self.class.nam... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence about Computer Networking:",
"pos": "Represent the Github code about Computer Networking:",
"neg": "Represent the Github code about programming:"
} |
Invites a user to a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890'
user (str): The user id. e.g. 'U1234567890' | [
"def groups_invite(self, *, channel: str, user: str, **kwargs) -> SlackResponse:\n \n self._validate_xoxp_token()\n kwargs.update({\"channel\": channel, \"user\": user})\n return self.api_call(\"groups.invite\", json=kwargs)"
] | [
"def index(request):\n session = Session(request.body)\n print 'request.body begin'\n print request.body\n print 'request.body end'\n t = Tropo()\n smsContent = session.initialText\n #t.call(to=session.parameters['callToNumber'], network='SIP')\n #t.say(session.parameters['message'])\n \n... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
{@inheritDoc}
@return \Cake\Collection\Iterator\FilterIterator | [
"public function reject(callable $c)\n {\n return new FilterIterator($this->unwrap(), function ($key, $value, $items) use ($c) {\n return !$c($key, $value, $items);\n });\n }"
] | [
"public function entityIdFrom(IEntitySet $entities) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder($this->type(new ObjectIdType(new EntityIdOptions($entities))));\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Return true if the next token matches the specified punctuator. | [
"function match(value) {\n var token = lookahead();\n return token.type === Token.Punctuator && token.value === value;\n }"
] | [
"def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
/*======================================================================*\
Function: setcookies()
Purpose: set cookies for a redirection
\*====================================================================== | [
"function setcookies()\n {\n for ($x = 0; $x < count($this->headers); $x++) {\n if (preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x], $match))\n $this->cookies[$match[1]] = urldecode($match[2]);\n }\n return $this;\n }"
] | [
"def closeEvent(self, event):\n \n\n self.save_config(self.gui_settings['gui_settings'])\n self.script_thread.quit()\n self.read_probes.quit()\n event.accept()\n\n print('\\n\\n======================================================')\n print('================= Closin... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Получение списка полей таблицы
@param string $table Имя таблицы
@param bool $info [optional]
@return array|bool Список полей, с описанием, если $info = true
@deprecated с 2.14 | [
"public function fields($table, $info = false)\n\t{\n Eresus_Kernel::log(__METHOD__, LOG_NOTICE, 'This method is deprecated');\n\t\t$schm = $this->getSchema()->getSchema();\n\t\tif ($schm[$table]->fields)\n\t\t{\n\t\t\treturn array_keys($schm[$table]->fields);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t... | [
"public function validateIpSmsCode()\n {\n $codeRequestsCountIp = AbstractSmsCode::getRequestedTodayByIp($this->ip, $this->type_id); // число запросов смс за сегодня\n if ($codeRequestsCountIp >= AbstractSmsCode::MAX_PER_IP) {\n throw $e = new \\yii\\base\\Exception(\\Yii::t('app', 'Прев... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about software development:"
} |
Уведомить всех кого надо и как надо | [
"public function notify()\n {\n if ($this->form)\n {\n if ($this->form->emailsAsArray)\n {\n foreach ($this->form->emailsAsArray as $email)\n {\n \\Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/modules/cms/fo... | [
"final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Seek implements table.Table Type interface. | [
"func (vt *VirtualTable) Seek(ctx sessionctx.Context, h int64) (int64, bool, error) {\n\treturn 0, false, table.ErrUnsupportedOp\n}"
] | [
"public void open() throws DBException\n {\n if (this.isOpen())\n return; // Ignore if already open\n this.getRecord().handleInitialKey(); // Set up the smaller key\n this.getRecord().handleEndKey(); // Set up the larger key\n // You can't ... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// RetrieveFundingOutpointByVinID gets the previous outpoint for a transaction
// input specified by row ID in the vins table. | [
"func RetrieveFundingOutpointByVinID(ctx context.Context, db *sql.DB, vinDbID uint64) (tx string, index uint32, tree int8, err error) {\n\terr = db.QueryRowContext(ctx, internal.SelectFundingOutpointByVinID, vinDbID).\n\t\tScan(&tx, &index, &tree)\n\treturn\n}"
] | [
"def deserialize_block(value):\n \n # Block id strings are stored under batch/txn ids for reference.\n # Only Blocks, not ids or Nones, should be returned by _get_block.\n block = Block()\n block.ParseFromString(value)\n return BlockWrapper(\n block=block)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param string $format formats the date to the specific format, null returns DateTime
@return \DateTime|string | [
"public function getEpcValidUntil($format = 'Y-m-d')\n {\n if ($this->epcValidUntil instanceof \\DateTime && $format !== null) {\n return $this->epcValidUntil->format($format);\n }\n\n return $this->epcValidUntil;\n }"
] | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
*********************************************************************************************
Lifecycle Methods | [
"@Override @SuppressLint(\"NewApi\")\n public void onCreate(Bundle savedInstanceState) {\n // Set window transition elements\n if(BuildUtils.isLollipop()) {\n getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);\n\n TransitionSet transitions = new TransitionSet()\n ... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set the uuid and the path of a newly created fileNode
@param fileNode
@throws FrameworkException | [
"public static void setFileProperties (File fileNode) throws FrameworkException {\n\n\t\tfinal PropertyMap properties = new PropertyMap();\n\n\t\tString id = fileNode.getProperty(GraphObject.id);\n\t\tif (id == null) {\n\n\t\t\tfinal String newUuid = UUID.randomUUID().toString().replaceAll(\"[\\\\-]+\", \"\");\n\t\... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
// GetAnalysisMonthlyRetain 获取用户访问小程序月留存 | [
"func (wxa *MiniProgram) GetAnalysisMonthlyRetain(beginDate, endDate string) (result ResAnalysisRetain, err error) {\n\treturn wxa.getAnalysisRetain(getAnalysisMonthlyRetainURL, beginDate, endDate)\n}"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the description about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about text processing:"
} |
Returns True if there's a file in the current feed with the
given file_name in the current feed. | [
"def _HasFile(self, file_name):\n \"\"\"\"\"\"\n if self._zip:\n return file_name in self._zip.namelist()\n else:\n file_path = os.path.join(self._path, file_name)\n return os.path.exists(file_path) and os.path.isfile(file_path)"
] | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Use Schroeder or Newton-Raphson to do one step of the iteration, formulas 37 and 38. | [
"function step(x, a, p, q) {\n var temp, w;\n\n temp = p <= 0.5 ? gratio(a)(x) - p : q - gratioc(a)(x);\n temp /= r(a, x);\n w = (a - 1 - x) / 2;\n if (Math.max(Math.abs(temp), Math.abs(w * temp)) <= 0.1) {\n return x * (1 - (temp + w * temp * temp));\n }\n return x * (1 -... | [
"def _berlekamp_massey_fast(self, s, k=None, erasures_loc=None, erasures_eval=None, erasures_count=0):\n '''\n '''\n n = self.n\n if not k: k = self.k\n\n # Initialize, depending on if we include erasures or not:\n if erasures_loc:\n sigma = Polynomial(erasures_l... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Return TRUE if the name is a qualified name.
Eg. MyNamespace\MyClass
@return bool | [
"public function isUnqualified() {\n $absolute = $this->isAbsolute();\n $parts = $this->getParts();\n return !$absolute && count($parts) === 1;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
show / hide clear button | [
"function(e) {\n if(!this.$clear) {\n return;\n }\n \n var len = this.$input.val().length,\n visible = this.$clear.is(':visible');\n \n if(len && !visible) {\n this.$clear.show();\n } \n ... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
or after waiting a few milliseconds | [
"protected void returnToTaskQueue(boolean sourcesReady)\n {\n if (sourcesReady) {\n // If we've done something meaningful, go ahead and return ourselves to the queue immediately\n m_taskQueue.offer(this);\n } else {\n // Otherwise, avoid spinning too aggressively, s... | [
"function showIntro() {\n write(\"Welcome to the Recognizer's Sample console application!\");\n write(\"To try the recognizers enter a phrase and let us show you the different outputs for each recognizer or just type 'exit' to leave the application.\");\n write();\n write(\"Here are some examples you co... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the path to the image in this control.
@return | [
"public String getZmlImagePath()\n {\n String strImage = null;\n if (this.getScreenField().getConverter() != null)\n if (this.getScreenField().getConverter().getField() != null)\n if (!this.getScreenField().getConverter().getField().isNull())\n {\n BaseFi... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetLayer sets the Layer field's value. | [
"func (s *InsertableImage) SetLayer(v int64) *InsertableImage {\n\ts.Layer = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Blocks messages from a specifed user
:param user_id: The ID of the user that you want to block
:return: Whether the request was successful
:raises: FBchatException if request failed | [
"def blockUser(self, user_id):\n \n data = {\"fbid\": user_id}\n r = self._post(self.req_url.BLOCK_USER, data)\n return r.ok"
] | [
"def get_entity(ent_type, **kwargs):\n '''\n \n '''\n try:\n func = 'keystoneng.{}_get'.format(ent_type)\n ent = __salt__[func](**kwargs)\n except OpenStackCloudException as e:\n # NOTE(SamYaple): If this error was something other than Forbidden we\n # reraise the issue si... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetElasticsearchSettings sets the ElasticsearchSettings field's value. | [
"func (s *CreateEndpointInput) SetElasticsearchSettings(v *ElasticsearchSettings) *CreateEndpointInput {\n\ts.ElasticsearchSettings = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Takes in params and generates a path and the remaining params
that should be shown in the url. The extra "unused" params
will be tacked onto the end of the url ?param1=value1, etc...
returns the url and new params, or nil, nil if no match is found. | [
"def params_to_url(test_params)\n # Extract the desired method from the params\n method = test_params.delete(:method) || :client\n method = method.to_sym\n\n # Add in underscores\n test_params = test_params.each_with_object({}) do |(k, v), obj|\n obj[k.to_sym] = v\n end\n\n ... | [
"def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Generate a list of telemetry events as payload | [
"def generate_payload(self):\n \n events = []\n transformation_task = self._get_alias_transformation_properties()\n transformation_task.update(self._get_based_properties())\n events.append(transformation_task)\n\n for exception in self.exceptions:\n properties = ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*
this method simulates net_kernel only for the purpose of replying to
pings. | [
"private boolean netKernel(final OtpMsg m) {\n OtpMbox mbox = null;\n try {\n final OtpErlangTuple t = (OtpErlangTuple) m.getMsg();\n final OtpErlangTuple req = (OtpErlangTuple) t.elementAt(1); // actual\n // request\n\n final OtpErlangPid pid = (OtpErlangPi... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github comment about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code about programming:"
} |
Processes and returns encoded image as PSD string
@return string | [
"protected function processPsd()\n {\n $format = 'psd';\n $compression = \\Imagick::COMPRESSION_UNDEFINED;\n\n $imagick = $this->image->getCore();\n $imagick->setFormat($format);\n $imagick->setImageFormat($format);\n $imagick->setCompression($compression);\n $ima... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetTags sets the Tags field's value. | [
"func (s *ChannelSummary) SetTags(v map[string]*string) *ChannelSummary {\n\ts.Tags = v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
is_job_done function checks to if Brain.Jobs Status is 'Done'
:param job_id: <str> id for the job
:param conn: (optional)<connection> to run on
:return: <dict> if job is done <false> if | [
"def is_job_done(job_id, conn=None):\n \n result = False\n get_done = RBJ.get_all(DONE, index=STATUS_FIELD)\n for item in get_done.filter({ID_FIELD: job_id}).run(conn):\n result = item\n return result"
] | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about AWS Auto Scaling:"
} |
Raise an error from the remote API if necessary. | [
"def _raise_for_remote_status(url: str, data: dict) -> None:\n \"\"\"\"\"\"\n if data.get('errorType') and data['errorType'] > 0:\n raise_remote_error(data['errorType'])\n\n if data.get('statusCode') and data['statusCode'] != 200:\n raise RequestError(\n 'Error requesting data from... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
// Reads a ref-name | [
"func readRef(data []byte) (string, plumbing.Hash, error) {\n\tchunks := bytes.Split(data, sp)\n\tswitch {\n\tcase len(chunks) == 1:\n\t\treturn \"\", plumbing.ZeroHash, fmt.Errorf(\"malformed ref data: no space was found\")\n\tcase len(chunks) > 2:\n\t\treturn \"\", plumbing.ZeroHash, fmt.Errorf(\"malformed ref da... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.