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
0babaaf51201c44493d80d0a9a46c996e97ab34e
diff --git a/src/test/java/me/atam/atam4j/AcceptanceTestHealthCheckManagerIntegrationTest.java b/src/test/java/me/atam/atam4j/AcceptanceTestHealthCheckManagerIntegrationTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/me/atam/atam4j/AcceptanceTestHealthCheckManagerIntegrationTest.java +++ b/src/test/java/me/atam/atam4j/AcceptanceTestHealthCheckManagerIntegrationTest.java @@ -34,6 +34,7 @@ public class AcceptanceTestHealthCheckManagerIntegrationTest { new Atam4j.Atam4jBuilder() .withTestClasses(new Class[]{PassingTest.class}) .withEnvironment(environment) + .withInitialDelay(0) .build() .initialise();
Override initalDelay in Test - Default value has been changed in the library which doesn't suit tests. Hence tests should override the value using the builder.
atam4j_atam4j
train
java
4a93e60f05dff1bf31e2b9e5772b717071362033
diff --git a/src/class-u.php b/src/class-u.php index <HASH>..<HASH> 100644 --- a/src/class-u.php +++ b/src/class-u.php @@ -49,7 +49,7 @@ interface U { const HAIR_SPACE = "\xe2\x80\x8a"; const ZERO_WIDTH_SPACE = "\xe2\x80\x8b"; const HYPHEN_MINUS = '-'; - const HYPHEN = self::HYPHEN_MINUS; // "\xe2\x80\x90"; // should be Strings::_uchr(8208), but IE6 chokes. + const HYPHEN = self::HYPHEN_MINUS; // Should be "\xe2\x80\x90" (\u8208), but IE6 chokes. const NO_BREAK_HYPHEN = "\xe2\x80\x91"; const EN_DASH = "\xe2\x80\x93"; const EM_DASH = "\xe2\x80\x94";
Docs: reword comment to let it pass style checks
mundschenk-at_php-typography
train
php
0f5f4672e550b70364682843ce78d28c7f573464
diff --git a/test/host/loader.js b/test/host/loader.js index <HASH>..<HASH> 100644 --- a/test/host/loader.js +++ b/test/host/loader.js @@ -171,6 +171,12 @@ }; }, + _setupInclude = function (configuration) { + context.include = function (source) { + _loadTest(configuration, source); + } + }, + _loadTestsFromNames = function (configuration, names, verbose) { var len = names.length, sourceIdx, @@ -459,6 +465,7 @@ verbose("Console loaded."); } _setupConfig(configuration); + _setupInclude(configuration); _loadTests(configuration, options, verbose); _safeRunBDD(configuration, options, verbose); };
include helper (#<I>)
ArnaudBuchholz_gpf-js
train
js
f8133b9e4ccf6014cfb09626dcc575485a331f05
diff --git a/test/src/Provider/GithubTest.php b/test/src/Provider/GithubTest.php index <HASH>..<HASH> 100644 --- a/test/src/Provider/GithubTest.php +++ b/test/src/Provider/GithubTest.php @@ -66,12 +66,11 @@ class GithubTest extends ConcreteProviderTest */ public function testGetAccessTokenWithInvalidJson() { - $response = m::mock('Guzzle\Http\Message\Response'); - $response->shouldReceive('getBody')->times(1)->andReturn('invalid'); + $client = $this->createMockHttpClient(); + $response = $this->createMockResponse('invalid'); + + $client->shouldReceive('post')->times(1)->andReturn($response); - $client = m::mock('Guzzle\Service\Client'); - $client->shouldReceive('setBaseUrl')->times(1); - $client->shouldReceive('post->send')->times(1)->andReturn($response); $this->provider->setHttpClient($client); $this->provider->responseType = 'json';
Fix test for <I> branch
thephpleague_oauth2-client
train
php
988e9fdf966269fd1915000a4d442d4cbafdb12a
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -1288,17 +1288,19 @@ class BaseHighState(object): 'as a list'.format(sls)) errors.append(err) else: - for sub_sls in state.pop('include'): - if sub_sls not in mods: - nstate, mods, err = self.render_state( - sub_sls, - env, - mods - ) - if nstate: - state.update(nstate) - if err: - errors += err + for inc_sls in state.pop('include'): + for sub_sls in fnmatch.filter( + self.avail[env], inc_sls): + if sub_sls not in mods: + nstate, mods, err = self.render_state( + sub_sls, + env, + mods + ) + if nstate: + state.update(nstate) + if err: + errors += err if 'extend' in state: ext = state.pop('extend') for name in ext:
Add glob mathing to include statements
saltstack_salt
train
py
7abdd30a878efb3673ce4dfe0070570a6c9444c8
diff --git a/routing/heap_test.go b/routing/heap_test.go index <HASH>..<HASH> 100644 --- a/routing/heap_test.go +++ b/routing/heap_test.go @@ -26,7 +26,7 @@ func TestHeapOrdering(t *testing.T) { sortedEntries := make([]nodeWithDist, 0, numEntries) for i := 0; i < numEntries; i++ { entry := nodeWithDist{ - dist: prand.Float64(), + dist: prand.Int63(), } heap.Push(&nodeHeap, entry)
routing: correct recent type change in heap_test.go
lightningnetwork_lnd
train
go
e1fb6016e34e9d17a186eb198be895ee49be7360
diff --git a/js/tests/client/client.js b/js/tests/client/client.js index <HASH>..<HASH> 100644 --- a/js/tests/client/client.js +++ b/js/tests/client/client.js @@ -10,7 +10,7 @@ var http = require( 'http' ), // git log --max-count=1 --pretty=format:"%H"" // git rev-parse HEAD - config = require( './config.js' ), + config = require( process.argv[1] || './config.js' ), rtTest = require( '../roundtrip-test.js' ), getTitle = function ( cb ) {
Support passing in the config path to the client Change-Id: Ia9b<I>b6c<I>e0be3ee<I>e5f<I>ce<I>d<I>
wikimedia_parsoid
train
js
3fe1257b0bc005483fec5984c5f7541ceae26ccd
diff --git a/tests/heroku/test_plugin.py b/tests/heroku/test_plugin.py index <HASH>..<HASH> 100644 --- a/tests/heroku/test_plugin.py +++ b/tests/heroku/test_plugin.py @@ -1,12 +1,13 @@ from __future__ import absolute_import -from mock import patch +from mock import Mock, patch from django.utils import timezone from datetime import timedelta +from sentry.exceptions import HookValidationError from sentry.models import (Commit, Deploy, Environment, ProjectOption, Release, ReleaseCommit, ReleaseHeadCommit, Repository, User) @@ -130,3 +131,19 @@ class SetRefsTest(TestCase): 'prev_release_id': old_release.id, } ) + + +class HookHandleTest(TestCase): + def test_bad_version(self): + project = self.create_project() + user = self.create_user() + hook = HerokuReleaseHook(project) + + req = Mock() + req.POST = { + 'head_long': '', + 'url': 'http://example.com', + 'user': user.email, + } + with self.assertRaises(HookValidationError): + hook.handle(req)
add test to heroku plugin to make sure version is validated (#<I>)
getsentry_sentry-plugins
train
py
823b0acfb18d087acfa55e1f0b67641723e52aa1
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,10 @@ $LOAD_PATH << File.expand_path('../../spec/helpers', __FILE__) require 'buildpack/packager' require 'file_system_helpers' +unless system("which tree") + raise "Please install the `tree` commandline tool." +end + RSpec.configure do |config| config.include FileSystemHelpers end
Check for existence of `tree` before running suite.
cloudfoundry_buildpack-packager
train
rb
58e491dc250a200bf6d78200304cec08d54d2f94
diff --git a/raygun_django_middleware/__init__.py b/raygun_django_middleware/__init__.py index <HASH>..<HASH> 100644 --- a/raygun_django_middleware/__init__.py +++ b/raygun_django_middleware/__init__.py @@ -58,7 +58,8 @@ class RaygunMiddleware(object): 'httpMethod': request.method, 'ipAddress': request.META.get('REMOTE_ADDR', '?'), 'queryString': dict((key, request.GET[key]) for key in request.GET), - 'form': dict((key, request.POST[key]) for key in request.POST), + # F. Henard - 2/19/18 - bad practice to access request.POST in middleware - see https://stackoverflow.com/a/28641930 + # 'form': dict((key, request.POST[key]) for key in request.POST), 'headers': _headers, 'rawData': raw_data, } diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="raygun-django-middleware", - version="1.0.6", + version="1.0.7", description="Raygun Django Middleware", author="Mirus Research", author_email="[email protected]",
don't access request.POST in middleware
mirusresearch_raygun-django-middleware
train
py,py
de571b1afb1c46d550d15370720319bd733b2814
diff --git a/clkhash/rest_client.py b/clkhash/rest_client.py index <HASH>..<HASH> 100644 --- a/clkhash/rest_client.py +++ b/clkhash/rest_client.py @@ -87,10 +87,14 @@ def run_get_status(server, project, run, apikey): def run_get_result_text(server, project, run, apikey): - return requests.get( + response = requests.get( '{}/api/v1/projects/{}/runs/{}/result'.format(server, project, run), headers={"Authorization": apikey} - ).text + ) + + if response.status_code != 200: + raise ServiceError("Error retrieving results", response) + return response.text def format_run_status(status):
Treat the results endpoint the same and raise an exception on != <I> status
data61_clkhash
train
py
ccb39257f4f283437cd4ef3660a62596f4d2496a
diff --git a/lib/active_admin/helpers/collection.rb b/lib/active_admin/helpers/collection.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/helpers/collection.rb +++ b/lib/active_admin/helpers/collection.rb @@ -5,6 +5,7 @@ module ActiveAdmin # 2. correctly handles the Hash returned when `group by` is used def collection_size(c = collection) return c.count if c.is_a?(Array) + return c.length if c.limit_value c = c.except :select, :order diff --git a/spec/unit/views/components/paginated_collection_spec.rb b/spec/unit/views/components/paginated_collection_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/views/components/paginated_collection_spec.rb +++ b/spec/unit/views/components/paginated_collection_spec.rb @@ -241,6 +241,15 @@ RSpec.describe ActiveAdmin::Views::PaginatedCollection do .not_to make_database_queries(matching: "SELECT COUNT(*) FROM \"posts\"") end + it "makes no COUNT queries to figure out the last element of each page" do + require "db-query-matchers" + + undecorated_collection = Post.all.page(1).per(30) + + expect { paginated_collection(undecorated_collection) } + .not_to make_database_queries(matching: "SELECT COUNT(*) FROM (SELECT") + end + context "when specifying per_page: array option" do let(:collection) do posts = 10.times.map { Post.new }
Use collection length instead of running COUNTs for limited collections (#<I>)
activeadmin_activeadmin
train
rb,rb
dcf929552a057c60bb0920db46d828160b0f0255
diff --git a/demo/runner.js b/demo/runner.js index <HASH>..<HASH> 100644 --- a/demo/runner.js +++ b/demo/runner.js @@ -8,7 +8,7 @@ var files = fs.readdirSync( './entry/' ); files.forEach( function ( file ) { var codeStr = fs.readFileSync( './entry/' + file ).toString(); - var formattedCode = esformatter.format( codeStr, { + var options = { 'whiteSpace': { 'value': ' ', 'removeTrailing': 1, @@ -35,8 +35,13 @@ files.forEach( function ( file ) { 'preserve_newlines': true } } - } ); + }; + var formattedCode = esformatter.format( codeStr, options ); fs.writeFileSync( './result/' + path.basename( file ), formattedCode ); + var reformattedCode = esformatter.format( formattedCode, options ); + if (formattedCode !== reformattedCode) { + throw new Error( 'Expected ' + file + ' to reformat to the same result' ); + } } );
Reformat within demo to ensure equal results
royriojas_esformatter-jsx
train
js
1a8b92143c5c61952f484ebc71c08642bfd2a5cb
diff --git a/test/integration/percolator_test.rb b/test/integration/percolator_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/percolator_test.rb +++ b/test/integration/percolator_test.rb @@ -106,6 +106,6 @@ module Tire Configuration.client.get("#{Configuration.url}/_percolator/percolator-test/weather") rescue nil end - end + end unless ENV['TRAVIS'] end
[TEST] Do not run percolator tests on TravisCI Related: karmi/tire@<I>ad5
karmi_retire
train
rb
f0f02972001e16005d080ba5b1ebd1ba9ee2bc13
diff --git a/src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java b/src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java +++ b/src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java @@ -106,6 +106,18 @@ public class ConfigurationBuilder } /** + * This list was compiled in August 2018 using a baseline of what could be bought for roughly $20k usd for the offline attack values. + * <p> + * In the case this library is no longer maintained (or you choose to stay on an old version of it), we will scale the existing values by Moore's law. + * + * @return The default list of guess types and associated values of guesses per second. + */ + public static Map<String, Long> getDefaultGuessTypes() + { + return getDefaultGuessTypes(getDefaultCrackingHardwareCost()); + } + + /** * @return Returns all the dictionaries included with Nbvcxz. * Namely there is a dictionary for common passwords, english male names, english female names, english surnames, and common english words. */
Add non-parameter getter for default guess types back in to not break API.
GoSimpleLLC_nbvcxz
train
java
2f73206f83abcadd78046ccbd66809bb3840e638
diff --git a/tests/OutputTest.php b/tests/OutputTest.php index <HASH>..<HASH> 100644 --- a/tests/OutputTest.php +++ b/tests/OutputTest.php @@ -148,10 +148,18 @@ class OutputTest extends TestCase } - public function testSetDecorated(): void + public function testSetDecorated1(): void { - $this->console->shouldReceive("setDecorated")->once()->with(7); - $this->output->setDecorated(7); + $this->console->shouldReceive("setDecorated")->once()->with(true); + $this->output->setDecorated(true); + $this->assertTrue(true); + } + + + public function testSetDecorated2(): void + { + $this->console->shouldReceive("setDecorated")->once()->with(false); + $this->output->setDecorated(false); $this->assertTrue(true); }
Use correct data types for the setDecorated() tests
duncan3dc_symfony-climate
train
php
f4395d96a25b3e68a34483c7c533d07c110f40f3
diff --git a/src/Datasource/InvalidPropertyInterface.php b/src/Datasource/InvalidPropertyInterface.php index <HASH>..<HASH> 100644 --- a/src/Datasource/InvalidPropertyInterface.php +++ b/src/Datasource/InvalidPropertyInterface.php @@ -36,7 +36,7 @@ interface InvalidPropertyInterface * This value could not be patched into the entity and is simply copied into the _invalid property for debugging * purposes or to be able to log it away. * - * @param array $fields The values to set. + * @param array<string, mixed> $fields The values to set. * @param bool $overwrite Whether to overwrite pre-existing values for $field. * @return $this */
Fix up assoc return docblocks.
cakephp_cakephp
train
php
6f2c90d214603751644880a75cee2fb8c1a9cb3e
diff --git a/pyquil/api/qvm.py b/pyquil/api/qvm.py index <HASH>..<HASH> 100644 --- a/pyquil/api/qvm.py +++ b/pyquil/api/qvm.py @@ -319,9 +319,16 @@ programs run on this QVM. sample. The expectations returned from *different* ``expectation`` calls *will then generally be different*. + To measure the expectation of a PauliSum, you probably want to + do something like this:: + + progs, coefs = hamiltonian.get_programs() + expect_coeffs = np.array(cxn.expectation(prep_program, operator_programs=progs)) + return np.real_if_close(np.dot(coefs, expect_coeffs)) + :param Program prep_prog: Quil program for state preparation. :param list operator_programs: A list of Programs, each specifying an operator whose expectation to compute. - Default is a list containing only the empty Program. + Default is a list containing only the empty Program. :param bool needs_compilation: If True, preprocesses the job with the compiler. :param ISA isa: If set, compiles to this target ISA. :returns: Expectation value of the operators.
Improve expectation docs (#<I>) See #<I>
rigetti_pyquil
train
py
56e0cb4913e31590b825d4db7057fadf8af1c618
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,4 @@ +import os import sys import warnings from pathlib import Path @@ -14,6 +15,7 @@ with warnings.catch_warnings(): warnings.filterwarnings('ignore', category=FutureWarning) import scanpy.api +on_rtd = os.environ.get('READTHEDOCS') == 'True' # -- General configuration ------------------------------------------------ @@ -107,7 +109,7 @@ gh_url = 'https://github.com/{github_user}/{github_repo}'.format_map(html_contex def setup(app): - app.warningiserror = True + app.warningiserror = on_rtd app.add_stylesheet('css/custom.css') app.connect('autodoc-process-docstring', insert_function_images) app.connect('build-finished', show_param_warnings)
Only make broken links cause a doc build failure when on readthedocs Errors cause cache invalidation, making sphinx very slow on repeated builds. We want the docs to fail building on rtd (to see errors) but locally warnings are sufficient.
theislab_scanpy
train
py
131ed173bcb31c309064193f9baf31b70b5e127b
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -201,7 +201,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { } s = `<${nodeName}${s}>`; - if (String(nodeName).match(/[\s\n\\/='"\0<>]/)) throw s; + if (String(nodeName).match(/[\s\n\\/='"\0<>]/)) throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`); let isVoid = String(nodeName).match(VOID_ELEMENTS); if (isVoid) s = s.replace(/>$/, ' />');
Always throw errors, not strings (#<I>)
developit_preact-render-to-string
train
js
f8fbd3c25803ead38327e88ce112b06c7202f966
diff --git a/lib/did_you_mean/word_collection.rb b/lib/did_you_mean/word_collection.rb index <HASH>..<HASH> 100644 --- a/lib/did_you_mean/word_collection.rb +++ b/lib/did_you_mean/word_collection.rb @@ -13,18 +13,12 @@ module DidYouMean def similar_to(target_word) target_word = target_word.to_s.downcase - threshold = threshold(target_word) + threshold = (target_word.size * 0.3).ceil map {|word| [Levenshtein.distance(word.to_s.downcase, target_word), word] } .select {|distance, _| distance <= threshold } .sort .map(&:last) end - - private - - def threshold(word) - (word.size * 0.3).ceil - end end end
Inline private WordCollection#threshold method
yuki24_did_you_mean
train
rb
f62021bc8e63a74e55b50fa2dea55f414d2d4932
diff --git a/src/extensions/ignite.js b/src/extensions/ignite.js index <HASH>..<HASH> 100644 --- a/src/extensions/ignite.js +++ b/src/extensions/ignite.js @@ -2,6 +2,7 @@ // of the functions defined here are available as functions on that. // bring in each of the constituents +const shell = require('shelljs') const ignitePluginPathExt = require('./ignite/ignitePluginPath') const igniteConfigExt = require('./ignite/igniteConfig') const findIgnitePluginsExt = require('./ignite/findIgnitePlugins') @@ -38,7 +39,7 @@ function attach (plugin, command, context) { const forceNpm = parameters.options.npm // should we be using yarn? - const useYarn = !forceNpm && system.which('yarn') + const useYarn = !forceNpm && Boolean(shell.which('yarn')) // the ignite plugin path const {
Fixed failure when missing yarn (#<I>) This fixes #<I>
infinitered_ignite
train
js
e790f1d1040c76ae8b2c12f9f3537ddab90d3457
diff --git a/lib/stars/favstar.rb b/lib/stars/favstar.rb index <HASH>..<HASH> 100644 --- a/lib/stars/favstar.rb +++ b/lib/stars/favstar.rb @@ -16,7 +16,7 @@ module Stars def show(url) # hardcode 17 to strip favstar domain for now html = self.class.get(url[17..200], :format => :html) - Nokogiri::HTML(html).css('.avatarList img').collect do |img| + Nokogiri::HTML(html).css('div[id^="faved_by_others"] img').collect do |img| " ★ #{img.attributes['alt'].value}" end end
THE KYLE NEATH HOTFIX
holman_stars
train
rb
4cc4bd44da9a2d6a6944856cea6da52ac80a17f9
diff --git a/neo4j/v1/__init__.py b/neo4j/v1/__init__.py index <HASH>..<HASH> 100644 --- a/neo4j/v1/__init__.py +++ b/neo4j/v1/__init__.py @@ -17,3 +17,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +from .session import * +from .typesystem import *
Readded exports to neo4j.v1 package
neo4j_neo4j-python-driver
train
py
15c0115b28fb69398ed4b77d45c6f300857b18ae
diff --git a/examples/echoes_bot.rb b/examples/echoes_bot.rb index <HASH>..<HASH> 100755 --- a/examples/echoes_bot.rb +++ b/examples/echoes_bot.rb @@ -4,6 +4,7 @@ # # require the dsl lib to include all the methods you see below. # +require 'rubygems' require 'chatterbot/dsl' puts "Loading echoes_bot.rb"
added call to rubygems for completeness
muffinista_chatterbot
train
rb
88a0c1d9f01ef8a5427122fbe706082d5881ecbe
diff --git a/sippr.py b/sippr.py index <HASH>..<HASH> 100755 --- a/sippr.py +++ b/sippr.py @@ -132,6 +132,7 @@ class Sipprverse(object): self.serotype = args.serotype self.sixteens = args.sixteens self.virulence = args.virulence + self.averagedepth = args.averagedepth try: self.user_genes = os.path.join(args.user_genes) assert os.path.isfile(self.user_genes), 'Cannot find user-supplied target file: {targets}. Please ' \ @@ -176,7 +177,11 @@ if __name__ == '__main__': required=True, help='Path of .fastq(.gz) files to process.') parser.add_argument('-r', '--referencefilepath', + required=True, help='Provide the location of the folder containing reference database') + parser.add_argument('-a', '--averagedepth', + default=2, + help='Cutoff value for mapping depth to use when parsing BAM files.') parser.add_argument('-n', '--numthreads', help='Number of threads. Default is the number of cores in the system') parser.add_argument('-c', '--customcutoffs',
Reducing the average depth mapping depth defaults
OLC-Bioinformatics_sipprverse
train
py
7bfbaf0af2d419551a13435c7fe4ba0d6f5a85cd
diff --git a/http/org.wso2.carbon.transport.http.netty/src/main/java/org/wso2/carbon/transport/http/netty/listener/HTTPServerConnector.java b/http/org.wso2.carbon.transport.http.netty/src/main/java/org/wso2/carbon/transport/http/netty/listener/HTTPServerConnector.java index <HASH>..<HASH> 100644 --- a/http/org.wso2.carbon.transport.http.netty/src/main/java/org/wso2/carbon/transport/http/netty/listener/HTTPServerConnector.java +++ b/http/org.wso2.carbon.transport.http.netty/src/main/java/org/wso2/carbon/transport/http/netty/listener/HTTPServerConnector.java @@ -50,11 +50,7 @@ public class HTTPServerConnector extends ServerConnector { if (listenerConfiguration.isBindOnStartup()) { // Already bind at the startup, hence skipping return; } - try { - serverConnectorController.bindInterface(this); - } catch (Exception e) { - throw new ServerConnectorException("Cannot bind to " + this + " : " + e.getMessage(), e); - } + serverConnectorController.bindInterface(this); } @Override public void stop() {
Modified code base for new carbon-messaging <I>
wso2_transport-http
train
java
b88a192240f8d32292c2547f3cf3bde27e126be2
diff --git a/src/Utils/TokenUtils.php b/src/Utils/TokenUtils.php index <HASH>..<HASH> 100644 --- a/src/Utils/TokenUtils.php +++ b/src/Utils/TokenUtils.php @@ -266,8 +266,10 @@ class TokenUtils { // src offsets used to set mw:TemplateParams if ( $offset === null ) { $a->srcOffsets = null; - } elseif ( $a->srcOffsets ) { + } elseif ( $a->srcOffsets !== null ) { for ( $k = 0; $k < count( $a->srcOffsets ); $k++ ) { + // phpcs:disable Generic.Files.LineLength.TooLong + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable https://github.com/phan/phan/issues/805 $a->srcOffsets[$k] += $offset; } }
Fix a phan warning in TokenUtils.php Phan doesn't propagate the result of the test back to the value of the property, which is <URL>
wikimedia_parsoid
train
php
6e10896011565d23056211ab7a67f12994097575
diff --git a/packages/upload/src/UploadProgressBar.js b/packages/upload/src/UploadProgressBar.js index <HASH>..<HASH> 100644 --- a/packages/upload/src/UploadProgressBar.js +++ b/packages/upload/src/UploadProgressBar.js @@ -55,7 +55,7 @@ class UploadProgressBar extends Component { event.preventDefault(); upload.sendPassword(password); if (typeof onPasswordSubmit === 'function') { - onPasswordSubmit(event); + onPasswordSubmit(event, upload); } this.toggleModal(); };
feat(upload): return upload onPasswordSubmit callback
Availity_availity-react
train
js
b59deae4b0bf7ee406b881563c17391de923fe79
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -188,10 +188,6 @@ var request = function request(method, path, query, options, callback){ } }); - if (options.timeout) { - req.setTimeout(options.timeout); - } - req.on('error', function(e){ debug('Error', e); reject(e);
fix(#request): Remove setTimeout option It does not work in browsers, and is not important, yet.
Widen_node-collective
train
js
b6faa85e25bd9bbb17b4a71976a6278d70318fff
diff --git a/bot/index.js b/bot/index.js index <HASH>..<HASH> 100644 --- a/bot/index.js +++ b/bot/index.js @@ -145,10 +145,10 @@ module.exports = (app) => { const log = makeLogFn(repository, pullNumber) - if (context.payload.repository.private) { - log('Repository is private, skipping landr build') - return - } + // If (context.payload.repository.private) { + // log('Repository is private, skipping landr build') + // return + // } log(`Triggering build for PR: ${url}`)
Enable private repo builds for landrbot Change-type: minor
balena-io_landr
train
js
812d0f21af852a802d2af5f410460271bb9704cd
diff --git a/admin/resource.go b/admin/resource.go index <HASH>..<HASH> 100644 --- a/admin/resource.go +++ b/admin/resource.go @@ -138,6 +138,9 @@ MetaIncluded: func (res *Resource) IndexAttrs(columns ...string) []string { if len(columns) > 0 { res.indexAttrs = columns + if len(res.searchAttrs) == 0 { + res.SearchAttrs(columns...) + } } if len(res.indexAttrs) == 0 { return res.allAttrs() @@ -230,6 +233,7 @@ func (res *Resource) SearchAttrs(columns ...string) []string { } } } + return res.searchAttrs }
Set search attrs if doesn't exist
qor_qor
train
go
6d9f5a2ed6627c1aea89d8e527902ae84f18db84
diff --git a/schedule/__init__.py b/schedule/__init__.py index <HASH>..<HASH> 100644 --- a/schedule/__init__.py +++ b/schedule/__init__.py @@ -134,11 +134,14 @@ class Job(object): timestats = '(last run: %s, next run: %s)' % ( format_time(self.last_run), format_time(self.next_run)) - job_func_name = self.job_func.__name__ - args = [repr(x) for x in self.job_func.args] - kwargs = ['%s=%s' % (k, repr(v)) - for k, v in self.job_func.keywords.items()] - call_repr = job_func_name + '(' + ', '.join(args + kwargs) + ')' + try: + job_func_name = self.job_func.__name__ + args = [repr(x) for x in self.job_func.args] + kwargs = ['%s=%s' % (k, repr(v)) + for k, v in self.job_func.keywords.items()] + call_repr = job_func_name + '(' + ', '.join(args + kwargs) + ')' + except AttributeError: + call_repr = repr(self.job_func) if self.at_time is not None: return 'Every %s %s at %s do %s %s' % (
Add fallback for when job_func has no name
dbader_schedule
train
py
54c81e53f948a636440db524ad42c38fa359f8d7
diff --git a/lib/active_mocker/rspec_helper.rb b/lib/active_mocker/rspec_helper.rb index <HASH>..<HASH> 100644 --- a/lib/active_mocker/rspec_helper.rb +++ b/lib/active_mocker/rspec_helper.rb @@ -1,3 +1,5 @@ +require 'active_mocker/loaded_mocks' + RSpec.configure do |config| def mock_class(class_name)
Require loaded_mocks If no mocks are required the constant lookup fails.
zeisler_active_mocker
train
rb
9a8bae48a98e7139035ff62890162dd4a9e450b8
diff --git a/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js b/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +++ b/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js @@ -47,3 +47,23 @@ } } }).call(this) + +;(function () { + var $menuToggleButtons = document.querySelectorAll('.govuk-js-header-toggle') + + for (var j = 0; j < $menuToggleButtons.length; j++) { + var element = $menuToggleButtons[j] + + element.addEventListener('click', function (event) { + var expanded = event.target.getAttribute('aria-expanded') + + if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) { + if (expanded === 'true') { + window.GOVUK.analytics.trackEvent('headerClicked', 'menuClosed', { label: 'none' }) + } else { + window.GOVUK.analytics.trackEvent('headerClicked', 'menuOpened', { label: 'none' }) + } + } + }) + } +})()
Added tracking for the header menu toggle There is already tracking in place to see how users use the search toggle - this adds tracking for the menu toggle. Since the functionality for the toggling of the menu comes from GOV.UK Frontend, this needed to be a separate event listener added to specifically send events to analytics. This can be removed when the user research has been completed.
alphagov_govuk_publishing_components
train
js
5717941ad9c3d8766ac77f5a58c68962ed9d5ca0
diff --git a/DeviceDetector.php b/DeviceDetector.php index <HASH>..<HASH> 100644 --- a/DeviceDetector.php +++ b/DeviceDetector.php @@ -47,7 +47,7 @@ class DeviceDetector /** * Current version number of DeviceDetector */ - const VERSION = '3.1.1'; + const VERSION = '3.3.0'; /** * Holds all registered client types
next version will be <I>
matomo-org_device-detector
train
php
4fbb51fa728d28275b97c328b43b7ed04bd48da0
diff --git a/ImageHandler.php b/ImageHandler.php index <HASH>..<HASH> 100755 --- a/ImageHandler.php +++ b/ImageHandler.php @@ -28,7 +28,7 @@ class ImageHandler extends Image { $callback = $this->fileCallback; - if (null !== $callback) + if (null === $callback) return $filename; return $callback($filename);
[ImageHandler] Problem with callback (fixes #7]
Gregwar_ImageBundle
train
php
206df090204d4b47365d5a69fbd0c94768065265
diff --git a/config/set/early-return.php b/config/set/early-return.php index <HASH>..<HASH> 100644 --- a/config/set/early-return.php +++ b/config/set/early-return.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; +use Rector\EarlyReturn\Rector\Foreach_\ReturnAfterToEarlyOnBreakRector; use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector; @@ -22,4 +23,5 @@ return static function (ContainerConfigurator $containerConfigurator): void { $services->set(ReturnBinaryAndToEarlyReturnRector::class); $services->set(ChangeOrIfReturnToEarlyReturnRector::class); $services->set(ChangeOrIfContinueToMultiContinueRector::class); + $services->set(ReturnAfterToEarlyOnBreakRector::class); };
[EarlyReturn] Register ReturnAfterToEarlyOnBreakRector to early-return config set (#<I>)
rectorphp_rector
train
php
a1141de5d323e934a878939e64baae390a18da9b
diff --git a/odl/space/cartesian.py b/odl/space/cartesian.py index <HASH>..<HASH> 100644 --- a/odl/space/cartesian.py +++ b/odl/space/cartesian.py @@ -690,9 +690,9 @@ class Ntuples(NtuplesBase): True """ if out is None: - return self.data.__getitem__(slice(start, stop, step)).copy() + return self.data[start:stop:step].copy() else: - out[:] = self.data.__getitem__(slice(start, stop, step)) + out[:] = self.data[start:stop:step] return out @property
Simplified asarray implementation in NTuples
odlgroup_odl
train
py
473ffd34889673a3730456672fdba281febf0737
diff --git a/src/Illuminate/Http/Resources/Json/JsonResource.php b/src/Illuminate/Http/Resources/Json/JsonResource.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Http/Resources/Json/JsonResource.php +++ b/src/Illuminate/Http/Resources/Json/JsonResource.php @@ -113,7 +113,7 @@ class JsonResource implements ArrayAccess, JsonSerializable, Responsable, UrlRou if (is_null($this->resource)) { return []; } - + return is_array($this->resource) ? $this->resource : $this->resource->toArray();
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
b170f97a3e9337019058688c1cb5f79598a32709
diff --git a/domains.go b/domains.go index <HASH>..<HASH> 100644 --- a/domains.go +++ b/domains.go @@ -3,6 +3,7 @@ package mailgun import ( "github.com/mbanzon/simplehttp" "strconv" + "time" ) type Domain struct { @@ -32,6 +33,11 @@ type singleDomainEnvelope struct { SendingDNSRecords []DNSRecord `json:"sending_dns_records"` } +func (d Domain) GetCreatedAt() (t time.Time, err error) { + t, err = parseMailgunTime(d.CreatedAt) + return +} + func (m *mailgunImpl) GetDomains(limit, skip int) (int, []Domain, error) { r := simplehttp.NewGetRequest(generatePublicApiUrl(domainsEndpoint)) if limit != -1 {
Added timestamp parsing to domain struct.
mailgun_mailgun-go
train
go
b4e8143136e670c8897e04be3d94301431db7a53
diff --git a/wikipediaapi/wikipedia.py b/wikipediaapi/wikipedia.py index <HASH>..<HASH> 100644 --- a/wikipediaapi/wikipedia.py +++ b/wikipediaapi/wikipedia.py @@ -94,7 +94,10 @@ class Wikipedia(object): self.language = language.strip().lower() self.extract_format = extract_format self.__headers = dict() if headers is None else headers - self.__headers.setdefault('User-Agent', 'Wikipedia-API (https://github.com/martin-majlis/Wikipedia-API)') + self.__headers.setdefault( + 'User-Agent', + 'Wikipedia-API (https://github.com/martin-majlis/Wikipedia-API)' + ) self.__request_kwargs = kwargs def page(
updated a line for pep8 standard
martin-majlis_Wikipedia-API
train
py
f7af66261fc59fe408133d6c7e4f528c036d894b
diff --git a/lib/sharp.js b/lib/sharp.js index <HASH>..<HASH> 100644 --- a/lib/sharp.js +++ b/lib/sharp.js @@ -135,12 +135,12 @@ module.exports = function(file, config, options, cb) { image.toFormat(toFormat); } catch (err) { - return cb(new gutil.PluginError(PLUGIN_NAME, err)); + return cb(new gutil.PluginError(PLUGIN_NAME, err, {showStack: true})); } image.toBuffer(function(err, buf) { if (err) { - return cb(new gutil.PluginError(PLUGIN_NAME, err)); + return cb(new gutil.PluginError(PLUGIN_NAME, err, {showStack: true})); } var newFile = new gutil.File({
show error stack if error is from sharp
mahnunchik_gulp-responsive
train
js
aaf8b3ed8538dd624315433b615afdec3632b4a4
diff --git a/tests/TestCase/Model/Behavior/TrashBehaviorTest.php b/tests/TestCase/Model/Behavior/TrashBehaviorTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Model/Behavior/TrashBehaviorTest.php +++ b/tests/TestCase/Model/Behavior/TrashBehaviorTest.php @@ -164,6 +164,33 @@ class TrashBehaviorTest extends TestCase } /** + * Test the beforeDelete callback. + * + * @return void + */ + public function testBeforeDeleteAbort() + { + $article = $this->Articles->get(1); + + $this->Articles->getEventManager()->on( + 'Model.beforeSave', + [], + function (Event $event, EntityInterface $entity, ArrayObject $options) use (&$hasDeleteOptionsBefore) { + $entity->setError('id', 'Save aborted'); + $event->setResult(false); + $event->stopPropagation(); + } + + ); + + $result = $this->Articles->delete($article); + + $this->assertFalse($result); + $this->assertArrayHasKey('id', $article->getErrors()); + } + + + /** * Tests that the options passed to the `delete()` method are being passed on into * the cascading delete process. *
Added test for aborting delete due to a beforeSave listener
UseMuffin_Trash
train
php
96fdfc65431df2a45dec3f3714d662a1f341ad15
diff --git a/shap/plots/force.py b/shap/plots/force.py index <HASH>..<HASH> 100644 --- a/shap/plots/force.py +++ b/shap/plots/force.py @@ -12,6 +12,7 @@ import base64 import numpy as np import scipy.cluster import collections +import warnings from ..common import convert_to_link, Instance, Model, Data, DenseData, Link def force_plot(base_value, shap_values, features=None, feature_names=None, out_names=None, link="identity",
import warnings to comply with jupyter notebooks
slundberg_shap
train
py
59d6174eb20d5f3416b89971cbaf30acb520f35a
diff --git a/tests/e2e/kubetest2-kops/deployer/up.go b/tests/e2e/kubetest2-kops/deployer/up.go index <HASH>..<HASH> 100644 --- a/tests/e2e/kubetest2-kops/deployer/up.go +++ b/tests/e2e/kubetest2-kops/deployer/up.go @@ -131,7 +131,8 @@ func (d *deployer) createCluster(zones []string, adminAccess string) error { if d.GCPProject != "" { args = appendIfUnset(args, "--project", d.GCPProject) } - args = appendIfUnset(args, "--vpc", strings.Split(d.ClusterName, ".")[0]) + // We used to set the --vpc flag to split clusters into different networks, this is now the default. + // args = appendIfUnset(args, "--vpc", strings.Split(d.ClusterName, ".")[0]) case "digitalocean": args = appendIfUnset(args, "--master-size", "c2-16vcpu-32gb") args = appendIfUnset(args, "--node-size", "c2-16vcpu-32gb")
gce: don't try to specify a pre-existing network We now automatically create a network if an existing one is not specified.
kubernetes_kops
train
go
9fdd243fb7b5dee65baa7c4aae0f55ea8324afe7
diff --git a/src/Gordalina/Easypay/Response/FetchAllPayments.php b/src/Gordalina/Easypay/Response/FetchAllPayments.php index <HASH>..<HASH> 100644 --- a/src/Gordalina/Easypay/Response/FetchAllPayments.php +++ b/src/Gordalina/Easypay/Response/FetchAllPayments.php @@ -43,15 +43,18 @@ class FetchAllPayments extends AbstractResponse implements ResponseInterface 'ep_status' => 'status', 'ep_message' => 'message', 'ep_num_records' => 'recordCount', - 'ref_detail' => array('records', array($this, 'normalizePayments')) + 'ref_detail' => array('records', function (array $payments) { + return FetchAllPayments::normalizePayments($payments); + }) )); } /** + * @static * @param array $payments * @return array|PaymentComplete[] */ - public function normalizePayments(array $payments) + public static function normalizePayments(array $payments) { if (!isset($payments['ref']) || empty($payments['ref'])) { return array();
Fix issue with PHP <I>
gordalina_easypay-php
train
php
f254950244616d8dd2c9432fad4f5de5cf7d1fa0
diff --git a/package-testing/lib/helper.rb b/package-testing/lib/helper.rb index <HASH>..<HASH> 100644 --- a/package-testing/lib/helper.rb +++ b/package-testing/lib/helper.rb @@ -1 +1 @@ -$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) +$LOAD_PATH << File.expand_path(__dir__)
(MAINT) Resolve rubocop Style/Dir
puppetlabs_pdk
train
rb
86335031d4b0a22ba0d0640ac0db21b2dc7110b2
diff --git a/python/pcs_api/_version.py b/python/pcs_api/_version.py index <HASH>..<HASH> 100644 --- a/python/pcs_api/_version.py +++ b/python/pcs_api/_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -__version__ = '1.0.2' +__version__ = '1.1-SNAPSHOT'
prepare python version <I>-SNAPSHOT for next development
netheosgithub_pcs_api
train
py
b8fff850866b20a22b684c648cf098cc1200ef6f
diff --git a/helpers/class.Date.php b/helpers/class.Date.php index <HASH>..<HASH> 100644 --- a/helpers/class.Date.php +++ b/helpers/class.Date.php @@ -174,10 +174,13 @@ class tao_helpers_Date */ static function getTimeStamp($microtime, $microseconds = false) { - list ($usec, $sec) = explode(" ", $microtime); - $timestamp = $microseconds ? $sec + $usec : $sec; + $parts = array_reverse(explode(" ", $microtime)); - return ((float)$timestamp); + $timestamp = $microseconds && isset($parts[1]) + ? $parts[0] . '.' . round($parts[1] * 1000000, 0) + : $parts[0]; + + return $timestamp; } static function getTimeStampWithMicroseconds(DateTime $dt)
Improved method for get timestamp of date with microseconds
oat-sa_tao-core
train
php
9af5f5f42951c57d68e84865090e7ffcddd2b932
diff --git a/addon/mixins/select-picker.js b/addon/mixins/select-picker.js index <HASH>..<HASH> 100644 --- a/addon/mixins/select-picker.js +++ b/addon/mixins/select-picker.js @@ -112,14 +112,14 @@ export default Ember.Mixin.create({ // value of the multiple property. Ember.Select maintains the value // property. var selection = this.selectionAsArray().map(function(item) { - return Ember.get(item, valuePath); + return valuePath ? Ember.get(item, valuePath) : item; }); var searchMatcher = this.makeSearchMatcher(); var result = _compact(Ember.makeArray(this.get('content')) .map(function(item, index) { - const label = Ember.get(item, labelPath); - const value = Ember.get(item, valuePath); + const label = labelPath ? Ember.get(item, labelPath) : item; + const value = valuePath ? Ember.get(item, valuePath) : item; const group = groupPath ? Ember.get(item, groupPath) : null; if (searchMatcher(group) || searchMatcher(label)) { return Ember.Object.create({
Test for empty path values and use whole object rather than usig Ember.get with an empty string (which is no longer supported)
sukima_ember-cli-select-picker
train
js
abddbc3a899318e570acb540489110c343a024ca
diff --git a/Components/AmazonPay/Shopware/AmazonPayPaymentResponseParser.php b/Components/AmazonPay/Shopware/AmazonPayPaymentResponseParser.php index <HASH>..<HASH> 100644 --- a/Components/AmazonPay/Shopware/AmazonPayPaymentResponseParser.php +++ b/Components/AmazonPay/Shopware/AmazonPayPaymentResponseParser.php @@ -54,18 +54,18 @@ class AmazonPayPaymentResponseParser implements PaymentResponseParserInterface } /** - * @param string $ordernumber + * @param string $orderId * - * @return array|bool + * @return array */ - private function getAmazonPayData($ordernumber) + private function getAmazonPayData($orderId): array { try { - $query = 'SELECT * FROM s_order_attributes WHERE orderID = ?'; + $query = 'SELECT bestit_amazon_authorization_id FROM s_order_attributes WHERE orderID = ?'; - return $this->connection->fetchAssoc($query, [$ordernumber]); + return $this->connection->fetchAssoc($query, [$orderId]); } catch (Exception $exception) { - return false; + return []; } }
surcharge tax fix (#<I>)
plentymarkets_plentymarkets-shopware-connector
train
php
685893c9e53e86c3a2cbc59fa516cf9daeb80d9f
diff --git a/src/Dami/Migration/MigrationFiles.php b/src/Dami/Migration/MigrationFiles.php index <HASH>..<HASH> 100644 --- a/src/Dami/Migration/MigrationFiles.php +++ b/src/Dami/Migration/MigrationFiles.php @@ -30,7 +30,7 @@ class MigrationFiles public function get($version = null) { $currentVersion = $this->schemaTable->getCurrentVersion(); - if ($version && (int) $version === (int) $currentVersion) { + if (null !== $version && (int) $version === (int) $currentVersion) { return null; } $migrateUp = null === $version || $version >= $currentVersion;
Checking if version of migration exists - better version :angry:
czogori_Dami
train
php
90d3f96b7a65d58910f87920ef605fb784299573
diff --git a/lib/custom/src/MShop/Customer/Manager/Typo3.php b/lib/custom/src/MShop/Customer/Manager/Typo3.php index <HASH>..<HASH> 100644 --- a/lib/custom/src/MShop/Customer/Manager/Typo3.php +++ b/lib/custom/src/MShop/Customer/Manager/Typo3.php @@ -476,11 +476,11 @@ class MShop_Customer_Manager_Typo3 $item->setId( $this->_newId( $conn, $context->getConfig()->get( $path, $path ) ) ); } - $dbm->release( $conn ); + $dbm->release( $conn, $dbname ); } catch( Exception $e ) { - $dbm->release( $conn ); + $dbm->release( $conn, $dbname ); throw $e; } } @@ -513,11 +513,11 @@ class MShop_Customer_Manager_Typo3 $map[ $row['id'] ] = $row; } - $dbm->release( $conn ); + $dbm->release( $conn, $dbname ); } catch( Exception $e ) { - $dbm->release( $conn ); + $dbm->release( $conn, $dbname ); throw $e; }
Fix for releasing db connections properly
aimeos_ai-typo3
train
php
8ffd3aa6e04213e73c613466d6caa50550b5066c
diff --git a/src/Plugins/MediaEmbed/Parser.php b/src/Plugins/MediaEmbed/Parser.php index <HASH>..<HASH> 100644 --- a/src/Plugins/MediaEmbed/Parser.php +++ b/src/Plugins/MediaEmbed/Parser.php @@ -7,10 +7,10 @@ */ namespace s9e\TextFormatter\Plugins\MediaEmbed; -use s9e\TextFormatter\Utils\Http; use s9e\TextFormatter\Parser as TagStack; use s9e\TextFormatter\Parser\Tag; use s9e\TextFormatter\Plugins\ParserBase; +use s9e\TextFormatter\Utils\Http; class Parser extends ParserBase {
MediaEmbed: reordered use statements [ci skip]
s9e_TextFormatter
train
php
6a58444df65ab59f97879d566752eeb54bd96fc2
diff --git a/lib/bcsec.rb b/lib/bcsec.rb index <HASH>..<HASH> 100644 --- a/lib/bcsec.rb +++ b/lib/bcsec.rb @@ -7,6 +7,7 @@ module Bcsec autoload :Group, 'bcsec/group' autoload :GroupMemberships, 'bcsec/group_membership' autoload :GroupMembership, 'bcsec/group_membership' + autoload :Netid, 'bcsec/netid' autoload :Rack, 'bcsec/rack' autoload :User, 'bcsec/user' autoload :Modes, 'bcsec/modes'
Expose the full LDAP record for LDAP-retrieved users. Closes #<I>.
NUBIC_aker
train
rb
207f09f1a8a5619f807aef0419687150a9a6a1e8
diff --git a/lib/xcode/configurations/targeted_device_family_property.rb b/lib/xcode/configurations/targeted_device_family_property.rb index <HASH>..<HASH> 100644 --- a/lib/xcode/configurations/targeted_device_family_property.rb +++ b/lib/xcode/configurations/targeted_device_family_property.rb @@ -7,14 +7,14 @@ module Xcode # Family which assigns particular numeric values to the platform types. # # Instead of manipulating the numeric values, this will perform a conversion - # return an array of names like 'iPhone' and 'iPad'. + # return an array of symbols with the platforms like :iphone and :ipad. # module TargetedDeviceFamily extend self # # @param [String] value convert the comma-delimited list of platforms - # @return [Array<String>] the platform names supported. + # @return [Array<Symbol>] the platform names supported. # def open(value) value.to_s.split(",").map do |platform_number|
Fixed documentation for TargetedDeviceFamily
rayh_xcoder
train
rb
c0cc7dbe783ba507f135ba89225f12d12c7db2e3
diff --git a/etc/webpack.common.js b/etc/webpack.common.js index <HASH>..<HASH> 100755 --- a/etc/webpack.common.js +++ b/etc/webpack.common.js @@ -275,12 +275,7 @@ var config = { 'NODE_ENV': JSON.stringify(ENV), 'HMR': false } - }), - /** - * Plugin: NotifierPlugin - * See: https://github.com/Turbo87/webpack-notifier#usage - */ - new WebpackNotifierPlugin() + }) ], /* @@ -299,6 +294,16 @@ var config = { }; +if( os.platform() !== 'win32') { + // FIXME, see https://github.com/holisticon/angular-common/issues/11 + config.plugins.push( + /** + * Plugin: NotifierPlugin + * See: https://github.com/Turbo87/webpack-notifier#usage + */ + new WebpackNotifierPlugin()); +} + /* * Plugin: HtmlWebpackPlugin * Description: Simplifies creation of HTML files to serve your webpack bundles.
fix(#<I>): workaround for windows notification error
holisticon_angular-common
train
js
cfdf1411909b136f417291d819501c6f4acb1cc4
diff --git a/cmd/shfmt/main.go b/cmd/shfmt/main.go index <HASH>..<HASH> 100644 --- a/cmd/shfmt/main.go +++ b/cmd/shfmt/main.go @@ -48,13 +48,9 @@ var ( copyBuf = make([]byte, 32*1024) - in io.Reader = os.Stdin - out io.Writer = os.Stdout - - color bool - ansiFgRed = "\u001b[31m" - ansiFgGreen = "\u001b[32m" - ansiReset = "\u001b[0m" + in io.Reader = os.Stdin + out io.Writer = os.Stdout + color bool version = "v3.0.0-alpha2" ) diff --git a/interp/interp.go b/interp/interp.go index <HASH>..<HASH> 100644 --- a/interp/interp.go +++ b/interp/interp.go @@ -1196,7 +1196,6 @@ func (r *Runner) call(ctx context.Context, pos syntax.Pos, args []string) { } func (r *Runner) exec(ctx context.Context, args []string) { - // path := r.lookPath(args[0]) err := r.Exec(r.modCtx(ctx), args) switch x := err.(type) { case nil:
all: remove a few lines of unused code Mostly my doing in the past week or so.
mvdan_sh
train
go,go
f80ee6fa5118d409bb7c6c5fb7ec97a7d1ca5741
diff --git a/umap/tests/test_umap_metrics.py b/umap/tests/test_umap_metrics.py index <HASH>..<HASH> 100644 --- a/umap/tests/test_umap_metrics.py +++ b/umap/tests/test_umap_metrics.py @@ -340,7 +340,7 @@ def test_seuclidean(spatial_data): ) def test_weighted_minkowski(spatial_data): v = np.abs(np.random.randn(spatial_data.shape[1])) - dist_matrix = pairwise_distances(spatial_data, metric="wminkowski", w=v, p=3) + dist_matrix = pairwise_distances(spatial_data, metric="minkowski", w=v, p=3) test_matrix = np.array( [ [
Fixes for weighted minkowski (per changes in SciPy); Scipy changed the name...
lmcinnes_umap
train
py
8b5b921b7198b9857995678022ccd207c7b3a5d5
diff --git a/axes/handlers/database.py b/axes/handlers/database.py index <HASH>..<HASH> 100644 --- a/axes/handlers/database.py +++ b/axes/handlers/database.py @@ -125,6 +125,7 @@ class AxesDatabaseHandler(AbstractAxesHandler, AxesBaseHandler): username=username, ip_address=request.axes_ip_address, user_agent=request.axes_user_agent, + defaults={"failures_since_start": failures_since_start} ) # Update failed attempt information but do not touch the username, IP address, or user agent fields, # because attackers can request the site with multiple different configurations @@ -136,7 +137,8 @@ class AxesDatabaseHandler(AbstractAxesHandler, AxesBaseHandler): attempt.post_data = Concat("post_data", Value(separator + post_data)) attempt.http_accept = request.axes_http_accept attempt.path_info = request.axes_path_info - attempt.failures_since_start += 1 + if not created: + attempt.failures_since_start += 1 attempt.attempt_time = request.axes_attempt_time attempt.save() # Record failed attempt with all the relevant information.
Initiallize failures since start correctly
jazzband_django-axes
train
py
5aff7ffbe7dda8b0554e792ddc5845c67207e581
diff --git a/src/services/Routes.php b/src/services/Routes.php index <HASH>..<HASH> 100644 --- a/src/services/Routes.php +++ b/src/services/Routes.php @@ -435,8 +435,9 @@ class Routes extends Component // Iterate through the elements and grab their URLs foreach ($elements as $element) { - if (!empty($element->url) && !\in_array($element->url, $resultingUrls, true)) { - $resultingUrls[] = $element->url; + if (!empty($element->uri) && !\in_array($element->uri, $resultingUrls, true)) { + $uri = $this->normalizeUri($element->uri); + $resultingUrls[] = $uri; } }
Return the URI rather than the URL
nystudio107_craft-routemap
train
php
65ee000a399f5545d360684ae84786e23052e71c
diff --git a/core-bundle/src/Resources/contao/library/Contao/Template.php b/core-bundle/src/Resources/contao/library/Contao/Template.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Template.php +++ b/core-bundle/src/Resources/contao/library/Contao/Template.php @@ -337,7 +337,7 @@ abstract class Template extends \Controller . "$(document.body).setStyle('margin-bottom', $('debug').hasClass('closed')?'60px':'320px');" . "$('tog').addEvent('click',function(e) {" . "$('debug').toggleClass('closed');" - . "Cookie.write('CONTAO_CONSOLE',$('debug').hasClass('closed')?'closed':'');" + . "Cookie.write('CONTAO_CONSOLE',$('debug').hasClass('closed')?'closed':'',{path:Contao.path});" . "$(document.body).setStyle('margin-bottom', $('debug').hasClass('closed')?'60px':'320px');" . "});" . "window.addEvent('resize',function() {"
[Core] Add the cookie path to the debug console (see #<I>)
contao_contao
train
php
47b37548b5281a797fb7ce6a979e70798e05c1cf
diff --git a/process/context/launch.go b/process/context/launch.go index <HASH>..<HASH> 100644 --- a/process/context/launch.go +++ b/process/context/launch.go @@ -59,7 +59,7 @@ type ProcLaunchCommand struct { // Run implements cmd.Command. func (c *ProcLaunchCommand) Run(ctx *cmd.Context) error { - logger.Tracef("running launch command") + logger.Tracef("running %s command", LaunchCommandInfo.Name) if err := c.registeringCommand.Run(ctx); err != nil { return errors.Trace(err) }
Do not hard-code the command name in the log message.
juju_juju
train
go
ec174ac271a94d14b2d82e72a2a554b0382fa149
diff --git a/pyt/cfg.py b/pyt/cfg.py index <HASH>..<HASH> 100644 --- a/pyt/cfg.py +++ b/pyt/cfg.py @@ -334,7 +334,7 @@ class CFG(ast.NodeVisitor): Args: function_node: is the node to create a CFG of """ - print(function_node.name) + self.module_definitions_stack.append(ModuleDefinitions()) self.function_names.append(function_node.name)
Add stack when creating funciton as a cfg
python-security_pyt
train
py
7c695aac8315ac7703fdb69724b78111475d0ae6
diff --git a/demo/views.py b/demo/views.py index <HASH>..<HASH> 100755 --- a/demo/views.py +++ b/demo/views.py @@ -138,3 +138,8 @@ def flot_demo(request): 'bar_chart': bar_chart, 'point_chart': point_chart} return render(request, 'demo/flot.html', context) + + +def mongodb_source_demo(request): + context = {} + return render(request, 'demo/mongodb_source.html', context)
added basic demo_mongodb_source view
agiliq_django-graphos
train
py
88cc0592a446ec4da9a76f8759231e8bdb8db39e
diff --git a/paved/django.py b/paved/django.py index <HASH>..<HASH> 100644 --- a/paved/django.py +++ b/paved/django.py @@ -24,7 +24,7 @@ util.update( ) ) -__all__ = ['manage', 'call_manage', 'test', 'syncdb', 'shell', 'start'] +__all__ = ['manage', 'call_manage', 'djtest', 'syncdb', 'shell', 'start'] @task
Fixed name of djtest in __all__
eykd_paved
train
py
9fa57d06da1558a76e944f386fd1ead282ca8e7e
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -567,7 +567,7 @@ gulp.task('test.all.dart', shell.task(['./scripts/ci/test_dart.sh'])); function getBrowsersFromCLI() { var isSauce = false; var args = minimist(process.argv.slice(2)); - var rawInput = args.browsers?args.browsers:'DartiumWithWebPlatform'; + var rawInput = args.browsers ? args.browsers : 'DartiumWithWebPlatform'; var inputList = rawInput.replace(' ', '').split(','); var outputList = []; for (var i = 0; i < inputList.length; i++) {
style(gulp): make code more readable
angular_angular
train
js
7dd8846d36d343344877d00389142ca30e46f580
diff --git a/lib/RateLimiter.js b/lib/RateLimiter.js index <HASH>..<HASH> 100644 --- a/lib/RateLimiter.js +++ b/lib/RateLimiter.js @@ -20,10 +20,8 @@ class RateLimiter { consume(key, rate = 1) { return new Promise((resolve, reject) => { const rlKey = RateLimiter.getKey(key); - const tempKey = `tmp${rlKey}`; this.redis.multi() - .setex(tempKey, this.duration, 0) - .renamenx(tempKey, rlKey) + .set(rlKey, 0, 'EX', this.duration, 'NX') .incrby(rlKey, rate) .pttl(rlKey) .exec((err, results) => { @@ -32,7 +30,7 @@ class RateLimiter { if (err) { reject(new Error('Redis Client error')); } else { - const [,, consumed, resTtlMs] = results; + const [, consumed, resTtlMs] = results; if (resTtlMs === -1) { msBeforeReset = this.duration; this.redis.expire(rlKey, this.duration);
Improved: use set command with NX flag
animir_node-rate-limiter-flexible
train
js
3b7b733ca9f2e3193426682ae6357b3f29307aa2
diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '19.5' +__version__ = '19.6'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py
9faa04f61e7e83076c1a0e6c0466cdeafc689fba
diff --git a/opbeat/utils/deprecation.py b/opbeat/utils/deprecation.py index <HASH>..<HASH> 100644 --- a/opbeat/utils/deprecation.py +++ b/opbeat/utils/deprecation.py @@ -11,9 +11,9 @@ def deprecated(alternative=None): def real_decorator(func): @functools.wraps(func) def new_func(*args, **kwargs): - msg = "Call to deprecated function {}.".format(func.__name__) + msg = "Call to deprecated function {0}.".format(func.__name__) if alternative: - msg += " Use {} instead".format(alternative) + msg += " Use {0} instead".format(alternative) warnings.warn_explicit( msg, category=DeprecationWarning,
Fix deprecation decorator not working on <I>.
elastic_apm-agent-python
train
py
3b23d51b98f7eea2f2d9911de9285413cfa119d1
diff --git a/buildbot_travis/runner.py b/buildbot_travis/runner.py index <HASH>..<HASH> 100644 --- a/buildbot_travis/runner.py +++ b/buildbot_travis/runner.py @@ -9,10 +9,10 @@ import readline from subprocess import PIPE, STDOUT, Popen from threading import Lock +import urwid from twisted.internet import reactor from twisted.internet.threads import deferToThread -import urwid from buildbot_travis.steps.create_steps import SetupVirtualEnv from buildbot_travis.travisyml import TRAVIS_HOOKS, TravisYml @@ -255,7 +255,7 @@ def run(args): vecmd = ve.buildCommand() if not args.dryrun: rc, out = runner.run(vecmd) - _, path = runner.run("echo $PATH") + _, path = runner.run("echo -n $PATH") script += 'export PATH="{}/{}/bin:{}"'.format( runner.pwd, ve.sandboxname, path)
fix runner path not doing echo -n lead to \n in the end of the PATH, so the new PATH had wrong last entry (looking into '/bin\n')
buildbot_buildbot_travis
train
py
11ae11bfa5f9fcb903689805f8d35b4d62ab0c90
diff --git a/tests/functional/cli/test_cli_artifacts.py b/tests/functional/cli/test_cli_artifacts.py index <HASH>..<HASH> 100644 --- a/tests/functional/cli/test_cli_artifacts.py +++ b/tests/functional/cli/test_cli_artifacts.py @@ -1,12 +1,9 @@ import subprocess -import sys import textwrap import time from io import BytesIO from zipfile import is_zipfile -import pytest - content = textwrap.dedent( """\ test-artifact: @@ -23,11 +20,12 @@ data = { } [email protected](sys.version_info < (3, 8), reason="I am the walrus") def test_cli_artifacts(capsysbinary, gitlab_config, gitlab_runner, project): project.files.create(data) - while not (jobs := project.jobs.list(scope="success")): + jobs = None + while not jobs: + jobs = project.jobs.list(scope="success") time.sleep(0.5) job = project.jobs.get(jobs[0].id)
test(cli): replace assignment expression This is a feature added in <I>, removing it allows for the test to run with lower python versions.
python-gitlab_python-gitlab
train
py
2b3c890520f65c00c164d51c5478801a7c61e617
diff --git a/manager/controlapi/service.go b/manager/controlapi/service.go index <HASH>..<HASH> 100644 --- a/manager/controlapi/service.go +++ b/manager/controlapi/service.go @@ -502,7 +502,7 @@ func (s *Server) UpdateService(ctx context.Context, request *api.UpdateServiceRe } if !reflect.DeepEqual(requestSpecNetworks, specNetworks) { - return errNetworkUpdateNotSupported + return grpc.Errorf(codes.Unimplemented, errNetworkUpdateNotSupported.Error()) } // Check to see if all the secrets being added exist as objects @@ -516,11 +516,11 @@ func (s *Server) UpdateService(ctx context.Context, request *api.UpdateServiceRe // with service mode change (comparing current config with previous config). // proper way to change service mode is to delete and re-add. if reflect.TypeOf(service.Spec.Mode) != reflect.TypeOf(request.Spec.Mode) { - return errModeChangeNotAllowed + return grpc.Errorf(codes.Unimplemented, errModeChangeNotAllowed.Error()) } if service.Spec.Annotations.Name != request.Spec.Annotations.Name { - return errRenameNotSupported + return grpc.Errorf(codes.Unimplemented, errRenameNotSupported.Error()) } service.Meta.Version = *request.ServiceVersion
SwarmKit: updateService does not return proper gRPC errors for some errors. Also, no error is returned if a service cannot be found.
docker_swarmkit
train
go
63c48edb63c21e09e3f8ca43588d95c274ffa868
diff --git a/lib/gpgme.rb b/lib/gpgme.rb index <HASH>..<HASH> 100644 --- a/lib/gpgme.rb +++ b/lib/gpgme.rb @@ -1099,6 +1099,8 @@ keylist_mode=#{KEYLIST_MODE_NAMES[keylist_mode]}>" def get_key(fingerprint, secret = false) rkey = Array.new err = GPGME::gpgme_get_key(self, fingerprint, rkey, secret ? 1 : 0) + # if the key is not found, we get GPG_ERR_EOF + return nil if err == GPG_ERR_EOF exc = GPGME::error_to_exception(err) raise exc if exc rkey[0] @@ -1501,7 +1503,7 @@ validity=#{VALIDITY_NAMES[validity]}, signatures=#{signatures.inspect}>" "Signature made from revoked key #{from}" when GPGME::GPG_ERR_BAD_SIGNATURE "Bad signature from #{from}" - when GPGME::GPG_ERR_NO_ERROR + when GPGME::GPG_ERR_NO_PUBKEY "No public key for #{from}" end end
(GPGME::Signature#to_s): Detect "No public key error" correctly. (GPGME::Ctx#get_key): Return nil if no key is found. Patch from Hamish Downer. (Bug#<I>)
ueno_ruby-gpgme
train
rb
5f874ea8724894c2893ab4931ea24e983f10cede
diff --git a/CHANGES.rst b/CHANGES.rst index <HASH>..<HASH> 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -0.3 (unreleased) +0.3 (2017-10-28) ---------------- - Use long instead of int for x/y sizes and indices diff --git a/fast_histogram/__init__.py b/fast_histogram/__init__.py index <HASH>..<HASH> 100644 --- a/fast_histogram/__init__.py +++ b/fast_histogram/__init__.py @@ -1,3 +1,3 @@ from .histogram import * -__version__ = "0.3.dev0" +__version__ = "0.3" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ extensions = [Extension("fast_histogram._histogram_core", include_dirs=[np.get_include()])] setup(name='fast-histogram', - version='0.3.dev0', + version='0.3', description='Fast simple 1D and 2D histograms', long_description=open('README.rst').read(), install_requires=['numpy'],
Preparing release <I>
astrofrog_fast-histogram
train
rst,py,py
eeb864dec07f5aca9bbecd696104d4d677d61586
diff --git a/lib/pseudohiki/converter.rb b/lib/pseudohiki/converter.rb index <HASH>..<HASH> 100755 --- a/lib/pseudohiki/converter.rb +++ b/lib/pseudohiki/converter.rb @@ -350,7 +350,7 @@ instead of \"#{given_opt}\"." Encoding.default_internal = internal if internal and not internal.empty? end - def parse_command_line_options + def setup_command_line_options OptionParser.new("USAGE: #{File.basename($0)} [OPTION]... [FILE]... Convert texts written in a Hiki-like notation into another format.") do |opt| opt.version = PseudoHiki::VERSION @@ -459,7 +459,7 @@ inside (default: not specified)") do |template| end def set_options_from_command_line - opt = parse_command_line_options + opt = setup_command_line_options yield opt if block_given? opt.parse! check_argv
renamed OptionManager#parse_command_line_options #setup_command_line_options
nico-hn_PseudoHikiParser
train
rb
ad1e5242f205c16ede24fdaf7945613629f9ffa5
diff --git a/mirror_maker.go b/mirror_maker.go index <HASH>..<HASH> 100644 --- a/mirror_maker.go +++ b/mirror_maker.go @@ -28,10 +28,10 @@ var TimingField = &avro.SchemaField{ Default: "null", Type: &avro.UnionSchema{ Types: []avro.Schema{ + &avro.NullSchema{}, &avro.ArraySchema{ Items: &avro.LongSchema{}, }, - &avro.NullSchema{}, }, }, }
re #<I> attempt to fix schema
elodina_go_kafka_client
train
go
0176c2aea6ef2d47d227a6467bcb9d20d35b8380
diff --git a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php +++ b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php @@ -699,11 +699,13 @@ class UnitOfWork implements PropertyChangedListener } elseif ($value instanceof PersistentCollection) { $value = $value->unwrap(); } + $count = 0; foreach ($value as $key => $entry) { $targetClass = $this->dm->getClassMetadata(get_class($entry)); $state = $this->getDocumentState($entry, self::STATE_NEW); $oid = spl_object_hash($entry); - $path = $mapping['type'] === 'many' ? $mapping['name'].'.'.$key : $mapping['name']; + $path = $mapping['type'] === 'many' ? $mapping['name'].'.'.$count : $mapping['name']; + $count++; if ($state == self::STATE_NEW) { if ( ! $targetClass->isEmbeddedDocument && ! $mapping['isCascadePersist']) { throw new \InvalidArgumentException("A new document was found through a relationship that was not"
Need to use a $count instead of $key since removing an element can change the array keys which results in bad mongodb queries.
doctrine_mongodb-odm
train
php
77f38a09f4f565ffd6a239f0977fb959cd591216
diff --git a/lib/neo4j/mixins/node_mixin.rb b/lib/neo4j/mixins/node_mixin.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j/mixins/node_mixin.rb +++ b/lib/neo4j/mixins/node_mixin.rb @@ -98,6 +98,7 @@ module Neo4j def init_without_node(props) # :nodoc: props[:_classname] = self.class.to_s @_java_node = Neo4j.create_node props + update_index if props && !props.empty? @_java_node._wrapper = self Neo4j.event_handler.node_created(self) end
fixing indexing in initializatoin, [#<I> state:resolved]
neo4jrb_neo4j
train
rb
bf03ed1fb1aa70573676872d9088e2c6b7d7f229
diff --git a/lib/chef/provider/group/solaris.rb b/lib/chef/provider/group/solaris.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/group/solaris.rb +++ b/lib/chef/provider/group/solaris.rb @@ -23,7 +23,7 @@ class Chef class Group class Solaris < Chef::Provider::Group::Groupadd - provides :group, os: "solaris2" + provides :group, platform: "solaris2" def load_current_resource super diff --git a/lib/chef/provider/group/usermod.rb b/lib/chef/provider/group/usermod.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/group/usermod.rb +++ b/lib/chef/provider/group/usermod.rb @@ -76,7 +76,7 @@ class Chef def append_flags case node[:platform] - when "openbsd", "netbsd", "aix", "solaris2", "smartos", "omnios" + when "openbsd", "netbsd", "aix", "smartos", "omnios" "-G" when "solaris" [ "-a", "-G" ]
Change the provides lines to reflect the new setup.
chef_chef
train
rb,rb
9362aff90388189e45082ae909a42253fca8bc66
diff --git a/collatex/src/test/java/eu/interedition/collatex2/alignmenttable/TranspositionAlignmentTest.java b/collatex/src/test/java/eu/interedition/collatex2/alignmenttable/TranspositionAlignmentTest.java index <HASH>..<HASH> 100644 --- a/collatex/src/test/java/eu/interedition/collatex2/alignmenttable/TranspositionAlignmentTest.java +++ b/collatex/src/test/java/eu/interedition/collatex2/alignmenttable/TranspositionAlignmentTest.java @@ -1,6 +1,7 @@ package eu.interedition.collatex2.alignmenttable; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import eu.interedition.collatex2.implementation.CollateXEngine; @@ -16,6 +17,7 @@ public class TranspositionAlignmentTest { Assert.assertEquals("A: | |y| \n" + "B: x| |y|z\n" + "C: |z|y| \n", engine.align(a, b, c).toString()); } + @Ignore @Test public void transposeInTwoPairs() { CollateXEngine engine = new CollateXEngine();
ignore failing test for alignment of transpositions
interedition_collatex
train
java
65ff2db6e173a1b9aa9c12fab8d5308bab0e75ae
diff --git a/code/filter/cmd.php b/code/filter/cmd.php index <HASH>..<HASH> 100644 --- a/code/filter/cmd.php +++ b/code/filter/cmd.php @@ -10,7 +10,7 @@ /** * Command Filter * - * A 'command' is a string containing only the characters [A-Za-z0-9.-_]. Used for names of views, controllers, etc + * A 'command' is a string containing only the characters [A-Za-z0-9.,-_]. * * @author Johan Janssens <https://github.com/johanjanssens> * @package Koowa\Library\Filter @@ -26,7 +26,7 @@ class KFilterCmd extends KFilterAbstract implements KFilterTraversable public function validate($value) { $value = trim($value); - $pattern = '/^[A-Za-z0-9.\-_]*$/'; + $pattern = '/^[A-Za-z0-9.,\-_]*$/'; return (is_string($value) && (preg_match($pattern, $value)) == 1); }
re #<I> : Add ',' to the regex for the cmd filter.
timble_kodekit
train
php
609372e24bd149fabf561163d7fcd7a2e5dbfeff
diff --git a/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBProviderFactory.java b/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBProviderFactory.java index <HASH>..<HASH> 100644 --- a/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBProviderFactory.java +++ b/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBProviderFactory.java @@ -67,7 +67,7 @@ public class DBProviderFactory extends DataProviderFactory { if (transactionManager != null) { try { final int status = transactionManager.getStatus(); - if (status != Status.STATUS_ROLLING_BACK && status != Status.STATUS_ROLLEDBACK && status != Status.STATUS_NO_TRANSACTION) { + if (status != Status.STATUS_NO_TRANSACTION) { transactionManager.rollback(); } } catch (SystemException e) {
Fixed some missed rollback functions from BZ#<I>.
pressgang-ccms_PressGangCCMSDatasourceProviders
train
java
efc17851c52c0b980334d500af15b2f7c910190f
diff --git a/guacamole/src/main/webapp/app/settings/types/ActiveConnectionWrapper.js b/guacamole/src/main/webapp/app/settings/types/ActiveConnectionWrapper.js index <HASH>..<HASH> 100644 --- a/guacamole/src/main/webapp/app/settings/types/ActiveConnectionWrapper.js +++ b/guacamole/src/main/webapp/app/settings/types/ActiveConnectionWrapper.js @@ -38,7 +38,7 @@ angular.module('settings').factory('ActiveConnectionWrapper', [ var ActiveConnectionWrapper = function ActiveConnectionWrapper(template) { /** - * The identifier of the data source associate dwith the + * The identifier of the data source associated with the * ActiveConnection wrapped by this ActiveConnectionWrapper. * * @type String
GUAC-<I>: Associate dwith -> associated with.
glyptodon_guacamole-client
train
js
105b98b97837fdf417555f38a3b1a2d927bbd252
diff --git a/slave/buildslave/null.py b/slave/buildslave/null.py index <HASH>..<HASH> 100644 --- a/slave/buildslave/null.py +++ b/slave/buildslave/null.py @@ -22,7 +22,8 @@ class LocalBuildSlave(BuildSlaveBase): @defer.inlineCallbacks def startService(self): # importing here to avoid dependency on buildbot master package - from buildbot.buildslave.protocols.null import Connection + # requires buildot version >= 0.9.0b5 + from buildbot.worker.protocols.null import Connection yield BuildSlaveBase.startService(self) # TODO: This is a workaround for using worker with "slave"-api with
use renamed module in slave it's ok, since protocols.null module was introduced in nine branch
buildbot_buildbot
train
py
859e251f1b5087bcc49b25ca6a1a5428649459ac
diff --git a/master/buildbot/process/metrics.py b/master/buildbot/process/metrics.py index <HASH>..<HASH> 100644 --- a/master/buildbot/process/metrics.py +++ b/master/buildbot/process/metrics.py @@ -326,7 +326,7 @@ class AttachedWorkersWatcher: def _get_rss(): - if sys.platform == 'linux2': + if sys.platform == 'linux': try: with open("/proc/%i/statm" % os.getpid()) as f: return int(f.read().split()[1]) diff --git a/master/buildbot/test/unit/test_process_metrics.py b/master/buildbot/test/unit/test_process_metrics.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/unit/test_process_metrics.py +++ b/master/buildbot/test/unit/test_process_metrics.py @@ -169,8 +169,8 @@ class TestPeriodicChecks(TestMetricBase): def testGetRSS(self): self.assertTrue(metrics._get_rss() > 0) - if sys.platform != 'linux2': - testGetRSS.skip = "only available on linux2 platforms" + if sys.platform != 'linux': + testGetRSS.skip = "only available on linux platforms" class TestReconfig(TestMetricBase):
Enable an incorrectly skipped test Since Python <I>, sys.platform is 'linux' on Linux [1], so TestPeriodicChecks.testGetRSS is skipped even on Linux. [1] <URL>
buildbot_buildbot
train
py,py
3eeaaeb79a78c42e1aafcab5dc27e5d6f5fee10b
diff --git a/src/ORM/Table.php b/src/ORM/Table.php index <HASH>..<HASH> 100644 --- a/src/ORM/Table.php +++ b/src/ORM/Table.php @@ -2206,7 +2206,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc * * ``` * $article = $this->Articles->patchEntity($article, $this->request->data(), [ - * 'fieldList' => ['title', 'body', 'tags', 'comments], + * 'fieldList' => ['title', 'body', 'tags', 'comments'], * 'associated' => ['Tags', 'Comments.Users' => ['fieldList' => 'username']] * ] * );
Add closing ' mark This stops the code colouration going weird on <URL>
cakephp_cakephp
train
php
ed62ea2bdae8f767ef9031fa43d17f3ac6ad093d
diff --git a/ripe/atlas/sagan/version.py b/ripe/atlas/sagan/version.py index <HASH>..<HASH> 100644 --- a/ripe/atlas/sagan/version.py +++ b/ripe/atlas/sagan/version.py @@ -1,2 +1,2 @@ -__version__ = "0.7.1" +__version__ = "0.8.0"
Update version.py Updated the version number for Iñigo's changes.
RIPE-NCC_ripe.atlas.sagan
train
py
b5f8ba4817a8a44d16e55ce667c69dce2e8ef145
diff --git a/src/api/ledger/pathfind.js b/src/api/ledger/pathfind.js index <HASH>..<HASH> 100644 --- a/src/api/ledger/pathfind.js +++ b/src/api/ledger/pathfind.js @@ -84,7 +84,8 @@ function formatResponse(pathfind, paths) { const address = pathfind.source.address; return parsePathfind(address, pathfind.destination.amount, paths); } - if (!_.includes(paths.destination_currencies, + if (paths.destination_currencies !== undefined && + !_.includes(paths.destination_currencies, pathfind.destination.amount.currency)) { throw new NotFoundError('No paths found. ' + 'The destination_account does not accept ' +
Fix: Check for destination_currencies property Example stack: TypeError: Cannot read property 'join' of undefined at formatResponse (ripple-lib/dist/npm/api/ledger/pathfind.js:<I>:<I>)
ChainSQL_chainsql-lib
train
js
74f18e92bfe373dd38d77c8c20b0d5b53e2fe9d2
diff --git a/src/Tasks.php b/src/Tasks.php index <HASH>..<HASH> 100644 --- a/src/Tasks.php +++ b/src/Tasks.php @@ -958,7 +958,7 @@ chmod 755 ' . $default_dir . '/settings.php'; $this->say('If you need the very latest data from a Pantheon site, go create a new backup using either the Pantheon backend, or Terminus.'); $which_database = $this->askDefault( - 'Which database backup should we load (i.e. local/dev/live)?', $default_database + 'Which database backup should we load (i.e. local/develop/multidev/live)?', $default_database ); $getDB = TRUE;
Change messaging in Robo prompt for DB backup to use.
thinkshout_robo-drupal
train
php
450931bbfa9158b31d8e672cf70810bdb731b3fd
diff --git a/lib/autowow/cli.rb b/lib/autowow/cli.rb index <HASH>..<HASH> 100644 --- a/lib/autowow/cli.rb +++ b/lib/autowow/cli.rb @@ -5,7 +5,7 @@ require_relative 'vcs' module Autowow class CLI < Thor - # map %w(bm) => :branch_merged + map %w(bm) => :branch_merged desc "branch_merged", "clean working branch and return to master" def branch_merged(working_dir = '.')
Adds short command `bm` for branch_merged
thisismydesign_autowow
train
rb
cfbbe1ff9cda380a7f7b398d353390685675ad1d
diff --git a/PPI/Test/Bootstrap.php b/PPI/Test/Bootstrap.php index <HASH>..<HASH> 100644 --- a/PPI/Test/Bootstrap.php +++ b/PPI/Test/Bootstrap.php @@ -8,7 +8,7 @@ */ namespace PPI\Test; -require_once(__DIR__ . '/../AutoLoad.php'); +require_once(__DIR__ . '/../Autoload.php'); require_once(__DIR__ . '/AutoLoad.php'); \PPI\Autoload::config(array(
Fix typo in autoloader Mac's aren't case sensitive but linux is! :D
ppi_framework
train
php
70d43bb93f24e5fc507ee2802c6f9dbb5feb9463
diff --git a/test/analytics.js b/test/analytics.js index <HASH>..<HASH> 100644 --- a/test/analytics.js +++ b/test/analytics.js @@ -852,6 +852,22 @@ describe('Analytics.js', function () { expect(spy.called).to.be(true); spy.restore(); }); + + it('sends a url along', function () { + var spy = sinon.spy(Provider.prototype, 'track'); + analytics.track(test.url); + expect(spy.calledWith(test.url)).to.be(true); + spy.restore(); + }); + + it('sends a clone of context along', function () { + var spy = sinon.spy(Provider.prototype, 'track'); + analytics.track(test.url,test.context); + expect(spy.args[0][1]).not.to.equal(test.context); + expect(spy.args[0][1]).to.eql(test.context); + spy.restore(); + }); + });
#<I> Added tests to pageview api for allowing context
segmentio_analytics.js-core
train
js
985a2eb10261a8a80fa07531492c2dd8e486fc6b
diff --git a/src/Services/Issues.php b/src/Services/Issues.php index <HASH>..<HASH> 100644 --- a/src/Services/Issues.php +++ b/src/Services/Issues.php @@ -3,6 +3,7 @@ namespace TZK\Taiga\Services; +use TZK\Taiga\RestClient; use TZK\Taiga\Service; class Issues extends Service { @@ -13,11 +14,11 @@ class Issues extends Service { * * @param RestClient $root */ - public function __construct($root) { + public function __construct(RestClient $root) { parent::__construct($root, 'issues'); } - public function getAll(array $param = []) { + public function getList(array $param = []) { return $this->get(null, $param); }
Renaming getAll method to getList Aim is to remain coherent with the rest of the services
TZK-_TaigaPHP
train
php
193c166cf3921e5560153549fd21a51cb2c3570c
diff --git a/app/routes/annotations.rb b/app/routes/annotations.rb index <HASH>..<HASH> 100644 --- a/app/routes/annotations.rb +++ b/app/routes/annotations.rb @@ -20,17 +20,22 @@ module OpenBEL status 200 end + options '/api/annotations/values' do + response.headers['Allow'] = 'OPTIONS,GET' + status 200 + end + options '/api/annotations/:annotation' do response.headers['Allow'] = 'OPTIONS,GET' status 200 end - options '/api/annotations/values/match-results/:match' do + options '/api/annotations/:annotation/values' do response.headers['Allow'] = 'OPTIONS,GET' status 200 end - options '/api/annotations/:annotation/values/match-results/:match' do + options '/api/annotations/:annotation/values/:value' do response.headers['Allow'] = 'OPTIONS,GET' status 200 end
corrected options routes; refs #<I>
OpenBEL_openbel-api
train
rb
8702cc4e35bcd0af07dcf0bd5ca4d1329e46bb6c
diff --git a/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java b/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java index <HASH>..<HASH> 100644 --- a/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java +++ b/algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java @@ -635,4 +635,10 @@ public class IndexTest extends PowerMockTestCase { index.search(query); verify(mockClient, times(nbTimes)).postRequestRaw(anyString(), anyString(), anyBoolean()); } + + @Test + public void testNullCompletionHandler() throws Exception { + // Check that the code does not crash when no completion handler is specified. + index.addObjectAsync(new JSONObject("{\"city\": \"New York\"}"), null); + } }
Add test case with null completion handler
algolia_algoliasearch-client-android
train
java
eb79ad4dab445f76ee7bf93288863a4e172bb93d
diff --git a/npm/cli.js b/npm/cli.js index <HASH>..<HASH> 100755 --- a/npm/cli.js +++ b/npm/cli.js @@ -8,3 +8,14 @@ var child = proc.spawn(electron, process.argv.slice(2), {stdio: 'inherit'}) child.on('close', function (code) { process.exit(code) }) + +const handleTerminationSignal = function (signal) { + process.on(signal, function signalHandler () { + if (!child.killed) { + child.kill(signal) + } + }) +} + +handleTerminationSignal('SIGINT') +handleTerminationSignal('SIGTERM')
fix: handle SIGINT and SIGTERM from the Electron CLI helper (#<I>) Fixes #<I>
electron_electron
train
js
dd9bb710a770e4d1d8ad5bc8edefbd56d1f7600d
diff --git a/mode/vbscript/vbscript.js b/mode/vbscript/vbscript.js index <HASH>..<HASH> 100644 --- a/mode/vbscript/vbscript.js +++ b/mode/vbscript/vbscript.js @@ -1,5 +1,5 @@ CodeMirror.defineMode("vbscript", function() { - var regexVBScriptKeyword = /Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab/im; + var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im; return { token: function(stream) {
[vbscript mode] Add start/end anchors to keyword regexp Issue #<I>
codemirror_CodeMirror
train
js
e54b34e95cce425ff72aee457589ac836d9323e0
diff --git a/webmap/models.py b/webmap/models.py index <HASH>..<HASH> 100644 --- a/webmap/models.py +++ b/webmap/models.py @@ -113,7 +113,7 @@ class Poi(models.Model): # Relationships marker = models.ForeignKey(Marker, limit_choices_to={'status__show_to_mapper': 'True', 'layer__status__show_to_mapper': 'True'}, verbose_name=_(u"marker"), help_text=_("Select icon, that will be shown in map"), related_name="pois") status = models.ForeignKey(Status, default=config.DEFAULT_STATUS_ID, help_text=_("POI status, determinse if it will be shown in map"), verbose_name=_(u"status")) - properties = models.ManyToManyField('Property', blank=True, null=True, help_text=_("POI properties"), verbose_name=_("properties")) + properties = models.ManyToManyField('Property', blank=True, null=True, help_text=_("POI properties"), verbose_name=_("properties"), limit_choices_to={'status__show_to_mapper': 'True'}) importance = models.SmallIntegerField(default=0, verbose_name=_(u"importance"), help_text=_(u"""Minimal zoom modificator (use 20+ to show always).<br/>"""))
models: limit property choices for POI
auto-mat_django-webmap-corpus
train
py