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
1c58d66191e3cd0f430958e314dfbd5b3817d109
diff --git a/controller/DeliveryServer.php b/controller/DeliveryServer.php index <HASH>..<HASH> 100755 --- a/controller/DeliveryServer.php +++ b/controller/DeliveryServer.php @@ -374,7 +374,7 @@ class DeliveryServer extends \tao_actions_CommonModule */ protected function getDeliveryServer() { - return $this->getServiceLocator()->get(DeliveryServerService::SERVICE_ID); + return $this->service = $this->getServiceLocator()->get(DeliveryServerService::SERVICE_ID); } /**
Use service variable for backward compatibility
oat-sa_extension-tao-delivery
train
php
7ce0fb7c6347c51bccb626524c53f7b635f2586a
diff --git a/djstripe/models/webhooks.py b/djstripe/models/webhooks.py index <HASH>..<HASH> 100644 --- a/djstripe/models/webhooks.py +++ b/djstripe/models/webhooks.py @@ -23,6 +23,7 @@ from .core import Event class WebhookEndpoint(StripeModel): stripe_class = stripe.WebhookEndpoint + stripe_dashboard_item_name = "webhooks" api_version = models.CharField( max_length=10,
Add missing WebhookEndpoint.stripe_dashboard_item_name
dj-stripe_dj-stripe
train
py
3bbc78a3b4b11ffdba0f500729a59b396176f580
diff --git a/library/CM/FormField/Suggest.js b/library/CM/FormField/Suggest.js index <HASH>..<HASH> 100644 --- a/library/CM/FormField/Suggest.js +++ b/library/CM/FormField/Suggest.js @@ -85,7 +85,7 @@ var CM_FormField_Suggest = CM_FormField_Abstract.extend({ field.trigger('open'); }); - this._$input.on('close', function() { + this._$input.on('select2-close', function() { field.trigger('close'); });
Updated 'close' event with 'select2-close'
cargomedia_cm
train
js
1ffee54245276fea61d06a6a2ea197b1ab836c39
diff --git a/tests/config_test.py b/tests/config_test.py index <HASH>..<HASH> 100644 --- a/tests/config_test.py +++ b/tests/config_test.py @@ -1,11 +1,8 @@ # coding=utf-8 from ladybug.config import folders -import pytest - def test_config_init(): """Test the initialization of the config module and basic properties.""" assert hasattr(folders, 'default_epw_folder') assert isinstance(folders.default_epw_folder, str) - \ No newline at end of file
style(config_test): remove unused import This PR is mainly for testing the CLA set-up. Let's see if it works as expected.
ladybug-tools_ladybug
train
py
7a4f66ed15a6c6e39a2067c1ede06d7d8d28550d
diff --git a/cldoc/inspecttree.py b/cldoc/inspecttree.py index <HASH>..<HASH> 100644 --- a/cldoc/inspecttree.py +++ b/cldoc/inspecttree.py @@ -110,6 +110,7 @@ def inspect(tree): print """<html> <head> +<meta name="Content-Type" content="text/html; charset=utf-8" /> <style type='text/css'> div.filename { padding: 3px;
Added utf8 to inspect output
jessevdk_cldoc
train
py
8dff8fbe9cc3c6e9b6d8a3b14d9e6f470cd6b1b9
diff --git a/lib/Doctrine/ODM/CouchDB/DocumentRepository.php b/lib/Doctrine/ODM/CouchDB/DocumentRepository.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/CouchDB/DocumentRepository.php +++ b/lib/Doctrine/ODM/CouchDB/DocumentRepository.php @@ -80,13 +80,13 @@ class DocumentRepository implements ObjectRepository */ public function find($id) { - $uow = $this->dm->getUnitOfWork(); $response = $this->dm->getCouchDBClient()->findDocument($id); if ($response->status == 404) { return null; } + $uow = $this->dm->getUnitOfWork(); $hints = array(); return $uow->createDocument($this->documentName, $response->body, $hints); }
find($id) only retrieves the unit of work when it's used.
doctrine_couchdb-odm
train
php
ba0cedcb990af16bf22dc80830145abfb49d5d5c
diff --git a/src/ValidationTrait.php b/src/ValidationTrait.php index <HASH>..<HASH> 100644 --- a/src/ValidationTrait.php +++ b/src/ValidationTrait.php @@ -226,6 +226,7 @@ trait ValidationTrait // 字段值过滤 if ($filters) { $value = $this->valueFiltering($value, $filters); + $this->data[$field] = $value; } // 字段值验证检查
bug fixed: save value to data on filtered
inhere_php-validate
train
php
f72a8629234886d78c39f0405cedbe816c5eeb26
diff --git a/start.go b/start.go index <HASH>..<HASH> 100644 --- a/start.go +++ b/start.go @@ -85,11 +85,11 @@ func loadStartConfig(context *cli.Context) (*startConfig, error) { } } - ocffile := context.String("config-file") - runtimefile := context.String("runtime-file") + ocffile := path.Join(config.BundlePath, "config.json") + runtimefile := path.Join(config.BundlePath, "runtime.json") if _, err = os.Stat(ocffile); os.IsNotExist(err) { - fmt.Printf("Please specify ocffile or put config.json under current working directory\n") + fmt.Printf("Please make sure bundle directory contains config.json\n") return nil, err } @@ -130,16 +130,6 @@ var startCommand = cli.Command{ Usage: "create and run a container", Flags: []cli.Flag{ cli.StringFlag{ - Name: "config-file, c", - Value: "config.json", - Usage: "path to spec config file", - }, - cli.StringFlag{ - Name: "runtime-file, r", - Value: "runtime.json", - Usage: "path to runtime config file", - }, - cli.StringFlag{ Name: "bundle, b", Value: getDefaultBundlePath(), Usage: "path to the root of the bundle directory",
remove runtime and config flags find them through bundle path
hyperhq_runv
train
go
858f1e546562ecfcc68132b00d1387673481ce76
diff --git a/tests/lax_test.py b/tests/lax_test.py index <HASH>..<HASH> 100644 --- a/tests/lax_test.py +++ b/tests/lax_test.py @@ -26,6 +26,7 @@ import numpy as onp import jax from jax import api +from jax import core from jax import dtypes from jax import lax from jax import test_util as jtu
add missing core import in lax_test
tensorflow_probability
train
py
338f87d837fc61d130f45b84cd74b5c51f54e088
diff --git a/lxd/instance/instance_utils.go b/lxd/instance/instance_utils.go index <HASH>..<HASH> 100644 --- a/lxd/instance/instance_utils.go +++ b/lxd/instance/instance_utils.go @@ -919,7 +919,7 @@ func ValidName(instanceName string, isSnapshot bool) error { // CreateInternal creates an instance record and storage volume record in the database and sets up devices. // Accepts a reverter that revert steps this function does will be added to. It is up to the caller to call the // revert's Fail() or Success() function as needed. -func CreateInternal(s *state.State, args db.InstanceArgs, revert *revert.Reverter) (Instance, error) { +func CreateInternal(s *state.State, args db.InstanceArgs, clearLogDir bool, revert *revert.Reverter) (Instance, error) { // Check instance type requested is supported by this machine. if _, supported := s.InstanceTypes[args.Type]; !supported { return nil, fmt.Errorf("Instance type %q is not supported on this server", args.Type) @@ -1120,7 +1120,9 @@ func CreateInternal(s *state.State, args db.InstanceArgs, revert *revert.Reverte } // Wipe any existing log for this instance name. - os.RemoveAll(inst.LogPath()) + if clearLogDir { + os.RemoveAll(inst.LogPath()) + } return inst, nil }
lxd/instance/instance/utils: Adds cleanLogDir bool argument to CreateInternal This makes cleaning the log directory optional, as we don't want to do this when recovering instances.
lxc_lxd
train
go
ab066b1985108f4582194f0a71a73854e979de5b
diff --git a/lib/database_cleaner/active_record/base.rb b/lib/database_cleaner/active_record/base.rb index <HASH>..<HASH> 100644 --- a/lib/database_cleaner/active_record/base.rb +++ b/lib/database_cleaner/active_record/base.rb @@ -8,7 +8,7 @@ module DatabaseCleaner def self.available_strategies %w[truncation transaction deletion] end - + def self.config_file_location=(path) @config_file_location = path end @@ -32,9 +32,9 @@ module DatabaseCleaner end def load_config - if File.file?(ActiveRecord.config_file_location) + if self.db != :default && File.file?(ActiveRecord.config_file_location) connection_details = YAML::load(ERB.new(IO.read(ActiveRecord.config_file_location)).result) - self.connection_hash = connection_details[self.db.to_s] + @connection_hash = connection_details[self.db.to_s] end end
prevents loading 'default' DB in AR to guard against odd error messages #<I>
DatabaseCleaner_database_cleaner
train
rb
e36cc3c76e0ac0a6f260a358312ba669c621d60e
diff --git a/DataFixtures/ORM/LoadCurrencyData.php b/DataFixtures/ORM/LoadCurrencyData.php index <HASH>..<HASH> 100644 --- a/DataFixtures/ORM/LoadCurrencyData.php +++ b/DataFixtures/ORM/LoadCurrencyData.php @@ -30,6 +30,10 @@ class LoadCurrencyData extends AbstractDataFixture */ public function load(ObjectManager $manager) { + if (!$this->isEnabled()) { + return; + } + foreach (self::$samples as $name) { $currency = new Currency(); $currency->setCode($name);
Added enabled option to fixtures (cherry picked from commit <I>b<I>ca4a<I>eb<I>d<I>a<I>a<I>fa<I>c2ef7)
WellCommerce_WishlistBundle
train
php
8d22f2930ec6c4a0850ef90c5b095d803af62691
diff --git a/gns3server/utils/picture.py b/gns3server/utils/picture.py index <HASH>..<HASH> 100644 --- a/gns3server/utils/picture.py +++ b/gns3server/utils/picture.py @@ -99,8 +99,8 @@ def get_size(data, default_width=0, default_height=0): root = tree.getroot() try: - width = _svg_convert_size(root.attrib.get("width", 0)) - height = _svg_convert_size(root.attrib.get("height", 0)) + width = _svg_convert_size(root.attrib.get("width", "0")) + height = _svg_convert_size(root.attrib.get("height", "0")) except IndexError: raise ValueError("Invalid SVG file")
Fix a crash with missing size in the svg files Fix #<I>
GNS3_gns3-server
train
py
8c7b728afdb0e4ae7f5d1d0531ffd4f19f9084a5
diff --git a/lib/scsocket.js b/lib/scsocket.js index <HASH>..<HASH> 100644 --- a/lib/scsocket.js +++ b/lib/scsocket.js @@ -296,10 +296,10 @@ SCSocket.prototype.disconnect = function (code, data) { data: data }; this.transport.emit('#disconnect', packet); - this.transport.close(code); + this.transport.close(code, data); } else if (this.state == this.CONNECTING) { - this.transport.close(code); + this.transport.close(code, data); } else { this.pendingReconnect = false; this.pendingReconnectTimeout = null;
When disconnecting, pass the data/reason as part of the close
SocketCluster_socketcluster-client
train
js
7534d9a11e0ff51fa32ea431942c32c44e1d2ff2
diff --git a/amaascore/market_data/interface.py b/amaascore/market_data/interface.py index <HASH>..<HASH> 100644 --- a/amaascore/market_data/interface.py +++ b/amaascore/market_data/interface.py @@ -37,10 +37,15 @@ class MarketDataInterface(Interface): self.logger.error(response.text) response.raise_for_status() - def retrieve_eod_prices(self, asset_manager_id, business_date, asset_ids=None): + + def retrieve_eod_prices(self, asset_manager_id, business_date, asset_ids=None, last_available=False): self.logger.info('Retrieve EOD Prices - Asset Manager: %s - Business Date: %s', asset_manager_id, business_date) url = '%s/eod-prices/%s/%s' % (self.endpoint, asset_manager_id, business_date.isoformat()) params = {'asset_ids': ','.join(asset_ids)} if asset_ids else {} + # setting last_available to True will return the latest price of the asset as of business + # date (or latest prior price if price found on the date) + if last_available: + params.update({'last_available':True}) response = self.session.get(url=url, params=params) if response.ok: eod_prices = [json_to_eod_price(eod_price) for eod_price in response.json()]
added last_available to sdk to retrieve eod price
amaas-fintech_amaas-core-sdk-python
train
py
84d0f66b05319c9080420531bd2a656038db7296
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 @@ -5,6 +5,15 @@ require "bundler/setup" require 'rspec' require 'capybara' + +RSpec.configure do |config| + config.before do + Capybara.configure do |config| + config.default_selector = :xpath + end + end +end + require 'capybara/spec/driver' require 'capybara/spec/session' @@ -15,12 +24,4 @@ Capybara.default_wait_time = 0 # less timeout so tests run faster module TestSessions RackTest = Capybara::Session.new(:rack_test, TestApp) Selenium = Capybara::Session.new(:selenium, TestApp) -end - -RSpec.configure do |config| - config.before do - Capybara.configure do |config| - config.default_selector = :xpath - end - end -end +end \ No newline at end of file
There is a deprecation warning about rspec 3 that says that no configuration option should be set after defining a group of specs. This commit fix the issue by moving the setting of options to a position before the specs are required loaded.
teamcapybara_capybara
train
rb
262b3d792954aa8676da33470e43c7146833a453
diff --git a/src/Domains/Resource/Field/FieldFlags.php b/src/Domains/Resource/Field/FieldFlags.php index <HASH>..<HASH> 100644 --- a/src/Domains/Resource/Field/FieldFlags.php +++ b/src/Domains/Resource/Field/FieldFlags.php @@ -30,7 +30,7 @@ trait FieldFlags public function isHidden(): bool { - return $this->hasFlag('hidden'); + return (bool) $this->hasFlag('hidden'); } public function isUnique()
Fix bug: false when null makes the field required
superv_platform
train
php
6a1bf2756be068fa031fdc952ee38d442027439a
diff --git a/bindings/angular1/directives/carousel.js b/bindings/angular1/directives/carousel.js index <HASH>..<HASH> 100755 --- a/bindings/angular1/directives/carousel.js +++ b/bindings/angular1/directives/carousel.js @@ -138,10 +138,6 @@ element = null; }); - setImmediate(function() { - carousel.refresh(); - }); - $onsen.fireComponentEvent(element[0], 'init'); }; },
fix(ons-carousel): Fix a size issue with navigator in angular.
OnsenUI_OnsenUI
train
js
9e903080e1b4059887744c5f689c976174fde6c5
diff --git a/algorithms.js b/algorithms.js index <HASH>..<HASH> 100644 --- a/algorithms.js +++ b/algorithms.js @@ -141,6 +141,9 @@ function toArray (span, root) { exports.path = function (opts) { var reverse = {} + if(opts.source == opts.dest) + return [opts.source] + opts.start = opts.source opts.live = opts.live !== true opts.each = function (f, t, h) {
handle case where source and dest are the same
ssbc_graphreduce
train
js
a3d00ddd70968165cf5eae5f1a3fa600ece1082c
diff --git a/account-management-app/src/main/java/org/duracloud/account/app/controller/AccountGroupsController.java b/account-management-app/src/main/java/org/duracloud/account/app/controller/AccountGroupsController.java index <HASH>..<HASH> 100644 --- a/account-management-app/src/main/java/org/duracloud/account/app/controller/AccountGroupsController.java +++ b/account-management-app/src/main/java/org/duracloud/account/app/controller/AccountGroupsController.java @@ -320,6 +320,7 @@ public class AccountGroupsController extends AbstractAccountController { private void addGroupsObjectsToModel(AccountService as, List<DuracloudGroup> groups, Model model) throws Exception { addUserToModel(model); + model.addAttribute(ACCOUNT_INFO_KEY, as.retrieveAccountInfo()); model.addAttribute("accountId", as.getAccountId()); if (!model.asMap().containsKey(GROUPS_FORM_KEY)) { model.addAttribute(GROUPS_FORM_KEY, new GroupsForm());
Fixes issue #<I> of the MC <I> release: account name visible throughout groups editor.
duracloud_management-console
train
java
375b0ea433cfc4c0e36c2c5f12ec2524a3aeb784
diff --git a/lib/es6-promise/-internal.js b/lib/es6-promise/-internal.js index <HASH>..<HASH> 100644 --- a/lib/es6-promise/-internal.js +++ b/lib/es6-promise/-internal.js @@ -10,7 +10,7 @@ import { import originalThen from './then'; import originalResolve from './promise/resolve'; -export const PROMISE_ID = Math.random().toString(36).substring(16); +export const PROMISE_ID = Math.random().toString(36).substring(2); function noop() {}
[fixes #<I>] make sure PROMISE_ID actually works
stefanpenner_es6-promise
train
js
9005f68a02235209dda5e26c0e46a25a280db951
diff --git a/nhash/nhash.go b/nhash/nhash.go index <HASH>..<HASH> 100644 --- a/nhash/nhash.go +++ b/nhash/nhash.go @@ -1,12 +1,18 @@ // Copyright © 2014 Lawrence E. Bakst. All rights reserved. +// This package contains a new set of interfacs for hash functions. +// It also implements the Go streaming hash interface as HashStream. +// It is an experiment. + package nhash import ( "io" ) -// Minimum information for a hash function +// Interface HashFunction requires 4 methods that return the +// size of the hasg function in bytes and bits. Probably wiil +// flush bits. Also the maximum number of bytes of seed needed. type HashFunction interface { // Size returns the number of bytes Sum will return. Size() int @@ -75,5 +81,6 @@ type HashGeneric interface { HashFunction // Hash takes "in" bytes of input, the hash is returned into byte slice "out" + // change seeds to bytes ??? Hash(in []byte, out []byte, seeds ...uint64) []byte }
updated some comments in nhash, need to remove HashSizeInBits
tildeleb_hashland
train
go
b308dbdca39ff2e09d94acc9fd42b0cfd97c1e12
diff --git a/electron.js b/electron.js index <HASH>..<HASH> 100644 --- a/electron.js +++ b/electron.js @@ -2,6 +2,9 @@ /* eslint-env node */ 'use strict'; +const updater = require('electron-simple-updater'); +updater.init('http://hospitalrun.io/releases/updates.js'); + const electron = require('electron'); const path = require('path'); const { app, BrowserWindow } = electron; @@ -28,8 +31,8 @@ app.on('window-all-closed', function onWindowAllClosed() { app.on('ready', function onReady() { mainWindow = new BrowserWindow({ - width: 800, - height: 600 + width: 1000, + height: 750 }); delete mainWindow.module;
resize the window and look to the website for an update file.
HospitalRun_hospitalrun-frontend
train
js
d5eb3d203ad97dc3c280486caec9781fa7177ac3
diff --git a/apiserver/facades/client/bundle/bundle_test.go b/apiserver/facades/client/bundle/bundle_test.go index <HASH>..<HASH> 100644 --- a/apiserver/facades/client/bundle/bundle_test.go +++ b/apiserver/facades/client/bundle/bundle_test.go @@ -1172,15 +1172,18 @@ func (s *bundleSuite) addApplicationToModel(model description.Model, name string series = "kubernetes" } var charmURL string + var channel string if strings.HasPrefix(name, "ch:") { charmURL = name name = name[3:] + channel = "stable" } else { charmURL = "cs:" + name } application := model.AddApplication(description.ApplicationArgs{ Tag: names.NewApplicationTag(name), CharmURL: charmURL, + Channel: channel, Series: series, CharmConfig: map[string]interface{}{}, LeadershipSettings: map[string]interface{}{}, @@ -1907,11 +1910,13 @@ series: xenial applications: mysql: charm: mysql + channel: stable num_units: 1 to: - "0" wordpress: charm: wordpress + channel: stable num_units: 2 to: - "0"
Ensure that the tests mimic real life The channel is saved in the database and will be exported correctly, the problem is the tests didn't mirror that. It does now.
juju_juju
train
go
21a23409514bff8c0bc687420cc9b6d3e882747e
diff --git a/spyderlib/widgets/sourcecode/base.py b/spyderlib/widgets/sourcecode/base.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/sourcecode/base.py +++ b/spyderlib/widgets/sourcecode/base.py @@ -449,7 +449,9 @@ class TextEditBaseWidget(QPlainTextEdit, BaseEditMixin): # of unicode chars on them (like the one attached on # Issue 1546) if os.name == 'nt' and PY3: - return self.get_text('sof', 'eof') + text = self.get_text('sof', 'eof') + return text.replace('\u2028', '\n').replace('\u2029', '\n')\ + .replace('\u0085', '\n') else: return super(TextEditBaseWidget, self).toPlainText() @@ -1252,4 +1254,3 @@ class ConsoleBaseWidget(TextEditBaseWidget): light_background=self.light_background, is_default=style is self.default_style) self.ansi_handler.set_base_format(self.default_style.format) -
Editor: Replace unicode line endings with unix ones in our version of toPlainText - This makes converting IPython notebooks work on Python 3 and Windows
spyder-ide_spyder
train
py
0f2850f6c558a2d7a2d2b3699d053796d7c9b567
diff --git a/holoviews/plotting/bokeh/path.py b/holoviews/plotting/bokeh/path.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/bokeh/path.py +++ b/holoviews/plotting/bokeh/path.py @@ -60,7 +60,7 @@ class PolygonPlot(PathPlot): if self.batched: dims = self.hmap.last.kdims else: - dims = self.overlay_dims.keys() + dims = list(self.overlay_dims.keys()) dims += element.vdims tooltips = [(d.pprint_label, '@'+util.dimension_sanitizer(d.name)) for d in dims]
Fixed small python3 bug in bokeh PathPlot tool setup
pyviz_holoviews
train
py
0d5944c99c807fb9999592866ae2d8a0cbd1bb74
diff --git a/index.es6.js b/index.es6.js index <HASH>..<HASH> 100644 --- a/index.es6.js +++ b/index.es6.js @@ -119,6 +119,7 @@ class Client { } if(object.nextSyncToken){ object.sync_token = object.nextSyncToken; + delete object.initial; delete object.nextSyncToken; } const query = new Query(object);
Prevent initial to be sent together with nextSyncToken
contentful_contentful.js
train
js
bc04d2d26c218d1b2b223b5a1c35cfcb29b0a006
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name = 'pylutron', - version = '0.2.2', + version = '0.2.4', license = 'MIT', description = 'Python library for Lutron RadioRA 2', author = 'Dima Zavin',
Update version for PyPi to <I> (had to skip <I>)
thecynic_pylutron
train
py
cb0dce6fc8ad1788989337bc953e138b2ee4a2dc
diff --git a/identify/extensions.py b/identify/extensions.py index <HASH>..<HASH> 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -1,6 +1,7 @@ EXTENSIONS = { 'adoc': {'text', 'asciidoc'}, 'ai': {'binary', 'adobe-illustrator'}, + 'aj': {'text', 'aspectj'}, 'asciidoc': {'text', 'asciidoc'}, 'apinotes': {'text', 'apinotes'}, 'asar': {'binary', 'asar'},
Add support for aspectj file extension.
chriskuehl_identify
train
py
5699378bddeadb52cf053df3107062ffd3fc080c
diff --git a/chef/lib/chef/daemon.rb b/chef/lib/chef/daemon.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/daemon.rb +++ b/chef/lib/chef/daemon.rb @@ -24,16 +24,6 @@ class Chef class Daemon class << self attr_accessor :name -=begin -def daemonize(name) - exit if fork - Process.setsid - exit if fork - $stdin.reopen("/dev/null") - $stdout.reopen("/tmp/log", "a") - $stderr.reopen($stdout) -end -=end def daemonize(name) @name = name
Remove some commented code Somehow I let this slip through, sorry.
chef_chef
train
rb
7b4d3e09d5c786ecad8c727213daa1de14d6da6d
diff --git a/lib/beggar/base.rb b/lib/beggar/base.rb index <HASH>..<HASH> 100644 --- a/lib/beggar/base.rb +++ b/lib/beggar/base.rb @@ -5,18 +5,12 @@ module Beggar end def progress - "#{days_progression}%" + "#{CurrentMonth.days_progression}%" end def worked_hours CurrentMonth.weekday_hours end - - private - - def days_progression - (CurrentMonth.weekdays_until_today * 100.0 / CurrentMonth.weekdays).round - end end end diff --git a/lib/beggar/current_month.rb b/lib/beggar/current_month.rb index <HASH>..<HASH> 100644 --- a/lib/beggar/current_month.rb +++ b/lib/beggar/current_month.rb @@ -13,6 +13,10 @@ module Beggar weekdays * 8.0 end + def days_progression + (weekdays_until_today * 100.0 / weekdays).round + end + private def weekdays_until(date)
Move days progression to CurrentMonth class
brtjkzl_beggar
train
rb,rb
6604b0ad29643fba367062051bb8ba7acf10b027
diff --git a/jmock/src/java/org/jmock/dynamic/CoreMock.java b/jmock/src/java/org/jmock/dynamic/CoreMock.java index <HASH>..<HASH> 100644 --- a/jmock/src/java/org/jmock/dynamic/CoreMock.java +++ b/jmock/src/java/org/jmock/dynamic/CoreMock.java @@ -41,11 +41,16 @@ public class CoreMock Invocation invocation = new Invocation(method, name, args); try { return invocationDispatcher.dispatch(invocation); - } catch (AssertionFailedError failure) { - if (failure instanceof DynamicMockError) - throw failure; + } + catch( DynamicMockError failure ) { + throw failure; + } + catch (AssertionFailedError failure) { + DynamicMockError mockFailure = + new DynamicMockError(invocation, invocationDispatcher, failure.getMessage()); - throw new DynamicMockError(invocation, invocationDispatcher, failure.getMessage()).fillInStackTrace(); + mockFailure.fillInStackTrace(); + throw mockFailure; } }
Replaced instanceof check with catch block
jmock-developers_jmock-library
train
java
b331a2d791b503561e3f39b22552f2c70a327481
diff --git a/centinel.py b/centinel.py index <HASH>..<HASH> 100755 --- a/centinel.py +++ b/centinel.py @@ -93,6 +93,6 @@ if __name__ == "__main__": if not os.path.exists(args.binary): print "Error: no binary found to daemonize" exit(1) - centinel.daemonize.daemonize(args.autoupdate, args.binary) + centinel.daemonize.daemonize(args.auto_update, args.binary) else: client.run()
bug fix- typo in variable name from daemonize
iclab_centinel
train
py
346d3f50939d3533a49ef161a0b9c8cca6eee809
diff --git a/lib/Context/Process.php b/lib/Context/Process.php index <HASH>..<HASH> 100644 --- a/lib/Context/Process.php +++ b/lib/Context/Process.php @@ -196,7 +196,9 @@ final class Process implements Context return $pid; } catch (\Throwable $exception) { - $this->process->kill(); + if ($this->isRunning()) { + $this->kill(); + } throw new ContextException("Starting the process failed", 0, $exception); } });
Check if process is running before killing on start-up failure (#<I>)
amphp_parallel
train
php
8eab47123ae6d4338159d8d74ad40061253259a1
diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -121,6 +121,9 @@ class Filters: web_page = create("WebPage", lambda _, m: m.web_page) """Filter messages sent with a webpage preview.""" + poll = create("Poll", lambda _, m: m.poll) + """Filter messages that contain :obj:`Poll <pyrogram.api.types.pyrogram.Poll>` objects.""" + private = create("Private", lambda _, m: bool(m.chat and m.chat.type == "private")) """Filter messages sent in private chats."""
Add Filters.poll to filter Poll messages
pyrogram_pyrogram
train
py
c341c0ebc4978ccdb75b22a1f2eec012b558980b
diff --git a/salt/grains/core.py b/salt/grains/core.py index <HASH>..<HASH> 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -776,7 +776,9 @@ def _linux_bin_exists(binary): ''' Does a binary exist in linux (depends on which) ''' - return __salt__['cmd.run']('which {0} > /dev/null; echo $?'.format(binary)) == '0' + return __salt__['cmd.retcode']( + 'which {0}'.format(binary) + ) == 0 def os_data():
Use cmd.retcode with _linux_bin_exists instead of cmd.run and echo $?
saltstack_salt
train
py
f2da3e8d9489be9631edf67230eed0d2a92edd6c
diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py index <HASH>..<HASH> 100644 --- a/charmhelpers/contrib/openstack/utils.py +++ b/charmhelpers/contrib/openstack/utils.py @@ -204,7 +204,7 @@ SWIFT_CODENAMES = OrderedDict([ ('stein', ['2.20.0', '2.21.0']), ('train', - ['2.22.0']), + ['2.22.0', '2.23.0']), ]) # >= Liberty version->codename mapping
Update swift versions for train (#<I>) Add <I> to the list of versions for Swift for OpenStack Train.
juju_charm-helpers
train
py
58642f004691d197eca2d563a6079fae8a43e6f8
diff --git a/lib/zendesk_apps_support/location.rb b/lib/zendesk_apps_support/location.rb index <HASH>..<HASH> 100644 --- a/lib/zendesk_apps_support/location.rb +++ b/lib/zendesk_apps_support/location.rb @@ -27,7 +27,8 @@ module ZendeskAppsSupport Location.new(id: 5, orderable: true, name: 'user_sidebar', product_code: Product::SUPPORT.code), Location.new(id: 6, orderable: true, name: 'organization_sidebar', product_code: Product::SUPPORT.code), Location.new(id: 7, orderable: false, name: 'background', product_code: Product::SUPPORT.code), - Location.new(id: 8, orderable: true, name: 'chat_sidebar', product_code: Product::CHAT.code) + Location.new(id: 8, orderable: true, name: 'chat_sidebar', product_code: Product::CHAT.code), + Location.new(id: 9, orderable: false, name: 'modal', product_code: Product::SUPPORT.code) ].freeze end end
add a modal location for signed URL support
zendesk_zendesk_apps_support
train
rb
c1e4bf0df7b640a7b02e04663e4d0bb3e8bdf1a4
diff --git a/isort/isort.py b/isort/isort.py index <HASH>..<HASH> 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -627,7 +627,7 @@ class SortImports(object): import_list.remove(key) import_string = ' '.join(import_list) import_string = import_string.replace("[[i]]", "_import") - return import_string + return import_string.replace("{ ", "{|").replace(" }", "|}") def _parse(self): """Parses a python file taking out and categorizing imports.""" @@ -696,7 +696,8 @@ class SortImports(object): from_import = parts[0].split(" ") import_string = " import ".join([from_import[0] + " " + "".join(from_import[1:])] + parts[1:]) - imports = self._strip_syntax(import_string).split() + imports = [item.replace("{|", "{ ").replace("|}", " }") for item in + self._strip_syntax(import_string).split()] if "as" in imports and (imports.index('as') + 1) < len(imports): while "as" in imports: index = imports.index('as')
Implement desired template variable support behaviour in accordince with test specification
timothycrosley_isort
train
py
8ab2cab1c4cad42b141d54bc5bc4d4d3c551d425
diff --git a/intake/source/cache.py b/intake/source/cache.py index <HASH>..<HASH> 100644 --- a/intake/source/cache.py +++ b/intake/source/cache.py @@ -384,10 +384,10 @@ class CompressedCache(BaseCache): self._ensure_cache_dir() self._urlpath = urlpath - files_in = open_files(urlpath, 'rb') + files_in = open_files(urlpath, 'rb', **self._storage_options) files_out = [open_files( [make_path_posix(os.path.join(d, os.path.basename(f.path)))], - 'wb', **self._storage_options)[0] + 'wb')[0] for f in files_in ] super(CompressedCache, self)._load(files_in, files_out, urlpath,
Storage options applied to wrong FS in compressed cache
intake_intake
train
py
acfb7902749a708bffe6ce7a170c424a9c17dcd6
diff --git a/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js b/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js index <HASH>..<HASH> 100644 --- a/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js +++ b/nunaliit2-js/src/main/js/nunaliit2/tuio/tuioclient.js @@ -2017,8 +2017,8 @@ if (lonlat) { return new OpenLayers.Geometry.Point(lonlat.lon, lonlat.lat); } - } else if (distance(first.x, first.y, last.x, last.y) <= pointDistance || - (poly = simplifyPolygon(this.positions)) != null) { + } else if ((poly = simplifyPolygon(this.positions)) != null || + distance(first.x, first.y, last.x, last.y) <= pointDistance) { // Start/end are close, or there is an intersection, create a polygon var points = (poly ? this.positionsToPoints(poly) : this.positionsToPoints(this.positions));
Prefer simplified polygons This avoids accepting meessy polygons with crossings where the end of the stroke happened to be near the beginning.
GCRC_nunaliit
train
js
cf170e9eb489680366d1608db8fd69d781ae65f5
diff --git a/thinc/loss.py b/thinc/loss.py index <HASH>..<HASH> 100644 --- a/thinc/loss.py +++ b/thinc/loss.py @@ -1,8 +1,15 @@ import numpy +try: + from cupy import get_array_module +except ImportError: + def get_array_module(*a, **k): + return numpy + def categorical_crossentropy(scores, labels): - target = numpy.zeros(scores.shape, dtype='float32') + xp = get_array_module(scores) + target = xp.zeros(scores.shape, dtype='float32') loss = 0. for i in range(len(labels)): target[i, int(labels[i])] = 1.
Use one-hot representation in categorical cross-entropy
explosion_thinc
train
py
ac23d79fe7e155506945666544abb7884388d7cd
diff --git a/framework/core/src/User/User.php b/framework/core/src/User/User.php index <HASH>..<HASH> 100644 --- a/framework/core/src/User/User.php +++ b/framework/core/src/User/User.php @@ -449,10 +449,10 @@ class User extends AbstractModel */ protected function getUnreadNotifications() { - static $cached = null; + static $cached = []; - if (is_null($cached)) { - $cached = $this->notifications() + if (! isset($cached[$this->id])) { + $cached[$this->id] = $this->notifications() ->whereIn('type', $this->getAlertableNotificationTypes()) ->whereNull('read_at') ->where('is_deleted', false) @@ -460,7 +460,7 @@ class User extends AbstractModel ->get(); } - return $cached; + return $cached[$this->id]; } /**
fix: unread notifications are globally cached between users. (#<I>)
flarum_core
train
php
dd6cce4c621228af6a0008f087ecac220ef33313
diff --git a/server/database/migrations.js b/server/database/migrations.js index <HASH>..<HASH> 100644 --- a/server/database/migrations.js +++ b/server/database/migrations.js @@ -145,7 +145,7 @@ module.exports = function(Database) { }); }); - return Promise.all([ renameColMigrations, changeColMigrations, addColMigrations/*, dropdownKeyMigration*/ ]); + return Promise.all([ renameColMigrations, changeColMigrations, addColMigrations, dropdownKeyMigration ]); } }); }; \ No newline at end of file
dropdownKeyMigration should not be waited for
FacilMap_facilmap2
train
js
36b6f17727589defa28101142009410c9c771289
diff --git a/_pytest/unittest.py b/_pytest/unittest.py index <HASH>..<HASH> 100644 --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -161,8 +161,8 @@ class TestCaseFunction(pytest.Function): if (getattr(self._testcase.__class__, "__unittest_skip__", False) or getattr(testMethod, "__unittest_skip__", False)): # If the class or method was skipped. - skip_why = (getattr(self._testcase.__class__, '__unittest_skip_why__', '') - or getattr(testMethod, '__unittest_skip_why__', '')) + skip_why = (getattr(self._testcase.__class__, '__unittest_skip_why__', '') or + getattr(testMethod, '__unittest_skip_why__', '')) try: self._testcase._addSkip(self, self._testcase, skip_why) except TypeError: # PY2
fixing code-style, keep flake8 happy
vmalloc_dessert
train
py
812cfe76a49baad021144b3591a0a043c6a53f76
diff --git a/parser.js b/parser.js index <HASH>..<HASH> 100644 --- a/parser.js +++ b/parser.js @@ -49,6 +49,8 @@ const iconRules = buildRuleset('icon', [ ]); const imageRules = buildRuleset('image', [ + ['meta[property="og:image:secure_url"]', node => node.element.content], + ['meta[property="og:image:url"]', node => node.element.content], ['meta[property="og:image"]', node => node.element.content], ['meta[property="twitter:image"]', node => node.element.content], ['meta[name="thumbnail"]', node => node.element.content],
Add support for Open Graph og:image:secure_url
mozilla_page-metadata-parser
train
js
a9163b547c7cfd4861c814371fa9d1a6bdb31231
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -153,6 +153,12 @@ class Object end end +class Struct + def as_json(options = nil) #:nodoc: + Hash[members.zip(values)] + end +end + class TrueClass AS_JSON = ActiveSupport::JSON::Variable.new('true').freeze def as_json(options = nil) AS_JSON end #:nodoc:
Complex struct encoding fix [#<I> state:committed]
rails_rails
train
rb
cd57c28b93bba5f062df6e047da9c393650ce15c
diff --git a/lib/knapsack_pro/config/ci/circle.rb b/lib/knapsack_pro/config/ci/circle.rb index <HASH>..<HASH> 100644 --- a/lib/knapsack_pro/config/ci/circle.rb +++ b/lib/knapsack_pro/config/ci/circle.rb @@ -23,6 +23,9 @@ module KnapsackPro end def project_dir + working_dir = ENV['CIRCLE_WORKING_DIRECTORY'] + return working_dir if working_dir + project_repo_name = ENV['CIRCLE_PROJECT_REPONAME'] "/home/ubuntu/#{project_repo_name}" if project_repo_name end
determine project dir for CircleCI based on CIRCLE_WORKING_DIRECTORY
KnapsackPro_knapsack_pro-ruby
train
rb
1ae62969d23b3002e240064a192391e7fdaab1fa
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -25,3 +25,9 @@ module.exports = function memoize( fn, delay ) { return fn.memoize[hash]; }; }; + +module.exports.withDelay = function spawn(delay) { + return function(fn) { + return memoize(fn, delay); + } +}
Added an extra function for convenience for creating a memoization function with a default delay
brainbytes_memoize-promise
train
js
6ceadcdb5c9b552f3f1c049aa219bcbff6be26b4
diff --git a/spacy/util.py b/spacy/util.py index <HASH>..<HASH> 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -494,7 +494,7 @@ def from_disk(path, readers, exclude): path = ensure_path(path) for key, reader in readers.items(): if key not in exclude: - reader(path / key) + reader(path2str(path / key)) return path
Make sure from_disk passes string to numpy (see #<I>) If path is a WindowsPath, numpy does not recognise it as a path and as a result, doesn't open the file. <URL>
explosion_spaCy
train
py
787811c040c7122b5530f8f4a7a53d9e2de5bf7f
diff --git a/cherrypy/_cpwsgiserver.py b/cherrypy/_cpwsgiserver.py index <HASH>..<HASH> 100644 --- a/cherrypy/_cpwsgiserver.py +++ b/cherrypy/_cpwsgiserver.py @@ -169,10 +169,8 @@ class WorkerThread(threading.Thread): request.write(line) except socket.error, e: errno = e.args[0] - if errno in socket_errors_to_ignore: - pass - else: - raise + if errno not in socket_errors_to_ignore: + traceback.print_exc() except (KeyboardInterrupt, SystemExit), exc: self.server.interrupt = exc except:
Fix for exhausted worker threads in wsgi server.
cherrypy_cheroot
train
py
c7d9d822c7521dbd3cac18ecff568a7a36ee5a67
diff --git a/cli/lib/kontena/cli/server/user.rb b/cli/lib/kontena/cli/server/user.rb index <HASH>..<HASH> 100644 --- a/cli/lib/kontena/cli/server/user.rb +++ b/cli/lib/kontena/cli/server/user.rb @@ -137,7 +137,9 @@ module Kontena::Cli::Server valid = true begin client.get('ping') # test server connection - rescue + rescue OpenSSL::SSL::SSLError => _ + raise 'Could not connect to server because of SSL problem. If you want to ignore SSL errors, set SSL_IGNORE_ERRORS=true environment variable' + rescue => exc valid = false end valid
show ssl error and possible workaround for user
kontena_kontena
train
rb
c19c4c60f4bd74a3ac91f3a05903a0cd2b5df749
diff --git a/lib/wavefile/reader.rb b/lib/wavefile/reader.rb index <HASH>..<HASH> 100644 --- a/lib/wavefile/reader.rb +++ b/lib/wavefile/reader.rb @@ -13,6 +13,16 @@ module WaveFile end end + def each_buffer(buffer_size) + begin + while true do + yield(read(buffer_size)) + end + rescue EOFError + close() + end + end + def read(buffer_size) samples = @file.sysread(buffer_size * @native_format.block_align).unpack(PACK_CODES[@native_format.bits_per_sample])
Adding Reader.each_buffer() method
jstrait_wavefile
train
rb
173db517b5f8002d630f815e2097a1858c27f8ef
diff --git a/reqctx/value.go b/reqctx/value.go index <HASH>..<HASH> 100644 --- a/reqctx/value.go +++ b/reqctx/value.go @@ -19,11 +19,13 @@ func (me contextValue) Get(ctx context.Context) interface{} { return ctx.Value(me.key) } +// Sets the value on the Request. It must not have been already set. func (me contextValue) SetRequestOnce(r *http.Request, val interface{}) *http.Request { assert.Nil(me.Get(r.Context())) return r.WithContext(context.WithValue(r.Context(), me.key, val)) } +// Returns a middleware that sets the value in the Request's Context. func (me contextValue) SetMiddleware(val interface{}) func(http.Handler) http.Handler { return func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
reqctx: Some comments
anacrolix_missinggo
train
go
a7ad15ed224220fb47a888a3e21c77397aa664d5
diff --git a/angr/analyses/disassembly.py b/angr/analyses/disassembly.py index <HASH>..<HASH> 100644 --- a/angr/analyses/disassembly.py +++ b/angr/analyses/disassembly.py @@ -310,7 +310,17 @@ class ConstantOperand(Operand): class RegisterOperand(Operand): - pass + + def _render(self, formatting): + custom_value_str = None + if formatting is not None: + try: custom_value_str = formatting['custom_values_str'][self.ident] + except KeyError: pass + + if custom_value_str: + return [custom_value_str] + else: + return super(RegisterOperand, self)._render(formatting) class MemoryOperand(Operand):
Disassembly: allow rendering register operands with custom values.
angr_angr
train
py
508d57c78ea3d7d010f20d30e981f703c28674ec
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ from __future__ import print_function from setuptools import setup, find_packages, Extension from Cython.Distutils import build_ext -import subprocess class Autogen(build_ext, object): def run(self, *args, **kwargs):
No need for subporcess
admesh_python-admesh
train
py
070dfada5751b40d7622998bf0cac0ea904c6dba
diff --git a/bokeh/core/_templates/autoload_nb_js.js b/bokeh/core/_templates/autoload_nb_js.js index <HASH>..<HASH> 100644 --- a/bokeh/core/_templates/autoload_nb_js.js +++ b/bokeh/core/_templates/autoload_nb_js.js @@ -24,7 +24,8 @@ function display_loaded() { if (window.Bokeh !== undefined) { - document.getElementById({{ elementid|json }}).textContent = "BokehJS successfully loaded."; + var el = document.getElementById({{ elementid|json }}); + el.textContent = "BokehJS " + Bokeh.version + " successfully loaded."; } else if (Date.now() < window._bokeh_timeout) { setTimeout(display_loaded, 100) }
Show bokehjs version in "successfully loaded" message (#<I>)
bokeh_bokeh
train
js
2ce1f8d558ca5e433e30777baba969ccd02d0b02
diff --git a/salt/key.py b/salt/key.py index <HASH>..<HASH> 100644 --- a/salt/key.py +++ b/salt/key.py @@ -24,7 +24,10 @@ class KeyCLI(object): ''' def __init__(self, opts): self.opts = opts - self.key = Key(opts) + if self.opts['transport'] == 'zeromq': + self.key = Key(opts) + else: + self.key = RaetKey(opts) def list_status(self, status): '''
Make salt-key work with raet keys
saltstack_salt
train
py
1414393e7c82f97b4c4e9c93e30688d2a9adbe17
diff --git a/lib/gretel.rb b/lib/gretel.rb index <HASH>..<HASH> 100644 --- a/lib/gretel.rb +++ b/lib/gretel.rb @@ -16,8 +16,8 @@ module Gretel # breadcrumbs set in engines. def breadcrumb_paths @breadcrumb_paths ||= begin - engines = Rails::Application::Railties.respond_to?(:engines) ? - Rails::Application::Railties.engines : + engines = Rails::Engine::Railties.respond_to?(:engines) ? + Rails::Engine::Railties.engines : Rails::Engine.subclasses.map(&:instance) engine_roots = engines.map { |e| e.config.root } @@ -79,4 +79,4 @@ module Gretel end end -ActionView::Base.send :include, Gretel::ViewHelpers \ No newline at end of file +ActionView::Base.send :include, Gretel::ViewHelpers
Fixed jRuby issue with Rails::Application constant
lassebunk_gretel
train
rb
a8c00e2b885a957332ca39468429020a0b1b446c
diff --git a/src/Exceptions/Handler.php b/src/Exceptions/Handler.php index <HASH>..<HASH> 100644 --- a/src/Exceptions/Handler.php +++ b/src/Exceptions/Handler.php @@ -16,8 +16,8 @@ use Symfony\Component\Console\Application as ConsoleApplication; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler; use Symfony\Component\HttpKernel\Exception\HttpException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class Handler implements ExceptionHandler {
Apply fixes from StyleCI (#<I>)
laravel_lumen-framework
train
php
56ac9f8d310149c1c1c0f97b6e0f28236ba962a3
diff --git a/ginga/rv/plugins/Blink.py b/ginga/rv/plugins/Blink.py index <HASH>..<HASH> 100644 --- a/ginga/rv/plugins/Blink.py +++ b/ginga/rv/plugins/Blink.py @@ -151,7 +151,7 @@ class Blink(GingaPlugin.LocalPlugin): def stop(self): self.stop_blinking() - def redo(self): + def redo(self, *args): pass def _blink_timer_cb(self, timer):
Fix issue with operation as local or global plugin
ejeschke_ginga
train
py
d05b8bfc67d8c100f3571779388c749f5a5cf93e
diff --git a/faststat/faststat.py b/faststat/faststat.py index <HASH>..<HASH> 100644 --- a/faststat/faststat.py +++ b/faststat/faststat.py @@ -11,6 +11,7 @@ try: class Stats(object): def __init__(self): self._stats = _faststat.Stats() + self.add = self._stats.add @property def variance(self):
fixed __getattr__ indirection which was bottlenecking C performance (<I> -> <I> microseconds per point with change)
kurtbrose_faststat
train
py
74150463353aa1d510d582d1e2cfaf603f12d228
diff --git a/safe_qgis/ui/resources_rc.py b/safe_qgis/ui/resources_rc.py index <HASH>..<HASH> 100644 --- a/safe_qgis/ui/resources_rc.py +++ b/safe_qgis/ui/resources_rc.py @@ -2,8 +2,8 @@ # Resource object code # -# Created: Thu Nov 14 14:54:00 2013 -# by: The Resource Compiler for PyQt (Qt v4.8.2) +# Created: Thu Nov 14 16:52:30 2013 +# by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost!
add a test (still failing) for issue #<I>
inasafe_inasafe
train
py
25a5b2be3790026273ddbc2cf13934d4cf63ef51
diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go index <HASH>..<HASH> 100644 --- a/lxd/container_lxc.go +++ b/lxd/container_lxc.go @@ -4798,10 +4798,12 @@ func (c *containerLXC) tarStoreFile(linkmap map[uint64]string, offset int, tw *t } } - // Handle xattrs. - hdr.Xattrs, err = shared.GetAllXattr(path) - if err != nil { - return fmt.Errorf("failed to read xattr: %s", err) + // Handle xattrs (for real files only) + if link == "" { + hdr.Xattrs, err = shared.GetAllXattr(path) + if err != nil { + return fmt.Errorf("failed to read xattr: %s", err) + } } if err := tw.WriteHeader(hdr); err != nil {
Don't attempt to read xattrs from symlinks Closes #<I>
lxc_lxd
train
go
7c6e2a15fddf1b56b42a2ad1a181db01c6f928a4
diff --git a/hawtio-system/src/main/java/io/hawt/web/auth/AuthenticationConfiguration.java b/hawtio-system/src/main/java/io/hawt/web/auth/AuthenticationConfiguration.java index <HASH>..<HASH> 100644 --- a/hawtio-system/src/main/java/io/hawt/web/auth/AuthenticationConfiguration.java +++ b/hawtio-system/src/main/java/io/hawt/web/auth/AuthenticationConfiguration.java @@ -14,8 +14,8 @@ public class AuthenticationConfiguration { private static final transient Logger LOG = LoggerFactory.getLogger(AuthenticationConfiguration.class); public static final String LOGIN_URL = "/auth/login"; - public static final String[] UNSECURED_PATHS = {"/auth", "/css", "/img", "/js", "/hawtconfig.json", - "/jolokia", "/keycloak", "/libs", "/oauth", "/user", "/login.html"}; + public static final String[] UNSECURED_PATHS = {"/auth", "/css", "/fonts", "/img", "/js", "/hawtconfig.json", + "/jolokia", "/keycloak", "/oauth", "/user", "/login.html"}; // Configuration properties public static final String AUTHENTICATION_ENABLED = "authenticationEnabled";
fix(hawtio-system): add '/fonts' to the list of unsecured paths and remove '/libs' fix #<I>
hawtio_hawtio
train
java
47bdb17899bb1aaa09939487bcda7ec453419a94
diff --git a/django_extensions/management/commands/graph_models.py b/django_extensions/management/commands/graph_models.py index <HASH>..<HASH> 100644 --- a/django_extensions/management/commands/graph_models.py +++ b/django_extensions/management/commands/graph_models.py @@ -56,7 +56,7 @@ class Command(BaseCommand): vizdata = ' '.join(dotdata.split("\n")).strip().encode('utf-8') version = pygraphviz.__version__.rstrip("-svn") try: - if [int(v) for v in version.split('.')] < (0, 36): + if tuple(int(v) for v in version.split('.')) < (0, 36): # HACK around old/broken AGraph before version 0.36 (ubuntu ships with this old version) import tempfile tmpfile = tempfile.NamedTemporaryFile()
fix #<I> compare tuples instead of list and tuples
django-extensions_django-extensions
train
py
b094802a03406328699bffad6deeceb5bdb61777
diff --git a/server/artifacts/artifact_server.go b/server/artifacts/artifact_server.go index <HASH>..<HASH> 100644 --- a/server/artifacts/artifact_server.go +++ b/server/artifacts/artifact_server.go @@ -95,9 +95,12 @@ func (a *ArtifactServer) gateKeeping(r *http.Request) (context.Context, error) { if token == "" { cookie, err := r.Cookie("authorization") if err != nil { - return nil, err + if err != http.ErrNoCookie { + return nil, err + } + } else { + token = cookie.Value } - token = cookie.Value } ctx := metadata.NewIncomingContext(r.Context(), metadata.MD{"authorization": []string{token}}) return a.authN.Context(ctx)
fix: Allow download of artifacs in server auth-mode. Fixes #<I> (#<I>)
argoproj_argo
train
go
8e9bf400c9d37199635e60b83187dfb760a7885d
diff --git a/lib/rules/sort-comp.js b/lib/rules/sort-comp.js index <HASH>..<HASH> 100644 --- a/lib/rules/sort-comp.js +++ b/lib/rules/sort-comp.js @@ -42,7 +42,7 @@ module.exports = Components.detect(function(context, components) { var errors = {}; - var MISPOSITION_MESSAGE = '{{propA}} must be placed {{position}} {{propB}}'; + var MISPOSITION_MESSAGE = '{{propA}} should be placed {{position}} {{propB}}'; var methodsOrder = getMethodsOrder({ order: [
sort-comp: say "should" instead of "must"
ytanruengsri_eslint-plugin-react-ssr
train
js
837f5528da2fd7755e90d08040a032e14324d025
diff --git a/tasks/serve.js b/tasks/serve.js index <HASH>..<HASH> 100644 --- a/tasks/serve.js +++ b/tasks/serve.js @@ -5,6 +5,7 @@ var express = require('express'); gulp.task('serve', ['watch'], function() { express() .use(express.static('./public')) + .use(express.static('./dist')) .listen(3000); });
gulp tasks: add ./dist as static dir
clappr_clappr
train
js
ee7f8e92f7067be07a3ebca5d3f9b11eb5d4a39d
diff --git a/src/View/View/AppView.php b/src/View/View/AppView.php index <HASH>..<HASH> 100644 --- a/src/View/View/AppView.php +++ b/src/View/View/AppView.php @@ -82,13 +82,16 @@ class AppView extends BaseView { //Enables the theme if(config('frontend.theme') && !$this->theme) $this->theme = config('frontend.theme'); - + if($this->layout === 'default') { + //Sets the layout relative path + $path = 'Template'.DS.'Layout'.($this->request->param('_ext') ? DS.$this->request->param('_ext').DS : DS).'frontend.ctp'; + //It first tries to get the layout from the theme - if($this->theme && is_readable(\MeTools\Core\Plugin::path($this->theme, 'src'.DS.'Template'.DS.'Layout'.DS.'frontend.ctp'))) + if($this->theme && is_readable(\MeTools\Core\Plugin::path($this->theme, 'src'.DS.$path))) $this->layout = sprintf('%s.frontend', $this->theme); //Otherwise, it tries to get the layout from the application - elseif(is_readable(APP.'Template'.DS.'Layout'.DS.'frontend.ctp')) + elseif(is_readable(APP.$path)) $this->layout = 'frontend'; //Otherwise, it gets the layout from the plugin else
fixed bug for rss layout
mirko-pagliai_me-cms
train
php
1730cb5bc9c6e3d8ecc953d9427d35b7c721e2f2
diff --git a/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java b/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java index <HASH>..<HASH> 100644 --- a/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java +++ b/library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java @@ -112,7 +112,7 @@ public class TelegramBotTest { User user = response.user(); UserTest.checkUser(user); assertTrue(user.isBot()); - assertTrue(user.canJoinGroups()); + assertFalse(user.canJoinGroups()); // can be changed via BotFather assertTrue(user.canReadAllGroupMessages()); assertTrue(user.supportsInlineQueries()); }
Fix getMe test after disabling group join
pengrad_java-telegram-bot-api
train
java
57f4c088be1e5f2a2d819054b2579ce463d08fcd
diff --git a/website/src/widgets/quickstart-install.js b/website/src/widgets/quickstart-install.js index <HASH>..<HASH> 100644 --- a/website/src/widgets/quickstart-install.js +++ b/website/src/widgets/quickstart-install.js @@ -88,9 +88,9 @@ const QuickstartInstall = ({ id, title }) => ( </QS> <QS package="source">pip install -r requirements.txt</QS> <QS package="source">python setup.py build_ext --inplace</QS> - {models.map(({ code }) => ( + {models.map(({ code, models: modelOptions }) => ( <QS models={code} key={code}> - python -m spacy download {code} + python -m spacy download {modelOptions[0]} </QS> ))} </Quickstart>
Use full model name in quickstart install [ci skip]
explosion_spaCy
train
js
dfeb0675664ce0cf6eab00918e37e07f485071d8
diff --git a/satpy/readers/__init__.py b/satpy/readers/__init__.py index <HASH>..<HASH> 100644 --- a/satpy/readers/__init__.py +++ b/satpy/readers/__init__.py @@ -588,6 +588,12 @@ class FSFile(os.PathLike): """Implement ordering.""" return os.fspath(self) < os.fspath(other) + def __eq__(self, other): + """Implement equality comparisons.""" + return (isinstance(other, FSFile) and + self._file == other._file and + self._fs == other._fs) + def open_file_or_filename(unknown_file_thing): """Try to open the *unknown_file_thing*, otherwise return the filename.""" diff --git a/satpy/tests/test_readers.py b/satpy/tests/test_readers.py index <HASH>..<HASH> 100644 --- a/satpy/tests/test_readers.py +++ b/satpy/tests/test_readers.py @@ -963,4 +963,4 @@ class TestFSFile(unittest.TestCase): FSFile(self.local_filename, zip_fs)) assert (FSFile(self.local_filename, zip_fs) != FSFile(self.local_filename)) - assert FSFile(self.local_filaneme) != FSFile(self.local_filename2) + assert FSFile(self.local_filename) != FSFile(self.local_filename2)
Compare FSFile objects for equality Allow to compare FSFile objects for equality. Two FSFile objects are considered equal if they have the same filename and their filesystem objects compare equal.
pytroll_satpy
train
py,py
c741625a2a08e710f183fabd6619feeb98326e34
diff --git a/src/Guard.php b/src/Guard.php index <HASH>..<HASH> 100644 --- a/src/Guard.php +++ b/src/Guard.php @@ -89,13 +89,7 @@ class Guard protected function validateToken($name, $value) { $token = $this->getFromStorage($name); - if ($token === false) { - return false; - } elseif ($token === $value) { - $result = true; - } else { - $result = false; - } + $result = ($token !== false && $token === $value); $this->removeFromStorage($name); return $result;
Simplify validateToken() method
slimphp_Slim-Csrf
train
php
ff168278a4b2736fb47b33a5b84856d19462e3e2
diff --git a/src/GitElephant/Repository.php b/src/GitElephant/Repository.php index <HASH>..<HASH> 100644 --- a/src/GitElephant/Repository.php +++ b/src/GitElephant/Repository.php @@ -294,7 +294,7 @@ class Repository $realBranches = array_filter($allBranches, function($branch) use ($actualBranches) { return !in_array($branch, $actualBranches) && preg_match('/^remotes(.+)$/', $branch) - && !preg_match('/^(.+)(HEAD|master)$/', $branch); + && !preg_match('/^(.+)(HEAD)(.*?)$/', $branch); }); foreach ($realBranches as $realBranch) { $this->checkout(str_replace(sprintf('remotes/%s/', $remote), '', $realBranch));
error in the logic to get real branches, master should be included
matteosister_GitElephant
train
php
dfdebcee11dfa83f1166279fed5bd9621a6512d0
diff --git a/lib/phusion_passenger/utils.rb b/lib/phusion_passenger/utils.rb index <HASH>..<HASH> 100644 --- a/lib/phusion_passenger/utils.rb +++ b/lib/phusion_passenger/utils.rb @@ -127,6 +127,10 @@ protected data[:is_initialization_error] = true if exception.child_exception data[:child_exception] = marshal_exception(exception.child_exception) + child_exception = exception.child_exception + exception.child_exception = nil + data[:exception] = Marshal.dump(exception) + exception.child_exception = child_exception end else begin @@ -149,15 +153,9 @@ protected child_exception = nil end - case hash[:class] - when AppInitError.to_s - exception_class = AppInitError - when FrameworkInitError.to_s - exception_class = FrameworkInitError - else - exception_class = InitializationError - end - return exception_class.new(hash[:message], child_exception) + exception = Marshal.load(hash[:exception]) + exception.child_exception = child_exception + return exception else begin return Marshal.load(hash[:exception])
Correctly marshal InitializationErrors.
phusion_passenger
train
rb
1e5d7762256b2b1d881ea02c68e3bce2524f3f13
diff --git a/imdb.class.php b/imdb.class.php index <HASH>..<HASH> 100644 --- a/imdb.class.php +++ b/imdb.class.php @@ -804,8 +804,9 @@ class IMDB { $arrReturned = $this->matchRegex($this->_strSource, IMDB::IMDB_GENRE); if (count($arrReturned[1])) { foreach ($arrReturned[1] as $strName) { - if($strName) + if($strName) { $arrReturn[] = trim($strName); + } } return implode($this->strSeperator, array_unique($arrReturn)); } @@ -823,8 +824,9 @@ class IMDB { $arrReturned = $this->matchRegex($this->_strSource, IMDB::IMDB_GENRE); if (count($arrReturned[1])) { foreach ($arrReturned[1] as $i => $strName) { - if($strName) + if($strName) { $arrReturn[] = '<a href="http://www.imdb.com/genre/' . trim($strName) . '/"' . ($strTarget ? ' target="' . $strTarget . '"' : '') . '>' . trim($strName) . '</a>'; + } } return implode($this->strSeperator, array_unique($arrReturn)); }
Update imdb.class.php brackets and spaces added
FabianBeiner_PHP-IMDB-Grabber
train
php
8529c058fb2e0d44a9f5dfe0451a39fdbc470cb6
diff --git a/lib/xcresources/command.rb b/lib/xcresources/command.rb index <HASH>..<HASH> 100644 --- a/lib/xcresources/command.rb +++ b/lib/xcresources/command.rb @@ -242,7 +242,10 @@ class XCResources::Command < Clamp::Command strings_file = Apfel.parse absolute_project_file_path(strings_file_path) keys = Hash[strings_file.kv_pairs.map do |kv_pair| - [kv_pair.key, { value: kv_pair.key, comment: kv_pair.comment }] + # WORKAROUND: Needed for single-line comments + comment = kv_pair.comment.gsub /^\s*\/\/\s*/, '' + + [kv_pair.key, { value: kv_pair.key, comment: comment }] end] log 'Found %s keys in file %s', keys.count, strings_file_path
WORKAROUND: Needed for single-line comments
xcres_xcres
train
rb
f64212f63895ddf804c975508a7070987a83d0f6
diff --git a/tests/node/filters.test.js b/tests/node/filters.test.js index <HASH>..<HASH> 100644 --- a/tests/node/filters.test.js +++ b/tests/node/filters.test.js @@ -69,7 +69,7 @@ describe('Filter', function () { testFormat('w', '2'); testFormat('z', '248'); testFormat('O', '+0700'); - testFilter('date("O")', { v: date }, '-0200'); + testFilter('date("O", -120)', { v: makeDate(-120, 2011, 0, 2) }, '-0200', 'O'); testFilter('date("z", 480)', { v: makeDate(480, 2011, 0, 1) }, '0', 'z'); testFilter('date("z", 480)', { v: makeDate(480, 2011, 11, 31) }, '364', 'z');
Tests are no longer timezone depend
Thunf_swiger
train
js
28bbd68b11214b57f51055c9a7b2a7490e054cbe
diff --git a/tests/test_latlng_parse.py b/tests/test_latlng_parse.py index <HASH>..<HASH> 100644 --- a/tests/test_latlng_parse.py +++ b/tests/test_latlng_parse.py @@ -9,3 +9,9 @@ class LatLngTestCase(TestCase): self.assertEquals(struct['srid'], '5432') self.assertEquals(struct['x'], '12.0') self.assertEquals(struct['y'], '13.0') + + def test_negative_coords(self): + struct = geosgeometry_str_to_struct('SRID=5432;POINT(12.0 -13.0)') + self.assertEquals(struct['srid'], '5432') + self.assertEquals(struct['x'], '12.0') + self.assertEquals(struct['y'], '-13.0')
Added test for negative lat/lng units
Frojd_wagtail-geo-widget
train
py
118509cf76eff3c1c0561d6f212a63b4ff582881
diff --git a/internal/handshake/ephermal_cache_test.go b/internal/handshake/ephermal_cache_test.go index <HASH>..<HASH> 100644 --- a/internal/handshake/ephermal_cache_test.go +++ b/internal/handshake/ephermal_cache_test.go @@ -20,7 +20,7 @@ var _ = Describe("Ephermal KEX", func() { }) It("changes KEX", func() { - kexLifetime = time.Millisecond + kexLifetime = 10 * time.Millisecond defer func() { kexLifetime = protocol.EphermalKeyLifetime }()
fix flaky key exchange generation test on AppVeyor
lucas-clemente_quic-go
train
go
911ad6179b360cc02ebb5b0489041535b8bb7514
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php index <HASH>..<HASH> 100644 --- a/plugins/Live/Visitor.php +++ b/plugins/Live/Visitor.php @@ -297,7 +297,7 @@ class Visitor implements VisitorInterface private static function sortActionDetails($actions) { - usort($actions, function ($a, $b) { + usort($actions, function ($a, $b) use ($actions) { $fields = array('serverTimePretty', 'idlink_va', 'type', 'title', 'url', 'pageIdAction', 'goalId'); foreach ($fields as $field) { $sort = VisitorLog::sortByActionsOnPageColumn($a, $b, $field); @@ -306,7 +306,10 @@ class Visitor implements VisitorInterface } } - return 0; + $indexA = array_search($a, $actions); + $indexB = array_search($b, $actions); + + return $indexA > $indexB ? 1 : -1; }); return $actions;
Changes to keep sorting order consistent across all PHP versions for Live.getLastVisitsDetails API (#<I>) * Changes to keep sorting order consistent across all php versions, #<I> * Started comparing index instead of returning -1 for visiotor sort, #<I>
matomo-org_matomo
train
php
5d9a65cad3c455bf30254de242dcebcdde92e630
diff --git a/lplight/client.py b/lplight/client.py index <HASH>..<HASH> 100644 --- a/lplight/client.py +++ b/lplight/client.py @@ -27,7 +27,8 @@ class RestClient(object): resp = requests.get(uri, headers=actual_headers, params=actual_params) setattr(resp, 'model', None) - if model: + # Make sure we only attempt to deserialize if we get a valid code. + if model and resp.status_code >= 200 and resp.status_code < 300: # TODO(jmv): Clean this up if is_collection: entries = []
Make sure we only attempt to deserialize on a successful resp
jmvrbanac_lplight
train
py
bc0b34804a807dad2c6ca25d461e40a554e73edd
diff --git a/results.go b/results.go index <HASH>..<HASH> 100644 --- a/results.go +++ b/results.go @@ -245,10 +245,6 @@ func (r *BinaryResult) Apply(req *Request, resp *Response) { } resp.Out.Header().Set("Content-Disposition", disposition) - if r.Length != -1 { - resp.Out.Header().Set("Content-Length", fmt.Sprintf("%d", r.Length)) - } - http.ServeContent(resp.Out, req.Request, r.Name, r.ModTime, r.ReadSeeker) // Close the Reader if we can
Fix http warnings in console Removed `content-length` settings when serving up binary files. `content-length` is being overridden by `serveContent` anyway, so the call is redundant.
revel_revel
train
go
2897ff1e19cc20ad7bbab11bfd8d408136bacc52
diff --git a/DataFixtures/ORM/LoadAvailabilityData.php b/DataFixtures/ORM/LoadAvailabilityData.php index <HASH>..<HASH> 100755 --- a/DataFixtures/ORM/LoadAvailabilityData.php +++ b/DataFixtures/ORM/LoadAvailabilityData.php @@ -35,7 +35,7 @@ class LoadAvailabilityData extends AbstractDataFixture foreach (self::$samples as $name) { $availability = $this->get('availability.factory')->create(); - $availability->translate('en')->setName($name); + $availability->translate($this->container->getParameter('locale'))->setName($name); $availability->mergeNewTranslations(); $manager->persist($availability); $this->setReference('availability_' . $name, $availability);
Sets fixtures locale from parameters (cherry picked from commit <I>c<I>de<I>ec<I>a<I>c3a7f4eef4e)
WellCommerce_WishlistBundle
train
php
41811e8c57af599b0b3a87f05387dd71fe4e0265
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -21,12 +21,10 @@ const HEADERS = { const acceptHeaderValue = 'application/json'; function filterNulls(obj) { - return Object.assign( - ...Object - .keys(obj) - .filter(key => obj[key] != null) - .map(key => ({ [key]: obj[key] })), - ); + return Object + .keys(obj) + .filter(key => obj[key] != null) + .reduce((acc, key) => { acc[key] = obj[key]; return acc; }, { }); } function stringify(obj) {
Avoid rest spread syntax; not transpiling correctly as func arg
funpokes_bing-image-search-async-iterator
train
js
87891db5bc54856db00b13303f0a41c5e20914eb
diff --git a/src/Map.php b/src/Map.php index <HASH>..<HASH> 100644 --- a/src/Map.php +++ b/src/Map.php @@ -135,7 +135,7 @@ class Map implements MapInterface { $map = $this->map; $key = ''; - $index = 1 << ($index - 1); + $index = (int)$index == 0 ? 0 : 1 << ($index - 1); foreach (explode(static::DELIMITER, $slug) as $child) { $key = empty($key) ? $child : $key.static::DELIMITER.$child; diff --git a/test/Tests/MapTest.php b/test/Tests/MapTest.php index <HASH>..<HASH> 100644 --- a/test/Tests/MapTest.php +++ b/test/Tests/MapTest.php @@ -205,6 +205,13 @@ class MapTest extends \PHPUnit_Framework_TestCase 'Test.version.a' => [3], ], ], + [ + 'assertFalse', 'Test.version.a', 0, [ + 'Test' => [], + 'Test.version' => [], + 'test.version.a' => [], + ] + ] ]; }
Ensure a negative bitshift can't occur in enabled method. This was previously fixed in the parse method, but missed in the enabled logic.
zumba_swivel
train
php,php
7edb1afad6d57a316f11839071fb5a7da96ddb4f
diff --git a/hack/verify-flags-underscore.py b/hack/verify-flags-underscore.py index <HASH>..<HASH> 100755 --- a/hack/verify-flags-underscore.py +++ b/hack/verify-flags-underscore.py @@ -232,7 +232,7 @@ def main(): if len(bad_lines) != 0: if not args.skip_exceptions: - print("Found illegal 'flag' usage. If these are false positives you should running `hack/verify-flags-underscore.py -e > hack/verify-flags/exceptions.txt` to update the list.") + print("Found illegal 'flag' usage. If these are false positives you should run `hack/verify-flags-underscore.py -e > hack/verify-flags/exceptions.txt` to update the list.") bad_lines.sort() for (relname, line) in bad_lines: print("%s:%s" % (relname, line))
Fixed typo in verify-flags-underscore
kubernetes_kubernetes
train
py
8085a5ef735c8fd4be671281c171b3d64742d783
diff --git a/pysat/instruments/pysat_netcdf.py b/pysat/instruments/pysat_netcdf.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/pysat_netcdf.py +++ b/pysat/instruments/pysat_netcdf.py @@ -124,8 +124,8 @@ def list_files(tag='', inst_id='', data_path=None, format_str=None): if format_str is None: # User did not supply an alternative format template string - format_str = '_'.join(platform, name, '{year:04d}', '{month:02d}', - '{day:02d}.nc') + format_str = '_'.join([platform, name, '{year:04d}', '{month:02d}', + '{day:02d}.nc']) # Use the pysat provided function to grab list of files from the # local file system that match the format defined above
BUG: fixed `join` implementation Fixed a big in the `join` implementation, making the input a list.
rstoneback_pysat
train
py
43284f08153237b903a5129326c788f928472fbc
diff --git a/src/main/com/mongodb/BaseCluster.java b/src/main/com/mongodb/BaseCluster.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/BaseCluster.java +++ b/src/main/com/mongodb/BaseCluster.java @@ -85,7 +85,7 @@ abstract class BaseCluster implements Cluster { if (!currentPhase.await(timeout, NANOSECONDS)) { throw new MongoTimeoutException(format("Timed out while waiting for a server that matches %s after %d ms", - serverSelector, MILLISECONDS.convert(timeout, NANOSECONDS))); + serverSelector, MILLISECONDS.convert(maxWaitTime, timeUnit))); } currentPhase = phase.get(); curDescription = description; @@ -112,7 +112,7 @@ abstract class BaseCluster implements Cluster { if (!currentPhase.await(timeout, NANOSECONDS)) { throw new MongoTimeoutException(format("Timed out while waiting to connect after %d ms", - MILLISECONDS.convert(timeout, NANOSECONDS))); + MILLISECONDS.convert(maxWaitTime, timeUnit))); } currentPhase = phase.get(); curDescription = description;
JAVA-<I>: MongoTimeoutException should include the total time waited before timing out, not just the last time through the loop
mongodb_mongo-java-driver
train
java
2b3c347b59a6f5103b0a52ccedc7a1c34effe77d
diff --git a/examples/mcmcp/experiment.py b/examples/mcmcp/experiment.py index <HASH>..<HASH> 100644 --- a/examples/mcmcp/experiment.py +++ b/examples/mcmcp/experiment.py @@ -49,7 +49,7 @@ class MCMCP(Experiment): """When a node is created it is added to the chain (see Chain in networks.py) and it receives any transmissions.""" network.add_node(node) - parent = node.neighbors(connection="from")[0] + parent = node.neighbors(direction="from")[0] parent.transmit() node.receive()
MCMCP: use direction as an argument to neighbors, not connection
berkeley-cocosci_Wallace
train
py
25813b248c864446c965c85905cd1a339b9be204
diff --git a/scriptworker/cot/verify.py b/scriptworker/cot/verify.py index <HASH>..<HASH> 100644 --- a/scriptworker/cot/verify.py +++ b/scriptworker/cot/verify.py @@ -1142,7 +1142,7 @@ async def get_action_context_and_template(chain, parent_link, decision_link): action_name = get_action_name(parent_link.task) action_defn = [d for d in all_actions if d['name'] == action_name][0] jsone_context = await populate_jsone_context(chain, parent_link, decision_link, "action") - if 'task' in action_defn: + if 'task' in action_defn and context.config['min_cot_version'] <= 2: tmpl = action_defn['task'] else: tmpl = await get_in_tree_template(decision_link)
task defn in actions.json only for cot version 2
mozilla-releng_scriptworker
train
py
420337dc4a01f38e000d9f1c3823efe26721b185
diff --git a/cluster.go b/cluster.go index <HASH>..<HASH> 100644 --- a/cluster.go +++ b/cluster.go @@ -1,7 +1,6 @@ package redis import ( - "fmt" "math/rand" "sync" "sync/atomic" @@ -367,14 +366,12 @@ func (c *ClusterClient) state() *clusterState { func (c *ClusterClient) cmdSlotAndNode(state *clusterState, cmd Cmder) (int, *clusterNode, error) { cmdInfo := c.cmds[cmd.arg(0)] firstKey := cmd.arg(cmdFirstKeyPos(cmd, cmdInfo)) - if firstKey == "" { + if firstKey == "" || cmdInfo == nil { node, err := c.nodes.Random() return -1, node, err } slot := hashtag.Slot(firstKey) - if cmdInfo == nil { - return -1, nil, internal.RedisError(fmt.Sprintf("cmdInfo of %s is nil", cmd.arg(0))) - } + if cmdInfo.ReadOnly && c.opt.ReadOnly { if c.opt.RouteByLatency { node, err := state.slotClosestNode(slot)
Simplify cmdInfo check.
go-redis_redis
train
go
fe1d738c739e9f55ef547644b3e1cb300b59b4e9
diff --git a/angular-typeahead.js b/angular-typeahead.js index <HASH>..<HASH> 100644 --- a/angular-typeahead.js +++ b/angular-typeahead.js @@ -3,21 +3,21 @@ angular.module('siyfion.sfTypeahead', []) return { restrict: 'AC', // Only apply on an attribute or class require: '?ngModel', // The two-way data bound value that is returned by the directive - scope: { + scope: { options: '=', // The typeahead configuration options (https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#options) datasets: '=' // The typeahead datasets to use (https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#datasets) }, link: function (scope, element, attrs, ngModel) { - + // Flag if user is selecting or not var selecting = false; - + // Create the typeahead on the element element.typeahead(scope.options, scope.datasets); - + // Parses what is going to be set to model ngModel.$parsers.push(function (fromView) { - if (scope.options.editable === false) { + if (((_ref = scope.options) != null ? _ref.editable : void 0) === false) { ngModel.$setValidity('typeahead', !selecting); if (selecting) { return undefined;
Checks that options have been defined before trying to access the editable value. Fixes secondary issue mentioned in #<I> which should mean it's all done!
Siyfion_angular-typeahead
train
js
e42dc771503f1838506879470a16c35562461e40
diff --git a/storage/google/cloud/storage/bucket.py b/storage/google/cloud/storage/bucket.py index <HASH>..<HASH> 100644 --- a/storage/google/cloud/storage/bucket.py +++ b/storage/google/cloud/storage/bucket.py @@ -1076,9 +1076,8 @@ class Bucket(_PropertyMixin): def requester_pays(self): """Does the requester pay for API requests for this bucket? - .. note:: - - No public docs exist yet for the "requester pays" feature. + See https://cloud.google.com/storage/docs/requester-pays for + details. :setter: Update whether requester pays for this bucket. :getter: Query whether requester pays for this bucket.
Link out to requester pays docs. (#<I>) * Link out to requester pays docs. * remove note:
googleapis_google-cloud-python
train
py
46a57aa933eef57ac7d140e8a599a07f2945358e
diff --git a/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/lib/Thelia/Core/Template/Smarty/SmartyParser.php index <HASH>..<HASH> 100755 --- a/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -90,8 +90,8 @@ class SmartyParser extends Smarty implements ParserInterface public function preThelia($tpl_source, \Smarty_Internal_Template $template) { - $new_source = preg_replace('`{#([a-zA-Z][a-zA-Z0-9\-_]*)(.*)}`', '{\$$1$2}', $tpl_source); - $new_source = preg_replace('`#([a-zA-Z][a-zA-Z0-9\-_]*)`', '{\$$1|dieseCanceller:\'#$1\'}', $new_source); + $new_source = preg_replace('`{#([a-zA-Z][a-zA-Z0-9_]*)(.*)}`', '{\$$1$2}', $tpl_source); + $new_source = preg_replace('`#([a-zA-Z][a-zA-Z0-9_]*)`', '{\$$1|dieseCanceller:\'#$1\'}', $new_source); return $new_source; }
Working - Fix #category-rule replaced by parser when writing jawascript
thelia_core
train
php
dad34d2ddbd3fdb236d558c33dba071a78a34cd3
diff --git a/tests/risk/answer_key.py b/tests/risk/answer_key.py index <HASH>..<HASH> 100644 --- a/tests/risk/answer_key.py +++ b/tests/risk/answer_key.py @@ -241,6 +241,12 @@ class AnswerKey(object): 'CUMULATIVE_INFORMATION': DataIndex( 'Sim Cumulative', 'Y', 4, 254), + 'CUMULATIVE_BETA': DataIndex( + 'Sim Cumulative', 'AB', 4, 254), + + 'CUMULATIVE_ALPHA': DataIndex( + 'Sim Cumulative', 'AC', 4, 254), + } def __init__(self): @@ -305,4 +311,9 @@ RISK_CUMULATIVE = pd.DataFrame({ 'sortino': pd.Series(dict(zip( DATES, ANSWER_KEY.CUMULATIVE_SORTINO))), 'information': pd.Series(dict(zip( - DATES, ANSWER_KEY.CUMULATIVE_INFORMATION)))}) + DATES, ANSWER_KEY.CUMULATIVE_INFORMATION))), + 'alpha': pd.Series(dict(zip( + DATES, ANSWER_KEY.CUMULATIVE_ALPHA))), + 'beta': pd.Series(dict(zip( + DATES, ANSWER_KEY.CUMULATIVE_BETA))), +})
TST: Add annualized alpha and beta to answer key. Add a column that uses annualized mean returns as the inputs into alpha and beta.
quantopian_zipline
train
py
7b6a98e30fe9f8a05e98ec574270203f8fb919b0
diff --git a/rhodes/rhodes-generator/generators/rhogen.rb b/rhodes/rhodes-generator/generators/rhogen.rb index <HASH>..<HASH> 100644 --- a/rhodes/rhodes-generator/generators/rhogen.rb +++ b/rhodes/rhodes-generator/generators/rhogen.rb @@ -98,7 +98,7 @@ module Rhogen name - model name source_url - url to the source adapter (i.e. "" or "http://rhosync.rhohub.com/apps/myapp/sources/account") source_id - unique id for this model (i.e. 500, this is only used on the device to uniquely identify the source) - attributes - list of one or more string attributes (i.e. name,industry,progress) + attributes - list of one or more string attributes (i.e. name,industry,progress), NO spaces between attributes DESC #option :testing_framework, :desc => 'Specify which testing framework to use (spec, test_unit)'
updating command-line help for rhogen model [#<I> state:resolved]
rhomobile_rhodes
train
rb
0efabddf61aee172deb3f2b17fdbbe611c95acf4
diff --git a/src/FieldHandlers/BaseListFieldHandler.php b/src/FieldHandlers/BaseListFieldHandler.php index <HASH>..<HASH> 100644 --- a/src/FieldHandlers/BaseListFieldHandler.php +++ b/src/FieldHandlers/BaseListFieldHandler.php @@ -33,6 +33,31 @@ abstract class BaseListFieldHandler extends BaseFieldHandler ]; /** + * Render field value + * + * This method prepares the output of the value for the given + * field. The result can be controlled via the variety of + * options. + * + * @param string $data Field data + * @param array $options Field options + * @return string Field value + */ + public function renderValue($data, array $options = []) + { + $options = array_merge($this->defaultOptions, $this->fixOptions($options)); + $result = parent::renderValue($data, $options); + + if (!empty($options['renderAs']) && static::RENDER_PLAIN_VALUE === $options['renderAs']) { + return $result; + } + + $result = $this->formatValue($result, $options); + + return $result; + } + + /** * Convert CsvField to one or more DbField instances * * Simple fields from migrations CSV map one-to-one to
add renderValue method on base class (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
6e9068cd16473ce5e67a314bd81d9506e835fd45
diff --git a/consolemenu/version.py b/consolemenu/version.py index <HASH>..<HASH> 100644 --- a/consolemenu/version.py +++ b/consolemenu/version.py @@ -1 +1 @@ -__version__ = "0.3.0" +__version__ = "0.4.0"
update version to <I>.
aegirhall_console-menu
train
py