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
c7b75373f3019a22242ed22f9d5a935011e05902
diff --git a/datapackage_pipelines/cli.py b/datapackage_pipelines/cli.py index <HASH>..<HASH> 100644 --- a/datapackage_pipelines/cli.py +++ b/datapackage_pipelines/cli.py @@ -32,7 +32,7 @@ def cli(ctx): def serve(): """Start the web server""" from .web import app - app.run(host='0.0.0.0', debug=True, port=5000) + app.run(host='0.0.0.0', debug=False, port=5000) @cli.command()
Don't run in debug mode in production
frictionlessdata_datapackage-pipelines
train
py
1f19aa9029336e1addc1095819730cd806c29aa9
diff --git a/symphony/lib/toolkit/class.jsonexception.php b/symphony/lib/toolkit/class.jsonexception.php index <HASH>..<HASH> 100644 --- a/symphony/lib/toolkit/class.jsonexception.php +++ b/symphony/lib/toolkit/class.jsonexception.php @@ -1,5 +1,8 @@ <?php - +// This class exists in PHP7.3 +if (class_exists('JSONException', false)) { + return; +} /** * @package toolkit */ @@ -11,7 +14,6 @@ * * @since Symphony 2.3 */ -if (!class_exists('JSONException', false)) { class JSONException extends Exception { /** @@ -55,4 +57,3 @@ class JSONException extends Exception parent::__construct($message, $code, $ex); } } -}
Fix for PHP<I>: JSONException is now native This commits makes sure we do not load our custom JSONException class if a native implementation already exists. Re #<I> Picked from <I>bba2 Picked from <I>f5f9cd9
symphonycms_symphony-2
train
php
c972edcd2dd95894579ac4021758f680ce2db539
diff --git a/lib/queue_classic/worker.rb b/lib/queue_classic/worker.rb index <HASH>..<HASH> 100644 --- a/lib/queue_classic/worker.rb +++ b/lib/queue_classic/worker.rb @@ -19,11 +19,13 @@ module QC def initialize(args={}) @fork_worker = args[:fork_worker] || QC::FORK_WORKER @wait_interval = args[:wait_interval] || QC::WAIT_TIME - if QC.has_connection? - @conn_adapter = QC.default_conn_adapter - else + + if args[:connection] @conn_adapter = ConnAdapter.new(args[:connection]) + elsif QC.has_connection? + @conn_adapter = QC.default_conn_adapter end + @queues = setup_queues(@conn_adapter, (args[:q_name] || QC::QUEUE), (args[:q_names] || QC::QUEUES),
fix the use of a connection as an argument if it exists
QueueClassic_queue_classic
train
rb
d04b0f6ff6ccd0b02031dd06ee7c472736e9706b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,8 @@ from setuptools import setup setup(name='tbapy', - version='1.2.3', - description='Python library to get data from The Blue Alliance API v3.', + version='1.3.0', + description='Library for interacting with The Blue Alliance API.', url='https://github.com/frc1418/tbapy', author='FRC Team 1418, Erik Boesen', author_email='robotics1418@gmail.com',
Increment version to <I>
frc1418_tbapy
train
py
97b7915b8f5fe7be0927e991431792e1d0051ae6
diff --git a/terraform/node_resource_plan.go b/terraform/node_resource_plan.go index <HASH>..<HASH> 100644 --- a/terraform/node_resource_plan.go +++ b/terraform/node_resource_plan.go @@ -21,6 +21,8 @@ func (n *NodePlannableResource) EvalTree() EvalNode { // With the interpolated count, we can then DynamicExpand // into the proper number of instances. &EvalInterpolate{Config: n.Config.RawCount}, + + &EvalCountFixZeroOneBoundary{Resource: n.Config}, }, } }
terraform: fix zero/one boundary for resource counts
hashicorp_terraform
train
go
d6a581b0352bb540ee43a54228970db3dc855fac
diff --git a/src/Http/Message/MessageFactory.php b/src/Http/Message/MessageFactory.php index <HASH>..<HASH> 100644 --- a/src/Http/Message/MessageFactory.php +++ b/src/Http/Message/MessageFactory.php @@ -26,7 +26,7 @@ class MessageFactory public function header($name, $value) { - $this->headers[$name] = $value; + $this->headers[$name] = (array) $value; return $this; } diff --git a/src/Http/Message/Request.php b/src/Http/Message/Request.php index <HASH>..<HASH> 100644 --- a/src/Http/Message/Request.php +++ b/src/Http/Message/Request.php @@ -62,7 +62,7 @@ class Request extends Message implements RequestInterface * @param string $target * @param array $server * @param array $cookies - * @param array $data + * @param array|null|object $data * @param \Zapheus\Http\Message\FileInterface[] $files * @param array $queries * @param array $attributes @@ -105,8 +105,6 @@ class Request extends Message implements RequestInterface $exists = isset($this->attributes[$name]); return $exists ? $this->attributes[$name] : null; - - // getAttribute } /**
Update MessageFactory and Request
zapheus_zapheus
train
php,php
518cdbbe1fe4ce60733b842ca5a0f918ef2a7191
diff --git a/lib/restful_kashflow/services/customer.rb b/lib/restful_kashflow/services/customer.rb index <HASH>..<HASH> 100644 --- a/lib/restful_kashflow/services/customer.rb +++ b/lib/restful_kashflow/services/customer.rb @@ -16,6 +16,10 @@ module RestfulKashflow !!@customer["IsGoCardlessMandateSet"] end + def raw + @customer.dup + end + def self.create(api_service, name, email, first_name, last_name) url = "/customers"
adding a raw method to customer to access the response from the API
butterware_restful-kashflow
train
rb
ac30305fff5ac09ab66d550206515e8e67b9b461
diff --git a/strftime_bench_test.go b/strftime_bench_test.go index <HASH>..<HASH> 100644 --- a/strftime_bench_test.go +++ b/strftime_bench_test.go @@ -45,7 +45,16 @@ func BenchmarkLestrrat(b *testing.B) { } } -func BenchmarkLestrratCached(b *testing.B) { +func BenchmarkLestrratCachedString(b *testing.B) { + var t time.Time + f, _ := lestrrat.New(benchfmt) + // This benchmark does not take into effect the compilation time + for i := 0; i < b.N; i++ { + f.FormatString(t) + } +} + +func BenchmarkLestrratCachedWriter(b *testing.B) { var t time.Time f, _ := lestrrat.New(benchfmt) var buf bytes.Buffer @@ -58,5 +67,6 @@ func BenchmarkLestrratCached(b *testing.B) { buf.Reset() b.StartTimer() f.Format(&buf, t) + f.FormatString(t) } }
Oh yeah, writing out a string is MUCH faster than writing to an io.Writer
lestrrat-go_strftime
train
go
5b41bb347ee24da6df47c75cf7ce088c18ab00f2
diff --git a/lib/instana/version.rb b/lib/instana/version.rb index <HASH>..<HASH> 100644 --- a/lib/instana/version.rb +++ b/lib/instana/version.rb @@ -1,4 +1,4 @@ module Instana - VERSION = "1.7.14" + VERSION = "1.7.15" VERSION_FULL = "instana-#{VERSION}" end
Bump gem version to <I>
instana_ruby-sensor
train
rb
5a5b7ce22c97cd33fe4e232045db3c94286150be
diff --git a/lib/m/parser.rb b/lib/m/parser.rb index <HASH>..<HASH> 100644 --- a/lib/m/parser.rb +++ b/lib/m/parser.rb @@ -26,6 +26,7 @@ module M t.libs << 'test' t.libs << 'spec' t.test_files = FileList[wildcard("test"), wildcard("spec")] + t.warning = false end # Invoke the rake task and exit, hopefully it'll work! begin
Remove warnigs when running the directories rake task Why: * As of Rake <I> [ruby warnings are enabled by default](<URL>), which means you will probably get a lot of warnings that come from your dependencies and that you don't want to have to take care of when running your tests. This change addresses the need by: * Disabling the warnings to mimic old rake behavior
qrush_m
train
rb
35e98bfea0ded24038f7a58177b7baa900ad1208
diff --git a/spec/flipper/middleware/memoizer_spec.rb b/spec/flipper/middleware/memoizer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/flipper/middleware/memoizer_spec.rb +++ b/spec/flipper/middleware/memoizer_spec.rb @@ -218,6 +218,39 @@ RSpec.describe Flipper::Middleware::Memoizer do end end + context 'with multiple instances' do + let(:app) do + # ensure scoped for builder block, annoying... + instance = flipper + middleware = described_class + + Rack::Builder.new do + use middleware, preload: %i(stats) + # Second instance should be a noop + use middleware, preload: true + + map '/' do + run ->(_env) { [200, {}, []] } + end + + map '/fail' do + run ->(_env) { raise 'FAIL!' } + end + end.to_app + end + + include_examples 'flipper middleware' + + it 'does not call preload in second instance' do + expect(flipper).not_to receive(:preload_all) + + get '/', {}, 'flipper' => flipper + + expect(adapter.count(:get_multi)).to be(1) + expect(adapter.last(:get_multi).args).to eq([[flipper[:stats]]]) + end + end + context 'when an app raises an exception' do it 'resets memoize' do begin
Spec for duplicate calls to Memoizer
jnunemaker_flipper
train
rb
e37c9339f9afff505525a4d377e0195005a1a3ec
diff --git a/holoviews/view/sheetviews.py b/holoviews/view/sheetviews.py index <HASH>..<HASH> 100644 --- a/holoviews/view/sheetviews.py +++ b/holoviews/view/sheetviews.py @@ -317,7 +317,8 @@ class Matrix(SheetCoordinateSystem, Raster): def __init__(self, data, bounds=None, xdensity=None, ydensity=None, **params): bounds = bounds if bounds is not None else BoundingBox() if isinstance(bounds, tuple): - bounds = BoundingBox(lbrt=bounds) + l, b, r, t = bounds + bounds = BoundingBox(points=((l, b), (r, t))) elif np.isscalar(bounds): bounds = BoundingBox(radius=bounds) data = np.array([[0]]) if data is None else data
Fixed constructing Matrix with lbrt
pyviz_holoviews
train
py
515252b2b92f5046906e190853a7c147ac321b1b
diff --git a/salt/modules/composer.py b/salt/modules/composer.py index <HASH>..<HASH> 100644 --- a/salt/modules/composer.py +++ b/salt/modules/composer.py @@ -147,7 +147,10 @@ def install(dir, if optimize is True: cmd += ' --optimize-autoloader' - result = __salt__['cmd.run_all'](cmd, runas=runas, env={'COMPOSER_HOME': composer_home}) + result = __salt__['cmd.run_all'](cmd, + runas=runas, + env={'COMPOSER_HOME': composer_home}, + python_shell=False) if result['retcode'] != 0: raise CommandExecutionError(result['stderr'])
composer module python_shell=False additon
saltstack_salt
train
py
21302a5633503ffe377206caee114aaab914278c
diff --git a/medoo.php b/medoo.php index <HASH>..<HASH> 100644 --- a/medoo.php +++ b/medoo.php @@ -112,7 +112,7 @@ class medoo } else { - preg_match('/([\w]+)(\[(\>|\>\=|\<|\<\=|\!|\<\>)\])?/i', $key, $match); + preg_match('/([\w\.]+)(\[(\>|\>\=|\<|\<\=|\!|\<\>)\])?/i', $key, $match); if (isset($match[3])) { if ($match[3] == '' || $match[3] == '!') @@ -407,4 +407,4 @@ class medoo ); } } -?> \ No newline at end of file +?>
support `where a.id = <I>` where clause should support table alias.
catfan_Medoo
train
php
573d1da0efa1812b78a137a78e28b5db8cbb8559
diff --git a/sanic/server.py b/sanic/server.py index <HASH>..<HASH> 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -1,4 +1,5 @@ import asyncio +import traceback from functools import partial from inspect import isawaitable from signal import SIGINT, SIGTERM @@ -189,9 +190,15 @@ class HttpProtocol(asyncio.Protocol): "Writing error failed, connection closed {}".format(e)) def bail_out(self, message): - exception = ServerError(message) - self.write_error(exception) - log.error(message) + if self.transport.is_closing(): + log.error( + "Connection closed before error was sent to user @ {}".format( + self.transport.get_extra_info('peername'))) + log.debug('Error experienced:\n{}'.format(traceback.format_exc())) + else: + exception = ServerError(message) + self.write_error(exception) + log.error(message) def cleanup(self): self.parser = None
Fixes write_error loop from bail_out function Fixes stack-overflow found in #<I>
huge-success_sanic
train
py
8a584caa8c35c5c050fa11cf7fc46f9765d7cbb6
diff --git a/pipenv/cli.py b/pipenv/cli.py index <HASH>..<HASH> 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -324,11 +324,6 @@ def ensure_pipfile(validate=True): python = which('python') if not USING_DEFAULT_PYTHON else False project.create_pipfile(python=python) - click.echo(crayons.white(u'Discovering imports from local codebase…', bold=True)) - for req in import_from_code('.'): - click.echo(' Found {0}!'.format(crayons.green(req))) - project.add_package_to_pipfile(req) - # Validate the Pipfile's contents. if validate and project.virtualenv_exists and not PIPENV_SKIP_VALIDATION: # Ensure that Pipfile is using proper casing.
don't import code automatically, only use -c
pypa_pipenv
train
py
0e5a05f05e26a5966c41f2574ee8fa804350be9f
diff --git a/jaraco/dateutil/__init__.py b/jaraco/dateutil/__init__.py index <HASH>..<HASH> 100644 --- a/jaraco/dateutil/__init__.py +++ b/jaraco/dateutil/__init__.py @@ -66,6 +66,7 @@ class Parser(object): # see http://webexhibits.org/calendars/timeline.html for more info osc_per_year = 290091329207984000 osc_per_second = 9192631770 +seconds_per_second = 1 seconds_per_year = 31556940 seconds_per_minute = 60 minutes_per_hour = 60 @@ -231,12 +232,19 @@ def gregorian_date(year, julian_day): def get_period_seconds(period): """ return the number of seconds in the specified period + + >>> get_period_seconds('day') + 86400 + >>> get_period_seconds(86400) + 86400 + >>> get_period_seconds(datetime.timedelta(hours=24)) + 86400 """ if isinstance(period, basestring): try: result = eval('seconds_per_%s' % period.lower()) except NameError: - raise ValueError("period not in (minute, hour, day, month, year)") + raise ValueError("period not in (second, minute, hour, day, month, year)") elif isinstance(period, (int, long)): result = period elif isinstance(period, datetime.timedelta):
Added support for seconds in get_period_seconds Added docs and tests to get_period_seconds
jaraco_tempora
train
py
58f07c9a353c9caa1a77481021cb9e93c6a27b96
diff --git a/aeron-agent/src/main/java/io/aeron/agent/EventDissector.java b/aeron-agent/src/main/java/io/aeron/agent/EventDissector.java index <HASH>..<HASH> 100644 --- a/aeron-agent/src/main/java/io/aeron/agent/EventDissector.java +++ b/aeron-agent/src/main/java/io/aeron/agent/EventDissector.java @@ -265,7 +265,7 @@ public class EventDissector builder.append(String.format( "[%1$f] %2$s [%3$d/%4$d]", - (double)timestamp / 1000000000.0, code.name(), captureLength, bufferLength)); + ((double)timestamp) / 1_000_000_000.0, code.name(), captureLength, bufferLength)); return relativeOffset; }
[Java] Improve readability.
real-logic_aeron
train
java
93f2eaf8c017512de7acafff9863ef06f85e540c
diff --git a/lib/mongoid/criteria.rb b/lib/mongoid/criteria.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/criteria.rb +++ b/lib/mongoid/criteria.rb @@ -22,5 +22,11 @@ module Mongoid #:nodoc: def where(selector = {}) @selector = selector; self end + + # Specifies how to sort this Criteria. + def order_by(*args) + options[:sort] = args.collect { |field| field }; self + end + end end \ No newline at end of file diff --git a/spec/unit/mongoid/criteria_spec.rb b/spec/unit/mongoid/criteria_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/mongoid/criteria_spec.rb +++ b/spec/unit/mongoid/criteria_spec.rb @@ -37,7 +37,32 @@ describe Mongoid::Criteria do end describe "#order_by" do - + + before do + @criteria = Mongoid::Criteria.new + end + + context "when field names specified" do + + it "adds the sort to the options ascending" do + @criteria.order_by(:title) + @criteria.options.should == { :sort => [:title] } + end + + end + + context "when field names and direction specified" do + + it "adds the sort to the options" do + + end + + end + + it "returns self" do + @criteria.order_by.should == @criteria + end + end end \ No newline at end of file
More DSL goodness - Angelina has nothing on this. :)
mongodb_mongoid
train
rb,rb
0053be979a8b9f8b0887d4e2aeb24485a4cdcf3c
diff --git a/commands/server.go b/commands/server.go index <HASH>..<HASH> 100644 --- a/commands/server.go +++ b/commands/server.go @@ -79,11 +79,7 @@ func server(cmd *cobra.Command, args []string) { func serve(port int) { jww.FEEDBACK.Println("Serving pages from " + helpers.AbsPathify(viper.GetString("PublishDir"))) - if BaseUrl == "" { - jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl")) - } else { - jww.FEEDBACK.Printf("Web Server is available at http://localhost:%v\n", port) - } + jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl")) fmt.Println("Press ctrl+c to stop")
Correctly print server URL when base-url is specified in the command line When running hugo server like: $ hugo server -s docs -b myhostname the printed output now directs to http://myhostname:<I> instead of (invariably) <URL>, BaseUrl is never empty, and the required value is always found in Viper.
gohugoio_hugo
train
go
a7fe01ea71a0e8694976e72d09330c1a29809e94
diff --git a/lib/Claroline/WebInstaller/Installer.php b/lib/Claroline/WebInstaller/Installer.php index <HASH>..<HASH> 100644 --- a/lib/Claroline/WebInstaller/Installer.php +++ b/lib/Claroline/WebInstaller/Installer.php @@ -46,6 +46,7 @@ class Installer $refresher->installAssets(); $installer = $kernel->getContainer()->get('claroline.installation.platform_installer'); + $installer->skipAssetsAction(); $installer->installFromOperationFile(); $userManager = $kernel->getContainer()->get('claroline.manager.user_manager');
[WebInstaller] Avoided installing assets twice
claroline_Distribution
train
php
23a022f6e2a8cc1a011383a20f4caccf6712dfd6
diff --git a/lib/httpimagestore/configuration/path.rb b/lib/httpimagestore/configuration/path.rb index <HASH>..<HASH> 100644 --- a/lib/httpimagestore/configuration/path.rb +++ b/lib/httpimagestore/configuration/path.rb @@ -61,9 +61,11 @@ module Configuration path = locals[:path] or raise NoMetaValueForPathTemplatePlaceholerError.new(path_name, template, :path, name) Pathname.new(path).extname.delete('.') when :digest - next @digest if @digest + return locals[:_digest] if locals.include? :_digest data = locals[:body] or raise NoMetaValueForPathTemplatePlaceholerError.new(path_name, template, :body, name) - @digest = Digest::SHA2.new.update(data).to_s[0,16] + digest = Digest::SHA2.new.update(data).to_s[0,16] + # cache digest in request locals + locals[:_digest] = digest else locals[name] or raise NoValueForPathTemplatePlaceholerError.new(path_name, template, name) end
fixing serious/stupid digest caching issue
jpastuszek_httpimagestore
train
rb
f07e212f8acf21e75994b87134c97008e3c48339
diff --git a/dwave_networkx/package_info.py b/dwave_networkx/package_info.py index <HASH>..<HASH> 100644 --- a/dwave_networkx/package_info.py +++ b/dwave_networkx/package_info.py @@ -13,7 +13,7 @@ # limitations under the License. # # ================================================================================================ -__version__ = '0.7.0' +__version__ = '0.7.1' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A NetworkX extension providing graphs and algorithms relevent to working with the D-Wave System'
Update version <I> -> <I> New Features ------------ * A new nice coordinate system for Pegasus graphs
dwavesystems_dwave_networkx
train
py
ab903b92f4d2f441fba2dd9e91e42ae99def545d
diff --git a/lib/ransack/adapters.rb b/lib/ransack/adapters.rb index <HASH>..<HASH> 100644 --- a/lib/ransack/adapters.rb +++ b/lib/ransack/adapters.rb @@ -10,6 +10,8 @@ module Ransack ActiveRecordAdapter.new elsif defined?(::Mongoid) MongoidAdapter.new + else + raise "Unsupported adapter" end end
raise exception for unsupported adapters The reason can be found here: <URL>
activerecord-hackery_ransack
train
rb
23ca17a516f3c7297c86957ebe39d3603f81e03f
diff --git a/lib/onebox/engine/whitelisted_generic_onebox.rb b/lib/onebox/engine/whitelisted_generic_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/whitelisted_generic_onebox.rb +++ b/lib/onebox/engine/whitelisted_generic_onebox.rb @@ -127,6 +127,10 @@ module Onebox !!list.find {|h| %r((^|\.)#{Regexp.escape(h)}$).match(uri.host) } end + def self.probable_discourse(uri) + !!(uri.path =~ /\/t\/[^\/]+\/\d+(\/\d+)?(\?.*)?$/) + end + def self.probable_wordpress(uri) !!(uri.path =~ /\d{4}\/\d{2}\/\d{2}/) end @@ -134,7 +138,8 @@ module Onebox def self.===(other) if other.kind_of?(URI) return WhitelistedGenericOnebox.host_matches(other, WhitelistedGenericOnebox.whitelist) || - WhitelistedGenericOnebox.probable_wordpress(other) + WhitelistedGenericOnebox.probable_wordpress(other) || + WhitelistedGenericOnebox.probable_discourse(other) else super end
Add support for Discourse style URLs
discourse_onebox
train
rb
39ec7580b7e16d13d63f4af5137019eeae6c0d25
diff --git a/core/annotations/provided/src/main/java/org/overture/annotations/provided/OnFailAnnotation.java b/core/annotations/provided/src/main/java/org/overture/annotations/provided/OnFailAnnotation.java index <HASH>..<HASH> 100644 --- a/core/annotations/provided/src/main/java/org/overture/annotations/provided/OnFailAnnotation.java +++ b/core/annotations/provided/src/main/java/org/overture/annotations/provided/OnFailAnnotation.java @@ -177,6 +177,6 @@ public class OnFailAnnotation extends ASTAnnotationAdapter implements TCAnnotati } AStringLiteralExp fmt = (AStringLiteralExp)ast.getArgs().get(0); - System.out.printf(fmt.getValue().getValue(), values); + System.out.printf(fmt.getValue().getValue() + " " + ast.getName().getLocation() + "\n", values); } }
Add LexLocation and newline to @OnFail output
overturetool_overture
train
java
af1532cb3c78f5cae7de612afaa6258c0eb8c7db
diff --git a/provider/aws.go b/provider/aws.go index <HASH>..<HASH> 100644 --- a/provider/aws.go +++ b/provider/aws.go @@ -131,6 +131,10 @@ func (p *AWSProvider) Zones() (map[string]*route53.HostedZone, error) { return nil, err } + for _, zone := range zones { + log.Debugf("Considering zone: %s (domain: %s)", aws.StringValue(zone.Id), aws.StringValue(zone.Name)) + } + return zones, nil } diff --git a/provider/google.go b/provider/google.go index <HASH>..<HASH> 100644 --- a/provider/google.go +++ b/provider/google.go @@ -159,6 +159,10 @@ func (p *GoogleProvider) Zones() (map[string]*dns.ManagedZone, error) { return nil, err } + for _, zone := range zones { + log.Debugf("Considering zone: %s (domain: %s)", zone.Name, zone.DnsName) + } + return zones, nil }
fix: print matched dns zones (gcp, aws) (#<I>)
kubernetes-incubator_external-dns
train
go,go
34ea49a9b13e63be7463d42955373782e3b62b29
diff --git a/src/php/tests/generated_code/AbstractGeneratedCodeTest.php b/src/php/tests/generated_code/AbstractGeneratedCodeTest.php index <HASH>..<HASH> 100644 --- a/src/php/tests/generated_code/AbstractGeneratedCodeTest.php +++ b/src/php/tests/generated_code/AbstractGeneratedCodeTest.php @@ -160,7 +160,7 @@ abstract class AbstractGeneratedCodeTest extends \PHPUnit\Framework\TestCase }, )); list($response, $status) = $call->wait(); - $this->assertSame(\Grpc\STATUS_UNAUTHENTICATED, $status->code); + $this->assertSame(\Grpc\STATUS_OK, $status->code); } public function testInvalidMethodName()
fix status code (#<I>)
grpc_grpc
train
php
1e80c58337b0d245218c76e55603daf07adf9529
diff --git a/lib/3scale_toolbox/entities/account.rb b/lib/3scale_toolbox/entities/account.rb index <HASH>..<HASH> 100644 --- a/lib/3scale_toolbox/entities/account.rb +++ b/lib/3scale_toolbox/entities/account.rb @@ -62,7 +62,7 @@ module ThreeScaleToolbox end def generic_find(remote, criteria) - account = remote.find_account(criteria) + account = remote.find_account(**criteria) if (errors = account['errors']) raise ThreeScaleToolbox::ThreeScaleApiError.new( 'Account find returned errors', errors
remove warning from ruby <I> when last arg is keyword
3scale_3scale_toolbox
train
rb
59347f5dd2b3b2dcf110346f9853249ff334bbc2
diff --git a/configuration/configuration/src/main/java/com/peterphi/configuration/service/rest/api/ConfigUIService.java b/configuration/configuration/src/main/java/com/peterphi/configuration/service/rest/api/ConfigUIService.java index <HASH>..<HASH> 100644 --- a/configuration/configuration/src/main/java/com/peterphi/configuration/service/rest/api/ConfigUIService.java +++ b/configuration/configuration/src/main/java/com/peterphi/configuration/service/rest/api/ConfigUIService.java @@ -33,7 +33,7 @@ public interface ConfigUIService @POST @Path("/create-path") @Produces(MediaType.TEXT_HTML) - Response getConfigPage(@FormParam("nonce") String nonce, + Response getConfigPage(@FormParam("_nonce") String nonce, @FormParam("parent_path") String path, @FormParam("child_path") String child);
Bugfix: was reading nonce from wrong field
petergeneric_stdlib
train
java
15593d558e494f34673fe9ed84cad4c9feac9f59
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -29,6 +29,7 @@ if (!module.parent) { function updateRepo({ token, repoName }) { const repoPath = `tmp/${repoName}`; + rimraf.sync(repoPath); mkdirp.sync(repoPath); let repo;
rimraf repopath before beginning
renovatebot_renovate
train
js
7716cb613812cdbef43fd763550f527152070dc9
diff --git a/Python/lipd/inferred_data.py b/Python/lipd/inferred_data.py index <HASH>..<HASH> 100644 --- a/Python/lipd/inferred_data.py +++ b/Python/lipd/inferred_data.py @@ -143,9 +143,6 @@ def __get_inferred_data_res_2(v=None, calc=True): :param bool calc: If false, we don't need calculations :return dict: Results of calculation """ - - - # Base: If something goes wrong, or if there are no values, then use "NaN" placeholders. d = { "hasMinValue": "nan", "hasMaxValue": "nan", @@ -160,12 +157,20 @@ def __get_inferred_data_res_2(v=None, calc=True): if np.isnan(_min): _min = "nan" + else: + _min = abs(_min) if np.isnan(_max): _max = "nan" + else: + _min = abs(_min) if np.isnan(_mean): _mean = "nan" + else: + _min = abs(_min) if np.isnan(_med): _med = "nan" + else: + _min = abs(_min) d = { "hasMinValue": _min,
Resolution calculations - Resolution should always be positive. Nick said there's some negative values floating around in datasets, so I put abs() on the resolution values just in case Python is the issue.
nickmckay_LiPD-utilities
train
py
d81fa727f6634abb9018fa33875429e1e45c570e
diff --git a/uuid.go b/uuid.go index <HASH>..<HASH> 100644 --- a/uuid.go +++ b/uuid.go @@ -208,3 +208,8 @@ func (u UUID) Time() time.Time { nsec := t % 1e7 return time.Unix(sec+timeBase, nsec).UTC() } + +// Marshaling for JSON +func (u UUID) MarshalJSON() ([]byte, error) { + return []byte(`"` + u.String() + `"`), nil +} diff --git a/uuid_test.go b/uuid_test.go index <HASH>..<HASH> 100644 --- a/uuid_test.go +++ b/uuid_test.go @@ -59,6 +59,15 @@ func TestPredefinedUUID(t *testing.T) { t.Errorf("Version #%d: expected %d got %d", i, testsUUID[i].version, version) } } + + json, err := uuid.MarshalJSON() + if err != nil { + t.Errorf("MarshalJSON #%d: %v", i, err) + } + expectedJson := `"` + testsUUID[i].input + `"` + if string(json) != expectedJson { + t.Errorf("MarshalJSON #%d: expected %d got %d", i, expectedJson, string(json)) + } } }
Let UUID implements Marshaling interface for encoding/json
gocql_gocql
train
go,go
686cc52ca49bd2296d46e3e9ea324eb79ac49a28
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -65,9 +65,9 @@ author = u'Landon Gilbert-Bland' # built documents. # # The short X.Y version. -version = u'3.3.2' +version = u'3.3.3' # The full version, including alpha/beta/rc tags. -release = u'3.3.2' +release = u'3.3.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ Flask-Login provides jwt endpoint protection for Flask. from setuptools import setup setup(name='Flask-JWT-Extended', - version='3.3.2', + version='3.3.3', url='https://github.com/vimalloc/flask-jwt-extended', license='MIT', author='Landon Gilbert-Bland',
Bump to <I> Previous test of <I> (for adding license file) caused it to not allow <I> to be reused, even though that release was nuked. Just incrementing the version number once more
vimalloc_flask-jwt-extended
train
py,py
28720e44327b1cfc5bb193a5194549fbda90ac14
diff --git a/tests/PaymentTest.php b/tests/PaymentTest.php index <HASH>..<HASH> 100644 --- a/tests/PaymentTest.php +++ b/tests/PaymentTest.php @@ -156,8 +156,10 @@ class PaymentTest extends TestCase $payment = $this->getInstance()->setCurrency("EUR")->setAmount(153)->setComment("TesT"); $this->assertEquals($payment->getQrString(), $payment->getQrImage()->getText()); - $payment->getQrImage(true); - $this->assertContains("Content-type: image/png", xdebug_get_headers()); + if(function_exists("xdebug_get_headers")) { + $payment->getQrImage(true); + $this->assertContains("Content-type: image/png", xdebug_get_headers()); + } } private function getInstance(): QrPayment
test header only with xdebug
RikudouSage_QrPaymentCZ
train
php
0d7f59032143ecc6062ac5a1eca39fbd788d8612
diff --git a/lib/appsignal/js_exception_transaction.rb b/lib/appsignal/js_exception_transaction.rb index <HASH>..<HASH> 100644 --- a/lib/appsignal/js_exception_transaction.rb +++ b/lib/appsignal/js_exception_transaction.rb @@ -15,16 +15,16 @@ module Appsignal def set_action return unless @data["action"] - @ext.set_action(@data["action"]) + ext.set_action(@data["action"]) end def set_metadata return unless @data["path"] - @ext.set_metadata("path", @data["path"]) + ext.set_metadata("path", @data["path"]) end def set_error - @ext.set_error( + ext.set_error( @data["name"], @data["message"] || "", Appsignal::Utils.data_generate(@data["backtrace"] || []) @@ -39,7 +39,7 @@ module Appsignal :tags => @data["tags"] }.each do |key, data| next unless data.is_a?(Array) || data.is_a?(Hash) - @ext.set_sample_data( + ext.set_sample_data( key.to_s, Appsignal::Utils.data_generate(data) ) @@ -47,8 +47,8 @@ module Appsignal end def complete! - @ext.finish(0) - @ext.complete + ext.finish(0) + ext.complete end end end
Use attr_accessor for ext
appsignal_appsignal-ruby
train
rb
d9653b059537f8f1d7c4712cc05ad3037d84daba
diff --git a/spec/unit/resource/dsc_script_spec.rb b/spec/unit/resource/dsc_script_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/resource/dsc_script_spec.rb +++ b/spec/unit/resource/dsc_script_spec.rb @@ -70,6 +70,23 @@ describe Chef::Resource::DscScript do expect(dsc_test_resource.configuration_data_script).to eq(configuration_data_script) end + context "when calling imports" do + let(:module_name) { 'FooModule' } + let(:dsc_resources) { ['ResourceA', 'ResourceB'] } + + it "allows an arbitrary number of resources to be set for a module to be set" do + dsc_test_resource.imports module_name, *dsc_resources + module_imports = dsc_test_resource.imports[module_name] + expect(module_imports).to eq(dsc_resources) + end + + it "adds * to the imports when no resources are set for a moudle" do + dsc_test_resource.imports module_name + module_imports = dsc_test_resource.imports[module_name] + expect(module_imports).to eq(['*']) + end + end + it "raises an ArgumentError exception if an attempt is made to set the code attribute when the command attribute is already set" do dsc_test_resource.command(configuration_path) expect { dsc_test_resource.code(configuration_code) }.to raise_error(ArgumentError)
Added test for dsc_script resource's import property
chef_chef
train
rb
69f6bea2c26d60c4c15ac96a674fa0865632d8fc
diff --git a/packages/ember-runtime/lib/system/native_array.js b/packages/ember-runtime/lib/system/native_array.js index <HASH>..<HASH> 100644 --- a/packages/ember-runtime/lib/system/native_array.js +++ b/packages/ember-runtime/lib/system/native_array.js @@ -108,9 +108,7 @@ forEach(NativeArray.keys(), function(methodName) { } }); -if (ignore.length > 0) { - NativeArray = NativeArray.without.apply(NativeArray, ignore); -} +NativeArray = NativeArray.without.apply(NativeArray, ignore); /** Creates an `Ember.NativeArray` from an Array like object.
Remove unnecessary check for `NativeArray` `ignore` has always one or more items.
emberjs_ember.js
train
js
0bcdd73515e2be5381a4303e7e770cf9ff9debaa
diff --git a/koordinates/__init__.py b/koordinates/__init__.py index <HASH>..<HASH> 100644 --- a/koordinates/__init__.py +++ b/koordinates/__init__.py @@ -30,7 +30,6 @@ from .layers import Layer, Table from .licenses import License from .metadata import Metadata from .publishing import Publish -from .publishrequest import PublishRequest from .sets import Set from .tokens import Token from .users import Group, User diff --git a/koordinates/client.py b/koordinates/client.py index <HASH>..<HASH> 100644 --- a/koordinates/client.py +++ b/koordinates/client.py @@ -13,7 +13,6 @@ import sys import requests from . import layers, licenses, metadata, publishing, sets, tokens, users -from .publishrequest import PublishRequest from . import exceptions
Remove references to PublishRequest The publishrequest module no longer exists so remove references to it.
koordinates_python-client
train
py,py
3cf0706f8609fdf703a5315b6f2e58880622bddd
diff --git a/lib/adal/cached_token_response.rb b/lib/adal/cached_token_response.rb index <HASH>..<HASH> 100644 --- a/lib/adal/cached_token_response.rb +++ b/lib/adal/cached_token_response.rb @@ -37,8 +37,10 @@ module ADAL end @authority = authority if client.respond_to? :client_id + @client = client @client_id = client.client_id else + @client = ClientCredential.new(client) @client_id = client end @token_response = token_response @@ -123,7 +125,7 @@ module ADAL # @return TokenResponse def refresh(new_resource = resource) token_response = TokenRequest - .new(authority, ADAL::ClientCredential.new(client_id)) + .new(authority, @client) .get_with_refresh_token(refresh_token, new_resource) if token_response.instance_of? SuccessResponse token_response.parse_id_token(id_token)
Added client secret to refresh calls from cache. This is part of OAuth <I>.
AzureAD_azure-activedirectory-library-for-ruby
train
rb
e668fc0034a06e9184b56e213fe441d37a290565
diff --git a/lib/roma/async_process.rb b/lib/roma/async_process.rb index <HASH>..<HASH> 100644 --- a/lib/roma/async_process.rb +++ b/lib/roma/async_process.rb @@ -643,7 +643,7 @@ module Roma end def push_a_vnode_stream(hname, vn, nid) - @log.info("#{__method__}:hname=#{hname} vn=#{vn} nid=#{nid}") + @log.debug("#{__method__}:hname=#{hname} vn=#{vn} nid=#{nid}") stop_clean_up
change log level of push_a_vnode_stream from info to debug
roma_roma
train
rb
aac640cb243039f09387d442a5015f1deb4fa871
diff --git a/lib/qbo_api/entity.rb b/lib/qbo_api/entity.rb index <HASH>..<HASH> 100644 --- a/lib/qbo_api/entity.rb +++ b/lib/qbo_api/entity.rb @@ -4,9 +4,9 @@ class QboApi def singular(entity) e = snake_to_camel(entity) case e - when 'Classes' + when 'Classes', 'Class' 'Class' - when /^(Entitlements|Preferences)$/ + when 'Entitlements', 'Preferences' e else e.chomp('s')
Fix bug that singularized 'Class' to 'Clas'
minimul_qbo_api
train
rb
ccfce0011759a2efae4c536558b2c68d2e05988d
diff --git a/src/models/Contact.php b/src/models/Contact.php index <HASH>..<HASH> 100644 --- a/src/models/Contact.php +++ b/src/models/Contact.php @@ -139,6 +139,7 @@ class Contact extends \hipanel\base\Model 'voice_phone' => Yii::t('hipanel:client', 'Phone'), 'fax_phone' => Yii::t('hipanel:client', 'Fax'), 'country_name' => Yii::t('hipanel:client', 'Country'), + 'country' => Yii::t('hipanel:client', 'Country'), 'isresident' => Yii::t('hipanel:client', 'RF resident'), 'street1' => Yii::t('hipanel:client', 'Street'), 'street2' => Yii::t('hipanel:client', 'Street 2'),
Added attribute label for `country` to Contact model
hiqdev_hipanel-module-client
train
php
a6e1326be7f3dcebdab2a6129bae0c45338f6b18
diff --git a/phypno/widgets/notes.py b/phypno/widgets/notes.py index <HASH>..<HASH> 100644 --- a/phypno/widgets/notes.py +++ b/phypno/widgets/notes.py @@ -361,8 +361,8 @@ class Stages(QWidget): which have start_time, end_time, and stage. """ - minimum = floor(self.parent.overview.minimum) - maximum = floor(self.parent.overview.maximum) + minimum = int(floor(self.parent.overview.minimum)) + maximum = int(floor(self.parent.overview.maximum)) window_length = self.parent.preferences.values['stages/scoring_window'] main = Element('sleep_stages') diff --git a/phypno/widgets/preferences.py b/phypno/widgets/preferences.py index <HASH>..<HASH> 100644 --- a/phypno/widgets/preferences.py +++ b/phypno/widgets/preferences.py @@ -27,7 +27,7 @@ defaults = {'main/geometry': [400, 300, 1024, 768], 'traces/y_scale_presets': [.1, .2, .5, 1, 2, 5, 10], 'traces/label_width': 2., 'utils/read_intervals': 10 * 60, - 'stages/scoring_window': 30., + 'stages/scoring_window': 30, 'spectrum/x_limit': [0, 30], 'spectrum/y_limit': [0, -10], # log unit }
make sure that range gets only int when making the labels for overview
wonambi-python_wonambi
train
py,py
60ee60af76d95961595db93a7b05640dc52d0510
diff --git a/src/RocknRoot/StrayFw/Database/Postgres/Schema.php b/src/RocknRoot/StrayFw/Database/Postgres/Schema.php index <HASH>..<HASH> 100644 --- a/src/RocknRoot/StrayFw/Database/Postgres/Schema.php +++ b/src/RocknRoot/StrayFw/Database/Postgres/Schema.php @@ -74,7 +74,7 @@ class Schema extends ProviderSchema $mapping = Mapping::get($this->mapping); $definition = $this->getDefinition(); $database = GlobalDatabase::get($mapping['config']['database']); - +t s $enumRealName = null; if (isset($enumDefinition['name']) === true) { $enumRealName = $enumDefinition['name']; @@ -87,8 +87,8 @@ class Schema extends ProviderSchema throw new DatabaseError('db/build : ' . print_r($statement->errorInfo(), true)); } - if (isset($modelDefinition['values']) === false) { - throw new InvalidSchemaDefinition('enum "' . $modelName . '" has no value'); + if (isset($enumDefinition['values']) === false) { + throw new InvalidSchemaDefinition('enum "' . $enumName. '" has no value'); } $values = array();
fix #<I> SQL data building
RocknRoot_strayFw
train
php
dae08ba51c29703941abd2e386d151490aa8bc75
diff --git a/src/Prooph.php b/src/Prooph.php index <HASH>..<HASH> 100644 --- a/src/Prooph.php +++ b/src/Prooph.php @@ -1,8 +1,8 @@ <?php /** * This file is part of the prooph/php-cs-fixer-config. - * (c) 2016-2017 prooph software GmbH <contact@prooph.de> - * (c) 2016-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com> + * (c) 2016-2018 prooph software GmbH <contact@prooph.de> + * (c) 2016-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/ProophTest.php b/tests/ProophTest.php index <HASH>..<HASH> 100644 --- a/tests/ProophTest.php +++ b/tests/ProophTest.php @@ -1,8 +1,8 @@ <?php /** * This file is part of the prooph/php-cs-fixer-config. - * (c) 2016-2017 prooph software GmbH <contact@prooph.de> - * (c) 2016-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com> + * (c) 2016-2018 prooph software GmbH <contact@prooph.de> + * (c) 2016-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code.
It's <I>!
prooph_php-cs-fixer-config
train
php,php
6a3219aa6e0ca459028aa5ec66f9a863666b42e5
diff --git a/lib/Diaporama.js b/lib/Diaporama.js index <HASH>..<HASH> 100644 --- a/lib/Diaporama.js +++ b/lib/Diaporama.js @@ -48,6 +48,9 @@ function Diaporama (container, data, opts) { if (self._autoplay) { self._start(); } + else { + self._requestRender(); + } }); this._requestResize();
When there is no autoplay. Produce at least one render
gre_diaporama
train
js
f636cdf5f7b4f743f2d537654b43b1c5a79a1e20
diff --git a/internal/testing/shader.go b/internal/testing/shader.go index <HASH>..<HASH> 100644 --- a/internal/testing/shader.go +++ b/internal/testing/shader.go @@ -303,9 +303,6 @@ func ShaderProgramImages(imageNum int) shaderir.Program { for i := 0; i < imageNum; i++ { p.Uniforms = append(p.Uniforms, shaderir.Type{Main: shaderir.Texture2D}) - if i > 0 { - p.Uniforms = append(p.Uniforms, shaderir.Type{Main: shaderir.Vec4}) - } } // In the fragment shader, local variables are:
testing: Bug fix: Wrong uniform variables
hajimehoshi_ebiten
train
go
251522e7553558b64eca481c7eb8046abac0c50d
diff --git a/lib/ezutils/classes/ezuri.php b/lib/ezutils/classes/ezuri.php index <HASH>..<HASH> 100644 --- a/lib/ezutils/classes/ezuri.php +++ b/lib/ezutils/classes/ezuri.php @@ -59,7 +59,7 @@ class eZURI More info on IRI here: http://www.w3.org/International/O-URL-and-ident.html */ - function decodeIRI( $str ) + static function decodeIRI( $str ) { $str = urldecode( $str ); // Decode %xx entries, we now have a utf-8 string $codec = eZTextCodec::instance( 'utf-8' ); // Make sure string is converted from utf-8 to internal encoding @@ -72,7 +72,7 @@ class eZURI More info on IRI here: http://www.w3.org/International/O-URL-and-ident.html */ - function encodeIRI( $str ) + static function encodeIRI( $str ) { $codec = eZTextCodec::instance( false, 'utf-8' ); $str = $codec->convertString( $str ); // Make sure the string is in utf-8
- fixed: encodeIRI and decodeIRI are not defined as static git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/unstable/<I>-<I>-<I>-php5@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
e324d6715c471f03f0107e2dac8f492b9315a5b5
diff --git a/tests/Arabic/NormaliseTest.php b/tests/Arabic/NormaliseTest.php index <HASH>..<HASH> 100644 --- a/tests/Arabic/NormaliseTest.php +++ b/tests/Arabic/NormaliseTest.php @@ -176,4 +176,14 @@ class NormaliseTest extends AbstractTestCase $this->assertTrue((bool) $this->normalise->isTehlike('ة')); $this->assertFalse((bool) $this->normalise->isTehlike('ج')); } + + /** @test */ + public function it_can_check_if_passed_character_is_small() + { + $this->markTestSkipped('Until Small alef is fixed and replaces MINI_ALEF #8'); + $this->assertTrue((bool)$this->normalise->isSmall($smallAlef = 'ٰ')); + $this->assertTrue((bool)$this->normalise->isSmall($smallYeh = 'ۦ')); + $this->assertTrue((bool)$this->normalise->isSmall($smallWaw = 'ۥ')); + $this->assertFalse((bool)$this->normalise->isSmall('ج')); + } }
Add test for isSmall, but failling b/c #8
alhoqbani_ar-php
train
php
f6147b4985c77a21d0c9c213199376255ba5f0d7
diff --git a/models/Event.php b/models/Event.php index <HASH>..<HASH> 100644 --- a/models/Event.php +++ b/models/Event.php @@ -49,6 +49,12 @@ class Event extends Model public $end; /** + * Day of Week settings for repeating events. Enter the numerical days of the week ex. [1,4] would repeat on Monday and Thursday. + * @var array + */ + public $dow; + + /** * A URL that will be visited when this event is clicked by the user. For more information on controlling this behavior, see the eventClick callback. * @var [type] */
Added Day of Week functionality to the Event model.
philippfrenzel_yii2fullcalendar
train
php
0d3d9213de9b98aaf1d7b39e3496ba0db29d5619
diff --git a/tests/e2e/redoc.spec.js b/tests/e2e/redoc.spec.js index <HASH>..<HASH> 100644 --- a/tests/e2e/redoc.spec.js +++ b/tests/e2e/redoc.spec.js @@ -61,6 +61,7 @@ describe('APIs.guru specs test', ()=> { delete apisGuruList['googleapis.com:mirror']; // bad urls in images delete apisGuruList['googleapis.com:discovery']; // non-string references delete apisGuruList['clarify.io']; // non-string references + delete apisGuruList['pushpay.com']; // https://github.com/Rebilly/ReDoc/issues/30 // run quick version of e2e test on all builds except releases if (process.env.TRAVIS && !process.env.TRAVIS_TAG) {
exclude pushpay.com spec from e2e test
Rebilly_ReDoc
train
js
6522f3595d989b77bb9f64955eaba23f1728f214
diff --git a/src/kba/pipeline/load.py b/src/kba/pipeline/load.py index <HASH>..<HASH> 100644 --- a/src/kba/pipeline/load.py +++ b/src/kba/pipeline/load.py @@ -102,6 +102,9 @@ if __name__ == '__main__': '--clear-registered-workers', action='store_true', default=False, help='Delete registered worker nodes from Zookeeper... the worker might still continue running, so be careful.') parser.add_argument( + '--worker-data', action='store_true', default=False, + help='Show full data for each pending task.') + parser.add_argument( '--purge', help='Totally remove these tasks from the entire queue -- gone.') parser.add_argument( @@ -286,3 +289,7 @@ if __name__ == '__main__': num = tq.push(task['i_str'], redo=True) assert num == 1 + + if args.worker_data: + for data in tq.pending: + print json.dumps(data, indent=4, sort_keys=True)
creating --worker-data flat for kba.pipeline.laod
trec-kba_streamcorpus-pipeline
train
py
85ba1ab65f09ce8d4376cc6b946d1518666752a1
diff --git a/source/rafcon/mvc/models/container_state.py b/source/rafcon/mvc/models/container_state.py index <HASH>..<HASH> 100644 --- a/source/rafcon/mvc/models/container_state.py +++ b/source/rafcon/mvc/models/container_state.py @@ -170,7 +170,7 @@ class ContainerStateModel(StateModel): model_name = "state" # Defer state type from class type (Execution, Hierarchy, ...) model_class = None - if not isinstance(info.args[1], (str, unicode)) and info.args[1] is not None: + if not isinstance(info.args[1], (str, unicode, dict)) and info.args[1] is not None: model_class = get_state_model_class_for_state(info.args[1]) model_key = "state_id" return model_list, data_list, model_name, model_class, model_key
container-model ignores dicts in get_model_info-method ->those regular occur for states-setter
DLR-RM_RAFCON
train
py
6f7d85f2a6f5d224e3b039fbb4da8ad2203b22e7
diff --git a/lib/tinymce/rails/asset_installer.rb b/lib/tinymce/rails/asset_installer.rb index <HASH>..<HASH> 100644 --- a/lib/tinymce/rails/asset_installer.rb +++ b/lib/tinymce/rails/asset_installer.rb @@ -84,7 +84,7 @@ module TinyMCE def symlink_asset(src, dest) with_asset(src, dest) do |src, dest| - unless File.exists?(dest) && File.readlink(dest) == src + unless File.exists?(dest) && File.symlink?(dest) && File.readlink(dest) == src logger.info "Creating symlink #{dest}" FileUtils.ln_s(src, dest, :force => true) else
Check if file is a symlink before doing readlink
spohlenz_tinymce-rails
train
rb
011f61798e5880cfb1f278eb88298500b3aeb312
diff --git a/drools-core/src/main/java/org/drools/core/common/DefaultAgenda.java b/drools-core/src/main/java/org/drools/core/common/DefaultAgenda.java index <HASH>..<HASH> 100644 --- a/drools-core/src/main/java/org/drools/core/common/DefaultAgenda.java +++ b/drools-core/src/main/java/org/drools/core/common/DefaultAgenda.java @@ -1402,7 +1402,7 @@ public class DefaultAgenda } private void waitAndEnterExecutionState( ExecutionState newState ) { - if (currentState != ExecutionState.INACTIVE) { + while (currentState != ExecutionState.INACTIVE) { try { stateMachineLock.wait(); } catch (InterruptedException e) {
deal with spurious wakeups of Object.wait()
kiegroup_drools
train
java
69a3c8391cb1c339d5b5b9148961185ce4480d6d
diff --git a/src/frontend/org/voltdb/dbmonitor/js/voltdb.render.js b/src/frontend/org/voltdb/dbmonitor/js/voltdb.render.js index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/dbmonitor/js/voltdb.render.js +++ b/src/frontend/org/voltdb/dbmonitor/js/voltdb.render.js @@ -185,6 +185,9 @@ function alertNodeClicked(obj) { saveSessionCookie("username", null); saveSessionCookie("password", null); saveSessionCookie("admin", null); + saveCookie("username", null); + saveCookie("password", null); + saveCookie("admin", null); $("#loginLink").trigger("click"); } else {
Removed invalid user credential cookies.
VoltDB_voltdb
train
js
7a196d97c82e63d8cc2f824d4d84f19870c63c36
diff --git a/lib/visitor/evaluator.js b/lib/visitor/evaluator.js index <HASH>..<HASH> 100644 --- a/lib/visitor/evaluator.js +++ b/lib/visitor/evaluator.js @@ -655,7 +655,7 @@ Evaluator.prototype.visitImport = function(imported){ } // support optional .styl - if (!literal && !~path.indexOf('.styl')) path += '.styl'; + if (!literal && !/\.styl$/i.test(path)) path += '.styl'; // Lookup found = utils.lookup(path, this.paths, this.filename);
Fixes #<I> directory with `.styl` in the name and local install of stylus
stylus_stylus
train
js
0589be5676946c09049580e535eb67c56af7c806
diff --git a/src/main/java/net/dv8tion/jda/MessageHistory.java b/src/main/java/net/dv8tion/jda/MessageHistory.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/dv8tion/jda/MessageHistory.java +++ b/src/main/java/net/dv8tion/jda/MessageHistory.java @@ -74,14 +74,14 @@ public class MessageHistory } /** - * Queues the next set of 50 Messages and returns them + * Queues the next set of 100 Messages and returns them * If the end of the chat was already reached, this function returns null * - * @return a list of the next 50 Messages (max), or null if at end of chat + * @return a list of the next 100 Messages (max), or null if at end of chat */ public List<Message> retrieve() { - return retrieve(50); + return retrieve(100); } /**
Changed MessageHistory.retrieve() to get <I> messages (max) instead of old <I> => better performance and less calls
DV8FromTheWorld_JDA
train
java
93dc76d04a375ea6df6849e6b0af9be50f5c770a
diff --git a/closure/goog/editor/plugins/enterhandler.js b/closure/goog/editor/plugins/enterhandler.js index <HASH>..<HASH> 100644 --- a/closure/goog/editor/plugins/enterhandler.js +++ b/closure/goog/editor/plugins/enterhandler.js @@ -454,9 +454,9 @@ goog.editor.plugins.EnterHandler.prototype.ensureBlockIeOpera = function(tag, } - if (goog.userAgent.IE) { - // IE has a bug where if the cursor is directly before a block node - // (e.g., the content is "foo[cursor]<blockquote>bar</blockquote>"), + if (goog.userAgent.IE && !goog.userAgent.isVersion(9)) { + // IE (before IE9) has a bug where if the cursor is directly before a block + // node (e.g., the content is "foo[cursor]<blockquote>bar</blockquote>"), // the FormatBlock command actually formats the "bar" instead of the "foo". // This is just wrong. To work-around this, we want to move the // selection back one character, and then restore it to its prior position.
Fix IE9 bug "Enter in a message body gives two breaks instead of one" It appears an obsolete work-around in Closure's enterhandler.js was causing the problem. R=marcosalmeida,hcnidumolu DELTA=3 (0 added, 0 deleted, 3 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-library
train
js
aa95f257967a91bcfb60f69674be8b809a63bab5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -247,7 +247,7 @@ def do_setup(): 'setproctitle>=1.1.8, <2', 'sqlalchemy>=0.9.8', 'tabulate>=0.7.5, <0.8.0', - 'thrift>=0.9.2, <0.10', + 'thrift>=0.9.2', 'zope.deprecation>=4.0, <5.0', ], extras_require={
[AIRFLOW-<I>] Remove `thrift < <I>` requirement Closes #<I> from dan-disqus/Thrift
apache_airflow
train
py
58f1dfee0f860e4d51b0c09f1474585119b6cb72
diff --git a/stop.js b/stop.js index <HASH>..<HASH> 100644 --- a/stop.js +++ b/stop.js @@ -1,5 +1,3 @@ 'use strict'; -var allonsy = require('./features/allons-y/allons-y.js'); - -allonsy.stop(); +require('./features/allons-y/allons-y.js').stop();
refactor(stop): don't declare a variable
CodeCorico_allons-y
train
js
074cfa0049c47457a1e88c5427bc88e25e02c488
diff --git a/corser.js b/corser.js index <HASH>..<HASH> 100644 --- a/corser.js +++ b/corser.js @@ -3,7 +3,7 @@ http.createServer(function (req, res) { res.setHeader('Access-Control-Allow-Origin', '*'); res.writeHead(200, {'Content-Type': 'application/json'}); res.end(JSON.stringify({ - message: 'Answered ' + req.method + ' request from ' + req.headers.host + message: req.headers.host + ' answered a ' + req.method + ' request.' })); }).listen(80, '0.0.0.0'); console.log('Server running at http://127.0.0.1:1337/');
The Host header refers to the host and port number of the resource being requested, not the other way around.
agrueneberg_Corser
train
js
3bb6ef9f8b535d29f360cae70d7a49d52d2e977f
diff --git a/tests/BlinkTest.php b/tests/BlinkTest.php index <HASH>..<HASH> 100644 --- a/tests/BlinkTest.php +++ b/tests/BlinkTest.php @@ -8,7 +8,7 @@ use DoSomething\GatewayTests\Helpers\UserResponse; class BlinkTest extends PHPUnit_Framework_TestCase { protected $authorizedConfig = [ - 'url' => 'https://blink-phpunit.dosomething.org', // not a real server! + 'url' => 'https://blink-phpunit.dosomething.org/api/', // not a real server! 'user' => 'blink', 'password' => 'blink', ];
Make sure config example includes /api/ in url to avoid confusion
DoSomething_gateway
train
php
5867b1bf81a1b769d49bda0b4895356eba5dc48c
diff --git a/log.js b/log.js index <HASH>..<HASH> 100644 --- a/log.js +++ b/log.js @@ -62,4 +62,20 @@ module.exports = function (options) { instance.log(info); }); }); + + afterEach(function (done) { + if (options.afterEach) { + return options.afterEach(options, done); + } + + done(); + }); + + after(function (done) { + if (options.afterEach) { + return options.afterEach(options, done); + } + + done(); + }); };
[api] Accept `after` and `afterEach` from options.
winstonjs_abstract-winston-transport
train
js
8ca21384e85703f219e8d4976bf6c8e6ae184e9b
diff --git a/libraries/joomla/application/component/modeladmin.php b/libraries/joomla/application/component/modeladmin.php index <HASH>..<HASH> 100644 --- a/libraries/joomla/application/component/modeladmin.php +++ b/libraries/joomla/application/component/modeladmin.php @@ -656,23 +656,8 @@ abstract class JModelAdmin extends JModelForm $table = $this->getTable(); while ($table->load(array('alias' => $alias, 'catid' => $category_id))) { - $m = null; - if (preg_match('#-(\d+)$#', $alias, $m)) - { - $alias = preg_replace('#-(\d+)$#', '-' . ($m[1] + 1) . '', $alias); - } - else - { - $alias .= '-2'; - } - if (preg_match('#\((\d+)\)$#', $title, $m)) - { - $title = preg_replace('#\(\d+\)$#', '(' . ($m[1] + 1) . ')', $title); - } - else - { - $title .= ' (2)'; - } + $title = JString::increment($title); + $alias = JString::increment($alias, 'dash'); } return array($title, $alias);
Updates JModelAdmin to use JString::increment.
joomla_joomla-framework
train
php
21b169f515fb44a5091ce171543988c791a01533
diff --git a/pyt/module_definitions.py b/pyt/module_definitions.py index <HASH>..<HASH> 100644 --- a/pyt/module_definitions.py +++ b/pyt/module_definitions.py @@ -42,7 +42,5 @@ class ModuleDefinitions(): definition = self.get_definition(name) if definition: definition.node = node - else: - raise Exception('Attempting to set node on nonexisting defintion')
no exception when class cannot be found.
python-security_pyt
train
py
79620efe35be5a6e81cb8018f4a5a7b3d894ba82
diff --git a/jobbie/test/java/org/openqa/selenium/ie/InternetExplorerJavascriptTests.java b/jobbie/test/java/org/openqa/selenium/ie/InternetExplorerJavascriptTests.java index <HASH>..<HASH> 100644 --- a/jobbie/test/java/org/openqa/selenium/ie/InternetExplorerJavascriptTests.java +++ b/jobbie/test/java/org/openqa/selenium/ie/InternetExplorerJavascriptTests.java @@ -1,4 +1,19 @@ -// Copyright 2010 Google Inc. All Rights Reserved. +/* +Copyright 2007-2010 WebDriver committers +Copyright 2007-2010 Google Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package org.openqa.selenium.ie;
EranMes: Fixing copyright notice. r<I>
SeleniumHQ_selenium
train
java
4fdb351c32d56f4b16b4699d742abebc098ec8d4
diff --git a/scripts/grunt/options/exec.js b/scripts/grunt/options/exec.js index <HASH>..<HASH> 100644 --- a/scripts/grunt/options/exec.js +++ b/scripts/grunt/options/exec.js @@ -9,6 +9,6 @@ module.exports = function(config, grunt) { return { tslint: 'node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project ./tsconfig.json', jest: 'node ./node_modules/jest-cli/bin/jest.js ' + coverage, - webpack: './node_modules/.bin/webpack --config scripts/webpack/webpack.prod.js', + webpack: 'node ./node_modules/webpack/bin/webpack.js --config scripts/webpack/webpack.prod.js', }; };
build: tryingt of fix windows build issue
grafana_grafana
train
js
c1e83fc02ce392b2c5b7e2672596490bbd203875
diff --git a/lib/grape_token_auth/configuration.rb b/lib/grape_token_auth/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/grape_token_auth/configuration.rb +++ b/lib/grape_token_auth/configuration.rb @@ -40,7 +40,8 @@ module GrapeTokenAuth :secret, :digest, :messages, - :from_address + :from_address, + :default_url_options def initialize @token_lifespan = 60 * 60 * 24 * 7 * 2 # 2 weeks @@ -57,6 +58,7 @@ module GrapeTokenAuth @digest = 'SHA256' @messages = Mailer::DEFAULT_MESSAGES @from_address = nil + @default_url_options = {} end def key_generator diff --git a/spec/lib/grape_token_auth/configuration_spec.rb b/spec/lib/grape_token_auth/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/grape_token_auth/configuration_spec.rb +++ b/spec/lib/grape_token_auth/configuration_spec.rb @@ -173,5 +173,11 @@ module GrapeTokenAuth expect(subject.from_address).to be_nil end end + + describe '#default_url_options' do + it 'defaults to an empty hash' do + expect(subject.default_url_options).to eq({}) + end + end end end
Add default_url_options to configuration Allows for passing a hash for generating URLs in emails and such.
mcordell_grape_token_auth
train
rb,rb
3b7328dd7d9d235bf32b3cfb836b49e50b70be77
diff --git a/oz/plugins/redis_sessions/__init__.py b/oz/plugins/redis_sessions/__init__.py index <HASH>..<HASH> 100644 --- a/oz/plugins/redis_sessions/__init__.py +++ b/oz/plugins/redis_sessions/__init__.py @@ -16,4 +16,5 @@ def random_hex(length): def password_hash(password, password_salt=None): """Hashes a specified password""" password_salt = password_salt or oz.app.settings["session_salt"] - return u"sha256!%s" % hashlib.sha256(unicode(password_salt) + unicode(password)).hexdigest() + salted_password = "".join([unicode(password_salt), password]) + return "sha256!%s" % unicode(hashlib.sha256(salted_password.encode("utf-8")).hexdigest())
Allow for non-ascii characters in password_hash
dailymuse_oz
train
py
346bd15e9330ddc719e104733cc0f91d1f820838
diff --git a/runtime/lib/query/Criterion.php b/runtime/lib/query/Criterion.php index <HASH>..<HASH> 100644 --- a/runtime/lib/query/Criterion.php +++ b/runtime/lib/query/Criterion.php @@ -328,7 +328,7 @@ class Criterion $index++; // increment this first to correct for wanting bind params to start with :p1 $bindParams[] = ':p' . $index; } - if ($index !== 0) { + if (count($bindParams)) { $field = ($this->table === null) ? $this->column : $this->table . '.' . $this->column; $sb .= $field . $this->comparison . '(' . implode(',', $bindParams) . ')'; } else {
[<I>] Fixed bug when Criteria::IN was called after another condition (closes #<I>)
propelorm_Propel
train
php
0604bd1515fee615a66eae1734b8492320067a45
diff --git a/cpu6502.py b/cpu6502.py index <HASH>..<HASH> 100644 --- a/cpu6502.py +++ b/cpu6502.py @@ -389,6 +389,9 @@ class ControlHandler: self.cpu.running = True self.sock.send("resetting\n") + def fileno(self): + return self.sock.fileno() + def handle_read(self): buf = self.sock.recv(1024) if not buf: @@ -610,15 +613,14 @@ class CPU: timeout = 0 if not self.running: timeout = 1 - sockets = [self.control_listener] + [x.sock for x in self.control] + sockets = [self.control_listener] + self.control rs, _, _ = select.select(sockets, [], [], timeout) for s in rs: if s is self.control_listener: cs, _ = self.control_listener.accept() self.control.append(ControlHandler(self, cs)) else: - c = [x for x in self.control if x.sock is s][0] - c.handle_read() + s.handle_read() count = 1000 while count > 0 and self.running:
add fileno() method to ControlHandler for better compatiblity with select()
6809_MC6809
train
py
e9ae99458a305737661eb13f04d564938b08b207
diff --git a/pinned/pinned.go b/pinned/pinned.go index <HASH>..<HASH> 100644 --- a/pinned/pinned.go +++ b/pinned/pinned.go @@ -44,8 +44,7 @@ func (c *Config) Dial(network, addr string) (net.Conn, error) { Wire: cn, } - host, _, _ := net.SplitHostPort(addr) - conf.ServerName = host + conf.ServerName, _, _ = net.SplitHostPort(addr) if err = conn.Handshake(); err != nil { conn.Close()
pkg: Simplify assignment
flynn_flynn
train
go
ab203799c5cb943e256438eb024c7c8d53abae38
diff --git a/src/convertFromHTML.js b/src/convertFromHTML.js index <HASH>..<HASH> 100644 --- a/src/convertFromHTML.js +++ b/src/convertFromHTML.js @@ -11,7 +11,7 @@ */ import { List, OrderedSet, Map } from 'immutable'; -import { ContentState, CharacterMetadata, ContentBlock, BlockMapBuilder, genKey } from 'draft-js'; +import { ContentState, CharacterMetadata, ContentBlock, Entity, BlockMapBuilder, genKey } from 'draft-js'; import getSafeBodyFromHTML from './util/parseHTML'; import rangeSort from './util/rangeSort'; @@ -640,8 +640,12 @@ const convertFromHTML = ({ ) => { let contentState = ContentState.createFromText(''); const createEntityWithContentState = (...args) => { - contentState = contentState.createEntity(...args); - return contentState.getLastCreatedEntityKey(); + if (contentState.createEntity) { + contentState = contentState.createEntity(...args); + return contentState.getLastCreatedEntityKey(); + } + + return Entity.create(...args); };
check for ContentState.createEntity for compatibility with earlier Draft versions
HubSpot_draft-convert
train
js
cfb382f89b83ca814e05b0fb54db88ade3edee3e
diff --git a/src/main/java/org/jboss/remotingjmx/RemotingConnectorServer.java b/src/main/java/org/jboss/remotingjmx/RemotingConnectorServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/remotingjmx/RemotingConnectorServer.java +++ b/src/main/java/org/jboss/remotingjmx/RemotingConnectorServer.java @@ -67,12 +67,6 @@ public class RemotingConnectorServer extends JMXConnectorServer { private boolean stopped = false; /** - * A map of the connections registered with this RemotingConnectorServer - */ - // TODO - Not sure if really needed but lets maintain for now. - private final Map<String, VersionedProxy> registeredConnections = new HashMap<String, VersionedProxy>(); - - /** * The Remoting Endpoint this ConnectorServer will register against when it is started. */ private Endpoint endpoint; @@ -153,7 +147,6 @@ public class RemotingConnectorServer extends JMXConnectorServer { public void connectionOpened(final VersionedProxy proxy) { String connectionId = proxy.getConnectionId(); log.debugf("Connection '%s' now opened.", connectionId); - registeredConnections.put(connectionId, proxy); connectionOpened(connectionId, "", null); }
[AS-<I>] Removed HashMap causing memory leak.
jbossas_remoting-jmx
train
java
422a9de853e4d919c60ebf87e47b937122babdf6
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -71,7 +71,6 @@ ns = Collection( www, ) ns.configure({ - "blacken": {"folders": ["tests", "fabric"]}, 'tests': { # TODO: have pytest tasks honor these? 'package': 'fabric',
Not sure why Chris explicitly put this in here actually. It ends up skipping a lot of stuff like tasks.py, setup.py etc
fabric_fabric
train
py
be57a8a44b155cf1ff391f648e220cb91cfa2d7b
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -282,7 +282,8 @@ function installNpmDeps(targetPath){ var q = Q.defer(); console.log('Installing project NPM dependancies (may take a few moments)...'); cd(targetPath); - var child = exec('npm install', {async:true}); + var sudoStr = (os.platform() == "darwin" || argv.sudo) ? "sudo " : ""; + var child = exec(sudoStr + 'npm install', {async:true}); child.stdout.on('data', function(data) { console.log('data: ' + data); q.resolve();
Added --sudo option and auto sudo for npm commands on mac OS
MobileCaddy_mobilecaddy-cli
train
js
8e01fa86325955b1c5d50f608e1c204e8728a437
diff --git a/Grid/Export/DSVExport.php b/Grid/Export/DSVExport.php index <HASH>..<HASH> 100644 --- a/Grid/Export/DSVExport.php +++ b/Grid/Export/DSVExport.php @@ -45,13 +45,13 @@ class DSVExport extends Export rewind($outstream); - $content = ''; + //$content = ''; + $content = "\xEF\xBB\xBF" ; while (($buffer = fgets($outstream)) !== false) { $content .= $buffer; } fclose($outstream); - $this->content = $content; }
fix export UTF8 Excel CSV
APY_APYDataGridBundle
train
php
7e52b574426cd35d3c127224c490fb285893542e
diff --git a/bouncer/models.py b/bouncer/models.py index <HASH>..<HASH> 100644 --- a/bouncer/models.py +++ b/bouncer/models.py @@ -54,7 +54,7 @@ class Rule(object): return self.matches_function_conditions(action, subject) def matches_dict_conditions(self, action, subject): - return all(self.matches_hash_condition(subject, key, value) for key, value in self.conditions.iteritems()) + return all(self.matches_hash_condition(subject, key, self.conditions[key]) for key in self.conditions) def matches_hash_condition(self, subject, key, value): return getattr(subject, key) == value diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup required_modules = [] setup(name='bouncer', - version='0.0.1', + version='0.1.2', description='Simple Declarative Authentication based on Ryan Bates excellent cancan library', url='http://github.com/jtushman/bouncer', author='Jonathan Tushman',
removing iteritems to support <I>
bouncer-app_bouncer
train
py,py
bb74403ef3dd8e8bdf5aa0b7561b75b27478d55c
diff --git a/src/core/Scene.js b/src/core/Scene.js index <HASH>..<HASH> 100644 --- a/src/core/Scene.js +++ b/src/core/Scene.js @@ -273,8 +273,8 @@ let Scene = Mixin(Base => { this._mounted = false }, - updated(oldProps, oldState, modifiedProps) { - Super(this).updated(oldProps, oldState, modifiedProps) + updated(oldProps, oldState, moddedProps) { + Super(this).updated(oldProps, oldState, moddedProps) if (!this.isConnected) return
fix: whoops, fix a typo. I'm in the process of adding unit tests to avoid these sorts of mistakes!
trusktr_infamous
train
js
29cb89330d4b0269cfae74a36a3c38d741bfb751
diff --git a/raiden/tasks.py b/raiden/tasks.py index <HASH>..<HASH> 100644 --- a/raiden/tasks.py +++ b/raiden/tasks.py @@ -195,7 +195,7 @@ class AlarmTask(Runnable): if missed_blocks > 2: log.info( 'Missed block(s)', - missed_blocks=missed_blocks, + missed_blocks=missed_blocks - 1, latest_block=latest_block, )
Fix block number for missed blocks message [no ci integration]
raiden-network_raiden
train
py
c312c963e076aa440e5bd7441507355b060e42fa
diff --git a/lib/osrm/query.rb b/lib/osrm/query.rb index <HASH>..<HASH> 100644 --- a/lib/osrm/query.rb +++ b/lib/osrm/query.rb @@ -81,11 +81,18 @@ module OSRM response['location']['forbidden.html'] raise 'OSRM API error: API usage policy has been violated, see https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy' else + ensure_ready_server if response.code == '404' raise 'OSRM API error: Invalid response' \ " #{response.code} #{response.message}" end end + def ensure_ready_server + root_uri = @uri.class.build(host: @uri.host, port: @uri.port) + root_response = Net::HTTP.get(root_uri) + raise "OSRM API error: #{root_response}" if root_response.match(/NOT READY/i) + end + def build_uri(alternatives: nil, overview: nil) raise "OSRM API error: Server isn't configured" unless configuration.server
Raise appropriate error message when the server is building data
freayd_osrm
train
rb
3fd4a8aeed53508a201b0cc077d07078f6aae48e
diff --git a/lib/rake/application.rb b/lib/rake/application.rb index <HASH>..<HASH> 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -375,7 +375,7 @@ module Rake options.top_level_dsl = ! value } ], - ['--top-level-dsl', "Put Rake DSL commands in the top level scope.", + ['--top-level-dsl', "Put Rake DSL commands in the top level scope (default).", lambda { |value| options.top_level_dsl = value }
Added default to --top-level-dsl option comment.
ruby_rake
train
rb
ffc1e196d2029b323357772e962fd67807554eaa
diff --git a/.eslintrules/no-substr.js b/.eslintrules/no-substr.js index <HASH>..<HASH> 100644 --- a/.eslintrules/no-substr.js +++ b/.eslintrules/no-substr.js @@ -11,12 +11,18 @@ module.exports = { recommended: false }, schema: [], + messages: { + noSubstr: ".substr should not be used anymore" + } }, create (context) { return { MemberExpression (node) { - if (['Identifier', 'Literal'].includes(node.object.type) && node.property.name === 'substr') { - context.report(node, '.substr should not be used anymore'); + if (["Identifier", "Literal"].includes(node.object.type) && node.property.name === 'substr') { + context.report({ + node, + messageId: "noSubstr" + }); } } };
Upgrade rule to fit dev model (#<I>)
ArnaudBuchholz_gpf-js
train
js
a3d178e25e710cea106b6e8e4fc76ee25094b69c
diff --git a/mapmyfitness/serializers.py b/mapmyfitness/serializers.py index <HASH>..<HASH> 100644 --- a/mapmyfitness/serializers.py +++ b/mapmyfitness/serializers.py @@ -1,4 +1,5 @@ -from .objects import RouteObject, WorkoutObject +from mapmyfitness.objects.route import RouteObject +from mapmyfitness.objects.workout import WorkoutObject class BaseSerializer(object):
Fixing an error with the serializer imports.
JasonSanford_mapmyfitness-python
train
py
58621dceb191a5ecd78b3ecddb4b81d8eebdd757
diff --git a/dns-controller/pkg/dns/dnscontroller.go b/dns-controller/pkg/dns/dnscontroller.go index <HASH>..<HASH> 100644 --- a/dns-controller/pkg/dns/dnscontroller.go +++ b/dns-controller/pkg/dns/dnscontroller.go @@ -146,7 +146,7 @@ func (c *DNSController) snapshotIfChangedAndReady() *snapshot { aliasTargets := make(map[string][]Record) if c.lastSuccessfulSnapshot != nil && s.changeCount == c.lastSuccessfulSnapshot.changeCount { - glog.V(4).Infof("No changes since DNS values last successfully applied") + glog.V(6).Infof("No changes since DNS values last successfully applied") return nil }
Turn down no-change logging in dns-controller
kubernetes_kops
train
go
77248f4fe3c03ffd1d0500623225cf00cb644b5e
diff --git a/src/main/java/com/pengrad/telegrambot/request/SetGameScore.java b/src/main/java/com/pengrad/telegrambot/request/SetGameScore.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/pengrad/telegrambot/request/SetGameScore.java +++ b/src/main/java/com/pengrad/telegrambot/request/SetGameScore.java @@ -19,8 +19,16 @@ public class SetGameScore extends BaseRequest<SetGameScore, BaseResponse> { add("user_id", userId).add("score", score).add("inline_message_id", inlineMessageId); } - public SetGameScore editMessage(boolean edit_message) { - return add("edit_message", edit_message); + public SetGameScore force(boolean force) { + return add("force", force); } + public SetGameScore disableEditMessage(boolean disableEditMessage) { + return add("disable_edit_message", disableEditMessage); + } + + @Deprecated + public SetGameScore editMessage(boolean editMessage) { + return add("edit_message", editMessage); + } }
Added force and disable_edit_message parameters to SetGameScore request, mark editMessage as deprecated
pengrad_java-telegram-bot-api
train
java
3d479a63ffa32be43c75265587f642bba61f2414
diff --git a/src/sap.m/src/sap/m/Table.js b/src/sap.m/src/sap/m/Table.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/Table.js +++ b/src/sap.m/src/sap/m/Table.js @@ -470,12 +470,13 @@ sap.ui.define([ */ Table.prototype._checkLastColumnWidth = function() { var $this = this.$(); + var oTableDomRef = this.getTableDomRef(); - if (!$this.length) { + if (!$this.length || !oTableDomRef) { return; } - if ($this[0].clientWidth < this.getTableDomRef().clientWidth) { + if ($this[0].clientWidth < oTableDomRef.clientWidth) { $this.find(".sapMListTblCell:visible").eq(0).addClass("sapMTableLastColumn").width(""); }
[INTERNAL][FIX] Table: added a missing null check in case the table is not rendered in the DOM <URL>
SAP_openui5
train
js
00f73bf867c98dca71cfab50148b097eb269be2f
diff --git a/src/Observers/HomePageObserver.php b/src/Observers/HomePageObserver.php index <HASH>..<HASH> 100644 --- a/src/Observers/HomePageObserver.php +++ b/src/Observers/HomePageObserver.php @@ -21,4 +21,14 @@ class HomePageObserver $query->update(['is_home' => 0]); } } + + /** + * If there is no homepage, set the first page as homepage. + */ + public function saved(Page $model) + { + if (Page::where('is_home', 1)->count() === 0) { + Page::whereNull('parent_id')->orderBy('position')->take(1)->update(['is_home' => 1]); + } + } }
If there is no homepage, set the first page as homepage.
TypiCMS_Pages
train
php
7520b8a7af7d43ea616a9b1ebe5a50c60d9ee81e
diff --git a/src/artoo.helpers.js b/src/artoo.helpers.js index <HASH>..<HASH> 100644 --- a/src/artoo.helpers.js +++ b/src/artoo.helpers.js @@ -319,13 +319,22 @@ } // Loading an external file the same way the browser would load it from page - function getScript(url, cb) { + function getScript(url, async, cb) { + if (typeof async === 'function') { + cb = async; + async = false; + } + var el = document.createElement('script'); // Script attributes el.type = 'text/javascript'; el.src = url; + // Should the script be loaded asynchronously? + if (async) + el.async = true; + // Defining callbacks el.onload = el.onreadystatechange = function() { if ((!this.readyState || diff --git a/src/artoo.settings.js b/src/artoo.settings.js index <HASH>..<HASH> 100644 --- a/src/artoo.settings.js +++ b/src/artoo.settings.js @@ -20,6 +20,8 @@ eval: null, reload: false, scriptUrl: null, + styleSheets: {}, + templates: {}, // Methods settings cache: {
Adding option to async inject scripts
medialab_artoo
train
js,js
90a6ce66325be5cef79c2d25fbda7c2ea4832a45
diff --git a/src/Calendar.js b/src/Calendar.js index <HASH>..<HASH> 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -669,7 +669,9 @@ function Calendar_constructor(element, overrides) { ) { if (elementVisible()) { - if (t.dynamicOverrides.height !== undefined || t.dynamicOverrides.contentHeight !== undefined) { + if (t.dynamicOverrides.height !== undefined || + t.dynamicOverrides.contentHeight !== undefined || + t.dynamicOverrides.aspectRatio !== undefined) { _calcSize(); } currentView.display(date, explicitScrollState); // will call freezeContentHeight
added checking overt aspectRatio option
fullcalendar_fullcalendar
train
js
05b172ef78593eda673fa9daff178fae7fd542c4
diff --git a/tests/test_pyqr.py b/tests/test_pyqr.py index <HASH>..<HASH> 100644 --- a/tests/test_pyqr.py +++ b/tests/test_pyqr.py @@ -84,8 +84,10 @@ def test_main_prueba(): def test_main_mostrar(mocker): mocker.patch("os.system") sys.argv = [] + archivo = "qr.png" + sys.argv.append("--archivo") + sys.argv.append(archivo) sys.argv.append("--mostrar") - archivo = pyqr.CrearArchivo() main() if(sys.platform == 'linux2' or sys.platform == 'linux'): os.system.assert_called_with("eog " "%s" "" % archivo)
fixed QR image viewing error on linux
reingart_pyafipws
train
py
56f40aaaaab6dac4b6f9569d6be490803068cdfc
diff --git a/satpy/tests/reader_tests/test_generic_image.py b/satpy/tests/reader_tests/test_generic_image.py index <HASH>..<HASH> 100644 --- a/satpy/tests/reader_tests/test_generic_image.py +++ b/satpy/tests/reader_tests/test_generic_image.py @@ -214,7 +214,6 @@ class TestGenericImage(unittest.TestCase): self.assertTrue(data.bands.size == 3) - def suite(): """The test suite for test_writers.""" loader = unittest.TestLoader()
Set area definitions to correct scenes, enable area validity tests
pytroll_satpy
train
py
3d776539d2059c972236db284036973c52089205
diff --git a/src/Application.js b/src/Application.js index <HASH>..<HASH> 100755 --- a/src/Application.js +++ b/src/Application.js @@ -124,7 +124,7 @@ export default class Application extends Dispatcher { this.config = Object.assign(this.config, _defaultConfig) this.config = Object.assign(this.config, new ConfigurationManager(this.config).getConfig()) - this.config = Object.assign(this.config, deepExtend(config, this._opts)) + this.config = deepExtend(this.config, config, this._opts) if(typeof this.config.debug === 'undefined') this.config.debug = (!process.env.NODE_ENV || process.env.NODE_ENV == 'development') })
deepmerge all opts and event config
nxus_core
train
js
3d3ac08fcf1498ce4ec974e961a99f7b80013163
diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index <HASH>..<HASH> 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -108,7 +108,6 @@ type bitswap struct { // GetBlock attempts to retrieve a particular block from peers within the // deadline enforced by the context. func (bs *bitswap) GetBlock(parent context.Context, k u.Key) (*blocks.Block, error) { - log := log.Prefix("bitswap(%s).GetBlock(%s)", bs.self, k) // Any async work initiated by this function must end when this function // returns. To ensure this, derive a new context. Note that it is okay to @@ -121,11 +120,9 @@ func (bs *bitswap) GetBlock(parent context.Context, k u.Key) (*blocks.Block, err ctx = eventlog.ContextWithLoggable(ctx, eventlog.Uuid("GetBlockRequest")) defer log.EventBegin(ctx, "GetBlockRequest", &k).Done() - log.Debugf("GetBlockRequestBegin") defer func() { cancelFunc() - log.Debugf("GetBlockRequestEnd") }() promise, err := bs.GetBlocks(ctx, []u.Key{k})
chore(bitswap): rm debug log (covered by eventlog)
ipfs_go-ipfs
train
go
dbd82397f8633b57c195ec5df00dc1d9d3eaf8ef
diff --git a/src/api/ShowSegmentHandler.php b/src/api/ShowSegmentHandler.php index <HASH>..<HASH> 100644 --- a/src/api/ShowSegmentHandler.php +++ b/src/api/ShowSegmentHandler.php @@ -53,6 +53,7 @@ class ShowSegmentHandler extends ApiHandler 'table_name' => $segment->table_name, 'fields' => explode(',', $segment->fields), 'criteria' => $segment->criteria ? Json::decode($segment->criteria, Json::PRETTY) : null, + 'group_id' => $segment->segment_group_id, ]]); $response->setHttpCode(Response::S200_OK); return $response;
Adding group_id to the segment show API call
remp2020_crm-segment-module
train
php
915176c6df458628bd3fcb970236b6c356a46d61
diff --git a/config/routes.rb b/config/routes.rb index <HASH>..<HASH> 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -107,21 +107,21 @@ Rails.application.routes.draw do end # Admin/XController - %w{advanced cache categories comments profiles general pages feedback + %w{advanced cache categories content comments profiles general pages feedback resources sidebar textfilters themes trackbacks users settings tags redirects seo post_types }.each do |i| match "/admin/#{i}", :to => "admin/#{i}#index", :format => false match "/admin/#{i}(/:action(/:id))", :to => "admin/#{i}", :action => nil, :id => nil, :format => false end - namespace :admin do - resources :content do - post :autosave, on: :collection - get :insert_editor, on: :collection - post :destroy, on: :member - get :auto_complete_for_article_keywords, on: :collection - get :attachment_box_add, on: :member - end - end +# namespace :admin do +# resources :content do +# post :autosave, on: :collection +# get :insert_editor, on: :collection +# post :destroy, on: :member +# get :auto_complete_for_article_keywords, on: :collection +## get :attachment_box_add, on: :member +# end +# end # default root :to => 'articles#index', :format => false
Reverting the resourcification of admin /content routes It completely breaks the application and there are many very tricky cases that were not thought first (autosave, 2 steps destroy (once get, another post)) etc... I spent way too much time trying to fix this without managing to do it, if someone does it, please test each and every case with comprehensive specs.
publify_publify
train
rb
c6030e8562cddcb71898a1dea242affe5f0464f0
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -169,9 +169,6 @@ end class StarStarMimeControllerTest < ActionController::TestCase tests StarStarMimeController - def setup; super; end - def teardown; super; end - def test_javascript_with_format @request.accept = "text/javascript" get :index, :format => 'js'
Remove the not needed setup and teardown
rails_rails
train
rb
75e8e0b28d3e1ba3ac849e6d2091826cbb8d546f
diff --git a/tests/test_io/test_web/test_load.py b/tests/test_io/test_web/test_load.py index <HASH>..<HASH> 100644 --- a/tests/test_io/test_web/test_load.py +++ b/tests/test_io/test_web/test_load.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: @pytest.fixture(scope="module") def mini_sbml(data_directory: Path) -> bytes: """Provide a gzip-compressed SBML document.""" - with (data_directory / "mini_cobra.xml").open(mode="rb") as handle: + with open(data_directory / "mini_cobra.xml", "rb") as handle: return gzip.compress(handle.read())
chore: improve file opening for test_load.py
opencobra_cobrapy
train
py