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
eaed59c835760a61b00daada9f7c44a095cb6a64
diff --git a/readability/clients.py b/readability/clients.py index <HASH>..<HASH> 100644 --- a/readability/clients.py +++ b/readability/clients.py @@ -53,6 +53,8 @@ class ReaderClient(object): """ params = urllib.urlencode(post_params) logger.debug('Making POST request to %s with body %s', url, params) + print url + print params return self._create_response( *self.oauth_client.request(url, method='POST', body=params)) @@ -193,7 +195,9 @@ class ReaderClient(object): """Adds given bookmark.""" rdb_url = self._generate_url('bookmarks') - params = dict(url=url, favorite=favorite, archive=archive) + fav_param = '1' if favorite else '0' + archive_param = '1' if archive else '0' + params = dict(url=url, favorite=fav_param, archive=archive_param) return self.post(rdb_url, params) def delete_bookmark(self, bookmark_id):
Send 1s and 0s for boolean params
ReadabilityHoldings_python-readability-api
train
py
629f4e99a9fd028fdd544f30a45d9a694afe472d
diff --git a/src/org/lantern/test/TerminalResizeTest.java b/src/org/lantern/test/TerminalResizeTest.java index <HASH>..<HASH> 100644 --- a/src/org/lantern/test/TerminalResizeTest.java +++ b/src/org/lantern/test/TerminalResizeTest.java @@ -19,6 +19,7 @@ package org.lantern.test; import org.lantern.LanternException; import org.lantern.LanternTerminal; +import org.lantern.input.Key; import org.lantern.terminal.Terminal; import org.lantern.terminal.TerminalSize; @@ -45,7 +46,13 @@ public class TerminalResizeTest implements Terminal.ResizeListener terminal.moveCursor(0, 0); terminal.addResizeListener(new TerminalResizeTest()); - Thread.sleep(10000); + while(true) { + Key key = terminal.readInput(); + if(key == null || key.getCharacter() != 'q') + Thread.sleep(1); + else + break; + } terminal.exitPrivateMode(); }
Quit the test with 'q'
mabe02_lanterna
train
java
9332b6a770c6c0e45a99cdb0c3dd550922fe7cc9
diff --git a/ui/js/controllers/bugfiler.js b/ui/js/controllers/bugfiler.js index <HASH>..<HASH> 100644 --- a/ui/js/controllers/bugfiler.js +++ b/ui/js/controllers/bugfiler.js @@ -257,7 +257,7 @@ treeherder.controller('BugFilerCtrl', [ var keywords = $scope.isIntermittent ? ["intermittent-failure"] : []; - var severity = ""; + var severity = "normal"; var blocks = $scope.modalBlocks; var dependsOn = $scope.modalDependsOn; var seeAlso = $scope.modalSeeAlso;
Bug <I> - Ensure a valid severity is sest when filing bugs (#<I>)
mozilla_treeherder
train
js
cbbefcac0e17410d87a88c4031fadde2aa52bdf9
diff --git a/src/super.js b/src/super.js index <HASH>..<HASH> 100644 --- a/src/super.js +++ b/src/super.js @@ -22,7 +22,9 @@ Super.prototype.on = function (arg, cb) { Super.prototype.off = function (type, cb) { var self = this; - if (self.handlers[type] && self.handlers[type].indexOf(cb) >= 0) { + if (cb === undefined) { + self.handlers[type] = []; + } else if (self.handlers[type] && self.handlers[type].indexOf(cb) >= 0) { self.handlers[type].splice(self.handlers[type].indexOf(cb), 1); } return self;
feat(off): allow unsubscribing of a type at once
yoannmoinet_nipplejs
train
js
a92bb174a2686f6467237c64523f475ca99b9034
diff --git a/ceph_deploy/util/decorators.py b/ceph_deploy/util/decorators.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/util/decorators.py +++ b/ceph_deploy/util/decorators.py @@ -1,4 +1,5 @@ import logging +import os import sys import traceback from functools import wraps @@ -80,15 +81,16 @@ def catches(catch=None, handler=None, exit=True): # This block is crucial to avoid having issues with # Python spitting non-sense thread exceptions. We have already # handled what we could, so close stderr and stdout. - import sys - try: - sys.stdout.close() - except: - pass - try: - sys.stderr.close() - except: - pass + if not os.environ.get('CEPH_DEPLOY_TEST'): + import sys + try: + sys.stdout.close() + except: + pass + try: + sys.stderr.close() + except: + pass return newfunc
only close stderr if we are not testing
ceph_ceph-deploy
train
py
5b48e07e1591661ee4ce7aa9e12908dce49e70e0
diff --git a/Tests/Unit/Job/JobProcessorTest.php b/Tests/Unit/Job/JobProcessorTest.php index <HASH>..<HASH> 100644 --- a/Tests/Unit/Job/JobProcessorTest.php +++ b/Tests/Unit/Job/JobProcessorTest.php @@ -173,6 +173,23 @@ class JobProcessorTest extends \PHPUnit_Framework_TestCase $this->assertNull($result); } + public function testFindOrCreateReturnsNullIfRootJobStaleByTimeButHaveNotStartedChild() + { + $job = new Job(); + $childJob = new Job(); + $childJob->setStatus(Job::STATUS_NEW); + $job->setChildJobs([$childJob]); + + list($jobConfigurationProvider, $storage) = $this->configureBaseMocksForStaleJobsCases($job, 0, $job); + + $processor = new JobProcessor($storage, $this->createMessageProducerMock()); + $processor->setJobConfigurationProvider($jobConfigurationProvider); + + $result = $processor->findOrCreateRootJob('owner-id', 'job-name', true); + + $this->assertNull($result); + } + public function testStaleRootJobAndChildrenWillChangeStatusForRootAndRunningChildren() { $rootJob = new Job();
CRM-<I>: Incorrectly staled jobs with not started child - cover by test "not stale if has not started child"
oroinc_OroMessageQueueComponent
train
php
ce241a0f98b9b6ce3dc0f0947aa80e7bfbc4c8a9
diff --git a/Src/Everon/Core.php b/Src/Everon/Core.php index <HASH>..<HASH> 100644 --- a/Src/Everon/Core.php +++ b/Src/Everon/Core.php @@ -29,7 +29,7 @@ class Core implements Interfaces\Core $Controller->result($result, $Response); } catch (Exception\InvalidRouterParameter $e) { - //todo: raise event for from validation + //todo: raise event for form validation throw $e; } catch (Exception\PageNotFound $e) { @@ -114,7 +114,7 @@ class Core implements Interfaces\Core if ($controller_has_action) { $result = $Controller->{$action}(); - $result = $result === null ? true : $result; //default is true, no need to write everywhere return true + $result = $result === null ? true : $result; //default is true, no need to write everywhere in Controllers return true if ($result) { $result_view = $this->executeViewAction($Controller->getView(), $action); @@ -164,7 +164,7 @@ class Core implements Interfaces\Core { if (method_exists($View, $action)) { $result = $View->{$action}(); - $View->setTemplateFromAction($action, $View->getData()); + $View->setOutputFromAction($action, $View->getData()); $result = $result === null ? true : $result; return $result; }
updated View's setOutputFromAction() and cleanups
oliwierptak_Everon1
train
php
fc79981c00ea5560d8125d0ec2be41a4a8d29c10
diff --git a/spec/futures_pipeline/client_spec.rb b/spec/futures_pipeline/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/futures_pipeline/client_spec.rb +++ b/spec/futures_pipeline/client_spec.rb @@ -59,7 +59,7 @@ describe FuturesPipeline::Client do context "with MOC parameter" do before do stub_get("api/v1/careers/search.json?moc=11b"). - to_return(:status => 200, :body => fixture("search.json")) + to_return(:status => 200, :body => fixture("search_by_moc.json")) end it "should return one career related to the MOC" do
Updated client spec to use search_by_moc.json
codeforamerica_futures_pipeline
train
rb
131e34abaa98de93810f06eac1dc80ed48c87d8a
diff --git a/lib/gtpl_manageronly.js b/lib/gtpl_manageronly.js index <HASH>..<HASH> 100644 --- a/lib/gtpl_manageronly.js +++ b/lib/gtpl_manageronly.js @@ -292,7 +292,6 @@ gtpl.deepCopy = function(data, escapeStringFunction, ignore_prefix, skip_prototy return data[recursion_key]; var o = {}; - data[recursion_key] = o; recursion_list.push(data); if (!skip_prototype) { @@ -305,6 +304,8 @@ gtpl.deepCopy = function(data, escapeStringFunction, ignore_prefix, skip_prototy } } + data[recursion_key] = o; + var keys = Object.keys(data); for (var j = 0; j < keys.length; j++) { var key = keys[j]; @@ -396,4 +397,4 @@ TemplateManager.prototype.import_templates = function(template_export_string, so this.__evalTemplates__(template_export_string); }; -})(); \ No newline at end of file +})();
Bugfix: don't overwrite temp object
open-publishing_GTPL
train
js
c38f739532810d95b112382cf99392ddbb675246
diff --git a/ezp/content/location.php b/ezp/content/location.php index <HASH>..<HASH> 100644 --- a/ezp/content/location.php +++ b/ezp/content/location.php @@ -31,10 +31,12 @@ class Location extends Base implements \ezp\DomainObjectInterface "hidden" => false, "visible" => true, "priority" => 0, + "containerProperties" => new ContainerPropertyCollection(), ); $this->readOnlyProperties = array( "id" => true, + "containerProperties" => true, ); $this->dynamicProperties = array( @@ -46,7 +48,7 @@ class Location extends Base implements \ezp\DomainObjectInterface protected function getParent() { - return Repository::get()->getSubtreeService()->loadLocation( $this->parentId ); + return Repository::get()->getSubtreeService()->load( $this->parentId ); } protected function setParent( Location $parent ) @@ -56,7 +58,7 @@ class Location extends Base implements \ezp\DomainObjectInterface protected function getContent() { - return Repository::get()->getContentService()->loadContent( $this->contentId ); + return Repository::get()->getContentService()->load( $this->contentId ); } protected function getChildren()
Added ContainerProperty to Location
ezsystems_ezpublish-kernel
train
php
80c3d2df14ef807f67bb9ff23e59173169e078a6
diff --git a/pkg/volume/cephfs/cephfs_test.go b/pkg/volume/cephfs/cephfs_test.go index <HASH>..<HASH> 100644 --- a/pkg/volume/cephfs/cephfs_test.go +++ b/pkg/volume/cephfs/cephfs_test.go @@ -85,9 +85,8 @@ func TestPlugin(t *testing.T) { t.Errorf("Got a nil Mounter") } volpath := path.Join(tmpDir, "pods/poduid/volumes/kubernetes.io~cephfs/vol1") - path := mounter.GetPath() - if path != volpath { - t.Errorf("Got unexpected path: %s", path) + if volumePath != volpath { + t.Errorf("Got unexpected path: %s", volumePath) } if err := mounter.SetUp(nil); err != nil { t.Errorf("Expected success, got: %v", err)
Fix errors in cephfs_test.go
kubernetes_kubernetes
train
go
d143b2d4f0f2e9efbf7b2fe647cab2ddd43c93de
diff --git a/lib/faraday/connection.rb b/lib/faraday/connection.rb index <HASH>..<HASH> 100644 --- a/lib/faraday/connection.rb +++ b/lib/faraday/connection.rb @@ -474,9 +474,7 @@ module Faraday if params uri.query = params.to_query(params_encoder || options.params_encoder) end - # rubocop:disable Style/SafeNavigation uri.query = nil if uri.query && uri.query.empty? - # rubocop:enable Style/SafeNavigation uri end
chore: Remove unnecessary lint skip
lostisland_faraday
train
rb
70a537a65e679cb4106db9768f593db2bc6c33ee
diff --git a/dropwizard-testing/src/main/java/io/dropwizard/testing/DropwizardTestSupport.java b/dropwizard-testing/src/main/java/io/dropwizard/testing/DropwizardTestSupport.java index <HASH>..<HASH> 100644 --- a/dropwizard-testing/src/main/java/io/dropwizard/testing/DropwizardTestSupport.java +++ b/dropwizard-testing/src/main/java/io/dropwizard/testing/DropwizardTestSupport.java @@ -240,7 +240,6 @@ public class DropwizardTestSupport<C extends Configuration> { stopIfRequired(); } finally { resetConfigOverrides(); - LoggingUtil.getLoggerContext().getLogger(Logger.ROOT_LOGGER_NAME).detachAndStopAllAppenders(); } } @@ -266,6 +265,8 @@ public class DropwizardTestSupport<C extends Configuration> { // Don't leak logging appenders into other test cases if (configuration != null) { configuration.getLoggingFactory().reset(); + } else { + LoggingUtil.getLoggerContext().getLogger(Logger.ROOT_LOGGER_NAME).detachAndStopAllAppenders(); } }
Ensure logger reset when configuration is null
dropwizard_dropwizard
train
java
255a8a8236bdb4a36d2cc692cdbdee20c3231fc0
diff --git a/relaxng/datatype/java/src/org/whattf/datatype/AbstractDatetime.java b/relaxng/datatype/java/src/org/whattf/datatype/AbstractDatetime.java index <HASH>..<HASH> 100755 --- a/relaxng/datatype/java/src/org/whattf/datatype/AbstractDatetime.java +++ b/relaxng/datatype/java/src/org/whattf/datatype/AbstractDatetime.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2006 Henri Sivonen + * Copyright (c) 2010 Mozilla Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -198,7 +199,7 @@ abstract class AbstractDatetime extends AbstractDatatype { } } else { throw newDatatypeException( - "The literal did not satisfy the date format."); + "The literal did not satisfy the " + getName() + " format."); } }
refine error messages from subclasses of AbstractDatetime subclasses were all simply reporting "The literal did not satisfy the date format" but should instead be reporting more specifically, e.g., "The literal did not satisfy the datetime with timezone format", etc. --HG-- extra : convert_revision : svn%3Ae<I>-c<I>-<I>-<I>-<I>d<I>ca<I>/trunk%<I>
validator_validator
train
java
54716d7195fc15033fa99256563d30c4df0b0723
diff --git a/nameko/testing/pytest.py b/nameko/testing/pytest.py index <HASH>..<HASH> 100644 --- a/nameko/testing/pytest.py +++ b/nameko/testing/pytest.py @@ -53,6 +53,12 @@ def pytest_configure(config): logging.basicConfig(level=log_level, stream=sys.stderr) +@pytest.fixture(autouse=True) +def always_warn_for_deprecation(): + import warnings + warnings.simplefilter('always', DeprecationWarning) + + @pytest.fixture def empty_config(): from nameko.constants import AMQP_URI_CONFIG_KEY diff --git a/test/test_container.py b/test/test_container.py index <HASH>..<HASH> 100644 --- a/test/test_container.py +++ b/test/test_container.py @@ -121,11 +121,6 @@ def logger(): yield patched -@pytest.fixture(autouse=True) -def always_warn(): - warnings.simplefilter('always') - - def test_collects_extensions(container): assert len(container.extensions) == 4 assert container.extensions == (
always warn for deprecationwarnings
nameko_nameko
train
py,py
125d69640ef204d076f6de4b232697c7cc358404
diff --git a/ptb-loader.php b/ptb-loader.php index <HASH>..<HASH> 100644 --- a/ptb-loader.php +++ b/ptb-loader.php @@ -87,11 +87,6 @@ final class PTB_Loader { define('PTB_PLUGIN_URL', $plugin_url); } - // Our meta key that is used to save the data array on pages. - if (!defined('PTB_META_KEY')) { - define('PTB_META_KEY', '_ptb_meta'); - } - // Used for random titles etc. if (!defined('PTB_RANDOM_KEY')) { define('PTB_RANDOM_KEY', '_PTB_'); @@ -102,19 +97,6 @@ final class PTB_Loader { define('PTB_PROPERTY_TYPE_KEY', '_property'); } - /* - - Custom wp-ptb directory structure: - - - custom wp-ptb dir - - gui - - js - - css - - properties - - page-types - - */ - } /**
Removed unsued definition and removed comment
wp-papi_papi
train
php
0d2b587cace8f59ce3d327203428cd6350749a2b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop) import io +import sys import setuptools @@ -9,6 +10,11 @@ with io.open('README.txt', encoding='utf-8') as readme: with io.open('CHANGES.txt', encoding='utf-8') as changes: long_description += '\n\n' + changes.read() +needs_pytest = {'pytest', 'test'}.intersection(sys.argv) +pytest_runner = ['pytest_runner'] if needs_pytest else [] +needs_sphinx = {'release', 'build_sphinx', 'upload_docs'}.intersection(sys.argv) +sphinx = ['sphinx'] if needs_sphinx else [] + setup_params = dict( name='jaraco.itertools', use_hg_version=True, @@ -25,9 +31,7 @@ setup_params = dict( ], setup_requires=[ 'hgtools', - 'pytest-runner', - 'sphinx', - ], + ] + pytest_runner + sphinx, tests_require=[ 'pytest', ],
Make pytest_runner and sphinx optionally required.
jaraco_jaraco.itertools
train
py
089a83363fac3bb9111892acc613e5bd61256f59
diff --git a/lib/application.js b/lib/application.js index <HASH>..<HASH> 100644 --- a/lib/application.js +++ b/lib/application.js @@ -112,6 +112,8 @@ app.defaultConfiguration = function(){ this.locals.settings = this.settings; // default configuration + this.enable('jsonp callback'); + this.configure('development', function(){ this.set('json spaces', 2); }); diff --git a/test/res.json.js b/test/res.json.js index <HASH>..<HASH> 100644 --- a/test/res.json.js +++ b/test/res.json.js @@ -9,7 +9,7 @@ describe('res', function(){ it('should respond with jsonp', function(done){ var app = express(); - app.enable('jsonp callback'); + // app.enable('jsonp callback'); app.use(function(req, res){ res.json({ count: 1 }); });
Changed: enable "jsonp callback" as a default
expressjs_express
train
js,js
f8ef3f6ddce12112e89954a8dd97eccdbc6925e8
diff --git a/lib/pupa/processor/client.rb b/lib/pupa/processor/client.rb index <HASH>..<HASH> 100644 --- a/lib/pupa/processor/client.rb +++ b/lib/pupa/processor/client.rb @@ -33,7 +33,7 @@ module Pupa # @param [String] level the log level # @param [String,IO] logdev the log device # @return [Faraday::Connection] a configured Faraday HTTP client - def self.new(cache_dir: nil, expires_in: 86400, value_max_bytes: 1048576, level: 'INFO', logdev: logdev) # 1 day + def self.new(cache_dir: nil, expires_in: 86400, value_max_bytes: 1048576, level: 'INFO', logdev: STDOUT) # 1 day Faraday.new do |connection| connection.request :url_encoded connection.use Middleware::Logger, Logger.new('faraday', level: level)
Fix default value of logdev in HTTP client
jpmckinney_pupa-ruby
train
rb
395d97160c86e8c958dcbf65d47e9de626d2af8b
diff --git a/py/bin/_update_website.py b/py/bin/_update_website.py index <HASH>..<HASH> 100755 --- a/py/bin/_update_website.py +++ b/py/bin/_update_website.py @@ -18,9 +18,9 @@ def rsync(pkgpath, apidocspath, gateway, remotepath): pkgpath.copy(tempdir.ensure(pkgpath.basename, dir=True)) apidocspath.copy(tempdir.ensure(apidocspath.basename, dir=True)) - rs = py.execnet.RSync(delete=True) + rs = py.execnet.RSync(tempdir, delete=True) rs.add_target(gateway, remotepath) - rs.send(tempdir) + rs.send() def run_tests(pkgpath, args=''): """ run the unit tests and build the docs """
[svn r<I>] Update this as well --HG-- branch : trunk
vmalloc_dessert
train
py
b0ae9c6b0f79b4c3a3fd46b940bf810c31701eac
diff --git a/packages/blueprint-sequelize/lib/resource-controller.js b/packages/blueprint-sequelize/lib/resource-controller.js index <HASH>..<HASH> 100644 --- a/packages/blueprint-sequelize/lib/resource-controller.js +++ b/packages/blueprint-sequelize/lib/resource-controller.js @@ -310,7 +310,7 @@ module.exports = ResourceController.extend ({ }, getInclude (req, include) { - return null; + return include; }, getProjection () { @@ -373,10 +373,17 @@ module.exports = ResourceController.extend ({ if (query._) delete query._; + // The include query parameter is a special parameter. Let's remove it from the + // query so the model does not process it. + let { include } = query; + + if (!!include) + delete query.include; + const preparations = [ this.getId (req, id), this.getProjection (req), - this.getInclude (req), + this.getInclude (req, include), this.getOptions (req, options) ]; @@ -420,8 +427,8 @@ module.exports = ResourceController.extend ({ return id; }, - getInclude (req) { - return null; + getInclude (req, include) { + return include; }, getProjection () {
fix: includes in the original query were ignored
onehilltech_blueprint
train
js
6110139a8fd7069c87e3c99b3976865576180f67
diff --git a/airflow/hooks/hive_hooks.py b/airflow/hooks/hive_hooks.py index <HASH>..<HASH> 100644 --- a/airflow/hooks/hive_hooks.py +++ b/airflow/hooks/hive_hooks.py @@ -14,7 +14,7 @@ # from __future__ import print_function -from builtins import zip +from six.moves import zip from past.builtins import basestring import unicodecsv as csv @@ -144,11 +144,9 @@ class HiveCliHook(BaseHook): if not d: return [] return as_flattened_list( - itertools.izip( - ["-hiveconf"] * len(d), - ["{}={}".format(k, v) for k, v in d.items()] - ) - ) + zip(["-hiveconf"] * len(d), + ["{}={}".format(k, v) for k, v in d.items()]) + ) def run_cli(self, hql, schema=None, verbose=True, hive_conf=None): """
[AIRFLOW-<I>] Stop using itertools.izip Itertools.zip does not exist in Python 3. Closes #<I> from yati-sagade/fix-py3-zip
apache_airflow
train
py
f618b8af2040c708115eba4622f02c7166c586e7
diff --git a/netpyne/simFuncs.py b/netpyne/simFuncs.py index <HASH>..<HASH> 100644 --- a/netpyne/simFuncs.py +++ b/netpyne/simFuncs.py @@ -687,7 +687,7 @@ def getCellsList (include): elif isinstance(condition, tuple) or isinstance(condition, list): # subset of a pop with relative indices cellsPop = [gid for gid,tags in allCellTags.iteritems() if tags['popLabel']==condition[0]] - #print sim.rank,condition[0],cellsPop + print sim.rank,condition[0],cellsPop[0], cellsPop[-1] if isinstance(condition[1], list): cellGids.extend([gid for i,gid in enumerate(cellsPop) if i in condition[1]])
temporary change to test cell recording on multiple cores
Neurosim-lab_netpyne
train
py
4a55e515523aadfc8b194d82aa638745f435786b
diff --git a/tests/pycut_test.py b/tests/pycut_test.py index <HASH>..<HASH> 100644 --- a/tests/pycut_test.py +++ b/tests/pycut_test.py @@ -327,9 +327,9 @@ class PycutTest(unittest.TestCase): gc.set_seeds(seeds) gc.apriori = apriori gc.run() - import sed3 - ed = sed3.sed3(img, contour=(gc.segmentation==0)) - ed.show() + # import sed3 + # ed = sed3.sed3(img, contour=(gc.segmentation==0)) + # ed.show() self.assertLess( np.sum(
visualization with sed3 removed from test
mjirik_imcut
train
py
8d4a73f7dd9e923dcdc7c478c9cf575fd31538bf
diff --git a/proc/proc_darwin.go b/proc/proc_darwin.go index <HASH>..<HASH> 100644 --- a/proc/proc_darwin.go +++ b/proc/proc_darwin.go @@ -39,18 +39,18 @@ func Launch(cmd []string) (*Process, error) { if err != nil { return nil, err } + // Make sure the binary exists. if filepath.Base(cmd[0]) == cmd[0] { if _, err := exec.LookPath(cmd[0]); err != nil { return nil, err } } - argv0 := C.CString(argv0Go) - - // Make sure the binary exists. if _, err := os.Stat(argv0Go); err != nil { return nil, err } + argv0 := C.CString(argv0Go) + argvSlice := make([]*C.char, 0, len(cmd)) for _, arg := range cmd { argvSlice = append(argvSlice, C.CString(arg))
Refactor: Reorganize guard clauses
go-delve_delve
train
go
ea591c8c1f515317dec60b89ffbe6409b955a632
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( ], extras_require={ 'test': [ - 'django>=2.0,<2.1a1', + 'django>=2.1,<2.2', 'ansicolors==1.1.8', 'codecov==2.0.9', 'flake8==3.0.4', @@ -34,7 +34,7 @@ setup( 'setuptools>=38.6.0,<39.0.0' ], 'demo': [ - 'django>=2.0,<2.1a1', + 'django>=2.1,<2.2', 'django-environ==0.4.5', 'gunicorn==19.5.0', 'whitenoise==3.3.1', diff --git a/tests/test_middleware.py b/tests/test_middleware.py index <HASH>..<HASH> 100644 --- a/tests/test_middleware.py +++ b/tests/test_middleware.py @@ -280,7 +280,7 @@ def test_locale_persist_middleware_deletes_deprecated_cookie( instance.process_response(request, response) cookie = response.cookies[settings.LANGUAGE_COOKIE_DEPRECATED_NAME] - assert cookie['expires'] == 'Thu, 01-Jan-1970 00:00:00 GMT' + assert cookie['expires'] == 'Thu, 01 Jan 1970 00:00:00 GMT' assert cookie['max-age'] == 0
Upate cookie date format to reflect change in Django <I> to follow RFC <I>#section-<I>
uktrade_directory-components
train
py,py
7982a0c7bf37518d56ed0fb2ea8570d05d1d574b
diff --git a/lib/sites/amazon.js b/lib/sites/amazon.js index <HASH>..<HASH> 100644 --- a/lib/sites/amazon.js +++ b/lib/sites/amazon.js @@ -33,7 +33,7 @@ function AmazonSite(uri) { ".buyNewOffers .rentPrice", "#buybox .a-color-price", "#buybox_feature_div .a-button-primary .a-text-bold", - "#newOfferAccordionRow .header-price" + "#addToCart .header-price" ]; // find the price on the page
Fix Amazon books price selector Change the selector to something a bit higher level, in the hopes that it works longer.
dylants_price-finder
train
js
32ba2d6f0a107133d1f653baf1348213f3fe4d6d
diff --git a/tests/test_koordinates.py b/tests/test_koordinates.py index <HASH>..<HASH> 100644 --- a/tests/test_koordinates.py +++ b/tests/test_koordinates.py @@ -7,8 +7,8 @@ test_koordinates Tests for `koordinates` module. """ -from __future__ import unicode_literals -from __future__ import absolute_import +#from __future__ import unicode_literals +#from __future__ import absolute_import import unittest #from requests.exceptions import HTTPError
Revised tests that run successfully on <I> locally As part of making the CircleCI configuration work I have stripped anything that's not needed out of the test strip in the hope this will allow CircleCI to run the tests OK.
koordinates_python-client
train
py
50a676d588d714ab5da68561e554ed8fef7e5933
diff --git a/role.go b/role.go index <HASH>..<HASH> 100644 --- a/role.go +++ b/role.go @@ -90,3 +90,21 @@ func (role *Role) Get(name string) (func(req *http.Request, currentUser interfac fc, ok := role.definitions[name] return fc, ok } + +// Remove role definition +func (role *Role) Remove(name string) { + delete(role.definitions, name) +} + +func Remove(name string) { + role.Remove(name) +} + +// Reset role definitions +func (role *Role) Reset() { + role.definitions = map[string]func(req *http.Request, currentUser interface{}) bool{} +} + +func Reset() { + role.Reset() +}
Implement Remove and Reset functions for Role definitions
qor_roles
train
go
c0ffbd58dbe110337c898df6bedf179b92edcb02
diff --git a/pkg/storage/etcd/etcd_watcher_test.go b/pkg/storage/etcd/etcd_watcher_test.go index <HASH>..<HASH> 100644 --- a/pkg/storage/etcd/etcd_watcher_test.go +++ b/pkg/storage/etcd/etcd_watcher_test.go @@ -217,24 +217,6 @@ func TestWatchInterpretation_ResponseBadData(t *testing.T) { } } -/* re-Disabling due to flakes seen upstream #18914 -func TestWatchEtcdError(t *testing.T) { - codec := testapi.Default.Codec() - server := etcdtesting.NewEtcdTestClientServer(t) - h := newEtcdHelper(server.Client, codec, etcdtest.PathPrefix()) - watching, err := h.Watch(context.TODO(), "/some/key", "4", storage.Everything) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } - server.Terminate(t) - - got, ok := <-watching.ResultChan() - if ok && got.Type != watch.Error { - t.Fatalf("Unexpected non-error") - } - watching.Stop() -}*/ - func TestWatch(t *testing.T) { codec := testapi.Default.Codec() server := etcdtesting.NewEtcdTestClientServer(t)
Remove TestWatchEtcdError We decided to remove this test, as there's no way to get an upper bound on its running time. Etcd restart behavior should be tested in integration or e2e tests.
kubernetes_kubernetes
train
go
bb9d0beb3d184353d86934199dccc97b024b5797
diff --git a/pyqode/core/styles/darcula.py b/pyqode/core/styles/darcula.py index <HASH>..<HASH> 100644 --- a/pyqode/core/styles/darcula.py +++ b/pyqode/core/styles/darcula.py @@ -40,13 +40,13 @@ class DarculaStyle(Style): Literal.String.Doc: '#A5C261 ', Name.Attribute: '#800080', Name.Builtin.Pseudo: '#94558D bold', - Name.Builtin: '#cc7832', + Name.Builtin: '#B200B2', Name.Class: '#A9B7C6 bold', Name.Constant: '#A9B7C6 bold', Name.Decorator: '#BBB529', Name.Entity: '#A9B7C6', Name.Exception: '#A9B7C6 bold', - Name.Function: '#A9B7C6 bold', + Name.Function: '#A9B7C6', Name.Label: '#A9B7C6 bold', Name.Namespace: '#A9B7C6', Name.Tag: '#A5C261 bold',
Darcula style: fix builtin color and make function names look different than class names
pyQode_pyqode.core
train
py
91c736fca1427c3fdbb6c64d15c89cf703f716df
diff --git a/lib/sgf/parser/node.rb b/lib/sgf/parser/node.rb index <HASH>..<HASH> 100644 --- a/lib/sgf/parser/node.rb +++ b/lib/sgf/parser/node.rb @@ -2,9 +2,10 @@ module SGF class Node - attr_accessor :children, :properties + attr_accessor :parent, :children, :properties def initialize args={} + @parent = args[:parent] @children = [] add_children args[:children] if !args[:children].nil? @properties = Hash.new
Adding the :parent property to go upwards in the tree.
Trevoke_SGFParser
train
rb
d9519cfcb6c991c06825e40cd89dc6596e10e263
diff --git a/src/test/java/cyclops/streams/push/reactivestreamspath/ReactiveJDKStreamRSTest.java b/src/test/java/cyclops/streams/push/reactivestreamspath/ReactiveJDKStreamRSTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/cyclops/streams/push/reactivestreamspath/ReactiveJDKStreamRSTest.java +++ b/src/test/java/cyclops/streams/push/reactivestreamspath/ReactiveJDKStreamRSTest.java @@ -96,14 +96,6 @@ public class ReactiveJDKStreamRSTest { assertThat(d.size(),is(3)); } - @Test - public void testDistinctReactiveSeqSingleEntryMultipleDuplicates(){ - List<String> names = Arrays.asList("Java", "C", "C", "C"); - ListX<String> d = ReactiveSeq.fromIterable(names).distinct(n -> n + ":" + n).toListX(); - assertThat(d.size(),is(2)); - } - - @Test public void testLimit(){
Removing duplicate test as mentioned in PR reveiw
aol_cyclops
train
java
c0b2a445c4c40cc079a5a60c02cefcc207cb964c
diff --git a/_pydev_bundle/pydev_monkey.py b/_pydev_bundle/pydev_monkey.py index <HASH>..<HASH> 100644 --- a/_pydev_bundle/pydev_monkey.py +++ b/_pydev_bundle/pydev_monkey.py @@ -65,12 +65,15 @@ def is_python(path): def remove_quotes_from_args(args): - new_args = [] - for x in args: - if len(x) > 1 and x.startswith('"') and x.endswith('"'): - x = x[1:-1] - new_args.append(x) - return new_args + if sys.platform == "win32": + new_args = [] + for x in args: + if len(x) > 1 and x.startswith('"') and x.endswith('"'): + x = x[1:-1] + new_args.append(x) + return new_args + else: + return args def quote_args(args):
Fix for #PyDev-<I>: subprocess.run eats enclosing quotes on args
fabioz_PyDev.Debugger
train
py
a76a2e7e87d8610ba85db53586e024db9050ae46
diff --git a/lib/dm-core/logger.rb b/lib/dm-core/logger.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/logger.rb +++ b/lib/dm-core/logger.rb @@ -178,7 +178,7 @@ module DataMapper # def flush return unless @buffer.size > 0 - @log.write_method(@buffer.slice!(0..-1).to_s) + @log.write_method(@buffer.slice!(0..-1).join) end # Close and remove the current log object.
Updated Logger to use Array#join instead of Array#to_s * Ruby <I> changes the output to be closer to inspect, so it is now better to use Array#join than Array#to_s
datamapper_dm-core
train
rb
d3e8544252305ff83c77c7e3a257e691bba97956
diff --git a/lib/Widget/Db/Record.php b/lib/Widget/Db/Record.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Db/Record.php +++ b/lib/Widget/Db/Record.php @@ -127,7 +127,7 @@ class Record extends Base public function fromArray($data) { foreach ($data as $key => $value) { - $this->$key = $value; + $this->__set($key, $value); } return $this; }
fixed create active record error when key name is class property name
twinh_wei
train
php
f15e197b8059fcf7586cbcb1c4f34c3eaa7119d2
diff --git a/luigi/worker.py b/luigi/worker.py index <HASH>..<HASH> 100644 --- a/luigi/worker.py +++ b/luigi/worker.py @@ -144,7 +144,7 @@ class Worker(object): raise # TODO: not necessarily true that we want to break on the first exception status = 'FAILED' expl = traceback.format_exc(sys.exc_info()[2]) - if self.__erroremail: #TODO: check if running in background mode + if self.__erroremail and not sys.stdout.isatty(): logging.error("Error while running %s. Sending error email", task) send_email("Luigi: %s FAILED" % task, expl, (self.__erroremail,))
Fix AI-<I>, by checking whether stdout is a tty. Change-Id: I9a<I>a6bf<I>f<I>fde6ccc6c6f7a<I>c3b<I> Reviewed-on: <URL>
spotify_luigi
train
py
54f1b7264287a1f7efd8486de56d1becbc666a6f
diff --git a/sass/themes/cr/2019/components/membership-signup/js/membership-signup.js b/sass/themes/cr/2019/components/membership-signup/js/membership-signup.js index <HASH>..<HASH> 100644 --- a/sass/themes/cr/2019/components/membership-signup/js/membership-signup.js +++ b/sass/themes/cr/2019/components/membership-signup/js/membership-signup.js @@ -484,4 +484,4 @@ } } }); -})(jQuery); \ No newline at end of file +})(jQuery);
fix: Collapse and expand white space
comicrelief_pattern-lab
train
js
6077a7077a8c5e6aa56eb9e1643e650b42f1b0ce
diff --git a/lib/coral_core.rb b/lib/coral_core.rb index <HASH>..<HASH> 100644 --- a/lib/coral_core.rb +++ b/lib/coral_core.rb @@ -54,7 +54,6 @@ $:.unshift(home) unless #--- require 'rubygems' -require 'hiera_backend.rb' #--- @@ -142,6 +141,10 @@ Dir.glob(File.join(home, 'coral_core', 'template', '*.rb')).each do |file| require file end +#--- + +require 'hiera_backend.rb' + #******************************************************************************* # Coral Core Library #
Requiring the hiera_backend override after the configuration is required.
coralnexus_corl
train
rb
ab85ca4c5a19e1706884b7596024a675c8aec256
diff --git a/src/Generator.php b/src/Generator.php index <HASH>..<HASH> 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -114,7 +114,7 @@ class Generator protected function detectDrivers() { try{ - if (class_exists('Auth')) { + if (class_exists('Auth') && method_exists('Auth', 'driver')) { $class = get_class(\Auth::driver()); $this->extra['Auth'] = array($class); $this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class;
Check for driver method on Auth facade
barryvdh_laravel-ide-helper
train
php
bfd29ea917909ee1de139f70e867d14ecb99efbe
diff --git a/purplex/grammar.py b/purplex/grammar.py index <HASH>..<HASH> 100644 --- a/purplex/grammar.py +++ b/purplex/grammar.py @@ -37,10 +37,10 @@ class DottedRule(object): self.pos = pos self.lookahead = lookahead - self._str = '[{} : {}, {}]'.format( + self._str = '[{} : {} . {}, {}]'.format( self.production.lhs, - ' '.join(self.production.rhs[:self.pos] + ['·'] - + self.production.rhs[self.pos:]), + ' '.join(self.production.rhs[:self.pos]), + ' '.join(self.production.rhs[self.pos:]), self.lookahead, ) self.at_end = self.pos == len(self.production.rhs)
Removed needless \cdot from DottedRule
mtomwing_purplex
train
py
9e9302d18d60ab79b0251350927d68e5b8adcf5a
diff --git a/classes/kohana/upload/file.php b/classes/kohana/upload/file.php index <HASH>..<HASH> 100644 --- a/classes/kohana/upload/file.php +++ b/classes/kohana/upload/file.php @@ -244,7 +244,7 @@ class Kohana_Upload_File { public static function from_stream($stream, $directory, $filename = NULL) { $result_file = Upload_File::combine($directory, $filename ? $filename : uniqid()); - + $stream_handle = fopen($stream, "r"); $result_handle = fopen($result_file, 'w'); $realSize = stream_copy_to_stream($stream_handle, $result_handle);
allow uploading images with spaces in their names
OpenBuildings_jam
train
php
456d06796b9e3d2bec9fdc2e151ff3962cdc42a5
diff --git a/alot/message.py b/alot/message.py index <HASH>..<HASH> 100644 --- a/alot/message.py +++ b/alot/message.py @@ -260,18 +260,16 @@ def encode_header(key, value): rawentries = value.split(',') encodedentries = [] for entry in rawentries: - m = re.search('\s*(.*)\s+<(.*\@.*\.\w*)>$', entry) + m = re.search('\s*(.*)\s+<(.*\@.*\.\w*)>\s*$', entry) if m: # If a realname part is contained name, address = m.groups() # try to encode as ascii, if that fails, revert to utf-8 # name must be a unicode string here - header = Header(name) + namepart = Header(name) # append address part encoded as ascii - header.append('<%s>' % address, charset='ascii') - encodedentries.append(header.encode()) - else: # pure email address - encodedentries.append(entry) - value = Header(','.join(encodedentries)) + entry = '%s <%s>' % (namepart.encode(), address) + encodedentries.append(entry) + value = Header(', '.join(encodedentries)) else: value = Header(value) return value
fix separately handle name and address fields this prevents strange stuff from hapening if name contans uft8 chars: then the whole header, including the address would be encoded, making the msg unreadable for the MTA
pazz_alot
train
py
4b0f9f00b12c4d09654d1e39df4acb7607eb63fd
diff --git a/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantAlternateRearranger.java b/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantAlternateRearranger.java index <HASH>..<HASH> 100644 --- a/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantAlternateRearranger.java +++ b/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantAlternateRearranger.java @@ -339,7 +339,7 @@ public class VariantAlternateRearranger { } public String rearrange(String key, String data, @Nullable Integer ploidy) { - if (data.isEmpty() || data.equals(".")) { + if (StringUtils.isEmpty(data) || data.equals(".")) { // Do not rearrange missing values return data; }
tools: Fix NPE at VariantAlternateRearranger
opencb_biodata
train
java
ca3f9585f42b9a66b80020ec937ec3370ac33105
diff --git a/sockaddrs.go b/sockaddrs.go index <HASH>..<HASH> 100644 --- a/sockaddrs.go +++ b/sockaddrs.go @@ -246,13 +246,3 @@ func SortByNetworkSize(inputAddrs SockAddrs) SockAddrs { OrderedAddrBy(AscNetworkSize).Sort(sortedAddrs) return sortedAddrs } - -// LimitAddrs returns a slice of SockAddrs based on the limitAddrs -func LimitAddrs(limitAddrs uint, inputAddrs SockAddrs) SockAddrs { - // Clamp the limit to the length of the array - if int(limitAddrs) > len(inputAddrs) { - limitAddrs = uint(len(inputAddrs)) - } - - return inputAddrs[0:limitAddrs] -} diff --git a/template/template.go b/template/template.go index <HASH>..<HASH> 100644 --- a/template/template.go +++ b/template/template.go @@ -66,9 +66,6 @@ func init() { } HelperFuncs = template.FuncMap{ - // Misc functions that operate on []SockAddr inputs - "limitAddrs": sockaddr.LimitAddrs, - // Misc functions that operate on []IfAddr inputs "join": sockaddr.JoinIfAddrs, "limit": sockaddr.LimitIfAddrs,
Remove `limitAddrs N` in favor of just `limit N`
hashicorp_go-sockaddr
train
go,go
8021e271b23813f9aa5734be2af3a8cd67f845c4
diff --git a/spec/travis/enqueue/services/enqueue_jobs_spec.rb b/spec/travis/enqueue/services/enqueue_jobs_spec.rb index <HASH>..<HASH> 100644 --- a/spec/travis/enqueue/services/enqueue_jobs_spec.rb +++ b/spec/travis/enqueue/services/enqueue_jobs_spec.rb @@ -32,7 +32,7 @@ describe Travis::Enqueue::Services::EnqueueJobs do describe "with a timeout" do it "returns false when the timeout is hit" do Travis::Features.stubs(:feature_deactivated?).raises(Timeout::Error) - service.disabled?.should == false + service.disabled?.should == false end end end @@ -42,7 +42,7 @@ describe Travis::Enqueue::Services::EnqueueJobs do let(:test) { stub_test(state: :created, enqueue: nil) } before :each do - test.repository.stubs(:settings).returns OpenStruct.new({:restricts_number_of_builds? => false}) + test.repository.stubs(:settings).returns OpenStruct.new({:restricts_number_of_builds? => false, :ssh_keys => []}) scope = stub('scope') scope.stubs(:all).returns([test]) Job.stubs(:queueable).returns(scope)
Stub settings for EnqueueJobs with empty ssh_keys
travis-ci_travis-core
train
rb
ac1b5751b0020388850a75d50e5b7bb158877a61
diff --git a/knowledge_base/__init__.py b/knowledge_base/__init__.py index <HASH>..<HASH> 100755 --- a/knowledge_base/__init__.py +++ b/knowledge_base/__init__.py @@ -662,8 +662,10 @@ class KnowledgeBase(object): for event in author.efrbroo_P14i_performed: if event.efrbroo_R16_initiated.first.get_urn() == work.get_urn(): author.efrbroo_P14i_performed.remove(event) + author.update() + event.efrbroo_R16_initiated.remove(work) event.remove() - author.update() + for title in work.efrbroo_P102_has_title: removed_resources.append(title.subject)
trying to fix kb.remove_work
mromanello_hucitlib
train
py
f11046a19fc83f01e77805fb441505926fe98d23
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -50,6 +50,10 @@ exports.plugin = { request.i18n = {}; I18n.init(request, request.i18n); request.i18n.setLocale(defaultLocale); + return h.continue; + }); + + server.ext('onPreAuth', function (request, h) { if (request.params && request.params.languageCode) { if (_.includes(pluginOptions.locales, request.params.languageCode) == false) { throw Boom.notFound('No localization available for ' + request.params.languageCode);
Fix: Add i<I>n object in `onRequest` to ensure that it’s available in `onPreResponse` in case no route was found
funktionswerk_hapi-i18n
train
js
6634f44ca625ff8a49146a334daf25f59a042ce8
diff --git a/test/bootstrap.php b/test/bootstrap.php index <HASH>..<HASH> 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ +date_default_timezone_set('UTC'); + require dirname(__FILE__).'/../src/Mustache/Autoloader.php'; Mustache_Autoloader::register();
Explicitly set timezone to UTC for tests
bobthecow_mustache.php
train
php
fd0cfb0a7a37093f48107ae8eeea0dcad2847a7a
diff --git a/tests/suppressions/suppression_spec.rb b/tests/suppressions/suppression_spec.rb index <HASH>..<HASH> 100644 --- a/tests/suppressions/suppression_spec.rb +++ b/tests/suppressions/suppression_spec.rb @@ -133,6 +133,26 @@ it 'prints a valid configuration line' do expect { suppression.to_s }.to raise_error(Threshold::InvalidSuppressionObject) end +#Test failure if SID contains letters +it 'prints a valid configuration line' do + suppression = Threshold::Suppression.new + suppression.sid='123a' + suppression.gid=456 + suppression.track_by='src' + suppression.ip='1.2.3.4' + expect { suppression.to_s }.to raise_error(Threshold::InvalidSuppressionObject) + end + + #Test failure if GID contains letters +it 'prints a valid configuration line' do + suppression = Threshold::Suppression.new + suppression.sid=123 + suppression.gid='456a' + suppression.track_by='src' + suppression.ip='1.2.3.4' + expect { suppression.to_s }.to raise_error(Threshold::InvalidSuppressionObject) + end + end
added additional SID and GID validation
shadowbq_snort-thresholds
train
rb
680aa0dbb19ec49cbccee9f67fcae00d16ca3e28
diff --git a/dateparser/utils.py b/dateparser/utils.py index <HASH>..<HASH> 100644 --- a/dateparser/utils.py +++ b/dateparser/utils.py @@ -100,6 +100,7 @@ def registry(cls): if key not in registry_dict: registry_dict[key] = creator(cls, *args, **kwargs) + setattr(registry_dict[key], 'registry_key', key) return registry_dict[key] return staticmethod(constructor)
Added support to tag registry objects with their respective keys
scrapinghub_dateparser
train
py
0dcc8deeec753de3b4643a7425e44b4c84a34457
diff --git a/tests/export/risk_test.py b/tests/export/risk_test.py index <HASH>..<HASH> 100644 --- a/tests/export/risk_test.py +++ b/tests/export/risk_test.py @@ -263,9 +263,9 @@ class EventBasedExportTestCase(BaseExportTestCase): # map + 2 quantile loss map self.assertEqual(19, loss_map_outputs.count()) - # 1 event loss table + # 16 event loss table (1 per rlz) event_loss_tables = risk_outputs.filter(output_type="event_loss") - self.assertEqual(1, event_loss_tables.count()) + self.assertEqual(16, event_loss_tables.count()) # 32 loss fractions loss_fraction_outputs = risk_outputs.filter( @@ -292,7 +292,7 @@ class EventBasedExportTestCase(BaseExportTestCase): self.assertEqual(19, len(loss_curve_files)) self.assertEqual(16, len(agg_loss_curve_files)) - self.assertEqual(1, len(event_loss_table_files)) + self.assertEqual(16, len(event_loss_table_files)) self.assertEqual(19, len(loss_map_files)) for f in loss_curve_files:
updated expectations for the number of generated event loss tables Former-commit-id: f<I>d<I>b6b<I>a<I>ab<I>b<I> [formerly <I>a<I>c6fb2c7e7dc<I>d<I>e1ca9] Former-commit-id: <I>c<I>e<I>c<I>e<I>fbe<I>d6b<I>c<I>fba
gem_oq-engine
train
py
1be2fd11afc0e9dd3e5fde93853e5adc609f0642
diff --git a/lib/sinja.rb b/lib/sinja.rb index <HASH>..<HASH> 100644 --- a/lib/sinja.rb +++ b/lib/sinja.rb @@ -119,6 +119,13 @@ module Sinja dedasherize_names(data.fetch(:attributes, {})) end + if method_defined?(:bad_request?) + # This screws up our error-handling logic in Sinatra 2.0, so monkeypatch it. + def bad_request? + false + end + end + def can?(resource_name, action, rel_type=nil, rel=nil) lookup = settings._sinja.resource_roles[resource_name] # TODO: This is... problematic.
Work around BadRequest problem with Sinatra <I>
mwpastore_sinja
train
rb
997a46ca2a3d66fb20dea2c1e564a168fc494b5b
diff --git a/lucid/misc/channel_reducer.py b/lucid/misc/channel_reducer.py index <HASH>..<HASH> 100644 --- a/lucid/misc/channel_reducer.py +++ b/lucid/misc/channel_reducer.py @@ -44,7 +44,7 @@ class ChannelReducer(object): Inputs: n_components: Numer of dimensions to reduce inner most dimension to. reduction_alg: A string or sklearn.decomposition class. Defaults to - "NMF" (non-negative matrix facotrization). Other options include: + "NMF" (non-negative matrix factorization). Other options include: "PCA", "FastICA", and "MiniBatchDictionaryLearning". The name of any of the sklearn.decomposition classes will work, though. kwargs: Additional kwargs to be passed on to the reducer.
Fixed spelling of factorization - Changed "facotrization" to "factorization".
tensorflow_lucid
train
py
2e52851408c576afed80939a0b23719435a64dbb
diff --git a/lib/solargraph/source/source_chainer.rb b/lib/solargraph/source/source_chainer.rb index <HASH>..<HASH> 100644 --- a/lib/solargraph/source/source_chainer.rb +++ b/lib/solargraph/source/source_chainer.rb @@ -37,7 +37,7 @@ module Solargraph return Chain.new([Chain::Literal.new('Symbol')]) if phrase.start_with?(':') && !phrase.start_with?('::') begin if !source.repaired? && source.parsed? - node = source.node_at(fixed_position.line, fixed_position.column) + node = source.node_at(position.line, position.column) else node = Source.parse(fixed_phrase) end
SourceChainer only uses node chainer for parsed and unrepaired sources.
castwide_solargraph
train
rb
f0cbb83294aef07b1f51cffc0aeb67a92a5950d2
diff --git a/src/soundjs/htmlaudio/HTMLAudioPlugin.js b/src/soundjs/htmlaudio/HTMLAudioPlugin.js index <HASH>..<HASH> 100644 --- a/src/soundjs/htmlaudio/HTMLAudioPlugin.js +++ b/src/soundjs/htmlaudio/HTMLAudioPlugin.js @@ -93,18 +93,6 @@ this.createjs = this.createjs || {}; // Public Properties - /** - * This is no longer needed as we are now using object pooling for tags. - * - * <b>NOTE this property only exists as a limitation of HTML audio.</b> - * @property defaultNumChannels - * @type {Number} - * @default 2 - * @since 0.4.0 - * @deprecated - */ - this.defaultNumChannels = 2; - this._capabilities = s._capabilities; this._loaderClass = createjs.SoundLoader;
Removed deprecated defaultNumChannels (an object pool is used now)
CreateJS_SoundJS
train
js
3b2fd2e8460e82c84ff829867710081268d9c063
diff --git a/tests/Vies/Validator/ValidatorBGTest.php b/tests/Vies/Validator/ValidatorBGTest.php index <HASH>..<HASH> 100644 --- a/tests/Vies/Validator/ValidatorBGTest.php +++ b/tests/Vies/Validator/ValidatorBGTest.php @@ -22,6 +22,7 @@ class ValidatorBGTest extends AbstractValidatorTest ['10100450', false], ['301004502', false], ['8311046307', true], + ['3002779909', true], ]; } }
Add new BG test case for foreign natural persons
DragonBe_vies
train
php
a3caf4f02318ad757d0a3f8015a74fce8a94d105
diff --git a/samples/analyze.js b/samples/analyze.js index <HASH>..<HASH> 100644 --- a/samples/analyze.js +++ b/samples/analyze.js @@ -251,7 +251,7 @@ async function analyzeSafeSearch(gcsUri) { `.${(result.timeOffset.nanos / 1e6).toFixed(0)}s` ); console.log( - `\t\tPornography liklihood: ${likelihoods[result.pornographyLikelihood]}` + `\t\tPornography likelihood: ${likelihoods[result.pornographyLikelihood]}` ); }); // [END video_analyze_explicit_content]
docs: fix typo in samples/analyze.js (#<I>) docs: fix typo in samples/analyze.js
googleapis_nodejs-video-intelligence
train
js
654889d0a91c7132fe348e4651ba903cafeee3c3
diff --git a/lib/vraptor-scaffold/generators/app/dependency_manager.rb b/lib/vraptor-scaffold/generators/app/dependency_manager.rb index <HASH>..<HASH> 100644 --- a/lib/vraptor-scaffold/generators/app/dependency_manager.rb +++ b/lib/vraptor-scaffold/generators/app/dependency_manager.rb @@ -30,12 +30,12 @@ class DependencyManager def default_dependencies dependencies = [Dependency.new("br.com.caelum", "vraptor", "3.3.1"), Dependency.new("opensymphony", "sitemesh", "2.4.2"), - Dependency.new("javax.servlet", "jstl", "1.2"), - Dependency.new("org.hsqldb", "hsqldb", "2.2.4")] + Dependency.new("javax.servlet", "jstl", "1.2")] if !@options[:gae] hibernate_version = "3.6.7.Final" - dependencies += [Dependency.new("org.hibernate", "hibernate-entitymanager", hibernate_version), + dependencies += [Dependency.new("org.hsqldb", "hsqldb", "2.2.4"), + Dependency.new("org.hibernate", "hibernate-entitymanager", hibernate_version), Dependency.new("org.hibernate", "hibernate-c3p0", hibernate_version)] end
removed hsqldb as default dependency for gae
caelum_vraptor-scaffold
train
rb
a7a65bb680e544755e2f9cb38132b1b5655910f9
diff --git a/src/Eleventy.js b/src/Eleventy.js index <HASH>..<HASH> 100644 --- a/src/Eleventy.js +++ b/src/Eleventy.js @@ -109,24 +109,26 @@ Eleventy.prototype.watch = function() { watcher.on( "change", - function(path, stat) { + async function(path, stat) { console.log("File changed:", path); - this.write(); + await this.write(); + console.log("Watching…"); }.bind(this) ); watcher.on( "add", - function(path, stat) { + async function(path, stat) { console.log("File added:", path); - this.write(); + await this.write(); + console.log("Watching…"); }.bind(this) ); }; Eleventy.prototype.write = async function() { try { - await this.writer.write(); + return await this.writer.write(); } catch (e) { console.log("\n" + chalk.red("Problem writing eleventy templates: ")); if (e instanceof EleventyError) {
Output "Watching…" after watch writes
11ty_eleventy
train
js
b217b89bc362f1e6fd36c0d629ffcd4b373ab4a2
diff --git a/lib/plain_old_model/base.rb b/lib/plain_old_model/base.rb index <HASH>..<HASH> 100644 --- a/lib/plain_old_model/base.rb +++ b/lib/plain_old_model/base.rb @@ -1,7 +1,4 @@ -require 'active_model/naming' -require 'active_model/translation' -require 'active_model/validations' -require 'active_model/conversion' +require 'active_model' require 'plain_old_model/attribute_assignment' module PlainOldModel @@ -22,4 +19,4 @@ module PlainOldModel end -end \ No newline at end of file +end
Add Rails 4 compatibility - In ActiveModel 4, you can no longer require portions of ActiveModel, and instead must require all See <URL>
gettyimages_plain_old_model
train
rb
c95d1e5a31c185b5de791a8aa3e48ae14190e8f8
diff --git a/salt/pillar/vault.py b/salt/pillar/vault.py index <HASH>..<HASH> 100644 --- a/salt/pillar/vault.py +++ b/salt/pillar/vault.py @@ -32,8 +32,8 @@ statically, as above, or as an environment variable: After the profile is created, edit the salt master config file and configure the external pillar system to use it. A path pointing to the needed vault key -must also be specified so that vault knows where to look. Vault do not apply -recursive list, so each required key need to be individually mapped. +must also be specified so that vault knows where to look. Vault does not apply +a recursive list, so each required key needs to be individually mapped. .. code-block:: yaml @@ -41,14 +41,14 @@ recursive list, so each required key need to be individually mapped. - vault: myvault path=secret/salt - vault: myvault path=secret/another_key -Also, on vault each key need to have all the key values pairs with the names you +Each key needs to have all the key-value pairs with the names you require. Avoid naming every key 'password' as you they will collide: .. code-block:: bash $ vault write secret/salt auth=my_password master=127.0.0.1 -you can then use normal pillar requests to get each key pair directly from +You can then use normal pillar requests to get each key pair directly from pillar root. Example: .. code-block:: bash
Some small spelling fixes for vault docs (#<I>) Refs #<I>
saltstack_salt
train
py
37c3b736cb4ebfe56d91dcc4c3ec3fc7b40a3474
diff --git a/lib/plugin/components/services/statebox/index.js b/lib/plugin/components/services/statebox/index.js index <HASH>..<HASH> 100644 --- a/lib/plugin/components/services/statebox/index.js +++ b/lib/plugin/components/services/statebox/index.js @@ -124,7 +124,8 @@ class StateboxService { this.statebox.listExecutions(executionOptions, callback) } - describeExecution (executionName, updateLastDescribed, executionOptions, callback) { + describeExecution (executionName, executionOptions, callback) { + const updateLastDescribed = executionOptions.updateLastDescribed === true return promiseOrCallback(this.statebox.describeExecution(executionName, updateLastDescribed), callback) } // describeExecution @@ -217,7 +218,7 @@ class StateboxService { } // reviveIfAuthorised async describeAndProcessIfAuthorised (executionName, executionOptions, action, actionFn) { - const executionDescription = await this.statebox.describeExecution(executionName, executionOptions) + const executionDescription = await this.statebox.describeExecution(executionName) return this.processIfAuthorised( executionOptions.userId, executionDescription.stateMachineName,
fix: get update last described from execution options
wmfs_tymly-core
train
js
461f7ccc8fa72a62ddec04413cd2ef0a74f87839
diff --git a/build/no-conflict.js b/build/no-conflict.js index <HASH>..<HASH> 100644 --- a/build/no-conflict.js +++ b/build/no-conflict.js @@ -26,7 +26,7 @@ glob('dist/**/*.css', (err, files) => data = data.replace(/\.uk-noconflict \{(.|[\r\n])*?\}/, '') .replace(`.uk-noconflict html`, `.uk-noconflict`) - .replace(/\.uk-noconflict\s(\.(uk-(drag|modal-page)))/g, '$1'); + .replace(/\.uk-noconflict\s(\.(uk-(drag|modal-page|offcanvas-page)))/g, '$1'); fs.writeFile(file, data); });
uk-noconflict not needed for uk-offcanvas-page class
uikit_uikit
train
js
fc2577b8b76f3a87d979371599986b6ff807b4d4
diff --git a/connection.js b/connection.js index <HASH>..<HASH> 100644 --- a/connection.js +++ b/connection.js @@ -429,6 +429,11 @@ TChannelConnection.prototype.onSocketError = function onSocketError(err) { } }; +TChannelConnection.prototype.nextFrameId = function nextFrameId() { + var self = this; + return self.handler.nextFrameId(); +}; + TChannelConnection.prototype.buildOutRequest = function buildOutRequest(options) { var self = this;
TChannelConnection: add #nextFrameId
uber_tchannel-node
train
js
e27d1d5a247c9e3b6261d4dd41f93f2afc2229e4
diff --git a/salt/modules/gentoolkitmod.py b/salt/modules/gentoolkitmod.py index <HASH>..<HASH> 100644 --- a/salt/modules/gentoolkitmod.py +++ b/salt/modules/gentoolkitmod.py @@ -94,7 +94,7 @@ def eclean_dist(destructive=False, package_names=False, size_limit=0, if size_limit is not 0: size_limit = parseSize(size_limit) - clean_size=None + clean_size=0 engine = DistfilesSearch(lambda x: None) clean_me, saved, deprecated = engine.findDistfiles( destructive=destructive, package_names=package_names, @@ -108,8 +108,8 @@ def eclean_dist(destructive=False, package_names=False, size_limit=0, if clean_me: cleaner = CleanUp(_eclean_progress_controller) - clean_size = _pretty_size(cleaner.clean_dist(clean_me)) + clean_size = cleaner.clean_dist(clean_me) ret = {'cleaned': cleaned, 'saved': saved, 'deprecated': deprecated, - 'total_cleaned': clean_size} + 'total_cleaned': _pretty_size(clean_size)} return ret
Set initial clean total size to 0 in eclean_dist
saltstack_salt
train
py
86013161361fef1b659b9794dc1b7ef526fad04b
diff --git a/src/main/java/io/vlingo/actors/reflect/GenericParser.java b/src/main/java/io/vlingo/actors/reflect/GenericParser.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/vlingo/actors/reflect/GenericParser.java +++ b/src/main/java/io/vlingo/actors/reflect/GenericParser.java @@ -6,7 +6,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; public final class GenericParser { - private static final Map<String, Boolean> GENERICS = new HashMap<String, Boolean>() {{ + private static final Map<String, Boolean> PRIMITIVES = new HashMap<String, Boolean>() {{ put("byte", true); put("short", true); put("int", true); @@ -151,7 +151,7 @@ public final class GenericParser { } private static boolean onlyNotPrimitives(final String type) { - return !GENERICS.getOrDefault(normalizeTypeAlias(type), false); + return !PRIMITIVES.getOrDefault(normalizeTypeAlias(type), false); } private static Stream<String> typeNameToTypeStream(final Type type) {
Typo! They are primitives, not generics
vlingo_vlingo-actors
train
java
4ef0e052bc0cd7b2b11e3598b9e7c9554406c465
diff --git a/dimod/constrained.py b/dimod/constrained.py index <HASH>..<HASH> 100644 --- a/dimod/constrained.py +++ b/dimod/constrained.py @@ -27,9 +27,6 @@ import zipfile from numbers import Number from typing import Hashable, Optional, Union, BinaryIO, ByteString, Iterable, Collection, Dict from typing import Callable, MutableMapping, Iterator, Tuple, Mapping, Any -from os import PathLike -from sys import argv -from collections import defaultdict import numpy as np @@ -869,7 +866,7 @@ class ConstrainedQuadraticModel: upper_bound_default: in case upper bounds for integer are not given, this will be the default Returns: - The model encoded in the LP file, converted to ConstrainedQuadraticModel dimod object + The model encoded in the LP file as a :class:`ConstrainedQuadraticModel`. """ grammar = make_lp_grammar() parse_output = grammar.parseFile(fp)
fixed docstring of cqm_from_lp and removed unused imports
dwavesystems_dimod
train
py
5863d077f5bf2fe8fa2413cb5c1372090524be85
diff --git a/fastlane_core/lib/fastlane_core/cert_checker.rb b/fastlane_core/lib/fastlane_core/cert_checker.rb index <HASH>..<HASH> 100644 --- a/fastlane_core/lib/fastlane_core/cert_checker.rb +++ b/fastlane_core/lib/fastlane_core/cert_checker.rb @@ -26,7 +26,7 @@ module FastlaneCore "You can run `security find-identity -v -p codesigning` to get this output.", "This Stack Overflow thread has more information: https://stackoverflow.com/q/35390072/774.", "(Check in Keychain Access for an expired WWDR certificate: https://stackoverflow.com/a/35409835/774 has more info.)" - ].join(' ')) + ].join("\n")) end ids = []
Make cert checker output look better (#<I>)
fastlane_fastlane
train
rb
f1798951e747da23bd1f30a7f1a6c041a117bd8a
diff --git a/activesupport/lib/active_support/core_ext/object/to_query.rb b/activesupport/lib/active_support/core_ext/object/to_query.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/object/to_query.rb +++ b/activesupport/lib/active_support/core_ext/object/to_query.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/object/to_param' +require 'cgi' class Object # Converts an object into a string suitable for use as a URL query string, using the given <tt>key</tt> as the @@ -6,7 +7,6 @@ class Object # # Note: This method is defined as a default implementation for all Objects for Hash#to_query to work. def to_query(key) - require 'cgi' unless defined?(CGI) && defined?(CGI::escape) "#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}" end end
Do not check defined?(CGI) on every call #to_query
rails_rails
train
rb
29c514bdffc94668687960c8b02bb01d3d1c34d0
diff --git a/login/change_password.php b/login/change_password.php index <HASH>..<HASH> 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -134,7 +134,7 @@ function validate_form($frm, &$err) { if (empty($frm->username)){ $err->username = get_string('missingusername'); } else { - if (empty($frm->password)){ + if (!isadmin() and empty($frm->password)){ $err->password = get_string('missingpassword'); } else { //require non adminusers to give valid password @@ -154,7 +154,7 @@ function validate_form($frm, &$err) { if ($frm->newpassword1 <> $frm->newpassword2) { $err->newpassword2 = get_string('passwordsdiffer'); } else { - if($frm->password === $frm->newpassword1){ + if(!isadmin() and ($frm->password === $frm->newpassword1)){ $err->newpassword1 = get_string('mustchangepassword'); } }
Admin can now change passwords. Bug <I>. (SE)
moodle_moodle
train
php
d284a4cac5f8b22ea74ae4e5b07be2e431f6239b
diff --git a/test/testcache.js b/test/testcache.js index <HASH>..<HASH> 100644 --- a/test/testcache.js +++ b/test/testcache.js @@ -215,4 +215,18 @@ describe('caching tests', function() { }); }); + it('should not error when calling cache.get on an expired key twice in the same tick', function(done) { + var CacheObject = new mod_cache({ + ttl: 1, + cachesize: 5 + }); + CacheObject.set(1, 1); + setTimeout(function() { + CacheObject.get(1, Function.prototype); + CacheObject.get(1, function() { + done(); + }); + }, 1200); + }); + });
failing test for issue #<I>
yahoo_dnscache
train
js
bfe96739a3c445e15e16c8c0dc60af2d663b357d
diff --git a/common/src/main/java/io/druid/granularity/DurationGranularity.java b/common/src/main/java/io/druid/granularity/DurationGranularity.java index <HASH>..<HASH> 100644 --- a/common/src/main/java/io/druid/granularity/DurationGranularity.java +++ b/common/src/main/java/io/druid/granularity/DurationGranularity.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/common/src/main/java/io/druid/granularity/QueryGranularity.java b/common/src/main/java/io/druid/granularity/QueryGranularity.java index <HASH>..<HASH> 100644 --- a/common/src/main/java/io/druid/granularity/QueryGranularity.java +++ b/common/src/main/java/io/druid/granularity/QueryGranularity.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
1) Move various "api" classes to io.druid packages and make sure things compile and stuff -- continued! Come classes didn't get committed?
apache_incubator-druid
train
java,java
1f7b8ecdb0635ca802bc3a566521a551dd676568
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import sys -from setuptools import setup +from setuptools import setup, find_packages REQUIRES = [] @@ -13,4 +13,9 @@ setup( author_email='ben.meyer@rackspace.com', install_requires=REQUIRES, test_suite='stackinabox', + packages=find_packages(exclude=['tests*', 'stackinabox/tests']), + zip_safe=True, + classifiers=["Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Topic :: Software Development :: Testing"], ) diff --git a/stackinabox/services/service.py b/stackinabox/services/service.py index <HASH>..<HASH> 100644 --- a/stackinabox/services/service.py +++ b/stackinabox/services/service.py @@ -14,7 +14,7 @@ class RouteAlreadyRegisteredError(Exception): class StackInABoxService(object): - DELETE = 'PUT' + DELETE = 'DELETE' GET = 'GET' HEAD = 'HEAD' OPTIONS = 'OPTIONS'
Bug Fixes - Bug Fix: setup did not include find_packages and therefore the currently installation may not be capturing everything it should be - Bug Fix: DELETE != PUT
TestInABox_stackInABox
train
py,py
78fd349e9a2d4bd311285decb88744de506bf81b
diff --git a/src/main/java/org/minimalj/model/properties/ChainedProperty.java b/src/main/java/org/minimalj/model/properties/ChainedProperty.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/minimalj/model/properties/ChainedProperty.java +++ b/src/main/java/org/minimalj/model/properties/ChainedProperty.java @@ -57,6 +57,9 @@ public class ChainedProperty implements PropertyInterface { Object value1 = property1.getValue(object); if (value1 != null) { property2.setValue(value1, value); + } else { + throw new NullPointerException( + property1.getName() + " on " + property1.getDeclaringClass().getSimpleName() + " is null"); } }
ChainedProperty: don't allow set on null objects
BrunoEberhard_minimal-j
train
java
1927c750429761dda24accd487f26c0ce7bb43a0
diff --git a/core/src/main/java/com/orientechnologies/orient/core/fetch/json/OJSONFetchContext.java b/core/src/main/java/com/orientechnologies/orient/core/fetch/json/OJSONFetchContext.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/fetch/json/OJSONFetchContext.java +++ b/core/src/main/java/com/orientechnologies/orient/core/fetch/json/OJSONFetchContext.java @@ -72,7 +72,8 @@ public class OJSONFetchContext implements OFetchContext { StringBuilder buffer = typesStack.pop(); if (keepTypes && buffer.length() > 0) try { - jsonWriter.writeAttribute(indentLevel + 1, true, ORecordSerializerJSON.ATTRIBUTE_FIELD_TYPES, buffer.toString()); + jsonWriter.writeAttribute(indentLevel > -1 ? indentLevel + 1 : -1, true, ORecordSerializerJSON.ATTRIBUTE_FIELD_TYPES, + buffer.toString()); } catch (IOException e) { throw new OFetchException("Error writing field types", e); }
Fixed issue #<I> about extra characters in returning JSON from server
orientechnologies_orientdb
train
java
b9c98de748cc0a04d3ea8b0be8c169c7f1bd7e09
diff --git a/openquake/commonlib/calc.py b/openquake/commonlib/calc.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/calc.py +++ b/openquake/commonlib/calc.py @@ -70,6 +70,7 @@ class HazardCurveGetter(object): self.rlzs_assoc = (rlzs_assoc if rlzs_assoc else dstore['csm_info'].get_rlzs_assoc()) self._pmap_by_grp = None # cache + self.sids = None # sids associated to the cache def new(self, sids): """ @@ -156,6 +157,10 @@ class HazardCurveGetter(object): else: pmap[sid] = probability_map.ProbabilityCurve(dset[idx]) self._pmap_by_grp[grp] = pmap + self.sids = sids # store the sids used in the cache + else: + # make sure the cache refer to the right sids + assert (sids == self.sids).all() return self._pmap_by_grp # ######################### hazard maps ################################### #
Added a consistency check Former-commit-id: 8c<I>ef<I>be<I>c8fcad<I>ab<I>a0d0a0be4
gem_oq-engine
train
py
32bde596e527990ba5b49ce28b469fe134a19fa8
diff --git a/lib/gscraper/search/web_query.rb b/lib/gscraper/search/web_query.rb index <HASH>..<HASH> 100644 --- a/lib/gscraper/search/web_query.rb +++ b/lib/gscraper/search/web_query.rb @@ -408,7 +408,7 @@ module GScraper raise(Blocked,"Google has temporarily blocked our IP Address",caller) end - results = doc.search('li.g') + results = doc.search('//li[@class="g"]') results_length = [@results_per_page, results.length].min rank_offset = result_offset_of(page_index)
Use an XPath expression here as well.
postmodern_gscraper
train
rb
7e760728889b3d3928310a453ebe3383adb37984
diff --git a/test/libmagic_test.py b/test/libmagic_test.py index <HASH>..<HASH> 100644 --- a/test/libmagic_test.py +++ b/test/libmagic_test.py @@ -3,12 +3,16 @@ import unittest import os import magic +import os.path # magic_descriptor is broken (?) in centos 7, so don't run those tests SKIP_FROM_DESCRIPTOR = bool(os.environ.get('SKIP_FROM_DESCRIPTOR')) +TESTDATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testdata')) + + class MagicTestCase(unittest.TestCase): - filename = 'testdata/test.pdf' + filename = os.path.join(TESTDATA_DIR, 'test.pdf') expected_mime_type = 'application/pdf' expected_encoding = 'us-ascii' expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages')
correctly find path to testdata when running from root
ahupp_python-magic
train
py
3ead70153c34a6e1665532d185572fae1144ea42
diff --git a/keyboard/keyboard.py b/keyboard/keyboard.py index <HASH>..<HASH> 100644 --- a/keyboard/keyboard.py +++ b/keyboard/keyboard.py @@ -5,7 +5,7 @@ import time import platform if platform.system() == 'Windows': - import keyboard.winkeyboard as os_keyboard + from. import winkeyboard as os_keyboard else: from. import nixkeyboard as os_keyboard
Import winkeyboard the same way as nixkeyboard
boppreh_keyboard
train
py
992b5c6eec86dc3562526d88d6623d8dcfbc90e8
diff --git a/src/webpack/config.js b/src/webpack/config.js index <HASH>..<HASH> 100644 --- a/src/webpack/config.js +++ b/src/webpack/config.js @@ -287,5 +287,8 @@ export default function createConfig(options) { ); } - return webpackConfig; + return { + webpackConfig, + webpack + }; }
createConfig now also returns the webpack instance
vgno_roc-web
train
js
31d69af3e37c61a8e33536c3748605f6a9340fc7
diff --git a/angr/analyses/cfg/cfg_fast.py b/angr/analyses/cfg/cfg_fast.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg/cfg_fast.py +++ b/angr/analyses/cfg/cfg_fast.py @@ -1676,7 +1676,10 @@ class CFGFast(ForwardAnalysis, CFGBase): # pylint: disable=abstract-method for ins_regex in self.project.arch.function_prologs: r = re.compile(ins_regex) regexes.append(r) - # FIXME: HACK: Oh my god i'm sorry + # EDG says: I challenge anyone bothering to read this to come up with a better + # way to handle CPU modes that affect instruction decoding. + # Since the only one we care about is ARM/Thumb right now + # we have this gross hack. Sorry about that. thumb_regexes = list() if hasattr(self.project.arch, 'thumb_prologs'): for ins_regex in self.project.arch.thumb_prologs:
Reword; the hack I think is gross is now the hack we're living with. Isn't ARM great folks?
angr_angr
train
py
ace9609a279286ec5f5caa1bbb48ce7985e246e6
diff --git a/js/kraken.js b/js/kraken.js index <HASH>..<HASH> 100644 --- a/js/kraken.js +++ b/js/kraken.js @@ -199,6 +199,7 @@ module.exports = class kraken extends Exchange { 'cacheDepositMethodsOnFetchDepositAddress': true, // will issue up to two calls in fetchDepositAddress 'depositMethods': {}, 'delistedMarketsById': {}, + 'disabledFiatCurrencies': ['CAD', 'USD', 'JPY', 'GBP'], }, 'exceptions': { 'EAPI:Invalid key': AuthenticationError, @@ -377,7 +378,7 @@ module.exports = class kraken extends Exchange { // differentiated fees for each particular method let code = this.commonCurrencyCode (currency['altname']); let precision = currency['decimals']; - let disabledFiatCurrencies = ['CAD', 'USD', 'JPY', 'GBP']; + let disabledFiatCurrencies = this.options.disabledFiatCurrencies; // assumes all currencies are active except those listed above let funding = { 'withdraw': {
[kraken] moved array to options
ccxt_ccxt
train
js
7becb0f6bd025640e4ab5a57eba33a40bd77094d
diff --git a/trakt/objects/season.py b/trakt/objects/season.py index <HASH>..<HASH> 100644 --- a/trakt/objects/season.py +++ b/trakt/objects/season.py @@ -74,4 +74,7 @@ class Season(Media): return season def __repr__(self): + if self.show: + return '<Season %r - S%02d>' % (self.show.title, self.pk) + return '<Season S%02d>' % self.pk
Updated the `__repr__()` method for the `Season` object
fuzeman_trakt.py
train
py
60f87cb4c3523faf5c5cdbc5f16453cae755988b
diff --git a/angr/procedures/java_jni/GetArrayElements.py b/angr/procedures/java_jni/GetArrayElements.py index <HASH>..<HASH> 100644 --- a/angr/procedures/java_jni/GetArrayElements.py +++ b/angr/procedures/java_jni/GetArrayElements.py @@ -9,6 +9,8 @@ class GetArrayElements(JNISimProcedure): array_ref = self.state.jni_references.lookup(array) values = self.load_java_array(self.state, array_ref) memory_addr = self.store_in_native_memory(values, array_ref.type) + if self.state.solver.eval(ptr_isCopy != 0): + self.store_in_native_memory(data=self.JNI_TRUE, data_type='boolean', addr=ptr_isCopy) return memory_addr def load_java_array(self, array_ref, start_idx=None, end_idx=None):
Fix case if isCopy is null
angr_angr
train
py
0338c7b0f022c5d44ede612b88e740013bfad759
diff --git a/test/browser/basic.js b/test/browser/basic.js index <HASH>..<HASH> 100644 --- a/test/browser/basic.js +++ b/test/browser/basic.js @@ -8,6 +8,7 @@ var test = require('tape') function makeFileShim (buf, name) { var file = new Blob([ buf ]) + file.fullPath = '/' + name file.name = name return file }
add fullPath property to tests
webtorrent_create-torrent
train
js
e1d77338485581fdc8b4e5d62ff2771284c12371
diff --git a/client/modules/crm/src/views/meeting/detail.js b/client/modules/crm/src/views/meeting/detail.js index <HASH>..<HASH> 100644 --- a/client/modules/crm/src/views/meeting/detail.js +++ b/client/modules/crm/src/views/meeting/detail.js @@ -98,6 +98,12 @@ Espo.define('crm:views/meeting/detail', 'views/detail', function (Dep) { if (!contactIdList.length && !leadIdList.length && !userIdList.length) { show = false; + } else if ( + userIdList.length === 1 && userIdList[0] === this.getUser().id + && + this.model.getLinkMultipleColumn('users', 'status', this.getUser().id) === 'Accepted' + ) { + show = false; } }
meeting/call do not show send invitees if only own user and accepted
espocrm_espocrm
train
js
b6feb777d512bba2ca545c4b65af7fa9030dd224
diff --git a/Library/ClassDefinition.php b/Library/ClassDefinition.php index <HASH>..<HASH> 100644 --- a/Library/ClassDefinition.php +++ b/Library/ClassDefinition.php @@ -1429,7 +1429,7 @@ class ClassDefinition if (!$check) { throw new CompilerException('Unknown class entry for "' . $className . '"'); } else { - $classEntry = 'zephir_get_internal_ce(SS("phalcon\\\\mvc\\\\application") TSRMLS_CC)'; + $classEntry = 'zephir_get_internal_ce(SS("'.str_replace('\\', '\\\\', strtolower($className)).'") TSRMLS_CC)'; } }
Fetch class entry name for zephir_get_internal_ce
phalcon_zephir
train
php
f7693f1e53c8cc5de43869412e322bcaaf234efd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -382,6 +382,8 @@ class ServerlessAppsyncPlugin { "dynamodb:Query", "dynamodb:Scan", "dynamodb:UpdateItem", + "dynamodb:BatchGetItem", + "dynamodb:BatchWriteItem" ]; const resourceArn = {
Allow batch DynamoDB operations with default role
sid88in_serverless-appsync-plugin
train
js
f5e050c27fcbc593d4d40c716dd8c5b13257db8a
diff --git a/lib/wasabi/operation_builder.rb b/lib/wasabi/operation_builder.rb index <HASH>..<HASH> 100644 --- a/lib/wasabi/operation_builder.rb +++ b/lib/wasabi/operation_builder.rb @@ -15,11 +15,6 @@ class Wasabi service = @wsdl.documents.services.fetch(@service_name) port = service.ports.fetch(@port_name) - # for now we just find the first soap service and determine the soap version to use this way. - # we need to somehow let people determine the service (by name?) and port (by soap version?) to use. - #soap_service, soap_version = find_soap_service - - #soap_port = soap_service.find_port_by_type(soap_version) endpoint = port.location binding = find_binding(port) @@ -37,18 +32,6 @@ class Wasabi private - #def find_soap_service - #@wsdl.documents.services.each do |name, service| - #soap_1_1_port = service.soap_1_1_port - #return [service, Wasabi::SOAP_1_1] if soap_1_1_port - - #service.soap_1_2_port - #return [service, Wasabi::SOAP_1_2] if soap_1_2_port - #end - - #raise 'Unable to find a SOAP service' - #end - def find_binding(port) binding_name = port.binding.split(':').last
removed old code from the OperationBuilder
savonrb_savon
train
rb
35002cef91f41ae7cd3ca7e0103fef287092ae4f
diff --git a/lib/event_source/read.rb b/lib/event_source/read.rb index <HASH>..<HASH> 100644 --- a/lib/event_source/read.rb +++ b/lib/event_source/read.rb @@ -30,7 +30,7 @@ module EventSource cycle ||= Cycle.build(delay_milliseconds: delay_milliseconds, timeout_milliseconds: timeout_milliseconds) new(stream).tap do |instance| - instance.configure(stream, batch_size: batch_size, precedence: precedence, partition: partition, session: session) + instance.configure(stream_name, batch_size: batch_size, precedence: precedence, partition: partition, session: session) Iterator.configure instance, instance.get, position: position, cycle: cycle end end
Convenience interfaces operate in terms of stream name rather than stream
eventide-project_message-store
train
rb
fc4ed6f9c2ba5db5ba379b5b106dc23c045f1dc0
diff --git a/zounds/__init__.py b/zounds/__init__.py index <HASH>..<HASH> 100644 --- a/zounds/__init__.py +++ b/zounds/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.56.0' +__version__ = '1.57.0' from .timeseries import \ Hours, Minutes, Seconds, Milliseconds, Microseconds, Picoseconds, \
New zounds version with updated matplotlib dependency
JohnVinyard_zounds
train
py
59f3f9fcf3551c55b7b1a9837763d9fc23c24a55
diff --git a/src/test/java/com/visenze/visearch/ViSearchSearchOperationsTest.java b/src/test/java/com/visenze/visearch/ViSearchSearchOperationsTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/visenze/visearch/ViSearchSearchOperationsTest.java +++ b/src/test/java/com/visenze/visearch/ViSearchSearchOperationsTest.java @@ -107,6 +107,7 @@ public class ViSearchSearchOperationsTest { SearchOperations searchOperations = new SearchOperationsImpl(mockClient, objectMapper); SearchParams searchParams = new SearchParams("test_im"); PagedSearchResult pagedResult = searchOperations.search(searchParams); + assertEquals(response, pagedResult.getRawJson()); assertEquals(new Integer(10), pagedResult.getPage()); assertEquals(new Integer(1), pagedResult.getLimit()); assertEquals(new Integer(20), pagedResult.getTotal());
Add test for getting raw json from response
visenze_visearch-sdk-java
train
java
bf02ebb642595215f68b2c8ca5d51b1fc7a00107
diff --git a/watch_test.go b/watch_test.go index <HASH>..<HASH> 100644 --- a/watch_test.go +++ b/watch_test.go @@ -649,4 +649,20 @@ func TestWatch(t *testing.T) { ) }, ) + t.Run( + "deepdirect", + func(t *testing.T) { + _testWatch( + t, + func() { + touch("a/deep/directory/direct") + }, + []string{"a/initial", "a/deep/directory/direct"}, + []string{}, + Mod{ + Added: []string{"a/deep/directory/direct"}, + }, + ) + }, + ) }
Test suite: add a test for direct files in non-existent directories
cortesi_moddwatch
train
go
794c06748c368b6fae0100e2511b6539d3ce8f68
diff --git a/src/main/java/com/redhat/darcy/ui/AbstractView.java b/src/main/java/com/redhat/darcy/ui/AbstractView.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/redhat/darcy/ui/AbstractView.java +++ b/src/main/java/com/redhat/darcy/ui/AbstractView.java @@ -107,13 +107,16 @@ public abstract class AbstractView implements View { */ @Override public final View setContext(ElementContext context) { - this.context = context; - List<Field> fields = ReflectionUtil.getAllDeclaredFields(this); + if (this.context == null) { // This only needs to happen once + readLoadConditionAnnotations(fields); + } + + this.context = context; + injectContexts(fields); initializeLazyElements(fields); - readLoadConditionAnnotations(fields); if (loadConditions.isEmpty()) { throw new MissingLoadConditionException(this);
Avoid adding duplicate load conditions on setContext
darcy-framework_darcy-ui
train
java
7b008468eaaceecf17c7f41d066a1ce0a5a81c83
diff --git a/Swat/SwatTableView.php b/Swat/SwatTableView.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTableView.php +++ b/Swat/SwatTableView.php @@ -805,7 +805,7 @@ class SwatTableView extends SwatControl implements SwatUIParent */ public function getMessages() { - $messages = parent::hasMessages(); + $messages = parent::getMessages(); if ($this->model !== null) { $rows = $this->model->getRows();
Patch from Brad Griffith to fix message retrieval for SwatTableView objects. svn commit r<I>
silverorange_swat
train
php
041e34b7aa1398df38effb1c3ed4559bd1f0299e
diff --git a/salt/scripts.py b/salt/scripts.py index <HASH>..<HASH> 100644 --- a/salt/scripts.py +++ b/salt/scripts.py @@ -91,6 +91,19 @@ def salt_run(): raise SystemExit('\nExiting gracefully on Ctrl-c') +def salt_ssh(): + ''' + Execute the salt-ssh system + ''' + if '' in sys.path: + sys.path.remove('') + try: + client = salt.cli.SaltSSH() + client.run() + except KeyboardInterrupt: + raise SystemExit('\nExiting gracefully on Ctrl-c') + + def salt_main(): ''' Publish commands to the salt system from the command line on the
hook in the scripts function for the salt-ssh script
saltstack_salt
train
py
a107ed97d06ed636762279899f239833f9d6d50f
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/action/MocoRequestAction.java b/moco-core/src/main/java/com/github/dreamhead/moco/action/MocoRequestAction.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/action/MocoRequestAction.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/action/MocoRequestAction.java @@ -42,12 +42,7 @@ public abstract class MocoRequestAction implements MocoEventAction { } protected final Resource applyUrl(final MocoConfig config) { - Resource appliedResource = this.url.apply(config); - if (appliedResource == this.url) { - return this.url; - } - - return appliedResource; + return this.url.apply(config); } protected final boolean isSameUrl(final Resource url) {
simplified applyUrl in moco request action
dreamhead_moco
train
java
dac99d55aec661bbca5d3efd6fab1d2842eea901
diff --git a/test/schema_object_base_test.rb b/test/schema_object_base_test.rb index <HASH>..<HASH> 100644 --- a/test/schema_object_base_test.rb +++ b/test/schema_object_base_test.rb @@ -20,6 +20,9 @@ describe Scorpio::SchemaObjectBase do assert_equal(%q(Scorpio::SchemaClasses["https://scorpio/foo#"]), subject.class.inspect) end end + it 'is the constant name plus the id for a class assigned to a constant' do + assert_equal(%q(Scorpio::OpenAPI::V2::Operation (http://swagger.io/v2/schema.json#/definitions/operation)), Scorpio::OpenAPI::V2::Operation.inspect) + end end describe 'class name' do let(:schema_content) { {'id' => 'https://scorpio/SchemaObjectBaseTest'} }
test SchemaObjectBase .inspect class method on a schema class set to a constant to get its name
notEthan_jsi
train
rb
7c49581cc7d6f9ebc9e6d9ec298149f0bbe6273d
diff --git a/mailer/__init__.py b/mailer/__init__.py index <HASH>..<HASH> 100644 --- a/mailer/__init__.py +++ b/mailer/__init__.py @@ -1,10 +1,12 @@ -VERSION = (0, 1, 0, "final") +VERSION = (0, 2, 0, "dev", 1) def get_version(): - if VERSION[3] != "final": - return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3]) - else: + if VERSION[3] == "final": return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2]) + elif VERSION[3] == "dev": + return "%s.%s.%s%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3], VERSION[4]) + else: + return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3]) __version__ = get_version()
master is <I> and modified version code for development releases
pinax_django-mailer
train
py