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
5559e14bb3c81d5046dac11f21d57e7de28272eb
diff --git a/pymatgen/phasediagram/analyzer.py b/pymatgen/phasediagram/analyzer.py index <HASH>..<HASH> 100644 --- a/pymatgen/phasediagram/analyzer.py +++ b/pymatgen/phasediagram/analyzer.py @@ -68,7 +68,7 @@ class PDAnalyzer(object): if set(comp.elements).difference(self._pd.elements): raise ValueError('{} has elements not in the phase diagram {}' ''.format(comp, self._pd.elements)) - c = [comp.get_atomic_fraction(e) for e in self._pd.elements[1:]] + c = self._pd.pd_coords(comp) for f, s in zip(self._pd.facets, self._pd.simplexes): if s.in_simplex(c, PDAnalyzer.numerical_tol / 10): return f, s @@ -245,8 +245,8 @@ class PDAnalyzer(object): # the reduced dimensionality Simplexes don't use the # first element in the PD - c1 = np.array([comp1.get_atomic_fraction(e) for e in pd_els[1:]]) - c2 = np.array([comp2.get_atomic_fraction(e) for e in pd_els[1:]]) + c1 = self._pd.pd_coords(comp1) + c2 = self._pd.pd_coords(comp2) intersections = [c1, c2] for sc in self._pd.simplexes:
refactoring to use PhaseDiagram.pd_coords
materialsproject_pymatgen
train
py
221aab3352ebef9b7f3d215b8adafcb44db1c3ff
diff --git a/lib/core/topologies/replset.js b/lib/core/topologies/replset.js index <HASH>..<HASH> 100644 --- a/lib/core/topologies/replset.js +++ b/lib/core/topologies/replset.js @@ -300,15 +300,11 @@ function connectNewServers(self, servers, callback) { // Destroyed if (self.state === DESTROYED || self.state === UNREFERENCED) { - return this.destroy({ force: true }); + this.destroy({ force: true }); + return done(); } if (event === 'connect') { - // Destroyed - if (self.state === DESTROYED || self.state === UNREFERENCED) { - return _self.destroy({ force: true }); - } - // Update the state var result = self.s.replicaSetState.update(_self); // Update the state with the new server @@ -363,8 +359,7 @@ function connectNewServers(self, servers, callback) { connectingServer.destroy({ force: true }); self.s.connectingServers.splice(existingServerIdx, 1); - done(); - return; + return done(); } // Create a new server instance
refactor(replset): reduce server count when destroyed
mongodb_node-mongodb-native
train
js
a6ff929e2293c0b291f07dfaac71d56977f55b89
diff --git a/system/src/Grav/Console/Gpm/IndexCommand.php b/system/src/Grav/Console/Gpm/IndexCommand.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Console/Gpm/IndexCommand.php +++ b/system/src/Grav/Console/Gpm/IndexCommand.php @@ -111,6 +111,16 @@ class IndexCommand extends ConsoleCommand $climate = new CLImate; $climate->extend('Grav\Console\TerminalObjects\Table'); + if (!$data) { + $this->output->writeln('No data was found in the GPM repository stored locally.'); + $this->output->writeln('Please try clearing cache and running the <green>bin/gpm index -f</green> command again'); + $this->output->writeln('If this doesn\'t work try tweaking your GPM system settings.'); + $this->output->writeln(''); + $this->output->writeln('For more help go to: https://learn.getgrav.org/troubleshooting'); + + die; + } + foreach ($data as $type => $packages) { $this->output->writeln("<green>" . strtoupper($type) . "</green> [ " . count($packages) . " ]"); $packages = $this->sort($packages);
If there is no repository data, display a nicer message with details on how to proceed to potentially fix it
getgrav_grav
train
php
c088700e2d4a2f5e509ec9067523f261cd6ccb88
diff --git a/lib/bibreformat.py b/lib/bibreformat.py index <HASH>..<HASH> 100644 --- a/lib/bibreformat.py +++ b/lib/bibreformat.py @@ -126,7 +126,7 @@ def bibreformat_task(fmt, sql, sql_queries, cds_query, process_format, process, write_message("Querying database (%s) ..." % sql_query, verbose=2) recIDs |= intbitset(run_sql(sql_query)) - if fmt == "HDREF": + if fmt == "HDREF" and recIDs: # HDREF represents the references tab # the tab needs to be recomputed not only when the record changes # but also when one of the citations changes
BibFormat: HDREF processing bug fix * Fixes bug that would occur with empty records when processing HDREF. (closes #<I>)
inveniosoftware_invenio-formatter
train
py
244c43c3ecb66a8a8534414bbc7f15b4f049ed22
diff --git a/src/lib/Supra/Controller/Pages/Twig/TwigSupraBlockGlobal.php b/src/lib/Supra/Controller/Pages/Twig/TwigSupraBlockGlobal.php index <HASH>..<HASH> 100644 --- a/src/lib/Supra/Controller/Pages/Twig/TwigSupraBlockGlobal.php +++ b/src/lib/Supra/Controller/Pages/Twig/TwigSupraBlockGlobal.php @@ -54,6 +54,23 @@ class TwigSupraBlockGlobal } /** + * Checks, wheiter block property have raw value (RAW - means value without CMS div wrappers) + * @param string $name + * @return boolean + */ + public function isEmpty($name) + { + if (empty($name)) { + return; + } + + $propertyValue = $this->blockController->getProperty($name) + ->getValue(); + + return empty($propertyValue); + } + + /** * Mark image for preload * @param string $imageId * @param integer $width
Task #<I>: Block titles fast-fix implementation of isEmpty method, to check, does property have non-empty raw value or not (raw means value without cms editable div wrappers)
sitesupra_sitesupra
train
php
23b0670ab399730f7f4109957a91258e260d991d
diff --git a/test/unit/serializers/cbor.spec.js b/test/unit/serializers/cbor.spec.js index <HASH>..<HASH> 100644 --- a/test/unit/serializers/cbor.spec.js +++ b/test/unit/serializers/cbor.spec.js @@ -62,4 +62,16 @@ describe("Test CborSerializer", () => { expect(res).toEqual(input); }); + + it("should allow maps to be serialized with useTag259ForMaps option true", () => { + const options = { useTag259ForMaps: true }; + const optsSerializer = new CborSerializer(options); + optsSerializer.init(); + + const input = new Map([["foo", "bar"], ["baz", "qux"]]); + const s = optsSerializer.serialize(input); + const res = optsSerializer.deserialize(s); + + expect(res).toEqual(input); + }); });
Add additional cbor test for useTag<I>ForMaps
moleculerjs_moleculer
train
js
dd19951b726017b463a3a24a1e589faf487734b0
diff --git a/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py b/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py index <HASH>..<HASH> 100644 --- a/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py +++ b/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py @@ -7,7 +7,7 @@ import requests from dagster.core.launcher.base import RunLauncher from dagster.grpc.types import ExecuteRunArgs from dagster.serdes import ConfigurableClass, serialize_dagster_namedtuple -from dagster.utils.backcompat import experimental_class_warning +from dagster.utils.backcompat import experimental @dataclass @@ -19,9 +19,9 @@ class TaskMetadata: container_definition: Dict[str, Any] +@experimental class EcsRunLauncher(RunLauncher, ConfigurableClass): def __init__(self, inst_data=None, boto3_client=boto3.client("ecs")): - experimental_class_warning("EcsRunLauncher") self._inst_data = inst_data self.ecs = boto3_client
Decorate EcsRunLauncher as experimental Summary: Now that <URL>
dagster-io_dagster
train
py
990239887cdec1c8b533aa3c180e5bb4ce379f5a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,9 +15,15 @@ with open(os.path.join(here, 'CHANGES.rst')) as changes: NAME = 'aioimaplib' -requires = [ +tests_require = [ + 'nose', + 'asynctest', + 'mock', + 'pytz', + 'tzlocal', + 'imaplib2', + 'docutils' ] - setup( name=NAME, version='0.7.1', @@ -39,5 +45,6 @@ setup( include_package_data=True, zip_safe=False, test_suite="nose.collector", - install_requires=requires, + install_requires=[], + tests_require=tests_require, )
[build] Add tests' requires in setup.py
bamthomas_aioimaplib
train
py
00045fb2a6ae11768cd6275cf78fc5d2717b10e6
diff --git a/lib/macho/load_commands.rb b/lib/macho/load_commands.rb index <HASH>..<HASH> 100644 --- a/lib/macho/load_commands.rb +++ b/lib/macho/load_commands.rb @@ -89,11 +89,11 @@ module MachO :LC_CODE_SIGNATURE => "LinkeditDataCommand", :LC_SEGMENT_SPLIT_INFO => "LinkeditDataCommand", :LC_REEXPORT_DYLIB => "DylibCommand", - :LC_LAZY_LOAD_DYLIB => "LoadCommand", # undoc, maybe DylibCommand? + :LC_LAZY_LOAD_DYLIB => "DylibCommand", :LC_ENCRYPTION_INFO => "EncryptionInfoCommand", :LC_DYLD_INFO => "DyldInfoCommand", :LC_DYLD_INFO_ONLY => "DyldInfoCommand", - :LC_LOAD_UPWARD_DYLIB => "LoadCommand", # undoc, maybe DylibCommand? + :LC_LOAD_UPWARD_DYLIB => "DylibCommand", :LC_VERSION_MIN_MACOSX => "VersionMinCommand", :LC_VERSION_MIN_IPHONEOS => "VersionMinCommand", :LC_FUNCTION_STARTS => "LinkeditDataCommand",
map lazy/upward dylib to proper load command Both `LC_LAZY_LOAD_DYLIB` and `LC_LOAD_UPWARD_DYLIB` are represented as a `DylibCommand` internally as can be verified by creating test dylibs with the `-lazy_library` and `-upward_library` linker arguments.
Homebrew_ruby-macho
train
rb
ec7f8c07d9765c8b9292d03f509964ee0835d9bc
diff --git a/support/cas-server-support-throttle-bucket4j/src/main/java/org/apereo/cas/web/Bucket4jThrottledRequestExecutor.java b/support/cas-server-support-throttle-bucket4j/src/main/java/org/apereo/cas/web/Bucket4jThrottledRequestExecutor.java index <HASH>..<HASH> 100644 --- a/support/cas-server-support-throttle-bucket4j/src/main/java/org/apereo/cas/web/Bucket4jThrottledRequestExecutor.java +++ b/support/cas-server-support-throttle-bucket4j/src/main/java/org/apereo/cas/web/Bucket4jThrottledRequestExecutor.java @@ -53,8 +53,9 @@ public class Bucket4jThrottledRequestExecutor implements ThrottledRequestExecuto if (this.blocking) { LOGGER.trace("Attempting to consume a token for the authentication attempt"); result = !this.bucket.tryConsume(1, MAX_WAIT_NANOS, BlockingStrategy.PARKING); + } else { + result = !this.bucket.tryConsume(1); } - result = !this.bucket.tryConsume(1); } catch (final InterruptedException e) { LOGGER.error(e.getMessage(), e); Thread.currentThread().interrupt();
Consume bucket once when blocking property is enabled. (#<I>)
apereo_cas
train
java
884cfdfd460a90b59150c648d32ca7a10d097b12
diff --git a/cytomine/models/software.py b/cytomine/models/software.py index <HASH>..<HASH> 100755 --- a/cytomine/models/software.py +++ b/cytomine/models/software.py @@ -212,7 +212,7 @@ class Job(Model): job_id=self.id, statusComment=attributes.get("statusComment", self.statusComment), status=_HUMAN_READABLE_JOB_STATUS[attributes.get("status", self.status)], - progress=attributes.get("progess", self.progress) + progress=attributes.get("progress", self.progress) ) ) return super(Job, self).update(id=id, **attributes)
Fix typo in job status update (cherry picked from commit 0eca<I>d2d<I>a7e0a3d<I>b<I>f0fad<I>e1ed1d1)
cytomine_Cytomine-python-client
train
py
9fa692ba163921cfa88d0cc011708f2a64f8af05
diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/signing.py b/datadog_checks_dev/datadog_checks/dev/tooling/signing.py index <HASH>..<HASH> 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/signing.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/signing.py @@ -96,7 +96,14 @@ def update_link_metadata(checks, core_workflow=True): products = [] for check in checks: products.append(path_join(check, 'datadog_checks')) - products.append(path_join(check, 'setup.py')) + + setup_file = path_join(check, 'setup.py') + if file_exists(setup_file): + products.append(setup_file) + + project_file = path_join(check, 'pyproject.toml') + if file_exists(project_file): + products.append(project_file) dep_file = path_join(check, 'requirements.in') if file_exists(dep_file):
Fix package signing for checks with `pyproject.toml` (#<I>)
DataDog_integrations-core
train
py
23de709aec46612a2b06c9379d0cb54a48e582de
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,19 +22,19 @@ setup(name='python-linkedin', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Natural Language :: English', ], keywords='linkedin python', author='Ozgur Vatansever', author_email='ozgurvt@gmail.com', - maintainer='Ozgur Vatansever', - maintainer_email='ozgurvt@gmail.com', - url='http://ozgur.github.com/python-linkedin/', + maintainer='Marshall Humble', + maintainer_email='humblejm@gmail.com', + url='https://github.com/marshallhumble/python-linkedin', license='MIT', packages=['linkedin'], - install_requires=['requests>=1.1.0', 'requests-oauthlib>=0.3'], + install_requires=['requests>=2.8.1', 'requests-oauthlib>=0.5.0'], zip_safe=False )
Update setup.py Changed settings in the setup.py file; moved to new versions that I am working with, removed <I> support, added <I> changed e-mail addresses
DEKHTIARJonathan_python3-linkedin
train
py
d03e227141ad74298f25ce68c1dd4198abd22623
diff --git a/src/Util/Autoload/ClassLoader.php b/src/Util/Autoload/ClassLoader.php index <HASH>..<HASH> 100644 --- a/src/Util/Autoload/ClassLoader.php +++ b/src/Util/Autoload/ClassLoader.php @@ -16,6 +16,9 @@ use function interface_exists; use function spl_autoload_register; use function trait_exists; +/** + * @deprecated + */ final class ClassLoader { /** @var array<class-string, ReflectionClass> */
Mark ClassLoader as deprecated
Roave_BetterReflection
train
php
3a917963245e49ba00eb8772fb0835773a4a1052
diff --git a/src/ShopifyApp/Messaging/Jobs/AppUninstalledJob.php b/src/ShopifyApp/Messaging/Jobs/AppUninstalledJob.php index <HASH>..<HASH> 100644 --- a/src/ShopifyApp/Messaging/Jobs/AppUninstalledJob.php +++ b/src/ShopifyApp/Messaging/Jobs/AppUninstalledJob.php @@ -10,6 +10,7 @@ use Illuminate\Queue\SerializesModels; use Osiset\ShopifyApp\Actions\CancelCurrentPlan; use Osiset\ShopifyApp\Contracts\Commands\Shop as IShopCommand; use Osiset\ShopifyApp\Contracts\Queries\Shop as IShopQuery; +use function Osiset\ShopifyApp\getShopifyConfig; use Osiset\ShopifyApp\Objects\Values\ShopDomain; use stdClass; @@ -78,6 +79,13 @@ class AppUninstalledJob implements ShouldQueue // Purge shop of token, plan, etc. $shopCommand->clean($shopId); + // Check freemium mode + $freemium = getShopifyConfig('billing_freemium_enabled'); + if ($freemium === true) { + // Add the freemium flag to the shop + $shopCommand->setAsFreemium($shopId); + } + // Soft delete the shop. $shopCommand->softDelete($shopId);
<I>-Freemium mode uninstall flag added on webhook (#<I>) * <I>-Freemium mode uninstall flag added on webhook * styleci fix * styleci fix
ohmybrew_laravel-shopify
train
php
f387d25cf9a5e56549866e1d8fe78e02a7db30ab
diff --git a/concepts/frame-list/main.js b/concepts/frame-list/main.js index <HASH>..<HASH> 100644 --- a/concepts/frame-list/main.js +++ b/concepts/frame-list/main.js @@ -12,7 +12,8 @@ var frameList = FrameList(frames) var state = mercury.hash({ frames: mercury.hash(initialFrameData), - editor: mercury.value(frameList) + editor: mercury.value(null), + frameList: mercury.value(frameList) }) // When the data changes, save it @@ -23,10 +24,12 @@ frameList.onSelectFrame(function (frameId) { var editor = FrameEditor(state.frames[frameId]) state.editor.set(editor) + state.frameList.set(null) editor.onExit(function () { // Restore the frame list - state.editor.set(frameList) + state.frameList.set(frameList) + state.editor.set(null) }) }) @@ -36,7 +39,10 @@ function render(state) { // The immutable internal event list is also passed in // Event listeners are obviously not serializable, but // they can expose their state (listener set) - return h(state.editor.partial()) + return h( + state.editor ? state.editor.partial() : + state.frameList.partial() + ) } // setup the loop and go.
Use two values in the state for editor & frameList This reduces confusion between what is currently rendering. This will avoid duck type checks in the view and allow the rendering wrapper to have a slightly different container for each type of widget.
Raynos_mercury
train
js
aaa2d8ec7098c7f803e65dc47e549f52fc1e3683
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 setup( name='bumpy', - version='0.2.3', + version='0.2.4', description='Create build files and CLI tools easily.', long_description=open('README.rst').read(), url='http://github.com/scizzorz/bumpy',
Bumpy to <I>
scizzorz_bumpy
train
py
17ed8ffd24d21b2bccd0d12c2d0cdf1117db6e44
diff --git a/src/components/player.js b/src/components/player.js index <HASH>..<HASH> 100644 --- a/src/components/player.js +++ b/src/components/player.js @@ -39,6 +39,10 @@ var baseUrl = currentScriptUrl().replace(/\/[^\/]+$/, "") * ``` */ export default class Player extends BaseObject { + + set loader(loader) { this._loader = loader } + get loader() { return this._loader = this._loader || new Loader(this.options.plugins || {}, this.options.playerId) } + /** * ## Player's constructor * @@ -113,8 +117,7 @@ export default class Player extends BaseObject { this.options = $.extend(defaultOptions, options) this.options.sources = this.normalizeSources(options) this.registerOptionEventListeners() - this.loader = new Loader(this.options.plugins || {}, this.options.playerId) - this.coreFactory = new CoreFactory(this, this.loader) + this.coreFactory = new CoreFactory(this) this.playerInfo = PlayerInfo.getInstance(this.options.playerId) this.playerInfo.currentSize = {width: options.width, height: options.height} this.playerInfo.options = this.options
player: allow overriding loader instance by setting the loader property
clappr_clappr
train
js
1af5b9aeedd8bbcc897077bd837b8b0827cf94f8
diff --git a/sources/scalac/transformer/TypesAsValuesPhase.java b/sources/scalac/transformer/TypesAsValuesPhase.java index <HASH>..<HASH> 100644 --- a/sources/scalac/transformer/TypesAsValuesPhase.java +++ b/sources/scalac/transformer/TypesAsValuesPhase.java @@ -975,6 +975,9 @@ public class TypesAsValuesPhase extends Phase { addConstructorsNeededBy(roots, args[i], set); } break; + case CompoundType(Type[] parts, _): + for (int i = 0; i < parts.length; ++i) + addConstructorsNeededBy(roots, parts[i], set); default: ; // nothing to do } @@ -1000,7 +1003,16 @@ public class TypesAsValuesPhase extends Phase { } private boolean isCyclic(Symbol sym) { - return constructorsNeededBy(sym).contains(sym); + HashSet constrs = constructorsNeededBy(sym); + if (constrs.contains(sym)) + return true; + Iterator constrsIt = constrs.iterator(); + while (constrsIt.hasNext()) { + Symbol constr = (Symbol)constrsIt.next(); + if (constr.isAbstractType()) + return true; + } + return false; } /**
- bug fix: include compound types in the comput... - bug fix: include compound types in the computation of the set of constructors needed to compute the parents of a class, - bug fix: handle abstract type members in the detection of classes whose parents have to be computed lazily (thanks Philippe)
scala_scala
train
java
b2556bed071423cff8215f850087ebc8c1ce75f1
diff --git a/phono3py/phonon3/interaction.py b/phono3py/phonon3/interaction.py index <HASH>..<HASH> 100644 --- a/phono3py/phonon3/interaction.py +++ b/phono3py/phonon3/interaction.py @@ -393,6 +393,7 @@ class Interaction(object): decimals=decimals, symprec=self._symprec) + self._phonon_done[0] = 0 if solve_dynamical_matrices: self.run_phonon_solver(verbose=verbose) else:
Unset phonons at Gamma at initialization.
atztogo_phono3py
train
py
c50260b5825de65c79e358e7bdc4ad09be5e9e6b
diff --git a/languagetool-server/src/test/java/org/languagetool/server/HTTPServerMultiLangLoadTest.java b/languagetool-server/src/test/java/org/languagetool/server/HTTPServerMultiLangLoadTest.java index <HASH>..<HASH> 100644 --- a/languagetool-server/src/test/java/org/languagetool/server/HTTPServerMultiLangLoadTest.java +++ b/languagetool-server/src/test/java/org/languagetool/server/HTTPServerMultiLangLoadTest.java @@ -100,8 +100,7 @@ public class HTTPServerMultiLangLoadTest extends HTTPServerLoadTest { } private Language getRandomLanguage() { - Random rnd = new Random(); - int randomNumber = rnd.nextInt(langCodeToText.size()); + int randomNumber = random.nextInt(langCodeToText.size()); int i = 0; for (Language lang : langCodeToText.keySet()) { if (i++ == randomNumber) {
use a static seed for better reproducability
languagetool-org_languagetool
train
java
4ee6f591272c988d39ca80d3f592843a74f3ec49
diff --git a/code/search/filters/OrderFilters.php b/code/search/filters/OrderFilters.php index <HASH>..<HASH> 100644 --- a/code/search/filters/OrderFilters.php +++ b/code/search/filters/OrderFilters.php @@ -58,7 +58,7 @@ class OrderFilters_MustHaveAtLeastOnePayment extends SearchFilter { $value = $this->getValue(); if($value) { return $query->innerJoin( - $table = "\"Payment\"", + $table = "Payment", // framework already applies quotes to table names here! $onPredicate = "\"Payment\".\"OrderID\" = \"Order\".\"ID\"", $tableAlias=null );
Framework already applies quotes to table names in function params - this would break MySQL
silvershop_silvershop-core
train
php
c206fea7026234975dcfa51f3d8e0a423297ae3c
diff --git a/src/on/_domeventregexp.js b/src/on/_domeventregexp.js index <HASH>..<HASH> 100644 --- a/src/on/_domeventregexp.js +++ b/src/on/_domeventregexp.js @@ -1,3 +1,3 @@ // the regexp allows to parse things like "click::x(.y)" // it's shared between few modules -export default /([^::]+)::([^\(\)]+)?(?:\((.*)\))?/; +export default /([^::]+)::([^()]+)?(?:\((.*)\))?/; diff --git a/src/parsebindings/_parserdata.js b/src/parsebindings/_parserdata.js index <HASH>..<HASH> 100644 --- a/src/parsebindings/_parserdata.js +++ b/src/parsebindings/_parserdata.js @@ -29,7 +29,7 @@ calc(parserData, { }, escRightBracket: { source: 'rightBracket', - handler: right => right.replace(/(\]|\)|\?)/g, '\\$1') + handler: right => right.replace(/(]|\)|\?)/g, '\\$1') }, bindingReg: { source: ['escLeftBracket', 'escRightBracket'],
refactor: Get rid of newly appeared ESLint errors
matreshkajs_matreshka
train
js,js
a6f0bf26c6b553bf3c7e568cd889f0b94fd39b65
diff --git a/ioc_module.new-object-model.js b/ioc_module.new-object-model.js index <HASH>..<HASH> 100644 --- a/ioc_module.new-object-model.js +++ b/ioc_module.new-object-model.js @@ -35,12 +35,10 @@ function registerInContainer(container) { .dependencies('FlowNodeHandlerFactory', 'MessageBusService', 'EventAggregator'); container.register('FlowNodeInstanceService', FlowNodeInstanceService) - .dependencies('FlowNodeInstanceRepository', 'IamServiceNew') - .singleton(); + .dependencies('FlowNodeInstanceRepository', 'IamServiceNew'); container.register('ProcessModelService', ProcessModelService) - .dependencies('ProcessDefinitionRepository', 'IamServiceNew', 'BpmnModelParser') - .singleton(); + .dependencies('ProcessDefinitionRepository', 'IamServiceNew', 'BpmnModelParser'); container.register('ExecutionContextFacadeFactory', ExecutionContextFacadeFactory) .singleton();
Remove singleton registration from persistence services to enable mocking
process-engine_process_engine_core
train
js
365d74dd2df643381f11aa14b50296fa6073ddb2
diff --git a/dna.js b/dna.js index <HASH>..<HASH> 100755 --- a/dna.js +++ b/dna.js @@ -369,6 +369,7 @@ dna.panels = { if (loc === undefined) loc = dna.pageToken.get(key, 0); loc = Math.max(0, Math.min(loc, menuItems.length - 1)); + menu[0].selectedIndex = loc; //case where menu is a drop-down elem (<select>) menuItems.removeClass('selected').addClass('unselected') .eq(loc).addClass('selected').removeClass('unselected'); panels = $(key).children().hide().removeClass('displayed').addClass('hidden');
Fix drop-down panel selector not remembering user's selection
dnajs_dna.js
train
js
be4020cd34b5a1ba8d3790bacee144311ad28dd3
diff --git a/src/test/java/com/couchbase/client/dcp/perfrunner/PerformanceTestDriver.java b/src/test/java/com/couchbase/client/dcp/perfrunner/PerformanceTestDriver.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/couchbase/client/dcp/perfrunner/PerformanceTestDriver.java +++ b/src/test/java/com/couchbase/client/dcp/perfrunner/PerformanceTestDriver.java @@ -145,6 +145,7 @@ class PerformanceTestDriver { } latch.countDown(); + flowController.ack(event); event.release(); } });
Gardening: Add missing flow control ACK in performance test driver Change-Id: I<I>aed<I>be<I>f<I>f0c<I>bcd1d8cf<I> Reviewed-on: <URL>
couchbase_java-dcp-client
train
java
d4fe15a7ac0501fbc69ecbb3c6696d7b8f46339b
diff --git a/bin/deepword.js b/bin/deepword.js index <HASH>..<HASH> 100755 --- a/bin/deepword.js +++ b/bin/deepword.js @@ -5,7 +5,7 @@ const fs = require('fs'); const args = process.argv.slice(2); const [name] = args; - + if (!name) usage(); else if (/^(-v|--v)$/.test(name))
chore(deepword) rm " "
cloudcmd_deepword
train
js
19ffff3afed7fc358243eb275812bbb78efc4d23
diff --git a/cuser/admin.py b/cuser/admin.py index <HASH>..<HASH> 100644 --- a/cuser/admin.py +++ b/cuser/admin.py @@ -31,6 +31,7 @@ class UserAdmin(BaseUserAdmin): search_fields = ('email', 'first_name', 'last_name') ordering = ('email',) + if CUSER_SETTINGS['register_proxy_auth_group_model']: admin.site.unregister(StockGroup)
Addressed PEP 8 error E<I>
tmm_django-username-email
train
py
662d1c20792ec52feff248b3bbe0b5102f9ef1b2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ setup( license="MIT", classifiers=[ "Programming Language :: Python", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7",
setup.py: Remove Python <I> since it's not tested
manrajgrover_halo
train
py
753c7c2e5d554cc9557985e80b81af7e96172889
diff --git a/cumulusci/core/config/OrgConfig.py b/cumulusci/core/config/OrgConfig.py index <HASH>..<HASH> 100644 --- a/cumulusci/core/config/OrgConfig.py +++ b/cumulusci/core/config/OrgConfig.py @@ -38,7 +38,7 @@ class OrgConfig(BaseConfig): self.global_org = global_org self.name = name - self.is_sandbox = config.get("sandbox", False) if config else False + self.force_sandbox = config.get("sandbox", False) if config else False self._community_info_cache = {} self._latest_api_version = None self._installed_packages = None @@ -62,7 +62,7 @@ class OrgConfig(BaseConfig): SFDX_CLIENT_ID = os.environ.get("SFDX_CLIENT_ID") SFDX_HUB_KEY = os.environ.get("SFDX_HUB_KEY") if SFDX_CLIENT_ID and SFDX_HUB_KEY: - auth_url = SANDBOX_LOGIN_URL if self.is_sandbox else self.id + auth_url = SANDBOX_LOGIN_URL if self.force_sandbox else self.id info = jwt_session( SFDX_CLIENT_ID, SFDX_HUB_KEY,
rename to force_sandbox
SFDO-Tooling_CumulusCI
train
py
46cefc737a7580188deaec648407fef038462bc5
diff --git a/core/Registry.php b/core/Registry.php index <HASH>..<HASH> 100644 --- a/core/Registry.php +++ b/core/Registry.php @@ -53,7 +53,7 @@ class Registry public function getKey($key) { if(!$this->hasKey($key)) { - return null; + throw new \Exception(sprintf("Key '%s' doesn't exist in Registry", $key)); } return $this->data[$key]; }
Fix failing tests by throwing Exception when accessing unset value.
matomo-org_matomo
train
php
4ad359a330b7f2bdc7c9fd538e34dda30a4b6777
diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index <HASH>..<HASH> 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -54,7 +54,8 @@ var indentationFilter = [ '!**/vs/loader.js', '!extensions/**/snippets/**', '!extensions/**/syntaxes/**', - '!extensions/**/themes/**' + '!extensions/**/themes/**', + '!extensions/**/colorize-fixtures/**' ]; var copyrightFilter = [
exclude colorize-fixtures from hygiene
Microsoft_vscode
train
js
29b4d46c930b03dea285d95b46bb056d628ff983
diff --git a/nni/algorithms/compression/pytorch/pruning/amc/amc_pruner.py b/nni/algorithms/compression/pytorch/pruning/amc/amc_pruner.py index <HASH>..<HASH> 100644 --- a/nni/algorithms/compression/pytorch/pruning/amc/amc_pruner.py +++ b/nni/algorithms/compression/pytorch/pruning/amc/amc_pruner.py @@ -14,8 +14,6 @@ from .channel_pruning_env import ChannelPruningEnv from .lib.agent import DDPG from .lib.utils import get_output_folder -torch.backends.cudnn.deterministic = True - _logger = logging.getLogger(__name__) class AMCPruner(Pruner):
Update amc_pruner.py (#<I>)
Microsoft_nni
train
py
0579ca4cabd2e19fd57fdda887735a2d2e25b72b
diff --git a/iodaemon/link.go b/iodaemon/link.go index <HASH>..<HASH> 100644 --- a/iodaemon/link.go +++ b/iodaemon/link.go @@ -59,14 +59,12 @@ func link(socketPath string) { go func() { io.Copy(inputWriter, os.Stdin) inputWriter.Close() - os.Stdin.Close() }() streaming.Add(1) go func() { io.Copy(os.Stdout, stdout) stdout.Close() - os.Stdout.Close() streaming.Done() }() @@ -74,7 +72,6 @@ func link(socketPath string) { go func() { io.Copy(os.Stderr, stderr) stderr.Close() - os.Stderr.Close() streaming.Done() }()
nix extraneous stdio closes; makes debugging hard
cloudfoundry-attic_garden-linux
train
go
323764014f10ef0fa90071f5675bb4ca26d5ade1
diff --git a/schiene/schiene.py b/schiene/schiene.py index <HASH>..<HASH> 100755 --- a/schiene/schiene.py +++ b/schiene/schiene.py @@ -9,7 +9,7 @@ def parse_connections(html): soup = BeautifulSoup(html, "lxml") connections = list() - for row in soup.find_all("td", class_="overview timelink")[1:]: + for row in soup.find_all("td", class_="overview timelink"): columns = row.parent.find_all("td") try:
prase connections from first table row
kennell_schiene
train
py
3570fd6575e40f0599cdad69f0db144471a1ca56
diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java index <HASH>..<HASH> 100644 --- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java +++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java @@ -21,7 +21,7 @@ class ActivityUtils { private final Instrumentation inst; private ActivityMonitor activityMonitor; - private Activity activity, storedActivity;; + private Activity activity; private final Sleeper sleeper; private ArrayList<Activity> activityList = new ArrayList<Activity>(); @@ -138,7 +138,7 @@ class ActivityUtils { if (activityMonitor.getLastActivity() != null) activity = activityMonitor.getLastActivity(); } - + Activity storedActivity; for(int i = 0; i < activityList.size(); i++){ storedActivity = activityList.get(i); if (storedActivity.getClass().getName().equals(
Changed member variable to local variable.
RobotiumTech_robotium
train
java
1ddd4f5db4676a13dc8b0d7e4726c5e1f8e315f2
diff --git a/lib/Doctrine/Import/Builder.php b/lib/Doctrine/Import/Builder.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Import/Builder.php +++ b/lib/Doctrine/Import/Builder.php @@ -457,6 +457,10 @@ END; $a[] = '\'onUpdate\' => ' . var_export($relation['onUpdate'], true); } + if (isset($relation['equal']) && $relation['equal']) { + $a[] = '\'equal\' => ' . var_export($relation['equal'], true); + } + if ( ! empty($a)) { $ret[$i] .= ', ' . 'array('; $length = strlen($ret[$i]);
Added back the generation of "equal: true" from schema files.
doctrine_annotations
train
php
b76142a1acd4230b7b28417cac5834a6e9a75aa2
diff --git a/curtsies/__init__.py b/curtsies/__init__.py index <HASH>..<HASH> 100644 --- a/curtsies/__init__.py +++ b/curtsies/__init__.py @@ -1,5 +1,5 @@ """Terminal-formatted strings""" -__version__="0.3.2" +__version__ = "0.3.2" from .window import FullscreenWindow, CursorAwareWindow from .input import Input diff --git a/curtsies/termhelpers.py b/curtsies/termhelpers.py index <HASH>..<HASH> 100644 --- a/curtsies/termhelpers.py +++ b/curtsies/termhelpers.py @@ -13,6 +13,7 @@ class Nonblocking(object): """ A context manager for making an input stream nonblocking. """ + def __init__(self, stream): # type: (IO) -> None self.stream = stream
ran black on all of curtsies (#<I>)
bpython_curtsies
train
py,py
72d4947d127d332c1e2db04b81d28f20dccb6da3
diff --git a/app/models/host/discovered.rb b/app/models/host/discovered.rb index <HASH>..<HASH> 100644 --- a/app/models/host/discovered.rb +++ b/app/models/host/discovered.rb @@ -16,10 +16,10 @@ class Host::Discovered < ::Host::Base # Discovered hosts don't have a name yet - use MAC for now # TODO: make this more intelligent, we might not have an eth0... when Puppet::Node::Facts - name = facts.values["macaddress_eth0"].downcase + name = facts.values["macaddress_eth0"].downcase.gsub(/:/,'') values = facts.values when Hash - name = facts["macaddress_eth0"].downcase + name = facts["macaddress_eth0"].downcase.gsub(/:/,'') values = facts return raise("invalid facts hash") unless name and values else
Downcase and remove colons from discovered host names for safety
theforeman_foreman_discovery
train
rb
53cb0633595e45265871048d03451a12bcbfc6f7
diff --git a/spec/remove.spec.js b/spec/remove.spec.js index <HASH>..<HASH> 100644 --- a/spec/remove.spec.js +++ b/spec/remove.spec.js @@ -73,6 +73,40 @@ describe('remove', function () { }); }); + describe.only('will retry attempt if file is locked', function () { + var preparations = function () { + fse.mkdirsSync('a/b/c'); + fse.outputFileSync('a/f.txt', 'abc'); + fse.outputFileSync('a/b/f.txt', '123'); + }; + + var expectations = function () { + path('a').shouldNotExist(); + }; + + it('async', function (done) { + preparations(); + + fse.open('a/f.txt', 'w', function (err, fd) { + if (err) { + done(err); + } else { + // Unlock the file after some time. + setTimeout(function () { + fse.close(fd); + }, 150); + + jetpack.removeAsync('a') + .then(function () { + expectations(); + done(); + }) + .catch(done); + } + }); + }); + }); + describe('respects internal CWD of jetpack instance', function () { var preparations = function () { fse.outputFileSync('a/b/c.txt', '123');
Attempt to write a test about files locking for removeAsync()
szwacz_fs-jetpack
train
js
fb9f362094dbafd4a3d624a4bd611a77c0fd5081
diff --git a/lib/wavefile/reader.rb b/lib/wavefile/reader.rb index <HASH>..<HASH> 100644 --- a/lib/wavefile/reader.rb +++ b/lib/wavefile/reader.rb @@ -128,7 +128,7 @@ module WaveFile # General algorithm that works for any number of channels, 2 or greater. num_multichannel_samples.times do |i| sample = Array.new(@native_format.channels) - num_channels.times {|j| sample[j] = samples.pop() } + @native_format.channels.times {|j| sample[j] = samples.pop() } multichannel_data[i] = sample.reverse!() end end
Fixing bug which prevents files with more than 2 channels from being read.
jstrait_wavefile
train
rb
5d54a4bc5e0026201524d1a39f80ecb4097fe0e6
diff --git a/lib/karo/cli.rb b/lib/karo/cli.rb index <HASH>..<HASH> 100644 --- a/lib/karo/cli.rb +++ b/lib/karo/cli.rb @@ -17,7 +17,7 @@ module Karo class_option :config_file, type: :string, default: Config.default_file_name, aliases: "-c", desc: "name of the file containing server configuration" - class_option :environment, aliases: "-e", desc: "server environment", default: "production" + class_option :environment, aliases: "-e", desc: "server environment", default: "staging" class_option :verbose, type: :boolean, lazy_default: true, aliases: "-v", desc: "verbose" class_option :dryrun, type: :boolean, lazy_default: true, aliases: "-d", desc: "dry-run"
Change default cli enviornment to staging to prevent accidental prod deploys
rahult_karo
train
rb
3460d1287619f2df5f914efcbc3cb310e9714e11
diff --git a/sdk/dotnet/cmd/pulumi-language-dotnet/main.go b/sdk/dotnet/cmd/pulumi-language-dotnet/main.go index <HASH>..<HASH> 100644 --- a/sdk/dotnet/cmd/pulumi-language-dotnet/main.go +++ b/sdk/dotnet/cmd/pulumi-language-dotnet/main.go @@ -332,7 +332,7 @@ func (host *dotnetLanguageHost) DeterminePluginDependency( func (host *dotnetLanguageHost) DotnetBuild( ctx context.Context, req *pulumirpc.GetRequiredPluginsRequest, engineClient pulumirpc.EngineClient) error { - args := []string{"build"} + args := []string{"build", "-nologo"} if req.GetProgram() != "" { args = append(args, req.GetProgram())
Reduce the output of dotnet build (#<I>)
pulumi_pulumi
train
go
fc6ca0627810702249ff78198f73ec38f3fab999
diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index <HASH>..<HASH> 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -548,7 +548,7 @@ class TargetAndroid(Target): '{python} build.py --name {name}' ' --version {version}' ' --package {package}' - ' --{storage_type} {appdir}' + ' --{storage_type} "{appdir}"' ' --sdk {androidsdk}' ' --minsdk {androidminsdk}').format( python=executable,
Fixes app path issue which lead to build fails. Fixes #<I> * The build fails when there is a space in the Application path. * This small fix resolves that issue.
kivy_buildozer
train
py
e33fb9d5d8425f3a5f1039dac437f5ee146fc317
diff --git a/conn_pool.go b/conn_pool.go index <HASH>..<HASH> 100644 --- a/conn_pool.go +++ b/conn_pool.go @@ -143,14 +143,6 @@ func (p *ConnPool) Stat() (s ConnPoolStat) { return } -func (p *ConnPool) MaxConnectionCount() int { - return p.maxConnections -} - -func (p *ConnPool) CurrentConnectionCount() int { - return p.maxConnections -} - func (p *ConnPool) createConnection() (c *Conn, err error) { c, err = Connect(p.config) if err != nil {
Remove ConnPool functions overlapped by Stat
jackc_pgx
train
go
2bb0905cbe9f8a77036129efea850d8d72e3d22b
diff --git a/src/main/java/org/deepsymmetry/beatlink/DeviceUpdate.java b/src/main/java/org/deepsymmetry/beatlink/DeviceUpdate.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/deepsymmetry/beatlink/DeviceUpdate.java +++ b/src/main/java/org/deepsymmetry/beatlink/DeviceUpdate.java @@ -50,7 +50,7 @@ public abstract class DeviceUpdate { packetBytes = new byte[packet.getLength()]; System.arraycopy(packet.getData(), 0, packetBytes, 0, packet.getLength()); timestamp = System.currentTimeMillis(); - deviceName = new String(packetBytes, 12, 20).trim(); + deviceName = new String(packetBytes, 11, 20).trim(); deviceNumber = Util.unsign(packetBytes[36]); }
Fix missing first name character in device updates
Deep-Symmetry_beat-link
train
java
1d56f00d1f99e11db378feaa80217b532c191be0
diff --git a/src/Agent.php b/src/Agent.php index <HASH>..<HASH> 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -107,13 +107,14 @@ class Agent * @throws \PhilKra\Exception\Transaction\DuplicateTransactionNameException * * @param string $name + * @param array $context * * @return Transaction */ - public function startTransaction(string $name): Transaction + public function startTransaction(string $name, array $context = []): Transaction { // Create and Store Transaction - $this->transactionsStore->register(new Transaction($name, $this->sharedContext)); + $this->transactionsStore->register(new Transaction($name, array_replace_recursive($this->sharedContext, $context))); // Start the Transaction $transaction = $this->transactionsStore->fetch($name); @@ -163,12 +164,13 @@ class Agent * @link http://php.net/manual/en/class.throwable.php * * @param \Throwable $thrown + * @param array $context * * @return void */ - public function captureThrowable(\Throwable $thrown) + public function captureThrowable(\Throwable $thrown, array $context = []) { - $this->errorsStore->register(new Error($thrown, $this->sharedContext)); + $this->errorsStore->register(new Error($thrown, array_replace_recursive($this->sharedContext, $context))); } /**
Allows specifying a context to merge with the shared context for every capture or transaction
philkra_elastic-apm-php-agent
train
php
999ca1093d2eb85f9c4129f9b6342175557c2a10
diff --git a/zip/writer.go b/zip/writer.go index <HASH>..<HASH> 100644 --- a/zip/writer.go +++ b/zip/writer.go @@ -125,7 +125,7 @@ func (w *Writer) Close() error { b.uint16(uint16(len(h.Comment))) b = b[4:] // skip disk number start and internal file attr (2x uint16) b.uint32(h.ExternalAttrs) - if h.offset > uint32max { + if h.isZip64() || h.offset > uint32max { b.uint32(uint32max) } else { b.uint32(uint32(h.offset))
zip: Re-add zip<I> fix (#<I>) Accidentally reverted #<I> in #<I> Fixes #<I>
klauspost_compress
train
go
4de70e270a671baf1c6e85bc500540908ccd4119
diff --git a/pytest_ansible/plugin.py b/pytest_ansible/plugin.py index <HASH>..<HASH> 100644 --- a/pytest_ansible/plugin.py +++ b/pytest_ansible/plugin.py @@ -3,6 +3,7 @@ import logging from pkg_resources import parse_version from .fixtures import (ansible_module_cls, ansible_module, ansible_facts_cls, ansible_facts) from .errors import AnsibleNoHostsMatch, AnsibleHostUnreachable +import collections # conditionally import ansible libraries import ansible @@ -219,7 +220,7 @@ class PyTestAnsiblePlugin: if hasattr(request.function, 'ansible'): return request.function.ansible.kwargs elif request.scope == 'class': - if hasattr(request.cls, 'pytestmark'): + if hasattr(request.cls, 'pytestmark') and isinstance(request.cls.pytestmark, collections.Iterable): for pytestmark in request.cls.pytestmark: if pytestmark.name == 'ansible': return pytestmark.kwargs
Don't assume pytestmark is iterable
ansible_pytest-ansible
train
py
9404505a80a66fe0c13f8229d250bd5dfcb4b421
diff --git a/state/backups/create.go b/state/backups/create.go index <HASH>..<HASH> 100644 --- a/state/backups/create.go +++ b/state/backups/create.go @@ -254,9 +254,8 @@ func writeAll(targetname string, source io.Reader) error { func (b *builder) buildFilesBundle() error { logger.Infof("dumping juju state-related files") - if b.filesToBackUp == nil { - logger.Infof("nothing to do") - return nil + if len(b.filesToBackUp) == 0 { + return errors.New("missing list of files to back up") } if b.bundleFile == nil { return errors.New("missing bundleFile")
Fail if there aren't any files to back up.
juju_juju
train
go
5f2558939bbf4ce180aa5d7c0d534e974bd01a4f
diff --git a/lib/puppet/util/settings/file_setting.rb b/lib/puppet/util/settings/file_setting.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/util/settings/file_setting.rb +++ b/lib/puppet/util/settings/file_setting.rb @@ -16,7 +16,8 @@ class Puppet::Util::Settings::FileSetting < Puppet::Util::Settings::Setting def group=(value) unless AllowedGroups.include?(value) - raise SettingError, "Invalid group %s on setting %s. Valid groups are %s." % [value, name, AllowedGroups.join(', ')] + identifying_fields = [desc,name,default].compact.join(': ') + raise SettingError, "Internal error: The :group setting for %s must be 'service', not '%s'" % [identifying_fields,value] end @group = value end @@ -28,7 +29,8 @@ class Puppet::Util::Settings::FileSetting < Puppet::Util::Settings::Setting def owner=(value) unless AllowedOwners.include?(value) - raise SettingError, "Invalid owner %s on setting %s. Valid owners are %s." % [value, name, AllowedOwners.join(', ')] + identifying_fields = [desc,name,default].compact.join(': ') + raise SettingError, "Internal error: The :owner setting for %s must be either 'root' or 'service', not '%s'" % [identifying_fields,value] end @owner = value end
Ticket #<I> (unhelpfull error messages) Reworks the error message to 1) make it clearer that it's an internal error, not something the user did, 2) rearrange the sentence to make it clearer that "setting" is being used as a noun 3) combined several fields to increase the chance that the identifying information would suffice to lead someone to the actual source of the error.
puppetlabs_puppet
train
rb
77cd6025884e5bee578afbc321e22993615c3942
diff --git a/system/Filters/Filters.php b/system/Filters/Filters.php index <HASH>..<HASH> 100644 --- a/system/Filters/Filters.php +++ b/system/Filters/Filters.php @@ -91,6 +91,11 @@ class Filters { $this->config = $config; $this->request = & $request; + $this->setResponse($response); + } + + public function setResponse(ResponseInterface $response) + { $this->response = & $response; }
refactor: add setResponse method.
codeigniter4_CodeIgniter4
train
php
c72268a74ae6cf4a25ceaabbe884d6ae8923161f
diff --git a/framework/validators/CFileValidator.php b/framework/validators/CFileValidator.php index <HASH>..<HASH> 100644 --- a/framework/validators/CFileValidator.php +++ b/framework/validators/CFileValidator.php @@ -49,7 +49,7 @@ * <ul> * <li>{file}: replaced with the name of the file.</li> * <li>{limit}: when using {@link tooLarge}, replaced with {@link maxSize}; - * when using {@link tooSmall}, replaced with {@link maxSize}; and when using {@link tooMany} + * when using {@link tooSmall}, replaced with {@link minSize}; and when using {@link tooMany} * replaced with {@link maxFiles}.</li> * <li>{extensions}: when using {@link wrongType}, it will be replaced with the allowed extensions.</li> * </ul>
(Fixes issue #<I>) doc typo
yiisoft_yii
train
php
cbb5b823144cf32d642b4e12c330ed984b47dede
diff --git a/lib/sugarcrm/base.rb b/lib/sugarcrm/base.rb index <HASH>..<HASH> 100644 --- a/lib/sugarcrm/base.rb +++ b/lib/sugarcrm/base.rb @@ -332,7 +332,7 @@ module SugarCRM; class Base id.present? && comparison_object.id == id end - + alias :eql? :== # Delegates to id in order to allow two records of the same type and id to work with something like: # [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ]
alias :eql? :== otherwise, @collection - @original (and other array operations) won't work correctly in association_collection.rb
chicks_sugarcrm
train
rb
00d79d559daac06e5fcd508e902546cd7e3076ad
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -120,10 +120,13 @@ EOF $warmer->warmUp($warmupDir); // fix references to the Kernel in .meta files + $safeTempKernel = str_replace('\\', '\\\\', get_class($tempKernel)); + $realKernelFQN = get_class($realKernel); + foreach (Finder::create()->files()->name('*.meta')->in($warmupDir) as $file) { file_put_contents($file, preg_replace( - '/(C\:\d+\:)"'.get_class($tempKernel).'"/', - sprintf('$1"%s"', $realKernelClass), + '/(C\:\d+\:)"'.$safeTempKernel.'"/', + sprintf('$1"%s"', $realKernelFQN), file_get_contents($file) )); }
Adjusting CacheClear Warmup method to namespaced kernels Backported the patch in #<I> to the <I> branch.
symfony_symfony
train
php
6a294345fbf0ea45a1fc37389e6d4eb2a45ca26c
diff --git a/fastlane/lib/fastlane/lane_manager.rb b/fastlane/lib/fastlane/lane_manager.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/lane_manager.rb +++ b/fastlane/lib/fastlane/lane_manager.rb @@ -103,6 +103,8 @@ module Fastlane rows << [0, "cancel", "No selection, exit fastlane!"] + require 'terminal-table' + table = Terminal::Table.new( title: "Available lanes to run", headings: ['Number', 'Lane Name', 'Description'],
Fix fastlane crashing when running a lane (#<I>) * Fix fastlane crashing when running a lane Fixes #<I> * Fix RuboCop issue
fastlane_fastlane
train
rb
a3384ab6f51ed92e063522011caeb863d4dfa95b
diff --git a/src/Illuminate/Foundation/Bus/PendingChain.php b/src/Illuminate/Foundation/Bus/PendingChain.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Bus/PendingChain.php +++ b/src/Illuminate/Foundation/Bus/PendingChain.php @@ -144,15 +144,17 @@ class PendingChain } if ($this->connection) { - $firstJob->allOnConnection($this->connection); + $firstJob->chainConnection = $this->connection; + $firstJob->connection = $firstJob->connection ?: $this->connection; } if ($this->queue) { - $firstJob->allOnQueue($this->queue); + $firstJob->chainQueue = $this->queue; + $firstJob->queue = $firstJob->queue ?: $this->queue; } if ($this->delay) { - $firstJob->delay($this->delay); + $firstJob->delay = ! is_null($firstJob->delay) ? $firstJob->delay : $this->delay; } $firstJob->chain($this->chain);
set the first job params only if not explicitly set
laravel_framework
train
php
5d3b06b5d121f23d3b72b35bde7614aabf823e93
diff --git a/catalog/services_state.go b/catalog/services_state.go index <HASH>..<HASH> 100644 --- a/catalog/services_state.go +++ b/catalog/services_state.go @@ -67,6 +67,7 @@ type ServicesState struct { ServiceNameMatch *regexp.Regexp // How we match service names LastChanged time.Time listeners []chan ChangeEvent + listenerLock sync.Mutex tombstoneRetransmit time.Duration sync.Mutex } @@ -179,6 +180,7 @@ func (state *ServicesState) NotifyListeners(hostname string, changedTime time.Ti return } event := ChangeEvent{Hostname: hostname, Time: changedTime} + state.listenerLock.Lock() for _, listener := range state.listeners { select { case listener <- event: @@ -187,13 +189,16 @@ func (state *ServicesState) NotifyListeners(hostname string, changedTime time.Ti log.Error("NotifyListeners(): Can't send to listener!") } } + state.listenerLock.Unlock() } // Add an event listener channel to the list that will be notified on // major state change events. Channels must be buffered by at least 1 // or they will block. Channels must be ready to receive input. func (state *ServicesState) AddListener(listener chan ChangeEvent) { + state.listenerLock.Lock() state.listeners = append(state.listeners, listener) + state.listenerLock.Unlock() log.Debugf("AddListener(): new count %d", len(state.listeners)) }
Add a lock around the listeners list.
newrelic_sidecar
train
go
777996d6b3fe5b15778d0f36f309bf275731275c
diff --git a/traces/timeseries.py b/traces/timeseries.py index <HASH>..<HASH> 100644 --- a/traces/timeseries.py +++ b/traces/timeseries.py @@ -505,6 +505,7 @@ class TimeSeries(object): period_time = sampling_period temp = deepcopy(self) + temp.default = EXTEND_BACK temp.domain = Domain(self.domain.start() - buffer_time, self.domain.end() + buffer_time)
setting default of temp timeseries in moving average
datascopeanalytics_traces
train
py
ff0f859dc0ca21fc8bcc0425b513c517824d1d0a
diff --git a/functions/timber-post-getter.php b/functions/timber-post-getter.php index <HASH>..<HASH> 100644 --- a/functions/timber-post-getter.php +++ b/functions/timber-post-getter.php @@ -16,12 +16,17 @@ class TimberPostGetter return false; } + public static function get_posts( $query = false, $PostClass = 'TimberPost' ) { + $posts = self::query_posts( $query, $PostClass ); + return $posts->get_posts(); + } + /** * @param mixed $query * @param string $PostClass * @return array|bool|null */ - public static function get_posts($query = false, $PostClass = 'TimberPost'){ + public static function query_posts($query = false, $PostClass = 'TimberPost'){ if (self::is_post_class_or_class_map($query)) { $PostClass = $query;
allowed get_posts to wrap query_posts from commit ee3e<I>c1e8f<I>f8d<I>fb1c5d<I>d7f7e<I>a4
timber_timber
train
php
dc4b97b8514943abbdcc72556ea01d68f2230b40
diff --git a/cmd/dex/serve.go b/cmd/dex/serve.go index <HASH>..<HASH> 100644 --- a/cmd/dex/serve.go +++ b/cmd/dex/serve.go @@ -147,15 +147,6 @@ func serve(cmd *cobra.Command, args []string) error { s = storage.WithStaticPasswords(s, passwords) } - if c.EnablePasswordDB { - c.StaticConnectors = append(c.StaticConnectors, Connector{ - ID: server.LocalConnector, - Name: "Email", - Type: server.LocalConnector, - }) - logger.Infof("config connector: local passwords enabled") - } - storageConnectors := make([]storage.Connector, len(c.StaticConnectors)) for i, c := range c.StaticConnectors { if c.ID == "" || c.Name == "" || c.Type == "" { @@ -174,6 +165,16 @@ func serve(cmd *cobra.Command, args []string) error { storageConnectors[i] = conn } + + if c.EnablePasswordDB { + storageConnectors = append(storageConnectors, storage.Connector{ + ID: server.LocalConnector, + Name: "Email", + Type: server.LocalConnector, + }) + logger.Infof("config connector: local passwords enabled") + } + s = storage.WithStaticConnectors(s, storageConnectors) if len(c.OAuth2.ResponseTypes) > 0 {
cmd/dex/serve: add local connector directly to static connectors in storage
dexidp_dex
train
go
0844783dff04aed07da6d437cea8dee6aee1fa9c
diff --git a/pyecore/resources/resource.py b/pyecore/resources/resource.py index <HASH>..<HASH> 100644 --- a/pyecore/resources/resource.py +++ b/pyecore/resources/resource.py @@ -169,7 +169,10 @@ class Resource(object): return self.resource_set.metamodel_registry[nsuri] except KeyError: pass - return global_registry[nsuri] + try: + return global_registry[nsuri] + except KeyError: + raise KeyError('Unknown metamodel with uri: {0}'.format(nsuri)) def normalize(fragment): return fragment.split()[-1:][0] if ' ' in fragment else fragment
Add raise statement if metamodel is not known during load() This commit introduces an explicit message if a metamodel is missing from the global_registry or the local one during deserialization (do nothing more).
pyecore_pyecore
train
py
c519dd1213bd96d9ff5a92d8f64e3957c7b8d981
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index <HASH>..<HASH> 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -236,7 +236,7 @@ public class MultiUserChat { // Fire events according to the received presence code checkPresenceCode( mucUser.getStatus(), - presence.getFrom().equals(myRoomJID), + isUserStatusModification, mucUser, from); } else {
muc: do check for equality twice We already performed the presence.getFrom().equals(myRoomJID) check and saved its result. No need to do it again.
igniterealtime_Smack
train
java
1952fd273d2f82add5e9f2d59bbf00bbdcd035ef
diff --git a/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java b/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java +++ b/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java @@ -348,7 +348,11 @@ public final class UnifiedServiceRefMetaData implements Serializable if (vfsRoot != null) { try { - wsdlLocation = vfsRoot.findChild(wsdlOverride).toURL(); + wsdlLocation = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() { + public URL run() throws Exception { + return vfsRoot.findChild(wsdlOverride).toURL(); + } + }); } catch (Exception e) {
Fixing another failures with security manager on
jbossws_jbossws-spi
train
java
9ea254735a770e11c4eeb61dfda83f9a3f819eb5
diff --git a/internal/core/machine.go b/internal/core/machine.go index <HASH>..<HASH> 100644 --- a/internal/core/machine.go +++ b/internal/core/machine.go @@ -244,7 +244,7 @@ func (m *Machine) SyncedFolders() (folders []*core.MachineSyncedFolder, err erro func (m *Machine) SaveMachine() (err error) { m.logger.Debug("saving machine to db", "machine", m.machine.Id) m.target.Record, err = ptypes.MarshalAny(m.machine) - m.target.ResourceId = m.machine.Id + m.target.Uuid = m.machine.Id if err != nil { return nil } diff --git a/internal/core/machine_test.go b/internal/core/machine_test.go index <HASH>..<HASH> 100644 --- a/internal/core/machine_test.go +++ b/internal/core/machine_test.go @@ -28,7 +28,7 @@ func TestMachineSetValidId(t *testing.T) { if err != nil { t.Errorf("Failed to get target") } - require.Equal(t, dbTarget.Target.ResourceId, "something") + require.Equal(t, dbTarget.Target.Uuid, "something") } func TestMachineSetEmptyId(t *testing.T) {
Set target uuid opposed to resource id The uuid is the public identifier vs the resource id which should be for internal operations. The target uuid should correspond to the machine id (given by the provider)
hashicorp_vagrant
train
go,go
dc42e86872bc2a5a83145c17ab080d0a2d3e426d
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,3 +2,7 @@ require_once 'vendor/autoload.php'; date_default_timezone_set("UTC"); + +// Setting "bcmath.scale" to something other than 0 so that +// we can be sure bcdiv's $scale parameter is working correctly +bcscale(16);
Setting "bcmath.scale" to something other than 0 so that we can be sure bcdiv's $scale parameter is working correctly.
stephen-hill_base58php
train
php
2f754258bf6d7f1f5adfb103fbe91e44c7af9407
diff --git a/trimesh/exchange/dae.py b/trimesh/exchange/dae.py index <HASH>..<HASH> 100644 --- a/trimesh/exchange/dae.py +++ b/trimesh/exchange/dae.py @@ -346,7 +346,7 @@ def _unparse_material(material): effect = collada.material.Effect( uuid.uuid4().hex, params=[], shadingtype='phong', diffuse=diffuse, emission=emission, - specular=[1.0, 1.0, 1.0], shininess=float(shininess) + specular=[1.0, 1.0, 1.0, 1.0], shininess=float(shininess) ) material = collada.material.Material( uuid.uuid4().hex, 'pbrmaterial', effect
Update dae.py Fix bug in export of specular color
mikedh_trimesh
train
py
ab3101c593d62deb215e699bfc33974cf87eb82c
diff --git a/ca/django_ca/extensions/base.py b/ca/django_ca/extensions/base.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/extensions/base.py +++ b/ca/django_ca/extensions/base.py @@ -403,7 +403,7 @@ class IterableExtension( def as_text(self) -> str: return "\n".join(["* %s" % v for v in self.serialize_value()]) - def parse_value(self, value: ParsableItem) -> IterableItem: + def parse_value(self, value: Union[ParsableItem, IterableItem]) -> IterableItem: """Parse a single value (presumably from an iterable).""" return cast(IterableItem, value) @@ -473,7 +473,7 @@ class ListExtension(IterableExtension[ExtensionTypeTypeVar, ParsableItem, Serial # Implement functions provided by list(). Class mentions that this provides the same methods. - def append(self, value: ParsableItem) -> None: + def append(self, value: Union[ParsableItem, IterableItem]) -> None: self.value.append(self.parse_value(value)) self._test_value()
allow appending iterableItems as well
mathiasertl_django-ca
train
py
f530093d2c2daaff26e4e8d995186065b6b14a6c
diff --git a/lib/components/form/location-field.js b/lib/components/form/location-field.js index <HASH>..<HASH> 100644 --- a/lib/components/form/location-field.js +++ b/lib/components/form/location-field.js @@ -61,7 +61,7 @@ class LocationField extends Component { componentDidMount () { if (this.props.static) { - ReactDOM.findDOMNode(this.refs['formControl']).focus() + ReactDOM.findDOMNode(this.formControl).focus() } } @@ -108,6 +108,7 @@ class LocationField extends Component { value: '', geocodedFeatures: [] }) + ReactDOM.findDOMNode(this.formControl).focus() } _onDropdownToggle = (v, e) => { @@ -347,7 +348,8 @@ class LocationField extends Component { const placeholder = currentPosition.fetching === type ? 'Fetching location...' : label || type - const textControl = <FormControl ref='formControl' + const textControl = <FormControl + ref={ctl => { this.formControl = ctl }} className={this._getFormControlClassname()} type='text' value={this.state.value}
feat(form): Focus location input for typing when 'X' pressed. Addresses conveyal/trimet-mod-otp#<I>
opentripplanner_otp-react-redux
train
js
63ddeb201ee09bff2e15698e7ecd52dd23970544
diff --git a/io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/channels/MediaChannel.java b/io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/channels/MediaChannel.java index <HASH>..<HASH> 100644 --- a/io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/channels/MediaChannel.java +++ b/io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/channels/MediaChannel.java @@ -253,6 +253,7 @@ public abstract class MediaChannel { public void open() { // generate a new unique identifier for the channel this.ssrc = SsrcGenerator.generateSsrc(); + this.statistics.setSsrc(this.ssrc); this.open = true; if(logger.isDebugEnabled()) {
#<I> A new SSRC identifier is generated for the media channel when the connection is opened. RTP statistics have the SSRC updated as well.
RestComm_media-core
train
java
d08207839e86b004bd26a8088aaba68e3733a282
diff --git a/lib/domjs.js b/lib/domjs.js index <HASH>..<HASH> 100644 --- a/lib/domjs.js +++ b/lib/domjs.js @@ -62,6 +62,7 @@ module.exports = { // attach element methods elMap.forEach(setCreate, this); renameReserved(this.map); + this.map._map = this.map; this.init = nextInit; this.idMap = {};
Exposed all functions map as '_map'
medikoo_domjs
train
js
3ae1ae0a6defa84e4fedb1641576d8daa3317dd4
diff --git a/api/src/main/java/org/datacleaner/metadata/ColumnMeaning.java b/api/src/main/java/org/datacleaner/metadata/ColumnMeaning.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/datacleaner/metadata/ColumnMeaning.java +++ b/api/src/main/java/org/datacleaner/metadata/ColumnMeaning.java @@ -33,7 +33,7 @@ public enum ColumnMeaning implements HasName, HasAliases { // generic items - OTHER("Disregard", "Other", "Nothing"), + OTHER("Other", "Disregard", "Nothing"), KEY_PRIMARY("Primary Key", "ID", "Record ID", "Identifier", "key", "PKID", "Record key"),
Use "Other" as default name for ColumnMeaning.OTHER
datacleaner_DataCleaner
train
java
04880cf8e92024cfa2e0a7dba57b7020824ae6bc
diff --git a/src/Request/RequestExecutor.php b/src/Request/RequestExecutor.php index <HASH>..<HASH> 100644 --- a/src/Request/RequestExecutor.php +++ b/src/Request/RequestExecutor.php @@ -57,6 +57,9 @@ class RequestExecutor case 'DELETE': $requestResponse = $this->getClient()->delete($this->uri, $this->options); break; + case 'HEAD': + $requestResponse = $this->getClient()->head($this->uri, $this->options); + break; default: throw new UnsupportedOperationException(sprintf('HTTP METHOD [%s] is not supported.', $this->method)); }
Update RequestExecutor.php
athena-oss_php-fluent-http-client
train
php
17b232c6b0a88af9ebf90301cd0f21199fb9dc17
diff --git a/OpenGraphParser.js b/OpenGraphParser.js index <HASH>..<HASH> 100644 --- a/OpenGraphParser.js +++ b/OpenGraphParser.js @@ -36,7 +36,7 @@ function parseMeta(html, url, options) { } if (metaValue.length > 0) { - if (metaValue[0] === '/') { + if (metaValue[0] === '/' && (metaValue.length <= 1 || metaValue[1] !== '/')) { if (url[url.length - 1] === '/') { metaValue = url + metaValue.substring(1); } else {
Try to handle when a url is protocol-agnostic (i.e. is hoped to work for whatever the current protocol is - i.e. http:// or https://)
Osedea_react-native-opengraph-kit
train
js
baf867ba73ea678311caf0b7e241c132271a21a1
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -41,6 +41,7 @@ describe('Array', function() { it('should return the last chunk as remaining elements', function() { array.chunk(4).should.eql([[0, 1, 2, 3], [4, 5]]); + array.chunk(5).should.eql([[0, 1, 2, 3, 4], [5]]); }); it('should run with a default chunk size of 1', function() {
Add another test assertion for #chunk()
nwoltman_pro-array
train
js
da131a5890d6808ecc771dff2068a51a0d2c8f2b
diff --git a/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionListener.php b/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionListener.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionListener.php +++ b/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionListener.php @@ -62,7 +62,7 @@ class ExceptionListener error_log(sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine())); } - $logger = null !== $this->logger && $this->logger instanceof DebugLoggerInterface ? $this->logger->getDebugLogger() : null; + $logger = null !== $this->logger ? $this->logger->getDebugLogger() : null; $attributes = array( '_controller' => $this->controller,
[FrameworkBundle] reverted wrong change
symfony_symfony
train
php
b35e537eaab6257302f9d6f306e21387921775ef
diff --git a/src/collapsible/collapsible.js b/src/collapsible/collapsible.js index <HASH>..<HASH> 100644 --- a/src/collapsible/collapsible.js +++ b/src/collapsible/collapsible.js @@ -30,10 +30,8 @@ export class MdCollapsible { refresh() { let accordion = getBooleanFromAttributeValue(this.accordion); if (accordion) { - // this.element.setAttribute('data-collapsible', 'accordion'); this.attributeManager.addAttributes({ 'data-collapsible': 'accordion' }); } else { - // this.element.setAttribute('data-collapsible', 'expandable'); this.attributeManager.addAttributes({ 'data-collapsible': 'expandable' }); }
refactor(md-collapsible): removed comments
aurelia-ui-toolkits_aurelia-materialize-bridge
train
js
f75934d8df82161a5b4ceb15e44ac5b57eadfb35
diff --git a/gems/aws-sdk-core/lib/seahorse/client/net_http/connection_pool.rb b/gems/aws-sdk-core/lib/seahorse/client/net_http/connection_pool.rb index <HASH>..<HASH> 100644 --- a/gems/aws-sdk-core/lib/seahorse/client/net_http/connection_pool.rb +++ b/gems/aws-sdk-core/lib/seahorse/client/net_http/connection_pool.rb @@ -306,10 +306,7 @@ module Seahorse now = Aws::Util.monotonic_milliseconds @pool.each_pair do |endpoint,sessions| sessions.delete_if do |session| - if - session.last_used.nil? or - now - session.last_used > http_idle_timeout * 1000 - then + if session.last_used.nil? or now - session.last_used > http_idle_timeout * 1000 session.finish true end
fix ruby <I> warning (#<I>) fixes ``` lib/seahorse/client/net_http/connection_pool.rb:<I>: warning: `if' at the end of line without an expression ```
aws_aws-sdk-ruby
train
rb
144f202a749e026e1aa5fbf6d526e627104dd76c
diff --git a/lib/business_time/version.rb b/lib/business_time/version.rb index <HASH>..<HASH> 100644 --- a/lib/business_time/version.rb +++ b/lib/business_time/version.rb @@ -1,3 +1,3 @@ module BusinessTime - VERSION = "0.6.2" + VERSION = "0.7.0" end
bumping to <I>. While there aren't any api changes, we've bumped a bunch of gem versions, dependencies of ruby, etc. and I want to give some versioning 'distance'.
bokmann_business_time
train
rb
05e9ccd29802e6dfaf088d765c36b8e9e13fb0bf
diff --git a/lib/yast/rake.rb b/lib/yast/rake.rb index <HASH>..<HASH> 100644 --- a/lib/yast/rake.rb +++ b/lib/yast/rake.rb @@ -39,7 +39,6 @@ end task = Rake::Task["package"] prerequisites = task.prerequisites prerequisites.delete("test") -prerequisites << "check:spelling" task.enhance(prerequisites)
do not make check spelling default for now to avoid mass breakage
yast_yast-rake
train
rb
0c5d8f813c490d2bade92d51c04b3c9393f6e164
diff --git a/railties/lib/rails/commands/commands_tasks.rb b/railties/lib/rails/commands/commands_tasks.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/commands/commands_tasks.rb +++ b/railties/lib/rails/commands/commands_tasks.rb @@ -100,7 +100,7 @@ EOT end def version - ARGV.unshift '--version' + argv.unshift '--version' require_command!("application") end @@ -117,7 +117,7 @@ EOT end def shift_argv! - ARGV.shift if ARGV.first && ARGV.first[0] != '-' + argv.shift if argv.first && argv.first[0] != '-' end def require_command!(command)
Using the instance variable for argv. Instead of using the global constant ARGV, we're changing to using the instance variable because it is more testable.
rails_rails
train
rb
4f237c54041bd3727ac53fdd8e092ab70e8f8979
diff --git a/js/bithumb.js b/js/bithumb.js index <HASH>..<HASH> 100644 --- a/js/bithumb.js +++ b/js/bithumb.js @@ -17,6 +17,7 @@ module.exports = class bithumb extends Exchange { 'has': { 'CORS': true, 'fetchTickers': true, + 'fetchOrder': true, 'withdraw': true, }, 'urls': {
bithumb: has fetchOrder
ccxt_ccxt
train
js
8807d8e4b4e1583cff1b389b3d1d6354395fdff7
diff --git a/test/test_with_nodeunit.js b/test/test_with_nodeunit.js index <HASH>..<HASH> 100644 --- a/test/test_with_nodeunit.js +++ b/test/test_with_nodeunit.js @@ -1,4 +1,4 @@ -var utils = require("bolt-internal-utils"); +var utils = require("../utils"); module.exports = { testStringStartsWith: function(test) {
Put right relative path to 'utils.js'
Chieze-Franklin_bolt-internal-utils
train
js
78ba7fcecd46b039739f13bb04bf6147463ea376
diff --git a/pandas/conftest.py b/pandas/conftest.py index <HASH>..<HASH> 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -378,12 +378,7 @@ TIMEZONES = [None, 'UTC', 'US/Eastern', 'Asia/Tokyo', 'dateutil/US/Pacific', FixedOffset(0), FixedOffset(-300), timezone.utc, timezone(timedelta(hours=1)), timezone(timedelta(hours=-1), name='foo')] -TIMEZONE_IDS = ['None', 'UTC', 'US/Eastern', 'Asia/Tokyp', - 'dateutil/US/Pacific', 'dateutil/Asia/Singapore', - 'dateutil.tz.tzutz()', 'dateutil.tz.tzlocal()', - 'pytz.FixedOffset(300)', 'pytz.FixedOffset(0)', - 'pytz.FixedOffset(-300)', 'datetime.timezone.utc', - 'datetime.timezone.+1', 'datetime.timezone.-1.named'] +TIMEZONE_IDS = [repr(i) for i in TIMEZONES] @td.parametrize_fixture_doc(str(TIMEZONE_IDS))
CLN: Condense TIMEZONE ID labeling (#<I>) Follow-up to gh-<I>
pandas-dev_pandas
train
py
09c6f742906d01d51c05d097756b98244114d8c9
diff --git a/packages/ra-data-graphql-simple/src/buildVariables.js b/packages/ra-data-graphql-simple/src/buildVariables.js index <HASH>..<HASH> 100644 --- a/packages/ra-data-graphql-simple/src/buildVariables.js +++ b/packages/ra-data-graphql-simple/src/buildVariables.js @@ -247,13 +247,14 @@ export default introspectionResults => ( }; case GET_MANY_REFERENCE: { const parts = preparedParams.target.split('.'); - return { - page: parseInt(preparedParams.pagination.page, 10) - 1, - perPage: parseInt(preparedParams.pagination.perPage, 10), - sortField: preparedParams.sort.field, - sortOrder: preparedParams.sort.order, - filter: { [`${parts[0]}Id`]: preparedParams.id }, - }; + let variables = buildGetListVariables(introspectionResults)( + resource, + aorFetchType, + preparedParams, + queryType + ); + variables.filter[`${parts[0]}Id`] = preparedParams.id; + return variables; } case GET_ONE: return {
ra-data-graphql-simple GET_MANY_REFERENCE comprehensive param support support comprehensive pagination, sort and filter params for GET_MANY_REFERENCE requests. currently there is a gap using the ra-data-graphql-simple adapter when trying to use filter / sort / pagination props on the ReferenceManyField component.
marmelab_react-admin
train
js
f4c489805b60b8d9de32d62705ecd4dbfcbd1f6e
diff --git a/classes/Pods.php b/classes/Pods.php index <HASH>..<HASH> 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -931,6 +931,7 @@ class Pods implements Iterator { if ( isset( $this->fields[ $params->name ], $this->fields[ $params->name ]['type'] ) ) { $field_type = $this->fields[ $params->name ]['type']; + /** * Modify value returned by field() after its retrieved, but before its validated or formatted * @@ -1058,11 +1059,17 @@ class Pods implements Iterator { // Get fields matching traversal names. if ( ! empty( $lookup ) ) { - $fields = $this->api->load_fields( array( - 'name' => $lookup, - 'type' => $tableless_field_types, - // @todo support object fields too. - ) ); + if ( count( $params->traverse ) && $params->name === $params->traverse[0] && $field_data && $field_data['name'] === $params->traverse[0] ) { + $fields = array( + $field_data, + ); + } else { + $fields = $this->api->load_fields( array( + 'name' => $lookup, + 'type' => $tableless_field_types, + // @todo support object fields too. + ) ); + } if ( ! empty( $fields ) ) { foreach ( $fields as $field ) {
Avoid unnecessary lookup method call if the field we are asking for is already here
pods-framework_pods
train
php
d29cf8ef9425acaa8b7f7fc126dc3acc7951fc8c
diff --git a/chartkick.js b/chartkick.js index <HASH>..<HASH> 100644 --- a/chartkick.js +++ b/chartkick.js @@ -666,7 +666,7 @@ }; if (chart.options.colors) { - chartOptions.colorAxis.colors = chart.options.colors; + chartOptions.colors = chart.options.colors; } var options = merge(merge(defaultOptions, chartOptions), chart.options.library || {});
Bugfix: Timeline with colors option
ankane_chartkick.js
train
js
6e69652138af0a80e3944613435b9b5668da1ecc
diff --git a/resource_openstack_compute_instance_v2.go b/resource_openstack_compute_instance_v2.go index <HASH>..<HASH> 100644 --- a/resource_openstack_compute_instance_v2.go +++ b/resource_openstack_compute_instance_v2.go @@ -601,9 +601,8 @@ func resourceComputeInstanceV2Update(d *schema.ResourceData, meta interface{}) e if d.HasChange("security_groups") { oldSGRaw, newSGRaw := d.GetChange("security_groups") - oldSGSlice, newSGSlice := oldSGRaw.([]interface{}), newSGRaw.([]interface{}) - oldSGSet := schema.NewSet(func(v interface{}) int { return hashcode.String(v.(string)) }, oldSGSlice) - newSGSet := schema.NewSet(func(v interface{}) int { return hashcode.String(v.(string)) }, newSGSlice) + oldSGSet := oldSGRaw.(*schema.Set) + newSGSet := newSGRaw.(*schema.Set) secgroupsToAdd := newSGSet.Difference(oldSGSet) secgroupsToRemove := oldSGSet.Difference(newSGSet)
provider/openstack: Use security_groups as native set when update
terraform-providers_terraform-provider-openstack
train
go
e69cb403a822bb11173e6c224b5e5ad21612e966
diff --git a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonObject.java b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonObject.java index <HASH>..<HASH> 100644 --- a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonObject.java +++ b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonObject.java @@ -70,7 +70,14 @@ public class CameraSingletonObject implements ICameraSingletonObject { @Override public void choosePicture(Map<String, String> propertyMap, IMethodResult result) { Intent intent = null; - String outputFormat = propertyMap.get("outputFormat"); + String outputFormat = null; + if(propertyMap.get("outputFormat") == null){ + propertyMap.put("outputFormat", "image"); + outputFormat = propertyMap.get("outputFormat"); + } + else{ + outputFormat = propertyMap.get("outputFormat"); + } CameraFactory factory = (CameraFactory)CameraFactorySingleton.getInstance(); factory.getRhoListener().setMethodResult(result); factory.getRhoListener().setActualPropertyMap(propertyMap);
Code fix for SR ID: EMBPD<I> Did modifications for choosePicture API to get the default values if there are no property values are specified.
rhomobile_rhodes
train
java
953dcb0b2341ef3ffc2e1da8e6c23ad2a0fec69f
diff --git a/src/oidcendpoint/user_authn/user.py b/src/oidcendpoint/user_authn/user.py index <HASH>..<HASH> 100755 --- a/src/oidcendpoint/user_authn/user.py +++ b/src/oidcendpoint/user_authn/user.py @@ -220,8 +220,8 @@ def create_signed_jwt(issuer, keyjar, sign_alg='RS256', **kwargs): return signer.pack(payload=kwargs) -def verify_signed_jwt(token, keyjar): - verifier = JWT(keyjar) +def verify_signed_jwt(token, keyjar, allowed_sign_algs=None): + verifier = JWT(keyjar, allowed_sign_algs=allowed_sign_algs) return verifier.unpack(token)
Should be able to limit acceptable algorithms.
IdentityPython_oidcendpoint
train
py
dab18bb5b9d7937e44f2efc4da23b37aee231af4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( version = version, description = 'A comprehensive Python module for handling Monero cryptocurrency', url = 'https://github.com/emesik/monero-python/', - long_description = open('README.rst').read(), + long_description = open('README.rst', encoding = 'utf8').read(), install_requires = open('requirements.txt', 'r').read().splitlines(), packages = find_packages('.', exclude=['tests']), include_package_data = True,
Read the README.rst with UTF8
monero-ecosystem_monero-python
train
py
543aa66417fdd275d25963fe102b874039cd2f32
diff --git a/lib/statsd.js b/lib/statsd.js index <HASH>..<HASH> 100644 --- a/lib/statsd.js +++ b/lib/statsd.js @@ -31,10 +31,6 @@ BatchStatsd.BaseStat = BaseStat; var LENGTH_ARRAYS = {}; function BatchStatsd(options) { - if (!(this instanceof BatchStatsd)) { - return new BatchStatsd(options); - } - var self = this; assert(options.logger, 'options.logger required');
BatchStatsd: drop new-less support
uber_tchannel-node
train
js
e7d9ac61d14799e1bbf9434a11ef7cb6f7ed2502
diff --git a/lib/json-socket.js b/lib/json-socket.js index <HASH>..<HASH> 100644 --- a/lib/json-socket.js +++ b/lib/json-socket.js @@ -151,7 +151,9 @@ JsonSocket.prototype = { var delegates = [ 'connect', 'on', - 'end' + 'end', + 'setTimeout', + 'setKeepAlive' ]; delegates.forEach(function(method) { JsonSocket.prototype[method] = function() {
add support for setTimeout and setKeepAlive
sebastianseilund_node-json-socket
train
js
78538da3714e74b7e7351631475fa5bd22d92e70
diff --git a/internal/exec/util/passwd.go b/internal/exec/util/passwd.go index <HASH>..<HASH> 100644 --- a/internal/exec/util/passwd.go +++ b/internal/exec/util/passwd.go @@ -175,6 +175,7 @@ func writeAuthKeysFile(u *user.User, fp string, keys []byte) error { return fmt.Errorf("opening file %q as user %s and group %s: %w", fp, u.Uid, u.Gid, err) } if _, err = f.Write(keys); err != nil { + f.Close() // ignore errors return fmt.Errorf("writing file %q: %w", fp, err) } if err := f.Close(); err != nil {
internal/exec/util/passwd: plug fd leak in error path Doesn't really matter since we'll likely bubble all the way to the exit anyway, but it's good practice.
coreos_ignition
train
go
5d549fb96ed146340d3fa927099b6a221c1f4c68
diff --git a/src/pyrocore/ui/theming.py b/src/pyrocore/ui/theming.py index <HASH>..<HASH> 100644 --- a/src/pyrocore/ui/theming.py +++ b/src/pyrocore/ui/theming.py @@ -76,6 +76,7 @@ class ThemeSwitcher(ScriptBaseWithConfig): for filepath in glob.glob(themes_dir + '/*' + ext): name = os.path.basename(filepath).split('.')[0] if name: + # This prefers '.rc.default' files, because those are checked first themes.setdefault(name, filepath) # Use available selected themes in given order, if there are any, else all themes
theming: minor hint regarding color theme files lookup
pyroscope_pyrocore
train
py
7887d3a440abd843eeec12da61b29978d8ca4ae7
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -38,7 +38,7 @@ return array( 'label' => 'QTI test model', 'description' => 'TAO QTI test implementation', 'license' => 'GPL-2.0', - 'version' => '30.2.3', + 'version' => '30.2.4', 'author' => 'Open Assessment Technologies', 'requires' => array( 'taoQtiItem' => '>=18.0.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -1712,6 +1712,6 @@ class Updater extends \common_ext_ExtensionUpdater { $this->setVersion('29.8.0'); } - $this->skip('29.8.0', '30.2.3'); + $this->skip('29.8.0', '30.2.4'); } }
Proper version bump - on previous merges one version bump was forgotten
oat-sa_extension-tao-testqti
train
php,php
d86e83417f3c9ef7031cba10e6bd3bfc493dff20
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,9 @@ setup( 'GitPython==1.0.1', 'MapGitConfig==1.1' ], - tests_require=['pytest'], + tests_require=[ + 'pytest>=3,<4' + ], # package_data={}, entry_points={ 'console_scripts': [
pin pytest version =>3,<4
lsst-sqre_sqre-codekit
train
py
7d1dddf9c04317ba4b24feb2e66c7b3a6c963b62
diff --git a/spec/ethon/libc_spec.rb b/spec/ethon/libc_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ethon/libc_spec.rb +++ b/spec/ethon/libc_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' describe Ethon::Libc do - describe "#getdtablesize" do + describe "#getdtablesize", if: !Ethon::Curl.windows? do it "returns an integer" do expect(Ethon::Libc.getdtablesize).to be_a(Integer) end - it "returns bigger zero" do + it "returns bigger zero", if: !Ethon::Curl.windows? do expect(Ethon::Libc.getdtablesize).to_not be_zero end end
libc_spec: Don't run tests if on Curl.windows?
typhoeus_ethon
train
rb
2ace939853b2f2b9d5f28270cbfde2cfb6f2426b
diff --git a/openquake/calculators/extract.py b/openquake/calculators/extract.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/extract.py +++ b/openquake/calculators/extract.py @@ -249,8 +249,7 @@ def extract_hmaps(dstore, what): for kind, hcurves in getters.PmapGetter(dstore).items(what): hmap = calc.make_hmap(hcurves, oq.imtls, oq.poes) dic[kind] = calc.convert_to_array(hmap, len(mesh), pdic) - return hazard_items(dic, mesh, ('vs30', F32, sitecol.vs30), - investigation_time=oq.investigation_time) + return hazard_items(dic, mesh, investigation_time=oq.investigation_time) @extract.add('uhs')
We can now see the hazards produced by engine-<I> with engine <I> [skip hazardlib] Former-commit-id: <I>ce<I>c<I>c<I>a<I>c<I>fda3c<I>be<I>
gem_oq-engine
train
py
c5c7d04269747c746f02bfaec075f2710e7cd309
diff --git a/util.py b/util.py index <HASH>..<HASH> 100644 --- a/util.py +++ b/util.py @@ -154,3 +154,23 @@ def subst_vars (str, local_vars): # subst_vars () +def grok_environment_error (exc, prefix="error: "): + """Generate a useful error message from an EnvironmentError (IOError or + OSError) exception object. Handles Python 1.5.1 and 1.5.2 styles, and + does what it can to deal with exception objects that don't have a + filename (which happens when the error is due to a two-file operation, + such as 'rename()' or 'link()'. Returns the error message as a string + prefixed with 'prefix'. + """ + # check for Python 1.5.2-style {IO,OS}Error exception objects + if hasattr (exc, 'filename') and hasattr (exc, 'strerror'): + if exc.filename: + error = prefix + "%s: %s" % (exc.filename, exc.strerror) + else: + # two-argument functions in posix module don't + # include the filename in the exception object! + error = prefix + "%s" % exc.strerror + else: + error = prefix + str(exc[-1]) + + return error
Added 'grok_environment_error()' function to deal with the various forms that IOError and OSError can take (taken from core.py).
pypa_setuptools
train
py

CommitBench: A Benchmark for Commit Message Generation

EXECUTIVE SUMMARY

We provide CommitBench as an open-source, reproducible and privacy- and license-aware benchmark for commit message generation. The dataset is gathered from GitHub repositories with licenses that permit redistribution. We provide six programming languages, Java, Python, Go, JavaScript, PHP, and Ruby. The commit messages in natural language are restricted to English, as it is the working language in many software development projects. The dataset has 1,664,590 examples that were generated by using extensive quality-focused filtering techniques (e.g., excluding bot commits). Additionally, we provide a version with longer sequences for benchmarking models with more extended sequence input.

CURATION RATIONALE

We created this dataset due to quality and legal issues with previous commit message generation datasets. Given a git diff displaying code changes between two file versions, the task is to predict the accompanying commit message describing these changes in natural language. We base our GitHub repository selection on that of a previous dataset, CodeSearchNet, but apply a large number of filtering techniques to improve the data quality and eliminate noise. Due to the original repository selection, we are also restricted to the aforementioned programming languages. It was important to us, however, to provide some number of programming languages to accommodate any changes in the task due to the degree of hardware-relatedness of a language. The dataset is provided as a large CSV file containing all samples. We provide the following fields: Diff, Commit Message, Hash, Project, Split.

DOCUMENTATION FOR SOURCE DATASETS

Repository selection based on CodeSearchNet, which can be found under https://github.com/github/CodeSearchNet.

LANGUAGE VARIETIES

Since GitHub hosts software projects from all over the world, there is no single uniform variety of English used across all commit messages. This means that phrasing can be regional or subject to influences from the programmer's native language. It also means that different spelling conventions may co-exist and that different terms may be used for the same concept. Any model trained on this data should take these factors into account.

Overview of split by programming language for CommitBench:

  • Java: 153,119
  • Ruby: 233,710
  • Go: 137,998
  • JavaScript: 373,598
  • Python: 472,469
  • PHP: 294,394

SPEAKER DEMOGRAPHIC

Due to the extremely diverse (geographically, but also socio-economically) backgrounds of the software development community, there is no single demographic the data comes from. Globally, the average software developer tends to be male and has obtained higher education. Due to the anonymous nature of GitHub profiles, gender distribution information cannot be extracted.

ANNOTATOR DEMOGRAPHIC

Due to the automated generation of the dataset, no annotators were used.

SPEECH SITUATION AND CHARACTERISTICS

The public nature and often business-related creation of the data by the original GitHub users fosters a more neutral, information-focused, and formal language. As it is not uncommon for developers to find the writing of commit messages tedious, there can also be commit messages representing the frustration or boredom of the commit author. While our filtering is supposed to catch these types of messages, there can be some instances still in the dataset.

PREPROCESSING AND DATA FORMATTING

See our paper for all preprocessing steps. We do not provide the un-processed raw data due to privacy concerns, but it can be obtained via CodeSearchNet or requested from the authors.

CAPTURE QUALITY

While our dataset is completely reproducible at the time of writing, there are external dependencies that could restrict this. If GitHub shuts down and someone with a software project in the dataset deletes their repository, there can be instances that are non-reproducible.

LIMITATIONS

While our filters are meant to ensure a high quality for each data sample in the dataset, we cannot ensure that only low-quality examples were removed. Similarly, we cannot guarantee that our extensive filtering methods catch all low-quality examples. Some might remain in the dataset. Another limitation of our dataset is the low number of programming languages (there are many more) as well as our focus on English commit messages.

METADATA

  • License: Dataset under the CC BY-NC 4.0 license, code under the MIT license

DISCLOSURES AND ETHICAL REVIEW

While we put substantial effort into removing privacy-sensitive information, our solutions cannot find 100% of such cases. This means that researchers and anyone using the data need to incorporate their own safeguards to effectively reduce the amount of personal information that can be exposed.

ABOUT THIS DOCUMENT

A data statement is a characterization of a dataset that provides context to allow developers and users to better understand how experimental results might generalize, how software might be appropriately deployed, and what biases might be reflected in systems built on the software.

This data statement was written based on the template for the Data Statements Version 2 schema. The template was prepared by Angelina McMillan-Major, Emily M. Bender, and Batya Friedman and can be found at https://techpolicylab.uw.edu/data-statements/ and was updated from the community Version 1 Markdown template by Leon Derczynski.

Downloads last month
188
Edit dataset card