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 |
|---|---|---|---|---|---|
193fb52ede7e1070f31f66cd4959ec7d01debf92 | diff --git a/squad/core/admin.py b/squad/core/admin.py
index <HASH>..<HASH> 100644
--- a/squad/core/admin.py
+++ b/squad/core/admin.py
@@ -56,6 +56,7 @@ force_notify_project.short_description = "Force sending email notification for s
class ProjectAdmin(admin.ModelAdmin):
list_display = ['__str__', 'is_public', 'notification_strategy', 'moderate_notifications']
+ list_filter = ['group', 'is_public', 'notification_strategy', 'moderate_notifications']
inlines = [EnvironmentInline, TokenInline, SubscriptionInline, AdminSubscriptionInline]
actions = [force_notify_project] | core/admin: add several filters for the project listing | Linaro_squad | train | py |
0a329898b0b88e44865053b96f32246c05a59371 | diff --git a/pydealer/pydealer.py b/pydealer/pydealer.py
index <HASH>..<HASH> 100644
--- a/pydealer/pydealer.py
+++ b/pydealer/pydealer.py
@@ -123,7 +123,7 @@ class Deck(object):
cards.append(card)
num -= 1
elif rebuild:
- self.build_deck()
+ self.build()
self.shuffle()
else:
break | changed line <I> from self.build_deck() to self.build() | Trebek_pydealer | train | py |
d95dbf99685eee8e6b91dede2c38950a3a6de8d5 | diff --git a/test/property_test.rb b/test/property_test.rb
index <HASH>..<HASH> 100755
--- a/test/property_test.rb
+++ b/test/property_test.rb
@@ -27,6 +27,15 @@ class PropertyTest < Test::Unit::TestCase
assert_equal "VALUE", @iface["ReadOrWriteMe"]
end
+ # https://github.com/mvidner/ruby-dbus/pull/19
+ def test_service_select_timeout
+ @iface["ReadOrWriteMe"] = "VALUE"
+ assert_equal "VALUE", @iface["ReadOrWriteMe"]
+ # wait for the service to become idle
+ sleep 6
+ assert_equal "VALUE", @iface["ReadOrWriteMe"], "Property value changed; perhaps the service died and got restarted"
+ end
+
def test_property_nonwriting
e = assert_raises DBus::Error do
@iface["ReadMe"] = "WROTE" | A test case for a stupid bug when a service becomes idle.
which was fixed in 1c6b3d3bded<I>a<I>baec5a<I>e<I>a<I>b<I> | mvidner_ruby-dbus | train | rb |
462b6f1398b153d58cba2b4a27576cc64862ed8b | diff --git a/WazeRouteCalculator/WazeRouteCalculator.py b/WazeRouteCalculator/WazeRouteCalculator.py
index <HASH>..<HASH> 100644
--- a/WazeRouteCalculator/WazeRouteCalculator.py
+++ b/WazeRouteCalculator/WazeRouteCalculator.py
@@ -137,9 +137,7 @@ class WazeRouteCalculator(object):
if self.vehicle_type:
url_options["vehicleType"] = self.vehicle_type
# Handle vignette system in Europe
- if 'AVOID_TOLL_ROADS' in self.route_options:
- pass #don't want to do anything if we're avoiding toll roads
- else:
+ if 'AVOID_TOLL_ROADS' not in self.route_options:
url_options["subscription"] = "*"
response = requests.get(self.WAZE_URL + routing_server, params=url_options, headers=self.HEADERS) | Amended to use not in for AVOID_TOLL_ROADS | kovacsbalu_WazeRouteCalculator | train | py |
642bafad0b98d149672bb448c0f020b84cbcb62a | diff --git a/lib/bixby_agent/cli.rb b/lib/bixby_agent/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/bixby_agent/cli.rb
+++ b/lib/bixby_agent/cli.rb
@@ -60,7 +60,6 @@ EOF
option :directory,
:short => "-d DIRECTORY",
:long => "--directory DIRECTORY",
- :default => "/opt/bixby",
:description => "Root directory for Bixby (optional, default: /opt/bixby)"
option :port, | don't pass in default root_dir | chetan_bixby-agent | train | rb |
f29f1e74b8f2e2c510fd4352e4759015d6314c1d | diff --git a/src/reply.js b/src/reply.js
index <HASH>..<HASH> 100644
--- a/src/reply.js
+++ b/src/reply.js
@@ -13,6 +13,14 @@ export default class Reply {
return this._response.payload;
}
+ set error (value) {
+ this._response.error = value;
+ }
+
+ get error () {
+ return this._response.error;
+ }
+
/**
* Abort the current request and respond wih the passed value
*/ | Give access to error payload in reply interface | MostlyJS_mostly-node | train | js |
8720a3317b324af02b160d12735d07b4247c0e54 | diff --git a/controller/grpc/controller.go b/controller/grpc/controller.go
index <HASH>..<HASH> 100644
--- a/controller/grpc/controller.go
+++ b/controller/grpc/controller.go
@@ -186,7 +186,7 @@ const ctxKeyFlynnAuthKeyID = "flynn-auth-key-id"
func (c *Config) Authorize(ctx context.Context) (context.Context, error) {
if md, ok := metadata.FromIncomingContext(ctx); ok {
- if passwords, ok := md["Auth-Key"]; ok && len(passwords) > 0 {
+ if passwords, ok := md["auth-key"]; ok && len(passwords) > 0 {
auth, err := c.authorizer.Authorize(passwords[0])
if err != nil {
return ctx, grpc.Errorf(codes.Unauthenticated, err.Error())
@@ -201,6 +201,8 @@ func (c *Config) Authorize(ctx context.Context) (context.Context, error) {
}
ctx = ctxhelper.NewContextLogger(ctx, logger.New("authKeyID", auth.ID))
}
+
+ return ctx, nil
}
return ctx, grpc.Errorf(codes.Unauthenticated, "no Auth-Key provided") | controller/grpc: Fix Auth | flynn_flynn | train | go |
c27bffcd026804512edc800b48bd40a3620a0865 | diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php
index <HASH>..<HASH> 100644
--- a/src/Controller/AppController.php
+++ b/src/Controller/AppController.php
@@ -6,15 +6,4 @@ use App\Controller\AppController as BaseController;
class AppController extends BaseController
{
-
- /**
- * Initialization hook method.
- *
- * @return void
- */
- public function initialize()
- {
- parent::initialize();
- $this->viewBuilder()->layout('QoboAdminPanel.basic');
- }
} | Removed forced layout (task #<I>) | QoboLtd_cakephp-menu | train | php |
882b48c836f18262aeb9cd4f2aed5aa64f8b107c | diff --git a/src/Extensions/WorkflowEmbargoExpiryExtension.php b/src/Extensions/WorkflowEmbargoExpiryExtension.php
index <HASH>..<HASH> 100644
--- a/src/Extensions/WorkflowEmbargoExpiryExtension.php
+++ b/src/Extensions/WorkflowEmbargoExpiryExtension.php
@@ -58,7 +58,10 @@ class WorkflowEmbargoExpiryExtension extends DataExtension
'AllowEmbargoedEditing' => true
);
- // This "config" option, might better be handled in _config
+ /**
+ * @deprecated 5.2.0:6.0.0 This setting does nothing and will be removed in in 6.0
+ * @var bool
+ */
public static $showTimePicker = true;
/** | API Deprecate $showTimePicker. It is not used any longer and will be removed in 6. | symbiote_silverstripe-advancedworkflow | train | php |
a745bab4f148e3276e1aa54f8f7f7696eca61cff | diff --git a/cert_issuer/blockchain_handlers/ethereum/connectors.py b/cert_issuer/blockchain_handlers/ethereum/connectors.py
index <HASH>..<HASH> 100644
--- a/cert_issuer/blockchain_handlers/ethereum/connectors.py
+++ b/cert_issuer/blockchain_handlers/ethereum/connectors.py
@@ -201,7 +201,7 @@ class MyEtherWalletBroadcaster(object):
data = {
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
- "params": [address, "latest"],
+ "params": [address, "pending"],
"id": 1
}
response = requests.post(self.base_url, json=data) | #<I> - Changing over to pending for get_balance as well. | blockchain-certificates_cert-issuer | train | py |
8f909fd5c07d7375d755b0396dd0cb82446d87de | diff --git a/great_expectations/data_context/types/resource_identifiers.py b/great_expectations/data_context/types/resource_identifiers.py
index <HASH>..<HASH> 100644
--- a/great_expectations/data_context/types/resource_identifiers.py
+++ b/great_expectations/data_context/types/resource_identifiers.py
@@ -108,13 +108,13 @@ class ValidationResultIdentifier(DataContextKey):
return tuple(
list(self.expectation_suite_identifier.to_tuple()) + [
self.run_id or "__none__",
- self.batch_identifier
+ self.batch_identifier or "__none__"
]
)
def to_fixed_length_tuple(self):
return self.expectation_suite_identifier.expectation_suite_name, self.run_id or "__none__", \
- self.batch_identifier
+ self.batch_identifier or "__none__"
@classmethod
def from_tuple(cls, tuple_): | If batch_id is None, set to “__none__” in tuple | great-expectations_great_expectations | train | py |
f0aaaa8e89d3206ac7b3343fe2b87b37fc9675f7 | diff --git a/pushy/src/test/java/com/turo/pushy/apns/server/MockApnsServerTest.java b/pushy/src/test/java/com/turo/pushy/apns/server/MockApnsServerTest.java
index <HASH>..<HASH> 100644
--- a/pushy/src/test/java/com/turo/pushy/apns/server/MockApnsServerTest.java
+++ b/pushy/src/test/java/com/turo/pushy/apns/server/MockApnsServerTest.java
@@ -36,6 +36,7 @@ import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.*;
+import static org.junit.Assume.assumeTrue;
public class MockApnsServerTest extends AbstractClientServerTest {
@@ -129,6 +130,16 @@ public class MockApnsServerTest extends AbstractClientServerTest {
@Test
public void testRestartWithProvidedEventLoopGroup() throws Exception {
+ int javaVersion = 0;
+
+ try {
+ javaVersion = Integer.parseInt(System.getProperty("java.specification.version"));
+ } catch (final NumberFormatException ignored) {
+ }
+
+ // TODO Remove this assumption when https://github.com/netty/netty/issues/8697 gets resolved
+ assumeTrue(javaVersion < 11);
+
final NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup(1);
try { | Temporarily ignore a test under Java <I> until an upstream issue is resolved. | relayrides_pushy | train | java |
800ced5e257d5d83d6dbe4ced0e7318ac40d026f | diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js
index <HASH>..<HASH> 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.js
@@ -1279,6 +1279,7 @@ export function popSavedQuery(saveQueryId) {
.then(({ json }) => {
const queryEditorProps = {
...convertQueryToClient(json.result),
+ loaded: true,
autorun: false,
};
return dispatch(addQueryEditor(queryEditorProps)); | fix(sql lab): when editing a saved query, the status is lost when switching tabs (#<I>) | apache_incubator-superset | train | js |
c83b29e0eddffdcc1249a5344be6dd6229ef70dd | diff --git a/lib/irt/commands/help.rb b/lib/irt/commands/help.rb
index <HASH>..<HASH> 100644
--- a/lib/irt/commands/help.rb
+++ b/lib/irt/commands/help.rb
@@ -117,8 +117,8 @@ module IRT
the evaluated yaml file
e.g.: {:a => 2}.vi #=> {:an_edited => 'value'}
Method#location When possible, it returns file and line where the
- method is defined. It is uitable to be passed to the
- in place editing commands.
+ method is defined. It is suitable to be passed to
+ the in place editing commands.
Method#info Returns useful info about the method. It is suitable
to be passed to the in place editing commands.
) | little irt_help fix | ddnexus_irt | train | rb |
2736f6abc275f59237073b408b08d154908507bd | diff --git a/lib/ticket_evolution/core/endpoint/request_handler.rb b/lib/ticket_evolution/core/endpoint/request_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/ticket_evolution/core/endpoint/request_handler.rb
+++ b/lib/ticket_evolution/core/endpoint/request_handler.rb
@@ -19,7 +19,8 @@ module TicketEvolution
def request(method, path, params = nil)
request = self.build_request(method, path, params)
- response = self.naturalize_response(request.http(method))
+ request.http(method)
+ response = self.naturalize_response(request)
if response.response_code >= 400
TicketEvolution::ApiError.new(response)
else
diff --git a/lib/ticket_evolution/modules/show.rb b/lib/ticket_evolution/modules/show.rb
index <HASH>..<HASH> 100644
--- a/lib/ticket_evolution/modules/show.rb
+++ b/lib/ticket_evolution/modules/show.rb
@@ -6,13 +6,13 @@ module TicketEvolution
end
def build_for_show(response)
+ remove_instance_variable(:@responsible)
"TicketEvolution::#{self.class.to_s.split('::').last.singularize.camelize}".constantize.new(
response.body.merge({
:status_code => response.response_code,
:server_message => response.server_message
})
)
- remove_instance_variable(:@responsible)
end
end
end | fixed two small return / reordering | ticketevolution_ticketevolution-ruby | train | rb,rb |
15de6ecac0b4bbe28629c4c8cfd2dc50216b4d49 | diff --git a/test/worker.py b/test/worker.py
index <HASH>..<HASH> 100755
--- a/test/worker.py
+++ b/test/worker.py
@@ -496,9 +496,9 @@ class TestBaseSplitCloneResiliency(TestBaseSplitClone):
# for each destination shard ("finding targets" state).
utils.poll_for_vars(
'vtworker', worker_port,
- 'WorkerState == cloning the data (offline)',
+ 'WorkerState == cloning the data (online)',
condition_fn=lambda v: v.get('WorkerState') == 'cloning the'
- ' data (offline)')
+ ' data (online)')
logging.debug('Worker is in copy state, starting reparent now')
utils.run_vtctl( | test: worker.py: Wait for online instead of the offline phase to run the reparent. | vitessio_vitess | train | py |
8442df8ba5a47e5f68226e3630b47f0dc106d7b3 | diff --git a/libs/playback/config.py b/libs/playback/config.py
index <HASH>..<HASH> 100644
--- a/libs/playback/config.py
+++ b/libs/playback/config.py
@@ -45,3 +45,19 @@ class Config(object):
:return: Dictionary vars
"""
return self.conf
+
+ def gen_conf(self):
+ """
+ Initial a configuration for the first time
+ :return:
+ """
+ pass
+ # TODO gen_conf
+
+ def set_conf(self):
+ """
+ Setting the value to the dict
+ :return:
+ """
+ pass
+ # TODO set_conf
\ No newline at end of file | Generate and setting configuration for Config | jiasir_playback | train | py |
99c102ecf1f6192ec5f382bd521a3071db8f4e33 | diff --git a/Classes/Console/Command/DatabaseCommandController.php b/Classes/Console/Command/DatabaseCommandController.php
index <HASH>..<HASH> 100644
--- a/Classes/Console/Command/DatabaseCommandController.php
+++ b/Classes/Console/Command/DatabaseCommandController.php
@@ -172,6 +172,10 @@ class DatabaseCommandController extends CommandController
'--single-transaction',
];
+ if ($this->output->getSymfonyConsoleOutput()->isVerbose()) {
+ $additionalArguments[] = '--verbose';
+ }
+
foreach ($excludeTables as $table) {
$additionalArguments[] = sprintf('--ignore-table=%s.%s', $dbConfig['dbname'], $table);
} | [FEATURE] Add verbose option to database:export (#<I>)
`database:export -v` now makes `mysqldump` verbose too.
`mysqldump` outputs its information using stderr so piping the dump via stdout
into a file or `database:import` continues to work. | TYPO3-Console_TYPO3-Console | train | php |
88663b4a7d8e15b48272c06cfb81b2ff9e8987cc | diff --git a/packages/form/src/Form.js b/packages/form/src/Form.js
index <HASH>..<HASH> 100644
--- a/packages/form/src/Form.js
+++ b/packages/form/src/Form.js
@@ -25,9 +25,9 @@ const Form = ({
validationSchema={validationSchema}
validate={validate}
>
- <RsForm data-testid="form-container" tag={FForm} {...rest}>
- {children}
- </RsForm>
+ {props => <RsForm data-testid="form-container" tag={FForm} {...rest}>
+ {typeof children === 'function' ? children(props) : children}
+ </RsForm>}
</Formik>
); | bug(form): formik children props
Enables the usage of Formik children props when using Function as Child Components | Availity_availity-react | train | js |
2a22de51568668e2c8b2f534c0f50b7b5b44bcf8 | diff --git a/CollectionTest.php b/CollectionTest.php
index <HASH>..<HASH> 100644
--- a/CollectionTest.php
+++ b/CollectionTest.php
@@ -212,7 +212,7 @@ class CollectionTest extends \Doctrine\Tests\DoctrineTestCase
{
$this->fillMatchingFixture();
- $col = $this->_coll->matching(new Criteria($this->_coll->expr()->eq("foo", "bar")));
+ $col = $this->_coll->matching(new Criteria(Criteria::expr()->eq("foo", "bar")));
$this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col);
$this->assertNotSame($col, $this->_coll);
$this->assertEquals(1, count($col));
diff --git a/CriteriaTest.php b/CriteriaTest.php
index <HASH>..<HASH> 100644
--- a/CriteriaTest.php
+++ b/CriteriaTest.php
@@ -74,4 +74,9 @@ class CriteriaTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings());
}
+
+ public function testExpr()
+ {
+ $this->assertInstanceOf('Doctrine\Common\Collections\ExpressionBuilder', Criteria::expr());
+ }
} | Move Selectable#expr() to static Criteria#expr() for creation of an ExpressionBuilder, it makes much more sense that way. | doctrine_collections | train | php,php |
04d58c3863f66ff6194d52b0d03314601e69700c | diff --git a/web/metrics.go b/web/metrics.go
index <HASH>..<HASH> 100644
--- a/web/metrics.go
+++ b/web/metrics.go
@@ -78,7 +78,7 @@ var (
"Severity": 1,
"Resolution": "Increase swap or memory",
"Explanation": "Ran out of all available memory space",
- "EventClass": "/Memory",
+ "EventClass": "/Perf/Memory",
},
},
}, | fixed type in metrics. missing /Perf | control-center_serviced | train | go |
63671f60812ad450e63466c0dc0c7abd664e9532 | diff --git a/lib/vagrant-vbguest/installer.rb b/lib/vagrant-vbguest/installer.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant-vbguest/installer.rb
+++ b/lib/vagrant-vbguest/installer.rb
@@ -43,20 +43,12 @@ module VagrantVbguest
@vm.channel.upload(i_script, installer_destination)
@vm.channel.sudo("sh #{installer_destination}") do |type, data|
- # Print the data directly to STDOUT, not doing any newlines
- # or any extra formatting of our own
- $stdout.print(data) if type != :exit_status
+ @vm.ui.info(data, :prefix => false, :new_line => false)
end
@vm.channel.execute("rm #{installer_destination} #{iso_destination}") do |type, data|
- # Print the data directly to STDOUT, not doing any newlines
- # or any extra formatting of our own
- $stdout.print(data) if type != :exit_status
+ @vm.ui.error(data.chomp, :prefix => false)
end
-
- # Puts out an ending newline just to make sure we end on a new
- # line.
- $stdout.puts
end
end
end | Replace the use of $stdout for printing
Formatting and newlines can be suppressed with arguments. Any output from
the rm command is going to be an error. | dotless-de_vagrant-vbguest | train | rb |
3d2e7aea9f4ef54ae3ef3b0b30f406eb71d241d7 | diff --git a/controllers/Categories.php b/controllers/Categories.php
index <HASH>..<HASH> 100644
--- a/controllers/Categories.php
+++ b/controllers/Categories.php
@@ -9,9 +9,9 @@ use RainLab\Blog\Models\Category;
class Categories extends Controller
{
public $implement = [
- 'Backend.Behaviors.FormController',
- 'Backend.Behaviors.ListController',
- 'Backend.Behaviors.ReorderController'
+ \Backend\Behaviors\FormController::class,
+ \Backend\Behaviors\ListController::class,
+ \Backend\Behaviors\ReorderController::class
];
public $formConfig = 'config_form.yaml';
diff --git a/controllers/Posts.php b/controllers/Posts.php
index <HASH>..<HASH> 100644
--- a/controllers/Posts.php
+++ b/controllers/Posts.php
@@ -9,9 +9,9 @@ use RainLab\Blog\Models\Post;
class Posts extends Controller
{
public $implement = [
- 'Backend.Behaviors.FormController',
- 'Backend.Behaviors.ListController',
- 'Backend.Behaviors.ImportExportController'
+ \Backend\Behaviors\FormController::class,
+ \Backend\Behaviors\ListController::class,
+ \Backend\Behaviors\ImportExportController::class
];
public $formConfig = 'config_form.yaml'; | Use class definitions for implemented behaviours (#<I>) | rainlab_blog-plugin | train | php,php |
c36cb3f94718b980708395a117ba0d688b2a4c0e | diff --git a/lib/webmock/http_lib_adapters/httpclient_adapter.rb b/lib/webmock/http_lib_adapters/httpclient_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/webmock/http_lib_adapters/httpclient_adapter.rb
+++ b/lib/webmock/http_lib_adapters/httpclient_adapter.rb
@@ -103,7 +103,7 @@ if defined?(::HTTPClient)
raise HTTPClient::TimeoutError if webmock_response.should_timeout
webmock_response.raise_error_if_any
- block.call(nil, body) if block
+ block.call(response, body) if block
response
end
diff --git a/spec/acceptance/httpclient/httpclient_spec.rb b/spec/acceptance/httpclient/httpclient_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/httpclient/httpclient_spec.rb
+++ b/spec/acceptance/httpclient/httpclient_spec.rb
@@ -37,6 +37,15 @@ describe "HTTPClient" do
include_examples "with WebMock"
end
+ it "should work with get_content" do
+ stub_request(:get, 'www.example.com').to_return(:status => 200, :body => 'test', :headers => {})
+ str = ''
+ HTTPClient.get_content('www.example.com') do |content|
+ str << content
+ end
+ str.should == 'test'
+ end
+
context "Filters" do
class Filter
def filter_request(request) | Fix failure with HTTPClient.get_content | bblimke_webmock | train | rb,rb |
cb21bfdf2881927b08be4dae1ed4e5b0f1b4aa74 | diff --git a/switchbot/devices/device.py b/switchbot/devices/device.py
index <HASH>..<HASH> 100644
--- a/switchbot/devices/device.py
+++ b/switchbot/devices/device.py
@@ -4,17 +4,17 @@ from __future__ import annotations
import asyncio
import binascii
import logging
-from ctypes import cast
-from typing import Any, Callable, TypeVar
+from typing import Any
from uuid import UUID
import async_timeout
-import bleak
+
from bleak import BleakError
from bleak.backends.device import BLEDevice
from bleak.backends.service import BleakGATTCharacteristic, BleakGATTServiceCollection
from bleak_retry_connector import (
BleakClientWithServiceCache,
+ BleakNotFoundError,
ble_device_has_changed,
establish_connection,
)
@@ -106,10 +106,17 @@ class SwitchbotDevice:
for attempt in range(max_attempts):
try:
return await self._send_command_locked(key, command)
+ except BleakNotFoundError:
+ _LOGGER.error(
+ "%s: device not found or no longer in range; Try restarting Bluetooth",
+ self.name,
+ exc_info=True,
+ )
+ return b"\x00"
except BLEAK_EXCEPTIONS:
if attempt == retry:
_LOGGER.error(
- "%s: communication failed. Stopping trying",
+ "%s: communication failed; Stopping trying",
self.name,
exc_info=True,
) | Improve error message when device has disappeared (#<I>) | Danielhiversen_pySwitchbot | train | py |
a7193f70ccc35fa0968616e3a7eb21e2025ec0c9 | diff --git a/graphlite/transaction.py b/graphlite/transaction.py
index <HASH>..<HASH> 100644
--- a/graphlite/transaction.py
+++ b/graphlite/transaction.py
@@ -101,14 +101,6 @@ class Transaction(object):
dst=edge.dst,
))
- def clear(self):
- """
- Clear the internal record of changes by
- deleting the elements of the list to
- free memory.
- """
- del self.ops[:]
-
def commit(self):
"""
Commits the stored changes to the database.
@@ -120,7 +112,6 @@ class Transaction(object):
if self.defined:
with self.lock:
self.perform_ops()
- self.clear()
def __enter__(self):
"""
diff --git a/tests/test_query.py b/tests/test_query.py
index <HASH>..<HASH> 100644
--- a/tests/test_query.py
+++ b/tests/test_query.py
@@ -45,6 +45,7 @@ def test_to(graph):
def test_edge():
+ assert not V(1).knows(2) == 3
assert V(1).knows(2) == V(1).knows(2)
assert V(1).knows(3) != V(1).knows(2) | removed Transaction.clear and improve coverage | eugene-eeo_graphlite | train | py,py |
f2853263226cb460d651a0e9d4a4de2398c341be | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -14,9 +14,9 @@ class Manifest extends TreeWalker {
});
Defaults.defineOptions(this, options);
- }
- files = {}
+ this.files = {};
+ }
create(filePath) {
const extension = path.extname(filePath).slice(1); | fix(class field support): adding support for node <I>
node <I> doesn't support class fields. Class filds are not intruduced until node <I> | webark_broccoli-style-manifest | train | js |
10476c3e66f554be9af55e09d3c2749f66ed7853 | diff --git a/lib/grit.rb b/lib/grit.rb
index <HASH>..<HASH> 100644
--- a/lib/grit.rb
+++ b/lib/grit.rb
@@ -20,8 +20,12 @@ end
# third party
require 'rubygems'
-gem "mime-types", ">=0"
-require 'mime/types'
+begin
+ gem "mime-types", ">=0"
+ require 'mime/types'
+rescue Gem::LoadError => e
+ puts "WARNING: Gem LoadError: #{e.message}"
+end
# ruby 1.9 compatibility
require 'grit/ruby1.9' | do not fail for stupidity of mime-types in rubygems <= <I> | mojombo_grit | train | rb |
d1b75070b5dfdc0bda1b3de6d72238262290bcb3 | diff --git a/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceWithMetadata.java b/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceWithMetadata.java
index <HASH>..<HASH> 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceWithMetadata.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceWithMetadata.java
@@ -95,7 +95,8 @@ public class InvoiceWithMetadata {
@Override
public boolean apply(final InvoiceItem invoiceItem) {
return invoiceItem.getInvoiceItemType() != InvoiceItemType.USAGE ||
- invoiceItem.getAmount().compareTo(BigDecimal.ZERO) != 0;
+ invoiceItem.getAmount().compareTo(BigDecimal.ZERO) != 0 ||
+ (invoiceItem.getQuantity() != null && invoiceItem.getQuantity() > 0);
}
});
final ImmutableList<InvoiceItem> filteredItems = ImmutableList.copyOf(resultingItems); | invoice: Refine new InvoiceConfig#isUsageZeroAmountDisabled to also check on quantity being zero | killbill_killbill | train | java |
d5db0acba96fa93b072af97166f983fed165f13b | diff --git a/packages/Navbar/src/index.js b/packages/Navbar/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/Navbar/src/index.js
+++ b/packages/Navbar/src/index.js
@@ -6,7 +6,8 @@ export class Navbar extends Component {
previousY = 0
previousX = 0
state = {
- maxHeight: 64
+ maxHeight: 64,
+ height: 56
}
componentDidMount() {
@@ -48,7 +49,7 @@ export class Navbar extends Component {
reveal
} = this.props
- const { maxHeight } = this.state
+ const { maxHeight, height } = this.state
const styles = {
boxShadow: `
@@ -57,7 +58,7 @@ export class Navbar extends Component {
0px 1px 10px 0px rgba(0, 0, 0, 0.12)
`,
transition: 'max-height 150ms cubic-bezier(0.4, 0.0, 0.2, 1)',
- height: 64,
+ height: height,
maxHeight: maxHeight,
overflow: 'hidden',
display: 'flex',
@@ -73,6 +74,11 @@ export class Navbar extends Component {
}
render({ children }) {
+ if (window.matchMedia("(max-width: 960px)").matches)
+ this.setState({ height: 56 })
+ else
+ this.setState({ height: 64 })
+
const styles = this.getStyles()
return <div style={styles}>{children}</div> | :sparkles: Added responsiveness to the navbar | slupjs_slup | train | js |
606457488f77e9cf5cac2c82e94bb4ce35d50e2a | diff --git a/build/generateExterns.js b/build/generateExterns.js
index <HASH>..<HASH> 100755
--- a/build/generateExterns.js
+++ b/build/generateExterns.js
@@ -846,8 +846,12 @@ function main(args) {
// Get externs.
const externs = sorted.map((x) => x.externs).join('');
+ // Get license header.
+ const licenseHeader = fs.readFileSync(__dirname + '/license-header', 'utf-8');
+
// Output generated externs, with an appropriate header.
fs.writeFileSync(outputPath,
+ licenseHeader +
'/**\n' +
' * @fileoverview Generated externs. DO NOT EDIT!\n' +
' * @externs\n' + | fix: Add license header to generated externs
To comply with internal regulations, even our generated externs should
have a license header. This prepends the header to all generated
externs.
Closes #<I>
Change-Id: Idef8e7bff<I>aefa<I>a8f<I>e<I>fa | google_shaka-player | train | js |
966b54dabcc75cc74fdb04b572708b268b30967e | diff --git a/lib/rodal.js b/lib/rodal.js
index <HASH>..<HASH> 100644
--- a/lib/rodal.js
+++ b/lib/rodal.js
@@ -52,8 +52,8 @@ var Dialog = function Dialog(props) {
return _react2.default.createElement(
'div',
{ style: mergedStyles, className: className },
- CloseButton,
- props.children
+ props.children,
+ CloseButton
);
}; | Fixing a Display Issue
Adjusted the display priority to ensure the close button not be covered by its children. | chenjiahan_rodal | train | js |
d165c9cb315c133d7a56c15b9be7c0bd06738bf3 | diff --git a/salt/states/git.py b/salt/states/git.py
index <HASH>..<HASH> 100644
--- a/salt/states/git.py
+++ b/salt/states/git.py
@@ -374,10 +374,16 @@ def latest(name,
remote = remote_name
if not remote:
- return _fail(ret, '\'remote\' option is required')
+ return _fail(ret, '\'remote\' argument is required')
if not target:
- return _fail(ret, '\'target\' option is required')
+ return _fail(ret, '\'target\' argument is required')
+
+ if not rev:
+ return _fail(
+ ret,
+ '\'{0}\' is not a valid value for the \'rev\' argument'.format(rev)
+ )
# Ensure that certain arguments are strings to ensure that comparisons work
if not isinstance(rev, six.string_types): | Don't permit rev to be None or any other False value | saltstack_salt | train | py |
1f965ab2b91613e8d8c138e71f242a226a981358 | diff --git a/packages/react-select/src/Select.js b/packages/react-select/src/Select.js
index <HASH>..<HASH> 100644
--- a/packages/react-select/src/Select.js
+++ b/packages/react-select/src/Select.js
@@ -1798,8 +1798,8 @@ export default class Select extends Component<Props, State> {
if (!this.state.isFocused) return null;
return (
<A11yText aria-live="polite">
- <p id="aria-selection-event"> {this.state.ariaLiveSelection}</p>
- <p id="aria-context"> {this.constructAriaLiveMessage()}</p>
+ <span id="aria-selection-event"> {this.state.ariaLiveSelection}</span>
+ <span id="aria-context"> {this.constructAriaLiveMessage()}</span>
</A11yText>
);
} | Fix aria renderLiveRegion A<I>yText DOM structure
W3C was breaking because of A<I>yText span wrapping p elements. | JedWatson_react-select | train | js |
bdcf25996941581fa2421136159e62bfdeb69965 | diff --git a/contrib/plots/quantile-generator.py b/contrib/plots/quantile-generator.py
index <HASH>..<HASH> 100755
--- a/contrib/plots/quantile-generator.py
+++ b/contrib/plots/quantile-generator.py
@@ -62,7 +62,8 @@ def main(args=None):
parser.add_argument("result",
metavar="RESULT",
type=str,
- help="XML file with result produced by benchexec"
+ nargs="+",
+ help="XML files with result produced by benchexec"
)
parser.add_argument("--correct-only",
action="store_true", dest="correct_only",
@@ -77,7 +78,9 @@ def main(args=None):
# load results
run_set_result = tablegenerator.RunSetResult.create_from_xml(
- options.result, tablegenerator.parse_results_file(options.result))
+ options.result[0], tablegenerator.parse_results_file(options.result[0]))
+ for results_file in options.result[1:]:
+ run_set_result.append(results_file, tablegenerator.parse_results_file(results_file))
run_set_result.collect_data(options.correct_only or options.scored_based)
# select appropriate results | Make quantile-generator accept multiple result files as input. | sosy-lab_benchexec | train | py |
b90984a7f69c084354e55b06976b90b58d31c8c9 | diff --git a/lib/models/room-state.js b/lib/models/room-state.js
index <HASH>..<HASH> 100644
--- a/lib/models/room-state.js
+++ b/lib/models/room-state.js
@@ -244,7 +244,6 @@ RoomState.prototype.maySendStateEvent = function(stateEventType, userId) {
var default_user_level = 0;
var user_levels = [];
- var current_user_level = 0;
var state_default = 0;
if (power_levels_event) {
@@ -253,9 +252,6 @@ RoomState.prototype.maySendStateEvent = function(stateEventType, userId) {
default_user_level = parseInt(power_levels.users_default || 0);
user_levels = power_levels.users || {};
- current_user_level = user_levels[userId];
-
- if (current_user_level === undefined) { current_user_level = default_user_level; }
if (power_levels.state_default !== undefined) {
state_default = power_levels.state_default;
@@ -268,7 +264,7 @@ RoomState.prototype.maySendStateEvent = function(stateEventType, userId) {
if (events_levels[stateEventType] !== undefined) {
state_event_level = events_levels[stateEventType];
}
- return current_user_level >= state_event_level;
+ return member.powerLevel >= state_event_level;
};
/** | Use member.powerLevel instead of duplicating the user power level calculation. | matrix-org_matrix-js-sdk | train | js |
97eb8892770a78cb0abc29ebb1208d2c8f4161d8 | diff --git a/src/Webiny/Component/Entity/Attribute/One2ManyAttribute.php b/src/Webiny/Component/Entity/Attribute/One2ManyAttribute.php
index <HASH>..<HASH> 100755
--- a/src/Webiny/Component/Entity/Attribute/One2ManyAttribute.php
+++ b/src/Webiny/Component/Entity/Attribute/One2ManyAttribute.php
@@ -230,7 +230,7 @@ class One2ManyAttribute extends AbstractCollectionAttribute
$attrValues = $this->getValue();
foreach ($attrValues as $r) {
- if (!in_array($r->id, $newValues)) {
+ if (!in_array($r->id, $newIds)) {
$r->delete();
}
} | - fix on cleanUpRecord method | Webiny_Framework | train | php |
df58f439ca4862f5c23937e4b0d55b3eb2a5000c | diff --git a/server/socket.js b/server/socket.js
index <HASH>..<HASH> 100644
--- a/server/socket.js
+++ b/server/socket.js
@@ -75,10 +75,6 @@ module.exports = function (server) {
io.sockets.emit('verifying', infoHash, stats());
- torrent.once('verifying', function () {
- io.sockets.emit('verifying', infoHash, stats());
- });
-
torrent.once('ready', function () {
io.sockets.emit('ready', infoHash, stats());
}); | don't broadcast `verifying` event | asapach_peerflix-server | train | js |
ac26124e34e993ffff70d6a7bf5e1e535d1d3fda | diff --git a/src/GW2Api.php b/src/GW2Api.php
index <HASH>..<HASH> 100644
--- a/src/GW2Api.php
+++ b/src/GW2Api.php
@@ -60,7 +60,7 @@ class GW2Api {
$handler->push(EffectiveUrlMiddleware::middleware());
return [
- 'base_url' => $this->apiUrl,
+ 'base_uri' => $this->apiUrl,
'defaults' => [
'verify' => $this->getCacertFilePath()
], | fix base_uri
guzzle 6 changed the name of this option | GW2Treasures_gw2api | train | php |
72f5f4faba6d21349bd3cf195e9320e528ae2761 | diff --git a/lib/twitter-ads/version.rb b/lib/twitter-ads/version.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter-ads/version.rb
+++ b/lib/twitter-ads/version.rb
@@ -1,5 +1,5 @@
# Copyright (C) 2015 Twitter, Inc.
module TwitterAds
- VERSION = '0.1.0'
+ VERSION = '0.1.1'
end | [release] bumping to <I> | twitterdev_twitter-ruby-ads-sdk | train | rb |
3cd3988fb5e0609cca39d13627e933afed2d0037 | diff --git a/kernel/setup/session.php b/kernel/setup/session.php
index <HASH>..<HASH> 100644
--- a/kernel/setup/session.php
+++ b/kernel/setup/session.php
@@ -329,7 +329,7 @@ $param['expiration_filter'] = $expirationFilterType;
$param['user_id'] = $userID;
if ( isset( $viewParameters['sortby'] ) )
$param['sortby'] = $viewParameters['sortby'];
-$sessionsActive = eZSession::countActive( $param );
+$sessionsActive = eZSession::countActive();
$sessionsCount = eZFetchActiveSessionCount( $param );
$sessionsList = eZFetchActiveSessions( $param ); | eZSession::countActive() uses no arg, but a call give 1 arg => this arg is useless | ezsystems_ezpublish-legacy | train | php |
4fc765241f4317d4f61e7cb4acafbf2272a83fa0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,8 +28,7 @@ setup(
author_email='jax-dev@google.com',
packages=find_packages(exclude=["examples"]),
install_requires=[
- 'numpy>=1.12', 'six', 'protobuf>=3.6.0', 'absl-py', 'opt_einsum',
- 'fastcache'
+ 'numpy>=1.12', 'six', 'absl-py', 'opt_einsum', 'fastcache'
],
url='https://github.com/google/jax',
license='Apache-2.0', | Drop protobuf dependency from `jax` package. It appears unused. (#<I>) | tensorflow_probability | train | py |
23dbff27ebacf6b87599745a4ad21e97374051ee | diff --git a/src/main/java/org/eobjects/analyzer/connection/JdbcDatastore.java b/src/main/java/org/eobjects/analyzer/connection/JdbcDatastore.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/eobjects/analyzer/connection/JdbcDatastore.java
+++ b/src/main/java/org/eobjects/analyzer/connection/JdbcDatastore.java
@@ -171,4 +171,19 @@ public final class JdbcDatastore extends UsageAwareDatastore {
}
}
}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("JdbcDatastore[name=");
+ sb.append(_name);
+ if (_jdbcUrl != null) {
+ sb.append(",url=");
+ sb.append(_jdbcUrl);
+ } else {
+ sb.append(",jndi=");
+ sb.append(_datasourceJndiUrl);
+ }
+ return sb.toString();
+ }
} | Added convenient toString() method for JdbcDatastore | datacleaner_AnalyzerBeans | train | java |
8a63646a756e4d68ea5680c60f2222952ec55cf2 | diff --git a/example/geopage/models.py b/example/geopage/models.py
index <HASH>..<HASH> 100644
--- a/example/geopage/models.py
+++ b/example/geopage/models.py
@@ -75,3 +75,12 @@ class GeoStreamPage(Page):
def get_context(self, request):
data = super(GeoStreamPage, self).get_context(request)
return data
+
+
+class ClassicGeoPage(Page):
+ address = models.CharField(max_length=250, blank=True, null=True)
+ location = models.CharField(max_length=250, blank=True, null=True)
+
+ content_panels = Page.content_panels + [
+ GeoPanel('location', address_field='address'),
+ ] | Added regular text field example with geppanel | Frojd_wagtail-geo-widget | train | py |
8aeed003f562fe9199614d013163c89b5182cd33 | diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -1,4 +1,5 @@
require 'set'
+require 'active_support/json'
module ActionView
module Helpers
diff --git a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
+++ b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
@@ -1,4 +1,5 @@
require 'action_view/helpers/javascript_helper'
+require 'active_support/json'
module ActionView
module Helpers | prototype and scripty helpers require json | rails_rails | train | rb,rb |
6bd963a828cd4ebcd93c5c45e883edf7c39c021f | diff --git a/sprd/model/BasketItem.js b/sprd/model/BasketItem.js
index <HASH>..<HASH> 100644
--- a/sprd/model/BasketItem.js
+++ b/sprd/model/BasketItem.js
@@ -34,14 +34,18 @@ define(["sprd/data/SprdModel", "sprd/entity/ConcreteElement", "sprd/entity/Price
if (this.$.priceItem) {
return this.$.priceItem.$.vatIncluded;
}
- return this.get('element.item.price().vatIncluded') || 0;
+
+ return (this.get('element.item.price().vatIncluded') || 0) +
+ (this.get('element.article.commission.vatIncluded') || 0);
},
vatExcluded: function () {
if (this.$.priceItem) {
return this.$.priceItem.$.vatExcluded;
}
- return this.get('element.item.price().vatExcluded') || 0;
+
+ return (this.get('element.item.price().vatExcluded') || 0) + +
+ (this.get('element.article.commission.vatExcluded') || 0);
},
discountPriceVatIncluded: function(){ | include article commission in basket, if an article was references for the basketItem | spreadshirt_rAppid.js-sprd | train | js |
ac1f715200bf21532a142b0f9fac6b0458cf59c1 | diff --git a/lib/util.js b/lib/util.js
index <HASH>..<HASH> 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -742,20 +742,6 @@ var Util = function (settings) {
this.authenticate = this.Authenticate;
/*
- RetrieveMultiple public and private methods
- */
- this.RetrieveMultiple = function (options, cb) {
- this.executePost(options, "RetrieveMultiple", apiRetrieveMultipleMessage, serializer.toXmlRetrieveMultiple(options), cb);
- };
-
- /*
- Retrieve public and private methods
- */
- this.Retrieve = function (options, cb) {
- this.executePost(options, "Retrieve", apiRetrieveMessage, serializer.toXmlRetrieve(options), cb);
- };
-
- /*
Create public and private methods
*/
this.Create = function (options, cb) { | Removing obsolete implementations of Retrieve and RetrieveMultiple | Innofactor_xrm-api | train | js |
e16e3273966e92c30780b8ea4f2a8a6853c88bf3 | diff --git a/graylog_hook.go b/graylog_hook.go
index <HASH>..<HASH> 100644
--- a/graylog_hook.go
+++ b/graylog_hook.go
@@ -117,7 +117,7 @@ func (hook *GraylogHook) sendEntry(entry graylogEntry) {
Host: host,
Short: string(short),
Full: string(full),
- TimeUnix: time.Now().UnixNano(),
+ TimeUnix: time.Now().UnixNano() / 1000000000.,
Level: level,
Facility: hook.Facility,
File: entry.file, | Graylog actually expects seconds, not nanosec | gemnasium_logrus-graylog-hook | train | go |
5c38668c5cd986740547e760b52826b267a07d5a | diff --git a/packages/testing/testing-utils/test-utils.js b/packages/testing/testing-utils/test-utils.js
index <HASH>..<HASH> 100755
--- a/packages/testing/testing-utils/test-utils.js
+++ b/packages/testing/testing-utils/test-utils.js
@@ -168,6 +168,7 @@ function getPkgsChanged({ from = 'HEAD', base = 'master' } = {}) {
'generator-bolt',
'@bolt/drupal-twig-extensions',
'@bolt/uikit-workshop',
+ '@bolt/bolt-starter',
];
// will contain package names and keep them unique | fix: ignore Drupal Lab package.json from getting picked up by testing utils | bolt-design-system_bolt | train | js |
a5b4f0df2e2d77d5f5f2c506e24195f1d0818bd4 | diff --git a/src/rez/__init__.py b/src/rez/__init__.py
index <HASH>..<HASH> 100644
--- a/src/rez/__init__.py
+++ b/src/rez/__init__.py
@@ -2,7 +2,7 @@ import logging.config
import os
-__version__ = "2.0.ALPHA.129"
+__version__ = "2.0.ALPHA.130"
__author__ = "Allan Johns"
__license__ = "LGPL"
diff --git a/src/rez/rex.py b/src/rez/rex.py
index <HASH>..<HASH> 100644
--- a/src/rez/rex.py
+++ b/src/rez/rex.py
@@ -553,11 +553,10 @@ class Python(ActionInterpreter):
if self.manager:
self.target_environ.update(self.manager.environ)
- if not hasattr(args, '__iter__'):
- import shlex
- args = shlex.split(args)
-
- return subprocess.Popen(args, env=self.target_environ,
+ shell_mode = not hasattr(args, '__iter__')
+ return subprocess.Popen(args,
+ shell=shell_mode,
+ env=self.target_environ,
**subproc_kwargs)
def command(self, value): | fixed bug where complex shell commands in package commands would cause an
error when using ResolvedContext.execute_command() | nerdvegas_rez | train | py,py |
e35d74a71f4d489a428e5f600d948e661704f71f | diff --git a/core.py b/core.py
index <HASH>..<HASH> 100644
--- a/core.py
+++ b/core.py
@@ -3,7 +3,7 @@
"""
futmarket.core
~~~~~~~~~~~~~~~~~~~~~
-This module implements the fut's basic methods.
+This module implements the futmarket's basic methods.
"""
# Imports
@@ -83,6 +83,8 @@ def active():
## Get names and attributes of team members, including last sale price
def my_team():
+ sold()
+ not_sold()
myclub = fut.club()
my_auction = pd.DataFrame(myclub)
my_auction = my_auction[my_auction['untradeable'] == False] | Fixed my_team function to clean tradepile first | futapi_fut | train | py |
3a49f9c09418164bf90ee9905cd88ee6d3dbb052 | diff --git a/ngReact.js b/ngReact.js
index <HASH>..<HASH> 100644
--- a/ngReact.js
+++ b/ngReact.js
@@ -5,6 +5,16 @@
// - reactComponent (generic directive for delegating off to React Components)
// - reactDirective (factory for creating specific directives that correspond to reactComponent directives)
+var React, angular;
+
+if (typeof module !== 'undefined' && module.exports) {
+ React = require('react');
+ angular = require('angular');
+} else {
+ React = window.React;
+ angular = window.angular;
+}
+
(function(React, angular) {
'use strict';
@@ -184,4 +194,4 @@
.directive('reactComponent', ['$timeout', '$injector', reactComponent])
.factory('reactDirective', ['$timeout','$injector', reactDirective]);
-})(window.React, window.angular);
\ No newline at end of file
+})(React, angular);
\ No newline at end of file | added a shim to require react and angular for browserify environment | ngReact_ngReact | train | js |
db419d7a2d7645ea9b3c1de408b43f48b55585b0 | diff --git a/com/checkout/ApiServices/Reporting/ReportingService.php b/com/checkout/ApiServices/Reporting/ReportingService.php
index <HASH>..<HASH> 100644
--- a/com/checkout/ApiServices/Reporting/ReportingService.php
+++ b/com/checkout/ApiServices/Reporting/ReportingService.php
@@ -32,7 +32,7 @@ class ReportingService extends \com\checkout\ApiServices\BaseServices
}
- ublic function queryChargeback(RequestModels\TransactionFilter $requestModel) {
+ public function queryChargeback(RequestModels\TransactionFilter $requestModel) {
$reportingMapper = new ReportingMapper($requestModel);
$reportingUri = $this->_apiUrl->getQueryChargebackApiUri();
$secretKey = $this->_apiSetting->getSecretKey(); | Fix typo inside ReportingService.php | checkout_checkout-php-library | train | php |
665a3e4eeb92110e0e0ee9b69cadd142dacdd0ac | diff --git a/src/bidi/chartypes.py b/src/bidi/chartypes.py
index <HASH>..<HASH> 100644
--- a/src/bidi/chartypes.py
+++ b/src/bidi/chartypes.py
@@ -50,6 +50,10 @@ class ExChar(object):
return None
+ def __repr__(self):
+ return u'<%s %s (bidi type:%s)>' % (self.__class__.__name__,
+ unicodedata.name(self.uni_char), self.bidi_type)
+
class ExCharUpperRtl(ExChar):
"""An extended char which treats upper case chars as a strong 'R'
(for debugging purpose) | Added __repr__ | MeirKriheli_python-bidi | train | py |
04e750a620123b6452a6acfe398e6425c6f4a952 | diff --git a/xblock/runtime.py b/xblock/runtime.py
index <HASH>..<HASH> 100644
--- a/xblock/runtime.py
+++ b/xblock/runtime.py
@@ -460,7 +460,7 @@ class Mixologist(object):
self._generated_classes[cls] = type(
cls.__name__ + 'WithMixins',
(cls, ) + self._mixins,
- {'mixed_class': True}
+ {'unmixed_class': cls}
)
return self._generated_classes[cls]
diff --git a/xblock/test/test_runtime.py b/xblock/test/test_runtime.py
index <HASH>..<HASH> 100644
--- a/xblock/test/test_runtime.py
+++ b/xblock/test/test_runtime.py
@@ -413,3 +413,6 @@ class TestMixologist(object):
# Test that mixins are applied in order
def test_mixin_order(self):
assert_is(1, self.mixologist.mix(FieldTester).number)
+
+ def test_unmixed_class(self):
+ assert_is(FieldTester, self.mixologist.mix(FieldTester).unmixed_class) | Add the unmixed class as an attribute to automixed classes | edx_XBlock | train | py,py |
756cdabbfee3ccf590ff5b7a2ecc9d9aefb38ebe | diff --git a/kernel/class/edit.php b/kernel/class/edit.php
index <HASH>..<HASH> 100644
--- a/kernel/class/edit.php
+++ b/kernel/class/edit.php
@@ -527,7 +527,7 @@ $class->NameList->setHasDirtyData();
$trans = eZCharTransform::instance();
-if ( $validationRequired )
+if ( $contentClassHasInput && $validationRequired )
{
// check for duplicate attribute identifiers and placements in the input
$placementMap = array(); | Fix EZP-<I>: Impossible to set default selection item on relation attribute | ezsystems_ezpublish-legacy | train | php |
5194c0e062c21172e29e4fb87c7b5ff0f442845d | diff --git a/backtrader/indicators/deviation.py b/backtrader/indicators/deviation.py
index <HASH>..<HASH> 100644
--- a/backtrader/indicators/deviation.py
+++ b/backtrader/indicators/deviation.py
@@ -31,9 +31,11 @@ class StandardDeviation(Indicator):
Note:
- If 2 datas are provided as parameters, the 2nd is considered to be the
mean of the first
- - ``safepow´´ (default: False) If this parameter is True, the standard deviation
- will be calculated as pow(abs(meansq - sqmean), 0.5) to safe guard for possible
- negative results of ``meansq - sqmean´´ caused by the floating point representation.
+
+ - ``safepow´´ (default: False) If this parameter is True, the standard
+ deviation will be calculated as pow(abs(meansq - sqmean), 0.5) to safe
+ guard for possible negative results of ``meansq - sqmean´´ caused by
+ the floating point representation.
Formula:
- meansquared = SimpleMovingAverage(pow(data, 2), period) | PEP-8 compliance in docstring | backtrader_backtrader | train | py |
6868207c6c2363281a33ff563762218e2e157a18 | diff --git a/infrastructure/config_drive_metadata_service.go b/infrastructure/config_drive_metadata_service.go
index <HASH>..<HASH> 100644
--- a/infrastructure/config_drive_metadata_service.go
+++ b/infrastructure/config_drive_metadata_service.go
@@ -104,7 +104,7 @@ func (ms *configDriveMetadataService) load() error {
return nil
}
- ms.logger.Warn(ms.logTag, "Failed to load config from %s", diskPath, err)
+ ms.logger.Warn(ms.logTag, "Failed to load config from %s - %s", diskPath, err.Error())
}
return err
diff --git a/platform/linux_platform.go b/platform/linux_platform.go
index <HASH>..<HASH> 100644
--- a/platform/linux_platform.go
+++ b/platform/linux_platform.go
@@ -403,7 +403,7 @@ func (p linux) SetupEphemeralDiskWithPath(realPath string) error {
if err != nil {
_, isInsufficentSpaceError := err.(insufficientSpaceError)
if isInsufficentSpaceError {
- p.logger.Warn(logTag, "No partitions created on root device, using root partition as ephemeral disk", err)
+ p.logger.Warn(logTag, "No partitions created on root device, using root partition as ephemeral disk - %s", err.Error())
return nil
} | Fix improper usages of logger.Warn
The format string was missing the format specifier. | cloudfoundry_bosh-agent | train | go,go |
890583b9b413ae6b969dc112c1aa637b15a66318 | diff --git a/packages/@uppy/transloadit/src/index.js b/packages/@uppy/transloadit/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/@uppy/transloadit/src/index.js
+++ b/packages/@uppy/transloadit/src/index.js
@@ -471,6 +471,7 @@ module.exports = class Transloadit extends Plugin {
this._onFileUploadComplete(id, file)
})
assembly.on('error', (error) => {
+ error.assembly = assembly.status
this.uppy.emit('transloadit:assembly-error', assembly.status, error)
})
@@ -610,7 +611,7 @@ module.exports = class Transloadit extends Plugin {
return Promise.resolve()
}
- // AssemblyWatcher tracks completion state of all Assemblies in this upload.
+ // AssemblyWatcher tracks completion states of all Assemblies in this upload.
const watcher = new AssemblyWatcher(this.uppy, assemblyIDs)
fileIDs.forEach((fileID) => { | transloadit: add assembly status property to assembly errors | transloadit_uppy | train | js |
d7ac228347e6bc54edd1e29db5c83819f70d501b | diff --git a/sumo/plotting/bs_plotter.py b/sumo/plotting/bs_plotter.py
index <HASH>..<HASH> 100644
--- a/sumo/plotting/bs_plotter.py
+++ b/sumo/plotting/bs_plotter.py
@@ -476,8 +476,7 @@ class SBSPlotter(BSPlotter):
labeltop='off', bottom='off', top='off')
if dos_label is not None:
- ax.yaxis.set_label_position('right')
- ax.set_ylabel(dos_label, rotation=270, labelpad=label_size)
+ ax.set_xlabel(dos_label)
ax.legend(loc=2, frameon=False, ncol=1,
prop={'size': label_size - 3}, | BUG: Move DOS label to x-axis | SMTG-UCL_sumo | train | py |
5d4ae15166a6dadb92d0914f70e130c83260e948 | diff --git a/openquake/engine/supervising/supervisor.py b/openquake/engine/supervising/supervisor.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/supervising/supervisor.py
+++ b/openquake/engine/supervising/supervisor.py
@@ -51,7 +51,7 @@ from openquake.engine.utils import monitor
from openquake.engine.utils import stats
-LOG_FORMAT = ('[%(asctime)s %(calc_domain) #%(calc_id)s %(hostname)s '
+LOG_FORMAT = ('[%(asctime)s %(calc_domain)s #%(calc_id)s %(hostname)s '
'%(levelname)s %(processName)s/%(process)s %(name)s] '
'%(message)s') | supervising/supervisor:
Corrected LOG_FORMAT format string.
Former-commit-id: fb<I>c<I>df<I>c4f<I>e<I>f5fb7f5cf<I> | gem_oq-engine | train | py |
ef35b0c67ac773475b8404015530737cae1c13a3 | diff --git a/app/models/socializer/person.rb b/app/models/socializer/person.rb
index <HASH>..<HASH> 100644
--- a/app/models/socializer/person.rb
+++ b/app/models/socializer/person.rb
@@ -179,7 +179,7 @@ module Socializer
# @example
# current_user.likes?(object)
#
- # @param object [type]
+ # @param [Socializer::ActivityObject] object
#
# @return [TrueClass] if the person likes the object
# @return [FalseClass] if the person does not like the object | Person Model - Unresolved type | socializer_socializer | train | rb |
b06e5e393d853440bdfe4b70994fe1c2d92e9311 | diff --git a/lib/httparty.rb b/lib/httparty.rb
index <HASH>..<HASH> 100644
--- a/lib/httparty.rb
+++ b/lib/httparty.rb
@@ -6,6 +6,7 @@ require 'zlib'
require 'multi_xml'
require 'json'
require 'csv'
+require 'erb'
require 'httparty/module_inheritable_attributes'
require 'httparty/cookie_hash' | Require ERB to prevent errors in HashConversions
(and, possibly, elsewhere) | jnunemaker_httparty | train | rb |
4c01f64e21fd8b041b824864ae785eacfd981c72 | diff --git a/Kwf/Component/PagesMetaRow.php b/Kwf/Component/PagesMetaRow.php
index <HASH>..<HASH> 100644
--- a/Kwf/Component/PagesMetaRow.php
+++ b/Kwf/Component/PagesMetaRow.php
@@ -89,7 +89,7 @@ class Kwf_Component_PagesMetaRow extends Kwf_Model_Db_Row
));
foreach ($pages as $p) {
$row = $this->getModel()->getRow($p->componentId);
- $row->deleteRecursive();
+ if ($row) $row->deleteRecursive();
}
} | Fix deleteRecursive if page is not yet in meta table | koala-framework_koala-framework | train | php |
0f46d0f3595a4cadcdc9268a38f6858c283a6c33 | diff --git a/lib/tetra/project_initer.rb b/lib/tetra/project_initer.rb
index <HASH>..<HASH> 100644
--- a/lib/tetra/project_initer.rb
+++ b/lib/tetra/project_initer.rb
@@ -65,7 +65,7 @@ module Tetra
end
# adds a source archive at the project, both in original and unpacked forms
- def commit_source_archive(file)
+ def commit_source_archive(file, message)
from_directory do
result_dir = File.join(packages_dir, name)
FileUtils.mkdir_p(result_dir)
@@ -81,6 +81,7 @@ module Tetra
end
unarchiver.decompress(file, "src")
+ commit_sources(message, true)
end
end
end
diff --git a/lib/tetra/ui/init_subcommand.rb b/lib/tetra/ui/init_subcommand.rb
index <HASH>..<HASH> 100644
--- a/lib/tetra/ui/init_subcommand.rb
+++ b/lib/tetra/ui/init_subcommand.rb
@@ -22,7 +22,7 @@ module Tetra
if source_archive
puts "Decompressing sources..."
- project.commit_source_archive(File.expand_path(source_archive))
+ project.commit_source_archive(File.expand_path(source_archive), "Inital sources added from archive")
puts "Sources decompressed in #{package_name}/src/, original archive copied in #{package_name}/packages/."
else
puts "Please add sources to src/." | Refactoring: move commit message to ui, where it belongs | moio_tetra | train | rb,rb |
64e1c5b2a8bdb45698db10e46de72793113a9075 | diff --git a/commerce-frontend-taglib/src/main/resources/META-INF/resources/quantity_selector/QuantitySelector.es.js b/commerce-frontend-taglib/src/main/resources/META-INF/resources/quantity_selector/QuantitySelector.es.js
index <HASH>..<HASH> 100644
--- a/commerce-frontend-taglib/src/main/resources/META-INF/resources/quantity_selector/QuantitySelector.es.js
+++ b/commerce-frontend-taglib/src/main/resources/META-INF/resources/quantity_selector/QuantitySelector.es.js
@@ -6,6 +6,7 @@ class QuantitySelector extends Component {
attached() {
this.quantity = this.quantity || this.minQuantity;
+ return this._updateQuantity(this.quantity);
}
syncQuantity() { | COMMERCE-<I> quantity selector not aligned on product card | liferay_com-liferay-commerce | train | js |
c96082cf8326bd75a92388d2eb5ac4e20d8f3edc | diff --git a/pywb/static/wombat.js b/pywb/static/wombat.js
index <HASH>..<HASH> 100644
--- a/pywb/static/wombat.js
+++ b/pywb/static/wombat.js
@@ -447,6 +447,12 @@ var wombat_internal = function($wbwindow) {
this._parser = make_parser(href);
}
+ //Special case for href="." assignment
+ if (prop == "href" && typeof(value) == "string" && value[0] == ".") {
+ this._parser.href = $wbwindow.document.baseURI;
+ value = this._parser.href;
+ }
+
try {
this._parser[prop] = value;
} catch (e) { | wobmat rewrite: support "a.href = '.'" properly even if trailing / missing | webrecorder_pywb | train | js |
08e588e3770ee262b16ea53e2a160908a7eca561 | diff --git a/ciscosparkapi/api/memberships.py b/ciscosparkapi/api/memberships.py
index <HASH>..<HASH> 100644
--- a/ciscosparkapi/api/memberships.py
+++ b/ciscosparkapi/api/memberships.py
@@ -260,7 +260,8 @@ class MembershipsAPI(object):
value = utf8(value)
put_data[utf8(param)] = value
# API request
- json_obj = self.session.post('memberships', json=put_data)
+ json_obj = self.session.post('memberships/'+membershipId,
+ json=put_data)
# Return a Membership object created from the response JSON data
return Membership(json_obj)
diff --git a/ciscosparkapi/api/rooms.py b/ciscosparkapi/api/rooms.py
index <HASH>..<HASH> 100644
--- a/ciscosparkapi/api/rooms.py
+++ b/ciscosparkapi/api/rooms.py
@@ -229,7 +229,7 @@ class RoomsAPI(object):
value = utf8(value)
put_data[utf8(param)] = value
# API request
- json_obj = self.session.post('rooms', json=put_data)
+ json_obj = self.session.post('rooms/'+roomId, json=put_data)
# Return a Room object created from the response JSON data
return Room(json_obj) | Squash bugs
Add missing ID suffixes to URLs on update methods. | CiscoDevNet_webexteamssdk | train | py,py |
c0e04b4957f8c19cdea5046cd8b4ef8349a7a457 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -61,7 +61,7 @@ release = "1.0"
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
-language = None
+language = "en"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. | Set language to "en" for documentation | adafruit_Adafruit_CircuitPython_OneWire | train | py |
d4a8a160ae93b00a77f3fbdb68407b66421056a7 | diff --git a/lib/eye/patch/version.rb b/lib/eye/patch/version.rb
index <HASH>..<HASH> 100644
--- a/lib/eye/patch/version.rb
+++ b/lib/eye/patch/version.rb
@@ -1,5 +1,5 @@
module Eye
module Patch
- VERSION = "0.0.5"
+ VERSION = "0.0.6"
end
end | Bump gem version to include load changes on deploy | tablexi_eye-patch | train | rb |
469f9e0f9a1b241027b781c84c31b58e0ce85805 | diff --git a/app/models/no_cms/menus/menu.rb b/app/models/no_cms/menus/menu.rb
index <HASH>..<HASH> 100644
--- a/app/models/no_cms/menus/menu.rb
+++ b/app/models/no_cms/menus/menu.rb
@@ -2,7 +2,7 @@ module NoCms::Menus
class Menu < ActiveRecord::Base
translates :name
- has_many :menu_items
+ has_many :menu_items, dependent: :destroy
accepts_nested_attributes_for :menu_items, allow_destroy: true
validates :name, :uid, presence: true | We destroy menu_items when the menu is destroyed | simplelogica_nocms-menus | train | rb |
f7be336afe172280c3d85cbac107a170eca7c96b | diff --git a/will/backends/io_adapters/slack.py b/will/backends/io_adapters/slack.py
index <HASH>..<HASH> 100644
--- a/will/backends/io_adapters/slack.py
+++ b/will/backends/io_adapters/slack.py
@@ -353,7 +353,7 @@ class SlackBackend(IOBackend, SleepMixin, StorageMixin):
})
if hasattr(event, "kwargs") and "html" in event.kwargs and event.kwargs["html"]:
data.update({
- "parse": "full",
+ "parse": "none",
})
headers = {'Accept': 'text/plain'} | Change parse option from full to none in Slack, this will not format html messages | skoczen_will | train | py |
e15d8e7912d183085304af317b43dede2cfa671a | diff --git a/psiturk/experiment.py b/psiturk/experiment.py
index <HASH>..<HASH> 100644
--- a/psiturk/experiment.py
+++ b/psiturk/experiment.py
@@ -364,7 +364,7 @@ def start_exp():
raise ExperimentError('already_did_exp_hit')
if debug_mode:
- ad_server_location = ''
+ ad_server_location = '/complete'
else:
# if everything goes ok here relatively safe to assume we can lookup the ad
ad_id = get_ad_via_hitid(hitId) | gets rid of error messages that was appear and end of debug sequence | NYUCCL_psiTurk | train | py |
b3044dfeca8275ec8ba544d91d734c1e03ff9ac9 | diff --git a/server/conf.go b/server/conf.go
index <HASH>..<HASH> 100644
--- a/server/conf.go
+++ b/server/conf.go
@@ -16,7 +16,6 @@ package server
import (
"flag"
"fmt"
- "io/ioutil"
"reflect"
"strconv"
"strings"
@@ -31,11 +30,7 @@ import (
// ProcessConfigFile parses the configuration file `configFile` and updates
// the given Streaming options `opts`.
func ProcessConfigFile(configFile string, opts *Options) error {
- data, err := ioutil.ReadFile(configFile)
- if err != nil {
- return err
- }
- m, err := conf.Parse(string(data))
+ m, err := conf.ParseFile(configFile)
if err != nil {
return err
} | [FIXED] Possible issue with confi files using include directive
This was observed in the context of Docker.
Resolves #<I> | nats-io_nats-streaming-server | train | go |
9c9bf372b5cfa8aa6ce391e1733af1184b733ea0 | diff --git a/lib/LitleOnlineRequest.rb b/lib/LitleOnlineRequest.rb
index <HASH>..<HASH> 100755
--- a/lib/LitleOnlineRequest.rb
+++ b/lib/LitleOnlineRequest.rb
@@ -264,7 +264,7 @@ module LitleOnline
request.authentication = authentication
request.merchantId = get_merchant_id(options)
- request.version = '10.1'
+ request.version = '11.0'
request.loggedInUser = get_logged_in_user(options)
request.xmlns = "http://www.litle.com/schema"
request.merchantSdk = get_merchant_sdk(options)
@@ -294,7 +294,7 @@ module LitleOnline
end
def get_merchant_sdk(options)
- options['merchantSdk'] || 'Ruby;10.1'
+ options['merchantSdk'] || 'Ruby;11.0'
end
def get_report_group(options) | Change XML and SDK version | Vantiv_litle-sdk-for-ruby | train | rb |
7ec2adb94fd39ede4d2bb0f54d1d47ebd68ea00f | diff --git a/model_organization/__init__.py b/model_organization/__init__.py
index <HASH>..<HASH> 100644
--- a/model_organization/__init__.py
+++ b/model_organization/__init__.py
@@ -1,5 +1,6 @@
from __future__ import print_function, division
import os
+import sys
import glob
import copy
import os.path as osp
@@ -530,7 +531,11 @@ class ModelOrganizer(object):
return
def tar_add(path, file_obj):
- file_obj.add(path, self.relpath(path), exclude=to_exclude)
+ if sys.version_info[:2] < (3, 7):
+ file_obj.add(path, self.relpath(path), exclude=to_exclude)
+ else:
+ file_obj.add(path, self.relpath(path),
+ filter=lambda f: None if to_exclude(f) else f)
def zip_add(path, file_obj):
# ziph is zipfile handle | Compatibility fix for py<I> in TarFile.add | Chilipp_model-organization | train | py |
73d59eeb49a1dd89426ce30a1054e70b9ad85dc5 | diff --git a/PyFunceble/query/http_status_code.py b/PyFunceble/query/http_status_code.py
index <HASH>..<HASH> 100644
--- a/PyFunceble/query/http_status_code.py
+++ b/PyFunceble/query/http_status_code.py
@@ -357,7 +357,11 @@ class HTTPStatusCode:
req.url
).get_converted()
- if not self.allow_redirects and first_origin != final_origin:
+ if (
+ not self.allow_redirects
+ and first_origin != final_origin
+ and req.history
+ ):
return req.history[0].status_code
return req.status_code | Fix issue when the history is empty.
Indeed, in some rare cases, the history may be empty.
This patch fixes the issue by checking if the history is filled with data.
Contributors:
* @mitchellkrogza | funilrys_PyFunceble | train | py |
45f47c39875d3a92ab722733f6642624f74b9ecb | diff --git a/secretballot/views.py b/secretballot/views.py
index <HASH>..<HASH> 100644
--- a/secretballot/views.py
+++ b/secretballot/views.py
@@ -2,6 +2,8 @@ from django.template import loader, RequestContext
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseRedirect, Http404,
HttpResponseForbidden)
+from django.db.models import Model, get_model
+from django.contrib.contenttypes.models import ContentType
from secretballot.models import Vote
def vote(request, content_type, object_id, vote, can_vote_test=None,
@@ -13,6 +15,15 @@ def vote(request, content_type, object_id, vote, can_vote_test=None,
raise ImproperlyConfigured('To use secretballot a SecretBallotMiddleware must be installed. (see secretballot/middleware.py)')
token = request.secretballot_token
+ if isinstance(content_type, ContentType)
+ pass
+ elif isinstance(content_type, Model):
+ content_type = ContentType.objects.get_for_model(content_type)
+ elif isinstance(content_type, basestring) and '.' in content_type:
+ content_type = ContentType.objects.get(app_label=app, model__iexact=modelname)
+ else:
+ raise ValueError('content_type must be an instance of ContentType, a model, or "app.modelname" string')
+
# do the action
if vote: | made content_type argument to view more flexible | jamesturk_django-secretballot | train | py |
a7083c5688e1f0da883c4d5a98a68e1c96fafdef | diff --git a/lib/workers/branch/index.js b/lib/workers/branch/index.js
index <HASH>..<HASH> 100644
--- a/lib/workers/branch/index.js
+++ b/lib/workers/branch/index.js
@@ -61,7 +61,7 @@ async function processBranch(branchConfig) {
}). You will still receive a PR once a newer version is released, so if you wish to permanently ignore this dependency, please add it to the \`ignoreDeps\` array of your renovate config.`;
}
content +=
- '\n\nIf this PR was closed by mistake or you changed your mind, you can simply reopen or rename it to reactivate Renovate for this dependency version.';
+ '\n\nIf this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.';
await platform.ensureComment(pr.number, subject, content);
if (branchExists) {
await platform.deleteBranch(config.branchName); | refactor: Recommend blocking PRs be renamed and not reopened | renovatebot_renovate | train | js |
c3c04fdc67f5404be68a8ada60840340caa1fc73 | diff --git a/qng/generator.py b/qng/generator.py
index <HASH>..<HASH> 100644
--- a/qng/generator.py
+++ b/qng/generator.py
@@ -1,3 +1,4 @@
+import copy
import json
import operator
import os
@@ -90,13 +91,15 @@ class QuebNameGenerator:
return names
def _get_male_names(self):
- names = [name for name in self._names if name['gender'] == 'male']
+ names = copy.deepcopy(self._names)
+ names = [name for name in names if name['gender'] == 'male']
names = self._compute_weights(names)
return names
def _get_female_names(self):
- names = [name for name in self._names if name['gender'] == 'female']
+ names = copy.deepcopy(self._names)
+ names = [name for name in names if name['gender'] == 'female']
names = self._compute_weights(names)
return names | Fix: deepcopy dictionaries for gendered lists | abusque_qng | train | py |
622eecc1ded70b7e8c5c04ec8670d453847a7522 | diff --git a/gothic/gothic.go b/gothic/gothic.go
index <HASH>..<HASH> 100644
--- a/gothic/gothic.go
+++ b/gothic/gothic.go
@@ -200,23 +200,15 @@ func getProviderName(req *http.Request) (string, error) {
}
func storeInSession(key string, value string, req *http.Request, res http.ResponseWriter) error {
- session, err := Store.Get(req, key + SessionName)
- if err != nil {
- return err
- }
+ session, _ := Store.Get(req, key + SessionName)
session.Values[key] = value
- err = session.Save(req, res)
-
- return err
+ return session.Save(req, res)
}
func getFromSession(key string, req *http.Request) (string, error) {
- session, err := Store.Get(req, key + SessionName)
- if err != nil {
- return "", err
- }
+ session, _ := Store.Get(req, key + SessionName)
value := session.Values[key]
if value == nil { | ignore errors when session is not yet registered (otherwise it will give an error on first attempt to use the new provider) | markbates_goth | train | go |
733f576b20da8bacf4ef5813745d1a49107b970f | diff --git a/src/aria/resources/DateRes_vi_VN.js b/src/aria/resources/DateRes_vi_VN.js
index <HASH>..<HASH> 100644
--- a/src/aria/resources/DateRes_vi_VN.js
+++ b/src/aria/resources/DateRes_vi_VN.js
@@ -27,8 +27,15 @@ Aria.resourcesDefinition({
],
// a false value for the following items mean: use substring
// to generate the short versions of days or months
- dayShort : false,
- monthShort : false,
+ dayShort : [
+ "CN",
+ "T2",
+ "T3",
+ "T4",
+ "T5",
+ "T6",
+ "T7"
+ ],
month : [
"Tháng một",
"Tháng hai",
@@ -42,6 +49,20 @@ Aria.resourcesDefinition({
"Tháng mười",
"Tháng mười một",
"Tháng mười hai"
+ ],
+ monthShort : [
+ "Th1",
+ "Th2",
+ "Th3",
+ "Th4",
+ "Th5",
+ "Th6",
+ "Th7",
+ "Th8",
+ "Th9",
+ "Th10",
+ "Th11",
+ "Th12"
]
}
}); | fix Add the short day/month translations for VN
close #<I> | ariatemplates_ariatemplates | train | js |
ace23372dc6ea6d9670d19a40ac11768e8baf03c | diff --git a/phpUnitTests/bootstrap.php b/phpUnitTests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/phpUnitTests/bootstrap.php
+++ b/phpUnitTests/bootstrap.php
@@ -1,3 +1,3 @@
<?php
-require_once __DIR__.'/../example/init.inc.php';
+(include_once __DIR__.'/../vendor/autoload.php') OR die(PHP_EOL.'ERROR: composer autoloader not found, run "composer install" or see README for instructions'.PHP_EOL); | Use composer autoloader (or complain if missing) | graphp_graph | train | php |
2b91e6560489e754112df8ef5ee283678f00df9d | diff --git a/src/Arr.php b/src/Arr.php
index <HASH>..<HASH> 100644
--- a/src/Arr.php
+++ b/src/Arr.php
@@ -80,7 +80,7 @@ class Arr
if (count($keys) === 1) {
if ($firstKey === '*') {
return $array;
- } else if (isset($array[$firstKey])) {
+ } else if (array_key_exists($firstKey, $array) === true) {
return $array[$firstKey];
} else {
$instance->keys[] = $firstKey;
@@ -108,7 +108,7 @@ class Arr
return $value;
} else if (is_numeric($firstKey) === true && is_int((int) $firstKey) === true) {
- if (isset($array[$firstKey]) === true) {
+ if (array_key_exists($firstKey, $array) === true) {
$value = $array[$firstKey];
return static::_traverse($instance, $value, $otherKeys);
@@ -116,7 +116,7 @@ class Arr
throw new OutOfBoundsException("Undefined offset: {$instance->_key()}");
}
} else {
- if (isset($array[$firstKey]) === true) {
+ if (array_key_exists($firstKey, $array) === true) {
$value = $array[$firstKey];
if (is_array($value) === false) { | fixed a bug when a null value was considered not existing | khalyomede_array-get | train | php |
08cc5f3d8a607226f801a4d15eb8bf0c754e895d | diff --git a/warehouse/filters.py b/warehouse/filters.py
index <HASH>..<HASH> 100644
--- a/warehouse/filters.py
+++ b/warehouse/filters.py
@@ -132,7 +132,7 @@ def format_classifiers(classifiers):
if value:
structured[key].append(value[0])
- # Go thorugh and ensure that all of the lists in our classifiers are in
+ # Go through and ensure that all of the lists in our classifiers are in
# sorted order.
structured = {k: sorted(v) for k, v in structured.items()} | Fix simple typo: thorugh -> through (#<I>)
Closes #<I> | pypa_warehouse | train | py |
ef40bb25fdf8eacb0fb2e9ff664274c5da3cec24 | diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Grav.php
+++ b/system/src/Grav/Common/Grav.php
@@ -209,7 +209,9 @@ class Grav extends Container
$this->fireEvent('onPagesInitialized');
$debugger->stopTimer('pages');
+ $debugger->startTimer('pageinit', 'Page Initialized');
$this->fireEvent('onPageInitialized');
+ $debugger->stopTimer('pageinit');
$debugger->addAssets(); | added a timer around pageInitialized event | getgrav_grav | train | php |
8d605b8ee84125fe623832f39d055e52130bb590 | diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1690,7 +1690,7 @@ module ActionDispatch
end
def shallow_nesting_depth #:nodoc:
- @nesting.select(&:shallow?).size
+ @nesting.count(&:shallow?)
end
def param_constraint? #:nodoc: | A shorter and more concise version of select..size | rails_rails | train | rb |
35ba710d0d0db60dde0667922cff2770adf6a378 | diff --git a/sentry/models.py b/sentry/models.py
index <HASH>..<HASH> 100644
--- a/sentry/models.py
+++ b/sentry/models.py
@@ -8,6 +8,8 @@ except ImportError:
import logging
import math
+from datetime import datetime
+
from django.conf import settings
from django.db import models
from django.db.models import Count
@@ -64,7 +66,7 @@ class GzippedDictField(models.TextField):
class MessageBase(Model):
logger = models.CharField(max_length=64, blank=True, default='root', db_index=True)
- timestamp = models.DateTimeField(auto_now_add=True, db_index=True)
+ timestamp = models.DateTimeField(editable=False, default=datetime.now)
class_name = models.CharField(_('type'), max_length=128, blank=True, null=True, db_index=True)
level = models.PositiveIntegerField(choices=conf.LOG_LEVELS, default=logging.ERROR, blank=True, db_index=True)
message = models.TextField() | added the field timestamp to the MessageBase model.
not editable, defaults to `now`. | elastic_apm-agent-python | train | py |
8b736bc4997ffb6767cab6d611a1226f275f4be0 | diff --git a/example/project/settings.py b/example/project/settings.py
index <HASH>..<HASH> 100644
--- a/example/project/settings.py
+++ b/example/project/settings.py
@@ -22,8 +22,6 @@ SECRET_KEY = 'qpd-psx8c+xna6!sg^@k)b3h@=hog+gwpu#z%*^(vat3=d&i1z'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
-TEMPLATE_DEBUG = True
-
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates', | remove depricated settings from example | sv0_django-markdown-app | train | py |
f9b4009db1b0a633e17a524c6d2b71d2d902bc2c | diff --git a/pf/html/admin/person/lookup.php b/pf/html/admin/person/lookup.php
index <HASH>..<HASH> 100644
--- a/pf/html/admin/person/lookup.php
+++ b/pf/html/admin/person/lookup.php
@@ -24,7 +24,13 @@ if($view_item){
$person_view = new table("person view $view_item");
if($person_view->rows[0]['pid'] == $view_item){
- $lookup['name'] = $person_view->rows[0]['pid'];
+ $lookup['pid'] = $person_view->rows[0]['pid'];
+ $lookup['firstname'] = $person_view->rows[0]['firstname'];
+ $lookup['lastname'] = $person_view->rows[0]['lastname'];
+ $lookup['email'] = $person_view->rows[0]['email'];
+ $lookup['telephone'] = $person_view->rows[0]['telephone'];
+ $lookup['company'] = $person_view->rows[0]['company'];
+ $lookup['address'] = $person_view->rows[0]['address'];
$lookup['notes'] = $person_view->rows[0]['notes'];
$node_view = new table("node view pid=$view_item"); | added the new fields in the person table to person lookup
in web admin GUI
Monotone-Parent: <I>cd9daafbfc<I>e7bd<I>f<I>bdd<I>b<I>
Monotone-Revision: e<I>c<I>bf<I>d1b<I>d<I>d3fc4cfcfc0a<I>d
Monotone- | inverse-inc_packetfence | train | php |
b8922363ef5df154eb31786036052e6d24d3c072 | diff --git a/Classes/Controller/JsonadmController.php b/Classes/Controller/JsonadmController.php
index <HASH>..<HASH> 100644
--- a/Classes/Controller/JsonadmController.php
+++ b/Classes/Controller/JsonadmController.php
@@ -21,9 +21,6 @@ use Zend\Diactoros\Response;
*/
class JsonadmController extends AbstractController
{
- private static $aimeos;
-
-
/**
* Initializes the object before the real action is called.
*/
@@ -148,7 +145,7 @@ class JsonadmController extends AbstractController
protected function createClient( $resource )
{
$context = $this->getContextBackend( 'admin/jsonadm/templates' );
- return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, [], $resource );
+ return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, Base::getAimeos(), $resource );
} | Pass Aimeos object instead of template paths to JsonAdm clients | aimeos_aimeos-typo3 | train | php |
b9851e1b6f1d30d08682fc9a575846b3bada0ada | diff --git a/jquery.geocomplete.js b/jquery.geocomplete.js
index <HASH>..<HASH> 100644
--- a/jquery.geocomplete.js
+++ b/jquery.geocomplete.js
@@ -205,6 +205,7 @@
this.find();
}, this));
+ // Saves the previous input value
this.$input.bind('geocode:result.' + this._name, $.proxy(function(){
this.lastInputVal = this.$input.val();
}, this));
@@ -218,11 +219,7 @@
if (this.options.geocodeAfterResult === true && this.selected === true) { return; }
if (this.options.restoreValueAfterBlur === true && this.selected === true) {
- var _this = this;
-
- setTimeout(function() {
- _this.$input.val(_this.lastInputVal);
- }, 0);
+ setTimeout($.proxy(this.restoreLastValue, this), 0);
} else {
this.find();
}
@@ -336,6 +333,11 @@
return firstResult;
},
+ // Restores the input value using the previous value if it exists
+ restoreLastValue: function() {
+ if (this.lastInputVal){ this.$input.val(this.lastInputVal); }
+ },
+
// Handles the geocode response. If more than one results was found
// it triggers the "geocode:multiple" events. If there was an error
// the "geocode:error" event is fired. | Add comments and refactor to use proxy instead of _this | ubilabs_geocomplete | train | js |
edd99286d14b9cfa5ea18b6c024ad6cfc16f5289 | diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -327,8 +327,9 @@ Server.prototype._onInstanceRequest = function(instanceId, req, callback) {
};
Server.prototype._onInstanceListening = function(instanceId, address) {
+ var host = address.address || '*';
console.log('%s: Service "%s" listening on %s:%d', this._cmdName,
- instanceId, address.address, address.port);
+ instanceId, host, address.port);
};
Server.prototype.start = function start(cb) { | server: print listening host correctly
It used to print:
sl-pm: Service "1" listening on null:<I> | strongloop_strong-pm | train | js |
0c8ec38ddab31f16f4c51a66860b234fb951b218 | diff --git a/isso/js/app/isso.js b/isso/js/app/isso.js
index <HASH>..<HASH> 100644
--- a/isso/js/app/isso.js
+++ b/isso/js/app/isso.js
@@ -89,10 +89,6 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n",
if(rv.hidden_replies > 0) {
insert_loader(rv, lastcreated);
}
-
- if (window.location.hash.length > 0) {
- $(window.location.hash).scrollIntoView();
- }
},
function(err) {
console.log(err); | don't scrollIntoView on expanding comments
A regression introduced in <I>ee6a<I> | posativ_isso | train | js |
052fbe5cdd092b32c59b52f4aea0a0088959c32a | diff --git a/aioftp/server.py b/aioftp/server.py
index <HASH>..<HASH> 100644
--- a/aioftp/server.py
+++ b/aioftp/server.py
@@ -529,6 +529,7 @@ class BaseServer:
loop=self.loop,
extra_workers=set(),
response=lambda *args: response_queue.put_nowait(args),
+ acquired=False,
_dispatcher=asyncio.Task.current_task(loop=self.loop),
)
@@ -608,7 +609,10 @@ class BaseServer:
writer.close()
- self.available_connections[self].release()
+ if connection.acquired:
+
+ self.available_connections[self].release()
+
if connection.future.user.done():
self.available_connections[connection.user].release()
@@ -931,6 +935,7 @@ class Server(BaseServer):
else:
ok, code, info = True, "220", "welcome"
+ connection.acquired = True
self.available_connections[self].acquire()
connection.response(code, info) | connection.acquired state for not to release not acquired semaphore | aio-libs_aioftp | train | py |
cdd3b44ed6113e6e682a4a4adf71837a4857902d | diff --git a/tests/test_parser.py b/tests/test_parser.py
index <HASH>..<HASH> 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -54,7 +54,7 @@ try:
except ImportError:
pass
-sys.stderr.write('Testing trees '+ " ".join(treeTypes.keys()))
+sys.stdout.write('Testing trees '+ " ".join(treeTypes.keys()) + "\n")
#Run the parse error checks
checkParseErrors = False | Send output to stdout, make it appear on its own line
--HG--
extra : convert_revision : svn%3Aacbfec<I>-<I>-<I>-a<I>-<I>a<I>e<I>e0/trunk%<I> | html5lib_html5lib-python | train | py |
48bd69817dc3f4c970e7fcd03570a0b1a3b6fd1b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -349,7 +349,7 @@ THREE.Projector = function () {
_object.object = object;
_vector3.setFromMatrixPosition( object.matrixWorld );
- _vector3.applyProjection( _viewProjectionMatrix );
+ _vector3.applyMatrix4( _viewProjectionMatrix );
_object.z = _vector3.z;
_object.renderOrder = object.renderOrder;
@@ -2050,4 +2050,4 @@ THREE.CanvasRenderer = function ( parameters ) {
};
-module.exports = THREE;
\ No newline at end of file
+module.exports = THREE; | Fix warning about deprecation of `applyProjection`
This prevents a bunch of console spew about deprecated function calls. | Ramshackle-Jamathon_three-canvas-renderer | train | js |
15e16f13e176cf15d91cf084720a4bc33cf926d6 | diff --git a/admin/javascript/LeftAndMain.Content.js b/admin/javascript/LeftAndMain.Content.js
index <HASH>..<HASH> 100644
--- a/admin/javascript/LeftAndMain.Content.js
+++ b/admin/javascript/LeftAndMain.Content.js
@@ -150,7 +150,10 @@
formData.push({name: 'BackURL', value:History.getPageUrl()});
jQuery.ajax(jQuery.extend({
- headers: {"X-Pjax" : "CurrentForm"},
+ headers: {
+ "X-Pjax" : "CurrentForm",
+ 'X-Pjax-Selector': '.cms-edit-form'
+ },
url: form.attr('action'),
data: formData,
type: 'POST', | MINOR Retaining correct PJAX selector on (fake) redirects after form submissions | silverstripe_silverstripe-framework | train | js |
513e6dc2ad7cd5492904660907b893b25edc995d | diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/traversal.rb b/middleman-core/lib/middleman-core/sitemap/extensions/traversal.rb
index <HASH>..<HASH> 100644
--- a/middleman-core/lib/middleman-core/sitemap/extensions/traversal.rb
+++ b/middleman-core/lib/middleman-core/sitemap/extensions/traversal.rb
@@ -68,6 +68,9 @@ module Middleman
# (e.g., if the resource is named 'gallery.html' and a path exists named 'gallery/', this would return true)
# @return [Boolean]
def eponymous_directory?
+ if !path.end_with?("/#{app.index_file}") && destination_path.end_with?("/#{app.index_file}")
+ return true
+ end
full_path = File.join(app.source_dir, eponymous_directory_path)
!!(File.exists?(full_path) && File.directory?(full_path))
end | Attempt a fix for #<I> | middleman_middleman | train | rb |
60e61927fc0d036a958adb84a97b2ade18041b3a | diff --git a/prometheus/graphite/bridge.go b/prometheus/graphite/bridge.go
index <HASH>..<HASH> 100644
--- a/prometheus/graphite/bridge.go
+++ b/prometheus/graphite/bridge.go
@@ -182,9 +182,12 @@ func (b *Bridge) Push() error {
}
func writeMetrics(w io.Writer, mfs []*dto.MetricFamily, prefix string, now model.Time) error {
- vec := expfmt.ExtractSamples(&expfmt.DecodeOptions{
+ vec, err := expfmt.ExtractSamples(&expfmt.DecodeOptions{
Timestamp: now,
}, mfs...)
+ if err != nil {
+ return err
+ }
buf := bufio.NewWriter(w)
for _, s := range vec { | graphite: Adjust ExtractSamples call to new interface | prometheus_client_golang | train | go |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.