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
7655337a1f891d1a4b77baf1d43d83d4ed1c3b4c
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index <HASH>..<HASH> 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -330,5 +330,5 @@ func Download(ctx *middleware.Context) { } } - ctx.ServeFile(archivePath, ctx.Repo.Repository.Name+"-"+base.ShortSha(commit.ID.String())+ext) + ctx.ServeFile(archivePath, ctx.Repo.Repository.Name+"-"+refName+ext) }
Update repo.go Release download file name doesn't include tag number #<I> Download: Changed to use refName instead of commit.ID for downloaded file name
gogs_gogs
train
go
54633b2a6eff8fe4c4dbbe8ef42ec95db738c509
diff --git a/lib/parity/version.rb b/lib/parity/version.rb index <HASH>..<HASH> 100644 --- a/lib/parity/version.rb +++ b/lib/parity/version.rb @@ -1,3 +1,3 @@ module Parity - VERSION = "2.2.0".freeze + VERSION = "2.2.1".freeze end
Version <I> Heroku Toolbelt has been replaced by / renamed to Heroku CLI. It is installed with `brew install heroku`. See: <URL>
thoughtbot_parity
train
rb
7a6c3917b5cdcef157e976833100616f65db54cf
diff --git a/maven/impl/src/main/java/org/jboss/forge/addon/maven/MavenContainer.java b/maven/impl/src/main/java/org/jboss/forge/addon/maven/MavenContainer.java index <HASH>..<HASH> 100644 --- a/maven/impl/src/main/java/org/jboss/forge/addon/maven/MavenContainer.java +++ b/maven/impl/src/main/java/org/jboss/forge/addon/maven/MavenContainer.java @@ -179,7 +179,7 @@ public class MavenContainer session.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(session, localRepo)); session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE); session.setCache(new DefaultRepositoryCache()); - session.setResolutionErrorPolicy(new SimpleResolutionErrorPolicy(true, true)); + session.setResolutionErrorPolicy(new SimpleResolutionErrorPolicy(false, true)); session.setWorkspaceReader(new ClasspathWorkspaceReader()); return session; }
MavenContainer should not cache not-found artifacts
forge_core
train
java
f046f736186059dd086d731f2bdc59343b89762d
diff --git a/src/translations/index.js b/src/translations/index.js index <HASH>..<HASH> 100644 --- a/src/translations/index.js +++ b/src/translations/index.js @@ -229,7 +229,7 @@ const TRANSLATIONS = { 'validate-words-21-hint': 'Was ist das 21. Wort?', 'validate-words-22-hint': 'Was ist das 22. Wort?', 'validate-words-23-hint': 'Was ist das 23. Wort?', - 'validate-words-24-hint': 'Was ist das 34. Wort?', + 'validate-words-24-hint': 'Was ist das 24. Wort?', 'export-file-heading': 'Login File herunterladen', 'export-file-intro-heading': 'Sichere deinen Account',
Fix german translation for <I>th word
nimiq_keyguard-next
train
js
d675c3f3c2757f520626b6da2d157e1241cfff3b
diff --git a/src/parts/events.js b/src/parts/events.js index <HASH>..<HASH> 100644 --- a/src/parts/events.js +++ b/src/parts/events.js @@ -215,8 +215,11 @@ export default { switch( e.key ){ // remove tag if has focus case 'Backspace': { - this.removeTags(focusedElm); - (nextTag ? nextTag : this.DOM.input).focus() + if( !this.settings.readonly ) { + this.removeTags(focusedElm); + (nextTag ? nextTag : this.DOM.input).focus() + } + break; }
fixes #<I> - Readonly tags can be deleted by Backspace
yairEO_tagify
train
js
2477d2f1e868d813013c9478c2521a927c4b4270
diff --git a/sumy/utils.py b/sumy/utils.py index <HASH>..<HASH> 100644 --- a/sumy/utils.py +++ b/sumy/utils.py @@ -52,7 +52,8 @@ class ItemsCount(object): if self._value.endswith("%"): total_count = len(sequence) percentage = int(self._value[:-1]) - count = total_count*percentage // 100 + # at least one sentence should be choosen + count = max(1, total_count*percentage // 100) return sequence[:count] else: return sequence[:int(self._value)]
Add to summary at least 1 sentence if possible
miso-belica_sumy
train
py
752960892e063947fb98197483cf1d1d3b3d64b4
diff --git a/pygccxml/declarations/calldef.py b/pygccxml/declarations/calldef.py index <HASH>..<HASH> 100644 --- a/pygccxml/declarations/calldef.py +++ b/pygccxml/declarations/calldef.py @@ -39,9 +39,25 @@ class argument_t(object): """ def __init__( self, name='', type=None, default_value=None ): + """Constructor. + + The type can either be a L{type_t} object or a string containing + a valid C++ type. In the latter case the string will be wrapped + inside an appropriate type_t object, so the L{type} property + will always be a type_t object. + + @param name: The name of the argument + @type name: str + @param type: The type of the argument + @type type: L{type_t} or str + @param default_value: The optional default value of the argument + @tyape default_value: str + """ object.__init__(self) self._name = name self._default_value = default_value + if not isinstance(type, cpptypes.type_t): + type = cpptypes.dummy_type_t(str(type)) self._type = type def __str__(self):
Added a doc string to the constructor of argument_t and, for additional convenience, allowed the 'type' argument to also be a string in addition to a type_t object. The constructor will automatically wrap the string inside the appropriate type_t object.
gccxml_pygccxml
train
py
f096f7d1039b9c6f645a43c4a4d8ba13acb1d518
diff --git a/pysysinfo/asterisk.py b/pysysinfo/asterisk.py index <HASH>..<HASH> 100644 --- a/pysysinfo/asterisk.py +++ b/pysysinfo/asterisk.py @@ -149,20 +149,20 @@ class AsteriskInfo: % (self._amihost, self._amiport) ) - def _sendAction(self, action, keys=None, vars=None): + def _sendAction(self, action, attrs=None, chan_vars=None): """Send action to Asterisk Manager Interface. @param action: Action name - @param keys: Tuple of key-value pairs for action attributes. - @param vars: Tuple of key-value pairs for channel variables. + @param attrs: Tuple of key-value pairs for action attributes. + @param chan_vars: Tuple of key-value pairs for channel variables. """ self._conn.write("Action: %s\r\n" % action) - if keys: - for (key,val) in keys: + if attrs: + for (key,val) in attrs: self._conn.write("%s: %s\r\n" % (key, val)) - if vars: - for (key,val) in vars: + if chan_vars: + for (key,val) in chan_vars: self._conn.write("Variable: %s=%s\r\n" % (key, val)) self._conn.write("\r\n")
Fix variable name to avoid using reserved name.
aouyar_PyMunin
train
py
baa2abecebeb9bc8576c380b0f7856bf523cf885
diff --git a/src/api/layer.js b/src/api/layer.js index <HASH>..<HASH> 100644 --- a/src/api/layer.js +++ b/src/api/layer.js @@ -378,12 +378,14 @@ export default class Layer { } _addToMGLMap(map, beforeLayerID) { - if (map._loaded) { + if (map.isStyleLoaded()) { this._onMapLoaded(map, beforeLayerID); } else { - map.on('load', () => { + try { this._onMapLoaded(map, beforeLayerID); - }); + } catch (error) { + map.on('load', this._onMapLoaded.bind(this)); + } } }
Load the map if the styles have been properly loaded
CartoDB_carto-vl
train
js
908a52d9d9ffd7bcd9554a318533fed435e69b9e
diff --git a/src/ossos-pipeline/ossos/downloads/cutouts/source.py b/src/ossos-pipeline/ossos/downloads/cutouts/source.py index <HASH>..<HASH> 100644 --- a/src/ossos-pipeline/ossos/downloads/cutouts/source.py +++ b/src/ossos-pipeline/ossos/downloads/cutouts/source.py @@ -51,11 +51,8 @@ class SourceCutout(object): self.original_observed_x = self.reading.x self.original_observed_y = self.reading.y if self.original_observed_ext is None: - self.original_observed_ext = 1 + self.original_observed_ext = len(self.hdulist) - 1 - logger.debug("Setting ext/x/y to {}/{}/{}".format(self.original_observed_ext, - self.original_observed_x, - self.original_observed_y)) self.observed_x = self.original_observed_x self.observed_y = self.original_observed_y @@ -72,7 +69,6 @@ class SourceCutout(object): self._comparison_image = None self._tempfile = None self._bad_comparison_images = [self.hdulist[-1].header.get('EXPNUM', None)] - logger.debug("Build of source worked.") logger.error("type X/Y {}/{}".format(type(self.pixel_x), type(self.pixel_y)))
Changed the logic for default extension (needed for /RA/DEC cutouts) to assume that the last extension of the HDULIST is the interesting one, if can't be computed. Also removed some excess debug message
OSSOS_MOP
train
py
7a26480b7f97254fc4f68db7722657d64526984d
diff --git a/galpy/potential.py b/galpy/potential.py index <HASH>..<HASH> 100644 --- a/galpy/potential.py +++ b/galpy/potential.py @@ -1,6 +1,4 @@ import warnings -from galpy.util import galpyWarning -warnings.warn("A major change in versions > 1.1 is that all galpy.potential functions and methods take the potential as the first argument; previously methods such as evaluatePotentials, evaluateDensities, etc. would be called with (R,z,Pot), now they are called as (Pot,R,z) for greater consistency across the codebase",galpyWarning) from galpy.potential_src import Potential from galpy.potential_src import planarPotential from galpy.potential_src import linearPotential
remove warning about changed arguments for potential functions
jobovy_galpy
train
py
236c698645132074437f355cc04a4ac3148af6d7
diff --git a/morse_talk/utils.py b/morse_talk/utils.py index <HASH>..<HASH> 100644 --- a/morse_talk/utils.py +++ b/morse_talk/utils.py @@ -372,7 +372,7 @@ def display(message, wpm, element_duration, word_ref, strip=False): print(_spoken_representation(message)) print("") print("code speed : %s wpm" % wpm) - print("element_duration : %s" % element_duration) + print("element_duration : %s s" % element_duration) print("reference word : %r" % word_ref) print("")
Add unit (s) to element duration in display function
morse-talk_morse-talk
train
py
b84e27835c1a16be532c700dd462455866d23d30
diff --git a/docs/examples/StyledSingle.js b/docs/examples/StyledSingle.js index <HASH>..<HASH> 100644 --- a/docs/examples/StyledSingle.js +++ b/docs/examples/StyledSingle.js @@ -11,7 +11,7 @@ const dot = (color = '#ccc') => ({ ':before': { backgroundColor: color, borderRadius: 10, - content: ' ', + content: '" "', display: 'block', marginRight: 8, height: 10,
fix content: property error in css
JedWatson_react-select
train
js
1c0d8c980c3b528ce2aeb0a528590822a31b5ef2
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index <HASH>..<HASH> 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -143,6 +143,15 @@ module Arel } end + it 'can handle subqueries' do + table = Table.new(:users) + subquery = table.project(:id).where(table[:name].eq('Aaron')) + node = @attr.in subquery + @visitor.accept(node).must_be_like %{ + "users"."id" IN (SELECT id FROM "users" WHERE "users"."name" = 'Aaron') + } + end + it 'uses the same column for escaping values' do @attr = Table.new(:users)[:name] visitor = Class.new(ToSql) do @@ -189,6 +198,15 @@ module Arel } end + it 'can handle subqueries' do + table = Table.new(:users) + subquery = table.project(:id).where(table[:name].eq('Aaron')) + node = @attr.not_in subquery + @visitor.accept(node).must_be_like %{ + "users"."id" NOT IN (SELECT id FROM "users" WHERE "users"."name" = 'Aaron') + } + end + it 'uses the same column for escaping values' do @attr = Table.new(:users)[:name] visitor = Class.new(ToSql) do
tests for passing a subquery to #in and #not_in
rails_rails
train
rb
9582ab190ff94b2b7b00198c5ee3af1514b96470
diff --git a/sc/sc.py b/sc/sc.py index <HASH>..<HASH> 100755 --- a/sc/sc.py +++ b/sc/sc.py @@ -76,6 +76,8 @@ parser.add_argument('--bot_data_save_dir', type=str, default=SC_BOT_DATA_SAVE_DI parser.add_argument('--bot_data_logs_dir', type=str, default=SC_BOT_DATA_LOGS_DIR) # Settings +parser.add_argument('--show_all', action="store_true", + help="Launch VNC viewers for all containers, not just the server.") parser.add_argument('--verbosity', type=str, default="DEBUG", choices=['DEBUG', 'INFO', 'WARN', 'ERROR'], help="Logging level.") @@ -135,9 +137,7 @@ if __name__ == '__main__': if not args.headless: time.sleep(1) - for i, player in enumerate(players): + for i, player in enumerate(players if args.show_all else players[:1]): port = 5900 + i logger.info(f"Launching vnc viewer for {player} on port {port}") subprocess.call(f"vnc-viewer localhost:{port} &", shell=True) - - time.sleep(5)
Do not show all container VNCs by default
Games-and-Simulations_sc-docker
train
py
37b81c6418f07a96cf6aabe86da855f14ad2d027
diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py index <HASH>..<HASH> 100644 --- a/telethon/tl/custom/message.py +++ b/telethon/tl/custom/message.py @@ -984,7 +984,7 @@ class Message(ChatGetter, SenderGetter, TLObject): options = find_options() if options is None: - return + options = [] return await self._client( functions.messages.SendVoteRequest( peer=self._input_chat,
Support retracting poll votes on message click without option (#<I>)
LonamiWebs_Telethon
train
py
53edb07190e43c40a574579cba25dbafe7329376
diff --git a/generators/connection/templates/sequelize-mssql.js b/generators/connection/templates/sequelize-mssql.js index <HASH>..<HASH> 100644 --- a/generators/connection/templates/sequelize-mssql.js +++ b/generators/connection/templates/sequelize-mssql.js @@ -6,7 +6,8 @@ module.exports = function () { const connectionString = app.get('mssql'); const connection = url.parse(connectionString); const database = connection.path.substring(1, connection.path.length); - const { port, hostname, username, password } = connection; + const { port, hostname } = connection; + const [ username, password ] = (connection.auth || ':').split(':'); const sequelize = new Sequelize(database, username, password, { dialect: 'mssql', host: hostname,
Split username and password from URL parsed auth (#<I>)
feathersjs_generator-feathers
train
js
54b39069bfd75b3ba3f57cad2696bda8403cfa60
diff --git a/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/FileManager.java b/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/FileManager.java index <HASH>..<HASH> 100644 --- a/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/FileManager.java +++ b/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/FileManager.java @@ -91,9 +91,6 @@ class FileManager implements StoragePolicy { for (Map.Entry<URI, CacheItem> invalidation : invalidations) { storage.invalidate(invalidation.getKey(), invalidation.getValue()); } - File[] files = fileResolver.getBaseDirectory().listFiles(new DeletingFileFilter(knownFiles)); - if (files != null && files.length > 0) { - System.err.println(String.format("Unable to delete these files %s", Arrays.toString(files))); - } + fileResolver.getBaseDirectory().listFiles(new DeletingFileFilter(knownFiles)); } }
- Removed a message about not able to delete files... We know about these files and they should not be deleted. git-svn-id: file:///home/projects/httpcache4j/tmp/scm-svn-tmp/trunk@<I> aeef7db8-<I>a-<I>-b<I>-bac<I>ff<I>f6
httpcache4j_httpcache4j
train
java
e3428f38fc19293d6c42136ba00321acc541db5c
diff --git a/src/harvesters/core.py b/src/harvesters/core.py index <HASH>..<HASH> 100644 --- a/src/harvesters/core.py +++ b/src/harvesters/core.py @@ -2321,15 +2321,14 @@ class ImageAcquirer: except RuntimeException as e: if file_dict: if do_clean_up: - os.remove(file_path) - _logger.error(e, exc_info=True) + self._remove_intermediate_file(file_path) + self._logger.error(e, exc_info=True) raise else: - _logger.warning(e, exc_info=True) + self._logger.warning(e, exc_info=True) if do_clean_up: - os.remove(file_path) - _logger.info('{} has been removed'.format(file_path)) + self._remove_intermediate_file(file_path) if has_valid_file: # Instantiate a concrete port object of the remote device's @@ -2343,6 +2342,10 @@ class ImageAcquirer: # Then return the node map: return node_map + def _remove_intermediate_file(self, file_path: str): + os.remove(file_path) + self._logger.info('{} has been removed'.format(file_path)) + @staticmethod def _retrieve_file_path( *,
Resolve issue #<I>
genicam_harvesters
train
py
b1c479c0f7df8bdcd050f51067073c4cec121a5c
diff --git a/tests/test_wsaa_crypto.py b/tests/test_wsaa_crypto.py index <HASH>..<HASH> 100644 --- a/tests/test_wsaa_crypto.py +++ b/tests/test_wsaa_crypto.py @@ -1,5 +1,7 @@ import base64, subprocess +from past.builtins import basestring + from pyafipws.wsaa import WSAA @@ -9,7 +11,7 @@ def test_wsfev1_create_tra(): # TODO: return string tra = tra.decode("utf8") # sanity checks: - assert isinstance(tra, str) + assert isinstance(tra, basestring) assert tra.startswith( '<?xml version="1.0" encoding="UTF-8"?>' '<loginTicketRequest version="1.0">'
WSAA: fix TRA test expecting unicode in python2
reingart_pyafipws
train
py
05f5a82c64fcaa4c776fc7c1cca4f9335f02b2f6
diff --git a/lxd/storage_lvm.go b/lxd/storage_lvm.go index <HASH>..<HASH> 100644 --- a/lxd/storage_lvm.go +++ b/lxd/storage_lvm.go @@ -1583,15 +1583,21 @@ func (s *storageLvm) ImageDelete(fingerprint string) error { logger.Debugf("Deleting LVM storage volume for image \"%s\" on storage pool \"%s\".", fingerprint, s.pool.Name) if s.useThinpool { - _, err := s.ImageUmount(fingerprint) - if err != nil { - return err - } - poolName := s.getOnDiskPoolName() - err = s.removeLV(poolName, storagePoolVolumeAPIEndpointImages, fingerprint) - if err != nil { - return err + imageLvmDevPath := getLvmDevPath(poolName, + storagePoolVolumeAPIEndpointImages, fingerprint) + lvExists, _ := storageLVExists(imageLvmDevPath) + + if lvExists { + _, err := s.ImageUmount(fingerprint) + if err != nil { + return err + } + + err = s.removeLV(poolName, storagePoolVolumeAPIEndpointImages, fingerprint) + if err != nil { + return err + } } }
lvm: existence check before image delete Closes #<I>.
lxc_lxd
train
go
5968e41e25e67ce73a20e665ff9d1435d1384296
diff --git a/test/typographer.test.js b/test/typographer.test.js index <HASH>..<HASH> 100644 --- a/test/typographer.test.js +++ b/test/typographer.test.js @@ -85,4 +85,8 @@ module.exports = { assert.eql( sp.educateDashes( '-- : --- : -- : ---'), '&#8212; : &#8211; : &#8212; : &#8211;'); }, + 'educateEllipses': function(){ + assert.eql( sp.educateEllipses( '. ... : . . . .'), + '. &#8230; : &#8230; .'); + }, }; diff --git a/typographer.js b/typographer.js index <HASH>..<HASH> 100644 --- a/typographer.js +++ b/typographer.js @@ -261,4 +261,14 @@ .replace(/--/g, '&#8212;'); // em (yes, backwards) }; + /** + * Returns input string, with each instance of "..." + * translated to an ellipsis HTML entity. + * + */ + SmartyPants.prototype.educateEllipses = function(text) { + return text.replace(/\.\.\./g, '&#8230;') + .replace(/\. \. \./g, '&#8230;'); + }; + }(this));
added SmartyPants.educateEllipses function
ekalinin_typogr.js
train
js,js
97540cd67c8951327ce6957d8cb2c6f31bbc7092
diff --git a/spring-social-client/src/test/java/org/springframework/social/provider/oauth1/OAuth1ClientRequestInterceptorTest.java b/spring-social-client/src/test/java/org/springframework/social/provider/oauth1/OAuth1ClientRequestInterceptorTest.java index <HASH>..<HASH> 100644 --- a/spring-social-client/src/test/java/org/springframework/social/provider/oauth1/OAuth1ClientRequestInterceptorTest.java +++ b/spring-social-client/src/test/java/org/springframework/social/provider/oauth1/OAuth1ClientRequestInterceptorTest.java @@ -27,7 +27,6 @@ public class OAuth1ClientRequestInterceptorTest { ClientRequest request = new ClientRequest(headers, body, uri, HttpMethod.POST); interceptor.beforeExecution(request); String authorizationHeader = headers.getFirst("Authorization"); - System.out.println(authorizationHeader); // TODO: Figure out how to test this more precisely with a fixed nonce // and timestamp (and thus a fixed signature)
Cleaned out an wayward println() in a test.
spring-projects_spring-social-linkedin
train
java
759302ada440fed79bb019ad9adc47817a3db18e
diff --git a/OpenPNM/GEN/__CustomGenerator__.py b/OpenPNM/GEN/__CustomGenerator__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/GEN/__CustomGenerator__.py +++ b/OpenPNM/GEN/__CustomGenerator__.py @@ -131,6 +131,11 @@ class Custom(GenericGenerator): # # def generate_pore_diameter(self,img2): # generate_pore_prop(img,'diameter') + def add_boundares(self): + r""" + TO DO: Impliment some sort of boundary pore finding + """ + self._logger.debug("add_boundaries: Nothing yet") def generate_pore_property_from_image(self,img,prop_name): r"""
Added a todo for Custom Generator which needs some sort of boundary pore finder / adder Former-commit-id: fd<I>c<I>bf4cac<I>e6d<I>cf0dcf<I>f2fb2de Former-commit-id: <I>a<I>bdb1eaafcd<I>d<I>f<I>aef<I>c
PMEAL_OpenPNM
train
py
c037a510c68812de0b6c60dc510b8f716e72f6a2
diff --git a/bigquery/noxfile.py b/bigquery/noxfile.py index <HASH>..<HASH> 100644 --- a/bigquery/noxfile.py +++ b/bigquery/noxfile.py @@ -150,6 +150,7 @@ def lint(session): session.install("-e", ".") session.run("flake8", os.path.join("google", "cloud", "bigquery")) session.run("flake8", "tests") + session.run("flake8", os.path.join("docs", "samples")) session.run("flake8", os.path.join("docs", "snippets.py")) session.run("black", "--check", *BLACK_PATHS)
style(bigquery): add code samples to lint check (#<I>)
googleapis_google-cloud-python
train
py
98ac24a9e155b1d3c2358da3e94610071b0e3cfb
diff --git a/lib/puppet/file_serving/base.rb b/lib/puppet/file_serving/base.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/file_serving/base.rb +++ b/lib/puppet/file_serving/base.rb @@ -7,6 +7,10 @@ require 'puppet/file_serving' # The base class for Content and Metadata; provides common # functionality like the behaviour around links. class Puppet::FileServing::Base + # This is for external consumers to store the source that was used + # to retrieve the metadata. + attr_accessor :source + # Does our file exist? def exist? begin diff --git a/spec/unit/file_serving/base.rb b/spec/unit/file_serving/base.rb index <HASH>..<HASH> 100755 --- a/spec/unit/file_serving/base.rb +++ b/spec/unit/file_serving/base.rb @@ -17,6 +17,12 @@ describe Puppet::FileServing::Base do Puppet::FileServing::Base.new("/module/dir/file", :links => :manage).links.should == :manage end + it "should have a :source attribute" do + file = Puppet::FileServing::Base.new("/module/dir/file") + file.should respond_to(:source) + file.should respond_to(:source=) + end + it "should consider :ignore links equivalent to :manage links" do Puppet::FileServing::Base.new("/module/dir/file", :links => :ignore).links.should == :manage end
Adding a "source" attribute to fileserving instances. This will be used to cache the source that was used to retrieve the instance.
puppetlabs_puppet
train
rb,rb
e6a189306d90b62ac0877a181c70d1d7ba430bb1
diff --git a/reef-bridge-project/reef-bridge-java/src/main/java/com/microsoft/reef/javabridge/generic/JobClient.java b/reef-bridge-project/reef-bridge-java/src/main/java/com/microsoft/reef/javabridge/generic/JobClient.java index <HASH>..<HASH> 100644 --- a/reef-bridge-project/reef-bridge-java/src/main/java/com/microsoft/reef/javabridge/generic/JobClient.java +++ b/reef-bridge-project/reef-bridge-java/src/main/java/com/microsoft/reef/javabridge/generic/JobClient.java @@ -80,7 +80,7 @@ public class JobClient { public static ConfigurationModule getDriverConfiguration() { return EnvironmentUtils.addClasspath(DriverConfiguration.CONF, DriverConfiguration.GLOBAL_LIBRARIES) - .set(DriverConfiguration.DRIVER_IDENTIFIER, "clrBridge") + .set(DriverConfiguration.DRIVER_IDENTIFIER, "ReefClrBridge") .set(DriverConfiguration.ON_EVALUATOR_ALLOCATED, JobDriver.AllocatedEvaluatorHandler.class) .set(DriverConfiguration.ON_EVALUATOR_FAILED, JobDriver.FailedEvaluatorHandler.class) .set(DriverConfiguration.ON_CONTEXT_ACTIVE, JobDriver.ActiveContextHandler.class)
minor fix for clr driver id
apache_reef
train
java
57419d7f78b69d99320076f2abdd71e78c8518b8
diff --git a/lib/rails_semantic_logger/extensions/action_cable/tagged_logger_proxy.rb b/lib/rails_semantic_logger/extensions/action_cable/tagged_logger_proxy.rb index <HASH>..<HASH> 100644 --- a/lib/rails_semantic_logger/extensions/action_cable/tagged_logger_proxy.rb +++ b/lib/rails_semantic_logger/extensions/action_cable/tagged_logger_proxy.rb @@ -3,6 +3,12 @@ ActionCable::Connection::TaggedLoggerProxy module ActionCable module Connection class TaggedLoggerProxy + # As of Rails 5 Beta 3 + def tag_logger(*tags, &block) + logger.tagged(*tags, &block) + end + + # Rails 5 Beta 1,2. TODO: Remove once Rails 5 is GA def tag(logger, &block) current_tags = tags - logger.tags logger.tagged(*current_tags, &block)
Rails 5 Beta 3 renamed Active job method #tag to #tag_logger
rocketjob_rails_semantic_logger
train
rb
75a90e4236b0602859977f575048ca0bead98a39
diff --git a/redis_metrics/management/commands/system_metric.py b/redis_metrics/management/commands/system_metric.py index <HASH>..<HASH> 100644 --- a/redis_metrics/management/commands/system_metric.py +++ b/redis_metrics/management/commands/system_metric.py @@ -81,11 +81,12 @@ class Command(BaseCommand): def _cpu(self): """Record CPU usage.""" - metric(int(psutil.cpu_percent()), category=self.category) + metric("cpu", int(psutil.cpu_percent()), category=self.category) def _mem(self): """Record Memory usage.""" metric( + "memory", int(psutil.virtual_memory().percent), category=self.category )
fixed cpu, memory metric keys
bradmontgomery_django-redis-metrics
train
py
b5c7aa8b09c8e11f4984e740346b7c548165f5cf
diff --git a/client-vendor/after-body/jquery.openx/jquery.openx.js b/client-vendor/after-body/jquery.openx/jquery.openx.js index <HASH>..<HASH> 100755 --- a/client-vendor/after-body/jquery.openx/jquery.openx.js +++ b/client-vendor/after-body/jquery.openx/jquery.openx.js @@ -56,7 +56,7 @@ var $element = $(this); $.getJSON(src + '&callback=?', function(html) { $element.html(html); - $element.trigger('openx-loaded', {hasContent: (!!html && $.trim(html).length > 0)}); + $element.trigger('openx-loaded', {hasContent: $.trim(html).length > 0}); }); }); };
jquery.open.x: simplify info check of `openx-loaded` event.
cargomedia_cm
train
js
32101bccc8c1843aa99679878a9fa101aa2bcead
diff --git a/tests/test_halo.py b/tests/test_halo.py index <HASH>..<HASH> 100644 --- a/tests/test_halo.py +++ b/tests/test_halo.py @@ -100,7 +100,9 @@ class TestHalo(unittest.TestCase): """ text = 'This is a text that it is too long. In fact, it exceeds the eighty column standard ' \ 'terminal width, which forces the text frame renderer to add an ellipse at the end of the ' \ - 'text' + 'text. Repeating it. This is a text that it is too long. In fact, it exceeds the ' \ + 'eighty column standard terminal width, which forces the text frame renderer to ' \ + 'add an ellipse at the end of the text' spinner = Halo(text=text, spinner='dots', stream=self._stream) spinner.start() @@ -124,7 +126,9 @@ class TestHalo(unittest.TestCase): """ text = 'This is a text that it is too long. In fact, it exceeds the eighty column standard ' \ 'terminal width, which forces the text frame renderer to add an ellipse at the end of the ' \ - 'text' + 'text. Repeating it. This is a text that it is too long. In fact, it exceeds the ' \ + 'eighty column standard terminal width, which forces the text frame renderer to ' \ + 'add an ellipse at the end of the text' spinner = Halo(text=text, spinner='dots', stream=self._stream, animation='marquee') spinner.start()
Test Halo animations: Increase length of text to make tests work on full screen terminals
manrajgrover_halo
train
py
84ed1ebf71ffcce941cc3a398f5baf46ebfe92fa
diff --git a/src/Model/PickUpOrder.php b/src/Model/PickUpOrder.php index <HASH>..<HASH> 100644 --- a/src/Model/PickUpOrder.php +++ b/src/Model/PickUpOrder.php @@ -54,7 +54,7 @@ class PickUpOrder $this->setOrderReferenceId($orderReferenceId); $this->setCustomerReference($customerReference); $this->setCountPackages($countPackages); - $this->setMote($note); + $this->setNote($note); $this->setEmail($email); $this->setSendDate($sendDate); $this->setSendTimeFrom($sendTimeFrom); @@ -230,4 +230,4 @@ class PickUpOrder { return $this->sender; } -} \ No newline at end of file +}
typo There is a typo in constructor when using setMote() method. It should be setNote().
Salamek_PplMyApi
train
php
7a6d735d40dcfd6e2061a1fdb174b2d075c72afb
diff --git a/src/test/org/openscience/cdk/smiles/smarts/parser/SMARTSSearchTest.java b/src/test/org/openscience/cdk/smiles/smarts/parser/SMARTSSearchTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/smiles/smarts/parser/SMARTSSearchTest.java +++ b/src/test/org/openscience/cdk/smiles/smarts/parser/SMARTSSearchTest.java @@ -1540,7 +1540,7 @@ public class SMARTSSearchTest extends CDKTestCase { Assert.assertEquals(0, results[1]); results = match("c-C", "CCc1ccccc1"); - Assert.assertEquals(1, results[0]); + Assert.assertEquals(2, results[0]); Assert.assertEquals(1, results[1]); }
Updted the test to check whether c-C occurs in CCc1ccccc1 since though it gives 2 non-unique hits, both of them are identical in that the query c matches the target c and so on. git-svn-id: <URL>
cdk_cdk
train
java
6271c997bb25405875b6f19dec98861ea99b9c09
diff --git a/bd_metrics/finditem_measure.rb b/bd_metrics/finditem_measure.rb index <HASH>..<HASH> 100755 --- a/bd_metrics/finditem_measure.rb +++ b/bd_metrics/finditem_measure.rb @@ -8,6 +8,13 @@ require 'borrow_direct' require 'borrow_direct/find_item' require 'date' +if ENV["ENV"] == "PRODUCTION" + BorrowDirect::Defaults.api_base = BorrowDirect::Defaults::PRODUCTION_API_BASE + puts "BD PRODUCTION: #{BorrowDirect::Defaults::PRODUCTION_API_BASE}" +end + +BorrowDirect::Defaults.api_key = ENV['BD_API_KEY'] + key = "isbn" sourcefile = ARGV[0] || File.expand_path("../isbn-bd-test-200.txt", __FILE__) @@ -19,7 +26,7 @@ timeout = 20 # wait one to 7 minutes. delay = 60..420 -puts "#{ENV['BD_LIBRARY_SYMBOL']}: #{key}: #{sourcefile}: #{Time.now.localtime}" +puts "#{ENV['BD_LIBRARY_SYMBOL']}: #{key}: #{sourcefile}: #{Time.now.localtime}: Testing at #{BorrowDirect::Defaults.api_base}" identifiers = File.readlines(sourcefile) #.shuffle
finditem_measure changes, including for v2 api
jrochkind_borrow_direct
train
rb
3413af3fcd8a2e5170f1aeb1af23fe8bea4c41e1
diff --git a/layers.go b/layers.go index <HASH>..<HASH> 100644 --- a/layers.go +++ b/layers.go @@ -777,10 +777,10 @@ func (r *layerStore) Mount(id string, options drivers.MountOpts) (string, error) hasReadOnlyOpt := func(opts []string) bool { for _, item := range opts { if item == "ro" { - return false + return true } } - return true + return false } // You are not allowed to mount layers from readonly stores if they
layer mount: fix RO logic Fix the logic in an anon-func looking for the `ro` option to allow for mounting images that are set as read-only.
containers_storage
train
go
fe87c6844ed33a742aba92595e0d6ec5bb74d814
diff --git a/test/7 - watch.js b/test/7 - watch.js index <HASH>..<HASH> 100644 --- a/test/7 - watch.js +++ b/test/7 - watch.js @@ -4,6 +4,7 @@ // Includes //---------- var expect = require('expect.js') +var fs = require('fs') var path = require('path') var shared = require('../code/2 - shared.js') @@ -32,11 +33,11 @@ var reWriter = function reWriter(goCrazy, filePath, data) { */ if (goCrazy) { data = data || 'changed data' - functions.writeFile(filePath, data).then(function() { - reWriteTimer = setTimeout(function() { - reWriter(goCrazy, filePath, data) - }, 500) - }) + fs.writeFileSync(filePath, data) + + reWriteTimer = setTimeout(function() { + reWriter(goCrazy, filePath, data) + }, 500) } else { clearTimeout(reWriteTimer) }
sync file re-writer This function should have used a sync file writer from the beginning. Oops.
nightmode_feri
train
js
7e855b6f6e7e8af5f67221947291ff5ca6d3ff70
diff --git a/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java b/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java +++ b/src/main/org/openscience/cdk/fingerprint/Fingerprinter.java @@ -194,8 +194,7 @@ public class Fingerprinter implements IFingerprinter { = new HashMap<IAtom, Map<IAtom,IBond>>(); for (IAtom startAtom : container.atoms()) { - for (int pathLength = 0; pathLength <= searchDepth; pathLength++) { - List<List<IAtom>> p = PathTools.getPathsOfLength(container, startAtom, pathLength); + List<List<IAtom>> p = PathTools.getPathsOfLengthUpto(container, startAtom, searchDepth); for (List<IAtom> path : p) { StringBuffer sb = new StringBuffer(); IAtom x = path.get(0); @@ -225,7 +224,6 @@ public class Fingerprinter implements IFingerprinter { allPaths.add(sb); else allPaths.add(revForm); } - } } // now lets clean stuff up Set<String> cleanPath = new HashSet<String>();
Updated fingerprinter code to get paths from an atom at one go, rather than multiple calls to getPathsOfLength for each path length. Gives a nice speedup git-svn-id: <URL>
cdk_cdk
train
java
4fc04d5768efefd83e0c046820bb9c7b3d90b1b6
diff --git a/lib/affirm/objects/client.rb b/lib/affirm/objects/client.rb index <HASH>..<HASH> 100644 --- a/lib/affirm/objects/client.rb +++ b/lib/affirm/objects/client.rb @@ -3,9 +3,10 @@ module Affirm class Client include Virtus.model - attribute :full, String - attribute :first, String - attribute :last, String + attribute :full, String + attribute :first, String + attribute :last, String + attribute :middle, String end end end diff --git a/spec/charge_spec.rb b/spec/charge_spec.rb index <HASH>..<HASH> 100644 --- a/spec/charge_spec.rb +++ b/spec/charge_spec.rb @@ -131,6 +131,7 @@ RSpec.describe Affirm::Charge do full first last + middle ).each do |method| it "details.billing.name.#{method}" do expect( @@ -143,6 +144,7 @@ RSpec.describe Affirm::Charge do full first last + middle ).each do |method| it "details.shipping.name.#{method}" do expect(
Add missing (optional) attribute to Client object.
spectator_affirm
train
rb,rb
2a3368dddd222d383398cc8625f59166bf078378
diff --git a/pi_results/class.tx_solr_pi_results.php b/pi_results/class.tx_solr_pi_results.php index <HASH>..<HASH> 100644 --- a/pi_results/class.tx_solr_pi_results.php +++ b/pi_results/class.tx_solr_pi_results.php @@ -210,6 +210,9 @@ class tx_solr_pi_results extends tx_solr_pluginbase_CommandPluginBase { $query = t3lib_div::makeInstance('tx_solr_Query', $rawUserQuery); /* @var $query tx_solr_Query */ + $resultsPerPage = $this->getNumberOfResultsPerPage(); + $query->setResultsPerPage($resultsPerPage); + $searchComponents = t3lib_div::makeInstance('tx_solr_search_SearchComponentManager')->getSearchComponents(); foreach ($searchComponents as $searchComponent) { $searchComponent->setSearchConfiguration($this->conf['search.']);
Fix setting of number of results per page through the query object
TYPO3-Solr_ext-solr
train
php
23234f3ba45a3e9810bdd72bf0aec60f88e0080d
diff --git a/jssrc/renderer.js b/jssrc/renderer.js index <HASH>..<HASH> 100644 --- a/jssrc/renderer.js +++ b/jssrc/renderer.js @@ -26,9 +26,9 @@ var supportedTags = { "table": true, "tbody": true, "thead": true, "tr": true, "th": true, "td": true, "form": true, "optgroup": true, "option": true, "select": true, "textarea": true, "title": true, "meta": true, "link": true, - "svg": true, "circle": true, "line": true + "svg": true, "circle": true, "line": true, "rect": true }; -var svgs = {"svg": true, "circle": true, "line": true}; +var svgs = {"svg": true, "circle": true, "line": true, "rect": true}; // Map of input entities to a queue of their values which originated from the client and have not been received from the server yet. var sentInputValues = {}; var lastFocusPath = null;
Add rects as svgs
witheve_Eve
train
js
3864183b282ff2bbe98a7f527d755d58629303e6
diff --git a/lib/memfs/fake/directory.rb b/lib/memfs/fake/directory.rb index <HASH>..<HASH> 100644 --- a/lib/memfs/fake/directory.rb +++ b/lib/memfs/fake/directory.rb @@ -26,7 +26,6 @@ module MemFs if entry_names.include?(path) entries[path] elsif entry_names.include?(parts.first) - parts = path.split('/', 2) entries[parts.first].find(parts.last) end end
Removing a useless line in Directory#find
simonc_memfs
train
rb
f38fc5136c666d1691c74d04cc752c94630acbe0
diff --git a/gatt/gatt_linux.py b/gatt/gatt_linux.py index <HASH>..<HASH> 100644 --- a/gatt/gatt_linux.py +++ b/gatt/gatt_linux.py @@ -351,7 +351,16 @@ class Device: """ Returns the device's alias (name). """ - return self._properties.Get('org.bluez.Device1', 'Alias') + try: + return self._properties.Get('org.bluez.Device1', 'Alias') + except dbus.exceptions.DBusException as e: + if e.get_dbus_name() == 'org.freedesktop.DBus.Error.UnknownObject': + # BlueZ sometimes doesn't provide an alias, we then simply return `None`. + # Might occur when device was deleted as the following issue points out: + # https://github.com/blueman-project/blueman/issues/460 + return None + else: + raise _error_from_dbus_error(e) def properties_changed(self, sender, changed_properties, invalidated_properties): """
Return none if device alias is not available
getsenic_gatt-python
train
py
1bf88a8aaeb1fed0c67f7fe573bfb1412a91b579
diff --git a/pytodoist/test/test_todoist.py b/pytodoist/test/test_todoist.py index <HASH>..<HASH> 100644 --- a/pytodoist/test/test_todoist.py +++ b/pytodoist/test/test_todoist.py @@ -298,10 +298,6 @@ class ProjectTest(unittest.TestCase): self.project.share('test@gmail.com') self.project.delete_collaborator('test@gmail.com') - def test_take_ownership(self): - self.project.share('test@gmail.com') - self.project.take_ownership() - class TaskTest(unittest.TestCase):
Remove the test_take_ownership test case as the todoist API doesn't recognise the command.
Garee_pytodoist
train
py
78715f05bb394dfa5906686f79a44fcdc32bf521
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: setup( name='ezmomi', - version='0.2.3', + version='0.3.0', author='Jason Ashby', author_email='jashby2@gmail.com', packages=['ezmomi'],
updated release ver to <I> for pypi
snobear_ezmomi
train
py
f6b536d625752fc8246d01707209bebaae2725ed
diff --git a/lib/punchblock/translator/asterisk.rb b/lib/punchblock/translator/asterisk.rb index <HASH>..<HASH> 100644 --- a/lib/punchblock/translator/asterisk.rb +++ b/lib/punchblock/translator/asterisk.rb @@ -49,7 +49,6 @@ module Punchblock def handle_ami_event(event) return unless event.is_a? RubyAMI::Event - pb_logger.trace "Handling AMI event #{event.inspect}" if event.name.downcase == "fullybooted" pb_logger.trace "Counting FullyBooted event" diff --git a/lib/punchblock/translator/asterisk/call.rb b/lib/punchblock/translator/asterisk/call.rb index <HASH>..<HASH> 100644 --- a/lib/punchblock/translator/asterisk/call.rb +++ b/lib/punchblock/translator/asterisk/call.rb @@ -104,7 +104,6 @@ module Punchblock end def process_ami_event(ami_event) - pb_logger.trace "Processing AMI event #{ami_event.inspect}" case ami_event.name when 'Hangup' pb_logger.debug "Received a Hangup AMI event. Sending End event."
[BUGFIX] Don't log every single AMI event received in the translator or calls
adhearsion_punchblock
train
rb,rb
3d279ca9bfde6b062445c8774dcc1e662008bdd0
diff --git a/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java b/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java index <HASH>..<HASH> 100644 --- a/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java +++ b/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java @@ -193,8 +193,6 @@ public class JLanguageTool { * <li>{@code /resource}</li> * <li>{@code /rules}</li> * </ul> - * This method is thread-safe. - * * @return The currently set data broker which allows to obtain * resources from the mentioned directories above. If no * data broker was set, a new {@link DefaultResourceDataBroker} will @@ -215,8 +213,6 @@ public class JLanguageTool { * <li>{@code /resource}</li> * <li>{@code /rules}</li> * </ul> - * This method is thread-safe. - * * @param broker The new resource broker to be used. * @since 1.0.1 */
javadoc: as the whole class is not thread-safe, there's no need to document single methods as thread-safe
languagetool-org_languagetool
train
java
fcdfbd9811a00e7522f308f2eb30e47a20df6fb0
diff --git a/core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedChannel.java b/core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedChannel.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedChannel.java +++ b/core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedChannel.java @@ -815,7 +815,7 @@ public abstract class AbstractFramedChannel<C extends AbstractFramedChannel<C, R * Forcibly closes the {@link io.undertow.server.protocol.framed.AbstractFramedChannel}. */ @Override - public synchronized void close() throws IOException { + public void close() throws IOException { if (UndertowLogger.REQUEST_IO_LOGGER.isTraceEnabled()) { UndertowLogger.REQUEST_IO_LOGGER.tracef(new ClosedChannelException(), "Channel %s is being closed", this); }
[UNDERTOW-<I>] Remove synchronized block from close, it is not necessary
undertow-io_undertow
train
java
e6c199e383218e82e3280cabe910d2a026b69a71
diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,5 +1,6 @@ 'use strict'; +// var utils = require('lazy-cache')(require); var utils = require('generator-util'); var fn = require; require = utils; @@ -43,6 +44,16 @@ utils.exists = function(fp) { return fp && (typeof utils.tryOpen(fp, 'r') === 'number'); }; + +utils.fileKeys = [ + 'base', 'basename', 'cwd', 'dir', + 'dirname', 'ext', 'extname', 'f', + 'file', 'filename', 'path', 'root', + 'stem' +]; + +utils.whitelist = ['emit', 'toc', 'layout'].concat(utils.fileKeys); + /** * Expose `utils` */
move whitelist and filesKeys to utils
base_base-runner
train
js
e6699fccd92cc5afe8af529e60f9d99b449b5353
diff --git a/src/main/java/com/lowagie/text/pdf/parser/PdfTextExtractor.java b/src/main/java/com/lowagie/text/pdf/parser/PdfTextExtractor.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/lowagie/text/pdf/parser/PdfTextExtractor.java +++ b/src/main/java/com/lowagie/text/pdf/parser/PdfTextExtractor.java @@ -101,6 +101,9 @@ public class PdfTextExtractor { throw new IOException("page number must be postive:" + page); } PdfDictionary pageDic = reader.getPageN(page); + if (pageDic == null) { + return ""; + } PdfDictionary resourcesDic = pageDic.getAsDict(PdfName.RESOURCES); extractionProcessor.processContent(getContentBytesForPage(page), resourcesDic); return extractionProcessor.getResultantText();
If no content, text extracts as empty string
albfernandez_itext2
train
java
ffd7d69761e9d2143a6d4ae3ad2abfcf808ebfd2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,9 @@ INSTALL_REQUIRES = [ "wsproto >= 0.14.0", ] -TESTS_REQUIRE = ["asynctest", "hypothesis", "pytest", "pytest-asyncio"] +TESTS_REQUIRE = [ + "asynctest", "hypothesis", "pytest", "pytest-asyncio", "pytest-cov", "pytest-trio", "trio" +] setup( name="Hypercorn",
Add missing test requirements This allows the following to work pip install -e '.[tests]' pytest
pgjones_hypercorn
train
py
36a4881622877c6ced545efbebe9b4c0fdd353c4
diff --git a/core/edb/src/main/java/org/openengsb/core/edb/internal/JPAObject.java b/core/edb/src/main/java/org/openengsb/core/edb/internal/JPAObject.java index <HASH>..<HASH> 100644 --- a/core/edb/src/main/java/org/openengsb/core/edb/internal/JPAObject.java +++ b/core/edb/src/main/java/org/openengsb/core/edb/internal/JPAObject.java @@ -36,7 +36,7 @@ import org.openengsb.core.api.edb.EDBObject; * the JPAObject can be converted to an EDBObject. */ public class JPAObject { - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) private List<JPAEntry> entries; @Column(name = "TIME") private Long timestamp;
[OPENENGSB-<I>] now the JPAEntries of a JPAObject are loaded LAZY
openengsb_openengsb
train
java
9ec86e67f14bef226be4a78854ed9cb39a5fcbf1
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -82,8 +82,7 @@ module.exports = function (grunt) { src : [ testSpecs, sourceFiles, - "Gruntfile.js", - "tasks/release.js" + "Gruntfile.js" ] } }, diff --git a/tasks/release.js b/tasks/release.js index <HASH>..<HASH> 100644 --- a/tasks/release.js +++ b/tasks/release.js @@ -70,8 +70,7 @@ module.exports = function (grunt) { run("git checkout master", "Getting back to master branch"); } // using Q for promises. Using the grunt-release project"s same idea - var q = new Q(); - q + Q() .then(checkout) .then(add) .then(commit)
Rollback Q() and add release.js task on jslint
melonjs_melonJS
train
js,js
83f855d97abca657439241543b8d13ac25375d58
diff --git a/src/txkube/testing/_testcase.py b/src/txkube/testing/_testcase.py index <HASH>..<HASH> 100644 --- a/src/txkube/testing/_testcase.py +++ b/src/txkube/testing/_testcase.py @@ -26,10 +26,19 @@ class TestCase(TesttoolsTestCase): # recognize. def setup_example(self): try: + # TesttoolsTestCase starts without this attribute set at all. Get + # us back to that state. It won't be set at all on the first + # setup_example call, nor if the previous run didn't have a failed + # expectation. del self.force_failure except AttributeError: pass def teardown_example(self, ignored): if getattr(self, "force_failure", False): + # If testtools things it's time to stop, translate this into a + # test failure exception that Hypothesis can see. This lets + # Hypothesis know when it has found a falsifying example. Without + # it, Hypothesis can't see which of its example runs caused + # problems. self.fail("expectation failed")
Some comments about the Hypothesis/testtools fix.
LeastAuthority_txkube
train
py
3adcfd42ef29ef966e760675a3a6b322f92fb872
diff --git a/src/Model/Table/TokensTable.php b/src/Model/Table/TokensTable.php index <HASH>..<HASH> 100644 --- a/src/Model/Table/TokensTable.php +++ b/src/Model/Table/TokensTable.php @@ -21,6 +21,23 @@ class TokensTable extends Table } /** + * get token by id + * @param string $id token id + * @return bool|Token false or token entity + */ + public function read($id) + { + // clean expired tokens first + $this->_cleanExpired(); + + // clean id + $id = preg_replace('/^([a-f0-9]{8}).*/', '$1', $id); + + // Get token for this id + return $this->findById($id)->first(); + } + + /** * create token with option * @param string $scope Scope or Model * @param int $scopeId scope id @@ -69,4 +86,13 @@ class TokensTable extends Table { return substr(hash('sha256', Text::uuid()), 0, 8); } + + /** + * clean expired tokens + * @return void + */ + protected function _cleanExpired() + { + $this->deleteAll(['expire <' => \Cake\I18n\FrozenTime::parse('-7 days')]); + } }
TokenTable::read() and clean method
Erwane_cakephp-token
train
php
8a58f332dd62b68ae22c67585002defe6aeb4b04
diff --git a/staging/src/k8s.io/client-go/tools/cache/shared_informer.go b/staging/src/k8s.io/client-go/tools/cache/shared_informer.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/client-go/tools/cache/shared_informer.go +++ b/staging/src/k8s.io/client-go/tools/cache/shared_informer.go @@ -209,7 +209,7 @@ func WaitForNamedCacheSync(controllerName string, stopCh <-chan struct{}, cacheS // if the controller should shutdown // callers should prefer WaitForNamedCacheSync() func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { - err := wait.PollUntil(syncedPollPeriod, + err := wait.PollImmediateUntil(syncedPollPeriod, func() (bool, error) { for _, syncFunc := range cacheSyncs { if !syncFunc() {
Check cache is synced first before sleeping If a cache was already synced, cache.WaitForCacheSync would always take <I>ms to complete because the PollUntil method will sleep first before checking the condition. Switching to PollImmediateUntil will ensure already synced caches will return immediately. For code that has, for example, <I> informers, the time to check the cache was in sync would take at least 2 seconds, but with this change it can be as fast as you can actually load the data.
kubernetes_kubernetes
train
go
88db0fe4eda3852e108f7b96d52da5fce7411eec
diff --git a/pipenv/project.py b/pipenv/project.py index <HASH>..<HASH> 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -654,7 +654,7 @@ class Project(object): if name: source = [s for s in sources if s.get('name') == name] elif url: - source = [s for s in sources if s.get('url') in url] + source = [s for s in sources if url.startswith(s.get('url'))] if source: return first(source)
Use `startswith` for url comparison in project
pypa_pipenv
train
py
ebda346273f2f66b066479bf2da946c1bc8573e0
diff --git a/contribs/gmf/src/directives/layertree.js b/contribs/gmf/src/directives/layertree.js index <HASH>..<HASH> 100644 --- a/contribs/gmf/src/directives/layertree.js +++ b/contribs/gmf/src/directives/layertree.js @@ -274,6 +274,13 @@ gmf.LayertreeController.prototype.getLayer = function(node, parentCtrl, depth) { } //depth > 1 && parent is a MIXED group switch (type) { + case gmf.Themes.NodeType.MIXED_GROUP: + layer = this.getLayerCaseMixedGroup_(node); + break; + case gmf.Themes.NodeType.NOT_MIXED_GROUP: + layer = this.getLayerCaseNotMixedGroup_(node); + this.prepareLayer_(node, layer); + break; case gmf.Themes.NodeType.WMTS: layer = this.getLayerCaseWMTS_(node); break;
Temporaty fix for mixed with sub groups
camptocamp_ngeo
train
js
d86c2ff18a5c970275dda2a325fa56af8e80547c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +var undefined + exports.FallbackMap = function FallbackMap (fallback) { var map = new Map() var mapGet = map.get @@ -10,10 +12,15 @@ exports.FallbackMap = function FallbackMap (fallback) { } map.get = function get (key) { + var result = mapGet.call(map, key) + if (result !== undefined) { + return result + } if (map.has(key)) { - return mapGet.call(map, key) + return result } - var result = fallback(key, map) + + result = fallback(key, map) map.set(key, result) return result }
bypass map.has call when not really needed
HyeonuPark_fallback-map
train
js
504975c38da07b21fce0f113beaf2009719ba0a9
diff --git a/keystore/v2/keystore/storage_zone.go b/keystore/v2/keystore/storage_zone.go index <HASH>..<HASH> 100644 --- a/keystore/v2/keystore/storage_zone.go +++ b/keystore/v2/keystore/storage_zone.go @@ -95,7 +95,7 @@ func (s *ServerKeyStore) HasZonePrivateKey(zoneID []byte) bool { // StorageKeyCreation interface (zones) // -const zonePrefix = "client" +const zonePrefix = "zone" func (s *ServerKeyStore) zoneStorageKeyPairPath(zoneID []byte) string { return filepath.Join(zonePrefix, string(zoneID), storageSuffix)
Use correct zone prefix for key store v2 (#<I>) The prefix for zone storage keys is incorrect, it should be "zone". That way the keys will be placed into correct subdirectory.
cossacklabs_acra
train
go
42707bbf2e4ce401c85da93ab572d951cc4d08c0
diff --git a/speech/setup.py b/speech/setup.py index <HASH>..<HASH> 100644 --- a/speech/setup.py +++ b/speech/setup.py @@ -27,7 +27,7 @@ version = '0.36.3' # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' -release_status = 'Development Status :: 4 - Beta' +release_status = 'Development Status :: 5 - Production/Stable' dependencies = [ 'google-api-core[grpc] >= 1.6.0, < 2.0.0dev', ]
Promote google-cloud-speech to GA (#<I>)
googleapis_google-cloud-python
train
py
2e8bd9d2f98decf731ed40a50e9d960ba08f3441
diff --git a/tests/system/providers/zendesk/example_zendesk_custom_get.py b/tests/system/providers/zendesk/example_zendesk_custom_get.py index <HASH>..<HASH> 100644 --- a/tests/system/providers/zendesk/example_zendesk_custom_get.py +++ b/tests/system/providers/zendesk/example_zendesk_custom_get.py @@ -44,6 +44,7 @@ with DAG( ) as dag: fetch_organizations() + from tests.system.utils import get_test_run # noqa: E402 # Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)
Migrate Zendesk example DAGs to new design AIP-<I> (#<I>) closes: #<I>
apache_airflow
train
py
ac80706d93087e3cc54415707c43bbf414469fc3
diff --git a/resources/views/default/form/element/related/elements.blade.php b/resources/views/default/form/element/related/elements.blade.php index <HASH>..<HASH> 100755 --- a/resources/views/default/form/element/related/elements.blade.php +++ b/resources/views/default/form/element/related/elements.blade.php @@ -20,6 +20,7 @@ @include(AdminTemplate::getViewPath('form.element.related.group'), [ 'name' => $name, 'group' => new \SleepingOwl\Admin\Form\Related\Group(null, $stub->all()), + 'index' => "totalGroupsCount", ]) </div> <button
fix saving group elements, add generation index for new group
LaravelRUS_SleepingOwlAdmin
train
php
cab1b8dfc8390a62fa1080e499cf3c657c54735f
diff --git a/src/Controller/RestControllerTrait.php b/src/Controller/RestControllerTrait.php index <HASH>..<HASH> 100644 --- a/src/Controller/RestControllerTrait.php +++ b/src/Controller/RestControllerTrait.php @@ -51,4 +51,20 @@ trait RestControllerTrait return $data; } + protected function addProhibitedKeys(array $keys) + { + foreach ($keys as $key) { + if (is_string($key)) { + $this->prohibitedKeys[$key] = true; + } + } + } + + protected function removeProhibitedKeys(array $keys) + { + foreach ($keys as $key) { + unset($this->prohibitedKeys[$key]); + } + } + } \ No newline at end of file
Allow modification of the prohibited keys array, via class methods
silktide_lazy-boy
train
php
839b6fff7c1546d6cf1757ce85da9ac44e6ed917
diff --git a/libraries/joomla/factory.php b/libraries/joomla/factory.php index <HASH>..<HASH> 100644 --- a/libraries/joomla/factory.php +++ b/libraries/joomla/factory.php @@ -506,18 +506,20 @@ abstract class JFactory $classname = 'JDate'; } } - $key = $time . '-' . $tzOffset; - - // if (!isset($instances[$classname][$key])) { - $tmp = new $classname($time, $tzOffset); - //We need to serialize to break the reference - // $instances[$classname][$key] = serialize($tmp); - // unset($tmp); - // } - - // $date = unserialize($instances[$classname][$key]); - // return $date; - return $tmp; + + $key = $time . '-' . ($tzOffset instanceof DateTimeZone ? $tzOffset->getName() : (string) $tzOffset); + + if (!isset($instances[$classname][$key])) + { + $tmp = new $classname($time, $tzOffset); + // We need to serialize to break the reference + $instances[$classname][$key] = serialize($tmp); + unset($tmp); + } + + $date = unserialize($instances[$classname][$key]); + + return $date; } /**
Fixes error in JFactory::getDate where timezone is passed as a string. Restores backward compatibility of JFactory::getDate to Joomla <I> in that is caches the date for a given time.
joomla_joomla-framework
train
php
0cf5d60712b35a0b9933843d492989ca5d018b1a
diff --git a/src/javascript/image/Image.js b/src/javascript/image/Image.js index <HASH>..<HASH> 100644 --- a/src/javascript/image/Image.js +++ b/src/javascript/image/Image.js @@ -340,12 +340,6 @@ define("moxie/image/Image", [ @method downsize @deprecated use resize() - @param {Object} opts - @param {Number} opts.width Resulting width - @param {Number} [opts.height=width] Resulting height (optional, if not supplied will default to width) - @param {Boolean} [opts.crop=false] Whether to crop the image to exact dimensions - @param {Boolean} [opts.preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) - @param {String} [opts.resample=false] Resampling algorithm to use for resizing */ downsize: function(opts) { var defaults = {
Image remove detailed comments on deprecated method.
moxiecode_moxie
train
js
abab48accb550b851f2bb04b9a1cfff71b0fd476
diff --git a/lib/bumper_pusher/version.rb b/lib/bumper_pusher/version.rb index <HASH>..<HASH> 100644 --- a/lib/bumper_pusher/version.rb +++ b/lib/bumper_pusher/version.rb @@ -1,3 +1,3 @@ module BumperPusher - VERSION = "0.0.1" + VERSION = "0.0.2" end
Update gemspec to version <I>
skywinder_bumper_pusher
train
rb
9d25f1650e3f0f4f7dd299795ad6676914416327
diff --git a/utils/vector.py b/utils/vector.py index <HASH>..<HASH> 100644 --- a/utils/vector.py +++ b/utils/vector.py @@ -270,7 +270,7 @@ def parallel_check(vec1, vec2): import scipy as sp # Initialize True - par = True + par = False # Shape check for v,n in zip([vec1, vec2], range(1,3)): @@ -285,9 +285,8 @@ def parallel_check(vec1, vec2): # Check for (anti-)parallel character and return angle = sp.degrees(sp.arccos(sp.dot(vec1.T,vec2) / spla.norm(vec1) / spla.norm(vec2))) - if abs(angle) < PRM.Non_Parallel_Tol or \ - abs(angle - 180) < PRM.Non_Parallel_Tol: - par = False + if min([abs(angle), abs(angle - 180.)]) < PRM.Non_Parallel_Tol: + par = True ## end if return par
utils.vector: Corrected and simplified parallel_check Had had the True/False values reversed, and had a more-verbose-than- necessary form of the parallel-check calculation.
bskinn_opan
train
py
bc54fb32ce15b8f08c7e9725701d22c32aed77c7
diff --git a/lib/chef/knife/stalenodes.rb b/lib/chef/knife/stalenodes.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/stalenodes.rb +++ b/lib/chef/knife/stalenodes.rb @@ -57,6 +57,12 @@ module KnifeStalenodes :description => "Adds minutes to hours since last check in", :default => 0 + option :maxhost, + :short => "-n HOSTS", + :long => "--number HOSTS", + :description => "Max number of hosts to search", + :default => 2500 + def calculate_time seconds = config[:days].to_i * 86400 + config[:hours].to_i * 3600 + config[:minutes].to_i * 60 @@ -101,7 +107,8 @@ module KnifeStalenodes search_args = { :keys => { :ohai_time => ['ohai_time'], :name => ['name'] - } + }, + :rows => config[:maxhost] } query.search(:node, get_query, search_args).first.each do |node|
[HelpSpot <I>] Allow rows returned from Solr to be adjustable
paulmooring_knife-stalenodes
train
rb
576e6eba4390b3f4e8a9a4c0cd30712cab1c1086
diff --git a/lib/friendly_id.rb b/lib/friendly_id.rb index <HASH>..<HASH> 100644 --- a/lib/friendly_id.rb +++ b/lib/friendly_id.rb @@ -28,7 +28,7 @@ The concept of *slugs* is at the heart of FriendlyId. A slug is the part of a URL which identifies a page using human-readable keywords, rather than an opaque identifier such as a numeric id. This can make -your application more friendly both for users and search engine. +your application more friendly both for users and search engines. #### Finders: Slugs Act Like Numeric IDs
Minor typo fix "search engine" -> "search engines" Thanks for a great gem - HTH, Eliot
norman_friendly_id
train
rb
d2b696ba8b83ccbff25b11486c132b296a2ecdc9
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index <HASH>..<HASH> 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -594,6 +594,10 @@ class TestDaemon(object): def __init__(self, parser): self.parser = parser self.colors = get_colors(self.parser.options.no_colors is False) + if salt.utils.is_windows(): + # There's no shell color support on windows... + for key in self.colors: + self.colors[key] = '' def __enter__(self): '''
We don't currently support colors on windows
saltstack_salt
train
py
3f613bb36ae46d9e187d6bbb6094634f3067abc1
diff --git a/src/WebServCo/Framework/Libraries/Config.php b/src/WebServCo/Framework/Libraries/Config.php index <HASH>..<HASH> 100644 --- a/src/WebServCo/Framework/Libraries/Config.php +++ b/src/WebServCo/Framework/Libraries/Config.php @@ -14,31 +14,6 @@ final class Config extends \WebServCo\Framework\AbstractLibrary private $env; /** - * Append data to configuration settings. - * - * Used recursively. - * @param array $config Configuration data to append to. - * @param mixed $data Data to append. - * @return array - */ - final private function append($config, $data) - { - if (is_array($config) && is_array($data)) { - foreach ($data as $setting => $value) { - if (array_key_exists($setting, $config) && - is_array($config[$setting]) && - is_array($value) - ) { - $config[$setting] = $this->append($config[$setting], $value); - } else { - $config[$setting] = $value; - } - } - } - return $config; - } - - /** * Add base setting data. * * Keys will be preserved.
Cleanup redundant method "append"
webservco_framework
train
php
7a8d56f97a526403e40b4a5e680c06a86eba8a13
diff --git a/merb-core/lib/merb-core/version.rb b/merb-core/lib/merb-core/version.rb index <HASH>..<HASH> 100644 --- a/merb-core/lib/merb-core/version.rb +++ b/merb-core/lib/merb-core/version.rb @@ -1,3 +1,3 @@ module Merb - VERSION = '1.0' unless defined?(Merb::VERSION) + VERSION = '1.0.1' unless defined?(Merb::VERSION) end
Bumps <I>.x version
wycats_merb
train
rb
40bcae5d50f681b2c32f16d3840795f94ff5f1b6
diff --git a/lib/NavigationComponent.js b/lib/NavigationComponent.js index <HASH>..<HASH> 100644 --- a/lib/NavigationComponent.js +++ b/lib/NavigationComponent.js @@ -58,6 +58,7 @@ class NavigationComponent extends PureComponent<void, NCProps, void> { backgroundColor: bnOptions.backgroundColor, shifting: bnOptions.shifting } + const previousScene = navigationState.routes[navigationState.index] return ( <BottomNavigation @@ -80,7 +81,7 @@ class NavigationComponent extends PureComponent<void, NCProps, void> { focused, tintColor: focused ? activeTintColor : inactiveTintColor } - const onPress = navigationGetOnPress(scene) + const onPress = navigationGetOnPress(previousScene, scene) const label = getLabel(scene) const icon = renderIcon(scene)
Fix For React Navigation Beta <I>+ (#<I>)
timomeh_react-native-material-bottom-navigation
train
js
18d1a63906f1b2731619e0945648a8ef84c2ccd3
diff --git a/pyqode/core/managers/file.py b/pyqode/core/managers/file.py index <HASH>..<HASH> 100644 --- a/pyqode/core/managers/file.py +++ b/pyqode/core/managers/file.py @@ -375,6 +375,13 @@ class FileManager(Manager): encoding = self._encoding self.saving = True self.editor.text_saving.emit(str(path)) + + # get file persmission on linux + try: + st_mode = os.stat(path).st_mode + except (ImportError, TypeError, AttributeError): + st_mode = None + # perform a safe save: we first save to a temporary file, if the save # succeeded we just rename the temporary file to the final file name # and remove it. @@ -412,6 +419,12 @@ class FileManager(Manager): _logger().debug('file saved: %s', path) self._check_for_readonly() + # restore file permission + try: + os.chmod(path, st_mode) + except (ImportError, TypeError, AttributeError): + pass + def close(self, clear=True): """ Close the file open in the editor:
Fix file permission lost on save on posix
pyQode_pyqode.core
train
py
4d577cf3b78be5b22205e3d87348757201ea243c
diff --git a/test/unit/services/calendarHelper.spec.js b/test/unit/services/calendarHelper.spec.js index <HASH>..<HASH> 100644 --- a/test/unit/services/calendarHelper.spec.js +++ b/test/unit/services/calendarHelper.spec.js @@ -445,8 +445,8 @@ describe('calendarHelper', function() { }); it('should only contain events for that week', function() { - expect(weekView.eventRows[0].row[0].event).to.eql(events[0]); - expect(weekView.eventRows[1].row[0].event).to.eql(events[1]); + expect(weekView.eventRows[0].row[0].event).to.eql(events[1]); + expect(weekView.eventRows[1].row[0].event).to.eql(events[0]); }); describe('setting the correct span and offset', function() {
test(weekView): fix failing test that legitimately got fixed
mattlewis92_angular-bootstrap-calendar
train
js
240ac9238505383d2fc0459ad0745509f5b10edb
diff --git a/test/fixtures/various_assertion_methods/expected.js b/test/fixtures/various_assertion_methods/expected.js index <HASH>..<HASH> 100644 --- a/test/fixtures/various_assertion_methods/expected.js +++ b/test/fixtures/various_assertion_methods/expected.js @@ -1,4 +1,4 @@ 'use strict'; -function add(a, b) { +async function add(a, b) { return a + b; } diff --git a/test/fixtures/various_assertion_methods/fixture.js b/test/fixtures/various_assertion_methods/fixture.js index <HASH>..<HASH> 100644 --- a/test/fixtures/various_assertion_methods/fixture.js +++ b/test/fixtures/various_assertion_methods/fixture.js @@ -2,7 +2,7 @@ const assert = require('node:assert'); -function add (a, b) { +async function add (a, b) { console.assert(typeof a === 'number'); assert(!isNaN(a)); @@ -54,5 +54,9 @@ function add (a, b) { assert.ifError(a); assert.fail(a, b, 'assertion message', '=='); + + await assert.rejects(prms); + await assert.doesNotReject(prms2); + return a + b; }
test: add test for AwaitExpression
unassert-js_unassert
train
js,js
045d838fafe6cb227edb9df09417578fdcbe2f85
diff --git a/suite/suite.go b/suite/suite.go index <HASH>..<HASH> 100644 --- a/suite/suite.go +++ b/suite/suite.go @@ -17,21 +17,29 @@ import ( var allTestsFilter = func(_, _ string) (bool, error) { return true, nil } var matchMethod = flag.String("testify.m", "", "regular expression to select tests of the testify suite to run") +type TestingT interface { + Run(name string, f func(t *testing.T)) bool + Helper() + + Errorf(format string, args ...interface{}) + FailNow() +} + // Suite is a basic testing suite with methods for storing and // retrieving the current *testing.T context. type Suite struct { *assert.Assertions require *require.Assertions - t *testing.T + t TestingT } // T retrieves the current *testing.T context. -func (suite *Suite) T() *testing.T { +func (suite *Suite) T() TestingT { return suite.t } // SetT sets the current *testing.T context. -func (suite *Suite) SetT(t *testing.T) { +func (suite *Suite) SetT(t TestingT) { suite.t = t suite.Assertions = assert.New(t) suite.require = require.New(t)
changed dependency to interface, s.t. consumers can easily mock the testing.T type
stretchr_testify
train
go
9a0e155ea7f095807366f73348df8dcf69b5d1c0
diff --git a/lib/commands/submit.js b/lib/commands/submit.js index <HASH>..<HASH> 100644 --- a/lib/commands/submit.js +++ b/lib/commands/submit.js @@ -76,7 +76,7 @@ cmd.handler = function(argv) { let ratio = 0.0; for (let score of scores) { - if (parseFloat(score[0]) > myRuntime) + if (parseFloat(score[0]) >= myRuntime) ratio += parseFloat(score[1]); }
Update submit.js fixed bug for "[WARN] Failed to get submission beat ratio."
skygragon_leetcode-cli
train
js
e81fbec92b9c8c6af0828b00b1d747f6f18e6f8e
diff --git a/salmonella/static/salmonella.js b/salmonella/static/salmonella.js index <HASH>..<HASH> 100644 --- a/salmonella/static/salmonella.js +++ b/salmonella/static/salmonella.js @@ -1,13 +1,17 @@ function popup_wrapper(triggerLink, app_name, model_name){ - var name = triggerLink.id.replace(/^lookup_/, ''); - name = id_to_windowname(name); + var name = triggerLink.id.replace(/^lookup_/, ''), + windowName = id_to_windowname(name); // Actual Django javascript function showRelatedObjectLookupPopup(triggerLink); // Sets focus on input field so event is // fired correctly. - document.getElementById(name).focus(); + try { + document.getElementById(windowName).focus(); + } catch (e) { + document.getElementById(name).focus(); + } return false; }
added a quick solution to fix inline items
lincolnloop_django-dynamic-raw-id
train
js
f40ba7d470e48577e2b310465dd98945cf9e1f16
diff --git a/services/personality_insights/v3.js b/services/personality_insights/v3.js index <HASH>..<HASH> 100644 --- a/services/personality_insights/v3.js +++ b/services/personality_insights/v3.js @@ -119,7 +119,7 @@ module.exports = function (RED) { personality_insights = new PersonalityInsightsV3({ username: username, password: password, - version_date: '2016-10-20' + version_date: '2016-12-15' }); node.status({fill:'blue', shape:'dot', text:'requesting'});
API version update to Personality Insights
watson-developer-cloud_node-red-node-watson
train
js
c068e0c555039dc87398435bdb1525dab0caa98c
diff --git a/src/opbeat.js b/src/opbeat.js index <HASH>..<HASH> 100644 --- a/src/opbeat.js +++ b/src/opbeat.js @@ -42,16 +42,19 @@ Opbeat.prototype.config = function (properties) { Opbeat.prototype.install = function () { if (!this.isPlatformSupport()) { + logger.log('opbeat.install.platform.unsupported') return this } config.init() if (!config.isValid()) { + logger.log('opbeat.install.config.invalid') return this } if (this.isInstalled) { + logger.log('opbeat.install.already.installed') return this }
Add logging if stuff goes wrong in install method
opbeat_opbeat-react
train
js
4d49ea1e078f34349553559319d2891c0c90e3be
diff --git a/master/buildbot/buildslave/openstack.py b/master/buildbot/buildslave/openstack.py index <HASH>..<HASH> 100644 --- a/master/buildbot/buildslave/openstack.py +++ b/master/buildbot/buildslave/openstack.py @@ -99,7 +99,7 @@ class OpenStackLatentBuildSlave(AbstractLatentBuildSlave): duration = 0 interval = self._poll_resolution inst = instance - while inst.status == BUILD: + while inst.status.startswith(BUILD): time.sleep(interval) duration += interval if duration % 60 == 0:
fix build status incompatibility with hpcloud
buildbot_buildbot
train
py
a0432aa52ae4ac63372e156fd0d68354634b6b33
diff --git a/source/core/oxmailvalidator.php b/source/core/oxmailvalidator.php index <HASH>..<HASH> 100644 --- a/source/core/oxmailvalidator.php +++ b/source/core/oxmailvalidator.php @@ -71,11 +71,8 @@ class oxMailValidator */ public function isValidEmail( $sEmail ) { - $blValid = true; - if ( $sEmail != 'admin' ) { - $sEmailRule = $this->getMailValidationRule(); - $blValid = ( getStr()->preg_match( $sEmailRule, $sEmail ) != 0 ); - } + $sEmailRule = $this->getMailValidationRule(); + $blValid = ( getStr()->preg_match( $sEmailRule, $sEmail ) != 0 ); return $blValid; }
no need to check for demo data in email validation
OXID-eSales_oxideshop_ce
train
php
9a6d681065f795a2fa9cc5b9bc57f2bf8dacd51a
diff --git a/src/pyiso/pyiso.py b/src/pyiso/pyiso.py index <HASH>..<HASH> 100644 --- a/src/pyiso/pyiso.py +++ b/src/pyiso/pyiso.py @@ -2859,13 +2859,14 @@ class PyIso(object): continue matches_boot_catalog = self.eltorito_boot_catalog is not None and self.eltorito_boot_catalog.dirrecord == child + is_symlink = child.rock_ridge is not None and child.rock_ridge.is_symlink() if child.is_dir(): # If the child is a directory, and is not dot or dotdot, we # want to descend into it to look at the children. if not child.is_dot() and not child.is_dotdot(): dirs.append(child) outfp.write(pad(outfp.tell(), self.pvd.logical_block_size())) - elif child.data_length > 0 and child.target is None and not matches_boot_catalog: + elif child.data_length > 0 and child.target is None and not matches_boot_catalog and not is_symlink: # If the child is a file, then we need to write the # data to the output file. progress.call(self._output_directory_record(outfp, blocksize, child))
Make sure not to try to write symlinks out. They might have random extents, but they have no data, so just ignore them while writing.
clalancette_pycdlib
train
py
3f65c05283b8e62aa0ef1cea5b1fdc29394339fe
diff --git a/core/container/src/main/java/org/wildfly/swarm/SwarmInfo.java b/core/container/src/main/java/org/wildfly/swarm/SwarmInfo.java index <HASH>..<HASH> 100644 --- a/core/container/src/main/java/org/wildfly/swarm/SwarmInfo.java +++ b/core/container/src/main/java/org/wildfly/swarm/SwarmInfo.java @@ -34,7 +34,7 @@ public class SwarmInfo { public static final String GROUP_ID; public static boolean isProduct() { - return VERSION.contains("-redhat-"); + return VERSION.contains("redhat-"); } private SwarmInfo() {
Update check for product version (#<I>) In altering how product version is defined, need to remove leading hyphen as it becomes a dot
thorntail_thorntail
train
java
0b0d16e8ec2b7b1b78d6a44a843d52e5db3bbdbc
diff --git a/tests/test_secretsmanager/test_secretsmanager.py b/tests/test_secretsmanager/test_secretsmanager.py index <HASH>..<HASH> 100644 --- a/tests/test_secretsmanager/test_secretsmanager.py +++ b/tests/test_secretsmanager/test_secretsmanager.py @@ -26,13 +26,13 @@ def test_get_secret_that_does_not_exist(): result = conn.get_secret_value(SecretId='i-dont-exist') @mock_secretsmanager -def test_get_secret_with_mismatched_id(): +def test_get_secret_that_does_not_match(): conn = boto3.client('secretsmanager', region_name='us-west-2') create_secret = conn.create_secret(Name='java-util-test-password', SecretString="foosecret") with assert_raises(ClientError): - result = conn.get_secret_value(SecretId='i-dont-exist') + result = conn.get_secret_value(SecretId='i-dont-match') @mock_secretsmanager def test_create_secret():
Opportunistic update to unit test for consistency.
spulec_moto
train
py
5cc5416aa5cb2837adea5d7065d24ad7f028a938
diff --git a/src/IMAP/Message.php b/src/IMAP/Message.php index <HASH>..<HASH> 100644 --- a/src/IMAP/Message.php +++ b/src/IMAP/Message.php @@ -488,7 +488,11 @@ class Message { foreach ($part->parameters as $parameter) { if($parameter->attribute == "charset") { $encoding = $parameter->value; - $parameter->value = preg_replace('/Content-Transfer-Encoding/', '', $encoding); + + $encoding = preg_replace('/Content-Transfer-Encoding/', '', $encoding); + $encoding = preg_replace('/iso-8859-8-i/', 'iso-8859-8', $encoding); + + $parameter->value = $encoding; } } }
removed -i from iso-<I>-8-i in Message::parseBody (#<I>)
Webklex_laravel-imap
train
php
5bb4f15547771978d0f9d0e5a9e39249e47ba29d
diff --git a/framework/web/widgets/captcha/CCaptcha.php b/framework/web/widgets/captcha/CCaptcha.php index <HASH>..<HASH> 100644 --- a/framework/web/widgets/captcha/CCaptcha.php +++ b/framework/web/widgets/captcha/CCaptcha.php @@ -27,6 +27,9 @@ * A {@link CCaptchaValidator} may be used to validate that the user enters * a verification code matching the code displayed in the CAPTCHA image. * + * When combining CCaptcha with CActiveForm or CForm, make sure ajaxValidation is disabled. Performing ajax validation causes + * your Captcha to be refreshed, rendering the code invalid on the next validation attempt. + * * @author Qiang Xue <qiang.xue@gmail.com> * @package system.web.widgets.captcha * @since 1.0
Add documentation explaining you cannot use ajaxValidation with CCaptcha
yiisoft_yii
train
php
a4864af2b4e77b416caa98ca2ad086c3fa3ea084
diff --git a/cmd/pk/get.go b/cmd/pk/get.go index <HASH>..<HASH> 100644 --- a/cmd/pk/get.go +++ b/cmd/pk/get.go @@ -36,16 +36,16 @@ func init() { } func (c *getCmd) Describe() string { - return "Create and upload blobs to a server." + return "Fetches blobs, files, and directories." } func (c *getCmd) Usage() { - panic("pk put Usage should never get called, as we should always end up calling either pk's or pk-put's usage") + panic("pk get Usage should never get called, as we should always end up calling either pk's or pk-get's usage") } func (c *getCmd) RunCommand(args []string) error { // RunCommand is only implemented to satisfy the CommandRunner interface. - panic("pk put RunCommand should never get called, as pk is supposed to invoke pk-put instead.") + panic("pk get RunCommand should never get called, as pk is supposed to invoke pk-get instead.") } // LookPath returns the full path to the executable that "pk get" actually
pk: fix get Describe that was copied from put Change-Id: I4e<I>f2a1b<I>bdae4a<I>da<I>dc<I>cfc8dcb<I>
perkeep_perkeep
train
go
42d7fae51e71c69d4928b398409795cf50469fde
diff --git a/tests/test_apev2.py b/tests/test_apev2.py index <HASH>..<HASH> 100644 --- a/tests/test_apev2.py +++ b/tests/test_apev2.py @@ -111,6 +111,10 @@ class APEReader(TestCase): def test_invalid(self): self.failUnlessRaises(IOError, mutagen.apev2.APEv2, "dne") + def test_no_tag(self): + self.failUnlessRaises(IOError, mutagen.apev2.APEv2, + os.path.join("tests", "data", "empty.mp3")) + def test_cases(self): self.failUnlessEqual(self.tag["artist"], self.tag["ARTIST"]) self.failUnless("artist" in self.tag) @@ -335,6 +339,10 @@ class TAPEv2(TestCase): def test_bad_value_type(self): from mutagen.apev2 import APEValue self.failUnlessRaises(ValueError, APEValue, "foo", 99) + + def test_module_delete_empty(self): + from mutagen.apev2 import delete + delete(os.path.join("tests", "data", "emptyfile.mp3")) add(TAPEv2)
test_apev2: Test APE-less loading, deleting.
quodlibet_mutagen
train
py
a12b49fd407e54729c74aa1969c1c0b1922ce563
diff --git a/telethon/errors/__init__.py b/telethon/errors/__init__.py index <HASH>..<HASH> 100644 --- a/telethon/errors/__init__.py +++ b/telethon/errors/__init__.py @@ -24,7 +24,8 @@ def rpc_message_to_error(rpc_error, request): :return: the RPCError as a Python exception that represents this error. """ # Try to get the error by direct look-up, otherwise regex - cls = rpc_errors_dict.get(rpc_error.error_message, None) + # Case-insensitive, for things like "timeout" which don't conform. + cls = rpc_errors_dict.get(rpc_error.error_message.upper(), None) if cls: return cls(request=request)
Change error mapping to be case insensitive
LonamiWebs_Telethon
train
py
884acfbf0260819330d664285d57b949d8ad8001
diff --git a/esper.py b/esper.py index <HASH>..<HASH> 100644 --- a/esper.py +++ b/esper.py @@ -13,8 +13,7 @@ class Processor: appropriate world methods there, such as `for ent, (rend, vel) in self.world.get_components(Renderable, Velocity):` """ - def __init__(self): - self.world = None + world = None def process(self, *args): raise NotImplementedError
Removed unnecessary __init__ in Processor base class.
benmoran56_esper
train
py
fe5f0ddbab3e3fe239b199bf4c2b559f2cc3f792
diff --git a/pyvisa/resources/resource.py b/pyvisa/resources/resource.py index <HASH>..<HASH> 100644 --- a/pyvisa/resources/resource.py +++ b/pyvisa/resources/resource.py @@ -334,7 +334,7 @@ class Resource(object): event_type, context, ret = self.visalib.wait_on_event(self.session, in_event_type, timeout) except errors.VisaIOError as exc: if capture_timeout and exc.error_code == constants.StatusCode.error_timeout: - return WaitResponse(0, None, exc.error_code, self.visalib, timed_out=True) + return WaitResponse(in_event_type, None, exc.error_code, self.visalib, timed_out=True) raise return WaitResponse(event_type, context, ret, self.visalib)
wait_on_event: create WaitResponse object with correct event_type If wait_on_event is called with capture_timeout=True and a timeout occurs we try to create a WaitResponse object with 0 as the event type. This will fail, as 0 is not part of the Enum. Create the object with the input event type instead.
pyvisa_pyvisa
train
py
b39083327a069a6b859b77651d26a1826368fabf
diff --git a/js/bitforex.js b/js/bitforex.js index <HASH>..<HASH> 100644 --- a/js/bitforex.js +++ b/js/bitforex.js @@ -220,6 +220,9 @@ module.exports = class bitforex extends Exchange { }, }, }, + 'commonCurrencies': { + 'UOS': 'UOS Network', + }, 'exceptions': { '4004': OrderNotFound, '1013': AuthenticationError,
Bitforex UOS -> UOS Network Conflict between <URL>
ccxt_ccxt
train
js
74b1e1f72c2d0ff69f0a2969d3362cc8c62bac21
diff --git a/server/jetstream_cluster.go b/server/jetstream_cluster.go index <HASH>..<HASH> 100644 --- a/server/jetstream_cluster.go +++ b/server/jetstream_cluster.go @@ -1387,9 +1387,11 @@ func (js *jetStream) applyStreamEntries(mset *Stream, ce *CommittedEntry, isReco panic(err.Error()) } // Ignore if we are recovering and we have already processed. - if isRecovering && mset.State().LastSeq > sp.LastSeq { - // Make sure all messages from the purge are gone. - mset.store.Compact(sp.LastSeq) + if isRecovering { + if mset.State().FirstSeq <= sp.LastSeq { + // Make sure all messages from the purge are gone. + mset.store.Compact(sp.LastSeq + 1) + } continue }
Change the way we decide to compact on purge op replay
nats-io_gnatsd
train
go
29ceb0fcd77d00ee83b1bc15090ca935b6165033
diff --git a/src/test/java/io/vlingo/http/resource/sse/SseStreamResourceTest.java b/src/test/java/io/vlingo/http/resource/sse/SseStreamResourceTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/vlingo/http/resource/sse/SseStreamResourceTest.java +++ b/src/test/java/io/vlingo/http/resource/sse/SseStreamResourceTest.java @@ -133,5 +133,6 @@ public class SseStreamResourceTest { Configuration.define(); context = new MockRequestResponseContext(new MockResponseSenderChannel()); client = new SseClient(context); + AllSseFeedActor.registerInstantiator(); } }
Ensure ActorInstantiator is registered.
vlingo_vlingo-http
train
java
3936c62e7767b8b6441d121342c24d4749f11898
diff --git a/src/ol/handler/Drag.js b/src/ol/handler/Drag.js index <HASH>..<HASH> 100644 --- a/src/ol/handler/Drag.js +++ b/src/ol/handler/Drag.js @@ -24,6 +24,7 @@ goog.require('goog.fx.Dragger'); * @param {Object} states An object for the handlers to share states. */ ol.handler.Drag = function(map, elt, states) { + goog.base(this); /** * @type {ol.Map}
drag handler constructor should call its parent
openlayers_openlayers
train
js
49d827aeae1b0a478acc94df46468a70c0ffdb00
diff --git a/wct.conf.js b/wct.conf.js index <HASH>..<HASH> 100644 --- a/wct.conf.js +++ b/wct.conf.js @@ -36,8 +36,8 @@ module.exports = { }, { "browserName": "firefox", - "platform": "OS X 10.10", - "version": "37" + "platform": "OS X 10.9", + "version": "40" }, // { // "browserName": "firefox",
attempt to workaround the usual saucelabs madness
rnicholus_ajax-form
train
js
e4b4ea851c2c2af561da751703e5935f3084be25
diff --git a/components/TimelineEvent.js b/components/TimelineEvent.js index <HASH>..<HASH> 100644 --- a/components/TimelineEvent.js +++ b/components/TimelineEvent.js @@ -24,8 +24,8 @@ class TimelineEvent extends Component { containerStyle() { const {style} = this.props - const userStyle = style || {} - return this.showAsCard() ? {...s.eventContainer, ...s.card, ...userStyle} : s.eventContainer + const containerStyle = {...s.eventContainer, ...style} + return this.showAsCard() ? {...containerStyle, ...s.card} : containerStyle } iconStyle() { @@ -72,7 +72,8 @@ TimelineEvent.propTypes = { TimelineEvent.defaultProps = { iconStyle: {}, - contentStyle: {} + contentStyle: {}, + style: {} } export default TimelineEvent
fix($browser): Style prop was not applied to TimelineEvent container when the container was not card <URL>
rcdexta_react-event-timeline
train
js
98c516715fe84891b1d177dbc6b64ef491dfb37e
diff --git a/impl/src/main/java/org/jboss/weld/logging/EventLogger.java b/impl/src/main/java/org/jboss/weld/logging/EventLogger.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/jboss/weld/logging/EventLogger.java +++ b/impl/src/main/java/org/jboss/weld/logging/EventLogger.java @@ -71,7 +71,7 @@ public interface EventLogger extends WeldLogger { @Message(id = 410, value = "Observer method {0} cannot define @WithAnnotations", format = Format.MESSAGE_FORMAT) DefinitionException invalidWithAnnotations(Object param1); - @LogMessage(level = Level.WARN) + @LogMessage(level=Level.INFO) @Message(id = 411, value = "Observer method {0} receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.", format = Format.MESSAGE_FORMAT) void unrestrictedProcessAnnotatedTypes(Object param1); @@ -81,4 +81,4 @@ public interface EventLogger extends WeldLogger { @Message(id = 413, value = "{0} cannot be replaced by an observer method with a different bean class {1}", format = Format.MESSAGE_FORMAT) DefinitionException beanClassMismatch(ObserverMethod<?> originalObserverMethod, ObserverMethod<?> observerMethod); -} \ No newline at end of file +}
Lower log level for WELD-<I> warning (WARN -> INFO)
weld_core
train
java