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
7b52bc506c5bc2a6a85a889ee3bc134edb80cddd
diff --git a/filters/filter_test.go b/filters/filter_test.go index <HASH>..<HASH> 100644 --- a/filters/filter_test.go +++ b/filters/filter_test.go @@ -307,3 +307,20 @@ func TestFilters(t *testing.T) { }) } } + +func TestOperatorStrings(t *testing.T) { + for _, testcase := range []struct { + op operator + expected string + }{ + {operatorPresent, "?"}, + {operatorEqual, "=="}, + {operatorNotEqual, "!="}, + {operatorMatches, "~="}, + {10, "unknown"}, + } { + if !reflect.DeepEqual(testcase.op.String(), testcase.expected) { + t.Fatalf("return value unexpected: %v != %v", testcase.op.String(), testcase.expected) + } + } +}
Add unit test for func in filter.go
containerd_containerd
train
go
3950f3253ac04a3aa1ada9f62d9f4fcc7c4f3c79
diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1559,7 +1559,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { } // Latency measurements for the main workflow are relative to the - // (first time the pod was seen by the API server. + // first time the pod was seen by the API server. var firstSeenTime time.Time if firstSeenTimeStr, ok := pod.Annotations[kubetypes.ConfigFirstSeenAnnotationKey]; ok { firstSeenTime = kubetypes.ConvertToTimestamp(firstSeenTimeStr).Get() @@ -1612,7 +1612,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { if mirrorPod.DeletionTimestamp != nil || !kl.podManager.IsMirrorPodOf(mirrorPod, pod) { // The mirror pod is semantically different from the static pod. Remove // it. The mirror pod will get recreated later. - glog.Errorf("Deleting mirror pod %q because it is outdated", format.Pod(mirrorPod)) + glog.Warningf("Deleting mirror pod %q because it is outdated", format.Pod(mirrorPod)) if err := kl.podManager.DeleteMirrorPod(podFullName); err != nil { glog.Errorf("Failed deleting mirror pod %q: %v", format.Pod(mirrorPod), err) } else {
two nits for kubelet syncPod
kubernetes_kubernetes
train
go
051c9c7ae555c8730e4dd0199be42d69fb39dd44
diff --git a/src/AutoScaler.php b/src/AutoScaler.php index <HASH>..<HASH> 100644 --- a/src/AutoScaler.php +++ b/src/AutoScaler.php @@ -115,10 +115,10 @@ class AutoScaler $poolProcesses = $pool->totalProcessCount(); - if (round($workers) > $poolProcesses && + if (ceil($workers) > $poolProcesses && $this->wouldNotExceedMaxProcesses($supervisor)) { $pool->scale($poolProcesses + 1); - } elseif (round($workers) < $poolProcesses && + } elseif (ceil($workers) < $poolProcesses && $poolProcesses > $supervisor->options->minProcesses) { $pool->scale($poolProcesses - 1); }
adjust auto scaling to always use the max processes and fix
laravel_horizon
train
php
b90fc49bbf824a42e28c6d1fd775d02eb24109bf
diff --git a/tests/Database/Ddd/EntityTest.php b/tests/Database/Ddd/EntityTest.php index <HASH>..<HASH> 100644 --- a/tests/Database/Ddd/EntityTest.php +++ b/tests/Database/Ddd/EntityTest.php @@ -1197,6 +1197,17 @@ class EntityTest extends TestCase $this->assertSame(0, $post1->delete_at); } + public function testRefreshWithoutPrimaryKey(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage( + 'Entity Tests\\Database\\Ddd\\Entity\\EntityWithoutPrimaryKey has no primary key.' + ); + + $entity = new EntityWithoutPrimaryKey(); + $entity->refresh(); + } + protected function initI18n(): void { $container = Container::singletons();
tests(entity): add tests for entity refresh without primary key
hunzhiwange_framework
train
php
fba14b51bcea6538bbc9b26ca149bb58eb39523d
diff --git a/product/constants/Portals.js b/product/constants/Portals.js index <HASH>..<HASH> 100644 --- a/product/constants/Portals.js +++ b/product/constants/Portals.js @@ -25,9 +25,9 @@ const INFO = 'info'; const MANUFACTURER = 'manufacturer'; const SHIPPING = 'shipping'; const AVAILABILITY = 'availability'; -const PRICE_STRIKED = 'priceStriked'; +const PRICE_STRIKED = 'price-striked'; const PRICE = 'price'; -const PRICE_INFO = 'priceInfo'; +const PRICE_INFO = 'price-info'; const TIERS = 'tiers'; // POSITIONS
CON-<I> unified naming conventions.
shopgate_pwa
train
js
c5769016c6e19ccc9dc70030f17b06dfeb0ac387
diff --git a/src/com/aoindustries/io/unix/UnixFile.java b/src/com/aoindustries/io/unix/UnixFile.java index <HASH>..<HASH> 100755 --- a/src/com/aoindustries/io/unix/UnixFile.java +++ b/src/com/aoindustries/io/unix/UnixFile.java @@ -970,11 +970,14 @@ public class UnixFile { } /** - * Gets the parent of this file. + * Gets the parent of this file or <code>null</code> if it doesn't have a parent. * Not synchronized because multiple instantiation is acceptable. */ final public UnixFile getParent() { - if(parent==null) parent = isRootDirectory() ? this : new UnixFile(getFile().getParentFile()); + if(parent==null) { + File parentFile = getFile().getParentFile(); + if(parentFile!=null) parent = new UnixFile(parentFile); + } return parent; }
root directory has null parent to be compatible with previous versions and standard Java File class.
aoindustries_aocode-public
train
java
d27d0977a53c3f4f2587b2cd90a2226f959809d5
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ require 'fileutils' +require 'active_support' require 'active_support/core_ext' require 'jekyll' require File.expand_path('lib/jekyll-timeago/filter')
CI: fix build in ruby <I>
markets_jekyll-timeago
train
rb
3c64dad8dcc3eb7923c2a832c18fed30d87f2400
diff --git a/lib/ydocx/templates/fachinfo.rb b/lib/ydocx/templates/fachinfo.rb index <HASH>..<HASH> 100644 --- a/lib/ydocx/templates/fachinfo.rb +++ b/lib/ydocx/templates/fachinfo.rb @@ -211,7 +211,9 @@ div#container { def organize_image(origin_path, source_path) if reference = @references.shift new_source_path = source_path.dirname.to_s + '/' + File.basename(reference) - FileUtils.copy reference, @files.join(new_source_path) + if reference != @files.join(new_source_path).realpath # same file + FileUtils.copy reference, @files.join(new_source_path) + end else copy_or_convert(origin_path, source_path) end
Updated to prevent same image file copy
zdavatz_ydocx
train
rb
cefdea62d941547b49249a4ff5f1e9b8a0703ca3
diff --git a/PyKCS11/__init__.py b/PyKCS11/__init__.py index <HASH>..<HASH> 100644 --- a/PyKCS11/__init__.py +++ b/PyKCS11/__init__.py @@ -693,7 +693,7 @@ class Session(object): if not isinstance(session, LowLevel.CK_SESSION_HANDLE): raise TypeError("session must be a CK_SESSION_HANDLE") - # hold the PyKCS11Lib reference, so that it's not GC'd + # hold the PyKCS11Lib reference, so that it's not Garbage Collection'd self.pykcs11 = pykcs11 self.slot = slot self.session = session
Session(): expand an acronym in a comment "Garbage Collection" is more explicit than "GC".
LudovicRousseau_PyKCS11
train
py
e4baf74207d1df17ecb3f09b253140a9959d06f9
diff --git a/lib/hammer_cli_katello/content_view_version.rb b/lib/hammer_cli_katello/content_view_version.rb index <HASH>..<HASH> 100644 --- a/lib/hammer_cli_katello/content_view_version.rb +++ b/lib/hammer_cli_katello/content_view_version.rb @@ -114,6 +114,45 @@ module HammerCLIKatello end end + class IncrementalUpdate < HammerCLIKatello::Command + include HammerCLIForemanTasks::Async + + action :incremental_update + command_name "incremental-update" + + success_message _("Incremental update is being performed with task %{id}") + failure_message _("An error occurred incrementally updating the content view") + + option('--environment-ids', + 'ENVIRONMENTS', + _("list of environment IDs to update the content view version in"), + :required => true, + :format => HammerCLI::Options::Normalizers::List.new + ) + + option('--id', + 'ID', + _("ID of a content view version to incrementally update"), + :required => true + ) + + def request_params + params = super + + params[:content_view_version_environments] = [ + { + :environment_ids => option_environment_ids, + :content_view_version_id => params['id'] + } + ] + + params.delete('id') + params + end + + build_options + end + autoload_subcommands end end
Fixes #<I>,#<I>: Add ability to incrementally update a content view version.
Katello_hammer-cli-katello
train
rb
fdf6161f8afe08b921aadc4119497f05b04e056b
diff --git a/devassistant/settings.py b/devassistant/settings.py index <HASH>..<HASH> 100644 --- a/devassistant/settings.py +++ b/devassistant/settings.py @@ -37,10 +37,10 @@ DEPS_ONLY_FLAG = '--deps-only' DATA_DIRECTORIES = [os.path.expanduser('~/.devassistant'), '/usr/local/share/devassistant', '/usr/share/devassistant/'] +DEVASSISTANT_HOME = DATA_DIRECTORIES[0] if 'DEVASSISTANT_PATH' in os.environ: DATA_DIRECTORIES = [os.path.abspath(os.path.expanduser(p)) for p in os.environ['DEVASSISTANT_PATH'].split(':')] + DATA_DIRECTORIES -DEVASSISTANT_HOME = DATA_DIRECTORIES[0] if 'DEVASSISTANT_HOME' in os.environ: DEVASSISTANT_HOME = os.path.abspath(os.path.expanduser(os.environ['DEVASSISTANT_HOME']))
Make sure DEVASSISTANT_HOME is not affected by DEVASSISTANT_PATH
devassistant_devassistant
train
py
744473927fc899e446fffd6b10307a2cc83c0ebd
diff --git a/bugwarrior/services/jira.py b/bugwarrior/services/jira.py index <HASH>..<HASH> 100644 --- a/bugwarrior/services/jira.py +++ b/bugwarrior/services/jira.py @@ -358,7 +358,7 @@ class JiraService(IssueService): ) def issues(self): - cases = self.jira.search_issues(self.query, maxResults=-1) + cases = self.jira.search_issues(self.query, maxResults=None) jira_version = 5 if self.config.has_option(self.target, 'jira.version'):
Jira: use paginated query to get ALL results i haven't read the docs, but from reading the code it seems that `None` is the right thing to pass. `-1` seems to get <I> results, while omitting the parameter returns the default of `<I>`. Fixes: #<I>
ralphbean_bugwarrior
train
py
4a38eaf9814739845761199eb2555fa662234369
diff --git a/src/helper/AbstractHelper.php b/src/helper/AbstractHelper.php index <HASH>..<HASH> 100644 --- a/src/helper/AbstractHelper.php +++ b/src/helper/AbstractHelper.php @@ -132,10 +132,10 @@ abstract class AbstractHelper // add to the attributes if ($val === true) { - $html .= ' ' . $this->escape($key); + $html .= $this->escape($key) . ' '; } else { - $html .= ' ' . $this->escape($key) - . '="' . $this->escape($val) . '"'; + $html .= $this->escape($key) + . '="' . $this->escape($val) . '" '; } }
Replacing the space at the end for Returns a <link $attr/> have a spacing :-)
auraphp_Aura.View
train
php
c767a0c3e780b4407172d88d4c37a47e1de462bf
diff --git a/taboo.js b/taboo.js index <HASH>..<HASH> 100644 --- a/taboo.js +++ b/taboo.js @@ -254,7 +254,8 @@ function Taboo(){ // check if index out of range if (index > this._data[0]['data'].length){ - throw "getRowAtIndex(): Index out of range"; + console.error("getRowAtIndex(): Index out of range"); + return []; } var cellObjects = _.map(this._data, function(column, i){
change exception raise to console.error semi-silently fail i guess
mrmagooey_taboo
train
js
6438fc9d6728deeb6b97c6b6c673449152c649ce
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js @@ -102,8 +102,8 @@ define(['require', 'orion/webui/littlelib'], function(require, lib) { this._dropdownNode.style.left = ""; var bounds = lib.bounds(this._dropdownNode); var totalBounds = lib.bounds(this._boundingNode(this._triggerNode)); - if (bounds.left + bounds.width > totalBounds.left + totalBounds.width) { - this._dropdownNode.style.left = (totalBounds.width - bounds.width - 2) + "px"; //$NON-NLS-0$ + if (bounds.left + bounds.width > (totalBounds.left + totalBounds.width)) { + this._dropdownNode.style.right = 0; } },
Bug <I> - Search: clicking on the options causes the main pane drift.
eclipse_orion.client
train
js
536bbca4b2c68c9cff4e43be8d9a9d0481fd312f
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/compilationUnit.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/compilationUnit.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/javascript/compilationUnit.js +++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/compilationUnit.js @@ -45,7 +45,7 @@ define([ this._source = ''; for(var i = 0; i < this._blocks.length; i++) { var block = this._blocks[i]; - if(block.dependecies) { + if(block.dependencies) { this._deps.push(block.dependencies); } var pad = block.offset - _cursor;
[nobug] - Fix spelling mistake in object property
eclipse_orion.client
train
js
818ab5fe430e3d01aaae79a5f9eff86eb011ad73
diff --git a/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java b/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java index <HASH>..<HASH> 100644 --- a/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java +++ b/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java @@ -89,7 +89,7 @@ public final class StyleUtil { SymbolInfo symbol = featureStyle.getSymbol(); SymbolizerTypeInfo symbolizer = null; StrokeInfo stroke = createStroke(featureStyle.getStrokeColor(), featureStyle.getStrokeWidth(), - featureStyle.getStrokeOpacity(), null); + featureStyle.getStrokeOpacity(), featureStyle.getDashArray()); FillInfo fill = createFill(featureStyle.getFillColor(), featureStyle.getFillOpacity()); switch (type) { case GEOMETRY: @@ -356,5 +356,4 @@ public final class StyleUtil { symbolizerInfo.setFill(createFill(style.getColor(), style.getOpacity())); return symbolizerInfo; } - -} +} \ No newline at end of file
Fix CGWT-<I> -Stroke Dash array property of a feature style is ignored
geomajas_geomajas-project-client-gwt2
train
java
5e0d90ee4ff25d288f92959e55d04ea400d34f17
diff --git a/src/CliCommand/CliCommand.php b/src/CliCommand/CliCommand.php index <HASH>..<HASH> 100644 --- a/src/CliCommand/CliCommand.php +++ b/src/CliCommand/CliCommand.php @@ -33,7 +33,7 @@ abstract class CliCommand extends Command { */ public function getConfig() { if ($this->config === null) { - $this->config = require 'config/config.default.php'; + $this->config = require __DIR__ . '/../../config/config.default.php'; } return $this->config;
Prepend __DIR__ when including default config. (#<I>) This works both for cloned, exported and composer installed imbos, and makes sure we're able to get the default configuration (in particular in tests).
imbo_imbo
train
php
81878f52023bc7f828385d14c8ae3a2fad665211
diff --git a/vraptor-core/src/main/java/br/com/caelum/vraptor/environment/DefaultEnvironment.java b/vraptor-core/src/main/java/br/com/caelum/vraptor/environment/DefaultEnvironment.java index <HASH>..<HASH> 100644 --- a/vraptor-core/src/main/java/br/com/caelum/vraptor/environment/DefaultEnvironment.java +++ b/vraptor-core/src/main/java/br/com/caelum/vraptor/environment/DefaultEnvironment.java @@ -28,6 +28,7 @@ import java.security.PrivilegedAction; import java.util.NoSuchElementException; import java.util.Properties; +import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import javax.inject.Named; @@ -68,12 +69,17 @@ public class DefaultEnvironment implements Environment { @Inject public DefaultEnvironment(ServletContext context) { this.context = context; + } + + @PostConstruct + public void setup() { loadProperties(); } - + public DefaultEnvironment(EnvironmentType environmentType) { this((ServletContext) null); this.environmentType = environmentType; + loadProperties(); } private void loadProperties() {
changing from constructor to CDI PostContructor and handling manual initialization
caelum_vraptor4
train
java
948ebf2db6aaa72ff37010880e3801f43def63b0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ module = Extension( setup( name='pyahocorasick', - version='1.2.0dev1', + version='1.2.0', ext_modules=[module], description=(
Release <I> - Closes #<I> --- add remove_word/pop methods that remove a word from trie - Some minor fixes
WojciechMula_pyahocorasick
train
py
37d1149f7714b1d8296cbde5f5e541026d7cde86
diff --git a/lib/rb/lib/thrift/protocol/binaryprotocol.rb b/lib/rb/lib/thrift/protocol/binaryprotocol.rb index <HASH>..<HASH> 100644 --- a/lib/rb/lib/thrift/protocol/binaryprotocol.rb +++ b/lib/rb/lib/thrift/protocol/binaryprotocol.rb @@ -54,18 +54,23 @@ module Thrift end def write_byte(byte) + # yes, -128..255. This covers signed byte min -> unsigned byte max + raise RangeError.new("#{byte} too large to fit in a byte") unless (-128..127).include? byte trans.write([byte].pack('n')[1..1]) end def write_i16(i16) + raise RangeError.new("#{i16} too large to fit in an i16") unless ((-2**15)..(2**15-1)).include? i16 trans.write([i16].pack('n')) end def write_i32(i32) + raise RangeError.new("#{i32} too large to fit in an i32") unless ((-2**31)..(2**31-1)).include? i32 trans.write([i32].pack('N')) end def write_i64(i64) + raise RangeError.new("#{i64} too large to fit in an i32") unless ((-2**63)..(2**63-1)).include? i64 hi = i64 >> 32 lo = i64 & 0xffffffff trans.write([hi, lo].pack('N2'))
Raise a RangeError if Protocol.write_<numeric> is called with a value that doesn't fit in <numeric> git-svn-id: <URL>
limingxinleo_thrift
train
rb
6893e91d8fd827a4f5c5fc44ac55b500d0865648
diff --git a/lib/check_files.py b/lib/check_files.py index <HASH>..<HASH> 100644 --- a/lib/check_files.py +++ b/lib/check_files.py @@ -428,7 +428,7 @@ def countInput(input): files = parseinput.parseinput(input) count = len(files[0]) for f in files[0]: - if pyfits.getval(f, 'INSTRUME') == 'STIS': + if (fileutil.isFits(f)[0]) and pyfits.getval(f, 'INSTRUME') == 'STIS': stisCount = stisObsCount(f) count += (stisCount-1) return count
Updated 'countInput()' in 'pytools.check_files' to only check FITS files to see whether they are STIS ASN files. The check was done using 'fileutil.isFITS()'. The updated code was tested on a directory of WFPC2 GEIS images, a STIS ASN file, and a directory of ACS flt.fits files. WJH git-svn-id: <URL>
spacetelescope_stsci.tools
train
py
25e5957b458623ed76da4eaac9d97f0e4424d971
diff --git a/presto-verifier/src/main/java/com/facebook/presto/verifier/Validator.java b/presto-verifier/src/main/java/com/facebook/presto/verifier/Validator.java index <HASH>..<HASH> 100644 --- a/presto-verifier/src/main/java/com/facebook/presto/verifier/Validator.java +++ b/presto-verifier/src/main/java/com/facebook/presto/verifier/Validator.java @@ -394,6 +394,9 @@ public class Validator timeout.toMillis() - stopwatch.elapsed(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS, true); } + else { + results = ImmutableList.of(ImmutableList.of(limitedStatement.getLargeUpdateCount())); + } prestoStatement.clearProgressMonitor(); QueryStats queryStats = progressMonitor.getFinalQueryStats(); if (queryStats == null) {
Fix NullPointerException from non-read queries Queries that do not read (SELECT) generate null results. We would attempt to create a multiset out of these, causing a NullPointerException. This changes the resultsMatch function to deal with non-read queries properly.
prestodb_presto
train
java
e6581dd41b1bbdffa781879607450831a03dad1a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,15 +1,10 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- -# Ubuntu packages: clamav clamav-daemon -# Suse packages: clamav - -import os -import os.path -import shutil - +# +# Interpreter version: python 2.7 +# +# Imports ===================================================================== from setuptools import setup, find_packages -from distutils.command.sdist import sdist -from distutils.filelist import FileList from docs import getVersion
setup.py fixed - remove unused things.
edeposit_edeposit.amqp.pdfgen
train
py
9fd498e1b6518ae87278afc38ada067f9386e10d
diff --git a/src/Sherlock/requests/SearchRequest.php b/src/Sherlock/requests/SearchRequest.php index <HASH>..<HASH> 100644 --- a/src/Sherlock/requests/SearchRequest.php +++ b/src/Sherlock/requests/SearchRequest.php @@ -23,7 +23,7 @@ class SearchRequest extends Request public function __construct($node) { - + $this->params['filter'] = array(); parent::__construct($node); } public function __call($name, $args)
Initialize filter param with blank array
polyfractal_sherlock
train
php
bcb09670ff85bb006f76a69ec1d4931f9ad10e2c
diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb index <HASH>..<HASH> 100644 --- a/spec/multi_json_spec.rb +++ b/spec/multi_json_spec.rb @@ -74,10 +74,10 @@ describe 'MultiJson' do it 'defaults to the best available gem' do # Clear cache variable already set by previous tests MultiJson.send(:remove_instance_variable, :@adapter) - unless jruby? - expect(MultiJson.adapter).to eq MultiJson::Adapters::Oj - else + if jruby? expect(MultiJson.adapter).to eq MultiJson::Adapters::JrJackson + else + expect(MultiJson.adapter).to eq MultiJson::Adapters::Oj end end
Refactored unless-else to if-else for codestyle and readability
intridea_multi_json
train
rb
28d85bb4c0215008696aaf78ea69c0febd175da8
diff --git a/lib/cli/version.rb b/lib/cli/version.rb index <HASH>..<HASH> 100644 --- a/lib/cli/version.rb +++ b/lib/cli/version.rb @@ -14,6 +14,6 @@ # Cloud Foundry namespace module CF module UAA - CLI_VERSION = "2.0.3" + CLI_VERSION = "2.0.4" end end
Bump to <I> for development.
cloudfoundry_cf-uaac
train
rb
1c057b61d924635e76bf876a4407c31d5e18609d
diff --git a/app/assets/javascripts/magic_lamp/genie.js b/app/assets/javascripts/magic_lamp/genie.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/magic_lamp/genie.js +++ b/app/assets/javascripts/magic_lamp/genie.js @@ -45,8 +45,8 @@ this.fixtureContainer = undefined; }, - handleError: function(path) { - throw new Error('Couldn\'t find fixture(s) at "' + path + '". Either the fixture isn\'t registered or MagicLamp is mounted incorrectly. Serious bummer.'); + handleError: function(errorMessage) { + throw new Error(errorMessage); }, xhrRequest: function(path) { diff --git a/spec/javascripts/magic_lamp_spec.js b/spec/javascripts/magic_lamp_spec.js index <HASH>..<HASH> 100644 --- a/spec/javascripts/magic_lamp_spec.js +++ b/spec/javascripts/magic_lamp_spec.js @@ -160,7 +160,7 @@ describe('MagicLamp', function() { it('throws an error when it cannot find the template', function() { expect(function() { subject.load('not/gonna/happen'); - }).to.throw(/'not\/gonna\/happen' is not a registered fixture/); + }).to.throw(/'not\/gonna\/happen' is not a registered fixture$/); expect(testFixtureContainer()).to.equal(null); });
made sure errors were being passed through properly
crismali_magic_lamp
train
js,js
9310521d5a4e058195c27ace1d93f6d0ff17a95d
diff --git a/cookbooks/build-essential/recipes/default.rb b/cookbooks/build-essential/recipes/default.rb index <HASH>..<HASH> 100644 --- a/cookbooks/build-essential/recipes/default.rb +++ b/cookbooks/build-essential/recipes/default.rb @@ -31,6 +31,8 @@ when "centos" else %w{gcc gcc-c++ kernel-devel make} end + pkgs << "zlib" + pkgs << "zlib-devel" pkgs.each do |pkg| package pkg do action :install
Adding zlib dep on centos
chef_omnibus
train
rb
7ff99e9ad03407b4c55db5e49e7c38adee000955
diff --git a/js/src/range.js b/js/src/range.js index <HASH>..<HASH> 100644 --- a/js/src/range.js +++ b/js/src/range.js @@ -1,16 +1,16 @@ -var range = function ( begin, end, step, out ) { +var range = function ( start, stop, step, out ) { if ( step < 0 ) { - for ( ; begin > end ; begin += step ) { - out.push(begin); + for ( ; start > stop ; start += step ) { + out.push( start ); } } else { - for ( ; begin < end ; begin += step ) { - out.push(begin); + for ( ; start < stop ; start += step ) { + out.push( start ); } }
python-like names for range
aureooms_js-itertools
train
js
4bacd68e5ae58b46c78d74159047b960a27cedcc
diff --git a/eZ/Publish/API/Repository/FieldType.php b/eZ/Publish/API/Repository/FieldType.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/FieldType.php +++ b/eZ/Publish/API/Repository/FieldType.php @@ -87,6 +87,8 @@ interface FieldType */ public function getValidatorConfigurationSchema(); + public function getName( $value ); + /** * Indicates if the field type supports indexing and sort keys for searching *
Added: getName() to API interface
ezsystems_ezpublish-kernel
train
php
f78898f7ca835e1535b29481328a967cd1abab3e
diff --git a/Resources/asset/js/modal-gallery.js b/Resources/asset/js/modal-gallery.js index <HASH>..<HASH> 100644 --- a/Resources/asset/js/modal-gallery.js +++ b/Resources/asset/js/modal-gallery.js @@ -82,17 +82,17 @@ }); }); if($links.length > 1) { - $modal.find('button.btn-prev').show().click(function(e) { + $modal.find('.btn-prev').show().click(function(e) { e.preventDefault(); $gallery.prev(); }); - $modal.find('button.btn-next').show().click(function(e) { + $modal.find('.btn-next').show().click(function(e) { e.preventDefault(); $gallery.next(); }); }else{ - $modal.find('button.btn-prev').hide(); - $modal.find('button.btn-next').hide(); + $modal.find('.btn-prev').hide(); + $modal.find('.btn-next').hide(); } $modal.on('show.bs.modal', function() { modalShown = true; }); $modal.on('hide.bs.modal', function() { modalShown = false; });
Allow usage of anchor (and buttons) in modal gallery JS
ekyna_CoreBundle
train
js
fb61aa8e3dffbdb63c724b511c7edb0cab0a1e1f
diff --git a/library/CM/FormField/Suggest.js b/library/CM/FormField/Suggest.js index <HASH>..<HASH> 100644 --- a/library/CM/FormField/Suggest.js +++ b/library/CM/FormField/Suggest.js @@ -16,6 +16,7 @@ var CM_FormField_Suggest = CM_FormField_Abstract.extend({ tags: null, dropdownCssClass: this.$el.attr('class'), allowClear: true, + openOnEnter: false, maximumSelectionSize: cardinality, formatResult: this._formatItem, formatSelection: this._formatItemSelected,
Don't open select2 on ENTER key
cargomedia_cm
train
js
3742221c3226ecbde5bbd49e2e050529860c8da4
diff --git a/tests/components/material.test.js b/tests/components/material.test.js index <HASH>..<HASH> 100644 --- a/tests/components/material.test.js +++ b/tests/components/material.test.js @@ -74,7 +74,7 @@ suite('material', function () { var imageUrl = 'base/examples/_images/mozvr.png'; el.setAttribute('material', 'src: url(' + imageUrl + ')'); el.addEventListener('material-texture-loaded', function (evt) { - assert(evt.detail.src === imageUrl); + assert.equal(evt.detail.src, imageUrl); done(); }); });
assert.equal instead of ===
aframevr_aframe
train
js
946d80cf753cd5322216e627ecdea8e6de6fdb3a
diff --git a/lxd/storage/drivers/driver_zfs_volumes.go b/lxd/storage/drivers/driver_zfs_volumes.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/driver_zfs_volumes.go +++ b/lxd/storage/drivers/driver_zfs_volumes.go @@ -1739,9 +1739,9 @@ func (d *zfs) UnmountVolume(vol Volume, keepBlockDev bool, op *operations.Operat return false, fmt.Errorf("Failed locating zvol for deactivation: %w", err) } - // We cannot wait longer than the operationlock.TimeoutSeconds to avoid continuing + // We cannot wait longer than the operationlock.TimeoutShutdown to avoid continuing // the unmount process beyond the ongoing request. - waitDuration := time.Duration(operationlock.TimeoutSeconds * time.Second) + waitDuration := operationlock.TimeoutShutdown waitUntil := time.Now().Add(waitDuration) i := 0 for {
lxd/storage/drivers/driver/zfs/volumes: Use operationlock.TimeoutShutdown in UnmountVolume
lxc_lxd
train
go
88c06787d21e475819a928eacc1b5497fdd4f74d
diff --git a/webapps/Gruntfile.js b/webapps/Gruntfile.js index <HASH>..<HASH> 100644 --- a/webapps/Gruntfile.js +++ b/webapps/Gruntfile.js @@ -59,7 +59,6 @@ module.exports = function(grunt) { tasks: ['less'] } }; - require('./grunt/config/watch')(config, watchConf); require('./ui/tasklist/grunt/config/watch')(config, watchConf); require('./ui/cockpit/grunt/config/watch')(config, watchConf); require('./ui/admin/grunt/config/watch')(config, watchConf);
fix(build): do not require non-existent watch file
camunda_camunda-bpm-platform
train
js
e1c4b842916da5f498fba28573a347b92c348e71
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -342,7 +342,6 @@ module ActionDispatch self.always_write_cookie = false private - def write_cookie?(cookie) @secure || !cookie[:secure] || always_write_cookie end @@ -402,7 +401,6 @@ module ActionDispatch end private - def verify(signed_message) @verifier.verify(signed_message) rescue ActiveSupport::MessageVerifier::InvalidSignature @@ -459,7 +457,6 @@ module ActionDispatch end private - def decrypt_and_verify(encrypted_message) @encryptor.decrypt_and_verify(encrypted_message) rescue ActiveSupport::MessageVerifier::InvalidSignature, ActiveSupport::MessageEncryptor::InvalidMessage
:scissors: spacing after private
rails_rails
train
rb
12d968311dcb9ecf0021dac53e3d3b14b63640eb
diff --git a/www/LocationServices.js b/www/LocationServices.js index <HASH>..<HASH> 100644 --- a/www/LocationServices.js +++ b/www/LocationServices.js @@ -145,7 +145,7 @@ var LocationServicesWithoutPermission = { // Check our cached position, if its timestamp difference with current time is less than the maximumAge, then just // fire the success callback with the cached position. - if (LocationServicesWithoutPermission.lastPosition && options.maximumAge && (((new Date()).getTime() - LocationServicesWithoutPermission.lastPosition.timestamp.getTime()) <= options.maximumAge)) { + if (LocationServicesWithoutPermission.lastPosition && options.maximumAge && ((Date.now() - LocationServicesWithoutPermission.lastPosition.timestamp) <= options.maximumAge)) { successCallback(LocationServicesWithoutPermission.lastPosition); // If the cached position check failed and the timeout was set to 0, error out with a TIMEOUT error object. } else if (options.timeout === 0) {
Fix NPE with fresh enough cached position
louisbl_cordova-plugin-locationservices
train
js
0f2d2a9505a02de16f0f2f9099336c08ea70c803
diff --git a/src/Models/Agent.php b/src/Models/Agent.php index <HASH>..<HASH> 100644 --- a/src/Models/Agent.php +++ b/src/Models/Agent.php @@ -99,7 +99,10 @@ class Agent extends User public static function isAdmin() { if (auth()->check()) { - if (auth()->user()->ticketit_admin || in_array(auth()->user()->id, Setting::grab('admin_ids'))) { + if (auth()->user()->ticketit_admin) { + return true; + } + elseif (!is_null(Setting::where('slug', 'admin_ids')->first()) && in_array(auth()->user()->id, Setting::grab('admin_ids'))) { return true; }
resolving issue #<I>
thekordy_ticketit
train
php
93041193e9df99b370779c6523204b03342cce0a
diff --git a/source/php/Module/Curator/Curator.php b/source/php/Module/Curator/Curator.php index <HASH>..<HASH> 100644 --- a/source/php/Module/Curator/Curator.php +++ b/source/php/Module/Curator/Curator.php @@ -46,6 +46,7 @@ class Curator extends \Modularity\Module if(is_array($data['posts']) && !empty($data['posts'])) { foreach($data['posts'] as &$post) { $post->user_readable_name = $this->getUserName($post->user_screen_name); + $post->text = wp_trim_words($post->text, 20, "..."); } }
fix: Curator, truncate long descriptions.
helsingborg-stad_Modularity
train
php
4d0bd21e0c4db75df7449170a238930acf6493d5
diff --git a/config/environments/production.rb b/config/environments/production.rb index <HASH>..<HASH> 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -31,6 +31,8 @@ Rails.application.configure do # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false + config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif] + # Generate digests for assets URLs. config.assets.digest = true
[FIX] Serve vendored images on production
ministryofjustice_peoplefinder
train
rb
92e346296e5dc86a04368dd534d18de2f5512a24
diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index <HASH>..<HASH> 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -687,6 +687,28 @@ class Controller */ protected function runAjaxHandler($handler) { + /** + * @event cms.ajax.beforeRunHandler + * Provides an opportunity to modify an AJAX request + * + * The parameter provided is `$handler` (the requested AJAX handler to be run) + * + * Example usage (forwards AJAX handlers to a backend widget): + * + * $this->controller->bindEvent('ajax.beforeRunHandler', function ($handler) { + * if (strpos($handler, '::')) { + * list($componentAlias, $handlerName) = explode('::', $handler); + * if ($componentAlias === $this->getBackendWidgetAlias()) { + * return $this->backendControllerProxy->runAjaxHandler($handler); + * } + * } + * }); + * + */ + if ($event = $this->fireSystemEvent('cms.ajax.beforeRunHandler', [$handler])) { + return $event; + } + /* * Process Component handler */
Added cms.ajax.beforeRunHandler event
octobercms_october
train
php
47075397133d5ba3f6e947b5af617fb4dd4220cc
diff --git a/lib/puppet/parser/ast/pops_bridge.rb b/lib/puppet/parser/ast/pops_bridge.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/parser/ast/pops_bridge.rb +++ b/lib/puppet/parser/ast/pops_bridge.rb @@ -133,7 +133,7 @@ class Puppet::Parser::AST::PopsBridge args = { :module_name => modname } unless is_nop?(o.body) - args[:code] = Puppet::AST::Bridge::PopsBridge::Expression.new(:value => o.body) + args[:code] = Expression.new(:value => o.body) end unless is_nop?(o.parent) @@ -148,7 +148,7 @@ class Puppet::Parser::AST::PopsBridge end def code() - Puppet::AST::Bridge::PopsBridge::Expression.new(:value => @value) + Expression.new(:value => @value) end def is_nop?(o)
(#<I>) Fix faulty references to Puppet::AST There were references to Puppet::AST, the name is actually Puppet::Parser::AST - but the long references were not needed - the class it is instantiating is in the same name space.
puppetlabs_puppet
train
rb
2c79231817aa9d95bde7f4019ce5dfae4e059124
diff --git a/src/main.js b/src/main.js index <HASH>..<HASH> 100644 --- a/src/main.js +++ b/src/main.js @@ -147,13 +147,9 @@ function configureCommandlineSwitchesSync(cliArgs) { if (argvValue === true || argvValue === 'true') { if (argvKey === 'disable-hardware-acceleration') { app.disableHardwareAcceleration(); // needs to be called explicitly - } else if (argvKey === 'disable-color-correct-rendering') { - app.commandLine.appendSwitch('disable-color-correct-rendering'); // needs to be called exactly like this (https://github.com/microsoft/vscode/issues/84154) } else { - app.commandLine.appendArgument(argvKey); + app.commandLine.appendSwitch(argvKey); } - } else { - app.commandLine.appendSwitch(argvKey, argvValue); } });
fix: don't use appendArgument to add switch values (#<I>) * fix: don't use appendArgument to add switch values * args - make sure to allow to enabe color correct rendering
Microsoft_vscode
train
js
ca86f4bf885656a9e26012c47d6124f92316b450
diff --git a/lib/chanko/unit/scope_finder.rb b/lib/chanko/unit/scope_finder.rb index <HASH>..<HASH> 100644 --- a/lib/chanko/unit/scope_finder.rb +++ b/lib/chanko/unit/scope_finder.rb @@ -1,12 +1,6 @@ module Chanko module Unit class ScopeFinder - LABEL_SCOPE_MAP = { - :controller => ActionController::Base, - :model => ActiveRecord::Base, - :view => ActionView::Base, - } - def self.find(*args) new(*args).find end @@ -34,7 +28,13 @@ module Chanko end def label - LABEL_SCOPE_MAP[@identifier] + label_scope_map = { + :controller => ActionController::Base, + :model => ActiveRecord::Base, + :view => ActionView::Base + } + + label_scope_map[@identifier] end end end
Stop referencing {AC,AR,AV}::Base in a top-level constant
cookpad_chanko
train
rb
77cda90345319470641ffd450da5485ebf24500e
diff --git a/src/modules/vk.js b/src/modules/vk.js index <HASH>..<HASH> 100644 --- a/src/modules/vk.js +++ b/src/modules/vk.js @@ -76,7 +76,7 @@ if (vk != null && vk.email != null) o.email = vk.email; } - + return o; } })(hello);
Added vk.js
MrSwitch_hello.js
train
js
901c58b991533240ec36c27ba334c0ba62256701
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -4,7 +4,7 @@ package ipfs var CurrentCommit string // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.7.0-dev" +const CurrentVersionNumber = "0.7.0-rc1" const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/"
Release <I>-rc1
ipfs_go-ipfs
train
go
01d21b25332846a93e959d2e7194d37bbea03b58
diff --git a/tests/Grant/AuthCodeGrantTest.php b/tests/Grant/AuthCodeGrantTest.php index <HASH>..<HASH> 100644 --- a/tests/Grant/AuthCodeGrantTest.php +++ b/tests/Grant/AuthCodeGrantTest.php @@ -48,7 +48,7 @@ class AuthCodeGrantTest extends TestCase { $this->cryptStub = new CryptTraitStub; $this->codeVerifier = rtrim(strtr(base64_encode(random_bytes(32)), '+/', '-_'), '='); - $this->codeChallenge = rtrim(strtr(base64_encode(hash('sha256',$this->codeVerifier, true)), '+/', '-_'), '='); + $this->codeChallenge = hash('sha256', strtr(rtrim(base64_encode($this->codeVerifier), '='), '+/', '-_')); } public function testGetIdentifier()
Update statement to generate codeChallenge in AuthCodeGrantTest
thephpleague_oauth2-server
train
php
cd06d724f84af6039de6f54d7d4b75df7c7b38d3
diff --git a/src/js/core.js b/src/js/core.js index <HASH>..<HASH> 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -936,7 +936,10 @@ s.touches = { s.onTouchStart = function (e) { if (e.originalEvent) e = e.originalEvent; if (e.type === 'mousedown' && 'which' in e && e.which === 3) return; - if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) return; + if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) { + s.allowClick = true; + return; + } if (s.params.swipeHandler) { if (!findElementInEvent(e, s.params.swipeHandler)) return; }
Fix "no clicks" in no-swiping areas
nolimits4web_swiper
train
js
c7d27a72233468c764eb4bad658330b3e552d795
diff --git a/stanfordnlp/server/client.py b/stanfordnlp/server/client.py index <HASH>..<HASH> 100644 --- a/stanfordnlp/server/client.py +++ b/stanfordnlp/server/client.py @@ -171,7 +171,7 @@ class CoreNLPClient(RobustService): def _request(self, buf, properties): """Send a request to the CoreNLP server. - :param (str | unicode) text: raw text for the CoreNLPServer to parse + :param (str | bytes) buf: data to be sent with the request :param (dict) properties: properties that the server expects :return: request result """ @@ -310,7 +310,7 @@ class CoreNLPClient(RobustService): 'pattern': pattern, 'filter': filter, 'properties': str(properties) - }, data=text, + }, data=text.encode('utf-8'), headers={'content-type': ctype}, timeout=(self.timeout*2)/1000, )
Fix data encoding issue in corenlp client *regex requests
stanfordnlp_stanza
train
py
486434baea460497de76e545a5a1d6a5efb559b3
diff --git a/linguist/admin.py b/linguist/admin.py index <HASH>..<HASH> 100644 --- a/linguist/admin.py +++ b/linguist/admin.py @@ -7,11 +7,15 @@ from django.utils.translation import ugettext_lazy as _ from .models import Translation as LinguistTranslationModel __all__ = [ + 'ModelTranslationAdminMixin', 'ModelTranslationAdmin', ] -class ModelTranslationAdmin(admin.ModelAdmin): +class ModelTranslationAdminMixin(object): + """ + Admin class mixin for translatable models. + """ def get_available_languages(self, obj): """ @@ -30,6 +34,13 @@ class ModelTranslationAdmin(admin.ModelAdmin): languages_column.short_description = _('Languages') +class ModelTranslationAdmin(ModelTranslationAdminMixin, admin.ModelAdmin): + """ + Admin class for translatable models. + """ + pass + + class LinguistTranslationModelAdmin(admin.ModelAdmin): """ Linguist Translation admin options.
Deport admin code in mixin for more flexibility.
ulule_django-linguist
train
py
aad66ea928c4abcd0c4e5a824afc91a2ca6ac3ee
diff --git a/lib/Caxy/HtmlDiff/Table/TableDiff.php b/lib/Caxy/HtmlDiff/Table/TableDiff.php index <HASH>..<HASH> 100644 --- a/lib/Caxy/HtmlDiff/Table/TableDiff.php +++ b/lib/Caxy/HtmlDiff/Table/TableDiff.php @@ -67,7 +67,7 @@ class TableDiff extends AbstractDiff if (null !== $config) { $diff->setConfig($config); - $this->initPurifier($config->getPurifierCacheLocation()); + $diff->initPurifier($config->getPurifierCacheLocation()); } return $diff; @@ -100,7 +100,7 @@ class TableDiff extends AbstractDiff * @param null|string $defaultPurifierSerializerCache * @return void */ - protected function initPurifier($defaultPurifierSerializerCache = null) + public function initPurifier($defaultPurifierSerializerCache = null) { $HTMLPurifierConfig = \HTMLPurifier_Config::createDefault(); // Cache.SerializerPath defaults to Null and sets
Fixed issue with create call on TableDiff object
caxy_php-htmldiff
train
php
16844a3987e3e7d20da5b5cebad643f37d13083e
diff --git a/salt/cloud/clouds/vsphere.py b/salt/cloud/clouds/vsphere.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/vsphere.py +++ b/salt/cloud/clouds/vsphere.py @@ -464,6 +464,7 @@ def list_nodes_min(kwargs=None, call=None): # pylint: disable=W0613 comps2 = comps1.split('/') if len(comps2) == 2: name = comps2[0] + name_file = comps2[1][:-4] if comps2[1].endswith('.vmtx'): name_file = comps2[1][:-5] if comps2[1].endswith('.vmx'): @@ -474,7 +475,7 @@ def list_nodes_min(kwargs=None, call=None): # pylint: disable=W0613 ) # the vm name needs slow lookup instance = conn.get_vm_by_path(node) - name = instance.get_property('name', from_cache=True) + name = instance.get_property('name') ret[name] = True else: log.debug('vm node bad format: {0}'.format(node))
small fixes added `name_file = comps2[1][:-4]` because I figure if vmware adds a new file type its best to try and work with it. vs giving the user an error that name_file is undefined. from_cache=True, was already the default...
saltstack_salt
train
py
1c250e4b02e0d5442cfdd52fa8ef4e54b022145b
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -69,9 +69,9 @@ copyright = u'2010-2020, Universidad Complutense de Madrid' # built documents. # # The short X.Y version. -version = '0.22' +version = '0.23' # The full version, including alpha/beta/rc tags. -release = '0.22.dev1' +release = '0.23.dev0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/numina/version.py b/numina/version.py index <HASH>..<HASH> 100644 --- a/numina/version.py +++ b/numina/version.py @@ -10,4 +10,4 @@ """Numina version.""" -version = '0.22.dev1' +version = '0.23.dev0'
Update to <I>.dev0
guaix-ucm_numina
train
py,py
c85d5395c2cf613b154a25d91320adbd914e32d5
diff --git a/src/Constants.js b/src/Constants.js index <HASH>..<HASH> 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -1,12 +1,12 @@ const Constants = { J1970: 2440587.5, // Julian date at Unix epoch: 1970-01-01 - SATURDAY: 1, - Sunday: 2, - Monday: 3, - Tuesday: 4, - Wednesday: 5, - Thursday: 6, - Friday: 7, + Saturday: 0, + Sunday: 1, + Monday: 2, + Tuesday: 3, + Wednesday: 4, + Thursday: 5, + Friday: 6, YearsPerCentury: 100, YearsPerDecade: 10, MonthsPerYear: 12,
Fixed week days values in constant variables.
pasoonate_pasoonate-js
train
js
12cf4eb2e36ddd56093e1afff04b40cc794205cf
diff --git a/lib/cc/config/default_adapter.rb b/lib/cc/config/default_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/cc/config/default_adapter.rb +++ b/lib/cc/config/default_adapter.rb @@ -18,6 +18,7 @@ module CC **/test/ **/tests/ **/vendor/ + **/*_test.go **/*.d.ts ].freeze
Update EXCLUDE_PATTERNS to include **/*_test.go (#<I>)
codeclimate_codeclimate
train
rb
0d17d252f08c6476ad2643ac6ad0b447858e532d
diff --git a/lib/rs_paginator/paginator.rb b/lib/rs_paginator/paginator.rb index <HASH>..<HASH> 100644 --- a/lib/rs_paginator/paginator.rb +++ b/lib/rs_paginator/paginator.rb @@ -24,7 +24,9 @@ module RsPaginator private def params(h = {}) - @context.params.merge(@extra_params).merge(h) + context_params = @context.params + context_params = context_params.to_unsafe_h if context_params.respond_to?(:to_unsafe_h) + context_params.merge(@extra_params).merge(h) end def prev_link
Fix Paginator: convert to unsafe hash Change needed for upgrading to rails 5.x. The change is backward compatible with rails <I>.x See RMC-<I>
rs-dev_rs_paginator
train
rb
2d7185d3e45d02247f66198b593a20bc63a096b4
diff --git a/Moss/Storage/Storage.php b/Moss/Storage/Storage.php index <HASH>..<HASH> 100644 --- a/Moss/Storage/Storage.php +++ b/Moss/Storage/Storage.php @@ -160,9 +160,14 @@ class Storage implements StorageInterface /** * @return Schema + * @throws StorageException */ protected function schema() { + if (!$this->builders['schema']) { + throw new StorageException('Unable to create schema, missing schema builder'); + } + $schema = new Schema($this->driver, $this->builders['schema'], $this->models); return $schema; @@ -274,9 +279,14 @@ class Storage implements StorageInterface /** * @return Query + * @throws StorageException */ protected function query() { + if (!$this->builders['query']) { + throw new StorageException('Unable to create query, missing query builder'); + } + $query = new Query($this->driver, $this->builders['query'], $this->models); return $query;
throws exception when builder is unavailable
mossphp_moss-storage
train
php
d95a5e51330030f97a2d1133899c3c1342c10121
diff --git a/blob/blob.go b/blob/blob.go index <HASH>..<HASH> 100644 --- a/blob/blob.go +++ b/blob/blob.go @@ -104,10 +104,13 @@ func (t *Table) Upload(digest string, r io.Reader) (*Record, error) { if err != nil { return nil, err } - _, err = t.c.Do(req) + resp, err := t.c.Do(req) if err != nil { return nil, err } + if resp.StatusCode != 201 { + return nil, fmt.Errorf("Upload failed: %s", resp.Status) + } return &Record{ Digest: digest, }, nil
Return an error if upload was not successful.
herenow_go-crate
train
go
52ddca7362077fd9a6314219861d1a6a13d923bd
diff --git a/source/_layouts/master.blade.php b/source/_layouts/master.blade.php index <HASH>..<HASH> 100644 --- a/source/_layouts/master.blade.php +++ b/source/_layouts/master.blade.php @@ -13,7 +13,7 @@ <meta property="og:image" content="/assets/img/logo.png"/> <meta property="og:type" content="website"/> - <meta name="twitter:image:alt" content="{{ $page->siteName}}"> + <meta name="twitter:image:alt" content="{{ $page->siteName }}"> <meta name="twitter:card" content="summary_large_image"> <title>{{ $page->siteName }}{{ $page->title ? ' | ' . $page->title : '' }}</title>
Update source/_layouts/master.blade.php
tightenco_jigsaw-docs-template
train
php
c796301402fad2771e31c9a39ac44dbda7a3653f
diff --git a/code/media/koowa/com_files/js/files.uploader.js b/code/media/koowa/com_files/js/files.uploader.js index <HASH>..<HASH> 100644 --- a/code/media/koowa/com_files/js/files.uploader.js +++ b/code/media/koowa/com_files/js/files.uploader.js @@ -287,6 +287,11 @@ Files.createUploader = function (options) { if (typeof similar.entities === 'object' && similar.entities.length) { names = getNamesFromArray(similar.entities); } + $.each(uploader.files, function (i, f) { + if (f.id !== file.id) { + names.push(f.name); + } + }); file.name = getUniqueName(file.name, function (name) { return $.inArray(name, names) !== -1;
Better unique file support Also check the queue in progress for the same name.
joomlatools_joomlatools-framework
train
js
e5d82f9d172a999eb039cb9516d90472d857614f
diff --git a/napalm_nxos/nxos.py b/napalm_nxos/nxos.py index <HASH>..<HASH> 100644 --- a/napalm_nxos/nxos.py +++ b/napalm_nxos/nxos.py @@ -56,6 +56,7 @@ class NXOSDriver(NetworkDriver): self.loaded = False self.fc = None self.changed = False + self.port = optional_args.get('port', 80) self.protocol = optional_args.get('nxos_protocol', 'http') def open(self): @@ -64,6 +65,7 @@ class NXOSDriver(NetworkDriver): password=self.password, ip=self.hostname, timeout=self.timeout, + port=self.port, protocol=self.protocol) self.device.show('show version', fmat='json') # execute something easy
Port is not passed in nxos driver Adding port as optional_argument.
napalm-automation_napalm-nxos
train
py
23735fe43a26fe4ad6a2d2395edf8c283d166502
diff --git a/lib/validates_timeliness/validator.rb b/lib/validates_timeliness/validator.rb index <HASH>..<HASH> 100644 --- a/lib/validates_timeliness/validator.rb +++ b/lib/validates_timeliness/validator.rb @@ -43,15 +43,20 @@ module ValidatesTimeliness @restrictions_to_check = RESTRICTIONS.keys & options.keys super + setup_timeliness_validated_attributes(options[:class]) if options[:class] end - def setup(model) + def setup_timeliness_validated_attributes(model) if model.respond_to?(:timeliness_validated_attributes) model.timeliness_validated_attributes ||= [] model.timeliness_validated_attributes |= @attributes end end + unless method_defined?(:setup) || private_instance_methods.include?(:deprecated_setup) + alias_method :setup, :setup_timeliness_validated_attributes + end + def validate_each(record, attr_name, value) raw_value = attribute_raw_value(record, attr_name) || value return if (@allow_nil && raw_value.nil?) || (@allow_blank && raw_value.blank?)
Remove #setup method, which is deprecated in Rails 4.
appfolio_validates_timeliness
train
rb
12053e35ef32d04d8bc9a4612c407d6251af7b75
diff --git a/lib/xcode/target.rb b/lib/xcode/target.rb index <HASH>..<HASH> 100644 --- a/lib/xcode/target.rb +++ b/lib/xcode/target.rb @@ -1,4 +1,4 @@ -require_relative 'build_file' +require 'xcode/build_file' module Xcode
Removed require_relative from target
rayh_xcoder
train
rb
4bbbb1c5266ce4f077451061ef3da55c5307e05e
diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -201,6 +201,7 @@ def make_tar(tfn, source_dirs, ignore_path=[], optimize_python=True): dirs.append(d) tinfo = tarfile.TarInfo(d) tinfo.type = tarfile.DIRTYPE + clean(tinfo) tf.addfile(tinfo) # put the file
build.py: also clean() tarfile directory entries
kivy_python-for-android
train
py
e3464a4898c37d85583639b16c077ba92ef01a98
diff --git a/salt/version.py b/salt/version.py index <HASH>..<HASH> 100644 --- a/salt/version.py +++ b/salt/version.py @@ -1,6 +1,6 @@ import sys -__version_info__ = (0, 10, 2) +__version_info__ = (0, 10, 3, 'd') __version__ = '.'.join(map(str, __version_info__)) def versions_report():
Set the version number to a develop version
saltstack_salt
train
py
217f64fd8904b6897d3120f4e4b3417a2618bac2
diff --git a/versionner.py b/versionner.py index <HASH>..<HASH> 100755 --- a/versionner.py +++ b/versionner.py @@ -101,9 +101,9 @@ def parse_args(args): p_up_gr.add_argument('--patch', '-p', action="store_true", help="") p_set = sub.add_parser('set') - p_set.add_argument('--major', '-j', type=str, help="") - p_set.add_argument('--minor', '-n', type=str, help="") - p_set.add_argument('--patch', '-p', type=str, help="") + p_set.add_argument('--major', '-j', type=int, help="") + p_set.add_argument('--minor', '-n', type=int, help="") + p_set.add_argument('--patch', '-p', type=int, help="") p_set.add_argument('--prerelease', '-r', type=str, help="") p_set.add_argument('--build', '-b', type=str, help="")
major, minor and patch in set action must be an int
msztolcman_versionner
train
py
72a9bda49f4021c3d7b82ae855656ffd983f2200
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ function MultiStream (streams, opts) { this._drained = false this._forwarding = false this._current = null - this._queue = streams + this._queue = streams.map(toStreams2) this._next() } @@ -64,7 +64,8 @@ MultiStream.prototype._next = function () { return } - this._current = toStreams2(stream) + stream = toStreams2(stream) + this._current = stream stream.on('readable', onReadable) stream.on('end', onEnd) @@ -96,8 +97,9 @@ MultiStream.prototype._next = function () { } function toStreams2 (s) { + if (typeof s === 'function') return s if (s._readableState) return s - + var wrap = new stream.Readable().wrap(s) if (s.destroy) { wrap.destroy = s.destroy.bind(s)
run toStreams2 in the constructor
feross_multistream
train
js
f0178835d7033b326e8267b9f0cb99f5c307d6c6
diff --git a/tools/test_migration.py b/tools/test_migration.py index <HASH>..<HASH> 100755 --- a/tools/test_migration.py +++ b/tools/test_migration.py @@ -37,6 +37,8 @@ def pg_dump(to_file): comments = [] columns = [] + alters = [] + alter_start = None in_table = False with open(to_file, 'w') as out: @@ -68,6 +70,23 @@ def pg_dump(to_file): for column in sorted(columns): out.write(column) + # ignore the name of UNIQUE keys until we start naming + # them explicitly + if alter_start: + if re.match(r"^ ADD CONSTRAINT \w+_key UNIQUE ", line): + line = re.sub(r" ADD CONSTRAINT (\w+)_key UNIQUE ", + r" ADD CONSTRAINT <elided>_key UNIQUE ", + line) + alters.append(alter_start + line) + alter_start = None + continue + else: + line = alter_start + line + alter_start = None + elif line.startswith('ALTER TABLE ONLY '): + alter_start = line; + continue + # move comments to the end if line.startswith('COMMENT '): comments.append(line) @@ -79,6 +98,10 @@ def pg_dump(to_file): out.write(line) + # write out alters sorted + for alter in sorted(alters): + out.write(alter) + # write out comments sorted for comment in sorted(comments): out.write(comment)
Ignore the name of UNIQUE keys (until we start naming them explicitly).
gem_oq-engine
train
py
7778f42a35fbecb65531b3df5c23e0b76393d649
diff --git a/lib/bibtex/bibliography.rb b/lib/bibtex/bibliography.rb index <HASH>..<HASH> 100644 --- a/lib/bibtex/bibliography.rb +++ b/lib/bibtex/bibliography.rb @@ -65,7 +65,9 @@ module BibTeX # Saves the bibliography to a file at the given path. def save_to(path) - File.write(path,to_s) + File.open(path, "w") do |f| + f.write to_s + end end # Add an object to the bibliography. Returns the bibliography.
Use File.open instead of File.write Ruby <I>-p<I> (and below?) do not have the method 'File.write'
inukshuk_bibtex-ruby
train
rb
86e4e20415d437bfe8920587578545eb7ad20bd8
diff --git a/src/User.php b/src/User.php index <HASH>..<HASH> 100644 --- a/src/User.php +++ b/src/User.php @@ -166,7 +166,7 @@ class User extends Model protected function setUsername($value) { - if (($value != $this->Username) && !$this->isNewRecord()) { + if ((!isset( $this->modelData["Username"]) || ( $value != $this->modelData["Username"] )) && !$this->isNewRecord()) { throw new ModelException("Username cannot be changed after a user has been created.", $this); }
Fixed warning thrown during setUsername
RhubarbPHP_Scaffold.Authentication
train
php
75842713e75293ee304bc01d1a03946e3a10c2c6
diff --git a/rapidoid-demo/src/main/java/org/rapidoid/demo/taskplanner/gui/AboutScreen.java b/rapidoid-demo/src/main/java/org/rapidoid/demo/taskplanner/gui/AboutScreen.java index <HASH>..<HASH> 100644 --- a/rapidoid-demo/src/main/java/org/rapidoid/demo/taskplanner/gui/AboutScreen.java +++ b/rapidoid-demo/src/main/java/org/rapidoid/demo/taskplanner/gui/AboutScreen.java @@ -37,14 +37,9 @@ public class AboutScreen extends GUI { } public void onTx() { - DB.transaction(new Runnable() { - @Override - public void run() { - DB.insert(new Task("DON'T GO TO THE DATABASE!", Priority.HIGH)); - DB.update(0, new Task("DON'T GO TO THE DATABASE!", Priority.HIGH)); - throw U.rte("some failure!"); - } - }, false); + DB.insert(new Task("DON'T GO TO THE DATABASE!", Priority.HIGH)); + DB.update(0, new Task("DON'T GO TO THE DATABASE!", Priority.HIGH)); + throw U.rte("some failure!"); } }
Simplified transaction demo due to the built-in transactions in apps.
rapidoid_rapidoid
train
java
36934737ab354734b6b7dee841d3a310df09907c
diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -134,6 +134,7 @@ func resourceAwsEcsService() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + Default: "DISABLED", Elem: &schema.Schema{Type: schema.TypeString}, }, }, @@ -432,7 +433,6 @@ func expandEcsNetworkConfigration(nc []interface{}) *ecs.NetworkConfiguration { if val, ok := raw["assign_public_ip"].(string); ok { awsVpcConfig.AssignPublicIp = aws.String(val) } - return &ecs.NetworkConfiguration{AwsvpcConfiguration: awsVpcConfig} }
set default value for assign_public_ip
terraform-providers_terraform-provider-aws
train
go
3cf61eca21537b24f7867f9a7723f8f3dc00ba85
diff --git a/app/controllers/checkout_controller_decorator.rb b/app/controllers/checkout_controller_decorator.rb index <HASH>..<HASH> 100644 --- a/app/controllers/checkout_controller_decorator.rb +++ b/app/controllers/checkout_controller_decorator.rb @@ -5,7 +5,7 @@ CheckoutController.class_eval do def edit - if (@order.valid? && @order.state == "payment") + if ((@order.state == "payment") && @order.valid?) puts "valid, processing" if @order.payable_via_paypal? puts "payable via paypal, adding payment"
execution ordering (and preventing) does make a difference (signed: cpt. obvious)
tomash_spree-pp-website-standard
train
rb
223b2481c00f18a9cc138956850865562a5c3242
diff --git a/lib/netsuite/records/inventory_item.rb b/lib/netsuite/records/inventory_item.rb index <HASH>..<HASH> 100644 --- a/lib/netsuite/records/inventory_item.rb +++ b/lib/netsuite/records/inventory_item.rb @@ -51,7 +51,7 @@ module NetSuite :parent, :preferred_location, :pricing_group, :purchase_price_variance_acct, :purchase_tax_code, :purchase_unit, :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :soft_descriptor, :stock_unit, :store_display_image, :store_display_thumbnail, :store_item_template, :supply_lot_sizing_method, - :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor + :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor, :locations_list field :pricing_matrix, PricingMatrix field :custom_field_list, CustomFieldList
Add locations_list to InventoryItem fields list
NetSweet_netsuite
train
rb
5c6c46bc27fb02d4bc15b5a8f6fd46e5ec8b060d
diff --git a/src/EloGank/Replay/Observer/Client/ReplayObserverClient.php b/src/EloGank/Replay/Observer/Client/ReplayObserverClient.php index <HASH>..<HASH> 100644 --- a/src/EloGank/Replay/Observer/Client/ReplayObserverClient.php +++ b/src/EloGank/Replay/Observer/Client/ReplayObserverClient.php @@ -62,7 +62,7 @@ class ReplayObserverClient $stringGameId = (string) $gameId; return sprintf( - '%s/%s/%s/%s/%s/%d', + '%s/%s/%s/%s/%s/%s', $this->replaysDirPath, $region, $stringGameId[0] . $stringGameId[1],
fix: LoL game id has reached the maximum integer value.
EloGank_lol-replay-observer
train
php
241369aa37e944ef5c2902fd41c9accff9765b6a
diff --git a/src/sos/sos_task.py b/src/sos/sos_task.py index <HASH>..<HASH> 100644 --- a/src/sos/sos_task.py +++ b/src/sos/sos_task.py @@ -759,11 +759,11 @@ def check_tasks(tasks, verbosity=1, html=False, start_time=False, age=None, tags print('{}\t{}\n'.format(t, s)) if d is not None: print('Started {} ago'.format(PrettyRelativeTime(time.time() - d))) - if s not in ('pending', 'submitted', 'running'): - print('Duration {}'.format(PrettyRelativeTime(taskDuration(t)))) task_file = os.path.join(os.path.expanduser('~'), '.sos', 'tasks', t + '.task') if not os.path.isfile(task_file): continue + if s not in ('pending', 'submitted', 'running'): + print('Duration {}'.format(PrettyRelativeTime(taskDuration(t)))) params = loadTask(task_file) print('TASK:\n=====') print(params.task)
Check duration after making sure task files exist #<I>
vatlab_SoS
train
py
69b1c0166312a81921c4ac51e1e580e868af230b
diff --git a/spec/safe_yaml_spec.rb b/spec/safe_yaml_spec.rb index <HASH>..<HASH> 100644 --- a/spec/safe_yaml_spec.rb +++ b/spec/safe_yaml_spec.rb @@ -149,22 +149,22 @@ describe YAML do it "doesn't issue a warning if the :safe option is specified" do Kernel.should_not_receive(:warn) - YAML.load(*arguments, :safe => true) + YAML.load(*(arguments + [{:safe => true}])) end it "defaults to safe mode if the :safe option is omitted" do YAML.should_receive(:safe_load).with(*arguments) - YAML.load(*arguments, :safe => true) + YAML.load(*(arguments + [{:safe => true}])) end it "calls #safe_load if the :safe option is set to true" do YAML.should_receive(:safe_load).with(*arguments) - YAML.load(*arguments, :safe => true) + YAML.load(*(arguments + [{:safe => true}])) end it "calls #unsafe_load if the :safe option is set to false" do YAML.should_receive(:unsafe_load).with(*arguments) - YAML.load(*arguments, :safe => false) + YAML.load(*(arguments + [{:safe => false}])) end end end
fixed specs for Ruby <I>
dtao_safe_yaml
train
rb
2d7185fba51e3d5bbb29a9258cfb0a5d21ed5c19
diff --git a/deployutils/__init__.py b/deployutils/__init__.py index <HASH>..<HASH> 100644 --- a/deployutils/__init__.py +++ b/deployutils/__init__.py @@ -22,4 +22,4 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = '0.5.3' +__version__ = '0.5.4-dev' diff --git a/testsite/settings.py b/testsite/settings.py index <HASH>..<HASH> 100644 --- a/testsite/settings.py +++ b/testsite/settings.py @@ -4,7 +4,7 @@ Django settings for deployutils testsite project. import os, sys -from deployutils.compat import reverse_lazy +from deployutils.apps.django.compat import reverse_lazy from deployutils.configs import load_config, update_settings
picks reverse_lazy from correct package
djaodjin_djaodjin-deployutils
train
py,py
a0e8b1b331647d1ed6e807b3adf6ac31f8a254d2
diff --git a/glue/ldbd.py b/glue/ldbd.py index <HASH>..<HASH> 100644 --- a/glue/ldbd.py +++ b/glue/ldbd.py @@ -190,7 +190,7 @@ class UniqueIds: return get_thread_storage()['uqids'][istring] except KeyError: curs = get_thread_storage()['curs'] - curs.execute('VALUES GENERATE_UNIQUE()') + curs.execute('VALUES BLOB(GENERATE_UNIQUE())') get_thread_storage()['uqids'][istring] = curs.fetchone()[0] return get_thread_storage()['uqids'][istring] @@ -472,7 +472,7 @@ class LIGOMetadata: missingcols = [k for k in self.ldb.uniqueids[tab] if k not in self.table[tab]['column']] for m in missingcols: - generate.append(',GENERATE_UNIQUE()') + generate.append(',BLOB(GENERATE_UNIQUE())') self.table[tab]['orderedcol'].append(m) # and construct the sql query self.table[tab]['query'] = ' '.join( @@ -483,7 +483,7 @@ class LIGOMetadata: tab = tabtup[0].lower() try: try: - self.curs.execute(self.table[tab]['query'], + self.curs.executemany(self.table[tab]['query'], self.table[tab]['stream']) rowcount = self.curs.rowcount except DB2.Error, e:
added blob cast and changed execute to executemany as needed for PyDB2 API
gwastro_pycbc-glue
train
py
f404bbd5bfd96e93627510168d02c29cbcb6a1af
diff --git a/mix/sdl_mixer.go b/mix/sdl_mixer.go index <HASH>..<HASH> 100644 --- a/mix/sdl_mixer.go +++ b/mix/sdl_mixer.go @@ -25,7 +25,7 @@ package mix // return (frames * 1000) / freq; //} // -//#if !(SDL_MIXER_VERSION_ATLEAST(2,0,2)) +//#if (SDL_MIXER_MAJOR_VERSION == 2) && (SDL_MIXER_MINOR_VERSION == 0) && (SDL_MIXER_PATCHLEVEL < 2) // //#if defined(WARN_OUTDATED) //#pragma message("Mix_OpenAudioDevice is not supported before SDL_mixer 2.0.2")
mix: Update SDL2_mixer version checking pre-processor to be usable on older version
veandco_go-sdl2
train
go
4e67b2a0cf969204023ab44fe2ae40d74c232025
diff --git a/nblr/src/main/java/jlibs/nblr/codegen/CodeGenerator.java b/nblr/src/main/java/jlibs/nblr/codegen/CodeGenerator.java index <HASH>..<HASH> 100644 --- a/nblr/src/main/java/jlibs/nblr/codegen/CodeGenerator.java +++ b/nblr/src/main/java/jlibs/nblr/codegen/CodeGenerator.java @@ -149,8 +149,6 @@ public abstract class CodeGenerator{ if(pathWithoutMatcher!=null) println(pathWithoutMatcher, pathStack); - else if(paths.charIndex==0) - printer.printlns("expected(String.valueOf(ch), \""+StringUtil.toLiteral(paths.toString(), false)+"\");"); if(paths.charIndex==0){ printer.printlns( @@ -158,6 +156,9 @@ public abstract class CodeGenerator{ "}" ); } + + if(pathWithoutMatcher==null && paths.charIndex==0) + printer.printlns("expected(String.valueOf(ch), \""+StringUtil.toLiteral(paths.toString(), false)+"\");"); } public void println(Path path, ArrayDeque<Path> pathStack){
expected(...) should be outside of if condition
santhosh-tekuri_jlibs
train
java
b037a19c09ba9b85841a247641836235be80e62d
diff --git a/src/config/page-view-counter.php b/src/config/page-view-counter.php index <HASH>..<HASH> 100644 --- a/src/config/page-view-counter.php +++ b/src/config/page-view-counter.php @@ -32,9 +32,9 @@ return [ * - $article->getPageViewsFrom('14d'); // Get the total page views of the last 14 days */ 'date-transformers' => [ - '24h' => Carbon::now()->subDays(1), - '7d' => Carbon::now()->subWeeks(1), - '14d' => Carbon::now()->subWeeks(2), + // '24h' => Carbon::now()->subDays(1), + // '7d' => Carbon::now()->subWeeks(1), + // '14d' => Carbon::now()->subWeeks(2), ], ];
Comment out the date transformers as default
cyrildewit_eloquent-viewable
train
php
d1805ac46e12a42bade0d12024a9d3716010d872
diff --git a/astrocats/__init__.py b/astrocats/__init__.py index <HASH>..<HASH> 100644 --- a/astrocats/__init__.py +++ b/astrocats/__init__.py @@ -4,7 +4,7 @@ import os import sys -__version__ = '0.2.0' +__version__ = '0.2.1' __author__ = 'James Guillochon' __license__ = 'MIT'
ENH: bumping version to `<I>`
astrocatalogs_astrocats
train
py
dde8eb46cef4fae11a3c51f007075aac216f2782
diff --git a/tests/StringsTest.php b/tests/StringsTest.php index <HASH>..<HASH> 100644 --- a/tests/StringsTest.php +++ b/tests/StringsTest.php @@ -93,7 +93,12 @@ class StringsTest extends TestFixture public function testToCOOKIEString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); - $this->assertSame('Thursday, 25-Dec-75 14:15:16 EST', $d->toCOOKIEString()); + if( \DateTime::COOKIE === 'd-M-y H:i:s T' ) + $cookieString = 'Thursday, 25-Dec-75 14:15:16 EST'; + else + $cookieString = 'Thursday, 25-Dec-1975 14:15:16 EST'; + + $this->assertSame($cookieString, $d->toCOOKIEString()); } public function testToISO8601String() {
One from strings tests was failing due to inconsistent declaring DateTime COOKIE constant across multiple PHP versions. Check here <URL>
briannesbitt_Carbon
train
php
8364506028eb1d41e43c84af4e17ac39df34ad4f
diff --git a/beeswarm/server/misc/config_actor.py b/beeswarm/server/misc/config_actor.py index <HASH>..<HASH> 100644 --- a/beeswarm/server/misc/config_actor.py +++ b/beeswarm/server/misc/config_actor.py @@ -143,8 +143,10 @@ class ConfigActor(Greenlet): client.add_bait(capability, activation_range, sleep_interval, activation_probability, bait_credentials.username, bait_credentials.password) db_session.commit() - for client in clients: - self._send_config_to_drone(client.id) + + drones = db_session.query(Drone).all() + for drone in drones: + self._send_config_to_drone(drone.id) def _get_drone_config(self, drone_id): db_session = database_setup.get_session()
new deception should trigger config pub to all drones
honeynet_beeswarm
train
py
9527f94bdfefa0d05d844e1261b451722be85de1
diff --git a/account-management-util/src/main/java/org/duracloud/account/util/impl/DuracloudInstanceServiceImpl.java b/account-management-util/src/main/java/org/duracloud/account/util/impl/DuracloudInstanceServiceImpl.java index <HASH>..<HASH> 100644 --- a/account-management-util/src/main/java/org/duracloud/account/util/impl/DuracloudInstanceServiceImpl.java +++ b/account-management-util/src/main/java/org/duracloud/account/util/impl/DuracloudInstanceServiceImpl.java @@ -281,7 +281,7 @@ public class DuracloudInstanceServiceImpl implements DuracloudInstanceService, try { doInitialize(false); return; - } catch(DuracloudInstanceUpdateException ex) { + } catch(DuraCloudRuntimeException ex) { logInitException(ex); } }
This update resolves issue #<I>a specified in <URL>
duracloud_management-console
train
java
010f942dc8d056e99fa3b7f2a598868f45533ec8
diff --git a/tests/unit/cli/batch_test.py b/tests/unit/cli/batch_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/cli/batch_test.py +++ b/tests/unit/cli/batch_test.py @@ -5,7 +5,6 @@ # Import Salt Libs from salt.cli.batch import Batch -from salt.client import LocalClient # Import Salt Testing Libs from salttesting import TestCase
Pylint fix, again.
saltstack_salt
train
py
c3510b323e4243776ee31f4110289a96ad973f75
diff --git a/src/test/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulatorTest.java b/src/test/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulatorTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulatorTest.java +++ b/src/test/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulatorTest.java @@ -517,7 +517,7 @@ public class MolecularFormulaManipulatorTest extends CDKTestCase { formula2.addIsotope(br1); formula2.addIsotope(br2); - Assert.assertEquals(2,formula2.getIsotopeCount()); + Assert.assertEquals(1,formula2.getIsotopeCount(),0.000001); double totalAbudance = MolecularFormulaManipulator.getTotalNaturalAbundance(formula2); Assert.assertEquals(0.25694761,totalAbudance,0.000001);
Extraction from the string elemental formula the charge.
cdk_cdk
train
java
c8e69113182f95c4661233f5e050cbe835086a5b
diff --git a/src/Process/Runner/Result.php b/src/Process/Runner/Result.php index <HASH>..<HASH> 100644 --- a/src/Process/Runner/Result.php +++ b/src/Process/Runner/Result.php @@ -51,6 +51,16 @@ class Result } /** + * Return true if command was successful. + * + * @return bool + */ + public function wasSuccessful() : bool + { + return $this->cmdResult->wasSuccessful(); + } + + /** * Return cmd output as array. * * @return array
Proxy the 'wasSuccessful' method
sebastianfeldmann_cli
train
php
c805139d4159f5bde8766a06028e3c8bee10d7b8
diff --git a/sprinter/formulas/ssh.py b/sprinter/formulas/ssh.py index <HASH>..<HASH> 100644 --- a/sprinter/formulas/ssh.py +++ b/sprinter/formulas/ssh.py @@ -29,7 +29,7 @@ class SSHFormula(FormulaBase): def install(self, feature_name, config): ssh_path = self.__generate_key(feature_name, config) self.__install_ssh_config(config, ssh_path) - super(FormulaBase, self).install(feature_name, config) + super(SSHFormula, self).install(feature_name, config) def update(self, feature_name, source_config, target_config): ssh_path = self.__generate_key(feature_name, target_config)
Fixing typo in ssh
toumorokoshi_sprinter
train
py
cd2889e370a6ffac0696ff25d5e849a9df0120f8
diff --git a/packages/wxa-cli/src/resolvers/ast/index.js b/packages/wxa-cli/src/resolvers/ast/index.js index <HASH>..<HASH> 100644 --- a/packages/wxa-cli/src/resolvers/ast/index.js +++ b/packages/wxa-cli/src/resolvers/ast/index.js @@ -9,6 +9,12 @@ import {generateCodeFromAST} from '../../compilers/script'; let debug = debugPKG('WXA:ASTManager'); +const isStaticSource = (filepath) => { + let ext = path.extname(filepath); + + return ~['png','jpg','jpeg','webp','eot','woff','woff2','ttf','file', 'gif','webm', 'mp3', 'mp4'].indexOf(ext.replace(/^\./, '')); +} + export default class ASTManager { constructor(resolve, meta, wxaConfigs) { this.resolve = resolve; @@ -136,6 +142,12 @@ export default class ASTManager { source, outputPath, resolved, }, }); + + // Allow use import to add static file to project + if (isStaticSource(source)) { + path.remove(); + return; + } switch (typeOfPath) { case StringLiteralRequire:
feat(cli): Allow use import declaration to add static file to project re #<I>
wxajs_wxa
train
js
a38150da4662b2e0b829a225fd4bf89fb706786a
diff --git a/lib/sample_models/model.rb b/lib/sample_models/model.rb index <HASH>..<HASH> 100644 --- a/lib/sample_models/model.rb +++ b/lib/sample_models/model.rb @@ -72,8 +72,12 @@ module SampleModels stream_class_name = validation_method.to_s.camelize + 'ValueStream' if ValidationCollection.const_defined?(stream_class_name) stream_class = ValidationCollection.const_get(stream_class_name) - input = @value_streams.last - @value_streams << stream_class.new(@model, @field, config, input) + if stream_class == ValidatesUniquenessOfValueStream + @validates_uniqueness_config = config + else + input = @value_streams.last + @value_streams << stream_class.new(@model, @field, config, input) + end end end @@ -86,6 +90,13 @@ module SampleModels end def satisfying_value + if @validates_uniqueness_config + input = @value_streams.last + @value_streams << ValidatesUniquenessOfValueStream.new( + @model, @field, @validates_uniqueness_config, input + ) + @validates_uniqueness_config = nil + end @value_streams.last.satisfying_value if @value_streams.last end
uniqueness value stream is always at the end since it might need to force earlier streams to increment
fhwang_sample_models
train
rb
569091978bf4a090e36274b884b8df2421e5bb49
diff --git a/spyderlib/utils/codeanalysis.py b/spyderlib/utils/codeanalysis.py index <HASH>..<HASH> 100644 --- a/spyderlib/utils/codeanalysis.py +++ b/spyderlib/utils/codeanalysis.py @@ -69,10 +69,11 @@ def check_with_pyflakes(source_code, filename=None): w = Checker(tree, filename) w.messages.sort(key=lambda x: x.lineno) results = [] + coding = encoding.get_coding(source_code) lines = source_code.splitlines() for warning in w.messages: if 'analysis:ignore' not in \ - to_text_string(lines[warning.lineno-1]): + to_text_string(lines[warning.lineno-1], coding): results.append((warning.message % warning.message_args, warning.lineno)) return results
Correctly decode source code after flake check
spyder-ide_spyder
train
py
5ec6ddce7c0d45470ce16e15bd857bfe0a630f16
diff --git a/source/rafcon/mvc/singleton.py b/source/rafcon/mvc/singleton.py index <HASH>..<HASH> 100644 --- a/source/rafcon/mvc/singleton.py +++ b/source/rafcon/mvc/singleton.py @@ -32,6 +32,8 @@ def open_folder(query): gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) + # Allows confirming with Enter and double-click + dialog.set_default_response(gtk.RESPONSE_OK) if main_window_controller: dialog.set_transient_for(main_window_controller.view.get_top_widget()) dialog.set_current_folder(last_path) @@ -64,6 +66,8 @@ def create_folder(query): gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) + # Allows confirming with Enter and double-click + dialog.set_default_response(gtk.RESPONSE_OK) if main_window_controller: dialog.set_transient_for(main_window_controller.view.get_top_widget()) dialog.set_current_folder(last_path)
Allow selection of folders with Enter key By setting the default response of a FileChooserDialog, it can be confirmed using either a double-click or the enter key
DLR-RM_RAFCON
train
py
9b8adeea2e0c2e750b09c8f272d52b562470b8b1
diff --git a/pkg/topom/topom.go b/pkg/topom/topom.go index <HASH>..<HASH> 100644 --- a/pkg/topom/topom.go +++ b/pkg/topom/topom.go @@ -294,7 +294,6 @@ func (s *Topom) Stats() (*Stats, error) { } type Stats struct { - Online bool `json:"online"` Closed bool `json:"closed"` Slots []*models.SlotMapping `json:"slots"`
topom: remove Stats.Online which is useless (always true)
CodisLabs_codis
train
go
2fe1c00003fab43773a2e091119a95cdb6918bf5
diff --git a/lib/outpost/scout_config.rb b/lib/outpost/scout_config.rb index <HASH>..<HASH> 100644 --- a/lib/outpost/scout_config.rb +++ b/lib/outpost/scout_config.rb @@ -4,6 +4,7 @@ module Outpost def initialize @reports = {} + @options = {} end # Reads/writes any options. It will passed
init scout config options as empty hash
vinibaggio_outpost
train
rb
3bad04f0b77bd5c8a889a0889ec8d79f1f3356d5
diff --git a/bcbio/workflow/template.py b/bcbio/workflow/template.py index <HASH>..<HASH> 100644 --- a/bcbio/workflow/template.py +++ b/bcbio/workflow/template.py @@ -20,10 +20,13 @@ from bcbio.bam import fastq from bcbio.variation.cortex import get_sample_name from bcbio.workflow.xprize import HelpArgParser + def parse_args(inputs): parser = HelpArgParser( description="Create a bcbio_sample.yaml file from a standard template and inputs") - parser.add_argument("template", help="Template name or path to template YAML file") + parser.add_argument("template", help=("Template name or path to template YAML file. " + "Built in choices: freebayes-variant, gatk-variant, tumor-paired, " + "illumina-rnaseq, illumina-chipseq")) parser.add_argument("metadata", help="CSV file with project metadata. Name of file used as project name.") parser.add_argument("input_files", nargs="*", help="Input read files, in BAM or fastq format") return parser.parse_args(inputs) @@ -223,3 +226,5 @@ def setup(args): print "Edit to finalize and run with:" print " cd %s" % work_dir print " bcbio_nextgen.py ../config/%s" % os.path.basename(out_config_file) + +
Added a more verbose template message to give the current options.
bcbio_bcbio-nextgen
train
py
40d8263ca85f1d8fae426d2a09ff4cab834d4e86
diff --git a/salt/cloud/clouds/nova.py b/salt/cloud/clouds/nova.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/nova.py +++ b/salt/cloud/clouds/nova.py @@ -418,9 +418,7 @@ def request_instance(vm_=None, call=None): log.info('Creating Cloud VM {0}'.format(vm_['name'])) salt.utils.cloud.check_name(vm_['name'], 'a-zA-Z0-9._-') conn = get_conn() - kwargs = { - 'name': vm_['name'] - } + kwargs = vm_.copy() try: kwargs['image_id'] = get_image(conn, vm_)
kwargs should be vm_ this allows for specifying stuff to configure novaclient plugins, in the cloud.profiles, such as public: False service_net: True
saltstack_salt
train
py
a09e320f02ff2e60ccfd63b448ec1bbb09070867
diff --git a/scripts/importer/Events.py b/scripts/importer/Events.py index <HASH>..<HASH> 100644 --- a/scripts/importer/Events.py +++ b/scripts/importer/Events.py @@ -476,7 +476,7 @@ def add_event(tasks, args, events, name, log, load=True, delete=True): log.debug("`newname`: '{}' (name: '{}') already exists.".format(newname, name)) return events, newname - # If event is alias of another event, find and return that + # If event is alias of another event *in `events`*, find and return that match_name = find_event_name_of_alias(events, newname) if match_name is not None: log.debug("`newname`: '{}' (name: '{}') already exist as alias for '{}'.".format(
DOCS: clarify docstring.
astrocatalogs_astrocats
train
py