hash stringlengths 40 40 | diff stringlengths 131 26.7k | message stringlengths 7 694 | project stringlengths 5 67 | split stringclasses 1 value | diff_languages stringlengths 2 24 |
|---|---|---|---|---|---|
3806530383b42599161ec47b6e3253289dee7394 | diff --git a/cherrypy/lib/sessions.py b/cherrypy/lib/sessions.py
index <HASH>..<HASH> 100644
--- a/cherrypy/lib/sessions.py
+++ b/cherrypy/lib/sessions.py
@@ -476,7 +476,7 @@ class FileSession(Session):
if path is None:
path = self._get_file_path()
path += self.LOCK_SUFFIX
- checker = locking.LockChecker(self.lock_timeout)
+ checker = locking.LockChecker(self.id, self.lock_timeout)
while not checker.expired():
# always try once
try: | Added session id to LockChecker construction | cherrypy_cheroot | train | py |
3e20fb075aaeae3d51e640ba8fa4043b6cf61b02 | diff --git a/aioredis/commands/pubsub.py b/aioredis/commands/pubsub.py
index <HASH>..<HASH> 100644
--- a/aioredis/commands/pubsub.py
+++ b/aioredis/commands/pubsub.py
@@ -23,7 +23,7 @@ class PubSubCommandsMixin:
subscribe to specified channels.
Returns :func:`asyncio.gather()` coroutine which when done will return
- a list of subscribed channels.
+ a list of :class:`~aioredis.Channel` objects.
"""
conn = self._conn
return wait_return_channels(
@@ -39,7 +39,8 @@ class PubSubCommandsMixin:
subscribe to specified patterns.
Returns :func:`asyncio.gather()` coroutine which when done will return
- a list of subscribed patterns.
+ a list of subscribed :class:`~aioredis.Channel` objects with
+ ``is_pattern`` property set to ``True``.
"""
conn = self._conn
return wait_return_channels( | add refs to Channel documentation in Pub/Sub section (see #<I>) | aio-libs_aioredis | train | py |
8e388179b1b2b87dbfa6a49e0c61a066510a323b | diff --git a/core/src/playn/core/Image.java b/core/src/playn/core/Image.java
index <HASH>..<HASH> 100644
--- a/core/src/playn/core/Image.java
+++ b/core/src/playn/core/Image.java
@@ -136,7 +136,7 @@ public interface Image {
* Configures the use of mipmaps when rendering this image at scales less than 1. This only
* applies to GL-based backends (it is a NOOP on other backends).
*/
- void setMipmapped (boolean mipmapped);
+ void setMipmapped(boolean mipmapped);
/**
* Creates a texture for this image (if one does not already exist) and returns its OpenGL | Wouldn't want to waste a drop of that precious, precious whitespace. | threerings_playn | train | java |
e001ff956630b260b2ec4a897533b555fef26204 | diff --git a/dingo/core/network/__init__.py b/dingo/core/network/__init__.py
index <HASH>..<HASH> 100644
--- a/dingo/core/network/__init__.py
+++ b/dingo/core/network/__init__.py
@@ -24,7 +24,7 @@ class GridDingo:
self.grid_district = kwargs.get('region', None)
#self.geo_data = kwargs.get('geo_data', None)
self.v_level = kwargs.get('v_level', None)
- self.branch_type = kwargs.get('branch_type', None)
+
self._graph = nx.Graph()
def graph_add_node(self, node_object): | move branch type to MVGrid class and rename it to default_branch_kind | openego_ding0 | train | py |
58de9f97ea83a4090075425f6257ede7990d52e8 | diff --git a/kubespawner/proxy.py b/kubespawner/proxy.py
index <HASH>..<HASH> 100644
--- a/kubespawner/proxy.py
+++ b/kubespawner/proxy.py
@@ -86,10 +86,11 @@ class KubeIngressProxy(Proxy):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- # We want 3x concurrent spawn limit as our threadpool. This means that if
- # concurrent_spawn_limit servers start instantly, we can add all 3 objects
- # required to add proxy routing for them instantly as well.
- self.executor = ThreadPoolExecutor(max_workers=self.app.concurrent_spawn_limit * 3)
+ # We use the maximum number of concurrent user server starts (and thus proxy adds)
+ # as our threadpool maximum. This ensures that contention here does not become
+ # an accidental bottleneck. Since we serialize our create operations, we only
+ # need 1x concurrent_spawn_limit, not 3x.
+ self.executor = ThreadPoolExecutor(max_workers=self.app.concurrent_spawn_limit)
self.ingress_reflector = IngressReflector(parent=self, namespace=self.namespace)
self.service_reflector = ServiceReflector(parent=self, namespace=self.namespace) | Bump proxy threadpool to 1x concurrent spawn limit, not 3x
We seriealize creates, so 1x is enough | jupyterhub_kubespawner | train | py |
b403c32aa0ba6d4d07ea1dbc94f8a69aee6e6e08 | diff --git a/lib/weblib.php b/lib/weblib.php
index <HASH>..<HASH> 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -313,7 +313,7 @@ function stripslashes_safe($string) {
$string = str_replace("\\'", "'", $string);
$string = str_replace('\\"', '"', $string);
- //$string = str_replace('\\\\', '\\', $string); // why?
+ $string = str_replace('\\\\', '\\', $string);
return $string;
} | Reinstated the line in stripslashes_safe() that removes the slash that escapes a backslash. Martin removed this line in March. Why? | moodle_moodle | train | php |
98a8a001fcba3fafcc1f169870bf463fe4a07191 | diff --git a/registry.py b/registry.py
index <HASH>..<HASH> 100644
--- a/registry.py
+++ b/registry.py
@@ -22,7 +22,7 @@ from flask import current_app
from flask.ext.registry import ImportPathRegistry, SingletonRegistry, \
RegistryProxy, RegistryError
from invenio.modules.deposit.models import DepositionType
-from invenio.modules.workflows.loader import workflows
+from invenio.modules.workflows.registry import workflows
class DepositSingletonRegistry(SingletonRegistry): | workflows: revamp testsuite
* Implements a renewed testsuite for workflows with better coverage
overall.
* Moves the workflows and widgets loading to use registry. Tests
also use their own test registry.
* Test specific workflows are now moved to the testsuite.
* Cleans up the tests a bit, renaming and moving the tests in
test_halt into the renewed test_workflows suite.
* Makes the tests visible for the overall invenio testsuite by
adding the TEST_SUITE variable.
* Fixes an issue with the custom Log handler and inheritance. | inveniosoftware_invenio-deposit | train | py |
484440636cbceadb63e98f4236941cb0eb183e9d | diff --git a/lib/insightly/base.rb b/lib/insightly/base.rb
index <HASH>..<HASH> 100644
--- a/lib/insightly/base.rb
+++ b/lib/insightly/base.rb
@@ -1,3 +1,4 @@
+#METODO look at tags vs custom fields
#METODO only allow build to set fields that are part of the API fields
#METODO make a distinction between fields that you can set and save and ones you can only read - like DATE_UPDATED_UTC
module Insightly | Added a note about tags vs custom fields | r26D_insightly | train | rb |
29a7673a9062995c7b36b04bf3dea218eb077ce6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ cmdclass = dict(test=PyTest)
# requirements
install_requires = set(x.strip() for x in open('requirements.txt'))
install_requires_replacements = {
- 'https://github.com/ethereum/pyrlp/tarball/develop': 'rlp>=0.3.9',
+ 'https://github.com/ethereum/pyrlp/tarball/develop': 'rlp==0.3.9',
'https://github.com/ethereum/ethash/tarball/master': 'pyethash'}
install_requires = [install_requires_replacements.get(r, r) for r in install_requires] | Force rlp=<I> to attempt fix build | ethereum_pyethereum | train | py |
5b47613083da2c61227f83f86d5d93c678c5d733 | diff --git a/src/Guards/TokenGuard.php b/src/Guards/TokenGuard.php
index <HASH>..<HASH> 100644
--- a/src/Guards/TokenGuard.php
+++ b/src/Guards/TokenGuard.php
@@ -187,7 +187,7 @@ class TokenGuard
protected function decodeJwtTokenCookie($request)
{
return (array) JWT::decode(
- $this->encrypter->decrypt($request->cookie(Passport::cookie())),
+ $this->encrypter->decrypt($request->cookie(Passport::cookie()), Passport::$unserializesCookies),
$this->encrypter->getKey(), ['HS256']
);
}
diff --git a/src/Passport.php b/src/Passport.php
index <HASH>..<HASH> 100644
--- a/src/Passport.php
+++ b/src/Passport.php
@@ -118,6 +118,13 @@ class Passport
public static $runsMigrations = true;
/**
+ * Indicates if Passport should unserializes cookies.
+ *
+ * @var bool
+ */
+ public static $unserializesCookies = true;
+
+ /**
* Enable the implicit grant type.
*
* @return static
@@ -506,4 +513,16 @@ class Passport
return new static;
}
+
+ /**
+ * Configure Passport to stop unserializing cookies.
+ *
+ * @return static
+ */
+ public static function dontUnserializeCookies()
+ {
+ static::$unserializesCookies = false;
+
+ return new static;
+ }
} | adapt for laravel breakingc hange | laravel_passport | train | php,php |
f022a06edf819f740d7ade6217c1d5214bf0b9af | diff --git a/extensions/composer/yii/composer/Installer.php b/extensions/composer/yii/composer/Installer.php
index <HASH>..<HASH> 100644
--- a/extensions/composer/yii/composer/Installer.php
+++ b/extensions/composer/yii/composer/Installer.php
@@ -31,7 +31,7 @@ class Installer extends LibraryInstaller
*/
public function supports($packageType)
{
- return $packageType === 'yii-extension';
+ return $packageType === 'yii2-extension';
}
/**
@@ -65,7 +65,7 @@ class Installer extends LibraryInstaller
protected function addPackage(PackageInterface $package)
{
$extension = [
- 'name' => $package->getPrettyName(),
+ 'name' => $package->getName(),
'version' => $package->getVersion(),
];
@@ -76,14 +76,14 @@ class Installer extends LibraryInstaller
}
$extensions = $this->loadExtensions();
- $extensions[$package->getUniqueName()] = $extension;
+ $extensions[$package->getName()] = $extension;
$this->saveExtensions($extensions);
}
protected function removePackage(PackageInterface $package)
{
$packages = $this->loadExtensions();
- unset($packages[$package->getUniqueName()]);
+ unset($packages[$package->getName()]);
$this->saveExtensions($packages);
} | renamed composer installation type. | yiisoft_yii2-debug | train | php |
b4b46e899cbeed00b353bd1d884614a85ff5a0e2 | diff --git a/AmqpSubscriptionConsumer.php b/AmqpSubscriptionConsumer.php
index <HASH>..<HASH> 100644
--- a/AmqpSubscriptionConsumer.php
+++ b/AmqpSubscriptionConsumer.php
@@ -29,6 +29,8 @@ class AmqpSubscriptionConsumer implements PsrSubscriptionConsumer
public function __construct(AmqpContext $context)
{
$this->context = $context;
+
+ $this->subscribers = [];
}
/** | move subscription logic of amqplib and amqpext to separate classes. | php-enqueue_amqp-bunny | train | php |
863088e9a0e275f7eb65926a779d417f0b4d87ee | diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php
index <HASH>..<HASH> 100644
--- a/includes/functions/functions_print.php
+++ b/includes/functions/functions_print.php
@@ -1105,7 +1105,7 @@ function print_findfact_link($element_id) {
function get_lds_glance(WT_Individual $indi) {
$BAPL = $indi->getFacts('BAPL') ? 'B' : '_';
$ENDL = $indi->getFacts('ENDL') ? 'E' : '_';
- $ENDL = $indi->getFacts('SLGC') ? 'C' : '_';
+ $SLGC = $indi->getFacts('SLGC') ? 'C' : '_';
$SLGS = '_';
foreach ($indi->getSpouseFamilies() as $family) { | Correct typo in functions_print.php - LDS ordinance | fisharebest_webtrees | train | php |
9d13aae115acc92b2b5089f3d28f117c0c7b28fb | diff --git a/framework/core/migrations/2018_01_11_155200_change_discussions_b8_columns.php b/framework/core/migrations/2018_01_11_155200_change_discussions_b8_columns.php
index <HASH>..<HASH> 100644
--- a/framework/core/migrations/2018_01_11_155200_change_discussions_b8_columns.php
+++ b/framework/core/migrations/2018_01_11_155200_change_discussions_b8_columns.php
@@ -48,8 +48,8 @@ return [
$table->renameColumn('hidden_user_id', 'hide_user_id');
$table->dropForeign([
- 'discussions_user_id_foreign', 'discussions_last_posted_user_id', 'hidden_user_id',
- 'first_post_id', 'last_post_id'
+ 'discussions_user_id_foreign', 'discussions_last_posted_user_id_foreign', 'discussions_hidden_user_id_foreign',
+ 'discussions_first_post_id_foreign', 'discussions_last_post_id_foreign'
]);
});
} | forgot to name a few constraints properly on the dropForeign statement | flarum_core | train | php |
f699154d2bfb59ace9b85d9dfa94b4e4bd823b18 | diff --git a/src/Leevel/Di/Container.php b/src/Leevel/Di/Container.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Di/Container.php
+++ b/src/Leevel/Di/Container.php
@@ -875,7 +875,7 @@ class Container implements IContainer, ArrayAccess
/**
* 解析数组回调反射参数.
*/
- protected function parseMethodReflection(callable $injection): array
+ protected function parseMethodReflection(array $injection): array
{
return (new ReflectionMethod($injection[0], $injection[1]))->getParameters();
} | chore(di): fix for phpstan level 3 | hunzhiwange_framework | train | php |
fb132873d9ec6a3647c0f479efe90a859cc3a32f | diff --git a/admin/upgradesettings.php b/admin/upgradesettings.php
index <HASH>..<HASH> 100644
--- a/admin/upgradesettings.php
+++ b/admin/upgradesettings.php
@@ -63,6 +63,7 @@ echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
echo $newsettingshtml;
+echo '</fieldset>';
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="' . get_string('savechanges','admin') . '" /></div>';
echo '</form>';
diff --git a/lib/adminlib.php b/lib/adminlib.php
index <HASH>..<HASH> 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -2356,7 +2356,7 @@ class admin_setting_special_gradebookroles extends admin_setting {
$first = true;
foreach ($roles as $roleid=>$role) {
if (is_array($currentsetting) && in_array($roleid, array_keys($currentsetting))) {
- $checked = 'checked="checked"';
+ $checked = ' checked="checked"';
} else {
$checked = '';
} | Fixes MDL-<I> "XML well-formed bug, need space before 'checked' attribute." (Merged from MOODLE_<I>_GROUPS) | moodle_moodle | train | php,php |
768a38d9bccfed0cd1824c38a820e04e89f85411 | diff --git a/lib/rediska/transaction_commands.rb b/lib/rediska/transaction_commands.rb
index <HASH>..<HASH> 100644
--- a/lib/rediska/transaction_commands.rb
+++ b/lib/rediska/transaction_commands.rb
@@ -72,7 +72,7 @@ module Rediska
'OK'
end
- def watch(_)
+ def watch(*_)
'OK'
end | Watch needs to support multiple arguments (fakeredis #<I>). | lbeder_rediska | train | rb |
49db743b8382bbe85dc7748f62a3a8eaa77cde7a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,9 +1,7 @@
module.exports = function(value) {
var length = value.length;
- // If `value` is an empty string, then it will have 0 caps and a length of 0,
- // which, when divided, will yield `NaN`. A string with a length of 0 will
- // obviously have no caps.
+ // A string with a length of 0 will obviously have no caps.
if (!length) {
return 0;
} | Simplify comment on 0 length strings | nwitch_caps-rate | train | js |
f70472db0ff05d352e8c399c7af898a7b2417a70 | diff --git a/i3pystatus/wireguard.py b/i3pystatus/wireguard.py
index <HASH>..<HASH> 100644
--- a/i3pystatus/wireguard.py
+++ b/i3pystatus/wireguard.py
@@ -76,6 +76,6 @@ class Wireguard(IntervalModule):
self.data = locals()
self.output = {
- "full_text": self.format.format(**locals()),
+ "full_text": self.format.format(**self.data),
'color': color,
} | Use self.data instead of locals | enkore_i3pystatus | train | py |
1e4206a71324f4d262ddcd1a35832118c25ece07 | diff --git a/lib/riddle/auto_version.rb b/lib/riddle/auto_version.rb
index <HASH>..<HASH> 100644
--- a/lib/riddle/auto_version.rb
+++ b/lib/riddle/auto_version.rb
@@ -8,6 +8,9 @@ class Riddle::AutoVersion
require "riddle/#{version}"
when '1.10-beta', '1.10-id64-beta', '1.10-dev'
require 'riddle/1.10'
+ else
+ puts "found version: #{version}"
+ exit
end
end
end
diff --git a/lib/riddle/controller.rb b/lib/riddle/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/riddle/controller.rb
+++ b/lib/riddle/controller.rb
@@ -12,7 +12,7 @@ module Riddle
end
def sphinx_version
- `#{indexer} 2>&1`[/^Sphinx (\d+\.\d+(\.\d+|(\-id64)?\-beta))/, 1]
+ `#{indexer} 2>&1`[/^Sphinx (\d+\.\d+(\.\d+|(?:-dev|(\-id64)?\-beta)))/, 1]
rescue
nil
end | allow compiling from svn | pat_riddle | train | rb,rb |
ad4d4fed1b283eeaa91c4c276a421fe7fa64befd | diff --git a/ailib/src/main/java/ai/api/model/Result.java b/ailib/src/main/java/ai/api/model/Result.java
index <HASH>..<HASH> 100644
--- a/ailib/src/main/java/ai/api/model/Result.java
+++ b/ailib/src/main/java/ai/api/model/Result.java
@@ -55,7 +55,7 @@ public class Result implements Serializable {
* Currently active contexts
*/
@SerializedName("contexts")
- private AIOutputContext[] contexts;
+ private List<AIOutputContext> contexts;
@SerializedName("metadata")
@@ -225,10 +225,28 @@ public class Result implements Serializable {
return getComplexParameter(name, null);
}
- public AIOutputContext[] getContexts() {
+ public List<AIOutputContext> getContexts() {
return contexts;
}
+ public AIOutputContext getContext(final String name) {
+ if (TextUtils.isEmpty(name)) {
+ throw new IllegalArgumentException("name argument must be not empty");
+ }
+
+ if (contexts == null) {
+ return null;
+ }
+
+ for (final AIOutputContext c : contexts) {
+ if (name.equalsIgnoreCase(c.getName())) {
+ return c;
+ }
+ }
+
+ return null;
+ }
+
/**
* The query that was used to produce this result
*/ | Contexts property in Result now List | dialogflow_dialogflow-android-client | train | java |
085567231657efb3292bab88895692d2781d20eb | diff --git a/lib/autoprefixer-rails/sprockets.rb b/lib/autoprefixer-rails/sprockets.rb
index <HASH>..<HASH> 100644
--- a/lib/autoprefixer-rails/sprockets.rb
+++ b/lib/autoprefixer-rails/sprockets.rb
@@ -57,7 +57,7 @@ module AutoprefixerRails
end
# Sprockets 2 API new and render
- def render(_, _)
+ def render(*)
self.class.run(@filename, @source)
end
end | Workaround for Sorbet rbi generation (#<I>)
Please note we don't guarantee any support for sorbet. | ai_autoprefixer-rails | train | rb |
31778d531c4ae60db5381c9723afbe10d861a7ac | diff --git a/bika/lims/browser/instrument.py b/bika/lims/browser/instrument.py
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/instrument.py
+++ b/bika/lims/browser/instrument.py
@@ -567,6 +567,12 @@ class InstrumentCertificationsView(BikaListingView):
BikaListingView.__init__(self, context, request, **kwargs)
self.form_id = "instrumentcertifications"
+ self.icon = self.portal_url + "/++resource++bika.lims.images/instrumentcertification_big.png"
+ self.title = self.context.translate(_("Calibration Certificates"))
+ self.context_actions = {_('Add'):
+ {'url': 'createObject?type_name=InstrumentCertification',
+ 'icon': '++resource++bika.lims.images/add.png'}}
+
self.columns = {
'Title': {'title': _('Cert. Num'), 'index': 'sortable_title'},
'getAgency': {'title': _('Agency'), 'sortable': False}, | Added context action for instrument certifications | senaite_senaite.core | train | py |
c1392e5bec2225199ad5a362209017ade129a603 | diff --git a/linshareapi/core.py b/linshareapi/core.py
index <HASH>..<HASH> 100644
--- a/linshareapi/core.py
+++ b/linshareapi/core.py
@@ -195,7 +195,11 @@ class CoreCli(object):
return True
if not quiet:
if request.status_code == 401:
- self.log.error("Authentication failed: %s: %s", request.status_code, request.text)
+ self.log.debug("Authentication failed: %s: %s", request.status_code, request.text)
+ trace_request(request)
+ error_code = request.headers.get('X-Linshare-Auth-Error-Code')
+ error_msg = request.headers.get('X-Linshare-Auth-Error-Msg')
+ self.log.error("Authentication failed: error code=%s: %s", error_code, error_msg)
return False
def process_request(self, request, url, force_nocontent=False): | Improving error message related to authentication request. | fred49_linshare-api | train | py |
3e4c18fa4d26daabf8973026e5bcd87e003c0756 | diff --git a/lib/graph_matching/bipartite_graph.rb b/lib/graph_matching/bipartite_graph.rb
index <HASH>..<HASH> 100644
--- a/lib/graph_matching/bipartite_graph.rb
+++ b/lib/graph_matching/bipartite_graph.rb
@@ -15,6 +15,10 @@ module GraphMatching
class BipartiteGraph < Graph
include Explainable
+ def vertices_adjacent_to(vertex, except: [])
+ adjacent_vertices(vertex) - except
+ end
+
# `maximum_cardinality_matching` returns a `Set` of arrays,
# each representing an edge in the matching. The augmenting
# path algorithm is used.
@@ -49,7 +53,7 @@ module GraphMatching
t.add(vi)
predecessors[vi] = start
- adj_u = adjacent_vertices(vi).reject { |vie| vie == start }
+ adj_u = vertices_adjacent_to(vi, except: [start])
if adj_u.empty?
log("Vertex #{vi} has no adjacent vertexes, so we found an augmenting path")
aug_path = [vi, start] | Extracts `vertices_adjacent_to` to improve readability | jaredbeck_graph_matching | train | rb |
964b92ca6b949cfcfc6066cdbd4b805065bf15fa | diff --git a/images/builder/main.go b/images/builder/main.go
index <HASH>..<HASH> 100644
--- a/images/builder/main.go
+++ b/images/builder/main.go
@@ -271,7 +271,7 @@ func runBuildJobs(o options) []error {
log.Println("Running build jobs...")
tagFlags := []string{"--tags", "--always", "--dirty"}
if len(o.tagMatch) > 0 {
- tagFlags = append(tagFlags, "--match "+o.tagMatch)
+ tagFlags = append(tagFlags, fmt.Sprintf(`--match "%s"`, o.tagMatch))
}
tag, err := getVersion(tagFlags)
if err != nil { | Fix parsing of --tag-match image builder flag | kubernetes_test-infra | train | go |
32e4d835ed3bc8799b296d365a5d54a3d6066048 | diff --git a/src/raven.js b/src/raven.js
index <HASH>..<HASH> 100644
--- a/src/raven.js
+++ b/src/raven.js
@@ -637,9 +637,20 @@ Raven.prototype = {
self._lastCapturedEvent = evt;
var elem = evt.target;
+
+ var target;
+
+ // try/catch htmlTreeAsString because it's particularly complicated, and
+ // just accessing the DOM incorrectly can throw an exception in some circumstances.
+ try {
+ target = htmlTreeAsString(elem);
+ } catch (e) {
+ target = '<unknown>';
+ }
+
self.captureBreadcrumb('ui_event', {
type: evtName,
- target: htmlTreeAsString(elem)
+ target: target
});
};
}, | try/catch serializing DOM element targets | getsentry_sentry-javascript | train | js |
772a5bf610c3e1b8dca46efc727964e5c6824c41 | diff --git a/views/index.blade.php b/views/index.blade.php
index <HASH>..<HASH> 100644
--- a/views/index.blade.php
+++ b/views/index.blade.php
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ Admin::title() }}</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | Add charset utf-8
Add charset utf-8 to fix broken characters in js AlertBox | z-song_laravel-admin | train | php |
ab5d2d2a28ed5d4b2ec8b2ef3e4a54176605024d | diff --git a/octohatrack/code_contrib.py b/octohatrack/code_contrib.py
index <HASH>..<HASH> 100644
--- a/octohatrack/code_contrib.py
+++ b/octohatrack/code_contrib.py
@@ -25,6 +25,10 @@ def pri_contributors(repo_name):
"repos/%s/%s?state=all&page=1&per_page=1" % (repo_name, _type), "number"
)
+ # No results for search type
+ if not _count:
+ continue
+
for i in range(1, _count + 1):
uri_stub = "/".join(["repos", repo_name, _type, str(i)]) | Fix usecase where repo has no pulls or issues (e.g. a fork) | LABHR_octohatrack | train | py |
3973d0df276564142cd42a69569e33dc8a78fbe6 | diff --git a/sos/report/plugins/networking.py b/sos/report/plugins/networking.py
index <HASH>..<HASH> 100644
--- a/sos/report/plugins/networking.py
+++ b/sos/report/plugins/networking.py
@@ -147,7 +147,8 @@ class Networking(Plugin):
"ethtool -l " + eth,
"ethtool --phy-statistics " + eth,
"ethtool --show-priv-flags " + eth,
- "ethtool --show-eee " + eth
+ "ethtool --show-eee " + eth,
+ "tc -s filter show dev " + eth
], tags=eth)
# skip EEPROM collection by default, as it might hang or | [networking] collect tc filters per each device
Collect "tc -s filter show dev <DEV>" for each device.
Resolves: #<I> | sosreport_sos | train | py |
76391c2f0aad2eb90f195ec3afcfbaaa69b6d533 | diff --git a/lib/instrumental.js b/lib/instrumental.js
index <HASH>..<HASH> 100644
--- a/lib/instrumental.js
+++ b/lib/instrumental.js
@@ -252,8 +252,8 @@ exports.init = function instrumental_init(startup_time, config, events) {
}
keepMetric = function(metric){
metricName = metric.split(" ")[1];
- return (!metricFiltersExclude.some(function(filter) { return filter.test(metricName); }) &&
- (metricFiltersInclude.length == 0 || metricFiltersInclude.some(function(filter) { return filter.test(metricName); })));
+ return (!metricFiltersExclude.some(function(filter) { return metricName.match(filter); }) &&
+ (metricFiltersInclude.length == 0 || metricFiltersInclude.some(function(filter) { return metricName.match(filter); })));
};
if(typeof(config.instrumental.metricPrefix) !== 'undefined' && | revert from regex.test to string.match for compatibility with older javascript | Instrumental_statsd-instrumental-backend | train | js |
dfeaaf4db43a8bd484219f4efc3b6bf800c6a4a1 | diff --git a/apptentive/src/main/java/com/apptentive/android/sdk/model/JsonPayload.java b/apptentive/src/main/java/com/apptentive/android/sdk/model/JsonPayload.java
index <HASH>..<HASH> 100644
--- a/apptentive/src/main/java/com/apptentive/android/sdk/model/JsonPayload.java
+++ b/apptentive/src/main/java/com/apptentive/android/sdk/model/JsonPayload.java
@@ -39,7 +39,7 @@ public abstract class JsonPayload extends Payload {
JSONObject wrapper = new JSONObject();
wrapper.put("token", token);
wrapper.put("payload", jsonObject);
- byte[] bytes = jsonObject.toString().getBytes();
+ byte[] bytes = wrapper.toString().getBytes();
Encryptor encryptor = new Encryptor(encryptionKey);
ApptentiveLog.v(ApptentiveLogTag.PAYLOADS, "Getting data for encrypted payload.");
return encryptor.encrypt(bytes); | Encrypt wrapper, not original payload. | apptentive_apptentive-android | train | java |
6e24de0e9fc1a5f4ce18db386eea566ba642742f | diff --git a/holoviews/core/layout.py b/holoviews/core/layout.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/layout.py
+++ b/holoviews/core/layout.py
@@ -172,8 +172,7 @@ class NdLayout(UniformNdMapping):
value = param.String(default='NdLayout')
data_type = (ViewableElement, AdjointLayout, UniformNdMapping)
-
- def __init__(self, initial_items, **params):
+ def __init__(self, initial_items=None, **params):
self._max_cols = 4
self._style = None
if isinstance(initial_items, list): | Allowed empty NdLayout | pyviz_holoviews | train | py |
ea3630d4966ce42f58e303500e90e5addeb21d4d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -160,7 +160,7 @@ class PyTestCommand(test):
setup(
name='openhtf',
- version='1.0.3',
+ version='1.1.0',
description='OpenHTF, the open hardware testing framework.',
author='John Hawley',
author_email='madsci@google.com', | Update version to <I> (#<I>) | google_openhtf | train | py |
e90ced786773003e78d2b5467deb328770f028a3 | diff --git a/slacker_cli/__init__.py b/slacker_cli/__init__.py
index <HASH>..<HASH> 100755
--- a/slacker_cli/__init__.py
+++ b/slacker_cli/__init__.py
@@ -64,13 +64,12 @@ def get_channel_id(token, channel_name):
return get_item_id_by_name(channels, channel_name)
-def upload_file(token, channel, file_name):
+def upload_file(token, channel_name, file_name):
""" upload file to a channel """
slack = Slacker(token)
- channel_id = get_channel_id(token, channel)
- slack.files.upload(file_name, channels=channel_id)
+ slack.files.upload(file_name, channels=channel_name)
def args_priority(args, environ):
@@ -153,8 +152,11 @@ def main():
post_message(token, channel, message, name, as_user, icon,
as_slackbot, team)
- if token and channel and file_name:
- upload_file(token, channel, file_name)
+ if token and file_name:
+ if user:
+ upload_file(token, '@' + user, file_name)
+ elif channel:
+ upload_file(token, '#' + channel, file_name)
if __name__ == '__main__': | send files to user with -u #<I> | juanpabloaj_slacker-cli | train | py |
00764ae6d2a1606e48eaedd0929469ce46bd217d | diff --git a/tests/Helpers.php b/tests/Helpers.php
index <HASH>..<HASH> 100644
--- a/tests/Helpers.php
+++ b/tests/Helpers.php
@@ -21,7 +21,8 @@
class Helpers extends PHPUnit_Framework_TestCase {
protected function _assertEqualsXmlFile(hemio\html\Interface_\HtmlCode $objHtml, $strFile) {
- $expected = DOMDocument::load(__DIR__ . DIRECTORY_SEPARATOR . $strFile);
+ $expected = DOMDocument;
+ $expected->load(__DIR__ . DIRECTORY_SEPARATOR . $strFile);
$actual = new DOMDocument;
$actualString = (string) $objHtml;
$actual->loadXML($actualString); | Fixes wrong static call to DOM load | hemio-ev_html | train | php |
3be40fc1cc21056258974b2915d33af02e218a59 | diff --git a/app_generators/ahn/templates/config/startup.rb b/app_generators/ahn/templates/config/startup.rb
index <HASH>..<HASH> 100644
--- a/app_generators/ahn/templates/config/startup.rb
+++ b/app_generators/ahn/templates/config/startup.rb
@@ -10,8 +10,10 @@ Adhearsion::Configuration.configure do |config|
# By default Asterisk is enabled with the default settings
config.enable_asterisk
+ # config.asterisk.enable_ami :host => "127.0.0.1", :username => "admin", :password => "password"
+
+ # config.enable_drb
- #
# config.asterisk.speech_engine = :cepstral
# Configure FreeSwitch | Added comments to startup.rb to help newbies use the AMI and DRb stuff for the first time.
git-svn-id: <URL> | adhearsion_adhearsion | train | rb |
edf3d702b9126380468f6436f1bac16aa4e2bb4a | diff --git a/ijroi/ijroi.py b/ijroi/ijroi.py
index <HASH>..<HASH> 100644
--- a/ijroi/ijroi.py
+++ b/ijroi/ijroi.py
@@ -89,14 +89,16 @@ def read_roi(fileobj):
if options & SUB_PIXEL_RESOLUTION:
getc = getfloat
points = np.empty((n_coordinates, 2), dtype=np.float32)
+ fileobj.seek(4*n_coordinates,1)
else:
getc = get16
points = np.empty((n_coordinates, 2), dtype=np.int16)
points[:,1] = [getc() for i in range(n_coordinates)]
points[:,0] = [getc() for i in range(n_coordinates)]
- points[:,1] += left
- points[:,0] += top
- points -= 1
+ if options & SUB_PIXEL_RESOLUTION == 0:
+ points[:,1] += left
+ points[:,0] += top
+ points -= 1
return points
def read_roi_zip(fname): | Handle freehand selections with subpixel resolution
Skip over the integer data when we have floating point data later in the
file. The floating point values don't need to be adjusted by the
bounding box. | tdsmith_ijroi | train | py |
60fe81cf9ce9e3130322405218082dee25f7b02d | diff --git a/tests/HTMLTests.php b/tests/HTMLTests.php
index <HASH>..<HASH> 100644
--- a/tests/HTMLTests.php
+++ b/tests/HTMLTests.php
@@ -100,7 +100,10 @@ class HTMLTests extends \PHPUnit_Framework_TestCase
public function testHeaderTable()
{
$document = $this->parseHTML('table2.rst');
- echo "$document";
+
+ $this->assertEquals(2, substr_count($document, '<th>'));
+ $this->assertEquals(2, substr_count($document, '</th>'));
+ $this->assertNotContains('==', $document);
}
/** | Fixing tests for table header (see #<I>) | doctrine_rst-parser | train | php |
9694ab324de883496062d00405ae5b69c2120210 | diff --git a/war/resources/scripts/hudson-behavior.js b/war/resources/scripts/hudson-behavior.js
index <HASH>..<HASH> 100644
--- a/war/resources/scripts/hudson-behavior.js
+++ b/war/resources/scripts/hudson-behavior.js
@@ -285,7 +285,7 @@ function refreshPart(id,url) {
window.setTimeout(function() {
new Ajax.Request(url, {
method: "post",
- onComplete: function(rsp, _) {
+ onSuccess: function(rsp) {
var hist = $(id);
var p = hist.parentNode;
var next = hist.nextSibling; | onComplete would trigger even if the request fails.
git-svn-id: <URL> | jenkinsci_jenkins | train | js |
e3675c33745ec00ab863f2f568024eb529eed7d0 | diff --git a/lib/sensu-plugin.rb b/lib/sensu-plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/sensu-plugin.rb
+++ b/lib/sensu-plugin.rb
@@ -1,6 +1,6 @@
module Sensu
module Plugin
- VERSION = "0.1.3"
+ VERSION = "0.1.4.beta"
EXIT_CODES = {
'OK' => 0,
'WARNING' => 1, | [beta] cut a <I> beta | sensu-plugins_sensu-plugin | train | rb |
516b840842e8054c47e529feaabb456c40c343e9 | diff --git a/lib/instrumentation/trace.js b/lib/instrumentation/trace.js
index <HASH>..<HASH> 100644
--- a/lib/instrumentation/trace.js
+++ b/lib/instrumentation/trace.js
@@ -22,12 +22,23 @@ Trace.prototype.end = function () {
}
Trace.prototype.duration = function () {
- if (!this.ended) throw new Error('Trace is not ended')
+ if (!this.ended) {
+ // TODO: Use the opbeat logger
+ console.error('Trying to call trace.duration() on un-ended Trace!')
+ return null
+ }
+
var ns = this._diff[0] * 1e9 + this._diff[1]
return ns / 1e6
}
Trace.prototype.startTime = function () {
+ if (!this.ended || !this.transaction.ended) {
+ // TODO: Use the opbeat logger
+ console.error('Trying to call trace.startTime() for un-ended Trace/Transaction!')
+ return null
+ }
+
var parent = this._parent()
if (!parent) return 0
var start = parent._hrtime
@@ -36,6 +47,12 @@ Trace.prototype.startTime = function () {
}
Trace.prototype.ancestors = function () {
+ if (!this.ended || !this.transaction.ended) {
+ // TODO: Use the opbeat logger
+ console.error('Trying to call trace.ancestors() for un-ended Trace/Transaction!')
+ return null
+ }
+
var parent = this._parent()
if (!parent) return []
return [parent.signature].concat(parent.ancestors()) | Add guards if trying to get data from non-ended traces | opbeat_opbeat-node | train | js |
368b8b81a37fcf761a716134055d92be3cb87412 | diff --git a/src/Http/Request.php b/src/Http/Request.php
index <HASH>..<HASH> 100644
--- a/src/Http/Request.php
+++ b/src/Http/Request.php
@@ -11,7 +11,7 @@ use Lead\Net\Scheme;
* Facilitates HTTP request creation by assembling connection and path info, `GET` and `POST` data,
* and authentication credentials in a single, stateful object.
*/
-class Request extends \Lead\Net\Http\Message
+class Request extends \Lead\Net\Http\Message implements \Psr\Http\Message\RequestInterface
{
use Psr7\MessageTrait, Psr7\RequestTrait;
diff --git a/src/Http/Response.php b/src/Http/Response.php
index <HASH>..<HASH> 100644
--- a/src/Http/Response.php
+++ b/src/Http/Response.php
@@ -7,7 +7,7 @@ use Lead\Set\Set;
/**
* Parses and stores the status, headers and body of an HTTP response.
*/
-class Response extends \Lead\Net\Http\Message
+class Response extends \Lead\Net\Http\Message implements \Psr\Http\Message\ResponseInterface
{
use Psr7\MessageTrait, Psr7\ResponseTrait; | Adds missing implements to be PSR-7 compatible. | crysalead_net | train | php,php |
2ba6be71e225d39e1acb0fce52f4b196b95be802 | diff --git a/gwpy/detector/units.py b/gwpy/detector/units.py
index <HASH>..<HASH> 100644
--- a/gwpy/detector/units.py
+++ b/gwpy/detector/units.py
@@ -158,7 +158,7 @@ units.add_enabled_units(units.imperial)
# 1) alternative names
registry = units.get_current_unit_registry().registry
for unit, aliases in [
- (units.Unit('count'), ('counts')),
+ (units.Unit('ct'), ('counts',)),
(units.Unit('Celsius'), ('Degrees_C', 'DegC')),
(units.Unit('Fahrenheit'), ('Degrees_F', 'DegF')),
]: | gwpy.detector: fixed bug in unit aliasing
need commas to make a tuple! | gwpy_gwpy | train | py |
466dcdfcf6386718093fcf8fcc2d2f57fb95e06e | diff --git a/plugin/pkg/auth/authorizer/node/graph.go b/plugin/pkg/auth/authorizer/node/graph.go
index <HASH>..<HASH> 100644
--- a/plugin/pkg/auth/authorizer/node/graph.go
+++ b/plugin/pkg/auth/authorizer/node/graph.go
@@ -22,6 +22,7 @@ import (
corev1 "k8s.io/api/core/v1"
utilfeature "k8s.io/apiserver/pkg/util/feature"
+ "k8s.io/component-helpers/storage/ephemeral"
pvutil "k8s.io/kubernetes/pkg/api/v1/persistentvolume"
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
"k8s.io/kubernetes/pkg/features"
@@ -386,7 +387,7 @@ func (g *Graph) AddPod(pod *corev1.Pod) {
if v.PersistentVolumeClaim != nil {
claimName = v.PersistentVolumeClaim.ClaimName
} else if v.Ephemeral != nil && utilfeature.DefaultFeatureGate.Enabled(features.GenericEphemeralVolume) {
- claimName = pod.Name + "-" + v.Name
+ claimName = ephemeral.VolumeClaimName(pod, &v)
}
if claimName != "" {
pvcVertex := g.getOrCreateVertex_locked(pvcVertexType, pod.Namespace, claimName) | auth: use generic ephemeral volume helper functions
The name concatenation and ownership check were originally considered small
enough to not warrant dedicated functions, but the intent of the code is more
readable with them. | kubernetes_kubernetes | train | go |
1f445ac790493189120d8d04c234d87ee72154aa | diff --git a/src/Exscript/util/sigintcatcher.py b/src/Exscript/util/sigintcatcher.py
index <HASH>..<HASH> 100644
--- a/src/Exscript/util/sigintcatcher.py
+++ b/src/Exscript/util/sigintcatcher.py
@@ -20,12 +20,13 @@ is the following statement::
import Exscript.util.sigintcatcher
-Be warned that this way may of importing it breaks on some
-systems, because a fork during an import may cause the following error:
+Be warned that this way of importing breaks on some systems, because a
+fork during an import may cause the following error::
RuntimeError: not holding the import lock
-So in general it is recommended to use the class directly.
+So in general it is recommended to use the L{sigint.SigIntWatcher()}
+class directly.
"""
from Exscript.util.sigint import SigIntWatcher
_watcher = SigIntWatcher() | minor API doc fix in Exscript.util.sigintcatcher. | knipknap_exscript | train | py |
44177fab534f26c0050e5314b0b20c20d81b61c5 | diff --git a/lib/algoliasearch-rails.rb b/lib/algoliasearch-rails.rb
index <HASH>..<HASH> 100644
--- a/lib/algoliasearch-rails.rb
+++ b/lib/algoliasearch-rails.rb
@@ -743,6 +743,7 @@ module AlgoliaSearch
return object.send(:algolia_dirty?) if (object.respond_to?(:algolia_dirty?))
# Loop over each index to see if a attribute used in records has changed
algolia_configurations.each do |options, settings|
+ next if algolia_indexing_disabled?(options)
next if options[:slave] || options[:replica]
return true if algolia_object_id_changed?(object, options)
settings.get_attribute_names(object).each do |k| | Do not check attributes for disabled indexes
If indexing is disabled, do not get all of the changed attributes | algolia_algoliasearch-rails | train | rb |
04c4d6dc66bf21df96089dc98b2718c07984e7aa | diff --git a/platform/html5/html.js b/platform/html5/html.js
index <HASH>..<HASH> 100644
--- a/platform/html5/html.js
+++ b/platform/html5/html.js
@@ -32,12 +32,32 @@ StyleCachePrototype.update = function(element, name) {
}
}
+StyleCachePrototype._apply = function(entry) {
+ //fixme: make updateStyle incremental
+ entry.element.updateStyle()
+}
+
StyleCachePrototype.apply = function(element) {
+ var cache = this._cache
+ var id = element._uniqueId
+
+ var entry = cache[id]
+ if (entry === undefined)
+ return
+
+ delete cache[id]
+ this._apply(entry)
}
StyleCachePrototype.applyAll = function() {
+ var cache = this._cache
+ this._cache = {}
+ for(var id in cache) {
+ var entry = cache[id]
+ this._apply(entry)
+ }
}
var StyleClassifier = function (prefix) {
@@ -607,6 +627,7 @@ exports.run = function(ctx, onloadCallback) {
exports.tick = function(ctx) {
//log('tick')
+ //ctx._styleCache.applyAll()
}
var Modernizr = window.Modernizr | added _apply to apply single entry style, added purge style cache from tick (commented for now) | pureqml_qmlcore | train | js |
f5a38ccd818f9ab4c7b3596cdd9bc8131f1b580f | diff --git a/forms_builder/forms/forms.py b/forms_builder/forms/forms.py
index <HASH>..<HASH> 100644
--- a/forms_builder/forms/forms.py
+++ b/forms_builder/forms/forms.py
@@ -47,6 +47,11 @@ class FormForForm(forms.ModelForm):
field_args["widget"] = getattr(import_module(module), widget)
self.initial[field_key] = field.default
self.fields[field_key] = field_class(**field_args)
+ # Add identifying CSS classes to the field.
+ css_class = field_class_name.lower()
+ if field.required:
+ css_class += " required"
+ self.fields[field_key].widget.attrs["class"] = css_class
def save(self, **kwargs):
""" | Add CSS classes to form fields using field type and required. | stephenmcd_django-forms-builder | train | py |
52c02c7927dff68b3e5efdd2ca5857d2e2fcfeb3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,7 @@
var P_PROTO = "___proto_polyfill_proto___";
var P_FUNCT = "___proto_polyfill_funct___";
var P_VALUE = "___proto_polyfill_value___";
- var IS_SYMBOL = /^Symbol\(/;
+ var SYMBOL = "Symbol(";
var getPrototypeOf = O["getPrototypeOf"];
var getOwnPropertyNames = O["getOwnPropertyNames"];
@@ -76,7 +76,7 @@
n = 0;
for (; n < names.length; n++) {
name = names[n];
- if (name && name !== O_PROTO && name !== P_PROTO && name !== P_FUNCT && name !== P_VALUE && !IS_SYMBOL.test(name) && !dest.hasOwnProperty(name)) {
+ if (name && name !== O_PROTO && name !== P_PROTO && name !== P_FUNCT && name !== P_VALUE && name.indexOf(SYMBOL) !== 0 && !dest.hasOwnProperty(name)) {
setProperty(dest, source, name);
}
} | replace regex with indexOf
for speed | webcarrot_proto-polyfill | train | js |
8dfca98f5d480cd5510b1a332e3c30a2194f291f | diff --git a/lib/jquery.raty.js b/lib/jquery.raty.js
index <HASH>..<HASH> 100644
--- a/lib/jquery.raty.js
+++ b/lib/jquery.raty.js
@@ -194,7 +194,7 @@
}
});
}, _callback: function(options) {
- for (i in options) {
+ for (var i in options) {
if (typeof this.opt[options[i]] === 'function') {
this.opt[options[i]] = this.opt[options[i]].call(this);
} | fixing usage of undefined variable in _callback function | wbotelhos_raty | train | js |
fd24a14eb66dd13e33768437ac7c69a52c5a40bb | diff --git a/src/androidTest/java/com/couchbase/lite/support/BatcherTest.java b/src/androidTest/java/com/couchbase/lite/support/BatcherTest.java
index <HASH>..<HASH> 100644
--- a/src/androidTest/java/com/couchbase/lite/support/BatcherTest.java
+++ b/src/androidTest/java/com/couchbase/lite/support/BatcherTest.java
@@ -47,7 +47,7 @@ public class BatcherTest extends LiteTestCase {
}
batcher.queueObjects(objectsToQueue);
- boolean didNotTimeOut = doneSignal.await(5, TimeUnit.SECONDS);
+ boolean didNotTimeOut = doneSignal.await(35, TimeUnit.SECONDS);
assertTrue(didNotTimeOut);
} | Issue #<I> - extend the allowed time for this test to run
Previously this test was executing very quickly, because it was essentially processing everything at once, which is exactly the core issue of issue #<I>.
By expecting the test to complete so quickly, we are advocating mis-behavior. Change this to expect the batcher to stream things out more over time, and therefore allow more time for the test to complete.
<URL> | couchbase_couchbase-lite-android | train | java |
8272d04163202e959e6eaa0ca59f4fab9aeba653 | diff --git a/openquake/hazardlib/gsim/chiou_youngs_2014.py b/openquake/hazardlib/gsim/chiou_youngs_2014.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/gsim/chiou_youngs_2014.py
+++ b/openquake/hazardlib/gsim/chiou_youngs_2014.py
@@ -106,7 +106,7 @@ class ChiouYoungs2014(GMPE):
eta = epsilon = 0.
# deep soil correction
- no_correction = sites.z1pt0 <= 0
+ no_correction = getattr(sites, 'z1pt0', 0) <= 0
deep_s = C['phi5'] * (1.0 - np.exp(-1. * centered_z1pt0 / C['phi6']))
deep_s[no_correction] = 0 | Small fix to ChiouYoungs<I> for missing z1pt0 | gem_oq-engine | train | py |
1b0c0eb11567feb979e38f6a883c49c46dcab2cb | diff --git a/safe/gui/tools/wizard/wizard_strings.py b/safe/gui/tools/wizard/wizard_strings.py
index <HASH>..<HASH> 100644
--- a/safe/gui/tools/wizard/wizard_strings.py
+++ b/safe/gui/tools/wizard/wizard_strings.py
@@ -142,7 +142,8 @@ classify_vector_for_postprocessor_question = tr(
'aggregation postprocessor will need to know mapping of the attribute '
'values to known categories. Please drag unique values from the list '
'on the left into the panel on the right and place them in the '
- 'appropriate categories.'
+ 'appropriate categories. Un-mapped values will go automatically in the '
+ '\'Other\' group on runtime.'
) # (subcategory, category, field)
select_function_constraints2_question = tr(
'You selected <b>%s</b> hazard and <b>%s</b> exposure. Now, select the ' | update wizard strings about "other" class | inasafe_inasafe | train | py |
b583a6e1fc46898774e9ffe015302305d8e9eb9d | diff --git a/h2o-py/h2o/frame.py b/h2o-py/h2o/frame.py
index <HASH>..<HASH> 100644
--- a/h2o-py/h2o/frame.py
+++ b/h2o-py/h2o/frame.py
@@ -2537,10 +2537,16 @@ class H2OFrame(object):
plt.ylabel("Frequency")
plt.title("Histogram of %s" % self.names[0])
- try:
- plt.bar(left=lefts, width=widths, height=counts, bottom=0)
- except TypeError:
- plt.bar(x=lefts, height=counts, width=widths, bottom=0)
+ # matplotlib deprecated "left" arg in 2.1.0 and removed in 3.0.0
+ version_number = matplotlib.__version__
+ major = version_number.split('.')[0]
+ minor = version_number.split('.')[1]
+ major = int(major)
+ minor = int(minor)
+ if major == 2 and minor >= 1 or major >= 3:
+ plt.bar(x=lefts, width=widths, height=counts, bottom=0)
+ else:
+ plt.bar(left=lefts, height=counts, width=widths, bottom=0)
if not server:
plt.show() | PUBDEV-<I>: updated catch to check matplotlib version number and apply arguments in plt.bar() that work for that version | h2oai_h2o-3 | train | py |
2ec0526fe1475ff5423a679d0d275089636c6c72 | diff --git a/geo-analyzer/src/main/java/au/gov/amsa/geo/distance/DistanceTravelledCalculator.java b/geo-analyzer/src/main/java/au/gov/amsa/geo/distance/DistanceTravelledCalculator.java
index <HASH>..<HASH> 100644
--- a/geo-analyzer/src/main/java/au/gov/amsa/geo/distance/DistanceTravelledCalculator.java
+++ b/geo-analyzer/src/main/java/au/gov/amsa/geo/distance/DistanceTravelledCalculator.java
@@ -70,7 +70,7 @@ public class DistanceTravelledCalculator {
.buffer(Math.max(
1,
(int) Math.round(Math.ceil(numFiles
- / Runtime.getRuntime().availableProcessors())) - 1))
+ / Runtime.getRuntime().availableProcessors()))))
.flatMap(fileList ->
// extract fixes from each file
Observable | use all available processors for distance travelled calculation | amsa-code_risky | train | java |
9361775687cc58f4628ed5350aca93dd4608975f | diff --git a/utool/util_alg.py b/utool/util_alg.py
index <HASH>..<HASH> 100755
--- a/utool/util_alg.py
+++ b/utool/util_alg.py
@@ -448,6 +448,12 @@ def deg_to_rad(degree):
return (degree / 360.0) * tau
+def rad_to_deg(radians):
+ tau = 2 * np.pi
+ radians %= tau
+ return (radians / tau) * 360.0
+
+
def enumerate_primes(max_prime=4100):
primes = [num for num in range(2, max_prime) if is_prime(num)]
return primes | Added th compliment to deg_to_rad (rad_to_deg) | Erotemic_utool | train | py |
ab1eb4e03a9a8c5183e340ea2e33bdfe4d196f17 | diff --git a/config/global.ini.php b/config/global.ini.php
index <HASH>..<HASH> 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -517,7 +517,6 @@ Plugins[] = ExamplePlugin
Plugins[] = ExampleRssWidget
Plugins[] = Provider
Plugins[] = Feedback
-Plugins[] = PleineLune
Plugins[] = Login
Plugins[] = UsersManager | PleineLune should not be loaded by default. Should be loaded only in config.ini.php. | matomo-org_matomo | train | php |
92e662087fea3ffa134ba117478e46122ef835fd | diff --git a/neutrino.go b/neutrino.go
index <HASH>..<HASH> 100644
--- a/neutrino.go
+++ b/neutrino.go
@@ -1251,16 +1251,14 @@ func (s *ChainService) handleDonePeerMsg(state *peerState, sp *ServerPeer) {
list = state.outboundPeers
}
if _, ok := list[sp.ID()]; ok {
- if sp.VersionKnown() {
- state.outboundGroups[addrmgr.GroupKey(sp.NA())]--
- }
+ state.outboundGroups[addrmgr.GroupKey(sp.NA())]--
+ delete(list, sp.ID())
if sp.persistent {
s.connManager.Disconnect(sp.connReq.ID())
} else {
s.connManager.Remove(sp.connReq.ID())
go s.connManager.NewConnReq()
}
- delete(list, sp.ID())
log.Debugf("Removed peer %s", sp)
return
} | neutrino: remove redundant VersionKnown check in handleDonePeerMsg
We assume that the outbound groups are incremented if the peer was added
in the first place, which we check above. Because of this, checking for
whether we know their version is redundant. | lightninglabs_neutrino | train | go |
0248e1dbfac4deab6b22fd59ec88e7dcd14b4d90 | diff --git a/Domain/Acl.php b/Domain/Acl.php
index <HASH>..<HASH> 100644
--- a/Domain/Acl.php
+++ b/Domain/Acl.php
@@ -1,4 +1,5 @@
<?php
+
/*
* This file is part of the Symfony package.
* | CS: Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline | symfony_security-acl | train | php |
0f34311ea12e2e45dd94ba0efb0c09b7412f1c26 | diff --git a/components/ngDroplet.js b/components/ngDroplet.js
index <HASH>..<HASH> 100644
--- a/components/ngDroplet.js
+++ b/components/ngDroplet.js
@@ -1042,7 +1042,11 @@
// Subscribe to the "change" event.
element.bind('change', function onChange() {
- scope.interface.traverseFiles(element[0].files);
+
+ scope.$apply(function apply() {
+ scope.interface.traverseFiles(element[0].files);
+ });
+
});
} | Added apply for INPUT elements | Wildhoney_ngDroplet | train | js |
9d4a473b756b3133201b455b3ffb0846fe69d6e5 | diff --git a/invoiceitem.go b/invoiceitem.go
index <HASH>..<HASH> 100644
--- a/invoiceitem.go
+++ b/invoiceitem.go
@@ -31,6 +31,8 @@ type InvoiceItem struct {
Currency Currency `json:"currency"`
Customer *Customer `json:"customer"`
Date int64 `json:"date"`
+ Period *Period `json:"period"`
+ Plan *Plan `json:"plan"`
Proration bool `json:"proration"`
Desc string `json:"description"`
Invoice *Invoice `json:"invoice"`
@@ -38,6 +40,7 @@ type InvoiceItem struct {
Sub string `json:"subscription"`
Discountable bool `json:"discountable"`
Deleted bool `json:"deleted"`
+ Quantity int64 `json:"quantity"`
}
// InvoiceItemList is a list of invoice items as retrieved from a list endpoint. | adding InvoiceItem.Quantity, InvoiceItem.Period.Start/End, InvoiceItem.Plan | stripe_stripe-go | train | go |
1d8c73954c2bb3bd562c9b040f4594a3034630c2 | diff --git a/test/test_transactions.py b/test/test_transactions.py
index <HASH>..<HASH> 100644
--- a/test/test_transactions.py
+++ b/test/test_transactions.py
@@ -512,9 +512,11 @@ def create_test(scenario_def, test):
# Assert final state is expected.
expected_c = test['outcome'].get('collection')
if expected_c is not None:
- # Read from the primary to ensure causal consistency.
+ # Read from the primary with local read concern to ensure causal
+ # consistency.
primary_coll = collection.with_options(
- read_preference=ReadPreference.PRIMARY)
+ read_preference=ReadPreference.PRIMARY,
+ read_concern=ReadConcern('local'))
self.assertEqual(list(primary_coll.find()), expected_c['data'])
return run_scenario | PYTHON-<I> Fix transaction test runner to read the latest data from the primary | mongodb_mongo-python-driver | train | py |
02ad71e1a37e4343f9dcd67924cbcda4b2ec7757 | diff --git a/src/database/seeds/ScheduleSeeder.php b/src/database/seeds/ScheduleSeeder.php
index <HASH>..<HASH> 100644
--- a/src/database/seeds/ScheduleSeeder.php
+++ b/src/database/seeds/ScheduleSeeder.php
@@ -77,9 +77,9 @@ class ScheduleSeeder extends Seeder
'ping_before' => null,
'ping_after' => null
],
- [ // Clear Expired Commands | Daily at 12am
+ [ // Clear Expired Commands | Every 6 hours
'command' => 'seat:queue:clear-expired',
- 'expression' => '0 0 * * * *',
+ 'expression' => '0 */6 * * *',
'allow_overlap' => false,
'allow_maintenance' => false,
'ping_before' => null, | Seed the expired job time to run every 6 hours | eveseat_services | train | php |
10fd0112b4ebf6c7101542b4d5b05eef7462f893 | diff --git a/satpy/composites/__init__.py b/satpy/composites/__init__.py
index <HASH>..<HASH> 100644
--- a/satpy/composites/__init__.py
+++ b/satpy/composites/__init__.py
@@ -413,12 +413,9 @@ class PSPRayleighReflectance(CompositeBase):
except KeyError:
LOG.warning("Could not get the reflectance correction using band name: %s", vis.attrs['name'])
LOG.warning("Will try use the wavelength, however, this may be ambiguous!")
- refl_cor_band = corrector.get_reflectance(sunz.load().values,
- satz.load().values,
- ssadiff.load().values,
- vis.attrs['wavelength'][1],
- red.values)
-
+ refl_cor_band = da.map_blocks(corrector.get_reflectance, sunz.data,
+ satz.data, ssadiff.data, vis.attrs['wavelength'][1],
+ red.data)
proj = vis - refl_cor_band
proj.attrs = vis.attrs
self.apply_modifier_info(vis, proj) | Daskify rayleigh, case of missing band name | pytroll_satpy | train | py |
bb3d7d47c2c61380d3bee4b0999f6afb2043d99c | diff --git a/src/naarad/metrics/metric.py b/src/naarad/metrics/metric.py
index <HASH>..<HASH> 100644
--- a/src/naarad/metrics/metric.py
+++ b/src/naarad/metrics/metric.py
@@ -292,7 +292,7 @@ class Metric(object):
items = sub_metric.split('.')
if sub_metric in self.important_sub_metrics:
return True
- if items[len(items)-1] in self.important_sub_metrics:
+ if items[-1] in self.important_sub_metrics:
return True
return False | Extend Diff to support URL based CDF csv file paths, also Fix issue <I>: cdf not plotted for sar important metrics | linkedin_naarad | train | py |
805176792d583f1eee8bd85c299fb4d9f8bf7dda | diff --git a/snet_cli/utils_proto.py b/snet_cli/utils_proto.py
index <HASH>..<HASH> 100644
--- a/snet_cli/utils_proto.py
+++ b/snet_cli/utils_proto.py
@@ -57,9 +57,10 @@ def _import_protobuf_from_file(grpc_pyfile, method_name, service_name = None):
service_descriptor = getattr(pb2, "DESCRIPTOR").services_by_name[service_name]
for method in service_descriptor.methods:
if(method.name == method_name):
- request_class = getattr(pb2, method.input_type.name)
- response_class = getattr(pb2, method.output_type.name)
+ request_class = method.input_type._concrete_class
+ response_class = method.output_type._concrete_class
stub_class = getattr(pb2_grpc, "%sStub"%service_name)
+
found_services.append(service_name)
if (len(found_services) == 0):
return False, None | Use the class instead of assuming it exists in the same module - closes #<I> | singnet_snet-cli | train | py |
4b0a68729db82c6559f1e7f53abde216aed791c3 | diff --git a/test/common.js b/test/common.js
index <HASH>..<HASH> 100644
--- a/test/common.js
+++ b/test/common.js
@@ -81,19 +81,24 @@ module.exports.createTemplate = function() {
return jade.compile(template);
};
+var ClientFlags = require('../lib/constants/client.js');
+
module.exports.createServer = function(onListening, handler) {
var server = require('../index.js').createServer();
server.on('connection', function(conn) {
conn.on('error', function() {
// we are here when client drops connection
});
+ var flags = 0xffffff;
+ flags = flags ^ ClientFlags.COMPRESS;
+
conn.serverHandshake({
protocolVersion: 10,
serverVersion: 'node.js rocks',
connectionId: 1234,
statusFlags: 2,
characterSet: 8,
- capabilityFlags: 0xffffff
+ capabilityFlags: flags
});
if (handler)
handler(conn); | don't set COMPRESS flag in the server | sidorares_node-mysql2 | train | js |
f34ca757eaa155944faf40bd47a6f450baaf8eca | diff --git a/nodeconductor/iaas/models.py b/nodeconductor/iaas/models.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/iaas/models.py
+++ b/nodeconductor/iaas/models.py
@@ -375,8 +375,25 @@ class Instance(core_models.UuidMixin,
monthly_fee=template_license.monthly_fee,
)
+ def _copy_ssh_public_key_attributes(self):
+ self.ssh_public_key_name = self.ssh_public_key.name
+ self.ssh_public_key_fingerprint = self.ssh_public_key.fingerprint
+
+ def _copy_flavor_attributes(self):
+ self.system_volume_size = self.flavor.disk
+ self.cores = self.flavor.cores
+ self.ram = self.flavor.ram
+ self.cloud = self.flavor.cloud
+
+ def _copy_template_attributes(self):
+ self.agreed_sla = self.template.sla_level
+
def save(self, *args, **kwargs):
created = self.pk is None
+ if created:
+ self._copy_template_attributes()
+ self._copy_flavor_attributes()
+ self._copy_ssh_public_key_attributes()
super(Instance, self).save(*args, **kwargs)
if created:
self._init_instance_licenses() | copied fields initialization added to Instance model (nc-<I>) | opennode_waldur-core | train | py |
b7e3c8e1f387e4c0843371971317ca7972d8aeb5 | diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/redirection.rb
+++ b/actionpack/lib/action_dispatch/routing/redirection.rb
@@ -68,8 +68,8 @@ module ActionDispatch
# return value.
#
# match 'jokes/:number', :to => redirect { |params, request|
- # path = (params[:number].to_i.even? ? "/wheres-the-beef" : "/i-love-lamp")
- # "http://#{request.host_with_port}#{path}"
+ # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp")
+ # "http://#{request.host_with_port}/#{path}"
# }
#
# Note that the `do end` syntax for the redirect block wouldn't work, as Ruby would pass | let's keep the slash in the return value instead of the path variable [ci skip] | rails_rails | train | rb |
0d2904f7b459f84cbf6eb91c2072b322671b145d | diff --git a/ariba/mic_plotter.py b/ariba/mic_plotter.py
index <HASH>..<HASH> 100644
--- a/ariba/mic_plotter.py
+++ b/ariba/mic_plotter.py
@@ -535,7 +535,7 @@ class MicPlotter:
corrected_p = min(1, len(output) * x[4])
corrected_significant = 'yes' if corrected_p < p_cutoff else 'no'
corrected_effect_size = scipy.stats.norm.ppf(corrected_p) / math.sqrt(x[2] + x[3])
- print(*x, corrected_p, corrected_significant, corrected_effect_size, sep='\t', file=f)
+ print('\t'.join([str(z) for z in x]), corrected_p, corrected_significant, corrected_effect_size, sep='\t', file=f)
def _make_plot(self, mic_data, top_plot_data, all_mutations, mut_combinations): | fix print to work with python <I> | sanger-pathogens_ariba | train | py |
e9b2277ce43b947f79f912b59777b09e2c1a2db3 | diff --git a/lib/instana/version.rb b/lib/instana/version.rb
index <HASH>..<HASH> 100644
--- a/lib/instana/version.rb
+++ b/lib/instana/version.rb
@@ -1,4 +1,4 @@
module Instana
- VERSION = "1.11.0"
+ VERSION = "1.11.1"
VERSION_FULL = "instana-#{VERSION}"
end | Bump gem version to <I> | instana_ruby-sensor | train | rb |
9a5ec77d48ef588629872130c729e9722518dc53 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@
from setuptools import setup
setup(name='servicemanager',
+ python_requires='>2.7.13',
version='1.2.0',
description='A python tool to manage developing and testing with lots of microservices',
url='https://github.com/hmrc/service-manager', | Update setup.py
Set the minimum python version | hmrc_service-manager | train | py |
02a20e2d10a4331979042cc2ffa1722af9562ff6 | diff --git a/lib/reterm/layout.rb b/lib/reterm/layout.rb
index <HASH>..<HASH> 100644
--- a/lib/reterm/layout.rb
+++ b/lib/reterm/layout.rb
@@ -110,8 +110,8 @@ module RETerm
if h.key?(:component)
c = h[:component]
- h.merge! :rows => c.requested_rows + c.extra_padding,
- :cols => c.requested_cols + c.extra_padding
+ h = {:rows => c.requested_rows + c.extra_padding,
+ :cols => c.requested_cols + c.extra_padding}.merge(h)
end
raise ArgumentError, "must specify x/y" unless h.key?(:x) && | Merge layout params into default hash, allowing user to always explicitly set rows/cols | movitto_reterm | train | rb |
abc9afcbf1d4f9147734385e34b85dee33255b4b | diff --git a/action/Request.php b/action/Request.php
index <HASH>..<HASH> 100644
--- a/action/Request.php
+++ b/action/Request.php
@@ -161,11 +161,9 @@ class Request extends \lithium\net\http\Request {
if (isset($this->_config['url'])) {
$this->url = rtrim($this->_config['url'], '/');
- } elseif (!empty($_GET['url']) ) {
+ } elseif (isset($_GET['url'])) {
$this->url = rtrim($_GET['url'], '/');
unset($_GET['url']);
- } elseif (isset($_SERVER['REQUEST_URI']) && strlen(trim($_SERVER['REQUEST_URI'])) > 0) {
- $this->url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
}
if (!empty($this->_config['query'])) {
$this->query = $this->_config['query']; | Rolling back extra nginx support that breaks subdirectory installs under non-nginx servers in `\action\Request`. | UnionOfRAD_lithium | train | php |
6d2704f274ff85bed0b942880a20bfa4307c1e0d | diff --git a/app/controllers/socializer/notifications_controller.rb b/app/controllers/socializer/notifications_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/socializer/notifications_controller.rb
+++ b/app/controllers/socializer/notifications_controller.rb
@@ -25,6 +25,5 @@ module Socializer
current_user.activity_object.save!
end
end
-
end
end
diff --git a/app/models/socializer/notification.rb b/app/models/socializer/notification.rb
index <HASH>..<HASH> 100644
--- a/app/models/socializer/notification.rb
+++ b/app/models/socializer/notification.rb
@@ -12,6 +12,5 @@ module Socializer
# Validations
validates_presence_of :activity_id
validates_presence_of :activity_object_id
-
end
end | Extra empty line detected at body end. | socializer_socializer | train | rb,rb |
02da5eabdc91a20c410442c4287c281a5f76a73f | diff --git a/dvc/__init__.py b/dvc/__init__.py
index <HASH>..<HASH> 100644
--- a/dvc/__init__.py
+++ b/dvc/__init__.py
@@ -5,7 +5,7 @@ Make your data science projects reproducible and shareable.
"""
import os
-VERSION_BASE = '0.15.3'
+VERSION_BASE = '0.16.0'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__)) | dvc: bump to <I> | iterative_dvc | train | py |
84d5ef94ba161f7054b73ccd9876795248acd0d2 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -67,3 +67,9 @@ def inspect_source(cop, file, source)
ast, tokens = Rubocop::CLI.rip_source(source.join("\n"))
cop.inspect(file, source, tokens, ast)
end
+
+class Rubocop::Cop::Cop
+ def messages
+ offences.map(&:message)
+ end
+end | Add messages method to Cop in specs only | rubocop-hq_rubocop | train | rb |
a9abadcfcc4121dca45df0168afd833f41b8ed74 | diff --git a/pandas/tests/reshape/merge/test_multi.py b/pandas/tests/reshape/merge/test_multi.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/reshape/merge/test_multi.py
+++ b/pandas/tests/reshape/merge/test_multi.py
@@ -195,6 +195,27 @@ class TestMergeMulti:
tm.assert_frame_equal(merged_left_right, merge_right_left)
+ def test_merge_multiple_cols_with_mixed_cols_index(self):
+ # GH29522
+ s = pd.Series(
+ range(6),
+ pd.MultiIndex.from_product([["A", "B"], [1, 2, 3]], names=["lev1", "lev2"]),
+ name="Amount",
+ )
+ df = pd.DataFrame(
+ {"lev1": list("AAABBB"), "lev2": [1, 2, 3, 1, 2, 3], "col": 0}
+ )
+ result = pd.merge(df, s.reset_index(), on=["lev1", "lev2"])
+ expected = pd.DataFrame(
+ {
+ "lev1": list("AAABBB"),
+ "lev2": [1, 2, 3, 1, 2, 3],
+ "col": [0] * 6,
+ "Amount": range(6),
+ }
+ )
+ tm.assert_frame_equal(result, expected)
+
def test_compress_group_combinations(self):
# ~ 40000000 possible unique groups | TST: Merge multiple cols with mixed columns/index (#<I>) | pandas-dev_pandas | train | py |
b5af664eb6e8db72c80a8aab456b699ec69e39dc | diff --git a/labsuite/engine/context.py b/labsuite/engine/context.py
index <HASH>..<HASH> 100644
--- a/labsuite/engine/context.py
+++ b/labsuite/engine/context.py
@@ -25,10 +25,6 @@ class Context():
Traverses through child components until it finds something that
has the same method name, then passes the arguments and returns
the response.
-
- This essentially provides full machine-level permissions to anyone
- with web console access. Fine for now because this runs on a local
- server hosted on the robot.
"""
deck_method = getattr(self.deck, method, None)
if callable(deck_method): | Context: Well, this is no longer true. | Opentrons_opentrons | train | py |
6473ac41593226691669e0de83fcc033f05c6f79 | diff --git a/tests/_util.py b/tests/_util.py
index <HASH>..<HASH> 100644
--- a/tests/_util.py
+++ b/tests/_util.py
@@ -5,7 +5,7 @@ from docutils.nodes import (
list_item, paragraph,
)
from mock import Mock
-from spec import eq_
+from spec import eq_, ok_
from sphinx.application import Sphinx
import six
import sphinx
@@ -153,4 +153,10 @@ def expect_releases(entries, release_map, skip_initial=False):
changelog = changelog2dict(releases(*entries, **kwargs))
err = "Got unexpected contents for {0}: wanted {1}, got {2}"
for rel, issues in six.iteritems(release_map):
- eq_(changelog[rel], issues, err.format(rel, issues, changelog[rel]))
+ found = changelog.pop(rel)
+ eq_(found, issues, err.format(rel, issues, found))
+ # Sanity: ensure no leftover issue lists exist (empty ones are OK)
+ for key in changelog.keys():
+ if not changelog[key]:
+ del changelog[key]
+ ok_(not changelog, "Found leftovers: {0}".format(changelog)) | Have expect_releases complain about leftovers | bitprophet_releases | train | py |
a704635de3ab1a204648d6f41e9b4350d5100ff6 | diff --git a/slither/core/declarations/contract.py b/slither/core/declarations/contract.py
index <HASH>..<HASH> 100644
--- a/slither/core/declarations/contract.py
+++ b/slither/core/declarations/contract.py
@@ -69,6 +69,14 @@ class Contract(ChildSlither, SourceMapping):
self._inheritance = inheritance
@property
+ def derived_contracts(self):
+ '''
+ list(Contract): Return the list of contracts derived from self
+ '''
+ candidates = self.slither.contracts
+ return [c for c in candidates if self in c.inheritance]
+
+ @property
def structures(self):
'''
list(Structure): List of the structures
@@ -163,6 +171,18 @@ class Contract(ChildSlither, SourceMapping):
'''
return self.functions_not_inherited + self.modifiers_not_inherited
+ def get_functions_overridden_by(self, function):
+ '''
+ Return the list of functions overriden by the function
+ Args:
+ (core.Function)
+ Returns:
+ list(core.Function)
+
+ '''
+ candidates = [c.functions_not_inherited for c in self.inheritance]
+ candidates = [candidate for sublist in candidates for candidate in sublist]
+ return [f for f in candidates if f.full_name == function.full_name]
@property
def all_functions_called(self): | API:
- Add contract.derived_contracts | crytic_slither | train | py |
a0f9a0365f5c6170df80d9f9f4bc203283d2cdaf | diff --git a/test/auto_session_timeout_helper_test.rb b/test/auto_session_timeout_helper_test.rb
index <HASH>..<HASH> 100644
--- a/test/auto_session_timeout_helper_test.rb
+++ b/test/auto_session_timeout_helper_test.rb
@@ -2,17 +2,21 @@ require File.dirname(__FILE__) + '/test_helper'
describe AutoSessionTimeoutHelper do
- class ActionView::Base
+ class StubView
+ include AutoSessionTimeoutHelper
+ include ActionView::Helpers::JavaScriptHelper
+ include ActionView::Helpers::TagHelper
+
def timeout_path
- '/timeout'
+ "/timeout"
end
-
+
def active_path
- '/active'
+ "/active"
end
end
- subject { ActionView::Base.new }
+ subject { StubView.new }
describe "#auto_session_timeout_js" do
it "returns correct JS" do | Fix tests to work with Rails 6 | pelargir_auto-session-timeout | train | rb |
7354828fb5261edb8dde6e694b3152eaaf27eb6d | diff --git a/RisFieldsMapping.php b/RisFieldsMapping.php
index <HASH>..<HASH> 100644
--- a/RisFieldsMapping.php
+++ b/RisFieldsMapping.php
@@ -27,7 +27,7 @@ class RisFieldsMapping implements RisFieldsMappingInterface
* @param string $field
* @return null|string
*/
- public function findTagByField(string $field)
+ public function findRisFieldByFieldName(string $field)
{
return $this->arrayFind($field);
}
diff --git a/RisFieldsMappingInterface.php b/RisFieldsMappingInterface.php
index <HASH>..<HASH> 100644
--- a/RisFieldsMappingInterface.php
+++ b/RisFieldsMappingInterface.php
@@ -13,5 +13,5 @@ interface RisFieldsMappingInterface
* @param string $field
* @return null|string
*/
- public function findTagByField(string $field);
+ public function findRisFieldByFieldName(string $field);
}
\ No newline at end of file | Rename function findTagByField by findRisFieldByFieldName | Funstaff_RefLibRis | train | php,php |
ff3353d6cafc999089664ec929684cabc6dd3572 | diff --git a/lib/Opauth/Strategy/Facebook.php b/lib/Opauth/Strategy/Facebook.php
index <HASH>..<HASH> 100644
--- a/lib/Opauth/Strategy/Facebook.php
+++ b/lib/Opauth/Strategy/Facebook.php
@@ -17,8 +17,5 @@ class Facebook extends OpauthStrategy{
public function __construct(&$Opauth, $strategy){
parent::__construct($Opauth, $strategy);
-
- $this->expects('app_id');
- $this->expects('app_id');
}
}
\ No newline at end of file | Removed unnecessary expects() in Facebook | opauth_opauth | train | php |
72d7caa4d8903b2aa9d465c52ec71f6fef7560e2 | diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/mon.py
+++ b/ceph_deploy/mon.py
@@ -44,7 +44,7 @@ def mon_status_check(conn, logger, hostname, args):
logger.error(line)
try:
- return json.loads(b''.join(out).decode('utf-8'))
+ return json.loads(''.join(out))
except ValueError:
return {}
@@ -589,8 +589,8 @@ def is_running(conn, args):
conn,
args
)
- result_string = b' '.join(stdout)
- for run_check in [b': running', b' start/running']:
+ result_string = ' '.join(stdout)
+ for run_check in [': running', b' start/running']:
if run_check in result_string:
return True
return False | mon: no need to decode - already done by remoto | ceph_ceph-deploy | train | py |
6908bc39b207217d5c9b3d73ea74e198711ded2f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ import sys, os
from setuptools import setup, find_packages
import subprocess
-version = "0.3.5"
+version = "0.3.6"
base_reqs = [
"requests"
diff --git a/waybackpack/version.py b/waybackpack/version.py
index <HASH>..<HASH> 100644
--- a/waybackpack/version.py
+++ b/waybackpack/version.py
@@ -1 +1 @@
-__version__ = "0.3.5"
+__version__ = "0.3.6" | Bump to v <I> | jsvine_waybackpack | train | py,py |
773758d0e8d58fba15859c44ced9ccddcda19e15 | diff --git a/src/Support/SelectFields.php b/src/Support/SelectFields.php
index <HASH>..<HASH> 100644
--- a/src/Support/SelectFields.php
+++ b/src/Support/SelectFields.php
@@ -358,7 +358,7 @@ class SelectFields
/**
* @param array $select
- * @param mixed $relation
+ * @param Relation $relation
* @param string|null $parentTable
* @param array $field
*/ | chore: phpstan: fix "Cannot call method getForeignKey() on class-string|object." | rebing_graphql-laravel | train | php |
4e70b7bf327c7e2095dd0a5b9168266417f7b477 | diff --git a/src/engines/class-twig-engine.php b/src/engines/class-twig-engine.php
index <HASH>..<HASH> 100644
--- a/src/engines/class-twig-engine.php
+++ b/src/engines/class-twig-engine.php
@@ -69,7 +69,7 @@ class Twig_Engine extends Engine {
*
* @return \Twig_Environment
*/
- private function instance() {
+ public function instance() {
if ( ! isset( self::$environment ) ) {
self::$environment = $this->boot();
} | Update class-twig-engine.php | wpup_digster | train | php |
fcc1e37136f363e5196e5d2a551588ac5747378f | diff --git a/tasks/jsduck.js b/tasks/jsduck.js
index <HASH>..<HASH> 100644
--- a/tasks/jsduck.js
+++ b/tasks/jsduck.js
@@ -12,8 +12,8 @@ module.exports = function(grunt) {
var helpers = require('grunt-lib-contrib').init(grunt),
cmd = 'jsduck',
options = helpers.options(this),
- src = this.file.src,
- dest = outDir || this.file.dest,
+ src = this.hasOwnProperty('file') == true ? this.file.src : this.data.src,
+ dest = outDir || (this.hasOwnProperty('dest') == true ? this.file.dest : this.data.dest),
args,
done = this.async(),
jsduck; | Update tasks/jsduck.js
Adds support for newer version of grunt. Fixes #1. | dpashkevich_grunt-jsduck | train | js |
1c14b8726aff9acb2506df6eb2754aa18517cc9c | diff --git a/tasks/shared-config.js b/tasks/shared-config.js
index <HASH>..<HASH> 100644
--- a/tasks/shared-config.js
+++ b/tasks/shared-config.js
@@ -97,20 +97,21 @@ module.exports = function( grunt ) {
function generateStyle( data, type ) {
var content = "";
var pattern = outputPattern[ type ];
- var name, key;
- function generateContent( data, type, parent ) {
- for (var key in data ) {
- if ( typeof(data[key]) === "object" ) {
- generateContent( data[key], type, key );
+ function generateContent( data, parentKey ) {
+ var name, key;
+ for ( key in data ) {
+ name = parentKey ? format( parentKey + "-" + key, options.cssFormat ) : format( key, options.cssFormat );
+
+ if ( typeof( data[ key ] ) === "object" ) {
+ generateContent( data[ key ], name );
}else{
- name = format( key, options.cssFormat );
- content += pattern.replace( '{{key}}', parent ? parent + "-" + name : name ).replace( '{{value}}', data[ key ] );
+ content += pattern.replace( '{{key}}', name ).replace( '{{value}}', data[ key ] );
}
}
}
- generateContent( data, type );
+ generateContent( data );
return content;
} | fixed issue with more then 2 dimensions. | MathiasPaumgarten_grunt-shared-config | train | js |
2f1123f8f136750a202ac5b9cff8031d76688ab5 | diff --git a/tests/testremote_storage.py b/tests/testremote_storage.py
index <HASH>..<HASH> 100644
--- a/tests/testremote_storage.py
+++ b/tests/testremote_storage.py
@@ -8,7 +8,7 @@ class RemoteStorageTestCase(unittest.TestCase):
VALID_UGCID = 650994986817657344
VALID_UGC_SIZE = 134620
VALID_UGC_FILENAME = "steamworkshop/tf2/_thumb.jpg"
- VALID_UGC_URL = "http://cloud-3.steampowered.com/ugc/650994986817657344/D2ADAD7F19BFA9A99BD2B8850CC317DC6BA01BA9/" #Silly tea hat made by RJ
+ VALID_UGC_URL = "http://cloud-4.steampowered.com/ugc/650994986817657344/D2ADAD7F19BFA9A99BD2B8850CC317DC6BA01BA9/" #Silly tea hat made by RJ
@classmethod
def setUpClass(cls): | Updated testremote_storage with updated UGC URL (volvo changed it) | Lagg_steamodd | train | py |
65fdd8adf0b503c2d503199c4587586c8f121c2b | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -21,7 +21,6 @@ if ENV["COVERAGE"]
end
end
-development = !!ENV['GUARD_NOTIFY'] || !ENV["RAILS_ENV"]
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path("../dummy/config/environment.rb", __FILE__)
@@ -68,9 +67,7 @@ RSpec.configure do |config|
config.color = true
- if development
- config.add_formatter(:documentation)
- else
+ if ENV['COVERAGE']
config.add_formatter(:progress)
end | Explicitly define rspec output only when coverage generated | cubesystems_releaf | train | rb |
9736a4e3d66c2577720ae056fdf650f9f1072b1c | diff --git a/src/Phpoaipmh/RecordIterator.php b/src/Phpoaipmh/RecordIterator.php
index <HASH>..<HASH> 100644
--- a/src/Phpoaipmh/RecordIterator.php
+++ b/src/Phpoaipmh/RecordIterator.php
@@ -220,6 +220,9 @@ class RecordIterator implements \Iterator
$t = $resp->$verb->resumptionToken['expirationDate'];
$this->expireDate = \DateTime::createFromFormat(\DateTime::ISO8601, $t);
}
+ } else {
+ //Unset the resumption token when we're at the end of the list
+ $this->resumptionToken = null;
}
//Return a count | Stop iteration at the end of list | caseyamcl_phpoaipmh | train | php |
92ead7200655a9b7f19279154c2d3a609846099d | diff --git a/tests/TestCase/Network/Email/SmtpTransportTest.php b/tests/TestCase/Network/Email/SmtpTransportTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Network/Email/SmtpTransportTest.php
+++ b/tests/TestCase/Network/Email/SmtpTransportTest.php
@@ -407,6 +407,7 @@ class SmtpTransportTest extends TestCase
->will($this->returnValue(['First Line', 'Second Line', '.Third Line', '']));
$data = "From: CakePHP Test <noreply@cakephp.org>\r\n";
+ $data .= "Return-Path: CakePHP Return <pleasereply@cakephp.org>\r\n";
$data .= "To: CakePHP <cake@cakephp.org>\r\n";
$data .= "Cc: Mark Story <mark@cakephp.org>, Juan Basso <juan@cakephp.org>\r\n";
$data .= "Date: " . $date . "\r\n"; | Tests upgraded to accept the parameter ReturnPath | cakephp_cakephp | train | php |
f6add66561c981c44cb18417d95558262240df9b | diff --git a/examples/platformer2/js/entities/HUD.js b/examples/platformer2/js/entities/HUD.js
index <HASH>..<HASH> 100644
--- a/examples/platformer2/js/entities/HUD.js
+++ b/examples/platformer2/js/entities/HUD.js
@@ -28,11 +28,13 @@ game.HUD.Container = me.Container.extend({
// add our child score object at position
this.addChild(new game.HUD.ScoreItem(-10, -40));
- // add our fullscreen control object
- this.addChild(new game.HUD.FSControl(10, 10));
-
// add our audio control object
- this.addChild(new game.HUD.AudioControl(10 + 48 + 10, 10));
+ this.addChild(new game.HUD.AudioControl(10, 10));
+
+ if (!me.device.isMobile) {
+ // add our fullscreen control object
+ this.addChild(new game.HUD.FSControl(10 + 48 + 10, 10));
+ }
}
}); | [#<I>] do not add the fullscreen control on mobile devices
btw, is the `me.device.isMobile` still up-to-date in terms of UA
matching ? | melonjs_melonJS | train | js |
e55ed719913812a4d94157b122a5e26f6e287461 | diff --git a/lxd/api_metrics.go b/lxd/api_metrics.go
index <HASH>..<HASH> 100644
--- a/lxd/api_metrics.go
+++ b/lxd/api_metrics.go
@@ -182,7 +182,7 @@ func metricsGet(d *Daemon, r *http.Request) response.Response {
for project, entries := range newMetrics {
metricsCache[project] = metricsCacheEntry{
- expiry: time.Now().Add(15 * time.Second),
+ expiry: time.Now().Add(8 * time.Second),
metrics: entries,
} | lxd/metrics: Reduce cache to 8s to accomodate <I>s intervals
Closes #<I> | lxc_lxd | train | go |
865d7c24635e5a4e8056c74912b0a87dac661359 | diff --git a/ipwhois/ipwhois.py b/ipwhois/ipwhois.py
index <HASH>..<HASH> 100644
--- a/ipwhois/ipwhois.py
+++ b/ipwhois/ipwhois.py
@@ -105,7 +105,7 @@ class IPWhois:
asn_alts: Array of additional lookup types to attempt if the
ASN dns lookup fails. Allow permutations must be enabled.
Defaults to all ['whois', 'http']. *WARNING* deprecated in
- favor of new argument methods.
+ favor of new argument asn_methods.
extra_org_map: Dictionary mapping org handles to RIRs. This is for
limited cases where ARIN REST (ASN fallback HTTP lookup) does
not show an RIR as the org handle e.g., DNIC (which is now the
@@ -222,7 +222,7 @@ class IPWhois:
asn_alts: Array of additional lookup types to attempt if the
ASN dns lookup fails. Allow permutations must be enabled.
Defaults to all ['whois', 'http']. *WARNING* deprecated in
- favor of new argument methods.
+ favor of new argument asn_methods.
extra_org_map: Dictionary mapping org handles to RIRs. This is for
limited cases where ARIN REST (ASN fallback HTTP lookup) does
not show an RIR as the org handle e.g., DNIC (which is now the | asn_methods docstring fix (#<I>) | secynic_ipwhois | train | py |
3f5cc224a641ac025eb0479fc213155f65b06395 | diff --git a/core/dbt/adapters/base/connections.py b/core/dbt/adapters/base/connections.py
index <HASH>..<HASH> 100644
--- a/core/dbt/adapters/base/connections.py
+++ b/core/dbt/adapters/base/connections.py
@@ -139,7 +139,7 @@ class BaseConnectionManager(metaclass=abc.ABCMeta):
.format(conn.name)
)
else:
- conn.handle = LazyHandle(self.open)
+ conn.handle = LazyHandle(self.open)
conn.name = conn_name
return conn
@@ -161,6 +161,11 @@ class BaseConnectionManager(metaclass=abc.ABCMeta):
This should be thread-safe, or hold the lock if necessary. The given
connection should not be in either in_use or available.
"""
+ logger.debug(
+ 'Opening a new connection, currently in state {}'
+ .format(connection.state)
+ )
+
raise dbt.exceptions.NotImplementedException(
'`open` is not implemented for this adapter!'
) | (#<I>) Move opening connection message inside open method | fishtown-analytics_dbt | train | py |
7310f31d2d0be4fff421a47d6d9e60ef96e7c45c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import sys
setup(
name="rig",
- version="0.1.1",
+ version="0.1.2",
packages=find_packages(),
# Metadata for PyPi | Increment version number to <I>. | project-rig_rig | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.