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
32998a063f1a978b05589edf928006684193c1f2
diff --git a/lib/how_is/report.rb b/lib/how_is/report.rb index <HASH>..<HASH> 100644 --- a/lib/how_is/report.rb +++ b/lib/how_is/report.rb @@ -4,7 +4,7 @@ require 'date' require "pathname" class HowIs - # Error class + # Raised when attempting to export to an unsupported format class UnsupportedExportFormat < StandardError def initialize(format) super("Unsupported export format: #{format}")
[docs] Improve docblock wording
duckinator_inq
train
rb
da14620774dc0e717222c7287230ad12e580d634
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ classifiers = ["License :: OSI Approved :: Apache Software License", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X"] + [ ("Programming Language :: Python :: %s" % x) for x in - "2.7 3.4".split()] + "2.7 3.4 3.5".split()] def make_cmdline_entry_points():
Tested in python <I>
KarlGong_ptest
train
py
026e2842a29c1f738a1b434873b323bbf763aa4c
diff --git a/LeanMapper/Repository.php b/LeanMapper/Repository.php index <HASH>..<HASH> 100644 --- a/LeanMapper/Repository.php +++ b/LeanMapper/Repository.php @@ -268,12 +268,7 @@ abstract class Repository return $this->entityClass = $entityClass; } } - $entityClass = $this->mapper->getEntityClass($this->mapper->getTableByRepositoryClass(get_called_class()), $row); - if ($row === null) { // this allows small performance optimalization (TODO: note in documentation) - $this->entityClass = $entityClass; - } else { - return $entityClass; - } + return $this->mapper->getEntityClass($this->mapper->getTableByRepositoryClass(get_called_class()), $row); } return $this->entityClass; }
Fixed cache-related issue in Repository
Tharos_LeanMapper
train
php
10104fa45f51090f425b8fd87858609951a5bca9
diff --git a/generators/app/index.js b/generators/app/index.js index <HASH>..<HASH> 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -106,7 +106,7 @@ module.exports = generator.extend({ this.template('dummy.txt', 'dummy.txt'); try { - jhipsterFunc.registerModule('generator-jhipster-db-helper', 'entity', 'post', 'app', 'A JHipster module for already existing databases'); + jhipsterFunc.registerModule('generator-jhipster-db-helper', 'app', 'post', 'app', 'A JHipster module for already existing databases'); } catch (err) { this.log(`${chalk.red.bold('WARN!')} Could not register as a jhipster entity post creation hook...\n`); }
move hook to post app rather than post entity
bastienmichaux_generator-jhipster-db-helper
train
js
944b4c0474efb37e589f91ce32926255975ef089
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -46,9 +46,16 @@ if os.name == 'nt': # Hack to overcome a separate bug def get_command_class(self, command): - """Ensures self.cmdclass is not a tuple.""" - if type(self.cmdclass) is tuple: - self.cmdclass = list(self.cmdclass) + """Replacement that doesn't write to self.cmdclass.""" + if command in self.cmdclass: + return self.cmdclass[command] + + for ep in pkg_resources.iter_entry_points('distutils.commands',command): + ep.require(installer=self.fetch_build_egg) + return ep.load() + else: + return _Distribution.get_command_class(self, command) + return dist.Distribution._get_command_class(self, command) dist.Distribution._get_command_class = dist.Distribution.get_command_class dist.Distribution.get_command_class = get_command_class
Another try for Win <I>.
tomduck_pandoc-eqnos
train
py
0f28d71d839c0b77a9298cb6062bf6f08befe72c
diff --git a/lib/omni_kassa.rb b/lib/omni_kassa.rb index <HASH>..<HASH> 100644 --- a/lib/omni_kassa.rb +++ b/lib/omni_kassa.rb @@ -3,7 +3,7 @@ require 'active_support/core_ext/string' module OmniKassa REQUEST_SETTINGS = :merchant_id, :currency_code, :transaction_reference, - :customer_language + :customer_language, :key_version SETTINGS = REQUEST_SETTINGS + [:secret_key, :url] def self.config(settings)
Added key_version to REQUEST_SETTINGS
pepijn_omni_kassa
train
rb
1ca488c3ec7750c44317fb95d69974f1b6787798
diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index <HASH>..<HASH> 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -30,11 +30,6 @@ var astTransformVisitor = { delete node.argument; } - if (t.isClassProperty(node)) { - // eslint doesn't like these - this.remove(); - } - if (t.isImportBatchSpecifier(node)) { // ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id> node.type = "ImportNamespaceSpecifier"; @@ -42,6 +37,19 @@ var astTransformVisitor = { delete node.name; } + // classes + + if (t.isClassDeclaration(node)) { + return t.variableDeclaration("let", [ + t.variableDeclarator(node.id, node) + ]); + } + + if (t.isClassProperty(node)) { + // eslint doesn't like these + this.remove(); + } + // JSX if (t.isJSXIdentifier(node)) {
turn class declarations into variable declarations - fixes babel/babel-eslint#8
babel_babel
train
js
ebd954c13eaccc641651a39207e269143404d211
diff --git a/lib/iniparse/line_types.rb b/lib/iniparse/line_types.rb index <HASH>..<HASH> 100644 --- a/lib/iniparse/line_types.rb +++ b/lib/iniparse/line_types.rb @@ -8,8 +8,7 @@ module IniParse :comment => nil, :comment_sep => nil, :comment_offset => 0, - :indent => nil, - :line => nil + :indent => nil }.freeze # Holds options for this line.
Let's not pass around a :line option for now.
antw_iniparse
train
rb
2873f416f6ef3a6d870a9a474845ff2992870fdc
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -296,7 +296,7 @@ function DiscordClient(options) { } }); } else { - console.log("Error POSTing login information: " + res.statusMessage + "\n" + body); + console.log("Error POSTing login information: \n" + body); self.emit("disconnected"); return false; }
Doesn't seem to give a statusMessage.
izy521_discord.io
train
js
6b48b0b3fa7896f31275840ab561195dc3e28f87
diff --git a/pyecore/ecore.py b/pyecore/ecore.py index <HASH>..<HASH> 100644 --- a/pyecore/ecore.py +++ b/pyecore/ecore.py @@ -61,12 +61,13 @@ class EcoreUtils(object): hasattr(obj, '_staticEClass') and obj._staticEClass elif isinstance(_type, EEnum): return obj in _type - elif isinstance(_type, EDataType) or isinstance(_type, EAttribute): + elif isinstance(_type, (EDataType, EAttribute)): return isinstance(obj, _type.eType) elif isinstance(_type, EClass): if isinstance(obj, EObject): - return obj.eClass is _type \ - or _type in obj.eClass.eAllSuperTypes() + return isinstance(obj, _type.python_class) + # return obj.eClass is _type \ + # or _type in obj.eClass.eAllSuperTypes() return False return isinstance(obj, _type) or obj is _type.eClass
Change 'EcoreUtils.isinstance' to deal with Python class This modification avoids the PyEcore 'isinstance' algorithm to deal with 'eAllSuperTypes()' which could be time consumming. Instead, it uses the 'python_class' which is produced and add to each 'EClass' instance.
pyecore_pyecore
train
py
20357c71f310378e49c913c243ae54c08bb9733e
diff --git a/spec/acceptance/real_time_updates_spec.rb b/spec/acceptance/real_time_updates_spec.rb index <HASH>..<HASH> 100644 --- a/spec/acceptance/real_time_updates_spec.rb +++ b/spec/acceptance/real_time_updates_spec.rb @@ -5,7 +5,7 @@ describe 'Updates to records in real-time indices', :live => true do product = Product.create! :name => "Widget \u0000" expect(Product.search.first).to eq(product) - end + end unless ENV['DATABASE'] == 'postgresql' it "handles attributes for sortable fields accordingly" do product = Product.create! :name => 'Red Fish'
Disable null character check for PostgreSQL. Seems pg updates don't allow such strings in the database. Fine by me.
pat_thinking-sphinx
train
rb
fc88679bd3e43d8e9b3c6d83bdc5a2032c987395
diff --git a/lib/lago/__init__.py b/lib/lago/__init__.py index <HASH>..<HASH> 100644 --- a/lib/lago/__init__.py +++ b/lib/lago/__init__.py @@ -504,11 +504,18 @@ class Prefix(object): task_message = 'Create empty disk image' elif spec['type'] == 'file': url = spec.get('url', '') + path = spec.get('path', '') + + if not url and not path: + raise RuntimeError('Partial drive spec %s' % str(spec)) + if url: - shutil.move( - self.fetch_url(self.path.prefixed(url)), spec['path'] - ) - # If we're using raw file, just return it's path + disk_in_prefix = self.fetch_url(url) + if path: + shutil.move(disk_in_prefix, spec['path']) + else: + spec['path'] = disk_in_prefix + # If we're using raw file, return it's path return spec['path'], disk_metadata else: raise RuntimeError('Unknown drive spec %s' % str(spec))
Support storing of disk url's into given path Allow when given both url and path to store the disk in given path Both url and uri are part of the disk json spec Change-Id: I5ec<I>d4ab<I>d1ce<I>bf<I>aa<I>b<I>c<I>aee
lago-project_lago
train
py
0b550f96957f0a7b573e5880123010671b470a12
diff --git a/modules/core/src/life_cycle/life_cycle.js b/modules/core/src/life_cycle/life_cycle.js index <HASH>..<HASH> 100644 --- a/modules/core/src/life_cycle/life_cycle.js +++ b/modules/core/src/life_cycle/life_cycle.js @@ -1,13 +1,22 @@ import {FIELD} from 'facade/lang'; import {ChangeDetector} from 'change_detection/change_detector'; +import {VmTurnZone} from 'core/zone/vm_turn_zone'; export class LifeCycle { _changeDetector:ChangeDetector; - constructor() { - this._changeDetector = null; + + constructor(changeDetector:ChangeDetector) { + this._changeDetector = changeDetector; + } + + registerWith(zone:VmTurnZone) { + zone.initCallbacks({ + onTurnDone: () => this.tick() + }); + this.tick(); } - digest() { - _changeDetector.detectChanges(); + tick() { + this._changeDetector.detectChanges(); } } \ No newline at end of file
feat(LifeCycle): change LifeCycle to be able register it with a zone
angular_angular
train
js
6ae20982ec83b9d9bfe1a8ccb0cac53373627653
diff --git a/src/ODM/MongoDB/Types/CurrencyType.php b/src/ODM/MongoDB/Types/CurrencyType.php index <HASH>..<HASH> 100644 --- a/src/ODM/MongoDB/Types/CurrencyType.php +++ b/src/ODM/MongoDB/Types/CurrencyType.php @@ -2,10 +2,10 @@ namespace ZFBrasil\DoctrineMoneyModule\ODM\MongoDB\Types; -use Doctrine\ODM\MongoDB\Types\StringType; +use Doctrine\ODM\MongoDB\Types\Type; use Money\Currency; -class CurrencyType extends StringType +class CurrencyType extends Type { const NAME = 'currency'; @@ -22,4 +22,20 @@ class CurrencyType extends StringType return new Currency($value); } + + public function closureToMongo() + { + return ' + if ($value) { + $return = $value->getName(); + } else { + $return null; + } + '; + } + + public function closureToPHP() + { + return '$return = new \Money\Currency($value);'; + } }
Bug fixation of ODM\MongoDB\Types\CurrencyType * shouldn't use stringtype
zfbrasil_doctrine-money-module
train
php
d22c6ef32d5644970b50c63a0e36953709944b84
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,7 @@ setup( long_description = long_description, keywords = 'framework templating template html xhtml python html5', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
Add python_requires to help pip
Knio_dominate
train
py
103091932659eb7255e694b5adc78f3b2de4b514
diff --git a/lib/traject/horizon_reader.rb b/lib/traject/horizon_reader.rb index <HASH>..<HASH> 100644 --- a/lib/traject/horizon_reader.rb +++ b/lib/traject/horizon_reader.rb @@ -356,6 +356,7 @@ module Traject rescue Exception => e logger.fatal "HorizonReader, unexpected exception at bib id:#{current_bib_id}: #{e}" + raise e ensure logger.info("HorizonReader: Closing all JDBC objects...")
bah, def do need to re-raise caught exception
jrochkind_traject_horizon
train
rb
3feb6a91e209e65fc96cd01b6d802ac56f649721
diff --git a/container/lxc/lxc.go b/container/lxc/lxc.go index <HASH>..<HASH> 100644 --- a/container/lxc/lxc.go +++ b/container/lxc/lxc.go @@ -148,14 +148,13 @@ lxc.network.type = veth lxc.network.link = lxcbr0 lxc.network.flags = up -lxc.mount.entry=/var/log/juju %s none defaults,bind 0 0 +lxc.mount.entry=/var/log/juju var/log/juju none defaults,bind 0 0 ` func (lxc *lxcContainer) WriteConfig() (string, error) { // TODO(thumper): support different network settings. - config := fmt.Sprintf(localConfig, lxc.InternalLogDir()) configFilename := filepath.Join(lxc.Directory(), "lxc.conf") - if err := ioutil.WriteFile(configFilename, []byte(config), 0644); err != nil { + if err := ioutil.WriteFile(configFilename, []byte(localConfig), 0644); err != nil { return "", err } return configFilename, nil
Have the config file use the root relative path for the mount.
juju_juju
train
go
ea2c140ea9c7bc5b2422c3076dfb899f94bb40a0
diff --git a/src/ReadModel/Index/Projector.php b/src/ReadModel/Index/Projector.php index <HASH>..<HASH> 100644 --- a/src/ReadModel/Index/Projector.php +++ b/src/ReadModel/Index/Projector.php @@ -326,8 +326,8 @@ class Projector implements EventListenerInterface $eventId, EntityType::EVENT(), $userId, - null, - null, + '', + '', $this->localDomain, $creationDate ); diff --git a/test/ReadModel/Index/ProjectorTest.php b/test/ReadModel/Index/ProjectorTest.php index <HASH>..<HASH> 100644 --- a/test/ReadModel/Index/ProjectorTest.php +++ b/test/ReadModel/Index/ProjectorTest.php @@ -224,8 +224,8 @@ class ProjectorTest extends \PHPUnit_Framework_TestCase $eventId, EntityType::EVENT(), $userId, - null, - null, + '', + '', Domain::specifyType('omd.be'), $this->isInstanceOf(\DateTime::class) );
III-<I> Title and zip should be set to default empty string instead of null.
cultuurnet_udb3-php
train
php,php
7c71e30224fcaaedca2a37d17676d976e91bb57d
diff --git a/src/cbednarski/Pharcc/Compiler.php b/src/cbednarski/Pharcc/Compiler.php index <HASH>..<HASH> 100644 --- a/src/cbednarski/Pharcc/Compiler.php +++ b/src/cbednarski/Pharcc/Compiler.php @@ -112,7 +112,7 @@ HEREDOC; } elseif (is_dir($include)) { $files = array_merge($files, FileUtils::listFilesInDir($this->config->getBasePath().DIRECTORY_SEPARATOR.$include)); } else { - throw new Exception('Included path is missing, unreadable, or is not a file or directory' . $include); + throw new \Exception('Included path is missing, unreadable, or is not a file or directory' . $include); } }
Added backslash to get Exception from the global namespace
cbednarski_pharcc
train
php
0fea2388ddf0cd965717718af0256488bd09c816
diff --git a/jupyterdrive/gdrive/drive-contents.js b/jupyterdrive/gdrive/drive-contents.js index <HASH>..<HASH> 100644 --- a/jupyterdrive/gdrive/drive-contents.js +++ b/jupyterdrive/gdrive/drive-contents.js @@ -105,7 +105,10 @@ define(function(require) { }; Contents.prototype.delete = function(path) { - return drive_utils.get_id_for_path(path, drive_utils.FileType.FILE) + return gapi_utils.gapi_ready + .then(function() { + return drive_utils.get_id_for_path(path, drive_utils.FileType.FILE); + }) .then(function(file_id){ return gapi_utils.execute(gapi.client.drive.files.delete({'fileId': file_id})); });
Adds gapi_utils.gapi_ready guard to Contents.delete gapi_utils.gapi_ready is a promise that is fullfilled when the Google API has loaded. This promise should be used to guard any calls to gapi_util or drive_util functions, to prevent calls to the Google API before the API has loaded.
jupyter_jupyter-drive
train
js
df3f919299a9c07d4e1a7c9bb7e3382ae3fad8d1
diff --git a/simulation.py b/simulation.py index <HASH>..<HASH> 100644 --- a/simulation.py +++ b/simulation.py @@ -47,6 +47,14 @@ class _DataFrameWrapper(object): return list(self._frame.columns) + _list_columns_for_table(self.name) @property + def local_columns(self): + """ + Columns in this table. + + """ + return list(self._frame.columns) + + @property def index(self): """ Table index.
when adding rows, need to be able to get only the local columns
UDST_orca
train
py
2d1a0a8d8139827a4bcbefde1440b47d02c18088
diff --git a/test/run-tests.php b/test/run-tests.php index <HASH>..<HASH> 100644 --- a/test/run-tests.php +++ b/test/run-tests.php @@ -24,7 +24,7 @@ /* $Id$ */ -error_reporting(E_ALL &~E_DEPRECATED); +error_reporting(E_ALL); if (!file_exists(dirname(__FILE__) . '/config.local.php')) { echo "Create config.local.php";
Removed E_DEPRECATED
pel_pel
train
php
87ebcb68b4f27838ac6f26d8843c65bf203d1861
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -363,7 +363,7 @@ setup( # 'ITER': ['*.csv'], # }, package_data={ - "tofu.tests.tests01_geom.tests03core_data": ["*.py", "*.txt"], + "tofu.tests.tests01_geom.tests03_core_data": ["*.py", "*.txt"], "tofu.geom.inputs": ["*.txt"], }, include_package_data=True,
Corrected typo in package_data that prevented proper .txt data to be included in sdist package from tests<I>_geom/tests<I>_core_data/
ToFuProject_tofu
train
py
876be130ed68dcba2cf838224b03edfce7ecf858
diff --git a/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java b/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java index <HASH>..<HASH> 100644 --- a/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java +++ b/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java @@ -76,7 +76,7 @@ public class CamelStubMessages implements MessageVerifier<Message> { ConsumerTemplate consumerTemplate = this.context.createConsumerTemplate(); Exchange exchange = consumerTemplate.receive(destination, timeUnit.toMillis(timeout)); - return exchange.getIn(); + return exchange != null ? exchange.getIn() : null; } catch (Exception e) { log.error("Exception occurred while trying to read a message from "
Added npe guard; fixes gh-<I>
spring-cloud_spring-cloud-contract
train
java
d5f0ac479b8638047110bb8269c2e30093ff4608
diff --git a/src/oauth2server/DatabaseInterface.php b/src/oauth2server/DatabaseInterface.php index <HASH>..<HASH> 100644 --- a/src/oauth2server/DatabaseInterface.php +++ b/src/oauth2server/DatabaseInterface.php @@ -6,8 +6,8 @@ interface DatabaseInteface { public function validateClient( $clientId, - $clientSecret, - $redirectUri + $clientSecret = null, + $redirectUri = null ); public function newSession(
Added NULL default back to $clientSecret and $redirectUri
thephpleague_oauth2-server
train
php
006532dfc897d3db87d8205932985655a12b8bf5
diff --git a/MAVProxy/modules/lib/ntrip.py b/MAVProxy/modules/lib/ntrip.py index <HASH>..<HASH> 100755 --- a/MAVProxy/modules/lib/ntrip.py +++ b/MAVProxy/modules/lib/ntrip.py @@ -175,6 +175,10 @@ class NtripClient(object): self.socket.close() self.socket = None return None + if len(data) == 0: + self.socket.close() + self.socket = None + return None if self.rtcm3.read(data): self.last_id = self.rtcm3.get_packet_ID() return self.rtcm3.get_packet()
ntrip: cope with zero data return
ArduPilot_MAVProxy
train
py
7e5d1aecb6300601d5aef45a1e313d40d6011178
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -20,7 +20,7 @@ function Server(host, port) { // if host provided, augment the urlObj if (host) { - urlObj.host = host; + urlObj.hostname = host; } // if port provided, augment the urlObj
Small bugfix of setting the server hostname.
dominicbarnes_node-couchdb-api
train
js
a5ec79f82c7bc7506ad8615e30e84e50fc0069c4
diff --git a/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java b/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java index <HASH>..<HASH> 100644 --- a/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java +++ b/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java @@ -173,6 +173,17 @@ public class RedissonScheduledExecutorServiceTest extends BaseTest { Thread.sleep(3000); assertThat(redisson.getAtomicLong("counter").get()).isEqualTo(3); + redisson.getAtomicLong("counter").delete(); + + RScheduledFuture<?> future2 = executor.scheduleWithFixedDelay(new ScheduledLongRepeatableTask("counter", "executed2"), 1, 2, TimeUnit.SECONDS); + Thread.sleep(6000); + assertThat(redisson.getAtomicLong("counter").get()).isEqualTo(3); + + executor.cancelTask(future2.getTaskId()); + assertThat(redisson.<Long>getBucket("executed2").get()).isBetween(1000L, Long.MAX_VALUE); + + Thread.sleep(3000); + assertThat(redisson.getAtomicLong("counter").get()).isEqualTo(3); } private void cancel(ScheduledFuture<?> future1) throws InterruptedException, ExecutionException {
test for cancelTask method added
redisson_redisson
train
java
420785e5e91c1b9a4fb53f48d00072d52af08d0f
diff --git a/spec/scss_lint/linter/private_naming_convention_spec.rb b/spec/scss_lint/linter/private_naming_convention_spec.rb index <HASH>..<HASH> 100644 --- a/spec/scss_lint/linter/private_naming_convention_spec.rb +++ b/spec/scss_lint/linter/private_naming_convention_spec.rb @@ -60,6 +60,20 @@ describe SCSSLint::Linter::PrivateNamingConvention do it { should_not report_lint } end + context 'is defined and used in the same file that starts with an @import' do + let(:scss) { <<-SCSS } + @import 'bar'; + + $_foo: red; + + p { + color: $_foo; + } + SCSS + + it { should_not report_lint } + end + context 'is defined and used in a for loop when the file begins with a comment' do let(:scss) { <<-SCSS } // A comment
Add test for another edge case in PrivateNamingConvention I was trying out this new rule in a few more places, and noticed similarly broken behavior when the file starts with an @import statement. My previous fix also resolves this, but I think it is good to cover this with a test anyway.
sds_scss-lint
train
rb
1fc0b2c08e0647efdd0346017d3b68b5a932eb00
diff --git a/lib/AmazonMwsResource.js b/lib/AmazonMwsResource.js index <HASH>..<HASH> 100644 --- a/lib/AmazonMwsResource.js +++ b/lib/AmazonMwsResource.js @@ -151,7 +151,15 @@ AmazonMwsResource.prototype = { function parseCSVFile(res, responseString, delimiter, callback) { var data = []; - csv.fromString(responseString, {headers: true, delimiter: delimiter, ignoreEmpty: true, quote: null}) + var options = { + delimiter: delimiter, + headers: true, + discardUnmappedColumns: true, + quote: null, + ignoreEmpty: true, + trim: true + }; + csv.fromString(responseString, options) .on('data', function (value) { data.push(value); })
added more options for CSV parsing
bhushankumarl_amazon-mws
train
js
e7274b4134468de8505ce90d5210f5c65ad4a07c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -87,6 +87,10 @@ function WebTorrent (opts) { self.emit('error', err) self.destroy() }) + + // Ignore warning when there are > 10 torrents in the client + self.dht.setMaxListeners(0) + self.dht.listen(opts.dhtPort) } else { self.dht = false
Ignore warning when there are > <I> torrents in the client
webtorrent_webtorrent
train
js
6b0a9ff7842acb92767ec367d4cc750dc1cc5437
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -402,7 +402,7 @@ abstract class Kernel implements KernelInterface } if ($this->container->hasParameter('kernel.compiled_classes')) { - ClassCollectionLoader::load($this->container->getParameter('kernel.compiled_classes'), $this->getCacheDir(), $name, $this->debug, true, $extension); + ClassCollectionLoader::load($this->container->getParameter('kernel.compiled_classes'), $this->getCacheDir(), $name, $this->debug, false, $extension); } }
[HttpKernel] changed the compiled class cache to non-adaptative (as it is now loaded very early)
symfony_symfony
train
php
9bb087caea0a17e21e88e787ec91dce041bb51ca
diff --git a/lib/bowline/library.rb b/lib/bowline/library.rb index <HASH>..<HASH> 100644 --- a/lib/bowline/library.rb +++ b/lib/bowline/library.rb @@ -5,9 +5,8 @@ module Bowline RUBYLIB_URL = "#{PROJECT_URL}/rubylib.zip" def path - # TODO - tilda won't work on win32 File.expand_path( - File.join(*%w{~ .bowline}) + File.join(Gem.user_home, ".bowline") ) end module_function :path
Gem lib has a nice api for the user's home dir
maccman_bowline
train
rb
4716287c742951ce011beea4d322e9664a677b9b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -49,23 +49,23 @@ var lowerBound = exports.lowerBound = function (range) { return k && range[k] } -exports.lowerBoundInclusive = function (range) { +var lowerBoundInclusive = exports.lowerBoundInclusive = function (range) { return has(range, 'gt') ? false : true } -exports.upperBoundInclusive = +var upperBoundInclusive = exports.upperBoundInclusive = function (range) { - return has(range, 'lt') || !range.minEx ? false : true + return (has(range, 'lt') /*&& !range.maxEx*/) ? false : true } var lowerBoundExclusive = exports.lowerBoundExclusive = function (range) { - return has(range, 'gt') || range.minEx ? true : false + return !lowerBoundInclusive(range) } var upperBoundExclusive = exports.upperBoundExclusive = function (range) { - return has(range, 'lt') ? true : false + return !upperBoundInclusive(range) } var upperBoundKey = exports.upperBoundKey = function (range) { @@ -144,3 +144,8 @@ exports.filter = function (range, compare) { return exports.contains(range, key, compare) } } + + + + +
_Exclusive interms of _Inclusive
dominictarr_ltgt
train
js
8425fa3324f591fb5f7aed0606d7a356eeb9f9de
diff --git a/orangepi/pi4B.py b/orangepi/pi4B.py index <HASH>..<HASH> 100644 --- a/orangepi/pi4B.py +++ b/orangepi/pi4B.py @@ -18,10 +18,10 @@ Usage: # pin number = (position of letter in alphabet - 1) * 32 + pin number # So, PD14 will be (4 - 1) * 32 + 14 = 110 -import orangepi.4 +import orangepi.pi4 # Orange Pi One physical board pin to GPIO pin -BOARD = orangepi.4.BOARD +BOARD = orangepi.pi4.BOARD # Orange Pi One BCM pin to actual GPIO pin -BCM = orangepi.4.BCM +BCM = orangepi.pi4.BCM
Update pi4B.py (#<I>) correct ref to pi4
rm-hull_OPi.GPIO
train
py
96f654ed226fc28c0654d9e0537bf2d1d48ca89e
diff --git a/tornado/concurrent.py b/tornado/concurrent.py index <HASH>..<HASH> 100644 --- a/tornado/concurrent.py +++ b/tornado/concurrent.py @@ -156,6 +156,7 @@ def return_future(f): return True exc_info = None with ExceptionStackContext(handle_error): + result = None try: result = f(*args, **kwargs) except:
Ensure the result variable is initialized even when an exception is handled.
tornadoweb_tornado
train
py
5c4ef40afb63704a2b9bb0a1fb5599224008aa0a
diff --git a/client/js/uploader.js b/client/js/uploader.js index <HASH>..<HASH> 100644 --- a/client/js/uploader.js +++ b/client/js/uploader.js @@ -338,6 +338,7 @@ qq.extend(qq.FineUploader.prototype, { var item = this.getItemByFileId(id); this._find(item, 'progressBar').style.width = 0; qq(item).removeClass(this._classes.fail); + qq(this._find(item, 'statusText')).clearText(); this._showSpinner(item); this._showCancelLink(item); return true;
#<I> - hide "failure" status message after starting retry attempt
FineUploader_fine-uploader
train
js
ed0f84ab3199e26d4c4b5256c0b47a6d1feaea64
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup( author_email='nico.schloemer@gmail.com', requires=['matplotlib (>=1.4.0)', 'numpy'], description='convert matplotlib figures into TikZ/PGFPlots', - long_description=convert_to_rst('README.md'), + long_description=convert_to_rst(os.path.abspath('README.md')), license='MIT License', classifiers=[ 'Development Status :: 5 - Production/Stable',
setup: always get README.md
nschloe_matplotlib2tikz
train
py
9f23e7eff94466f9d041f6907f8ae695e538217a
diff --git a/lib/omnibus-ctl.rb b/lib/omnibus-ctl.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus-ctl.rb +++ b/lib/omnibus-ctl.rb @@ -354,6 +354,11 @@ module Omnibus end end + # If it begins with a '-', it is an option. + def is_option?(arg) + arg && arg[0] == '-' + end + def run(args) # Ensure Omnibus related binaries are in the PATH ENV["PATH"] = [File.join(base_path, "bin"), @@ -361,8 +366,21 @@ module Omnibus ENV['PATH']].join(":") command_to_run = args[0] - service = args[1] + + # This piece of code checks if the argument is an option. If it is, + # then it sets service to nil and adds the argument into the options + # argument. This is ugly. A better solution is having a proper parser. + # But if we are going to implement a proper parser, we might as well + # port this to Thor rather than reinventing Thor. For now, this preserves + # the behavior to complain and exit with an error if one attempts to invoke + # a pcc command that does not accept an argument. Like "help". options = args[2..-1] || [] + if is_option?(args[1]) + options.unshift(args[1]) + service = nil + else + service = args[1] + end if !command_map.has_key?(command_to_run) log "I don't know that command."
Check if service argument is actually an option
chef_omnibus-ctl
train
rb
0ce94bf888ab26d196b23dbf78505f848b43072f
diff --git a/tests/Pheasant/Tests/MysqlTestCase.php b/tests/Pheasant/Tests/MysqlTestCase.php index <HASH>..<HASH> 100755 --- a/tests/Pheasant/Tests/MysqlTestCase.php +++ b/tests/Pheasant/Tests/MysqlTestCase.php @@ -19,6 +19,11 @@ class MysqlTestCase extends \PHPUnit_Framework_TestCase ; } + public function tearDown() + { + $this->pheasant->connection()->close(); + } + // Helper to return a connection public function connection() {
Close connection in test cases to avoid running out of connections
lox_pheasant
train
php
192032e324ddf24f50370e29990eb00c81af3c86
diff --git a/js/bones.js b/js/bones.js index <HASH>..<HASH> 100644 --- a/js/bones.js +++ b/js/bones.js @@ -638,7 +638,7 @@ var bones = { exports.Td = bones.Td; exports.Form = bones.Form; exports.Input = bones.Input; - exports.TextArea = bones.TextArea; + exports.Textarea = bones.Textarea; exports.Select = bones.Select; exports.Option = bones.Option; exports.Label = bones.Label;
merged cloud9 version with github version. Fixed bug in export of Textarea.
rsdoiel_tbone
train
js
51b563b4ca427da661465b5fb7154e3d726786f8
diff --git a/lib/json-dry.js b/lib/json-dry.js index <HASH>..<HASH> 100644 --- a/lib/json-dry.js +++ b/lib/json-dry.js @@ -14,7 +14,7 @@ var special_char = '~', * * @author Jelle De Loecker <jelle@develry.be> * @since 0.1.0 - * @version 1.0.0 + * @version 1.0.1 * * @param {Object} root * @param {Function} replacer @@ -131,7 +131,7 @@ function createDryReplacer(root, replacer) { // See if the new path is shorter len = 1; for (i = 0; i < path.length; i++) { - len += 1 + path.length; + len += 1 + path[i].length; } len += key.length;
Fix calculating length of possible replacement path
skerit_json-dry
train
js
3be01599300e56ebc13afc3748acdb2446cca749
diff --git a/aomi/validation.py b/aomi/validation.py index <HASH>..<HASH> 100644 --- a/aomi/validation.py +++ b/aomi/validation.py @@ -1,6 +1,7 @@ """Some validation helpers for aomi""" from __future__ import print_function import os +import platform import stat from aomi.helpers import problems, abspath, is_tagged, log @@ -66,10 +67,11 @@ def secret_file(filename): stat.S_ISLNK(filestat.st_mode) == 0: problems("Secret file %s must be a real file or symlink" % filename) - if filestat.st_mode & stat.S_IROTH or \ - filestat.st_mode & stat.S_IWOTH or \ - filestat.st_mode & stat.S_IWGRP: - problems("Secret file %s has too loose permissions" % filename) + if (platform.system() != "Windows"): + if filestat.st_mode & stat.S_IROTH or \ + filestat.st_mode & stat.S_IWOTH or \ + filestat.st_mode & stat.S_IWGRP: + problems("Secret file %s has too loose permissions" % filename) def validate_obj(keys, obj):
Don't do the file permission check on Windows When running Python on Windows, most of the file system permission checks are ignored by the python stat() call. So don't do the fine-grained permission checks there. Correct (hopefully) the whitespace issue More whitespace tinkering
Autodesk_aomi
train
py
fd3772dc9456ff8d346013ca59e31276f466652a
diff --git a/question/upgrade.php b/question/upgrade.php index <HASH>..<HASH> 100644 --- a/question/upgrade.php +++ b/question/upgrade.php @@ -77,8 +77,9 @@ function question_remove_rqp_qtype_config_string() { */ function question_random_check($result){ global $CFG; - if ($CFG->version >= 2007081000){ - return null;//no test after upgrade seperates question cats into contexts. + if (!empty($CFG->running_installer) //no test on first installation, no questions to test yet + || $CFG->version >= 2007081000){//no test after upgrade seperates question cats into contexts. + return null; } if (!$toupdate = question_cwqpfs_to_update()){ $result->setStatus(true);//pass test
MDL-<I> custom check was causing error on installation because dmllib functions are not available yet.
moodle_moodle
train
php
3cf76bbc87d6f50a801d9ad878324bd77f913e2a
diff --git a/group/classes/output/user_groups_editable.php b/group/classes/output/user_groups_editable.php index <HASH>..<HASH> 100644 --- a/group/classes/output/user_groups_editable.php +++ b/group/classes/output/user_groups_editable.php @@ -75,7 +75,7 @@ class user_groups_editable extends \core\output\inplace_editable { $options = []; foreach ($coursegroups as $group) { - $options[$group->id] = $group->name; + $options[$group->id] = format_string($group->name, true, ['context' => $this->context]); } $this->edithint = get_string('editusersgroupsa', 'group', fullname($user)); $this->editlabel = get_string('editusersgroupsa', 'group', fullname($user));
MDL-<I> core_group: add support for multi-lang to groups editable Part of MDL-<I>.
moodle_moodle
train
php
bea0e19bfb9747ef526e0a82f957c654d22202d6
diff --git a/packages/graphics/src/Graphics.js b/packages/graphics/src/Graphics.js index <HASH>..<HASH> 100644 --- a/packages/graphics/src/Graphics.js +++ b/packages/graphics/src/Graphics.js @@ -527,7 +527,18 @@ export default class Graphics extends Container if (points) { - if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) + // TODO: make a better fix. + + // We check how far our start is from the last existing point + const xDiff = Math.abs(points[points.length - 2] - startX); + const yDiff = Math.abs(points[points.length - 1] - startY); + + if (xDiff < 0.001 && yDiff < 0.001) + { + // If the point is very close, we don't add it, since this would lead to artifacts + // during tessellation due to floating point imprecision. + } + else { points.push(startX, startY); }
Fixes arc duplicating points (#<I>)
pixijs_pixi.js
train
js
33abf56b68f49b9e5c4b16745b46602e02008747
diff --git a/config/common.php b/config/common.php index <HASH>..<HASH> 100644 --- a/config/common.php +++ b/config/common.php @@ -1,7 +1,9 @@ <?php return [ + \Psr\SimpleCache\CacheInterface::class => \yii\di\Reference::to('cache'), + \yii\cache\CacheInterface::class => \yii\di\Reference::to('cache'), 'cache' => [ - '__class' => yii\cache\Cache::class, + '__class' => \yii\cache\Cache::class, ], ];
Added DI config for cache interfaces
yiisoft_cache
train
php
76215f1324a65b45ab0681f67212d05a68a11931
diff --git a/test/async.es6.js b/test/async.es6.js index <HASH>..<HASH> 100644 --- a/test/async.es6.js +++ b/test/async.es6.js @@ -226,6 +226,22 @@ describe("async functions and await expressions", function() { done(); }).catch(done); }); + + it("should propagate failure when returned", function() { + var rejection = new Error("rejection"); + + async function f() { + return new Promise(function(resolve, reject) { + reject(rejection); + }); + } + + return f().then(function(result) { + assert.ok(false, "should have been rejected"); + }, function(error) { + assert.strictEqual(error, rejection); + }); + }); }); describe("async function expressions", function() {
Add a failing test for #<I>.
facebook_regenerator
train
js
63129991865625fd05a7ff3195fb15358b4bf952
diff --git a/src/product-helpers.js b/src/product-helpers.js index <HASH>..<HASH> 100644 --- a/src/product-helpers.js +++ b/src/product-helpers.js @@ -7,7 +7,7 @@ export default { * Returns the variant of a product corresponding to the options given. * * @example - * const selectedVariant = client.product.variantForOptions(product, { + * const selectedVariant = client.product.helpers.variantForOptions(product, { * size: "Small", * color: "Red" * });
Add correct documentation for variantForOptions from product helpers
Shopify_js-buy-sdk
train
js
78378cf87aefbb7dc864407016a3182d6f3547ab
diff --git a/lib/are_you_sure/form_builders/confirm_form_builder.rb b/lib/are_you_sure/form_builders/confirm_form_builder.rb index <HASH>..<HASH> 100644 --- a/lib/are_you_sure/form_builders/confirm_form_builder.rb +++ b/lib/are_you_sure/form_builders/confirm_form_builder.rb @@ -63,7 +63,7 @@ module AreYouSure end def select_field_value(selected, *options) - return '' unless selected + return '' if selected.nil? options.flatten.each_slice(2).to_a.detect {|i| i[1] == selected }[0] end
selected is false or nil?
haazime_are_you_sure
train
rb
02517e42ccb6b7e2aba4e9af421d56862dbcb0a5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -15,8 +15,9 @@ setup( author_email='venthur@debian.org', url='https://github.com/venthur/python-debianbts', license='GPL2', - package_dir = {'': 'src'}, - py_modules = ['debianbts'], + package_dir={'': 'src'}, + py_modules=['debianbts'], + install_requires=['pysimplesoap'], classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", diff --git a/src/debianbts.py b/src/debianbts.py index <HASH>..<HASH> 100644 --- a/src/debianbts.py +++ b/src/debianbts.py @@ -48,7 +48,7 @@ if os.path.isdir(ca_path): # MAJOR: incompatible API changes # MINOR: add backwards-comptible functionality # PATCH: backwards-compatible bug fixes. -__version__ = '2.6.0' +__version__ = '2.6.1' PY2 = sys.version_info.major == 2
Adding pysimplesoap to install requirements and bumping version.
venthur_python-debianbts
train
py,py
2b5701d6bafa077f7719686c69261ef40fe29b84
diff --git a/src/Baum/Extensions/ModelExtensions.php b/src/Baum/Extensions/ModelExtensions.php index <HASH>..<HASH> 100644 --- a/src/Baum/Extensions/ModelExtensions.php +++ b/src/Baum/Extensions/ModelExtensions.php @@ -9,16 +9,13 @@ trait ModelExtensions { * @return \Baum\Node */ public function reload() { - if ( !$this->exists ) - return $this; + if ( !$this->exists ) { + $this->syncOriginal(); + } else { + $fresh = static::find($this->getKey()); - $dirty = $this->getDirty(); - if ( count($dirty) === 0 ) - return $this; - - $fresh = static::find($this->getKey()); - - $this->setRawAttributes($fresh->getAttributes(), true); + $this->setRawAttributes($fresh->getAttributes(), true); + } return $this; }
Modify Model::reload() function behaviour to sync with original attributes when model is not persisted and to always load from the database otherwise.
etrepat_baum
train
php
3e88a139f38f8b37ad100cdf85ce1fff22704d17
diff --git a/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js b/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js +++ b/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js @@ -300,12 +300,14 @@ var designerCtrl = App.controller('designerCtrl', function($scope, $q, $routePar .then( function () { return designerService.buildProject($scope.projectName) } ) .then( function () { - $scope.drawGraph(); + if ($scope.showGraph) + $scope.drawGraph(); notifications.put({type:"success", message:"Project saved"}); console.log("Project saved and built"); }, function (reason) { - $scope.drawGraph(); + if ($scope.showGraph) + $scope.drawGraph(); if ( reason.exception.className == 'ValidationException' ) { console.log("Validation error"); notifications.put({type:"warning", message:"Project saved with validation errors"});
Fixed regression issue observed when saving projects with diagram hidden. Refers #<I>
RestComm_Restcomm-Connect
train
js
772102dc1c6644918e1b0535c3528ec5db32a801
diff --git a/playground/examples/creating.objects.js b/playground/examples/creating.objects.js index <HASH>..<HASH> 100644 --- a/playground/examples/creating.objects.js +++ b/playground/examples/creating.objects.js @@ -73,14 +73,14 @@ syn.note( 0 ) // We can pass our own property values to // constructors. For example: -syn = Synth({ octave:-2, waveform:'pwm', Q:.9 }) +syn = Synth({ octave:-2, Q:.9, decay:1 }) syn.note( 0 ) // really, the above is just a shorthand for: syn = Synth() syn.octave = -2 -syn.waveform = 'pwm' syn.Q = .9 +syn.decay = 1 syn.note( 0 ) // We can also pass a preset first, and then
fixing intro tutorial to not change waveform property after init
charlieroberts_gibber.audio.lib
train
js
e248573c74efd1448f0423198d5bf546d2cde8ca
diff --git a/mautrix/client/api/modules/media_repository.py b/mautrix/client/api/modules/media_repository.py index <HASH>..<HASH> 100644 --- a/mautrix/client/api/modules/media_repository.py +++ b/mautrix/client/api/modules/media_repository.py @@ -47,7 +47,7 @@ class MediaRepositoryMethods(BaseClientAPI): Raises: MatrixResponseError: If the response does not contain a ``content_uri`` field. """ - resp = await self.api.request(Method.PUT, MediaPath.unstable["fi.mau.msc2246"].create) + resp = await self.api.request(Method.POST, MediaPath.unstable["fi.mau.msc2246"].create) try: return resp["content_uri"] except KeyError:
async media: fix method on /create
tulir_mautrix-python
train
py
158eaf2d064dc303f728c6ee47c762bab101ddc3
diff --git a/src/DataTables/Backend/CategoriesDataTable.php b/src/DataTables/Backend/CategoriesDataTable.php index <HASH>..<HASH> 100644 --- a/src/DataTables/Backend/CategoriesDataTable.php +++ b/src/DataTables/Backend/CategoriesDataTable.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Cortex\Categorizable\DataTables\Backend; -use Cortex\Categorizable\Models\Category; use Cortex\Foundation\DataTables\AbstractDataTable; use Cortex\Categorizable\Transformers\Backend\CategoryTransformer; @@ -13,7 +12,7 @@ class CategoriesDataTable extends AbstractDataTable /** * {@inheritdoc} */ - protected $model = Category::class; + protected $model = 'rinvex.categorizable.category'; /** * {@inheritdoc}
Use IoC bound model instead of the explicitly hardcoded
rinvex_cortex-categories
train
php
217a737ad1cca630a9c409ec481e0af3c5977772
diff --git a/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java +++ b/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java @@ -31,7 +31,10 @@ public class DerbyDatabase extends AbstractDatabase { } public String getDefaultDriver(String url) { - if (url.startsWith("jdbc:derby")) { + // CORE-1230 - don't shutdown derby network server + if (url.startsWith("jdbc:derby://")) { + return "org.apache.derby.jdbc.ClientDriver"; + } else if (url.startsWith("java:derby")) { return "org.apache.derby.jdbc.EmbeddedDriver"; } return null;
fix CORE-<I> shutdown derby database depends on whether it is embedded or network server
liquibase_liquibase
train
java
a132b04ee77aeea8fdf2c25825dae845b992148c
diff --git a/tests/framework/helpers/MarkdownTest.php b/tests/framework/helpers/MarkdownTest.php index <HASH>..<HASH> 100644 --- a/tests/framework/helpers/MarkdownTest.php +++ b/tests/framework/helpers/MarkdownTest.php @@ -36,4 +36,20 @@ TEXT; $this->assertNotEquals(Markdown::process($text), Markdown::process($text, 'original')); $this->assertEquals(Markdown::process($text), Markdown::process($text, 'gfm-comment')); } + + /** + * @expectedException \yii\base\InvalidParamException + * @expectedExceptionMessage Markdown flavor 'undefined' is not defined. + */ + public function testProcessInvalidParamException() + { + Markdown::process('foo', 'undefined'); + } + + public function testProcessParagraph() + { + $actual = Markdown::processParagraph('foo'); + $expected = 'foo'; + $this->assertEquals($expected, $actual); + } }
Add test coverage of yii\helpers\BaseMarkdown (#<I>)
yiisoft_yii-core
train
php
f7cfa262c9b10ce18fac0dd41cec1d16ceec4ba6
diff --git a/lago/templates.py b/lago/templates.py index <HASH>..<HASH> 100644 --- a/lago/templates.py +++ b/lago/templates.py @@ -228,7 +228,7 @@ class HttpTemplateProvider: """ response = self.open_url(url=handle, suffix='.hash') try: - return response.read() + return response.read().decode('utf-8') finally: response.close()
py3: templates: Decode downloaded hash to string
lago-project_lago
train
py
faa8667ef40fe66d1a7ed3e6090058f9c5285fd6
diff --git a/lastfp/__init__.py b/lastfp/__init__.py index <HASH>..<HASH> 100644 --- a/lastfp/__init__.py +++ b/lastfp/__init__.py @@ -116,6 +116,8 @@ def fpid_query(duration, fpdata, metadata=None): raise CommunicationError('ID query failed') except httplib.BadStatusLine: raise CommunicationError('bad response in ID query') + except IOError: + raise CommunicationError('ID query failed') try: fpid, status = res.split()[:2] @@ -146,6 +148,8 @@ def metadata_query(fpid, apikey): raise CommunicationError('metadata query failed') except httplib.BadStatusLine: raise CommunicationError('bad response in metadata query') + except IOError: + raise CommunicationError('metadata query failed') return fh.read() class ExtractionError(FingerprintError):
yet another HTTP failure more: raising IOError
beetbox_pylastfp
train
py
e063e93913219b3f39cbffbca488d62eb980dfac
diff --git a/src/com/opera/core/systems/OperaDriver.java b/src/com/opera/core/systems/OperaDriver.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/OperaDriver.java +++ b/src/com/opera/core/systems/OperaDriver.java @@ -210,6 +210,12 @@ public class OperaDriver extends RemoteWebDriver implements TakesScreenshot { // Get product from Opera settings.setProduct(utils().getProduct()); + + // Mobile needs to be able to autofocus elements for form input currently. This is an ugly + // workaround which should get solved by implementing a standalone bream Scope service. + if (utils().getProduct().is(OperaProduct.MOBILE)) { + preferences().set("User Prefs", "Allow Autofocus Form Element", true); + } } /**
Workaround for letting Opera Mobile autofocus form elements through ECMAscript
operasoftware_operaprestodriver
train
java
123a677e311129cdac495fbb27370593aa9aefd6
diff --git a/lib/rake/builder/qt_builder.rb b/lib/rake/builder/qt_builder.rb index <HASH>..<HASH> 100644 --- a/lib/rake/builder/qt_builder.rb +++ b/lib/rake/builder/qt_builder.rb @@ -33,9 +33,10 @@ module Rake end def configure - super + raise 'programming_language must be C++' if @programming_language.downcase != 'c++' + raise 'qt_version must be set' if ! @qt_version - raise "qt_version must be set" if ! @qt_version + super @resource_files = Rake::Path.expand_all_with_root( @resource_files, @rakefile_path ) @compilation_options += [ '-pipe', '-g', '-gdwarf-2', '-Wall', '-W' ]
Ensure that programming language is C++
joeyates_rake-builder
train
rb
42bd4e0c299aa59ccdbca3c198233870589cc3c0
diff --git a/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java b/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java index <HASH>..<HASH> 100644 --- a/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java +++ b/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java @@ -69,9 +69,11 @@ public class TabLayoutView extends TabLayout implements TabView { @Override public void onTabReselected(Tab tab) { - View tabBarItem = ((TabBarView) viewPager).getTabAt(0); - if (tabBarItem instanceof ScrollView) - ((ScrollView) tabBarItem).smoothScrollTo(0,0); + if (viewPager != null) { + View tabBarItem = ((TabBarView) viewPager).getTabAt(0); + if (tabBarItem instanceof ScrollView) + ((ScrollView) tabBarItem).smoothScrollTo(0, 0); + } } }; addOnTabSelectedListener(tabSelectedListener);
Checked view pager is not null
grahammendick_navigation
train
java
fafff8fd4c17804dca6205e38369e13c71d37408
diff --git a/Test/Fixture/SerializableAssocFixture.php b/Test/Fixture/SerializableAssocFixture.php index <HASH>..<HASH> 100644 --- a/Test/Fixture/SerializableAssocFixture.php +++ b/Test/Fixture/SerializableAssocFixture.php @@ -36,7 +36,7 @@ class SerializableAssocFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 20, 'key' => 'primary'), - 'field3' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100000, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + 'field3' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'serializable_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 20), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') );
fix fixture for mysql <I>
imsamurai_cakephp-serializable-behaviour
train
php
6b837a84a1302049788f5860aa32ccb0444afdb0
diff --git a/tasks/update.php b/tasks/update.php index <HASH>..<HASH> 100644 --- a/tasks/update.php +++ b/tasks/update.php @@ -99,7 +99,7 @@ class Fluxbb_Update_Task protected function down_version($version) { - $this->log('Rollback to v'.$version.'...'); + $this->log('Rollback from v'.$version.'...'); $this->foreach_migration($version, 'down'); }
Small wording fix in update task.
fluxbb_core
train
php
20042e2c2f04d052a795607fe18620b31aa57817
diff --git a/lib/octopress-deploy/s3.rb b/lib/octopress-deploy/s3.rb index <HASH>..<HASH> 100644 --- a/lib/octopress-deploy/s3.rb +++ b/lib/octopress-deploy/s3.rb @@ -30,7 +30,7 @@ module Octopress #abort "Seriously, you should. Quitting..." unless Deploy.check_gitignore @bucket = @s3.buckets[@bucket_name] if !@bucket.exists? - abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add_bucket`" + abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add-bucket`" else puts "Syncing #{@local} files to #{@bucket_name} on S3." write_files @@ -42,7 +42,7 @@ module Octopress def pull @bucket = @s3.buckets[@bucket_name] if !@bucket.exists? - abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add_bucket`" + abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add-bucket`" else puts "Syncing #{@bucket_name} files to #{@pull_dir} on S3." @bucket.objects.each do |object|
Fixed wrong command name for add-bucket
octopress_deploy
train
rb
fab2fc97ed7557d20c6bc7477e657c8eae9f0ebc
diff --git a/elizabeth/core/providers.py b/elizabeth/core/providers.py index <HASH>..<HASH> 100644 --- a/elizabeth/core/providers.py +++ b/elizabeth/core/providers.py @@ -2656,8 +2656,11 @@ class Generic(object): self.path = Path() def __getattr__(self, attrname): - """Get _attribute witout underscore""" - + """Get _attribute without underscore + + :param attrname: Attribute name. + :return: An attribute. + """ attribute = object.__getattribute__(self, '_' + attrname) if attribute and callable(attribute): attribute = attribute(self.locale)
Updated comments of __getattribute__
lk-geimfari_mimesis
train
py
4eb98844ea219ece9a75907732c149d2f51ff5fa
diff --git a/service/security/hapi-auth-service.js b/service/security/hapi-auth-service.js index <HASH>..<HASH> 100644 --- a/service/security/hapi-auth-service.js +++ b/service/security/hapi-auth-service.js @@ -2,6 +2,7 @@ const Boom = require('boom') const Hoek = require('hoek') +const config = require('./../lib/config') const internals = {} @@ -51,7 +52,7 @@ internals.implementation = function (server, options) { // only allow the SuperAdmin to impersonate an org let organizationId = user.organizationId - if (organizationId === 'ROOT' && request.headers.org) { + if (organizationId === config.get('authorization.superUser.organization.id') && request.headers.org) { organizationId = request.headers.org }
Fixes hard coded ROOT organization id
nearform_udaru
train
js
44dc5337dcecf2f9e106b75c73cee15d04986560
diff --git a/packages/tiptap-extensions/src/marks/Link.js b/packages/tiptap-extensions/src/marks/Link.js index <HASH>..<HASH> 100644 --- a/packages/tiptap-extensions/src/marks/Link.js +++ b/packages/tiptap-extensions/src/marks/Link.js @@ -59,7 +59,7 @@ export default class Link extends Mark { const { schema } = view.state const attrs = getMarkAttrs(view.state, schema.marks.link) - if (attrs.href) { + if (attrs.href && event.target instanceof HTMLAnchorElement) { event.stopPropagation() window.open(attrs.href) }
fix #<I>: link click handler no longer open on selection click
scrumpy_tiptap
train
js
608aebbafb47b076c9606bba3152ec5f409f1521
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java +++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java @@ -96,11 +96,16 @@ public class ShadowCanvas { public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) { describeBitmap(bitmap, paint); - appendDescription(" at (" + - dst.left + "," + dst.top + - ") with height=" + dst.height() + - " and width=" + dst.width() + - " taken from " + src.toString()); + StringBuilder descriptionBuilder = new StringBuilder(); + if (dst != null) { + descriptionBuilder.append(" at (").append(dst.left).append(",").append(dst.top) + .append(") with height=").append(dst.height()).append(" and width=").append(dst.width()); + } + + if (src != null) { + descriptionBuilder.append( " taken from ").append(src.toString()); + } + appendDescription(descriptionBuilder.toString()); } @Implementation
Check for null before logging in ShadowCanvas. (src is allowed to be null)
robolectric_robolectric
train
java
943daff0616ceb50ab2d3a73663b11fea5c5eabb
diff --git a/lib/rvideo/inspector.rb b/lib/rvideo/inspector.rb index <HASH>..<HASH> 100644 --- a/lib/rvideo/inspector.rb +++ b/lib/rvideo/inspector.rb @@ -50,7 +50,7 @@ module RVideo # :nodoc: raise ArgumentError, "Must supply either an input file or a pregenerated response" if options[:raw_response].nil? and file.nil? end - metadata = /(Input \#.*)\nMust/m.match(@raw_response) + metadata = metadata_match if /Unknown format/i.match(@raw_response) || metadata.nil? @unknown_format = true @@ -515,6 +515,18 @@ module RVideo # :nodoc: end private + + def metadata_match + [ + /(Input \#.*)\nMust/m, # ffmpeg + /(Input \#.*)\nAt least/m # ffmpeg macports + ].each do |rgx| + if md=rgx.match(@raw_response) + return md + end + end + nil + end def bitrate_match /bitrate: ([0-9\.]+)\s*(.*)\s+/.match(@raw_metadata)
Updated inspector to support ffmpeg output from the macports ffmpeg.
mhs_rvideo
train
rb
355212e04b6cb70949c439aa3e69bf3fbe094bc2
diff --git a/src/Labrador/Service/DefaultServicesRegister.php b/src/Labrador/Service/DefaultServicesRegister.php index <HASH>..<HASH> 100644 --- a/src/Labrador/Service/DefaultServicesRegister.php +++ b/src/Labrador/Service/DefaultServicesRegister.php @@ -74,8 +74,6 @@ class DefaultServicesRegister implements Register { 'dataGenerator' => GcbDataGenerator::class ] ); - - } private function registerSymfonyServices(Injector $injector) {
removing erroneous white space
labrador-kennel_core
train
php
0d247cdbe1366f511dd61e15d2b0d79a597b3817
diff --git a/src/Service/DataExport.php b/src/Service/DataExport.php index <HASH>..<HASH> 100644 --- a/src/Service/DataExport.php +++ b/src/Service/DataExport.php @@ -23,8 +23,8 @@ use Nails\Admin\DataExport\SourceResponse; */ class DataExport { - protected $aSources = []; - protected $aFormats = []; + protected $aSources = []; + protected $aFormats = []; protected $aCacheFiles = []; // -------------------------------------------------------------------------- @@ -36,18 +36,8 @@ class DataExport { $this->aSources = []; $this->aFormats = []; - $aComponents = array_merge( - [ - (object) [ - 'slug' => 'app', - 'namespace' => 'App\\', - 'path' => NAILS_APP_PATH, - ], - ], - Components::available() - ); - - foreach ($aComponents as $oComponent) { + + foreach (Components::available() as $oComponent) { $sPath = $oComponent->path; $sNamespace = $oComponent->namespace;
fix: Components::available() includes the application
nails_module-admin
train
php
7b8118e85e140b605d5bb15970c831b9d45817d6
diff --git a/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php b/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php index <HASH>..<HASH> 100644 --- a/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php +++ b/models/classes/search/index/DocumentBuilder/IndexDocumentBuilder.php @@ -250,17 +250,6 @@ class IndexDocumentBuilder extends InjectionAwareService implements IndexDocumen } $fieldName = $propertyTypeId . '_' . \tao_helpers_Slug::create($customPropertyLabel); - $propertyValue = $resource->getOnePropertyValue($property); - - if (null === $propertyValue) { - continue; - } - - if ($propertyValue instanceof Literal) { - $customProperties[$fieldName][] = (string)$propertyValue; - $customProperties[$fieldName] = array_unique($customProperties[$fieldName]); - continue; - } $customPropertiesValues = $resource->getPropertyValues($property); $customProperties[$fieldName] = array_map(
fix: collections of Literals should be searchable
oat-sa_tao-core
train
php
59b1ac0528fe9b8cb8ce4c166646ef73898a24e9
diff --git a/shinken/modules/livestatus_broker/livestatus.py b/shinken/modules/livestatus_broker/livestatus.py index <HASH>..<HASH> 100644 --- a/shinken/modules/livestatus_broker/livestatus.py +++ b/shinken/modules/livestatus_broker/livestatus.py @@ -5802,7 +5802,9 @@ class LiveStatusRequest(LiveStatus): attribute, operator = operator, attribute reference = '' attribute = self.strip_table_from_column(attribute) - if operator in ['=', '!=', '>', '>=']: + if operator in ['=', '>', '>=', '<', '<=', '=~', '~', '~~', '!=', '!>', '!>=', '!<', '!<=']: + if operator in ['!>', '!>=', '!<', '!<=']: + operator = { '!>' : '<=', '!>=' : '<', '!<' : '>=', '!<=' : '>' }[operator] self.filtercolumns.append(attribute) self.stats_columns.append(attribute) self.stats_filter_stack.put(self.make_filter(operator, attribute, reference))
*Add them for Stats: too
Alignak-monitoring_alignak
train
py
97ac11a9beeec558899ba21f80d2610cd7aabc92
diff --git a/lib/Rule.js b/lib/Rule.js index <HASH>..<HASH> 100644 --- a/lib/Rule.js +++ b/lib/Rule.js @@ -64,9 +64,10 @@ Rule.prototype.wrapPath = function (rule) { if (rule.charAt(rule.length - 1) === symbol.file) { rule = rule.slice(0, rule.length - 1); } else { - rule = rule.replace(/\/$/, '') + '/**/*' + rule = rule.replace(/\/$/, '') + '/'; } - return this.wrapMatch('-' + rule); + const length = rule.length; + return path => path.length > length && path.indexOf(rule) === 0; }; Rule.prototype.setNegation = function (negation) {
refactor(rule): update rule.wrapPath to str match.
xgfe_freepack
train
js
249fb7aa8c9e7cc3a00ca9eb4b777bc19d979c50
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -181,6 +181,7 @@ if( a['AMIGO_API_PORT'] && a['AMIGO_API_PORT'].value ){ var otu_mrg_imp_p = _to_boolean(a['OWLTOOLS_USE_MERGE_IMPORT'].value); var otu_rm_dis_p = _to_boolean(a['OWLTOOLS_USE_REMOVE_DISJOINTS'].value); var all_owltools_ops_flags_list = [ + '--log-info', '--merge-support-ontologies', // Make load less sensitive and more collapsed. //(otu_mrg_imp_p ? '--merge-import http://purl.obolibrary.org/obo/go/extensions/go-plus.owl' : '' ),
re-add explicit INFO logging during amigo loads
geneontology_amigo
train
js
0708ef673a9f30e1a30481020884f38928113f72
diff --git a/test/tools/javac/InterfaceAssert.java b/test/tools/javac/InterfaceAssert.java index <HASH>..<HASH> 100644 --- a/test/tools/javac/InterfaceAssert.java +++ b/test/tools/javac/InterfaceAssert.java @@ -23,9 +23,11 @@ /* * @test - * @bug 4399129 + * @bug 4399129 6980724 * @summary Check that assertions compile properly when nested in an interface * @author gafter + * @compile InterfaceAssert.java + * @run main InterfaceAssert */ /*
<I>: test/tools/javac/InterfaceAssert.java sometimes fails (This is the same as OpenJDK changeset 3a9f<I>be<I>a.)
wmdietl_jsr308-langtools
train
java
e6288c27ee2aecc2e0fd97eeff7c2b46d303cdd2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ except: from distutils.core import setup setup(name='sprinter', - version='0.4.0', + version='0.4.1', description='a utility library to help environment bootstrapping scripts', author='Yusuke Tsutsumi', author_email='yusuke@yusuketsutsumi.com',
Revving to <I> * feature: standalone sprinter install * feature: sandboxed brew * feature: sandboxed virtualenv * bugfix: ssh uses keyname instead of host as host name * bugfix: brew install was not working * bugfix: issue with standard recipe being called over other recipe * bugfix: fixing phases implementation
toumorokoshi_sprinter
train
py
63b0109c7fc45b7e0fd047226f44d9b1e85c2e52
diff --git a/test/TestAsset/ExceptionWithStringAsCode.php b/test/TestAsset/ExceptionWithStringAsCode.php index <HASH>..<HASH> 100644 --- a/test/TestAsset/ExceptionWithStringAsCode.php +++ b/test/TestAsset/ExceptionWithStringAsCode.php @@ -13,5 +13,6 @@ use Exception; class ExceptionWithStringAsCode extends Exception { + /** @var string */ protected $code = 'ExceptionString'; } diff --git a/test/TestAsset/FailingExceptionWithStringAsCodeFactory.php b/test/TestAsset/FailingExceptionWithStringAsCodeFactory.php index <HASH>..<HASH> 100644 --- a/test/TestAsset/FailingExceptionWithStringAsCodeFactory.php +++ b/test/TestAsset/FailingExceptionWithStringAsCodeFactory.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */
set <I> in @copyright
mxc-commons_mxc-servicemanager
train
php,php
13b167e23a92063cbe74fb54f42f3cffe51414c7
diff --git a/lib/Pico.php b/lib/Pico.php index <HASH>..<HASH> 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -465,7 +465,7 @@ class Pico 'rewrite_url' => null, 'theme' => 'default', 'date_format' => '%D %T', - 'twig_config' => array('cache' => false, 'autoescape' => false, 'debug' => false), + 'twig_config' => null, 'pages_order_by' => 'alpha', 'pages_order' => 'asc', 'content_dir' => null, @@ -486,6 +486,13 @@ class Pico $this->config['rewrite_url'] = $this->isUrlRewritingEnabled(); } + $defaultTwigConfig = array('cache' => false, 'autoescape' => false, 'debug' => false); + if (!is_array($this->config['twig_config'])) { + $this->config['twig_config'] = $defaultTwigConfig; + } else { + $this->config['twig_config'] += $defaultTwigConfig; + } + if (empty($this->config['content_dir'])) { // try to guess the content directory if (is_dir($this->getRootDir() . 'content')) {
Pico::loadConfig(): Improve Twig config parsing Thanks @refeaime for reporting this
picocms_Pico
train
php
4ebe37fd1a77a251abef39c4d090f1f2dbfe9f96
diff --git a/libdokan/folderlist.go b/libdokan/folderlist.go index <HASH>..<HASH> 100644 --- a/libdokan/folderlist.go +++ b/libdokan/folderlist.go @@ -150,7 +150,7 @@ func (fl *FolderList) FindFiles(fi *dokan.FileInfo, callback func(*dokan.NamedSt var favs []*libkbfs.Favorite if isLoggedIn { - favs, err := fl.fs.config.KBFSOps().GetFavorites(ctx) + favs, err = fl.fs.config.KBFSOps().GetFavorites(ctx) fl.fs.log.CDebugf(ctx, "FL ReadDirAll -> %v,%v", favs, err) if err != nil { return err
libdokan: fix folderlist readdir
keybase_client
train
go
7a33105b783929da8c7adc16864494c1cd231b7d
diff --git a/code/GridFieldOrderableRows.php b/code/GridFieldOrderableRows.php index <HASH>..<HASH> 100755 --- a/code/GridFieldOrderableRows.php +++ b/code/GridFieldOrderableRows.php @@ -238,7 +238,25 @@ class GridFieldOrderableRows extends RequestHandler implements $this->populateSortValues($items); // Generate the current sort values. - $current = $items->map('ID', $field)->toArray(); + if ($items instanceof ManyManyList) + { + $current = array(); + foreach ($items->toArray() as $record) + { + // NOTE: _SortColumn0 is the first ->sort() field + // used by SS when functions are detected in a SELECT + // or CASE WHEN. + if (isset($record->_SortColumn0)) { + $current[$record->ID] = $record->_SortColumn0; + } else { + $current[$record->ID] = $record->$field; + } + } + } + else + { + $current = $items->map('ID', $field)->toArray(); + } // Perform the actual re-ordering. $this->reorderItems($list, $current, $ids);
Fix bug where the current sort value is pulled from the base table if the sortField has the same name when using ManyManyList
symbiote_silverstripe-gridfieldextensions
train
php
a2fc84b50d5381462abc34e1183ecb7c5add3789
diff --git a/inquirer/themes.py b/inquirer/themes.py index <HASH>..<HASH> 100644 --- a/inquirer/themes.py +++ b/inquirer/themes.py @@ -25,7 +25,7 @@ def load_theme_from_json(json_theme): } } - Color values should be strings representing valid blessings.Terminal colors. + Color values should be string representing valid blessings.Terminal colors. """ return load_theme_from_dict(json.loads(json_theme)) @@ -46,7 +46,7 @@ def load_theme_from_dict(dict_theme): } } - Color values should be strings representing valid blessings.Terminal colors. + Color values should be string representing valid blessings.Terminal colors. """ t = Default() for question_type, settings in dict_theme.items():
lines too long. damn <I> chars lines
magmax_python-inquirer
train
py
560be6419cee712976dde1c1103f1cc01cffe9e7
diff --git a/src/FlashNotifier.php b/src/FlashNotifier.php index <HASH>..<HASH> 100644 --- a/src/FlashNotifier.php +++ b/src/FlashNotifier.php @@ -79,4 +79,20 @@ class FlashNotifier $this->session->flash('flash_notifications', $notifications); } } + + /** + * Extend the aged flash data one `\Request` further + * Equivalent to Laravel's `\Session::reflash()` but scoped to only `\Flash` data + */ + public function renew() + { + if($this->session->has('flash_notifications')) { + $notifications = []; + foreach ($this->session->get('flash_notifications') as $notification) { + $notifications[$notification['level']] = $notification['message']; + }; + + $this->manyMessages($notifications); + } + } }
Add support for extending the flash messages for an extra request via `\Flash::renew()`
mds-tech_flash
train
php
ba5adad6825ade8a34de9bfdae28b95b4799b21e
diff --git a/lib/clickhouse/connection/client.rb b/lib/clickhouse/connection/client.rb index <HASH>..<HASH> 100644 --- a/lib/clickhouse/connection/client.rb +++ b/lib/clickhouse/connection/client.rb @@ -1,12 +1,22 @@ +require "forwardable" + module Clickhouse class Connection module Client + def self.included(base) + base.extend Forwardable + base.def_delegators :@client, :get + base.def_delegators :@client, :post + end + def connect! return if connected? + response = client.get "/" raise ConnectionError, "Unexpected response status: #{response.status}" unless response.status == 200 true + rescue Faraday::ConnectionFailed => e raise ConnectionError, e.message end diff --git a/test/unit/connection/test_client.rb b/test/unit/connection/test_client.rb index <HASH>..<HASH> 100644 --- a/test/unit/connection/test_client.rb +++ b/test/unit/connection/test_client.rb @@ -56,6 +56,22 @@ module Unit assert_equal false, @connection.connected? end end + + describe "#get" do + it "gets delegated to the client" do + @connection.instance_variable_set :@client, (client = mock) + client.expects(:get).with(:foo) + @connection.get(:foo) + end + end + + describe "#post" do + it "gets delegated to the client" do + @connection.instance_variable_set :@client, (client = mock) + client.expects(:post).with(:foo) + @connection.post(:foo) + end + end end end
Delegating #get and #post to the (Faraday) client
archan937_clickhouse
train
rb,rb
8e436de3ba97e2bc173984b13cc5c31f44e637b4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -235,7 +235,8 @@ class JavaLib(object): self.java_files = [] self.dependencies = [] self.properties = [] - if hadoop_vinfo.main >= (2, 0, 0) and hadoop_vinfo.is_yarn(): + if hadoop_vinfo.main >= (2, 0, 0) and \ + (not hadoop_vinfo.is_cloudera() or hadoop_vinfo.is_yarn()): # This version of Hadoop has the v2 pipes API # FIXME: kinda hardwired to avro for now self.properties.append((os.path.join(
Also build with v2 API when using Hadoop2 without Yarn
crs4_pydoop
train
py
9c73997387dbaab74e77f5aafe3cc54ddd1dbc30
diff --git a/demos/bartlett1932/__init__.py b/demos/bartlett1932/__init__.py index <HASH>..<HASH> 100644 --- a/demos/bartlett1932/__init__.py +++ b/demos/bartlett1932/__init__.py @@ -0,0 +1,7 @@ +from dallinger import db +from experiment import Bartlett1932 + + +def build(): + """Potentially move PsiturkConfig stuff in here""" + return Bartlett1932(db.init_db())
Placeholder for wrapper/factory function to return an experiment
Dallinger_Dallinger
train
py
6dc7e624d31280cf9b67ec41be0968ff3e0c0551
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -349,12 +349,12 @@ function _uploadDeviceKeys(client) { device_id: deviceId, keys: client._deviceKeys, user_id: userId, - signatures: {}, }; + var sig = client._olmDevice.sign(anotherjson.stringify(deviceKeys)); + deviceKeys.signatures = {}; deviceKeys.signatures[userId] = {}; - deviceKeys.signatures[userId]["ed25519:" + deviceId] = - client._olmDevice.sign(anotherjson.stringify(deviceKeys)); + deviceKeys.signatures[userId]["ed25519:" + deviceId] = sig; return client.uploadKeysRequest({ device_keys: deviceKeys,
Fix device key signing Calculate the signature *before* we add the `signatures` key.
matrix-org_matrix-js-sdk
train
js
d99bec321b1254972fb4928fe9fd4bbb80362206
diff --git a/report/log/index.php b/report/log/index.php index <HASH>..<HASH> 100644 --- a/report/log/index.php +++ b/report/log/index.php @@ -90,7 +90,9 @@ if ($logreader !== '') { if (($edulevel != -1)) { $params['edulevel'] = $edulevel; } - +if ($origin !== '') { + $params['origin'] = $origin; +} // Legacy store hack, as edulevel is not supported. if ($logreader == 'logstore_legacy') { $params['edulevel'] = -1;
MDL-<I> reports: origin parameter looked at in log reports
moodle_moodle
train
php
2ca115789b96287ba0c8a32c514d1fe2beedb750
diff --git a/girc/capabilities.py b/girc/capabilities.py index <HASH>..<HASH> 100644 --- a/girc/capabilities.py +++ b/girc/capabilities.py @@ -24,6 +24,8 @@ class Capabilities: if '=' in cap: cap, value = cap.rsplit('=', 1) + if value = '': + value = None else: value = True
[caps] Mark CAPA= as None instead of True
goshuirc_irc
train
py
9ebe283358654606c1d55b165909a21a93d1b9a1
diff --git a/src/ai/backend/common/types.py b/src/ai/backend/common/types.py index <HASH>..<HASH> 100644 --- a/src/ai/backend/common/types.py +++ b/src/ai/backend/common/types.py @@ -550,7 +550,7 @@ class ResourceSlot(UserDict): def as_numeric(self, slot_types, *, unknown: HandlerForUnknownSlotType = 'error', - fill_missing: bool = True): + fill_missing: bool = False): data = {} unknown_handler = HandlerForUnknownSlotType(unknown) for k, v in self.data.items(): @@ -608,7 +608,7 @@ class ResourceSlot(UserDict): def as_json_numeric(self, slot_types, *, unknown: HandlerForUnknownSlotType = 'error', - fill_missing: bool = True): + fill_missing: bool = False): data = {} unknown_handler = HandlerForUnknownSlotType(unknown) for k, v in self.data.items():
ResourceSlot: as_numeric's fill_missing should default to False ...not to break the existing master branch of the manager
lablup_backend.ai-common
train
py
c7213d018047b6a17cfac88953e7cacf9ab48b10
diff --git a/src/main/java/net/spy/memcached/MemcachedConnection.java b/src/main/java/net/spy/memcached/MemcachedConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/spy/memcached/MemcachedConnection.java +++ b/src/main/java/net/spy/memcached/MemcachedConnection.java @@ -293,6 +293,10 @@ public final class MemcachedConnection extends SpyObject { ByteBuffer rbuf=qa.getRbuf(); final SocketChannel channel = qa.getChannel(); int read=channel.read(rbuf); + if (read < 0) { + // GRUMBLE. + throw new IOException("Disconnected"); + } while(read > 0) { getLogger().debug("Read %d bytes", read); rbuf.flip();
if the memcache server disconnects, try to notice.
dustin_java-memcached-client
train
java
3d3e95d1999a75f23c8389ca67d3cf750caa8760
diff --git a/playerRecord.py b/playerRecord.py index <HASH>..<HASH> 100644 --- a/playerRecord.py +++ b/playerRecord.py @@ -34,7 +34,7 @@ class PlayerRecord(object): self.type = c.PlayerDesigns(c.HUMAN) self.difficulty = c.ComputerDifficulties(None) # only matters if type is a computer self.initCmd = "" # only used if self.type is an AI or bot - self.rating = 500 + self.rating = c.DEFAULT_RATING self.created = time.time() # origination timestamp self._matches = [] # match history # initialize with new values @@ -122,6 +122,12 @@ class PlayerRecord(object): raise ValueError("Encountered invalid attributes. ALLOWED: %s%s%s"\ %(list(self.__dict__), os.linesep, badAttrsMsg)) ############################################################################ + def control(self): + """the type of control this player exhibits""" + if self.isComputer: value = c.COMPUTER + else: value = c.PARTICIPANT + return c.PlayerControls(value) + ############################################################################ def load(self, playerName=None): """retrieve the PlayerRecord settings from saved disk file""" if playerName: # switch the PlayerRecord this object describes
- use DEFAULT_RATING - migrated control() method from PlayerPreGame
ttinies_sc2players
train
py
01217329f9d53edbd2bf2f721b953a2133a3d716
diff --git a/core/src/test/java/jlibs/core/i18n/ResourceBundleTest.java b/core/src/test/java/jlibs/core/i18n/ResourceBundleTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/jlibs/core/i18n/ResourceBundleTest.java +++ b/core/src/test/java/jlibs/core/i18n/ResourceBundleTest.java @@ -58,6 +58,7 @@ public class ResourceBundleTest{ Assert.assertNull(errors, "compilation failed with errors:\n"+errors); else{ errors = errors.replace('\\', '/'); + errors = errors.replace("\r\n", "\n"); for(String error: searchFor){ if(errors.indexOf(error)==-1) Assert.fail("[Expected Error] "+error+"\n[Actual Error] "+errors);
tests were failing on windows because of pathseparator
santhosh-tekuri_jlibs
train
java
094fcece17bceb004e1b0ab6fd8789e84c2e85a5
diff --git a/src/EventSourcing/DBAL/AggregateAwareDBALEventStore.php b/src/EventSourcing/DBAL/AggregateAwareDBALEventStore.php index <HASH>..<HASH> 100644 --- a/src/EventSourcing/DBAL/AggregateAwareDBALEventStore.php +++ b/src/EventSourcing/DBAL/AggregateAwareDBALEventStore.php @@ -275,4 +275,4 @@ class AggregateAwareDBALEventStore implements EventStoreInterface return $id; } -} \ No newline at end of file +}
III-<I> Fixed coding standards.
cultuurnet_udb3-php
train
php
fd408deaf473ce7727fdd35a5a9ac43eaf038e03
diff --git a/pyrtl/passes.py b/pyrtl/passes.py index <HASH>..<HASH> 100644 --- a/pyrtl/passes.py +++ b/pyrtl/passes.py @@ -85,9 +85,14 @@ def optimize(update_working_block=True, block=None): def constant_propagation(block): - """Removes excess constants in the block""" - + """ + Removes excess constants in the block + Note on resulting block: + The output of the block can have wirevectors that are driven but not + listened to. This is to be expected. These are to be removed by the + remove_unlistened_nets function + """ current_nets = 0 while len(block.logic) != current_nets:
Added more constant propogation documentation
UCSBarchlab_PyRTL
train
py
181a53450f2e2face324703ec7e9789549171c75
diff --git a/colorise/parser.py b/colorise/parser.py index <HASH>..<HASH> 100644 --- a/colorise/parser.py +++ b/colorise/parser.py @@ -181,7 +181,7 @@ class ColorFormatParser(object): r = [None, None] for token in tokens: - for i, e in enumerate(('fg=', 'bg=')): + for i, e in enumerate(['fg=', 'bg=']): if token.startswith(e): if r[i] is not None: raise ColorSyntaxError("Multiple color definitions of"
Use a list for better readability
MisanthropicBit_colorise
train
py
62517a91c586a5cf20414f803638f018ec85f834
diff --git a/core/src/main/java/org/mwg/core/scheduler/HybridScheduler.java b/core/src/main/java/org/mwg/core/scheduler/HybridScheduler.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/mwg/core/scheduler/HybridScheduler.java +++ b/core/src/main/java/org/mwg/core/scheduler/HybridScheduler.java @@ -76,7 +76,12 @@ public class HybridScheduler implements Scheduler { @Override public void run() { while (running) { - final Job globalPolled = globalQueue.poll(); + Job globalPolled = null; + try { + globalPolled = globalQueue.take(); + } catch (InterruptedException e) { + e.printStackTrace(); + } if (globalPolled != null) { try { globalPolled.run();
Fixing performance issue due to active check.
datathings_greycat
train
java
4e03e6f6f8a368520503be7f7097d95fda468fa1
diff --git a/src/Form/Builder.php b/src/Form/Builder.php index <HASH>..<HASH> 100644 --- a/src/Form/Builder.php +++ b/src/Form/Builder.php @@ -163,7 +163,7 @@ class Builder $html[] = "$name=\"$value\""; } - return '<form '.implode(' ', $html).'>'; + return '<form '.implode(' ', $html).' pjax-container>'; } /** diff --git a/views/index.blade.php b/views/index.blade.php index <HASH>..<HASH> 100644 --- a/views/index.blade.php +++ b/views/index.blade.php @@ -93,6 +93,10 @@ container: '#pjax-container' }); + $(document).on('submit', 'form[pjax-container]', function(event) { + $.pjax.submit(event, '#pjax-container') + }) + $(document).on("pjax:popstate", function() { $(document).one("pjax:end", function(event) {
use pjax when submit forms
z-song_laravel-admin
train
php,php