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
3023cc111f675898bb47f79a99aec91b77072696
diff --git a/core-bundle/src/Resources/contao/library/Contao/Controller.php b/core-bundle/src/Resources/contao/library/Contao/Controller.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Controller.php +++ b/core-bundle/src/Resources/contao/library/Contao/Controller.php @@ -1003,6 +1003,7 @@ abstract class Controller extends \System exit; } + $strLocation = ltrim($strLocation, '/'); $strLocation = str_replace('&amp;', '&', $strLocation); $strLocation = static::replaceOldBePaths($strLocation);
[Core] Make sure there's never // in Controller::redirect() because Environment::get('base') always contains one
contao_contao
train
php
11890436898fc470682dc4fd8c291f5d2f5f7a97
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,14 @@ var fs = require('fs'); var PI_MODEL_NO = [ + // https://www.raspberrypi.org/documentation/hardware/raspberrypi/ 'BCM2708', 'BCM2709', 'BCM2710', - 'BCM2835', - 'BCM2837B0' + 'BCM2835', // Raspberry Pi 1 and Zero + 'BCM2836', // Raspberry Pi 2 + 'BCM2837', // Raspberry Pi 3 (and later Raspberry Pi 2) + 'BCM2837B0', // Raspberry Pi 3B+ and 3A+ + 'BCM2711' // Raspberry Pi 4B ]; function isPi (model) {
Update index.js Added additional Raspberry Pi model numbers (Pi 2, 3, 4B), and commented which device each refers to. Source of the information also commented.
fourcube_detect-rpi
train
js
84c08e4a3ab7468e6f57099f92034e2ee19f28a6
diff --git a/rdoupdate/actions.py b/rdoupdate/actions.py index <HASH>..<HASH> 100644 --- a/rdoupdate/actions.py +++ b/rdoupdate/actions.py @@ -89,7 +89,7 @@ def download_updates_builds(*files, **kwargs): def get_last_commit_update(dir='.'): with helpers.cdir(dir): - out = git('diff', '--name-status', 'HEAD~..HEAD').strip() + out = git('diff', '--name-status', 'HEAD~..HEAD', log_cmd=False).strip() if out.find("\n") != -1: raise exception.InvalidUpdateCommit( msg="Last commit changes more than one file.")
Don't be overly verbose
yac_rdoupdate
train
py
1145fb57ed2a26c8e50153ceb2fb640f75fe2988
diff --git a/addrmanager.go b/addrmanager.go index <HASH>..<HASH> 100644 --- a/addrmanager.go +++ b/addrmanager.go @@ -595,14 +595,12 @@ func deserialiseNetAddress(addr string) (*btcwire.NetAddress, error) { if err != nil { return nil, err } - ip := net.ParseIP(host) port, err := strconv.ParseUint(portStr, 10, 16) if err != nil { return nil, err } - na := btcwire.NewNetAddressIPPort(ip, uint16(port), - btcwire.SFNodeNetwork) - return na, nil + + return hostToNetAddress(host, uint16(port), btcwire.SFNodeNetwork) } // Start begins the core address handler which manages a pool of known
handle .onion addresses in deserialising addrmanager. Use the generic function that already handles this.
btcsuite_btcd
train
go
bacbf62b90f1bf8dc08c6f04f9c481424cb6999e
diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index <HASH>..<HASH> 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -40,7 +40,7 @@ if dev_version is not None: version += "-dev" + str(dev_version) install_requires = [ - "astroid>=2.5.0,<=2.6", + "astroid>=2.4.0,<=2.6", "isort>=4.2.5,<6", "mccabe>=0.6,<0.7", "toml>=0.7.1",
Back to astroid <I>
PyCQA_pylint
train
py
4346e5f80284c65a40162f6508f3e63464036862
diff --git a/src/Bootstrap/Drupal.php b/src/Bootstrap/Drupal.php index <HASH>..<HASH> 100644 --- a/src/Bootstrap/Drupal.php +++ b/src/Bootstrap/Drupal.php @@ -44,12 +44,20 @@ class Drupal } try { - // Add support for Acquia Dev Desktop sites on Mac OS X - // @TODO: Check if this condition works in Windows - $devDesktopSettingsDir = getenv('HOME') . "/.acquia/DevDesktop/DrupalSettings"; - if (file_exists($devDesktopSettingsDir)) { - $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] = $devDesktopSettingsDir; + // Add support for Acquia Dev Desktop sites. + // Try both Mac and Windows home locations. + $home = getenv('HOME'); + if (empty($home)) { + $home = getenv('USERPROFILE'); } + if (!empty($home)) { + $devDesktopSettingsDir = $home . "/.acquia/DevDesktop/DrupalSettings"; + if (file_exists($devDesktopSettingsDir)) { + $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] = $devDesktopSettingsDir; + } + } + + $argvInputReader = new ArgvInputReader(); if ($debug) { $io->writeln('➤ Creating request');
Compatibility with Windows Acquia Dev Desktop (#<I>)
hechoendrupal_drupal-console
train
php
80560de2fd9d0956bb0ac5d474c47ddbf6995139
diff --git a/Kwf/Controller/Action/Media/UploadController.php b/Kwf/Controller/Action/Media/UploadController.php index <HASH>..<HASH> 100644 --- a/Kwf/Controller/Action/Media/UploadController.php +++ b/Kwf/Controller/Action/Media/UploadController.php @@ -14,6 +14,8 @@ class Kwf_Controller_Action_Media_UploadController extends Kwf_Controller_Action throw new Kwf_Exception_Client(trlKwf("No File uploaded, please select a file.")); } else if ($file['error'] == UPLOAD_ERR_PARTIAL) { throw new Kwf_Exception_Client(trlKwf("The uploaded file was only partially uploaded.")); + } else if ($file['error'] == UPLOAD_ERR_INI_SIZE) { + throw new Kwf_Exception_Client(trlKwf("The uploaded file is too large.")); } else { throw new Kwf_Exception("Upload error $file[error]"); }
Show better exception text when file upload error UPLOAD_ERR_INI_SIZE
koala-framework_koala-framework
train
php
df220007da891a9b5b7b6581de39c4b100acd8eb
diff --git a/src/addToReport.js b/src/addToReport.js index <HASH>..<HASH> 100644 --- a/src/addToReport.js +++ b/src/addToReport.js @@ -10,7 +10,7 @@ export function addToReport(pluginInstance, timelineArg) { const { timeline, invocationInstance } = pluginInstance; const entries = (timelineArg || timeline).getEntries(); const { report } = invocationInstance.report; - report.performanceEntries = (report.performanceEntries || []).concat(entries); + report.performanceEntries = [...(report.performanceEntries || []), ...entries]; } export function addHttpTracesToReport(plugin) {
Replacing .concat with faster array definition with spread operator
iopipe_iopipe-js-trace
train
js
bf3776b47a450e45a7e69792231d7aa0e87c88b0
diff --git a/lib/Predis.php b/lib/Predis.php index <HASH>..<HASH> 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -13,17 +13,13 @@ use Predis\Distribution\IDistributionStrategy; class Client { private $_options, $_profile, $_connection; - public function __construct($parameters = null, $clientOptions = null) { - $this->setupClient($clientOptions ?: new ClientOptions()); - $this->_connection = $this->initializeConnection($parameters); - } - - private function setupClient($options) { - $this->_options = $this->filterClientOptions($options); + public function __construct($parameters = null, $options = null) { + $this->_options = $this->filterOptions($options ?: new ClientOptions()); $this->_profile = $this->_options->profile; + $this->_connection = $this->initializeConnection($parameters); } - private function filterClientOptions($options) { + private function filterOptions($options) { if ($options instanceof ClientOptions) { return $options; } @@ -41,7 +37,7 @@ class Client { } private function initializeConnection($parameters = array()) { - if ($parameters === null) { + if (!isset($parameters)) { return $this->createConnection(array()); } if ($parameters instanceof IConnection) {
Improve initialization code of Predis\Client instances.
imcj_predis
train
php
7fdc9b91e12c5d624d0efdcde8a329b1b55b5080
diff --git a/spyder/widgets/variableexplorer/utils.py b/spyder/widgets/variableexplorer/utils.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/variableexplorer/utils.py +++ b/spyder/widgets/variableexplorer/utils.py @@ -421,9 +421,12 @@ def value_to_display(value, minmax=False, level=0): display = value if level > 0: display = u"'" + display + u"'" - elif (isinstance(value, NUMERIC_TYPES) or isinstance(value, bool) or - isinstance(value, datetime.date) or - isinstance(value, datetime.timedelta) or + # TODO: Implement full timedelta support in variable explorer + elif (isinstance(value, datetime.date) or + isinstance(value, datetime.date)): + display = str(value) + elif (isinstance(value, NUMERIC_TYPES) or + isinstance(value, bool) or isinstance(value, numeric_numpy_types)): display = repr(value) else:
Display date/times in human readible format in Variable Explorer
spyder-ide_spyder
train
py
470a2841a3a488c7aed2a0f6c3ed3f97bfb8a629
diff --git a/code/controller/CMSMain.php b/code/controller/CMSMain.php index <HASH>..<HASH> 100755 --- a/code/controller/CMSMain.php +++ b/code/controller/CMSMain.php @@ -243,10 +243,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $def[$class]['defaultChild'] = $obj->defaultChild(); $def[$class]['defaultParent'] = isset(SiteTree::get_by_link($obj->defaultParent())->ID) ? SiteTree::get_by_link($obj->defaultParent())->ID : null; - if(is_array($allowedChildren)) foreach($allowedChildren as $allowedChild) { - $def[$allowedChild]['allowedParents'][] = $class; - } - if($obj->stat('can_be_root')) { $def['Root']['allowedChildren'][] = $class; }
MINOR Removed redundant allowedParents information from siteTreeHints, already contained in allowedChildren
silverstripe_silverstripe-siteconfig
train
php
2b40cbc48ea3744be372672ca6b5ec92b85fdbcd
diff --git a/app/src/Bolt/Extensions.php b/app/src/Bolt/Extensions.php index <HASH>..<HASH> 100644 --- a/app/src/Bolt/Extensions.php +++ b/app/src/Bolt/Extensions.php @@ -698,7 +698,7 @@ class Extensions } // then, attempt to insert it after the last <script> tag within context, matching indentation.. - if (preg_match_all("~</script>~mi", $context, $matches)) { + if (preg_match_all("~^([ \t]*)(.*)</script>~mi", $context, $matches)) { // matches[0] has some elements, the last index is -1, because zero indexed. $last = count($matches[0]) - 1; $replacement = sprintf("%s\n%s%s", $matches[0][$last], $matches[1][$last], $tag);
Fix regex for "insertAfterJs" hook.
bolt_bolt
train
php
b75a1e0b794e6a9230735a2f4baa772d7ce83448
diff --git a/SingularityBase/src/main/java/com/hubspot/mesos/SingularityDockerInfo.java b/SingularityBase/src/main/java/com/hubspot/mesos/SingularityDockerInfo.java index <HASH>..<HASH> 100644 --- a/SingularityBase/src/main/java/com/hubspot/mesos/SingularityDockerInfo.java +++ b/SingularityBase/src/main/java/com/hubspot/mesos/SingularityDockerInfo.java @@ -31,6 +31,11 @@ public class SingularityDockerInfo { this.parameters = parameters.or(Collections.<String, String>emptyMap()); } + @Deprecated + public SingularityDockerInfo(String image, boolean privileged, SingularityDockerNetworkType network, Optional<List<SingularityDockerPortMapping>> portMappings) { + this(image, privileged, network, portMappings, Optional.<Boolean>absent(), Optional.<Map<String, String>>absent()); + } + public String getImage() { return image; }
also support old constructor, make it deprecated
HubSpot_Singularity
train
java
b984a6f2521b882f5e3d9ec493e6ceaaf4a1f3a6
diff --git a/src/SharpServiceProvider.php b/src/SharpServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/SharpServiceProvider.php +++ b/src/SharpServiceProvider.php @@ -21,7 +21,7 @@ use Code16\Sharp\Http\Middleware\SharpRedirectIfAuthenticated; use Code16\Sharp\Http\SharpContext; use Illuminate\Support\Facades\Gate; use Illuminate\Support\ServiceProvider; -use Intervention\Image\ImageServiceProviderLaravel5; +use \Intervention\Image\ImageServiceProviderLaravelRecent; class SharpServiceProvider extends ServiceProvider { @@ -88,7 +88,7 @@ class SharpServiceProvider extends ServiceProvider \Code16\Sharp\Console\ReorderHandlerMakeCommand::class, ]); - $this->app->register(ImageServiceProviderLaravel5::class); + $this->app->register(ImageServiceProviderLaravelRecent::class); } protected function registerPolicies()
Updated for compatability with intervention/image <I>
code16_sharp
train
php
455af85c0c39e621e2e21abbfa0e79dc94b3ccb3
diff --git a/bika/lims/browser/listing/ajax.py b/bika/lims/browser/listing/ajax.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/listing/ajax.py +++ b/bika/lims/browser/listing/ajax.py @@ -11,6 +11,7 @@ from bika.lims.browser.listing.decorators import returns_safe_json from bika.lims.browser.listing.decorators import set_application_json_header from bika.lims.browser.listing.decorators import translate from bika.lims.interfaces import IRoutineAnalysis +from bika.lims.interfaces import IReferenceAnalysis from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope.interface import implements from zope.publisher.interfaces import IPublishTraverse @@ -337,7 +338,11 @@ class AjaxListingView(BrowserView): def is_analysis(self, obj): """Check if the object is an analysis """ - return IRoutineAnalysis.providedBy(obj) + if IRoutineAnalysis.providedBy(obj): + return True + if IReferenceAnalysis.providedBy(obj): + return True + return False def lookup_schema_field(self, obj, fieldname): """Lookup a schema field by name
Include reference analyses in check (#<I>)
senaite_senaite.core
train
py
d9170f12f124f8b75d35acf45aa8dd05c47d9581
diff --git a/core/model/model_test.go b/core/model/model_test.go index <HASH>..<HASH> 100644 --- a/core/model/model_test.go +++ b/core/model/model_test.go @@ -36,7 +36,7 @@ func (*ModelSuite) TestValidateSeries(c *gc.C) { ctrl := gomock.NewController(c) defer ctrl.Finish() cm := NewMockCharmMeta(ctrl) - cm.EXPECT().Meta().Return(&t.meta) + cm.EXPECT().Meta().Return(&t.meta).AnyTimes() if len(t.meta.Containers) > 0 { cm.EXPECT().Manifest().Return(&charm.Manifest{ Bases: []charm.Base{
TestValidateSeries: expect Meta() more than once
juju_juju
train
go
6f194ba36413816da275c54b1c14c03383fc294b
diff --git a/ELiDE/app.py b/ELiDE/app.py index <HASH>..<HASH> 100644 --- a/ELiDE/app.py +++ b/ELiDE/app.py @@ -17,7 +17,6 @@ from kivy.uix.textinput import TextInput from kivy.factory import Factory -from .charsheet import CharSheet from .board import Board from .texturestack import ImageStack @@ -28,7 +27,6 @@ resource_add_path(ELiDE.__path__[0] + "/assets") _ = lambda x: x -Factory.register('CharSheet', cls=CharSheet) Factory.register('Board', cls=Board)
no such thing as CharSheet anymore
LogicalDash_LiSE
train
py
35080b5f1995cd3a70820d9a9d42a1b9d3ce3e4f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -67,10 +67,10 @@ setup( # Check that the pandoc-fignos script is on the PATH -if not shutil.which('pandoc-xnos'): +if not shutil.which('pandoc-fignos'): msg = """ - ERROR: `pandoc-fignos` script not found. You will need to find - the script and ensure it is on your PATH. Please file an Issue at + ERROR: `pandoc-fignos` script not found. This will need to + be corrected. If you need help, please file an Issue at https://github.com/tomduck/pandoc-fignos/issues.\n""" print(textwrap.dedent(msg)) sys.exit(-1)
Check that pandoc-fignos is on path.
tomduck_pandoc-fignos
train
py
71f80389d08e570918f19f4df59d8cbbead69374
diff --git a/lib/pg_search/document.rb b/lib/pg_search/document.rb index <HASH>..<HASH> 100644 --- a/lib/pg_search/document.rb +++ b/lib/pg_search/document.rb @@ -1,12 +1,14 @@ -require "logger" +require 'logger' module PgSearch class Document < ActiveRecord::Base include PgSearch + self.table_name = 'pg_search_documents' belongs_to :searchable, :polymorphic => true - before_validation :update_content + before_validation :update_content, + :unless => Proc.new { |doc| doc.searchable.nil? } # The logger might not have loaded yet. # https://github.com/Casecommons/pg_search/issues/26
Do a nil check, as the association may no longer be present (#<I>)
Casecommons_pg_search
train
rb
66aae47f019b9687b32e1a60e76583595257c468
diff --git a/app/inventory/completed/controller.js b/app/inventory/completed/controller.js index <HASH>..<HASH> 100644 --- a/app/inventory/completed/controller.js +++ b/app/inventory/completed/controller.js @@ -1,7 +1,4 @@ import AbstractPagedController from 'hospitalrun/controllers/abstract-paged-controller'; export default AbstractPagedController.extend({ - startKey: [], - sortProperties: ['dateCompleted'], - // Sort in descending order - sortAscending: false + startKey: [] }); \ No newline at end of file
Removed descending sort due to conflict w/paging
HospitalRun_hospitalrun-frontend
train
js
a3b62f0844d34fe4151c2df72ebbdbdae92b41af
diff --git a/tests/test_menu_launcher.py b/tests/test_menu_launcher.py index <HASH>..<HASH> 100644 --- a/tests/test_menu_launcher.py +++ b/tests/test_menu_launcher.py @@ -415,7 +415,7 @@ def test_running_menu(): child.sendline('5') child.expect('Return to Mode menu') # return to mode - child.sendline('5') + child.sendline('6') child.expect('Return to Vent menu') # return to main menu child.sendline('6')
Testing 2 for returning from configure to plugins menu.
CyberReboot_vent
train
py
039759814143e33f385294a51dad3abb88c2e4e5
diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/cache/local/OWOWCache.java b/core/src/main/java/com/orientechnologies/orient/core/storage/cache/local/OWOWCache.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/cache/local/OWOWCache.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/cache/local/OWOWCache.java @@ -605,7 +605,8 @@ public final class OWOWCache extends OAbstractWriteCache implements OWriteCache, } /** - * This method is called once new pages are added to the disk inside of {@link OWriteCache#load(long, long, OModifiableBoolean, boolean)} method. If total amount of added pages minus amount of added pages at the time of last disk + * This method is called once new pages are added to the disk inside of {@link OWriteCache#load(long, long, OModifiableBoolean, boolean)} + * lmethod. If total amount of added pages minus amount of added pages at the time of last disk * space check bigger than threshold value {@link #diskSizeCheckInterval} new disk space check is performed and if amount of space * left on disk less than threshold {@link #freeSpaceLimit} then database is switched in "read only" mode */
double write log: check style violation was fixed.
orientechnologies_orientdb
train
java
51574fa72baf0a82758902ca2623c5492573155f
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -43,7 +43,7 @@ var token; var createUser = function(user){ return new Promise(function(resolve, reject){ var options = { - url: getClusterPostServer() + "/clusterauth/user", + url: getClusterPostServer() + "/auth/user", method: 'POST', json: user, agentOptions: agentOptions @@ -62,7 +62,7 @@ var createUser = function(user){ var userLogin = function(user){ return new Promise(function(resolve, reject){ var options = { - url: getClusterPostServer() + "/clusterauth/login", + url: getClusterPostServer() + "/auth/login", method: 'POST', json: user, agentOptions: agentOptions @@ -81,7 +81,7 @@ var userLogin = function(user){ var deleteUser = function(token){ return new Promise(function(resolve, reject){ var options = { - url: getClusterPostServer() + "/clusterauth/user", + url: getClusterPostServer() + "/auth/user", method: 'DELETE', agentOptions: agentOptions, headers: { authorization: token }
BUG: Change route for user auth in test
juanprietob_clusterpost
train
js
c00a93aca0aca3e1dd6ef493cb3ef68dfbbb84b4
diff --git a/src/obj.js b/src/obj.js index <HASH>..<HASH> 100644 --- a/src/obj.js +++ b/src/obj.js @@ -66,6 +66,23 @@ constructWrapper(Object, 'obj', { return prop !== undefined; }, /** + * Checks if an object is empty + * @public + * @static + * @method obj.isEmpty + * @param {Object} obj - object tot check the void + * @returns {boolean} - boolean indicating if the object is empty + */ + isEmpty: function (obj) + { + var key; + + for (key in obj) { + return false; + } + return true; + }, + /** * Checks if an object is an primitive * @public * @static
- added isEmpty to obj
unnoon_bottom_line
train
js
3485bc12220f306663117ef521c1b2cf0283626d
diff --git a/comparators/landmark_score.js b/comparators/landmark_score.js index <HASH>..<HASH> 100644 --- a/comparators/landmark_score.js +++ b/comparators/landmark_score.js @@ -67,6 +67,7 @@ function landmark_score(newVersion, oldVersion, callback) { if (record) { result['result:landmark_score']['DBwikipedia'] = 1; + result['result:landmark_score']['score'] = record.score; } db.close(); });
Include record score in wikipedia tag involved
mapbox_osm-compare
train
js
979a121132b82b513f54b5044309c386f843ba04
diff --git a/ratelimit_test.go b/ratelimit_test.go index <HASH>..<HASH> 100644 --- a/ratelimit_test.go +++ b/ratelimit_test.go @@ -121,7 +121,7 @@ func (r *runnerImpl) afterFunc(d time.Duration, fn func()) { }) } -// goWait runs a function in a goroutine and makes sure the gouritine was scheduled. +// goWait runs a function in a goroutine and makes sure the goroutine was scheduled. func (r *runnerImpl) goWait(fn func()) { wg := sync.WaitGroup{} wg.Add(1) @@ -192,7 +192,7 @@ func TestSlack(t *testing.T) { // To simulate slack, we combine two limiters. // - First, we start a single goroutine with both of them, // during this time the slow limiter will dominate, - // and allow the fast limiter to acumulate slack. + // and allow the fast limiter to accumulate slack. // - After 2 seconds, we start another goroutine with // only the faster limiter. This will allow it to max out, // and consume all the slack.
goWait: Fix typo in comments (#<I>)
uber-go_ratelimit
train
go
dd70310d16631d1765306f5290c51c08a64417a8
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -5331,6 +5331,7 @@ const devices = [ 'genGroups', 'hvacThermostat', 'hvacUserInterfaceCfg', + 'msRelativeHumidity', 'msTemperatureMeasurement', ]; await bind(endpoint, coordinatorEndpoint, binds);
Update devices.js (#<I>) Added humidity device bind for Stelpro SMT<I> thermostat
Koenkk_zigbee-shepherd-converters
train
js
86d42af1d7ce034a5289b37dbd73380e42c2d35c
diff --git a/src/main/java/net/sf/mpxj/common/SplitTaskFactory.java b/src/main/java/net/sf/mpxj/common/SplitTaskFactory.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/sf/mpxj/common/SplitTaskFactory.java +++ b/src/main/java/net/sf/mpxj/common/SplitTaskFactory.java @@ -121,7 +121,10 @@ public final class SplitTaskFactory if (splits.size() > 2) { task.setSplits(splits); - task.setSplitCompleteDuration(splitsComplete); + if (task.getActualFinish() == null) + { + task.setSplitCompleteDuration(splitsComplete); + } } else {
Don't set complete through for completed split tasks.
joniles_mpxj
train
java
6545f4dbf41ba5f99666b365bcc5dfe445ece8e7
diff --git a/ibis/backends/pandas/execution/strings.py b/ibis/backends/pandas/execution/strings.py index <HASH>..<HASH> 100644 --- a/ibis/backends/pandas/execution/strings.py +++ b/ibis/backends/pandas/execution/strings.py @@ -237,6 +237,8 @@ def execute_group_concat_series_gb_mask( op, data, sep, mask, aggcontext=None, **kwargs ): def method(series, sep=sep): + if series.empty: + return pd.NA return sep.join(series.values.astype(str)) return aggcontext.agg(
fix(pandas): properly handle empty groups when aggregating with `GroupConcat`
ibis-project_ibis
train
py
b93370fd8566be3e2d31bb8ab309116e51126eed
diff --git a/spec/bin_spec.rb b/spec/bin_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bin_spec.rb +++ b/spec/bin_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'command line invocation' do end it 'outputs the attribution' do - expect(stdout).to match('2014-2016 Ben Balter') + expect(stdout).to match('2014-2017 Ben Balter') end it 'outputs the confidence' do
make test match updated (c) year
licensee_licensee
train
rb
f260a748a27bfbc4cf4ad882bbb3cf82e3b2c98d
diff --git a/lib/plugins/deploy/deploy.js b/lib/plugins/deploy/deploy.js index <HASH>..<HASH> 100644 --- a/lib/plugins/deploy/deploy.js +++ b/lib/plugins/deploy/deploy.js @@ -17,11 +17,9 @@ class Deploy { options: { stage: { usage: 'Stage of the service', - required: false, }, region: { usage: 'Region of the service', - required: false, }, }, }, @@ -29,4 +27,4 @@ class Deploy { } } -module.exports = Deploy; \ No newline at end of file +module.exports = Deploy;
Remove unnecessary "required: false" entries
serverless_serverless
train
js
a4812504df8c479d5065b9faaafbfeda1c9f4eb4
diff --git a/pkg/cmd/cli/cmd/deploy.go b/pkg/cmd/cli/cmd/deploy.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/cli/cmd/deploy.go +++ b/pkg/cmd/cli/cmd/deploy.go @@ -156,7 +156,8 @@ func (o *DeployOptions) Complete(f *clientcmd.Factory, args []string, out io.Wri func (o DeployOptions) Validate() error { if len(o.deploymentConfigName) == 0 { - return errors.New("a deployment config name is required.") + msg := fmt.Sprintf("a deployment config name is required.\nUse \"%s get dc\" for a list of available deployment configs.", o.baseCommandName) + return errors.New(msg) } numOptions := 0 if o.deployLatest {
Suggest `oc get dc` in output of `oc deploy` This patch suggests `<root_cmd> get dc` as part of the output in `oc deploy` in order to help a user find a list of available deployment configs. `$ oc deploy` ``` error: a deployment config name is required. Use "oc get dc" for a list of available deployment configs. See 'oc deploy -h' for help and examples. ```
openshift_origin
train
go
f994c7f8e62aaef41ffa519c588c926def9da95c
diff --git a/pyzotero/zotero.py b/pyzotero/zotero.py index <HASH>..<HASH> 100644 --- a/pyzotero/zotero.py +++ b/pyzotero/zotero.py @@ -1,5 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# pylint: disable=R0904 """ zotero.py
Disabling Pylint warning about too many public methods It's an API wrapper ffs
urschrei_pyzotero
train
py
329791418e91e063a10477876cc834ea4a3775a4
diff --git a/holoviews/plotting/mpl/tabular.py b/holoviews/plotting/mpl/tabular.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/mpl/tabular.py +++ b/holoviews/plotting/mpl/tabular.py @@ -115,7 +115,7 @@ class TablePlot(ElementPlot): for col in range(element.cols): if summarize and row > half_rows: adjusted_row = (element.rows - self.max_rows + row) - cell_value = element.pprint_cell(row, col) + cell_value = self.pprint_value(element.pprint_cell(row, col)) cellfont = self.font_types.get(element.cell_type(adjusted_row,col), None) width = self.cell_widths[col] / float(total_width) font_kwargs = dict(fontproperties=cellfont) if cellfont else {} @@ -135,7 +135,7 @@ class TablePlot(ElementPlot): table = self.handles['artist'] for coords, cell in table.get_celld().items(): - value = element.pprint_cell(*coords) + value = self.pprint_value(element.pprint_cell(*coords)) cell.set_text_props(text=value) # Resize fonts across table as necessary
Fixed missing called to self.pprint_value
pyviz_holoviews
train
py
7da2ae4c4db6f202d8ba612940a2f1f9f0eb6bb0
diff --git a/vagrant.py b/vagrant.py index <HASH>..<HASH> 100644 --- a/vagrant.py +++ b/vagrant.py @@ -382,11 +382,9 @@ class Vagrant(object): started_parsing = True if not started_parsing or not line.strip() or line.strip().startswith('#'): continue - keyval = line.strip().split(None, 1) - conf[keyval[0]] = keyval[1] - # Cleanup double quotes for IdentityFile - if conf['IdentityFile']: - conf['IdentityFile'] = conf['IdentityFile'].strip('"') + key, value = line.strip().split(None, 1) + # Remove leading and trailing " from the values + conf[key] = value.strip('"') return conf def _run_vagrant_command(self, *args):
Simplify cleaning and small fix.
todddeluca_python-vagrant
train
py
36a34b89f63cb6319d340c03234d153c0c986cd7
diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index <HASH>..<HASH> 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -2388,12 +2388,12 @@ function lti_get_shared_secrets_by_key($key) { // Look up the shared secret for the specified key in both the types_config table (for configured tools) // And in the lti resource table for ad-hoc tools. $lti13 = LTI_VERSION_1P3; - $query = "SELECT t2.value + $query = "SELECT " . $DB->sql_compare_text('t2.value', 256) . " AS value FROM {lti_types_config} t1 JOIN {lti_types_config} t2 ON t1.typeid = t2.typeid JOIN {lti_types} type ON t2.typeid = type.id WHERE t1.name = 'resourcekey' - AND t1.value = :key1 + AND " . $DB->sql_compare_text('t1.value', 256) . " = :key1 AND t2.name = 'password' AND type.state = :configured1 AND type.ltiversion <> :ltiversion
MDL-<I> mod_lti: Oracle support for retrieving shared secrets. Thanks to Mark van Hoek!
moodle_moodle
train
php
fedc253a8750b560936975efa4a11e3c69c19964
diff --git a/lib/rubycards/deck.rb b/lib/rubycards/deck.rb index <HASH>..<HASH> 100644 --- a/lib/rubycards/deck.rb +++ b/lib/rubycards/deck.rb @@ -30,7 +30,7 @@ module RubyCards # # @return [Deck] The shuffled deck def shuffle! - @cards = nil + @cards.shuffle! self end diff --git a/spec/rubycards/deck_spec.rb b/spec/rubycards/deck_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubycards/deck_spec.rb +++ b/spec/rubycards/deck_spec.rb @@ -22,6 +22,12 @@ describe Deck do deck.cards.should_not == cards_before_shuffling end + it "should should shuffle the internal cards array" do + cards_before_shuffling = deck.cards.dup + expect(deck.instance_variable_get("@cards")).to receive(:shuffle!) + deck.shuffle! + end + it 'returns itself' do should == deck.shuffle! end
Write a test that verifies the shuffle.
jdan_rubycards
train
rb,rb
34d8ce53048574e866603d947cfb03a319187577
diff --git a/src/Input.js b/src/Input.js index <HASH>..<HASH> 100644 --- a/src/Input.js +++ b/src/Input.js @@ -27,6 +27,7 @@ import {WebMidi} from "./WebMidi.js"; * @fires Input#disconnected * @fires Input#closed * @fires Input#midimessage + * * @fires Input#sysex * @fires Input#timecode * @fires Input#songposition @@ -38,6 +39,7 @@ import {WebMidi} from "./WebMidi.js"; * @fires Input#stop * @fires Input#activesensing * @fires Input#reset + * * @fires Input#unknownmidimessage * * @extends EventEmitter @@ -198,7 +200,6 @@ export class Input extends EventEmitter { */ _onMidiMessage(e) { - // Create Message object from MIDI data const message = new Message(e.data);
Cosmetic changes in jsdoc comments
djipco_webmidi
train
js
947ac5d7e26daad6082019827e73b1d535f03958
diff --git a/Shared/src/org/bimserver/shared/reflector/RealtimeReflectorFactoryBuilder.java b/Shared/src/org/bimserver/shared/reflector/RealtimeReflectorFactoryBuilder.java index <HASH>..<HASH> 100644 --- a/Shared/src/org/bimserver/shared/reflector/RealtimeReflectorFactoryBuilder.java +++ b/Shared/src/org/bimserver/shared/reflector/RealtimeReflectorFactoryBuilder.java @@ -38,7 +38,7 @@ public class RealtimeReflectorFactoryBuilder implements ReflectorFactoryBuilder private static final Logger LOGGER = LoggerFactory.getLogger(RealtimeReflectorFactoryBuilder.class); private SServicesMap servicesMap; private ClassPool pool; - private static int implementationCounter = 0; + private static volatile int implementationCounter = 0; private static final String GENERATED_CLASSES_PACKAGE = "org.bimserver.generated"; public RealtimeReflectorFactoryBuilder(SServicesMap servicesMap) {
Made volatile because of javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of org/apache/catalina/loader/WebappClassLoader): attempted duplicate class definition for name: "org/bimserver/generated/LowLevelInterfaceImpl3"
opensourceBIM_BIMserver
train
java
102bb3d397bd6e6d32848b3a5e4dda91970954fb
diff --git a/lib/ma-zmq/reply.rb b/lib/ma-zmq/reply.rb index <HASH>..<HASH> 100644 --- a/lib/ma-zmq/reply.rb +++ b/lib/ma-zmq/reply.rb @@ -1,11 +1,34 @@ module MaZMQ class Reply < MaZMQ::SocketHandler - # mergear con RoundRobin - #socket_type ZMQ::REP + attr_reader :state def initialize(use_eventmachine=true) @socket_type = ZMQ::REP super(use_eventmachine) end + + def recv_string + case @state + when :idle + msg = super + if msg and not msg.empty? + @state = :reply + end + return msg + else + return false + end + end + + def send_string(msg) + case @state + when :reply + resp = super(msg) + @state = :idle + return resp + else + return false + end + end end end
Added @state on Reply object
al-nattahnam_ma-zmq
train
rb
2c30d5757a8d07e4dcae6bd59a4021a8e365e207
diff --git a/bot/action/extra/messages/analyzer.py b/bot/action/extra/messages/analyzer.py index <HASH>..<HASH> 100644 --- a/bot/action/extra/messages/analyzer.py +++ b/bot/action/extra/messages/analyzer.py @@ -145,8 +145,12 @@ class TextMessageAnalyzer(MessageAnalyzer): class PhotoMessageAnalyzer(MessageAnalyzer): def _get_summary(self): - # todo add caption if present? - return FormattedText().bold("🌅 Photo") + summary = FormattedText().bold("🌅 Photo") + caption = self.last_message.caption + if caption: + summarized_caption = TextSummarizer.summarize(caption, max_number_of_characters=9) + summary.normal(" [ ").italic(summarized_caption).normal(" ]") + return summary def get_full_content(self): pass
Add caption if present in photo summary
alvarogzp_telegram-bot-framework
train
py
21e89df897dcdaa8389dc528cf3cbcef8daa08c5
diff --git a/gitpress/__init__.py b/gitpress/__init__.py index <HASH>..<HASH> 100644 --- a/gitpress/__init__.py +++ b/gitpress/__init__.py @@ -13,4 +13,3 @@ __version__ = '0.2' from . import command from .runner import run -from .server import preview
Expose nothing in API until needed or documented.
joeyespo_gitpress
train
py
dca452f0ed773557f5a5013cd77f76edfcbbb74e
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -125,12 +125,7 @@ def _do_download(version, download_base, to_dir, download_delay): # Remove previously-imported pkg_resources if present (see # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details). if 'pkg_resources' in sys.modules: - del_modules = [ - name for name in sys.modules - if name.startswith('pkg_resources') - ] - for mod_name in del_modules: - del sys.modules[mod_name] + _unload_pkg_resources() import setuptools setuptools.bootstrap_install_from = egg
Uses an existing method to delete pkg_resources
pypa_setuptools
train
py
61c62e12fe33027bb282b9645be723320e749587
diff --git a/src/actions/SmartDeleteAction.php b/src/actions/SmartDeleteAction.php index <HASH>..<HASH> 100644 --- a/src/actions/SmartDeleteAction.php +++ b/src/actions/SmartDeleteAction.php @@ -22,4 +22,13 @@ class SmartDeleteAction extends SmartPerformAction ], ], 'first'); } + + public function loadCollection($data = null) + { + // Fixes delete buttons in GridView. + // When button in being pressed, the system submits POST request which contains + // POST model ClassSearch and GET attribute with ID + $data = Yii::$app->request->get() ? [Yii::$app->request->get()] : null; + parent::loadCollection($data); + } }
SmartDeleteAction now accepts data from GET valiables in POST request
hiqdev_hipanel-core
train
php
58bf52d8ba052fd4f3b51c821badc17327ce60b5
diff --git a/tests/dummy/config/deprecation-workflow.js b/tests/dummy/config/deprecation-workflow.js index <HASH>..<HASH> 100644 --- a/tests/dummy/config/deprecation-workflow.js +++ b/tests/dummy/config/deprecation-workflow.js @@ -12,5 +12,10 @@ window.deprecationWorkflow.config = { { handler: 'silence', matchId: 'common.user-performs-non-learner-function' }, { handler: 'silence', matchId: 'common.curriculum-inventory-report-is-finalized' }, { handler: 'silence', matchId: 'ember-modifier.use-destroyables' }, //https://github.com/zeppelin/ember-click-outside + { handler: 'silence', matchId: 'ember-polyfills.deprecate-assign' }, + { handler: 'silence', matchId: 'ember-modifier.use-modify' }, + { handler: 'silence', matchId: 'ember-modifier.no-args-property' }, + { handler: 'silence', matchId: 'ember-modifier.no-element-property' }, + { handler: 'silence', matchId: 'ember-modifier.function-based-options' }, ], };
Silence new ember deprecations Some of these are in Ember 4, others are from modifiers, but are very noisy.
ilios_common
train
js
8fa9960e95eac3d711c4367bbd9c02686f56f8ec
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 @@ -6,4 +6,3 @@ include Celerity::Exception java.lang.System.setProperty("java.awt.headless", "true") WatirSpec.browser_args = [{ :log_level => $DEBUG ? :all : :off }] -WatirSpec::Server.get("/my_route") { "content" } \ No newline at end of file
Remove example route from spec_helper
jarib_celerity
train
rb
9f3019fd4337337bcbc6b327f13e596d687bd9f5
diff --git a/lib/class-wp-json-server.php b/lib/class-wp-json-server.php index <HASH>..<HASH> 100644 --- a/lib/class-wp-json-server.php +++ b/lib/class-wp-json-server.php @@ -245,7 +245,7 @@ class WP_JSON_Server { * @param WP_JSON_Response $result * @param WP_JSON_Request $request */ - $result = apply_filters( 'json_post_dispatch', json_ensure_response( $result ), $request ); + $result = apply_filters( 'json_post_dispatch', json_ensure_response( $result ), $this, $request ); // Wrap the response in an envelope if asked for if ( isset( $_GET['_envelope'] ) ) {
Make json_pre_dispatch and json_post_dispatch consistent Currentlt `json_post_dispatch` passes the response data and the request object, whereas the `json_pre_dispatch` passes the response data (null), the server and the request object. These filters should be consistent.
WP-API_WP-API
train
php
17c35413138beddc1718a8593ab5149537cba0d5
diff --git a/src/defaults.js b/src/defaults.js index <HASH>..<HASH> 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -2,9 +2,13 @@ import parsers from './parse/parsers'; const defaults = { beautifier: { - indent_size: 1, - indent_char: ' ', - indent_with_tabs: true + indent_size: 2, + indent_char: ' ', + indent_with_tabs: false, + unformatted: + `a abbr acronym address b bdo big cite code col del dfn dt em font + h1 h2 h3 h4 h5 h6 i img ins kbd mark pre q s samp small span + strike strong sub sup tt u var`.split(' ') }, debug: { logFn: console.log
Match HTML beautifier config with what has been used recently on another project
cloudfour_drizzle-builder
train
js
985dc4edaa01614d77cc5b0bbca6772ab622f56c
diff --git a/lib/rack/stream/app.rb b/lib/rack/stream/app.rb index <HASH>..<HASH> 100644 --- a/lib/rack/stream/app.rb +++ b/lib/rack/stream/app.rb @@ -89,6 +89,14 @@ module Rack run_callbacks(:open) { @status, @headers, app_body = @app.call(@env) + app_body = if app_body.respond_to?(:body_parts) + app_body.body_parts + elsif app_body.respond_to?(:body) + app_body.body + else + app_body + end + chunk(*app_body) # chunk any downstream response bodies after_open {close} if @callbacks[:after_open].empty?
add compatibility with Rail's ActionDispatch::Response bodies
jch_rack-stream
train
rb
cb328caca6287c7995ee5285c6446bffd4ef496b
diff --git a/handler/oauth2/validator.go b/handler/oauth2/validator.go index <HASH>..<HASH> 100644 --- a/handler/oauth2/validator.go +++ b/handler/oauth2/validator.go @@ -1,8 +1,6 @@ package oauth2 import ( - "fmt" - "github.com/ory-am/fosite" "github.com/pkg/errors" "golang.org/x/net/context" @@ -31,10 +29,8 @@ func (c *CoreValidator) validateAccessToken(ctx context.Context, token string, a sig := c.CoreStrategy.AccessTokenSignature(token) or, err := c.CoreStorage.GetAccessTokenSession(ctx, sig, accessRequest.GetSession()) if err != nil { - fmt.Printf("%s", err) return errors.Wrap(fosite.ErrRequestUnauthorized, err.Error()) } else if err := c.CoreStrategy.ValidateAccessToken(ctx, or, token); err != nil { - fmt.Printf("%s", err) return errors.Wrap(fosite.ErrRequestUnauthorized, err.Error()) }
validator: removed unnecessary logging (#<I>)
ory_fosite
train
go
c9c9fc4adfd3f81f0f0e0dd32cc0e3d4dabe24eb
diff --git a/spec/gibbon/api_request_spec.rb b/spec/gibbon/api_request_spec.rb index <HASH>..<HASH> 100644 --- a/spec/gibbon/api_request_spec.rb +++ b/spec/gibbon/api_request_spec.rb @@ -60,12 +60,6 @@ describe Gibbon::APIRequest do end end - context 'Faraday::Error::ClientError' do - let(:error_class) { Faraday::Error::ClientError } - - include_examples 'client error handling' - end - context 'Faraday::ClientError' do let(:error_class) { Faraday::ClientError }
test: remove failing deprecated suite
amro_gibbon
train
rb
5160b54aef6ec76f50148a925ddb2674f9a7d1fd
diff --git a/tests/test_git.py b/tests/test_git.py index <HASH>..<HASH> 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -10,6 +10,7 @@ from waliki.git import Git from waliki.settings import WALIKI_DATA_DIR, WALIKI_COMMITTER_EMAIL, WALIKI_COMMITTER_NAME from .factories import PageFactory +git = git.bake("--no-pager", _tty_out=False) class TestGit(TestCase): diff --git a/waliki/git/__init__.py b/waliki/git/__init__.py index <HASH>..<HASH> 100644 --- a/waliki/git/__init__.py +++ b/waliki/git/__init__.py @@ -10,7 +10,7 @@ from sh import git, ErrorReturnCode, Command from collections import namedtuple -git = git.bake("--no-pager") +git = git.bake("--no-pager", _tty_out=False) Commit = namedtuple('Commit', ['hash', 'author_name', 'author_email', 'subject', 'date', 'date_relative', 'paths', 'diff'])
Run git with output to pipe instead of virtual terminal. Default SELinux policy (at least, on Fedora) doesn't allow processes running from Apache HTTP server to create virtual terminals. By default, sh Python module runs processes with output to virtual terminal. This is not needed for git, so it's better to explicitly make it write its output to a pipe instead of virtual terminal. Also, "--no-pager" option and output through a pipe added to git tests.
mgaitan_waliki
train
py,py
8df68d0fb6f7ebab9541fda0bf806f9d54bff02b
diff --git a/src/libs/Api.php b/src/libs/Api.php index <HASH>..<HASH> 100644 --- a/src/libs/Api.php +++ b/src/libs/Api.php @@ -201,9 +201,6 @@ class Api $modelObj = new $modelClass($route->getQueryParams('model_id')); - if (!$modelObj->can('edit', $this->app['user'])) - return false; - return $modelObj->set($route->getQueryParams('properties')); } @@ -213,9 +210,6 @@ class Api $modelObj = new $modelClass($route->getQueryParams('model_id')); - if (!$modelObj->can('delete', $this->app['user'])) - return false; - return $modelObj->delete(); }
remove advance model permissions check when editing or deleting
infusephp_rest-api
train
php
1758b1dc68fb3d393c95ad7a0ea7deb514a4a0dc
diff --git a/lib/linner.rb b/lib/linner.rb index <HASH>..<HASH> 100644 --- a/lib/linner.rb +++ b/lib/linner.rb @@ -95,12 +95,12 @@ private end def revision + dump_manifest return unless File.exist?(rev = File.join(env.public_folder, env.revision.to_s)) doc = Nokogiri::HTML.parse(File.read rev) replace_tag_with_manifest_value doc, "script", "src" replace_tag_with_manifest_value doc, "link", "href" File.open(rev, "w") {|f| f.write doc.to_html} - dump_manifest end private
dump manifest first, next if didn't exsit revision file
SaitoWu_linner
train
rb
36079e3fa54cd845739db9c8e30f5d4d3c3fe9ab
diff --git a/src/test/java/io/vlingo/actors/plugin/mailbox/concurrentqueue/ExecutorDispatcherTest.java b/src/test/java/io/vlingo/actors/plugin/mailbox/concurrentqueue/ExecutorDispatcherTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/vlingo/actors/plugin/mailbox/concurrentqueue/ExecutorDispatcherTest.java +++ b/src/test/java/io/vlingo/actors/plugin/mailbox/concurrentqueue/ExecutorDispatcherTest.java @@ -38,7 +38,7 @@ public class ExecutorDispatcherTest extends ActorsTest { @Test public void testClose() { - final TestResults testResults = new TestResults(3, true); + final TestResults testResults = new TestResults(3, false); final TestMailbox mailbox = new TestMailbox(testResults, world.defaultLogger()); @@ -71,7 +71,7 @@ public class ExecutorDispatcherTest extends ActorsTest { @Test public void testExecute() { - final TestResults testResults = new TestResults(Total, true); + final TestResults testResults = new TestResults(Total, false); final TestMailbox mailbox = new TestMailbox(testResults, world.defaultLogger());
Disable excessive logs in test.
vlingo_vlingo-actors
train
java
53e9eaa5e438e721da1b8fd3cb06aa1248442879
diff --git a/lib/Pico.php b/lib/Pico.php index <HASH>..<HASH> 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -965,7 +965,8 @@ class Pico // use REQUEST_URI (requires URL rewriting); e.g. /pico/sub/page if (($this->requestUrl === null) && $this->isUrlRewritingEnabled()) { - $basePath = dirname($_SERVER['SCRIPT_NAME']) . '/'; + $basePath = dirname($_SERVER['SCRIPT_NAME']); + $basePath = !in_array($basePath, array('.', '/')) ? $basePath . '/' : '/'; $basePathLength = strlen($basePath); $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
Fix Pico's REQUEST_URI routing method when installed to /
picocms_Pico
train
php
a412e662e577276f8e23662a2992b1dba78f0272
diff --git a/Event/Log/LogWorkspaceRoleChangeRightEvent.php b/Event/Log/LogWorkspaceRoleChangeRightEvent.php index <HASH>..<HASH> 100644 --- a/Event/Log/LogWorkspaceRoleChangeRightEvent.php +++ b/Event/Log/LogWorkspaceRoleChangeRightEvent.php @@ -139,9 +139,8 @@ class LogWorkspaceRoleChangeRightEvent extends LogGenericEvent implements Mandat */ public function isAllowedToNotify() { - if (!$this->changeSet || !isset($this->changeSet['mask'])) { - return false; - } + if (!$this->changeSet || !isset($this->changeSet['mask'])) return false; + if ($this->role->getName() === 'ROLE_ANONYMOUS' || $this->role->getName() === 'ROLE_USER') return false; $oldState = $this->changeSet['mask'][0]; $newState = $this->changeSet['mask'][1];
No notification on resource for ROLE_ANONYMOUS and ROLE_USER
claroline_CoreBundle
train
php
9ea306aa1b5c7b93d3256902e57fb5898bab5144
diff --git a/ssllabs-scan.go b/ssllabs-scan.go index <HASH>..<HASH> 100644 --- a/ssllabs-scan.go +++ b/ssllabs-scan.go @@ -17,6 +17,7 @@ package main +import "crypto/tls" import "encoding/json" import "flag" import "fmt" @@ -489,7 +490,12 @@ func (manager *Manager) startAssessment(h string) { } func (manager *Manager) run() { - httpClient = &http.Client{} + // XXX Allow self-signed certificates for now. Will be removed in the final version. + transport := &http.Transport{ + TLSClientConfig: &tls.Config { InsecureSkipVerify: true }, + } + + httpClient = &http.Client { Transport: transport } // Ping SSL Labs to determine how many concurrent // assessments we're allowed to use. Print the API version
Temporarily allow self-signed certificates.
ssllabs_ssllabs-scan
train
go
89ab80d868bc733403c327f949515a6515e36170
diff --git a/health_check/storage/backends.py b/health_check/storage/backends.py index <HASH>..<HASH> 100644 --- a/health_check/storage/backends.py +++ b/health_check/storage/backends.py @@ -3,7 +3,6 @@ import uuid from django.conf import settings from django.core.files.base import ContentFile from django.core.files.storage import get_storage_class -from django.utils.six import string_types from health_check.backends import BaseHealthCheckBackend from health_check.exceptions import ServiceUnavailable @@ -26,7 +25,7 @@ class StorageHealthCheck(BaseHealthCheckBackend): storage = None def get_storage(self): - if isinstance(self.storage, string_types): + if isinstance(self.storage, str): return get_storage_class(self.storage)() else: return self.storage
storage: Remove usage of django.utils.six
KristianOellegaard_django-health-check
train
py
a575e2a311776547b606168fbd4e9316d268ab69
diff --git a/libs/linkBankOperations.js b/libs/linkBankOperations.js index <HASH>..<HASH> 100644 --- a/libs/linkBankOperations.js +++ b/libs/linkBankOperations.js @@ -172,6 +172,9 @@ class Linker { */ linkBillsToOperations (bills, options) { const result = {} + + bills = bills.filter(bill => !bill.isThirdPartyPayer === true) + return bluebird.each(bills, bill => { const res = result[bill._id] = {matching: [], reimbursed: []} // Get all operations whose date is close to out bill
feat: linkBankOperations: ignore third party bills
konnectors_libs
train
js
42dcde2121f8d090381608fe030fa3041b5059ef
diff --git a/marklogic-sesame-functionaltests/src/test/java/com/marklogic/sesame/functionaltests/MarkLogicRepositoryConnectionTest.java b/marklogic-sesame-functionaltests/src/test/java/com/marklogic/sesame/functionaltests/MarkLogicRepositoryConnectionTest.java index <HASH>..<HASH> 100644 --- a/marklogic-sesame-functionaltests/src/test/java/com/marklogic/sesame/functionaltests/MarkLogicRepositoryConnectionTest.java +++ b/marklogic-sesame-functionaltests/src/test/java/com/marklogic/sesame/functionaltests/MarkLogicRepositoryConnectionTest.java @@ -2191,16 +2191,15 @@ public class MarkLogicRepositoryConnectionTest extends ConnectedRESTQA { } testAdminCon.remove(stmt, dirgraph); testAdminCon.close(); - + try{ testAdminCon.hasStatement(stmt, false, dirgraph); fail("Should not be able to run statements on testAdminCon"); } catch(Exception e){ - Assert.assertTrue(e instanceof IllegalStateException); + Assert.assertTrue(e instanceof RepositoryException); } - try{ testAdminCon.add(stmt); fail("Adding triples after close should not be allowed");
fix functional test, should fail with RepositoryException
marklogic_marklogic-sesame
train
java
9f85c55444362d631896477dbfb4f6336745d39a
diff --git a/ledgerautosync/ledger.py b/ledgerautosync/ledger.py index <HASH>..<HASH> 100644 --- a/ledgerautosync/ledger.py +++ b/ledgerautosync/ledger.py @@ -142,4 +142,7 @@ class HLedger(object): cmd = ["reg", "-w200", "desc:%s"%(payee)] lines = self.run(cmd).splitlines() accts = [ l[92:172].strip() for l in lines ] - return all_or_none([ a for a in accts if a != exclude ]) + if accts and accts[-1] != exclude: + return accts[-1] + else: + return None
hledger: if we find many accounts, use the last
egh_ledger-autosync
train
py
56956a84aafaff472dcb06250c4728f7f6864d39
diff --git a/framework/core/views/index.blade.php b/framework/core/views/index.blade.php index <HASH>..<HASH> 100644 --- a/framework/core/views/index.blade.php +++ b/framework/core/views/index.blade.php @@ -8,7 +8,7 @@ $url = app('Flarum\Forum\UrlGenerator'); @foreach ($document->data as $discussion) <li> <a href="{{ $url->toRoute('discussion', [ - 'id' => $discussion->id . '-' . $discussion->attributes->title + 'id' => $discussion->id . '-' . $discussion->attributes->slug ]) }}"> {{ $discussion->attributes->title }} </a>
Use stored slug for generating server-rendered link to discussion Fixes #<I>.
flarum_core
train
php
72ed33a8039fadc549bc775f88aeae042f93b75c
diff --git a/lib/bond/mission.rb b/lib/bond/mission.rb index <HASH>..<HASH> 100644 --- a/lib/bond/mission.rb +++ b/lib/bond/mission.rb @@ -68,7 +68,7 @@ module Bond @matched = @input = @list_prefix = nil if (match = handle_valid_match(input)) @input.instance_variable_set("@matched", @matched) - @input.instance_eval("def self.matched; @matched ; end") + class<<@input; def matched; @matched; end; end end !!match end
fixed invalid instance_eval in <I>
cldwalker_bond
train
rb
8dfb2f5c1035da0cfb46a6d60ff0f6c63c2df3b6
diff --git a/src/apps/rings.js b/src/apps/rings.js index <HASH>..<HASH> 100644 --- a/src/apps/rings.js +++ b/src/apps/rings.js @@ -260,7 +260,7 @@ d3plus.apps.rings.draw = function(vars) { if (domain[0] == domain[1]) { domain[0] = 0 } - + var radius = d3.scale.linear() .domain(domain) .range([3,d3.min([primaryMax,secondaryMax])]) @@ -284,7 +284,7 @@ d3plus.apps.rings.draw = function(vars) { primaries.forEach(function(p,i){ p.d3plus.ring = 1 - var val = vars.size.key ? d3plus.variable.value(vars,s,vars.size.key) : 1 + var val = vars.size.key ? d3plus.variable.value(vars,p,vars.size.key) : 1 p.d3plus.r = radius(val) var check = [vars.edges.source,vars.edges.target]
quickfix for primary Rings node sizing
alexandersimoes_d3plus
train
js
9dce6d0314663a56710abc8fcbb70351ed898b2c
diff --git a/src/main/java/hex/NeuralNet.java b/src/main/java/hex/NeuralNet.java index <HASH>..<HASH> 100644 --- a/src/main/java/hex/NeuralNet.java +++ b/src/main/java/hex/NeuralNet.java @@ -780,7 +780,7 @@ public class NeuralNet extends ValidatedJob { float[] valid_samples = new float[validation_errors.length]; for (int i=0; i<valid_err.length; ++i) { valid_err[i] = (float)validation_errors[i].classification; - valid_samples[i] = training_errors[i].training_samples; + valid_samples[i] = validation_errors[i].training_samples; } new D3Plot(valid_samples, valid_err, "training samples", "classification error", "Classification Error on Validation Set").generate(sb);
Fix: Use the number of training points at the time the validation error was computed for the validation error plot.
h2oai_h2o-2
train
java
2f1ca0ffd55a994638175b909e4ce8878a32aaf2
diff --git a/Mixtape/subset_featurizer.py b/Mixtape/subset_featurizer.py index <HASH>..<HASH> 100644 --- a/Mixtape/subset_featurizer.py +++ b/Mixtape/subset_featurizer.py @@ -246,7 +246,19 @@ class SubsetFeatureUnion(TrajFeatureUnion): @property def n_max_i(self): - return [featurizer.n_max for (_, featurizer) in self.transformer_list] + return np.array([featurizer.n_max for (_, featurizer) in self.transformer_list]) + + @property + def n_features_i(self): + return np.array([featurizer.n_features for (_, featurizer) in self.transformer_list]) + + @property + def n_featurizers(self): + return len(self.transformer_list) + + @property + def n_max(self): + return np.sum([featurizer.n_max for (_, featurizer) in self.transformer_list]) @property def n_features(self):
More helper functions on subset union
msmbuilder_msmbuilder
train
py
eca9743ab00f719f6c8619143af729765257f4fb
diff --git a/lib/alfred/task_manager.rb b/lib/alfred/task_manager.rb index <HASH>..<HASH> 100644 --- a/lib/alfred/task_manager.rb +++ b/lib/alfred/task_manager.rb @@ -12,7 +12,7 @@ module Alfred def self.load_tasks task_dirs.each do |dir| - Dir[dir + '/lib/tasks/**_task.rb'].each { |task_file| load(task_file) } + Dir[dir + '/lib/tasks/**/*_task.rb'].each { |task_file| load(task_file) } end end
Fix TaskManager.load_tasks so the tasks in namespaces are also loaded.
anvil-src_anvil-core
train
rb
09a5ea8ba165a071b4439ae675563856616ceb01
diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index <HASH>..<HASH> 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -305,6 +305,13 @@ Blockchain.prototype.isClientInstalled = function (callback) { if (err || !stdout || stderr.indexOf("not found") >= 0 || stdout.indexOf("not found") >= 0) { return callback(__('Ethereum client bin not found:') + ' ' + this.client.getBinaryPath()); } + const parsedVersion = this.client.parseVersion(stdout); + const supported = this.client.isSupportedVersion(parsedVersion); + if (supported === undefined) { + this.logger.error((__('WARNING! Ethereum client version could not be determined or compared with version range') + ' ' + this.client.versSupported + __(', for best results please use a supported version')).yellow); + } else if (!supported) { + this.logger.error((__('WARNING! Ethereum client version unsupported, for best results please use a version in range') + ' ' + this.client.versSupported).yellow); + } callback(); }); };
test if client version is supported, warn if not or can't determine
embark-framework_embark
train
js
c9098d44250491c57d200d59067de247639eddb7
diff --git a/cartoframes/viz/source.py b/cartoframes/viz/source.py index <HASH>..<HASH> 100644 --- a/cartoframes/viz/source.py +++ b/cartoframes/viz/source.py @@ -79,14 +79,17 @@ class Source: raise ValueError('Wrong source input. Valid values are str and DataFrame.') def get_credentials(self): - if self.credentials: - return { - # CARTO VL requires a username but CARTOframes allows passing only the base_url. - # That's why 'user' is used by default if username is empty. - 'username': self.credentials.username or 'user', - 'api_key': self.credentials.api_key, - 'base_url': self.credentials.base_url - } + if self.type == SourceType.QUERY: + if self.credentials: + return { + # CARTO VL requires a username but CARTOframes allows passing only the base_url. + # That's why 'user' is used by default if username is empty. + 'username': self.credentials.username or 'user', + 'api_key': self.credentials.api_key, + 'base_url': self.credentials.base_url + } + elif self.type == SourceType.GEOJSON: + return None def set_datetime_columns(self): if self.type == SourceType.GEOJSON:
Return Credentials only for Query Sources
CartoDB_cartoframes
train
py
437e5b731feb5f5b0e7205ff94d15c07c32e83a4
diff --git a/command/upload.py b/command/upload.py index <HASH>..<HASH> 100644 --- a/command/upload.py +++ b/command/upload.py @@ -186,7 +186,7 @@ class upload(PyPIRCCommand): http.putheader('Authorization', auth) http.endheaders() http.send(body) - except socket.error as e: + except OSError as e: self.announce(str(e), log.ERROR) return
Issue #<I>: get rid of socket.error, replace with OSError
pypa_setuptools
train
py
edb967fa1baecf26888171f1af3f6dd0089b77da
diff --git a/src/Codeception/Module/Laravel4.php b/src/Codeception/Module/Laravel4.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/Laravel4.php +++ b/src/Codeception/Module/Laravel4.php @@ -52,13 +52,13 @@ class Laravel4 extends \Codeception\Util\Framework implements \Codeception\Util\ protected $config = array( 'cleanup' => true, - 'start' => 'bootstrap/start.php' + 'start' => 'bootstrap' . DIRECTORY_SEPARATOR . 'start.php' ); public function _initialize() { $projectDir = \Codeception\Configuration::projectDir(); - require $projectDir . '/vendor/autoload.php'; + require $projectDir . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; \Illuminate\Support\ClassLoader::register();
fixed the laravel 4 module so that it doesn't make assumptions about a directory separator.
Codeception_base
train
php
ee7f008ff54ea9b5f81589af8e47b39f3216b619
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -158,7 +158,7 @@ if command.startswith('install') or \ ) check_external_program( program='unpaper', - need_version='0.4.2', + need_version='6.1', package='unpaper', optional=True )
Require unpaper <I>; no messing around with broken versions
jbarlow83_OCRmyPDF
train
py
fe51d4c4c82821ccca3914b299074f7aa291e97d
diff --git a/lib/einhorn.rb b/lib/einhorn.rb index <HASH>..<HASH> 100644 --- a/lib/einhorn.rb +++ b/lib/einhorn.rb @@ -148,6 +148,7 @@ module Einhorn def self.bind(addr, port, flags) log_info("Binding to #{addr}:#{port} with flags #{flags.inspect}") sd = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) + Einhorn::Compat.cloexec!(sd, false) if flags.include?('r') || flags.include?('so_reuseaddr') sd.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)
Make sure sockets we open aren't cloexec
stripe_einhorn
train
rb
66cee3efb8e1c9e4dfab6ca33f4534023909fbf6
diff --git a/react-native/react/constants/platform.native.desktop.js b/react-native/react/constants/platform.native.desktop.js index <HASH>..<HASH> 100644 --- a/react-native/react/constants/platform.native.desktop.js +++ b/react-native/react/constants/platform.native.desktop.js @@ -18,6 +18,10 @@ function findSocketRoot () { 'linux': `${process.env.XDG_RUNTIME_DIR}/keybase.${runMode}/` } + if (runMode === 'prod') { + paths['linux'] = `${process.env.XDG_RUNTIME_DIR}/keybase/` + } + return paths[process.platform] }
Support prod runmode on Linux (On Linux the service doesn't append .prod if it's prod, for some reason.)
keybase_client
train
js
8a9a62e1e9eeb3c6b2537df804d3c8991515cbc1
diff --git a/client/state/push-notifications/actions.js b/client/state/push-notifications/actions.js index <HASH>..<HASH> 100644 --- a/client/state/push-notifications/actions.js +++ b/client/state/push-notifications/actions.js @@ -43,6 +43,9 @@ import { recordTracksEvent, bumpStat } from 'state/analytics/actions'; +import { + isSupportUserSession, +} from 'lib/user/support-user-interop'; const debug = debugFactory( 'calypso:push-notifications' ); const DAYS_BEFORE_FORCING_REGISTRATION_REFRESH = 15; @@ -52,6 +55,12 @@ const serviceWorkerOptions = { export function init() { return dispatch => { + if ( isSupportUserSession() ) { + debug( 'Push Notifications are not supported when SU is active' ); + dispatch( apiNotReady() ); + return; + } + // Only continue if the service worker supports notifications if ( ! isPushNotificationsSupported() ) { debug( 'Push Notifications are not supported' );
Do not init PN support if SU is active
Automattic_wp-calypso
train
js
82546bb6918ee8fe94d27466d1a3d287d382660c
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100755 --- a/src/Config.php +++ b/src/Config.php @@ -46,7 +46,7 @@ { foreach ($data as $key => $value) { - list($head, $tail) = explode("_", strtolower($key), 2); + list($head, $tail) = array_pad(explode("_", strtolower($key), 2), 2, null); if ($tail == "") { @@ -82,7 +82,7 @@ else { $info = $this->inflate($this->getByPrefix(strtoupper($type) . "_")); - $result = $info[$type]; + $result = $info[$type] ?? (object)[]; } return $result;
Catch issues when inflating config
irwtdvoys_bolt-core
train
php
addac2734d5f7e5c11707ddff36920cfb8f58b64
diff --git a/src/runSymfonyCommands.php b/src/runSymfonyCommands.php index <HASH>..<HASH> 100755 --- a/src/runSymfonyCommands.php +++ b/src/runSymfonyCommands.php @@ -5,6 +5,7 @@ namespace CubeTools\CubeCommonDevelop; $_mainFile = !\debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); if ($_mainFile) { + require_once __DIR__.'/SymfonyCommands.php'; $r = SymfonyCommands::initCommands(); echo $r; }
[general] fix runSymfonyCommands, runs successfully now
EmchBerger_cube-common-develop
train
php
7d1835ee986cb48d8bdc22ae87e7d90bdbfe1930
diff --git a/lib/fog/storage.rb b/lib/fog/storage.rb index <HASH>..<HASH> 100644 --- a/lib/fog/storage.rb +++ b/lib/fog/storage.rb @@ -1,4 +1,9 @@ -require "mime/types" +begin + # Use mime/types/columnar if available, for reduced memory usage + require 'mime/types/columnar' +rescue LoadError + require 'mime/types' +end module Fog module Storage
Decrease Fog Memory footprint Mail <I>+ has a columnar store that only loads the data that is needed for a drastically reduced memory footprint. cc/ @jeremyevans @halostatue
fog_fog-core
train
rb
fb3a6cf5e2f08efdf05447cf1c753bf10384defc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( 'pillow', 'python-magic', 'requests', 'nltk'], packages=find_packages(exclude=['pliers/tests']), license='MIT', - package_data={'pliers': ['data/*'], + package_data={'pliers': ['datasets/*'], 'pliers.tests': ['data/*/*'] }, download_url='https://github.com/tyarkoni/pliers/archive/%s.tar.gz' %
Added datasets to package_data
tyarkoni_pliers
train
py
bd8f7b98808185434b2358143ca1766641da4396
diff --git a/lib/ruby-lint/virtual_machine.rb b/lib/ruby-lint/virtual_machine.rb index <HASH>..<HASH> 100644 --- a/lib/ruby-lint/virtual_machine.rb +++ b/lib/ruby-lint/virtual_machine.rb @@ -304,15 +304,23 @@ module RubyLint name = SEND_MAPPING.fetch(name, name) callback = "on_send_#{name}" + value_stack.add_stack + execute_callback(callback, node) end def after_send(node) - name = node.children[1].to_s - name = SEND_MAPPING.fetch(name, name) - callback = "after_send_#{name}" + name = node.children[1].to_s + mapped_name = SEND_MAPPING.fetch(name, name) + callback = "after_send_#{mapped_name}" execute_callback(callback, node) + + context, _ = value_stack.pop + context = current_scope unless context + retval = context.call(name) + + push_value(retval) end def on_send_include(node)
Re-introduced basic method call evaluation.
YorickPeterse_ruby-lint
train
rb
1d8ea2ce35f5a242f0e5c2564736c4fcc73b1eb8
diff --git a/extended-cpts.php b/extended-cpts.php index <HASH>..<HASH> 100644 --- a/extended-cpts.php +++ b/extended-cpts.php @@ -895,7 +895,7 @@ class Extended_CPT_Admin { $num = number_format_i18n( $count->publish ); # This is absolutely not localisable. WordPress 3.8 didn't add a new post type label. - $text = '<span class="page-count"><a href="edit.php?post_type=' . $this->cpt->post_type . '">' . $num . ' ' . $text . '</a></span>'; + $text = '<a href="edit.php?post_type=' . $this->cpt->post_type . '">' . $num . ' ' . $text . '</a>'; # Go! $items[] = $text;
Update the 'At a Glance' code for WordPress <I>
johnbillion_extended-cpts
train
php
2a6353c18db5bbff846d505ad9093fe77251e57f
diff --git a/test/components/loader_spec.js b/test/components/loader_spec.js index <HASH>..<HASH> 100644 --- a/test/components/loader_spec.js +++ b/test/components/loader_spec.js @@ -24,7 +24,6 @@ describe('Loader', function() { }) it('should not contain the MSE/Flash based playbacks when PLAIN_HTML5_ONLY is set', function() { - PLAIN_HTML5_ONLY == true const loader = new Loader([], 0, true) // expected order from previous Clappr versions const expectedPlaybacks = [HTML5VideoPlayback, HTML5AudioPlayback, HTMLImgPlayback, NoOp]
test(loader): remove unnecessary lines from test files
clappr_clappr
train
js
0b9b510f70c6b5f44d578a110549e9fdc1581198
diff --git a/src/Command/CacheRebuildCommand.php b/src/Command/CacheRebuildCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/CacheRebuildCommand.php +++ b/src/Command/CacheRebuildCommand.php @@ -80,7 +80,7 @@ class CacheRebuildCommand extends ContainerAwareCommand $cache = $dialog->askAndValidate( $output, $dialog->getQuestion($this->trans('commands.cache.rebuild.questions.cache'), 'all'), - function ($cache) use ($cache_keys, $validators) { + function ($cache) use ($validators) { $validated_cache = $validators->validateCache($cache); if (!$validated_cache) { throw new \InvalidArgumentException( @@ -93,8 +93,7 @@ class CacheRebuildCommand extends ContainerAwareCommand return $validated_cache; }, false, - 'all', - $cache_keys + 'all' ); }
The cache_keys use argument is declared but never used in src/Command/CacheRebuildCommand.php, line <I>.
hechoendrupal_drupal-console
train
php
019c40675abc974f0f9dde30b160aca3e482ddb5
diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index <HASH>..<HASH> 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -4751,7 +4751,7 @@ const converters = { } return {brightness: mapNumberRange(value, 10, 1000, 0, 254)}; } - } else if (meta.device.manufacturerName === '_TZE200_3p5ydos3') { + } else if (['_TZE200_3p5ydos3', '_TZE200_9i9dt8is', '_TZE200_dfxkcots'].includes(meta.device.manufacturerName)) { if (dpValue.dp === tuya.dataPoints.eardaDimmerLevel) { return {brightness: mapNumberRange(value, 0, 1000, 0, 254)}; } else if (dpValue.dp === tuya.dataPoints.dimmerMinLevel) {
Fix "Received unexpected Tuya DataPoint #2" error for _TZE<I>_dfxkcots. <URL>
Koenkk_zigbee-shepherd-converters
train
js
2eae54b84ae459d15b18b172778763e41cbda82d
diff --git a/lib/sem4r/campaign/campaign_service.rb b/lib/sem4r/campaign/campaign_service.rb index <HASH>..<HASH> 100644 --- a/lib/sem4r/campaign/campaign_service.rb +++ b/lib/sem4r/campaign/campaign_service.rb @@ -34,6 +34,7 @@ module Sem4r @service_namespace = "https://adwords.google.com/api/adwords/cm/v201008" @header_namespace = @service_namespace + @production_service_url = "https://adwords.google.com/api/adwords/cm/v201008/CampaignService" @sandbox_service_url = "https://adwords-sandbox.google.com/api/adwords/cm/v201008/CampaignService" init(@header_namespace, @service_namespace) end
ummm, fixing the missing production service url for campaigns, how did this get through a release?
26fe_sem4r
train
rb
1323b8410cec4c5baaa4a2cdfc0cccf9bff7ff58
diff --git a/spec/mongo/database_spec.rb b/spec/mongo/database_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongo/database_spec.rb +++ b/spec/mongo/database_spec.rb @@ -322,7 +322,7 @@ describe Mongo::Database do end end - describe '#fs' do + describe '#fs', unless: sharded? do let(:database) do described_class.new(authorized_client, TEST_DB)
Don't test insert then read on sharded clusters in #fs test, write concern is not set
mongodb_mongo-ruby-driver
train
rb
08e9809c79c9b75c5fc4bd41d96777d937baf9f1
diff --git a/custodian/cp2k/jobs.py b/custodian/cp2k/jobs.py index <HASH>..<HASH> 100644 --- a/custodian/cp2k/jobs.py +++ b/custodian/cp2k/jobs.py @@ -127,7 +127,10 @@ class Cp2kJob(Job): os.mkdir(f"relax{self.suffix}") for f in fs: if not os.path.isdir(f): - shutil.copy(f, f"relax{self.suffix}/{f}") + if self.final: + shutil.move(f, f"relax{self.suffix}/{f}") + else: + shutil.copy(f, f"relax{self.suffix}/{f}") # Remove continuation so if a subsequent job is run in # the same directory, will not restart this job.
Move (not copy) if its the last calc in series.
materialsproject_custodian
train
py
79073d63679bd7ed3bec1ae7ec38b1c7b8afa318
diff --git a/src/Viewable.php b/src/Viewable.php index <HASH>..<HASH> 100644 --- a/src/Viewable.php +++ b/src/Viewable.php @@ -17,6 +17,10 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\MorphMany; use CyrildeWit\EloquentViewable\Contracts\View as ViewContract; +/** + * @method static self|Builder orderByViews(string $direction = 'desc', ?Period $period = null) + * @method static self|Builder orderByUniqueViews(string $direction = 'desc', ?Period $period = null) + **/ trait Viewable { /**
Update Viewable Add PHPDoc block to allow IDE to pick on query scope easily
cyrildewit_eloquent-viewable
train
php
d38710f29d7a02ea17321cd840412386b8efe392
diff --git a/src/ox_modules/module-pdf.js b/src/ox_modules/module-pdf.js index <HASH>..<HASH> 100644 --- a/src/ox_modules/module-pdf.js +++ b/src/ox_modules/module-pdf.js @@ -258,6 +258,11 @@ function validateReverse(arg, name) { } function resolvePath(pdfFilePath, options) { + + pdfFilePath = pdfFilePath.trim().split('').map((item, idx) => { + return ![8206, 8296].includes(pdfFilePath.charCodeAt(idx)) ? item : null; + }).join(''); + if (pdfFilePath[0] === '~') { // resolve path relative to home directory return path.join(process.env.HOME, pdfFilePath.slice(1)); @@ -300,10 +305,6 @@ module.exports = function(options, context, rs, logger, modules, services) { validateMessage(message, 'message'); validateReverse(reverse, 'reverse'); - pdfFilePath = pdfFilePath.trim().split('').map((item, idx) => { - return ![8206, 8296].includes(pdfFilePath.charCodeAt(idx)) ? item : null; - }).join(''); - pdfFilePath = resolvePath(pdfFilePath, options); try {
pdf resolvePath refactor
oxygenhq_oxygen
train
js
521fe8deb5cd06160aa28163727c46497db461d0
diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index <HASH>..<HASH> 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -3160,7 +3160,7 @@ class Booster: Returns ------- - upper_bound : double + upper_bound : float Upper bound value of the model. """ ret = ctypes.c_double(0) @@ -3174,7 +3174,7 @@ class Booster: Returns ------- - lower_bound : double + lower_bound : float Lower bound value of the model. """ ret = ctypes.c_double(0)
[docs][python] Fix return types in docstrings (#<I>) Update basic.py
Microsoft_LightGBM
train
py
74195affdf872f5a6f7774a5987866d45359b132
diff --git a/lib/getFilterInfosAndTargetContentTypeFromQueryString.js b/lib/getFilterInfosAndTargetContentTypeFromQueryString.js index <HASH>..<HASH> 100644 --- a/lib/getFilterInfosAndTargetContentTypeFromQueryString.js +++ b/lib/getFilterInfosAndTargetContentTypeFromQueryString.js @@ -1080,6 +1080,7 @@ module.exports = function getFilterInfosAndTargetContentTypeFromQueryString( !currentEngineName || candidateEngineNames.indexOf(currentEngineName) === -1 ) { + flushOperations(); if (candidateEngineNames.indexOf(defaultEngineName) !== -1) { currentEngineName = defaultEngineName; } else { diff --git a/test/getFilterInfosAndTargetContentTypeFromQueryString.js b/test/getFilterInfosAndTargetContentTypeFromQueryString.js index <HASH>..<HASH> 100644 --- a/test/getFilterInfosAndTargetContentTypeFromQueryString.js +++ b/test/getFilterInfosAndTargetContentTypeFromQueryString.js @@ -182,10 +182,13 @@ describe('getFilterInfosAndTargetContentTypeFromQueryString', function() { expect(filterInfosAndTargetContentTypeFromQueryString, 'to satisfy', { targetContentType: 'image/gif', - operationNames: ['gm'], + operationNames: ['gm', 'sharpOrGm'], filterInfos: [ { operationName: 'gm' + }, + { + operationName: 'sharpOrGm' } ] });
Flush the operations pipeline when switching to a different engine, fixes #<I>
papandreou_express-processimage
train
js,js
7095a7ca7d985d5447aed80cf3e41a4f8c19b954
diff --git a/src/utils.js b/src/utils.js index <HASH>..<HASH> 100644 --- a/src/utils.js +++ b/src/utils.js @@ -71,7 +71,7 @@ function defaultGetLocalIdent( let relativeMatchResource = ""; // eslint-disable-next-line no-underscore-dangle - if (loaderContext._module.matchResource) { + if (loaderContext._module && loaderContext._module.matchResource) { relativeMatchResource = `${normalizePath( // eslint-disable-next-line no-underscore-dangle path.relative(options.context, loaderContext._module.matchResource) @@ -138,7 +138,8 @@ const icssRegExp = /\.icss\.\w+$/i; function getModulesOptions(rawOptions, loaderContext) { const resourcePath = // eslint-disable-next-line no-underscore-dangle - loaderContext._module.matchResource || loaderContext.resourcePath; + (loaderContext._module && loaderContext._module.matchResource) || + loaderContext.resourcePath; let isIcss;
fix: crash with thread-loader (#<I>)
webpack-contrib_css-loader
train
js
644aeb5313fd8f5884c65deff139277ef2fa97dd
diff --git a/RetryTrait.php b/RetryTrait.php index <HASH>..<HASH> 100644 --- a/RetryTrait.php +++ b/RetryTrait.php @@ -9,6 +9,14 @@ trait RetryTrait $e = null; $numberOfRetires = $this->getNumberOfRetries(); + if (false == is_numeric($numberOfRetires)) { + throw new \LogicException(sprintf('The $numberOfRetires must be a number but got "%s"', var_export($numberOfRetires, true))); + } + $numberOfRetires = (int) $numberOfRetires; + if ($numberOfRetires <= 0) { + throw new \LogicException(sprintf('The $numberOfRetires must be a positive number greater than 0 but got "%s".', $numberOfRetires)); + } + for ($i = 0; $i < $numberOfRetires; ++$i) { try { parent::runBare(); @@ -37,8 +45,8 @@ trait RetryTrait { $annotations = $this->getAnnotations(); - if (isset($annotations['method']['retry'])) { - return $annotations['method']['retry']; + if (isset($annotations['method']['retry'][0])) { + return $annotations['method']['retry'][0]; } if (isset($annotations['class']['retry'][0])) {
[sqs] fix hanged tests.
php-enqueue_test
train
php
3f92b77af7af983d31a336d215d10e2aaa19fe86
diff --git a/cmd2.py b/cmd2.py index <HASH>..<HASH> 100755 --- a/cmd2.py +++ b/cmd2.py @@ -2030,6 +2030,10 @@ class Cmd2TestCase(unittest.TestCase): self.cmdapp = self.CmdApp() self.fetchTranscripts() + # Make sure any required initialization gets done and flush the output buffer + self.cmdapp.preloop() + self.outputTrap.read() + def runTest(self): # was testall if self.CmdApp: its = sorted(self.transcripts.items()) @@ -2095,6 +2099,9 @@ class Cmd2TestCase(unittest.TestCase): def tearDown(self): if self.CmdApp: + # Make sure any required cleanup gets done + self.cmdapp.postloop() + self.outputTrap.tear_down()
Transcript testing now calls preloop() before and postloop() after
python-cmd2_cmd2
train
py
253183ffc8c38823c6841f16787e2784b9c51db3
diff --git a/src/frontend/org/voltdb/export/ExportCoordinator.java b/src/frontend/org/voltdb/export/ExportCoordinator.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/export/ExportCoordinator.java +++ b/src/frontend/org/voltdb/export/ExportCoordinator.java @@ -355,7 +355,6 @@ public class ExportCoordinator { exportLog.debug(getNewLeaderMessage()); } - m_isMaster = isPartitionLeader(); // If leader and maps empty request ExportSequenceNumberTracker from all nodes. // Note: cannot initiate a coordinator task directly from here, must go // through another runnable and the invocation path.
ENG-<I>: do not reset mastership on leadership change (#<I>)
VoltDB_voltdb
train
java
2b6fd77db5473ce74fea5363ce25ff9b488cd0d7
diff --git a/lib/capybara/server.rb b/lib/capybara/server.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/server.rb +++ b/lib/capybara/server.rb @@ -55,6 +55,7 @@ class Capybara::Server end def boot + return self unless @app find_available_port Capybara.log "application has already booted" and return self if responsive? Capybara.log "booting Rack applicartion on port #{port}" diff --git a/spec/server_spec.rb b/spec/server_spec.rb index <HASH>..<HASH> 100644 --- a/spec/server_spec.rb +++ b/spec/server_spec.rb @@ -10,6 +10,12 @@ describe Capybara::Server do @res.body.should include('Hello Server') end + + it "should do nothing when no server given" do + running do + @server = Capybara::Server.new(nil).boot + end.should_not raise_error + end it "should find an available port" do @app1 = proc { |env| [200, {}, "Hello Server!"]}
Make sure server does nothing when no app given
teamcapybara_capybara
train
rb,rb
0653e617bd3c4091cbddf6ed12aced356e265970
diff --git a/src/doc/conf.py b/src/doc/conf.py index <HASH>..<HASH> 100644 --- a/src/doc/conf.py +++ b/src/doc/conf.py @@ -23,9 +23,9 @@ if MOCK_MODULES and on_rtd: project = 'Astral' author = 'Simon Kennedy' -copyright = '2009-2014, %s' % author +copyright = '2009-2015, %s' % author version = '0.8' -release = '0.8' +release = '0.8.1' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
* Version number changed to <I> * Copyright year updated
sffjunkie_astral
train
py
245396d12f36876e7edd389af00de9788132f915
diff --git a/js/carousel.js b/js/carousel.js index <HASH>..<HASH> 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -397,7 +397,7 @@ if (n === undefined) { n = 1; } - target = offset + dim * n; + target = (dim * Math.round(offset / dim) + dim * n); if (offset !== target) { amplitude = target - offset; timestamp = Date.now(); @@ -409,7 +409,7 @@ if (n === undefined) { n = 1; } - target = offset - dim * n; + target = (dim * Math.round(offset / dim) - dim * n); if (offset !== target) { amplitude = target - offset; timestamp = Date.now();
Fixing carousel misalign when switching slides too quickly
Dogfalo_materialize
train
js
179d5b97d68c6cc86d479fa714f1590c4f55ac97
diff --git a/src/Model/Resource.php b/src/Model/Resource.php index <HASH>..<HASH> 100644 --- a/src/Model/Resource.php +++ b/src/Model/Resource.php @@ -168,6 +168,15 @@ class Resource implements \ArrayAccess // A create action can simply return 201 Created with a location. if (isset($data['status']) && $data['status'] === 'created' && isset($data['location'])) { + // Platform.sh can erroneously return HTTP URLs in the location. + if (strpos($collectionUrl, 'https://') !== false && strpos($data['location'], 'http://') !== false) { + $data['location'] = str_replace('http://', 'https://', $data['location']); + } elseif (strpos($data['location'], '//') === false) { + // If the location is relative, make it absolute. + $base = Url::fromString($collectionUrl); + $data['location'] = (string) $base->combine($data['location']); + } + $resource = static::get($data['location'], null, $client); if ($resource === false) { throw new \RuntimeException('Failed to retrieve created resource');
Work around HTTP / HTTPS issue with <I> responses
platformsh_platformsh-client-php
train
php