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 |
|---|---|---|---|---|---|
f684aa1af36b405bcf3310ed4ec317c5d453f5ea | diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/readinput.py
+++ b/openquake/commonlib/readinput.py
@@ -908,8 +908,8 @@ def get_sitecol_assetcol(oqparam, haz_sitecol=None, cost_types=()):
if oqparam.region_grid_spacing:
haz_distance = oqparam.region_grid_spacing * 1.414
if haz_distance != asset_hazard_distance:
- logging.info('Using asset_hazard_distance=%d km instead of %d km',
- haz_distance, asset_hazard_distance)
+ logging.debug('Using asset_hazard_distance=%d km instead of %d km',
+ haz_distance, asset_hazard_distance)
else:
haz_distance = asset_hazard_distance | Less logging [ci skip] | gem_oq-engine | train | py |
68ca5e117574d201c950138cf74410d6354b9e7c | diff --git a/drizzlepac/align.py b/drizzlepac/align.py
index <HASH>..<HASH> 100644
--- a/drizzlepac/align.py
+++ b/drizzlepac/align.py
@@ -362,8 +362,7 @@ def perform_align(input_list, catalog_list, num_sources, archive=False, clobber=
index = np.where(alignment_table.filtered_table['imageName'] == imgname)[0][0]
# First ensure sources were found
-
- if table is None or not table[1]:
+ if table is None:
log.warning("No sources found in image {}".format(imgname))
alignment_table.filtered_table[:]['status'] = 1
alignment_table.filtered_table[:]['processMsg'] = "No sources found" | Remove logic from align (#<I>) | spacetelescope_drizzlepac | train | py |
9d9bd92d044da11fc95e3190f56a5209f4fad473 | diff --git a/src/LiteCQRS/Plugin/CRUD/CrudCreatable.php b/src/LiteCQRS/Plugin/CRUD/CrudCreatable.php
index <HASH>..<HASH> 100644
--- a/src/LiteCQRS/Plugin/CRUD/CrudCreatable.php
+++ b/src/LiteCQRS/Plugin/CRUD/CrudCreatable.php
@@ -11,7 +11,7 @@ trait CrudCreatable
$this->apply(new ResourceCreatedEvent(array(
'class' => get_class($this),
'id' => $this->id,
- 'data' => $this->data,
+ 'data' => $data,
)));
}
diff --git a/src/LiteCQRS/Plugin/CRUD/CrudUpdatable.php b/src/LiteCQRS/Plugin/CRUD/CrudUpdatable.php
index <HASH>..<HASH> 100644
--- a/src/LiteCQRS/Plugin/CRUD/CrudUpdatable.php
+++ b/src/LiteCQRS/Plugin/CRUD/CrudUpdatable.php
@@ -11,7 +11,7 @@ trait CrudUpdatable
$this->apply(new ResourceUpdatedEvent(array(
'class' => get_class($this),
'id' => $this->id,
- 'data' => $this->data,
+ 'data' => $data,
)));
} | Fix create() and update() methods for Crud traits, missed in [PR-<I>] | beberlei_litecqrs-php | train | php,php |
06c7a16c845dc8e0bf575fafeeca0f5462f5eb4d | diff --git a/backoff.go b/backoff.go
index <HASH>..<HASH> 100644
--- a/backoff.go
+++ b/backoff.go
@@ -30,6 +30,8 @@ func (b *Backoff) Duration() time.Duration {
return d
}
+const maxInt64 = float64(math.MaxInt64 - 512)
+
// ForAttempt returns the duration for a specific attempt. This is useful if
// you have a large number of independent Backoffs, but don't want use
// unnecessary memory storing the Backoff parameters per Backoff. The first
@@ -51,7 +53,6 @@ func (b *Backoff) ForAttempt(attempt float64) time.Duration {
// short-circuit
return max
}
-
factor := b.Factor
if factor <= 0 {
factor = 2
@@ -62,9 +63,15 @@ func (b *Backoff) ForAttempt(attempt float64) time.Duration {
if b.Jitter {
durf = rand.Float64()*(durf-minf) + minf
}
+ //ensure float64 wont overflow int64
+ if durf > maxInt64 {
+ return max
+ }
dur := time.Duration(durf)
- if dur > max {
- //cap!
+ //keep within bounds
+ if dur < min {
+ return min
+ } else if dur > max {
return max
}
return dur | validate float for integer overflow (closes #<I>) and add missing min-bound | jpillora_backoff | train | go |
cf15fdd045a16654126aa7489357d8b2fb13ee89 | diff --git a/config/api-tester.php b/config/api-tester.php
index <HASH>..<HASH> 100644
--- a/config/api-tester.php
+++ b/config/api-tester.php
@@ -44,7 +44,6 @@ return [
Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
Illuminate\Session\Middleware\StartSession::class,
Illuminate\View\Middleware\ShareErrorsFromSession::class,
- Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class,
],
/* | Remove CSRF check for api-tester. Unneeded. | asvae_laravel-api-tester | train | php |
7b8d94335ee1134e83f6ff39043e39e0b74014ed | diff --git a/BackofficeBundle/Controller/TreeController.php b/BackofficeBundle/Controller/TreeController.php
index <HASH>..<HASH> 100644
--- a/BackofficeBundle/Controller/TreeController.php
+++ b/BackofficeBundle/Controller/TreeController.php
@@ -51,7 +51,7 @@ class TreeController extends Controller
*/
public function showContentTypeForContentAction()
{
- $contentTypes = $this->get('php_orchestra_model.repository.content_type')->findAll();
+ $contentTypes = $this->get('php_orchestra_model.repository.content_type')->findAllByDeletedInLastVersion();
return $this->render(
'PHPOrchestraBackofficeBundle:Tree:showContentTypeForContent.html.twig', | find contentType in last version in the editorial tree | open-orchestra_open-orchestra-media-admin-bundle | train | php |
58c9f321b429bd4e2abcaaf5b8431073e84b53c6 | diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py
index <HASH>..<HASH> 100644
--- a/pyrogram/client/client.py
+++ b/pyrogram/client/client.py
@@ -2231,12 +2231,12 @@ class Client:
If the message is a reply, ID of the original message
Returns:
- On success, the sent Message is returned.
+ On success, the sent :obj:`Message <pyrogram.Message>` is returned.
Raises:
:class:`Error <pyrogram.Error>`
"""
- return self.send(
+ r = self.send(
functions.messages.SendMedia(
peer=self.resolve_peer(chat_id),
media=types.InputMediaVenue(
@@ -2257,6 +2257,13 @@ class Client:
)
)
+ for i in r.updates:
+ if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
+ users = {i.id: i for i in r.users}
+ chats = {i.id: i for i in r.chats}
+
+ return message_parser.parse_message(self, i.message, users, chats)
+
def send_contact(self,
chat_id: int or str,
phone_number: str, | Make send_venue return the new type | pyrogram_pyrogram | train | py |
72cf2a092cf0aeb801ccfef6674981745adb5fed | diff --git a/rivets-backbone.js b/rivets-backbone.js
index <HASH>..<HASH> 100644
--- a/rivets-backbone.js
+++ b/rivets-backbone.js
@@ -21,7 +21,7 @@
/**
* Resolves path chain
*
- * for a, 'b.c.d' returns {model: a.b.c, key:'d'}
+ * for a, 'b:c:d' returns {model: a:b:c, key:'d'}
*
* @param {Model} model
* @param {String} keypath
@@ -29,7 +29,7 @@
* @returns {{model: Model, key: String}}
*/
function getKeyPathRoot(model, keypath) {
- keypath = keypath.split('.');
+ keypath = keypath.split(':');
while (keypath.length > 1) {
model = model.get(keypath.shift());
@@ -124,12 +124,10 @@
}
// Configure rivets data-bind for Backbone.js
- rivets.configure({
- adapter: {
- subscribe: onOffFactory('on'),
- unsubscribe: onOffFactory('off'),
- read: read,
- publish: publish
- }
- });
+ rivets.adapters[':'] = {
+ subscribe: onOffFactory('on'),
+ unsubscribe: onOffFactory('off'),
+ read: read,
+ publish: publish
+ };
}); | adaptation for rivets <I> | azproduction_rivets-backbone-adapter | train | js |
d1e95479bd8bde5775c674dc52eadda083fab5fd | diff --git a/src/flags.py b/src/flags.py
index <HASH>..<HASH> 100644
--- a/src/flags.py
+++ b/src/flags.py
@@ -108,7 +108,6 @@ def _extract_member_definitions_from_class_attributes(class_dict):
return members
-# TODO: extract a FlagCreateParams from FlagProperties and use that when that is enough
class FlagProperties:
__slots__ = ('name', 'data', 'bits', 'index', 'index_without_aliases', 'readonly')
@@ -125,7 +124,10 @@ class FlagProperties:
raise AttributeError("Attribute '%s' of '%s' object is readonly." % (key, type(self).__name__))
super().__setattr__(key, value)
- # FIXME: bug: missing __delattr__
+ def __delattr__(self, key):
+ if getattr(self, 'readonly', False):
+ raise AttributeError("Can't delete readonly attribute '%s' of '%s' object." % (key, type(self).__name__))
+ super().__delattr__(key)
_readonly_protected_flags_class_attributes = { | bugfix: added the missing FlagProperties.__delattr__ | pasztorpisti_py-flags | train | py |
adccb449c3f5a4c613666ac1927c500b5b9e2aa8 | diff --git a/pages/calendar/index.js b/pages/calendar/index.js
index <HASH>..<HASH> 100644
--- a/pages/calendar/index.js
+++ b/pages/calendar/index.js
@@ -116,10 +116,7 @@ const CalendarDemo = () => {
</div>
<div className="field col-12 md:col-4">
<label htmlFor="time24">Time / 24h</label>
- <Calendar id="time24" value={date7} onChange={(e) => {
- setDate7(e.value)
- console.log('onChange')
- }} showTime showSeconds />
+ <Calendar id="time24" value={date7} onChange={(e) => setDate7(e.value)} showTime showSeconds />
</div>
<div className="field col-12 md:col-4">
<label htmlFor="time12">Time / 12h</label> | Removed console.log from CalendarDemo | primefaces_primereact | train | js |
803f2819b2b390d68234b83575aaad3bebb424af | diff --git a/tests/test_modules/test_ADAndor/test_andordriverpart.py b/tests/test_modules/test_ADAndor/test_andordriverpart.py
index <HASH>..<HASH> 100644
--- a/tests/test_modules/test_ADAndor/test_andordriverpart.py
+++ b/tests/test_modules/test_ADAndor/test_andordriverpart.py
@@ -423,3 +423,16 @@ class TestAndorDetectorDriverPart(ChildTestCase):
exposure=exposure,
frames_per_step=2,
)
+
+ def test_validate_succeeds_without_tweaking_for_positive_exposure(self):
+ generator = self._get_static_generator(1.0)
+ exposure = 0.5
+
+ # Set the readout time
+ self.set_attributes(self.child, andorReadoutTime=0.1)
+
+ tweaks = self.andor_driver_part.on_validate(
+ self.context, generator, exposure=exposure
+ )
+
+ assert tweaks is None | AndorDriverPart: improve test coverage | dls-controls_pymalcolm | train | py |
513c48f05eb38a6d28bff60d7699bd6834b4759b | diff --git a/Test/Unit/Parsing/PHPTester.php b/Test/Unit/Parsing/PHPTester.php
index <HASH>..<HASH> 100644
--- a/Test/Unit/Parsing/PHPTester.php
+++ b/Test/Unit/Parsing/PHPTester.php
@@ -1012,7 +1012,9 @@ class PHPTester {
return preg_replace('/^ \* /', '', $line);
}, $docblock_lines);
- Assert::assertContains($line, $docblock_lines);
+ // Work around assertContains() not outputting the array on failure by
+ // putting it in the message.
+ Assert::assertContains($line, $docblock_lines, "The line '{$line}' was found in the docblock lines: " . print_r($docblock_lines, TRUE));
}
/** | Fixed assertDocblockHasLine() not outputting searched array in failure message. | drupal-code-builder_drupal-code-builder | train | php |
8bceef1546f5d5d9b24031f1c6801184b459d9bb | diff --git a/core/src/rabird/__init__.py b/core/src/rabird/__init__.py
index <HASH>..<HASH> 100644
--- a/core/src/rabird/__init__.py
+++ b/core/src/rabird/__init__.py
@@ -5,7 +5,7 @@ __import__('pkg_resources').declare_namespace(__name__)
import sys
-version_info = (0, 0, 7)
+version_info = (0, 0, 8)
__version__ = '.'.join(map(str, version_info))
__monkey_patched = False
diff --git a/core/src/rabird/datetime.py b/core/src/rabird/datetime.py
index <HASH>..<HASH> 100644
--- a/core/src/rabird/datetime.py
+++ b/core/src/rabird/datetime.py
@@ -87,7 +87,10 @@ def __get_cpu_ticks_max_win32():
return 0xFFFFFFFF
def __get_cpu_ticks_win32():
- return win32api.GetTickCount()
+ # FIXED: win32api.GetTickCount()'s value will be converted to an 32bits
+ # integer ! It must be DWORD not integer! We convert it back to unsigned
+ # value.
+ return (win32api.GetTickCount() + 0x100000000) % 0x100000000
def __get_cpu_ticks_per_second_unix():
return 100 | Fixed result of win<I>api.GetTickCount() will be converted to an <I>bits signed integer! We convert it back to dword value! | starofrainnight_rabird.core | train | py,py |
3d8378de75f3496e84648eb57b7db58bcf321e94 | diff --git a/blockstack/lib/client.py b/blockstack/lib/client.py
index <HASH>..<HASH> 100644
--- a/blockstack/lib/client.py
+++ b/blockstack/lib/client.py
@@ -3496,6 +3496,15 @@ def resolve_profile(name, include_expired=False, include_name_record=False, host
profile_data = jwt['payload']['claim']
public_key = str(jwt['payload']['issuer']['publicKey'])
+ # return public key that matches address
+ pubkeys = [virtualchain.ecdsalib.ecdsa_public_key(keylib.key_formatting.decompress(public_key)),
+ virtualchain.ecdsalib.ecdsa_public_key(keylib.key_formatting.compress(public_key))]
+
+ if name_rec['address'] == pubkeys[0].address():
+ public_key = pubkeys[0].to_hex()
+ else:
+ public_key = pubkeys[1].to_hex()
+
ret = {
'profile': profile_data,
'zonefile': zonefile_txt, | use the right public key that matches the owner address | blockstack_blockstack-core | train | py |
d587d7e373ca2fe3195942d83c545ea414a19223 | diff --git a/Backtrace.php b/Backtrace.php
index <HASH>..<HASH> 100644
--- a/Backtrace.php
+++ b/Backtrace.php
@@ -151,7 +151,7 @@ class QM_Backtrace {
$trace = array_map( array( $this, 'filter_trace' ), $this->trace );
$trace = array_values( array_filter( $trace ) );
- if ( empty( $trace ) ) {
+ if ( empty( $trace ) && !empty($this->trace) ) {
$lowest = $this->trace[0];
$file = QM_Util::standard_dir( $lowest['file'], '' );
$lowest['calling_file'] = $lowest['file']; | Added a test to make sure ->trace is not empty. Was causing issues in HHVM. | johnbillion_query-monitor | train | php |
87c4884fc5a5b4d1b601de251be5522a66043fe4 | diff --git a/test/unit/ComparatorTest.php b/test/unit/ComparatorTest.php
index <HASH>..<HASH> 100644
--- a/test/unit/ComparatorTest.php
+++ b/test/unit/ComparatorTest.php
@@ -15,7 +15,7 @@ final class ComparatorTest extends TestCase
public function testCompare(): void
{
$reflectorFactory = new DirectoryReflectorFactory();
- self::assertSame(
+ self::assertEquals(
[
'[BC] Parameter something in Thing::__construct has been deleted',
'[BC] Method methodGone in class Thing has been deleted', | Use assertEquals for comparing arrays because order doesn't matter | Roave_BackwardCompatibilityCheck | train | php |
48ff65b7643a174eadffc3bc368ba5e50e285d54 | diff --git a/lib/faraday/adapter/net_http.rb b/lib/faraday/adapter/net_http.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday/adapter/net_http.rb
+++ b/lib/faraday/adapter/net_http.rb
@@ -4,6 +4,7 @@ rescue LoadError
warn "Warning: no such file to load -- net/https. Make sure openssl is installed if you want ssl support"
require 'net/http'
end
+require 'zlib'
module Faraday
class Adapter | Require zlib for Ruby <I>
In Ruby <I>, zlib is required by net/http but this is not the case in
Ruby <I>, causing a NameError (uninitialized constant
Faraday::Adapter::NetHttp::Zlib). | lostisland_faraday | train | rb |
eac1d23825b950f645cebcb1d6a51bac819db58b | diff --git a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/command_headers.go b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/command_headers.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/command_headers.go
+++ b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/command_headers.go
@@ -48,8 +48,8 @@ func (c *CommandHeaderRoundTripper) RoundTrip(req *http.Request) (*http.Response
return c.Delegate.RoundTrip(req)
}
-// ParseCommandHeaders fills in a map of X-Headers into the CommandHeaderRoundTripper. These
-// headers are then filled into each request. For details on X-Headers see:
+// ParseCommandHeaders fills in a map of custom headers into the CommandHeaderRoundTripper. These
+// headers are then filled into each request. For details on the custom headers see:
// https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/859-kubectl-headers
// Each call overwrites the previously parsed command headers (not additive).
// TODO(seans3): Parse/add flags removing PII from flag values. | nit: Update comment to match headers change. | kubernetes_kubernetes | train | go |
87207df0df82da0d2ff41bf0a453bb8506da3ba4 | diff --git a/vault/generate_root.go b/vault/generate_root.go
index <HASH>..<HASH> 100644
--- a/vault/generate_root.go
+++ b/vault/generate_root.go
@@ -39,11 +39,11 @@ type GenerateRootStrategy interface {
type generateStandardRootToken struct{}
func (g generateStandardRootToken) authenticate(ctx context.Context, c *Core, combinedKey []byte) error {
- _, err := c.unsealKeyToMasterKey(ctx, combinedKey)
+ masterKey, err := c.unsealKeyToMasterKey(ctx, combinedKey)
if err != nil {
return errwrap.Wrapf("unable to authenticate: {{err}}", err)
}
- if err := c.barrier.VerifyMaster(combinedKey); err != nil {
+ if err := c.barrier.VerifyMaster(masterKey); err != nil {
return errwrap.Wrapf("master key verification failed: {{err}}", err)
} | Fix a regression introduced in #<I> that breaks root token generation. (#<I>) | hashicorp_vault | train | go |
a6ae0beeed9663380ccbbbf54c85cddb15aec858 | diff --git a/lib/mementus/pipeline/step.rb b/lib/mementus/pipeline/step.rb
index <HASH>..<HASH> 100644
--- a/lib/mementus/pipeline/step.rb
+++ b/lib/mementus/pipeline/step.rb
@@ -58,7 +58,7 @@ module Mementus
end
end
- # Returns the first element in the sequence.
+ # Returns the first value in the sequence.
def first
to_enum.first
end | Make noun consistent in method docs | maetl_mementus | train | rb |
dc504ab815cc9ad74a6a6beaf6faa88a5d99c293 | diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index <HASH>..<HASH> 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -1545,16 +1545,17 @@ class ProjectPipelineManager(RetrieveMixin, CreateMixin, RESTManager):
return CreateMixin.create(self, data, path=path, **kwargs)
-class ProjectSnippetNote(RESTObject):
+class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject):
_constructor_types = {'author': 'User'}
-class ProjectSnippetNoteManager(RetrieveMixin, CreateMixin, RESTManager):
+class ProjectSnippetNoteManager(CRUDMixin, RESTManager):
_path = '/projects/%(project_id)s/snippets/%(snippet_id)s/notes'
_obj_cls = ProjectSnippetNote
_from_parent_attrs = {'project_id': 'project_id',
'snippet_id': 'id'}
_create_attrs = (('body', ), tuple())
+ _update_attrs = (('body', ), tuple())
class ProjectSnippet(SaveMixin, ObjectDeleteMixin, RESTObject): | Snippet notes support all the CRUD methods
Fixes #<I> | python-gitlab_python-gitlab | train | py |
4d6d94059bb2c88ec5c84ee6b197309458ae8091 | diff --git a/lib/mongoid/version.rb b/lib/mongoid/version.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/version.rb
+++ b/lib/mongoid/version.rb
@@ -1,4 +1,4 @@
# encoding: utf-8
module Mongoid #:nodoc
- VERSION = "2.0.0.beta.14"
+ VERSION = "2.0.0.beta.15"
end | Updating version to beta <I> | mongodb_mongoid | train | rb |
94c8196a7fbb33a6aeedebebcd97d3ea30d60127 | diff --git a/src/position.js b/src/position.js
index <HASH>..<HASH> 100644
--- a/src/position.js
+++ b/src/position.js
@@ -75,9 +75,10 @@ var Position = Class(null, /** @lends Position.prototype */ {
* Position parent nodes of the NOI
*/
_positionParents: function() {
+ const top = this.noi.parentStack.length - 1;
this.noi.parentStack.forEach((node, index) => {
node.x = this.noi.x;
- node.y = index;
+ node.y = top - index;
});
}, | fix: positioning of parent nodes
Before this fix parent nodes were positioned in reverse order, i.e. the
NOI's parent was the top most node, under them was his parent and so on. | valerii-zinchenko_inheritance-diagram | train | js |
b1f80f2996d3613471698cb7bd84c0352963aeed | diff --git a/hamster_lib/backends/sqlalchemy/storage.py b/hamster_lib/backends/sqlalchemy/storage.py
index <HASH>..<HASH> 100644
--- a/hamster_lib/backends/sqlalchemy/storage.py
+++ b/hamster_lib/backends/sqlalchemy/storage.py
@@ -948,21 +948,15 @@ class FactManager(storage.BaseFactManager):
"""
start, end = fact.start, fact.end
query = self.store.session.query(AlchemyFact)
- query = query.filter(or_(
- and_(AlchemyFact.start >= start, AlchemyFact.start <= end),
- and_(AlchemyFact.end >= start, AlchemyFact.end <= end),
- and_(AlchemyFact.start <= start, AlchemyFact.end >= start),
- ))
- facts_in_timeframe = query.all()
- # Check if passed fact is the only element of the returned list.
- result = not bool(facts_in_timeframe)
- if fact.pk and len(facts_in_timeframe) == 1:
- if facts_in_timeframe[0].pk == fact.pk:
- result = True
- else:
- result = False
- return result
+ condition = and_(AlchemyFact.start < end, AlchemyFact.end > start)
+
+ if fact.pk:
+ condition = and_(condition, AlchemyFact.pk != fact.pk)
+
+ query = query.filter(condition)
+
+ return not bool(query.count())
def _add(self, fact, raw=False):
""" | Refactor timeframe availability check as per suggestion | projecthamster_hamster-lib | train | py |
1c187a5f78cc658550248ac4a832c90be73a904f | diff --git a/lib/events-ha-node.js b/lib/events-ha-node.js
index <HASH>..<HASH> 100644
--- a/lib/events-ha-node.js
+++ b/lib/events-ha-node.js
@@ -230,6 +230,8 @@ class EventsHaNode extends EventsNode {
triggerNode() {}
updateHomeAssistant() {
+ if (!this.isIntegrationLoaded) return;
+
const message = {
type: 'nodered/entity',
server_id: this.nodeConfig.server.id, | fix(trigger-state): Only update HA when integration is loaded
Fixes: #<I> | zachowj_node-red-contrib-home-assistant-websocket | train | js |
2e0e6ed2c8a0e0d0fa56a309593cef53981e20a0 | diff --git a/library/Theme/Enqueue.php b/library/Theme/Enqueue.php
index <HASH>..<HASH> 100644
--- a/library/Theme/Enqueue.php
+++ b/library/Theme/Enqueue.php
@@ -49,6 +49,12 @@ class Enqueue
*/
public function style()
{
+ $loadWpJquery = apply_filters('Municipio/load-wp-jquery', false);
+
+ if (!$loadWpJquery) {
+ wp_deregister_script('jquery');
+ }
+
if ((defined('DEV_MODE') && DEV_MODE === true) || (isset($_GET['DEV_MODE']) && $_GET['DEV_MODE'] === 'true')) {
wp_register_style('hbg-prime', '//hbgprime.dev/dist/css/hbg-prime.min.css', '', '1.0.0');
} else { | Do not load wp jquery by default (option enable with filter) | helsingborg-stad_Municipio | train | php |
0464fb8a70bdeb8ff0c6e8f4a3e9e4ed8304baa8 | diff --git a/src/Eris/Generator/Natural.php b/src/Eris/Generator/Natural.php
index <HASH>..<HASH> 100644
--- a/src/Eris/Generator/Natural.php
+++ b/src/Eris/Generator/Natural.php
@@ -30,9 +30,10 @@ class Natural implements Generator
public function shrink($element)
{
- if ($element > 0) {
+ if ($element > $this->lowerLimit) {
$element--;
}
+
return $element;
}
diff --git a/test/Eris/Generator/NaturalTest.php b/test/Eris/Generator/NaturalTest.php
index <HASH>..<HASH> 100644
--- a/test/Eris/Generator/NaturalTest.php
+++ b/test/Eris/Generator/NaturalTest.php
@@ -30,10 +30,9 @@ class NaturalTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($lastValue - 1, $generator->shrink($lastValue));
}
- public function testCannotShrinkBelowZero()
+ public function testCannotShrinkBelowTheLowerLimit()
{
- $generator = new Natural($lowerLimit = 0, $upperLimit = 0);
- $lastValue = $generator();
- $this->assertEquals(0, $generator->shrink($lastValue));
+ $generator = new Natural($lowerLimit = 4, $upperLimit = 10);
+ $this->assertEquals(4, $generator->shrink(4));
}
} | Fixed bug in Generator\Natural shrinking: values were going under the lower limit | giorgiosironi_eris | train | php,php |
6998338b4bbb33d8fce4bef9dc0e644062cddfa8 | diff --git a/src/Colors/Color.php b/src/Colors/Color.php
index <HASH>..<HASH> 100644
--- a/src/Colors/Color.php
+++ b/src/Colors/Color.php
@@ -103,19 +103,28 @@ class Color
{
return $this->isStyleForced;
}
-
+
/**
- * @link https://github.com/symfony/Console/blob/master/Output/StreamOutput.php#L93-112
+ * Returns true if the stream supports colorization.
+ *
+ * Colorization is disabled if not supported by the stream:
+ *
+ * - Windows without Ansicon and ConEmu
+ * - non tty consoles
+ *
+ * @link https://github.com/symfony/Console/blob/master/Output/StreamOutput.php#L95-L102
* @codeCoverageIgnore
+ *
+ * @return bool true if the stream supports colorization, false otherwise
*/
public function isSupported()
{
- if (DIRECTORY_SEPARATOR === '\\') {
- return false !== getenv('ANSICON');
+ if (DIRECTORY_SEPARATOR == '\\') {
+ return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
}
- return function_exists('posix_isatty') && @posix_isatty(STDOUT);
- }
+ return function_exists('posix_isatty') && @posix_isatty($this->stream);
+ }
/**
* @codeCoverageIgnore | synced `isSupported` code with symfony StreamOutput
this effectively adds support for `ConEmuANSI` | kevinlebrun_colors.php | train | php |
5302f4bb5ec6dc968b31bcb428c7b1c5ea1e75d2 | diff --git a/examples/consumergroup/main.go b/examples/consumergroup/main.go
index <HASH>..<HASH> 100644
--- a/examples/consumergroup/main.go
+++ b/examples/consumergroup/main.go
@@ -13,7 +13,7 @@ import (
"github.com/Shopify/sarama"
)
-// Sarma configuration options
+// Sarama configuration options
var (
brokers = ""
version = "" | Update documentation with Sarama instead of Sarma | Shopify_sarama | train | go |
c2ec53fcdf0d1f783cdc936df666bee9363df4d5 | diff --git a/tests/Api/FocusTest.php b/tests/Api/FocusTest.php
index <HASH>..<HASH> 100644
--- a/tests/Api/FocusTest.php
+++ b/tests/Api/FocusTest.php
@@ -23,7 +23,6 @@ class FocusTest extends MauticApiTestCase
'style' => 'bar',
'htmlMode' => 1,
'html' => '<div><strong style="color:red">html mode enabled</strong></div>',
- 'css' => '.mf-bar-collapser {border-radius: 0 !important}',
'properties' => array(
'bar' =>
array( | The CSS property had been removed from the focus entity (<URL>) | mautic_api-library | train | php |
85c804dfb025e998e7f2e9e2f5c2ba091e60a906 | diff --git a/src/Illuminate/View/Component.php b/src/Illuminate/View/Component.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/View/Component.php
+++ b/src/Illuminate/View/Component.php
@@ -3,7 +3,6 @@
namespace Illuminate\View;
use Closure;
-use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
use ReflectionClass;
use ReflectionMethod;
diff --git a/tests/View/ViewComponentAttributeBagTest.php b/tests/View/ViewComponentAttributeBagTest.php
index <HASH>..<HASH> 100644
--- a/tests/View/ViewComponentAttributeBagTest.php
+++ b/tests/View/ViewComponentAttributeBagTest.php
@@ -2,7 +2,6 @@
namespace Illuminate\Tests\View;
-use Illuminate\View\Component;
use Illuminate\View\ComponentAttributeBag;
use PHPUnit\Framework\TestCase; | Apply fixes from StyleCI (#<I>) | laravel_framework | train | php,php |
5b3ceed1c5e15e07443b77ab804eba589b5b1671 | diff --git a/Model/ImportEpisodeJob.php b/Model/ImportEpisodeJob.php
index <HASH>..<HASH> 100644
--- a/Model/ImportEpisodeJob.php
+++ b/Model/ImportEpisodeJob.php
@@ -30,7 +30,7 @@ class ImportEpisodeJob extends BprsContainerAwareJob {
$remote_episode = $this->serializer->deserialize($response->getBody(), $episode_class, 'json');
$series = $this->media_service->getSeries($remote_episode->getSeries()->getUniqID());
if (!$series) {
- $series = $this->importSeries($episode->getSeries()->getUniqID());
+ $series = $this->importSeries($remote_episode->getSeries()->getUniqID());
}
$episode->setSeries($series); | fixed bug for importing remote series if series does not exist
if series does not exist, the episode has no series. duuh. | OKTOTV_OktoMediaBundle | train | php |
565f68d2d7592dfbb8d40112b6aceb321b07e109 | diff --git a/examples/chat/app.js b/examples/chat/app.js
index <HASH>..<HASH> 100644
--- a/examples/chat/app.js
+++ b/examples/chat/app.js
@@ -3,9 +3,15 @@ require.paths.unshift('lib')
require('express')
require('express/plugins')
+var messages = [],
+ utils = require('express/utils'),
+ kiwi = require('kiwi')
+
configure(function(){
var fiveMinutes = 300000,
oneMinute = 60000
+ kiwi.seed('haml')
+ kiwi.seed('sass')
use(MethodOverride)
use(ContentLength)
use(CommonLogger)
@@ -15,9 +21,6 @@ configure(function(){
set('root', __dirname)
})
-var messages = [],
- utils = require('express/utils')
-
get('/', function(){
this.redirect('/chat')
})
diff --git a/examples/upload/app.js b/examples/upload/app.js
index <HASH>..<HASH> 100644
--- a/examples/upload/app.js
+++ b/examples/upload/app.js
@@ -3,7 +3,11 @@ require.paths.unshift('lib')
require('express')
require('express/plugins')
+var kiwi = require('kiwi')
+
configure(function(){
+ kiwi.seed('haml')
+ kiwi.seed('sass')
use(MethodOverride)
use(ContentLength)
use(CommonLogger) | Added kiwi.seed() calls to make them available via require()
This is needed since the view plugin uses
the regular require() and not kiwi.require() | expressjs_express | train | js,js |
4d1e0304c3a679a02e42e93280ae4b0334ff3f2f | diff --git a/Classes/Neos/Neos/Ui/Aspects/AugmentationAspect.php b/Classes/Neos/Neos/Ui/Aspects/AugmentationAspect.php
index <HASH>..<HASH> 100644
--- a/Classes/Neos/Neos/Ui/Aspects/AugmentationAspect.php
+++ b/Classes/Neos/Neos/Ui/Aspects/AugmentationAspect.php
@@ -103,7 +103,7 @@ class AugmentationAspect
/**
* Hooks into standard content element wrapping to render those attributes needed for the package to identify
- * nodes and typoScript paths
+ * nodes and Fusion paths
*
* @Flow\Around("method(Neos\Neos\Service\ContentElementWrappingService->wrapContentObject())")
* @param JoinPointInterface $joinPoint the join point | TASK: Replace typoScript with Fusion in comment | neos_neos-ui | train | php |
eb9b4df1c692698167a781c15ccb34657ce06067 | diff --git a/persim/persim.py b/persim/persim.py
index <HASH>..<HASH> 100644
--- a/persim/persim.py
+++ b/persim/persim.py
@@ -17,6 +17,7 @@ class PersImage(BaseEstimator):
specs=None,
kernel_type="gaussian",
weighting_type="linear",
+ verbose=True,
):
""" Initialize a persistence image generator.
@@ -31,12 +32,12 @@ class PersImage(BaseEstimator):
self.pixels = pixels
self.N = int(np.sqrt(pixels))
-
- print(
- 'PersImage(pixels={}, spread={}, specs={}, kernel_type="{}", weighting_type="{}")'.format(
- pixels, spread, specs, kernel_type, weighting_type
+ if verbose:
+ print(
+ 'PersImage(pixels={}, spread={}, specs={}, kernel_type="{}", weighting_type="{}")'.format(
+ pixels, spread, specs, kernel_type, weighting_type
+ )
)
- )
def transform(self, diagrams):
""" Convert diagram or list of diagrams to a persistence image | Update persim.py
Add verbose option so users can disable printing on object creation | scikit-tda_persim | train | py |
19be19d37484a2b7abc6ea60fef63e331297ca16 | diff --git a/src/HtmlElement.php b/src/HtmlElement.php
index <HASH>..<HASH> 100644
--- a/src/HtmlElement.php
+++ b/src/HtmlElement.php
@@ -30,9 +30,9 @@ class HtmlElement
*
* @return string
*/
- public static function render(string $tag, $attributes = null, $content = null) : string
+ public static function render(string $tag, $attributes = null, $contents = null) : string
{
- return (new static(func_get_args()))->renderTag();
+ return (new static([$tag, $attributes, $contents]))->renderTag();
}
protected function __construct(array $arguments) | Scrutinizer nitpicks | spatie_html-element | train | php |
240d9c7a080208ce0e7fc3defe3711f3c42e8c1e | diff --git a/container/src/main/java/org/jboss/forge/furnace/impl/addons/AddonLifecycleManager.java b/container/src/main/java/org/jboss/forge/furnace/impl/addons/AddonLifecycleManager.java
index <HASH>..<HASH> 100644
--- a/container/src/main/java/org/jboss/forge/furnace/impl/addons/AddonLifecycleManager.java
+++ b/container/src/main/java/org/jboss/forge/furnace/impl/addons/AddonLifecycleManager.java
@@ -177,7 +177,7 @@ public class AddonLifecycleManager
master.merge(graph);
logger.log(Level.FINE, " ------------ MASTER GRAPH v" + i++ + "------------ ");
- logger.log(Level.INFO, master.toString());
+ logger.log(Level.FINE, master.toString());
}
MasterGraph last = stateManager.getCurrentGraph(); | Don't log the incremental Addon graphs unless FINE logging is requested. | forge_furnace | train | java |
76a445f3f6ac2a14d11809e8e1a334d1b41eb52e | diff --git a/src/registry/registry.js b/src/registry/registry.js
index <HASH>..<HASH> 100644
--- a/src/registry/registry.js
+++ b/src/registry/registry.js
@@ -142,8 +142,8 @@ module.exports = {
publish: function(args) {
return initSettings()
.then(function(settings) {
- var p = manifest.generatePackageJsonFromPluginXml(args[0]);
- p.then(function() {
+ return manifest.generatePackageJsonFromPluginXml(args[0])
+ .then(function() {
return Q.ninvoke(npm, 'load', settings);
}).then(function() {
return Q.ninvoke(npm.commands, 'publish', args) | CB-<I> Fix incorrect "success" message when publishing fails.
Problem was introduced by promise refactoring. | apache_cordova-plugman | train | js |
abab1c38d1eb459d9d41247a9ed381b4b14f9eae | diff --git a/src/SlugGenerator.php b/src/SlugGenerator.php
index <HASH>..<HASH> 100644
--- a/src/SlugGenerator.php
+++ b/src/SlugGenerator.php
@@ -343,7 +343,7 @@ class SlugGenerator
.'$AE > AE;'
.'$OE > OE;'
.'$UE > UE;'
- .'::Latin-ASCII;'
+ .'::Latin-ASCII;' // Any-ASCII is not available in older CLDR versions
;
} | Document the difference to the original de-ASCII rule | ausi_slug-generator | train | php |
f01ceb313979f752fd9d099b533dea0fdd7040e3 | diff --git a/test/kernel_test.rb b/test/kernel_test.rb
index <HASH>..<HASH> 100644
--- a/test/kernel_test.rb
+++ b/test/kernel_test.rb
@@ -2506,4 +2506,52 @@ describe Hanami::Utils::Kernel do
end
end
end
+
+ describe '.numeric?' do
+ describe 'successful operations' do
+ before do
+ @result = Hanami::Utils::Kernel.numeric?(input)
+ end
+
+ describe 'when a numeric in symbol is given' do
+ let(:input) { :'123' }
+
+ it 'returns a true' do
+ @result.wont_equal nil
+ end
+ end
+
+ describe 'when a symbol is given' do
+ let(:input) { :hello }
+
+ it 'returns false' do
+ @result.must_equal nil
+ end
+ end
+
+ describe 'when a numeric in string is given' do
+ let(:input) { '123' }
+
+ it 'returns a symbol' do
+ @result.wont_equal nil
+ end
+ end
+
+ describe 'when a string is given' do
+ let(:input) { 'hello' }
+
+ it 'returns a symbol' do
+ @result.must_equal nil
+ end
+ end
+
+ describe 'when a numeric is given' do
+ let(:input) { 123 }
+
+ it 'returns a symbol' do
+ @result.wont_equal nil
+ end
+ end
+ end
+ end
end | Add missing tests for Kernel#numeric? method | hanami_utils | train | rb |
6f79c24482c3f60a59de20724fd7a708c2c9e716 | diff --git a/Eloquent/Builder.php b/Eloquent/Builder.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Builder.php
+++ b/Eloquent/Builder.php
@@ -108,6 +108,19 @@ class Builder {
}
/**
+ * Pluck a single column from the database.
+ *
+ * @param string $column
+ * @return mixed
+ */
+ public function pluck($column)
+ {
+ $result = $this->first(array($column));
+
+ if ($result) return $result->{$column};
+ }
+
+ /**
* Get an array with the values of a given column.
*
* @param string $column | Using `pluck` on Eloquent queries will now call accessors. Fixes #<I>. | illuminate_database | train | php |
854e9a1da008876650edf48e9ebb587bf0a59aec | diff --git a/lib/base/components.js b/lib/base/components.js
index <HASH>..<HASH> 100644
--- a/lib/base/components.js
+++ b/lib/base/components.js
@@ -29,12 +29,10 @@ exports.define = {
if (!type) {
return val
}
- console.error('yo!', type)
let result = lookUpComponent(this, type, val, this.ChildType || this.ChildConstructor)
if (result) {
let r = new result.Constructor(val, event, this, key) //, this, key, escape)
if (!r.useVal) {
- // need to clean this up integrate this function into useval much better
r.useVal = true
}
return r | added ChildType -- type overwrite system | vigour-io_vjs | train | js |
8ae57ba45f57100ee16d1e38f530ac48bfb4a3a1 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -369,7 +369,8 @@ function chmod(p, mode = '0777'){
if (!isExist(p)) {
return false;
}
- return fs.chmodSync(p, mode);
+ fs.chmodSync(p, mode);
+ return true;
}
exports.chmod = chmod; | return true for chmod method when file is exist | thinkjs_think-helper | train | js |
6e4f495f6a6f0a5fe5dec19a19834868478b19ba | diff --git a/structs.go b/structs.go
index <HASH>..<HASH> 100644
--- a/structs.go
+++ b/structs.go
@@ -13,9 +13,7 @@ package discordgo
import (
"encoding/json"
- "fmt"
"net"
- "strings"
"sync"
"time"
@@ -27,9 +25,8 @@ import (
// Debug : If set to ture debug logging will be displayed.
type Session struct {
// General configurable settings.
- Token string // Authentication token for this session
- Debug bool // Debug for printing JSON request/responses
- AutoMention bool // if set to True, ChannelSendMessage will auto mention <@ID>
+ Token string // Authentication token for this session
+ Debug bool // Debug for printing JSON request/responses
// Settable Callback functions for Websocket Events
OnEvent func(*Session, Event) // should Event be *Event?
@@ -85,7 +82,7 @@ type Session struct {
VEndpoint string
VGuildID string
VChannelID string
- Vop2 VoiceOP2
+ Vop2 voiceOP2
UDPConn *net.UDPConn
// Managed state object, updated with events. | Removed unused AutoMention, renamed VoiceOP2 | bwmarrin_discordgo | train | go |
41875795e8b1a921f215f86b8d23c5a69367f5b6 | diff --git a/lib/substation.rb b/lib/substation.rb
index <HASH>..<HASH> 100644
--- a/lib/substation.rb
+++ b/lib/substation.rb
@@ -8,8 +8,8 @@ require 'concord'
# Sustation can be thought of as a domain level request router. It assumes
# that every usecase in your application has a name and is implemented in a
-# dedicated class that will be referred to as an *action* for the purposes of
-# this document. The only protocol such actions must support is `#call(request)`.
+# dedicated class that will be referred to as an *action* in the context of
+# substation. The only protocol such actions must support is `#call(request)`.
#
# Actions can be registered under any given name which allows above
# layers to invoke any specific action if respective conditions are met. | [ci skip] Change wording to better suit code docs | snusnu_substation | train | rb |
31fc8c2a2f9dcf1d3a0a58736c7b6d7cd88bb74a | diff --git a/src/OAuth2/Response/AuthenticationError.php b/src/OAuth2/Response/AuthenticationError.php
index <HASH>..<HASH> 100644
--- a/src/OAuth2/Response/AuthenticationError.php
+++ b/src/OAuth2/Response/AuthenticationError.php
@@ -8,9 +8,9 @@ class OAuth2_Response_AuthenticationError extends OAuth2_Response_Error
public function __construct($statusCode, $error, $errorDescription, $tokenType, $realm, $scope = null)
{
parent::__construct($statusCode, $error, $errorDescription);
- $authHeader = sprintf('%s realm=%s', $tokenType, $realm);
+ $authHeader = sprintf('%s realm="%s"', $tokenType, $realm);
if ($scope) {
- $authHeader = sprintf('%s, scope=%s', $authHeader, $scope);
+ $authHeader = sprintf('%s, scope="%s"', $authHeader, $scope);
}
$this->setHttpHeader('WWW-Authenticate', $authHeader);
} | Place the realm & scope values in ""
- On Android, the lack of "" caused the Java to throw exceptions when
trying to read the response code (Android assumes that when we have a
response code like <I> we have the WWW-Authenticate header set) ... also
... it seems that Android is very particlular about the ""
- Most examples from the specs have the values of realm in "" i.e.
- - <URL> | bshaffer_oauth2-server-php | train | php |
aecb5890fe28ffa10679cff16d988be3b96a4d31 | diff --git a/photutils/utils/colormaps.py b/photutils/utils/colormaps.py
index <HASH>..<HASH> 100644
--- a/photutils/utils/colormaps.py
+++ b/photutils/utils/colormaps.py
@@ -43,8 +43,8 @@ def random_cmap(ncolors=256, background_color='black', random_state=None):
h = prng.uniform(low=0.0, high=1.0, size=ncolors)
s = prng.uniform(low=0.2, high=0.7, size=ncolors)
v = prng.uniform(low=0.5, high=1.0, size=ncolors)
- hsv = np.transpose(np.array([h, s, v]))
- rgb = colors.hsv_to_rgb(hsv)
+ hsv = np.dstack((h, s, v))
+ rgb = np.squeeze(colors.hsv_to_rgb(hsv))
if background_color is not None:
if background_color not in colors.cnames: | Modify random_cmap to work with matplotlib <I> | astropy_photutils | train | py |
7be61a526165a989a39a7bb20a55acb3bdef811a | diff --git a/components/link/link.js b/components/link/link.js
index <HASH>..<HASH> 100644
--- a/components/link/link.js
+++ b/components/link/link.js
@@ -97,7 +97,7 @@ export function linkHOC(ComposedComponent) {
type="button"
{...props}
className={classes}
- data-test="ring-link"
+ data-test={dataTests('ring-link', dataTest)}
>{this.getChildren()}</button>
);
} | RG-<I> concat data-test for link with "button" tag as well | JetBrains_ring-ui | train | js |
b72590a9218a676ae62c1070bd7258fe71389bb8 | diff --git a/src/bundle/Resources/public/js/scripts/admin.content.tree.js b/src/bundle/Resources/public/js/scripts/admin.content.tree.js
index <HASH>..<HASH> 100644
--- a/src/bundle/Resources/public/js/scripts/admin.content.tree.js
+++ b/src/bundle/Resources/public/js/scripts/admin.content.tree.js
@@ -1,4 +1,4 @@
-(function(global, doc, React, ReactDOM, eZ, localStorage) {
+(function (global, doc, React, ReactDOM, eZ, localStorage) {
const KEY_CONTENT_TREE_EXPANDED = 'ez-content-tree-expanded';
const CLASS_CONTENT_TREE_EXPANDED = 'ez-content-tree-container--expanded';
const CLASS_CONTENT_TREE_ANIMATE = 'ez-content-tree-container--animate';
@@ -12,6 +12,7 @@
const userId = window.eZ.helpers.user.getId();
let frame = null;
const toggleContentTreePanel = () => {
+ doc.activeElement.blur();
contentTreeContainer.classList.toggle(CLASS_CONTENT_TREE_EXPANDED);
contentTreeContainer.classList.add(CLASS_CONTENT_TREE_ANIMATE);
btn.classList.toggle(CLASS_BTN_CONTENT_TREE_EXPANDED); | EZP-<I>: removed focus after content tree expanded (#<I>) | ezsystems_ezplatform-admin-ui | train | js |
6d71804a5661ae0d6fc34e547a668d0ff0402986 | diff --git a/lib/duration.js b/lib/duration.js
index <HASH>..<HASH> 100644
--- a/lib/duration.js
+++ b/lib/duration.js
@@ -9,7 +9,7 @@ var d = require('d/d')
, mfloor = require('es5-ext/date/#/floor-month')
, yfloor = require('es5-ext/date/#/floor-year')
, toInteger = require('es5-ext/number/to-integer')
- , toUint = require('es5-ext/number/to-uint')
+ , toPosInt = require('es5-ext/number/to-pos-integer')
, abs = Math.abs
@@ -101,7 +101,7 @@ Duration.prototype = Object.create(Object.prototype, {
if (pattern == null) pattern = 0;
if (isNaN(pattern)) return format.call(this, pattern);
pattern = Number(pattern);
- threshold = toUint(arguments[1]);
+ threshold = toPosInt(arguments[1]);
s = "";
if (pattern === 1) {
if (threshold-- <= 0) s += abs(last = this.millisecond) + "ms"; | Update up to changes in es5-ext | medikoo_duration | train | js |
01be34bbb66566b759b4caec30f4c6dea4a0405e | diff --git a/lib/appenders/consoleappender.js b/lib/appenders/consoleappender.js
index <HASH>..<HASH> 100644
--- a/lib/appenders/consoleappender.js
+++ b/lib/appenders/consoleappender.js
@@ -71,7 +71,6 @@ define(function (require) {
message[message.length-1] = lastMsg.substring(0, lastMsg.length - 1);
}
}
- console.log(message);
this.doAppendMessages(level, message);
}
}; | ConsoleAppender: dropped temp debug "console.log" call (sigh)
The call had been introduced to trace the execution of the appender
while implementing support for "appendStrings: false". It's ironic
I suppose to use "console.log" to debug a library meant to help get
rid of these calls. | joshfire_woodman | train | js |
4ed5edf8b0c7c46b9942123308ec6a7df0dd0fdc | diff --git a/osutil/osutil.go b/osutil/osutil.go
index <HASH>..<HASH> 100644
--- a/osutil/osutil.go
+++ b/osutil/osutil.go
@@ -26,7 +26,7 @@ var execPath, execError = executable()
// current process, but there is no guarantee that the path is still
// pointing to the correct executable.
//
-// OpenBSD and Darwin are currently unsupported.
+// OpenBSD is currently unsupported.
func Executable() (string, error) {
return execPath, execError
} | osutil: fix doc now that darwin is supported for Executable
Change-Id: Id3ebd7a2de<I>c<I>ab3e<I>b<I>ecf4e<I>f2d5d | go4org_go4 | train | go |
1abb9cace8b7f8ef6ce44e64ac939116e6933a6c | diff --git a/lib/run-jsdoc.js b/lib/run-jsdoc.js
index <HASH>..<HASH> 100644
--- a/lib/run-jsdoc.js
+++ b/lib/run-jsdoc.js
@@ -12,7 +12,7 @@ var path = require('path')
, log = require('npmlog')
, run = require('./run')
-var jsdocpackfile = require.resolve('../node_modules/jsdoc/package.json')
+var jsdocpackfile = path.join(__dirname, '..', 'node_modules', 'jsdoc', 'package.json')
, jsdocpack = require(jsdocpackfile)
, jsdoc = path.resolve(path.dirname(jsdocpackfile), jsdocpack.bin.jsdoc) | attempt at fixing jsdoc resolve | thlorenz_wicked | train | js |
d03a6555768febaad7f3b18c99e6542d07e7f69b | diff --git a/lib/sensu/api.rb b/lib/sensu/api.rb
index <HASH>..<HASH> 100644
--- a/lib/sensu/api.rb
+++ b/lib/sensu/api.rb
@@ -143,14 +143,14 @@ module Sensu
ahalt 404
end
- def created!(response_json)
+ def created!(response)
status 201
- body response_json
+ body response
end
- def accepted!(response_json)
+ def accepted!(response)
status 202
- body response_json
+ body response
end
def no_content! | let's rename response_json to response | sensu_sensu | train | rb |
8c57f23fe075d92f2799efda991d1fd20b0dd474 | diff --git a/numina/core/recipereqs.py b/numina/core/recipereqs.py
index <HASH>..<HASH> 100644
--- a/numina/core/recipereqs.py
+++ b/numina/core/recipereqs.py
@@ -28,7 +28,7 @@ class RecipeRequirementsType(MapStoreType):
'''Metaclass for RecipeRequirements.'''
@classmethod
- def exclude(cls, value):
+ def exclude(cls, name, value):
return isinstance(value, Requirement)
@classmethod
diff --git a/numina/core/reciperesult.py b/numina/core/reciperesult.py
index <HASH>..<HASH> 100644
--- a/numina/core/reciperesult.py
+++ b/numina/core/reciperesult.py
@@ -84,7 +84,7 @@ class ErrorRecipeResult(BaseRecipeResult):
class RecipeResultType(MapStoreType):
'''Metaclass for RecipeResult.'''
@classmethod
- def exclude(cls, value):
+ def exclude(cls, name, value):
return isinstance(value, Product)
class RecipeResultAutoQCType(RecipeResultType): | Update exclude to have two arguments as store | guaix-ucm_numina | train | py,py |
58040f92c42bed8267ef5f049a2a716121fc6575 | diff --git a/lib/git-runner/base.rb b/lib/git-runner/base.rb
index <HASH>..<HASH> 100644
--- a/lib/git-runner/base.rb
+++ b/lib/git-runner/base.rb
@@ -9,6 +9,7 @@ module GitRunner
def run
begin
+ load_git_runner_gems
Text.begin
if refs && refs.is_a?(Array)
@@ -58,6 +59,11 @@ module GitRunner
private
+ def load_git_runner_gems
+ # Load all additional gems that start with 'git-runner-'
+ Gem::Specification.all.map(&:name).select { |gem| gem =~ /^git-runner-/ }.each { |name| require(name) }
+ end
+
def write_error_log
log_directory = File.join(Configuration.tmp_directory, 'logs')
error_log = File.join(log_directory, Time.now.strftime("%Y%m%d%H%M%S") + '-error.log') | Load all additional gems that start with 'git-runner-' | jamesbrooks_git-runner | train | rb |
41f4451c203d2f964acbcd326c0b6e678062fe43 | diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Util/RemoteFilesystem.php
+++ b/src/Composer/Util/RemoteFilesystem.php
@@ -308,6 +308,11 @@ class RemoteFilesystem
case STREAM_NOTIFY_AUTH_RESULT:
if (403 === $messageCode) {
+ // Bail if the caller is going to handle authentication failures itself.
+ if (!$this->retryAuthFailure) {
+ break;
+ }
+
$this->promptAuthAndRetry($messageCode, $message);
break;
} | take care of retry-auth-failure:false in case of <I> as well | mothership-ec_composer | train | php |
f27f0b9d31d57ed3bd9cb805f9b7a7ae2a4fce15 | diff --git a/tests/scriptTest.php b/tests/scriptTest.php
index <HASH>..<HASH> 100644
--- a/tests/scriptTest.php
+++ b/tests/scriptTest.php
@@ -29,7 +29,7 @@ class scriptTest extends \PHPUnit_Framework_TestCase
$scheme = (new SchemeCollection)->scheme('http')->host('*')->toAdapter(new Http);
$this->resource->setSchemeCollection($scheme);
$result = $this->resource->get->uri('http://rss.excite.co.jp/rss/excite/odd')->eager->request();
- $this->assertSame(200, $result->code);
+ $this->assertSame('200', $result->code);
}
public function testSetSchemeApp() | make response code string (Guzzle 4) | bearsunday_BEAR.Resource | train | php |
9a23778d50f20533bb3cd0df66feb9693ba185ec | diff --git a/examples/geolocation.js b/examples/geolocation.js
index <HASH>..<HASH> 100644
--- a/examples/geolocation.js
+++ b/examples/geolocation.js
@@ -8,7 +8,10 @@ goog.require('ol.dom.Input');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
-
+goog.require('ol.style.Circle');
+goog.require('ol.style.Fill');
+goog.require('ol.style.Stroke');
+goog.require('ol.style.Style');
var view = new ol.View({
center: [0, 0],
@@ -57,6 +60,19 @@ var accuracyFeature = new ol.Feature();
accuracyFeature.bindTo('geometry', geolocation, 'accuracyGeometry');
var positionFeature = new ol.Feature();
+positionFeature.setStyle(new ol.style.Style({
+ image: new ol.style.Circle({
+ radius: 6,
+ fill: new ol.style.Fill({
+ color: '#3399CC'
+ }),
+ stroke: new ol.style.Stroke({
+ color: '#fff',
+ width: 2
+ })
+ })
+}));
+
positionFeature.bindTo('geometry', geolocation, 'position')
.transform(function() {}, function(coordinates) {
return coordinates ? new ol.geom.Point(coordinates) : null; | Use a custom style for the position feature | openlayers_openlayers | train | js |
981b3ac1e36d054d1c53dc86f70e37a419290d46 | diff --git a/lib/reterm/init.rb b/lib/reterm/init.rb
index <HASH>..<HASH> 100644
--- a/lib/reterm/init.rb
+++ b/lib/reterm/init.rb
@@ -37,6 +37,7 @@ module RETerm
Ncurses::cbreak
Ncurses::curs_set(0)
Ncurses::keypad(stdscr, true)
+ #Ncurses::set_escdelay(100) # TODO
no_mouse = opts[:nomouse] || (opts.key?(:mouse) && !opts[:mouse])
Ncurses::mousemask(Ncurses::ALL_MOUSE_EVENTS | Ncurses::REPORT_MOUSE_POSITION, []) unless no_mouse | Stub out TODO about setting esc delay (perhaps parameterize) | movitto_reterm | train | rb |
78110bfde8827d9cb9479bdadd077d2bbfa4f8e7 | diff --git a/src/urh/dev/config.py b/src/urh/dev/config.py
index <HASH>..<HASH> 100644
--- a/src/urh/dev/config.py
+++ b/src/urh/dev/config.py
@@ -81,14 +81,18 @@ DEVICE_CONFIG["AirSpy R2"] = {
"center_freq": dev_range(start=24, stop=1800 * M, step=1),
"sample_rate": [2.5*M, 10*M],
"bandwidth": [2.5*M, 10*M],
- "rx_rf_gain": list(range(0, 41)),
+ "rx_rf_gain": list(range(0, 16)),
+ "rx_if_gain": list(range(0, 16)),
+ "rx_baseband_gain": list(range(0, 16)),
}
DEVICE_CONFIG["AirSpy Mini"] = {
"center_freq": dev_range(start=24, stop=1800 * M, step=1),
"sample_rate": [3*M, 6*M],
"bandwidth": [3*M, 6*M],
- "rx_rf_gain": list(range(0, 41)),
+ "rx_rf_gain": list(range(0, 16)),
+ "rx_if_gain": list(range(0, 16)),
+ "rx_baseband_gain": list(range(0, 16)),
}
DEVICE_CONFIG["Fallback"] = { | consider gain ranges for airspy in config | jopohl_urh | train | py |
2ab2298451b1d193d7066c6a53828d3cbf5eeb02 | diff --git a/app/Core/Models/Post.php b/app/Core/Models/Post.php
index <HASH>..<HASH> 100644
--- a/app/Core/Models/Post.php
+++ b/app/Core/Models/Post.php
@@ -382,7 +382,6 @@ class Post extends Model
*/
private function filter(Builder $query, $dashboard = false)
{
-
foreach ($this->behavior->filters as $filter) {
$filter = new $filter;
@@ -410,5 +409,4 @@ class Post extends Model
return $this->filter($query, true);
}
-
} | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | orchidsoftware_platform | train | php |
35d84de477533b431f5be8baf51884756e1a4f51 | diff --git a/resources/assets/js/attachments.js b/resources/assets/js/attachments.js
index <HASH>..<HASH> 100644
--- a/resources/assets/js/attachments.js
+++ b/resources/assets/js/attachments.js
@@ -27,7 +27,7 @@
thumbnail: attachment.thumbnail ? attachment.thumbnail.thumbnail : null
}
- return output = new EJS({element: my.template.get(0)}).render(data);
+ return new EJS({element: my.template.get(0)}).render(data);
},
escape: function(string)
{ | re #<I> Cleanup. | joomlatools_joomlatools-framework | train | js |
2de01b9644ce5144a2ec25e25ea5b5c97bf84b6a | diff --git a/lib/flapjack/logger.rb b/lib/flapjack/logger.rb
index <HASH>..<HASH> 100644
--- a/lib/flapjack/logger.rb
+++ b/lib/flapjack/logger.rb
@@ -16,7 +16,7 @@ module Flapjack
@log4r_logger = Log4r::Logger.new(name)
- formatter = Log4r::PatternFormatter.new(:pattern => "[%l] %d :: #{name} :: %m",
+ formatter = Log4r::PatternFormatter.new(:pattern => "%d [%l] :: #{name} :: %m",
:date_pattern => "%Y-%m-%dT%H:%M:%S%z")
[Log4r::StdoutOutputter, Log4r::SyslogOutputter].each do |outp_klass|
@@ -54,4 +54,4 @@ module Flapjack
end
-end
\ No newline at end of file
+end | alter logging format so timestamp is first | flapjack_flapjack | train | rb |
469d8ee4c1091fb082d7544ec5e4ee2572fb51c4 | diff --git a/addok/core.py b/addok/core.py
index <HASH>..<HASH> 100644
--- a/addok/core.py
+++ b/addok/core.py
@@ -338,7 +338,9 @@ class Search(BaseHelper):
if self.geohash_key:
keys.append(self.geohash_key)
self.debug('Adding geohash %s', self.geohash_key)
- self.autocomplete(self.tokens, skip_commons=True)
+ if len(self.token) > 1:
+ # Do not give priority to autocomplete when only one token.
+ self.autocomplete(self.tokens, skip_commons=True)
if self.bucket_dry:
self.add_to_bucket(keys)
if not self.bucket_empty: | Do not give priority to autocomplete when only one common token
Rationale: "saintes" will never by found | addok_addok | train | py |
9dc907ac572247d6f965a19476fccd6eea8e8d0d | diff --git a/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java b/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java
+++ b/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java
@@ -301,7 +301,7 @@ public final class ExtendedEmailPublisherDescriptor extends BuildStepDescriptor<
}
props.put("mail.smtp.socketFactory.fallback", "false");
}
- if (acc.getSmtpUsername() != null) {
+ if (!StringUtils.isBlank(acc.getSmtpUsername())) {
props.put("mail.smtp.auth", "true");
}
@@ -322,7 +322,7 @@ public final class ExtendedEmailPublisherDescriptor extends BuildStepDescriptor<
}
private Authenticator getAuthenticator(final MailAccount acc) {
- if (acc == null || acc.getSmtpUsername() == null) {
+ if (acc == null || !StringUtils.isBlank(acc.getSmtpUsername())) {
return null;
}
return new Authenticator() { | Fix JENKINS-<I>
Updated to check for isBlank rather than null for authentication | jenkinsci_email-ext-plugin | train | java |
c9c153f01800fb21d40a5b23db42a914658c03f4 | diff --git a/src/Dropdown.js b/src/Dropdown.js
index <HASH>..<HASH> 100644
--- a/src/Dropdown.js
+++ b/src/Dropdown.js
@@ -30,8 +30,13 @@ const Dropdown = ({ children, className, trigger, options, ...props }) => {
});
const renderItems = () =>
- Children.map(children, element => {
- if (element.type.name === 'Divider') {
+ Children.map(children.filter(Boolean), element => {
+ if (element.type === 'li') {
+ return element;
+ } else if (
+ element.type.name === 'Divider' ||
+ element.type.displayName === 'Divider'
+ ) {
return <li key={idgen()} className="divider" tabIndex="-1" />;
} else {
return <li key={idgen()}>{element}</li>; | Filter children in dropdown to allow null entries, direct <li/> children, and properly handle Divider in minimized code. | react-materialize_react-materialize | train | js |
4a9734b48e978b1edbf029faf03301c74d1bc6f4 | diff --git a/server/src/main/resources/assets/js/grapes-webApp.js b/server/src/main/resources/assets/js/grapes-webApp.js
index <HASH>..<HASH> 100644
--- a/server/src/main/resources/assets/js/grapes-webApp.js
+++ b/server/src/main/resources/assets/js/grapes-webApp.js
@@ -178,7 +178,7 @@ function displayModuleLicenseOptions(){
getModuleLicenses();
$(".export").on('click', function (event) {
- exportTableToCSV.apply(this, [$('#table'), 'export.csv']);
+ exportTableToCSV.apply(this, [$('table'), 'export.csv']);
});
}
@@ -1229,7 +1229,7 @@ function getArtifactLicenses(){
var html = "<table class=\"table table-bordered table-hover\" id=\"table-of-result\">\n";
html += "<thead><tr><td>Licenses</td></tr></thead>\n";
html += "<tbody>\n";
-
+
$.ajax({
type: "GET",
url: "/artifact/"+ gavc + "/licenses",
@@ -1572,4 +1572,4 @@ function updateProduct(){
setTimeout(function(){
getProductOverview();
}, 500);
-}
\ No newline at end of file
+} | Fixing the issue of license table generating an empty CSV export file | Axway_Grapes | train | js |
bef4a9aeec041c4d23676ed7c244a7a51c3bf271 | diff --git a/hamster/stuff.py b/hamster/stuff.py
index <HASH>..<HASH> 100644
--- a/hamster/stuff.py
+++ b/hamster/stuff.py
@@ -135,7 +135,7 @@ def format_activity(name, category, description, pad_description = False):
if description:
text+= "\n"
if pad_description:
- text += " "
+ text += " " * 23
text += """<span style="italic" size="small">%s</span>""" % description | padding description some more since we have now also end time.
this is somewhat lame though | projecthamster_hamster | train | py |
46596bbd22ca5401d76f433d73c7746157f9c61c | diff --git a/mbed/mbed.py b/mbed/mbed.py
index <HASH>..<HASH> 100644
--- a/mbed/mbed.py
+++ b/mbed/mbed.py
@@ -1122,8 +1122,13 @@ class Program(object):
# Gets mbed tools dir (unified)
def get_tools_dir(self):
mbed_os_path = self.get_os_dir()
+ # mbed-os dir identified and tools is a sub dir
if mbed_os_path and os.path.isdir(os.path.join(mbed_os_path, 'tools')):
return os.path.join(mbed_os_path, 'tools')
+ # mbed-os not identified but tools found under cwd/tools
+ elif os.path.isdir(os.path.join(self.path, 'tools')):
+ return os.path.join(self.path, 'tools')
+ # mbed Classic deployed tools
elif os.path.isdir(os.path.join(self.path, '.temp', 'tools')):
return os.path.join(self.path, '.temp', 'tools')
else: | Improved mbed tools detection (#<I>) | ARMmbed_mbed-cli | train | py |
fa740c541031f30f28c34f872ed693652974cafa | diff --git a/pythran/passmanager.py b/pythran/passmanager.py
index <HASH>..<HASH> 100644
--- a/pythran/passmanager.py
+++ b/pythran/passmanager.py
@@ -137,6 +137,8 @@ class PassManager(object):
n = a.run(node, ctx)
if issubclass(transformation, Transformation):
ast.fix_missing_locations(node)
- else:
+ elif issubclass(transformation, Analysis):
a.display(n)
+ else:
+ pass # FIXME raise unknown_kind_of_pass or internal_error?
return n | Defensive approach in the pass manager when apply() on unknown pass type
I still don't know if we should raise or warn or whatever here. At least
do not call blindly display() unless there is a super-class for passes
that provide it.
Defensive programmign apart, code is more readable with the check for
'Analysis' type. Still wonder if "transformation" is the right name
for the pass. | serge-sans-paille_pythran | train | py |
aa2b5de5d03515d27e95ee49adaad54b4753dbeb | diff --git a/lib/amqp/server.rb b/lib/amqp/server.rb
index <HASH>..<HASH> 100644
--- a/lib/amqp/server.rb
+++ b/lib/amqp/server.rb
@@ -115,7 +115,7 @@ module Carrot::AMQP
@socket.connect
if ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE
- @socket.post_connection_check(@address)
+ @socket.post_connection_check(@host)
end
end | @host is the correct property to validate - not @address | famoseagle_carrot | train | rb |
17f28e7a06539f7a0fb8587e5aa9bbf7aaf2715b | diff --git a/gevent_openssl/SSL.py b/gevent_openssl/SSL.py
index <HASH>..<HASH> 100644
--- a/gevent_openssl/SSL.py
+++ b/gevent_openssl/SSL.py
@@ -2,9 +2,8 @@
"""
import OpenSSL.SSL
-import select
import socket
-import sys
+from gevent.socket import wait_read, wait_write
_real_connection = OpenSSL.SSL.Connection
@@ -26,21 +25,15 @@ class Connection(object):
return getattr(self._connection, attr)
def __iowait(self, io_func, *args, **kwargs):
- timeout = self._sock.gettimeout() or 0.1
fd = self._sock.fileno()
+ timeout = self._sock.gettimeout()
while True:
try:
return io_func(*args, **kwargs)
except (OpenSSL.SSL.WantReadError, OpenSSL.SSL.WantX509LookupError):
- sys.exc_clear()
- _, _, errors = select.select([fd], [], [fd], timeout)
- if errors:
- break
+ wait_read(fd, timeout=timeout)
except OpenSSL.SSL.WantWriteError:
- sys.exc_clear()
- _, _, errors = select.select([], [fd], [fd], timeout)
- if errors:
- break
+ wait_write(fd, timeout=timeout)
def accept(self):
sock, addr = self._sock.accept() | Fix infinite loop in __iowait (#6)
Use gevent's wait_read and wait_write instead of directly selecting
the file descriptor. | mjs_gevent_openssl | train | py |
189ab1c677e88f670f9269b0857efeb1e18f64ea | diff --git a/lib/fog/rackspace/mock_data.rb b/lib/fog/rackspace/mock_data.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/rackspace/mock_data.rb
+++ b/lib/fog/rackspace/mock_data.rb
@@ -39,7 +39,7 @@ module Fog
"OS-DCF:diskConfig" => "AUTO",
"created" => "2012-02-28T19:38:57Z",
"id" => image_id,
- "name" => "Ubuntu",
+ "name" => image_name,
"links" => [
{
"href" => "https://dfw.servers.api.rackspacecloud.com/v2/010101/images/#{image_id}",
@@ -77,7 +77,6 @@ module Fog
},
"minDisk" => 10,
"minRam" => 256,
- "name" => image_name,
"progress" => 100,
"status" => "ACTIVE",
"updated" => "2012-02-28T19:39:05Z" | Remove duplicated hash key in rackspace/mock_data.rb | fog_fog | train | rb |
3cd23cd3089390b2ee45edd6f3b44b0b1a6ba5f5 | diff --git a/peri/comp/exactpsf.py b/peri/comp/exactpsf.py
index <HASH>..<HASH> 100644
--- a/peri/comp/exactpsf.py
+++ b/peri/comp/exactpsf.py
@@ -404,7 +404,7 @@ class ExactLineScanConfocalPSF(psfs.PSF):
#Clipping params to computable values:
alpha = self.param_dict['psf-alpha']
zscale = self.param_dict['psf-zscale']
- wavelength = self.param_dict['laser-wavelength']
+ wavelength = self.param_dict['psf-laser-wavelength']
max_alpha, max_zscale = np.pi/2, 100.
if alpha < 1e-3 or alpha > max_alpha:
@@ -415,7 +415,7 @@ class ExactLineScanConfocalPSF(psfs.PSF):
self.param_dict['psf-zscale'] = np.clip(zscale, 1e-3, max_zscale-1e-3)
if wavelength < 1e-3:
warnings.warn('Invalid laser wavelength, clipping', RuntimeWarning)
- self.param_dict['laser-wavelength'] = np.clip(wavelength, 1e-3, np.inf)
+ self.param_dict['psf-laser-wavelength'] = np.clip(wavelength, 1e-3, np.inf)
def set_tile(self, tile):
if not hasattr(self, 'tile') or (self.tile.shape != tile.shape).any(): | Fixing psf dict key in prev. change<I> | peri-source_peri | train | py |
eb7b4255d69c935103e044b32b3a046c288d96e6 | diff --git a/werkzeug/formparser.py b/werkzeug/formparser.py
index <HASH>..<HASH> 100644
--- a/werkzeug/formparser.py
+++ b/werkzeug/formparser.py
@@ -413,7 +413,9 @@ class MultiPartParser(object):
disposition, extra = parse_options_header(disposition)
transfer_encoding = self.get_part_encoding(headers)
name = extra.get('name')
- filename = extra.get('filename')
+
+ # Accept filename* to support non-ascii filenames as per rfc2231
+ filename = extra.get('filename') or extra.get('filename*')
# if no content type is given we stream into memory. A list is
# used as a temporary container. | Add support for non-ascii filenames when uploading files using multipart/form-data (#<I>) | pallets_werkzeug | train | py |
6cc7712442cf23c7f846b73030c79ba12fdf4a0e | diff --git a/airflow/executors/local_executor.py b/airflow/executors/local_executor.py
index <HASH>..<HASH> 100644
--- a/airflow/executors/local_executor.py
+++ b/airflow/executors/local_executor.py
@@ -46,7 +46,6 @@ locally, into just one `LocalExecutor` with multiple modes.
import multiprocessing
import subprocess
-import time
from builtins import range
@@ -94,7 +93,6 @@ class LocalWorker(multiprocessing.Process, LoggingMixin):
def run(self):
self.execute_work(self.key, self.command)
- time.sleep(1)
class QueuedLocalWorker(LocalWorker):
@@ -116,7 +114,6 @@ class QueuedLocalWorker(LocalWorker):
break
self.execute_work(key, command)
self.task_queue.task_done()
- time.sleep(1)
class LocalExecutor(BaseExecutor):
@@ -164,7 +161,6 @@ class LocalExecutor(BaseExecutor):
def end(self):
while self.executor.workers_active > 0:
self.executor.sync()
- time.sleep(0.5)
class _LimitedParallelism(object):
"""Implements LocalExecutor with limited parallelism using a task queue to | [AIRFLOW-<I>] Remove sleep in localexecutor (#<I>) | apache_airflow | train | py |
998f9293403bf515c952ba310c344bb981936f6c | diff --git a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java
index <HASH>..<HASH> 100644
--- a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java
+++ b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java
@@ -1,5 +1,5 @@
//
-// $Id: StringUtil.java,v 1.3 2001/02/13 19:54:43 mdb Exp $
+// $Id: StringUtil.java,v 1.4 2001/03/02 01:49:48 mdb Exp $
package com.samskivert.util;
@@ -121,4 +121,26 @@ public class StringUtil
return buf.toString();
}
+
+ /**
+ * Generates a string from the supplied bytes that is the HEX encoded
+ * representation of those bytes.
+ */
+ public static String hexlate (byte[] bytes)
+ {
+ char[] chars = new char[bytes.length*2];
+
+ for (int i = 0; i < chars.length; i++) {
+ int val = (int)chars[i];
+ if (val < 0) {
+ val += 256;
+ }
+ chars[2*i] = XLATE.charAt(val/16);
+ chars[2*i+1] = XLATE.charAt(val%16);
+ }
+
+ return new String(chars);
+ }
+
+ private final static String XLATE = "0123456789abcdef";
} | Added hexlate() a function that takes an array of bytes and returns a
string that is the hex encoding of said bytes.
git-svn-id: <URL> | samskivert_samskivert | train | java |
755c0de49638c41f6c55498a92f55ef55f97dad8 | diff --git a/src/components/Editor/SearchBar.js b/src/components/Editor/SearchBar.js
index <HASH>..<HASH> 100644
--- a/src/components/Editor/SearchBar.js
+++ b/src/components/Editor/SearchBar.js
@@ -477,7 +477,7 @@ class SearchBar extends Component {
}
onKeyUp(e: SyntheticKeyboardEvent) {
- if (e.key != "Enter") {
+ if (e.key !== "Enter" || e.key !== "F3") {
return;
} | Added F3 for searching. (#<I>) | firefox-devtools_debugger | train | js |
073078e2221f9cf50d120d544d815a096fe5bfd2 | diff --git a/tests/test_include.py b/tests/test_include.py
index <HASH>..<HASH> 100644
--- a/tests/test_include.py
+++ b/tests/test_include.py
@@ -1,8 +1,13 @@
import pytest
from django.db.models import Count
-from django.db.models import OuterRef
-from django.db.models import Subquery
+try:
+ from django.db.models import OuterRef
+ from django.db.models import Subquery
+except ImportError: # Django < 1.11
+ HAS_SUBQUERIES = False
+else:
+ HAS_SUBQUERIES = True
from tests import models
from tests import factories
@@ -17,6 +22,7 @@ class TestQuerySet:
assert len(models.Cat.objects.include().all()) == 10
assert models.Cat.objects.include().all().count() == 10
+ @pytest.mark.skipif(not HAS_SUBQUERIES, reason='Subqueries not supported on older Django versions')
def test_values(self):
qs = models.Cat.objects.include('archetype')
list(qs.filter(id__in=Subquery(qs.filter(id=OuterRef('pk')).values('pk')))) | Fix tests on older versions of Django | chrisseto_django-include | train | py |
4a1a9d6b14d27fc2418c159eeb9fcb89b9f751fd | diff --git a/lnd_test.go b/lnd_test.go
index <HASH>..<HASH> 100644
--- a/lnd_test.go
+++ b/lnd_test.go
@@ -4847,6 +4847,15 @@ func TestLightningNetworkDaemon(t *testing.T) {
t.Logf("Running %v integration tests", len(testsCases))
for _, testCase := range testsCases {
+ logLine := fmt.Sprintf("STARTING ============ %v ============\n",
+ testCase.name)
+ if err := lndHarness.Alice.AddToLog(logLine); err != nil {
+ t.Fatalf("unable to add to log: %v", err)
+ }
+ if err := lndHarness.Bob.AddToLog(logLine); err != nil {
+ t.Fatalf("unable to add to log: %v", err)
+ }
+
success := t.Run(testCase.name, func(t1 *testing.T) {
ht := newHarnessTest(t1)
ht.RunTestCase(testCase, lndHarness) | lnd_test: add name of testcase to node's logfile
This commit adds a line of text including a test case's
name to Alice's and Bob's logfiles during integration
tests, making it easier to seek for the place in the log
where the specific tests start. | lightningnetwork_lnd | train | go |
5185683fd021c8a69de3981fa169d8d9933959cf | diff --git a/res/tests/axelitus/Base/TestsDotArr.php b/res/tests/axelitus/Base/TestsDotArr.php
index <HASH>..<HASH> 100644
--- a/res/tests/axelitus/Base/TestsDotArr.php
+++ b/res/tests/axelitus/Base/TestsDotArr.php
@@ -62,6 +62,7 @@ class TestsDotArr extends TestCase
$this->assertEquals(['a.aa' => 'A.AA', 'b' => 'B'], DotArr::get(['a' => ['aa' => 'A.AA'], 'b' => 'B', 'c' => 'C'], ['a.aa', 'b']));
$this->assertEquals(['a.aa' => 'A.AA', 'd' => null], DotArr::get(['a' => ['aa' => 'A.AA'], 'b' => 'B', 'c' => 'C'], ['a.aa', 'd']));
+ $this->assertEquals(['a.aa' => 'A.AA', 'a.aaa' => null], DotArr::get(['a' => ['aa' => 'A.AA'], 'b' => 'B', 'c' => 'C'], ['a.aa', 'a.aaa']));
}
public function testGetEx01() | Added a test for DotArr::get() fucntion. | axelitus_php-base | train | php |
a6478daf0fc42370b8eeec683dca86dd5bfc5181 | diff --git a/tests/src/java/com/threerings/presents/server/RefTest.java b/tests/src/java/com/threerings/presents/server/RefTest.java
index <HASH>..<HASH> 100644
--- a/tests/src/java/com/threerings/presents/server/RefTest.java
+++ b/tests/src/java/com/threerings/presents/server/RefTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertTrue;
/**
* Tests the oid list reference tracking code.
*/
-public class RefTest extends PresentsTest
+public class RefTest extends PresentsTestBase
{
@Test public void runTest ()
{ | That ended up being called PresentsTestBase.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
c3ca9a3af7b572059906c845f2cd30fa241d99f6 | diff --git a/tornado/test/twisted_test.py b/tornado/test/twisted_test.py
index <HASH>..<HASH> 100644
--- a/tornado/test/twisted_test.py
+++ b/tornado/test/twisted_test.py
@@ -453,9 +453,10 @@ else:
# Doesn't clean up its temp files
'test_shebang',
],
- 'twisted.internet.test.test_process.PTYProcessTestsBuilder': [
- 'test_systemCallUninterruptedByChildExit',
- ],
+ # Process tests appear to work on OSX 10.7, but not 10.6
+ #'twisted.internet.test.test_process.PTYProcessTestsBuilder': [
+ # 'test_systemCallUninterruptedByChildExit',
+ # ],
'twisted.internet.test.test_tcp.TCPClientTestsBuilder': [
'test_badContext', # ssl-related; see also SSLClientTestsMixin
], | Disable twisted process tests, which don't work for me on OSX <I> | tornadoweb_tornado | train | py |
ad7793942943907c512d9bb1307a14874fb8fee0 | diff --git a/lib/commands/execute.js b/lib/commands/execute.js
index <HASH>..<HASH> 100644
--- a/lib/commands/execute.js
+++ b/lib/commands/execute.js
@@ -8,6 +8,17 @@ import logger from '../logger';
let commands = {}, helpers = {}, extensions = {};
commands.execute = async function (script, args) {
+ if (script.match(/^mobile\:/)) {
+ script = script.replace(/^mobile\:/, '').trim();
+ return await this.executeMobile(script, _.isArray(args) ? args[0] : args);
+ } else {
+ if (this.isWebContext()) {
+ args = this.convertElementsForAtoms(args);
+ return await this.executeAtom('execute_script', [script, args]);
+ } else {
+ return await this.uiAutoClient.sendCommand(script);
+ }
+ }
if (this.isWebContext()) {
args = this.convertElementsForAtoms(args);
return await this.executeAtom('execute_script', [script, args]); | Make sure mobile:scroll is checked before web execute | appium_appium-ios-driver | train | js |
c25352f53f20400c9385d3cc8019d8e91975823c | diff --git a/media/boom/js/boom/chunk/asset/editor.js b/media/boom/js/boom/chunk/asset/editor.js
index <HASH>..<HASH> 100644
--- a/media/boom/js/boom/chunk/asset/editor.js
+++ b/media/boom/js/boom/chunk/asset/editor.js
@@ -38,7 +38,7 @@ function boomChunkAssetEditor(pageId, slotname, visibleElements) {
asset_id : this.asset.attr('data-asset-id'),
caption : this.caption.find('textarea').val(),
url : this.link.find('input').val(),
- title : this.title.find('input').val()
+ title : this.title.find('textarea').val()
};
}; | Bugfix: asset chunk title not saving | boomcms_boom-core | train | js |
e7cf48aa26e29cf33c11c2b91f6066cc138fb185 | diff --git a/rpcserver.go b/rpcserver.go
index <HASH>..<HASH> 100644
--- a/rpcserver.go
+++ b/rpcserver.go
@@ -214,6 +214,7 @@ func WalletRequestProcessor() {
// ignore
case tx.ErrInconsistantStore:
+ log.Warn("Detected inconsistant TxStore. Reconnecting...")
// Likely due to a mis-ordered btcd notification.
// To recover, close server connection and reopen
// all accounts from their last good state saved | Warn when inconsistant TxStore is detected. | btcsuite_btcwallet | train | go |
7ce3b5df6d5e15c0e4638dff2ce6c0153a53b0d5 | diff --git a/tests/PlayerTest.php b/tests/PlayerTest.php
index <HASH>..<HASH> 100644
--- a/tests/PlayerTest.php
+++ b/tests/PlayerTest.php
@@ -20,7 +20,7 @@ class PlayerTest extends TestCase
public function can_queue_a_play()
{
$player = new Player();
- $player->play('spock');
+ $player->move('spock');
$last_move = $player->getLastMove();
@@ -31,7 +31,7 @@ class PlayerTest extends TestCase
public function can_get_move_history()
{
$player = new Player();
- $player->play('rock');
+ $player->move('rock');
$history = $player->getMoveHistory();
@@ -44,7 +44,7 @@ class PlayerTest extends TestCase
$this->expectException(RockPaperScissorsSpockLizardException::class);
$player = new Player();
- $player->play('paper');
- $player->play('scissors');
+ $player->move('paper');
+ $player->move('scissors');
}
}
\ No newline at end of file | Updated test to reflect method name change from play() to move() | jarrettbarnett_RockPaperScissorsSpockLizard | train | php |
38b4b7b459393b649ebf255db640d1f9a0b99ec2 | diff --git a/website/data/alert-banner.js b/website/data/alert-banner.js
index <HASH>..<HASH> 100644
--- a/website/data/alert-banner.js
+++ b/website/data/alert-banner.js
@@ -8,5 +8,5 @@ export default {
linkText: 'Join Now',
// Set the expirationDate prop with a datetime string (e.g. '2020-01-31T12:00:00-07:00')
// if you'd like the component to stop showing at or after a certain date
- expirationDate: '2021-10-21T12:00:00-07:00',
+ expirationDate: '2021-10-20T23:00:00-07:00',
} | Update HashiConf alert-banner expiration
Updates the HashiConf Alert Banner expiration to <I>/<I> @ <I>pm (PT) | hashicorp_vagrant | train | js |
01e38ea8c7e496f17f6cf6160ecce902d24d0d45 | diff --git a/brozzler/browser.py b/brozzler/browser.py
index <HASH>..<HASH> 100644
--- a/brozzler/browser.py
+++ b/brozzler/browser.py
@@ -506,7 +506,6 @@ class Chrome:
# start_new_session - new process group so we can kill the whole group
self.chrome_process = subprocess.Popen(chrome_args, env=new_env,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=0,
- creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,
start_new_session=True)
self._out_reader_thread = threading.Thread(target=self._read_stderr_stdout,
name="ChromeOutReaderThread(pid={})".format(self.chrome_process.pid))
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ import setuptools
setuptools.setup(
name='brozzler',
- version='1.1.dev42',
+ version='1.1.dev43',
description='Distributed web crawling with browsers',
url='https://github.com/internetarchive/brozzler',
author='Noah Levitt', | oops didn't mean to leave that windows-only subprocess flag | internetarchive_brozzler | train | py,py |
1f49faf9262db9282431e8981d45872a4ef6287c | diff --git a/lib/ProMotion/table/cell/table_view_cell_module.rb b/lib/ProMotion/table/cell/table_view_cell_module.rb
index <HASH>..<HASH> 100644
--- a/lib/ProMotion/table/cell/table_view_cell_module.rb
+++ b/lib/ProMotion/table/cell/table_view_cell_module.rb
@@ -22,7 +22,7 @@ module ProMotion
# TODO: Remove this in ProMotion 2.1. Just for migration purposes.
def check_deprecated_styles
- whitelist = [ :title, :subtitle, :image, :remote_image, :accessory, :selection_style, :action, :arguments, :cell_style, :cell_class, :cell_identifier, :editing_style, :search_text, :keep_selection, :height ]
+ whitelist = [ :title, :subtitle, :image, :remote_image, :accessory, :selection_style, :action, :long_press_action, :arguments, :cell_style, :cell_class, :cell_identifier, :editing_style, :search_text, :keep_selection, :height ]
if (data_cell.keys - whitelist).length > 0
PM.logger.deprecated("In #{self.table_screen.class.to_s}#table_data, you should set :#{(data_cell.keys - whitelist).join(", :")} in a `styles:` hash. See TableScreen documentation.")
end | Add long_press_action to the cell non-deprecated whitelist. | infinitered_ProMotion | train | rb |
6e0413e7263bd5379ae5009675be4e6627a0a55f | diff --git a/src/lib/Supra/Controller/Pages/Filter/ParsedHtmlFilter.php b/src/lib/Supra/Controller/Pages/Filter/ParsedHtmlFilter.php
index <HASH>..<HASH> 100644
--- a/src/lib/Supra/Controller/Pages/Filter/ParsedHtmlFilter.php
+++ b/src/lib/Supra/Controller/Pages/Filter/ParsedHtmlFilter.php
@@ -42,8 +42,6 @@ class ParsedHtmlFilter implements FilterInterface
*/
private function parseSupraLinkStart(Entity\ReferencedElement\LinkReferencedElement $link)
{
- ObjectRepository::setCallerParent($link, $this);
-
$attributes = array(
'target' => $link->getTarget(),
'title' => $link->getTitle(),
@@ -194,6 +192,8 @@ class ParsedHtmlFilter implements FilterInterface
else {
$link = $metadataItem->getReferencedElement();
+ // Overwriting in case of duplicate markup tag usage
+ ObjectRepository::setCallerParent($link, $this, true);
$result[] = $this->parseSupraLinkStart($link);
}
} | Bug #<I> fixed, ObjectRepository::setCallerParent was called twice, guess because of duplicate supra link markup ID inside the editable HTML.
git-svn-id: <URL> | sitesupra_sitesupra | train | php |
6354c257c38f49eb448ab1dc91aac16f27f9d2c3 | diff --git a/charmhelpers/contrib/openstack/neutron.py b/charmhelpers/contrib/openstack/neutron.py
index <HASH>..<HASH> 100644
--- a/charmhelpers/contrib/openstack/neutron.py
+++ b/charmhelpers/contrib/openstack/neutron.py
@@ -249,6 +249,8 @@ def neutron_plugins():
plugins['nsx']['server_packages'].remove('neutron-plugin-vmware')
plugins['nsx']['server_packages'].append('python-vmware-nsx')
plugins['nsx']['config'] = '/etc/neutron/nsx.ini'
+ plugins['vsp']['driver'] = (
+ 'nuage_neutron.plugins.nuage.plugin.NuagePlugin')
return plugins | Added Nuage Neutron plugin information for mitaka release when neutron-plugin is vsp | juju_charm-helpers | train | py |
bf4fe8c82e901c0af7d1de096b01ada3f30d899d | diff --git a/lib/daru/dataframe.rb b/lib/daru/dataframe.rb
index <HASH>..<HASH> 100644
--- a/lib/daru/dataframe.rb
+++ b/lib/daru/dataframe.rb
@@ -357,8 +357,7 @@ module Daru
# Access row or vector. Specify name of row/vector followed by axis(:row, :vector).
# Defaults to *:vector*. Use of this method is not recommended for accessing
- # rows or vectors. Use df.row[:a] for accessing row with index ':a' or
- # df.vector[:vec] for accessing vector with index *:vec*.
+ # rows. Use df.row[:a] for accessing row with index ':a'.
def [](*names)
if names[-1] == :vector or names[-1] == :row
axis = names[-1] | Fix doc recommending against using []
The comments on the #vector method say that it has been deprecated, but the comments
on #[] say to use #vector. I think #[] is actually preferred. | SciRuby_daru | train | rb |
d69a904f2c37947b30da35d623a47ba061c88ad4 | diff --git a/luigi/scheduler.py b/luigi/scheduler.py
index <HASH>..<HASH> 100644
--- a/luigi/scheduler.py
+++ b/luigi/scheduler.py
@@ -127,6 +127,10 @@ class CentralPlannerScheduler(Scheduler):
self.update(worker)
task = self._tasks.setdefault(task_id, Task(status=PENDING, deps=deps))
+
+ if task.remove is not None:
+ task.remove = None # unmark task for removal so it isn't removed after being added
+
if not (task.status == RUNNING and status == PENDING):
# don't allow re-scheduling of task while it is running, it must either fail or succeed first
task.status = status | Dont remove tasks that are added after removal mark
Change-Id: I<I>ebd<I>e<I>e<I>e4b4c<I>f4c<I>b
Reviewed-on: <URL> | spotify_luigi | train | py |
102e4e69482c433344297c968a649c7855519b0f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -39,7 +39,7 @@ module.exports = function(Parser) {
// Not a BigInt, reset and parse again
if (this.input.charCodeAt(this.pos) != 110) {
this.pos = start
- super.readNumber(startsWithDot)
+ return super.readNumber(startsWithDot)
}
let str = this.input.slice(start, this.pos) | Fix parsing of normal int literals | acornjs_acorn-bigint | train | js |
df06a65dc0e4fa9a4fb63a8b815833f12fe8d7d5 | diff --git a/test/Expr/NotLikeExprTest.php b/test/Expr/NotLikeExprTest.php
index <HASH>..<HASH> 100644
--- a/test/Expr/NotLikeExprTest.php
+++ b/test/Expr/NotLikeExprTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Cekurte\Resource\Query\Language\Test;
+namespace Cekurte\Resource\Query\Language\Test\Expr;
use Cekurte\Resource\Query\Language\Expr\NotLikeExpr;
use Cekurte\Tdd\ReflectionTestCase; | Added the php unit tests to the NotLikeExpr class. | jpcercal_resource-query-language | train | php |
ffd0f9feca37048d1a8feb303103fedc4eff4d96 | diff --git a/core/src/main/java/io/grpc/inprocess/InProcessSocketAddress.java b/core/src/main/java/io/grpc/inprocess/InProcessSocketAddress.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/grpc/inprocess/InProcessSocketAddress.java
+++ b/core/src/main/java/io/grpc/inprocess/InProcessSocketAddress.java
@@ -33,4 +33,9 @@ public final class InProcessSocketAddress extends SocketAddress {
public String getName() {
return name;
}
+
+ @Override
+ public String toString() {
+ return name;
+ }
} | inprocess: add a toString for InProcessSocketAddress
The motivation here is in some cases we log the remote-addr that is set in the gRPC call attributes, and have to special case this type to support inprocess servers. | grpc_grpc-java | train | java |
32051ce625b35d7d88f41eba37e9fc534fe546f6 | diff --git a/bw2python/client.py b/bw2python/client.py
index <HASH>..<HASH> 100644
--- a/bw2python/client.py
+++ b/bw2python/client.py
@@ -16,8 +16,8 @@ class Client(object):
if handler is not None:
status = frame.getFirstValue("status")
reason = frame.getFirstValue("reason")
- response = BosswaveResponse(status, reason)
- handler(response)
+ response = BosswaveResponse(status, reason)
+ handler(response)
elif frame.command == "rslt":
finished = frame.getFirstValue("finished") | Fixed problem with null response handlers | SoftwareDefinedBuildings_bw2python | train | py |
32ffda773fe21a9320db0460e1e2599db0e17c03 | diff --git a/src/IndexManager.php b/src/IndexManager.php
index <HASH>..<HASH> 100644
--- a/src/IndexManager.php
+++ b/src/IndexManager.php
@@ -10,12 +10,11 @@ use Symfony\Component\PropertyAccess\PropertyAccess;
class IndexManager implements IndexManagerInterface
{
- public $propertyAccessor;
-
protected $engine;
protected $configuration;
protected $useSerializerGroups;
+ private $propertyAccessor;
private $searchableEntities;
private $aggregators;
private $entitiesAggregators; | Property accessor wasn't public before | algolia_search-bundle | train | php |
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.