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
cd274e6b9c5d710879270317195d1e560e58df8a
diff --git a/planet/api/models.py b/planet/api/models.py index <HASH>..<HASH> 100644 --- a/planet/api/models.py +++ b/planet/api/models.py @@ -163,8 +163,9 @@ class _Paged(JSON): return items def _json_stream(self, limit): + items = self.get()[self.ITEM_KEY] # if there are no results, the GeneratorAdapter doesn't play well - if self.get().get('count', 0): + if len(items): items = GeneratorAdapter(self.items_iter(limit)) else: items = [] @@ -177,7 +178,10 @@ class _Features(_Paged): def _json_stream(self, limit): stream = super(_Features, self)._json_stream(limit) - stream['count'] = self.get()['count'] + json_body = self.get() + # patch back in the count if present + if 'count' in json_body: + stream['count'] = json_body.get('count') stream['type'] = 'FeatureCollection' return stream
fix streaming results for mosaics/quads follow up to <I>ae6cd
planetlabs_planet-client-python
train
py
b1cbbbb6c82edb8679518634929cb9f5c474da61
diff --git a/lib/turbot/command/bots.rb b/lib/turbot/command/bots.rb index <HASH>..<HASH> 100644 --- a/lib/turbot/command/bots.rb +++ b/lib/turbot/command/bots.rb @@ -80,22 +80,21 @@ class Turbot::Command::Bots < Turbot::Command::Base alias_command "info", "bots:info" - # bots:create [path/to/manifest.json] + # bots:push # - # create a new bot + # Push bot code to the turbot server. Must be run from a local bot checkout. # - # # Must be run with a path to a manifest.json file - # $ heroku bots:create path/to/manifest.json + # $ turbot bots:push # Creating example... done - def create - manifest_path = shift_argument || File.join(Dir.pwd, "manifest.json") + def push validate_arguments! - working_dir = File.dirname(manifest_path) + working_dir = Dir.pwd + manifest_path = "#{working_dir}/manifest.json" manifest = JSON.parse(open(manifest_path).read) #archive_file = File.join(working_dir, 'tmp', "#{manifest['bot_id']}.zip") - archive = Tempfile.new(manifest['bot_id']) + archive = Tempfile.new(bot) archive_path = "#{archive.path}.zip" Zip.continue_on_exists_proc = true
Rename "create" -> "push"
openc_turbot-client
train
rb
4638adcedeb6a9e2c68a5dbead6135487c439fe5
diff --git a/aurelia-bootstrap-datetimepicker/src/abp-datetime-picker.js b/aurelia-bootstrap-datetimepicker/src/abp-datetime-picker.js index <HASH>..<HASH> 100644 --- a/aurelia-bootstrap-datetimepicker/src/abp-datetime-picker.js +++ b/aurelia-bootstrap-datetimepicker/src/abp-datetime-picker.js @@ -304,13 +304,11 @@ export class AbpDatetimePickerCustomElement { } modelChanged(newValue, oldValue) { - if (isNaN(Date.parse(newValue)) && newValue !== null) { + if (!moment(newValue, this._format, true).isValid() && newValue !== null) { throw new Error('Datetimepicker, model.bind must be of type Date'); } if (newValue !== oldValue && newValue) { - if (moment(newValue, this._format, true).isValid()) { - this.value = moment(newValue, this._format, true).format(this._format); - } + this.value = moment(newValue, this._format, true).format(this._format); } }
fix(edge): issue #<I> modelChanged fails in Edge browser
ghiscoding_Aurelia-Bootstrap-Plugins
train
js
f7ee426727125caec674c1196bb20638e9d8950f
diff --git a/api/types/types_paths.go b/api/types/types_paths.go index <HASH>..<HASH> 100644 --- a/api/types/types_paths.go +++ b/api/types/types_paths.go @@ -293,7 +293,9 @@ func checkPerms(k fileKey, mustPerm bool) bool { log.WithField("path", p).Debug("file exists") } } else { - log.WithFields(fields).Info("making libStorage directory") + if Debug { + log.WithFields(fields).Info("making libStorage directory") + } noPermMkdirErr := fmt.Sprintf("mkdir %s: permission denied", p) if err := os.MkdirAll(p, k.perms()); err != nil { if err.Error() == noPermMkdirErr {
Fix for Path Initialization Logging This patch wraps part of the path initialization logging inside a logic branch that requires the LIBSTORAGE_DEBUG environment variable to be set to true to prevent the initialization logging from occurring at all times.
thecodeteam_libstorage
train
go
e945e635d5c319803112574ceff5084a7d33d209
diff --git a/simplesteem/simplesteem.py b/simplesteem/simplesteem.py index <HASH>..<HASH> 100644 --- a/simplesteem/simplesteem.py +++ b/simplesteem/simplesteem.py @@ -478,4 +478,24 @@ class SimpleSteem: return True + def dex_ticker(self): + d = Dex(self.steem_instance()) + self.ticker = d.get_ticker(); + return self.ticker + + + def steem_to_sbd(self, steem, account=None): + if not account: + account = self.mainaccount + best_price = self.dex_ticker()['highest_bid'] + try: + d.sell(steem, "STEEM", best_price, account=account) + except Exception as e: + self.msg.error_message("COULD NOT SELL STEEM FOR SBD") + return False + else: + return True + + + # EOF
Added new method for checking Dex ticker and selling steem for sbd
ArtoLabs_SimpleSteem
train
py
0e4b34f1673db152caaaa0277dcbeadbe10e31c7
diff --git a/lib/pkgcloud/openstack/compute/client/keys.js b/lib/pkgcloud/openstack/compute/client/keys.js index <HASH>..<HASH> 100644 --- a/lib/pkgcloud/openstack/compute/client/keys.js +++ b/lib/pkgcloud/openstack/compute/client/keys.js @@ -36,6 +36,10 @@ exports.addKey = function addKey(options, callback) { if (typeof options === 'string') { options = { name: options }; } + else if (options.key) { + options.public_key = options.key; + delete options.key; + } var self = this, createOptions;
[fix] Make OpenStack `addKey` consistent with other providers. Fixes #<I>.
pkgcloud_pkgcloud
train
js
4c304f73ea2bdc8d5fd5ca0c57e5491c4675eebd
diff --git a/skpm-test-runner/src/utils/get-sketch-path.js b/skpm-test-runner/src/utils/get-sketch-path.js index <HASH>..<HASH> 100644 --- a/skpm-test-runner/src/utils/get-sketch-path.js +++ b/skpm-test-runner/src/utils/get-sketch-path.js @@ -1,6 +1,7 @@ import fs from 'fs' import path from 'path' import childProcess from 'child_process' +import { get as getConfig } from '@skpm/utils/tool-config' function appInfoForKey(app, key) { const plistPath = path.join(app, 'Contents', 'Info.plist') @@ -66,15 +67,19 @@ export function getSketchPath(app) { if (!appPath || useLatest) { appPath = pathToLatestApp() if (useLatest && !appPath) { - if (useXCode && !appPath) { - console.error('Latest build not found.') - process.exit(1) - } + console.error('Latest build not found.') + process.exit(1) } } + if (!appPath) { + appPath = getConfig().sketchApp + } + if (!fs.existsSync(appPath)) { - console.error('No Sketch application found.') + console.error( + `No Sketch application found${appPath ? ` at ${appPath}` : ''}.` + ) process.exit(1) }
fall back to skpm sketch app
skpm_skpm
train
js
05cd5c16305f41baa844bf2b49d4dc9626864e6d
diff --git a/windpowerlib/wind_turbine.py b/windpowerlib/wind_turbine.py index <HASH>..<HASH> 100644 --- a/windpowerlib/wind_turbine.py +++ b/windpowerlib/wind_turbine.py @@ -166,21 +166,23 @@ class WindTurbine(object): def read_turbine_data(**kwargs): r""" - Fetches cp or P values from a file or downloads it from a server. + Fetches power coefficient curve or power curve from a file. - The files are located in the data folder of the package root. + The data files are provided along with the windpowerlib and are located in + the directory windpowerlib/data. Other Parameters ---------------- datapath : string, optional - Path where the cp or P file is stored. Default: '$PACKAGE_ROOT/data' + Path where the data file is stored. Default: './data' filename : string, optional - Filename of the cp or P file. + Name of data file. Default: 'cp_values.csv' Returns ------- pandas.DataFrame - Cp or P values with the corresponding wind speeds as indices. + Power coefficient curve values or power curve values with the + corresponding wind speeds as indices. """ if 'datapath' not in kwargs:
Changes in docstring of read_turbine_data
wind-python_windpowerlib
train
py
a906bb22026b002473f3a4e73e166fb91d32883d
diff --git a/custodian/qchem/handlers.py b/custodian/qchem/handlers.py index <HASH>..<HASH> 100644 --- a/custodian/qchem/handlers.py +++ b/custodian/qchem/handlers.py @@ -178,11 +178,7 @@ class QChemErrorHandler(ErrorHandler): or len(od["scf_iteration_energies"][-1]) == 0: if 'Exit Code 134' in self.errors: # SCF not started - if "thresh" not in self.fix_step.params["rem"]: - self.fix_step.set_integral_threshold(thresh=12) - return "use tight integral threshold" - else: - return None + return self.fix_error_code_134() else: return None scf_iters = od["scf_iteration_energies"][-1]
if SCF not started just turn to error code <I> fix
materialsproject_custodian
train
py
764a5ffe0eccde82165784fdfd03a494adca2389
diff --git a/src/main/java/com/hp/autonomy/hod/client/config/Requester.java b/src/main/java/com/hp/autonomy/hod/client/config/Requester.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hp/autonomy/hod/client/config/Requester.java +++ b/src/main/java/com/hp/autonomy/hod/client/config/Requester.java @@ -202,6 +202,7 @@ public class Requester<E extends EntityType, T extends TokenType> { * @param <E> The most general authentication entity type which this backend caller accepts * @param <T> The most general authentication token type which this backend caller accepts */ + @FunctionalInterface public interface BackendCaller<E extends EntityType, T extends TokenType> { /**
[FLIB-<I>] Added @FunctionalInterface to BackendCaller. [rev: alex.scown]
microfocus-idol_java-hod-client
train
java
755dff9e5847f9d32aa24d6cc4789beb4efa805e
diff --git a/lib/economic/current_invoice.rb b/lib/economic/current_invoice.rb index <HASH>..<HASH> 100644 --- a/lib/economic/current_invoice.rb +++ b/lib/economic/current_invoice.rb @@ -87,7 +87,7 @@ module Economic data['DebtorCountry'] = debtor_country unless debtor_country.blank? data['Date'] = date.iso8601 unless date.blank? data['TermOfPaymentHandle'] = { 'Id' => term_of_payment_handle[:id] } unless term_of_payment_handle.blank? - data['DueDate'] = due_date.iso8601 unless due_date.blank? + data['DueDate'] = (due_date.blank? ? nil : due_date.iso8601) data['CurrencyHandle'] = { 'Code' => currency_handle[:code] } unless currency_handle.blank? data['ExchangeRate'] = exchange_rate data['IsVatIncluded'] = is_vat_included
CurrentInvoice#due_date is nullable. Reflect that when building the SOAP data
substancelab_rconomic
train
rb
a650d743d9f96c3d70ae8af090386d4c0dff31b3
diff --git a/dwave/cloud/client.py b/dwave/cloud/client.py index <HASH>..<HASH> 100644 --- a/dwave/cloud/client.py +++ b/dwave/cloud/client.py @@ -775,8 +775,8 @@ class Client(object): Derived properies are: * `name` (str): Solver name/id. - * `qpu` (bool): Is solver QPU based? - * `software` (bool): Is solver software based? + * `qpu` (bool): Solver is a QPU? + * `software` (bool): Solver is a software solver? * `online` (bool, default=True): Is solver online? * `num_active_qubits` (int): Number of active qubits. Less then or equal to `num_qubits`. * `avg_load` (float): Solver's average load (similar to Unix load average).
Update get_solvers docs
dwavesystems_dwave-cloud-client
train
py
d65a0cd420b7256a42897b5d0da47b06009fcccb
diff --git a/osmnx/geometries.py b/osmnx/geometries.py index <HASH>..<HASH> 100644 --- a/osmnx/geometries.py +++ b/osmnx/geometries.py @@ -359,6 +359,9 @@ def _create_gdf(response_jsons, polygon, tags): # Set to hold the unique IDs of elements that do not have tags untagged_element_ids = set() + # identify which relation types to parse to (multi)polygons + relation_types = {"boundary", "multipolygon"} + # extract geometries from the downloaded osm data for response_json in response_jsons: # Parses the JSON of OSM nodes, ways and (multipolygon) relations @@ -398,9 +401,9 @@ def _create_gdf(response_jsons, polygon, tags): elif ( element["type"] == "relation" - and element.get("tags").get("type") == "multipolygon" + and element.get("tags").get("type") in relation_types ): - # Parse all multipolygon relations to multipolygons + # parse relations to (multi)polygons multipolygon = _parse_relation_to_multipolygon( element=element, geometries=geometries )
parse relations of type boundary and multipolygon
gboeing_osmnx
train
py
7be86551c196d03ad1918223cb186e57d174e4d7
diff --git a/tests/TwilioTest.php b/tests/TwilioTest.php index <HASH>..<HASH> 100644 --- a/tests/TwilioTest.php +++ b/tests/TwilioTest.php @@ -228,7 +228,7 @@ class TwilioTest extends PHPUnit_Framework_TestCase { $http->shouldReceive('get')->once() ->with('/2010-04-01/Accounts/AC123/Calls.json?Page=1&PageSize=50') ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo"}' + '{"status":400,"message":"foo", "code": "20006"}' )); $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); foreach ($client->account->calls as $call) {
update test to include error code. fixes #<I>
twilio_twilio-php
train
php
c7df773318708cbe94e56fadbef043b3e52df3e2
diff --git a/tests/before_travis_test.js b/tests/before_travis_test.js index <HASH>..<HASH> 100644 --- a/tests/before_travis_test.js +++ b/tests/before_travis_test.js @@ -136,7 +136,7 @@ function configureOrmModule() { { reg: /Database username/ , write: 'travis\n' , done: false }, { reg: /Database password/ , write: '\n' , done: false }, { reg: /Database name/ , write: 'test_db\n' , done: false }, - { reg: /Database dialect/ , write: '\n' , done: false }, + { reg: /Database dialect/ , write: 'mysql\n' , done: false }, { reg: /Database host/ , write: '127.0.0.1\n', done: false }, { reg: /Database port/ , write: '3306\n' , done: false }, ]
fix(travis): Before Travis Script debugging
CleverStack_clever-orm
train
js
376ed31fff67bc20c18282059f7d1535f746d1da
diff --git a/Util/PaginationResultSet.php b/Util/PaginationResultSet.php index <HASH>..<HASH> 100644 --- a/Util/PaginationResultSet.php +++ b/Util/PaginationResultSet.php @@ -41,9 +41,9 @@ class PaginationResultSet { $this->page = $page; $this->itemPerPage = $itemPerPage; - $this->orderBy = $orderBy; $this->fullyItems = $fullyItems; + $this->pageNumber = $pageNumber; $this->items = $items; }
Fix Bug: Pagination Result Set attribute pageNumber is undefined.
CedrickOka_oka-pagination
train
php
d06975ed49a4564f118d42572c1f997cc131307e
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -141,7 +141,7 @@ function Server(originalCommand, configPath, baseDir, listenPort, controlPath) { self._app.models.ServiceInstance.upsert({ id: 1, processes: req.workers.map(function(w) { - return {processId: w.pid, workerId: w.id} + return {pid: w.pid, workerId: w.id} }), }, function(err, obj) { debug('upsert ServiceInstance: %j', err || obj);
server: ServiceProcess processId rename to pid
strongloop_strong-pm
train
js
3598facd22154d7f706d0d664fcda6b3598f1bd5
diff --git a/Kwc/Shop/Cart/Checkout/Payment/PayPal/Cancel/ContentSender.php b/Kwc/Shop/Cart/Checkout/Payment/PayPal/Cancel/ContentSender.php index <HASH>..<HASH> 100644 --- a/Kwc/Shop/Cart/Checkout/Payment/PayPal/Cancel/ContentSender.php +++ b/Kwc/Shop/Cart/Checkout/Payment/PayPal/Cancel/ContentSender.php @@ -8,7 +8,7 @@ class Kwc_Shop_Cart_Checkout_Payment_PayPal_Cancel_ContentSender extends Kwf_Com Kwc_Shop_Cart_Orders::setCartOrderId($session->paypalCartId); $order = Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting($this->_data->parent->parent->parent->componentClass, 'childModel')) ->getReferencedModel('Order')->getCartOrder(); - if ($order && $order->status == 'pending') { + if ($order) { $order->status = 'cart'; $order->save(); }
on cancel set order status always to cart in paypal payment
koala-framework_koala-framework
train
php
1da643b8be886ad836dfd6da950b8b6ed4215f0c
diff --git a/webpack/config.worker.js b/webpack/config.worker.js index <HASH>..<HASH> 100644 --- a/webpack/config.worker.js +++ b/webpack/config.worker.js @@ -23,7 +23,8 @@ var config = merge(configShared, { output: { library: 'Pusher', path: path.join(__dirname, '../dist/worker'), - filename: filename + filename: filename, + libraryTarget: 'umd' }, resolve: { // in order to import the appropriate runtime.ts
Set worker webpack ouput libraryTarget to umd
pusher_pusher-js
train
js
ef8145be98c21f460e423843cccce35f7386436d
diff --git a/lib/mongomodel/support/scope.rb b/lib/mongomodel/support/scope.rb index <HASH>..<HASH> 100644 --- a/lib/mongomodel/support/scope.rb +++ b/lib/mongomodel/support/scope.rb @@ -150,6 +150,10 @@ module MongoModel result end end + + def respond_to?(method, include_private = false) + Array.method_defined?(method) || klass.respond_to?(method, include_private) || super + end protected def method_missing(method, *args, &block)
Implemented respond_to? for Scope
spohlenz_mongomodel
train
rb
d0251d1af04952c3481f35a53eeb65139a117c03
diff --git a/lib/omnibus/software.rb b/lib/omnibus/software.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/software.rb +++ b/lib/omnibus/software.rb @@ -30,14 +30,14 @@ module Omnibus # @return [Software] # def load(project, name, manifest) - loaded_softwares[name] ||= begin + loaded_softwares["#{project.name}:#{name}"] ||= begin filepath = Omnibus.software_path(name) if filepath.nil? raise MissingSoftware.new(name) else log.internal(log_key) do - "Loading software `#{name}' from `#{filepath}'." + "Loading software `#{name}' from `#{filepath}' using overrides from #{project.name}." end end
Don't cache software definitions across projects
chef_omnibus
train
rb
24b98724fa200082b478ad0caddefb05715363fe
diff --git a/lib/ztk/logger.rb b/lib/ztk/logger.rb index <HASH>..<HASH> 100644 --- a/lib/ztk/logger.rb +++ b/lib/ztk/logger.rb @@ -24,6 +24,7 @@ module ZTK # # @author Zachary Patten <zachary AT jovelabs DOT com> class Logger < ::Logger + attr_accessor :stdout_echo # Log Levels SEVERITIES = Severity.constants.inject([]) {|arr,c| arr[Severity.const_get(c)] = c; arr} @@ -95,7 +96,9 @@ module ZTK message = [message, progname].flatten.compact.join(": ") message = "%19s.%06d|%05d|%5s|%s%s\n" % [Time.now.utc.strftime("%Y-%m-%d|%H:%M:%S"), Time.now.utc.usec, Process.pid, SEVERITIES[severity], called_by, message] - @logdev.write(ZTK::ANSI.uncolor(message)) + statement = ZTK::ANSI.uncolor(message) + stdout_echo and $stdout.write(statement) + @logdev.write(statement) @logdev.respond_to?(:flush) and @logdev.flush true
allow echoing log statements to stdout
zpatten_ztk
train
rb
a7f5a3b2a916db4d23fca6f48e348094a1be0416
diff --git a/src/components/Nginx.php b/src/components/Nginx.php index <HASH>..<HASH> 100644 --- a/src/components/Nginx.php +++ b/src/components/Nginx.php @@ -199,7 +199,12 @@ class Nginx extends \hidev\base\Component public function findFpmSocketFile() { - $files = ['/run/php/php7.0-fpm.sock', '/var/run/php5-fpm.sock', '/tmp/php-fpm.sock']; + $files = [ + '/run/php/php7.1-fpm.sock', + '/run/php/php7.0-fpm.sock', + '/var/run/php5-fpm.sock', + '/tmp/php-fpm.sock', + ]; foreach ($files as $file) { if (file_exists($file)) { return $file;
added more FPM socket variants to guess from
hiqdev_hidev-nginx
train
php
00e8f7e55b940b8b23c09e2bc17bcd404db101cc
diff --git a/csvs_to_sqlite/cli.py b/csvs_to_sqlite/cli.py index <HASH>..<HASH> 100644 --- a/csvs_to_sqlite/cli.py +++ b/csvs_to_sqlite/cli.py @@ -55,7 +55,8 @@ def cli(paths, dbname, separator, quoting, replace_tables, extract_column, fts): extract_columns = extract_column del extract_column - click.echo('extract_columns={}'.format(extract_columns)) + if extract_columns: + click.echo('extract_columns={}'.format(extract_columns)) if dbname.endswith('.csv'): raise click.BadParameter( 'dbname must not end with .csv'
Less verbosity (#<I>) Only log extract_columns info when that option is passed.
simonw_csvs-to-sqlite
train
py
e19ae9feab6831968fa13c5840b24cf9b27cfc42
diff --git a/faq-bundle/src/Resources/contao/dca/tl_faq.php b/faq-bundle/src/Resources/contao/dca/tl_faq.php index <HASH>..<HASH> 100644 --- a/faq-bundle/src/Resources/contao/dca/tl_faq.php +++ b/faq-bundle/src/Resources/contao/dca/tl_faq.php @@ -160,7 +160,7 @@ $GLOBALS['TL_DCA']['tl_faq'] = array 'exclude' => true, 'search' => true, 'inputType' => 'text', - 'eval' => array('rgxp'=>'alias', 'unique'=>true, 'maxlength'=>128, 'tl_class'=>'w50'), + 'eval' => array('rgxp'=>'alias', 'doNotCopy'=>true, 'unique'=>true, 'maxlength'=>128, 'tl_class'=>'w50'), 'save_callback' => array ( array('tl_faq', 'generateAlias')
[Faq] Do not add a suffix when copying if the "doNotCopy" flag is set (see #<I>).
contao_contao
train
php
3fb252d4d27bf3860aa2a3bac52adfe9f9fb735c
diff --git a/container/utils/__init__.py b/container/utils/__init__.py index <HASH>..<HASH> 100644 --- a/container/utils/__init__.py +++ b/container/utils/__init__.py @@ -102,7 +102,7 @@ def metadata_to_image_config(metadata): def ports_to_exposed_ports(list_of_ports): to_return = {} - for port_spec in list_of_ports: + for port_spec in map(text_type, list_of_ports): exposed_ports = port_spec.rsplit(':', 1)[-1] protocol = 'tcp' if '/' in exposed_ports:
Apply text_type to ports (#<I>)
ansible_ansible-container
train
py
05190d8b82358b0c13364d538117327b96b68d65
diff --git a/src/DomHandler/Wsdl/AbstractDocument.php b/src/DomHandler/Wsdl/AbstractDocument.php index <HASH>..<HASH> 100755 --- a/src/DomHandler/Wsdl/AbstractDocument.php +++ b/src/DomHandler/Wsdl/AbstractDocument.php @@ -76,8 +76,11 @@ abstract class AbstractDocument extends DomDocumentHandler protected function getElementHandler(\DOMElement $element, AbstractDomDocumentHandler $domDocument, $index = -1) { $handlerName = '\WsdlToPhp\PackageGenerator\DomHandler\ElementHandler'; + $elementNameClass = sprintf('%s\Tag\Tag%s', __NAMESPACE__, ucfirst(implode('', array_slice(explode(':', $element->nodeName), -1, 1)))); $tagClass = sprintf('%s\Tag\Tag%s', __NAMESPACE__, ucfirst($this->currentTag)); - if (class_exists($tagClass)) { + if (class_exists($elementNameClass)) { + $handlerName = $elementNameClass; + } elseif (class_exists($tagClass)) { $handlerName = $tagClass; } return new $handlerName($element, $domDocument, $index);
issue #<I> - improve AbstractDocument::getElementHandler method this method is based on the currentTag property in order to return the correct object which is biased and making difficulties to get the right object, this improvement should allow to always get the right type of object based on the element tag
WsdlToPhp_PackageGenerator
train
php
4a0ecce48c862a6a2c094027ac402daf143d9f4d
diff --git a/jquery.dirtyforms.js b/jquery.dirtyforms.js index <HASH>..<HASH> 100644 --- a/jquery.dirtyforms.js +++ b/jquery.dirtyforms.js @@ -124,12 +124,9 @@ License MIT settings.focused.value = $focused.val(); } - return this.each(function (e) { - var $form = $(this); - if (!$form.is('form')) return; - - dirtylog('Adding form ' + $form.attr('id') + ' to forms to watch'); - $form.addClass(settings.listeningClass) + return this.filter('form').each(function () { + dirtylog('Adding form ' + $(this).attr('id') + ' to forms to watch'); + $(this).addClass(settings.listeningClass) .on('focus change', inputSelector, onFocus) .on('change', "input[type='checkbox'],input[type='radio'],select", onSelectionChange) .on('click', "input[type='reset']", onReset);
Simplified the loop in the init method by using .filter() instead of is().
snikch_jquery.dirtyforms
train
js
3a8721b832ad3e7d5b45d3bc0380b928db2937b5
diff --git a/hypervisor/xen/xen.go b/hypervisor/xen/xen.go index <HASH>..<HASH> 100644 --- a/hypervisor/xen/xen.go +++ b/hypervisor/xen/xen.go @@ -255,7 +255,7 @@ func (xc *XenContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNic glog.V(1).Infof("add network for %d - ip: %s, br: %s, gw: %s, dev: %s, hw: %s", xc.domId, guest.Ipaddr, host.Bridge, host.Bridge, dev, hw.String()) - res := HyperxlNicAdd(xc.driver.Ctx, (uint32)(xc.domId), guest.Ipaddr[0], host.Bridge, host.Bridge, dev, []byte(hw)) + res := HyperxlNicAdd(xc.driver.Ctx, (uint32)(xc.domId), guest.Ipaddr, host.Bridge, host.Bridge, dev, []byte(hw)) if res != 0 { glog.V(1).Infof("nic %s insert succeeded [faked] ", guest.Device) result <- callback
fix xen build failure by #<I> it changed the struct definition, then reverted, but leave this file changed.
hyperhq_runv
train
go
85b112482152672d566c494e566dd093eb4bdd09
diff --git a/charmhelpers/core/hookenv.py b/charmhelpers/core/hookenv.py index <HASH>..<HASH> 100644 --- a/charmhelpers/core/hookenv.py +++ b/charmhelpers/core/hookenv.py @@ -173,9 +173,7 @@ def relation_get(attribute=None, unit=None, rid=None): try: return json.loads(subprocess.check_output(_args)) except ValueError: - pass - - return None + return None def relation_set(relation_id=None, relation_settings={}, **kwargs):
Removed an unnecessary change left from the merge.
juju_charm-helpers
train
py
6f3cb9647d114c907380099159914d0ebf859539
diff --git a/spec/addressabler_spec.rb b/spec/addressabler_spec.rb index <HASH>..<HASH> 100644 --- a/spec/addressabler_spec.rb +++ b/spec/addressabler_spec.rb @@ -26,6 +26,17 @@ describe Addressabler do uri = Addressable::URI.parse("http://www.bart-blabla.cc") uri.tld.should == 'cc' end + + it "doesn't know non-existing TLDs" do + uri = Addressable::URI.parse("http://www.bart-blabla.foobar") + uri.tld.should == '' + end + + it "accepts custom TLDs" do + Addressable::URI.custom_tlds = { 'foobar' => {} } + uri = Addressable::URI.parse("http://www.bart-blabla.foobar") + uri.tld.should == 'foobar' + end end it "should support adding keys to the query" do
Write behavior for "custom_tlds" option
flipsasser_addressabler
train
rb
f003c2e8618c435ba985170307ec99df6c112335
diff --git a/devices/green_power.js b/devices/green_power.js index <HASH>..<HASH> 100644 --- a/devices/green_power.js +++ b/devices/green_power.js @@ -17,7 +17,8 @@ module.exports = [ 'short_press_2_of_1'])], toZigbee: [], whiteLabel: [{vendor: 'Philips', description: 'Hue Tap', model: '8718696743133'}, - {vendor: 'Niko', description: 'Friends of Hue switch', model: '91004'}], + {vendor: 'Niko', description: 'Friends of Hue switch', model: '91004'}, + {vendor: 'Vimar', description: 'Smart switch for Philips Hue', model: '03906'}], }, { zigbeeModel: ['GreenPower_7'],
Add <I> as whitelabel of GreenPower_On_Off_Switch (#<I>) * Added support for Vimar <I> Friends Of Hue GreenPower smart switch * Fixed missing comma in GreenPower
Koenkk_zigbee-shepherd-converters
train
js
5b3ea752379a59a839907019048460e952cdde32
diff --git a/tensorflow_probability/python/bijectors/rational_quadratic_spline_test.py b/tensorflow_probability/python/bijectors/rational_quadratic_spline_test.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/bijectors/rational_quadratic_spline_test.py +++ b/tensorflow_probability/python/bijectors/rational_quadratic_spline_test.py @@ -56,7 +56,7 @@ def rq_splines(draw, batch_shape=None, dtype=tf.float32): params = draw( tfp_hps.broadcasting_params( batch_shape, - params_event_ndims=dict(bin_widths=2, bin_heights=2, knot_slopes=2), + params_event_ndims=dict(bin_widths=1, bin_heights=1, knot_slopes=1), constraint_fn_for=constraints.get)) return tfb.RationalQuadraticSpline( range_min=lo, validate_args=draw(hps.booleans()), **params)
Fix param event ndims for RQ spline bijector. PiperOrigin-RevId: <I>
tensorflow_probability
train
py
4a6d9ca5a68c00cf1f06e85a16c70bd2d97b03a0
diff --git a/tests/log_parser/test_performance_log_parser.py b/tests/log_parser/test_performance_log_parser.py index <HASH>..<HASH> 100644 --- a/tests/log_parser/test_performance_log_parser.py +++ b/tests/log_parser/test_performance_log_parser.py @@ -13,6 +13,8 @@ def test_valid_talosdata(): assert parser.artifact[0].keys()[0] == 'json' +# Disabled because of bug 1188132. +@pytest.mark.xfail def test_invalid_talosdata(): invalid_line = '10:27:39 INFO - INFO : TALOSDATA: [ { "json"' parser = TalosParser() diff --git a/treeherder/log_parser/parsers.py b/treeherder/log_parser/parsers.py index <HASH>..<HASH> 100644 --- a/treeherder/log_parser/parsers.py +++ b/treeherder/log_parser/parsers.py @@ -346,4 +346,5 @@ class TalosParser(ParserBase): # that's the behaviour we want self.artifact = json.loads(match.group(1)) else: - raise ValueError('Invalid TALOSDATA: %s' % line) + # probably a line which just happens to contain talosdata, ignore + pass
Bug <I> - Don't retry log parsing for invalid TALOSDATA log lines Since if it failed the first time, it's always going to fail.
mozilla_treeherder
train
py,py
c3803b52735245a2e9240e8ba18c0198fb47bf72
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -199,6 +199,11 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { onseed = opts opts = {} } + + if (typeof FileList === 'function' && input instanceof FileList) { + input = Array.prototype.slice.call(input) + } + // TODO: support `input` as filesystem path string var buffer = Buffer.concat(input.map(function (file) { return file.buffer
Support `FileList` as input for the `seed` method The W3C `FileList` object has no `map` method, thus it needs to be converted to an array before using.
webtorrent_webtorrent
train
js
a4e5f000d5657115c13adaab8bc637e1e5030084
diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -99,13 +99,15 @@ EOT : $input->getOption('file'); $this->configFile = new JsonFile($this->configFile); - if (!$this->configFile->exists()) { + + // initialize the global file if it's not there + if ($input->getOption('global') && !$this->configFile->exists()) { touch($this->configFile->getPath()); - // If you read an empty file, Composer throws an error - // Toss some of the defaults in there - $defaults = Config::$defaultConfig; - $defaults['repositories'] = Config::$defaultRepositories; - $this->configFile->write($defaults); + $this->configFile->write(array('config' => new \ArrayObject)); + } + + if (!$this->configFile->exists()) { + throw new \RuntimeException('No composer.json found in the current directory'); } }
Only create the root file empty and error out on missing local files
mothership-ec_composer
train
php
1dde940b16a90eabc6636711dd7299f5be7eec18
diff --git a/webvtt/webvtt.py b/webvtt/webvtt.py index <HASH>..<HASH> 100644 --- a/webvtt/webvtt.py +++ b/webvtt/webvtt.py @@ -24,13 +24,14 @@ class WebVTT: for format_, parser_class in SUPPORTED_FORMATS: method_name = 'read' if format_ == 'webvtt' else 'from_{}'.format(format_) - setattr(self.__class__, method_name, self._set_reader(format_, parser_class)) + setattr(self.__class__, method_name, self._set_reader(method_name, format_, parser_class)) - def _set_reader(self, format_, parser_class): + def _set_reader(self, name, format_, parser_class): def f(self, file): self.parser = parser_class() return self.parser.read(file) + f.__name__ = name if format_ == 'webvtt': f.__doc__ = 'Reads a WebVTT captions file.' else:
Add __name__ to the methods created dynamically at runtime
glut23_webvtt-py
train
py
fcf1d4c3af3ce600b281bb2e19d645b1bedee72c
diff --git a/test/test-integration-openssh.js b/test/test-integration-openssh.js index <HASH>..<HASH> 100644 --- a/test/test-integration-openssh.js +++ b/test/test-integration-openssh.js @@ -25,6 +25,12 @@ const debug = false; const opensshPath = 'ssh'; let opensshVer; +// TODO: figure out why this test is failing on Windows +if (process.platform === 'win32') { + console.log('Skipping OpenSSH integration tests on Windows'); + process.exit(0); +} + // Fix file modes to avoid OpenSSH client complaints about keys' permissions for (const file of readdirSync(FIXTURES_DIR, { withFileTypes: true })) { if (file.isFile())
test: skip OpenSSH integration tests on Windows
mscdex_ssh2
train
js
1526ea0efcc796d9d0795f2320048bfd50113d6a
diff --git a/py/pysparkling/initializer.py b/py/pysparkling/initializer.py index <HASH>..<HASH> 100644 --- a/py/pysparkling/initializer.py +++ b/py/pysparkling/initializer.py @@ -32,7 +32,8 @@ class Initializer(object): if cl.getClass().getName()=='com.databricks.backend.daemon.driver.DriverLocal$DriverLocalClassLoader': cl.getParent().getParent().addURL(url) else: - cl.addURL(url) + spark_cl = Initializer.__find_spark_cl(cl, 'org.apache.spark.util.MutableURLClassLoader') + spark_cl.addURL(url) # Add Sparkling Water Assembly JAR to Spark's file server so executors can fetch it when they need to use the dependency. jsc.addJar(sw_jar_file) @@ -53,3 +54,12 @@ class Initializer(object): def __get_sw_jar(): return os.path.abspath(resource_filename("sparkling_water", 'sparkling_water_assembly.jar')) + @staticmethod + def __find_spark_cl(start_cl, cl_name): + cl = start_cl + while cl: + name = cl.getClass().getName() + if (name == cl_name): + return cl + cl = cl.getParent() + return None
[SW-<I>] Find the right ClassLoader to register SW jar (#<I>) Zeppelin and other platforms bring additional ClassLoader on top of Spark MutableURLClassLoader. That causes PySparkling to fail on missing `addURL` method. The patch introduces code which finds the right Spark classloader in active thread classloader chain. It does not do any error recovery if the classloader is not found.
h2oai_sparkling-water
train
py
f5e6bd15f7582fb716601f20c108191c24aebc0c
diff --git a/blockstack/lib/rpc.py b/blockstack/lib/rpc.py index <HASH>..<HASH> 100644 --- a/blockstack/lib/rpc.py +++ b/blockstack/lib/rpc.py @@ -471,10 +471,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler): if 'zonefile' in name_rec: zonefile_txt = base64.b64decode(name_rec['zonefile']) - res = decode_name_zonefile(name, zonefile_txt) - if res is None: - log.error("Failed to parse zone file for {}".format(name)) - zonefile_txt = {'error': 'Non-standard zone file'} ret = {} @@ -488,7 +484,7 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler): ret = { 'status': 'registered_subdomain', 'zonefile': zonefile_txt, - 'zonefile_hash': name_rec['zonefile_hash'], + 'zonefile_hash': name_rec['value_hash'], 'address': name_rec['address'], 'blockchain': 'bitcoin', 'last_txid': name_rec['txid'],
don't even try to decode the zone file on GET /v1/names. It's not necessary.
blockstack_blockstack-core
train
py
9b48a94c0ae1d128d819e2523a813738c1662489
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -287,7 +287,7 @@ module ActiveRecord cattr_accessor :session_class self.session_class = Session - SESSION_RECORD_KEY = 'rack.session.record'.freeze + SESSION_RECORD_KEY = 'rack.session.record' private def get_session(env, sid)
brrrrr! freeze is not needed
rails_rails
train
rb
0390f50042bb668d494a7e7eeb5a5836d449b547
diff --git a/lib/active_scaffold/actions/create.rb b/lib/active_scaffold/actions/create.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/actions/create.rb +++ b/lib/active_scaffold/actions/create.rb @@ -122,7 +122,7 @@ module ActiveScaffold::Actions params = params[:record] || {} unless params[model.inheritance_column] # in create action must be inside record key model = params.delete(model.inheritance_column).camelize.constantize if params[model.inheritance_column] end - model.new + model.respond_to?(:build) ? model.build : model.new end # override this method if you want to inject data in the record (or its associated objects) before the save
use build instead of new for associations in new_model
activescaffold_active_scaffold
train
rb
856f3c822d3053b57d2045da16a0d9d070e053d7
diff --git a/sources/values.js b/sources/values.js index <HASH>..<HASH> 100644 --- a/sources/values.js +++ b/sources/values.js @@ -15,7 +15,9 @@ module.exports = function values (array, onAbort) { return function (abort, cb) { if(abort) return abortCb(cb, abort, onAbort) - cb(i >= array.length || null, array[i++]) + if(i >= array.length) + cb(true) + else + cb(null, array[i++]) } } -
perf: don't access array out of bounds
pull-stream_pull-stream
train
js
db1b6ddbe057d2d03517a7959053aa8f648cea46
diff --git a/extensions/random-custom-background.php b/extensions/random-custom-background.php index <HASH>..<HASH> 100644 --- a/extensions/random-custom-background.php +++ b/extensions/random-custom-background.php @@ -126,7 +126,7 @@ class Random_Custom_Background { $supports = get_theme_support( 'custom-background' ); /* If '__return_false' is the wp_head callback, roll our own. */ - if ( '__return_false' == $supports[0]['wp-head-callback'] ) + if ( isset( $supports[0]['wp-head-callback'] ) && '__return_false' == $supports[0]['wp-head-callback'] ) add_action( 'wp_head', array( &$this, 'custom_background_callback' ) ); }
Make sure the 'wp-head-callback' is set before checking its value in the Random Custom Background extension.
justintadlock_hybrid-core
train
php
93db3e60813e516311400090f215597901c52aaa
diff --git a/tests/AppTest.php b/tests/AppTest.php index <HASH>..<HASH> 100644 --- a/tests/AppTest.php +++ b/tests/AppTest.php @@ -8,6 +8,7 @@ */ namespace Slim\Tests; +use Prophecy\Argument; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -33,6 +34,16 @@ class AppTest extends TestCase ini_set('error_log', tempnam(sys_get_temp_dir(), 'slim')); } + public function testDoesNotUseContainerAsServiceLocator() + { + $containerProphecy = $this->prophesize(ContainerInterface::class); + $responseFactory = $this->getResponseFactory(); + $app = new App($responseFactory, $containerProphecy->reveal()); + + $containerProphecy->has(Argument::type('string'))->shouldNotHaveBeenCalled(); + $containerProphecy->get(Argument::type('string'))->shouldNotHaveBeenCalled(); + } + /******************************************************************************** * Getter methods *******************************************************************************/
AppTest: Assert that the constructor doesn't use ContainerInterface as service collector
slimphp_Slim
train
php
6907e9d7a1aaf2ffe280271980b6977561949654
diff --git a/spec/motion-support/ns_dictionary_spec.rb b/spec/motion-support/ns_dictionary_spec.rb index <HASH>..<HASH> 100644 --- a/spec/motion-support/ns_dictionary_spec.rb +++ b/spec/motion-support/ns_dictionary_spec.rb @@ -26,4 +26,28 @@ describe "NSDictionary" do dict.symbolize_keys.should == { :foo => 'bar' } end end + + describe "with_indifferent_access" do + it "should work for NSDictionary instances" do + dict = NSMutableDictionary.alloc.init + dict.setValue('bar', forKey:'foo') + dict_indifferent = dict.with_indifferent_access + dict_indifferent['foo'].should == 'bar' + dict_indifferent[:foo].should == dict_indifferent['foo'] + end + + it "should work with nested NSDictionary instances" do + dict = NSMutableDictionary.alloc.init + dict_inner = NSMutableDictionary.alloc.init + dict_inner.setValue('value', forKey: 'key') + dict.setValue('bar', forKey:'foo') + dict.setValue(dict_inner, forKey: 'inner') + + dict_indifferent = dict.with_indifferent_access + inner_indifferent = dict_indifferent['inner'] + dict_indifferent[:inner].should == inner_indifferent + inner_indifferent['key'].should == dict_inner['key'] + inner_indifferent[:key].should == inner_indifferent['key'] + end + end end
add with_indifferent_access specs
rubymotion_motion-support
train
rb
8541dd87a948dfd7152f78df6eaee9832afd6595
diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index <HASH>..<HASH> 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -23,7 +23,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias) if(!height)height = 600; // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(); + var webgl = ( function () { try { var canvas = document.createElement( 'canvas' ); return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); } catch( e ) { return false; } } )(); //console.log(webgl); if( webgl )
updating Detector to use new ThreeJS method which supports more environments (like SublimeJS)
pixijs_pixi.js
train
js
e6bbe851c95e7afbbc5420661c8f1329d478a519
diff --git a/lib/travis/addons/email/task.rb b/lib/travis/addons/email/task.rb index <HASH>..<HASH> 100644 --- a/lib/travis/addons/email/task.rb +++ b/lib/travis/addons/email/task.rb @@ -24,7 +24,8 @@ module Travis Mailer::Build.send(type, payload, recipients, broadcasts).deliver if recipients.any? rescue StandardError => e # TODO notify the repo - error("Could not send email to: #{recipients}\n#{e.message}") + error("Could not send email to: #{recipients}") + log_exception(e) raise end
we need the full exception from email sending as something funky is going on right now
travis-ci_travis-core
train
rb
f20d73392debf7d3b6c58235ba1b55b96a501af6
diff --git a/src/Sylius/Bundle/AdminBundle/Resources/private/js/sylius-move-taxon.js b/src/Sylius/Bundle/AdminBundle/Resources/private/js/sylius-move-taxon.js index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/private/js/sylius-move-taxon.js +++ b/src/Sylius/Bundle/AdminBundle/Resources/private/js/sylius-move-taxon.js @@ -20,7 +20,7 @@ $.fn.extend({ beforeSend(settings) { /* eslint-disable-next-line no-param-reassign */ settings.data = { - position: jquery(this).data('position') - 1, + position: $(this).data('position') - 1, }; return settings; @@ -40,7 +40,7 @@ $.fn.extend({ beforeSend(settings) { /* eslint-disable-next-line no-param-reassign */ settings.data = { - position: jquery(this).data('position') + 1, + position: $(this).data('position') + 1, }; return settings;
Use "$" instead of "jquery" to follow the import statement
Sylius_Sylius
train
js
06d949f7fbed72e469687ebf7a81df2937296853
diff --git a/test/dummy/config/initializers/date_picker.rb b/test/dummy/config/initializers/date_picker.rb index <HASH>..<HASH> 100644 --- a/test/dummy/config/initializers/date_picker.rb +++ b/test/dummy/config/initializers/date_picker.rb @@ -1,5 +1,5 @@ DatePicker.configure do |config| - config.style = :bootstrap + config.style = :flatpickr config.formats = { date: :default, datetime: :default,
Switch dummy app config to flatpickr
benignware_date_picker
train
rb
8cf2528dc654b92f33825081201aa55626e4eb98
diff --git a/lib/commands/serve.js b/lib/commands/serve.js index <HASH>..<HASH> 100644 --- a/lib/commands/serve.js +++ b/lib/commands/serve.js @@ -110,11 +110,11 @@ module.exports = { .then(hook.prepare('beforeBuild')) .then(this._autoFindLiveReloadPort.bind(this, options)) .then(function(serveOpts) { - var baseURL = this.project.config.baseURL; - if (baseURL === undefined) { baseURL = '/'; } + var config = this.project.config(); _merge(serveOpts, { - baseURL: this.project.config().baseURL, + baseURL: config.baseURL, + rootURL: config.rootURL, project: this.project });
fix(serve-task #<I>): support rootURL
isleofcode_ember-cordova
train
js
be56b772c68b8b4ec9c5d0bb9a3d50df490668a8
diff --git a/src/debianbts.py b/src/debianbts.py index <HASH>..<HASH> 100644 --- a/src/debianbts.py +++ b/src/debianbts.py @@ -27,18 +27,32 @@ which represents a bugreport from the BTS. from datetime import datetime +import urllib +import urlparse import SOAPpy # Setup the soap server -# TODO: recognize HTTP proxy environment variable # Default values URL = 'http://bugs.debian.org/cgi-bin/soap.cgi' NS = 'Debbugs/SOAP/V1' -server = SOAPpy.SOAPProxy(URL, NS) BTS_URL = 'http://bugs.debian.org/' +def _get_http_proxy(): + """Returns an HTTP proxy URL formatted for consumption by SOAPpy. + + SOAPpy does some fairly low-level HTTP manipulation and needs to be + explicitly made aware of HTTP proxy URLs, which also have to be formatted + without a schema or path. + """ + http_proxy = urllib.getproxies().get('http') + if http_proxy is None: + return None + return urlparse.urlparse(http_proxy).netloc +server = SOAPpy.SOAPProxy(URL, NS, http_proxy=_get_http_proxy()) + + class Bugreport(object): """Represents a bugreport from Debian's Bug Tracking System.
Add support for HTTP proxies. SOAPpy does some low-level HTTP request manipulation and needs to be explicitly aware of HTTP proxies, which also have to be formatted for its consumption (without a schema or path). Closes Debian bug #<I> (and its duplicates).
venthur_python-debianbts
train
py
7684d68d2c2e2da2eca3edcc7fbcd741b185b2a9
diff --git a/lib/facade.js b/lib/facade.js index <HASH>..<HASH> 100644 --- a/lib/facade.js +++ b/lib/facade.js @@ -96,7 +96,9 @@ Facade.field = function (field) { */ Facade.prototype.json = function () { - return clone(this.obj); + var ret = clone(this.obj); + if (this.type) ret.type = this.type(); + return ret; }; /** diff --git a/test/facade.js b/test/facade.js index <HASH>..<HASH> 100644 --- a/test/facade.js +++ b/test/facade.js @@ -56,6 +56,11 @@ describe('Facade', function (){ var facade = new Facade(obj); expect(facade.json()).to.eql(obj); }); + + it('should add .type', function(){ + var track = new Facade.Track({}); + expect(track.json().type).to.eql('track'); + }); }); describe('.context()', function(){
add `type` field to be returned from `.json()` Adds the facade .type to the json payload so we don't have to do it manually. Sets .json() to better match the spec
segmentio_facade
train
js,js
ab66ba92adf4ad44f006a90d85b5e6117811fdcc
diff --git a/tests/helpers/CMTest/library/CMTest/TH.php b/tests/helpers/CMTest/library/CMTest/TH.php index <HASH>..<HASH> 100644 --- a/tests/helpers/CMTest/library/CMTest/TH.php +++ b/tests/helpers/CMTest/library/CMTest/TH.php @@ -24,12 +24,12 @@ class CMTest_TH { } public static function clearEnv() { + self::clearConfig(); self::clearServices(); self::clearDb(); self::clearCache(); self::timeReset(); self::clearFilesystem(); - self::clearConfig(); } public static function clearCache() {
Reset config first in TH
cargomedia_cm
train
php
17dc541e25ec6743bf1099230c4f3abe60325c20
diff --git a/parsl/monitoring/db_manager.py b/parsl/monitoring/db_manager.py index <HASH>..<HASH> 100644 --- a/parsl/monitoring/db_manager.py +++ b/parsl/monitoring/db_manager.py @@ -539,7 +539,9 @@ class DatabaseManager: "_migrate_logs_to_internal can only migrate WORKFLOW_,TASK_INFO message from priority queue, got x[0] == {}".format(x[0]) self._dispatch_to_internal(x) elif queue_tag == 'resource': - assert x[0] == MessageType.RESOURCE_INFO, "_migrate_logs_to_internal can only migrate RESOURCE_INFO message from resource queue" + assert isinstance(x, tuple), "_migrate_logs_to_internal was expecting a tuple, got {}".format(x) + assert x[0] == MessageType.RESOURCE_INFO, \ + "_migrate_logs_to_internal can only migrate RESOURCE_INFO message from resource queue, got tag {}, message {}".format(x[0], x) self._dispatch_to_internal(x) elif queue_tag == 'node': assert len(x) == 2, "expected message tuple to have exactly two elements"
Add a stronger type assertion around monitoring code being rearranged (#<I>)
Parsl_parsl
train
py
34eb51b77508f7668ed01a346ae4d10be65b50e2
diff --git a/src/main/java/edu/ksu/canvas/model/Course.java b/src/main/java/edu/ksu/canvas/model/Course.java index <HASH>..<HASH> 100644 --- a/src/main/java/edu/ksu/canvas/model/Course.java +++ b/src/main/java/edu/ksu/canvas/model/Course.java @@ -32,6 +32,7 @@ public class Course extends BaseCanvasModel implements Serializable { private String workflowState; private Integer totalStudents; private Long enrollmentTermId; + private Boolean restrictEnrollmentsToCourseDates; private List<Section> sections; private List<Enrollment> enrollments; @@ -199,6 +200,15 @@ public class Course extends BaseCanvasModel implements Serializable { return enrollments; } + @CanvasField(postKey = "restrict_enrollments_to_course_dates") + public Boolean getRestrictEnrollmentsToCourseDates() { + return restrictEnrollmentsToCourseDates; + } + + public void setRestrictEnrollmentsToCourseDates(Boolean restrictEnrollmentsToCourseDates) { + this.restrictEnrollmentsToCourseDates = restrictEnrollmentsToCourseDates; + } + public void setEnrollments(List<Enrollment> enrollments) { this.enrollments = enrollments; }
Expose the restrict_enrollments_to_course_dates configuration setting.
kstateome_canvas-api
train
java
2a11ee0118d5c4213a215b30bf9c169379d50fcf
diff --git a/homu/utils.py b/homu/utils.py index <HASH>..<HASH> 100644 --- a/homu/utils.py +++ b/homu/utils.py @@ -11,7 +11,8 @@ def github_set_ref(repo, ref, sha, *, force=False, auto_create=True): try: js = repo._json(repo._patch(url, data=json.dumps(data)), 200) except github3.models.GitHubError as e: if e.code == 422 and auto_create: - return repo.create_ref('refs/' + ref, sha) + try: return repo.create_ref('refs/' + ref, sha) + except github3.models.GitHubError: raise e else: raise
Properly report exceptions in `github_set_ref`
barosl_homu
train
py
34e1056807cc6831ba34c033072fd3a995f411c4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,6 @@ setup( description=('Easily print colored text to the console'), license='BSD 3-Clause License', keywords='text, color, colorise, colorize, console, terminal', - packages=['colorise', 'colorise.win', 'colorise.nix'], - package_data={'colorise': ['tests', 'examples']}, url='https://github.com/MisanthropicBit/colorise', project_urls={ 'Issue Tracker': 'https://github.com/MisanthropicBit/colorise/issues', @@ -42,5 +40,5 @@ setup( 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: Implementation :: PyPy' - ] + ], )
Move tests/examples from install, add end ','
MisanthropicBit_colorise
train
py
f57d6d6bba308a2a0db785ea166f87b7170ad1af
diff --git a/lib/Migration.php b/lib/Migration.php index <HASH>..<HASH> 100644 --- a/lib/Migration.php +++ b/lib/Migration.php @@ -35,7 +35,7 @@ namespace RawPHP\RawMigrator; -use RawPHP\RawBase\Models\Model; +use RawPHP\RawBase\Model; use RawPHP\RawDatabase\IDatabase; /**
Updated to work with the latest rawphp/rawbase package.
rawphp_RawMigrator
train
php
1c5dd63d728d2040d7304428a066321a4e9dda9a
diff --git a/packages/heroku-spaces/lib/heroku/command/dapps.rb b/packages/heroku-spaces/lib/heroku/command/dapps.rb index <HASH>..<HASH> 100644 --- a/packages/heroku-spaces/lib/heroku/command/dapps.rb +++ b/packages/heroku-spaces/lib/heroku/command/dapps.rb @@ -166,7 +166,8 @@ class Heroku::Command::Dapps < Heroku::Command::Base info = api.post_organization_app(params).body begin - action("Creating #{info['name']}", :org => !!org) do + space_action = info['space'] ? " in space #{info['space']['name']}" : '' + action("Creating #{info['name']}#{space_action}", :org => !!org) do if info['create_status'] == 'creating' Timeout::timeout(options[:timeout].to_i) do loop do
Show space info in dapps:create
heroku_cli
train
rb
84c935f424de59e82115aab363c9d376c2a2120f
diff --git a/lib/fewer.rb b/lib/fewer.rb index <HASH>..<HASH> 100644 --- a/lib/fewer.rb +++ b/lib/fewer.rb @@ -1,3 +1,20 @@ +module Fewer + class << self + attr_writer :logger + + def logger + @logger ||= begin + defined?(Rails) ? Rails.logger : begin + require 'logger' + log = Logger.new(STDOUT) + log.level = Logger::INFO + log + end + end + end + end +end + require 'fewer/app' require 'fewer/engines' require 'fewer/errors'
Add Fewer.logger, which used the rails logger if available
benpickles_fewer
train
rb
df90b731adf1c08dc3257848041bca0a792d1df3
diff --git a/gitlab_tests/test_v91/test_users.py b/gitlab_tests/test_v91/test_users.py index <HASH>..<HASH> 100644 --- a/gitlab_tests/test_v91/test_users.py +++ b/gitlab_tests/test_v91/test_users.py @@ -2,9 +2,9 @@ import os from unittest import TestCase import responses +from requests.exceptions import HTTPError from gitlab import Gitlab -from gitlab.exceptions import HttpError from gitlab_tests.base import BaseTest from response_data.users import * @@ -34,7 +34,9 @@ class TestGetUsers(BaseTest): status=404, content_type='application/json') - self.assertRaises(HttpError, self.gitlab.get_users) + self.gitlab.suppress_http_error = False + self.assertRaises(HTTPError, self.gitlab.get_users) + self.gitlab.suppress_http_error = True self.assertEqual(False, self.gitlab.getusers()) @@ -60,5 +62,7 @@ class TestDeleteUser(BaseTest): status=404, content_type='application/json') - self.assertRaises(HttpError, self.gitlab.delete_user, 14) + self.gitlab.suppress_http_error = False + self.assertRaises(HTTPError, self.gitlab.delete_user, 14) + self.gitlab.suppress_http_error = True self.assertFalse(self.gitlab.deleteuser(14))
tests: Update Users cases for new behaviour See also: #<I>
pyapi-gitlab_pyapi-gitlab
train
py
9d11f8580fdfb9af2c6ccb42ef5a1cc9dcb5f164
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 @@ -394,11 +394,16 @@ def _import(path, continue_on_error): def _load_components(path, include=".*", exclude="test", continue_on_error=True): + do_include = re.compile(include).search if include else lambda x: True + do_exclude = re.compile(exclude).search if exclude else lambda x: False + num_loaded = 0 if path.endswith(".py"): path, _ = os.path.splitext(path) path = path.rstrip("/").replace("/", ".") + if do_exclude(path): + return 0 package = _import(path, continue_on_error) if not package: @@ -406,9 +411,6 @@ def _load_components(path, include=".*", exclude="test", continue_on_error=True) num_loaded += 1 - do_include = re.compile(include).search if include else lambda x: True - do_exclude = re.compile(exclude).search if exclude else lambda x: False - if not hasattr(package, "__path__"): return num_loaded
Fix excludes not working in _load_components (#<I>) * Moved the do_include and do_exclude to the top and added a check for excludes before importing path.
RedHatInsights_insights-core
train
py
ff04c162bd38c5a0b52a9e408be83563969c7bd1
diff --git a/tests/integration/modules/gem.py b/tests/integration/modules/gem.py index <HASH>..<HASH> 100644 --- a/tests/integration/modules/gem.py +++ b/tests/integration/modules/gem.py @@ -27,7 +27,10 @@ def check_status(): ''' Check the status of the rubygems source ''' - ret = salt.utils.http.query('https://rubygems.org', status=True) + try: + ret = salt.utils.http.query('https://rubygems.org', status=True) + except Exception: + return False return ret['status'] == 200
Skip Ruby tests on exception in pre-req check
saltstack_salt
train
py
29b732217a17abe222f72967d49d136765e68007
diff --git a/cookie.go b/cookie.go index <HASH>..<HASH> 100644 --- a/cookie.go +++ b/cookie.go @@ -18,6 +18,8 @@ var ( ) // Cookie represents HTTP response cookie. +// +// Do not copy Cookie obects. Create new obect and use CopyTo instead. type Cookie struct { key []byte value []byte @@ -29,6 +31,16 @@ type Cookie struct { buf []byte } +// CopyTo copies src cookie to c. +func (c *Cookie) CopyTo(src *Cookie) { + c.Reset() + c.key = append(c.key[:0], src.key...) + c.value = append(c.value[:0], src.value...) + c.expire = src.expire + c.domain = append(c.domain[:0], src.domain...) + c.path = append(c.path[:0], src.path...) +} + // Path returns cookie path. func (c *Cookie) Path() []byte { return c.path
Added CopyTo to Cookie for the sake of API consistency
valyala_fasthttp
train
go
2a679fee74fccbfc7538232279f4ecf66e818c79
diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java @@ -4106,7 +4106,7 @@ public abstract class DevUtil extends AbstractContainerSupportUtil { } } } else { - warn("File deleted but could not find corresponding file or folder in the target directory: " + debug("File deleted but could not find corresponding file or folder in the target directory: " + fileChanged.getCanonicalPath() + "."); } }
Use debug instead of warn as to not flood dev mode output (#<I>)
WASdev_ci.common
train
java
003e2f065f9bea2002ab752baafa667aa5b455ae
diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb b/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb index <HASH>..<HASH> 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb @@ -27,6 +27,8 @@ module Elasticsearch # @option arguments [String] :_source_exclude A list of fields to exclude from the returned _source field # @option arguments [String] :_source_include A list of fields to extract and return from the _source field # + # @see http://elasticsearch.org/guide/reference/api/get/ + # # @since 0.90.1 # def get_source(arguments={})
[API] Added missing documentation for the `get_source` API
elastic_elasticsearch-ruby
train
rb
c0ec40c83a7e2370f0f4a01055aafb69026d8099
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -322,7 +322,7 @@ module AbstractController super if _include_layout?(options) - layout = options.key?(:layout) ? options.delete(:layout) : :default + layout = options.delete(:layout) { :default } options[:layout] = _layout_for_option(layout) end end diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -313,7 +313,7 @@ module ActionView options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split) end - escape = options.key?("escape") ? options.delete("escape") : true + escape = options.delete("escape") { true } content = ERB::Util.html_escape(content) if escape content_tag :textarea, content.to_s.html_safe, { "name" => name, "id" => sanitize_to_id(name) }.update(options)
Refactored two methods to use delete with a block
rails_rails
train
rb,rb
0130fd9c1a72681ab80dd7ad3fbc4baa7876e7b9
diff --git a/lib/utils/parseInput.js b/lib/utils/parseInput.js index <HASH>..<HASH> 100644 --- a/lib/utils/parseInput.js +++ b/lib/utils/parseInput.js @@ -21,10 +21,10 @@ function parseInput(input, format) { } else if (typeof input === 'function') { output = parseInput(input((0, _moment2['default'])().startOf('day')), format); } else if (input._isAMomentObject) { - output = input.startOf('day').clone(); + output = input.clone().startOf('day'); } return output; } -module.exports = exports['default']; \ No newline at end of file +module.exports = exports['default'];
Stopped parseInput from mutating props
ParadeTo_react-date-range-ch
train
js
1a96075102954cdcb24adbaceb06b0711cff9667
diff --git a/Kwf/Assets/Dependency/File.php b/Kwf/Assets/Dependency/File.php index <HASH>..<HASH> 100644 --- a/Kwf/Assets/Dependency/File.php +++ b/Kwf/Assets/Dependency/File.php @@ -14,6 +14,9 @@ class Kwf_Assets_Dependency_File extends Kwf_Assets_Dependency_Abstract throw new Kwf_Exception("Invalid filename"); } $this->_fileName = $fileNameWithType; + if (strpos($fileNameWithType, '\\') !== false) { + throw new Kwf_Exception("Infalid filename, must not contain \\, use / instead"); + } //check commented out, only required for debugging //if (!file_exists($this->getAbsoluteFileName())) { @@ -134,7 +137,7 @@ class Kwf_Assets_Dependency_File extends Kwf_Assets_Dependency_Abstract foreach ($it as $file) { $f = $file->getPathname(); $f = substr($f, strlen($paths[$pathType])); - $f = $pathType . $f; + $f = $pathType . str_replace('\\', '/', $f); $files[] = self::createDependency($f, $providerList); } $ret = new Kwf_Assets_Dependency_Dependencies($files, $fileName.'*');
Make sure asset file url doesn't contains backslash fixes assets build on windows
koala-framework_koala-framework
train
php
2f9a9e5962fe5312bd55d1ea4d7f73399de0d5fd
diff --git a/js/binance.js b/js/binance.js index <HASH>..<HASH> 100644 --- a/js/binance.js +++ b/js/binance.js @@ -3148,7 +3148,7 @@ module.exports = class binance extends Exchange { const market = this.market (symbol); const defaultType = this.safeString2 (this.options, 'fetchOrders', 'defaultType', 'spot'); const type = this.safeString (params, 'type', defaultType); - const marginMode = this.handleMarginMode (params); + const [ marginMode, query ] = this.handleMarginModeAndParams (params); const request = { 'symbol': market['id'], }; @@ -3169,8 +3169,8 @@ module.exports = class binance extends Exchange { if (limit !== undefined) { request['limit'] = limit; } - const query = this.omit (params, [ 'type', 'marginMode' ]); - const response = await this[method] (this.extend (request, query)); + const requestParams = this.omit (query, [ 'type' ]); + const response = await this[method] (this.extend (requestParams, query)); // // spot //
binance.fetchOrders handleMarginMode switched to handleMarginModeAndParams
ccxt_ccxt
train
js
b3dd4620d8cc697f22454401f53943112414eb28
diff --git a/src/main/java/org/cactoos/func/FuncOf.java b/src/main/java/org/cactoos/func/FuncOf.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/cactoos/func/FuncOf.java +++ b/src/main/java/org/cactoos/func/FuncOf.java @@ -41,7 +41,7 @@ public final class FuncOf<X, Y> implements Func<X, Y> { /** * The func. */ - private final Func<X, Y> func; + private final Func<? super X, ? extends Y> func; /** * Ctor. @@ -61,7 +61,7 @@ public final class FuncOf<X, Y> implements Func<X, Y> { * Ctor. * @param scalar Origin scalar */ - public FuncOf(final Scalar<Y> scalar) { + public FuncOf(final Scalar<? extends Y> scalar) { this(input -> scalar.value()); } @@ -69,7 +69,7 @@ public final class FuncOf<X, Y> implements Func<X, Y> { * Ctor. * @param fnc Func */ - public FuncOf(final Func<X, Y> fnc) { + public FuncOf(final Func<? super X, ? extends Y> fnc) { this.func = fnc; }
(#<I>) Update other FuncOf ctors
yegor256_cactoos
train
java
1676fc9690d71d6595277fac5327f4d620a34f70
diff --git a/lib/Record.php b/lib/Record.php index <HASH>..<HASH> 100644 --- a/lib/Record.php +++ b/lib/Record.php @@ -515,6 +515,8 @@ class Record extends Base implements \ArrayAccess, \IteratorAggregate, \Countabl public function set($name, $value = null) { $this->loaded = true; + + // Set record for collection if (!$this->data && $value instanceof static) { $this->isColl = true; } diff --git a/tests/unit/DbTest.php b/tests/unit/DbTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/DbTest.php +++ b/tests/unit/DbTest.php @@ -1750,7 +1750,6 @@ class DbTest extends TestCase $member['table'] = 234; - $this->assertNotEquals(234, $member->getTable()); $this->assertEquals('member', $member->getTable()); }
added commen for changd coll status in set method
twinh_wei
train
php,php
beae798737fb61e699fefb91371e10b6c855a474
diff --git a/examples/java/uk/co/real_logic/sbe/examples/SbeExample.java b/examples/java/uk/co/real_logic/sbe/examples/SbeExample.java index <HASH>..<HASH> 100644 --- a/examples/java/uk/co/real_logic/sbe/examples/SbeExample.java +++ b/examples/java/uk/co/real_logic/sbe/examples/SbeExample.java @@ -132,13 +132,13 @@ public class SbeExample sb.append("\ncar.available=").append(car.available()); sb.append("\ncar.code=").append(car.code()); - sb.append("\ncar.vehicleCode="); + sb.append("\ncar.someNumbers="); for (int i = 0, size = car.someNumbersLength(); i < size; i++) { sb.append(car.someNumbers(i)).append(", "); } - sb.append("\ncar.someNumbers="); + sb.append("\ncar.vehicleCode="); for (int i = 0, size = car.vehicleCodeLength(); i < size; i++) { sb.append((char)car.vehicleCode(i));
Fixed name of output field in SbeExample
real-logic_simple-binary-encoding
train
java
0b558c6eb0affa6196f03f31221361538181df07
diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index <HASH>..<HASH> 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -177,10 +177,12 @@ class NumberHelper extends AppHelper { } $options['after'] = null; } elseif ($number < 1 && $number > -1 ) { - $multiply = intval('1' . str_pad('', $options['places'], '0')); - $number = $number * $multiply; - $options['before'] = null; - $options['places'] = null; + if ($options['after'] !== false) { + $multiply = intval('1' . str_pad('', $options['places'], '0')); + $number = $number * $multiply; + $options['before'] = null; + $options['places'] = null; + } } elseif (empty($options['before'])) { $options['before'] = null; } else {
Adding code to make tests from previous commit pass.
cakephp_cakephp
train
php
1565da82664ef97658c0216650e42cbef43a210c
diff --git a/hydra_base/lib/scenario.py b/hydra_base/lib/scenario.py index <HASH>..<HASH> 100644 --- a/hydra_base/lib/scenario.py +++ b/hydra_base/lib/scenario.py @@ -793,8 +793,10 @@ def get_resourceattr_data(resource_attr_ids, scenario_id, get_parent_data=False, scenario_i = _get_scenario(scenario_id, user_id) + if not isinstance(resource_attr_ids, list): + resource_attr_ids = [resource_attr_ids] - scenario_rs = scenario_i.get_data(get_parent_data=get_parent_data, ra_ids=[resource_attr_ids]) + scenario_rs = scenario_i.get_data(get_parent_data=get_parent_data, ra_ids=resource_attr_ids) resource_scenario_dict = {}
Emergency fix for a bug that was passing a multi-layer list into get_data
hydraplatform_hydra-base
train
py
d93822713a10fcb5f73ebc6227c0f51337f33d13
diff --git a/atlassian/jira.py b/atlassian/jira.py index <HASH>..<HASH> 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -735,7 +735,7 @@ class Jira(AtlassianRestAPI): :param list issue_list: :return: """ - jira_issue_regex = re.compile(r"[A-Z]{1,10}-\d+") + jira_issue_regex = re.compile(r"\w+-\d+") missing_issues = list() matched_issue_keys = list() for key in issue_list:
[Jira] Do not filter project keys too aggressively. (#<I>)
atlassian-api_atlassian-python-api
train
py
932b150828bfecb297b8dde343bd5f259e11e6b8
diff --git a/angr/exploration_techniques/oppologist.py b/angr/exploration_techniques/oppologist.py index <HASH>..<HASH> 100644 --- a/angr/exploration_techniques/oppologist.py +++ b/angr/exploration_techniques/oppologist.py @@ -35,10 +35,7 @@ class Oppologist(ExplorationTechnique): irsb = self.project.factory.block(pn.addr).vex addrs = [ s.addr for s in irsb.statements if isinstance(s, pyvex.IRStmt.IMark) ] - if len(addrs) > 1: - stops = [ addrs[1] ] - else: - stops = None + stops = None pn.options.add(sim_options.UNICORN) pn.options.add(sim_options.UNICORN_AGGRESSIVE_CONCRETIZATION)
fix oppologist error caused by stop point at non-bb-address This used to work because we just ignored stop points at non basic block addresses, but now we just stop at the start of the block (therefore not using unicorn at all) which is wrong.
angr_angr
train
py
0ddcfb694b2c2ca22d89cb795418794e2b3c922f
diff --git a/examples/vector-layer.js b/examples/vector-layer.js index <HASH>..<HASH> 100644 --- a/examples/vector-layer.js +++ b/examples/vector-layer.js @@ -40,7 +40,7 @@ var map = new ol.Map({ target: 'map', view: new ol.View2D({ center: [0, 0], - zoom: 2 + zoom: 1 }) });
Set zoom in vector-layer example to match master
openlayers_openlayers
train
js
3fff141844347ebea413d4223f4e42d4d46924a2
diff --git a/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/task/DataSinkTask.java b/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/task/DataSinkTask.java index <HASH>..<HASH> 100644 --- a/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/task/DataSinkTask.java +++ b/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/task/DataSinkTask.java @@ -394,8 +394,7 @@ public class DataSinkTask<IT> extends AbstractOutputTask } catch (IOException e) { LOG.error("Could not access the file system to detemine the status of the output.", e); - // any other kind of I/O exception: we assume only a degree of one here - return 1; + throw new RuntimeException("I/O Error while accessing file", e); } }
throw exception instead of return max dop of 1 one IOException (from file system/hdfs)
apache_flink
train
java
a7a4ef73faee6cddba36bf670d4a20ab0521c36f
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/__init__.py +++ b/sos/report/plugins/__init__.py @@ -1629,7 +1629,7 @@ class Plugin(object): def _add_cmd_output(self, **kwargs): """Internal helper to add a single command to the collection list.""" - pred = kwargs.pop('pred') if 'pred' in kwargs else None + pred = kwargs.pop('pred') if 'pred' in kwargs else SoSPredicate(self) if 'priority' not in kwargs: kwargs['priority'] = 10 soscmd = SoSCommand(**kwargs)
[plugins] Set default predicate instead of None for robustness Just making the code more robustness, it could be dangerous to set pred = None and then potentially call log_skipped_cmd that expects "pred" of SoSPredicate type. Currently such a call flow can not happen, but it is worth to make the code more robust for potential future changes. Resolves: #<I>
sosreport_sos
train
py
87fc9530037fa16796e7b8d9d5eaa7b4f4ba8534
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/node/environment.rb +++ b/lib/puppet/node/environment.rb @@ -529,9 +529,16 @@ class Puppet::Node::Environment if file == NO_MANIFEST Puppet::Parser::AST::Hostclass.new('') elsif File.directory?(file) - parse_results = Dir.entries(file).find_all { |f| f =~ /\.pp$/ }.sort.map do |pp_file| - parser.file = File.join(file, pp_file) + parse_results = Dir.glob(File.join(file, '**/**.pp')).sort.map do | file_to_parse | +# parse_results = Dir.entries(file).find_all { |f| f =~ /\.pp$/ }.sort.map do |pp_file| +# parser.file = File.join(file, pp_file) + begin + parser.file = file_to_parse parser.parse + rescue Puppet::Error => e + require 'debugger'; debugger + puts file_to_parse + end end # Use a parser type specific merger to concatenate the results Puppet::Parser::AST::Hostclass.new('', :code => Puppet::Parser::ParserFactory.code_merger.concatenate(parse_results))
(PUP-<I>) Make manifest-directory load recursively This changes the loaded of a manifest reference that is a directory to include all .pp recursively in this directory. The content is sorted so that all content of directory b comes before file c in its parent directory (rule applied recursively).
puppetlabs_puppet
train
rb
79205f7db320a755224ed9e0fabc82261e1409b5
diff --git a/packages/netlify-cms-core/src/components/App/App.js b/packages/netlify-cms-core/src/components/App/App.js index <HASH>..<HASH> 100644 --- a/packages/netlify-cms-core/src/components/App/App.js +++ b/packages/netlify-cms-core/src/components/App/App.js @@ -67,7 +67,7 @@ class App extends React.Component { t: PropTypes.func.isRequired, }; - static configError(config) { + configError(config) { const t = this.props.t; return ( <ErrorContainer> @@ -145,7 +145,7 @@ class App extends React.Component { } if (config.get('error')) { - return App.configError(config); + return this.configError(config); } if (config.get('isFetching')) {
fix: fix App configError method (#<I>)
netlify_netlify-cms
train
js
af5bdce5d69fe9086cb1df484b2acdb85c4974ae
diff --git a/samples/test/tables.test.js b/samples/test/tables.test.js index <HASH>..<HASH> 100644 --- a/samples/test/tables.test.js +++ b/samples/test/tables.test.js @@ -57,6 +57,9 @@ describe('Tables', () => { ]); }); + // to avoid getting rate limited + beforeEach(done => setTimeout(done, 500)); + after(async () => { await bigquery .dataset(srcDatasetId)
docs(samples): deflake sample tests (#<I>)
googleapis_nodejs-bigquery
train
js
f36cc519b27c8d797010a3d08733fc6a2bf9b60b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( ], extras_require={ 'dev': ['tox>=3', 'flake8', 'pep8-naming', 'wheel', 'twine'], - 'test': ['mock>=3', 'pytest>=6', 'pytest-mock>=2', 'pytest-cov'], + 'test': ['mock>=3', 'pytest>=7', 'pytest-mock>=2', 'pytest-cov'], 'docs': ['sphinx>=1.8', 'sphinx-rtd-theme'], }, long_description=pathlib.Path('README.rst').read_text(encoding='utf-8'),
bump pytest to >=7
xflr6_gsheets
train
py
3be32ad3956a9ee47a2aa21026400f1a4fe58fa2
diff --git a/tests/test_multiprocess.py b/tests/test_multiprocess.py index <HASH>..<HASH> 100644 --- a/tests/test_multiprocess.py +++ b/tests/test_multiprocess.py @@ -16,6 +16,11 @@ pytestmark = [ platform.system() == 'Linux', reason="#410: keyring discovery fails intermittently", ), + pytest.mark.skipif( + # always skip as it crashes the interpreter + sys.version_info < (3, 8) and platform.system() == 'Darwin', + reason="#281, #494: Prior to 3.8, multiprocess invocation fails", + ), ] @@ -26,11 +31,6 @@ def test_multiprocess_get(): assert proc1.exitcode == 0 -@pytest.mark.skipif( - # always skip as it crashes the interpreter - sys.version_info < (3, 8) and platform.system() == 'Darwin', - reason="#281: Prior to 3.8, multiprocess invocation fails", -) def test_multiprocess_get_after_native_get(): keyring.get_password('test_app', 'test_user') test_multiprocess_get()
Skip both multiprocessing tests. Ref #<I>.
jaraco_keyring
train
py
1e6cd34d1d5ae99074f265e9bcc1bb965c83101e
diff --git a/structr-ui/src/main/resources/structr/js/schema.js b/structr-ui/src/main/resources/structr/js/schema.js index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/resources/structr/js/schema.js +++ b/structr-ui/src/main/resources/structr/js/schema.js @@ -376,6 +376,7 @@ var _Schema = { canvas.css('transform', _Schema.getSchemaCSSTransform()); }; + inheritanceSlideoutOpen = false; $('#inheritanceTab').on('click', function() { if ($(this).hasClass('noclick')) { $(this).removeClass('noclick');
correctly set state of inheritance tree slideout before the schema section is loaded (switching between sections could otherwise show an inconsistent ui)
structr_structr
train
js
ddf57574831447501e8682a445fc7aee4138ce90
diff --git a/core/pog/src/main/java/org/overture/pog/obligation/SubTypeObligation.java b/core/pog/src/main/java/org/overture/pog/obligation/SubTypeObligation.java index <HASH>..<HASH> 100644 --- a/core/pog/src/main/java/org/overture/pog/obligation/SubTypeObligation.java +++ b/core/pog/src/main/java/org/overture/pog/obligation/SubTypeObligation.java @@ -191,7 +191,7 @@ public class SubTypeObligation extends ProofObligation } - private SubTypeObligation(PExp exp, PType etype, PType atype, + public SubTypeObligation(PExp exp, PType etype, PType atype, IPOContextStack ctxt) { super(exp, POType.SUB_TYPE, ctxt, exp.getLocation());
changed visibility to allow compass pog to compile
overturetool_overture
train
java
f2548a166989322f583dbd8001b516f3b5dc018c
diff --git a/website/test/e2e/navigation_spec.js b/website/test/e2e/navigation_spec.js index <HASH>..<HASH> 100644 --- a/website/test/e2e/navigation_spec.js +++ b/website/test/e2e/navigation_spec.js @@ -35,7 +35,7 @@ describe('Navigation', function() { 'Tutorial' ]); }); - + it('should have items under Protractor Setup', function() { expect(menu.dropdown('Protractor Setup').itemNames()).toEqual([ 'Setting Up Protractor', @@ -59,7 +59,7 @@ describe('Navigation', function() { it('should have items under Reference', function() { expect(menu.dropdown('Reference').itemNames()).toEqual([ - 'Configuration File Reference', + 'Configuration File', 'Protractor API', 'Style Guide', 'Protractor Syntax vs WebDriverJS Syntax', @@ -81,7 +81,7 @@ describe('Navigation', function() { expect($('h1').getText()).toBe('Setting Up Protractor'); }); - + it('should go to Setting Up the Selenium Server', function() { menu.dropdown('Protractor Setup').item('Setting Up the Selenium Server');
chore(website): update e2e tests for navigation
angular_protractor
train
js
9ee3cb1c832b96181300ac66ba7b652352343e4f
diff --git a/lang/de.php b/lang/de.php index <HASH>..<HASH> 100644 --- a/lang/de.php +++ b/lang/de.php @@ -62,7 +62,7 @@ $translations = array( 'General_DisplayMoreData'=>'Mehr Daten anzeigen', 'General_PiwikIsACollaborativeProjectYouCanContribute'=>'%s Piwik %s ist ein gemeinschaftliches Projekt. %s Wenn Ihnen Piwik gefällt, können Sie helfen! Möchten Sie herausfinden %s wie Sie zu Piwik beitragen können?%s ', 'General_YouAreCurrentlyViewingDemoOfPiwik'=>'Zur Zeit betrachten Sie die Demo von%s; %sLaden Sie%s die Vollversion herunter! Besuchen Sie %s', -'General_PiwikXIsAvailablePleaseUpdateNow'=>'Piwik %s ist verfügbar. %s Bitte jetzt ein Update machen!%s (siehe %s Änderung%en).', +'General_PiwikXIsAvailablePleaseUpdateNow'=>'Piwik %s ist verfügbar. %s Bitte jetzt ein Update machen!%s (siehe %s Änderungen%s).', 'General_BackToPiwik'=>'Zurück zu Piwik', 'General_ShortMonth_1'=>'Jan', 'General_ShortMonth_2'=>'Feb',
fixes #<I> - update German translation (forwarded a copy of the patch to translations (at) piwik.org git-svn-id: <URL>
matomo-org_matomo
train
php
fe1283c1ca357b44d74d4cb4efe76868554d53cd
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/undoStack.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/undoStack.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/undoStack.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/undoStack.js @@ -266,7 +266,7 @@ define("orion/editor/undoStack", [], function() { //$NON-NLS-0$ * @see orion.editor.UndoStack#markClean */ isClean: function() { - return this.cleanIndex === this.index && this._unsavedChanges.length === 0; + return this.cleanIndex === this.getSize().undo && this._unsavedChanges.length === 0; }, /** * Returns true if there is at least one change to undo.
Bug <I> - File save operation should support sending file diffs
eclipse_orion.client
train
js
d5e920773ca0558d154a559e6df996ad0527b616
diff --git a/app/models/thredded/topic.rb b/app/models/thredded/topic.rb index <HASH>..<HASH> 100644 --- a/app/models/thredded/topic.rb +++ b/app/models/thredded/topic.rb @@ -6,6 +6,11 @@ module Thredded scope :for_messageboard, -> messageboard { where(messageboard_id: messageboard.id) } + scope :stuck, -> { where(sticky: true) } + scope :unstuck, -> { where(sticky: false) } + + scope :search, -> query { ::Thredded::TopicsSearch.new(query, self).search } + scope :order_sticky_first, -> { order(sticky: :desc) } extend FriendlyId @@ -36,19 +41,6 @@ module Thredded has_many :categories, through: :topic_categories has_many :user_topic_reads, dependent: :destroy - def self.stuck - where(sticky: true) - end - - def self.unstuck - where(sticky: false) - end - - # @return [ActiveRecord::Relation<Topic>] - def self.search(query) - ::Thredded::TopicsSearch.new(query, self).search - end - def self.find_by_slug_with_user_topic_reads!(slug) includes(:user_topic_reads).friendly.find(slug) rescue ActiveRecord::RecordNotFound
Convert topic.rb Relation class methods to scopes Idiomatic Rails
thredded_thredded
train
rb
1c66807b0b5f5b58bb289b3f7f94796b6c720f95
diff --git a/poetry/__version__.py b/poetry/__version__.py index <HASH>..<HASH> 100644 --- a/poetry/__version__.py +++ b/poetry/__version__.py @@ -1 +1 @@ -__version__ = '0.8.3' +__version__ = '0.8.4a0'
Update version number in __version__
sdispater_poetry
train
py
8ec3e1f20cb86982d99550c003793d86be112df8
diff --git a/src/sap.m/src/sap/m/MenuButton.js b/src/sap.m/src/sap/m/MenuButton.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/MenuButton.js +++ b/src/sap.m/src/sap/m/MenuButton.js @@ -88,13 +88,13 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control', './Butto * Controls whether the default action handler is invoked always or it is invoked only until a menu item is selected. * Usable only if <code>buttonMode</code> is set to <code>Split</code>. */ - useDefaultActionOnly : { type : "Boolean", group : "Behavior", defaultValue: false } + useDefaultActionOnly : { type : "boolean", group : "Behavior", defaultValue: false } }, aggregations: { /** * Defines the menu that opens for this button. */ - menu: { type: "sap.m.Menu", multiple: false, singularName: "menu", bindable: "bindable" }, + menu: { type: "sap.m.Menu", multiple: false, singularName: "menu" }, /** * Internal aggregation that contains the button part.
[INTERNAL] m.MenuButton: fix class metadata 'Boolean' is not a valid property type, the correct type is 'boolean'. Furthermore, data binding is not supported for aggregations of cardinality <I> (multiple: false), therefore "bindable" does not make sense (method bindMenu() already should have logged an error). Change-Id: I4ce<I>fbc<I>b<I>ad9de4cfb<I>be
SAP_openui5
train
js
8a6b14c69ad02a4fc167aee60ff94b11a399618c
diff --git a/framework/core/js/src/forum/components/ReplyPlaceholder.js b/framework/core/js/src/forum/components/ReplyPlaceholder.js index <HASH>..<HASH> 100644 --- a/framework/core/js/src/forum/components/ReplyPlaceholder.js +++ b/framework/core/js/src/forum/components/ReplyPlaceholder.js @@ -5,6 +5,7 @@ import avatar from '../../common/helpers/avatar'; import username from '../../common/helpers/username'; import DiscussionControls from '../utils/DiscussionControls'; import ComposerPostPreview from './ComposerPostPreview'; +import listItems from '../../common/helpers/listItems'; /** * The `ReplyPlaceholder` component displays a placeholder for a reply, which, @@ -25,6 +26,7 @@ export default class ReplyPlaceholder extends Component { {avatar(app.session.user, { className: 'PostUser-avatar' })} {username(app.session.user)} </h3> + <ul className="PostUser-badges badges">{listItems(app.session.user.badges().toArray())}</ul> </div> </header> <ComposerPostPreview className="Post-body" composer={app.composer} surround={this.anchorPreview.bind(this)} />
Add user badges to post preview #<I> (#<I>)
flarum_core
train
js
f0d3f0e3ee21e874f2d0b1277164f2f10ac212c1
diff --git a/bot.go b/bot.go index <HASH>..<HASH> 100644 --- a/bot.go +++ b/bot.go @@ -79,7 +79,7 @@ func NewIrcBot(user, nick, password, server, port string, channels []string) *Ir //defautl actions, needed to run proprely bot.AddInternAction(&pong{}) bot.AddInternAction(&validConnect{}) - bot.AddInternAction(&Help{}) + bot.AddUserAction(&Help{}) //init database if err := bot.db.open("irc.db"); err != nil {
.ping is a command fire by user we need to register using AddUserAction
zaibon_ircbot
train
go
6ced501b0e28cfc526065215529cdc9f251e6d2c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,6 @@ setup( 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8',
drop support for python <I> python <I> has EOL'd, so let's not support it any more.
tych0_xcffib
train
py
c9603288c072ebff4ca0abf001d66ae41ff0d744
diff --git a/spikeextractors/tests/test_extractors.py b/spikeextractors/tests/test_extractors.py index <HASH>..<HASH> 100644 --- a/spikeextractors/tests/test_extractors.py +++ b/spikeextractors/tests/test_extractors.py @@ -309,14 +309,6 @@ class TestExtractors(unittest.TestCase): check_recordings_equal(self.RX, RX_biocam) check_dumping(RX_biocam) - def test_maxone_extractors(self): - path1 = self.test_dir + '/raw.h5' - se.MaxOneRecordingExtractor.write_recording(self.RX, path1) - RX_mea1k = se.MaxOneRecordingExtractor(path1) - check_recording_return_types(RX_mea1k) - check_recordings_equal(self.RX, RX_mea1k) - check_dumping(RX_mea1k) - def test_mearec_extractors(self): path1 = self.test_dir + '/raw.h5' se.MEArecRecordingExtractor.write_recording(self.RX, path1)
Remove tests for mea1k/maxone
SpikeInterface_spikeextractors
train
py
adcfa4b29ec994b3685ce1223095a3044cc81d1e
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index <HASH>..<HASH> 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -36,6 +36,7 @@ def mkbuildcontext(dockerfile): 'Dockerfiles with Python 3') else: dfinfo.size = len(dockerfile.getvalue()) + dockerfile.seek(0) elif isinstance(dockerfile, io.BytesIO): dfinfo = tarfile.TarInfo('Dockerfile') dfinfo.size = len(dockerfile.getvalue())
Should be done for StringIO objects as well
docker_docker-py
train
py
bdda1120a7aa15fa64676e3ffcc95adbd4ca282a
diff --git a/puzzle/plugins/gemini/gemini_plugin.py b/puzzle/plugins/gemini/gemini_plugin.py index <HASH>..<HASH> 100644 --- a/puzzle/plugins/gemini/gemini_plugin.py +++ b/puzzle/plugins/gemini/gemini_plugin.py @@ -29,7 +29,7 @@ class GeminiPlugin(CaseMixin, VariantMixin, Plugin): self.individuals = self._get_individuals() self.case_objs = self._get_cases(self.individuals) - self.mode = app.config['PUZZLE_MODE'] + self.mode = app.config.get('PUZZLE_MODE', 'snv') logger.info("Setting mode to {0}".format(self.mode)) logger.debug("Setting can_filter_gene to 'True'")
Fixed problem with test when 'PUZZLE_MODE' did not exist in app
robinandeer_puzzle
train
py