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
dbb3054690344ad7fef762de668818849f59e9d5
diff --git a/realtime/make_map.py b/realtime/make_map.py index <HASH>..<HASH> 100644 --- a/realtime/make_map.py +++ b/realtime/make_map.py @@ -58,7 +58,7 @@ def processEvent(theEventId=None, theLocale='en'): myShakeEvent = ShakeEvent(theEventId=theEventId, theLocale=theLocale, theForceFlag=myForceFlag) - except BadZipfile, URLError: + except (BadZipfile, URLError): # retry with force flag true if os.path.exists(myPopulationPath): myShakeEvent = ShakeEvent(theEventId=theEventId,
Knocked out 3 lints with one stone
inasafe_inasafe
train
py
f82c051fc020ed3951e43e62120c4023096cf3d8
diff --git a/snap7/client.py b/snap7/client.py index <HASH>..<HASH> 100755 --- a/snap7/client.py +++ b/snap7/client.py @@ -189,7 +189,7 @@ class Client(object): block_num, byref(_buffer), byref(size)) check_error(result, context="client") - return bytearray(_buffer), size.value + return bytearray(_buffer)[:size.value], size.value def upload(self, block_num): """ @@ -607,7 +607,7 @@ class Client(object): second = buffer[0] ) - @error_wrap + @error_wrap def set_plc_datetime(self, dt): """ Set date and time in PLC
Update client.full_upload() (#<I>) * Add get/set date & time New function: set_plc_datetime get_plc_datetime * Add get_plc_datetime and set_plc_datetime * full_upload1 * full_upload1 Before change following code would have failed: data, size = client.full_upload("FC", 1) client.download(data=data, block_num=1)
gijzelaerr_python-snap7
train
py
29c3f1481d34ff89462c2821442d35b94516d7e1
diff --git a/index.es.js b/index.es.js index <HASH>..<HASH> 100644 --- a/index.es.js +++ b/index.es.js @@ -1,4 +1,4 @@ -import { writeFile } from 'fs' +import { existsSync, mkdirSync, writeFile } from 'fs' import { dirname } from 'path' import { createFilter } from 'rollup-pluginutils' import { renderSync } from 'node-sass' @@ -71,6 +71,9 @@ export default function css(options = {}) { dest = dest + '.css' } + // Ensure the parent folders of dest exist (create the missing ones) + ensureParentDirsSync(dirname(dest)); + // Emit styles to file writeFile(dest, css, (err) => { if (err) { @@ -93,3 +96,18 @@ function getSize (bytes) { ? (bytes / 1024).toPrecision(3) + ' kB' : (bytes / 1024 / 1024).toPrecision(4) + ' MB' } + +function ensureParentDirsSync (dir) { + if (existsSync(dir)) { + return; + } + + try { + mkdirSync(dir); + } catch (err) { + if (err.code === 'ENOENT') { + ensureParentDirsSync(dirname(dir)); + ensureParentDirsSync(dir); + } + } +}
Modify output option to generate missing parent folders in path `output` option only accept an existent path to save the CSS bundle. With this edit, we can specify a partial existent path. The missing folders will be created when needed.
thgh_rollup-plugin-scss
train
js
51d4b852980d804c0a3e89c016703da4b195a518
diff --git a/src/webroot/cms/content-manager/sitemap/modules/plugin-page-edit.js b/src/webroot/cms/content-manager/sitemap/modules/plugin-page-edit.js index <HASH>..<HASH> 100644 --- a/src/webroot/cms/content-manager/sitemap/modules/plugin-page-edit.js +++ b/src/webroot/cms/content-manager/sitemap/modules/plugin-page-edit.js @@ -271,7 +271,7 @@ YUI().add('website.sitemap-plugin-page-edit', function (Y) { Manager.Page.updatePage(post_data, function (response, success) { if (success) { //Update data - data[id] = value; + Supra.mix(data, response); } else { //Revert changes if (this._nodeDataMapping[id]) {
#<I> Path rename from cms in sitemap
sitesupra_sitesupra
train
js
8439263d6ff66e659a8051d3efc0475020048629
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,9 +8,9 @@ from distutils.core import setup from codecs import open setup(name='Open-Tamil', - version='0.2.4', + version='0.2.8', description='Tamil language text processing tools', - author='Muthiah Annamalai', + author='M. Annamalai, T. Arulalan,', author_email='[email protected]', url='https://github.com/arcturusannamalai/open-tamil', packages=['tamil','transliterate','ngram'], @@ -20,3 +20,4 @@ setup(name='Open-Tamil', long_description=open('README.md','r','UTF-8').read(), download_url='https://github.com/arcturusannamalai/open-tamil/archive/latest.zip',#pip ) +
update v.# make tag and set to release
Ezhil-Language-Foundation_open-tamil
train
py
0bc531b8860fdd84518b540c227de96dc77852a2
diff --git a/p2p/net/swarm/swarm_transport.go b/p2p/net/swarm/swarm_transport.go index <HASH>..<HASH> 100644 --- a/p2p/net/swarm/swarm_transport.go +++ b/p2p/net/swarm/swarm_transport.go @@ -18,6 +18,11 @@ func (s *Swarm) TransportForDialing(a ma.Multiaddr) transport.Transport { s.transports.RLock() defer s.transports.RUnlock() + if len(s.transports.m) == 0 { + log.Error("you have no transports configured") + return nil + } + for _, p := range protocols { transport, ok := s.transports.m[p.Code] if !ok { @@ -41,6 +46,11 @@ func (s *Swarm) TransportForListening(a ma.Multiaddr) transport.Transport { s.transports.RLock() defer s.transports.RUnlock() + if len(s.transports.m) == 0 { + log.Error("you have no transports configured") + return nil + } + selected := s.transports.m[protocols[len(protocols)-1].Code] for _, p := range protocols { transport, ok := s.transports.m[p.Code]
log an error when we have no transports configured Modify our two transport lookup functions to log loudly when there are no transports registered.
libp2p_go-libp2p
train
go
517313e4f71974359222b28ff97afed8b54e75c1
diff --git a/src/main/java/org/openqa/selenium/WebDriver.java b/src/main/java/org/openqa/selenium/WebDriver.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/openqa/selenium/WebDriver.java +++ b/src/main/java/org/openqa/selenium/WebDriver.java @@ -238,7 +238,6 @@ public interface WebDriver extends SearchContext { /** * @return the interface for managing the current window. */ - @Beta Window window(); /** @@ -508,5 +507,10 @@ public interface WebDriver extends SearchContext { * Maximizes the current window if it is not already maximized */ void maximize(); + + /** + * Fullscreen the current window if it is not already fullscreen + */ + void fullscreen(); } }
adding selenium server pass throughs for W3C dialect of alert / window / cookie commands. changing how W3C dialect is detected by checking if 'status' is sent in the new session response switch to window in w3c passes in 'handle' variable instead of 'name' Fixes #<I> Fixes #<I> Fixes #<I> Fixes #<I> Fixes #<I>
appium_java-client
train
java
cff5f40435cb092474d2136571cd8984d51d5456
diff --git a/appveyor.yml b/appveyor.yml index <HASH>..<HASH> 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ -version: 3.0.0.{build} +version: 3.0.1.{build} environment: PYPIPA: diff --git a/hydpy/docs/sphinx/conf.py b/hydpy/docs/sphinx/conf.py index <HASH>..<HASH> 100644 --- a/hydpy/docs/sphinx/conf.py +++ b/hydpy/docs/sphinx/conf.py @@ -79,9 +79,9 @@ copyright = u'2018, Christoph Tyralla' # built documents. # # The short X.Y version. -version = '3.0.0' +version = '3.0.1' # The full version, including alpha/beta/rc tags. -release = '3.0.0' +release = '3.0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -147,7 +147,7 @@ with open("README.rst", "r") as readmefile: # The usual setup definitions. setup(name='HydPy', - version='3.0.0', + version='3.0.1', description='A framework for the development and application of ' 'hydrological models.', long_description=long_description,
Go to version <I> for fixing application model `hstream_v1`.
hydpy-dev_hydpy
train
yml,py,py
7e738bc7ba57d833aa705d338aaf7f084f2a0377
diff --git a/xcs/bitstrings.py b/xcs/bitstrings.py index <HASH>..<HASH> 100644 --- a/xcs/bitstrings.py +++ b/xcs/bitstrings.py @@ -282,7 +282,7 @@ class BitCondition: if not isinstance(bits, BitString): bits = BitString(bits) if not isinstance(mask, BitString): - bits = BitString(mask) + mask = BitString(mask) hash_value = None assert len(bits) == len(mask)
Bugfix - BitCondition initialization Fixed a bug in BitCondition.__init__ that caused the bits to be initialized from the mask in some cases.
hosford42_xcs
train
py
ed476be4ad59b81c201016ea71815544bb0b3088
diff --git a/python/ray/tune/examples/zoopt_example.py b/python/ray/tune/examples/zoopt_example.py index <HASH>..<HASH> 100644 --- a/python/ray/tune/examples/zoopt_example.py +++ b/python/ray/tune/examples/zoopt_example.py @@ -42,7 +42,7 @@ if __name__ == "__main__": # for continuous dimensions: (continuous, search_range, precision) "height": (ValueType.CONTINUOUS, [-10, 10], 1e-2), # for discrete dimensions: (discrete, search_range, has_order) - "width": (ValueType.DISCRETE, [-10, 10], False) + "width": (ValueType.DISCRETE, [0, 10], False) } config = {
quickfix (#<I>)
ray-project_ray
train
py
f060662c4245cdf7a7a5e17e27be802f5cf93747
diff --git a/core/core_test.go b/core/core_test.go index <HASH>..<HASH> 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -20,12 +20,9 @@ func launchSwarm(nodeCount int, t *testing.T) []*server { var wg sync.WaitGroup wg.Add(nodeCount) + var peers []string for i := 0; i < nodeCount; i++ { port := port + i - var peers []string - if i > 0 { - peers = append(peers, fmt.Sprintf("localhost:%d", nodes[i-1].network.Port)) - } s, err := newServer(port, peers, diskAllocated) if err != nil { t.Error(err) @@ -36,6 +33,7 @@ func launchSwarm(nodeCount int, t *testing.T) []*server { t.Log(err) } }() + peers = append(peers, fmt.Sprintf("localhost:%d", s.network.Port)) nodes = append(nodes, s) time.Sleep(20 * time.Millisecond) }
Hopefully fixed core network connection tests when running on non externally routable box
degdb_degdb
train
go
86cc31f52992fb9d11f92de6fd5496842fea2265
diff --git a/tornado/httputil.py b/tornado/httputil.py index <HASH>..<HASH> 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -603,6 +603,8 @@ def url_concat(url, args): >>> url_concat("http://example.com/foo?a=b", [("c", "d"), ("c", "d2")]) 'http://example.com/foo?a=b&c=d&c=d2' """ + if args is None: + return url parsed_url = urlparse(url) if isinstance(args, dict): parsed_query = parse_qsl(parsed_url.query, keep_blank_values=True) diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index <HASH>..<HASH> 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -66,6 +66,13 @@ class TestUrlConcat(unittest.TestCase): ) self.assertEqual(url, "https://localhost/path?r=1&t=2") + def test_url_concat_none_params(self): + url = url_concat( + "https://localhost/path?r=1&t=2", + None, + ) + self.assertEqual(url, "https://localhost/path?r=1&t=2") + def test_url_concat_with_frag(self): url = url_concat( "https://localhost/path#tab",
fix backwards compatibility of url_concat for args=None
tornadoweb_tornado
train
py,py
2d0ba1d33d38ada48d8e359712014db7351be705
diff --git a/es2015/controls/folder/folder.js b/es2015/controls/folder/folder.js index <HASH>..<HASH> 100644 --- a/es2015/controls/folder/folder.js +++ b/es2015/controls/folder/folder.js @@ -51,7 +51,8 @@ class Folder extends Component { Folder.defaultProps = { label: 'Folder', - onChange: a=>a + onChange: a=>a, + open: false }
explicitly declared folders as closed by default
wearekuva_oui
train
js
324dcc36e25e2708d1d6150131983bc0920681d2
diff --git a/lib/open.js b/lib/open.js index <HASH>..<HASH> 100644 --- a/lib/open.js +++ b/lib/open.js @@ -35,7 +35,9 @@ function makeArguments(filename, settings) { function open(detect, filename, settings) { return detect.then(function(cmd) { return new Promise(function(resolve, reject) { - child_process.exec(cmd + ' ' + makeArguments(filename, settings), function(err) { + cmd = quote(cmd) + ' ' + makeArguments(filename, settings) + + child_process.exec(cmd, function(err) { if (err) { reject(err); } else {
fix open to launch paths with spaces correctly
lahmatiy_open-in-editor
train
js
6f5dcb198f3bb236bb133b07ef626df5e374ff51
diff --git a/jishaku/codeblocks.py b/jishaku/codeblocks.py index <HASH>..<HASH> 100644 --- a/jishaku/codeblocks.py +++ b/jishaku/codeblocks.py @@ -20,7 +20,7 @@ __all__ = ('Codeblock', 'CODEBLOCK_REGEX', 'CodeblockConverter') Codeblock = namedtuple('Codeblock', 'language content') -CODEBLOCK_REGEX = re.compile("^(?:```([A-Za-z0-9\\-\\.]*)\n)?(.+?)(?:\n+```)?$", re.S) +CODEBLOCK_REGEX = re.compile("^(?:```([A-Za-z0-9\\-\\.]*)\n)?(.+?)(?:```)?$", re.S) class CodeblockConverter(commands.Converter): # pylint: disable=too-few-public-methods
Discord accepts non-delimited codeblocks
Gorialis_jishaku
train
py
97a779747e4cf51b356634617b2c049f2b364e4b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,9 +5,6 @@ https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ -import ez_setup -ez_setup.use_setuptools() - # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding @@ -112,4 +109,4 @@ setup( # 'sample=sample:main', # ], #}, -) \ No newline at end of file +)
Dont use ez_setup, just setuptools
aarongarrett_inspyred
train
py
817ec510c709232433ee9b32ae2a22d2d03783db
diff --git a/pre_commit/jsonschema_extensions.py b/pre_commit/jsonschema_extensions.py index <HASH>..<HASH> 100644 --- a/pre_commit/jsonschema_extensions.py +++ b/pre_commit/jsonschema_extensions.py @@ -16,7 +16,9 @@ def extend_with_default(validator_class): for property, subschema in properties.iteritems(): if "default" in subschema: - instance.setdefault(property, subschema["default"]) + instance.setdefault( + property, copy.deepcopy(subschema["default"]), + ) return jsonschema.validators.extend( validator_class, {"properties" : set_defaults}, diff --git a/tests/jsonschema_extensions_test.py b/tests/jsonschema_extensions_test.py index <HASH>..<HASH> 100644 --- a/tests/jsonschema_extensions_test.py +++ b/tests/jsonschema_extensions_test.py @@ -49,3 +49,10 @@ def test_apply_defaults_deep(): }, ) assert ret == {'foo': {'bar': {'baz': 'herp'}}} + + +def test_apply_defaults_copies(): + schema = {'properties': {'foo': {'default': []}}} + ret1 = apply_defaults({}, schema) + ret2 = apply_defaults({}, schema) + assert ret1['foo'] is not ret2['foo']
Deepcopy defaults to prevent weird references in yaml.
pre-commit_pre-commit
train
py,py
4cdaae93b2f5852764d9ec0da67736f0f59c43c8
diff --git a/src/FilenameParsing/FileIDHelperResolutionStrategy.php b/src/FilenameParsing/FileIDHelperResolutionStrategy.php index <HASH>..<HASH> 100644 --- a/src/FilenameParsing/FileIDHelperResolutionStrategy.php +++ b/src/FilenameParsing/FileIDHelperResolutionStrategy.php @@ -322,7 +322,7 @@ class FileIDHelperResolutionStrategy implements FileResolutionStrategy $possibleVariants = $filesystem->listContents($folder, true); foreach ($possibleVariants as $possibleVariant) { if ($possibleVariant['type'] !== 'dir' && $helper->isVariantOf($possibleVariant['path'], $parsedFileID)) { - yield $helper->parseFileID($possibleVariant['path']); + yield $helper->parseFileID($possibleVariant['path'])->setHash($parsedFileID->getHash()); } } }
BUG Explicitely set hash when returning variant parsed ID
silverstripe_silverstripe-assets
train
php
b28826715c69eb6033fe61a039e9611d34ab7030
diff --git a/lib/actions/FunctionDeploy.js b/lib/actions/FunctionDeploy.js index <HASH>..<HASH> 100644 --- a/lib/actions/FunctionDeploy.js +++ b/lib/actions/FunctionDeploy.js @@ -314,7 +314,7 @@ module.exports = function(SPlugin, serverlessPath) { return _this.S.actions.codePackageLambdaNodejs(evtClone) .bind(_this) .then(_this.S.actions.codeDeployLambdaNodejs) - //.then(_this.S.actions.createEventSourceLambdaNodejs) + .then(_this.S.actions.codeEventDeployLambda) .then(function(evtCloneProcessed) { // Add Function and Region evt.deployed[region].push(evtCloneProcessed.function);
functionDeploy now correctly references the new events action
serverless_serverless
train
js
39f9c28bca89d53071bcd2f052566417bebde2ca
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -50,12 +50,17 @@ module.exports = (apiUrl, apiKey, options = {}) => { } async function get (endpoint, queryParams = {}) { - return canvasGot({ - url: endpoint, - baseUrl: apiUrl, - method: 'GET', - query: queryString.stringify(queryParams, { arrayFormat: 'bracket' }) - }) + try { + const result = await canvasGot({ + url: endpoint, + baseUrl: apiUrl, + method: 'GET', + query: queryString.stringify(queryParams, { arrayFormat: 'bracket' }) + }) + return result + } catch (err) { + throw removeToken(err) + } } async function * list (endpoint, queryParams = {}) {
Remove tokens from errors thrown by "get()"
KTH_canvas-api
train
js
46892ff3d299350ad39f7290df97ec07947426ca
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -4880,6 +4880,7 @@ if ( $this->_parent->is_registered() && ! $this->is_registered() && + $this->has_free_plan() && /** * If not registered for add-on and the following conditions for the add-on are met, activate add-on account. * * Network active and in network admin - network activate add-on account.
[add-ons] [opt-in] Only auto opt-in add-ons with an opted-in parent that have a free plan. If it's a premium only product then do not auto opt-in.
Freemius_wordpress-sdk
train
php
9662d934134d0d131ccc161e6b7283e7075fb781
diff --git a/gotenv.go b/gotenv.go index <HASH>..<HASH> 100644 --- a/gotenv.go +++ b/gotenv.go @@ -118,7 +118,7 @@ func setenv(key, val string, override bool) { if override { os.Setenv(key, val) } else { - if os.Getenv(key) == "" { + if _, present := os.LookupEnv(key); !present { os.Setenv(key, val) } }
Replaced os.Getenv(key) with os.LookupEnv(key) because it is possible to set an environment variable to an empty string and want that. LookupEnv ensure that the environment variable is absolutely not set
subosito_gotenv
train
go
1d9b1af4a396b10bd56982a9e9e4d16604f780b2
diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -256,15 +256,15 @@ class Container implements ResettableContainerInterface // this method can be called thousands of times during a request, avoid // calling strtolower() unless necessary. for ($i = 2;;) { + if (isset($this->privates[$id])) { + @trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED); + } if ('service_container' === $id) { return $this; } if (isset($this->aliases[$id])) { $id = $this->aliases[$id]; } - if (isset($this->privates[$id])) { - @trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED); - } // Re-use shared service instance if it exists. if (isset($this->services[$id])) {
[DI] Check privates before aliases consistently
symfony_symfony
train
php
82238f921c6e9ce1e6b8fb71383d2e016f61ad93
diff --git a/escope.js b/escope.js index <HASH>..<HASH> 100644 --- a/escope.js +++ b/escope.js @@ -480,8 +480,30 @@ switch (node.type) { case Syntax.AssignmentExpression: - currentScope.__referencing(node.left, Reference.WRITE, node.right); - currentScope.__referencing(node.right); + //check for implicit global variable declaration + if (currentScope.type === 'global' && node.left.name && !currentScope.isUsedName(node.left.name)){ + //create a variableDeclarator from assignment expression + decl = { + type: "VariableDeclarator", + id: node.left, + init: node.right + }; + currentScope.variableScope.__define(decl.id, { + type: Variable.Variable, + name: decl.id, + node: decl, + index: 0, + parent: node + }); + if (decl.init) { + // initializer is found + currentScope.__referencing(decl.id, Reference.WRITE, decl.init); + currentScope.__referencing(decl.init); + } + }else{ + currentScope.__referencing(node.left, Reference.WRITE, node.right); + currentScope.__referencing(node.right); + } break; case Syntax.ArrayExpression:
Added check for implicit global variable declaration
estools_escope
train
js
05124e2279269b4630c91843be8120511cdc20b8
diff --git a/lib/AnimatedStack.js b/lib/AnimatedStack.js index <HASH>..<HASH> 100644 --- a/lib/AnimatedStack.js +++ b/lib/AnimatedStack.js @@ -143,6 +143,8 @@ export default class AnimatedStack extends React.Component { ); this.setState({layersStyles: layersStylesStart}); + // NOTE: maybe we should use animation instead of transition + // since here we need timeout for brower to konw the change of style setTimeout(() => { const layersStylesEnd = this.layersStylesForAnimation( defaultStyles, currentIndex, nextIndex, animationObject, 'endStyle' @@ -151,7 +153,7 @@ export default class AnimatedStack extends React.Component { isInTransition: true, layersStyles: layersStylesEnd }); - }); + }, 50); } }
fix: use <I> miliseconds timeout to make sure the style is changed and the animation is applied
poetic_react-super-components
train
js
0321e70da90994d9e60f05cc0e55451744f59e21
diff --git a/lib/eZ/Publish/Core/Search/Solr/Content/SortClauseVisitor/MapLocationDistance.php b/lib/eZ/Publish/Core/Search/Solr/Content/SortClauseVisitor/MapLocationDistance.php index <HASH>..<HASH> 100644 --- a/lib/eZ/Publish/Core/Search/Solr/Content/SortClauseVisitor/MapLocationDistance.php +++ b/lib/eZ/Publish/Core/Search/Solr/Content/SortClauseVisitor/MapLocationDistance.php @@ -106,7 +106,7 @@ class MapLocationDistance extends SortClauseVisitor if ( $fieldName === null ) { throw new InvalidArgumentException( - "\$sortClause->target", + "\$sortClause->targetData", "No searchable fields found for the given sort clause target ". "'{$target->fieldIdentifier}' on '{$target->typeIdentifier}'." );
EZP-<I>: move searchable field map to storage
ezsystems_ezplatform-solr-search-engine
train
php
3cab0e482507c0f00fe9796d78a46a5e94efc600
diff --git a/ModuleBuilderFactory.php b/ModuleBuilderFactory.php index <HASH>..<HASH> 100644 --- a/ModuleBuilderFactory.php +++ b/ModuleBuilderFactory.php @@ -73,7 +73,7 @@ class Factory { * An environment object to set. */ public static function setEnvironment(\ModuleBuilder\Environment\EnvironmentInterface $environment) { - self::$environment = new $environment; + self::$environment = $environment; } /**
Fixed reinstantiation of existing object.
drupal-code-builder_drupal-code-builder
train
php
f0e3030e226ed4dc4f8c597e0d12aa39318b6a58
diff --git a/run-multiple.js b/run-multiple.js index <HASH>..<HASH> 100755 --- a/run-multiple.js +++ b/run-multiple.js @@ -26,7 +26,8 @@ var url = params.url, metrics = []; function runPhantomas(params, callback) { - var cmd = 'phantomjs phantomas.js --format=json --url=' + params.url; + var timeMs = Date.now(), + cmd = 'phantomjs phantomas.js --format=json --url=' + params.url; if (params.timeout > 0) { cmd += ' --timeout=' + params.timeout; @@ -51,7 +52,7 @@ function runPhantomas(params, callback) { } if (typeof callback === 'function') { - callback(res); + callback(res, Date.now() - timeMs); } }); } @@ -60,10 +61,12 @@ function run() { if (remainingRuns--) { console.log('Remaining runs: ' + (remainingRuns + 1)); - runPhantomas(params, function(res) { + runPhantomas(params, function(res, timeMs) { if (res) { metrics.push(res.metrics); } + + console.log('Run completed in ' + (timeMs/1000).toFixed(2) + ' s'); run(); }); }
run-multiple: show time it took to complete each run
macbre_phantomas
train
js
111f75d6ca8ffee58772d933c3096fa95f33ee5a
diff --git a/tests/seattle_benchmark.py b/tests/seattle_benchmark.py index <HASH>..<HASH> 100644 --- a/tests/seattle_benchmark.py +++ b/tests/seattle_benchmark.py @@ -31,16 +31,17 @@ def run_tests(data): means = {} for jsonfile in ["../transit/seattle-data0.json", "../transit/seattle-data0.jsonv"]: + data = "" with open(jsonfile, 'r') as fd: data = fd.read() - print("-"*50) - print("Running " + jsonfile) - print("-"*50) + print("-"*50) + print("Running " + jsonfile) + print("-"*50) - runs = 100 - deltas = [run_tests(data) for x in range(runs)] - means[jsonfile] = sum(deltas)/runs + runs = 100 + deltas = [run_tests(data) for x in range(runs)] + means[jsonfile] = sum(deltas)/runs for jsonfile, mean in means.items(): print "\nMean for" + jsonfile + ": "+str(mean)
Partial revert of for loop to ensure file is closed before benchmark.
cognitect_transit-python
train
py
0f4adb3f53bf2c855658b9598a41e26f184320c1
diff --git a/lib/firehose/rack.rb b/lib/firehose/rack.rb index <HASH>..<HASH> 100644 --- a/lib/firehose/rack.rb +++ b/lib/firehose/rack.rb @@ -95,7 +95,7 @@ module Firehose Firehose.logger.debug "WS sent `#{message}` to `#{path}` with sequence `#{sequence}`" send_data message subscribe.call(sequence) - end.errback { |e| raise e } + end.errback { |e| raise e.inspect unless e == :disconnect } end subscribe.call
don't raise error on ws disconnect
firehoseio_firehose
train
rb
927a4388b5b1767c31cb4cacea94e098cd9c898d
diff --git a/internal/graphics/shader.go b/internal/graphics/shader.go index <HASH>..<HASH> 100644 --- a/internal/graphics/shader.go +++ b/internal/graphics/shader.go @@ -100,6 +100,10 @@ highp vec2 roundTexel(highp vec2 p) { void main(void) { highp vec2 pos = varying_tex_coord; + // pos might include a very slight error. + // roundTexel adjusts pos by rounding it (#315, #558). + pos = roundTexel(pos); + #if defined(FILTER_NEAREST) vec4 color = texture2D(texture, pos); if (pos.x < varying_tex_coord_min.x || @@ -111,7 +115,6 @@ void main(void) { #endif #if defined(FILTER_LINEAR) - pos = roundTexel(pos); highp vec2 texel_size = 1.0 / source_size; highp vec2 p0 = pos - texel_size / 2.0; @@ -142,7 +145,6 @@ void main(void) { #endif #if defined(FILTER_SCREEN) - pos = roundTexel(pos); highp vec2 texel_size = 1.0 / source_size; pos -= texel_size / 2.0 / scale;
graphics: Bug fix: rounding texels is required even on the nearest filter Fixes #<I>
hajimehoshi_ebiten
train
go
24da318802f75c2088d4a0d5ae486b4519700a15
diff --git a/hererocks.py b/hererocks.py index <HASH>..<HASH> 100755 --- a/hererocks.py +++ b/hererocks.py @@ -990,17 +990,26 @@ class LuaRocks(Program): def get_manifest_name(): return os.path.join(opts.location, "hererocks.manifest") +manifest_version = 1 + def get_installed_identifiers(): if not os.path.exists(get_manifest_name()): return {} with open(get_manifest_name()) as manifest_h: try: - return json.load(manifest_h) + identifiers = json.load(manifest_h) except ValueError: return {} + if identifiers.get("version") == manifest_version: + return identifiers + else: + return {} + def save_installed_identifiers(all_identifiers): + all_identifiers["version"] = manifest_version + with open(get_manifest_name(), "w") as manifest_h: json.dump(all_identifiers, manifest_h)
Add version to manifest Increment when changing manifest format in breaking ways so that upgrading hererocks doesn't result in a crash.
mpeterv_hererocks
train
py
23e6dae04d196bb048864c48edd5b6d011d78503
diff --git a/src/Translators/SquantoTranslator.php b/src/Translators/SquantoTranslator.php index <HASH>..<HASH> 100644 --- a/src/Translators/SquantoTranslator.php +++ b/src/Translators/SquantoTranslator.php @@ -36,6 +36,9 @@ class SquantoTranslator extends LaravelTranslator implements Translator { $locale = $locale ?: $this->getLocale(); + // The key is always stored as lowercase so make sure our key input is sanitized as well. + $key = strtolower($key); + if($result = $this->getFromExcludedSource($key, $replace, $locale, $fallback)) { return $result; } diff --git a/tests/unit/translators/SquantoTranslatorTest.php b/tests/unit/translators/SquantoTranslatorTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/translators/SquantoTranslatorTest.php +++ b/tests/unit/translators/SquantoTranslatorTest.php @@ -23,6 +23,12 @@ class SquantoTranslatorTest extends TestCase } /** @test */ + public function retrieving_translation_is_case_insensitive() + { + $this->assertEquals('bazz', $this->translator->get('foo.BAR')); + } + + /** @test */ public function it_can_get_a_translation_collection() { $foo = require __DIR__.'/../../stubs/cached/nl/foo.php';
Make sure the input key is lowercased
thinktomorrow_squanto
train
php,php
5dbe11c0627c0a17a33acabe4f570823d1e4c163
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 @@ -26,6 +26,7 @@ end def install_extension_if_missing(name, query, expected_result) connection = ActiveRecord::Base.connection + postgresql_version = connection.send(:postgresql_version) result = connection.select_value(query) raise "Unexpected output for #{query}: #{result.inspect}" unless result.downcase == expected_result.downcase rescue => e
Fixes scoping issue which prevents missing extensions from being installed
Casecommons_pg_search
train
rb
ea4cd39bbcc508a96c17d9e97f12278961023487
diff --git a/lib/ansiblelint/utils.py b/lib/ansiblelint/utils.py index <HASH>..<HASH> 100644 --- a/lib/ansiblelint/utils.py +++ b/lib/ansiblelint/utils.py @@ -786,7 +786,7 @@ def get_playbooks_and_roles(options=None): } # detect role in repository root: - if 'tasks/main.yml' in files: + if 'tasks/main.yml' in files or 'tasks/main.yaml' in files: role_dirs.append('.') for p in map(Path, files): @@ -802,7 +802,7 @@ def get_playbooks_and_roles(options=None): if next((i for i in p.parts if i.endswith('_vars')), None): continue elif 'roles' in p.parts or '.' in role_dirs: - if 'tasks' in p.parts and p.parts[-1] == 'main.yaml': + if 'tasks' in p.parts and p.parts[-1] in ['main.yaml', 'main.yml']: role_dirs.append(str(p.parents[1])) elif role_internals.intersection(p.parts): continue
Fix role detection to include tasks/main.yml Previous role detection logic was looking only for tasks/main.yaml to determine what looks to be a role. Now it also includes tasks/main.yml
ansible_ansible-lint
train
py
839e47e6e3c5f7f4782c8d9bfad38b53984aebcd
diff --git a/src/Listener/RelatedModelsListener.php b/src/Listener/RelatedModelsListener.php index <HASH>..<HASH> 100644 --- a/src/Listener/RelatedModelsListener.php +++ b/src/Listener/RelatedModelsListener.php @@ -50,7 +50,9 @@ class RelatedModelsListener extends BaseListener } $query = $association->target()->find('list'); - $event = $this->_trigger('relatedModel', compact('name', 'viewVar', 'query', 'association')); + $subject = $this->_subject(); + $subject->set(compact('name', 'viewVar', 'query', 'association')); + $event = $this->_trigger('relatedModel', $subject); $controller->set($event->subject->viewVar, $event->subject->query->toArray()); }
Properly call _trigger() with a Subject object
FriendsOfCake_crud-json-api
train
php
ff9b3de44180bfe40fd2b2fa6234fdfa2df09e1b
diff --git a/lib/haibu/core/spawner.js b/lib/haibu/core/spawner.js index <HASH>..<HASH> 100644 --- a/lib/haibu/core/spawner.js +++ b/lib/haibu/core/spawner.js @@ -32,7 +32,12 @@ haibu.getSpawnOptions = function getSpawnOptions (app) { } version = semver.maxSatisfying(nodeVersions, engine); if (!version) { - var err = new Error('Error spawning drone: no matching engine found'); + var err = new Error([ + 'Haibu could not find a node.js version satisfying specified', + 'node.js engine `' + String(engine) + '`. Try specifying a different ' + + 'version of node.js', + 'in your package.json, such as `0.8.x`.' + ].join('\n')); err.blame = { type: 'user', message: 'Repository configuration'
[minor] Make the error message for "no matching engines found" more human-readable/helpful
nodejitsu_haibu
train
js
35eded21cf2196c29f5b48939ae7f4cb126ed737
diff --git a/tests/DebugTest.php b/tests/DebugTest.php index <HASH>..<HASH> 100644 --- a/tests/DebugTest.php +++ b/tests/DebugTest.php @@ -98,7 +98,9 @@ class DebugTest extends DebugTestFramework 'channel' => 'phpError', ), ), - 'html' => '<li class="error-strict m_warn" data-channel="phpError"><span class="no-pseudo t_string">Runtime Notice (E_STRICT): '.__FILE__.' (line '.$lastError['line'].'): </span><span class="t_string">Only variables should be passed by reference</span></li>', + 'html' => '<li class="error-notice m_warn" data-channel="phpError">' + .'<span class="no-pseudo t_string">'.(version_compare(PHP_VERSION, '7.0', '>=') ? 'Notice' : 'Runtime Notice (E_STRICT)' ).': '.__FILE__.' (line '.$lastError['line'].'): </span><span class="t_string">Only variables should be passed by reference</span>' + .'</li>', )); }
unit test fix E_NOTICE vs E_STRICT
bkdotcom_PHPDebugConsole
train
php
559c0c0e9bbcd34f599505e27796db55cc585e8f
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -216,7 +216,7 @@ window.onload = function() { }) } var gas = 1000000; - var gasPrice = web3.toWei(1, 'gwei'); + var gasPrice = web3.toWei(2, 'gwei'); window.eventEmitter = eventEmitter; function action(name, address, args) { var options = {from:address, gas:gas, gasPrice:gasPrice }
Change gasPrice to 2gwei
wearekickback_contracts
train
js
79f770d614f4b15698e3574da0c9021a928c53ef
diff --git a/lib/api_hammer/faraday/request_logger.rb b/lib/api_hammer/faraday/request_logger.rb index <HASH>..<HASH> 100644 --- a/lib/api_hammer/faraday/request_logger.rb +++ b/lib/api_hammer/faraday/request_logger.rb @@ -122,8 +122,8 @@ module ApiHammer body_info = [['request', filtered_request_body, request_env.request_headers], ['response', filtered_response_body, response_env.response_headers]] body_info.map do |(role, body, headers)| if body - filtered_body = ApiHammer::ParsedBody.new(body, headers['Content-Type']).filtered_body(@options.slice(:filter_keys)) - body.replace(filtered_body) if filtered_body + parsed_body = ApiHammer::ParsedBody.new(body, headers['Content-Type']) + body.replace(parsed_body.filtered_body(@options.slice(:filter_keys))) end end end
no need to check if filtered_body now
notEthan_api_hammer
train
rb
d1a2d531f416b238464e396d78a2baa8999a163c
diff --git a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java index <HASH>..<HASH> 100644 --- a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java +++ b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java @@ -180,11 +180,6 @@ public class GraphHopperServlet extends GHBaseServlet Map<String, Object> map = routeSerializer.toJSON(ghRsp, calcPoints, pointsEncoded, enableElevation, enableInstructions); - // this makes java client 0.5 fail so not in 0.6 but in 0.7 - Object infoMap = map.get("info"); - if (infoMap != null) - ((Map) infoMap).put("took", Math.round(took * 1000)); - if (ghRsp.hasErrors()) writeJsonError(httpRes, SC_BAD_REQUEST, new JSONObject(map)); else
finally removed 'took', #<I>
graphhopper_graphhopper
train
java
eb0c98ef957ea2cc9dd5fa261f6bfec2f8545e95
diff --git a/src/Engines/Node.php b/src/Engines/Node.php index <HASH>..<HASH> 100644 --- a/src/Engines/Node.php +++ b/src/Engines/Node.php @@ -45,6 +45,6 @@ class Node implements Engine protected function createTempFilePath(): string { - return implode(DIRECTORY_SEPARATOR, [$this->tempPath, md5(time()).'.js']); + return implode(DIRECTORY_SEPARATOR, [$this->tempPath, md5(intval(microtime(true) * 1000).random_bytes(5)).'.js']); } }
Improved uniqueness of generated temp file (#<I>)
spatie_server-side-rendering
train
php
743b60fae11cb4622d33462d69ac62628aca569e
diff --git a/src/Model/Address.php b/src/Model/Address.php index <HASH>..<HASH> 100644 --- a/src/Model/Address.php +++ b/src/Model/Address.php @@ -2,11 +2,6 @@ namespace CommerceGuys\Addressing\Model; -use CommerceGuys\Addressing\Validator\Constraints\AddressFormat as AddressFormatConstraint; -use CommerceGuys\Addressing\Validator\Constraints\Country as CountryConstraint; -use Symfony\Component\Validator\Constraints\NotBlank as NotBlankConstraint; -use Symfony\Component\Validator\Mapping\ClassMetadata; - class Address implements AddressInterface { /** @@ -283,19 +278,4 @@ class Address implements AddressInterface return $this; } - - /** - * @codeCoverageIgnore - */ - public static function loadValidatorMetadata(ClassMetadata $metadata) - { - $metadata->addPropertyConstraint('countryCode', new NotBlankConstraint()); - $metadata->addPropertyConstraint('countryCode', new CountryConstraint()); - $metadata->addConstraint(new AddressFormatConstraint(array( - 'groups' => array('AddressFormat'), - ))); - - // Validate the address format only if the country is valid. - $metadata->setGroupSequence(array('Address', 'AddressFormat')); - } }
Untie validation from the address model class.
commerceguys_addressing
train
php
dc188b0933ea193ddaeb0d894d59f5e9caf1d9c3
diff --git a/www/saml2/sp/idpdisco.php b/www/saml2/sp/idpdisco.php index <HASH>..<HASH> 100644 --- a/www/saml2/sp/idpdisco.php +++ b/www/saml2/sp/idpdisco.php @@ -23,17 +23,19 @@ $rememberEnabled = $config->getBoolean('idpdisco.enableremember', FALSE); try { if (!isset($_GET['entityID'])) throw new Exception('Missing parameter: entityID'); - - if (!isset($_GET['returnIDParam'])) throw new Exception('Missing parameter: returnIDParam'); + if (!isset($_GET['return'])) throw new Exception('Missing parameter: return'); + + $spentityid = $_GET['entityID']; $return = $_GET['return']; // Default value for "returnIDParam". Added to support Shibboleth 2.0 SP which does not // send this parameter. + // if (!isset($_GET['returnIDParam'])) throw new Exception('Missing parameter: returnIDParam'); $returnidparam = 'idpentityid'; - //if (!isset($_GET['return'])) throw new Exception('Missing parameter: return'); + // if (isset($_GET['returnIDParam'])) { $returnidparam = $_GET['returnIDParam']; }
fix previous fix (discoservice)
simplesamlphp_saml2
train
php
7f7ce29d72b114dfb41f30dc6ca6edf16ecf1aae
diff --git a/internal/util/comparisons.js b/internal/util/comparisons.js index <HASH>..<HASH> 100644 --- a/internal/util/comparisons.js +++ b/internal/util/comparisons.js @@ -3,6 +3,8 @@ 'use strict'; +const regexFlagsSupported = /a/g.flags !== undefined; + function uncurryThis(f) { return f.call.bind(f); } @@ -63,7 +65,9 @@ const kIsMap = 3; // Check if they have the same source and flags function areSimilarRegExps(a, b) { - return a.source === b.source && a.flags === b.flags; + return regexFlagsSupported + ? a.source === b.source && a.flags === b.flags + : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b); } function areSimilarFloatArrays(a, b) { @@ -190,7 +194,7 @@ function innerDeepEqual(val1, val2, strict, memos) { return false; } } else if (isRegExp(val1)) { - if (!areSimilarRegExps(val1, val2)) { + if (!(isRegExp(val2) && areSimilarRegExps(val1, val2))) { return false; } } else if (isNativeError(val1) || val1 instanceof Error) {
Fallback to toString check if regex falgs are unsupported
browserify_commonjs-assert
train
js
9b2018942f82b0b5c12ecacac0c3387643edc8e3
diff --git a/git_repo/services/ext/gerrit.py b/git_repo/services/ext/gerrit.py index <HASH>..<HASH> 100644 --- a/git_repo/services/ext/gerrit.py +++ b/git_repo/services/ext/gerrit.py @@ -147,7 +147,10 @@ class GerritService(RepositoryService): else: change_id = request.split('/')[3] - remote = self.repository.remote(self.name) + try: + remote = self.repository.remote(self.name) + except ValueError as err: + raise Exception('Remote "{remote}" is not setup. Please run `git {remote} add`'.format(remote=self.name)) local_branch_name = 'requests/{}/{}'.format(self.name, change_id) self.fetch(remote, request, local_branch_name, force=force)
Handle cases when the remote is not yet setup.
guyzmo_git-repo
train
py
1a8e7e91e7a07e1bbcb03f5eacf85baa4f7d9410
diff --git a/test/cri-containerd/runpodsandbox_test.go b/test/cri-containerd/runpodsandbox_test.go index <HASH>..<HASH> 100644 --- a/test/cri-containerd/runpodsandbox_test.go +++ b/test/cri-containerd/runpodsandbox_test.go @@ -433,7 +433,7 @@ func Test_RunPodSandbox_PortMappings_WCOW_Hypervisor(t *testing.T) { } func Test_RunPodSandbox_PortMappings_LCOW(t *testing.T) { - pullRequiredImages(t, []string{imageLcowK8sPause}) + pullRequiredLcowImages(t, []string{imageLcowK8sPause}) request := &runtime.RunPodSandboxRequest{ Config: &runtime.PodSandboxConfig{
Fix bug in pulling LCOW image with wrong annotations
Microsoft_hcsshim
train
go
35fc3fd5f2c1c212e348e0e9269b5a624ecefc17
diff --git a/rflint/parser/testcase.py b/rflint/parser/testcase.py index <HASH>..<HASH> 100644 --- a/rflint/parser/testcase.py +++ b/rflint/parser/testcase.py @@ -64,8 +64,10 @@ class Testcase(object): current_statement.endline = row.linenumber else: if len(current_statement) > 0: + # append current statement to the list of statements... statements.append(current_statement) - current_statement = Statement(row.cells[1:]) + # start a new statement + current_statement = Statement(row) current_statement.startline = row.linenumber current_statement.endline = row.linenumber
fixed but in .statements property
boakley_robotframework-lint
train
py
b5b531f0dd49ce096d2f54603331fee434e9c17c
diff --git a/src/extensions/filter/backgrid-filter.js b/src/extensions/filter/backgrid-filter.js index <HASH>..<HASH> 100644 --- a/src/extensions/filter/backgrid-filter.js +++ b/src/extensions/filter/backgrid-filter.js @@ -65,7 +65,7 @@ */ filter: function (e) { e.preventDefault(); - var $text = $(e.target); + var $text = $(e.target).find(":text"); var data = {}; data[$text.attr("name")] = $text.val(); this.collection.fetch({data: data}); diff --git a/test/extensions/filter.js b/test/extensions/filter.js index <HASH>..<HASH> 100644 --- a/test/extensions/filter.js +++ b/test/extensions/filter.js @@ -76,7 +76,8 @@ describe("A ServerSideFilter", function () { collection: collection }); filter.render(); - filter.$el.find(":text").val("query").submit(); + filter.$el.find(":text").val("query"); + filter.$el.submit(); expect(url).toBe("http://www.example.com"); expect(data).toEqual({q: "query"}); expect(collection.length).toBe(1);
Fix bug in server side filter where keyword is unable to be sent as query parameter
cloudflarearchive_backgrid
train
js,js
7c02725eb460ff09310c76e453f3dd6cd9ae0408
diff --git a/spec/report_spec.rb b/spec/report_spec.rb index <HASH>..<HASH> 100644 --- a/spec/report_spec.rb +++ b/spec/report_spec.rb @@ -761,6 +761,7 @@ describe Bugsnag::Report do end it "should handle utf8 encoding errors in exceptions_list" do + skip "Irrelevant on newer ruby" if RUBY_VERSION >= '2.3.0' invalid_data = "\"foo\xEBbar\"" invalid_data = invalid_data.force_encoding("utf-8") if invalid_data.respond_to?(:force_encoding)
fix(spec): Skip test made irrelevant by Ruby <I> improvements Ruby <I> has a number of improvements to encoding listed in the changelog: <URL>
bugsnag_bugsnag-ruby
train
rb
d82177992cc4317cdc1f694fccaeee196dd42aba
diff --git a/tests/test_project/settings.py b/tests/test_project/settings.py index <HASH>..<HASH> 100644 --- a/tests/test_project/settings.py +++ b/tests/test_project/settings.py @@ -10,8 +10,11 @@ https://docs.djangoproject.com/en/1.7/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os +import sys BASE_DIR = os.path.dirname(os.path.dirname(__file__)) - +TEMPLATE_DIRS = [ + os.path.join(sys.prefix, 'django', 'contrib', 'admin', 'templates') +] # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
Workaround for screwy <I> issue.
ionelmc_django-redisboard
train
py
c3d12dabf6d4c09773262e75a4109ecf0e60c173
diff --git a/platforms/ble/ble_client_adaptor.go b/platforms/ble/ble_client_adaptor.go index <HASH>..<HASH> 100644 --- a/platforms/ble/ble_client_adaptor.go +++ b/platforms/ble/ble_client_adaptor.go @@ -2,7 +2,6 @@ package ble import ( "context" - "fmt" "log" "strings" "time" @@ -40,11 +39,14 @@ func NewClientAdaptor(address string) *ClientAdaptor { } } -func (b *ClientAdaptor) Name() string { return b.name } +// Name returns the name for the adaptor +func (b *ClientAdaptor) Name() string { return b.name } + +// SetName sets the name for the adaptor func (b *ClientAdaptor) SetName(n string) { b.name = n } -func (b *ClientAdaptor) Address() string { return b.address } -//func (b *ClientAdaptor) Peripheral() gatt.Peripheral { return b.peripheral } +// Address returns the Bluetooth LE address for the adaptor +func (b *ClientAdaptor) Address() string { return b.address } // Connect initiates a connection to the BLE peripheral. Returns true on successful connection. func (b *ClientAdaptor) Connect() (err error) { @@ -114,7 +116,6 @@ func (b *ClientAdaptor) ReadCharacteristic(cUUID string) (data []byte, err error if err != nil { return nil, err } - fmt.Printf(" Value %x | %q\n", data, data) return data, nil }
ble: add godoc comments for exported methods
hybridgroup_gobot
train
go
3c98bbeaefa25241f7775808c45ef813c7be5e8e
diff --git a/pygerduty/__init__.py b/pygerduty/__init__.py index <HASH>..<HASH> 100755 --- a/pygerduty/__init__.py +++ b/pygerduty/__init__.py @@ -3,6 +3,7 @@ import copy import json import time +import six from six.moves import urllib @@ -648,6 +649,9 @@ class PagerDuty(object): if query_params: url += "?{0}".format(query_params) + if isinstance(data, six.text_type): + data = data.encode("utf-8") + request = urllib.request.Request(url, data=data, headers=headers) request.get_method = lambda: method.upper() diff --git a/pygerduty/version.py b/pygerduty/version.py index <HASH>..<HASH> 100644 --- a/pygerduty/version.py +++ b/pygerduty/version.py @@ -1,2 +1,2 @@ -version_info = (0, 29, 0) +version_info = (0, 29, 1) __version__ = '.'.join(str(v) for v in version_info)
Encode request data as utf-8 when text_string fixes #<I>
dropbox_pygerduty
train
py,py
1224c0ec8f05ed7ae99703aa305ff10396f4ae91
diff --git a/lib/main.js b/lib/main.js index <HASH>..<HASH> 100644 --- a/lib/main.js +++ b/lib/main.js @@ -59,7 +59,7 @@ function main () { }).then(function () { logger.debug('Directory created: %s', outputDir) - return Promise.all(travisConfig.node_js.forEach(function (version) { + return Promise.all(travisConfig.node_js.map(function (version) { return runTests(outputDir, version) })) }).then(function () {
Fix test case execution promises (forEach -> map)
jcollado_multitest
train
js
bec1751ee416aa5a36fd5d147abf97138a0d2efb
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -248,7 +248,7 @@ module Rails RESERVED_NAMES = %w[application destroy plugin runner test] class AppGenerator < AppBase # :nodoc: - WEBPACKS = %w( react vue angular elm ) + WEBPACKS = %w( react vue angular elm stimulus ) add_shared_options_for "application"
Add stimulus to list of supported options for --webpack
rails_rails
train
rb
9c606ea06cdd604f7d840e0f69d6d9b5d6b46394
diff --git a/java/runtime/src/main/java/org/ray/runtime/functionmanager/FunctionManager.java b/java/runtime/src/main/java/org/ray/runtime/functionmanager/FunctionManager.java index <HASH>..<HASH> 100644 --- a/java/runtime/src/main/java/org/ray/runtime/functionmanager/FunctionManager.java +++ b/java/runtime/src/main/java/org/ray/runtime/functionmanager/FunctionManager.java @@ -28,7 +28,7 @@ public class FunctionManager { * Cache from a RayFunc object to its corresponding FunctionDescriptor. Because * `LambdaUtils.getSerializedLambda` is expensive. */ - private static final ThreadLocal<WeakHashMap<Class<RayFunc>, FunctionDescriptor>> + private static final ThreadLocal<WeakHashMap<Class<? extends RayFunc>, FunctionDescriptor>> RAY_FUNC_CACHE = ThreadLocal.withInitial(WeakHashMap::new); /** @@ -51,6 +51,7 @@ public class FunctionManager { final String methodName = serializedLambda.getImplMethodName(); final String typeDescriptor = serializedLambda.getImplMethodSignature(); functionDescriptor = new FunctionDescriptor(className, methodName, typeDescriptor); + RAY_FUNC_CACHE.get().put(func.getClass(),functionDescriptor); } return getFunction(driverId, functionDescriptor); }
fix bug: (#<I>) before fix,RAY_FUN_CACHE use only get method ,can only get null fix : put after create
ray-project_ray
train
java
3807ba4fbca2a1222dabe028bf652567a3c4f94e
diff --git a/src/Pingpong/Twitter/Twitter.php b/src/Pingpong/Twitter/Twitter.php index <HASH>..<HASH> 100644 --- a/src/Pingpong/Twitter/Twitter.php +++ b/src/Pingpong/Twitter/Twitter.php @@ -268,6 +268,7 @@ class Twitter { $this->session->forget('oauth_token'); $this->session->forget('oauth_token_secret'); + $this->setNewOAuthToken(null, null); return $this; }
When destroying, forget also the oauth_token and oauth_token secret from the base twitter instance
pingpong-labs_twitter
train
php
a5307e35387bffa83c4efcff608335631a36e206
diff --git a/src/Cache/Storage/Apc.php b/src/Cache/Storage/Apc.php index <HASH>..<HASH> 100644 --- a/src/Cache/Storage/Apc.php +++ b/src/Cache/Storage/Apc.php @@ -194,7 +194,7 @@ class Apc extends None $name = $key['info']; $namearr = explode('-', $name); - if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') + if ($namearr !== false && $namearr[0] == $hash && $namearr[1] == 'cache') { $group = $namearr[2];
Use the correct variable name to check the hash value (#<I>)
hubzero_framework
train
php
0f2334a90d61742545343b8c14b57360170d1d52
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -9028,7 +9028,7 @@ const devices = [ exposes: [e.contact(), e.battery(), e.battery_low(), e.tamper()], }, { - zigbeeModel: ['DOOR_TPV13'], + zigbeeModel: ['DOOR_TPV13', 'DOOR_TPV12'], model: 'HEIMAN-M1', vendor: 'HEIMAN', description: 'Door sensor',
Added new Heiman door sensor (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
c1c84af5fd5f3179dd3c89bf844f7f5cce509147
diff --git a/tests/Adapter/FilesystemAdapterTest.php b/tests/Adapter/FilesystemAdapterTest.php index <HASH>..<HASH> 100644 --- a/tests/Adapter/FilesystemAdapterTest.php +++ b/tests/Adapter/FilesystemAdapterTest.php @@ -176,6 +176,14 @@ class FilesystemAdapterTest extends TestCase $this->assertFalse($adapter->get(new Name('test'))->contains(new Name('..'))); $this->assertFalse($adapter->contains(new Name('.'))); $this->assertFalse($adapter->contains(new Name('..'))); + $this->assertFalse( + $adapter + ->all() + ->reduce( + false, + fn($found, $file) => $found || $file->name()->equals(new Name('.')) || $file->name()->equals(new Name('..')), + ), + ); $this->expectException(FileNotFound::class);
test that the dot files does not appear when accessing the whole set of files
Innmind_Filesystem
train
php
778f64744d42b7a4341cc550baaba5147a5d0775
diff --git a/demo/js/demo.js b/demo/js/demo.js index <HASH>..<HASH> 100644 --- a/demo/js/demo.js +++ b/demo/js/demo.js @@ -45,12 +45,10 @@ class Example extends Component { href="https://github.com/react-component/collapse" target="_blank" rel="noopener noreferrer" - title="rc-collapse" >rc-collapse</a> and <a href="https://github.com/daviferreira/react-sanfona" target="_blank" rel="noopener noreferrer" - title="react-sanfona" >react-sanfona</a>. </p> </AccordionItemBody>
Fixes some warning with accessibility checker
springload_react-accessible-accordion
train
js
605522b0c714c173d0a1ec8d00e46c3629107267
diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go @@ -365,6 +365,8 @@ func (c *Cacher) Watch(ctx context.Context, key string, resourceVersion string, // Create a watcher here to reduce memory allocations under lock, // given that memory allocation may trigger GC and block the thread. + // Also note that emptyFunc is a placeholder, until we will be able + // to compute watcher.forget function (which has to happen under lock). watcher := newCacheWatcher(chanSize, filterWithAttrsFunction(key, pred), emptyFunc, c.versioner) // We explicitly use thread unsafe version and do locking ourself to ensure that
Add explanation about forgetFunc in cacher
kubernetes_kubernetes
train
go
0150e85a248be5c2066d16b6ea8339b3128c75c1
diff --git a/src/module-elasticsuite-core/Model/Search/RequestBuilder.php b/src/module-elasticsuite-core/Model/Search/RequestBuilder.php index <HASH>..<HASH> 100644 --- a/src/module-elasticsuite-core/Model/Search/RequestBuilder.php +++ b/src/module-elasticsuite-core/Model/Search/RequestBuilder.php @@ -79,7 +79,8 @@ class RequestBuilder */ public function getRequest(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria) { - $storeId = $this->storeManager->getStore()->getId(); + $storeId = $this->getCurrentStoreId(); + $containerName = $searchCriteria->getRequestName(); $containerConfiguration = $this->getSearchContainerConfiguration($storeId, $containerName); @@ -97,6 +98,22 @@ class RequestBuilder } /** + * Return current store id. + * + * @return integer + */ + private function getCurrentStoreId() + { + $storeId = $this->storeManager->getStore()->getId(); + + if ($storeId == 0) { + $storeId = $this->storeManager->getDefaultStoreView()->getId(); + } + + return $storeId; + } + + /** * Extract fulltext search query from search criteria. * * @param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria Search criteria.
Fix detection of the default store id in search API.
Smile-SA_elasticsuite
train
php
c7e792b379a5dff84e3cb4e6f910b0af0886521c
diff --git a/rawdisk/plugins/filesystems/ntfs/mft.py b/rawdisk/plugins/filesystems/ntfs/mft.py index <HASH>..<HASH> 100644 --- a/rawdisk/plugins/filesystems/ntfs/mft.py +++ b/rawdisk/plugins/filesystems/ntfs/mft.py @@ -25,6 +25,19 @@ from mft_entry import MftEntry +ENTRY_MFT = 0 +ENTRY_MFT_MIRROR = 1 +ENTRY_LOGFILE = 2 +ENTRY_VOLUME = 3 +ENTRY_ATTRDEF = 4 +ENTRY_ROOT = 5 +ENTRY_BITMAP = 6 +ENTRY_BOOT = 7 +ENTRY_BADCLUS = 8 +ENTRY_SECURE = 9 +ENTRY_UPCASE = 10 +ENTRY_EXTEND = 11 + class MftTable(object): """Represents NTFS Master File Table (MFT)
Added definitions for mft system files
dariusbakunas_rawdisk
train
py
9414c79695eae30b069c50fa0979d4efc97c5563
diff --git a/modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php b/modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php +++ b/modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php @@ -136,7 +136,7 @@ class SocialGroupRequestMembershipNotification extends BlockBase implements Cont ->getContentPlugin('group_membership_request') ->getContentTypeConfigId(); - $requests = $this->entityTypeManager->getStorage('group_content') + $requests = (int) $this->entityTypeManager->getStorage('group_content') ->getQuery() ->condition('type', $content_type_config_id) ->condition('gid', $this->group->id())
Issue #<I> by chmez: Hide a message about existing requests for joining when they are actually not
goalgorilla_open_social
train
php
8f2d0bb2bd2a0b5f008caff8204049e7736607da
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.0.1'; - const VERSION_ID = 30001; + const VERSION = '3.0.2-DEV'; + const VERSION_ID = 30002; const MAJOR_VERSION = 3; const MINOR_VERSION = 0; - const RELEASE_VERSION = 1; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 2; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '07/2016'; const END_OF_LIFE = '01/2017';
bumped Symfony version to <I>
symfony_symfony
train
php
6eb073f2e5a2d2456363bd7a640a63a094ed7e9e
diff --git a/lib/anycable/rails/actioncable/channel.rb b/lib/anycable/rails/actioncable/channel.rb index <HASH>..<HASH> 100644 --- a/lib/anycable/rails/actioncable/channel.rb +++ b/lib/anycable/rails/actioncable/channel.rb @@ -14,7 +14,9 @@ module ActionCable end def stream_from(broadcasting, callback = nil, coder: nil) - raise ArgumentError('Unsupported') if callback.present? || coder.present? || block_given? + if callback.present? || coder.present? || block_given? + raise ArgumentError, 'Custom stream callbacks are not supported in AnyCable!' + end connection.socket.subscribe identifier, broadcasting end
Fix raising exception about unsupported stream callbacks Exception classes are not methods.
anycable_anycable-rails
train
rb
ff5c4b671e2022e5f8589a79fbec4adf08a05a43
diff --git a/qa/integration-tests-webapps/src/test/java/org/camunda/bpm/cockpit/DashboardIT.java b/qa/integration-tests-webapps/src/test/java/org/camunda/bpm/cockpit/DashboardIT.java index <HASH>..<HASH> 100644 --- a/qa/integration-tests-webapps/src/test/java/org/camunda/bpm/cockpit/DashboardIT.java +++ b/qa/integration-tests-webapps/src/test/java/org/camunda/bpm/cockpit/DashboardIT.java @@ -33,7 +33,7 @@ public class DashboardIT extends AbstractWebappUiIntegrationTest { WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]"))); submit.submit(); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.tagName("h3"), "1 process definition deployed")); + wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector("[ng-repeat=\"propName in procDefStatsKeys\"]:first-child"), "1 process definition")); wait.until(currentURIIs(new URI(appUrl + "/default/#/dashboard"))); }
fix(webapps-IT): adapt webapps-IT-test to new cockpit dashboard related to CAM-<I>
camunda_camunda-bpm-platform
train
java
cf8d8456dda4b0e7d9ebd5d5e5441420fa8b4fb6
diff --git a/code/MemberProfilePage.php b/code/MemberProfilePage.php index <HASH>..<HASH> 100644 --- a/code/MemberProfilePage.php +++ b/code/MemberProfilePage.php @@ -317,6 +317,7 @@ class MemberProfilePage_Controller extends Page_Controller { public static $allowed_actions = array ( 'index', 'RegisterForm', + 'afterregistration', 'ProfileForm', 'add', 'AddForm', @@ -444,16 +445,25 @@ class MemberProfilePage_Controller extends Page_Controller { } } - return array ( - 'Title' => $this->obj('AfterRegistrationTitle'), - 'Content' => $this->obj('AfterRegistrationContent'), - ); + return $this->redirect($this->Link('afterregistration')); } else { return $this->redirectBack(); } } /** + * Returns the after registration content to the user. + * + * @return array + */ + public function afterregistration() { + return array ( + 'Title' => $this->obj('AfterRegistrationTitle'), + 'Content' => $this->obj('AfterRegistrationContent') + ); + } + + /** * @uses MemberProfilePage_Controller::getProfileFields * @return Form */
ENHANCEMENT: Redirect to an after registration action rather than directly returning content.
symbiote_silverstripe-memberprofiles
train
php
34b648d37e93535bc90090642e96de116c085ac5
diff --git a/tests/lib/rules/keyword-spacing.js b/tests/lib/rules/keyword-spacing.js index <HASH>..<HASH> 100644 --- a/tests/lib/rules/keyword-spacing.js +++ b/tests/lib/rules/keyword-spacing.js @@ -1149,9 +1149,10 @@ ruleTester.run("keyword-spacing", rule, { {code: "function* foo() { [yield] }", parserOptions: {ecmaVersion: 6}}, {code: "function* foo() { [ yield ] }", options: [NEITHER], parserOptions: {ecmaVersion: 6}}, + // This is invalid syntax: https://github.com/eslint/eslint/issues/5405 // not conflict with `arrow-spacing` - {code: "function* foo() { (() =>yield foo) }", parserOptions: {ecmaVersion: 6}}, - {code: "function* foo() { (() => yield foo) }", options: [NEITHER], parserOptions: {ecmaVersion: 6}}, + // {code: "function* foo() { (() =>yield foo) }", parserOptions: {ecmaVersion: 6}}, + // {code: "function* foo() { (() => yield foo) }", options: [NEITHER], parserOptions: {ecmaVersion: 6}}, // not conflict with `block-spacing` {code: "function* foo() {yield}", parserOptions: {ecmaVersion: 6}},
Fix: remove tests which have invalid syntax (fixes #<I>) espree <I> came to raise a syntax error correctly at `yield` keyword inside of arrow functions.
eslint_eslint
train
js
8acda64c391e146e9df9f4f4f442182cdde3b00c
diff --git a/DependencyInjection/LiipThemeExtension.php b/DependencyInjection/LiipThemeExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/LiipThemeExtension.php +++ b/DependencyInjection/LiipThemeExtension.php @@ -29,25 +29,16 @@ class LiipThemeExtension extends Extension { $processor = new Processor(); $configuration = new Configuration(); + $config = $processor->process($configuration->getConfigTree(), $configs); if (empty($config['themes']) || empty($config['activeTheme'])) { throw new \RuntimeException('Liip\ThemeBundle not completely configured please consult the README file.'); } - $loader = $this->getFileLoader($container); + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('templating.xml'); $container->setParameter($this->getAlias().'.themes', $config['themes']); $container->setParameter($this->getAlias().'.activeTheme', $config['activeTheme']); } - - /** - * Get File Loader - * - * @param ContainerBuilder $container - */ - public function getFileLoader($container) - { - return new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - } }
Moved fileloader as it is only used once
liip_LiipThemeBundle
train
php
9d80eeefc63430f18ba54cfc69e135e8c916ed20
diff --git a/tests/test_manager_graph.py b/tests/test_manager_graph.py index <HASH>..<HASH> 100644 --- a/tests/test_manager_graph.py +++ b/tests/test_manager_graph.py @@ -146,6 +146,11 @@ class TestNetworkCache(BelReconstitutionMixin, FleetingTemporaryCacheMixin): graph_copy.document[METADATA_VERSION] = '1.0.1' network_copy = self.manager.insert_graph(graph_copy, store_parts=False) + self.assertTrue(self.manager.has_name_version(graph_copy.name, graph_copy.version)) + self.assertFalse(self.manager.has_name_version('wrong name', '0.1.2')) + self.assertFalse(self.manager.has_name_version(graph_copy.name, '0.1.2')) + self.assertFalse(self.manager.has_name_version('wrong name', graph_copy.version)) + self.assertEqual(2, self.manager.count_networks()) self.assertEqual('1.0.1', self.manager.get_most_recent_network_by_name(self.graph.name).version)
added tests manager has_name_version
pybel_pybel
train
py
5d0dfaa82335e2d867b587053a56dfa018976546
diff --git a/upnp_test.go b/upnp_test.go index <HASH>..<HASH> 100644 --- a/upnp_test.go +++ b/upnp_test.go @@ -14,7 +14,7 @@ func TestConcurrentUPNP(t *testing.T) { // verify that a router exists _, err := Discover() if err != nil { - t.Fatal(err) + t.Skip(err) } // now try to concurrently Discover() using 20 threads @@ -36,7 +36,7 @@ func TestIGD(t *testing.T) { // connect to router d, err := Discover() if err != nil { - t.Fatal(err) + t.Skip(err) } // discover external IP
skip tests which require a router if not discovered
NebulousLabs_go-upnp
train
go
c203462d8b8f8b9e12a1b7927120db5db06e09d1
diff --git a/lib/inspectors/log.js b/lib/inspectors/log.js index <HASH>..<HASH> 100644 --- a/lib/inspectors/log.js +++ b/lib/inspectors/log.js @@ -9,7 +9,7 @@ var logHtmlScript, logHttpsHtmlScript, logHttpsScript; function wrapScript(script, isHtml) { - return isHtml ? '\r\n<script>' + script + '</script>\r\n' : script; + return isHtml ? '\r\n<script>' + script + '</script>\r\n' : '\r\n' + script; } module.exports = function(req, res, next) {
refactor: Add crlf before log script
avwo_whistle
train
js
afdb035d707f6ec1b0aa472c9ec90c1aaef7306f
diff --git a/internal/wasm/sdk/internal/wasm/vm.go b/internal/wasm/sdk/internal/wasm/vm.go index <HASH>..<HASH> 100644 --- a/internal/wasm/sdk/internal/wasm/vm.go +++ b/internal/wasm/sdk/internal/wasm/vm.go @@ -503,6 +503,10 @@ func (i *VM) RemoveDataPath(path []string) error { return err } + if _, err := i.free(pathAddr); err != nil { + return err + } + errc := result.ToI32() if errc != 0 { return fmt.Errorf("unable to set data value for path %v, err=%d", path, errc)
internal/wasm/sdk/internal: A missing wasm memory free.
open-policy-agent_opa
train
go
bc1d2732e9001feb0080a67f8ec9c94f3c2674f7
diff --git a/indra/literature/pmc_client.py b/indra/literature/pmc_client.py index <HASH>..<HASH> 100644 --- a/indra/literature/pmc_client.py +++ b/indra/literature/pmc_client.py @@ -1,6 +1,7 @@ from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import re +import copy import logging import os.path import requests @@ -456,6 +457,7 @@ def _pull_nested_paragraphs_to_top(tree): def _extract_paragraphs_from_tree(tree): """Preprocess tree and return it's paragraphs.""" + tree = copy.deepcopy(tree) _retain_only_pars(tree) _pull_nested_paragraphs_to_top(tree) paragraphs = []
Make deepcopy of tree before mutating
sorgerlab_indra
train
py
8b1dff9d98a40b1695b34c0591b9aa20a38c6286
diff --git a/lib/liquid/lexer.rb b/lib/liquid/lexer.rb index <HASH>..<HASH> 100644 --- a/lib/liquid/lexer.rb +++ b/lib/liquid/lexer.rb @@ -29,7 +29,7 @@ module Liquid '[' => :open_square, ']' => :close_square } - IDENTIFIER = /[\w\-?]+/ + IDENTIFIER = /[\w\-?!]+/ SINGLE_STRING_LITERAL = /'[^\']*'/ DOUBLE_STRING_LITERAL = /"[^\"]*"/ INTEGER_LITERAL = /-?\d+/
Allow ! in identifiers like Ruby
Shopify_liquid
train
rb
b8ea72f75eaf1753ae9af0b3a09c399f488e1c7f
diff --git a/lib/devise_remote_user/version.rb b/lib/devise_remote_user/version.rb index <HASH>..<HASH> 100644 --- a/lib/devise_remote_user/version.rb +++ b/lib/devise_remote_user/version.rb @@ -1,3 +1,3 @@ module DeviseRemoteUser - VERSION = '0.3.0' + VERSION = '0.4.0' end
Bumped version to <I>
duke-libraries_devise-remote-user
train
rb
2d51b881d1a2cde6c0daca0b17b7e882449b3c5d
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1724,8 +1724,8 @@ PlugAPI.prototype.grab = function(callback) { return; } - that.getActivePlaylist(function(playlist) { - if (playlist == null) { + that.getActivePlaylist(function(currentPlaylist) { + if (currentPlaylist == null) { if (typeof callback === 'function') { return callback(new Error('Playlist not found'), null); } @@ -1733,17 +1733,17 @@ PlugAPI.prototype.grab = function(callback) { return; } - var callbackWrapper = function(err, data) { - if (!err) { - playlist = editPlaylistLength(playlist, true); + var callbackWrapper = function(requestError, data) { + if (!requestError) { + currentPlaylist = editPlaylistLength(currentPlaylist, true); } if (typeof callback === 'function') { - return callback(err, data); + return callback(requestError, data); } }; queueREST('POST', 'grabs', { - playlistID: playlist.id, + playlistID: currentPlaylist.id, historyID: room.getHistoryID() }, callbackWrapper); });
Attempt to bypass duplicate func on bithound (2)
plugCubed_plugAPI
train
js
f1ab8fc4e8d9adf0b54f03efd6dfb463802d41c0
diff --git a/polysquare_setuptools_lint/__init__.py b/polysquare_setuptools_lint/__init__.py index <HASH>..<HASH> 100644 --- a/polysquare_setuptools_lint/__init__.py +++ b/polysquare_setuptools_lint/__init__.py @@ -140,7 +140,7 @@ def _run_flake8_internal(filename): code = super(Flake8MergeReporter, self).error(line, offset, text, - check) + check) or "no-code" key = _Key(self._current_file, line, code) return_dict[key] = Message(code,
flake8: Don't trust flake8 to give us a code Sometimes it doesn't. This causes prospector's formatter to choke.
polysquare_polysquare-setuptools-lint
train
py
ab1d6f42e2ab36bef241ff723db7da554cfcd318
diff --git a/cluster/manager.go b/cluster/manager.go index <HASH>..<HASH> 100644 --- a/cluster/manager.go +++ b/cluster/manager.go @@ -506,6 +506,7 @@ func (c *ClusterManager) joinCluster( initState, err := snapAndReadClusterInfo() kvdb.Unlock(kvlock) if err != nil { + dlog.Panicf("Fatal, Unable to create snapshot: %v", err) return err } defer func() {
Panic if snapshot creation fails.
libopenstorage_openstorage
train
go
e8e1bb0a5a7dfd82b8b022d78671d049182fda32
diff --git a/controller/config.go b/controller/config.go index <HASH>..<HASH> 100755 --- a/controller/config.go +++ b/controller/config.go @@ -580,7 +580,15 @@ func (c Config) PruneTxnQueryCount() int { // PruneTxnSleepTime is the amount of time to sleep between batches. func (c Config) PruneTxnSleepTime() time.Duration { - val, _ := time.ParseDuration(c.mustString(PruneTxnSleepTime)) + asInterface, ok := c[PruneTxnSleepTime] + if !ok { + asInterface = DefaultPruneTxnSleepTime + } + asStr, ok := asInterface.(string) + if !ok { + asStr = DefaultPruneTxnSleepTime + } + val, _ := time.ParseDuration(asStr) return val }
PruneTxnSleepTime was meant to be optional. The other field used 'intOrDefault' which properly handles the default vaule when the parameter isn't available. But sleep time was a string, and doesn't have a strOrDefault. So this does an inline "if we don't have it, use the default".
juju_juju
train
go
6d6954d1980ad13787ddabef95389af4542654e4
diff --git a/lib/unexpected-sinon.js b/lib/unexpected-sinon.js index <HASH>..<HASH> 100644 --- a/lib/unexpected-sinon.js +++ b/lib/unexpected-sinon.js @@ -324,12 +324,15 @@ spies = [ spies ]; } var originalValues = spies.map(function (spy) { - var originalValue = {}; + var originalValue = { + func: spy.func + }; + // Temporarily override the body of the spied-on function, if any. + // This prevents spies with side effects from breaking while + // the expected calls are being recorded: + spy.func = function () {}; for (var propertyName in spy) { - if (propertyName === 'func') { - originalValue.func = spy.func; - spy.func = function () {}; - } else if (spy.hasOwnProperty(propertyName) && typeof spy[propertyName] !== 'function') { + if (spy.hasOwnProperty(propertyName) && typeof spy[propertyName] !== 'function') { if (Array.isArray(spy[propertyName])) { originalValue[propertyName] = [].concat(spy[propertyName]); } else {
After a closer inspection of the sinon source, this turns out to be supported already :)
unexpectedjs_unexpected-sinon
train
js
d91f39d77462ed58b098db123e47d9b552d675f8
diff --git a/php/commands/core.php b/php/commands/core.php index <HASH>..<HASH> 100644 --- a/php/commands/core.php +++ b/php/commands/core.php @@ -636,6 +636,7 @@ class Core_Command extends WP_CLI_Command { if ( !is_multisite() ) { ob_start(); ?> +define( 'WP_ALLOW_MULTISITE', true ); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', <?php var_export( $assoc_args['subdomains'] ); ?>); $base = '<?php echo $assoc_args['base']; ?>';
Added allow multisite constant to multisite install and convert. The multisite install and convert procedures do not include: define( 'WP_ALLOW_MULTISITE', true ); If this isn't present, the "Network Settings" and "Network Setup" menu items are not available in the network admin.
wp-cli_export-command
train
php
1cea073a4c49faeef9b1d582e9f1559f9fe7328a
diff --git a/microcosm_flask/matchers.py b/microcosm_flask/matchers.py index <HASH>..<HASH> 100644 --- a/microcosm_flask/matchers.py +++ b/microcosm_flask/matchers.py @@ -58,7 +58,7 @@ class JSONMatcher(BaseMatcher): def __init__(self, resource): self.resource = resource self.schema = self.schema_class() - self.expected = self.schema.dump(self.resource).data + self.expected = self.schema.dump(self.resource) @property def schema_class(self):
fix a marshmallow <I> incompatability in JSONMatcher
globality-corp_microcosm-flask
train
py
c0a490ea3c2b38f4f69442cdfa36f393e3d0c38c
diff --git a/classes/fields/pick.php b/classes/fields/pick.php index <HASH>..<HASH> 100644 --- a/classes/fields/pick.php +++ b/classes/fields/pick.php @@ -297,8 +297,11 @@ class PodsField_Pick extends PodsField { $data[ $custom_value ] = $custom_label; } } - else - $data = array_merge( $data, $custom ); + else { + foreach ( $custom as $custom_value => $custom_label ) { + $data[ $custom_value ] = $custom_label; + } + } } elseif ( '' != pods_var( 'pick_object', $options, '' ) && array() == pods_var_raw( 'data', $options, array(), null, true ) ) { $options[ 'table_info' ] = pods_api()->get_table_info( pods_var( 'pick_object', $options ), pods_var( 'pick_val', $options ) );
Fix array_merge issue with numeric ids in custom value filter
pods-framework_pods
train
php
0c06dff5768a32e70a51cc2bacf669ac24234b0f
diff --git a/cmd/log_out.go b/cmd/log_out.go index <HASH>..<HASH> 100644 --- a/cmd/log_out.go +++ b/cmd/log_out.go @@ -1,6 +1,8 @@ package cmd import ( + "errors" + cmdconf "github.com/cloudfoundry/bosh-cli/cmd/config" biui "github.com/cloudfoundry/bosh-cli/ui" ) @@ -16,6 +18,10 @@ func NewLogOutCmd(environment string, config cmdconf.Config, ui biui.UI) LogOutC } func (c LogOutCmd) Run() error { + if c.environment == "" { + return errors.New("Expected non-empty Director URL") + } + updatedConfig := c.config.UnsetCredentials(c.environment) err := updatedConfig.Save() diff --git a/cmd/log_out_test.go b/cmd/log_out_test.go index <HASH>..<HASH> 100644 --- a/cmd/log_out_test.go +++ b/cmd/log_out_test.go @@ -57,5 +57,12 @@ var _ = Describe("LogOutCmd", func() { Expect(ui.Said).To(BeEmpty()) }) + + It("returns error if environment is empty", func() { + command = NewLogOutCmd("", config, ui) + err := act() + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(Equal("Expected non-empty Director URL")) + }) }) })
log-out command requires environment is set
cloudfoundry_bosh-cli
train
go,go
1bba28be63b9dba4d8636a93185c78dec7e46b87
diff --git a/pyecobee/__init__.py b/pyecobee/__init__.py index <HASH>..<HASH> 100644 --- a/pyecobee/__init__.py +++ b/pyecobee/__init__.py @@ -222,12 +222,17 @@ class Ecobee(object): log_msg_action = "set fan minimum on time." return self.make_request(body, log_msg_action) - def set_fan_mode(self, index, fan_mode): + def set_fan_mode(self, index, fan_mode, cool_temp, heat_temp, hold_type="nextTransition"): ''' Set fan mode. Values: auto, minontime, on ''' - body = ('{"selection":{"selectionType":"thermostats","selectionMatch":' - '"' + self.thermostats[index]['identifier'] + - '"},"thermostat":{"settings":{"vent":"' + fan_mode + - '"}}}') + body = {"selection": { + "selectionType": "thermostats", + "selectionMatch": self.thermostats[index]['identifier']}, + "functions": [{"type": "setHold", "params": { + "holyType": hold_type, + "coolHoldTemp": cool_temp * 10, + "heatHoldTemp": heat_temp * 10, + "fan": fan_mode + }}]} log_msg_action = "set fan mode" return self.make_request(body, log_msg_action)
refactor set_fan_mode
nkgilley_python-ecobee-api
train
py
5fb4f4951073c2f2ce3f9aec840f1e94eb1ba007
diff --git a/src/main/java/com/conveyal/gtfs/loader/ReferenceTracker.java b/src/main/java/com/conveyal/gtfs/loader/ReferenceTracker.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/conveyal/gtfs/loader/ReferenceTracker.java +++ b/src/main/java/com/conveyal/gtfs/loader/ReferenceTracker.java @@ -10,7 +10,7 @@ import static com.conveyal.gtfs.error.NewGTFSErrorType.DUPLICATE_ID; import static com.conveyal.gtfs.error.NewGTFSErrorType.REFERENTIAL_INTEGRITY; /** - * This class is used during feed loads to track the unique keys that are encountered in a GTFS + * This class is used while loading GTFS to track the unique keys that are encountered in a GTFS * feed. It has two sets of strings that it tracks, one for single field keys (e.g., route_id or * stop_id) and one for keys that are compound, usually made up of a string ID with a sequence field * (e.g., trip_id + stop_sequence for tracking unique stop times).
fix(reference-tracker): fix wording; trigger patch with #<I>
conveyal_gtfs-lib
train
java
047b64ba62a2d0605736bfb4384dd40ce8d19e9d
diff --git a/src/motor/Node.js b/src/motor/Node.js index <HASH>..<HASH> 100644 --- a/src/motor/Node.js +++ b/src/motor/Node.js @@ -592,12 +592,16 @@ class Node { * @param {[type]} childNode [description] */ addChild (childNode) { + if (! (childNode instanceof Node)) + throw new Error('Node.addChild expects the childNode argument to be a Node instance.') // We cannot add Scenes to Nodes, for now. // // TODO: If someone extends Scene, constructor.name is different. We // need to catch those cases too, without using instanceof Scene in // order to avoid a circular dependency in this module. + // Idea: maybe we can traverse the prototype chain looking for each + // constructor.name. if (childNode.constructor.name == 'Scene') { throw new Error(` A Scene cannot currently be added to another Node.
Add argument check. TODO: other arg checks for other methods? The downside is performance cost, but may be worth it in order for things to just work. Another option could be to encourage the use of Facebook Flow or Typescript for type checking at compile time, therefore preventing runtime performance cost.
trusktr_infamous
train
js
d6fd840383ae53b0d30ea5c69786b0089954ea9c
diff --git a/lib/lita/handler.rb b/lib/lita/handler.rb index <HASH>..<HASH> 100644 --- a/lib/lita/handler.rb +++ b/lib/lita/handler.rb @@ -28,7 +28,7 @@ module Lita matches_for_route(route, instance) ) end - end + end if defined?(@routes) end private
Don't try to iterate over routes if there aren't any.
litaio_lita
train
rb
d5003feb3946e8b196ac44764d72a7de777b5950
diff --git a/lib/express/spec/mocks.js b/lib/express/spec/mocks.js index <HASH>..<HASH> 100644 --- a/lib/express/spec/mocks.js +++ b/lib/express/spec/mocks.js @@ -62,7 +62,7 @@ var MockResponse = Class({ * Flag response as finished. */ - finish: function() { + close: function() { this.finished = true } })
Fixed mocks to match node api
expressjs_express
train
js
fb2bb83134c1a1dec46459da7d22189974ea1ec5
diff --git a/lib/infer.js b/lib/infer.js index <HASH>..<HASH> 100644 --- a/lib/infer.js +++ b/lib/infer.js @@ -248,14 +248,11 @@ }); function withDisabledComputing(fn, body) { - var oldWorkList = cx.workList; cx.disabledComputing = {fn: fn, prev: cx.disabledComputing}; - cx.workList = null; try { return body(); } finally { cx.disabledComputing = cx.disabledComputing.prev; - cx.workList = oldWorkList; } } var IsCallee = exports.IsCallee = constraint("self, args, argNodes, retval", { @@ -289,8 +286,14 @@ }); var HasMethodCall = constraint("propName, args, argNodes, retval", { + init: function() { + Constraint.prototype.init(); + this.disabled = cx.disabledComputing; + }, addType: function(obj, weight) { - obj.getProp(this.propName).propagate(new IsCallee(obj, this.args, this.argNodes, this.retval), weight); + var callee = new IsCallee(obj, this.args, this.argNodes, this.retval); + callee.disabled = this.disabled; + obj.getProp(this.propName).propagate(callee, weight); }, propHint: function() { return this.propName; } });
Store set of disabled instantiated methods in HasMethodCall constraint This was the reason IsCallee ended up with a bogus set. Issue #<I>
ternjs_tern
train
js
6505c0681be9e95d9330c063139acd84db766b90
diff --git a/src/main/java/com/stratio/cassandra/lucene/service/RegularCellsMapper.java b/src/main/java/com/stratio/cassandra/lucene/service/RegularCellsMapper.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/stratio/cassandra/lucene/service/RegularCellsMapper.java +++ b/src/main/java/com/stratio/cassandra/lucene/service/RegularCellsMapper.java @@ -73,16 +73,11 @@ public class RegularCellsMapper { ColumnFamily columnFamily = row.cf; Columns columns = new Columns(); - // Get row's columns iterator skipping clustering column - Iterator<Cell> cellIterator = columnFamily.iterator(); - cellIterator.next(); - // Stuff for grouping collection columns (sets, lists and maps) String name; CollectionType collectionType; - while (cellIterator.hasNext()) { - Cell cell = cellIterator.next(); + for (Cell cell : columnFamily) { CellName cellName = cell.name(); ColumnDefinition columnDefinition = metadata.getColumnDefinition(cellName); if (columnDefinition == null) {
Fix row updated skipping first column (issue#6)
Stratio_cassandra-lucene-index
train
java
5f91dfde97c54bb0e2da4b5528dcadc5dde87441
diff --git a/test_pycosat.py b/test_pycosat.py index <HASH>..<HASH> 100644 --- a/test_pycosat.py +++ b/test_pycosat.py @@ -1,6 +1,7 @@ import unittest -from pycosat import solve, itersolve, __version__ +import pycosat +from pycosat import solve, itersolve # -------------------------- utility functions --------------------------- @@ -58,7 +59,7 @@ tests = [] class TestSolve(unittest.TestCase): def test_wrong_args(self): - self.assertRaises(TypeError, solve, 'A', []) + self.assertRaises(TypeError, solve, 'A', [[1, 2], [3, 4]]) self.assertRaises(TypeError, solve, 3, {}) self.assertRaises(TypeError, solve, 5, ['a']) self.assertRaises(TypeError, solve, 5, [[1, 2], [3, None]]) @@ -98,7 +99,7 @@ tests.append(TestIterSolve) def run(verbosity=1, repeat=1): try: - print("pycosat version: %r" % __version__) + print("pycosat version: %r" % pycosat.__version__) except AttributeError: pass suite = unittest.TestSuite()
fix test when __version__ is not present
ContinuumIO_pycosat
train
py
9ceea1b007b0ef3183d3a44d10c352f4e5235157
diff --git a/lib/install.js b/lib/install.js index <HASH>..<HASH> 100644 --- a/lib/install.js +++ b/lib/install.js @@ -9,7 +9,7 @@ import { system, tempDir, fs } from 'appium-support'; const log = getLogger('Chromedriver Install'); -const CD_VER = process.env.npm_config_chromedriver_version || "2.20"; +const CD_VER = process.env.npm_config_chromedriver_version || "2.21"; const CD_CDN = process.env.npm_config_chromedriver_cdnurl || process.env.CHROMEDRIVER_CDNURL || "http://chromedriver.storage.googleapis.com";
upgrade chromedriver to <I>
appium_appium-chromedriver
train
js
ff5ddd50f31ca5cc8556ba012bf4aeb9b501baf4
diff --git a/flink-addons/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/HadoopInputFormat.java b/flink-addons/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/HadoopInputFormat.java index <HASH>..<HASH> 100644 --- a/flink-addons/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/HadoopInputFormat.java +++ b/flink-addons/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/HadoopInputFormat.java @@ -78,6 +78,7 @@ public class HadoopInputFormat<K extends Writable, V extends Writable> implement this.valueClass = value; HadoopUtils.mergeHadoopConf(job); this.jobConf = job; + ReflectionUtils.setConf(mapredInputFormat, jobConf); } public void setJobConf(JobConf job) {
[FLINK-<I>] Fix HadoopInputFormat to work without prior serialization.
apache_flink
train
java
8bf62315a734d3e34d2dbaeba92d6ea41a0e3287
diff --git a/master/buildbot/process/botmaster.py b/master/buildbot/process/botmaster.py index <HASH>..<HASH> 100644 --- a/master/buildbot/process/botmaster.py +++ b/master/buildbot/process/botmaster.py @@ -226,7 +226,7 @@ class BotMaster(service.MultiService): if isinstance(b, Builder)], fireOnOneErrback=True) def _add(ign): - log.msg("setBuilders._add: %s %s" % (list(self), builders)) + log.msg("setBuilders._add: %s %s" % (list(self), [b.name for b in builders])) for b in builders: for slavename in b.slavenames: # this is actually validated earlier
botmaster: shorter log, only names of builders We have too many of them, the log was so bloated.
buildbot_buildbot
train
py
fa39762180d4782067f4770fc23a4db9f044d4d8
diff --git a/tests/DependencyInjection/Compiler/DoctrineMiddlewarePassTest.php b/tests/DependencyInjection/Compiler/DoctrineMiddlewarePassTest.php index <HASH>..<HASH> 100644 --- a/tests/DependencyInjection/Compiler/DoctrineMiddlewarePassTest.php +++ b/tests/DependencyInjection/Compiler/DoctrineMiddlewarePassTest.php @@ -45,8 +45,7 @@ class DoctrineMiddlewarePassTest extends AbstractCompilerPassTestCase $this->compile(); - $this->assertEmpty($this->container->getDefinitions()); - $this->assertEmpty($this->container->getAliases()); + $this->assertContainerBuilderNotHasService('tactician.middleware.doctrine'); } public function test_do_not_process_when_tactician_doctrine_is_not_installed() @@ -60,7 +59,6 @@ class DoctrineMiddlewarePassTest extends AbstractCompilerPassTestCase $this->compile(); - $this->assertEmpty($this->container->getDefinitions()); - $this->assertEmpty($this->container->getAliases()); + $this->assertContainerBuilderNotHasService('tactician.middleware.doctrine'); } }
Fix tests in Symfony <I> and up The service_container is now registered by default in the container, so we can't safely declare the container has no services anymore.
thephpleague_tactician-bundle
train
php
1b859fe9e88caacd2847a0a4b286ee2705cdd766
diff --git a/representatives/templatetags/representatives_tags.py b/representatives/templatetags/representatives_tags.py index <HASH>..<HASH> 100644 --- a/representatives/templatetags/representatives_tags.py +++ b/representatives/templatetags/representatives_tags.py @@ -24,7 +24,7 @@ def chamber_icon(chamber): @register.filter def mandate_date(date, arg=None): - if date.year == 9999: + if date is None or date.year == 9999: return 'present' else: return naturalday(date, arg)
Mandate with no end date = present
political-memory_django-representatives
train
py