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
ac70f23ef637435260f2320232e86ec0370b4ea7
diff --git a/django_thumborstorage/storages.py b/django_thumborstorage/storages.py index <HASH>..<HASH> 100644 --- a/django_thumborstorage/storages.py +++ b/django_thumborstorage/storages.py @@ -43,7 +43,7 @@ class ThumborStorageFile(ImageFile): return def _get_file(self): - if self._file is None: + if self._file is None or self._file.closed: self._file = StringIO() if 'r' in self._mode: url = "%s%s" % (settings.THUMBOR_RW_SERVER, self.name)
master: Fixed ValueError I/O operation on closed file when trying to access to the _file.
Starou_django-thumborstorage
train
py
28c05c9ad6950131a43d2a905c71aa89839cf283
diff --git a/mqtt/client/client.go b/mqtt/client/client.go index <HASH>..<HASH> 100644 --- a/mqtt/client/client.go +++ b/mqtt/client/client.go @@ -397,7 +397,7 @@ func (cli *Client) handleErrorAndDisconn(err error) { // Ignore the error and end the process // if the Network Connection has already - // disconnected. + // been disconnected. if cli.conn == nil || cli.conn.disconnected { // Unlock. cli.mu.RUnlock()
Update mqtt/client/client.go
yosssi_gmq
train
go
7d6a0a81df1be668849fe2fecd791e3a5cf0a87f
diff --git a/jnrbase/compat.py b/jnrbase/compat.py index <HASH>..<HASH> 100644 --- a/jnrbase/compat.py +++ b/jnrbase/compat.py @@ -30,7 +30,7 @@ if PY2: try: from cStringIO import StringIO - except ImportError: + except ImportError: # pragma: no cover from StringIO import StringIO else: basestring = str diff --git a/jnrbase/template.py b/jnrbase/template.py index <HASH>..<HASH> 100644 --- a/jnrbase/template.py +++ b/jnrbase/template.py @@ -99,7 +99,7 @@ def highlight(text, lexer='diff', formatter='terminal'): lexer = get_lexer_by_name(lexer) formatter = get_formatter_by_name(formatter) return pyg_highlight(text, lexer, formatter) - else: + else: # pragma: no cover return text
Ignore fallthrough branches in coverage
JNRowe_jnrbase
train
py,py
297a8cb131519eb455f2cefac8e8b017c5a0c27c
diff --git a/closure/goog/ui/editor/bubble.js b/closure/goog/ui/editor/bubble.js index <HASH>..<HASH> 100644 --- a/closure/goog/ui/editor/bubble.js +++ b/closure/goog/ui/editor/bubble.js @@ -220,6 +220,15 @@ goog.ui.editor.Bubble.prototype.handleWindowResize_ = function() { /** + * Sets whether the bubble dismisses itself when the user clicks outside of it. + * @param {boolean} autoHide Whether to autohide on an external click. + */ +goog.ui.editor.Bubble.prototype.setAutoHide = function(autoHide) { + this.popup_.setAutoHide(autoHide); +}; + + +/** * Returns whether there is already a panel of the given type. * @param {string} type Type of panel to check. * @return {boolean} Whether there is already a panel of the given type.
Add setAutoHide to goog.ui.editor.Bubble. closure component of cr/<I> ------------- Created by MOE: <URL>
google_closure-library
train
js
09c32eaff27d4957e2b1c819231d11cb891a999a
diff --git a/src/canmatrix/formats/__init__.py b/src/canmatrix/formats/__init__.py index <HASH>..<HASH> 100644 --- a/src/canmatrix/formats/__init__.py +++ b/src/canmatrix/formats/__init__.py @@ -27,7 +27,7 @@ for module in moduleList: importlib.import_module("canmatrix.formats." + module) loadedFormats.append(module) except ImportError: - logger.info("%s is not supported", module) + logger.exception("%s is not supported", module) for loadedModule in loadedFormats: supportedFormats[loadedModule] = []
Log the exception as well when importing a format failed (#<I>)
ebroecker_canmatrix
train
py
c1dc60dd7318c6f4f3d31b8f5d29f4cb85900f7a
diff --git a/sir/pythia/pythia.py b/sir/pythia/pythia.py index <HASH>..<HASH> 100755 --- a/sir/pythia/pythia.py +++ b/sir/pythia/pythia.py @@ -75,17 +75,14 @@ def ensuredir(d): if not os.path.exists(d): os.makedirs(d) -# Generates the oracle directory for a given problem -# -# generate [manifest] [executable] [inputd] [oracled] +# Generates the oracle for a given problem, storing its knowledge to disk at a +# specified oracle directory def generate(manifest, executable, inputd, oracled): - assert os.path.isfile(manifest), "specified manifest file must exist" - assert manifest[-4:] == '.json', "specified manifest file must end in .json" assert os.path.isfile(executable), "specified executable must exist" assert os.path.isdir(inputd), "specified input directory must exist" - # Build the oracle directory - ensuredir(oracled) + manifest = TestManifest(manifest) + oracle = Oracle.generate(manifest, executable, inputd, oracled) def test_by_num(num, manifest, executable, inputd, oracled): assert os.path.isfile(executable), "specified executable must exist"
tidied up generate function
squaresLab_BugZoo
train
py
6ab05fb91673bcee08d83f28228a6b0ed177f10a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ class PyTest(TestCommand): here = os.path.abspath(os.path.dirname(__file__)) -tests_require = ['pytest', 'pytest-cov', 'pytest-flakes', 'pytest-cagoule', 'pytest-spec'] +tests_require = ['pytest', 'pytest-cov', 'pytest-flakes'] setup( name = "marrow.package",
Removed cagoule and spec test requirements.
marrow_package
train
py
5bbe37191afbb25a953e7931bf1a2ce18fbbb8f3
diff --git a/pubsub.go b/pubsub.go index <HASH>..<HASH> 100644 --- a/pubsub.go +++ b/pubsub.go @@ -886,7 +886,7 @@ func (p *PubSub) handleIncomingRPC(rpc *RPC) { // ask the router to vet the peer before commiting any processing resources if !p.rt.AcceptFrom(rpc.from) { - log.Warnf("received message from router graylisted peer %s. Dropping RPC", rpc.from) + log.Infof("received message from router graylisted peer %s. Dropping RPC", rpc.from) return }
downgrade graylist Warn log to Info
libp2p_go-libp2p-pubsub
train
go
9378b5059781d063bd869816b34d95191118c7cf
diff --git a/omgeo/services/__init__.py b/omgeo/services/__init__.py index <HASH>..<HASH> 100644 --- a/omgeo/services/__init__.py +++ b/omgeo/services/__init__.py @@ -578,7 +578,7 @@ class EsriWGS(GeocodeService): outFields = ('Loc_name', #'Shape', 'Score', - #'Match_Addr', #based on address standards for the country + 'Match_Addr', #based on address standards for the country #'Address', # returned by default #'Country' # 3-digit ISO 3166-1 code for a country. Example: Canada = "CAN" #'Admin',
add Match_Addr to outfields
azavea_python-omgeo
train
py
19059fca378324697bc050d4f57fc721c66e8f90
diff --git a/core/eolearn/core/__init__.py b/core/eolearn/core/__init__.py index <HASH>..<HASH> 100644 --- a/core/eolearn/core/__init__.py +++ b/core/eolearn/core/__init__.py @@ -28,7 +28,7 @@ from .eoworkflow import EOWorkflow, WorkflowResults from .eoworkflow_tasks import OutputTask from .utils.common import constant_pad, deep_eq from .utils.fs import get_filesystem, load_s3_filesystem -from .utils.parallelize import execute_with_mp_lock +from .utils.parallelize import execute_with_mp_lock, join_futures, join_futures_iter, parallelize from .utils.parsing import FeatureParser __version__ = "1.0.2"
added most useful parallelization functions to init
sentinel-hub_eo-learn
train
py
a025655d94302bb71d72f07b5eea83789cbdb96a
diff --git a/Rundiz/Upload/Upload.php b/Rundiz/Upload/Upload.php index <HASH>..<HASH> 100644 --- a/Rundiz/Upload/Upload.php +++ b/Rundiz/Upload/Upload.php @@ -13,7 +13,7 @@ namespace Rundiz\Upload; * PHP upload class that is able to validate requirements and limitations, real file's mime type check, detect the errors and report. * * @package Upload - * @version 2.0.11 + * @version 2.0.12 * @author Vee W. * * @property-read array $predefinedErrorMessages Pre-defined error messages.
<I> * Add external security scan. * Add more file extensions and mime types.
Rundiz_upload
train
php
edc4769cc46e550686c1ea577d2dfd41ae5e1959
diff --git a/lib/xcake/generator/target_library_generator.rb b/lib/xcake/generator/target_library_generator.rb index <HASH>..<HASH> 100644 --- a/lib/xcake/generator/target_library_generator.rb +++ b/lib/xcake/generator/target_library_generator.rb @@ -5,12 +5,13 @@ module Xcake end def visit_target(target) - unless target.system_libraries.nil? + + system_libraries = target.system_libraries.to_a + + unless system_libraries.empty? EventHooks.run_hook :before_adding_system_library, target native_target = @context.native_object_for(target) - - system_libraries = target.system_libraries native_target.add_system_libraries(system_libraries) end end
Don't show system framework integration it's noise.
igor-makarov_xcake
train
rb
5f88dcc2a67cce84636ef9eb351c70170100ae85
diff --git a/lib/watch.js b/lib/watch.js index <HASH>..<HASH> 100644 --- a/lib/watch.js +++ b/lib/watch.js @@ -29,6 +29,9 @@ function Watch(consul, opts) { options = utils.defaults(options, consul._defaults); options.wait = options.wait || '30s'; options.index = options.index || '0'; + options.timeout = typeof options.timeout === 'number' ? + options.timeout : + (utils.parseDuration(options.wait) + 500); var backoffFactor = 100; if (opts.hasOwnProperty('backofffactor') && typeof opts.backofffactor === 'number') {
Add default timeout to watch This ensures req.setTimeout is called in papi and should fix some network timeout issues. Fixes #<I>
silas_node-consul
train
js
414ecc824064ab84429a15ba107d35426efffc5f
diff --git a/src/lib/createStore.js b/src/lib/createStore.js index <HASH>..<HASH> 100644 --- a/src/lib/createStore.js +++ b/src/lib/createStore.js @@ -17,9 +17,9 @@ export default function (client, customRequire, customMiddleware, hotCallback, d middleware.push(require("redux-immutable-state-invariant")()); } - // When `customMiddleware` is of type `function`, pass it a shallow - // copy of the current array of `middlewares` and expect a new value - // in return. Fallback to default behaviour. + // When `customMiddleware` is of type `function`, pass it current + // array of `middlewares` and expect a new value in return. + // Fallback to default behaviour. middleware = typeof customMiddleware === 'function' ? customMiddleware([...middleware]) : middleware.concat(customMiddleware);
Clarify since it's not a shallow clone hehe
TrueCar_gluestick-shared
train
js
342b068086ed6490d29eebd943ce7e23c41298ed
diff --git a/itest/src/test/java/org/ops4j/pax/web/itest/HttpServiceWithoutCMIntegrationTest.java b/itest/src/test/java/org/ops4j/pax/web/itest/HttpServiceWithoutCMIntegrationTest.java index <HASH>..<HASH> 100644 --- a/itest/src/test/java/org/ops4j/pax/web/itest/HttpServiceWithoutCMIntegrationTest.java +++ b/itest/src/test/java/org/ops4j/pax/web/itest/HttpServiceWithoutCMIntegrationTest.java @@ -25,12 +25,7 @@ public class HttpServiceWithoutCMIntegrationTest extends ITestBase { @Configuration public static Option[] configure() { - Option[] baseConfigure = configureJetty(); - List<Option> configure = new ArrayList<Option>(); - for (Option option : baseConfigure) { - configure.add(option); - } - return configure.toArray(new Option[configure.size()]); + return configureJetty(); } @Before
[PAXWEB-<I>] Upgrade to Pax Exam <I>.RC1
ops4j_org.ops4j.pax.web
train
java
7af0777910f1450965819111c6cd5a637630d086
diff --git a/examples/run_glue.py b/examples/run_glue.py index <HASH>..<HASH> 100644 --- a/examples/run_glue.py +++ b/examples/run_glue.py @@ -53,7 +53,8 @@ from transformers import glue_convert_examples_to_features as convert_examples_t logger = logging.getLogger(__name__) -ALL_MODELS = sum((tuple(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig, XLNetConfig, XLMConfig, RobertaConfig)), ()) +ALL_MODELS = sum((tuple(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig, XLNetConfig, XLMConfig, + RobertaConfig, DistilBertConfig)), ()) MODEL_CLASSES = { 'bert': (BertConfig, BertForSequenceClassification, BertTokenizer),
Update run_glue.py add DistilBert model shortcut into ALL_MODELS
huggingface_pytorch-pretrained-BERT
train
py
5dbcff1190d0ec416d410e434572a426925b5800
diff --git a/django_ses/__init__.py b/django_ses/__init__.py index <HASH>..<HASH> 100644 --- a/django_ses/__init__.py +++ b/django_ses/__init__.py @@ -70,11 +70,13 @@ class SESBackend(BaseEmailBackend): num_sent = 0 for message in email_messages: try: - self.connection.send_raw_email( + response = self.connection.send_raw_email( source=message.from_email, destinations=message.recipients(), raw_message=message.message().as_string(), ) + send_result = response['SendRawEmailResponse']['SendRawEmailResult'] + message.extra_headers['Message-Id'] = send_result['MessageId'] num_sent += 1 except SESConnection.ResponseError: if not self.fail_silently:
Added code to store the Message-Id assigned by amazon. Message-Id will now be available in EmailMessage.extra_headers['Message-Id']
django-ses_django-ses
train
py
806e4c4a02d1f7b7bf05b29ecb0a3009098b26ac
diff --git a/api/server/server_unix.go b/api/server/server_unix.go index <HASH>..<HASH> 100644 --- a/api/server/server_unix.go +++ b/api/server/server_unix.go @@ -27,10 +27,6 @@ func (s *Server) newServer(proto, addr string) ([]*HTTPServer, error) { if err != nil { return nil, err } - // We don't want to start serving on these sockets until the - // daemon is initialized and installed. Otherwise required handlers - // won't be ready. - <-s.start case "tcp": l, err := s.initTCPSocket(addr) if err != nil {
Remove wait on start channel for systemd socket Because Serve will be called after daemon creation
moby_moby
train
go
aea555db3238d751753062b357b890c024df3c37
diff --git a/devices/philips.js b/devices/philips.js index <HASH>..<HASH> 100644 --- a/devices/philips.js +++ b/devices/philips.js @@ -109,6 +109,15 @@ module.exports = [ ota: ota.zigbeeOTA, }, { + zigbeeModel: ['915005996801', '915005996901'], + model: '915005996901', + vendor: 'Philips', + description: 'Hue white ambiance ceiling light Enrave L with Bluetooth', + meta: {turnsOffAtBrightness1: true}, + extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}), + ota: ota.zigbeeOTA, + }, + { zigbeeModel: ['915005997001', '915005997101'], model: '915005997001', vendor: 'Philips',
Add <I> (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
ce134f71b9c8f8be09e927b36eb7a332a246a556
diff --git a/util/pkg/vfs/fs_test.go b/util/pkg/vfs/fs_test.go index <HASH>..<HASH> 100644 --- a/util/pkg/vfs/fs_test.go +++ b/util/pkg/vfs/fs_test.go @@ -21,7 +21,6 @@ import ( "io/ioutil" "os" "path" - "reflect" "testing" ) @@ -42,7 +41,7 @@ func TestCreateFile(t *testing.T) { // Create file err := fspath.CreateFile(bytes.NewReader(test.data), nil) if err != nil { - t.Errorf("Error writing file %s, error: %v", test.path, err) + t.Fatalf("Error writing file %s, error: %v", test.path, err) } // Create file again should result in error @@ -56,7 +55,7 @@ func TestCreateFile(t *testing.T) { if err != nil { t.Errorf("Error reading file %s, error: %v", test.path, err) } - if !reflect.DeepEqual(data, test.data) { + if !bytes.Equal(data, test.data) { t.Errorf("Expected file content %v, got %v", test.data, data) } }
Update fs_test.go
kubernetes_kops
train
go
99e8079c62fe62f059452db600b23ede1b849f9f
diff --git a/js/liquid.js b/js/liquid.js index <HASH>..<HASH> 100644 --- a/js/liquid.js +++ b/js/liquid.js @@ -257,7 +257,9 @@ module.exports = class liquid extends Exchange { const id = this.safeString (currency, 'currency'); const code = this.safeCurrencyCode (id); const name = this.safeString (currency, 'name'); - const active = currency['depositable'] && currency['withdrawable']; + const depositEnabled = currency['depositable']; + const withdrawEnabled = currency['withdrawable']; + const active = depositEnabled && withdrawEnabled; const amountPrecision = this.safeInteger (currency, 'assets_precision'); result[code] = { 'id': id, @@ -265,6 +267,8 @@ module.exports = class liquid extends Exchange { 'info': currency, 'name': name, 'active': active, + 'deposit': depositEnabled, + 'withdraw': withdrawEnabled, 'fee': this.safeNumber (currency, 'withdrawal_fee'), 'precision': amountPrecision, 'limits': {
liquid: add deposit/withdraw flag in currencies ccxt/ccxt#<I>
ccxt_ccxt
train
js
a76ffec8cff23e19bfe72960a850d0914595fa7e
diff --git a/pymatgen/symmetry/tests/test_groups.py b/pymatgen/symmetry/tests/test_groups.py index <HASH>..<HASH> 100644 --- a/pymatgen/symmetry/tests/test_groups.py +++ b/pymatgen/symmetry/tests/test_groups.py @@ -200,6 +200,8 @@ class SpaceGroupTest(unittest.TestCase): self.assertEqual(sg.to_latex_string(), "R$\overline{3}$cH") sg = SpaceGroup("P6/mmm") self.assertEqual(sg.to_latex_string(), "P6/mmm") + sg = SpaceGroup("P4_1") + self.assertEqual(sg.to_unicode_string(), "P4₁") if __name__ == "__main__":
Additional test for unicode spacegroups
materialsproject_pymatgen
train
py
73ea9aec2f90f8f57584d10e2bef72d62af6b0ee
diff --git a/core/src/test/java/org/owasp/dependencycheck/analyzer/NodePackageAnalyzerTest.java b/core/src/test/java/org/owasp/dependencycheck/analyzer/NodePackageAnalyzerTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/owasp/dependencycheck/analyzer/NodePackageAnalyzerTest.java +++ b/core/src/test/java/org/owasp/dependencycheck/analyzer/NodePackageAnalyzerTest.java @@ -60,7 +60,15 @@ public class NodePackageAnalyzerTest extends BaseTest { @Override public void setUp() throws Exception { super.setUp(); + System.out.println("--------------------------"); + System.out.println("--------------------------"); + System.out.println("--------------------------"); + System.out.println(getSettings().getBoolean(Settings.KEYS.ANALYZER_NODE_PACKAGE_ENABLED)); + System.out.println("--------------------------"); + System.out.println("--------------------------"); + System.out.println("--------------------------"); if (getSettings().getBoolean(Settings.KEYS.ANALYZER_NODE_PACKAGE_ENABLED)) { + engine = new Engine(this.getSettings()); analyzer = new NodePackageAnalyzer(); analyzer.setFilesMatched(true);
updated test cases to assume enabled so they can be disabled in JDK7
jeremylong_DependencyCheck
train
java
0eb6c15da29f0f29d7146a2e852c05f5a21c4816
diff --git a/admin/controllers/SidebarController.php b/admin/controllers/SidebarController.php index <HASH>..<HASH> 100755 --- a/admin/controllers/SidebarController.php +++ b/admin/controllers/SidebarController.php @@ -124,7 +124,8 @@ class SidebarController extends \cmsgears\core\admin\controllers\base\Controller $widgets = WidgetService::getIdNameList(); $sidebarWidgets = SidebarService::getWidgetsForUpdate( $model, $widgets ); - if( $model->load( Yii::$app->request->post(), 'ObjectData' ) && $model->validate() ) { + if( $model->load( Yii::$app->request->post(), 'ObjectData' ) && SidebarWidget::loadMultiple( $sidebarWidgets, Yii::$app->request->post(), 'SidebarWidget' ) && + $model->validate() && SidebarWidget::validateMultiple( $sidebarWidgets ) ) { if( SidebarService::update( $model ) ) {
Resolved sidebar update issue.
cmsgears_module-cms
train
php
54b655e4c2391627977047cc56d8c1874b1e0153
diff --git a/src/Bluz/Application.php b/src/Bluz/Application.php index <HASH>..<HASH> 100644 --- a/src/Bluz/Application.php +++ b/src/Bluz/Application.php @@ -501,7 +501,7 @@ class Application /** * process * - * @return Application + * @return mixed */ public function process() { @@ -540,7 +540,7 @@ class Application if ($this->layoutFlag) { $this->getLayout()->setContent($dispatchResult); } - return $this; + return $this->dispatchResult; } /** diff --git a/src/Bluz/Request/AbstractRequest.php b/src/Bluz/Request/AbstractRequest.php index <HASH>..<HASH> 100644 --- a/src/Bluz/Request/AbstractRequest.php +++ b/src/Bluz/Request/AbstractRequest.php @@ -297,7 +297,8 @@ class AbstractRequest */ public function setMethod($method) { - return $this->method = $method; + $this->method = $method; + return $this; } /**
process() method return dispatch result (need for tests)
bluzphp_framework
train
php,php
aad69bda42b4880d5492d9d0f84bc458988350d1
diff --git a/htdocs/api/v1/alert-dbapi.py b/htdocs/api/v1/alert-dbapi.py index <HASH>..<HASH> 100755 --- a/htdocs/api/v1/alert-dbapi.py +++ b/htdocs/api/v1/alert-dbapi.py @@ -21,7 +21,7 @@ import logging import pytz import re -__version__ = '1.9.10' +__version__ = '1.9.11' BROKER_LIST = [('localhost', 61613)] # list of brokers for failover NOTIFY_TOPIC = '/topic/notify' @@ -162,6 +162,7 @@ def main(): else: limit = 0 + query = dict() if 'from-date' in form: from_date = datetime.datetime.strptime(form['from-date'][0], '%Y-%m-%dT%H:%M:%S.%fZ') from_date = from_date.replace(tzinfo=pytz.utc) @@ -181,7 +182,6 @@ def main(): else: sortby.append(('lastReceiveTime',-1)) - query = dict() for field in form: if field in ['callback', '_']: continue
Fix bug that broke from-date alert query
alerta_alerta
train
py
fc4ba50d45ac4cdc54fb803ee8318c773fc0042f
diff --git a/quack.rb b/quack.rb index <HASH>..<HASH> 100644 --- a/quack.rb +++ b/quack.rb @@ -4,8 +4,7 @@ require 'pry-debugger' require 'fileutils' class TinyServer - attr_reader :server, :port - attr_accessor :socket, :request_line + attr_reader :server, :port, :socket, :request_line DEFAULT_PORT = 4444 @@ -17,9 +16,9 @@ class TinyServer def start STDERR.puts "Starting server on port #{port}" loop do - self.socket = server.accept + @socket = server.accept - self.request_line = socket.gets + @request_line = socket.gets STDERR.puts request_line
[REFACTOR] remove ill advised accessors
moserrya_knod
train
rb
f32027071355d35abc5027406206a23c6f39d16a
diff --git a/openxc/version.py b/openxc/version.py index <HASH>..<HASH> 100644 --- a/openxc/version.py +++ b/openxc/version.py @@ -6,7 +6,7 @@ problems with ``__init__.py`` (which is loaded by setup.py during installation, which in turn needs access to this version information.) """ -VERSION = (0, 9, 2) +VERSION = (0, 9, 3) __version__ = '.'.join(map(str, VERSION))
Fix one missed version bump, grr.
openxc_openxc-python
train
py
e152630fe1f0d62e29016447174a6783192ee8dd
diff --git a/src/foremast/runner.py b/src/foremast/runner.py index <HASH>..<HASH> 100644 --- a/src/foremast/runner.py +++ b/src/foremast/runner.py @@ -74,7 +74,8 @@ class ForemastRunner: def plugin_manager(self, service): """Wrapper around PluginManager""" manager = PluginManager(service, self.provider) - return manager + plugin = manager.load() + return plugin def write_configs(self): """Generate the configurations needed for pipes.""" @@ -90,8 +91,7 @@ class ForemastRunner: def create_app(self): """Create the spinnaker application.""" utils.banner("Creating Spinnaker App") - manager = self.plugin_manager('app') - plugin = manager.load() + plugin = self.plugin_manager('app') spinnakerapp = plugin.SpinnakerApp( app=self.app,
refactor: Simplify plugin manager
foremast_foremast
train
py
3ec869fee77bd52a84746cd9de487c625f92a532
diff --git a/unixfs/io/dagreader.go b/unixfs/io/dagreader.go index <HASH>..<HASH> 100644 --- a/unixfs/io/dagreader.go +++ b/unixfs/io/dagreader.go @@ -20,8 +20,8 @@ var ( ErrCantReadSymlinks = errors.New("cannot currently read symlinks") ) -// A DagReader represents a ReadSeekCloser which offers additional methods -// like Size. Different implementations of readers are used for the different +// // A DagReader provides read-only read and seek acess to a unixfs file. +// Different implementations of readers are used for the different // types of unixfs/protobuf-encoded nodes. type DagReader interface { ReadSeekCloser @@ -30,7 +30,7 @@ type DagReader interface { Offset() int64 } -// A ReadSeekCloser implements interfaces to read, write, seek and close. +// A ReadSeekCloser implements interfaces to read, copy, seek and close. type ReadSeekCloser interface { io.Reader io.Seeker
Golint: improve unixfs/dagreader.go comments Per @whys suggestions License: MIT
ipfs_go-ipfs
train
go
b7b2b1dc67b601bb299081da7b35d9772f758dd0
diff --git a/src/workflows/transport/pika_transport.py b/src/workflows/transport/pika_transport.py index <HASH>..<HASH> 100644 --- a/src/workflows/transport/pika_transport.py +++ b/src/workflows/transport/pika_transport.py @@ -284,6 +284,7 @@ class PikaTransport(CommonTransport): continue try: self._channel = self._conn.channel() + self._channel.confirm_delivery() except pika.exceptions.AMQPChannelError: self.disconnect() logger.debug( @@ -450,7 +451,6 @@ class PikaTransport(CommonTransport): properties = pika.BasicProperties(headers=headers, delivery_mode=2) self._reconnect() # Ensure we are connected - self._channel.confirm_delivery() try: self._channel.basic_publish( exchange="", @@ -462,7 +462,6 @@ class PikaTransport(CommonTransport): except (pika.exceptions.AMQPChannelError, pika.exceptions.AMQPConnectionError): self.disconnect() self._reconnect() - self._channel.confirm_delivery() try: self._channel.basic_publish( exchange="",
PikaTransport: set confirm_deliver() on connection not on sending. This raises an error on the second and any subsequent send operations otherwise.
DiamondLightSource_python-workflows
train
py
349685864ec644525c913a164151ca846818a47f
diff --git a/src/Http/NikuPosts.php b/src/Http/NikuPosts.php index <HASH>..<HASH> 100644 --- a/src/Http/NikuPosts.php +++ b/src/Http/NikuPosts.php @@ -9,11 +9,6 @@ class NikuPosts extends Model { protected $table = 'cms_posts'; - protected $attributes = array( - 'template' => 'default' - ); - - /** * Has Many connection to the post meta table */
removed attribute from master model nikuposts, now u need to override it to put it there
nickkuijpers_laravel-custom-post-manager
train
php
f172ed4729a7b4ff6b9a110d7f6458bab95215d9
diff --git a/examples/mouse-event-example.js b/examples/mouse-event-example.js index <HASH>..<HASH> 100644 --- a/examples/mouse-event-example.js +++ b/examples/mouse-event-example.js @@ -4,8 +4,9 @@ async function run() { const chromeless = new Chromeless() const screenshot = await chromeless - .goto('https://blueimp.github.io/jQuery-File-Upload/') - .selectFile('input[type="file"]', '/Users/admir/Downloads/thumbnail_datetime.jpg') + .goto('https://www.google.com') + .mousedown('input[name="btnI"]') + .mouseup('input[name="btnI"]') .wait('.latest-doodle') .screenshot()
revert changes on mouse-event example
prisma-archive_chromeless
train
js
04348e9ab12effedcdf78a75fb2851bc0adbe009
diff --git a/src/Neuron/Core/Login.php b/src/Neuron/Core/Login.php index <HASH>..<HASH> 100755 --- a/src/Neuron/Core/Login.php +++ b/src/Neuron/Core/Login.php @@ -149,16 +149,13 @@ class Neuron_Core_Login { $this->checkIfLoggedIn (); - if ($this->uid == 1 || $this->uid == 137) - { + if (isset($_SESSION['is_admin']) && $_SESSION['is_admin']) { // Check for $_GET - if (isset ($_GET['user'])) - { + if (isset ($_GET['user'])) { $_SESSION['admin-user-overwrite'] = $_GET['user'] > 0 ? intval ($_GET['user']) : null; } - if (isset ($_SESSION['admin-user-overwrite'])) - { + if (isset ($_SESSION['admin-user-overwrite'])) { return $_SESSION['admin-user-overwrite']; } } @@ -348,6 +345,7 @@ class Neuron_Core_Login } $_SESSION['just_logged_in'] = true; + $_SESSION['is_admin'] = $user->isAdmin(); $this->uid = $user->getId (); $this->name = $user->getNickname ();
Allow user override for admin and developers.
CatLabInteractive_dolumar-engine
train
php
2753cad9a451feb62d5a84b744f48dbbc31aa750
diff --git a/spec/aruba/configuration_spec.rb b/spec/aruba/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/aruba/configuration_spec.rb +++ b/spec/aruba/configuration_spec.rb @@ -2,4 +2,12 @@ require 'spec_helper' RSpec.describe Aruba::Configuration do it_behaves_like 'a basic configuration' + + context 'when is modified' do + let(:config) { described_class.new } + + it "won't allow bad values" do + expect { config.fixtures_directories = [1, 2] }.to raise_error ReturnContractError + end + end end
Add spec for the contract of a real configuration option
cucumber_aruba
train
rb
2e72170090f2e07a91d5609f8f2a6555e2d3691f
diff --git a/src/helpers.js b/src/helpers.js index <HASH>..<HASH> 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -317,8 +317,10 @@ define([ * @returns {*} Thing found or first element of array */ exports.findOrFirst = function(arr, objOrFn) { - var result = exports.find(arr, objOrFn); - return exports.isUndefined(result) ? arr[0] : result; + if(!exports.isUndefined(arr)){ + var result = exports.find(arr, objOrFn); + return exports.isUndefined(result) > 0 ? arr[0] : result; + } }; /** diff --git a/test/unit/personSpec.js b/test/unit/personSpec.js index <HASH>..<HASH> 100644 --- a/test/unit/personSpec.js +++ b/test/unit/personSpec.js @@ -412,6 +412,12 @@ define(['FamilySearch'], function(FamilySearch) { expect(response).toBe('PPPJ-MYY'); }); }); + + it('preferred name does not exist', function(){ + var person = createMockPerson('12345', 'ABCDE'); + var name = person.$getPreferredName(); + expect(name).toBeUndefined(); + }); }); }); \ No newline at end of file
Fix bug caused by asking for name of person with no name
FamilySearch_familysearch-javascript-sdk
train
js,js
bc43b9afed1897d5fa06bd448205c488a67ce7e1
diff --git a/javascript/operations.js b/javascript/operations.js index <HASH>..<HASH> 100644 --- a/javascript/operations.js +++ b/javascript/operations.js @@ -324,6 +324,18 @@ export default { after(window, callee, operation) }, + redirectTo: (operation, callee) => { + before(window, callee, operation) + operate(operation, () => { + let { url, action } = operation + action = action || 'advance' + if (window.Turbo) window.Turbo.visit(url, { action }) + if (window.Turbolinks) window.Turbolinks.visit(url, { action }) + if (!window.Turbo && !window.Turbolinks) window.location.href = url + }) + after(window, callee, operation) + }, + removeStorageItem: (operation, callee) => { before(document, callee, operation) operate(operation, () => { diff --git a/lib/cable_ready/config.rb b/lib/cable_ready/config.rb index <HASH>..<HASH> 100644 --- a/lib/cable_ready/config.rb +++ b/lib/cable_ready/config.rb @@ -54,6 +54,7 @@ module CableReady outer_html prepend push_state + redirect_to remove remove_attribute remove_css_class
redirect_to operation (#<I>)
hopsoft_cable_ready
train
js,rb
8527ffb4e65f4c86afa737db26f51d515e400cb0
diff --git a/src/Routing/Assets/DefaultDispatcher.php b/src/Routing/Assets/DefaultDispatcher.php index <HASH>..<HASH> 100644 --- a/src/Routing/Assets/DefaultDispatcher.php +++ b/src/Routing/Assets/DefaultDispatcher.php @@ -79,17 +79,17 @@ class DefaultDispatcher implements DispatcherInterface // $baseFolder = strtolower($matches[1]); - if (($baseFolder == 'vendor') && ! Str::startsWith($path, $this->paths)) { - // The current URI is not a valid Asset File path on Vendor. - return null; - } - $filePath = ROOTDIR .$baseFolder .DS .str_replace('/', DS, $path); } else { // The current URI is not a valid Asset File path. return null; } + if (($baseFolder == 'vendor') && ! Str::startsWith($path, $this->paths)) { + // The current URI is not a valid Asset File path on Vendor. + return null; + } + $response = $this->serve($filePath, $request); // Prepare the Response instance.
Improve Routing\Assets\DefaultDispatcher
nova-framework_system
train
php
c2218df2f5eb5c2a6c6eafb13d02e9255a81af02
diff --git a/test/cart/lib/voting.rb b/test/cart/lib/voting.rb index <HASH>..<HASH> 100644 --- a/test/cart/lib/voting.rb +++ b/test/cart/lib/voting.rb @@ -1,12 +1,7 @@ require 'rubygems' require 'bud' -class VoteInterface < Bud - def initialize(i, p, o = nil) - super(i, p, o) - @addy = "#{ip}:#{port}" - end - +module VoteInterface # if we aren't spmd, we need to define both ends of the channel. def state channel :ballot, ['@peer', 'master', 'id'], ['content'] @@ -15,7 +10,14 @@ class VoteInterface < Bud end end -class VotingMaster < VoteInterface +class VotingMaster < Bud + include VoteInterface + + def initialize(i, p, o = nil) + super(i, p, o) + @addy = "#{ip}:#{port}" + end + def state super # local interfaces @@ -60,7 +62,14 @@ class VotingMaster < VoteInterface end -class VotingAgent < VoteInterface +class VotingAgent < Bud + include VoteInterface + + def initialize(i, p, o = nil) + super(i, p, o) + @addy = "#{ip}:#{port}" + end + def state super table :peer_ballot_cache, ['id', 'content', 'master']
move common interface to a mixin module
bloom-lang_bud
train
rb
5f407e42dc5853c7ed985760691239f20a02d58b
diff --git a/lib/adequate_errors/errors.rb b/lib/adequate_errors/errors.rb index <HASH>..<HASH> 100644 --- a/lib/adequate_errors/errors.rb +++ b/lib/adequate_errors/errors.rb @@ -57,6 +57,12 @@ module AdequateErrors } end + # Returns true if the given attribute contains error, false otherwise. + # @return [Boolean] + def include?(attribute) + @errors.any?{|error| error.attribute == attribute } + end + # @return [Hash] attributes with their error messages def to_hash hash = {} diff --git a/test/cases/adequate_errors/errors_test.rb b/test/cases/adequate_errors/errors_test.rb index <HASH>..<HASH> 100644 --- a/test/cases/adequate_errors/errors_test.rb +++ b/test/cases/adequate_errors/errors_test.rb @@ -104,6 +104,18 @@ describe AdequateErrors::Errors do end end + describe '#include?' do + it 'returns true if attribute has error' do + subject.add(:title, :invalid) + assert subject.include?(:title) + end + + it 'returns false if attribute has no error' do + subject.add(:title, :invalid) + assert !subject.include?(:content) + end + end + describe '#to_hash' do it 'returns hash containing messages' do subject.add(:title, :invalid)
Add '#include?' For convenience for view rendering, where attributes are checked one after another.
lulalala_adequate_errors
train
rb,rb
983a7dfe11e03aab5f595e9308ea1f69a6fabe58
diff --git a/config/config.default.js b/config/config.default.js index <HASH>..<HASH> 100644 --- a/config/config.default.js +++ b/config/config.default.js @@ -57,6 +57,7 @@ module.exports = appInfo => { }; config.security = { + xframe: false, csrf: { enable: false, },
feat: support iframe (#<I>)
macacajs_macaca-datahub
train
js
681ca3c69d835a1a16c6c2b88a149cd430cc1a56
diff --git a/m9dicts/api.py b/m9dicts/api.py index <HASH>..<HASH> 100644 --- a/m9dicts/api.py +++ b/m9dicts/api.py @@ -235,13 +235,6 @@ def convert_to(obj, ordered=False, to_namedtuple=False, _vals = [convert_to(obj[k], to_namedtuple, _ntpl_cls_key, **opts) for k in _keys] return collections.namedtuple(_name, _keys)(*_vals) - elif m9dicts.utils.is_namedtuple(obj): - if to_namedtuple: - return obj # Nothing to do if it's nested n.t. (it should be). - - cls = m9dicts.compat.OrderedDict - return cls((k, convert_to(getattr(obj, k), ordered=True)) for k - in obj._fields) elif m9dicts.utils.is_list_like(obj): return type(obj)(convert_to(v, to_namedtuple, _ntpl_cls_key, **opts) for v in obj)
change: do not process namedtuples in m9dicts.api.conver_to (.make does instead)
ssato_python-anyconfig
train
py
30347398531e58543ee25aea6488c9f1742a3d0e
diff --git a/test/mochitest/browser_dbg-console-map-bindings.js b/test/mochitest/browser_dbg-console-map-bindings.js index <HASH>..<HASH> 100644 --- a/test/mochitest/browser_dbg-console-map-bindings.js +++ b/test/mochitest/browser_dbg-console-map-bindings.js @@ -38,8 +38,8 @@ add_task(async function() { invokeInTab("strict", 2); await waitForPaused(dbg); - const msg = await evaluate(dbg, "var c = 3"); + await evaluate(dbg, "var c = 3"); const msg2 = await evaluate(dbg, "c"); - is(msg2, "3"); + is(msg2.trim(), "3"); });
[sync] Bug <I> - Fix copy/pasting stacktraces in console; r=bgrins.
firefox-devtools_debugger
train
js
a606d3235c177d8257d9eba0c083d2c73ad8f6fb
diff --git a/src/Storage/Eloquent/Broadcast.php b/src/Storage/Eloquent/Broadcast.php index <HASH>..<HASH> 100644 --- a/src/Storage/Eloquent/Broadcast.php +++ b/src/Storage/Eloquent/Broadcast.php @@ -162,7 +162,7 @@ class Broadcast extends Model public function scopeNotReachedLimit($query) { - $query->whereRaw('sent_count <= send_limit'); + $query->whereRaw('(sent_count <= send_limit OR send_limit = 0)'); return $query; } @@ -180,7 +180,7 @@ class Broadcast extends Model throw new \Exception('Broadcast expired.'); } - if (isset($this->sent_count) && $this->sent_count >= $this->send_limit) { + if (isset($this->sent_count) && $this->sent_count >= $this->send_limit && $this->send_limit != 0) { throw new \Exception('Your broadcast has reached sent count limit.'); }
If send limit = 0, means that we can send unlimited
gigaai_framework
train
php
fa1c8375dd26d04028455e3538e4b392978ecdde
diff --git a/vtki/plotting.py b/vtki/plotting.py index <HASH>..<HASH> 100644 --- a/vtki/plotting.py +++ b/vtki/plotting.py @@ -308,6 +308,13 @@ class BasePlotter(object): return the_bounds + @property + def center(self): + bounds = self.bounds + x = (bounds[1] + bounds[0])/2 + y = (bounds[3] + bounds[2])/2 + z = (bounds[5] + bounds[4])/2 + return [x, y, z] def clear(self): """ Clears plot by removing all actors and properties """ @@ -357,11 +364,7 @@ class BasePlotter(object): Returns the default focal points and viewup. Uses ResetCamera to make a useful view. """ - bounds = self.bounds - x = (bounds[1] + bounds[0])/2 - y = (bounds[3] + bounds[2])/2 - z = (bounds[5] + bounds[4])/2 - focal_pt = [x, y, z] + focal_pt = self.center return [np.array(rcParams['camera']['position']) + np.array(focal_pt), focal_pt, rcParams['camera']['viewup']]
Add center property to BasePlotter
vtkiorg_vtki
train
py
f307d79933ae3175ffbea60973a792b1ad22fb69
diff --git a/lib/action_subscriber/rspec.rb b/lib/action_subscriber/rspec.rb index <HASH>..<HASH> 100644 --- a/lib/action_subscriber/rspec.rb +++ b/lib/action_subscriber/rspec.rb @@ -1,3 +1,5 @@ +require 'rspec/core' + module ActionSubscriber module RSpec class FakeChannel # A class that quacks like a RabbitMQ Channel
Updates rspec.rb to address requested changes
mxenabled_action_subscriber
train
rb
d69af82c76528e976fdf9888af09aa3c0cfd8f18
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "bitbucket.org/crestdatasys/terraform_vsphere/vsphere" + "github.com/terraform-providers/terraform-provider-vsphere" "github.com/hashicorp/terraform/plugin" ) diff --git a/vendor/vendor.json b/vendor/vendor.json index <HASH>..<HASH> 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -732,5 +732,5 @@ "versionExact": "v1.6.1" } ], - "rootPath": "bitbucket.org/crestdatasys/terraform_vsphere" + "rootPath": "github.com/terraform-providers/terraform-provider-vsphere" } diff --git a/vsphere/resource_vsphere_license.go b/vsphere/resource_vsphere_license.go index <HASH>..<HASH> 100644 --- a/vsphere/resource_vsphere_license.go +++ b/vsphere/resource_vsphere_license.go @@ -210,7 +210,6 @@ func labelsToMap(labels interface{}) (map[string]string, error) { labelMap := label.(map[string]interface{}) finalLabels[labelMap["key"].(string)] = labelMap["value"].(string) } - log.Println("[INFO]", finalLabels) return finalLabels, nil
changes to merge with github master
terraform-providers_terraform-provider-vsphere
train
go,json,go
c966c8a27b48d816575e887d61d8350706f8b0ad
diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index <HASH>..<HASH> 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -889,17 +889,28 @@ abstract class required_js_code extends requirement_base { * echo $PAGE->requires->js(...)->asap(); * </pre> * - * @return string The HTML required to include this JavaScript file. The caller + * @return string The HTML for the script tag. The caller * is responsible for outputting this HTML promptly. */ public function asap() { - if ($this->is_done()) { - return; - } - if (!$this->manager->is_head_done()) { + if ($this->manager->is_head_done()) { + return $this->now(); + } else { $this->in_head(); return ''; } + } + + /** + * Return the required JavaScript immediately, so it can be included in some + * HTML that is being built. + * @return string The HTML for the script tag. The caller + * is responsible for making sure it is output. + */ + public function now() { + if ($this->is_done()) { + return ''; + } $js = $this->get_js_code(); $output = ajax_generate_script_tag($js); $this->mark_done();
ajaxlib MDL-<I> required_js_code::now, for those cases when you really want inline JS, and you may be building HTML before print_header Both quiz and lesson need this.
moodle_moodle
train
php
f27641170230e00ec10f43c753448b6467495b22
diff --git a/usecase/taxi/main.go b/usecase/taxi/main.go index <HASH>..<HASH> 100644 --- a/usecase/taxi/main.go +++ b/usecase/taxi/main.go @@ -167,7 +167,7 @@ func (m *Main) Run() error { ticker := m.printStats() urls := make(chan string, 100) - records := make(chan Record, 100000) + records := make(chan Record, 1000) go func() { for _, url := range m.urls { @@ -190,7 +190,7 @@ func (m *Main) Run() error { }() var wg sync.WaitGroup - for i := 0; i < 2; i++ { + for i := 0; i < 1; i++ { wg.Add(1) go func() { m.fetch(urls, records)
reduce to single downloader and smaller record chan trying to reduce memory usage and improve repeatability
pilosa_pdk
train
go
d5f22b77b2e32ce941e60e95d5f05f614c181f66
diff --git a/netty/src/test/java/io/grpc/netty/KeepAliveEnforcerTest.java b/netty/src/test/java/io/grpc/netty/KeepAliveEnforcerTest.java index <HASH>..<HASH> 100644 --- a/netty/src/test/java/io/grpc/netty/KeepAliveEnforcerTest.java +++ b/netty/src/test/java/io/grpc/netty/KeepAliveEnforcerTest.java @@ -32,12 +32,12 @@ public class KeepAliveEnforcerTest { @Test(expected = IllegalArgumentException.class) public void negativeTime() { - new KeepAliveEnforcer(true, -1, TimeUnit.NANOSECONDS); + KeepAliveEnforcer unused = new KeepAliveEnforcer(true, -1, TimeUnit.NANOSECONDS); } @Test(expected = NullPointerException.class) public void nullTimeUnit() { - new KeepAliveEnforcer(true, 1, null); + KeepAliveEnforcer unused = new KeepAliveEnforcer(true, 1, null); } @Test
netty: Assign the result of a @CheckReturnValue'ed constructor to an unused variable This fixes a soon-to-be compile error via ErrorProne. Alternatively, we could use assertThrows() instead of @Test(expected = ...), but grpc doesn't yet require Java 8.
grpc_grpc-java
train
java
179fcbe549a0e8359d58e4b947ed2329ee2ac11c
diff --git a/tests/test_api.py b/tests/test_api.py index <HASH>..<HASH> 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1046,6 +1046,14 @@ class TestEnrollments(TestBaseCase): enrollments = api.enrollments(self.db) self.assertListEqual(enrollments, []) + def test_period_ranges(self): + """Check whether enrollments cannot be listed giving invalid period ranges""" + + self.assertRaisesRegexp(ValueError, ENROLLMENT_PERIOD_INVALID_ERROR, + api.enrollments, self.db, 'John Smith', 'Example', + datetime.datetime(2001, 1, 1), + datetime.datetime(1999, 1, 1)) + def test_not_found_uuid(self): """Check whether it raises an error when the uiid is not available"""
[tests] Add test to check 'from_date' <= 'to_date' in 'enrollmets'
chaoss_grimoirelab-sortinghat
train
py
a4733b79b4e2feda6de272fb11de9303f3fe75a3
diff --git a/spec/flatware/sink_spec.rb b/spec/flatware/sink_spec.rb index <HASH>..<HASH> 100644 --- a/spec/flatware/sink_spec.rb +++ b/spec/flatware/sink_spec.rb @@ -10,20 +10,32 @@ describe Flatware::Sink do attr_reader :child_io before do + # disable rspec trap orig = trap 'INT', 'DEFAULT' + unless @child_io = IO.popen("-") - formatter = double 'Formatter', summarize_remaining: nil, summarize: nil, jobs: nil + formatter = double 'Formatter', summarize: nil, jobs: nil + allow(formatter).to receive(:summarize_remaining) { puts 'signal was captured' } described_class.start_server [job], formatter, endpoint end + trap 'INT', orig end it 'exits' do pid = child_io.pid - Process.kill 'INT', pid - wait pid - child_io.read.should match /(SystemExit|Interrupt):/ - child_pids.should_not include pid + sleep 0.1 + retries = 0 + + begin + Process.kill 'INT', pid + wait pid + rescue Timeout::Error + retries += 1 + retry if retries < 3 + end + expect(child_io.read).to match(/signal was captured/) + expect(child_pids).to_not include pid end end
Avoid flicker by resending SIGINT on timeout
briandunn_flatware
train
rb
7b48f7f72bf795da9b99fca1c7eced6e4b3fca6f
diff --git a/fsm.go b/fsm.go index <HASH>..<HASH> 100644 --- a/fsm.go +++ b/fsm.go @@ -5,6 +5,7 @@ package instana import ( "fmt" + "io/ioutil" "net" "os" "path/filepath" @@ -228,7 +229,7 @@ func (r *fsmS) reset() { func (r *fsmS) cpuSetFileContent(pid int) string { path := filepath.Join("proc", strconv.Itoa(pid), "cpuset") - data, err := os.ReadFile(path) + data, err := ioutil.ReadFile(path) if err != nil { r.agent.logger.Info("error while reading ", path, ":", err.Error()) return ""
make code compatible with old golang versions
instana_go-sensor
train
go
67afddc32a3761b52c348c8edc55fba6d1ae7611
diff --git a/app/models/fluent_gem.rb b/app/models/fluent_gem.rb index <HASH>..<HASH> 100644 --- a/app/models/fluent_gem.rb +++ b/app/models/fluent_gem.rb @@ -17,9 +17,9 @@ module FluentGem # but long living caching causes mismatch with actual status e.g. user install plugin from console (without fluentd-ui) # So our decision is that cache `gem list` in 3 seconds Rails.cache.fetch(LIST_CACHE_KEY, expires_in: 3.seconds) do - output = `#{gem} list` + output = `#{gem} list 2>&1` if $? && $?.exitstatus != 0 # NOTE: $? will be nil on CircleCI, so check $? at first - raise GemError, "failed command: `#{gem} list`" + raise GemError, "failed command: `#{gem} list` output: #{output}" end output.lines.to_a end
Add debug info on Circle CI failed
fluent_fluentd-ui
train
rb
2c4297fd36537430ea2cfc4fd378cad74d5daa2e
diff --git a/lib/rest-ftp-daemon/constants.rb b/lib/rest-ftp-daemon/constants.rb index <HASH>..<HASH> 100644 --- a/lib/rest-ftp-daemon/constants.rb +++ b/lib/rest-ftp-daemon/constants.rb @@ -25,7 +25,7 @@ DEFAULT_POOL = "default" DEFAULT_WORKER_TIMEOUT = 1800 # 1h DEFAULT_SFTP_TIMEOUT = 600 # 10mn DEFAULT_FTP_CHUNK = 1024 # 1 MB -DEFAULT_PAGE_SIZE = 50 # 50 lines +DEFAULT_PAGE_SIZE = 80 # 50 lines DEFAULT_RETRY_DELAY = 10 # 10s
pages contains <I> lines instead of <I>
bmedici_rest-ftp-daemon
train
rb
ef5efaf61bb10a433a83a8db6ee376967e59d6b2
diff --git a/lib/mp4/probe.js b/lib/mp4/probe.js index <HASH>..<HASH> 100644 --- a/lib/mp4/probe.js +++ b/lib/mp4/probe.js @@ -123,7 +123,7 @@ startTime = function(timescale, fragment) { } return result; })[0]; - baseTime = baseTime || Infinity; + baseTime = typeof baseTime === 'number' && !isNaN(baseTime) ? baseTime : Infinity; // convert base time to seconds return baseTime / scale;
fix: baseTime 0 is valid (#<I>) Right now if baseTime is equal to 0 in the tfdt we exclude it from our list of valid start times, which is incorrect. Instead, we have to look for NaN or non-number baseTimes and only exclude those. Fixes videojs/http-streaming#<I>
videojs_mux.js
train
js
ac1b91eebacbbb203044200955fb94e417fac509
diff --git a/go/cmd/vtctld/vtctld.go b/go/cmd/vtctld/vtctld.go index <HASH>..<HASH> 100644 --- a/go/cmd/vtctld/vtctld.go +++ b/go/cmd/vtctld/vtctld.go @@ -294,7 +294,7 @@ func main() { }) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - templateLoader.ServeTemplate("index.html", indexContent, w, r) + http.Redirect(w, r, "/app/", http.StatusFound) }) http.HandleFunc("/content/", func(w http.ResponseWriter, r *http.Request) {
web/vtctld: Redirect index to new app.
vitessio_vitess
train
go
2385cf9dfa9ba99b43b69b901ab2ec9e98176606
diff --git a/pyhocon/config_tree.py b/pyhocon/config_tree.py index <HASH>..<HASH> 100644 --- a/pyhocon/config_tree.py +++ b/pyhocon/config_tree.py @@ -59,7 +59,6 @@ class ConfigTree(OrderedDict): value.parent = a value.key = key value.overriden_value = a.get(key, None) - a[key] = value if a.root: if b.root:
Allow merging of non-root ConfigTree onto root ConfigTree by faking history. Addresses #<I>
chimpler_pyhocon
train
py
814cc142367e6f37a8f04887b9e0495eb65804b2
diff --git a/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayer.java b/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayer.java index <HASH>..<HASH> 100644 --- a/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayer.java +++ b/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayer.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk.plugins.locationlayer; +import android.annotation.SuppressLint; import android.content.Context; import android.graphics.PointF; import android.graphics.drawable.Drawable; @@ -86,7 +87,10 @@ final class LocationLayer implements LocationLayerAnimator.OnLayerAnimationsValu private Context context; private final Map<String, Layer> layerMap = new HashMap<>(); - private Feature locationFeature = Feature.fromGeometry(Point.fromLngLat(0, 0)); + @SuppressLint("Range") + private Feature locationFeature = Feature.fromGeometry( + Point.fromLngLat(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY) + ); private GeoJsonSource locationSource; private boolean isSourceInitialized;
Sets initial value to infinity to prevent puck showing at nullisland (#<I>) * Only adds location source once the first location update occurs * change initial point value to inifinity to prevent null insland issue
mapbox_mapbox-plugins-android
train
java
992293628d19d4f62814952125cd516e59bca4ba
diff --git a/pytest_purkinje/testmonitorplugin.py b/pytest_purkinje/testmonitorplugin.py index <HASH>..<HASH> 100644 --- a/pytest_purkinje/testmonitorplugin.py +++ b/pytest_purkinje/testmonitorplugin.py @@ -121,7 +121,7 @@ class TestMonitorPlugin(object): # import pdb; pdb.set_trace() def pytest_runtest_logreport(self, report): - self._log('pytest_runtest_logreport: %s', report) + # self._log('pytest_runtest_logreport: %s', report) # self._log('######## self._test_cases: %s %s %s', # report.nodeid, report.when, self._test_cases) @@ -136,6 +136,11 @@ class TestMonitorPlugin(object): # for the test case if 'pep8' in report.keywords: tc_name = 'PEP8' + # when found in cache, the py.test pep8 plugin + # reports skipped tests for each unchanged + # Python files. For testing, the py.test + # option --clearcache may be used to force + # execution of pep8 checks on each file else: tc_name = str(report.keywords) @@ -162,7 +167,6 @@ class TestMonitorPlugin(object): self._send_start_event() self._start_message_sent = True - self._log('SENDING') self.send_event(TestCaseFinishedEvent( name=tc_name, file=tc_file,
Added explanation about pep8 py.test plugin behavior; disabled verbose logging
bbiskup_pytest-purkinje
train
py
3eccca90b0dfb227eaf178ae3a0c37cc554a95ff
diff --git a/lib/graphql/relay/relation_connection.rb b/lib/graphql/relay/relation_connection.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/relay/relation_connection.rb +++ b/lib/graphql/relay/relation_connection.rb @@ -124,7 +124,7 @@ module GraphQL # If a relation contains a `.group` clause, a `.count` will return a Hash. def relation_count(relation) count_or_hash = if(defined?(ActiveRecord::Relation) && relation.is_a?(ActiveRecord::Relation)) - relation.count(:all) + relation.respond_to?(:unscope)? relation.unscope(:order).count(:all) : relation.count(:all) else # eg, Sequel::Dataset, don't mess up others relation.count end
Add unscope(:order) to relation count on relay
rmosolgo_graphql-ruby
train
rb
5560f8abd9b4361d88755a9e3094fe2c13cedba9
diff --git a/librarian/card.py b/librarian/card.py index <HASH>..<HASH> 100644 --- a/librarian/card.py +++ b/librarian/card.py @@ -106,13 +106,13 @@ class Card(object): def __eq__(self, other): """Return True if this card's code is the same as the other's code.""" - return self.code == other.code + return isinstance(other, Card) and self.code == other.code def __neq__(self, other): """ Return True if this card's code is not the same as the other's code. """ - return self.code != other.code + return isinstance(other, Card) and self.code != other.code def __str__(self): """
Added instance clause to equality operators on Card
Nekroze_librarian
train
py
d5d71dd1e6e0fe2620236aa2b7f5be6547ba6dbf
diff --git a/lib/lastpass/version.rb b/lib/lastpass/version.rb index <HASH>..<HASH> 100644 --- a/lib/lastpass/version.rb +++ b/lib/lastpass/version.rb @@ -2,5 +2,5 @@ # Licensed under the terms of the MIT license. See LICENCE for details. module LastPass - VERSION = "1.6.1" + VERSION = "1.7.0" end
Version bumped to <I>
detunized_lastpass-ruby
train
rb
51ff5cba38c84bf948860f5aa9970f7df4676d00
diff --git a/command/output.go b/command/output.go index <HASH>..<HASH> 100644 --- a/command/output.go +++ b/command/output.go @@ -247,7 +247,9 @@ func (c *OutputCommand) Help() string { Usage: terraform output [options] [NAME] Reads an output variable from a Terraform state file and prints - the value. If NAME is not specified, all outputs are printed. + the value. With no additional arguments, output will display all + the outputs for the root module. If NAME is not specified, all + outputs are printed. Options:
Align the help string of output with documentation (#<I>)
hashicorp_terraform
train
go
db1ef587c25f82d93a4fee3fe1e28779bf669895
diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js index <HASH>..<HASH> 100644 --- a/lib/helper/Puppeteer.js +++ b/lib/helper/Puppeteer.js @@ -1865,7 +1865,7 @@ class Puppeteer extends Helper { if (!els || els.length === 0) { return false; } - return Array.prototype.filter.call(els, el => (el.value || '').indexOf(value) !== -1).length > 0; + return Array.prototype.filter.call(els, el => (el.value.toString() || '').indexOf(value) !== -1).length > 0; }; waiter = context.waitForFunction(valueFn, { timeout: waitTimeout }, locator.value, value); } else {
Fixed error with waitForFunction not working with number values (#<I>)
Codeception_CodeceptJS
train
js
e3d4e61d01c8dd8b111984f2177660f10e63f628
diff --git a/lib/configurator/bindings.rb b/lib/configurator/bindings.rb index <HASH>..<HASH> 100644 --- a/lib/configurator/bindings.rb +++ b/lib/configurator/bindings.rb @@ -8,6 +8,10 @@ module Configurator base.send :include, Singleton base.send :include, InstanceMethods base.extend self + + # allow for reloading of target class + base.class_eval { remove_instance_variable(:@config) if defined? @config } + base.class_eval(<<-EOF, __FILE__, __LINE__ + 1) def self.method_missing(method, *args, &block) return super unless instance.respond_to? method
allow reloading of target class
rabbitt_configurator
train
rb
f4adb35b9a3746fca7e87c68a657fc6bb7990839
diff --git a/builder/vmware/step_type_boot_command.go b/builder/vmware/step_type_boot_command.go index <HASH>..<HASH> 100644 --- a/builder/vmware/step_type_boot_command.go +++ b/builder/vmware/step_type_boot_command.go @@ -73,6 +73,8 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc return multistep.ActionHalt } + log.Printf("Host IP for the VMware machine: %s", hostIp) + tplData := &bootCommandTemplateData{ hostIp, httpPort,
builder/vmware: more logs for Workstation
hashicorp_packer
train
go
7ceb91135bc0f743866265f38ab6df25949b6b1a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,8 @@ var throughs = require('./throughs') exports = module.exports = require('./pull') +exports.pull = exports + for(var k in sources) exports[k] = sources[k]
export pull function like the rest (#<I>)
pull-stream_pull-stream
train
js
8ea5476d4782a5591e572857e5b8e076f8932d75
diff --git a/src/Bkwld/Decoy/Models/Base.php b/src/Bkwld/Decoy/Models/Base.php index <HASH>..<HASH> 100644 --- a/src/Bkwld/Decoy/Models/Base.php +++ b/src/Bkwld/Decoy/Models/Base.php @@ -621,7 +621,7 @@ abstract class Base extends Eloquent implements SluggableInterface { * @return string An image tag */ public function croppaTag($width = null, $height = null, $field = 'image', $crop_style = null, $options = null) { - if (!($url = $this->croppa($width, $height, $crop_style, $field, $options))) return; + if (!($url = $this->croppa($width, $height, $field, $crop_style, $options))) return; return "<img src='{$url}' alt=''/>"; } @@ -637,7 +637,7 @@ abstract class Base extends Eloquent implements SluggableInterface { * @return string An image tag */ public function croppaBkgd($width = null, $height = null, $field = 'image', $crop_style = null, $options = null) { - if (!($url = $this->croppa($width, $height, $crop_style, $field, $options))) return; + if (!($url = $this->croppa($width, $height, $field, $crop_style, $options))) return; return "background-image:url('{$url}')"; }
Fix the forwarded croppa calls Since the method signature changed
BKWLD_decoy
train
php
58f752cf09bc88a864a70eebad148bf78ff068d3
diff --git a/tests/BrowscapTest/UserAgentsTest.php b/tests/BrowscapTest/UserAgentsTest.php index <HASH>..<HASH> 100644 --- a/tests/BrowscapTest/UserAgentsTest.php +++ b/tests/BrowscapTest/UserAgentsTest.php @@ -76,9 +76,11 @@ class UserAgentsTest extends \PHPUnit_Framework_TestCase continue; } - $fileData = require_once $file->getPathname(); + $tests = require_once $file->getPathname(); - $data = array_merge($data, $fileData); + foreach ($tests as $test) { + $data[] = $test; + } } return $data;
do not use test keys for merged result
browscap_browscap
train
php
416898d2a5f1663706f9d764f8d5278b4b4e35a9
diff --git a/categories/models.py b/categories/models.py index <HASH>..<HASH> 100644 --- a/categories/models.py +++ b/categories/models.py @@ -107,10 +107,14 @@ class Category(MPTTModel): super(Category, self).save(*args, **kwargs) - for item in self.get_descendants(): - if item.active != self.active: - item.active = self.active - item.save() + # While you can activate an item without activating its descendants, + # It doesn't make sense that you can deactivate an item and have its + # decendants remain active. + if not self.active: + for item in self.get_descendants(): + if item.active != self.active: + item.active = self.active + item.save() class Meta: verbose_name_plural = 'categories'
Changed behavior of (de)activating an item within the change form: Instead of changing all descendants' active status to the current item's, it will only change the descendants' active status if the item is False. As it makes sense to have an item active, but its children inactive, it doesn't make sense that an item is inactive, but its descendants are active. This doesn't change the activate/deactivate admin actions. They will always affect an item and its descendants.
callowayproject_django-categories
train
py
f2af9db8b41fa6a86170d715c7d63aad82c313a1
diff --git a/spec/swag_dev/project/tools_provider_spec.rb b/spec/swag_dev/project/tools_provider_spec.rb index <HASH>..<HASH> 100644 --- a/spec/swag_dev/project/tools_provider_spec.rb +++ b/spec/swag_dev/project/tools_provider_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'securerandom' +require 'swag_dev/project/tools' require 'swag_dev/project/tools_provider' describe SwagDev::Project::ToolsProvider, :tools_provider do @@ -35,9 +36,9 @@ describe SwagDev::Project::ToolsProvider, :tools_provider do build('tools').keys.each do |k| context "#to_h[#{k}]" do it do - # @todo really vague, all present tools SHOULD inherit from BaseTool - expect(subject.to_h[k]).to be_a(Object) + # SHOULD receive ``BaseTool`` instances expect(subject.to_h[k]).not_to be_a(String) + expect(subject.to_h[k]).to be_a(SwagDev::Project::Tools::BaseTool) end end end @@ -98,7 +99,7 @@ describe SwagDev::Project::ToolsProvider, :tools_provider do let(:target) { build('tools').keys[0] } let(:replacement) { random_tools.to_a[0][1] } - # replace an original tool by a arbitrary class + # replace an original tool by an arbitrary class context '.fetch(k).class' do it do subject[target] = replacement
tools_provider (spec) tools SHOULD inherit from "BaseTool" + comment typo
SwagDevOps_kamaze-project
train
rb
733bba52cd5c57332976a8e16c5a66be1ea87ef8
diff --git a/tests/quality/test_pep8.py b/tests/quality/test_pep8.py index <HASH>..<HASH> 100644 --- a/tests/quality/test_pep8.py +++ b/tests/quality/test_pep8.py @@ -17,7 +17,7 @@ from tests import TestCase @pytest.mark.quality class TPEP8(TestCase): - IGNORE = ["E128", "W601", "E402", "E731", "W503"] + IGNORE = ["E128", "W601", "E402", "E731", "W503", "E741", "E305"] def _run(self, path, ignore=None): if ignore is None:
Update pep8 ignore list for new pep8 <I> release
quodlibet_mutagen
train
py
7a2504d5e5cf924e798eef8e82e6f40b3f136ac6
diff --git a/war/src/main/js/widgets/config/model/ConfigTableMetaData.js b/war/src/main/js/widgets/config/model/ConfigTableMetaData.js index <HASH>..<HASH> 100644 --- a/war/src/main/js/widgets/config/model/ConfigTableMetaData.js +++ b/war/src/main/js/widgets/config/model/ConfigTableMetaData.js @@ -219,10 +219,6 @@ ConfigTableMetaData.prototype.showSection = function(section) { section.activator.addClass('active'); section.markRowsAsActive(); - // Hide the section header row. No need for it now because the - // tab text acts as the section label. - $('.section-header-row').hide(); - // and always show the buttons topRows.filter('.config_buttons').show();
No need to explicitly hide the header row anymore ConfigSection.markRowsAsActive does that for us by not showing the headerRow.
jenkinsci_jenkins
train
js
cf9ddf73a7ffcb85ee899509686d753a53514800
diff --git a/command/agent/rpc_client.go b/command/agent/rpc_client.go index <HASH>..<HASH> 100644 --- a/command/agent/rpc_client.go +++ b/command/agent/rpc_client.go @@ -50,7 +50,7 @@ func (c *RPCClient) Monitor(level logutils.LogLevel, ch chan<- string, done <-ch var lock sync.Mutex internalDone := make(chan struct{}) - l, err := net.Listen("tcp", "0.0.0.0:0") + l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { return err }
command/monitor: fixing #<I>, bind to localhost only
hashicorp_serf
train
go
73b35826e9a2cec9a36cec0ddc2ba8f08daa19ab
diff --git a/library/src/main/java/com/liulishuo/filedownloader/services/FileDownloadMgr.java b/library/src/main/java/com/liulishuo/filedownloader/services/FileDownloadMgr.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/liulishuo/filedownloader/services/FileDownloadMgr.java +++ b/library/src/main/java/com/liulishuo/filedownloader/services/FileDownloadMgr.java @@ -69,7 +69,7 @@ class FileDownloadMgr { FileDownloadModel model = mHelper.find(id); // check has already in download pool - if (checkDownloading(url, path)) { + if (!needStart(id)) { if (FileDownloadLog.NEED_LOG) { FileDownloadLog.d(this, "has already started download %d", id); } @@ -122,6 +122,30 @@ class FileDownloadMgr { } + private boolean needStart(int downloadId) { + final FileDownloadModel model = mHelper.find(downloadId); + if (model == null) { + return true; + } + + boolean needStart = false; + do { + + if (checkDownloading(downloadId)) { + break; + } + + if (checkReuse(downloadId, model)) { + break; + } + + needStart = true; + + } while (false); + + return needStart; + } + public boolean checkDownloading(String url, String path) { return checkDownloading(FileDownloadUtils.generateId(url, path)); }
fix(handful-cases warn): handle the case of the downloading is finished during the check-reuse to check-downloading in filedownloader-process
lingochamp_FileDownloader
train
java
4bf5f50b00263e5688dcead8132f403899756a73
diff --git a/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/TargetType.java b/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/TargetType.java index <HASH>..<HASH> 100644 --- a/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/TargetType.java +++ b/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/TargetType.java @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.hazelcast.simulator.protocol.registry; /**
Added missing file header to TargetType.
hazelcast_hazelcast-simulator
train
java
7f930fa83cb56b3d278546934a4b38825b1f90ac
diff --git a/pharen.php b/pharen.php index <HASH>..<HASH> 100644 --- a/pharen.php +++ b/pharen.php @@ -1503,10 +1503,12 @@ class MacroNode extends FuncDefNode{ } $old_ns = RootNode::$ns; RootNode::$ns = $macronode->macro_ns; + $old_tmpfunc = Node::$tmpfunc; $code = $macronode->parent_compile(); RootNode::$ns = $old_ns; if($macronode->evaluated || function_exists($name)){ Node::add_tmpfunc(''); + Node::$tmpfunc = $old_tmpfunc; return; }else{ $code = "use Pharen\Lexical as Lexical;\n"
Fix bug where buried lambdas were not added to the PHP code.
Scriptor_pharen
train
php
8fb3054768225bdb92658971af8b8a7ccdb5c827
diff --git a/huawei_lte_api/api/User.py b/huawei_lte_api/api/User.py index <HASH>..<HASH> 100644 --- a/huawei_lte_api/api/User.py +++ b/huawei_lte_api/api/User.py @@ -74,18 +74,17 @@ class User(ApiGroup): return result == ResponseEnum.OK.value def login(self, force_new_login: bool=False) -> bool: - retries = 5 - for i in range(retries): + tries = 5 + for i in range(tries): try: state_login = self.state_login() except ConnectionError as e: # Some models reportedly close the connection if we attempt to access login state too soon after # setting up the session etc. In that case, retry a few times. The error is reported to be # ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) - if i == retries - 1 or not isinstance( - getattr(e, '__context__', getattr(e, '__cause__', None)), ConnectionResetError): + if i == tries - 1: raise - time.sleep(i/10) + time.sleep((i + 1)/10) except ResponseErrorNotSupportedException: return True
Trigger login state retries on all ConnectionErrors, fix intended sleep amount
Salamek_huawei-lte-api
train
py
5d402643aa2b8c36c3611c533a27ecc4ff626fc4
diff --git a/pout.py b/pout.py index <HASH>..<HASH> 100644 --- a/pout.py +++ b/pout.py @@ -124,9 +124,9 @@ def c(*args): for arg in args: arg = _get_unicode(arg) lines.append(u'Total Characters: {}'.format(len(arg))) - for c in arg: + for i, c in enumerate(arg, 1): - line = [] + line = [u'{}.'.format(i)] if c == u'\n': line.append(u'\\n') elif c == u'\r':
adds the character number to each char printed with c()
Jaymon_pout
train
py
e1bf45aa8020a801a553768d081a7e8948ceffd6
diff --git a/src/Composer/Autoload/PhpFileCleaner.php b/src/Composer/Autoload/PhpFileCleaner.php index <HASH>..<HASH> 100644 --- a/src/Composer/Autoload/PhpFileCleaner.php +++ b/src/Composer/Autoload/PhpFileCleaner.php @@ -120,6 +120,7 @@ class PhpFileCleaner } if ($this->peek('*')) { $this->skipComment(); + continue; } } diff --git a/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php b/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php index <HASH>..<HASH> 100644 --- a/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php +++ b/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php @@ -4,3 +4,5 @@ namespace Foo\Bar; class A {} class B {} + +$x = `/** unterminated comment`;
Fix issue parsing php files with unterminated comments found inside backticks, fixes #<I>
composer_composer
train
php,php
5f5ce18e76ded8e04efa5150ea75037494922f11
diff --git a/test/fuzz_fusil_2/runner.py b/test/fuzz_fusil_2/runner.py index <HASH>..<HASH> 100644 --- a/test/fuzz_fusil_2/runner.py +++ b/test/fuzz_fusil_2/runner.py @@ -31,7 +31,7 @@ class Fuzzer(Application): '--port', str(port), '--seed', str(seed), '--fuzz-period', '500', - '--restart-interval', '10000', + '--restart-interval', '250', ], timeout=timeout ) @@ -48,6 +48,8 @@ class Fuzzer(Application): '--debug', '--page-requisites', '--delete-after', + '--tries', '2', + '--retry-connrefused', ], timeout=timeout ) @@ -68,11 +70,17 @@ class Fuzzer(Application): r'WARNING Discarding malformed URL ' ) stdout_watcher.ignoreRegex( + r'WARNING Failed to read document at ' + ) + stdout_watcher.ignoreRegex( r'ERROR Fetching ' ) stdout_watcher.ignoreRegex( r'DEBUG ' ) + stdout_watcher.ignoreRegex( + r'INFO Fetch(ed|ing) ' + ) if __name__ == "__main__": Fuzzer().main()
fixup! fuzz_fusil_2: Update runner to match new conditions.
ArchiveTeam_wpull
train
py
ecf57dc3df92283a2cfe9b8be1c37aeb5d39d0cf
diff --git a/Tests/Controller/Admin/UserGroupControllerTest.php b/Tests/Controller/Admin/UserGroupControllerTest.php index <HASH>..<HASH> 100755 --- a/Tests/Controller/Admin/UserGroupControllerTest.php +++ b/Tests/Controller/Admin/UserGroupControllerTest.php @@ -14,7 +14,6 @@ namespace WellCommerce\Bundle\AdminBundle\Tests\Controller\Admin; use Doctrine\Common\Collections\Criteria; use WellCommerce\Bundle\AdminBundle\Entity\UserGroupInterface; -use WellCommerce\Bundle\AdminBundle\Entity\UserInterface; use WellCommerce\Bundle\CoreBundle\Test\Controller\Admin\AbstractAdminControllerTestCase; /**
Optimized imports (cherry picked from commit 1e<I>c<I>bb<I>d<I>c6e2bb<I>ec<I>d<I>)
WellCommerce_WishlistBundle
train
php
88e81f21130d5b7d3cb5b784f1a2f537737cd4dd
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -31,7 +31,7 @@ const NPM_VERSION = '7.6.1'; const OPENAPI_GENERATOR_CLI_VERSION = '1.0.13-4.3.1'; const GRADLE_VERSION = '6.8.2'; -const JIB_VERSION = '2.7.1'; +const JIB_VERSION = '2.8.0'; // Libraries version const JHIPSTER_DEPENDENCIES_VERSION = '7.0.0-SNAPSHOT';
Update jib-maven-plugin version to <I>
jhipster_generator-jhipster
train
js
a0a5ca25788929697d43e8a01952fc4084dd319c
diff --git a/auth/db/auth.php b/auth/db/auth.php index <HASH>..<HASH> 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -65,7 +65,7 @@ class auth_plugin_db extends auth_plugin_base { $authdb->Close(); // user exists externally // check username/password internally - if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) { + if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id, 'auth'=>$this->authtype))) { return validate_internal_user_password($user, $password); } } else {
MDL-<I> always lookpup passwords only in records from current auth plugin This bug should not be creating any problems thanks to our design of login process, but it should be fixed anyway.
moodle_moodle
train
php
5a61279d7432fa110553b6b351cbbb489e6ed82e
diff --git a/web/src/main/java/uk/ac/ebi/atlas/search/baseline/BaselineExperimentSearchResultProducer.java b/web/src/main/java/uk/ac/ebi/atlas/search/baseline/BaselineExperimentSearchResultProducer.java index <HASH>..<HASH> 100644 --- a/web/src/main/java/uk/ac/ebi/atlas/search/baseline/BaselineExperimentSearchResultProducer.java +++ b/web/src/main/java/uk/ac/ebi/atlas/search/baseline/BaselineExperimentSearchResultProducer.java @@ -48,7 +48,7 @@ public class BaselineExperimentSearchResultProducer { for (Map.Entry<BaselineExperimentSlice, Collection<BaselineExperimentExpression>> baselineExperimentSliceCollectionEntry : expressionsByExperimentSlice.asMap().entrySet()) { BaselineExperiment experiment = baselineExperimentSliceCollectionEntry.getKey().experiment(); - if (experiment.getExperimentalFactors().getDefaultQueryFactorType().equals(defaultQueryFactorType)) { + if (experiment.getExperimentalFactors().getDefaultQueryFactorType().equalsIgnoreCase(defaultQueryFactorType)) { builder.putAll(baselineExperimentSliceCollectionEntry.getKey(), baselineExperimentSliceCollectionEntry.getValue()); } }
Solr is using now text_lower for defaultQueryFactorType
ebi-gene-expression-group_atlas
train
java
478112d7607ba7d127c06ee87c85bc5fd8cdf786
diff --git a/spyder/plugins/completion/kite/utils/install.py b/spyder/plugins/completion/kite/utils/install.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/completion/kite/utils/install.py +++ b/spyder/plugins/completion/kite/utils/install.py @@ -149,7 +149,7 @@ class KiteInstallationThread(QThread): stderr=subprocess.STDOUT, shell=True ) - while True and not self.cancelled: + while not self.cancelled: progress = download_process.stdout.readline() progress = to_text_string(progress, "utf-8") if progress == '' and download_process.poll() is not None: @@ -159,10 +159,12 @@ class KiteInstallationThread(QThread): current_progress = download_progress.split('/')[0] total_size = download_progress.split('/')[1] self.sig_download_progress.emit(current_progress, total_size) - download_process.stdout.close() - return_code = download_process.wait() + if self.cancelled: raise KiteInstallationCancelledException() + + download_process.stdout.close() + return_code = download_process.wait() if return_code: raise subprocess.CalledProcessError(return_code, download_command)
Kite: Minor fix when in installation thread
spyder-ide_spyder
train
py
be862351ddfcfc8e5e6b7530d297497cc7a5c38d
diff --git a/visidata/asyncthread.py b/visidata/asyncthread.py index <HASH>..<HASH> 100644 --- a/visidata/asyncthread.py +++ b/visidata/asyncthread.py @@ -10,7 +10,7 @@ from .vdtui import * from visidata import vd, option, options, status, globalCommand, Sheet, EscapeException from visidata import ColumnAttr, Column, ENTER -__all__ = ['Progress', 'asynccache', 'async_deepcopy', 'elapsed_s', 'cancelThread', 'ThreadsSheet'] +__all__ = ['Progress', 'asynccache', 'async_deepcopy', 'elapsed_s', 'cancelThread', 'ThreadsSheet', 'ProfileSheet'] option('profile', '', 'filename to save binary profiling data')
[asyncthread-] export ProfileSheet
saulpw_visidata
train
py
2841ccc8a7e3d54d6719b066a19fd30568698661
diff --git a/models/classes/LtiProvider/LtiProviderFactory.php b/models/classes/LtiProvider/LtiProviderFactory.php index <HASH>..<HASH> 100644 --- a/models/classes/LtiProvider/LtiProviderFactory.php +++ b/models/classes/LtiProvider/LtiProviderFactory.php @@ -70,7 +70,7 @@ class LtiProviderFactory extends ConfigurableService public function createFromArray(array $provider): LtiProvider { - $ltiVersion = $provider[ConfigurableLtiProviderRepository::LTI_VERSION] ?: '1.1'; + $ltiVersion = $provider[ConfigurableLtiProviderRepository::LTI_VERSION] ?? '1.1'; $this->getValidationService()->validateArray($ltiVersion, $provider);
Update models/classes/LtiProvider/LtiProviderFactory.php
oat-sa_extension-tao-lti
train
php
78b8f89bd25a90b6da4d7b2cf0f641e472f9d313
diff --git a/tests/Large/G/Entity/Testing/EntityGenerator/TestEntityGeneratorLargeTest.php b/tests/Large/G/Entity/Testing/EntityGenerator/TestEntityGeneratorLargeTest.php index <HASH>..<HASH> 100644 --- a/tests/Large/G/Entity/Testing/EntityGenerator/TestEntityGeneratorLargeTest.php +++ b/tests/Large/G/Entity/Testing/EntityGenerator/TestEntityGeneratorLargeTest.php @@ -32,7 +32,7 @@ class TestEntityGeneratorLargeTest extends AbstractLargeTest private const TEST_ENTITY = self::TEST_ENTITY_NAMESPACE_BASE . TestCodeGenerator::TEST_ENTITY_PERSON; - private const TEST_ENTITY_SIMPLE = self::TEST_ENTITY_NAMESPACE_BASE . TestCodeGenerator::TEST_ENTITY_EMAIL; + private const TEST_ENTITY_SIMPLE = self::TEST_ENTITY_NAMESPACE_BASE . TestCodeGenerator::TEST_ENTITY_SIMPLE; protected static $buildOnce = true;
Updating a constant to be what it says it is
edmondscommerce_doctrine-static-meta
train
php
374d85fd2e4604f31706209e506a95685acefe7b
diff --git a/js/kraken.js b/js/kraken.js index <HASH>..<HASH> 100644 --- a/js/kraken.js +++ b/js/kraken.js @@ -171,18 +171,22 @@ module.exports = class kraken extends Exchange { 'private': { 'post': [ 'AddOrder', + 'AddExport', 'Balance', 'CancelOrder', 'ClosedOrders', 'DepositAddresses', 'DepositMethods', 'DepositStatus', + 'ExportStatus', 'Ledgers', 'OpenOrders', 'OpenPositions', 'QueryLedgers', 'QueryOrders', 'QueryTrades', + 'RetrieveExport', + 'RemoveExport', 'TradeBalance', 'TradesHistory', 'TradeVolume',
Kraken: Add report export management endpoints
ccxt_ccxt
train
js
6e4c7ffe7ee003734c07c780c15cf757fce38145
diff --git a/bin/cmd.js b/bin/cmd.js index <HASH>..<HASH> 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -320,7 +320,7 @@ function runDownload (torrentId) { .on('error', function (err) { // In case the port is unusable - if (err.code === 'EADDRINUSE') { + if (err.code === 'EADDRINUSE' || err.code === 'EACCES') { // Let the OS choose one for us server.listen(0, initServer) }
Pick a new port on EACCES
webtorrent_webtorrent
train
js
ee039fa4d45d5a16709c5a001b99937793bae9e5
diff --git a/master/setup.py b/master/setup.py index <HASH>..<HASH> 100755 --- a/master/setup.py +++ b/master/setup.py @@ -194,19 +194,21 @@ else: if sys.version_info[:2] >= (2, 6): setup_args['install_requires'] += [ 'twisted >= 9.0.0', + 'Jinja2 >= 2.1', ] else: # Latest supported on Python 2.5 version of Twisted is 12.10, and # pip/easy_install currently can't select correct version of Twisted. # Twisted depends on zope.interface, which became incompatible with # Python 2.5 starting from 4.0.0 release. + # Jinja2 dropped Python 2.5 support in 2.7 release. setup_args['install_requires'] += [ 'twisted >= 9.0.0, <= 12.1.0', 'zope.interface < 4.0.0', + 'Jinja2 >= 2.1, < 2.7', ] setup_args['install_requires'] += [ - 'Jinja2 >= 2.1', # sqlalchemy-0.8 betas show issues with sqlalchemy-0.7.2, so stick to 0.7.10 'sqlalchemy >= 0.6, <= 0.7.10', # buildbot depends on sqlalchemy internals, and these are the tested
On Python <I> use Jinja2 version that works with Python <I> Python <I> support was dropped in <I> release: <<URL>
buildbot_buildbot
train
py
262d7fefbb285cd865b6803a63b81566d44368bd
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,8 @@ Object.assign( reactNativeElements.reduce((getters, key) => { const tag = key.toLowerCase() getters[tag] = glamorous(ReactNativeElementMap[key]) + // backward compatible camel case + getters[camelCase(key)] = getters[tag] return getters }, {}), ) @@ -27,5 +29,9 @@ Object.assign( }, {}), ) +function camelCase(tagName) { + return tagName.slice(0, 1).toLowerCase() + tagName.slice(1) +} + export default glamorous export {ThemeProvider, withTheme}
feat(glamorous): add camel case aliases to builtin component factories (#<I>) glamorous.touchablehighlight -> glamorous.touchableHighlight
robinpowered_glamorous-native
train
js
973f3b38f5b942133175e954b704cb661dda1964
diff --git a/library/src/main/java/com/vanniktech/rxpermission/RealRxPermission.java b/library/src/main/java/com/vanniktech/rxpermission/RealRxPermission.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/vanniktech/rxpermission/RealRxPermission.java +++ b/library/src/main/java/com/vanniktech/rxpermission/RealRxPermission.java @@ -2,6 +2,7 @@ package com.vanniktech.rxpermission; import android.annotation.TargetApi; import android.app.Application; +import android.content.Context; import io.reactivex.Observable; import io.reactivex.ObservableSource; import io.reactivex.ObservableTransformer; @@ -28,13 +29,13 @@ public final class RealRxPermission implements RxPermission { static RealRxPermission instance; /** - * @param application your android application + * @param context any context * @return a Singleton instance of this class */ - public static RealRxPermission getInstance(final Application application) { + public static RealRxPermission getInstance(final Context context) { synchronized (RealRxPermission.class) { if (instance == null) { - instance = new RealRxPermission(application); + instance = new RealRxPermission((Application) context.getApplicationContext()); } }
Accept a Context rather than Application in RealRxPermission#getInstance() (#<I>)
vanniktech_RxPermission
train
java
fdb891e180242578a04433229d5fc020ee4605d5
diff --git a/FormBuilder.php b/FormBuilder.php index <HASH>..<HASH> 100755 --- a/FormBuilder.php +++ b/FormBuilder.php @@ -618,7 +618,7 @@ class FormBuilder { { if ( ! $this->oldInputIsEmpty() and is_null($this->old($name))) return false; - if (is_null($this->old($name))) return $checked; + if ($this->missingOldAndModel($name)) return $checked; return (bool) $this->getValueAttribute($name); } @@ -633,12 +633,23 @@ class FormBuilder { */ protected function getRadioCheckedState($name, $value, $checked) { - if (is_null($this->old($name))) return $checked; + if ($this->missingOldAndModel($name)) return $checked; return $this->getValueAttribute($name) == $value; } /** + * Determine if old input or model input exists for a key. + * + * @param string $name + * @return bool + */ + protected function missingOldAndModel($name) + { + return (is_null($this->old($name)) and is_null($this->getModelValueAttribute($name))); + } + + /** * Create a HTML reset input element. * * @param string $value
Fix form builder with model binding.
LaravelCollective_html
train
php
1468c654692045d1fc8ff4cc3d1363cfe2ac206b
diff --git a/TYPO3.Media/Classes/TYPO3/Media/TypeConverter/AssetInterfaceConverter.php b/TYPO3.Media/Classes/TYPO3/Media/TypeConverter/AssetInterfaceConverter.php index <HASH>..<HASH> 100644 --- a/TYPO3.Media/Classes/TYPO3/Media/TypeConverter/AssetInterfaceConverter.php +++ b/TYPO3.Media/Classes/TYPO3/Media/TypeConverter/AssetInterfaceConverter.php @@ -240,7 +240,11 @@ class AssetInterfaceConverter extends PersistentObjectConverter protected function buildObject(array &$possibleConstructorArgumentValues, $objectType) { $className = $this->objectManager->getClassNameByObjectName($objectType) ?: static::$defaultNewAssetType; - return parent::buildObject($possibleConstructorArgumentValues, $className); + if (count($possibleConstructorArgumentValues)) { + return parent::buildObject($possibleConstructorArgumentValues, $className); + } else { + return null; + } } /**
[BUGFIX] Avoid "Missing constructor argument" exception The type converter would always call buildObject() on the parent, even if the possible constructor arguments were empty. This lead to: Missing constructor argument "resource" for object of type "TYPO3\Media\Domain\Model\Asset". A check is added to avoid that.
neos_neos-development-collection
train
php
d6bb387069f59f945d7d15b3c327112db2f3c606
diff --git a/src/main/java/org/bff/javampd/player/MPDPlayer.java b/src/main/java/org/bff/javampd/player/MPDPlayer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/bff/javampd/player/MPDPlayer.java +++ b/src/main/java/org/bff/javampd/player/MPDPlayer.java @@ -152,7 +152,7 @@ public class MPDPlayer implements Player { @Override public void seekId(MPDSong song, long secs) throws MPDPlayerException { List<String> response = null; - String params[] = new String[2]; + String[] params = new String[2]; params[1] = Long.toString(secs); if (song == null) { if (getCurrentSong().getLength() > secs) {
array designator should be on type not the variable
finnyb_javampd
train
java
72a70cfe7f9193a6bd5166e3aab69cf39a305c5a
diff --git a/allaccess/fields.py b/allaccess/fields.py index <HASH>..<HASH> 100644 --- a/allaccess/fields.py +++ b/allaccess/fields.py @@ -48,6 +48,9 @@ class EncryptedField(models.TextField): return value def get_db_prep_value(self, value, connection=None, prepared=False): + if self.null: + # Normalize empty values to None + value = value or None if value is None: return None value = smart_str(value) diff --git a/allaccess/models.py b/allaccess/models.py index <HASH>..<HASH> 100644 --- a/allaccess/models.py +++ b/allaccess/models.py @@ -14,8 +14,8 @@ class Provider(models.Model): authorization_url = models.URLField() access_token_url = models.URLField() profile_url = models.URLField(blank=True) - key = EncryptedField(blank=True) - secret = EncryptedField(blank=True) + key = EncryptedField(blank=True, null=True, default=None) + secret = EncryptedField(blank=True, null=True, default=None) class AccountAccess(models.Model):
Normalize blank values to None since empty strings will be encrypted.
mlavin_django-all-access
train
py,py
564fa015363bdd8309642e9cd7967878bae490cf
diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -20,7 +20,7 @@ import ( // The presence and format of this constant is very important. // The debian/rules build recipe uses this value for the version // number of the release package. -const version = "2.7.3" +const version = "2.7.4" const ( // TreeStateDirty when the build was made with a dirty checkout.
Update the version to <I>
juju_juju
train
go