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
b5c7aa7e36ed8987722f5f5dbe4ae051e893fdfc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,8 +11,13 @@ from pip.req import parse_requirements install_reqs = parse_requirements('requirements.txt', session=False) install_requires = [str(ir.req) for ir in install_reqs] +def get_version(): + namespace = {} + execfile('chumpy/version.py', namespace) + return namespace['version'] + setup(name='chumpy', - version=importlib.import_module('chumpy').__version__, + version=get_version(), packages = ['chumpy'], author='Matthew Loper', author_email='matt.loper@gmail.com',
get version without importing chumpy
mattloper_chumpy
train
py
8c2682ca34751dc25ddd7de205ee9658a030c878
diff --git a/EmptyClassMetadata.php b/EmptyClassMetadata.php index <HASH>..<HASH> 100644 --- a/EmptyClassMetadata.php +++ b/EmptyClassMetadata.php @@ -48,10 +48,7 @@ class EmptyClassMetadata implements ClassMetadata public function hasField($fieldName) { - if ($this->getReflectionClass()->hasProperty($fieldName)) { - return $this->getReflectionClass()->getProperty($fieldName)->isPublic(); - } - return false; + return $this->getReflectionClass()->hasProperty($fieldName); } public function getFieldNames() @@ -68,7 +65,7 @@ class EmptyClassMetadata implements ClassMetadata public function getTypeOfField($fieldName) { - if ($this->hasField($fieldName)) { + if ($this->getReflectionClass()->hasProperty($fieldName)) { $reflProp = $this->getReflectionClass()->getProperty($fieldName); $doc = (string) $reflProp->getDocComment(); if (strpos($doc, '@var') === false) {
Changed the "hasField" behavior to return reflection "has" check
Orbitale_EntityMerger
train
php
fe1908551514ae53163509691e1fd302f5d0ce7b
diff --git a/lib/coverband.rb b/lib/coverband.rb index <HASH>..<HASH> 100644 --- a/lib/coverband.rb +++ b/lib/coverband.rb @@ -23,11 +23,10 @@ require 'coverband/collectors/coverage' require 'coverband/reporters/base' require 'coverband/reporters/html_report' require 'coverband/reporters/console_report' -require 'coverband/integrations/background' -require 'coverband/integrations/rack_server_check' require 'coverband/reporters/web' -require 'coverband/integrations/background_middleware' require 'coverband/integrations/background' +require 'coverband/integrations/background_middleware' +require 'coverband/integrations/rack_server_check' module Coverband @@configured = false
Remove repeated integrations/background require from coverband.rb
danmayer_coverband
train
rb
74077c88789a84f80088123aee4c5b73f97a54f3
diff --git a/scripts/rotate_ldap_password.php b/scripts/rotate_ldap_password.php index <HASH>..<HASH> 100644 --- a/scripts/rotate_ldap_password.php +++ b/scripts/rotate_ldap_password.php @@ -144,7 +144,6 @@ echo sprintf( exit(0); function generatePassword($length = 24) { - $passwordData = null; if(function_exists('mcrypt_create_iv')) { @@ -152,13 +151,13 @@ function generatePassword($length = 24) { if($e !== false) $passwordData = $e; } - if (function_exists('openssl_random_pseudo_bytes')) { + if(empty($passwordData) && function_exists('openssl_random_pseudo_bytes')) { $e = openssl_random_pseudo_bytes(64, $strong); // Only return if strong algorithm was used if($strong) $passwordData = $e; } - if (empty($passwordData)) { + if(empty($passwordData)) { echo "Cannot generate passwords - PRNG functions missing? Try installing mcrypt."; exit(1); }
Only attempt using openssl function if mcrypt didn't work
silverstripe_silverstripe-activedirectory
train
php
35a4b8a5b9bd288020d61b2e6674afce8eea675e
diff --git a/packages/centarius/src/document/ReactLoadable.js b/packages/centarius/src/document/ReactLoadable.js index <HASH>..<HASH> 100644 --- a/packages/centarius/src/document/ReactLoadable.js +++ b/packages/centarius/src/document/ReactLoadable.js @@ -8,9 +8,15 @@ const ReactLoadable = ({ chunks, ...rest }) => ( key={chunk.file} crossOrigin="anonymous" type="text/javascript" - src={chunk.file} + src={ + process.env.NODE_ENV === 'production' + ? `/${chunk.file}` + : `http://${process.env.HOST || 'localhost'}:${parseInt( + process.env.PORT, + 10 + ) + 1}/${chunk.file}` + } {...rest} - async /> ))} </Fragment>
Fix ReactLoadable causing loading flashes (#2) * Fix ReactLoadable causing loading flashes * Give default value to HOST if it is undefined
Dekoruma_centarius
train
js
3770c6acdddc53eeafa06c06dfd216fea59fcbdd
diff --git a/path.py b/path.py index <HASH>..<HASH> 100644 --- a/path.py +++ b/path.py @@ -1487,16 +1487,19 @@ def _permission_mask(mode): >>> _permission_mask('u=x')(0o666) == 0o166 True + + >>> _permission_mask('g=')(0o157) == 0o107 + True """ # parse the symbolic mode - parsed = re.match('(?P<who>[ugoa]+)(?P<op>[-+=])(?P<what>[rwx]+)$', mode) + parsed = re.match('(?P<who>[ugoa]+)(?P<op>[-+=])(?P<what>[rwx]*)$', mode) if not parsed: raise ValueError("Unrecognized symbolic mode", mode) # generate a mask representing the specified permission spec_map = dict(r=4, w=2, x=1) specs = (spec_map[perm] for perm in parsed.group('what')) - spec = functools.reduce(operator.or_, specs) + spec = functools.reduce(operator.or_, specs, 0) # now apply spec to each subject in who shift_map = dict(u=6, g=3, o=0)
Allow empty subject, which is now meaningful for the '=' operator
jaraco_path.py
train
py
26579f2e5568923874fd55a98c3632cc4d473558
diff --git a/spec/models/withdraw_spec.rb b/spec/models/withdraw_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/withdraw_spec.rb +++ b/spec/models/withdraw_spec.rb @@ -13,14 +13,14 @@ RSpec.describe Withdraw, type: :model do withdraw = Withdraw.new(librarian: users(:librarian1)) withdraw.item = items(:item_00013) expect(withdraw.valid?).to be_falsy - expect(withdraw.errors.messages[:item_id]).to include('This item is rented.') + expect(withdraw.errors.messages[:item_id]).to include('is rented.') end it "should not withdraw reserved item" do reserve = FactoryBot.create(:reserve) withdraw = FactoryBot.build(:withdraw, item: reserve.manifestation.items.first) expect(withdraw.valid?).to be_falsy - expect(withdraw.errors.messages[:item_id]).to include('This item is reserved.') + expect(withdraw.errors.messages[:item_id]).to include('is reserved.') end end
update spec file update spec file
next-l_enju_circulation
train
rb
d12a6efd0ac3cfaf4b5fa4563fe3ee8c50035b38
diff --git a/forms/textarea/textBling.js b/forms/textarea/textBling.js index <HASH>..<HASH> 100644 --- a/forms/textarea/textBling.js +++ b/forms/textarea/textBling.js @@ -1,6 +1,6 @@ -//sb.include('forms.textarea'); +sb.include('forms.textarea'); sb.include('browser.removeSelection'); -sb.include('flashGate'); +sb.include('sharedObject'); sb.include('String.prototype.isNumeric'); /* @@ -61,7 +61,7 @@ sb.forms.textarea.textBling.prototype = { }, clearStorage : function(){ - sb.sharedObject.forget(this.editBox.id); + sb.sharedObject.clear(this.editBox.id); }, addEvents : function(){
updated textBling to include sharedObject and to change call from sharedObject from .forget() to .clear()
surebert_surebert-framework
train
js
96b43cc75e3da8a046f628228a392e952fc59779
diff --git a/lxd/backup/backup.go b/lxd/backup/backup.go index <HASH>..<HASH> 100644 --- a/lxd/backup/backup.go +++ b/lxd/backup/backup.go @@ -31,7 +31,8 @@ type Info struct { Backend string `json:"backend" yaml:"backend"` Pool string `json:"pool" yaml:"pool"` Snapshots []string `json:"snapshots,omitempty" yaml:"snapshots,omitempty"` - OptimizedStorage *bool `json:"optimized,omitempty" yaml:"optimized,omitempty"` // Optional field to handle older optimized backups that don't have this field. + OptimizedStorage *bool `json:"optimized,omitempty" yaml:"optimized,omitempty"` // Optional field to handle older optimized backups that don't have this field. + OptimizedHeader *bool `json:"optimized_header,omitempty" yaml:"optimized_header,omitempty"` // Optional field to handle older optimized backups that don't have this field. Type api.InstanceType `json:"type" yaml:"type"` }
lxd/backup/backup: Adds OptimizedHeader field to Info struct Used to indicate if an optimized backup file will contain a driver specific optimized header file.
lxc_lxd
train
go
49903e5c8e8c8f39bb2042e3335b8c437d35d864
diff --git a/auditlog-generator/src/main/java/org/duracloud/mill/audit/generator/AuditLogGeneratorDriver.java b/auditlog-generator/src/main/java/org/duracloud/mill/audit/generator/AuditLogGeneratorDriver.java index <HASH>..<HASH> 100644 --- a/auditlog-generator/src/main/java/org/duracloud/mill/audit/generator/AuditLogGeneratorDriver.java +++ b/auditlog-generator/src/main/java/org/duracloud/mill/audit/generator/AuditLogGeneratorDriver.java @@ -33,7 +33,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext public class AuditLogGeneratorDriver { private static final Logger log = LoggerFactory.getLogger(AuditLogGeneratorDriver.class); - private static final String CONFIG_FILE_OPTION = null; + private static final String CONFIG_FILE_OPTION = "c"; private static void usage() { HelpFormatter help = new HelpFormatter();
Adds missing config file flag to driver.
duracloud_mill
train
java
aee65186bc3f04b1cedf5627ca54f317c623eac2
diff --git a/ceam/modules/blood_pressure.py b/ceam/modules/blood_pressure.py index <HASH>..<HASH> 100644 --- a/ceam/modules/blood_pressure.py +++ b/ceam/modules/blood_pressure.py @@ -30,7 +30,7 @@ class BloodPressureModule(SimulationModule): def load_population_columns(self, path_prefix, population_size): self.population_columns['systolic_blood_pressure_percentile'] = np.random.uniform(low=0.01, high=0.99, size=population_size) - self.population_columns['systolic_blood_pressure'] = norm.ppf(self.population_columns.systolic_blood_pressure_precentile, loc=138, scale=15) + self.population_columns['systolic_blood_pressure'] = norm.ppf(self.population_columns.systolic_blood_pressure_percentile, loc=138, scale=15) def load_data(self, path_prefix): dists = pd.read_csv(os.path.join(path_prefix, 'SBP_dist.csv'))
A bit of a refactor that I forgot the first time
ihmeuw_vivarium
train
py
0d0ac5032f73da5ce3dca6fbc40f66855a718759
diff --git a/lib/sfn/monkey_patch/stack/google.rb b/lib/sfn/monkey_patch/stack/google.rb index <HASH>..<HASH> 100644 --- a/lib/sfn/monkey_patch/stack/google.rb +++ b/lib/sfn/monkey_patch/stack/google.rb @@ -32,6 +32,12 @@ module Sfn collection end + # Sub-stacks never provide events + def events + collection = Miasma::Models::Orchestration::Stack::Events.new(self) + collection.define_singleton_method(:perform_population){ [] } + collection + end end # Return all stacks contained within this stack
Always disable events on sub-stacks
sparkleformation_sfn
train
rb
193dc97a1dff32063c722c8b46d1b2979e32bcc1
diff --git a/build.js b/build.js index <HASH>..<HASH> 100755 --- a/build.js +++ b/build.js @@ -76,7 +76,13 @@ function makeFile(filename, contents, callback) { fs.writeFile(filename, contents, 'utf8', function(err) { console.log('saved : ' + filename); gzip(contents, function(err, data) { + if (filename === './moment.min.js') { + console.log(' ------------------------'); + } console.log('size : ' + filename + ' ' + contents.length + ' b (' + data.length + ' b)'); + if (filename === './moment.min.js') { + console.log(' ------------------------'); + } }); if (callback) { callback(); @@ -95,7 +101,7 @@ function makeFile(filename, contents, callback) { * @param {String} dest The file destination */ function minifyToFile(source, dest, prefix, callback) { - var ast, + var ast, ugly; ast = uglify.parser.parse(source); ast = uglify.uglify.ast_mangle(ast);
Highlighting minified file size of the library
moment_moment
train
js
9f43b207040cc4cf30cebb3927d0d6073d8a2056
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -555,9 +555,7 @@ Renderer.prototype.drawMeshes = function (camera, shadowMapping, shadowMappingLi this.updateDirectionalLightShadowMap(light, shadowCasters) } }) - } - if (!shadowMapping && !shadowMappingLight) { pointLights.forEach((light) => { if (light.castShadows) { const shadowCasters = geometries.filter((geometry) => { @@ -567,9 +565,7 @@ Renderer.prototype.drawMeshes = function (camera, shadowMapping, shadowMappingLi this.updatePointLightShadowMap(light, shadowCasters) } }) - } - if (!shadowMapping && !shadowMappingLight) { spotLights.forEach((light) => { if (light.castShadows) { const shadowCasters = geometries.filter((geometry) => {
Simplify shadowmapping check in drawMeshes
pex-gl_pex-renderer
train
js
63306190d77aaf811bf1f0dfa72c43ac4c2b3cd6
diff --git a/wandb/apis/public.py b/wandb/apis/public.py index <HASH>..<HASH> 100644 --- a/wandb/apis/public.py +++ b/wandb/apis/public.py @@ -2399,7 +2399,9 @@ class RunArtifacts(Paginator): self.client, self.run.entity, self.run.project, - r["node"]["digest"], + "{}:v{}".format( + r["node"]["artifactSequence"]["name"], r["node"]["versionIndex"] + ), r["node"], ) for r in self.last_response["project"]["run"][self.run_key]["edges"]
Fixes Artifact Construction from Public Runs (#<I>) * init * better fix
wandb_client
train
py
6be974586fb654908c4a9ce28ddb1c6815345509
diff --git a/ps_banner.php b/ps_banner.php index <HASH>..<HASH> 100644 --- a/ps_banner.php +++ b/ps_banner.php @@ -91,7 +91,7 @@ class Ps_Banner extends Module implements WidgetInterface public function renderWidget($hookName, array $params) { $this->smarty->assign($this->getWidgetVariables($hookName, $params)); - return $this->display(__FILE__, 'ps_banner.tpl'); + return $this->fetch('module:ps_banner/ps_banner.tpl'); } public function getWidgetVariables($hookName, array $params)
FO: Call template with nice fetch method
PrestaShop_ps_banner
train
php
e93d72595031c9c38f6e63b1fd1de215373967ec
diff --git a/clientcommands.js b/clientcommands.js index <HASH>..<HASH> 100644 --- a/clientcommands.js +++ b/clientcommands.js @@ -50,6 +50,8 @@ function handleMsg(targetName, text) { self.user.applyStateChange('ChatMessage', query.toWindowPath(), self.server.nickname, text); self.server.send('PRIVMSG ' + target.nick + ' :' + text); + + self.user.setActiveWindow(query.toWindowPath()); } else if (target instanceof ChannelTarget) { var channel = self.server.findChannel(target.name);
focusing target query window on /msg
pavben_WebIRC
train
js
6e1f37c03e018f69a5635b9f884c8588de1c4cad
diff --git a/packages/vx-tooltip/src/tooltips/TooltipWithBounds.js b/packages/vx-tooltip/src/tooltips/TooltipWithBounds.js index <HASH>..<HASH> 100644 --- a/packages/vx-tooltip/src/tooltips/TooltipWithBounds.js +++ b/packages/vx-tooltip/src/tooltips/TooltipWithBounds.js @@ -23,6 +23,7 @@ function TooltipWithBounds({ parentRect, children, style, + ...otherProps, }) { let left = initialLeft; let top = initialTop; @@ -36,7 +37,7 @@ function TooltipWithBounds({ } return ( - <Tooltip style={{ top: 0, transform: `translate(${left}px, ${top}px)`, ...style }}> + <Tooltip style={{ top: 0, transform: `translate(${left}px, ${top}px)`, ...style }} {...otherProps}> {children} </Tooltip> );
Pass props through to underlying Tooltip component Allows custom classes to be set, as well as the additional flexibility
hshoff_vx
train
js
8afc8aef2ab1b5945a6a64123095a39be98bd22c
diff --git a/logical_type_test.go b/logical_type_test.go index <HASH>..<HASH> 100644 --- a/logical_type_test.go +++ b/logical_type_test.go @@ -174,7 +174,7 @@ func TestDecimalFixedLogicalTypeEncode(t *testing.T) { testBinaryCodecPass(t, schemaPrecision1, big.NewRat(163, 10), []byte("\x00\x00\x00\xa3")) testBinaryCodecPass(t, schemaPrecision1, big.NewRat(-130, 4), []byte("\xff\xff\xfe\xbb")) testBinaryCodecPass(t, schemaPrecision1, big.NewRat(25, 2), []byte("\x00\x00\x00\x7d")) - testBinaryEncodeFail(t, schemaPrecision1, big.NewRat(math.MaxInt, -1), "datum size ought to equal schema size") + testBinaryEncodeFail(t, schemaPrecision1, big.NewRat(math.MaxInt32, -1), "datum size ought to equal schema size") } func TestDecimalBytesLogicalTypeInRecordEncode(t *testing.T) {
fixed compile problem in logical_type_test. Changed MaxInt to MaxInt<I>
linkedin_goavro
train
go
47740307fe645dac5a41c4aa9b57a0d90d9b60ef
diff --git a/Minimal-J/src/main/java/org/minimalj/frontend/swing/toolkit/SwingHeavyActionButton.java b/Minimal-J/src/main/java/org/minimalj/frontend/swing/toolkit/SwingHeavyActionButton.java index <HASH>..<HASH> 100644 --- a/Minimal-J/src/main/java/org/minimalj/frontend/swing/toolkit/SwingHeavyActionButton.java +++ b/Minimal-J/src/main/java/org/minimalj/frontend/swing/toolkit/SwingHeavyActionButton.java @@ -7,6 +7,7 @@ import java.beans.PropertyChangeListener; import javax.swing.Action; import javax.swing.JButton; import javax.swing.SwingWorker; +import javax.swing.SwingWorker.StateValue; import org.minimalj.frontend.toolkit.ProgressListener; @@ -38,6 +39,8 @@ public class SwingHeavyActionButton extends JButton { public void propertyChange(PropertyChangeEvent evt) { if ("progress".equals(evt.getPropertyName())) { progress.showProgress((Integer) evt.getNewValue(), 100); + } else if ("state".equals(evt.getPropertyName()) && evt.getNewValue() == StateValue.DONE) { + progress.showProgress(100, 100); } } });
SwingHeavyActionButton: close waiting dialog also in case of exception
BrunoEberhard_minimal-j
train
java
3135799f9e99f66af058463f2512edfd3026d173
diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -96,10 +96,10 @@ class ObjectHydrator extends AbstractHydrator if ($assoc->mappedByFieldName) { $this->_fetchedAssociations[$assoc->targetEntityName][$assoc->mappedByFieldName] = true; } else { - $targetClass = $this->_em->getClassMetadata($assoc->targetEntityName); + $targetClass = $this->_em->getClassMetadata($assoc->targetEntityName); if (isset($targetClass->inverseMappings[$assoc->sourceFieldName])) { - $inverseAssoc = $targetClass->inverseMappings[$assoc->sourceFieldName]; - $this->_fetchedAssociations[$assoc->targetEntityName][$inverseAssoc->sourceFieldName] = true; + $inverseAssoc = $targetClass->inverseMappings[$assoc->sourceFieldName]; + $this->_fetchedAssociations[$assoc->targetEntityName][$inverseAssoc->sourceFieldName] = true; } } }
[<I>] Fixed formatting.
doctrine_annotations
train
php
f734cea1cf79397f61a36b7847720a05f59a79a3
diff --git a/src/Mustache/Loader/FilesystemLoader.php b/src/Mustache/Loader/FilesystemLoader.php index <HASH>..<HASH> 100644 --- a/src/Mustache/Loader/FilesystemLoader.php +++ b/src/Mustache/Loader/FilesystemLoader.php @@ -88,7 +88,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader * * @return string Mustache Template source */ - private function loadFile($name) + protected function loadFile($name) { $fileName = $this->getFileName($name); @@ -106,7 +106,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader * * @return string Template file name */ - private function getFileName($name) + protected function getFileName($name) { $fileName = $this->baseDir . '/' . $name; if (substr($fileName, 0 - strlen($this->extension)) !== $this->extension) {
Changing private to protected These fixes came out of this issue (<URL> can be overridden to use symfony-based templating locators.
bobthecow_mustache.php
train
php
a10c0daf1e032a93a8016a3aaeec9d36a8d4eebe
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -15,14 +15,14 @@ import ( // Version represents main version number of the current release // of the Triton-go SDK. -const Version = "1.3.0" +const Version = "1.4.0" // Prerelease adds a pre-release marker to the version. // // If this is "" (empty string) then it means that it is a final release. // Otherwise, this is a pre-release such as "dev" (in development), "beta", // "rc1", etc. -var Prerelease = "dev" +var Prerelease = "" // UserAgent returns a Triton-go characteristic string that allows the // network protocol peers to identify the version, release and runtime
Preparing for <I> release
joyent_triton-go
train
go
6c6e02af9958e09f2277de80b57cdff5c3e7b9b2
diff --git a/lib/gir_ffi/builder/module.rb b/lib/gir_ffi/builder/module.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/builder/module.rb +++ b/lib/gir_ffi/builder/module.rb @@ -100,12 +100,8 @@ module GirFFI def function_introspection_data function info = gir.find_by_name @namespace, function.to_s - - if info.info_type == :function - info - else - nil - end + return nil if info.nil? + info.info_type == :function ? info : nil end def function_definition info, libmodule diff --git a/test/generated_regress_test.rb b/test/generated_regress_test.rb index <HASH>..<HASH> 100644 --- a/test/generated_regress_test.rb +++ b/test/generated_regress_test.rb @@ -984,6 +984,13 @@ class GeneratedRegressTest < MiniTest::Spec assert_equal 3423, result.get_int end + it "raises an appropriate NoMethodError when a function is not found" do + begin + Regress.this_method_does_not_exist + rescue => e + assert_equal "undefined method `this_method_does_not_exist' for Regress:Module", e.message + end + end end end
Make appropriate exception be thrown for missing module methods.
mvz_gir_ffi
train
rb,rb
bf38165dd89b8f9480f5d5b94901e74a77c76ff1
diff --git a/lib/statistrano/base/rake_tasks.rb b/lib/statistrano/base/rake_tasks.rb index <HASH>..<HASH> 100644 --- a/lib/statistrano/base/rake_tasks.rb +++ b/lib/statistrano/base/rake_tasks.rb @@ -81,7 +81,7 @@ module Statistrano releases_string << "." releases_string << server.base_domain releases_string << "'>" - releases_string << server.name + releases_string << release["name"] releases_string << "</a></li>" end template = IO.read( File.expand_path( '../../../../templates/index.html', __FILE__) ).gsub( '{{release_list}}', releases_string )
oops, fix server name vs release name
mailchimp_statistrano
train
rb
08a897ea5348ee445c24457cdec9a26b071b9978
diff --git a/src/Operation/AbstractGraphQLOperation.php b/src/Operation/AbstractGraphQLOperation.php index <HASH>..<HASH> 100644 --- a/src/Operation/AbstractGraphQLOperation.php +++ b/src/Operation/AbstractGraphQLOperation.php @@ -47,6 +47,9 @@ use Nosto\Types\Signup\AccountInterface; abstract class AbstractGraphQLOperation extends AbstractOperation { + const IDENTIFIER_BY_CID = 'BY_CID'; + const IDENTIFIER_BY_REF = 'BY_REF'; + /** * @var AccountInterface Nosto configuration */ diff --git a/src/Operation/Order/OrderCreate.php b/src/Operation/Order/OrderCreate.php index <HASH>..<HASH> 100644 --- a/src/Operation/Order/OrderCreate.php +++ b/src/Operation/Order/OrderCreate.php @@ -51,9 +51,6 @@ use Nosto\Helper\SerializationHelper; class OrderCreate extends AbstractGraphQLOperation { - const IDENTIFIER_BY_CID = 'BY_CID'; - const IDENTIFIER_BY_REF = 'BY_REF'; - /** @var OrderInterface */ private $order;
Migrate const to AbstractGraphQLOperation class
Nosto_nosto-php-sdk
train
php,php
ba22d45c99a26228830aeef0c2b1e6e08397e698
diff --git a/salt/modules/file.py b/salt/modules/file.py index <HASH>..<HASH> 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -950,7 +950,7 @@ def replace(path, This is a pure Python implementation that wraps Python's :py:func:`~re.sub`. :param path: Filesystem path to the file to be edited - :param pattern: The PCRE search + :param pattern: The Python's regular expression search :param repl: The replacement text :param count: Maximum number of pattern occurrences to be replaced :param flags: A list of flags defined in the :ref:`re module documentation
[Issue #<I>] Change PCRE reference to Python's re() in the documentation.
saltstack_salt
train
py
3f50af9ea5a3ace9be087e9c79848205c512ca35
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='neat-python', - version='0.4', + version='0.5', author='cesar.gomes, mirrorballu2', author_email='nobody@nowhere.com', maintainer='CodeReclaimers, LLC',
This revision was uploaded to PyPI as release <I>.
CodeReclaimers_neat-python
train
py
6c3a168d10aeab5aec48fa565347553fb864e96a
diff --git a/lib/slop/option.rb b/lib/slop/option.rb index <HASH>..<HASH> 100644 --- a/lib/slop/option.rb +++ b/lib/slop/option.rb @@ -65,17 +65,10 @@ class Slop @delimiter = options[:delimiter] || ',' @limit = options[:limit] || 0 - if @long_flag && @long_flag.size > @slop.longest_flag - if @help.respond_to? :to_str - size = @long_flag.size + @help.size - else - size = @long_flag.size - end - @slop.longest_flag = size - end - @callback = blk if block_given? @callback ||= options[:callback] + + build_longest_flag end # @return [Boolean] true if this option expects an argument @@ -176,5 +169,16 @@ class Slop value end end + + def build_longest_flag + if @long_flag && @long_flag.size > @slop.longest_flag + if @help.respond_to? :to_str + size = @long_flag.size + @help.size + else + size = @long_flag.size + end + @slop.longest_flag = size + end + end end end
move this logic into a private method
leejarvis_slop
train
rb
059ad13200568e9ad6aee682710b20b010a1a8be
diff --git a/volman/volman_bbs_lrp_test.go b/volman/volman_bbs_lrp_test.go index <HASH>..<HASH> 100644 --- a/volman/volman_bbs_lrp_test.go +++ b/volman/volman_bbs_lrp_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/cloudfoundry-incubator/auction/auctiontypes" + "code.cloudfoundry.org/auction/auctiontypes" "github.com/cloudfoundry-incubator/bbs" "github.com/cloudfoundry-incubator/bbs/models" "github.com/cloudfoundry-incubator/inigo/helpers" diff --git a/volman/volman_bbs_task_test.go b/volman/volman_bbs_task_test.go index <HASH>..<HASH> 100644 --- a/volman/volman_bbs_task_test.go +++ b/volman/volman_bbs_task_test.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/cloudfoundry-incubator/auction/auctiontypes" + "code.cloudfoundry.org/auction/auctiontypes" "github.com/cloudfoundry-incubator/bbs" "github.com/cloudfoundry-incubator/bbs/models" "github.com/cloudfoundry-incubator/inigo/helpers"
`github.com/cloudfoundry-incubator/auction` -> `code.cloudfoundry.org/auction` [#<I>]
cloudfoundry_inigo
train
go,go
bd28bee5e13607aefa357456d872153171da5f26
diff --git a/src/Behat/Behat/Definition/Translator/TranslatorInterface.php b/src/Behat/Behat/Definition/Translator/TranslatorInterface.php index <HASH>..<HASH> 100644 --- a/src/Behat/Behat/Definition/Translator/TranslatorInterface.php +++ b/src/Behat/Behat/Definition/Translator/TranslatorInterface.php @@ -4,4 +4,5 @@ namespace Behat\Behat\Definition\Translator; interface TranslatorInterface extends \Symfony\Contracts\Translation\TranslatorInterface { + public function getLocale(); }
Add getLocale method to Behat TranslatorInterface The old Symfony interfaces had this method, but the new one doesn't. However, some parts of the depend on this method existing on the interface.
Behat_Behat
train
php
058ae54b665e718328f4c511d92b9c1f5d95a372
diff --git a/v2/types.go b/v2/types.go index <HASH>..<HASH> 100644 --- a/v2/types.go +++ b/v2/types.go @@ -1107,7 +1107,7 @@ func NewTickerFromRaw(symbol string, raw []interface{}) (t Ticker, err error) { return } -type bookAction int +type bookAction byte // BookAction represents a new/update or removal for a book entry. type BookAction bookAction
changed update type to btye
bitfinexcom_bitfinex-api-go
train
go
ba80b0dd9bac21f2469145747aae588672a85047
diff --git a/api/auth.go b/api/auth.go index <HASH>..<HASH> 100644 --- a/api/auth.go +++ b/api/auth.go @@ -482,7 +482,7 @@ func removeUser(w http.ResponseWriter, r *http.Request, t auth.Token) error { if email != "" && u.IsAdmin() { u, err = auth.GetUserByEmail(email) if err != nil { - return err + return &errors.HTTP{Code: http.StatusNotFound, Message: err.Error()} } } else if u.IsAdmin() { return &errors.HTTP{Code: http.StatusBadRequest, Message: "please specify the user you want to remove"}
Changed the return code on delete a user to <I> if not found When querying the user database, if a user is not found the api currently returns a server error (5XX) which is inconsistent with the other api calls. This commit updates this behaviour.
tsuru_tsuru
train
go
e5889354b6d3545d6e5dfee2ba20da7b422ed437
diff --git a/src/network/socket.js b/src/network/socket.js index <HASH>..<HASH> 100644 --- a/src/network/socket.js +++ b/src/network/socket.js @@ -49,6 +49,9 @@ case 2: onCloseHandler(null); break; + case 3: + socketRealTimeStatusInterval && clearInterval(socketRealTimeStatusInterval); + break; } }, 5000);
Async Reconnect debugging
masoudmanson_pod-async
train
js
7e649f080e90e900bb7fc34c2e63d40b78b59219
diff --git a/frontend/widgets/Alert.php b/frontend/widgets/Alert.php index <HASH>..<HASH> 100644 --- a/frontend/widgets/Alert.php +++ b/frontend/widgets/Alert.php @@ -41,10 +41,11 @@ class Alert extends Widget $this->_doNotRender = true; $session = \Yii::$app->getSession(); $flashes = $session->getAllFlashes(); + $baseCssClass = isset($this->options['class']) ? $this->options['class'] : ''; + foreach ($flashes as $type => $message) { if (in_array($type, $this->allowedTypes)) { - $class = ($type === 'error') ? 'alert-danger' : 'alert-' . $type; - Html::addCssClass($this->options, $class); + $this->options['class'] = (($type === 'error') ? "alert-danger" : "alert-{$type}") . ' ' . $baseCssClass; echo BsAlert::widget([ 'body' => $message, 'closeButton' => $this->closeButton,
CSS Class assignment correction # 2. Ensure previous CSS classes are not appended and reinitialized in the foreach loop.
yiisoft_yii2-app-advanced
train
php
27edd8664e36475922c89fc49beb753bfc299cdc
diff --git a/lib/bx/seq/twobit.py b/lib/bx/seq/twobit.py index <HASH>..<HASH> 100644 --- a/lib/bx/seq/twobit.py +++ b/lib/bx/seq/twobit.py @@ -2,6 +2,7 @@ import sys import _twobit from struct import * +from UserDict import DictMixin TWOBIT_MAGIC_NUMBER = 0x1A412743 TWOBIT_MAGIC_NUMBER_SWAP = 0x4327411A @@ -26,6 +27,9 @@ class TwoBitSequence( object ): return "" return _twobit.read( self.tbf.file, self, start, stop ) + def __len__( self ): + return self.size + def get( self, start, end ): # Trim start / stop if start < 0: @@ -40,7 +44,7 @@ class TwoBitSequence( object ): # Return return dna -class TwoBitFile( object ): +class TwoBitFile( DictMixin ): def __init__( self, file ): # Read magic and determine byte order self.byte_order = ">" @@ -74,6 +78,9 @@ class TwoBitFile( object ): self.load_sequence( name ) return seq + def keys( self ): + return self.index.keys() + def load_sequence( self, name ): seq = self.index[name] # Seek to start of sequence block
Even more pythonic.
bxlab_bx-python
train
py
710ad1b144a25af8d83d2f285cef6fbd18c5432f
diff --git a/Dropbox/API.php b/Dropbox/API.php index <HASH>..<HASH> 100644 --- a/Dropbox/API.php +++ b/Dropbox/API.php @@ -138,7 +138,6 @@ class API /** * Uploads large files to Dropbox in mulitple chunks - * Note: This method is subject to change and, as such, should not be used in production * @param string $file Absolute path to the file to be uploaded * @param string|bool $filename The destination filename of the uploaded file * @param string $path Path to upload the file to, relative to root
Removed beta notice from chunkedUpload method
BenExile_Dropbox
train
php
43dcc97512f7cc49dd24139334f89db909105df6
diff --git a/dvc/version.py b/dvc/version.py index <HASH>..<HASH> 100644 --- a/dvc/version.py +++ b/dvc/version.py @@ -7,7 +7,7 @@ import os import subprocess -_BASE_VERSION = "0.92.1" +_BASE_VERSION = "0.93.0" def _generate_version(base_version):
dvc: bump to <I>
iterative_dvc
train
py
ffa7bd90ee7154356a58f6aaee2984afba7194e5
diff --git a/src/Handler/GitterImHandler.php b/src/Handler/GitterImHandler.php index <HASH>..<HASH> 100644 --- a/src/Handler/GitterImHandler.php +++ b/src/Handler/GitterImHandler.php @@ -52,12 +52,12 @@ class GitterImHandler extends AbstractContentHandler protected function send($content) { $url = sprintf('https://%s/%s/%s/%s', self::HOST, self::ROOMS_ENDPOINT, $this->roomId, self::MESSAGES_ENDPOINT); - $data = json_encode(['text' => $content]); - $headers = [ + $data = json_encode(array('text' => $content)); + $headers = array( 'Content-Type: application/json', 'Accept: application/json', "Authorization: Bearer {$this->token}" - ]; + ); $ch = curl_init();
traditional array syntax, this isn't php <I>+
nackjicholson_monolog-gitter-im
train
php
c4969c8eac2039d189fb0ab1ca83d24456b3998d
diff --git a/src/test/java/org/cactoos/list/ReverseIterableTest.java b/src/test/java/org/cactoos/list/ReverseIterableTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/cactoos/list/ReverseIterableTest.java +++ b/src/test/java/org/cactoos/list/ReverseIterableTest.java @@ -23,8 +23,9 @@ */ package org.cactoos.list; +import org.cactoos.TextHasString; +import org.cactoos.text.JoinedText; import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; import org.junit.Test; /** @@ -40,7 +41,7 @@ public final class ReverseIterableTest { public void reversesIterable() { MatcherAssert.assertThat( "Can't reverse an iterable", - String.join( + new JoinedText( " ", new ReverseIterable<>( new ArrayAsIterable<>( @@ -48,7 +49,7 @@ public final class ReverseIterableTest { ) ) ), - Matchers.equalTo("dude world hello") + new TextHasString("dude world hello") ); }
#<I>: Let's do ReverseIterableTest use JoinedText
yegor256_cactoos
train
java
48203e621732e2c4a33e9640cf3e1543dbec14d9
diff --git a/holoviews/plotting/raster.py b/holoviews/plotting/raster.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/raster.py +++ b/holoviews/plotting/raster.py @@ -103,9 +103,6 @@ class MatrixPlot(ElementPlot): im = self.handles.get('im', None) im.set_data(view.data) - ranges = self.compute_ranges(self._map, key, ranges, [0, 1, 2, 3]) - ranges = self.match_range(view, ranges) - if isinstance(view, HeatMap) and self.show_values: self._annotate_values(view)
Fixed normalization for Matrix animations
pyviz_holoviews
train
py
65254b07fe5589c9d73eda44deb9ddc8610c6f3f
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 @@ -1,6 +1,5 @@ # rubygems here so 'rake spec' works require 'rubygems' -require 'bundler' -Bundler.require(:default, :test) +require 'rspec' require 'crags' include Crags \ No newline at end of file
remove bundler from spec_helper
gotascii_crags
train
rb
666f59890799ccad674a2dea26268f0f8184b003
diff --git a/flask_unchained/__init__.py b/flask_unchained/__init__.py index <HASH>..<HASH> 100644 --- a/flask_unchained/__init__.py +++ b/flask_unchained/__init__.py @@ -35,4 +35,4 @@ from .bundles.controller.utils import redirect, url_for # aliases -from flask import current_app +from flask import current_app, g, request, session, _app_ctx_stack, _request_ctx_stack
alias a few useful globals from flask into the flask_unchained package
briancappello_flask-unchained
train
py
1b4c8b6ec013284cf48a4112eb98002a70145e06
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,9 @@ extras_require = { ':python_version=="2.7"': [ 'ipaddr>=2.1.11', ], + 'admin': [ + 'Flask-Admin>=1.3.0', + ], 'celery': [ # Needed for building the documentation until v4.2 is released. 'celery>=3.1.0,<4.0', @@ -65,7 +68,6 @@ setup_requires = [ ] install_requires = [ - 'Flask-Admin>=1.3.0', 'Flask-BabelEx>=0.9.3', 'Flask-Breadcrumbs>=0.3.0', 'Flask-CeleryExt>=0.3.1',
setup: add Flask-Admin as an extra * Closes #<I>
inveniosoftware_invenio-accounts
train
py
5a2c03b9369ccd00cc8c5c7bca4b2fc40bb18a7f
diff --git a/passpie/credential.py b/passpie/credential.py index <HASH>..<HASH> 100644 --- a/passpie/credential.py +++ b/passpie/credential.py @@ -2,7 +2,7 @@ import re def split_fullname(fullname): - rgx = re.compile(r"(?P<login>.*)@(?P<name>.*)") + rgx = re.compile(r"(?P<login>.*)?@(?P<name>.*)") try: name = rgx.match(fullname).group("name") login = rgx.match(fullname).group("login")
Fix regex for spliting fullnames
marcwebbie_passpie
train
py
3238bad447081d4d2b5c910651190214f64a20d1
diff --git a/run_tests_all_pytz.py b/run_tests_all_pytz.py index <HASH>..<HASH> 100755 --- a/run_tests_all_pytz.py +++ b/run_tests_all_pytz.py @@ -81,11 +81,6 @@ def mangle_release(rel): return rel releases = pypi_data["releases"] -for release in sorted(releases): - print(release) - for f in releases[release]: - print(f["python_version"]) - # Download the pytz versions into the cache. for release in sorted(releases): # These lines shouldn't be needed but pypi always runs setup.py even when
Remove some accidentally committed debugging code.
mithro_python-datetime-tz
train
py
d7ffe4ab30a6266d784caaf886e1552e2b1dfe0a
diff --git a/eZ/Publish/Core/FieldType/TextBlock/Type.php b/eZ/Publish/Core/FieldType/TextBlock/Type.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/FieldType/TextBlock/Type.php +++ b/eZ/Publish/Core/FieldType/TextBlock/Type.php @@ -19,8 +19,6 @@ use eZ\Publish\Core\FieldType\FieldType, */ class Type extends FieldType { - // @TODO remove extension of TextLine? - protected $settingsSchema = array( "textRows" => array( "type" => "int",
Fixed: Removed orphan TODO.
ezsystems_ezpublish-kernel
train
php
feb409e8e4f6b4f5e6738f9f7e4b8ed7089958d4
diff --git a/src/ExecutionContext.php b/src/ExecutionContext.php index <HASH>..<HASH> 100644 --- a/src/ExecutionContext.php +++ b/src/ExecutionContext.php @@ -8,6 +8,35 @@ use Symfony\Component\Process\PhpExecutableFinder; use Rusty\Finder\FilesFinder; +/** + * Stores all the runtime execution context. + * + * Examples: + * + * ``` + * $context = new ExecutionContext('./some/file.php'); + * $context = new ExecutionContext('./some/directory/'); + * ``` + * + * Bootstrap files can be specified: + * ``` + * $context = new ExecutionContext('./some/file.php', [ + * './some/bootstrap/file.php', + * ]); + * ``` + * + * The search can be restricted to some extensions: + * ``` + * $context = new ExecutionContext('./some/directory/', [], ['php']); + * ``` + * + * Some options define what will be checked: + * ``` + * $context = new ExecutionContext('./some/directory/'); + * $context->disableLint(); + * $context->stopOnError(); + * ``` + */ class ExecutionContext { private $target;
Add some documentation for the ExecutionContext
K-Phoen_Rusty
train
php
225271ba227ed2e1ece2da28cf9066bba9de7166
diff --git a/curdling/services/downloader.py b/curdling/services/downloader.py index <HASH>..<HASH> 100644 --- a/curdling/services/downloader.py +++ b/curdling/services/downloader.py @@ -212,14 +212,21 @@ class Downloader(Service): # -- Private API of the Download service -- def update_url_credentials(self, base_url, other_url): - parsed_base = compat.urlparse(base_url) - parsed_other = compat.urlparse(other_url) - - if parsed_base.username: - parsed_other.username = parsed_base.username - if parsed_base.password: - parsed_other.password = parsed_base.password - return parsed_other.geturl() + base = compat.urlparse(base_url) + other = compat.urlparse(other_url) + + # If they're not from the same server, we return right away without + # trying to update anything + if base.hostname != other.hostname or base.password != other.password: + return other.geturl() + + # Updating credentials only if the target URL doesn't have the data + # that we want to set + if base.username and not other.username: + other.username = base.username + if base.password and not other.password: + other.password = base.password + return other.geturl() def download(self, distribution): # This is the URL retrieved by the locator that found the given
Fix Downloader.update_url_credentials() We should not try to update the other URL if the base is from a different domain (or port); Also, we should not try to update it if it already contains the data we wanna set. The `ParseResult` instance returned by `urlparse` does not allow us to change attributes when they are set.
clarete_curdling
train
py
b278916dd064c81995cdde90746b9ebd2f8545a4
diff --git a/src/widgets/PopUpManager.js b/src/widgets/PopUpManager.js index <HASH>..<HASH> 100644 --- a/src/widgets/PopUpManager.js +++ b/src/widgets/PopUpManager.js @@ -125,7 +125,14 @@ define(function (require, exports, module) { } function _keydownCaptureListener(keyEvent) { - if (keyEvent.keyCode !== KeyEvent.DOM_VK_ESCAPE) { // escape key + // Escape key or Alt key (Windows-only) + if (keyEvent.keyCode !== KeyEvent.DOM_VK_ESCAPE && + !(keyEvent.keyCode === KeyEvent.DOM_VK_ALT && brackets.platform === "win")) { + return; + } + + // Don't dismiss the popup if both Ctrl and Alt keys are pressed. + if (keyEvent.keyCode === KeyEvent.DOM_VK_ALT && keyEvent.ctrlKey) { return; }
dismiss popups on Windows when Alt key is pressed
adobe_brackets
train
js
bd63d75f6b1fbfa63cfc0d734c6ef3db44728750
diff --git a/auto_ml/predictor.py b/auto_ml/predictor.py index <HASH>..<HASH> 100644 --- a/auto_ml/predictor.py +++ b/auto_ml/predictor.py @@ -351,11 +351,10 @@ class Predictor(object): if model_names is not None: - estimator_names = model_names + estimator_names = self.model_names else: estimator_names = self._get_estimator_names() - if self.type_of_estimator == 'classifier': if len(set(y)) > 2 and self.scoring is None: self.scoring = 'accuracy_score' @@ -709,12 +708,13 @@ class Predictor(object): final_model_obj = self.trained_final_model.named_steps['final_model'] except: final_model_obj = self.trained_final_model - print('\n\nHere are the results from our ' + final_model_obj.model_name) + print('\n\nHere are the results from our ' + final_model_obj.model_name + ' model') trained_feature_names = self._get_trained_feature_names() if self.type_of_estimator == 'classifier': - trained_coefficients = final_model_obj.model.coef_[0] + trained_coefficients = final_model_obj.model.coef_ + # Note to self: this used to be accessing the [0]th index of .coef_ for classifiers. Not sure why. else: trained_coefficients = final_model_obj.model.coef_
fixes bug around passing in single string model names
ClimbsRocks_auto_ml
train
py
28f86835b4e28c488e7204cf63cb2b1a8bb43578
diff --git a/gandi/cli/commands/vhost.py b/gandi/cli/commands/vhost.py index <HASH>..<HASH> 100644 --- a/gandi/cli/commands/vhost.py +++ b/gandi/cli/commands/vhost.py @@ -59,7 +59,7 @@ def create(gandi, vhost, paas, background): gandi.pretty_echo(result) paas = gandi.paas.info(paas) - gandi.paas.init_conf(paas['name']) + gandi.paas.init_conf(paas['name'], vhost) return result
Give the vhost we want to init.
Gandi_gandi.cli
train
py
9119052303c38e1ccc583018f502088762450600
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java b/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java index <HASH>..<HASH> 100644 --- a/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java +++ b/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java @@ -44,8 +44,8 @@ public class MDC { if (oldMap != null) { newMap.putAll(oldMap); } + // the newMap replaces the old one for serialisation's sake threadLocal.set(newMap); - newMap.put(key, val); } @@ -81,7 +81,8 @@ public class MDC { if (oldMap != null) { newMap.putAll(oldMap); } - + // the newMap replaces the old one for serialisation's sake + threadLocal.set(newMap); newMap.remove(key); }
When removing keys from the MDC, the new value should be stored as a Threadlocal.
tony19_logback-android
train
java
65a34d51f8dc2d929df951c194f60ddccbe2975d
diff --git a/model/src/main/java/org/jboss/pnc/model/ProductVersion.java b/model/src/main/java/org/jboss/pnc/model/ProductVersion.java index <HASH>..<HASH> 100644 --- a/model/src/main/java/org/jboss/pnc/model/ProductVersion.java +++ b/model/src/main/java/org/jboss/pnc/model/ProductVersion.java @@ -281,6 +281,10 @@ public class ProductVersion implements GenericEntity<Integer> { buildConfigurationSet.setProductVersion(productVersion); } productVersion.setBuildConfigurationSets(buildConfigurationSets); + + for (BuildConfiguration buildConfiguration : buildConfigurations) { + buildConfiguration.setProductVersion(productVersion); + } productVersion.setBuildConfigurations(buildConfigurations); for (ProductMilestone productMilestone : productMilestones) { @@ -338,6 +342,16 @@ public class ProductVersion implements GenericEntity<Integer> { return this; } + public Builder buildConfigurationSet(Set<BuildConfiguration> buildConfigurationSet) { + this.buildConfigurations = buildConfigurationSet; + return this; + } + + public Builder buildConfigurationSet(BuildConfiguration buildConfigurationSet) { + this.buildConfigurations.add(buildConfigurationSet); + return this; + } + public Builder attributes(Map<String, String> attributes) { this.attributes = attributes; return this;
[NCL-<I>] fix PV.Builder to also update BuildConfiguration's side
project-ncl_pnc
train
java
20c2664a5038aea602f3450a87878c1083ac9ed2
diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index <HASH>..<HASH> 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -471,8 +471,6 @@ class PartialWebhookGuild(Hashable): The partial guild's ID. name: :class:`str` The partial guild's name. - icon: :class:`str` - The partial guild's icon """ __slots__ = ('id', 'name', '_icon', '_state')
[docs] Remove extraneous icon definition
Rapptz_discord.py
train
py
f94faf02726b4edd9e7db4c610e06cd69f8f8c8b
diff --git a/jaraco/util/cmdline.py b/jaraco/util/cmdline.py index <HASH>..<HASH> 100644 --- a/jaraco/util/cmdline.py +++ b/jaraco/util/cmdline.py @@ -55,6 +55,3 @@ class Command(object): @classmethod def add_arguments(cls, parser): pass - -if six.PY3: - Command = meta.LeafClassesMeta('Command', (object,), dict(Command.__dict__))
Remove superfluous compatibility shim
jaraco_jaraco.util
train
py
6d05ccc8829ecde5e30d67dc202e8cb14acd2eff
diff --git a/build/webpack.conf.js b/build/webpack.conf.js index <HASH>..<HASH> 100644 --- a/build/webpack.conf.js +++ b/build/webpack.conf.js @@ -1,6 +1,7 @@ const path = require('path'); const ProgressBarPlugin = require('progress-bar-webpack-plugin'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); +const TerserPlugin = require('terser-webpack-plugin'); const config = require('./config'); @@ -26,6 +27,17 @@ module.exports = { externals: { vue: config.vue }, + optimization: { + minimizer: [ + new TerserPlugin({ + terserOptions: { + output: { + comments: false + } + }, + }) + ] + }, performance: { hints: false },
Build: delete unremoved comments in umd module `lib/index.js` fixed #<I>
ElemeFE_element
train
js
3f38c64edcc6a549d0c60a6bace86196e4a264c9
diff --git a/src/rez/util.py b/src/rez/util.py index <HASH>..<HASH> 100644 --- a/src/rez/util.py +++ b/src/rez/util.py @@ -46,9 +46,18 @@ class yaml_literal(str): def yaml_literal_presenter(dumper, data): - return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|') -yaml.add_representer(yaml_literal, yaml_literal_presenter) - + tag = None + try: + data = unicode(data, 'ascii') + tag = u'tag:yaml.org,2002:str' + except UnicodeDecodeError: + try: + data = unicode(data, 'utf-8') + tag = u'tag:yaml.org,2002:str' + except UnicodeDecodeError: + data = data.encode('base64') + tag = u'tag:yaml.org,2002:binary' + return dumper.represent_scalar(tag, data, '|') # TODO deprecate class Common(object):
Improving yaml_literal presenter. Allan's implementation
nerdvegas_rez
train
py
956f0bb6e624b0d683999d4c32602fb105ad3b7c
diff --git a/jsonapi/resource.py b/jsonapi/resource.py index <HASH>..<HASH> 100644 --- a/jsonapi/resource.py +++ b/jsonapi/resource.py @@ -129,8 +129,8 @@ class Resource(object): continue for field in related_model._meta.fields: - if field.rel and field.rel.to == model and \ - not issubclass(related_model, model): + if field.rel and field.rel.to == model and field.rel.multiple: + # and not issubclass(related_model, model)? <- OneToOne rel fields[related_resource.Meta.name_plural] = { "type": Resource.FIELD_TYPES.TO_MANY, "name": field.rel.related_name or "{}_set".format(
update foreign key check. Require multiple relationship from the other side.
pavlov99_jsonapi
train
py
e2f4b3186048a1a1e0ca6d51dbf893750939950f
diff --git a/test/test_backend/test_server.py b/test/test_backend/test_server.py index <HASH>..<HASH> 100644 --- a/test/test_backend/test_server.py +++ b/test/test_backend/test_server.py @@ -26,6 +26,8 @@ def run_client_process(): def test_json_server(): global port + import select + class Args: port = 6789 @@ -43,7 +45,7 @@ def test_json_server(): Timer(1, run_client_process).start() try: srv.serve_forever() - except ValueError: + except (ValueError, select.error): pass # when closed from client we have a ValueError because of a # bad file descriptior, this is not a bug in pyqode but in # socketserver
Ignore select error after a shutdown request
pyQode_pyqode.core
train
py
f684ae36a425ff07be019796642097999c77043b
diff --git a/js/kspace.js b/js/kspace.js index <HASH>..<HASH> 100644 --- a/js/kspace.js +++ b/js/kspace.js @@ -112,6 +112,10 @@ function filterFeatures(features, min, max) { } KnownSpace.prototype.invalidate = function(tier) { + if (!this.pool) { + return; + } + this.featureCache[tier] = null; this.startFetchesForTiers([tier]); } diff --git a/js/sourceadapters.js b/js/sourceadapters.js index <HASH>..<HASH> 100644 --- a/js/sourceadapters.js +++ b/js/sourceadapters.js @@ -174,6 +174,10 @@ CachingFeatureSource.prototype.capabilities = function() { } CachingFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) { + if (pool == null) { + throw 'pool is null...'; + } + var awaitedFeatures = pool.awaitedFeatures[this.cfsid]; if (!awaitedFeatures) { var awaitedFeatures = new Awaited();
Reject attempts to invalidate before first fetch.
dasmoth_dalliance
train
js,js
cd20dabe9809d4448ea679506bce63786ec3e579
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ if os.path.exists("README.rst"): setup( name = "pytesseract", - version = "0.1.6", + version = "0.1.7", author = "Samuel Hoffstaetter", author_email="pytesseract@madmaze.net", maintainer = "Matthias Lee",
Bump the package version - <I> Change log: - Updated documentation for better PyPI support - Includes all the latest fixes until now
madmaze_pytesseract
train
py
66b65aa3ad549fdeaa8df08c9fc2bad2b0c91226
diff --git a/lib/restore_bundled_with/fetch.rb b/lib/restore_bundled_with/fetch.rb index <HASH>..<HASH> 100644 --- a/lib/restore_bundled_with/fetch.rb +++ b/lib/restore_bundled_with/fetch.rb @@ -2,6 +2,8 @@ module RestoreBundledWith class Fetch LOCK_FILE = 'Gemfile.lock' REF = 'HEAD' + # REGEX_PICK = /^(?<pick>\n^BUNDLED WITH.*\n.+\n)/ + # git.cat_file trims last \n? REGEX_PICK = /^(?<pick>\n^BUNDLED WITH.*\n.+)/ def initialize(file = LOCK_FILE, ref = REF, git_path = '.', git_options = {}) @file = file
chore(fetch): comment for capture regex
packsaddle_ruby-restore_bundled_with
train
rb
95bffde12df3be209303a244e8278a6a7fc46eda
diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -607,11 +607,11 @@ class Builder { } /** - * Add a relationship count condition to the query + * Add a relationship count condition to the query. * - * @param string $relation - * @param string $boolean - * @param null $callback + * @param string $relation + * @param string $boolean + * @param \Closure $callback * @return \Illuminate\Database\Eloquent\Builder|static */ public function hasNot($relation, $boolean = 'and', $callback = null) @@ -948,4 +948,4 @@ class Builder { $this->query = clone $this->query; } -} \ No newline at end of file +}
Match with Laravel Code Style rules
laravel_framework
train
php
016e42a3e4b7ec9207b025625bb4a6b65cb22fe1
diff --git a/spec/configurable_spec.rb b/spec/configurable_spec.rb index <HASH>..<HASH> 100644 --- a/spec/configurable_spec.rb +++ b/spec/configurable_spec.rb @@ -25,7 +25,7 @@ module Xcake it "should store build configuration" do expect(@configurable.debug_configurations.count).to eq(1) end - + it "should use that configuration if no name is specified" do expect(@configuration.debug_configuration).to eq(@configuration) end
Hound doesn't like the github editor who does??
igor-makarov_xcake
train
rb
c930dacb2a27c8394708a4b257a4032cd59fd559
diff --git a/src/Fieldset.php b/src/Fieldset.php index <HASH>..<HASH> 100644 --- a/src/Fieldset.php +++ b/src/Fieldset.php @@ -7,6 +7,7 @@ class Fieldset extends Element\Group use Attributes; use Fieldset\Tostring; use Element\Identify; + use Bindable; protected $attributes = []; private $legend; @@ -22,5 +23,10 @@ class Fieldset extends Element\Group { return isset($this->legend) ? $this->legend : null; } + + public function bind($model) + { + return $this->bindGroup($model); + } }
fiedsets should also be bindable
monolyth-php_formulaic
train
php
911c5867e770e0822036e34af7afa8639655ae7d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -99,7 +99,12 @@ MarantzDenonTelnet.prototype.sendNextTelnetCueItem = function() { } else { var item = this.cmdCue.shift(); var isRequestCommand = (item.cmd.substr(-1) === '?'); - this.connection.send(item.cmd, {timeout: (isRequestCommand ? this.connectionparams.timeout : 10)}, function(error, data) { + var send_options = {timeout: (isRequestCommand ? this.connectionparams.timeout : 10)}; + if (isRequestCommand) + { + send_options.waitfor = this.connectionparams.irs; + } + this.connection.send(item.cmd, send_options, function(error, data) { if (typeof data === 'string') { data = data.trim().split('\r'); for (var i = 0; i < data.length; i++) { // sanitize data
End waiting if request response arrives, rather than timeout
k3erg_marantz-denon-telnet
train
js
b31cf5d973fbc72bbef47da46cf7ca7a9adc802e
diff --git a/lang/en/form.php b/lang/en/form.php index <HASH>..<HASH> 100644 --- a/lang/en/form.php +++ b/lang/en/form.php @@ -55,7 +55,7 @@ $string['security'] = 'Security'; $string['selectallornone'] = 'Select all/none'; $string['selected'] = 'Selected'; $string['showadvanced'] = 'Show advanced'; -$string['somefieldsrequired'] = 'There are required fields in this form marked{$a}.'; +$string['somefieldsrequired'] = 'There are required fields in this form marked {$a}.'; $string['time'] = 'Time'; $string['timeunit'] = 'Time unit'; $string['timing'] = 'Timing';
MDL-<I> Insert a space into the somefieldrequired string
moodle_moodle
train
php
503f6e280c2978ad8e57f995bec07515eeef19ae
diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Http/Request.php +++ b/src/Illuminate/Http/Request.php @@ -421,6 +421,10 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess $request->headers->replace($from->headers->all()); + $request->setLocale($from->getLocale()); + + $request->setDefaultLocale($from->getDefaultLocale()); + $request->setJson($from->json()); if ($from->hasSession() && $session = $from->session()) {
[9.x] Copy locale and defaultLocale from original request (#<I>) * [9.x] Copy locale and defaultLocale from original request * Use getters since properties are protected * Update Request.php
laravel_framework
train
php
79bfa508d21ce159f75200ae05dace5d74293c35
diff --git a/Templating/Tests/Adapter/ValueObjectAdapterTest.php b/Templating/Tests/Adapter/ValueObjectAdapterTest.php index <HASH>..<HASH> 100644 --- a/Templating/Tests/Adapter/ValueObjectAdapterTest.php +++ b/Templating/Tests/Adapter/ValueObjectAdapterTest.php @@ -59,7 +59,6 @@ class ValueObjectAdapterTest extends \PHPUnit_Framework_TestCase ->getMockBuilder( 'eZ\\Publish\\Core\\FieldType\\Page\\Parts\\Zone' ) ->setConstructorArgs( array( - $this->getMock( 'eZ\\Publish\\Core\\FieldType\\Page\\PageService' ), $this->validProperties ) )
Fixed unit tests that still relies on the page service being passed to Page objects
ezsystems_LegacyBridge
train
php
3edcbb784fde296311e16f8db665b20bfaf9ea8a
diff --git a/packages/pg/test/unit/connection/error-tests.js b/packages/pg/test/unit/connection/error-tests.js index <HASH>..<HASH> 100644 --- a/packages/pg/test/unit/connection/error-tests.js +++ b/packages/pg/test/unit/connection/error-tests.js @@ -58,8 +58,7 @@ var SSLNegotiationPacketTests = [ }, ] -for (var i = 0; i < SSLNegotiationPacketTests.length; i++) { - var tc = SSLNegotiationPacketTests[i] +for (const tc of SSLNegotiationPacketTests) { suite.test(tc.testName, function (done) { // our fake postgres server var socket
Fix most SSL negotiation packet tests being ignored `tc` was only one variable and the tests are asynchronous, so every test was writing 'E'.
brianc_node-postgres
train
js
77ae6265050835f299b1c7d278fed3bed28bd952
diff --git a/cache/cache.go b/cache/cache.go index <HASH>..<HASH> 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -232,7 +232,6 @@ func (c *Cache) worker(exitChan chan bool) { in: toConfirmTracker, out: c.outputChan, confirmed: c.confirmChan, - cacheIn: c.inputChan, } c.Go(func(exit chan bool) { diff --git a/cache/confirm.go b/cache/confirm.go index <HASH>..<HASH> 100644 --- a/cache/confirm.go +++ b/cache/confirm.go @@ -8,7 +8,6 @@ type notConfirmed struct { in chan *points.Points out chan *points.Points confirmed chan *points.Points - cacheIn chan *points.Points size int }
Remove cacheIn leftover from confirmTracker
lomik_go-carbon
train
go,go
d659a3fb4492ebe6a782ada2407030fc47853487
diff --git a/tests/integration/components/back-link-test.js b/tests/integration/components/back-link-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/components/back-link-test.js +++ b/tests/integration/components/back-link-test.js @@ -6,20 +6,7 @@ moduleForComponent('back-link', 'Integration | Component | back link', { }); test('it renders', function(assert) { - - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.on('myAction', function(val) { ... }); - this.render(hbs`{{back-link}}`); - assert.equal(this.$().text().trim(), ''); - - // Template block usage: - this.render(hbs` - {{#back-link}} - template block text - {{/back-link}} - `); - - assert.equal(this.$().text().trim(), 'template block text'); + assert.equal(this.$().text().trim(), 'Back'); });
Fix bad test for back-link helper
ilios_common
train
js
12f5a2e2144d9babd83ae0f963f3ba2a68ba1b4c
diff --git a/lib/shopify_api.rb b/lib/shopify_api.rb index <HASH>..<HASH> 100644 --- a/lib/shopify_api.rb +++ b/lib/shopify_api.rb @@ -296,7 +296,7 @@ module ShopifyAPI self.prefix = "/admin/products/:product_id/" # generate a method for each possible image variant - [:pico, :icon, :thumb, :small, :medium, :large, :original].each do |m| + [:pico, :icon, :thumb, :small, :compact, :medium, :large, :original].each do |m| reg_exp_match = "/\\1_#{m}.\\2" define_method(m) { src.gsub(/\/(.*)\.(\w{2,4})/, reg_exp_match) } end
Support new :compact product image size variant
Shopify_shopify_api
train
rb
72dce1312c763d1373dd8016550967af77736263
diff --git a/pycbc/ahope/ahope_utils.py b/pycbc/ahope/ahope_utils.py index <HASH>..<HASH> 100644 --- a/pycbc/ahope/ahope_utils.py +++ b/pycbc/ahope/ahope_utils.py @@ -670,8 +670,8 @@ class Workflow(object): cmd_tuples = node.get_cmd_tuple_list() for cmd in cmd_tuples: cmd_list += list(cmd) - print cmd cmd_list.remove('') + cmd_list = [c for cmd in cmd_list for c in cmd.split(' ')] job_dir = node.job().out_dir
work around concatenated argument list
gwastro_pycbc
train
py
d61ab3803d910f032802771279f8effde80c6e36
diff --git a/api/v1/server/configure_cilium.go b/api/v1/server/configure_cilium.go index <HASH>..<HASH> 100644 --- a/api/v1/server/configure_cilium.go +++ b/api/v1/server/configure_cilium.go @@ -3,7 +3,9 @@ package server import ( + "context" "crypto/tls" + "net" "net/http" errors "github.com/go-openapi/errors" @@ -251,7 +253,9 @@ func configureAPI(api *restapi.CiliumAPI) http.Handler { }) } - api.ServerShutdown = func() {} + api.ServerShutdown = func() { + serverCancel() + } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) } @@ -261,11 +265,19 @@ func configureTLS(tlsConfig *tls.Config) { // Make all necessary changes to the TLS configuration here. } +var ( + // ServerCtx and ServerCancel + ServerCtx, serverCancel = context.WithCancel(context.Background()) +) + // As soon as server is initialized but not run yet, this function will be called. // If you need to modify a config, store server instance to stop it individually later, this is the place. // This function can be called multiple times, depending on the number of serving schemes. // scheme value will be set accordingly: "http", "https" or "unix" func configureServer(s *http.Server, scheme, addr string) { + s.BaseContext = func(_ net.Listener) context.Context { + return ServerCtx + } } // The middleware configuration is for the handler executors. These do not apply to the swagger.json document.
api: add custom `BaseContext` function This sets the context for every request handled by the server (in our case, the daemon). As a result, on shutdown, we can cancel this context in the `ServerShutdown` function in `configureAPI`.
cilium_cilium
train
go
433c3d2d3a53bb02303f6f067ebb8f96c99c32a3
diff --git a/packages/errors/src/index.js b/packages/errors/src/index.js index <HASH>..<HASH> 100644 --- a/packages/errors/src/index.js +++ b/packages/errors/src/index.js @@ -82,7 +82,7 @@ export const ManagerDeviceLockedError = createCustomErrorClass( "ManagerDeviceLocked" ); export const ManagerFirmwareNotEnoughSpaceError = createCustomErrorClass( - "ManagerFirmwareNotEnoughSpaceError" + "ManagerFirmwareNotEnoughSpace" ); export const ManagerNotEnoughSpaceError = createCustomErrorClass( "ManagerNotEnoughSpace"
rename error to ManagerFirmwareNotEnoughSpace
LedgerHQ_ledgerjs
train
js
063675a2821065432dbbb289ec2340ed5b608da4
diff --git a/phpsec/phpsec.hash.php b/phpsec/phpsec.hash.php index <HASH>..<HASH> 100644 --- a/phpsec/phpsec.hash.php +++ b/phpsec/phpsec.hash.php @@ -120,13 +120,10 @@ class phpsecHash { switch($method) { case self::PBKDF2: $param = array(); - $hashPart = explode('$', $hash); - parse_str($hashPart[2], $param); + list( , , $params, $hash, $salt) = explode('$', $hash); + parse_str($params, $param); - $hash = base64_decode($hashPart[3]); - $salt = base64_decode($hashPart[4]); - - if($hash === phpsecCrypt::pbkdf2($str, $salt, $param['c'], $param['dk'], $param['f'])) { + if(base64_decode($hash) === phpsecCrypt::pbkdf2($str, base64_decode($salt), $param['c'], $param['dk'], $param['f'])) { return true; } return false;
Cleans up phpsecHash::check()
phpsec_phpSec
train
php
b270808b2fa8a8c5eabe298edbd42e5dd477bfce
diff --git a/src/org/jgroups/util/Util.java b/src/org/jgroups/util/Util.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/util/Util.java +++ b/src/org/jgroups/util/Util.java @@ -3470,8 +3470,9 @@ public class Util { } public static void checkIfValidAddress(InetAddress bind_addr,String prot_name) throws Exception { - //if(bind_addr.isAnyLocalAddress() || bind_addr.isLoopbackAddress()) - // return; + // N.B. bind_addr.isAnyLocalAddress() is not OK + if (bind_addr.isLoopbackAddress()) + return; Collection<InetAddress> addrs=getAllAvailableAddresses(); for(InetAddress addr : addrs) { if(addr.equals(bind_addr))
JGRP-<I> BindException when trying to bind to loopback addresses
belaban_JGroups
train
java
e8d1e51951bcaace7f30e10774fc072a44888822
diff --git a/storage/layers.go b/storage/layers.go index <HASH>..<HASH> 100644 --- a/storage/layers.go +++ b/storage/layers.go @@ -183,6 +183,7 @@ func (r *layerStore) Load() error { if mount.MountPoint != "" { if layer, ok := ids[mount.ID]; ok { mounts[mount.MountPoint] = layer + layer.MountPoint = mount.MountPoint layer.MountCount = mount.MountCount } }
Fix an error tracking mounted filesystems Fix an error where we'd lose track of mounts after loading them and saving them again.
containers_storage
train
go
f73854c839c34dd180d2ceb34624ea6d8dffa824
diff --git a/lib/sass/script/lexer.rb b/lib/sass/script/lexer.rb index <HASH>..<HASH> 100644 --- a/lib/sass/script/lexer.rb +++ b/lib/sass/script/lexer.rb @@ -169,6 +169,16 @@ module Sass @scanner.pos = @tok.pos if @tok end + # Rewinds the underlying StringScanner + # to before the previous token returned by \{#next}. + def return_previous! + if @prev + @scanner.pos = @prev.pos + @prev = nil + @tok = nil + end + end + # @return [Boolean] Whether or not there's more source text to lex. def done? whitespace unless after_interpolation? && @interpolation_stack.last diff --git a/lib/sass/script/parser.rb b/lib/sass/script/parser.rb index <HASH>..<HASH> 100644 --- a/lib/sass/script/parser.rb +++ b/lib/sass/script/parser.rb @@ -378,6 +378,10 @@ RUBY peeked && names.include?(peeked.type) && @lexer.next end + def return_tok! + @lexer.return_previous! + end + def assert_done return if @lexer.done? @lexer.expected!(EXPR_NAMES[:default])
Give the Sass Lexer a lookahead of 2 for keyword argument support.
sass_ruby-sass
train
rb,rb
b978508a1fbc47b5989ac1a7fb57db849f636579
diff --git a/mmm-util/mmm-util-core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java b/mmm-util/mmm-util-core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java index <HASH>..<HASH> 100644 --- a/mmm-util/mmm-util-core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java +++ b/mmm-util/mmm-util-core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java @@ -4,6 +4,7 @@ package net.sf.mmm.util.lang.base; import java.math.BigDecimal; import java.math.BigInteger; +import java.util.Currency; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -99,6 +100,7 @@ public abstract class AbstractDatatypeDetector extends AbstractLoggableComponent registerStandardDatatype(String.class); registerStandardDatatype(Boolean.class); registerStandardDatatype(Character.class); + registerStandardDatatype(Currency.class); registerCustomDatatype(Datatype.class); // internal trick... registerNumberDatatypes(); registerJavaTimeDatatypes();
#<I>: support for Currency
m-m-m_util
train
java
ac91ce208ad60d767c6e7e825d7f1be9a33074b1
diff --git a/tests/relationships/OrderGetDiscountTest.php b/tests/relationships/OrderGetDiscountTest.php index <HASH>..<HASH> 100644 --- a/tests/relationships/OrderGetDiscountTest.php +++ b/tests/relationships/OrderGetDiscountTest.php @@ -85,8 +85,7 @@ class OrderGetDiscountTest extends BaseRelationshipTest $this->prepareProductsAndCoupons(); // Check total discount of order is 10% of product 1 only - echo var_dump($this->order->getTotaldiscount()); - $this->assertTrue($this->order->getTotaldiscount() == 1.00); + $this->assertTrue(round($this->order->getTotaldiscount(), 2) == 1.00); } public function testGetDiscountOfOrderWithProduct1and2() @@ -99,8 +98,7 @@ class OrderGetDiscountTest extends BaseRelationshipTest $this->prepareProductsAndCoupons(); // Check total discount of order is 10% of product 1 and 2 - echo var_dump($this->order->getTotaldiscount()); - $this->assertTrue($this->order->getTotaldiscount() == 10.00); + $this->assertTrue(round($this->order->getTotaldiscount(), 2) == 10.00); // Check GetDiscounts() return correct value foreach ($this->order->getDiscounts() as $item) {
Build fix: test comparing int to float may fail sometimes. Hopefully this will do the trick.
redooor_redminportal
train
php
cc0a01eb4251ebe1fd84821f8fc43aa1e804a04b
diff --git a/OpenTokArchive.php b/OpenTokArchive.php index <HASH>..<HASH> 100644 --- a/OpenTokArchive.php +++ b/OpenTokArchive.php @@ -83,6 +83,10 @@ class OpenTokArchiveVideoResource { return $this->id; } + public function getLength() { + return $this->length; + } + public static function parseXML($videoResourceItem) { return new OpenTokArchiveVideoResource($videoResourceItem['id'], $videoResourceItem['length']); } @@ -99,6 +103,18 @@ class OpenTokArchiveTimelineEvent { $this->offset = $offset; } + public function getEventType() { + return $this->eventType; + } + + public function getResourceId() { + return $this->resourceId; + } + + public function getOffset() { + return $this->offset; + } + public static function parseXML($timelineItem) { return new OpenTokArchiveTimelineEvent($timelineItem['type'], $timelineItem['id'], $timelineItem['offset']); }
Added all the getters/setters for the OpenTokArchive sub-classes
opentok_OpenTok-PHP-SDK
train
php
aea7663bfe0ab4ecf147b11fe4db6ec290a140eb
diff --git a/lib/conceptql/rdbms/generic.rb b/lib/conceptql/rdbms/generic.rb index <HASH>..<HASH> 100644 --- a/lib/conceptql/rdbms/generic.rb +++ b/lib/conceptql/rdbms/generic.rb @@ -20,11 +20,11 @@ module ConceptQL ds = Sequel[ds] if ds.is_a?(Symbol) table = Sequel[table] if table.is_a?(Symbol) expr = exprs.inject(&:&) - ds.where(ds.db[table.as(:r)] + ds.from_self(alias: :l).where(ds.db[table.as(:r)] .select(1) .where(expr) .exists - ) + ).from_self end def cast_date(date)
Fix issues so TShank passes
outcomesinsights_conceptql
train
rb
73b7d6ebb390be1469cf846c88fb5f68b98f2afe
diff --git a/src/Elfiggo/Brobdingnagian/Extension.php b/src/Elfiggo/Brobdingnagian/Extension.php index <HASH>..<HASH> 100644 --- a/src/Elfiggo/Brobdingnagian/Extension.php +++ b/src/Elfiggo/Brobdingnagian/Extension.php @@ -41,7 +41,7 @@ class Extension implements ExtensionInterface $container->setShared('elfiggo.brobdingnagian.reporter', function (ServiceContainer $c) { return new Reporter( $c->get('elfiggo.brobdingnagian.params'), - $c->get('console.io') + $c->get('elfiggo.brobdingnagian.logger') ); }); diff --git a/src/Elfiggo/Brobdingnagian/Report/LoggerHandler.php b/src/Elfiggo/Brobdingnagian/Report/LoggerHandler.php index <HASH>..<HASH> 100644 --- a/src/Elfiggo/Brobdingnagian/Report/LoggerHandler.php +++ b/src/Elfiggo/Brobdingnagian/Report/LoggerHandler.php @@ -39,7 +39,7 @@ class LoggerHandler implements Handler public function output() { - foreach($this->logger->messages() as $data) { + foreach($this->messages() as $data) { $this->io->writeln($data['message']); } }
Update Logger and Dependencies in Loader
Elfiggo_brobdingnagian-detector-phpspec-extension
train
php,php
d0adeaf3782b91623dfa68644ab903ba606273a4
diff --git a/lib/agent/providers/network/index.js b/lib/agent/providers/network/index.js index <HASH>..<HASH> 100644 --- a/lib/agent/providers/network/index.js +++ b/lib/agent/providers/network/index.js @@ -151,7 +151,7 @@ exp.get_active_network_interface = function(callback){ /** * Callsback an array of wireless interface names **/ -exp.get_wireless_interface_names = os_functions.get_wireless_interfaces_list; +exp.get_wireless_interfaces_list = os_functions.get_wireless_interfaces_list; /** *
Fixed wireless interfaces list fn name in network.
prey_prey-node-client
train
js
78c68772940d1fa77c7ededf55e49014f887962f
diff --git a/packages/@vue/cli-service/lib/config/dev.js b/packages/@vue/cli-service/lib/config/dev.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-service/lib/config/dev.js +++ b/packages/@vue/cli-service/lib/config/dev.js @@ -10,6 +10,11 @@ module.exports = (api, options) => { .plugin('hmr') .use(require('webpack/lib/HotModuleReplacementPlugin')) + // https://github.com/webpack/webpack/issues/6642 + webpackConfig + .output + .globalObject('this') + webpackConfig .plugin('no-emit-on-errors') .use(require('webpack/lib/NoEmitOnErrorsPlugin'))
fix: fix hmr compatibility with worker-loader (#<I>) closes #<I>
vuejs_vue-cli
train
js
cb0b2e985a3da5b586e685b0ec90288488a2e5b6
diff --git a/test/integration/_lib/helpers/einhorn_helpers.rb b/test/integration/_lib/helpers/einhorn_helpers.rb index <HASH>..<HASH> 100644 --- a/test/integration/_lib/helpers/einhorn_helpers.rb +++ b/test/integration/_lib/helpers/einhorn_helpers.rb @@ -9,7 +9,11 @@ module Helpers end def default_einhorn_command - ['bundle', 'exec', '--keep-file-descriptors', File.expand_path('bin/einhorn', einhorn_code_dir)] + cmd = ['bundle', 'exec'] + cmd << '--keep-file-descriptors' if RUBY_VERSION >= '2.0' + cmd << File.expand_path('bin/einhorn', einhorn_code_dir) + + cmd end def with_running_einhorn(cmdline, options = {})
Only pass --keep-file-descriptors if we need it
stripe_einhorn
train
rb
e353b7609e93092c5af54c4c5eb762ae49b30e3e
diff --git a/src/Connection.php b/src/Connection.php index <HASH>..<HASH> 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -92,6 +92,13 @@ class Connection private $options = null; /** + * Connection timeout + * + * @var integer + */ + private $timeout = null; + + /** * Stream File Pointer. * * @var mixed Socket file pointer @@ -213,6 +220,7 @@ class Connection */ public function connect($timeout = null) { + $this->timeout = $timeout; $this->streamSocket = $this->getStream($this->options->getAddress(), $timeout); $msg = 'CONNECT '.$this->options; $this->send($msg); @@ -441,7 +449,7 @@ class Connection { $this->reconnects += 1; $this->close(); - $this->connect(); + $this->connect($this->timeout); } /**
TASK: Respect connection timeout on reconnect
repejota_phpnats
train
php
774537d86c85e42f187b66550483e87930a701a4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,3 @@ from distutils.core import setup -setup(name='ClearBlade', packages=['clearblade']) \ No newline at end of file +setup(name='ClearBlade', packages=['clearblade'], install_requires=['requests','paho-mqtt',])
Added additional installs in the setup.py script which are required
ClearBlade_ClearBlade-Python-SDK
train
py
cef1266df6d7feee294b9c8070c721d2d7002c07
diff --git a/cwltool/process.py b/cwltool/process.py index <HASH>..<HASH> 100644 --- a/cwltool/process.py +++ b/cwltool/process.py @@ -344,6 +344,7 @@ def formatSubclassOf(fmt, cls, ontology, visited): def checkFormat(actualFile, inputFormats, ontology): # type: (Union[Dict[Text, Any], List, Text], Union[List[Text], Text], Graph) -> None for af in aslist(actualFile): + if not af: continue if "format" not in af: raise validate.ValidationException(u"Missing required 'format' for File %s" % af) for inpf in aslist(inputFormats): @@ -551,7 +552,7 @@ class Process(object): if self.formatgraph: for i in self.tool["inputs"]: d = shortname(i["id"]) - if d in builder.job and i.get("format") and builder.job[d]: + if d in builder.job and i.get("format"): checkFormat(builder.job[d], builder.do_eval(i["format"]), self.formatgraph) builder.bindings.extend(builder.bind_input(self.inputs_record_schema, builder.job))
Fix #<I>: checkFormat fail for null input Patched in the function checkFormat itself, instead of the code which calls it
common-workflow-language_cwltool
train
py
d73fe107d5e8603273609afc19bd2374f534f07a
diff --git a/src/config/eslint.js b/src/config/eslint.js index <HASH>..<HASH> 100644 --- a/src/config/eslint.js +++ b/src/config/eslint.js @@ -18,6 +18,7 @@ module.exports = { // airbnb config modifications 'no-unused-vars': 'warn', // easier for development 'linebreak-style': 'off', + 'react/prop-types': 'off', // disable rule until update to Flow v0.53 'arrow-parens': 'off', // conflict with Prettier 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
Disable react/prop-types rule, because of conflicts with Flow <I>
ProAI_react-kickstarter
train
js
521569ae960d405ffda8c5fb5a696de10a87ede0
diff --git a/openquake/commonlib/parallel.py b/openquake/commonlib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/parallel.py +++ b/openquake/commonlib/parallel.py @@ -396,7 +396,7 @@ class TaskManager(object): idx = self.task_ids.index(task_id) self.task_ids.pop(idx) fut = Future() - fut.set_result(result_dict['result']) + fut.set_result(result_dict['result'].unpickle()) # work around a celery bug del app.backend._cache[task_id] yield fut
Added a crucial .unpickle() Former-commit-id: a3e<I>a<I>dc<I>ffeb<I>c<I>b<I>ac
gem_oq-engine
train
py
23609faf1b2cb85f7c88fcf57b1b8c1af2122598
diff --git a/src/Discord/Parts/Channel/Reaction.php b/src/Discord/Parts/Channel/Reaction.php index <HASH>..<HASH> 100644 --- a/src/Discord/Parts/Channel/Reaction.php +++ b/src/Discord/Parts/Channel/Reaction.php @@ -34,17 +34,13 @@ class Reaction extends Part protected $fillable = ['count', 'me', 'emoji', 'message_id', 'channel_id']; /** - * Gets the emoji identifier, either the `id` or `name`. + * Gets the emoji identifier, combination of `id` and `name`. * * @return string */ protected function getIdAttribute(): string { - if ($emoji = $this->emoji) { - return ":{$emoji->name}:{$emoji->id}"; - } - - return ''; + return ":{$this->emoji->name}:{$this->emoji->id}"; } /**
Reaction: emoji should always be present
teamreflex_DiscordPHP
train
php
df53147f5798c9b5aa67764528247fe92c8b3cc0
diff --git a/markus/__init__.py b/markus/__init__.py index <HASH>..<HASH> 100644 --- a/markus/__init__.py +++ b/markus/__init__.py @@ -15,6 +15,6 @@ __author__ = "Will Kahn-Greene" __email__ = "willkg@mozilla.com" # yyyymmdd -__releasedate__ = "20200415" +__releasedate__ = "" # x.y.z or x.y.z.dev0 -- semver -__version__ = "2.2.0" +__version__ = "2.2.1.dev0"
Update to <I>.dev0 for development
willkg_markus
train
py
1b442fb830611492493b26b0bf1ca2537d9d1b61
diff --git a/watch/watcher.go b/watch/watcher.go index <HASH>..<HASH> 100644 --- a/watch/watcher.go +++ b/watch/watcher.go @@ -74,6 +74,9 @@ func NewWatcher(c *api.Client, once bool) (*Watcher, error) { // creating the view, it will be returned here (but future errors returned by // the view will happen on the channel). func (w *Watcher) AddDependency(dep dependency.Dependency) (bool, error) { + w.Lock() + defer w.Unlock() + log.Printf("[INFO] (watcher) adding dependency %s", dep.Display()) if _, ok := w.depViewMap[dep.HashCode()]; ok { @@ -102,6 +105,9 @@ func (w *Watcher) AddDependency(dep dependency.Dependency) (bool, error) { // function will return false. If the View does exist, this function will return // true upon successful deletion. func (w *Watcher) RemoveDependency(dep dependency.Dependency) bool { + w.Lock() + defer w.Unlock() + log.Printf("[INFO] (watcher) removing dependency %s", dep.Display()) if view, ok := w.depViewMap[dep.HashCode()]; ok {
Lock when adding and removing dependencies
hashicorp_consul-template
train
go
bb878828b1fc26da896e3e00dc4ec1a7f1de390c
diff --git a/validator/sawtooth_validator/gossip/gossip.py b/validator/sawtooth_validator/gossip/gossip.py index <HASH>..<HASH> 100644 --- a/validator/sawtooth_validator/gossip/gossip.py +++ b/validator/sawtooth_validator/gossip/gossip.py @@ -384,6 +384,7 @@ class Topology(Thread): def run(self): while not self._stopped: try: + self._refresh_peer_list(self._gossip.get_peers()) peers = self._gossip.get_peers() if len(peers) < self._min_peers: LOGGER.debug("Below minimum peer threshold. "
Refresh peer list to see if connections drop on idle network
hyperledger_sawtooth-core
train
py
650305f6197d4a3b81521e447c6fcbb3a453d98f
diff --git a/angr/analyses/reaching_definitions/dep_graph.py b/angr/analyses/reaching_definitions/dep_graph.py index <HASH>..<HASH> 100644 --- a/angr/analyses/reaching_definitions/dep_graph.py +++ b/angr/analyses/reaching_definitions/dep_graph.py @@ -96,13 +96,13 @@ class DepGraph: predecessors = list(graph.predecessors(def_)) result.add_node(def_) - result.add_edges_from(list(map( - lambda e: (*e, graph.get_edge_data(*e)), - map( - lambda p: (p, def_), - predecessors - ) - ))) + edges_and_data = [ ] + for pred in predecessors: + edge_data = graph.get_edge_data(pred, def_) + if edge_data is None: + result.add_edge(pred, def_) + else: + result.add_edge(pred, def_, **edge_data) visited = visited or set() visited.add(def_)
DepGraph: Fix a crash if the edge data is None when generating closures. (#<I>)
angr_angr
train
py
cf9949694207bd028206305cead6b9745f6e80c2
diff --git a/drivers/endnotexml.php b/drivers/endnotexml.php index <HASH>..<HASH> 100644 --- a/drivers/endnotexml.php +++ b/drivers/endnotexml.php @@ -30,9 +30,12 @@ class RefLib_endnotexml { * @var array */ var $refTypes = array( + 'Book Section' => 5, 'Electronic Article' => 43, 'Journal Article' => 17, 'Map' => 20, + 'Report' => 27, + 'Unpublished Work' => 34, ); /** @@ -210,7 +213,7 @@ class RefLib_endnotexml { if (isset($typesFlipped[$this->_GetText($find)])) { $ref['type'] = $typesFlipped[$this->_GetText($find)]; } else { - die('UNKNOWN: ' . $this->_GetText($find)); + die('Unknown reference type: ' . $this->_GetText($find) . ". Please report this at https://github.com/hash-bang/RefLib/issues with a copy of your EndNote XML file if you believe this is in error"); } }
Added more refTypes More helpful error message for unknown reference types
hash-bang_RefLib
train
php