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
a6134c4edc85d876fdcbe9137ba9f3109ddd3d06
diff --git a/blueocean-core-js/src/js/analytics/AnalyticsService.js b/blueocean-core-js/src/js/analytics/AnalyticsService.js index <HASH>..<HASH> 100644 --- a/blueocean-core-js/src/js/analytics/AnalyticsService.js +++ b/blueocean-core-js/src/js/analytics/AnalyticsService.js @@ -18,7 +18,7 @@ export class AnalyticsService { }, body: JSON.stringify({ name: eventName, - properties: { properties }, + properties: properties, }), }; return Fetch.fetch(url, { fetchOptions });
Properies object not being passed when track() sent (#<I>)
jenkinsci_blueocean-plugin
train
js
67bf96da703dee6e4b22440d3453f4c660e441bd
diff --git a/src/morfologik/fsa/FSA5Serializer.java b/src/morfologik/fsa/FSA5Serializer.java index <HASH>..<HASH> 100644 --- a/src/morfologik/fsa/FSA5Serializer.java +++ b/src/morfologik/fsa/FSA5Serializer.java @@ -211,8 +211,7 @@ public final class FSA5Serializer { final State[] states = s.states; final boolean[] final_transitions = s.final_transitions; - final int maxTransition = labels.length - 1; - final int lastTransition = 0; + final int lastTransition = labels.length - 1; offset += nodeDataLength; if (nodeDataLength > 0 && os != null) { @@ -227,7 +226,7 @@ public final class FSA5Serializer { bb.clear(); } - for (int i = maxTransition; i >= 0; i--) { + for (int i = 0; i <= lastTransition; i++) { final State target = states[i]; int targetOffset;
Changed the order of serialized arcs to reflect the alphabetic order (or whatever the comparator is). It was for some reason reversed.
morfologik_morfologik-stemming
train
java
fb13d65b43d013d69a720623a238f51b2e9e1771
diff --git a/qtpylib/broker.py b/qtpylib/broker.py index <HASH>..<HASH> 100644 --- a/qtpylib/broker.py +++ b/qtpylib/broker.py @@ -508,7 +508,7 @@ class Broker(): # --------------------------------------- def _create_order(self, symbol, direction, quantity, order_type="", \ limit_price=0, expiry=0, orderId=0, ticksize=0.01, \ - target=0, initial_stop=0, trail_stop_at=0, trail_stop_by=0): + target=0, initial_stop=0, trail_stop_at=0, trail_stop_by=0, **kwargs): # force BUY/SELL (not LONG/SHORT) direction = direction.replace("LONG", "BUY").replace("SHORT", "SELL") @@ -520,6 +520,9 @@ class Broker(): # continue... + if "stoploss" in kwargs and initial_stop == 0: + initial_stop = kwargs['stoploss'] + order_type = "MARKET" if limit_price == 0 else "LIMIT" # clear expired pending orders
allow use of stoploss as synonym to initial_stop
ranaroussi_qtpylib
train
py
039d62fce27cbd5697a9d6438e60361aa0094651
diff --git a/hgtools/__init__.py b/hgtools/__init__.py index <HASH>..<HASH> 100644 --- a/hgtools/__init__.py +++ b/hgtools/__init__.py @@ -349,7 +349,7 @@ def file_finder_plugin(dirname="."): distutils.log.warn("Error getting managers in hgtools.file_finder_plugin: %s", e) return [] -def patch_egg_info(): +def patch_egg_info(force_hg_version=False): from setuptools.command.egg_info import egg_info from pkg_resources import safe_version import functools @@ -357,7 +357,8 @@ def patch_egg_info(): @functools.wraps(orig_ver) def tagged_version(self): using_hg_version = ( - self.distribution.use_hg_version + force_hg_version + or self.distribution.use_hg_version or self.distribution.use_hg_version_increment ) if using_hg_version:
Yet another attempt to fix installing hgtools
jaraco_hgtools
train
py
538a48a48869b6d16344ec0999ed60968ea91571
diff --git a/pupa/importers/base.py b/pupa/importers/base.py index <HASH>..<HASH> 100644 --- a/pupa/importers/base.py +++ b/pupa/importers/base.py @@ -137,6 +137,9 @@ class BaseImporter(object): except self.model_class.DoesNotExist: raise UnresolvedIdError('cannot resolve psuedo id to {}: {}'.format( self.model_class.__name__, json_id)) + except self.model_class.MultipleObjectsReturned: + raise UnresolvedIdError('multiple objects returned for psuedo id to {}: {}'.format( + self.model_class.__name__, json_id)) # return the cached object return self.psuedo_id_cache[json_id]
more useful message for multiple results in psuedo-id
opencivicdata_pupa
train
py
6f05b676209c47fd9c96f9d4a6e69474c94a3ba4
diff --git a/lib/rails-settings/scopes.rb b/lib/rails-settings/scopes.rb index <HASH>..<HASH> 100644 --- a/lib/rails-settings/scopes.rb +++ b/lib/rails-settings/scopes.rb @@ -2,7 +2,7 @@ module RailsSettings module Scopes def with_settings joins("INNER JOIN settings ON #{settings_join_condition}"). - uniq + distinct end def with_settings_for(var)
Use #distinct instead of deprecated #uniq
ledermann_rails-settings
train
rb
539363fb8ab2e8bee9b1d2fac0f3d9610f45ccc6
diff --git a/apitester/index.php b/apitester/index.php index <HASH>..<HASH> 100755 --- a/apitester/index.php +++ b/apitester/index.php @@ -22,6 +22,7 @@ $apiurl = (isset($_POST['apiurl'])) ? $_POST['apiurl'] : @$_SESSION['apiurl']; if (!empty($apiurl) && substr($apiurl, -1) !== '/') { $apiurl .= '/'; } +$_SESSION['apiurl'] = $apiurl; //clear the debug info if (!empty($_POST['auth']) && $_POST['auth'] != @$_SESSION['auth']) { @@ -176,7 +177,6 @@ if (isset($_SESSION['redirect'])) { $_SESSION['settings']['OAuth2']['state'] = $state; $_SESSION['auth'] = $auth; - $_SESSION['apiurl'] = $apiurl; $_SESSION['apiendpoint'] = $apiendpoint; $_SESSION['responsetype'] = $responsetype; $_SESSION['method'] = $method;
Fixed issue with api url not saving to session in the api tester
mautic_api-library
train
php
f16ee718f5a0084f234b7c75bbe11f0c0c44503b
diff --git a/themes/RedMallee/Menu/SubHorizontal/Component.js b/themes/RedMallee/Menu/SubHorizontal/Component.js index <HASH>..<HASH> 100644 --- a/themes/RedMallee/Menu/SubHorizontal/Component.js +++ b/themes/RedMallee/Menu/SubHorizontal/Component.js @@ -4,14 +4,17 @@ Kwf.onElementReady('.redMalleeMenuSubHorizontal', function(el) { $(menu).before('<a class="arrowLeft"></a>').before('<a class="arrowRight"></a>'); var arrowLeft = $(el.child('.arrowLeft').dom).hide(); var arrowRight = $(el.child('.arrowRight').dom); + $(menu).on('touchend', function(event) { + event.preventDefault(); + }); arrowLeft.bind('click', function() { $(menu).animate({ - scrollLeft: 0 + scrollLeft: '-=' + ($(menu).innerWidth() - arrowLeft.width()) }, 500); }); arrowRight.bind('click', function() { $(menu).animate({ - scrollLeft: menu.scrollWidth - $(menu).innerWidth() + scrollLeft: '+=' + ($(menu).innerWidth() - arrowLeft.width()) }, 500); }); $(menu).scroll(function(event) {
SubHorizontal clickable menuScroll animates only screen width and not to the end
koala-framework_koala-framework
train
js
4057541bff5fd4cd657569ebd1242556f174b965
diff --git a/addons/knobs/src/registerKnobs.js b/addons/knobs/src/registerKnobs.js index <HASH>..<HASH> 100644 --- a/addons/knobs/src/registerKnobs.js +++ b/addons/knobs/src/registerKnobs.js @@ -37,6 +37,12 @@ function knobClicked(clicked) { function resetKnobs() { knobStore.reset(); + setPaneKnobs(false); +} + +function resetKnobsAndForceReRender() { + knobStore.reset(); + forceReRender(); setPaneKnobs(false); @@ -47,7 +53,7 @@ function disconnectCallbacks() { channel.removeListener(CHANGE, knobChanged); channel.removeListener(CLICK, knobClicked); channel.removeListener(STORY_CHANGED, resetKnobs); - channel.removeListener(RESET, resetKnobs); + channel.removeListener(RESET, resetKnobsAndForceReRender); knobStore.unsubscribe(setPaneKnobs); } @@ -56,7 +62,7 @@ function connectCallbacks() { channel.on(CHANGE, knobChanged); channel.on(CLICK, knobClicked); channel.on(STORY_CHANGED, resetKnobs); - channel.on(RESET, resetKnobs); + channel.on(RESET, resetKnobsAndForceReRender); knobStore.subscribe(setPaneKnobs); return disconnectCallbacks;
Merge pull request #<I> from gaetanmaisse/fix-<I> fix: remove call to `forceReRender()` on STORY_CHANGED in addon knobs
storybooks_storybook
train
js
57821a3c0d14a25bfe8fb84116d79655972a63a4
diff --git a/src/App/Assets.php b/src/App/Assets.php index <HASH>..<HASH> 100644 --- a/src/App/Assets.php +++ b/src/App/Assets.php @@ -347,7 +347,7 @@ class Assets $response->headers->set($response->headers->make('X-Robots-Tag', 'noindex')); } if (isset($options['download'])) { - $response->headers->set($response->headers->make('Content-Disposition', 'attachment; filename=' . pathinfo($filename, PATHINFO_BASENAME))); + $response->headers->set($response->headers->make('Content-Disposition', 'attachment; filename="' . pathinfo($filename, PATHINFO_BASENAME) . '"')); } $mimeType = $this->getMimeType($filename); if ($mimeType !== null) {
Fixed filename when downloading an asset.
bearframework_bearframework
train
php
7753f2df764e25d7e77907a6fc6986b600cbe744
diff --git a/src/Services/RestService.php b/src/Services/RestService.php index <HASH>..<HASH> 100644 --- a/src/Services/RestService.php +++ b/src/Services/RestService.php @@ -14,6 +14,7 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception as GuzzleException; use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Support\Arr; use InvalidArgumentException; use Psr\Http\Message\ResponseInterface; use Throwable; @@ -404,7 +405,7 @@ class RestService extends AbstractService continue; } - foreach (array_dot($value) as $dotKey => $leafValue) { + foreach (Arr::dot($value) as $dotKey => $leafValue) { $partKey = $key . implode( array_map(
Replaced array_dot call with Arr::dot
czim_laravel-service
train
php
2a61309cad794848e247e2d3de7369b96e12efd1
diff --git a/plugin/metrics/handler.go b/plugin/metrics/handler.go index <HASH>..<HASH> 100644 --- a/plugin/metrics/handler.go +++ b/plugin/metrics/handler.go @@ -26,7 +26,14 @@ func (m *Metrics) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg rw := dnstest.NewRecorder(w) status, err := plugin.NextOrFailure(m.Name(), m.Next, ctx, rw, r) - vars.Report(WithServer(ctx), state, zone, rcode.ToString(rw.Rcode), rw.Len, rw.Start) + rc := rw.Rcode + if !plugin.ClientWrite(status) { + // when no response was written, fallback to status returned from next plugin as this status + // is actually used as rcode of DNS response + // see https://github.com/coredns/coredns/blob/master/core/dnsserver/server.go#L318 + rc = status + } + vars.Report(WithServer(ctx), state, zone, rcode.ToString(rc), rw.Len, rw.Start) return status, err }
when no response is written, fallback to status of next plugin in prometheus plugin (#<I>) * when no response is written, fallback to status of next plugin in prometheus plugin
coredns_coredns
train
go
60581bb517ae3de0e6301d90cb3a59ad9cc5063d
diff --git a/lib/adminlib.php b/lib/adminlib.php index <HASH>..<HASH> 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -4125,8 +4125,8 @@ function &admin_get_root($reload=false, $requirefulltree=true) { include($file); } } - if (file_exists($CFG->dirroot.'/local/localsettings.php')) { - include_once($CFG->dirroot.'/local/localsettings.php'); + if (file_exists($CFG->dirroot.'/local/settings.php')) { + include_once($CFG->dirroot.'/local/settings.php'); } } diff --git a/lib/locallib.php b/lib/locallib.php index <HASH>..<HASH> 100644 --- a/lib/locallib.php +++ b/lib/locallib.php @@ -48,6 +48,17 @@ * with $oldversion set to 0, so that all the updates run. * * + * Local admin menu items + * ---------------------- + * + * It is possible to add new items to the admin_tree block. + * To do this, create a file, local/settings.php + * which can access the $ADMIN variable directly and add things to it. + * You might do something like: + * $ADMIN->add('root', new admin_category($name, $title); + * $ADMIN->add('foo', new admin_externalpage($name, $title, $url, $cap); + * + * * Course deletion * --------------- *
Merged from MOODLE_<I>_STABLE: More on MDL-<I> - fixed up path to local/ settings file to be more consistent, added documentation in lib/locallib.php on how to create new local admin tree item
moodle_moodle
train
php,php
b948443ca9cf984ee5f82a27ae4d81e4eb4ed3ac
diff --git a/autoload.php b/autoload.php index <HASH>..<HASH> 100644 --- a/autoload.php +++ b/autoload.php @@ -7,6 +7,10 @@ * @link https://github.com/joomlatools/joomlatools-platform-legacy for the canonical source repository */ +if (!defined('JOOMLATOOLS_PLATFORM')) { + return; +} + // Add deprecated constants // @deprecated 4.0 $os = strtoupper(substr(PHP_OS, 0, 3));
#<I>: Make sure to check JOOMLATOOLS_PLATFORM is define in the autoload file.
joomlatools_joomlatools-platform-legacy
train
php
34e01088d4434b856a682b9ec1c85b5b6652601f
diff --git a/lib/resque_spec.rb b/lib/resque_spec.rb index <HASH>..<HASH> 100644 --- a/lib/resque_spec.rb +++ b/lib/resque_spec.rb @@ -3,7 +3,6 @@ require 'resque_spec/helpers' require 'resque_spec/matchers' module ResqueSpec - include Resque::Helpers extend self attr_accessor :inline @@ -103,6 +102,14 @@ module ResqueSpec 'stored_at' => payload[:stored_at] } end + + def encode(object) + Resque.encode(object) + end + + def decode(object) + Resque.decode(object) + end end config = RSpec.configuration
fixed compatibility for resque 2
leshill_resque_spec
train
rb
7c28cb943b7ef2045ba7c03d39108c5e1fec4150
diff --git a/config/laravel-uptime-monitor.php b/config/laravel-uptime-monitor.php index <HASH>..<HASH> 100644 --- a/config/laravel-uptime-monitor.php +++ b/config/laravel-uptime-monitor.php @@ -13,11 +13,11 @@ return [ 'notifications' => [ \Spatie\UptimeMonitor\Notifications\Notifications\SiteDown::class => ['slack'], \Spatie\UptimeMonitor\Notifications\Notifications\SiteRestored::class => ['slack'], - \Spatie\UptimeMonitor\Notifications\Notifications\SiteUp::class => ['slack'], + \Spatie\UptimeMonitor\Notifications\Notifications\SiteUp::class => [], \Spatie\UptimeMonitor\Notifications\Notifications\InvalidSslCertificateFound::class => ['slack'], \Spatie\UptimeMonitor\Notifications\Notifications\SoonExpiringSslCertificateFound::class => ['slack'], - \Spatie\UptimeMonitor\Notifications\Notifications\ValidSslCertificateFound::class => ['slack'], + \Spatie\UptimeMonitor\Notifications\Notifications\ValidSslCertificateFound::class => [], ], /**
Update laravel-uptime-monitor.php
spatie_laravel-uptime-monitor
train
php
41468230274945e35f23093345fac01d21f88299
diff --git a/lib/graphql/query/arguments.rb b/lib/graphql/query/arguments.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/query/arguments.rb +++ b/lib/graphql/query/arguments.rb @@ -19,6 +19,10 @@ module GraphQL argument_definitions.each do |key, _value| expose_as = argument_definitions[key].expose_as + + # Don't define a helper method if it would override something. + next if self.respond_to?(expose_as) + define_singleton_method expose_as do self[expose_as] end
dont define a helper method if it would override an existing method
rmosolgo_graphql-ruby
train
rb
762cdb41bf34421fb9a7016d572c119cedcc08b5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,8 @@ MAINTAINER = 'Steven Silvester' MAINTAINER_EMAIL = '[email protected]' URL = 'http://github.com/blink1073/oct2py' LICENSE = 'MIT' -REQUIRES = ["numpy (>= 1.7.1)", "scipy (>= 0.12)", "octave_kernel (>= 0.19)"] -INSTALL_REQUIRES = ["octave_kernel >= 0.19"] +REQUIRES = ["numpy (>= 1.7.1)", "scipy (>= 0.12)", "octave_kernel (>= 0.25)"] +INSTALL_REQUIRES = ["octave_kernel >= 0.25"] PACKAGES = [DISTNAME, '%s.tests' % DISTNAME, '%s/ipython' % DISTNAME, '%s/ipython/tests' % DISTNAME] PACKAGE_DATA = {DISTNAME: ['tests/*.m', '*.m']}
Bump octave_kernel dependency
blink1073_oct2py
train
py
5e896c062d37e71cffa990d2f0ad27db69f22bc8
diff --git a/src/main/java/org/asteriskjava/util/LogFactory.java b/src/main/java/org/asteriskjava/util/LogFactory.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/util/LogFactory.java +++ b/src/main/java/org/asteriskjava/util/LogFactory.java @@ -88,7 +88,7 @@ public final class LogFactory { return new Slf4JLogger(clazz); } - catch (Exception e) + catch (Throwable e) { slf4jLoggingAvailable = Boolean.FALSE; }
AJ-<I> - Catching ClassNotFoundError if SLF4J binding is missing
asterisk-java_asterisk-java
train
java
7c09227748a460e85507d656c7b6af1ca637c905
diff --git a/lib/celluloid/tasks.rb b/lib/celluloid/tasks.rb index <HASH>..<HASH> 100644 --- a/lib/celluloid/tasks.rb +++ b/lib/celluloid/tasks.rb @@ -70,7 +70,7 @@ module Celluloid @status = status - if @dangerous_suspend + if $CELLULOID_DEBUG && @dangerous_suspend warning = "Dangerously suspending task: " warning << [ "type=#{@type.inspect}", 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 @@ -1,9 +1,12 @@ +require 'coveralls' +Coveralls.wear! + require 'rubygems' require 'bundler/setup' require 'celluloid' require 'celluloid/rspec' -require 'coveralls' -Coveralls.wear! + +$CELLULOID_DEBUG = true logfile = File.open(File.expand_path("../../log/test.log", __FILE__), 'a') logfile.sync = true
Only log dangerous suspends if $CELLULOID_DEBUG is set These warnings aren't helpful and are way too annoying for average users. We should work on fixing the internal sources of these warnings before we expose them to average users of the framework. At the very least we need a way of acknowledging them and hiding them in situations where they're irrelevant.
celluloid_celluloid
train
rb,rb
df7aacb54186c2b49bbb1d70de205fdb9834120f
diff --git a/lib/prey/plugins/drivers/campfire/index.js b/lib/prey/plugins/drivers/campfire/index.js index <HASH>..<HASH> 100644 --- a/lib/prey/plugins/drivers/campfire/index.js +++ b/lib/prey/plugins/drivers/campfire/index.js @@ -95,6 +95,8 @@ var CampfireDriver = function(options){ if(!this.room) return; logger.info("Leaving room " + this.room.name); this.room.leave(); + + hooks.removeAllListeners(); this.emit('unload', err); }; diff --git a/lib/prey/plugins/drivers/console/index.js b/lib/prey/plugins/drivers/console/index.js index <HASH>..<HASH> 100644 --- a/lib/prey/plugins/drivers/console/index.js +++ b/lib/prey/plugins/drivers/console/index.js @@ -117,6 +117,7 @@ var ConsoleDriver = function(options){ if(err) logger.error(err); if(this.prompt) this.prompt.close(); process.stdin.destroy(); + hooks.removeAllListeners(); common.logger.on(); this.emit('unload', err); };
Console/Campfire drivers: remove all listeners when unloading.
prey_prey-node-client
train
js,js
ec1c0b318c32387fb14b0a754fb576154e7056b1
diff --git a/test/conftest.py b/test/conftest.py index <HASH>..<HASH> 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -94,3 +94,18 @@ def cache_path(monkeypatch): monkeypatch.setenv("HOME", tmp) yield tmp shutil.rmtree(tmp) + + +def pytest_itemcollected(item): + parent = item.parent.obj # Test class/module + node = item.obj # Test case + suite_doc = parent.__doc__.strip() if parent.__doc__ else None + case_doc = node.__doc__.strip() if node.__doc__ else None + if suite_doc and case_doc: + item._nodeid = '{0} [{1}]'.format(suite_doc, case_doc) + elif suite_doc and not case_doc: + item._nodeid = '{0} [{1}]'.format(suite_doc, node.__name__) + elif case_doc and not suite_doc: + item._nodeid = '{0} [{1}]'.format(parent.__name__, case_doc) + else: + item._nodeid = node.__name__
update test names based on docstrings
tonybaloney_wily
train
py
56723680961604163f5f49937dc0b7684afe0aa9
diff --git a/blueprints/flexberry-model/files/__root__/mixins/regenerated/models/__name__.js b/blueprints/flexberry-model/files/__root__/mixins/regenerated/models/__name__.js index <HASH>..<HASH> 100644 --- a/blueprints/flexberry-model/files/__root__/mixins/regenerated/models/__name__.js +++ b/blueprints/flexberry-model/files/__root__/mixins/regenerated/models/__name__.js @@ -1,10 +1,9 @@ import Ember from 'ember'; import DS from 'ember-data'; -<%if(projections) {%>import { Projection } from 'ember-flexberry-data';<%}%> -<% for (let enumName in enumImports) { %> +<% if (projections) { %>import { Projection } from 'ember-flexberry-data';<% } +for (let enumName in enumImports) { %> import <%= enumName %> from '../../../enums/<%= enumImports[enumName] %>';<% } %> - export let Model = Ember.Mixin.create({ <%= model %> });<%if(parentModelName) {%>
Fix flexberry-model blueprint JSCS errors in generated mixin
Flexberry_ember-flexberry
train
js
4cc99d24c2be8a546062465de1e3180786de6650
diff --git a/pypmc/_version.py b/pypmc/_version.py index <HASH>..<HASH> 100644 --- a/pypmc/_version.py +++ b/pypmc/_version.py @@ -1 +1 @@ -__version__ = '1.1' +__version__ = '1.1.1'
[version] bump to <I>
fredRos_pypmc
train
py
c0d69ba93c6454a84605d3213f9a545f65413f1e
diff --git a/aws/resource_aws_cognito_user_pool_client.go b/aws/resource_aws_cognito_user_pool_client.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_cognito_user_pool_client.go +++ b/aws/resource_aws_cognito_user_pool_client.go @@ -264,7 +264,7 @@ func resourceAwsCognitoUserPoolClientCreate(d *schema.ResourceData, meta interfa d.SetId(aws.StringValue(resp.UserPoolClient.ClientId)) if err = cognitoUserPoolUICustomizationSet(d, conn); err != nil { - return fmt.Errorf("Error setting User Pool Client UI Customization: %s", err) + return fmt.Errorf("Error setting Cognito User Pool Client UI Customization: %s", err) } return resourceAwsCognitoUserPoolClientRead(d, meta)
Update aws/resource_aws_cognito_user_pool_client.go
terraform-providers_terraform-provider-aws
train
go
df48229db79fd7082d0702c29fdf8659d27035e5
diff --git a/lib/yard/code_objects/base.rb b/lib/yard/code_objects/base.rb index <HASH>..<HASH> 100644 --- a/lib/yard/code_objects/base.rb +++ b/lib/yard/code_objects/base.rb @@ -272,7 +272,7 @@ module YARD # @return [String] if prefix is true, prefix + the name as a String. # This must be implemented by the subclass. def name(prefix = false) - prefix ? @name.to_s : @name + prefix ? @name.to_s : (defined?(@name) && @name) end # Associates a file with a code object, optionally adding the line where it was defined.
Fix "warning: instance variable @name not initialized"
lsegal_yard
train
rb
3ae18561e21114d580b3fcd2791b1c78ca86ab04
diff --git a/lib/reporters/dot_reporter.js b/lib/reporters/dot_reporter.js index <HASH>..<HASH> 100644 --- a/lib/reporters/dot_reporter.js +++ b/lib/reporters/dot_reporter.js @@ -15,6 +15,7 @@ function DotReporter(silent, out) { this.startTime = new Date(); this.endTime = null; this.currentLineChars = 0; + this.maxLineChars = Math.min(this.out.columns || 65, 65) - 5; this.out.write('\n'); this.out.write(' '); } @@ -37,7 +38,7 @@ DotReporter.prototype = { if (this.silent) { return; } - if (this.currentLineChars > 60) { + if (this.currentLineChars > this.maxLineChars) { this.currentLineChars = 0; this.out.write('\n '); }
use writeStream.columns to determine max length of the output
testem_testem
train
js
cd22fc20800d1ba841676428275c31bbf02ae06a
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,7 +8,7 @@ module.exports = function(grunt) { 'package.json', 'bower.json', 'readme.md', - 'example/js/directives/angular-pdf.js', + 'example/js/directives/angular-pdf.min.js', 'dist/angular-pdf.js', 'dist/angular-pdf.min.js' ], @@ -19,7 +19,7 @@ module.exports = function(grunt) { 'package.json', 'bower.json', 'readme.md', - 'example/js/directives/angular-pdf.js', + 'example/js/directives/angular-pdf.min.js', 'dist/angular-pdf.js', 'dist/angular-pdf.min.js' ], @@ -34,7 +34,7 @@ module.exports = function(grunt) { clean: { all: [ - 'example/js/directives/angular-pdf.js', + 'example/js/directives/angular-pdf.min.js', 'example/js/lib/*.js', 'dist/angular-pdf.js', 'dist/angular-pdf.min.js'
fix(Grunt): fixing path of angular-pdf in example folder
sayanee_angularjs-pdf
train
js
842d1aa1d0bb36f976d7a0dcfeedc65a646bb7db
diff --git a/source/core/oxbase.php b/source/core/oxbase.php index <HASH>..<HASH> 100644 --- a/source/core/oxbase.php +++ b/source/core/oxbase.php @@ -208,6 +208,8 @@ class oxBase extends oxSuperCfg $myConfig = $this->getConfig(); $this->_sCacheKey = $this->getViewName(); + $this->_addSkippedSaveFieldsForMapping(); + $this->_disableLazyLoadingForCaching(); if ( $this->_blUseLazyLoading ) { $this->_sCacheKey .= $myConfig->getActiveView()->getClassName(); @@ -1397,6 +1399,19 @@ class oxBase extends oxSuperCfg } /** + * Add additional fields to skipped save fields + */ + protected function _addSkippedSaveFieldsForMapping() + { + } + + /** + * Disable lazy loading if cache is enabled + */ + protected function _disableLazyLoadingForCaching() + { + } + /** * Checks if object ID's first two chars are 'o' and 'x'. Returns true or false * * @return bool
Added additional field to _aSkipSaveFields for multishops. Moved out version specific code into separate functions
OXID-eSales_oxideshop_ce
train
php
5aa55e7cea431ee675e5b73444c3e096eb2afbae
diff --git a/aiohttp/client.py b/aiohttp/client.py index <HASH>..<HASH> 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -287,7 +287,7 @@ class ClientRequest: query = params self.path = urllib.parse.urlunsplit( - ('', '', urllib.parse.quote(path, safe='/%'), query, fragment)) + ('', '', urllib.parse.quote(path, safe='/%:'), query, fragment)) def update_headers(self, headers): """Update request headers."""
make : safe char for path
aio-libs_aiohttp
train
py
ec02c5ce80e5c37fb543f001f94db02a4ef6d296
diff --git a/js/gateio.js b/js/gateio.js index <HASH>..<HASH> 100644 --- a/js/gateio.js +++ b/js/gateio.js @@ -169,6 +169,8 @@ module.exports = class gateio extends Exchange { 'BTCBULL': 'BULL', 'SBTC': 'Super Bitcoin', 'TNC': 'Trinity Network Credit', + '88MPH': 'MPH', + 'MPH': 'Morpher', // conflict with 88MPH }, }); }
gateio commonCurrencies MPH vs <I>MPH fix
ccxt_ccxt
train
js
d018110bfd10ed22800287e7db9bc97dd0f26c29
diff --git a/src/oidcmsg/__init__.py b/src/oidcmsg/__init__.py index <HASH>..<HASH> 100644 --- a/src/oidcmsg/__init__.py +++ b/src/oidcmsg/__init__.py @@ -1,5 +1,5 @@ __author__ = "Roland Hedberg" -__version__ = "1.6.1" +__version__ = "1.6.0" import os from typing import Dict
Don't jump to <I> . <I> is good enough.
openid_JWTConnect-Python-OidcMsg
train
py
94e7e7e58baeee54ab422c4a98427a51f307817f
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -825,6 +825,10 @@ def directory(name, Make sure that only files that are set up by salt and required by this function are kept. If this option is set then everything in this directory will be deleted unless it is required. + + require + Require other resources such as packages or files + ''' mode = __manage_mode(mode) ret = {'name': name, @@ -977,6 +981,23 @@ def recurse(name, Make sure that only files that are set up by salt and required by this function are kept. If this option is set then everything in this directory will be deleted unless it is required. + + require + Require other resources such as packages or files + + user + The user to own the directory, this defaults to the user salt is + running as on the minion + + group + The group ownership set for the directory, this defaults to the group + salt is running as on the minion + + dir_mode + The permissions mode to set any directories created + + file_mode + The permissions mode to set any files created ''' ret = {'name': name, 'changes': {},
Update the docstrings for file.directory and file.recurse This documents the newly added arguments
saltstack_salt
train
py
7c0280cb28dacdd50259697a42aa4869190cf236
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name="daemonize", - version="2.2.1", + version="2.2.2", py_modules=["daemonize"], author="Ilya Otyutskiy", author_email="[email protected]",
New version: <I>.
thesharp_daemonize
train
py
255535e1b4a7a5f8dd36fcf8d9ed9475bed62ff3
diff --git a/src/javascripts/frigging_bootstrap/components/switch.js b/src/javascripts/frigging_bootstrap/components/switch.js index <HASH>..<HASH> 100644 --- a/src/javascripts/frigging_bootstrap/components/switch.js +++ b/src/javascripts/frigging_bootstrap/components/switch.js @@ -43,6 +43,7 @@ export default class extends React.Component { this.state = { errors: undefined, + checked: true, } } @@ -51,10 +52,6 @@ export default class extends React.Component { span({className: `bootstrap-switch-handle-on bootstrap-switch-primary`}, "ON"), span({className: `bootstrap-switch-label`}, "\u00a0"), span({className: `bootstrap-switch-handle-off bootstrap-switch-default`}, "OFF"), - input({ - type: "checkbox", - checked: true, - }), ) }
Add Checked State For Switch Component Add the checked state for the switch component in order to know which part of the switch to display either ON or OFF.
frig-js_frig
train
js
a0df9b8e89734c4244d05c7b2436d7fe02f444e7
diff --git a/cocaine/proxy/proxy.py b/cocaine/proxy/proxy.py index <HASH>..<HASH> 100644 --- a/cocaine/proxy/proxy.py +++ b/cocaine/proxy/proxy.py @@ -475,8 +475,6 @@ class CocaineProxy(object): return try: - request.logger.debug("%s: processing request app: `%s`, event `%s`", - app.id, app.name, event) yield self.process(request, name, app, event, pack_httprequest(request)) except Exception as err: request.logger.error("error during processing request %s", err) @@ -495,7 +493,8 @@ class CocaineProxy(object): @gen.coroutine def process(self, request, name, app, event, data): - request.logger.info("start processing request after %.3f ms", request.request_time() * 1000) + request.logger.info("start processing event `%s` for an app `%s` (appid: %s) after %.3f ms", + event, app.name, app.id, request.request_time() * 1000) timeout = self.get_timeout(name) # allow to reconnect this amount of times. attempts = 2 # make it configurable
proxy(logs): log an app name, event and app.id
cocaine_cocaine-tools
train
py
eb3aed68e470e44c26bcf4d2973f204be8bff6cd
diff --git a/python/test/function/test_round.py b/python/test/function/test_round.py index <HASH>..<HASH> 100644 --- a/python/test/function/test_round.py +++ b/python/test/function/test_round.py @@ -20,7 +20,7 @@ from nbla_test_utils import list_context ctxs = list_context('Round') -def ref_round(x, ): +def ref_round(x): return np.round(x) def ref_grad_round(x, dy):
Delete unnecessary comma.
sony_nnabla
train
py
96f4cd1df916270f70b949ad8b79a5f1ca9d63cc
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -1240,7 +1240,7 @@ func (s *server) Stop() error { s.cc.feeEstimator.Stop() s.invoices.Stop() s.fundingMgr.Stop() - s.chanSubSwapper.Start() + s.chanSubSwapper.Stop() // Disconnect from each active peers to ensure that // peerTerminationWatchers signal completion to each peer.
server: stop chansubswapper on shutdown instead of start
lightningnetwork_lnd
train
go
fa672e47ceea3bcc6dbb0645be049581659ecf9c
diff --git a/lib/request_browser.js b/lib/request_browser.js index <HASH>..<HASH> 100644 --- a/lib/request_browser.js +++ b/lib/request_browser.js @@ -235,6 +235,9 @@ module.exports = function BlastRequestBrowser(Blast, Collection) { // Set a request if needed if (this.timeout != null) { xhr.timeout = this.timeout; + } else if (this.timeout != 0) { + // If no timeout is given, use a timeout of 60s + xhr.timeout = 60000; } // Always get the response as a blob
Set fallback XHR timeout of <I> seconds
skerit_protoblast
train
js
74f9894a120deb88d65c93b616b2b6f2d2fe4e7b
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -171,8 +171,11 @@ class PSHACalculator(base.HazardCalculator): for tile_i, tile in enumerate(tiles, 1): num_tasks = 0 num_sources = 0 - with self.monitor('prefiltering'): + if num_tiles > 1: logging.info('Prefiltering tile %d of %d', tile_i, len(tiles)) + else: + logging.info('Prefiltering sources') + with self.monitor('prefiltering'): src_filter = SourceFilter(tile, oq.maximum_distance) csm = self.csm.filter(src_filter) if tile_i == 1: # set it only on the first tile
Better monitoring [skip CI] Former-commit-id: <I>f<I>f9c<I>ee5fc9e9f<I>c<I>e7c<I>
gem_oq-engine
train
py
3261148297197fafb71d29467c59ed62412eec7d
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -271,6 +271,12 @@ module Discordrb register_event(AwaitEvent, attributes, block) end + def pm(attributes = {}, &block) + register_event(PrivateMessageEvent, attributes, block) + end + + alias_method :private_message, :pm + def remove_handler(handler) clazz = event_class(handler.class) @event_handlers[clazz].delete(handler)
Add a shorthand handler adder for PMs
meew0_discordrb
train
rb
d7bf21161ac8cc74ad30dcb6c40b8db4a2897748
diff --git a/test/agent.js b/test/agent.js index <HASH>..<HASH> 100644 --- a/test/agent.js +++ b/test/agent.js @@ -861,8 +861,6 @@ test('#captureError()', function (t) { let span = null const expect = [ 'metadata', - 'transaction', - 'span', 'error' ] @@ -873,8 +871,6 @@ test('#captureError()', function (t) { this.agent.captureError(new Error('with callback'), function () { t.pass('called callback') }) - span.end() - trans.end() }) .on('data-error', function (data) { t.equal(data.exception.message, 'with callback')
test: fix possible race condition (#<I>) Sometimes the error would arrive before the span and the tests would fail. Since we don't actually care about the arrival of the span or the transaction, we can just not end those and the test will not have a race condition anymore.
elastic_apm-agent-nodejs
train
js
cacfa0bcbe0639bde31e898a4ff4ee81ebfcb784
diff --git a/src/Traits/RequestTrait.php b/src/Traits/RequestTrait.php index <HASH>..<HASH> 100644 --- a/src/Traits/RequestTrait.php +++ b/src/Traits/RequestTrait.php @@ -13,21 +13,26 @@ trait RequestTrait public static function initialize(Request $request): void { /** - * The scope is only to properly initialize the Request $request on PUT requests + * Do this only if the Request $request is passed by the container */ - $httpPutStreamListener = new HttpPutStreamListener(); - $data = $httpPutStreamListener->getData( - $request - ); - if (!$data['isEmptyPutStream']) { - $request->initialize( - [], - $data['request'], - [], - [], - $data['files'] + if ($_SERVER['CONTENT_TYPE'] ?? null) { + /** + * The scope is only to properly initialize the Request $request on PUT requests + */ + $httpPutStreamListener = new HttpPutStreamListener(); + $data = $httpPutStreamListener->getData( + $request ); - $request->setRequestFormat('json'); + if (!$data['isEmptyPutStream']) { + $request->initialize( + [], + $data['request'], + [], + [], + $data['files'] + ); + $request->setRequestFormat('json'); + } } }
Fixed how HttpPutStreamListener is ran on PUT
mindlahus_symfony-assets
train
php
26e28a2de3c669ed12591695371ecc2479b5b855
diff --git a/src/query-ast-to-sql-ast/index.js b/src/query-ast-to-sql-ast/index.js index <HASH>..<HASH> 100644 --- a/src/query-ast-to-sql-ast/index.js +++ b/src/query-ast-to-sql-ast/index.js @@ -288,7 +288,7 @@ function handleTable(sqlASTNode, queryASTNode, field, gqlType, namespace, grabMa if (config.alwaysFetch) { for (let column of wrap(config.alwaysFetch)) { - children.push(columnToASTChild(column, namespace)) + children.push(columnToASTChild(unthunk(column, sqlASTNode.as, sqlASTNode.args || {}, context, sqlASTNode), namespace)) } }
Wrap alwaysFetch around unthunk Allow dynamically generating an alwaysFetch clause
acarl005_join-monster
train
js
ffb4fe712079918ff946776fcd45a53b8f5aad61
diff --git a/llrb_test.go b/llrb_test.go index <HASH>..<HASH> 100644 --- a/llrb_test.go +++ b/llrb_test.go @@ -227,6 +227,16 @@ func (s *S) TestRotateRight(c *check.C) { c.Check(tree, check.DeepEquals, rotTree) } +func (s *S) TestNilOperations(c *check.C) { + var e *Tree + for _, t := range []*Tree{nil, {}} { + c.Check(t.Min(), check.Equals, nil) + c.Check(t.Max(), check.Equals, nil) + c.Check(t.DeleteMin(), check.Equals, e) + c.Check(t.DeleteMax(), check.Equals, e) + } +} + func (s *S) TestInsertion(c *check.C) { min, max := compRune(0), compRune(1000) for _, t := range []*Tree{nil, {}} {
Test nil operations Tests that operations on an unallocated *Tree do not panic, and that they behave the same way as the same call on zeroed Tree.
biogo_store
train
go
ab6119b541081064bdf627e70d5895eb1a31983c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ try: from speedparser import VERSION version = ".".join(map(str, VERSION)) except: - version = '0.1.8' + version = '0.2.0' # some trove classifiers: diff --git a/speedparser/__init__.py b/speedparser/__init__.py index <HASH>..<HASH> 100644 --- a/speedparser/__init__.py +++ b/speedparser/__init__.py @@ -1,3 +1,3 @@ from speedparser import parse -VERSION = (0,1,8) +VERSION = (0,2,0) __all__ = ['parse', 'VERSION']
version bump for pypi push #5
jmoiron_speedparser
train
py,py
8045349cefc1d9c7fe9ba2fc25e771449bbdca3a
diff --git a/ceph_deploy/hosts/fedora/__init__.py b/ceph_deploy/hosts/fedora/__init__.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/hosts/fedora/__init__.py +++ b/ceph_deploy/hosts/fedora/__init__.py @@ -1,4 +1,5 @@ import mon +from ceph_deploy.hosts.centos import pkg from install import install, mirror_install from uninstall import uninstall
shortcut in fedora to use pkg from centos
ceph_ceph-deploy
train
py
d74b5a79db0d06096a02ed02d750fed85d4e09e0
diff --git a/lib/cldr/export/data/numbers.rb b/lib/cldr/export/data/numbers.rb index <HASH>..<HASH> 100644 --- a/lib/cldr/export/data/numbers.rb +++ b/lib/cldr/export/data/numbers.rb @@ -107,7 +107,7 @@ module Cldr def unit @unit ||= select("numbers/currencyFormats/unitPattern").inject({}) do |result, node| - count = node.attribute('count').value rescue 'one' + count = node.attribute('count').value result[count] = node.content result end
Do not default the `count` attribute This attribute is required by the `ldml.dtd`, and indeed, there is no case in the data that is missing that attribute
ruby-i18n_ruby-cldr
train
rb
28568df4a661745c720added9ae98476716262c3
diff --git a/bosh-stemcell/spec/support/stemcell_shared_examples.rb b/bosh-stemcell/spec/support/stemcell_shared_examples.rb index <HASH>..<HASH> 100644 --- a/bosh-stemcell/spec/support/stemcell_shared_examples.rb +++ b/bosh-stemcell/spec/support/stemcell_shared_examples.rb @@ -9,5 +9,10 @@ shared_examples_for 'All Stemcells' do it { should be_file } it { should contain expected_version } end + + describe file '/var/vcap/bosh/etc/stemcell_git_sha1' do + it { should be_file } + its(:content) { should match '^[0-9a-f]{40}\+?$' } + end end end
add a test to check that stemcell_got_sha1 file exists and has the correct content [#<I>] <URL>
cloudfoundry_bosh
train
rb
72c6d7d01909f51c4a0e1e7ca9b9902d651b691a
diff --git a/sk_dsp_comm/sigsys.py b/sk_dsp_comm/sigsys.py index <HASH>..<HASH> 100644 --- a/sk_dsp_comm/sigsys.py +++ b/sk_dsp_comm/sigsys.py @@ -545,9 +545,11 @@ def OA_filter(x,h,N,mode=0): Examples -------- - >>> n = arange(0,100) - >>> x cos(2*pi*0.05*n) - >>> b = ones(10) + >>> import numpy as np + >>> from sk_dsp_comm.sigsys import OA_filter + >>> n = np.arange(0,100) + >>> x = np.cos(2*pi*0.05*n) + >>> b = np.ones(10) >>> y = OA_filter(x,h,N) >>> # set mode = 1 >>> y, y_mat = OA_filter(x,h,N,1)
Adding imports to OA_filter docstring
mwickert_scikit-dsp-comm
train
py
4b7c3bb19e35a220ec72c84f61c928b9fe5bef0b
diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java index <HASH>..<HASH> 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java @@ -485,13 +485,8 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O return; status = STATUS.CLOSING; - // CLOSE ALL THE CONNECTIONS - for (String url : serverURLs) { - connectionManager.closePool(url); - } - sbTreeCollectionManager.close(); - super.close(true, false); + if (pushThread != null) { pushThread.shutdown(); try { @@ -500,6 +495,13 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O Thread.currentThread().interrupt(); } } + + // CLOSE ALL THE SOCKET POOLS + for (String url : serverURLs) { + connectionManager.closePool(url); + } + sbTreeCollectionManager.close(); + status = STATUS.CLOSED; } finally {
mad sure socket pool are closed after other operations are closed
orientechnologies_orientdb
train
java
cbc1dfac99e43c839d1e2a90d827eae8da303f20
diff --git a/eventsourcing/infrastructure/event_player.py b/eventsourcing/infrastructure/event_player.py index <HASH>..<HASH> 100644 --- a/eventsourcing/infrastructure/event_player.py +++ b/eventsourcing/infrastructure/event_player.py @@ -47,17 +47,19 @@ class EventPlayer(object): return make_stored_entity_id(self.id_prefix, entity_id) def take_snapshot(self, entity_id, until=None): - # Get the most recent event (optionally until a particular time). + # Get the ultimate event (until a particular time). most_recent_event = self.get_most_recent_event(entity_id, until=until) - # Nothing to snapshot? + # If there isn't any event, there's nothing to snapshot, so return None. if most_recent_event is None: - return + return None - # Nothing happened after last snapshot? + # If there is something to snapshot, then get the ultimate snapshot (until a particular time)? last_snapshot = self.get_snapshot(entity_id, until=until) + + # If there's a snapshot, and it is conincident with the last event, then there's nothing to do. if last_snapshot and last_snapshot.domain_event_id == most_recent_event.domain_event_id: - return + return last_snapshot # Get entity in the state after this event was applied. entity = self.replay_events(entity_id, until=most_recent_event.domain_event_id)
Added some comments. Changed take_snapshot() to return a snapshot when it was returning None, in the case where there are events but the snapshot is up to date.
johnbywater_eventsourcing
train
py
1864ae3643c93761aa40c18baf3528ec996c24a8
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1184,7 +1184,7 @@ export default class ReactJkMusicPlayer extends PureComponent { canPlay = () => { this.setAudioLength(); - if (this.isChanging) this.loadAndPlayAudio(); + if (this.props.autoPlay) this.loadAndPlayAudio(); this.setState({ loading: false, @@ -1415,9 +1415,9 @@ export default class ReactJkMusicPlayer extends PureComponent { const mergedError = Object.assign({}, e, audioInfo) this.props.onAudioAbort && this.props.onAudioAbort(mergedError) if (audioLists.length) { - this.audio.pause() - // this.audio.play() // i dont know why but when i uncomment this line when someone want to change playlist it will play automatically and this was so bad. - this.lyric.stop() + this.audio.pause(); + this.props.autoPlay && this.audio.play(); // i dont know why but when i uncomment this line when someone want to change playlist it will play automatically and this was so bad. + this.lyric.stop(); } } //切换播放器模式
A minor bug related to autoplay have been solved.
lijinke666_react-music-player
train
js
89af747603fad09130129fa4688eaab53c0abdba
diff --git a/peer/peer.go b/peer/peer.go index <HASH>..<HASH> 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -1265,10 +1265,6 @@ func (p *Peer) maybeAddDeadline(pendingResponses map[string]time.Time, msgCmd st // Expects a verack message. pendingResponses[wire.CmdVerAck] = deadline - case wire.CmdGetAddr: - // Expects an addr message. - pendingResponses[wire.CmdAddr] = deadline - case wire.CmdMemPool: // Expects an inv message. pendingResponses[wire.CmdInv] = deadline
peer: remove getaddr msg from stall detection. The getaddr msg is usually replied to with an addr msg, but if the other peer does not have any addresses to share it will not reply at all (instead of replying with an addr msg with 0 addresses). Therefore, the getaddr msg is not guaranteed a reply, so this commit removes it from stall detection to avoid incorrectly kicking such peers.
btcsuite_btcd
train
go
ab111bef8371c6af695ebe37c3d930450ee309e9
diff --git a/src/Router/AdminUrlGenerator.php b/src/Router/AdminUrlGenerator.php index <HASH>..<HASH> 100644 --- a/src/Router/AdminUrlGenerator.php +++ b/src/Router/AdminUrlGenerator.php @@ -245,7 +245,8 @@ final class AdminUrlGenerator }); ksort($routeParameters, \SORT_STRING); - $urlType = $this->adminContextProvider->getContext()->getAbsoluteUrls() ? UrlGeneratorInterface::ABSOLUTE_URL : UrlGeneratorInterface::RELATIVE_PATH; + $context = $this->adminContextProvider->getContext(); + $urlType = null !== $context && false === $context->getAbsoluteUrls() ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_URL; $url = $this->urlGenerator->generate($this->dashboardRoute, $routeParameters, $urlType); if ($this->signUrls()) {
Fixed an issue with absolute/relative URL generation
EasyCorp_EasyAdminBundle
train
php
dd5a51705119c734222babf90dddd634338fe4e2
diff --git a/model/src/test/java/org/cloudfoundry/identity/uaa/scim/ScimGroupTests.java b/model/src/test/java/org/cloudfoundry/identity/uaa/scim/ScimGroupTests.java index <HASH>..<HASH> 100644 --- a/model/src/test/java/org/cloudfoundry/identity/uaa/scim/ScimGroupTests.java +++ b/model/src/test/java/org/cloudfoundry/identity/uaa/scim/ScimGroupTests.java @@ -184,9 +184,4 @@ public class ScimGroupTests { assertEquals(3, group.getMembers().size()); } - - @Test - public void test_toString() { - group.toString(); - } }
Remove test without assertion [#<I>]
cloudfoundry_uaa
train
java
a0f38277dae2bf460aae80eb9e794f16e2abcb9c
diff --git a/Tests/Controller/RestControllerTest.php b/Tests/Controller/RestControllerTest.php index <HASH>..<HASH> 100644 --- a/Tests/Controller/RestControllerTest.php +++ b/Tests/Controller/RestControllerTest.php @@ -832,14 +832,11 @@ class RestControllerTest extends WebTestCase $this->assertEquals($person->name, $refresh->name); $this->assertNull($refresh->mother); - // TODO: Determine if we should remove more than the association in this scenario - /** $refreshMother = $this->em->getRepository('Lemon\RestBundle\Tests\Fixtures\Person')->findOneBy(array( 'id' => $mother->id )); - $this->assertNull($refreshMother); - **/ + $this->assertNotNull($refreshMother, "We removed the relationship, but not the entity"); } public function testPostActionWithInvalidAttribute()
Clarifying in test behavior when removing 1-1
stanlemon_rest-bundle
train
php
35cabb7881264cd2025a7af70fba5e92d23a73ab
diff --git a/lib/dm-core/model.rb b/lib/dm-core/model.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/model.rb +++ b/lib/dm-core/model.rb @@ -46,18 +46,13 @@ module DataMapper end if @relationships + duped_relationships = Hash.new { |h,k| h[k] = {} } @relationships.each do |repository_name,relationships| - repository(repository_name) do - relationships.each do |name,relationship| - options = relationship.options.dup - if options.has_key?(:max) && options.has_key?(:min) - target.has options.delete(:max), name, options - else - target.belongs_to name, options - end - end + relationships.each do |name, relationship| + duped_relationships[repository_name][name] = relationship.dup end end + target.instance_variable_set(:@relationships, duped_relationships) end end
Reverting some Model.inherited changes. Returning closer to original method of duplicating relationship objects.
datamapper_dm-core
train
rb
f8116078ce2c5760ae218bc1657977ed116fcf18
diff --git a/spacy/tests/training/test_readers.py b/spacy/tests/training/test_readers.py index <HASH>..<HASH> 100644 --- a/spacy/tests/training/test_readers.py +++ b/spacy/tests/training/test_readers.py @@ -60,11 +60,12 @@ def test_readers(): assert isinstance(extra_corpus, Callable) +# TODO: enable IMDB test once Stanford servers are back up and running @pytest.mark.slow @pytest.mark.parametrize( "reader,additional_config", [ - ("ml_datasets.imdb_sentiment.v1", {"train_limit": 10, "dev_limit": 10}), + # ("ml_datasets.imdb_sentiment.v1", {"train_limit": 10, "dev_limit": 10}), ("ml_datasets.dbpedia.v1", {"train_limit": 10, "dev_limit": 10}), ("ml_datasets.cmu_movies.v1", {"limit": 10, "freq_cutoff": 200, "split": 0.8}), ],
disable failing test because Stanford servers are down (#<I>)
explosion_spaCy
train
py
0d44183c616e18432717514a27bbe122fd5cc1e7
diff --git a/utils/tests/tests_online.py b/utils/tests/tests_online.py index <HASH>..<HASH> 100644 --- a/utils/tests/tests_online.py +++ b/utils/tests/tests_online.py @@ -358,7 +358,7 @@ class TestStatsBitMapCounter(RedisMixin, TestCase, CleanMixin): if __name__ == '__main__': parser = argparse.ArgumentParser(description="Online depployement Test"\ " Script for Utils") - parser.add_argument('-r', '--redis-host', action='store', required=True, + parser.add_argument('-r', '--redis-host', action='store', default='localhost', help="The Redis host ip") parser.add_argument('-p', '--redis-port', action='store', default='6379', help="The Redis port")
Don't require a redis-host The default is set to “localhost”, so it will use that if not specified.
istresearch_scrapy-cluster
train
py
ebf46d76a310c39603c3d3c21ac6238f0cfaa360
diff --git a/js/indodax.js b/js/indodax.js index <HASH>..<HASH> 100644 --- a/js/indodax.js +++ b/js/indodax.js @@ -59,7 +59,7 @@ module.exports = class indodax extends Exchange { }, }, 'markets': { - // HARDCODING IS DEPRECATED! + // HARDCODING IS DEPRECATED // but they don't have a corresponding endpoint in their API 'BTC/IDR': { 'id': 'btc_idr', 'symbol': 'BTC/IDR', 'base': 'BTC', 'quote': 'IDR', 'baseId': 'btc', 'quoteId': 'idr', 'precision': { 'amount': 8, 'price': 0 }, 'limits': { 'amount': { 'min': 0.0001, 'max': undefined }}}, 'ACT/IDR': { 'id': 'act_idr', 'symbol': 'ACT/IDR', 'base': 'ACT', 'quote': 'IDR', 'baseId': 'act', 'quoteId': 'idr', 'precision': { 'amount': 8, 'price': 0 }, 'limits': { 'amount': { 'min': undefined, 'max': undefined }}},
indodax minor edits
ccxt_ccxt
train
js
142f1e698a86dfd70b52ee1ba6ae212064280b84
diff --git a/oneandone/client.py b/oneandone/client.py index <HASH>..<HASH> 100644 --- a/oneandone/client.py +++ b/oneandone/client.py @@ -4269,7 +4269,8 @@ class Server(object): fixed_instance_size_id=None, vcore=None, cores_per_processor=None, ram=None, appliance_id=None, password=None, power_on=None, firewall_policy_id=None, ip_id=None, load_balancer_id=None, - monitoring_policy_id=None, datacenter_id=None, rsa_key=None): + monitoring_policy_id=None, datacenter_id=None, rsa_key=None, + private_network_id=None): self.first_password = None self.first_ip = None @@ -4291,7 +4292,8 @@ class Server(object): 'load_balancer_id': load_balancer_id, 'monitoring_policy_id': monitoring_policy_id, 'datacenter_id': datacenter_id, - 'rsa_key': rsa_key + 'rsa_key': rsa_key, + 'private_network_id': private_network_id } self.base_url = 'https://cloudpanel-api.1and1.com/v1'
Added private_network_id to the create_server method.
1and1_oneandone-cloudserver-sdk-python
train
py
3620b6bf0d950b6e2434fdad1ad406028c410822
diff --git a/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb b/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb index <HASH>..<HASH> 100644 --- a/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb +++ b/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb @@ -178,6 +178,10 @@ module ApplicationHelper system_environment.use_compressed_js() end + def current_user + instance_variable_get(:@user) + end + def can_view_admin_page? security_service.canViewAdminPage(current_user) end
#<I> - Including JavaImports in application_controller
gocd_gocd
train
rb
599664892148cdfc00ed20bdb86e2fae6e217225
diff --git a/mdc_api/mdc_api.py b/mdc_api/mdc_api.py index <HASH>..<HASH> 100755 --- a/mdc_api/mdc_api.py +++ b/mdc_api/mdc_api.py @@ -455,11 +455,7 @@ class connector: self.log.error("pre-subscription data is not valid. Please make sure it is a valid JSON list") result = asyncResult() data = self._putURL("/subscriptions",JSONdata, versioned=False) - if data.status_code == 200: #immediate success with response - result.error = False - result.is_done = True - result.result = data.json() - elif data.status_code == 204: # immediate success with no response + if data.status_code == 204: # immediate success with no response result.error = False result.is_done = True result.result = []
updated pre-subscription based on changes to connector API
ARMmbed_mbed-connector-api-python
train
py
0c7acf62d4d9c72bfae079446e0c20274bcb1438
diff --git a/moment.js b/moment.js index <HASH>..<HASH> 100644 --- a/moment.js +++ b/moment.js @@ -2445,7 +2445,6 @@ // CommonJS module is defined if (hasModule) { module.exports = moment; - makeGlobal(true); } else if (typeof define === "function" && define.amd) { define("moment", function (require, exports, module) { if (module.config && module.config() && module.config().noGlobal !== true) {
Do not export a global in node.js
moment_moment
train
js
8393a8d5d5b6ffcc99ce7a430adb8e631e94919f
diff --git a/mbuild/utils/io.py b/mbuild/utils/io.py index <HASH>..<HASH> 100644 --- a/mbuild/utils/io.py +++ b/mbuild/utils/io.py @@ -206,7 +206,7 @@ try: has_hoomd = True del hoomd except ImportError: - has_hoomd = False + has_hoomd = False try: import nglview
Update mbuild/utils/io.py remove extra space
mosdef-hub_mbuild
train
py
212a099ab022fe617d94f195423432dad5cdb21a
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index <HASH>..<HASH> 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -129,6 +129,35 @@ module ApplicationTests assert_equal "false", last_response.body end + test "action_controller api executes using all the middleware stack" do + add_to_config "config.api_only = true" + + app_file "app/controllers/application_controller.rb", <<-RUBY + class ApplicationController < ActionController::API + end + RUBY + + app_file "app/controllers/omg_controller.rb", <<-RUBY + class OmgController < ApplicationController + def show + render :json => { :omg => 'omg' } + end + end + RUBY + + app_file "config/routes.rb", <<-RUBY + Rails.application.routes.draw do + get "/:controller(/:action)" + end + RUBY + + require 'rack/test' + extend Rack::Test::Methods + + get 'omg/show' + assert_equal '{"omg":"omg"}', last_response.body + end + # AD test "action_dispatch extensions are applied to ActionDispatch" do add_to_config "config.action_dispatch.tld_length = 2"
Add AC::API + its middleware stack integration test
rails_rails
train
rb
74d1191ae2f6beca59f58da7cf9b1772796f93b6
diff --git a/salt/states/mongodb.py b/salt/states/mongodb.py index <HASH>..<HASH> 100644 --- a/salt/states/mongodb.py +++ b/salt/states/mongodb.py @@ -326,7 +326,7 @@ def user_grant_roles(name, roles, if __salt__['mongodb.user_grant_roles'](name, roles, database, user=user, password=password, host=host, port=port, authdb=authdb): ret['comment'] = 'Granted roles to {0} on {1}'.format(name, database) - ret['changes'][name] = [ '{0} granted'.format(i) for i in diff ] + ret['changes'][name] = ['{0} granted'.format(i) for i in diff] ret['result'] = True else: ret['comment'] = 'Failed to grant roles ({2}) to {0} on {1}'.format(name, database, diff)
this is particularly heinous. doin' it for the lint
saltstack_salt
train
py
10cb3988724546b19885edac07f6569b05f04b60
diff --git a/tornado/escape.py b/tornado/escape.py index <HASH>..<HASH> 100644 --- a/tornado/escape.py +++ b/tornado/escape.py @@ -64,6 +64,9 @@ def xhtml_unescape(value): return re.sub(r"&(#?)(\w+?);", _convert_entity, _unicode(value)) +# The fact that json_encode wraps json.dumps is an implementation detail. +# Please see https://github.com/facebook/tornado/pull/706 +# before sending a pull request that adds **kwargs to this function. def json_encode(value): """JSON-encodes the given Python object.""" # JSON permits but does not require forward slashes to be escaped.
Add note about frequently-seen pull request to add **kwargs to json_encode.
tornadoweb_tornado
train
py
a11609d1f4aabc5f07d44fa96fab860283d2af69
diff --git a/src/PhpImap/DataPartInfo.php b/src/PhpImap/DataPartInfo.php index <HASH>..<HASH> 100644 --- a/src/PhpImap/DataPartInfo.php +++ b/src/PhpImap/DataPartInfo.php @@ -69,7 +69,7 @@ class DataPartInfo } /** - * @return string|null + * @return string */ public function fetch() { @@ -117,6 +117,6 @@ class DataPartInfo ); } - return $this->data; + return (null === $this->data) ? '' : $this->data; } }
some uses of DataPartInfo::fetch() imply string returns are expected
barbushin_php-imap
train
php
b4afb5a494931f9eb7bb24c6246963f9e3f5b6f8
diff --git a/src/main/java/de/saumya/mojo/mains/JRubyMain.java b/src/main/java/de/saumya/mojo/mains/JRubyMain.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/saumya/mojo/mains/JRubyMain.java +++ b/src/main/java/de/saumya/mojo/mains/JRubyMain.java @@ -43,7 +43,7 @@ public class JRubyMain extends Main { } catch (RaiseException rj) { try { - System.exit(handleRaiseException(rj)); + System.exit(-1);//handleRaiseException(rj)); } catch( Throwable e ){ System.exit(-1);
revert change which we have only for jruby-<I>+
jruby_jruby-mains
train
java
bed13457998ce646a2f549c1f8fd7eb8a601f128
diff --git a/eventsourcing/postgres.py b/eventsourcing/postgres.py index <HASH>..<HASH> 100644 --- a/eventsourcing/postgres.py +++ b/eventsourcing/postgres.py @@ -341,7 +341,7 @@ class Factory(InfrastructureFactory): f"'{self.POSTGRES_HOST}'" ) - port = self.getenv(self.POSTGRES_PORT, "5432") + port = self.getenv(self.POSTGRES_PORT) or "5432" user = self.getenv(self.POSTGRES_USER) if user is None:
Fix syntax to comply with mypy
johnbywater_eventsourcing
train
py
7bce83ac939fe1f2fcf0859e08958cb20a971ed5
diff --git a/debug.go b/debug.go index <HASH>..<HASH> 100644 --- a/debug.go +++ b/debug.go @@ -2,8 +2,10 @@ package readeef import ( "log" + "net/http" "runtime" "strconv" + "time" ) type debug interface { @@ -29,8 +31,9 @@ func InitDebug(logger *log.Logger, config Config) { func (d realDebug) Printf(format string, v ...interface{}) { if d.config.Readeef.Debug { _, file, line, ok := runtime.Caller(2) + timestamp := time.Now().Format(http.TimeFormat) if ok { - d.logger.Println(file + ": " + strconv.Itoa(line)) + d.logger.Println(file + ":" + strconv.Itoa(line) + " (" + timestamp + ")") } d.logger.Printf(format, v...) } @@ -39,8 +42,9 @@ func (d realDebug) Printf(format string, v ...interface{}) { func (d realDebug) Println(v ...interface{}) { if d.config.Readeef.Debug { _, file, line, ok := runtime.Caller(2) + timestamp := time.Now().Format(http.TimeFormat) if ok { - d.logger.Println(file + ": " + strconv.Itoa(line)) + d.logger.Println(file + ":" + strconv.Itoa(line) + " (" + timestamp + ")") } d.logger.Println(v...) }
print a timestamp along with the filename and line number
urandom_readeef
train
go
7e9918047675d32e0af3c6a298027fdb14fc62f1
diff --git a/django_zotero/forms.py b/django_zotero/forms.py index <HASH>..<HASH> 100644 --- a/django_zotero/forms.py +++ b/django_zotero/forms.py @@ -38,7 +38,7 @@ class GenericTagInlineFormset(generic.BaseGenericInlineFormSet): else: single_fields.append(field) - @transaction.set_autocommit +# @transaction.set_autocommit def save(self): try: super(GenericTagInlineFormset, self).save()
Removing autocommit for compatibility
CulturePlex_django-zotero
train
py
cf4ba3b3da5553d34a1228bfc84cd9abdbf17568
diff --git a/src/modules/meteor/__tests__/index.js b/src/modules/meteor/__tests__/index.js index <HASH>..<HASH> 100644 --- a/src/modules/meteor/__tests__/index.js +++ b/src/modules/meteor/__tests__/index.js @@ -70,12 +70,6 @@ describe('module - meteor', function() { 'ls -al /opt/myapp/tmp/bundle.tar.gz' ); assert.equal(sshOut.code, 0); - - const sshOut2 = await runSSHCommand( - serverInfo, - 'ls -al /opt/myapp/config/start.sh' - ); - assert.equal(sshOut2.code, 0); }); }); @@ -100,6 +94,13 @@ describe('module - meteor', function() { 'ls -al /opt/myapp/config/env.list' ); assert.equal(sshOut.code, 0); + + const sshOut2 = await runSSHCommand( + serverInfo, + 'ls -al /opt/myapp/config/start.sh' + ); + + assert.equal(sshOut2.code, 0); }); });
Fix tests for mup meteor push
zodern_meteor-up
train
js
57c7b9ba4e53849ace4fe94e5983046328898009
diff --git a/pmagpy/ipmag.py b/pmagpy/ipmag.py index <HASH>..<HASH> 100755 --- a/pmagpy/ipmag.py +++ b/pmagpy/ipmag.py @@ -3161,7 +3161,7 @@ def upload_magic(concat=0, dir_path='.', data_model=None): for File in file_names: # read in the data Data, file_type = pmag.magic_read(File) - if file_type != "bad_file": + if (file_type != "bad_file") and (file_type != "empty_file"): print("-I- file", File, " successfully read in") if len(RmKeys) > 0: for rec in Data:
ignore empty files in upload_magic
PmagPy_PmagPy
train
py
fd5190a46eeb6218135de46464de52e4cbc079bb
diff --git a/CrashReport/src/org/acra/sender/GoogleFormSender.java b/CrashReport/src/org/acra/sender/GoogleFormSender.java index <HASH>..<HASH> 100644 --- a/CrashReport/src/org/acra/sender/GoogleFormSender.java +++ b/CrashReport/src/org/acra/sender/GoogleFormSender.java @@ -42,7 +42,7 @@ public class GoogleFormSender implements ReportSender { * @param formKey The key of the form. The key is the formKey parameter value in the Form Url: https://spreadsheets.google.com/viewform?formkey=<b>dDN6NDdnN2I2aWU1SW5XNmNyWVljWmc6MQ</b> */ public GoogleFormSender(String formKey) { - mFormUri = Uri.parse("http://spreadsheets.google.com/formResponse?formkey=" + formKey + "&amp;ifq"); + mFormUri = Uri.parse("https://spreadsheets.google.com/formResponse?formkey=" + formKey + "&amp;ifq"); } @Override
Use https as new default protocol for Form POST.
ACRA_acra
train
java
5d2501076dc51bdb095089d5ed0e0f7c34c6f40c
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -1169,7 +1169,7 @@ describe("moment", function() { describe("jalaliMoment toISOString", function () { jalaliMoment.locale("en"); it("toISOString(false) with 00:00 time and GMT+ timezone should decrease day", function () { - const date = jalaliMoment("2020-11-23").zone("+03:30"); + const date = jalaliMoment("2020-11-23").utcOffset("+03:30"); const isoString = date.toISOString(); const dateWithoutTimezone = jalaliMoment(isoString.split('T')[0]); date.date().should.be.equal(dateWithoutTimezone.date() + 1); @@ -1177,7 +1177,7 @@ describe("moment", function() { }); it("toISOString(true) with 00:00 time and GMT+ timezone should preserve date", function () { - const date = jalaliMoment("2020-11-23").zone("+03:30"); + const date = jalaliMoment("2020-11-23").utcOffset("+03:30"); const isoString = date.toISOString(true); const dateWithoutTimezone = jalaliMoment(isoString.split('T')[0]); date.format("YYYY-MM-DD").should.be.equal(dateWithoutTimezone.format("YYYY-MM-DD"));
changed a depricated method in the test.js
fingerpich_jalali-moment
train
js
359efd68b280b02f1476ab6848517e131e5939cb
diff --git a/pkg/minikube/command/ssh_runner.go b/pkg/minikube/command/ssh_runner.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/command/ssh_runner.go +++ b/pkg/minikube/command/ssh_runner.go @@ -263,7 +263,7 @@ func (s *SSHRunner) Copy(f assets.CopyableFile) error { mtime, err := f.GetModTime() if err != nil { glog.Infof("error getting modtime for %s: %v", dst, err) - } else { + } else if mtime != (time.Time{}) { scp += fmt.Sprintf(" && sudo touch -d \"%s\" %s", mtime.Format(layout), dst) } out, err := sess.CombinedOutput(scp)
Avoid setting time for memory assets These do not have any file modification time Previously used '<I>-<I>-<I> <I>:<I>:<I> <I>'
kubernetes_minikube
train
go
138fe2c0b735f46b926b8d632923501b0a912ede
diff --git a/sql_conf.go b/sql_conf.go index <HASH>..<HASH> 100644 --- a/sql_conf.go +++ b/sql_conf.go @@ -41,13 +41,14 @@ func sqlConfFromEnv() *SQLConf { // Returns the DefaultSQLConf if no config/geo.yml is found, or an error // if one arises during the process of parsing the configuration file. func GetSQLConf() (*SQLConf, error) { - DefaultSQLConf := sqlConfFromEnv() + return GetSQLConfFromFile("config/geo.yml") +} - // TODO This should be redesigned so that the user specifies where the config file is - // We can still handle the issue where it doesn't exist, - // but that way it's not hardcoded. - configPath := path.Join("config/geo.yml") +func GetSQLConfFromFile(filename string) (*SQLConf, error) { + DefaultSQLConf := sqlConfFromEnv() + configPath := path.Join(filename) _, err := os.Stat(configPath) + if err != nil && os.IsNotExist(err) { return DefaultSQLConf, nil } else {
Adding in GetSQLConfFromFile method such that users can specify where their configuration file is for SQL commands. Removing TODO note :)
kellydunn_golang-geo
train
go
2b33f85ed16247cb0059c7a3736d0a0d0068bcfe
diff --git a/public/js/make-api.js b/public/js/make-api.js index <HASH>..<HASH> 100644 --- a/public/js/make-api.js +++ b/public/js/make-api.js @@ -347,6 +347,15 @@ var module = module || undefined; return this; }, + remixedFrom: function( projectID ) { + this.searchFilters.push({ + term: { + remixedFrom: projectID + } + }); + return this; + }, + id: function( id ) { this.searchFilters.push({ query: {
Fix Bug <I> - Search for projects remixed from another project
mozilla_MakeAPI
train
js
3b3c09829351b4e22796b3af70e4686ce9b551c3
diff --git a/lib/redis-model-extension/get_find.rb b/lib/redis-model-extension/get_find.rb index <HASH>..<HASH> 100644 --- a/lib/redis-model-extension/get_find.rb +++ b/lib/redis-model-extension/get_find.rb @@ -92,6 +92,17 @@ module RedisModelExtension nil end end - + + + # read all data from redis and create new instance (used for Find & Get method) + def new_by_key(key) + args = HashWithIndifferentAccess.new(RedisModelExtension::Database.redis.hgetall(key)) + + new_instance = self.name.constantize.new(args) + new_instance.store_args + + return new_instance + end + end end \ No newline at end of file
[MOVE] New by key - to get & find, this meted apply only when used get or find
ondrejbartas_redis-model-extension
train
rb
5a7856988128ebfa4d94d2e61dcd1163b88ecf39
diff --git a/Tests/Behavior/Features/Bootstrap/RedirectOperationTrait.php b/Tests/Behavior/Features/Bootstrap/RedirectOperationTrait.php index <HASH>..<HASH> 100755 --- a/Tests/Behavior/Features/Bootstrap/RedirectOperationTrait.php +++ b/Tests/Behavior/Features/Bootstrap/RedirectOperationTrait.php @@ -20,14 +20,6 @@ use Neos\RedirectHandler\DatabaseStorage\RedirectStorage; trait RedirectOperationTrait { /** - * @BeforeScenario @fixtures - */ - public function beforeRedirectScenarioDispatcher() - { - $this->resetRedirectInstances(); - } - - /** * @Given /^I have the following redirects:$/ * @When /^I create the following redirects:$/ */ @@ -127,12 +119,4 @@ trait RedirectOperationTrait return ltrim($httpRequest->getBaseUri()->getPath() . 'index.php/' . $uri, '/'); } - - /** - * Makes sure to reset all redirect instances which might still be stored in the RedirectRepository. - */ - public function resetRedirectInstances() - { - $this->objectManager->get(RedirectRepository::class)->removeAll(); - } }
TASK: Remove unnecessary reset method
neos_redirecthandler-neosadapter
train
php
57d274713c76ec0ddb444d726937ff09c0cf9d8a
diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index <HASH>..<HASH> 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -40,6 +40,8 @@ class ControllerTest extends MockTest "Filter" => "", "SortCriteria" => "", "ObjectID" => "Q:0", + ])->andReturn([ + "TotalMatches" => 0, ]); $this->expectException(\BadMethodCallException::class); @@ -199,6 +201,9 @@ class ControllerTest extends MockTest "Filter" => "", "SortCriteria" => "", "ObjectID" => "Q:0", + ])->andReturn([ + "UpdateID" => 85, + "TotalMatches" => 1, ]); $device ->shouldReceive("soap")
Correct lazy tests not mocking the result of interactions
duncan3dc_sonos
train
php
2823d821b69bca41f45602ea8b14e59dbfd7e90d
diff --git a/src/collectors/postgres/postgres.py b/src/collectors/postgres/postgres.py index <HASH>..<HASH> 100644 --- a/src/collectors/postgres/postgres.py +++ b/src/collectors/postgres/postgres.py @@ -265,6 +265,7 @@ class DatabaseStats(QueryStats): pg_stat_database.tup_inserted as tup_inserted, pg_stat_database.tup_updated as tup_updated, pg_stat_database.tup_deleted as tup_deleted, + pg_stat_database.deadlocks as deadlocks, pg_database_size(pg_database.datname) AS size FROM pg_database JOIN pg_stat_database
Add deadlocks to monitoring in postgres
python-diamond_Diamond
train
py
2758d9c88c0bc9624b865908ce296e607a265298
diff --git a/lib/fetch/index.js b/lib/fetch/index.js index <HASH>..<HASH> 100644 --- a/lib/fetch/index.js +++ b/lib/fetch/index.js @@ -1350,15 +1350,12 @@ function httpNetworkFetch ( } // TODO (fix): Do we need controller here? - if (context.controller) { - try { - context.controller.error(err) - context.controller = null - } catch (err) { - // Will throw TypeError if body is not readable. - if (err.name !== 'TypeError') { - throw err - } + try { + context.controller?.error(err) + } catch (err) { + // Will throw TypeError if body is not readable. + if (err.name !== 'TypeError') { + throw err } } }
fix: don't null controller
mcollina_undici
train
js
dd7db112a7d0fbbbd8ab1a86400fb7a2cf4f5f83
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java @@ -109,7 +109,7 @@ public class ImportTag implements Tag { Map<String, Object> childBindings = child.getContext().getSessionBindings(); if (!child.getContext().getDeferredNodes().isEmpty()){ - interpreter.getContext().addDeferredNode(node); + node.getChildren().forEach(deferredChild -> interpreter.getContext().addDeferredNode(deferredChild)); if (StringUtils.isBlank(contextVar)) { childBindings.keySet().forEach(key -> interpreter.getContext().put(key, DeferredValue.instance())); } else {
Add children of root node to deferred nodes
HubSpot_jinjava
train
java
6285554760f99ccd5d899319e069c9618e96ffba
diff --git a/test-utils/src/main/java/com/github/olivergondza/dumpling/Util.java b/test-utils/src/main/java/com/github/olivergondza/dumpling/Util.java index <HASH>..<HASH> 100644 --- a/test-utils/src/main/java/com/github/olivergondza/dumpling/Util.java +++ b/test-utils/src/main/java/com/github/olivergondza/dumpling/Util.java @@ -123,6 +123,10 @@ public class Util { try { while (os.read(buffer) != -1) { out.append(new String(buffer)); + if (out.length() > 1014 * 1024 * 5) { + out.append("**** TRUNCATED ****"); + break; + } } } catch (IOException ex) { throw new Error(ex);
Limit the ammount of output to read diagnosing SUT process failure
olivergondza_dumpling
train
java
4c6a9738cfd7d0854ac738c9df3ddc04a156f5e1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,6 @@ setup( keywords = "google gmail", url = "https://github.com/charlierguo/gmail", packages=['gmail'], - package_dir={'gmail': ''}, long_description=read('README.md'), classifiers=[ "Development Status :: 3 - Alpha",
No need for package_dir in setup.py
charlierguo_gmail
train
py
c6e9ec087a1d29f4922a34435a390dbfca1794e5
diff --git a/tests/test_parse_metadata.py b/tests/test_parse_metadata.py index <HASH>..<HASH> 100644 --- a/tests/test_parse_metadata.py +++ b/tests/test_parse_metadata.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import logging +import os import unittest from pathlib import Path @@ -89,6 +90,12 @@ class TestParseMetadata(unittest.TestCase): self.assertIn(HGNC_KEYWORD, self.parser.namespace_dict) self.assertIn('TextLocation', self.parser.annotations_dict) + @unittest.skipUnless('PYBEL_BASE' in os.environ, "Need local files to test local files") + def test_squiggly_filepath(self): + line = 'DEFINE NAMESPACE {} AS URL "~/dev/pybel/tests/belns/hgnc-human-genes.belns"'.format(HGNC_KEYWORD) + self.parser.parseString(line) + help_check_hgnc(self, self.parser.namespace_dict) + def test_document_metadata_exception(self): s = 'SET DOCUMENT InvalidKey = "nope"' with self.assertRaises(InvalidMetadataException):
Added testing for local file parsing Closes #<I>
pybel_pybel
train
py
ce6303e8555c2436acc3ad84133e1c1cc646148a
diff --git a/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/MessageSender.java b/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/MessageSender.java index <HASH>..<HASH> 100644 --- a/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/MessageSender.java +++ b/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/MessageSender.java @@ -328,7 +328,11 @@ public class MessageSender extends ClientEntity implements IAmqpSender, IErrorCo } this.retryPolicy.resetRetryCount(this.getClientId()); - this.maxMessageSize = this.sendLink.getRemoteMaxMessageSize().intValue(); + + final UnsignedLong remoteMaxMessageSize = this.sendLink.getRemoteMaxMessageSize(); + if (remoteMaxMessageSize != null) { + this.maxMessageSize = remoteMaxMessageSize.intValue(); + } if (!this.linkFirstOpen.isDone()) { this.linkFirstOpen.complete(this);
Fix NPE on Send Reconnect path (#<I>)
Azure_azure-sdk-for-java
train
java
5cd527fb4adf7df09b7014b12c95c0b7037f6ece
diff --git a/generators/cypress/index.js b/generators/cypress/index.js index <HASH>..<HASH> 100644 --- a/generators/cypress/index.js +++ b/generators/cypress/index.js @@ -21,6 +21,7 @@ const BaseBlueprintGenerator = require('../generator-base-blueprint'); const writeFiles = require('./files').writeFiles; const constants = require('../generator-constants'); const { CYPRESS } = require('../../jdl/jhipster/test-framework-types'); +const _ = require('lodash'); let useBlueprints; @@ -152,7 +153,10 @@ module.exports = class extends BaseBlueprintGenerator { }); if (this.clientFrameworkAngular) { // Add 'ng build --configuration instrumenter' support - this.createStorage('angular.json').merge({projects: {[this_.kebabCase(this.baseName)]: {architect: {build:{configurations:{instrumenter:{}}}}}]}}); + console.log('this.kebabCase', _.kebabCase); + this.createStorage('angular.json').merge({ + projects: { [_.kebabCase(this.baseName)]: { architect: { build: { configurations: { instrumenter: {} } } } } }, + }); } }, };
fix and lint previous commit
jhipster_generator-jhipster
train
js
955546070836f66f4b52a746f852f3c93d19a345
diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index <HASH>..<HASH> 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -344,10 +344,11 @@ def salt_client_acl_tool(username, ip): cherrypy_conf = salt_config.get('rest_cherrypy', None) if cherrypy_conf: acl = cherrypy_conf.get('client_acl', None) - if username in acl and ip in acl[username]: - return True - elif username in acl and not ip in acl[username]: - return False + if acl: + if username in acl and ip in acl[username]: + return True + elif username in acl and not ip in acl[username]: + return False return True
Updating to add a check for the acl to exist.
saltstack_salt
train
py
b7389b4579a645c02c58dc5ef8952534fa1988a3
diff --git a/tests/connection.py b/tests/connection.py index <HASH>..<HASH> 100644 --- a/tests/connection.py +++ b/tests/connection.py @@ -374,10 +374,9 @@ class Connection_(Spec): gw.open.assert_called_once_with() # Expect direct-tcpip channel open on 1st client open_channel = mock_gw.get_transport.return_value.open_channel - chan_calls = open_channel.call_args - type_, cxn, _ = chan_calls[0] - eq_(type_, 'direct-tcpip') - eq_(cxn, ('host', 22)) + kwargs = open_channel.call_args[1] + eq_(kwargs['kind'], 'direct-tcpip') + eq_(kwargs['dest_addr'], ('host', 22)) # Expect result of that channel open as sock arg to connect() sock_arg = mock_main.connect.call_args[1]['sock'] ok_(sock_arg is open_channel.return_value)
Forgot to fix test when changing open_channel() call semantics
fabric_fabric
train
py
2052463ba75db08db781fdd5e14bd8dd2ffe1eec
diff --git a/GPy/util/linalg.py b/GPy/util/linalg.py index <HASH>..<HASH> 100644 --- a/GPy/util/linalg.py +++ b/GPy/util/linalg.py @@ -237,6 +237,16 @@ def tdot(*args, **kwargs): return tdot_numpy(*args,**kwargs) def DSYR(A,x,alpha=1.): + """ + Performs a symmetric rank-1 update operation: + A <- A + alpha * np.dot(x,x.T) + + Arguments + --------- + :param A: Symmetric NxN np.array + :param x: Nx1 np.array + :param alpha: scalar + """ N = c_int(A.shape[0]) LDA = c_int(A.shape[0]) UPLO = c_char('l')
Explanation added to DSYR
SheffieldML_GPy
train
py
f0cf011b32c4f75df1226ba982eb8e631cc1a6a1
diff --git a/lib/jekyll-admin.rb b/lib/jekyll-admin.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll-admin.rb +++ b/lib/jekyll-admin.rb @@ -39,10 +39,10 @@ module JekyllAdmin end end -# Monkey Patches -require_relative "./jekyll/commands/serve" - [Jekyll::Page, Jekyll::Document, Jekyll::StaticFile, Jekyll::Collection].each do |klass| klass.include JekyllAdmin::APIable klass.include JekyllAdmin::URLable end + +# Monkey Patches +require_relative "jekyll/commands/serve"
Load monkey patches after loading major actors To ensure that autoloaded classes from upstream have been loaded by the time they're referenced by the monkey patches
jekyll_jekyll-admin
train
rb
476b7d4e370d1d6581052bdaa359a0de04cc1878
diff --git a/demo/src/screens/MainScreen.js b/demo/src/screens/MainScreen.js index <HASH>..<HASH> 100644 --- a/demo/src/screens/MainScreen.js +++ b/demo/src/screens/MainScreen.js @@ -307,7 +307,7 @@ export default class UiLibExplorerMenu extends Component { const data = this.getMenuData(); return ( - <View flex bg-dark80> + <View testID="demo_main_screen" flex bg-dark80> {this.renderHeader()} {showNoResults && ( <View paddingH-24>
Added test id (#<I>)
wix_react-native-ui-lib
train
js
4b419976cb94cde8522d8576430956fd27d62f03
diff --git a/test/memory-stress-test.js b/test/memory-stress-test.js index <HASH>..<HASH> 100644 --- a/test/memory-stress-test.js +++ b/test/memory-stress-test.js @@ -28,11 +28,12 @@ const MySQLImport = require('../mysql-import.js'); const SQLDumpGenerator = require('./SQLDumpGenerator.js'); const importer = new MySQLImport(config); -importer.onProgress((file_count, file_no, byte_total, byte_progress)=>{ - var percent = Math.floor(byte_progress / byte_total * 10000) / 100 +importer.onProgress(progress=>{ + var percent = Math.floor(progress.bytes_processed / progress.total_bytes * 10000) / 100; + var filename = progress.file_path.split("/").pop(); process.stdout.clearLine(); process.stdout.cursorTo(0); - process.stdout.write(`File ${file_no} of ${file_count}: processing ${byte_progress} of ${byte_total} bytes - ${percent}% Complete`); + process.stdout.write(`File ${progress.file_no} of ${progress.total_files}: processing ${filename} - ${percent}% Complete`); }); const start_time = new Date();
Refactored so file stat is only done once. Cleaned up.
Pamblam_mysql-import
train
js
5b48a7f632955a7eb9a3f24e7c41e51a8f48bbfa
diff --git a/kaleo/models.py b/kaleo/models.py index <HASH>..<HASH> 100644 --- a/kaleo/models.py +++ b/kaleo/models.py @@ -85,8 +85,9 @@ class InvitationStat(models.Model): @classmethod def add_invites_to_user(cls, user, amount): stat, _ = InvitationStat.objects.get_or_create(user=user) - stat.invites_allocated = -1 - stat.save() + if stat.invites_allocated != -1: + stat.invites_allocated += amount + stat.save() @classmethod def add_invites(cls, amount):
Fix add invites bug This fixes the bug where adding invites to a user would set them to have unlimited invites.
pinax_pinax-invitations
train
py
26b2f2c0ab815b4b2352330cc84626a6289cc6c0
diff --git a/lib/Webforge/CMS/Navigation/SimpleNode.php b/lib/Webforge/CMS/Navigation/SimpleNode.php index <HASH>..<HASH> 100644 --- a/lib/Webforge/CMS/Navigation/SimpleNode.php +++ b/lib/Webforge/CMS/Navigation/SimpleNode.php @@ -47,7 +47,7 @@ class SimpleNode implements Node { 'depth' => $this->depth, 'children' => array_map(function ($child) { return $child->unwrap('structure'); - }, $this->children) + }, $this->children->toArray()) ); } else { return array (
correct simple node to work with collection
webforge-labs_webforge
train
php