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
e551377d5d5518eab557a7176597f4200fb82c89
diff --git a/motion/ruby_motion_query/app.rb b/motion/ruby_motion_query/app.rb index <HASH>..<HASH> 100644 --- a/motion/ruby_motion_query/app.rb +++ b/motion/ruby_motion_query/app.rb @@ -32,6 +32,19 @@ module RubyMotionQuery UIApplication.sharedApplication.delegate end + # @return [UIApplication] + def get + UIApplication.sharedApplication + end + + # Returns boolean of success of hiding + # @return [Boolean] + def hide_keyboard + self.get.sendAction(:resignFirstResponder, to:nil, from:nil, forEvent:nil) + end + alias :resign_responders :hide_keyboard + alias :end_editing :hide_keyboard + # @return [Symbol] Environment the app is running it def environment @_environment ||= RUBYMOTION_ENV.to_sym
code to hide keyboard from rmq.app added
infinitered_rmq
train
rb
f1c568a43b2b7ce66d88edb089b8bb9b811053a1
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 @@ -7,4 +7,7 @@ begin rescue LoadError end +# https://github.com/geemus/excon/issues/142#issuecomment-8531521 +Excon.defaults[:nonblock] = false if RUBY_PLATFORM == 'java' + require 'peddler'
Use blocking connect if running on JRuby
hakanensari_peddler
train
rb
c35eda5a951b6d850e98259d1c923cb0fa7cb875
diff --git a/safe/impact_functions/loader.py b/safe/impact_functions/loader.py index <HASH>..<HASH> 100644 --- a/safe/impact_functions/loader.py +++ b/safe/impact_functions/loader.py @@ -67,6 +67,8 @@ from safe.impact_functions.volcanic.volcano_point_population\ # Volcanic Ash from safe.impact_functions.ash.ash_raster_landcover.impact_function import \ AshRasterLandcoverFunction +from safe.impact_functions.ash.ash_raster_population.impact_function import \ + AshRasterPopulationFunction def register_impact_functions(): @@ -116,3 +118,5 @@ def register_impact_functions(): # Volcanic Ash IF's # Added in 3.4 impact_function_registry.register(AshRasterLandcoverFunction) + # Added in 3.5 + impact_function_registry.register(AshRasterPopulationFunction)
Add ash raster IF to loader.
inasafe_inasafe
train
py
a36595c2bab270022e659a77706eae7bd28bed5a
diff --git a/azurerm/resource_arm_dns_cname_record.go b/azurerm/resource_arm_dns_cname_record.go index <HASH>..<HASH> 100644 --- a/azurerm/resource_arm_dns_cname_record.go +++ b/azurerm/resource_arm_dns_cname_record.go @@ -47,9 +47,8 @@ func resourceArmDnsCNameRecord() *schema.Resource { }, "records": { - Type: schema.TypeSet, + Type: schema.TypeString, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, Removed: "Use `record` instead. This attribute will be removed in a future version", },
r/cname_record: `records` is a string, albeit deprecated
terraform-providers_terraform-provider-azurerm
train
go
eefe7f3ba2ac0595e11743ec1ad5eedeb0958dab
diff --git a/src/tests/test_definitions.py b/src/tests/test_definitions.py index <HASH>..<HASH> 100644 --- a/src/tests/test_definitions.py +++ b/src/tests/test_definitions.py @@ -223,7 +223,7 @@ def test_import_parser(): source_future_import_invalid7, source_future_import_invalid8, ), 1): - module = parse(StringIO(source_ucl), 'file_invalid{}.py'.format(i)) + module = parse(StringIO(source_ucli), 'file_invalid{}.py'.format(i)) assert Module('file_invalid{}.py'.format(i), _, 1, _, _, None, _, _,
Fix parser test case for invalid source Commit e<I> introduced some tests that intend to iterate over strings that contain definitions of invalid source code and then assert that the parser does something sensible with these sources. However, there was a typo in e<I> causing the tests to not execute as expected: the invalid sources are iterated in the `source_ucli` variable. However, the parsing is done against the `source_ucl` variable which contains a known parsable source string!
PyCQA_pydocstyle
train
py
f21bdd778baa87d237cffc7aa2c89434897fba57
diff --git a/src/python/dxpy/scripts/dx_build_app.py b/src/python/dxpy/scripts/dx_build_app.py index <HASH>..<HASH> 100755 --- a/src/python/dxpy/scripts/dx_build_app.py +++ b/src/python/dxpy/scripts/dx_build_app.py @@ -242,7 +242,9 @@ def _lint(dxapp_json_filename, mode): readme_filename = _find_readme(os.path.dirname(dxapp_json_filename)) if 'description' in app_spec: if readme_filename: - logger.warn('"description" field shadows file ' + readme_filename) + raise dxpy.app_builder.AppBuilderException('Description was provided both in Readme.md ' + 'and in the "description" field of {file}. Please consolidate content in Readme.md ' + 'and remove the "description" field.'.format(file=dxapp_json_filename)) if not app_spec['description'].strip().endswith('.'): logger.warn('"description" field should be written in complete sentences and end with a period') else:
PTFM-<I> Don't allow "description" field to shadow Readme.md
dnanexus_dx-toolkit
train
py
488e93ce39ba13cb5feb06990ed07459049e8c76
diff --git a/src/box.js b/src/box.js index <HASH>..<HASH> 100644 --- a/src/box.js +++ b/src/box.js @@ -100,7 +100,8 @@ Taaspace.Box = (function () { Box.prototype.area = function () { return this.w * this.h; }; - + + // Mutators
.area() added to box.
taataa_tapspace
train
js
a3ba11178cabcfb340bfe674eb672bf41e3967ab
diff --git a/examples/life.py b/examples/life.py index <HASH>..<HASH> 100644 --- a/examples/life.py +++ b/examples/life.py @@ -153,6 +153,7 @@ def main(): else: time.sleep(0.01) tdl.flush() + tdl.set_title("Conway's Game of Life - %i FPS" % tdl.get_fps()) if __name__ == '__main__':
added FPS counter to life.py
libtcod_python-tcod
train
py
dfeb4ed52a88b8033bb304773339a86426fc20ee
diff --git a/test/scheduler.js b/test/scheduler.js index <HASH>..<HASH> 100644 --- a/test/scheduler.js +++ b/test/scheduler.js @@ -58,8 +58,8 @@ describe('Scheduler', function(){ - describe('#spawnWorker_p', function(done){ - it('properly stores provided data.', function(){ + describe('#spawnWorker_p', function(){ + it('properly stores provided data.', function(done){ //check that we're starting off with no workers. Object.keys(scheduler.$workers).should.be.empty;
Properly placed one more done() callback.
rstudio_shiny-server
train
js
63bfd9ef79230225302f81f0c3e870d6e9da8dd4
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -18,7 +18,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase */ public function testLog($sql, $params, $logParams) { - $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface'); + $logger = $this->getMock('Psr\\Log\\LoggerInterface'); $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') @@ -47,7 +47,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase public function testLogNonUtf8() { - $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface'); + $logger = $this->getMock('Psr\\Log\\LoggerInterface'); $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
[Doctrine] removed usage of the deprecated LoggerInterface in some tests
symfony_symfony
train
php
b99ca08d0e9131e4add101687699c90a6dff0ba9
diff --git a/lib/Thelia/Core/Template/Element/BaseLoop.php b/lib/Thelia/Core/Template/Element/BaseLoop.php index <HASH>..<HASH> 100755 --- a/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -69,14 +69,16 @@ abstract class BaseLoop */ public function __construct(ContainerInterface $container) { - $this->checkInterface(); - $this->container = $container; + $this->translator = $container->get("thelia.translator"); + + $this->checkInterface(); + $this->request = $container->get('request'); $this->dispatcher = $container->get('event_dispatcher'); $this->securityContext = $container->get('thelia.securityContext'); - $this->translator = $container->get("thelia.translator"); + $this->args = $this->getArgDefinitions()->addArguments($this->getDefaultArgs(), false); }
instanciate translator before checking loop class interface
thelia_core
train
php
f70422152ed2ce7a1b498595e24bf17a6d3f0551
diff --git a/tasks/grunt-mochaccino.js b/tasks/grunt-mochaccino.js index <HASH>..<HASH> 100644 --- a/tasks/grunt-mochaccino.js +++ b/tasks/grunt-mochaccino.js @@ -21,6 +21,7 @@ module.exports = function (grunt) { 'use strict'; + var os = require('os'); var fs = require('fs'); var path = require('path'); var spawn = require('child_process').spawn; @@ -50,7 +51,18 @@ module.exports = function (grunt) { grunt.file.mkdir(reportDir); } - var args = ['-R', reporter]; + var args = []; + + // because mocha is a batch file, we have to run it via cmd.exe + // when on Windows + var onWindows = /win/.test(os.platform()); + if (onWindows) { + mocha = 'cmd.exe'; + args = ['/c', 'mocha']; + } + + // add reporter + args = args.concat(['-R', reporter]); var mochaOptions = {stdio: 'inherit'}; var covReportStream = null;
Use cmd.exe to call mocha batch file on Windows
intel_grunt-mochaccino
train
js
6356ecc29ebcb98f70df9ca92a6a41489486b3b8
diff --git a/src/leaflet_layer.js b/src/leaflet_layer.js index <HASH>..<HASH> 100755 --- a/src/leaflet_layer.js +++ b/src/leaflet_layer.js @@ -132,7 +132,10 @@ function extendLeaflet(options) { this.modifyScrollWheelBehavior(map); this.modifyDoubleClickZoom(map); debounceMoveEnd = debounce( - function(map) { map._moveEnd(true); }, + function(map) { + map._moveEnd(true); + map.fire('viewreset'); // keep other leaflet layers in sync + }, map.options.wheelDebounceTime * 2 ); this.trackMapLayerCounts(map); @@ -474,7 +477,6 @@ function extendLeaflet(options) { newCenter = map.containerPointToLatLng(viewHalf.add(centerOffset)); var ret = map._move(newCenter, zoom, { flyTo: true }); - map.fire('viewreset'); return ret; };
leaflet layer: call viewreset with moveend
tangrams_tangram
train
js
80537f9032d4251ca3129d3393fa5b96a5f9d010
diff --git a/insights/core/dr.py b/insights/core/dr.py index <HASH>..<HASH> 100644 --- a/insights/core/dr.py +++ b/insights/core/dr.py @@ -274,13 +274,16 @@ def get_subgraphs(graph=DEPENDENCIES): def load_components(path, include=".*", exclude="test"): - include = re.compile(include).search if include else lambda x: True - exclude = re.compile(exclude).search if exclude else lambda x: False + do_include = re.compile(include).search if include else lambda x: True + do_exclude = re.compile(exclude).search if exclude else lambda x: False prefix = path.replace('/', '.') + '.' - for _, name, _ in pkgutil.walk_packages(path=[path], prefix=prefix): - if include(name) and not exclude(name): + package = importlib.import_module(path.replace("/", ".")) + for _, name, is_pkg in pkgutil.walk_packages(path=package.__path__, prefix=prefix): + if do_include(name) and not do_exclude(name): log.debug("Importing %s" % name) importlib.import_module(name) + if is_pkg: + load_components(name.replace(".", "/"), include, exclude) def first_of(dependencies, broker):
Fix load_components when importing from eggs.
RedHatInsights_insights-core
train
py
46a9b94ad3318e9f809288fb65db73fd10b31367
diff --git a/providers/core.tcpsocket.js b/providers/core.tcpsocket.js index <HASH>..<HASH> 100644 --- a/providers/core.tcpsocket.js +++ b/providers/core.tcpsocket.js @@ -71,8 +71,8 @@ TcpSocket_node.prototype.getInfo = function (callback) { connected: this.connection.state === TcpSocket_node.state.CONNECTED, peerAddress: this.connection.remoteAddress, peerPort: this.connection.remotePort, - localAddress: this.connection.localAddress, - localPort: this.connection.localPort + localAddress: this.connection.address().address, + localPort: this.connection.address().port }); } };
Fix TCP socket provider to pass the unit test. The provider was using |connection.localAddress| to populate the response from getInfo, but node does not fill in |localAddress| for server sockets. However, both client and server sockets provide their local address through the |address()| getter.
freedomjs_freedom-for-node
train
js
8029ad45f028609538507972a616fada6368f0d6
diff --git a/salt/utils/http.py b/salt/utils/http.py index <HASH>..<HASH> 100644 --- a/salt/utils/http.py +++ b/salt/utils/http.py @@ -921,6 +921,7 @@ def parse_cookie_header(header): for item in list(cookie): if item in attribs: continue + name = item value = cookie.pop(item) # cookielib.Cookie() requires an epoch
Fix parse_cookie_header function cookie name always None parse_cookie_header function is used when backend is tornado. But cookie name is always None, because programe not set name correct value
saltstack_salt
train
py
7ca00d176b3e3eb3fae3df3455aa2a2f1f786e41
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -6,7 +6,7 @@ from django.conf import settings from celery.decorators import task -from .models import EventWatch +from notifications.models import EventWatch log = logging.getLogger('k.notifications') @@ -29,7 +29,11 @@ def send_notification(content_type, pk, subject, content, exclude=None, emails = [(subject, content, settings.NOTIFICATIONS_FROM_ADDRESS, [w.email]) for w in watchers] - send_mass_mail(emails) + sent = send_mass_mail(emails, fail_silently=True) + + if sent != len(emails): + log.warning('Tried to send %s emails, but only sent %s' % + (len(emails), sent)) @task(rate_limit='4/m')
send_mass_mail() swallows errors and continues [bug <I>]
mozilla_django-tidings
train
py
7dda40b1b96f4afebaef4a2c8455a3aa4fdbe7a4
diff --git a/java/server/src/org/openqa/grid/internal/TestSession.java b/java/server/src/org/openqa/grid/internal/TestSession.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/grid/internal/TestSession.java +++ b/java/server/src/org/openqa/grid/internal/TestSession.java @@ -306,6 +306,7 @@ public class TestSession { HttpHost host = new HttpHost(remoteURL.getHost(), remoteURL.getPort()); HttpResponse proxyResponse = client.execute(host, proxyRequest); + lastActivity = System.currentTimeMillis(); response.setStatus(proxyResponse.getStatusLine().getStatusCode()); HttpEntity responseBody = proxyResponse.getEntity();
KevinMenard: Update the test session activity when a command response is received as well. r<I>
SeleniumHQ_selenium
train
java
235f14b5befacba95a727326a3f226f2d104908f
diff --git a/bazaar/bazaar.py b/bazaar/bazaar.py index <HASH>..<HASH> 100644 --- a/bazaar/bazaar.py +++ b/bazaar/bazaar.py @@ -4,6 +4,7 @@ from fs import open_fs from datetime import datetime import os import six +import re FileAttrs = namedtuple('FileAttrs', ["created", "updated", "name", "size", "namespace"]) @@ -243,7 +244,7 @@ class FileSystem(object): if namespace is None: namespace = self.namespace - name = {"$regex": '^{dir}/([^\/]*)$'.format(dir=path if path != "/" else "")} + name = {"$regex": '^{dir}/([^\/]*)$'.format(dir=re.escape(path) if path != "/" else "")} files = File.objects(namespace=namespace, name=name) return [file.name.split("/")[-1] for file in files] diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open('requirements.txt') as fp: setup( name='bazaar', packages=['bazaar'], - version='0.10', + version='0.11', description='Agnostic file storage', author='BMAT developers', author_email='tv-av@bmat.com',
Escape special chars for weird names
bmat_bazaar
train
py,py
82c044d8fa062422d6ccce9028543ace97c3c9f4
diff --git a/lib/mountain_view/engine.rb b/lib/mountain_view/engine.rb index <HASH>..<HASH> 100644 --- a/lib/mountain_view/engine.rb +++ b/lib/mountain_view/engine.rb @@ -31,8 +31,8 @@ module MountainView initializer "mountain_view.add_helpers" do ActiveSupport.on_load :action_controller do - helper MountainView::ApplicationHelper - helper MountainView::ComponentHelper + ::ActionController::Base.helper MountainView::ApplicationHelper + ::ActionController::Base.helper MountainView::ComponentHelper end end end
Fix nomethoderror when including helpers Explicitly calls helper inclusion via ActionController::Base, preventing errors in Rails <I> (Issue#<I>).
devnacho_mountain_view
train
rb
0974f2415425eaeee3b4971b03eab75a17df053e
diff --git a/plenum/client/client.py b/plenum/client/client.py index <HASH>..<HASH> 100644 --- a/plenum/client/client.py +++ b/plenum/client/client.py @@ -117,7 +117,7 @@ class Client(Motor): if wallet: self.wallet = wallet else: - storage = WalletStorageFile.fromName(name, basedirpath) + storage = WalletStorageFile.fromName(self.name, basedirpath) self.wallet = Wallet(self.name, storage) signers = None # type: Dict[str, Signer]
bug fixed by using the correct client name
hyperledger_indy-plenum
train
py
8230a5ded87ff3ba1d93a713813a08c148319cb4
diff --git a/builtin/providers/aws/resource_aws_dynamodb_table.go b/builtin/providers/aws/resource_aws_dynamodb_table.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_dynamodb_table.go +++ b/builtin/providers/aws/resource_aws_dynamodb_table.go @@ -346,7 +346,10 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er } // Wait, till table is active before imitating any TimeToLive changes - waitForTableToBeActive(d.Id(), meta) + if err := waitForTableToBeActive(d.Id(), meta); err != nil { + log.Printf("[DEBUG] Error waiting for table to be active: %s", err) + return err + } log.Printf("[DEBUG] Setting DynamoDB TimeToLive on arn: %s", tableArn) if timeToLiveOk {
provider/aws: aws_dynamodb_table Add support for TimeToLive. Fix errcheck
hashicorp_terraform
train
go
e55933344dc397b2aa6987a497ce11328c3691df
diff --git a/Processor.php b/Processor.php index <HASH>..<HASH> 100644 --- a/Processor.php +++ b/Processor.php @@ -376,16 +376,8 @@ class Processor $propertyContainer = $this->getPropertyDefinition($activectx, $property, '@container'); - if (in_array($propertyContainer, array('@language', '@annotation'))) + if (is_object($value) && in_array($propertyContainer, array('@language', '@annotation'))) { - // Expand language and annotation maps - if (false === is_object($value)) - { - throw new SyntaxException( - "Invalid value for \"$property\" detected. It must be an object as it is a @language or @annotation container.", - $value); - } - $result = array(); if ('@language' === $propertyContainer)
Only invoke language and annotation map expansion if the value is a JSON object This addresses #<I> and #<I>.
lanthaler_JsonLD
train
php
f08cd352fb36107c77c9289cbce7c9162f281fac
diff --git a/ssbio/protein/structure/properties/residues.py b/ssbio/protein/structure/properties/residues.py index <HASH>..<HASH> 100644 --- a/ssbio/protein/structure/properties/residues.py +++ b/ssbio/protein/structure/properties/residues.py @@ -57,8 +57,11 @@ def search_ss_bonds(model, threshold=3.0): bridges = [] for cys_pair in pairs: - if cys_pair[0]['SG'] - cys_pair[1]['SG'] < threshold: - bridges.append(cys_pair) + try: + if cys_pair[0]['SG'] - cys_pair[1]['SG'] < threshold: + bridges.append(cys_pair) + except KeyError: # This will occur when a CYS residue is missing a SG atom for some reason + continue infodict = {} if bridges:
Skip over CYS residues with no SG atoms in find_disulfide_bridges (cherry picked from commit d<I>cebe)
SBRG_ssbio
train
py
79055d2e769d391c0572d6ce3e94a60917b400c5
diff --git a/sdk/src/api.js b/sdk/src/api.js index <HASH>..<HASH> 100644 --- a/sdk/src/api.js +++ b/sdk/src/api.js @@ -101,6 +101,8 @@ export default class API { async pushModule(name, directory, system = false) { const dest = path.join(system ? SILK_MODULE_ROOT : DATA_MODULE_ROOT, name); + await this.adb('root'); + await this.adb('wait-for-device'); if (system) { await this.adb('remount'); }
adb root before remounting
silklabs_silk
train
js
f0580543d71f1c86bbe526967d2d8b842d77464b
diff --git a/src/lib.js b/src/lib.js index <HASH>..<HASH> 100644 --- a/src/lib.js +++ b/src/lib.js @@ -28,8 +28,8 @@ const dePseudify = (function () { */ '::?-(?:moz|ms|webkit|o)-[a-z0-9-]+' ], - // Actual regex is of the format: /([^\\])(:hover|:focus)/g - pseudosRegex = new RegExp('([^\\\\])(' + ignoredPseudos.join('|') + ')', 'g'); + // Actual regex is of the format: /([^\\])(:hover|:focus)+/ + pseudosRegex = new RegExp('([^\\\\])(' + ignoredPseudos.join('|') + ')+'); return function (selector) { return selector.replace(pseudosRegex, '$1');
Fix dePseudify() regression when multiple ignored If the `selector` here has multiple pseudo elements attached to it, then this new "escape-aware" regular expression doesn't work without allowing adding a quantifier after the closing parenthesis for the ignored pseudos.
uncss_uncss
train
js
dea5581e18d08459cfc303adefd46c9bd88f3833
diff --git a/library/Public.php b/library/Public.php index <HASH>..<HASH> 100644 --- a/library/Public.php +++ b/library/Public.php @@ -136,11 +136,10 @@ if (!function_exists('municipio_get_mime_link_item')) { if (!function_exists('municipio_to_aspect_ratio')) { function municipio_to_aspect_ratio($ratio, $size) { - $ratio = explode(':', $ratio); - - $width = round($size[0]); - $height = round(($width / $ratio[0]) * $ratio[1]); - + if (count($ratio = explode(":", $ratio)) == 2) { + $width = round($size[0]); + $height = round(($width / $ratio[0]) * $ratio[1]); + } return array($width, $height); } }
Check that ratio is set before calculating.
helsingborg-stad_Municipio
train
php
81b9378d097981ab6d3df43fa04c1a069cc383c8
diff --git a/merb-gen/lib/generators/merb/merb_flat.rb b/merb-gen/lib/generators/merb/merb_flat.rb index <HASH>..<HASH> 100644 --- a/merb-gen/lib/generators/merb/merb_flat.rb +++ b/merb-gen/lib/generators/merb/merb_flat.rb @@ -16,6 +16,8 @@ module Merb::Generators glob! + empty_directory :gems, 'gems' + def destination_root File.join(@destination_root, base_name) end diff --git a/merb-gen/lib/generators/merb/merb_full.rb b/merb-gen/lib/generators/merb/merb_full.rb index <HASH>..<HASH> 100644 --- a/merb-gen/lib/generators/merb/merb_full.rb +++ b/merb-gen/lib/generators/merb/merb_full.rb @@ -20,6 +20,8 @@ module Merb::Generators glob! + empty_directory :gems, 'gems' + first_argument :name, :required => true, :desc => "Application name" invoke :layout do |generator|
Added empty ./gems dir for merb-gen app (and --flat)
wycats_merb
train
rb,rb
0ff1f4f00006b8ad86c9d32f9e9274ddb3309eaf
diff --git a/indra/assemblers/__init__.py b/indra/assemblers/__init__.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/__init__.py +++ b/indra/assemblers/__init__.py @@ -38,3 +38,7 @@ try: from indra.assemblers.pybel_assembler import PybelAssembler except ImportError: pass +try: + from indra.assemblers.figaro_assembler import FigaroAssembler +except ImportError: + pass
Expose Figaro assembler in assemblers module
sorgerlab_indra
train
py
62f14d0de71a5073eee23bd213af4a9f214d3051
diff --git a/src/org/jgroups/protocols/pbcast/FLUSH.java b/src/org/jgroups/protocols/pbcast/FLUSH.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/protocols/pbcast/FLUSH.java +++ b/src/org/jgroups/protocols/pbcast/FLUSH.java @@ -523,8 +523,7 @@ public class FLUSH extends Protocol } private void onStartFlush(Address flushStarter, FlushHeader fh) - { - isBlockState = true; + { if (stats) { startFlushTime = System.currentTimeMillis(); @@ -569,10 +568,11 @@ public class FLUSH extends Protocol if (flushOkCompleted) { + isBlockState = true; m.putHeader(getName(), new FlushHeader(FlushHeader.FLUSH_COMPLETED, viewID)); passDown(new Event(Event.MSG, m)); if (log.isDebugEnabled()) - log.debug(localAddress + " sent FLUSH_COMPLETED message to " + flushCaller); + log.debug(localAddress + " is blocking FLUSH.down(). Sent FLUSH_COMPLETED message to " + flushCaller); } }
moved blocking on FLUSH.down() from START_FLUSH to FLUSH_OK
belaban_JGroups
train
java
2046983ade493e412d925e2b4a07862418f5f256
diff --git a/gym/lib/gym/version.rb b/gym/lib/gym/version.rb index <HASH>..<HASH> 100644 --- a/gym/lib/gym/version.rb +++ b/gym/lib/gym/version.rb @@ -1,4 +1,4 @@ module Gym - VERSION = "1.8.0" + VERSION = "1.9.0" DESCRIPTION = "Building your iOS apps has never been easier" end
Version Bump (#<I>)
fastlane_fastlane
train
rb
9cbf54e5cc3056c7529bb16ec33ea2c3aba9a54b
diff --git a/src/satosa/satosa_config.py b/src/satosa/satosa_config.py index <HASH>..<HASH> 100644 --- a/src/satosa/satosa_config.py +++ b/src/satosa/satosa_config.py @@ -50,7 +50,7 @@ class SATOSAConfig(object): self._config["INTERNAL_ATTRIBUTES"] = _internal_attributes break if not self._config["INTERNAL_ATTRIBUTES"]: - raise SATOSAConfigurationError("Coudl not load attribute mapping from 'INTERNAL_ATTRIBUTES.") + raise SATOSAConfigurationError("Could not load attribute mapping from 'INTERNAL_ATTRIBUTES.") def _verify_dict(self, conf): """
Fix typo in exception in SATOSAConfig constructor.
IdentityPython_SATOSA
train
py
ca1d08d157f9ebb41b21bfb8ce06df0751173470
diff --git a/src/bundle/Controller/ContentOnTheFlyController.php b/src/bundle/Controller/ContentOnTheFlyController.php index <HASH>..<HASH> 100644 --- a/src/bundle/Controller/ContentOnTheFlyController.php +++ b/src/bundle/Controller/ContentOnTheFlyController.php @@ -295,14 +295,6 @@ class ContentOnTheFlyController extends Controller ? $this->contentActionDispatcher : $this->createContentActionDispatcher; - if (!$location instanceof Location) { - $contentInfo = $this->contentService->loadContentInfo($content->id); - - if (!empty($contentInfo->mainLocationId)) { - $location = $this->locationService->loadLocation($contentInfo->mainLocationId); - } - } - $actionDispatcher->dispatchFormAction( $form, $form->getData(), @@ -310,6 +302,14 @@ class ContentOnTheFlyController extends Controller ['referrerLocation' => $location] ); + if (!$location instanceof Location) { + $contentInfo = $this->contentService->loadContentInfo($content->id); + + if (null !== $contentInfo->mainLocationId) { + $location = $this->locationService->loadLocation($contentInfo->mainLocationId); + } + } + if ($actionDispatcher->getResponse()) { $view = new EditContentOnTheFlySuccessView('@ezdesign/ui/on_the_fly/content_edit_response.html.twig'); $view->addParameters([
EZP-<I>: Fixed CotF blank screen after publishing (#<I>)
ezsystems_ezplatform-admin-ui
train
php
dd651ca1f91f26cace282493ce468d77bc108e01
diff --git a/code/javascript/core/scripts/selenium-api.js b/code/javascript/core/scripts/selenium-api.js index <HASH>..<HASH> 100644 --- a/code/javascript/core/scripts/selenium-api.js +++ b/code/javascript/core/scripts/selenium-api.js @@ -880,7 +880,7 @@ Selenium.prototype.getWhetherThisWindowMatchWindowExpression = function(currentW * @param target new window (which might be relative to the current one, e.g., "_parent") * @return boolean true if the new window is this code's window */ - if (window.opener!=null && window.opener["target"]!=null && window.opener["target"]==window) { + if (window.opener!=null && window.opener[target]!=null && window.opener[target]==window) { return true; } return false;
Fix problem in getWhetherThisWindowMatchWindowExpression: use the value of the variable target, not the literal string "target" r<I>
SeleniumHQ_selenium
train
js
b93b5a6d06abc467fa4a1eda5fe61dc69ca7bbca
diff --git a/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py b/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py index <HASH>..<HASH> 100644 --- a/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py +++ b/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py @@ -191,7 +191,6 @@ def create(dataset, session_id, target, features=None, prediction_window=100, options['prediction_window'] = prediction_window options['batch_size'] = batch_size options['max_iterations'] = max_iterations - options['use_tensorflow'] = params['use_tensorflow'] model.train(dataset, target, session_id, validation_set, options) return ActivityClassifier_beta(model_proxy=model, name=name)
Activity classifier bug fix: don't pass unrecognized options to C++ (#<I>)
apple_turicreate
train
py
1181305f6b368402909cf648cd456722d3399a0a
diff --git a/src/Model/Draft/CategoryDraft.php b/src/Model/Draft/CategoryDraft.php index <HASH>..<HASH> 100644 --- a/src/Model/Draft/CategoryDraft.php +++ b/src/Model/Draft/CategoryDraft.php @@ -11,7 +11,6 @@ use Sphere\Core\Model\OfTrait; use Sphere\Core\Model\Type\CategoryReference; use Sphere\Core\Model\Type\JsonObject; use Sphere\Core\Model\Type\LocalizedString; -use Sphere\Core\Model\Type\Reference; /** * Class CategoryDraft diff --git a/src/Request/AbstractQueryRequest.php b/src/Request/AbstractQueryRequest.php index <HASH>..<HASH> 100644 --- a/src/Request/AbstractQueryRequest.php +++ b/src/Request/AbstractQueryRequest.php @@ -22,10 +22,11 @@ abstract class AbstractQueryRequest extends AbstractApiRequest use SortTrait; /** - * @param $where - * @param $sort - * @param $limit - * @param $offset + * @param \Sphere\Core\Http\JsonEndpoint $endpoint + * @param null $where + * @param null $sort + * @param null $limit + * @param null $offset */ public function __construct($endpoint, $where = null, $sort = null, $limit = null, $offset = null) {
removed unused statement, update doc block for abstract query request
commercetools_commercetools-php-sdk
train
php,php
b0d1ad486c93d54f5386276641317dec77e4d163
diff --git a/code/media/koowa/com_koowa/js/koowa.select2.js b/code/media/koowa/com_koowa/js/koowa.select2.js index <HASH>..<HASH> 100644 --- a/code/media/koowa/com_koowa/js/koowa.select2.js +++ b/code/media/koowa/com_koowa/js/koowa.select2.js @@ -29,7 +29,14 @@ //Workaround for Select2 refusing to ajaxify select elements if (element.get(0).tagName.toLowerCase() === "select") { + var data = element.children(); + element.empty(); + element.get(0).typeName = 'input'; + + var newElement = $('<input />'); + var replaced = element.replaceWith(newElement); + element = newElement; } element.select2(settings);
re #<I> first version of <select> workaround
joomlatools_joomlatools-framework
train
js
e4048da0c14ae7d06d1b0b83cf6ff40dbdc14781
diff --git a/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java b/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java +++ b/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java @@ -218,7 +218,7 @@ public class StackdriverWriter extends AbstractOutputWriter implements OutputWri String inputLine = null; final URL metadataUrl = new URL("http://169.254.169.254/latest/meta-data/instance-id"); URLConnection metadataConnection = metadataUrl.openConnection(); - BufferedReader in = new BufferedReader(new InputStreamReader(metadataConnection.getInputStream())); + BufferedReader in = new BufferedReader(new InputStreamReader(metadataConnection.getInputStream(), "UTF-8")); while ((inputLine = in.readLine()) != null) { detectedInstanceId = inputLine; }
use UTF-8 instead of relying on default charset, solves findBugs issue as well as being better form in general
jmxtrans_embedded-jmxtrans
train
java
20751504ea34d42f4490a8fe45ed9fb5055e8e4b
diff --git a/tilequeue/utils.py b/tilequeue/utils.py index <HASH>..<HASH> 100644 --- a/tilequeue/utils.py +++ b/tilequeue/utils.py @@ -32,12 +32,12 @@ def grouper(iterable, n): def parse_log_file(log_file): - ip_pattern = '(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' + ip_pattern = r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # didn't match againts explicit date pattern, in case it changes - date_pattern = '\[([\d\w\s\/:]+)\]' - tile_id_pattern = '\/([\w]+)\/([\d]+)\/([\d]+)\/([\d]+)\.([\d\w]*)' + date_pattern = r'\[([\d\w\s\/:]+)\]' + tile_id_pattern = r'\/([\w]+)\/([\d]+)\/([\d]+)\/([\d]+)\.([\d\w]*)' - log_pattern = '%s - - %s "([\w]+) %s.*' % ( + log_pattern = r'%s - - %s "([\w]+) %s.*' % ( ip_pattern, date_pattern, tile_id_pattern) tile_log_records = []
Use raw strings for patterns with regular expression rather than Python escape sequences.
tilezen_tilequeue
train
py
9ebcc53853635d86201597e3141560d02b560d6c
diff --git a/boundary/metric_modify.py b/boundary/metric_modify.py index <HASH>..<HASH> 100644 --- a/boundary/metric_modify.py +++ b/boundary/metric_modify.py @@ -13,8 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from boundary import MetricCommon import json +import logging + +from boundary import MetricCommon """ Common Base class for defining and update metric definitions @@ -98,12 +100,12 @@ class MetricModify (MetricCommon): if self.aggregate is not None: data['defaultAggregate'] = self.aggregate if self.unit is not None: - data['unit'] = self.unit, + data['unit'] = self.unit if self.resolution is not None: data['defaultResolutionMS'] = self.resolution if self.isDisabled is not None: data['isDisabled'] = self.isDisabled - + self.path = "v1/metrics/{0}".format(self.metricName) self.data = json.dumps(data, sort_keys=True) self.headers = {'Content-Type': 'application/json', "Accept": "application/json"}
Superious comma was sending tuple which translated to a JSON array and caused and error
boundary_pulse-api-cli
train
py
11bee31470af90eb69ccfcd121b80b4ef7181478
diff --git a/lib/omnibus.rb b/lib/omnibus.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus.rb +++ b/lib/omnibus.rb @@ -86,13 +86,28 @@ module Omnibus generate_extra_rake_tasks end - # All the {Omnibus::Project} objects that have been created. + # All {Omnibus::Project} instances that have been created. # # @return [Array<Omnibus::Project>] def self.projects @projects ||= [] end + # Names of all the {Omnibus::Project} instances that have been created. + # + # @return [Array<String>] + def self.project_names + projects.map{|p| p.name} + end + + # Load the {Omnibus::Project} instance with the given name. + # + # @param name [String] + # @return {Omnibus::Project} + def self.project(name) + projects.find{ |p| p.name == name} + end + # The absolute path to the Omnibus project/repository directory. # # @return [String]
Add `Omnibus.projects` and `Omnibus.project` methods These helpers aid in common project-related tasks.
chef_omnibus
train
rb
570b466a29553a21cd8fe30a47004286b97a08b0
diff --git a/lib/expression/expression.js b/lib/expression/expression.js index <HASH>..<HASH> 100644 --- a/lib/expression/expression.js +++ b/lib/expression/expression.js @@ -501,7 +501,7 @@ Expression.setMethod(function getTokenValuesArray(tokens, vars) { * * @author Jelle De Loecker <jelle@develry.be> * @since 1.3.3 - * @version 1.3.3 + * @version 2.0.0 * * @param {Array} path * @param {Array} args @@ -538,7 +538,7 @@ Expression.setMethod(function callPathWithArgs(path, args, vars) { } if (!context || !fnc) { - throw new Error('Unable to call path "' + path.join('.') + '"'); + return undefined; } args = this.getTokenValuesArray(args, vars); diff --git a/test/10-expressions.js b/test/10-expressions.js index <HASH>..<HASH> 100644 --- a/test/10-expressions.js +++ b/test/10-expressions.js @@ -276,6 +276,15 @@ describe('Expressions', function() { createTests(tests); }); + + describe('None existing method calls', function() { + + var tests = [ + [`{%= empty_arr.does_not_exist() or 'nope' %}`, 'nope'], + ]; + + createTests(tests); + }); }); function createTests(tests) {
Calling a non-existant method in a hawkejs expression will not throw an error but return undefined
skerit_hawkejs
train
js,js
8cdefcd5c03d60371657e6c7c92d3a546f0ab82d
diff --git a/webview/win32.py b/webview/win32.py index <HASH>..<HASH> 100644 --- a/webview/win32.py +++ b/webview/win32.py @@ -159,9 +159,9 @@ class BrowserView(object): atl_width = self.width - self.scrollbar_width atl_height = self.height - self.scrollbar_height - VERTICAL_SCROLLBAR_OFFSET - self.atlhwnd = win32gui.CreateWindow("AtlAxWin", self.url, - win32con.WS_CHILD | win32con.WS_HSCROLL | win32con.WS_VSCROLL, - 0, 0, atl_width, atl_height, self.hwnd, None, hInstance, None) + self.atlhwnd = win32gui.CreateWindow("AtlAxWin", "bogus-url", + win32con.WS_CHILD | win32con.WS_HSCROLL | win32con.WS_VSCROLL, + 0, 0, atl_width, atl_height, self.hwnd, None, hInstance, None) # COM voodoo pBrowserUnk = POINTER(IUnknown)() @@ -181,6 +181,9 @@ class BrowserView(object): win32gui.UpdateWindow(self.atlhwnd) win32gui.SetFocus(self.atlhwnd) + # Load URL here instead in CreateWindow to prevent a dead-lock + self.browser.Navigate2(self.url) + # Start sending and receiving messages win32gui.PumpMessages()
Change how URL is loaded on an initial window display in Windows
r0x0r_pywebview
train
py
4d4d5248e0eedad1ffc88301836b0388976e5b9a
diff --git a/salt/utils/find.py b/salt/utils/find.py index <HASH>..<HASH> 100644 --- a/salt/utils/find.py +++ b/salt/utils/find.py @@ -495,6 +495,9 @@ class Finder(object): _REQUIRES_STAT: list(), _REQUIRES_CONTENTS: list()} for key, value in options.iteritems(): + if key.startswith('_'): + # this is a passthrough object, continue + continue if value is None or len(value) == 0: raise ValueError('missing value for "{0}" option'.format(key)) try:
Check for transparent objects in file finder, fix # <I>
saltstack_salt
train
py
26ecb14cf46bd1c4883b450750f5c9c6ada8d968
diff --git a/config/platform/windows.rb b/config/platform/windows.rb index <HASH>..<HASH> 100644 --- a/config/platform/windows.rb +++ b/config/platform/windows.rb @@ -413,7 +413,11 @@ module RightScale class Controller # Shutdown machine now def shutdown - `shutdown -s -f -t 01` + # Eww, we can't just call the normal shutdown on 64bit because of bitness + # Hack that will work on EC2, need to find a better way... + cmd = "c:\\WINDOWS\\ServicePackFiles\\amd64\\shutdown.exe" + cmd = 'shutdown.exe' unless File.exists?(cmd) + `#{cmd} -s -f -t 01` end end
Make shutdown work on Windows <I> bit
rightscale_right_link
train
rb
032c06a82081fba6e22d6b61fba22adade099f12
diff --git a/lib/devise_security_extension/models/password_archivable.rb b/lib/devise_security_extension/models/password_archivable.rb index <HASH>..<HASH> 100644 --- a/lib/devise_security_extension/models/password_archivable.rb +++ b/lib/devise_security_extension/models/password_archivable.rb @@ -10,7 +10,7 @@ module Devise # :nodoc: base.class_eval do include InstanceMethods has_many :old_passwords, :as => :password_archivable, :class_name => "OldPassword" - before_save :archive_password + before_update :archive_password validate :validate_password_archive end end
Fix: Save old password in archive only on update
phatworx_devise_security_extension
train
rb
93e18f78f91790f2a66d00f395fb4c8148a18395
diff --git a/src/notebook/reducers/document.js b/src/notebook/reducers/document.js index <HASH>..<HASH> 100644 --- a/src/notebook/reducers/document.js +++ b/src/notebook/reducers/document.js @@ -56,10 +56,10 @@ export default handleActions({ [constants.TOGGLE_STICKY_CELL]: function toggleStickyCell(state, action) { const { id } = action; const stickyCells = state.get('stickyCells'); - if (stickyCells.get(id)) { + if (stickyCells.has(id)) { return state.set('stickyCells', stickyCells.delete(id)); } - return state.setIn(['stickyCells', id], true); + return state.set('stickyCells', stickyCells.add(id)); }, [constants.UPDATE_CELL_EXECUTION_COUNT]: function updateExecutionCount(state, action) { const { id, count } = action;
refactor(reducers): Use Immutable.Set in toggleStickyCell
nteract_nteract
train
js
eff1f8d8267bfa2155b8201ae30d91aa61f2a4f5
diff --git a/packages/grpc-native-core/gulpfile.js b/packages/grpc-native-core/gulpfile.js index <HASH>..<HASH> 100644 --- a/packages/grpc-native-core/gulpfile.js +++ b/packages/grpc-native-core/gulpfile.js @@ -68,7 +68,7 @@ gulp.task('build', 'Build native package', () => { }); gulp.task('test', 'Run all tests', ['build'], () => { - return gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'})); + return gulp.src(`${testDir}/*.js`).pipe(mocha({timeout: 5000, reporter: 'mocha-jenkins-reporter'})); }); gulp.task('doc.gen', 'Generate docs', (cb) => {
Increasing mocha timeout to 5s up from 2s. Our fleet of macos is a bit less powerful than the rest, so we regularly flake tests there due to this timeout.
grpc_grpc-node
train
js
61b70e1a825eea48df8fead5f237c3d89d94787e
diff --git a/tests/status_code.py b/tests/status_code.py index <HASH>..<HASH> 100644 --- a/tests/status_code.py +++ b/tests/status_code.py @@ -5,19 +5,11 @@ # license that can be found in the LICENSE file. from .fake_webapp import EXAMPLE_APP -from splinter.request_handler.status_code import HttpResponseError class StatusCodeTest(object): - # def test_should_visit_an_absent_page_and_get_an_404_error(self): - # with self.assertRaises(HttpResponseError): - # self.browser.visit(EXAMPLE_APP + "this_page_does_not_exists") - def test_should_visit_index_of_example_app_and_get_200_status_code(self): self.browser.visit(EXAMPLE_APP) self.assertEqual(200, self.browser.status_code) - - def test_should_be_able_to_print_status_code_with_reason(self): - self.browser.visit(EXAMPLE_APP) self.assertEqual('200 - OK', str(self.browser.status_code))
tests/status_code: join status ok tests
cobrateam_splinter
train
py
254e6ea4bf14a602ea74200b3c539212e4110fe2
diff --git a/babylon-to-espree/toAST.js b/babylon-to-espree/toAST.js index <HASH>..<HASH> 100644 --- a/babylon-to-espree/toAST.js +++ b/babylon-to-espree/toAST.js @@ -206,11 +206,6 @@ var astTransformVisitor = { } } - // remove class property keys (or patch in escope) - if (path.isClassProperty()) { - delete node.key; - } - // async function as generator if (path.isFunction()) { if (node.async) node.generator = true; diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -229,6 +229,13 @@ function monkeypatch() { // visit decorators that are in: ClassDeclaration / ClassExpression var visitClass = referencer.prototype.visitClass; referencer.prototype.visitClass = function(node) { + var classBody = node.body.body; + for (var a = 0; a < classBody.length; a++) { + if (classBody[a].type === "ClassProperty") { + createScopeVariable.call(this, classBody[a], classBody[a].key); + } + } + visitDecorators.call(this, node); var typeParamScope; if (node.typeParameters) {
Create a variable for class properties in scope instead of deleting the key (#<I>)
babel_babel-eslint
train
js,js
d70485404692a2c3fd28301dcaa9b018ba187284
diff --git a/pyoko/db/queryset.py b/pyoko/db/queryset.py index <HASH>..<HASH> 100644 --- a/pyoko/db/queryset.py +++ b/pyoko/db/queryset.py @@ -171,7 +171,9 @@ class QuerySet(object): _pass_perm_checks=self._pass_perm_checks) model.setattr('key', ub_to_str(key) if key else ub_to_str(data.get('key'))) - return model.set_data(data, from_db=True) + model = model.set_data(data, from_db=True) + model._initial_data = model._data + return model def __repr__(self): if not self.is_clone:
ADD: make `make_model` method to set initial data attr to track changes rref #<I>
zetaops_pyoko
train
py
54d8e7683243f62e8ce55c53906e3c9ea4bd6b04
diff --git a/src/ORM/Association/HasMany.php b/src/ORM/Association/HasMany.php index <HASH>..<HASH> 100644 --- a/src/ORM/Association/HasMany.php +++ b/src/ORM/Association/HasMany.php @@ -16,6 +16,8 @@ namespace Cake\ORM\Association; use Cake\Collection\Collection; +use Cake\Database\Expression\FieldInterface; +use Cake\Database\Expression\QueryExpression; use Cake\Datasource\EntityInterface; use Cake\ORM\Association; use Cake\ORM\Table; @@ -436,6 +438,12 @@ class HasMany extends Association if ($mustBeDependent) { if ($this->_cascadeCallbacks) { + $conditions = new QueryExpression($conditions); + $conditions->traverse(function ($entry) use ($target) { + if ($entry instanceof FieldInterface) { + $entry->setField($target->aliasField($entry->getField())); + } + }); $query = $this->find('all')->where($conditions); $ok = true; foreach ($query as $assoc) {
Update HasMany to avoid ambigous columns I've changed the conditions from a basic array to a QueryExpression, which I aftewards traverse to add alias to all fields.
cakephp_cakephp
train
php
3d89167204c3cd327a2ecdd95d6d4cfcd6c9a45b
diff --git a/pynYNAB/Client.py b/pynYNAB/Client.py index <HASH>..<HASH> 100644 --- a/pynYNAB/Client.py +++ b/pynYNAB/Client.py @@ -123,7 +123,7 @@ class nYnabClient(object): request_data = dict(starting_device_knowledge=self.current_device_knowledge[opname], ending_device_knowledge=self.current_device_knowledge[opname], device_knowledge_of_server=self.device_knowledge_of_server[opname], - changed_entities={}) + changed_entities=changed_entities) request_data.update(extra) sync_data = self.connection.dorequest(request_data, opname)
regression to not being able to push changed entities
rienafairefr_pynYNAB
train
py
839361f04e3e83440a9f5c118f1d2fca6216d329
diff --git a/openpnm/utils/Workspace.py b/openpnm/utils/Workspace.py index <HASH>..<HASH> 100644 --- a/openpnm/utils/Workspace.py +++ b/openpnm/utils/Workspace.py @@ -344,7 +344,7 @@ class Workspace(dict): # If _next_id has not been set, then assign it self._next_id = 0 # But check ids in any objects present first - for proj in self: + for proj in self.values(): if 'pore._id' in proj.network.keys(): Pmax = proj.network['pore._id'].max() + 1 Tmax = proj.network['throat._id'].max() + 1
fixing bug in id gen
PMEAL_OpenPNM
train
py
753545cd10aa455ec0912843820e26d5c4903c8e
diff --git a/unleash/plugins/tox_tests.py b/unleash/plugins/tox_tests.py index <HASH>..<HASH> 100644 --- a/unleash/plugins/tox_tests.py +++ b/unleash/plugins/tox_tests.py @@ -38,6 +38,6 @@ def lint_release(ctx): with VirtualEnv.temporary() as ve, in_tmpexport(ctx['commit']): ve.pip_install('tox') ctx['log'].debug('Running tests using tox') - ve.check_output(['tox']) + ve.check_output(ve.get_binary('tox')) except subprocess.CalledProcessError as e: ctx['issues'].error('tox testing failed:\n{}'.format(e.output))
Use get_binary in tox tests.
mbr_unleash
train
py
00b0532b5cb15d7e55165a9aba9d7d57f4e15ca8
diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index <HASH>..<HASH> 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -859,9 +859,10 @@ class UrlDispatcher(AbstractRouter, collections.abc.Mapping): route is added allowing head requests to the same endpoint """ if allow_head: - # the head route can't have "name" set or it would conflict with + # it name is not None append -head to avoid it conflicting with # the GET route below - self.add_route(hdrs.METH_HEAD, *args, **kwargs) + head_name = name and '{}-head'.format(name) + self.add_route(hdrs.METH_HEAD, *args, name=head_name, **kwargs) return self.add_route(hdrs.METH_GET, *args, name=name, **kwargs) def add_post(self, *args, **kwargs):
fix allow-head to include name on route
aio-libs_aiohttp
train
py
743bcf15048f5b319e7c11e8506208c2a8724f32
diff --git a/concurrency/fields.py b/concurrency/fields.py index <HASH>..<HASH> 100755 --- a/concurrency/fields.py +++ b/concurrency/fields.py @@ -88,7 +88,7 @@ class VersionField(Field): def contribute_to_class(self, cls, name, virtual_only=False): super(VersionField, self).contribute_to_class(cls, name) - if hasattr(cls, '_concurrencymeta'): + if hasattr(cls, '_concurrencymeta') or cls._meta.abstract: return setattr(cls, '_concurrencymeta', ConcurrencyOptions()) cls._concurrencymeta._field = self @@ -197,7 +197,8 @@ class TriggerVersionField(VersionField): form_class = forms.VersionField def contribute_to_class(self, cls, name, virtual_only=False): - _TRIGGERS.append(self) + if not cls._meta.abstract: + _TRIGGERS.append(self) super(TriggerVersionField, self).contribute_to_class(cls, name) def _get_next_version(self, model_instance):
Don't create triggers on abstract classes Abstract classes have no database table, so creating a trigger for them causes an error. This patch checks that `cls._meta.abstract` is False before adding the trigger to the `TRIGGERS` list.
saxix_django-concurrency
train
py
aa86c0be367202b737ad4d875498cf544da0f517
diff --git a/src/CyberSpectrum/Command/CommandBase.php b/src/CyberSpectrum/Command/CommandBase.php index <HASH>..<HASH> 100644 --- a/src/CyberSpectrum/Command/CommandBase.php +++ b/src/CyberSpectrum/Command/CommandBase.php @@ -230,7 +230,7 @@ abstract class CommandBase extends Command } if (!$this->skipFiles) { - $this->skipFiles = $this->getConfigValue('/transifex/skip_files'); + $this->skipFiles = $this->getTransifexConfigValue('/skip_files'); } else { // Make sure it is an array $this->skipFiles = array();
Adjusted loading the skip files config from configurable config path
cyberspectrum_contao-toolbox
train
php
96f9e2cc749953a37594f864ea89d277d9d298c6
diff --git a/src/Formatter/Coordinate/DMS.php b/src/Formatter/Coordinate/DMS.php index <HASH>..<HASH> 100644 --- a/src/Formatter/Coordinate/DMS.php +++ b/src/Formatter/Coordinate/DMS.php @@ -61,7 +61,7 @@ class DMS implements FormatterInterface { $this->separator = $separator; $this->useCardinalLetters = false; - $this->setUnits(static::UNITS_UTF8); + $this->setUnits(self::UNITS_UTF8); } /** diff --git a/src/Formatter/Coordinate/DecimalMinutes.php b/src/Formatter/Coordinate/DecimalMinutes.php index <HASH>..<HASH> 100644 --- a/src/Formatter/Coordinate/DecimalMinutes.php +++ b/src/Formatter/Coordinate/DecimalMinutes.php @@ -68,7 +68,7 @@ class DecimalMinutes implements FormatterInterface $this->separator = $separator; $this->useCardinalLetters = false; - $this->setUnits(static::UNITS_UTF8); + $this->setUnits(self::UNITS_UTF8); } /**
don't use late static binding for class constants
mjaschen_phpgeo
train
php,php
41e6f4387985518bcd8e05cc8538c3fe8a886ad0
diff --git a/app/Elements/IndividualRecord.php b/app/Elements/IndividualRecord.php index <HASH>..<HASH> 100644 --- a/app/Elements/IndividualRecord.php +++ b/app/Elements/IndividualRecord.php @@ -60,6 +60,7 @@ class IndividualRecord extends AbstractElement 'IDNO' => '0:M', 'IMMI' => '0:M', 'NAME' => '0:M', + 'NATI' => '0:M', 'NATU' => '0:M', 'NCHI' => '0:M', 'NMR' => '0:M',
added NATI - nationality (#<I>)
fisharebest_webtrees
train
php
bddbed19f25b6576b672308c366c2b04700dba3a
diff --git a/stdeb/command/bdist_deb.py b/stdeb/command/bdist_deb.py index <HASH>..<HASH> 100644 --- a/stdeb/command/bdist_deb.py +++ b/stdeb/command/bdist_deb.py @@ -1,6 +1,5 @@ import os import stdeb.util as util -from stdeb.command.sdist_dsc import sdist_dsc from distutils.core import Command @@ -22,8 +21,11 @@ class bdist_deb(Command): # generate .dsc source pkg self.run_command('sdist_dsc') + # get relevant options passed to sdist_dsc + sdist_dsc = self.get_finalized_command('sdist_dsc') + dsc_tree = sdist_dsc.dist_dir + # execute system command and read output (execute and read output of find cmd) - dsc_tree = 'deb_dist' target_dir = None for entry in os.listdir(dsc_tree): fulldir = os.path.join(dsc_tree,entry)
bdist_deb: get dist_dir option passed to sdist_dsc command
astraw_stdeb
train
py
e55a3443d0b257ec665c943374ef51672245fd7e
diff --git a/lib/models/index.js b/lib/models/index.js index <HASH>..<HASH> 100644 --- a/lib/models/index.js +++ b/lib/models/index.js @@ -1,4 +1,4 @@ - +require('mongoose').models = {}; module.exports = { InviteCode: require('./invite'), Job: require('./job'),
fix mongoose models code reloading issue
Strider-CD_strider
train
js
7a46a55d004e28b75cfde1831873397da05db844
diff --git a/lib/pluginlib.php b/lib/pluginlib.php index <HASH>..<HASH> 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -221,12 +221,18 @@ class plugin_manager { /** * Returns a localized name of a given plugin * - * @param string $plugin name of the plugin, eg mod_workshop or auth_ldap + * @param string $component name of the plugin, eg mod_workshop or auth_ldap * @return string */ - public function plugin_name($plugin) { - list($type, $name) = normalize_component($plugin); - return $this->pluginsinfo[$type][$name]->displayname; + public function plugin_name($component) { + + $pluginfo = $this->get_plugin_info($component); + + if (is_null($pluginfo)) { + throw new moodle_exception('err_unknown_plugin', 'core_plugin', '', array('plugin' => $component)); + } + + return $pluginfo->displayname; } /**
MDL-<I> Fix plugin_manager::plugin_name() implementation This is not directly related to the issue. However, it turned out that if this method was called on plugin_manager without loaded plugins, it would throw an error. This new implementation uses cleaner access to the plugininfo subclass.
moodle_moodle
train
php
fe6bc7276c96ad3645bd0856163a2dbf9966be90
diff --git a/scripts/code-viewer.js b/scripts/code-viewer.js index <HASH>..<HASH> 100644 --- a/scripts/code-viewer.js +++ b/scripts/code-viewer.js @@ -172,6 +172,7 @@ let encoded = this.responseText; encoded = window.html_beautify(encoded, {indent_size: 2, wrap_line_length: 0}); encoded = window.he.encode(encoded); + encoded = encoded.replace(/^\s*$\n/gm, ''); // Delete empty lines. codeViewer.encoded = encoded; if (codeViewer.tabActive === 'e') {
further beautification of html code in viewer
electric-eloquence_fepper-ui
train
js
ea08c77936c645101946fe4763dc6e519b88636b
diff --git a/spyder/plugins/projects/plugin.py b/spyder/plugins/projects/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/projects/plugin.py +++ b/spyder/plugins/projects/plugin.py @@ -266,9 +266,15 @@ class Projects(SpyderPluginWidget): dlg.sig_project_creation_requested.connect(self._create_project) dlg.sig_project_creation_requested.connect(self.sig_project_created) if dlg.exec_(): - if (active_project is None - and self.get_option('visible_if_project_open')): - self.show_explorer() + # A project was not open before + if active_project is None: + if self.get_option('visible_if_project_open'): + self.show_explorer() + else: + # We are switching projects. + # TODO: Don't emit sig_project_closed when we support + # multiple workspaces. + self.sig_project_closed.emit(active_project.root_path) self.sig_pythonpath_changed.emit() self.restart_consoles() @@ -312,6 +318,11 @@ class Projects(SpyderPluginWidget): self.set_project_filenames( self.main.editor.get_open_filenames()) + # TODO: Don't emit sig_project_closed when we support + # multiple workspaces. + self.sig_project_closed.emit( + self.current_active_project.root_path) + project = EmptyProject(path) self.current_active_project = project self.latest_project = project
Projects: Emit sig_project_closed when switching projects - This can happen either when you have an open project and (i) Change to another, existing project; or (ii) Create a new project. - It's important to emit that signal to let the LSP know that the previous open project needs to be removed from the workspace. - This won't be necessary once we support multiple workspaces in the interface, but for now it is.
spyder-ide_spyder
train
py
112288d331e051e5556e7a2fa81e79d9616ea856
diff --git a/src/Auditable.php b/src/Auditable.php index <HASH>..<HASH> 100644 --- a/src/Auditable.php +++ b/src/Auditable.php @@ -55,7 +55,10 @@ trait Auditable */ public function audits() { - return $this->morphMany(Config::get('audit.implementation'), 'auditable'); + return $this->morphMany( + Config::get('audit.implementation', \OwenIt\Auditing\Models\Audit::class), + 'auditable' + ); } /**
fix(Auditable): set OwenIt\Auditing\Models\Audit as default Audit implementation
owen-it_laravel-auditing
train
php
1df07d2ff6fb0f323f275d801fbecd64c8b90c4f
diff --git a/logging/mock.go b/logging/mock.go index <HASH>..<HASH> 100644 --- a/logging/mock.go +++ b/logging/mock.go @@ -57,12 +57,12 @@ func (m writerMap) CheckWrittenAtLevel(t *testing.T, lv LogLevel, exp string) { } else { w = m[lv] } - if len(w.written) < 32 { + // 32 bytes covers the date, time and filename up to the colon in + // 2011/10/22 10:22:57 log_test.go:<line no>: <level> <log message> + if len(w.written) <= 32 { t.Errorf("Not enough bytes logged at level %s:", LogString(lv)) t.Errorf("\tgot: %s", string(w.written)) } - // 32 bytes covers the date, time and filename up to the colon in - // 2011/10/22 10:22:57 log_test.go:<line no>: <level> <log message> s := string(w.written[32:]) // 2 covers the : itself and the extra space idx := strings.Index(s, ":") + 2
Hmm, slice out of range error, wtf x2.
fluffle_goirc
train
go
d58c351b254b190081102ee664064fdf921452f2
diff --git a/src/editor/ImageViewer.js b/src/editor/ImageViewer.js index <HASH>..<HASH> 100644 --- a/src/editor/ImageViewer.js +++ b/src/editor/ImageViewer.js @@ -205,6 +205,7 @@ define(function (require, exports, module) { function render(fullPath) { var relPath = ProjectManager.makeProjectRelativeIfPossible(fullPath); + _scale = 100; // initialize to 100 $("#img-path").text(relPath); $("#img-preview").on("load", function () { // add dimensions and size @@ -235,7 +236,6 @@ define(function (require, exports, module) { $("#img").on("mousemove", "#img-preview, #img-scale", _showImageTip) .on("mouseleave", "#img-preview, #img-scale", _hideImageTip); - _scale = 100; // initialize to 100 _updateScale($(this).width()); }); }
Moving the initialization to the top of render function.
adobe_brackets
train
js
01e9e54a465ebae4458c80e4c677ceefed9dc99a
diff --git a/src/Models/Tenant.php b/src/Models/Tenant.php index <HASH>..<HASH> 100644 --- a/src/Models/Tenant.php +++ b/src/Models/Tenant.php @@ -132,8 +132,6 @@ class Tenant extends BaseTenant implements HasMedia $this->mergeCasts(['social' => 'array', 'style' => 'string']); $this->mergeRules(['social' => 'nullable', 'style' => 'nullable|string|strip_tags|max:150', 'tags' => 'nullable|array']); - - $this->setTable(config('rinvex.tenants.tables.tenants')); } /**
Remove duplicate `setTable` method call override as it's already called in parent class
rinvex_cortex-tenants
train
php
0da4edb618bb5ed23c53b4d0c86ad4d4197d95bd
diff --git a/nanoget/nanoget.py b/nanoget/nanoget.py index <HASH>..<HASH> 100644 --- a/nanoget/nanoget.py +++ b/nanoget/nanoget.py @@ -265,7 +265,7 @@ def process_fastq_plain(fastq, threads): pool = Pool(processes=threads) try: output = [results for results in pool.imap( - extract_from_fastq, SeqIO.parse(inputfastq, "fastq")) if not results is None] + extract_from_fastq, SeqIO.parse(inputfastq, "fastq")) if results is not None] except KeyboardInterrupt: sys.stderr.write("Terminating worker threads") pool.terminate()
change not is None to is not None
wdecoster_nanoget
train
py
e44908495d28a495870a99fe43c2bf0e0b67335f
diff --git a/code/forms/Users_RegisterForm.php b/code/forms/Users_RegisterForm.php index <HASH>..<HASH> 100755 --- a/code/forms/Users_RegisterForm.php +++ b/code/forms/Users_RegisterForm.php @@ -32,6 +32,10 @@ class Users_RegisterForm extends Form { */ public function __construct($controller, $name) { + // If back URL set, push to session + if(isset($_REQUEST['BackURL'])) + Session::set('BackURL',$_REQUEST['BackURL']); + // Setup form fields $fields = new FieldList(); @@ -129,7 +133,6 @@ class Users_RegisterForm extends Form { // If a back URL is used in session. if(Session::get("BackURL")) { $redirect_url = Session::get("BackURL"); - Session::clear("BackURL"); } else { $redirect_url = Controller::join_links( BASE_URL,
Allow tracking of a back URL when a user completes the register form
i-lateral_silverstripe-users
train
php
f61724d57d2b1bb5779557b127f66accd8166008
diff --git a/test/commands_test.rb b/test/commands_test.rb index <HASH>..<HASH> 100644 --- a/test/commands_test.rb +++ b/test/commands_test.rb @@ -51,4 +51,28 @@ class CommandsTest < TestCase assert cmds[:default].verbose? end + test "on/global and default all return newly created slop instances" do + assert_kind_of Slop, @commands.on('foo') + assert_kind_of Slop, @commands.default + assert_kind_of Slop, @commands.global + end + + test "parse does nothing when there's nothing to parse" do + assert @commands.parse [] + end + + test "parse returns the original array of items" do + items = %w( foo bar baz ) + assert_equal items, @commands.parse(items) + + items = %w( new --force ) + assert_equal items, @commands.parse(items) + end + + test "parse! removes options/arguments" do + items = %w( new --outdir foo ) + @commands.parse!(items) + assert_equal [], items + end + end \ No newline at end of file
more tests for Slop::Commands
leejarvis_slop
train
rb
a869d04f522155118474bda30755b0d3ee5708f2
diff --git a/src/component/table.js b/src/component/table.js index <HASH>..<HASH> 100644 --- a/src/component/table.js +++ b/src/component/table.js @@ -37,6 +37,7 @@ angular.module('ngTasty.component.table', [ templateUrl: 'template/table/pagination.html', listItemsPerPage: [5, 25, 50, 100], itemsPerPage: 5, + listFilters: ['filter'], watchResource: 'reference' }) .controller('TableController', function($scope, $attrs, $filter, tableConfig, tastyUtil) { @@ -88,6 +89,7 @@ angular.module('ngTasty.component.table', [ this.config[key] = tableConfig[key]; } }, this); + tableConfig = this.config; } else { this.config = tableConfig; } @@ -299,7 +301,9 @@ angular.module('ngTasty.component.table', [ } } if ($attrs.bindFilters) { - $scope.rows = $filter('filter')($scope.rows, $scope.filters, $scope.filtersComparator); + tableConfig.listFilters.forEach(function (filter) { + $scope.rows = $filter(filter)($scope.rows, $scope.filters, $scope.filtersComparator); + }); } if ($scope.paginationDirective) { $scope.pagination.count = $scope.params.count;
Adding listFilters as config params #<I>
Zizzamia_ng-tasty
train
js
7547ac9da82969e80d5f649d1fe3864000c28829
diff --git a/client/manager_sql.go b/client/manager_sql.go index <HASH>..<HASH> 100644 --- a/client/manager_sql.go +++ b/client/manager_sql.go @@ -58,7 +58,7 @@ type SQLManager struct { } type sqlData struct { - PK int `db:"pk"` + PK int64 `db:"pk"` ID string `db:"id"` Name string `db:"client_name"` Secret string `db:"client_secret"`
client: Change pk field to int<I> (#<I>) Changed PK from int to int<I>, ran make test with no issues. Closes #<I>
ory_hydra
train
go
a7925855559d7434c80c141360908982d046f254
diff --git a/changes.go b/changes.go index <HASH>..<HASH> 100644 --- a/changes.go +++ b/changes.go @@ -153,11 +153,14 @@ func (c *pollChangeManager) getChanges(changesUri *url.URL) error { scopes := findScopesForId(apidInfo.ClusterID) v := url.Values{} + blockValue := block /* Sequence added to the query if available */ if lastSequence != "" { v.Add("since", lastSequence) + } else { + blockValue = "0" } - v.Add("block", block) + v.Add("block", blockValue) /* * Include all the scopes associated with the config Id @@ -258,6 +261,12 @@ func (c *pollChangeManager) getChanges(changesUri *url.URL) error { log.Panic("Timeout. Plugins failed to respond to changes.") case <-events.Emit(ApigeeSyncEventSelector, &resp): } + } else if lastSequence == "" { + select { + case <-time.After(httpTimeout): + log.Panic("Timeout. Plugins failed to respond to changes.") + case <-events.Emit(ApigeeSyncEventSelector, &resp): + } } else { log.Debugf("No Changes detected for Scopes: %s", scopes) }
[ISSUE-<I>] after receiving a new snapshot, send the 1st changelist request with "block=0" (#<I>)
apid_apidApigeeSync
train
go
083ea05295d2f3b020b84b30beacfae52f9158e0
diff --git a/terraform/terraform_test.go b/terraform/terraform_test.go index <HASH>..<HASH> 100644 --- a/terraform/terraform_test.go +++ b/terraform/terraform_test.go @@ -1067,7 +1067,7 @@ STATE: const testTerraformPlanComputedMultiIndexStr = ` DIFF: -CREATE: aws_instance.bar +CREATE: aws_instance.bar.0 foo: "" => "<computed>" type: "" => "aws_instance" CREATE: aws_instance.foo.0 @@ -1146,7 +1146,7 @@ DIFF: CREATE: aws_instance.bar foo: "" => "foo" type: "" => "aws_instance" -CREATE: aws_instance.foo +CREATE: aws_instance.foo.0 foo: "" => "foo" type: "" => "aws_instance"
core: Context plan tests update for "count" behavior change The behavior of the "count" meta-argument has changed so that its presence (rather than its value) chooses whether the associated resource has indexes. As a consequence, these tests which set count = 1 now produce a single indexed instance with index 0.
hashicorp_terraform
train
go
dc247e5232cb2d8e384c0acefa3f9e90fbaee78d
diff --git a/course/lib.php b/course/lib.php index <HASH>..<HASH> 100644 --- a/course/lib.php +++ b/course/lib.php @@ -2067,7 +2067,12 @@ function print_category_info($category, $depth, $showcourses = false) { $catlinkcss = $category->visible ? '' : ' class="dimmed" '; - $coursecount = $DB->count_records('course') <= FRONTPAGECOURSELIMIT; + static $coursecount = null; + if (null === $coursecount) { + // only need to check this once + $coursecount = $DB->count_records('course') <= FRONTPAGECOURSELIMIT; + } + if ($showcourses and $coursecount) { $catimage = '<img src="'.$CFG->pixpath.'/i/course.gif" alt="" />'; } else {
MDL-<I> cache superfluous queries when listing categories on front page
moodle_moodle
train
php
057fa426a7903f33a564e3e84ea48e76b88c3eda
diff --git a/tests/test_data.py b/tests/test_data.py index <HASH>..<HASH> 100755 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -44,12 +44,12 @@ class DeloreanTests(TestCase): def test_initialize_with_tzinfo_generic(self): self.aware_dt_generic = datetime(2013, 1, 3, 4, 31, 14, 148546, tzinfo=generic_utc) do = delorean.Delorean(datetime=self.aware_dt_generic) - self.assertIsInstance(do, delorean.Delorean) + self.assertTrue(type(do) is delorean.Delorean) def test_initialize_with_tzinfo_pytz(self): self.aware_dt_pytz = datetime(2013, 1, 3, 4, 31, 14, 148546, tzinfo=utc) do = delorean.Delorean(datetime=self.aware_dt_pytz) - self.assertIsInstance(do, delorean.Delorean) + self.assertTrue(type(do) is delorean.Delorean) def test_truncation_hour(self): self.do.truncate('hour')
Changed assertIsInstance to assertTrue for backwards compatability.
myusuf3_delorean
train
py
6aefe4d9f44e1da61968ed255f6860cb5d98da38
diff --git a/github/tests/Issue131.py b/github/tests/Issue131.py index <HASH>..<HASH> 100644 --- a/github/tests/Issue131.py +++ b/github/tests/Issue131.py @@ -32,7 +32,7 @@ class Issue131(Framework.TestCase): # https://github.com/jacquev6/PyGithub/pull for pull in self.repo.get_pulls('closed'): if pull.number == 204: user = pull.head.user - self.assertIsNone(user) + self.assertEqual(user, None) # Should be: # self.assertEqual(user.login, 'imcf') # self.assertEqual(user.type, 'Organization')
Fix unit tests on Python <= <I>
PyGithub_PyGithub
train
py
d626342214e2ad5ea7c1d93e93d541316e944bec
diff --git a/examples/webapp/.bitbundler.js b/examples/webapp/.bitbundler.js index <HASH>..<HASH> 100644 --- a/examples/webapp/.bitbundler.js +++ b/examples/webapp/.bitbundler.js @@ -3,6 +3,7 @@ module.exports = { dest: "dist/index.js", loader: [ + envReplace("production"), "bit-loader-cache", "bit-loader-sourcemaps", "bit-loader-babel", @@ -19,3 +20,11 @@ module.exports = { // "bit-bundler-extractsm" ] }; + +function envReplace(value) { + return { + transform: (meta) => ({ + source: meta.source.replace(/process\.env\.NODE_ENV/g, JSON.stringify(value)) + }) + }; +}
added a small inline loader plugin to handle production builds
MiguelCastillo_bit-bundler
train
js
810ad5da287271ec3f1b099f87b25b47d9963eb6
diff --git a/test/intervaltree_test.py b/test/intervaltree_test.py index <HASH>..<HASH> 100644 --- a/test/intervaltree_test.py +++ b/test/intervaltree_test.py @@ -94,7 +94,7 @@ def test_duplicate_insert(): assert len(tree) == 2 assert tree.items() == contents - tree.extend([Interval(-10, 20)]) + tree.extend([Interval(-10, 20), Interval(-10, 20, "arbitrary data")]) assert len(tree) == 2 assert tree.items() == contents
made last duplicate insert test be extend() for multiple dups
chaimleib_intervaltree
train
py
bf5f24cc9ab8c5e6817e970114124e7a78467fd1
diff --git a/packages/ember-metal/lib/watching.js b/packages/ember-metal/lib/watching.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/watching.js +++ b/packages/ember-metal/lib/watching.js @@ -430,6 +430,9 @@ Ember.watch = function(obj, keyName) { if (!watching[keyName]) { watching[keyName] = 1; if (isKeyName(keyName)) { + desc = m.descs[keyName]; + if (desc && desc.willWatch) { desc.willWatch(obj, keyName); } + if ('function' === typeof obj.willWatchProperty) { obj.willWatchProperty(keyName); } @@ -454,12 +457,15 @@ Ember.unwatch = function(obj, keyName) { // can't watch length on Array - it is special... if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; } - var watching = metaFor(obj).watching; + var m = metaFor(obj), watching = m.watching, desc; if (watching[keyName] === 1) { watching[keyName] = 0; if (isKeyName(keyName)) { + desc = m.descs[keyName]; + if (desc && desc.didUnwatch) { desc.didUnwatch(obj, keyName); } + if ('function' === typeof obj.didUnwatchProperty) { obj.didUnwatchProperty(keyName); }
add hook for desc for willWatch and didUnwatch
emberjs_ember.js
train
js
cad708c976bd4016ccb8d372344e253893db67bc
diff --git a/molo/core/api/importers.py b/molo/core/api/importers.py index <HASH>..<HASH> 100644 --- a/molo/core/api/importers.py +++ b/molo/core/api/importers.py @@ -342,16 +342,6 @@ class SiteImporter(object): nested_fields["time"]): page.time = json.dumps(nested_fields["time"]) - # section_tags/nav_tags - # list -> ["tag"]["id"] - # -> Need to fetch and create the nav tags - # THEN create the link between page and nav_tag - if (("section_tags" in nested_fields) and - nested_fields["section_tags"]): - self.section_tags[page.id] = [] - for section_tag in nested_fields["section_tags"]: - self.section_tags[page.id].append( - section_tag["tag"]["id"]) # nav_tags # list -> ["tag"]["id"]
Fail tests by removing adding section tag functionality
praekeltfoundation_molo
train
py
3bda14dff17f5619d5770052b492b15a17a3eb5a
diff --git a/dialogue.js b/dialogue.js index <HASH>..<HASH> 100644 --- a/dialogue.js +++ b/dialogue.js @@ -227,7 +227,7 @@ Dialogue.prototype.applyCss = function(event) { // bring it back in plus 50px padding if ((cssSettings.left + event.data.$dialogue.width()) > frame.width) { cssSettings.left = frame.width - 50; - cssSettings.left = cssSettings.left - event.data.$dialogue.width(); + cssSettings.left = cssSettings.left - cssSettings['max-width']; }; // no positional element so center to window
bug with left positioning when outside of viewport
mwyatt_dialogue
train
js
fb9c93b1a1de72d8f475443f7aa0978718591438
diff --git a/boards.js b/boards.js index <HASH>..<HASH> 100644 --- a/boards.js +++ b/boards.js @@ -44,7 +44,7 @@ module.exports = { pageSize: 128, numPages: 256, timeout: 400, - productId: ['0x6001'], + productId: ['0x6001', '0x7523'], protocol: 'stk500v1' }, 'duemilanove168': {
Updated nano with Pid as well
noopkat_avrgirl-arduino
train
js
d128efcb9b95dc5de911058f4c9e02cc65b5e7db
diff --git a/lib/bmc-daemon-lib/logger_helper.rb b/lib/bmc-daemon-lib/logger_helper.rb index <HASH>..<HASH> 100644 --- a/lib/bmc-daemon-lib/logger_helper.rb +++ b/lib/bmc-daemon-lib/logger_helper.rb @@ -32,11 +32,11 @@ module BmcDaemonLib def log severity, message, details return puts "LoggerHelper.log: missing logger (#{get_class_name})" unless logger # puts "LoggerHelper.log > #{message}" - # puts "LoggerHelper.log > #{get_full_context.inspect}" - logger.add severity, message, get_full_context, details + # puts "LoggerHelper.log > #{full_context.inspect}" + logger.add severity, message, full_context, details end - def get_full_context + def full_context # Grab the classe's context context = log_context()
logger helper: rename method
bmedici_bmc-daemon-lib
train
rb
da258310f09046cddc42cf7ef17743c8709defdd
diff --git a/spec/unit/active_admin_spec.rb b/spec/unit/active_admin_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/active_admin_spec.rb +++ b/spec/unit/active_admin_spec.rb @@ -36,9 +36,5 @@ describe ActiveAdmin do it "should have a default current_user_method" do ActiveAdmin.current_user_method.should == :current_admin_user end - - it "should have a default authentication method" do - ActiveAdmin.authentication_method.should == :authenticate_admin_user! - end end diff --git a/spec/unit/admin_notes_controller_spec.rb b/spec/unit/admin_notes_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/admin_notes_controller_spec.rb +++ b/spec/unit/admin_notes_controller_spec.rb @@ -18,11 +18,13 @@ describe ActiveAdmin::AdminNotes::NotesController do end end + # TODO: Update to work with new authentication scheme context "when admin user set" do it "should add the current Admin User to a new Admin Note" do - ActiveAdmin.current_user_method = :current_admin_user - controller.should_receive(:assign_admin_note_to_current_admin_user) - do_create + pending + #ActiveAdmin.current_user_method = :current_admin_user + #controller.should_receive(:assign_admin_note_to_current_admin_user) + #do_create end end end
Marked a couple specs as pending until authentication is finished
activeadmin_activeadmin
train
rb,rb
540adf9678a70adc2697f4634a7bfebf838c8216
diff --git a/src/read/nodejs.js b/src/read/nodejs.js index <HASH>..<HASH> 100644 --- a/src/read/nodejs.js +++ b/src/read/nodejs.js @@ -1,5 +1,6 @@ /** * @file NodeJS read implementation + * @since 0.2.6 */ /*#ifndef(UMD)*/ "use strict";
Documentation (#<I>)
ArnaudBuchholz_gpf-js
train
js
494f1de65e5c3be26854db7fb05834e884544dce
diff --git a/src/net/sf/mpxj/primavera/PrimaveraReader.java b/src/net/sf/mpxj/primavera/PrimaveraReader.java index <HASH>..<HASH> 100644 --- a/src/net/sf/mpxj/primavera/PrimaveraReader.java +++ b/src/net/sf/mpxj/primavera/PrimaveraReader.java @@ -620,7 +620,8 @@ final class PrimaveraReader Date endDate = row.getDate("act_end_date") == null ? row.getDate("reend_date") : row.getDate("act_end_date"); task.setFinish(endDate); - populateField(task, TaskField.WORK, TaskField.BASELINE_WORK, TaskField.ACTUAL_WORK); + Duration work = Duration.add(task.getActualWork(), task.getRemainingWork(), m_project.getProjectProperties()); + task.setWork(work); // Add User Defined Fields List<Row> taskUDF = getTaskUDF(uniqueID, udfVals);
Fix calculation of Primavera task work field.
joniles_mpxj
train
java
488cf5d59fadacb416768f58749c94769d486903
diff --git a/flask_apscheduler/auth.py b/flask_apscheduler/auth.py index <HASH>..<HASH> 100644 --- a/flask_apscheduler/auth.py +++ b/flask_apscheduler/auth.py @@ -17,7 +17,21 @@ import base64 from flask import request -from werkzeug.http import bytes_to_wsgi, wsgi_to_bytes + + +def wsgi_to_bytes(data): + """coerce wsgi unicode represented bytes to real ones""" + if isinstance(data, bytes): + return data + return data.encode("latin1") # XXX: utf8 fallback? + + +def bytes_to_wsgi(data): + assert isinstance(data, bytes), "data must be bytes" + if isinstance(data, str): + return data + else: + return data.decode("latin1") def get_authorization_header():
add functions that were removed in werkszeug. for #<I>
viniciuschiele_flask-apscheduler
train
py
9389b395489ab556c28caaae6be36cc5ea0cd7c4
diff --git a/config.php b/config.php index <HASH>..<HASH> 100644 --- a/config.php +++ b/config.php @@ -2,8 +2,5 @@ return [ 'showCpSection' => false, - - 'enableConsole' => false, - 'providerInfos' => [], ]; \ No newline at end of file
Removed `enableConsole` from config.php
dukt_oauth
train
php
ad515f7a4d58f86429d95004beaacfdbfea2343c
diff --git a/docs/extensions/attributetable.py b/docs/extensions/attributetable.py index <HASH>..<HASH> 100644 --- a/docs/extensions/attributetable.py +++ b/docs/extensions/attributetable.py @@ -165,7 +165,7 @@ def process_attributetable(app, doctree, fromdocname): def get_class_results(lookup, modulename, name, fullname): module = importlib.import_module(modulename) - cls_dict = getattr(module, name).__dict__ + cls = getattr(module, name) groups = OrderedDict([ (_('Attributes'), []), @@ -183,7 +183,7 @@ def get_class_results(lookup, modulename, name, fullname): badge = None label = attr - value = cls_dict.get(attr) + value = getattr(cls, attr, None) if value is not None: doc = value.__doc__ or '' if inspect.iscoroutinefunction(value) or doc.startswith('|coro|'):
Fix methods from superclass showing under "Attributes" table
Rapptz_discord.py
train
py
5c995f33b061b108494027982179119c01639882
diff --git a/mongoctl/repository.py b/mongoctl/repository.py index <HASH>..<HASH> 100644 --- a/mongoctl/repository.py +++ b/mongoctl/repository.py @@ -110,7 +110,7 @@ def validate_repositories(): global __repos_validated__ if not __repos_validated__: if not(has_file_repository() or has_db_repository() or has_commandline_servers_or_clusters()): - log_warning("******* WARNING!\nNo fileRepository or databaseRepository configured." + log_verbose("******* WARNING!\nNo fileRepository or databaseRepository configured." "\n*******") __repos_validated__ = True
logging: Change repo warning into verbose
mongolab_mongoctl
train
py
e3c3e88ecdf4c18acc90f858118e0e692c32ca7c
diff --git a/js/dx.aspnet.data.js b/js/dx.aspnet.data.js index <HASH>..<HASH> 100644 --- a/js/dx.aspnet.data.js +++ b/js/dx.aspnet.data.js @@ -108,7 +108,7 @@ if(options) { ["skip", "take", "requireTotalCount", "requireGroupCount"].forEach(function(i) { - if(i in options) + if(options[i] !== undefined) result[i] = options[i]; });
Pick useful change from <I>b6f2cba<I>
DevExpress_DevExtreme.AspNet.Data
train
js
805e271455db3e690853692c3a8ecadfe61b021d
diff --git a/src/test/com/twitter/elephantbird/pig/load/TestMultiFormatLoader.java b/src/test/com/twitter/elephantbird/pig/load/TestMultiFormatLoader.java index <HASH>..<HASH> 100644 --- a/src/test/com/twitter/elephantbird/pig/load/TestMultiFormatLoader.java +++ b/src/test/com/twitter/elephantbird/pig/load/TestMultiFormatLoader.java @@ -45,7 +45,7 @@ public class TestMultiFormatLoader { public void setUp() throws Exception { if (!GPLNativeCodeLoader.isNativeCodeLoaded()) { - // should have an option to force running these tests. + // TODO: Consider using @RunWith / @SuiteClasses return; }
add comment about RunWith/SuiteClasses for lzo tests.
twitter_elephant-bird
train
java
cade27c66949e345c417fe599309ddd59877ade6
diff --git a/autoload.php b/autoload.php index <HASH>..<HASH> 100644 --- a/autoload.php +++ b/autoload.php @@ -16,10 +16,10 @@ /* * Some helper functions are outside classes and need to be loaded */ -require_once './src/functions.php'; -require_once './src/Http/Psr7/functions.php'; +require_once __DIR__.'/src/functions.php'; +require_once __DIR__.'/src/Http/Psr7/functions.php'; -/** +/* * Based on https://www.php-fig.org/psr/psr-4/examples/. */ spl_autoload_register(function ($class) { @@ -50,7 +50,6 @@ spl_autoload_register(function ($class) { } }); - spl_autoload_register(function ($class) { $prefixes = array( 'Psr\\Http\\Message\\' => 'psr/http-message/src/',
fix autoloader when not using composer
algolia_algoliasearch-client-php
train
php
e9c8a4a225fe26bb68ab2d2c04b7502fe10fabb4
diff --git a/salt/client/ssh/wrapper/state.py b/salt/client/ssh/wrapper/state.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/wrapper/state.py +++ b/salt/client/ssh/wrapper/state.py @@ -48,6 +48,7 @@ def _thin_dir(): Get the thin_dir from the master_opts if not in __opts__ ''' thin_dir = __opts__.get('thin_dir', __opts__['__master_opts__']['thin_dir']) + return thin_dir def sls(mods, saltenv='base', test=None, exclude=None, **kwargs):
When building up the remote file location nothing was being returned via _thin_dir so the remote path was starting with None. This change updates _thin_dir to return a value for format to use.
saltstack_salt
train
py
8deac592fb2e16bdecba5f5193568c9003737808
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index <HASH>..<HASH> 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -476,8 +476,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { // First shutdown the writer, this will result in a closing stream element getting send to // the server if (packetWriter != null) { + LOGGER.finer("PacketWriter shutdown()"); packetWriter.shutdown(instant); } + LOGGER.finer("PacketWriter has been shut down"); try { // After we send the closing stream element, check if there was already a @@ -490,8 +492,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { } if (packetReader != null) { + LOGGER.finer("PacketReader shutdown()"); packetReader.shutdown(); } + LOGGER.finer("PacketReader has been shut down"); try { socket.close();
Finer logs in XMPPTCPConnection.shutdown()
igniterealtime_Smack
train
java
0cf0860a3d059af379e0c2ee3e08ff5adf6c7cac
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index <HASH>..<HASH> 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -69,11 +69,11 @@ class DruidCluster(Model, AuditMixinNullable): # short unique name, used in permissions cluster_name = Column(String(250), unique=True) coordinator_host = Column(String(255)) - coordinator_port = Column(Integer) + coordinator_port = Column(Integer, default=8081) coordinator_endpoint = Column( String(255), default='druid/coordinator/v1/metadata') broker_host = Column(String(255)) - broker_port = Column(Integer) + broker_port = Column(Integer, default=8082) broker_endpoint = Column(String(255), default='druid/v2') metadata_last_refreshed = Column(DateTime) cache_timeout = Column(Integer)
Set default ports Druid (#<I>) For Druid set the default port for the broker and coordinator.
apache_incubator-superset
train
py
4a94b6e975720d5af69e5d90038b6099df28a431
diff --git a/structr-core/src/main/java/org/structr/core/graph/DeleteNodeCommand.java b/structr-core/src/main/java/org/structr/core/graph/DeleteNodeCommand.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/core/graph/DeleteNodeCommand.java +++ b/structr-core/src/main/java/org/structr/core/graph/DeleteNodeCommand.java @@ -166,7 +166,7 @@ public class DeleteNodeCommand extends NodeServiceCommand { } catch (Throwable t) { - logger.log(Level.WARNING, t, LogMessageSupplier.create("Exception while deleting node: {0}", node)); + logger.log(Level.FINE, t, LogMessageSupplier.create("Exception while deleting node: {0}", node)); }
Reduces log level so that deleting an already deleted node are not logged as a WARNING.
structr_structr
train
java