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
6b668bd0cd1d84988e2ba31e57da6710705ff204
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -82,7 +82,6 @@ module.exports = { { test: /\.ts$/, loader: 'typescript-simple-loader' } ], noParse: [ - new RegExp(TRACEUR_RUNTIME), /rtts_assert\/src\/rtts_assert/ ] },
fix(webpack.config): remove TRACEUR_RUNTIME
inchingorg_xdata-web
train
js
3fd0879828bc0462ee724a927359b2d7351aff7d
diff --git a/common/models/traits/CommentTrait.php b/common/models/traits/CommentTrait.php index <HASH>..<HASH> 100755 --- a/common/models/traits/CommentTrait.php +++ b/common/models/traits/CommentTrait.php @@ -37,7 +37,7 @@ trait CommentTrait { $command = $query->createCommand(); $average = $command->queryOne(); - return $average[ 'average' ]; + return round( $average[ 'average' ] ); } public function getReviewCounts() {
Resolved average round figure issue in method getAverageRating().
cmsgears_module-core
train
php
0836c60fa482aa9f2ae4f2ae5e7a0f8485f6b9bc
diff --git a/angr/functionmanager.py b/angr/functionmanager.py index <HASH>..<HASH> 100644 --- a/angr/functionmanager.py +++ b/angr/functionmanager.py @@ -149,6 +149,9 @@ class Function(object): """ constants = set() + if not self._function_manager._project.loader.main_bin.contains_addr(self.startpoint): + return constants + # reanalyze function with a new initial state (use persistent registers) initial_state = self._function_manager._cfg.get_any_irsb(self.startpoint).initial_state fresh_state = self._function_manager._project.factory.blank_state(mode="fastpath")
fix for function string references that don't start in the binary
angr_angr
train
py
8f4336a8dcf516de15e08f516f356fef8200e9c3
diff --git a/js/bitfinex.js b/js/bitfinex.js index <HASH>..<HASH> 100644 --- a/js/bitfinex.js +++ b/js/bitfinex.js @@ -227,7 +227,7 @@ module.exports = class bitfinex extends Exchange { 'Nonce is too small.': InvalidNonce, }, 'broad': { - 'Invalid order: not enough exchange balance for ': InsufficientFunds, // when buy, cost > quote currency + 'Invalid order: not enough exchange balance for ': InsufficientFunds, // when buying cost is greater than the available quote currency 'Invalid order: minimum size for ': InvalidOrder, // when amount below limits.amount.min 'Invalid order': InvalidOrder, // ? },
minor english fix in a comment in bitfinex describe ()
ccxt_ccxt
train
js
05b63af4c9af86b2eb77449e9cbdb48c0b1a19df
diff --git a/scripts/lib/bundle.js b/scripts/lib/bundle.js index <HASH>..<HASH> 100644 --- a/scripts/lib/bundle.js +++ b/scripts/lib/bundle.js @@ -25,6 +25,7 @@ function readPackageDigest() { function computePackageDigest(noWriteFile = false) { const files = globIgnore(join(rootDir, '**'), { + absolute: true, ignore: readFileSync(join(rootDir, '.npmignore')) .toString('utf8') .split(/\n/g)
fix: update call to globIgnore (#<I>) (#<I>) globIgnore now requires the 'absolute' option to be specified.
kulshekhar_ts-jest
train
js
03221dce357496b5d985185155cfd068d483a1ae
diff --git a/core/model/VirtualPage.php b/core/model/VirtualPage.php index <HASH>..<HASH> 100755 --- a/core/model/VirtualPage.php +++ b/core/model/VirtualPage.php @@ -123,8 +123,15 @@ class VirtualPage extends Page { */ function copyFrom($source) { if($source) { - foreach($this->getVirtualFields() as $virtualField) + foreach($this->getVirtualFields() as $virtualField) { $this->$virtualField = $source->$virtualField; + } + + // We also want to copy ShowInMenus, but only if we're copying the + // source page for the first time. + if($this->isChanged('CopyContentFromID')) { + $this->ShowInMenus = $source->ShowInMenus; + } } }
MINOR: Copy "ShowInMenus" when a VirtualPage is first created (from r<I>) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
0e26ad501d89bf3f00ca53abf9a77fa04331b495
diff --git a/src/trumbowyg.js b/src/trumbowyg.js index <HASH>..<HASH> 100644 --- a/src/trumbowyg.js +++ b/src/trumbowyg.js @@ -677,7 +677,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { } }) .on('keyup focus', function () { - if (!t.$ta.val().match(/<.*>/)) { + if (!t.$ta.val().match(/<.*>/) && !t.$ed.html().match(/<.*>/)) { setTimeout(function () { var block = t.isIE ? '<p>' : 'p'; t.doc.execCommand('formatBlock', false, block);
fix(Trumbo): stop p tags from wrapping markup This code adds <p> tags if the Trumbo contains no mark-up. The check is run before a setTimeout and the <p> tags are added after. When using the table plugin the content is empty before the check but contains a table after the timeout executes.
Alex-D_Trumbowyg
train
js
6d1cdb3e4552608998edf23c4eaf682cb68c5f25
diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index <HASH>..<HASH> 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -332,6 +332,21 @@ class SvnDriver extends VcsDriver } /** + * An absolute path (leading '/') is converted to a file:// url. + * + * @param string $url + * + * @return string + */ + protected static function fixSvnUrl($url) + { + if (strpos($url, '/', 0) === 0) { + $url = 'file://' . $url; + } + return $url; + } + + /** * This is quick and dirty - thoughts? * * @return void
* fixSvnUrl(): to prefix absolute paths with file://
mothership-ec_composer
train
php
345a1abf8e3b05ee658437e38eb139f66b8345b7
diff --git a/bugtool/cmd/configuration.go b/bugtool/cmd/configuration.go index <HASH>..<HASH> 100644 --- a/bugtool/cmd/configuration.go +++ b/bugtool/cmd/configuration.go @@ -54,12 +54,7 @@ func defaultCommands(confDir string, cmdDir string, k8sPods []string) []string { "ip -6 n", "ss -t -p -a -i -s", "ss -u -p -a -i -s", - "nstat", "uname -a", - "dig", - "netstat -a", - "pidstat", - "arp", "top -b -n 1", "uptime", "dmesg --time-format=iso", @@ -83,12 +78,6 @@ func defaultCommands(confDir string, cmdDir string, k8sPods []string) []string { "bpftool map dump pinned /sys/fs/bpf/tc/globals/cilium_ct_any6_global", "bpftool map dump pinned /sys/fs/bpf/tc/globals/cilium_snat_v4_external", "bpftool map dump pinned /sys/fs/bpf/tc/globals/cilium_snat_v6_external", - // Versions - "docker version", - "docker info", - // Docker and Kubernetes logs from systemd - "journalctl -u cilium*", - "journalctl -u kubelet", // iptables "iptables-save -c", "iptables -S",
Remove non-functional commands from cilium-bugtool This PR removes all the non-functional commands from cilium-bugtool configuration. Fixes: #<I>
cilium_cilium
train
go
067204d003291f02633a01c2e7620c41dd38e906
diff --git a/forms/Form.php b/forms/Form.php index <HASH>..<HASH> 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -192,6 +192,7 @@ class Form extends RequestHandler { '$Action!' => 'handleAction', 'POST ' => 'httpSubmission', 'GET ' => 'httpSubmission', + 'HEAD ' => 'httpSubmission', ); /**
BUGFIX: Prevent <I> error when a HEAD request is sent to its action URL.
silverstripe_silverstripe-framework
train
php
e4553a741b9396c830ceebe3b6b235b92fdbf172
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -1,7 +1,7 @@ import logging import subprocess import sys -import time +import os logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) @@ -12,7 +12,7 @@ ROOT_CLIENT = None PROJECT = None USERNAME = None -PROJECT_NAME = 'test17' +PROJECT_NAME = os.environ['USER'] + '-test' ROOT_URL = 'http://localhost:5000/v3' def fileno_monkeypatch(self):
parameterize test db name based on the user running it
LuminosoInsight_luminoso-api-client-python
train
py
342d45ab7d37ba84b12524b988a7c5c2de6bdb1d
diff --git a/lib/sapience/logger.rb b/lib/sapience/logger.rb index <HASH>..<HASH> 100644 --- a/lib/sapience/logger.rb +++ b/lib/sapience/logger.rb @@ -18,7 +18,7 @@ module Sapience logger.trace "Appender thread: Flushing appender: #{appender.class.name}" appender.flush rescue StandardError => exc - logger.error "Appender thread: Failed to flush appender: #{appender.inspect}", exc + $stderr.write("Appender thread: Failed to flush to appender: #{appender.inspect}\n #{exc.inspect}") end end
Log sapience error into $stderr
reevoo_sapience-rb
train
rb
751aecfae754a555aad15fe1771bbf209de00c9c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def version(): README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() setup( - name='gocd_cli', + name='gocd-cli', author='Björn Andersson', author_email='ba@sanitarium.se', license='MIT License',
Change the name to match the repo And decent naming conventions, underscores are yuck for names :p
gaqzi_gocd-cli
train
py
c99c6fcc474d6a16f2d9a2f279dd722b9ba9c8e9
diff --git a/modules/console.py b/modules/console.py index <HASH>..<HASH> 100644 --- a/modules/console.py +++ b/modules/console.py @@ -31,6 +31,15 @@ def unload(): def mavlink_packet(msg): '''handle an incoming mavlink packet''' + if not isinstance(mpstate.console, wxconsole.MessageConsole): + return if not mpstate.console.is_alive(): mpstate.console = textconsole.SimpleConsole() + return + type = msg.get_type() + if type == 'GPS_RAW': + if msg.fix_type == 2: + mpstate.console.set_status('GPS', 'GPS: OK', fg='green') + else: + mpstate.console.set_status('GPS', 'GPS: %u' % msg.fix_type, fg='red')
console: added gps status
ArduPilot_MAVProxy
train
py
2648ff273e89fdecdf4fe70f768b0e36d6f2674b
diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -771,7 +771,7 @@ class Request } /** - * Checks whether the request instructs proxies in the path not to cache the request. + * Checks whether cached response must be successfully revalidated by the origin server. * * @return Boolean */
fixed the description of isNoCache method
symfony_symfony
train
php
5c63b9377e35d7657e66ce4b94050543ce34953f
diff --git a/src/Migration.php b/src/Migration.php index <HASH>..<HASH> 100644 --- a/src/Migration.php +++ b/src/Migration.php @@ -19,7 +19,7 @@ use Spiral\Migrations\Exception\MigrationException; abstract class Migration implements MigrationInterface { // Target migration database - const DATABASE = null; + protected const DATABASE = null; /** @var State|null */ private $state = null;
- bugfix: older migrations will conflict due to protected constant
spiral_migrations
train
php
8d5c8980227dd9bcbe93bed032501946e43709e5
diff --git a/worker/uniter/context_test.go b/worker/uniter/context_test.go index <HASH>..<HASH> 100644 --- a/worker/uniter/context_test.go +++ b/worker/uniter/context_test.go @@ -756,3 +756,19 @@ func (s *RunCommandSuite) TestRunCommandsHasEnvironSet(c *gc.C) { c.Check(executionEnvironment[key], gc.Equals, value) } } + +func (s *RunCommandSuite) TestRunCommandsStdOutAndErrAndRC(c *gc.C) { + context := s.GetHookContext(c) + charmDir := c.MkDir() + commands := ` +echo this is standard out +echo this is standard err >&2 +exit 42 +` + result, err := context.RunCommands(commands, charmDir, "/path/to/tools", "/path/to/socket") + c.Assert(err, gc.IsNil) + + c.Assert(result.StdOut, gc.Equals, "this is standard out\n") + c.Assert(result.StdErr, gc.Equals, "this is standard err\n") + c.Assert(result.ReturnCode, gc.Equals, 42) +}
Test capture of stdout, stderr, and the return code.
juju_juju
train
go
e1d85554610d0ca8b69fa1ff74d2de31d48a3c49
diff --git a/ykman/cli/piv.py b/ykman/cli/piv.py index <HASH>..<HASH> 100644 --- a/ykman/cli/piv.py +++ b/ykman/cli/piv.py @@ -452,8 +452,10 @@ def set_pin_retries(ctx, management_key, pin, pin_retries, puk_retries): if not pin: pin = _prompt_pin(pin) controller.verify(pin) - - controller.set_pin_retries(pin_retries, puk_retries) + try: + controller.set_pin_retries(pin_retries, puk_retries) + except: + ctx.fail('Setting pin retries failed.') @piv.command('generate-certificate')
piv: catch failing set-pin-retries
Yubico_yubikey-manager
train
py
c79503f9e33850bbfa6c8f59bebe6621bfa73045
diff --git a/src/SDL/Compiler.php b/src/SDL/Compiler.php index <HASH>..<HASH> 100644 --- a/src/SDL/Compiler.php +++ b/src/SDL/Compiler.php @@ -181,9 +181,11 @@ class Compiler implements CompilerInterface, Configuration private function load(Document $document): Document { foreach ($document->getTypeDefinitions() as $type) { - $this->stack->push($type); - $this->loader->register($type); - $this->stack->pop(); + if (!$this->loader->has($type->getName())) { + $this->stack->push($type); + $this->loader->register($type); + $this->stack->pop(); + } } return $document; @@ -208,6 +210,7 @@ class Compiler implements CompilerInterface, Configuration { /** @var DocumentBuilder $document */ $document = $this->storage->remember($readable, $this->onCompile()); + $this->load($document); return $document->withCompiler($this); }
Load cached types into loader repository
railt_railt
train
php
1e26cfc6c7ef3c5afb703ff77b82750fc88f378d
diff --git a/internal/cmd/package.go b/internal/cmd/package.go index <HASH>..<HASH> 100644 --- a/internal/cmd/package.go +++ b/internal/cmd/package.go @@ -23,7 +23,7 @@ func newPackageCmd() *packageCmd { cmd := &cobra.Command{ Use: "package", Aliases: []string{"pkg", "p"}, - Short: "Creates a package based on the given the given config file and flags", + Short: "Creates a package based on the given config file and flags", SilenceUsage: true, SilenceErrors: true, Args: cobra.NoArgs,
fix: typo on 'package' commands --help (#<I>)
goreleaser_nfpm
train
go
7b5efad725034467d6d5612d574ae2a08a195e39
diff --git a/config/module/validate_provider_alias.go b/config/module/validate_provider_alias.go index <HASH>..<HASH> 100644 --- a/config/module/validate_provider_alias.go +++ b/config/module/validate_provider_alias.go @@ -67,7 +67,7 @@ func (t *Tree) validateProviderAlias() error { // We didn't find the alias, error! err = multierror.Append(err, fmt.Errorf( - "module %s: provider alias must be defined by the module or a parent: %s", + "module %s: provider alias must be defined by the module: %s", strings.Join(pv.Path, "."), k)) } }
update missing alias message Update the old error message for a missing provider alias, as we no longer automatically inherit providers.
hashicorp_terraform
train
go
941756e4da590911aab8d3950b0eea5e30752042
diff --git a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java index <HASH>..<HASH> 100644 --- a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java +++ b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java @@ -107,7 +107,8 @@ public class FileCache { // Check if the file was cached by another process during download if (!targetFile.exists()) { log.warn(String.format("Unable to rename %s to %s", sourceFile.getAbsolutePath(), targetFile.getAbsolutePath())); - log.warn(String.format("A copy/delete will be tempted but with no garantee of atomicity")); + log.warn(String.format("A copy/delete will be tempted but with no garantee of atomicity. It's recommended that " + + "user cache and temp folders are located on the same hard drive partition. Please check $SONAR_USER_HOME or -Dsonar.userHome")); try { FileUtils.moveFile(sourceFile, targetFile); } catch (IOException e) {
SONAR-<I> improve warning when temp folder and user cache are not on the same hard drive
SonarSource_sonarqube
train
java
fbbccf50550da01366922fa1daf2990c1bbb9534
diff --git a/aws/data_source_aws_outposts_outposts_test.go b/aws/data_source_aws_outposts_outposts_test.go index <HASH>..<HASH> 100644 --- a/aws/data_source_aws_outposts_outposts_test.go +++ b/aws/data_source_aws_outposts_outposts_test.go @@ -14,6 +14,7 @@ func TestAccAWSOutpostsOutpostsDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{
tests/ds/outposts_outposts: Add ErrorCheck
terraform-providers_terraform-provider-aws
train
go
69c6cfadaaddf717fdac55d0deb6e76c3721439f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ module.exports = { init() { this._super.init && this._super.init.apply(this, arguments); + this.overrideTestCommandFilter(); this.setTestGenerator(); }, @@ -98,6 +99,36 @@ module.exports = { }); }, + overrideTestCommandFilter() { + let TestCommand = this.project.require('ember-cli/lib/commands/test'); + + TestCommand.prototype.buildTestPageQueryString = function(options) { + let params = []; + + if (options.filter) { + params.push(`grep=${options.filter}`); + + if (options.invert) { + params.push('invert=1'); + } + } + + if (options.query) { + params.push(options.query); + } + + return params.join('&'); + }; + + TestCommand.prototype.availableOptions.push({ + name: 'invert', + type: Boolean, + default: false, + description: 'Invert the filter specified by the --filter argument', + aliases: ['i'] + }); + }, + setTestGenerator() { this.project.generateTestFile = function(moduleName, tests) { var output = `describe('${moduleName}', function() {\n`;
Add missing `overrideTestCommandFilter()` method This was missed when we migrated the functionality from `ember-cli-mocha` into `ember-mocha`
emberjs_ember-mocha
train
js
5703c35794eab8233e4f7a620013244a1b1ac95a
diff --git a/tests/compose.js b/tests/compose.js index <HASH>..<HASH> 100644 --- a/tests/compose.js +++ b/tests/compose.js @@ -4,26 +4,22 @@ var expect = chai.expect; describe('.compose()', function () { - it('should return a new function', function () { + var func = null; - var func = fn.compose( + beforeEach(function() { + func = fn.compose( fn.partial( fn.op['+'], 3 ), fn.partial( fn.op['*'], 6 ), function (num) { return Math.pow(num, 2); }); + }); + it('should return a new function', function () { expect(func).to.be.a('function'); }); it('should pass return values from right to left', function () { - var func = fn.compose( - fn.partial( fn.op['+'], 3 ), - fn.partial( fn.op['*'], 6 ), - function (num) { - return Math.pow(num, 2); - }); - var result = func(7); expect(result).to.equal(297);
Small re-factoring, using 'beforeEach' in test
CrowdHailer_fn.js
train
js
379f644e5133a1ecdba3ecf73395df0957213aa8
diff --git a/bokeh/transform.py b/bokeh/transform.py index <HASH>..<HASH> 100644 --- a/bokeh/transform.py +++ b/bokeh/transform.py @@ -66,7 +66,7 @@ def cumsum(field, include_zero=False): will generate a ``CumSum`` expressions that sum the ``"angle"`` column of a data source. For the ``start_angle`` value, the cumulative sums - will start with a zero value. For ``start_angle``, no initial zero will + will start with a zero value. For ``end_angle``, no initial zero will be added (i.e. the sums will start with the first angle value, and include the last).
Fix `cumsum()` docstring (#<I>) "For ``start_angle``" -> "For ``end_angle``"
bokeh_bokeh
train
py
ea97fe874246bab38c150fd986702663b3116abd
diff --git a/shinken/modules/livestatus_broker/livestatus_query.py b/shinken/modules/livestatus_broker/livestatus_query.py index <HASH>..<HASH> 100644 --- a/shinken/modules/livestatus_broker/livestatus_query.py +++ b/shinken/modules/livestatus_broker/livestatus_query.py @@ -789,6 +789,8 @@ member_key: the key to be used to sort each resulting element of a group member. # The filters are closures. # Add parameter Class (Host, Service), lookup datatype (default string), convert reference def eq_filter(ref): + if ((ref[attribute] is None) and (reference == "")): + return True return ref[attribute] == reference def eq_nocase_filter(ref):
Fix string comparison for livestatus. None is equivalent to empty string
Alignak-monitoring_alignak
train
py
ca87b685caf364c49af6ac7618f59b22059ad7b1
diff --git a/Query.php b/Query.php index <HASH>..<HASH> 100644 --- a/Query.php +++ b/Query.php @@ -450,9 +450,10 @@ class Query extends Component implements QueryInterface if ($this->emulateExecution) { return 0; } - // performing a query with return size of 0, is equal to getting result stats such as count + // performing a query with return size of 0 and track_total_hits enabled, is equal to getting result stats such as count // https://www.elastic.co/guide/en/elasticsearch/reference/5.6/breaking_50_search_changes.html#_literal_search_type_literal - $result = $this->createCommand($db)->search(['size' => 0]); + // https://www.elastic.co/guide/en/elasticsearch/reference/master/search-your-data.html#track-total-hits + $result = $this->createCommand($db)->search(['size' => 0, 'track_total_hits' => 'true']); // since ES7 totals are returned as array (with count and precision values) if (isset($result['hits']['total'])) {
Added track_total_hits to Query::count() By default ElasticSearch returns <I> hits (<URL>) All hits can be returned by setting track_total_hits to true
yiisoft_yii2-elasticsearch
train
php
847e93f2fe4731a8d485c63261352e9c26f6b9de
diff --git a/lib/devise_security_extension/models/password_archivable.rb b/lib/devise_security_extension/models/password_archivable.rb index <HASH>..<HASH> 100644 --- a/lib/devise_security_extension/models/password_archivable.rb +++ b/lib/devise_security_extension/models/password_archivable.rb @@ -11,7 +11,6 @@ module Devise # :nodoc: include InstanceMethods has_many :old_passwords, :as => :password_archivable, :dependent => :destroy before_update :archive_password - after_create :set_first_old_password validate :validate_password_archive end end @@ -63,14 +62,6 @@ module Devise # :nodoc: end end - def set_first_old_password - if self.respond_to?(:password_salt) and !self.password_salt.nil? - self.old_passwords.create! :encrypted_password => self.encrypted_password, :password_salt => self.password_salt - else - self.old_passwords.create! :encrypted_password => self.encrypted_password - end - end - module ClassMethods #:nodoc: ::Devise::Models.config(self, :password_archiving_count, :deny_old_passwords) end
revert add :set_first_old_password
phatworx_devise_security_extension
train
rb
e0343aa3f70779d473bf55010fd3b2f03f242571
diff --git a/src/howler.core.js b/src/howler.core.js index <HASH>..<HASH> 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -1967,7 +1967,7 @@ sound._node.bufferSource.loop = sound._loop; if (sound._loop) { sound._node.bufferSource.loopStart = sound._start || 0; - sound._node.bufferSource.loopEnd = sound._stop; + sound._node.bufferSource.loopEnd = sound._stop || 0; } sound._node.bufferSource.playbackRate.setValueAtTime(sound._rate, Howler.ctx.currentTime);
Make sure sound stop time isn't undefined Fixes #<I>
goldfire_howler.js
train
js
9703974bf3a6a24b9447bdb079974becc0c7bcc7
diff --git a/lib/strainer/sandbox.rb b/lib/strainer/sandbox.rb index <HASH>..<HASH> 100644 --- a/lib/strainer/sandbox.rb +++ b/lib/strainer/sandbox.rb @@ -223,9 +223,9 @@ module Strainer # @return [Array] # the list of root-level directories def root_folders - @root_folders ||= Dir.glob("#{Dir.pwd}/*", File::FNM_DOTMATCH).tap { |a| a.shift(2) }.collect do |f| + @root_folders ||= Dir.glob("#{Dir.pwd}/*", File::FNM_DOTMATCH).collect do |f| File.basename(f) if File.directory?(f) - end.compact + end.reject!{|dir| %w(. ..).include? dir}.compact! end # Determine if the current project is a git repo?
Root folders are missing 2 random files! Suspect this is meant to throw away . and ..
customink_strainer
train
rb
46a95d91d43fa86f475de90aae2c6dad620f3469
diff --git a/src/client.js b/src/client.js index <HASH>..<HASH> 100644 --- a/src/client.js +++ b/src/client.js @@ -48,13 +48,14 @@ class SmtpClient { * @param {Boolean} [options.disableEscaping] If set to true, do not escape dots on the beginning of the lines */ constructor (host, port, options = {}) { + this.options = options + this.timeoutSocketLowerBound = TIMEOUT_SOCKET_LOWER_BOUND this.timeoutSocketMultiplier = TIMEOUT_SOCKET_MULTIPLIER this.port = port || (this.options.useSecureTransport ? 465 : 25) this.host = host || 'localhost' - this.options = options /** * If set to true, start an encrypted connection instead of the plaintext one * (recommended if applicable). If useSecureTransport is not set but the port used is 465,
Use this.options only after defined
emailjs_emailjs-smtp-client
train
js
493a4cc7fd37a39b28e02e9157c08e949d43a99a
diff --git a/src/app/containers/App.js b/src/app/containers/App.js index <HASH>..<HASH> 100644 --- a/src/app/containers/App.js +++ b/src/app/containers/App.js @@ -18,6 +18,17 @@ import RemoteIcon from 'react-icons/lib/go/radio-tower'; const monitorPosition = location.hash; +// Mock localStorage when it is not allowed +let localStorage; +try { + localStorage = window.localStorage; +} catch (error) { + localStorage = { + getItem: key => undefined, + setItem: () => {} + }; +} + @enhance export default class App extends Component { static propTypes = {
Mock localStorage when it is not allowed Related to #<I>.
zalmoxisus_redux-devtools-extension
train
js
2060eb32a2931abff66d780d06eb821f41204c60
diff --git a/grunt.js b/grunt.js index <HASH>..<HASH> 100644 --- a/grunt.js +++ b/grunt.js @@ -87,12 +87,14 @@ module.exports = function(grunt) { }, 'node-qunit': { - deps: './src/pouch.js', - code: './src/adapters/pouch.leveldb.js', - tests: testFiles.map(function (n) { return "./tests/" + n; }), - done: function(err, res) { - !err && (testResults['node'] = res); - return true; + all: { + deps: './src/pouch.js', + code: './src/adapters/pouch.leveldb.js', + tests: testFiles.map(function (n) { return "./tests/" + n; }), + done: function(err, res) { + !err && (testResults['node'] = res); + return true; + } } },
#<I> Corrected path requirement for grunt-node-qunit
pouchdb_pouchdb
train
js
16fe4ce4786d388c6794be91d84d50725d5c8709
diff --git a/locationsharinglib/locationsharinglib.py b/locationsharinglib/locationsharinglib.py index <HASH>..<HASH> 100755 --- a/locationsharinglib/locationsharinglib.py +++ b/locationsharinglib/locationsharinglib.py @@ -36,6 +36,7 @@ import json import logging import pickle from datetime import datetime +import pytz from bs4 import BeautifulSoup as Bfs from cachetools import TTLCache, cached @@ -168,7 +169,7 @@ class Person: # pylint: disable=too-many-instance-attributes @property def datetime(self): """A datetime representation of the location retrieval""" - return datetime.fromtimestamp(int(self.timestamp) / 1000) + return datetime.fromtimestamp(int(self.timestamp) / 1000, tz=pytz.utc) @property def address(self):
Add timezone info to timestamp Google provides timestamp in UTC
costastf_locationsharinglib
train
py
eb031922f977492da7592c5b5819f8e4d3943f69
diff --git a/src/components/Comments.js b/src/components/Comments.js index <HASH>..<HASH> 100644 --- a/src/components/Comments.js +++ b/src/components/Comments.js @@ -1,3 +1,4 @@ +// @flow import React from 'react'; import PropTypes from 'prop-types'; import { Modal, Button, Col, Row, Glyphicon } from 'react-bootstrap';
Update Comments.js Added the flow annotation
attivio_suit
train
js
fcea21ac3234b0b948e992fc3ca20e50d7c42477
diff --git a/test/tdigest_test.rb b/test/tdigest_test.rb index <HASH>..<HASH> 100644 --- a/test/tdigest_test.rb +++ b/test/tdigest_test.rb @@ -1,6 +1,4 @@ require 'test_helper' -require 'ruby-prof' - class TDigestTest < Minitest::Test extend Minitest::Spec::DSL
fix: remove ruby-prof require from test
castle_tdigest
train
rb
aaa01f97347eb15fa9721ebdba99edfd907fc22e
diff --git a/lib/statsd/instrument.rb b/lib/statsd/instrument.rb index <HASH>..<HASH> 100644 --- a/lib/statsd/instrument.rb +++ b/lib/statsd/instrument.rb @@ -217,14 +217,12 @@ module StatsD def write_packet(command) if mode.to_s == 'production' - begin - socket.send(command, 0) - rescue SocketError, IOError, SystemCallError => e - logger.error e - end + socket.send(command, 0) else logger.info "[StatsD] #{command}" end + rescue SocketError, IOError, SystemCallError => e + logger.error e end def clean_tags(tags)
Cleanup of write_packet method.
Shopify_statsd-instrument
train
rb
fca9410b497ec2c181ec2384f73da0b4487a9a4d
diff --git a/test/structures_test.js b/test/structures_test.js index <HASH>..<HASH> 100644 --- a/test/structures_test.js +++ b/test/structures_test.js @@ -1,6 +1,6 @@ 'use strict'; -var structures = require('../lib/structures.js'); +var structure = require('../lib/structure.js'); /* ======== A Handy Little Nodeunit Reference ======== @@ -30,7 +30,7 @@ exports['awesome'] = { 'no args': function(test) { test.expect(1); // tests here - test.equal(structures.awesome(), 'awesome', 'should be awesome.'); + test.equal('test', 'test', 'should be placeholder test.'); test.done(); }, };
Added placeholder test to test build system
markselby_node-structures
train
js
79a168e469de41ed24c80103f9aa1be0292e9d22
diff --git a/katcp/client.py b/katcp/client.py index <HASH>..<HASH> 100644 --- a/katcp/client.py +++ b/katcp/client.py @@ -613,7 +613,7 @@ class DeviceClient(object): is as for sys.excepthook. """ if self._thread: - raise RuntimeError("Device client already started.") + raise RuntimeError("Device client %r already started." % (self._bindaddr,)) self._thread = ExcepthookThread(target=self.run, excepthook=excepthook) if daemon is not None: @@ -622,7 +622,7 @@ class DeviceClient(object): if timeout: self._connected.wait(timeout) if not self._connected.isSet(): - raise RuntimeError("Device client failed to start.") + raise RuntimeError("Device client %r failed to start." % (self._bindaddr,)) def join(self, timeout=None): """Rejoin the client thread. @@ -633,7 +633,7 @@ class DeviceClient(object): Seconds to wait for thread to finish. """ if not self._thread: - raise RuntimeError("Device client thread not started.") + raise RuntimeError("Device client %r thread not started." % (self._bindaddr,)) self._thread.join(timeout) if not self._thread.isAlive():
Log the bind address for DeviceClient exceptions
ska-sa_katcp-python
train
py
399306adc5c124483c0e6a61319795756a66f3fa
diff --git a/lib/build/webpack-config.js b/lib/build/webpack-config.js index <HASH>..<HASH> 100644 --- a/lib/build/webpack-config.js +++ b/lib/build/webpack-config.js @@ -82,8 +82,8 @@ module.exports = function (cfg) { ], alias: { quasar: appPaths.resolve.app(`node_modules/quasar-framework/dist/quasar.${cfg.ctx.themeName}.esm.js`), - '~': appPaths.srcDir, - '@': appPaths.resolve.src(`components`), + src: appPaths.srcDir, + components: appPaths.resolve.src(`components`), layouts: appPaths.resolve.src(`layouts`), pages: appPaths.resolve.src(`pages`), assets: appPaths.resolve.src(`assets`),
fix: Avoid webpack aliases clashes
quasarframework_quasar-cli
train
js
671d7b60d77551c2a13b3fa0f88a557f5c369672
diff --git a/owslib/wcs.py b/owslib/wcs.py index <HASH>..<HASH> 100644 --- a/owslib/wcs.py +++ b/owslib/wcs.py @@ -20,16 +20,16 @@ from coverage import wcs100, wcs110, wcsBase def WebCoverageService(url, version=None, xml=None): ''' wcs factory function, returns a version specific WebCoverageService object ''' - if xml is None: - reader = wcsBase.WCSCapabilitiesReader() - request = reader.capabilities_url(url) - xml = urllib2.urlopen(request).read() - + if version is None: + if xml is None: + reader = wcsBase.WCSCapabilitiesReader() + request = reader.capabilities_url(url) + xml = urllib2.urlopen(request).read() capabilities = etree.etree.fromstring(xml) version = capabilities.get('version') del capabilities - + if version == '1.0.0': return wcs100.WebCoverageService_1_0_0.__new__(wcs100.WebCoverageService_1_0_0, url, xml) elif version == '1.1.0':
The web coverage reader was being created twice by the WebCoverageService factory function - this was not necessary.
geopython_OWSLib
train
py
268f6b9bcfab4e78d423674da3cdddfa4d2e4cc8
diff --git a/lib/Parser.js b/lib/Parser.js index <HASH>..<HASH> 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -304,6 +304,9 @@ Parser.prototype.initializeEvaluating = function() { // possible improvement: evaluate node.expressions[i-1] // and append to previous quasis if has a set value } + if (exprs.length == 1) { + return exprs[0].setRange(node.range); + } return new BasicEvaluatedExpression().setTemplateString(exprs).setRange(node.range); }); this.plugin("evaluate TaggedTemplateExpression", function(node) {
Pretend template is a string if it resolves to a constant
webpack_webpack
train
js
98e608468637c384cd4225620fb10907fb3c9898
diff --git a/lib/Rackem/Server.php b/lib/Rackem/Server.php index <HASH>..<HASH> 100644 --- a/lib/Rackem/Server.php +++ b/lib/Rackem/Server.php @@ -64,7 +64,7 @@ class Server if($offset === false) $offset = strpos($buffer, "\n\n"); if($offset === false) $offset = strpos($buffer, "\r\r"); if($offset === false) $offset = strpos($buffer, "\r\n"); - $length = $m[1] - $offset + 2; + $length = $m[1] - (strlen($buffer) - $offset); $body = ''; while(strlen($body) < $length) $body .= socket_read($client, 1024); $buffer = $buffer . $body;
Ensure Server reads full Content-Length of body into the buffer
tamagokun_rackem
train
php
47f69068d3f23f46c29569f2515a7b7e51736aeb
diff --git a/satpy/writers/geotiff.py b/satpy/writers/geotiff.py index <HASH>..<HASH> 100644 --- a/satpy/writers/geotiff.py +++ b/satpy/writers/geotiff.py @@ -76,7 +76,27 @@ class GeoTIFFWriter(ImageWriter): "profile", "bigtiff", "pixeltype", - "copy_src_overviews",) + "copy_src_overviews", + # Not a GDAL option, but allows driver='COG' + "driver", + # COG driver options (different from GTiff above) + "blocksize", + "resampling", + "quality", + "level", + "overview_resampling", + "warp_resampling", + "overview_compress", + "overview_quality", + "overview_predictor", + "tiling_scheme", + "zoom_level_strategy", + "target_srs", + "res", + "extent", + "aligned_levels", + "add_alpha", + ) def __init__(self, dtype=None, tags=None, **kwargs): """Init the writer."""
Update GDAL_OPTIONS with driver= and COG-specific options
pytroll_satpy
train
py
204203c6e1345075c2c8638a1e21745336819615
diff --git a/cloudplatform/runtime/spring/src/main/java/io/rhiot/cloudplatform/runtime/spring/test/CloudPlatformTest.java b/cloudplatform/runtime/spring/src/main/java/io/rhiot/cloudplatform/runtime/spring/test/CloudPlatformTest.java index <HASH>..<HASH> 100644 --- a/cloudplatform/runtime/spring/src/main/java/io/rhiot/cloudplatform/runtime/spring/test/CloudPlatformTest.java +++ b/cloudplatform/runtime/spring/src/main/java/io/rhiot/cloudplatform/runtime/spring/test/CloudPlatformTest.java @@ -69,6 +69,7 @@ public abstract class CloudPlatformTest extends Assert { beforeCloudPlatformStarted(); cloudPlatform = cloudPlatform.start(); camelContext = cloudPlatform.applicationContext().getBean(CamelContext.class); + camelContext.getShutdownStrategy().setTimeout(5); producerTemplate = camelContext.createProducerTemplate(); payloadEncoding = cloudPlatform.applicationContext().getBean(PayloadEncoding.class); connector = cloudPlatform.applicationContext().getBean(IoTConnector.class);
Reduced CamelContext shutdown strategy timeout for tests.
rhiot_rhiot
train
java
92a98a5a576a9f287a3182ce958f209ce9c8af91
diff --git a/controller/frontend/src/Controller/Frontend/Product/Iface.php b/controller/frontend/src/Controller/Frontend/Product/Iface.php index <HASH>..<HASH> 100644 --- a/controller/frontend/src/Controller/Frontend/Product/Iface.php +++ b/controller/frontend/src/Controller/Frontend/Product/Iface.php @@ -68,7 +68,7 @@ interface Iface * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items * @since 2019.04 */ - public function find( string $code ); + public function find( string $code ) : \Aimeos\MShop\Product\Item\Iface; /** * Creates a search function string for the given name and parameters @@ -86,7 +86,7 @@ interface Iface * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items * @since 2019.04 */ - public function get( string $id ); + public function get( string $id ) : \Aimeos\MShop\Product\Item\Iface; /** * Adds a filter to return only items containing a reference to the given ID @@ -144,7 +144,7 @@ interface Iface * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items * @since 2019.04 */ - public function resolve( string $name ); + public function resolve( string $name ) : \Aimeos\MShop\Product\Item\Iface; /** * Returns the products filtered by the previously assigned conditions
Added missing return types for product controller methods
aimeos_ai-controller-frontend
train
php
a7f694dc9d587dfd9ddc927b168e4092c8f91879
diff --git a/src/com/opera/core/systems/testing/drivers/TestOperaDriver.java b/src/com/opera/core/systems/testing/drivers/TestOperaDriver.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/testing/drivers/TestOperaDriver.java +++ b/src/com/opera/core/systems/testing/drivers/TestOperaDriver.java @@ -20,14 +20,12 @@ import com.opera.core.systems.OperaDriver; import com.opera.core.systems.OperaProduct; import com.opera.core.systems.runner.OperaRunner; import com.opera.core.systems.runner.launcher.OperaLauncherRunnerSettings; -import com.opera.core.systems.scope.internal.OperaIntervals; import com.opera.core.systems.scope.services.IOperaExec; import org.openqa.selenium.Capabilities; import org.openqa.selenium.Platform; import org.openqa.selenium.remote.DesiredCapabilities; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; /** @@ -72,7 +70,7 @@ public class TestOperaDriver extends OperaDriver { } public boolean isRunning() { - return runner.isOperaRunning(); + return runner != null && runner.isOperaRunning(); } public boolean isOperaIdleAvailable() {
Check for whether we're using a local launcher We might be running a remote Opera, fixes NullPointerException.
operasoftware_operaprestodriver
train
java
cc119f2548c96ca9752943ae2d6446117a59a747
diff --git a/spec/cb/cb_job_api_spec.rb b/spec/cb/cb_job_api_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cb/cb_job_api_spec.rb +++ b/spec/cb/cb_job_api_spec.rb @@ -15,9 +15,10 @@ module Cb search.count.should == 25 search[0].is_a?(Cb::CbJob).should == true search[24].is_a?(Cb::CbJob).should == true - + # # make sure our jobs are properly populated - job = search[rand(0..24)] + job = search[Random.new.rand(0..24)] + job.did.length.should >= 19 job.title.length.should > 1 job.company_name.length.nil?.should == false @@ -37,7 +38,7 @@ module Cb # job_api.first_item_index.should == 1 # job_api.last_item_index.should >= 1 - job = Cb.job.find_by_did(search[rand(0..24)].did) + job = Cb.job.find_by_did(search[Random.new.rand(0..24)].did) job.did.length.should >= 19 job.title.length.should > 1
pushing the latest with rand err fixed
careerbuilder_ruby-cb-api
train
rb
c4a7749908605cc9b9b2361d74dce74d964dd804
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 @@ -12,7 +12,6 @@ end db = ENV['DB'] || 'none' require 'pry-byebug' require 'i18n' -require 'active_support/testing/time_helpers' require 'rspec' require 'allocation_stats' if ENV['TEST_PERFORMANCE'] require 'json' @@ -44,7 +43,10 @@ end RSpec.configure do |config| config.include Helpers config.include Mobility::Util - config.include ActiveSupport::Testing::TimeHelpers + if defined?(ActiveSupport) + require 'active_support/testing/time_helpers' + config.include ActiveSupport::Testing::TimeHelpers + end config.filter_run focus: true config.run_all_when_everything_filtered = true
Only include time helpers when active support is defined Right now, we're only using them for testing with activerecord. If we need to use them with sequel, we can add as an explicit dependency.
shioyama_mobility
train
rb
9a33e62c836d3096ccd53c9e9f17b9a5c8d78c6f
diff --git a/lib/plugins/aws/invokeLocal/index.test.js b/lib/plugins/aws/invokeLocal/index.test.js index <HASH>..<HASH> 100644 --- a/lib/plugins/aws/invokeLocal/index.test.js +++ b/lib/plugins/aws/invokeLocal/index.test.js @@ -1079,7 +1079,7 @@ describe('AwsInvokeLocal', () => { () => { log.debug('test target %o', serverless.cli.consoleLog.lastCall.args); const result = JSON.parse(serverless.cli.consoleLog.lastCall.args[0]); - expect(result.deadlineMs).to.be.closeTo(Date.now() + 6000, 1000); + expect(result.deadlineMs).to.be.closeTo(Date.now() + 6000, 2000); }, error => { if (error.code === 'ENOENT' && error.path === 'ruby') {
test(AWS Local Invocation): Increase error margin
serverless_serverless
train
js
ecfe94465d834af1317dd19bba3b24cec124e991
diff --git a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php @@ -249,12 +249,16 @@ class TextDescriptor extends Descriptor */ private function getColumnWidth(array $commands) { - $width = 0; + $widths = array(); + foreach ($commands as $command) { - $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width; + $widths[] = strlen($command->getName()); + foreach ($command->getAliases() as $alias) { + $widths[] = strlen($alias); + } } - return $width + 2; + return max($widths) + 2; } /**
Fixed warning when command alias is longer than command name
symfony_symfony
train
php
6fb7bd0ba6880b9030025313d9eddc9a807287f4
diff --git a/lib/common/components/StickySidebar/sticky-sidebar.js b/lib/common/components/StickySidebar/sticky-sidebar.js index <HASH>..<HASH> 100644 --- a/lib/common/components/StickySidebar/sticky-sidebar.js +++ b/lib/common/components/StickySidebar/sticky-sidebar.js @@ -47,7 +47,7 @@ export default class StickySidebar { } get scrollY() { - return (this.scrollParent.pageYOffset !== null) ? this.scrollParent.pageYOffset : this.scrollParent.scrollTop; + return (this.scrollParent.pageYOffset != null) ? this.scrollParent.pageYOffset : this.scrollParent.scrollTop; } ngOnInit() {
Fix sticky sidebar when scroll parent is not window
Rebilly_ReDoc
train
js
a4d1303c01d4afe4fbff491a23ee6829306f11d4
diff --git a/spec/art-decomp/logging_spec.rb b/spec/art-decomp/logging_spec.rb index <HASH>..<HASH> 100644 --- a/spec/art-decomp/logging_spec.rb +++ b/spec/art-decomp/logging_spec.rb @@ -18,7 +18,7 @@ module ArtDecomp describe Logging do after do Logging.off - FileUtils.rmtree @dir if Dir.exists? @dir + FileUtils.rmtree @dir end def log diff --git a/spec/art-decomp/old_executable_spec.rb b/spec/art-decomp/old_executable_spec.rb index <HASH>..<HASH> 100644 --- a/spec/art-decomp/old_executable_spec.rb +++ b/spec/art-decomp/old_executable_spec.rb @@ -10,7 +10,7 @@ module ArtDecomp describe OldExecutable do end after do - FileUtils.rmdir @dir + FileUtils.rmtree @dir end describe '.new' do
Logging and OldExecutable specs: cleanup fixes
chastell_art-decomp
train
rb,rb
8c0ac0b45e3dd3ec7ea1a2cb3fe73a0b4b428cfc
diff --git a/spec/models/no_cms/blocks/layout_spec.rb b/spec/models/no_cms/blocks/layout_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/no_cms/blocks/layout_spec.rb +++ b/spec/models/no_cms/blocks/layout_spec.rb @@ -56,7 +56,7 @@ describe NoCms::Blocks::Layout do subject { NoCms::Blocks::Layout.find('title-long_text') } it "should recover the configuration for quickly configured fields" do - expect(subject.fields[:title]).to eq title_configuration + expect(subject.fields[:title]).to eq NoCms::Blocks::Layout::DEFAULT_FIELD_CONFIGURATION.merge(title_configuration) end it "should recover the configuration for verbosing configured fields" do
Default configuration must be taken into account on the spec We are adding now a default configuration and the test must take it into account
simplelogica_nocms-blocks
train
rb
6744ab832c70753870ddb8bfad48f069c9d99538
diff --git a/peewee.py b/peewee.py index <HASH>..<HASH> 100644 --- a/peewee.py +++ b/peewee.py @@ -26,6 +26,7 @@ __all__ = [ 'BooleanField', 'CharField', 'Clause', + 'CompositeKey', 'DateField', 'DateTimeField', 'DecimalField', @@ -722,7 +723,15 @@ class CompositeKey(object): def add_to_class(self, model_class, name): self.name = name - setattr(model_class, name, None) + setattr(model_class, name, self) + + def __get__(self, instance, instance_type=None): + if instance is not None: + return [getattr(instance, field) for field in self.fields] + return self + + def __set__(self, instance, value): + pass class QueryCompiler(object):
Export CompositeKey and implement it as a descriptor.
coleifer_peewee
train
py
99c01ccf315ef2b6c5ecacdade31153ab7722544
diff --git a/action/Request.php b/action/Request.php index <HASH>..<HASH> 100644 --- a/action/Request.php +++ b/action/Request.php @@ -442,12 +442,12 @@ class Request extends \lithium\net\http\Request { * Returns information about the type of content that the client is requesting. * * @see lithium\net\http\Media::negotiate() - * @param $type mixed If not specified, returns the media type name that the client prefers, - * using content negotiation. If a media type name (string) is passed, returns `true` or - * `false`, indicating whether or not that type is accepted by the client at all. - * If `true`, returns the raw content types from the `Accept` header, parsed into an array - * and sorted by client preference. - * @return string Returns a simple type name if the type is registered (i.e. `'json'`), or + * @param boolean|string $type If not specified, returns the media type name that the client + * prefers, using content negotiation. If a media type name (string) is passed, returns + * `true` or `false`, indicating whether or not that type is accepted by the client at + * all. If `true`, returns the raw content types from the `Accept` header, parsed into + * an array and sorted by client preference. + * @return mixed Returns a simple type name if the type is registered (i.e. `'json'`), or * a fully-qualified content-type if not (i.e. `'image/jpeg'`), or a boolean or array, * depending on the value of `$type`. */
Updating docs for param/return types of Request::type().
UnionOfRAD_lithium
train
php
e4bc684e3643d9080cd8002c64fc7032af03f7a5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ var pullWeird = require('./pull-weird') var PacketStream = require('packet-stream') var EventEmitter = require('events').EventEmitter -var PullSerializer = require('pull-serializer') function isFunction (f) { return 'function' === typeof f @@ -92,10 +91,7 @@ module.exports = function (remoteApi, localApi, serializer) { emitter.createStream = function () { - var pullPs = pullWeird(ps) - if (serializer) - pullPs = PullSerializer(pullPs, serializer) - return pullPs + return (serializer) ? serializer(pullWeird(ps)) : pullWeird(ps) } return emitter diff --git a/test/jsonb.js b/test/jsonb.js index <HASH>..<HASH> 100644 --- a/test/jsonb.js +++ b/test/jsonb.js @@ -1,2 +1,4 @@ +var PullSerializer = require('pull-serializer') + // run tests with jsonb serialization -require('./async')(require('json-buffer')) \ No newline at end of file +require('./async')(function(stream) { return PullSerializer(stream, require('json-buffer')) }) \ No newline at end of file
generalized to allow non-line-delimited serializers
ssbc_muxrpc
train
js,js
1e4a3df63540fe5f7f1ecb498b57ef0651bba8b0
diff --git a/OMMBV/trans.py b/OMMBV/trans.py index <HASH>..<HASH> 100644 --- a/OMMBV/trans.py +++ b/OMMBV/trans.py @@ -20,7 +20,7 @@ try: # geocentric Earth. # ecef_to_geodetic = trans.ecef_to_geocentric -except (AttributeError, NameError): +except (AttributeError, NameError, ModuleNotFoundError): estr = ''.join(['Unable to use Fortran version of ecef_to_geodetic.', ' Please check installation.']) warnings.warn(estr)
BUG/DOC: Expand exceptions for not importing fortran
rstoneback_pysatMagVect
train
py
307e14a514e227bf6d3d4bdb10a34a71643e070b
diff --git a/autopep8.py b/autopep8.py index <HASH>..<HASH> 100755 --- a/autopep8.py +++ b/autopep8.py @@ -794,7 +794,7 @@ class FixPEP8(object): if fixed: for line_index in range(start_line_index, end_line_index + 1): self.source[line_index] = '' - self.source[start_line_index] = fixed + self.source[start_line_index] = fixed.rstrip() + '\n' return range(start_line_index + 1, end_line_index + 1) else: return []
Avoid add trailing in double aggressive mode This fixes #<I>.
hhatto_autopep8
train
py
03f720b5f0545265e88dfb9689dc61932e7989d2
diff --git a/pyes/query.py b/pyes/query.py index <HASH>..<HASH> 100644 --- a/pyes/query.py +++ b/pyes/query.py @@ -793,7 +793,7 @@ class TermQuery(Query): self._values = {} if field is not None and value is not None: - self.add(field, value) + self.add(field, value, boost) def add(self, field, value, boost=None): if not value.strip():
Bug Fix: On TermQuery if boost is provided from the constructor is also passed to the add method.
aparo_pyes
train
py
18a98e432a9ec31feed226d4da02aff121c14b3b
diff --git a/lib/fugue.js b/lib/fugue.js index <HASH>..<HASH> 100644 --- a/lib/fugue.js +++ b/lib/fugue.js @@ -34,7 +34,7 @@ var stop = exports.stop = function() { worker.kill(); } catch(excep) { // do nothing, just log - log('Error killing worker with pid ' + worker.pid + ': ' + excep.message) + console.log('Error killing worker with pid ' + worker.pid + ': ' + excep.message) } }); workers = [];
protected worker killing sequence on shutdown from workers quitting themselves
pgte_fugue
train
js
88b1d826db1cc37d22beead44e3c59bcb1d94e22
diff --git a/mode/dockerfile/dockerfile.js b/mode/dockerfile/dockerfile.js index <HASH>..<HASH> 100644 --- a/mode/dockerfile/dockerfile.js +++ b/mode/dockerfile/dockerfile.js @@ -24,14 +24,12 @@ // Block comment: This is a line starting with a comment { regex: /#.*$/, - token: "comment", - next: "start" + token: "comment" }, // Highlight an instruction without any arguments (for convenience) { regex: instructionOnlyLine, - token: "variable-2", - next: "start" + token: "variable-2" }, // Highlight an instruction followed by arguments { @@ -39,10 +37,9 @@ token: ["variable-2", null], next: "arguments" }, - // Fail-safe return to start { - token: null, - next: "start" + regex: /./, + token: null } ], arguments: [ @@ -54,8 +51,7 @@ }, { regex: /[^#]+\\$/, - token: null, - next: "arguments" + token: null }, { // Match everything except for the inline comment
[dockerfile mode] Clean up state machine Issue #<I>
codemirror_CodeMirror
train
js
387d735968396ad03f2f57168b6adbafb7afab64
diff --git a/pywavefront/texture.py b/pywavefront/texture.py index <HASH>..<HASH> 100644 --- a/pywavefront/texture.py +++ b/pywavefront/texture.py @@ -31,15 +31,10 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ---------------------------------------------------------------------------- -import os - -from pywavefront.exceptions import PywavefrontException class Texture(object): def __init__(self, path): - self.image_name = path + # Treat path as part of a file uri always using forward slashes + self.path = path.replace('\\', '/') self.image = None - - if not os.path.exists(path): - raise PywavefrontException("Requested file does not exist")
Treat texture path as a file uri + skip early exist check
pywavefront_PyWavefront
train
py
62f0483c3feca6fa693c4bba581f634aed072822
diff --git a/src/main/java/com/couchbase/lite/router/Router.java b/src/main/java/com/couchbase/lite/router/Router.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/router/Router.java +++ b/src/main/java/com/couchbase/lite/router/Router.java @@ -411,6 +411,10 @@ public class Router implements Database.ChangeListener { } else if(name.startsWith("_design") || name.startsWith("_local")) { // This is also a document, just with a URL-encoded "/" docID = name; + } else if (name.equals("_session")) { + // There are two possible uri to get a session, /<db>/_session or /_session. + // This is for /<db>/_session. + message = message.replaceFirst("_Document", name); } else { // Special document name like "_all_docs": message += name;
Fix router creating a wrong handler when getting /db/_session There are two possible uri to get a session, /<db>/_session or /_session. The current code has already taken care the /_session message. But when it got /<db>/_session, it was turn the message into do_GET_Document_session instead of do_GET_session. #<I>
couchbase_couchbase-lite-java-core
train
java
e7672d7a4cb062919d26e6c8cf4859e6265e6ff7
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -840,7 +840,6 @@ module Discordrb def initialize(data, bot) @bot = bot @owner_id = data['owner_id'].to_i - @owner = bot.user(@owner_id) @id = data['id'].to_i update_data(data) @@ -852,6 +851,8 @@ module Discordrb process_presences(data['presences']) process_channels(data['channels']) process_voice_states(data['voice_states']) + + @owner = self.member(@owner_id) end # @return [Channel] The default channel on this server (usually called #general)
Properly initialize the server owner and make it a member
meew0_discordrb
train
rb
8e789768f060197077900d7cfb6e86ec6264fad8
diff --git a/internal/service/meta/arn_data_source_fw.go b/internal/service/meta/arn_data_source_fw.go index <HASH>..<HASH> 100644 --- a/internal/service/meta/arn_data_source_fw.go +++ b/internal/service/meta/arn_data_source_fw.go @@ -72,4 +72,5 @@ type dataSourceARN struct{} // Read is called when the provider must read data source values in order to update state. // Config values should be read from the ReadDataSourceRequest and new state values set on the ReadDataSourceResponse. func (d *dataSourceARN) Read(ctx context.Context, request tfsdk.ReadDataSourceRequest, response *tfsdk.ReadDataSourceResponse) { + tflog.Trace(ctx, "dataSourceARN.Read enter") }
d/aws_arn: Trace data source Read entry.
terraform-providers_terraform-provider-aws
train
go
c9e9257f77aaa2424bdf3705e958f6d29366656c
diff --git a/tests/CommandTest.php b/tests/CommandTest.php index <HASH>..<HASH> 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -79,5 +79,14 @@ class CommandTest extends PHPUnit '--validator' => 'title:required|unique:tweets,id', '--no-interaction' ]); + + Artisan::call('make:scaffold', + [ + 'name' => 'Tweet', + '--schema' => 'title:string', + '--localization' => 'title:required', + '--lang' => 'fr', + '--no-interaction' + ]); } } \ No newline at end of file
Setup tests for localization and lang command.
laralib_l5scaffold
train
php
211d6ebb39655a0cda2303ccf6d422191dbf4304
diff --git a/pipe.go b/pipe.go index <HASH>..<HASH> 100644 --- a/pipe.go +++ b/pipe.go @@ -181,9 +181,12 @@ func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { return nil, err } - if state&cPIPE_READMODE_MESSAGE != 0 { + /** + Windows support message type pipes in message-read mode only. Removing this check to allow for windows named pipes. + */ + /*if state&cPIPE_READMODE_MESSAGE != 0 { return nil, &os.PathError{Op: "open", Path: path, Err: errors.New("message readmode pipes not supported")} - } + }*/ f, err := makeWin32File(h) if err != nil {
Allow for message pipes in message readmode for Windows named pipes.
Microsoft_go-winio
train
go
7f4ded6aa78e74ffe8126574fa1024c4b70011a4
diff --git a/lxd/db/storage_pools.go b/lxd/db/storage_pools.go index <HASH>..<HASH> 100644 --- a/lxd/db/storage_pools.go +++ b/lxd/db/storage_pools.go @@ -140,13 +140,12 @@ INSERT INTO storage_volumes(name, storage_pool_id, node_id, type, description) return errors.Wrap(err, "failed to create node ceph volumes") } + // Create entries of all the ceph volumes configs for the new node. stmt = ` SELECT id FROM storage_volumes WHERE storage_pool_id=? AND node_id=? ORDER BY name, type ` - - // Create entries of all the ceph volumes configs for the new node. - volumeIDs, err := query.SelectIntegers(c.tx, stmt, poolID, otherNodeID) + volumeIDs, err := query.SelectIntegers(c.tx, stmt, poolID, nodeID) if err != nil { return errors.Wrap(err, "failed to get joining node's ceph volume IDs") }
Fix broken copy of storage volume configs when joining a cluster
lxc_lxd
train
go
3ddebbd9540d4f52d26fdda069dc8bc060f61ef3
diff --git a/anharmonic/phonon3/imag_self_energy.py b/anharmonic/phonon3/imag_self_energy.py index <HASH>..<HASH> 100644 --- a/anharmonic/phonon3/imag_self_energy.py +++ b/anharmonic/phonon3/imag_self_energy.py @@ -93,7 +93,6 @@ class ImagSelfEnergy: len(bi_set)) return imag_se - def get_phonon_at_grid_point(self): return (self._frequencies[self._grid_point], self._eigenvectors[self._grid_point])
Improved averaging among degenerate bands
atztogo_phonopy
train
py
2f6e13a868f18a516f0eb79efa70f3ae527c4aad
diff --git a/tinman/handlers/__init__.py b/tinman/handlers/__init__.py index <HASH>..<HASH> 100644 --- a/tinman/handlers/__init__.py +++ b/tinman/handlers/__init__.py @@ -2,4 +2,5 @@ application development. """ +from tinman.handlers.base import RequestHandler from tinman.handlers.session import SessionRequestHandler
Make the base request handler available by default
gmr_tinman
train
py
9a5a8937e4e0b81432243f39e87c93d81f3a14ef
diff --git a/harvester.py b/harvester.py index <HASH>..<HASH> 100644 --- a/harvester.py +++ b/harvester.py @@ -208,7 +208,8 @@ class Statistics: self._fps_max = 0. def increment_num_images(self, num=1): - self._num_images += num + if self._has_acquired_1st_timestamp: + self._num_images += num @property def fps(self):
Do not include the first image for taking statistics
genicam_harvesters
train
py
b319b00fe6df14d2ed749d08f027c2f50f27f971
diff --git a/phantomcss.js b/phantomcss.js index <HASH>..<HASH> 100755 --- a/phantomcss.js +++ b/phantomcss.js @@ -182,7 +182,7 @@ function screenshot( target, timeToWait, hideSelector, fileName ) { } function isComponentsConfig( obj ) { - return ( obj instanceof Object ) && ( isClipRect( obj ) === false ); + return ( Object.prototype.toString.call(obj) == '[object Object]' ) && ( isClipRect( obj ) === false ); } function grab(filepath, target){
Stronger checking of Object type to fix issue with SlimerJS
HuddleEng_PhantomCSS
train
js
87063a58a6bf6e4444c485c6f5533aeb0504789a
diff --git a/languagetool-gui-commons/src/main/java/org/languagetool/gui/Configuration.java b/languagetool-gui-commons/src/main/java/org/languagetool/gui/Configuration.java index <HASH>..<HASH> 100644 --- a/languagetool-gui-commons/src/main/java/org/languagetool/gui/Configuration.java +++ b/languagetool-gui-commons/src/main/java/org/languagetool/gui/Configuration.java @@ -185,13 +185,13 @@ public class Configuration { return disabledCategoryNames; } - public void setDisabledRuleIds(Set<String> ruleIDs) { - disabledRuleIds = ruleIDs; - enabledRuleIds.removeAll(ruleIDs); + public void setDisabledRuleIds(Set<String> ruleIds) { + disabledRuleIds = ruleIds; + enabledRuleIds.removeAll(ruleIds); } - public void setEnabledRuleIds(Set<String> ruleIDs) { - enabledRuleIds = ruleIDs; + public void setEnabledRuleIds(Set<String> ruleIds) { + enabledRuleIds = ruleIds; } public void setDisabledCategoryNames(Set<String> categoryNames) {
more consistent variable naming with rest of code
languagetool-org_languagetool
train
java
ae5d701c23ca65c5a4de39d78ba34324dc6e3765
diff --git a/progressbar/bar.py b/progressbar/bar.py index <HASH>..<HASH> 100644 --- a/progressbar/bar.py +++ b/progressbar/bar.py @@ -533,7 +533,7 @@ class ProgressBar(StdRedirectMixin, ResizableMixin, ProgressBarBase): except StopIteration: self.finish() raise - except GeneratorExit: + except GeneratorExit: # pragma: no cover self.finish(dirty=True) raise
ignoring "impossible" use case for test coverage
WoLpH_python-progressbar
train
py
880da01c49a9255f5022ab7e18bca38c18f56370
diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -53,7 +53,7 @@ class Process } $this->commandline = $commandline; - $this->cwd = null === $cwd ? getcwd() : $cwd; + $this->cwd = $cwd; if (null !== $env) { $this->env = array(); foreach ($env as $key => $value) { @@ -359,6 +359,13 @@ class Process */ public function getWorkingDirectory() { + // This is for BC only + if (null === $this->cwd) { + // getcwd() will return false if any one of the parent directories does not have + // the readable or search mode set, even if the current directory does + return getcwd() ?: null; + } + return $this->cwd; }
[Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process)
symfony_symfony
train
php
c720ee241be02a552e5ce2ea4f8496af0eff6aea
diff --git a/salt/grains/core.py b/salt/grains/core.py index <HASH>..<HASH> 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -813,7 +813,10 @@ def hostname(): # domain grains = {} grains['localhost'] = socket.gethostname() - grains['fqdn'] = socket.getfqdn() + if (re.search("\.", socket.getfqdn())): + grains['fqdn'] = socket.getfqdn() + else : + grains['fqdn'] = grains['localhost'] (grains['host'], grains['domain']) = grains['fqdn'].partition('.')[::2] return grains
grains/core : fix fqdn / domain return on SunOS systems getfqdn() on Solaris platforms returns the unqualified hostname. In that case, using gethostname() could be a solution. Tested on SmartOS / Solaris <I>
saltstack_salt
train
py
844f5d92fca77824a426ed049cfb0f7d52308759
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -24,7 +24,10 @@ module.exports = { }, { test: /\.(css|less)$/, - loader: ExtractTextPlugin.extract('style-loader', 'css-loader') + loader: ExtractTextPlugin.extract( + 'style-loader', + 'css-loader?localIdentName=[name]-[local]-[hash:base64:8]' + ), }, {test: /\.less$/, loader: 'less-loader'}, {test: /\.(woff|eot)$/, loader: "file-loader"},
Set localIdentName for css-loader.
skbkontur_retail-ui
train
js
39322418440b87807cf4773f8e9959f0aa00ac6c
diff --git a/tests/model/DataListTest.php b/tests/model/DataListTest.php index <HASH>..<HASH> 100644 --- a/tests/model/DataListTest.php +++ b/tests/model/DataListTest.php @@ -394,13 +394,6 @@ class DataListTest extends SapphireTest { // $this->assertEquals('Joe', $list->Last()->Name, 'Last comment should be from Joe'); // } - public function testSimpleNegationFilter() { - $list = DataObjectTest_TeamComment::get(); - $list = $list->filter('TeamID:Negation', $this->idFromFixture('DataObjectTest_Team', 'team1')); - $this->assertEquals(1, $list->count()); - $this->assertEquals('Phil', $list->first()->Name, 'First comment should be from Bob'); - } - public function testSimplePartialMatchFilter() { $list = DataObjectTest_TeamComment::get(); $list = $list->filter('Name:PartialMatch', 'o')->sort('Name');
Removed test for deprecated NegationFilter
silverstripe_silverstripe-framework
train
php
3d098cbe31572b550b34b52d4c467d881ca5cd0d
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ window.Promise = Promise; import 'isomorphic-fetch'; import UI from 'reapp-ui'; +import Helpers from 'reapp-ui/helpers'; import 'reapp-object-assign'; // data @@ -66,9 +67,10 @@ module.exports = Object.assign( store, Store, - // theme + // UI theme, makeStyles: UI.makeStyles, + Helpers, // router Router,
export helpers from reapp-ui
reapp_reapp-kit
train
js
ec4ed4a1f81a1e77213713b12a457f7dd1f94a12
diff --git a/tests/Unit/ConnectionTest.php b/tests/Unit/ConnectionTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/ConnectionTest.php +++ b/tests/Unit/ConnectionTest.php @@ -62,7 +62,7 @@ class ConnectionTest extends \PHPUnit_Framework_TestCase $options = new ConnectionOptions(); if (!self::$isGnatsd) { time_nanosleep(1, 700000000); - $options->port = 4222; + $options->setPort(4222); } $this->c = new Nats\Connection($options); $this->c->connect();
Fixed a broken unit test. Changed direct variable assignation to a setter
repejota_phpnats
train
php
a4f2e4c13d88935e425b13fa089bf0a3785d2c92
diff --git a/beets/mediafile.py b/beets/mediafile.py index <HASH>..<HASH> 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -1481,10 +1481,14 @@ class MediaFile(object): ) comments = MediaField( MP3DescStorageStyle(key='COMM'), + MP3DescStorageStyle(key='COMM', desc=u'ID3v1 Comment'), + MP3DescStorageStyle(key='COMM', desc=u'Comment'), + MP3DescStorageStyle(key='COMM', desc=u'Track:Comments'), MP4StorageStyle("\xa9cmt"), StorageStyle('DESCRIPTION'), StorageStyle('COMMENT'), ASFStorageStyle('WM/Comments'), + StorageStyle('Description') ) bpm = MediaField( MP3StorageStyle('TBPM'),
added some more storage styles for comment fields Original: beetbox/beets@<I>ef<I>
beetbox_mediafile
train
py
2fe382e67acbe7a23149e5a7b461dedceb42b9b4
diff --git a/lib/rufus/lua/state.rb b/lib/rufus/lua/state.rb index <HASH>..<HASH> 100644 --- a/lib/rufus/lua/state.rb +++ b/lib/rufus/lua/state.rb @@ -424,6 +424,7 @@ module Rufus::Lua if lua_code == nil + Lib.lua_remove(@pointer, @error_handler) if @error_handler > 0 @error_handler = 0 elsif lua_code == :traceback diff --git a/spec/error_handler_spec.rb b/spec/error_handler_spec.rb index <HASH>..<HASH> 100644 --- a/spec/error_handler_spec.rb +++ b/spec/error_handler_spec.rb @@ -47,6 +47,8 @@ stack traceback: [string "mystuff.lua:77"]:3: in function 'f' [string "mymain.lua:88"]:1: in main chunk' (2 LUA_ERRRUN) }.strip) + + expect(@s.send(:stack_top)).to eq(1) end it 'set the error handler in a permanent way' do @@ -167,6 +169,7 @@ stack traceback: end expect(le.msg).to eq('[string "line"]:1: b') + expect(@s.send(:stack_top)).to eq(0) end end end
remove error_handler from stack when unsetting it for gh-<I>
jmettraux_rufus-lua
train
rb,rb
7788ce3a1c71579482b2b19e78715296e4fa6963
diff --git a/spyderlib/widgets/editor.py b/spyderlib/widgets/editor.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/editor.py +++ b/spyderlib/widgets/editor.py @@ -1096,8 +1096,9 @@ class EditorStack(QWidget): print >>STDOUT, "current_changed:", index, self.data[index].editor, print >>STDOUT, self.data[index].editor.get_document_id() - self.emit(SIGNAL('current_file_changed(QString,int)'), - self.data[index].filename, editor.get_position('cursor')) + if editor is not None: + self.emit(SIGNAL('current_file_changed(QString,int)'), + self.data[index].filename, editor.get_position('cursor')) def _get_previous_file_index(self): if len(self.stack_history) > 1:
Editor/bugfix: an error occured when closing the last opened file (this bug was introduced when implementing the cursor position history feature)
spyder-ide_spyder
train
py
3e24811c0079a73b1000b40a21f4c97225948896
diff --git a/course/reset.php b/course/reset.php index <HASH>..<HASH> 100644 --- a/course/reset.php +++ b/course/reset.php @@ -46,7 +46,6 @@ $strreset = get_string('reset'); $strresetcourse = get_string('resetcourse'); $strremove = get_string('remove'); -$PAGE->navbar->add($strresetcourse); $PAGE->set_title($course->fullname.': '.$strresetcourse); $PAGE->set_heading($course->fullname.': '.$strresetcourse);
MDL-<I> course: Update breadcrumb nodes in the course reset page
moodle_moodle
train
php
9d63f41a1fd74c0dc492a3e879b1ad078306c247
diff --git a/easy_thumbnails/files.py b/easy_thumbnails/files.py index <HASH>..<HASH> 100644 --- a/easy_thumbnails/files.py +++ b/easy_thumbnails/files.py @@ -176,7 +176,7 @@ class ThumbnailFile(ImageFieldFile): return self._file def _set_file(self, value): - if not isinstance(value, File): + if value is None and not isinstance(value, File): value = File(value) self._file = value self._committed = False
If ThumbnailFile.file is set to None, don't try to wrap it in a File class. Fixes #<I>
SmileyChris_easy-thumbnails
train
py
4f423a9d7253500b2eae76d73b0450315bcbd57e
diff --git a/pycm/pycm_overall_func.py b/pycm/pycm_overall_func.py index <HASH>..<HASH> 100644 --- a/pycm/pycm_overall_func.py +++ b/pycm/pycm_overall_func.py @@ -838,7 +838,6 @@ def overall_statistics(**kwargs): "FNR Micro": complement(TPR_PPV_F1_micro), "PPV Micro": TPR_PPV_F1_micro, "F1 Micro": TPR_PPV_F1_micro, - "F1 Weighted" : weighted_calc(kwargs["F1"],kwargs["P"]), "Scott PI": PI, "Gwet AC1": AC1, "Bennett S": S,
removed old lines from pycm_overall_func.py
sepandhaghighi_pycm
train
py
cf9b8b06f06f0d3cf973fe72befecaff21c8de7f
diff --git a/intranet/apps/users/views.py b/intranet/apps/users/views.py index <HASH>..<HASH> 100644 --- a/intranet/apps/users/views.py +++ b/intranet/apps/users/views.py @@ -117,9 +117,9 @@ def picture_view(request, user_id, year=None): data = None if data is None: - image_buffer = io.BytesIO(data) - else: img = io.open(default_image_path, mode="rb").read() + else: + image_buffer = io.BytesIO(data) response = HttpResponse(content_type="image/jpeg") response["Content-Disposition"] = "filename={}_{}.jpg".format(user_id, year or preferred)
fix(users): fix image data logic
tjcsl_ion
train
py
6264d85495098b9190e318c831f19c40806a30eb
diff --git a/images/spec/features/refinery/admin/images_spec.rb b/images/spec/features/refinery/admin/images_spec.rb index <HASH>..<HASH> 100644 --- a/images/spec/features/refinery/admin/images_spec.rb +++ b/images/spec/features/refinery/admin/images_spec.rb @@ -148,6 +148,12 @@ module Refinery end click_button "Save" + # check that image loads after it has been updated + visit refinery.url_for(page_for_image.url) + visit find(:css, 'img[src^="/system/images"]')[:src] + page.should have_css('img[src*="/system/images"]') + expect { page }.to_not have_content('Not found') + # update the image visit refinery.edit_admin_image_path(image) attach_file "image_image", Refinery.roots('refinery/images').join("spec/fixtures/beach.jpeg") @@ -155,7 +161,8 @@ module Refinery # check that image loads after it has been updated visit refinery.url_for(page_for_image.url) - visit find(:css, 'img[src^="/system"]')[:src] + visit find(:css, 'img[src^="/system/images"]')[:src] + page.should have_css('img[src*="/system/images"]') expect { page }.to_not have_content('Not found') end end
Hybrid positive/negative assertion to prove image's presence
refinery_refinerycms
train
rb
570d9b56ccf8f3a54d2dc820df6ecfedaa835cae
diff --git a/lib/debugger/xml/multiprocess/monkey.rb b/lib/debugger/xml/multiprocess/monkey.rb index <HASH>..<HASH> 100644 --- a/lib/debugger/xml/multiprocess/monkey.rb +++ b/lib/debugger/xml/multiprocess/monkey.rb @@ -23,7 +23,7 @@ module Debugger #{private ? "private" : ""} def exec(*args) - Debugger.interface.close + Debugger.handler.interface.close pre_debugger_exec(*args) end } @@ -46,4 +46,4 @@ module Process module_eval Debugger::Xml::MultiProcess.create_mp_fork module_eval Debugger::Xml::MultiProcess.create_mp_exec end -end \ No newline at end of file +end
Correct way to close interface before calling #exec
astashov_debugger-xml
train
rb
97b85d3d1d224af98c7ed8eeb446e95241065d32
diff --git a/test/OfferCommandHandlerTestTrait.php b/test/OfferCommandHandlerTestTrait.php index <HASH>..<HASH> 100644 --- a/test/OfferCommandHandlerTestTrait.php +++ b/test/OfferCommandHandlerTestTrait.php @@ -147,15 +147,20 @@ trait OfferCommandHandlerTestTrait new String('Bart Ramakers'), Url::fromNative('http://foo.bar/media/de305d54-75b4-431b-adb2-eb6b9e546014.png') ); + $imageAddedEventClass = $this->getEventClass('ImageAdded'); $commandClass = $this->getCommandClass('RemoveImage'); $eventClass = $this->getEventClass('ImageRemoved'); $this->scenario ->withAggregateId($id) ->given( - [$this->factorOfferCreated($id)] + [ + $this->factorOfferCreated($id), + new $imageAddedEventClass($id, $image), + ] ) ->when( + new $commandClass($id, $image) ) ->then([new $eventClass($id, $image)]);
III-<I>: Fix image removal test in command handler: the image should have been added first
cultuurnet_udb3-php
train
php
3db14fb3a4a87f4a0a4a2b86af108cc47cdb53db
diff --git a/pypeerassets/providers/mintr.py b/pypeerassets/providers/mintr.py index <HASH>..<HASH> 100644 --- a/pypeerassets/providers/mintr.py +++ b/pypeerassets/providers/mintr.py @@ -30,6 +30,9 @@ class Mintr: def wrapper(raw): '''make Mintr API response just like RPC response''' + raw["blocktime"] = raw["time"] + raw.pop("time") + for v in raw["vout"]: v["scriptPubKey"] = {"asm": v["asm"], "hex": v["hex"], "type": v["type"], "reqSigs": v["reqsigs"],
Mintr: time -> blocktime
PeerAssets_pypeerassets
train
py
41a40c95e8d5b06b350fc5bf53818887975f22f8
diff --git a/rescan.go b/rescan.go index <HASH>..<HASH> 100644 --- a/rescan.go +++ b/rescan.go @@ -510,9 +510,26 @@ func rescan(chain ChainSource, options ...RescanOption) error { ) } - // If we're actually scanning and we have a non-empty watch - // list, then we'll attempt to fetch the filter from the - // network. + // If we're not scanning or our watch list is empty, then we can + // just notify the block without fetching any filters/blocks. + if !scanning || len(ro.watchList) == 0 { + if ro.ntfn.OnFilteredBlockConnected != nil { + ro.ntfn.OnFilteredBlockConnected( + curStamp.Height, &curHeader, nil, + ) + } + if ro.ntfn.OnBlockConnected != nil { + ro.ntfn.OnBlockConnected( + &curStamp.Hash, curStamp.Height, + curHeader.Timestamp, + ) + } + + return nil + } + + // Otherwise, we'll attempt to fetch the filter to retrieve the + // relevant transactions and notify them. queryOptions := NumRetries(0) blockFilter, err := chain.GetCFilter( curStamp.Hash, wire.GCSFilterRegular, queryOptions,
rescan: prevent unnecessarily fetching filter for block connected In this commit, we introduce a slight optimization to prevent fetching a block filter and its accompanying block when we're not scanning or our watch list is empty.
lightninglabs_neutrino
train
go
5591c0a0e1da60eb09a60544e7214ae20c328f19
diff --git a/lib/ahoy/tracker.rb b/lib/ahoy/tracker.rb index <HASH>..<HASH> 100644 --- a/lib/ahoy/tracker.rb +++ b/lib/ahoy/tracker.rb @@ -160,7 +160,7 @@ module Ahoy def visit_token_helper @visit_token_helper ||= begin token = existing_visit_token - token ||= generate_id + token ||= generate_id unless Ahoy.api_only token end end @@ -168,7 +168,7 @@ module Ahoy def visitor_token_helper @visitor_token_helper ||= begin token = existing_visitor_token - token ||= generate_id + token ||= generate_id unless Ahoy.api_only token end end
Fixed regression with server not generating visit and visitor tokens, part 2
ankane_ahoy
train
rb
90de287f8172eedd85cf3a274b63f61a0a1f5e11
diff --git a/psamm/datasource/modelseed.py b/psamm/datasource/modelseed.py index <HASH>..<HASH> 100644 --- a/psamm/datasource/modelseed.py +++ b/psamm/datasource/modelseed.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with PSAMM. If not, see <http://www.gnu.org/licenses/>. # -# Copyright 2014-2015 Jon Lund Steffensen <jon_steffensen@uri.edu> +# Copyright 2014-2016 Jon Lund Steffensen <jon_steffensen@uri.edu> """Module related to loading ModelSEED database files.""" @@ -21,6 +21,7 @@ import csv import re from .context import FileMark +from .entry import CompoundEntry as BaseCompoundEntry class ParseError(Exception): @@ -33,7 +34,7 @@ def decode_name(s): return re.sub(r'&#(\d+);', lambda x: chr(int(x.group(1))), s) -class CompoundEntry(object): +class CompoundEntry(BaseCompoundEntry): """Representation of entry in a ModelSEED compound table""" def __init__(self, id, names, formula, filemark=None):
modelseed: Use CompoundEntry base class
zhanglab_psamm
train
py
16649eeedac74d892252e3dd7ae5427946dc353e
diff --git a/src/Storage/Database/Schema/Comparison/BaseComparator.php b/src/Storage/Database/Schema/Comparison/BaseComparator.php index <HASH>..<HASH> 100644 --- a/src/Storage/Database/Schema/Comparison/BaseComparator.php +++ b/src/Storage/Database/Schema/Comparison/BaseComparator.php @@ -71,4 +71,28 @@ abstract class BaseComparator return $this->pending; } + + /** + * Run the update checks and flag if we need an update. + * + * @param boolean $force + * + * @return SchemaCheck + */ + public function compare($force = false) + { + if ($this->response !== null && $force === false) { + return $this->getResponse(); + } + + $this->checkTables(); + + // If we have diffs, check if they need to be modified + if ($this->diffs !== null) { + $this->adjustDiffs(); + $this->addAlterResponses(); + } + + return $this->getResponse(); + } }
Execute update checks and flag update requirements
bolt_bolt
train
php
80c1275899045bfd50efa9b436ada7672c09e783
diff --git a/tests/test_settings.py b/tests/test_settings.py index <HASH>..<HASH> 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -9,3 +9,7 @@ DATABASES = { 'ENGINE': 'django.db.backends.sqlite3', } } + +PASSWORD_HASHERS = ( + 'django.contrib.auth.hashers.MD5PasswordHasher', +)
use md5 password hasher to speed up the tests
byteweaver_django-polls
train
py
fcfe8e248ddfe129e7e19ef7c7820bab01bf7eba
diff --git a/src/naarad/metrics/metric.py b/src/naarad/metrics/metric.py index <HASH>..<HASH> 100644 --- a/src/naarad/metrics/metric.py +++ b/src/naarad/metrics/metric.py @@ -170,8 +170,7 @@ class Metric(object): def calculate_stats(self): stats_to_calculate = ['mean', 'std', 'min', 'max'] # TODO: get input from user - percentiles_to_calculate = range(5, 101, 5) # TODO: get input from user - percentiles_to_calculate.append(99) + percentiles_to_calculate = range(0, 100, 1) # TODO: get input from user headers = CONSTANTS.SUBMETRIC_HEADER + ',mean,std,p50,p75,p90,p95,p99,min,max\n' # TODO: This will be built from user input later on metric_stats_csv_file = self.get_stats_csv() imp_metric_stats_csv_file = self.get_important_sub_metrics_csv()
finer grain (1 percent) CDF support instead of 5 percent
linkedin_naarad
train
py
89abb7d0cabe02d2b9768c2d08f346ccc1c3d7ac
diff --git a/src/frontend/org/voltdb/CSVSnapshotFilter.java b/src/frontend/org/voltdb/CSVSnapshotFilter.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/CSVSnapshotFilter.java +++ b/src/frontend/org/voltdb/CSVSnapshotFilter.java @@ -68,6 +68,7 @@ public class CSVSnapshotFilter implements SnapshotDataFilter { cont.b.limit(cont.b.limit() + 4); final int rowCount = cont.b.getInt(); buf.putInt(rowCountPosition, rowCount); + buf.flip(); VoltTable vt = PrivateVoltTableFactory.createVoltTableFromBuffer(buf, true); Pair<Integer, byte[]> p =
Add a defensive flip based on Ning's feedback. If it is correctly sized it isn't necessary, but it doesn't hurt.
VoltDB_voltdb
train
java