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
d43f091a2bc8d3f22d67b81c9e4f224c0680f1dd
diff --git a/generators/model/Generator.php b/generators/model/Generator.php index <HASH>..<HASH> 100644 --- a/generators/model/Generator.php +++ b/generators/model/Generator.php @@ -543,6 +543,8 @@ class Generator extends \yii\gii\Generator $db = $this->getDbConnection(); $patterns = []; + $patterns[] = "/^{$db->tablePrefix}(.*?)$/"; + $patterns[] = "/^(.*?){$db->tablePrefix}$/"; if (strpos($this->tableName, '*') !== false) { $pattern = $this->tableName; if (($pos = strrpos($pattern, '.')) !== false) { @@ -550,8 +552,6 @@ class Generator extends \yii\gii\Generator } $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/'; } - $patterns[] = "/^{$db->tablePrefix}(.*?)$/"; - $patterns[] = "/^(.*?){$db->tablePrefix}$/"; $className = $tableName; foreach ($patterns as $pattern) { if (preg_match($pattern, $tableName, $matches)) {
Ensure that the table prefix is used when generating the class name.
yiisoft_yii2-gii
train
php
d95057a0ffba6f7192cb6789a9b072e5ab4b9f64
diff --git a/jira/client.py b/jira/client.py index <HASH>..<HASH> 100755 --- a/jira/client.py +++ b/jira/client.py @@ -760,10 +760,11 @@ class JIRA(object): if relationship is not None: data['relationship'] = relationship + # check if the link comes from one of the configured application links for x in self.applicationlinks(): - if x['displayUrl'] == self._options['server']: - data['globalId'] = "appId=%s&issueId=%s" % (x['id'], destination.raw['id']) - data['application'] = {'name': x['name'], 'type': "com.atlassian.jira"} + if x['application']['displayUrl'] == self._options['server']: + data['globalId'] = "appId=%s&issueId=%s" % (x['application']['id'], destination.raw['id']) + data['application'] = {'name': x['application']['name'], 'type': "com.atlassian.jira"} break url = self._get_url('issue/' + str(issue) + '/remotelink')
bugfix of KeyError in JIRA.add_remote_link during check of application links
pycontribs_jira
train
py
b4e829eb9f335f478bab66c948d740c1f095adeb
diff --git a/packages/react-atlas-core/src/Dropdown/Dropdown.js b/packages/react-atlas-core/src/Dropdown/Dropdown.js index <HASH>..<HASH> 100644 --- a/packages/react-atlas-core/src/Dropdown/Dropdown.js +++ b/packages/react-atlas-core/src/Dropdown/Dropdown.js @@ -123,10 +123,10 @@ class Dropdown extends React.PureComponent { function() { this._validationHandler(this.props.errorCallback); if (this.props.onChange) { - this.props.onChange(inputValue, event, this.state.isValid); + this.props.onChange(inputValue, event, this.state.isValid, this.props.name); } if (this.props.onClick) { - this.props.onClick(inputValue, event, this.state.isValid); + this.props.onClick(inputValue, event, this.state.isValid, this.props.name); } } );
adding name prop to onChange and onClick callbacks (#<I>)
DigitalRiver_react-atlas
train
js
230692f769921bd46995fe0832b0ddc31b3e52bd
diff --git a/integration/ec2_test.go b/integration/ec2_test.go index <HASH>..<HASH> 100644 --- a/integration/ec2_test.go +++ b/integration/ec2_test.go @@ -411,8 +411,7 @@ func TestEC2Labels(t *testing.T) { } // TestEC2Hostname is an integration test which asserts that Teleport sets its -// hostname if the EC2 tag `TeleportHostname` is available. This test must be -// run on an instance with tag `TeleportHostname=fakehost.example.com`. +// hostname if the EC2 tag `TeleportHostname` is available. func TestEC2Hostname(t *testing.T) { teleportHostname := "fakehost.example.com" diff --git a/lib/labels/ec2/ec2.go b/lib/labels/ec2/ec2.go index <HASH>..<HASH> 100644 --- a/lib/labels/ec2/ec2.go +++ b/lib/labels/ec2/ec2.go @@ -87,7 +87,11 @@ func New(ctx context.Context, c *Config) (*EC2, error) { func (l *EC2) Get() map[string]string { l.mu.RLock() defer l.mu.RUnlock() - return l.labels + labels := make(map[string]string) + for k, v := range l.labels { + labels[k] = v + } + return labels } // Apply adds EC2 labels to the provided resource.
Fix EC2 labels concurrent write (#<I>) This change fixes a bug in EC2 labels (#<I>) involving concurrent writes to the labels map. This is fixed by making EC2.Get() return a copy instead of the actual label map.
gravitational_teleport
train
go,go
b3ec2e489aa18497e3e1dbdc6ced4b2f1c62f824
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,2 +1,5 @@ //= require angular //= require cortex +//= require jquery +//= require jquery_ujs +//= require bootstrap
Added jquery, jquery_ujs and bootstrap dependancies to application.js
cortex-cms_cortex
train
js
f9ee4affcb01ad5daf481387ed63db9d68b4a803
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLUpdate.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLUpdate.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLUpdate.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLUpdate.java @@ -238,12 +238,14 @@ public class OCommandExecutorSQLUpdate extends OCommandExecutorSQLSetAware imple pair = entry.getValue(); - if (pair.getValue() instanceof OSQLFilterItem) - pair.setValue(((OSQLFilterItem) pair.getValue()).getValue(record, null)); + v = pair.getValue(); + + if (v instanceof OSQLFilterItem) + v = ((OSQLFilterItem) v).getValue(record, null); else if (pair.getValue() instanceof OSQLFunctionRuntime) - v = ((OSQLFunctionRuntime) pair.getValue()).execute(record, this); + v = ((OSQLFunctionRuntime) v).execute(record, this); - map.put(pair.getKey(), pair.getValue()); + map.put(pair.getKey(), v); recordUpdated = true; } }
Fixed bug reported by Ervis on SQL update with PUT: the value wasn't computed every time but only once.
orientechnologies_orientdb
train
java
26bd14b920e271327c1a83c85d85aeee265335f4
diff --git a/internetarchive/api.py b/internetarchive/api.py index <HASH>..<HASH> 100644 --- a/internetarchive/api.py +++ b/internetarchive/api.py @@ -476,6 +476,14 @@ def configure(username=None, password=None): def get_username(access_key, secret_key): + """Returns an Archive.org username given an IA-S3 key pair. + + :type access_key: str + :param access_key: IA-S3 access_key to use when making the given request. + + :type secret_key: str + :param secret_key: IA-S3 secret_key to use when making the given request. + """ u = 'https://s3.us.archive.org' p = dict(check_auth=1) r = requests.get(u, params=p, auth=auth.S3Auth(access_key, secret_key))
Added docstring to get_username
jjjake_internetarchive
train
py
3eb4c76dee909e6bdacf5aede6a3a52b2808566e
diff --git a/mongoctl/mongoctl.py b/mongoctl/mongoctl.py index <HASH>..<HASH> 100644 --- a/mongoctl/mongoctl.py +++ b/mongoctl/mongoctl.py @@ -2392,9 +2392,6 @@ def kill_process(pid, force=False): def mongoctl_signal_handler(signal_val, frame): global __mongod_process__ - # if there is no mongod server yet then exit - if __mongod_process__ is None: - exit(0) # otherwise prompt to kill server global __child_subprocesses__ @@ -2414,8 +2411,12 @@ def mongoctl_signal_handler(signal_val, frame): map(kill_child, __child_subprocesses__) exit(0) - prompt_execute_task("Kill server '%s'?" % __current_server__.get_id(), - exit_mongoctl) + # if there is no mongod server yet then exit + if __mongod_process__ is None: + exit_mongoctl() + else: + prompt_execute_task("Kill server '%s'?" % __current_server__.get_id(), + exit_mongoctl) ############################################################################### # Register the global mongoctl signal handler
ensure killing all forked processes on interrupt exit
mongolab_mongoctl
train
py
dca596e1afb038c6a20052a257e80197ef93e6ea
diff --git a/src/pyrocore/torrent/matching.py b/src/pyrocore/torrent/matching.py index <HASH>..<HASH> 100644 --- a/src/pyrocore/torrent/matching.py +++ b/src/pyrocore/torrent/matching.py @@ -247,13 +247,13 @@ class TimeFilter(NumericFilterBase): # Fall back to ISO fmt = "%Y-%m-%d" - self._value = self._value.replace(' ', 'T') - if 'T' in self._value: + val = self._value.upper().replace(' ', 'T') + if 'T' in val: # Time also given - fmt += "T%H:%M:%S"[:3+3*self._value.count(':')] + fmt += "T%H:%M:%S"[:3+3*val.count(':')] try: - timestamp = time.mktime(time.strptime(self._value, fmt)) + timestamp = time.mktime(time.strptime(val, fmt)) except (ValueError), exc: raise FilterError("Bad timestamp value %r in %r (%s)" % (self._value, self._condition, exc))
accept lower-case T in time specs
pyroscope_pyrocore
train
py
ee2f95d297de30d6818f985f0ca213d5645826b8
diff --git a/lib/arjdbc/db2/adapter.rb b/lib/arjdbc/db2/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/db2/adapter.rb +++ b/lib/arjdbc/db2/adapter.rb @@ -328,6 +328,17 @@ module ArJdbc select_one(sql).nil? end + # @override + def primary_keys(table) + # If no schema in table name is given but present in URL parameter. Use the URL parameter one + # This avoids issues if the table is present in multiple schemas + if table.split(".").size == 1 && schema + table = "#{schema}.#{table}" + end + + super + end + def next_sequence_value(sequence_name) select_value("SELECT NEXT VALUE FOR #{sequence_name} FROM sysibm.sysdummy1") end
Solve issue with same table name present in different schemas. primary_key will return an array because of that
jruby_activerecord-jdbc-adapter
train
rb
9155a994ead33e67f5660978981627640d9487b4
diff --git a/eZ/Publish/API/Repository/Tests/Stubs/Values/Content/VersionInfoStub.php b/eZ/Publish/API/Repository/Tests/Stubs/Values/Content/VersionInfoStub.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Tests/Stubs/Values/Content/VersionInfoStub.php +++ b/eZ/Publish/API/Repository/Tests/Stubs/Values/Content/VersionInfoStub.php @@ -19,7 +19,10 @@ use \eZ\Publish\API\Repository\Values\Content\VersionInfo; */ class VersionInfoStub extends VersionInfo { - private $repository; + /** + * @var \eZ\Publish\API\Repository\Repository + */ + protected $repository; /** * Content of the content this version belongs to. @@ -28,7 +31,7 @@ class VersionInfoStub extends VersionInfo */ public function getContentInfo() { - // TODO: Implement getContentInfo() method. + return $this->repository->getContentService()->loadContentInfo( $this->id ); } /**
Implemented: Lazy load ContentInfo within VersionInfo.
ezsystems_ezpublish-kernel
train
php
3c2db839772460aca5edcaae576c93d0097e5116
diff --git a/tarbell/app.py b/tarbell/app.py index <HASH>..<HASH> 100644 --- a/tarbell/app.py +++ b/tarbell/app.py @@ -392,7 +392,9 @@ class TarbellSite: if not self.data or start > self.expires: self.data = self._get_context_from_gdoc(self.project.SPREADSHEET_KEY) end = int(time.time()) - self.expires = end + SPREADSHEET_CACHE_TTL + ttl = getattr(self.project, 'SPREADSHEET_CACHE_TTL', + SPREADSHEET_CACHE_TTL) + self.expires = end + ttl return self.data except AttributeError: return {}
Make the SPREADSHEET_CACHE_TTL configurable in the tarbell_config.py file. This setting tells tarbell how long to cache google spreadsheet data. It's useful when google docs is having trouble.
tarbell-project_tarbell
train
py
c17f5765423e520a52b142dbb256912bc281ba0f
diff --git a/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lb/RoundRobinLoadBalancer.java b/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lb/RoundRobinLoadBalancer.java index <HASH>..<HASH> 100644 --- a/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lb/RoundRobinLoadBalancer.java +++ b/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lb/RoundRobinLoadBalancer.java @@ -51,7 +51,7 @@ public class RoundRobinLoadBalancer implements ServiceInstanceLoadBalancer{ @Override public ServiceInstance vote(List<ServiceInstance> instances) { if (instances==null||instances.isEmpty()){ - throw new IllegalArgumentException("input instances are null or empty"); + return null; } int i = index.getAndIncrement(); int pos = i % instances.size();
RRloadbalancer should not throw IlleaglArgExc
foundation-runtime_service-directory
train
java
e66ebc762187781297ee58614f485b11fbe90c08
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -737,6 +737,11 @@ class AESFuncs(object): # If the return data is invalid, just ignore it if 'return' not in load or 'jid' not in load or 'id' not in load: return False + if load['jid'] == 'req': + # The minion is returning a standalone job, request a jobid + load['jid'] = salt.utils.prep_jid( + self.opts['cachedir'], + self.opts['hash_type']) log.info('Got return from {id} for job {jid}'.format(**load)) self.event.fire_event(load, load['jid']) if not self.opts['job_cache']:
Allow minions to send a return that requests a jid
saltstack_salt
train
py
62a2f3b65e508578c7c31ed35276ceb4cabc5832
diff --git a/Facades/Cache.php b/Facades/Cache.php index <HASH>..<HASH> 100755 --- a/Facades/Cache.php +++ b/Facades/Cache.php @@ -8,8 +8,8 @@ namespace Illuminate\Support\Facades; * @method static bool missing(string $key) * @method static mixed get(string $key, mixed $default = null) * @method static mixed pull(string $key, mixed $default = null) - * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl) - * @method static bool add(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl) + * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) + * @method static bool add(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) * @method static int|bool increment(string $key, $value = 1) * @method static int|bool decrement(string $key, $value = 1) * @method static bool forever(string $key, $value)
Update doc block (#<I>)
illuminate_support
train
php
e3658bf21716e95bccdcd6016e8d2df13434e72d
diff --git a/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java b/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java +++ b/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java @@ -167,8 +167,15 @@ public abstract class DOMNode extends LinkedTreeNode implements Node, Renderable try { int maxLength = Integer.parseInt(s[1]); - - return StringUtils.substringBeforeLast(StringUtils.substring(s[0], 0, maxLength), " ").concat("…"); + + if (s[0].length() > maxLength) { + + return StringUtils.substringBeforeLast(StringUtils.substring(s[0], 0, maxLength), " ").concat("…"); + + } else { + + return s[0]; + } } catch (NumberFormatException nfe) {}
abbreviate text only if longer than maxlen
structr_structr
train
java
04a78c355e89571e19cf9d2271ce5ea8fd3f0623
diff --git a/gump.class.php b/gump.class.php index <HASH>..<HASH> 100644 --- a/gump.class.php +++ b/gump.class.php @@ -272,6 +272,7 @@ class GUMP { case 1: $input_lang = $params[0]; + break; case 2: $input_lang = $params[0]; $output_lang = $params[1];
Small fix to the filter_translate() methos
Wixel_GUMP
train
php
11c46820145bfbcd206bebf5c02de9b72c7e3fcd
diff --git a/common/cache/class.FileCache.php b/common/cache/class.FileCache.php index <HASH>..<HASH> 100644 --- a/common/cache/class.FileCache.php +++ b/common/cache/class.FileCache.php @@ -86,7 +86,7 @@ class common_cache_FileCache { $returnValue = $this->persistence->get($serial); if ($returnValue === false && !$this->has($serial)) { - $msg = "Unable to read cache for '".$serial."'."; + $msg = "No cache entry found for '".$serial."'."; throw new common_cache_NotFoundException($msg); } return $returnValue; diff --git a/common/cache/class.NotFoundException.php b/common/cache/class.NotFoundException.php index <HASH>..<HASH> 100644 --- a/common/cache/class.NotFoundException.php +++ b/common/cache/class.NotFoundException.php @@ -29,14 +29,9 @@ */ class common_cache_NotFoundException extends common_cache_Exception + implements common_log_SeverityLevel { - // --- ASSOCIATIONS --- - - - // --- ATTRIBUTES --- - - // --- OPERATIONS --- - -} /* end of class common_cache_NotFoundException */ - -?> \ No newline at end of file + public function getSeverity() { + return common_Logger::DEBUG_LEVEL; + } +} \ No newline at end of file
Reduced log severity for cache misses
oat-sa_generis
train
php,php
e5834a9b6cb9a968cd0f248bb8fc3c84b538ab51
diff --git a/integration_tests/test_end_to_end_restore.py b/integration_tests/test_end_to_end_restore.py index <HASH>..<HASH> 100644 --- a/integration_tests/test_end_to_end_restore.py +++ b/integration_tests/test_end_to_end_restore.py @@ -2,8 +2,6 @@ import shutil import unittest import subprocess from subprocess import PIPE - -from integration_tests.files import write_file from trashcli import base_dir import tempfile import os @@ -20,9 +18,16 @@ No files trashed from current dir ('%s') """ % self.tmpdir, result.stdout.decode('utf-8')) def run_command(self, command): + class Result: + def __init__(self, stdout, stderr): + self.stdout = stdout + self.stderr = stderr command_full_path = os.path.join(base_dir, command) - return subprocess.run(["python", command_full_path], - stdout=PIPE, stderr=PIPE, cwd=self.tmpdir) + process = subprocess.Popen(["python", command_full_path], stdout=PIPE, + stderr=PIPE, cwd=self.tmpdir) + stdout, stderr = process.communicate() + + return Result(stdout, stderr) def tearDown(self): shutil.rmtree(self.tmpdir)
Refactor: compatibility with python <I> in tests, using Popen instead of subprocess.run
andreafrancia_trash-cli
train
py
dcd5171e120bda9b80efba49b1bb36782ef86c74
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java @@ -61,8 +61,8 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS if (null == vertexCriterion) { this.edgeCriterion = edgeCriterion; } else { - final Traversal<Object, Vertex> inVertexPredicate = __.inV().where(vertexCriterion); - final Traversal<Object, Vertex> outVertexPredicate = __.outV().where(vertexCriterion); + final Traversal<Object, Vertex> inVertexPredicate = __.inV().filter(vertexCriterion); + final Traversal<Object, Vertex> outVertexPredicate = __.outV().filter(vertexCriterion); // if there is a vertex predicate then there is an implied edge filter on vertices even if there is no // edge predicate provided by the user.
forgot one spot in SubgraphStrategy that needed where() to be filter().
apache_tinkerpop
train
java
01851c28720ce6d5ebdd53613b8596b6e5db4bd2
diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index <HASH>..<HASH> 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -337,11 +337,8 @@ module Rscons # # @return [true,false,nil] Return value from Kernel.system(). def execute(short_desc, command, options = {}) - print_command = proc do - puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ') - end if @echo == :command - print_command.call + puts command_to_s(command) elsif @echo == :short puts short_desc end @@ -350,7 +347,7 @@ module Rscons system(*env_args, *Rscons.command_executer, *command, *options_args).tap do |result| unless result or @echo == :command $stdout.write "Failed command was: " - print_command.call + puts command_to_s(command) end end end @@ -751,6 +748,17 @@ module Rscons private + # Return a string representation of a command. + # + # @param command [Array<String>] + # The command. + # + # @return [String] + # The string representation of the command. + def command_to_s(command) + command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ') + end + # Parse dependencies for a given target from a Makefile. # # This method is used internally by Rscons builders.
refactor into new Environment#command_to_s
holtrop_rscons
train
rb
5b1ac76e9ac914d174ef02a720d43143598d63fa
diff --git a/config/ember-try.js b/config/ember-try.js index <HASH>..<HASH> 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -1,5 +1,6 @@ /* eslint-env node */ module.exports = { + useYarn: true, scenarios: [ { name: 'ember-1.13',
fix tests by using yarn in ember-try
ember-cli_ember-fetch
train
js
09e522dadd0b8c35315c5d9304671a8dbd4632db
diff --git a/app/models/lit/source.rb b/app/models/lit/source.rb index <HASH>..<HASH> 100644 --- a/app/models/lit/source.rb +++ b/app/models/lit/source.rb @@ -86,7 +86,9 @@ module Lit end req = Net::HTTP::Get.new(uri.request_uri) req.add_field("Authorization", %(Token token="#{self.api_key}")) - res = Net::HTTP.new(uri.host, uri.port).start do |http| + http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = (uri.port == 443) + res = http.start do |http| http.request(req) end if res.is_a?(Net::HTTPSuccess)
Add SSL support to source syncing
prograils_lit
train
rb
ec5f6d29d5d2cc94ef6d1349660afabb7018cf1a
diff --git a/src/DiggyRouter/Router.php b/src/DiggyRouter/Router.php index <HASH>..<HASH> 100644 --- a/src/DiggyRouter/Router.php +++ b/src/DiggyRouter/Router.php @@ -49,7 +49,7 @@ class Router */ private function handleIncludes(array $routingData, string $routingFile) { - if (array_key_exists('includes', $routingData)) { + if (isset($routingData['includes'])) { foreach ($routingData['includes'] as $includedFile) { if (substr($includedFile, 0, 1) === '/') // Absolute path { @@ -61,6 +61,11 @@ class Router $newData = Yaml::parse(file_get_contents($newRoutingFile)); $newData = $this->handleIncludes($newData, $newRoutingFile); + + if (!isset($routingData['routes'])) { + $routingData['routes'] = []; + } + $routingData['routes'] = array_merge($routingData['routes'], $newData['routes']); }
Fix case when no route is present in main file
Webcretaire_DiggyRouter
train
php
86b01aa2df26eb79ff4baf0630f13c22bcfe219c
diff --git a/upload/catalog/controller/common/cart.php b/upload/catalog/controller/common/cart.php index <HASH>..<HASH> 100644 --- a/upload/catalog/controller/common/cart.php +++ b/upload/catalog/controller/common/cart.php @@ -92,15 +92,12 @@ class ControllerCommonCart extends Controller { // Display prices if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) { - $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); + $unit_price = $this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')); + + $price = $this->currency->format($unit_price); + $total = $this->currency->format($unit_price * $product['quantity']); } else { $price = false; - } - - // Display prices - if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) { - $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity'], $this->session->data['currency']); - } else { $total = false; }
removes redundant condition & price re-calculation
opencart_opencart
train
php
2440ced86214c8989096d1ed553cf21203b682fb
diff --git a/test/linter/test-consistency.js b/test/linter/test-consistency.js index <HASH>..<HASH> 100644 --- a/test/linter/test-consistency.js +++ b/test/linter/test-consistency.js @@ -388,9 +388,9 @@ function testConsistency(filename) { subfeatures.forEach(subfeature => { console.error( - chalk`{red → {bold ${path.join('.')}.${ - subfeature[0] - }}: ${subfeature[1] || '[Array]'}}`, + chalk`{red → {bold ${path.join('.')}.${subfeature[0]}}: ${ + subfeature[1] === undefined ? '[Array]' : subfeature[1] + }}`, ); }); });
Fix "[Array]" printing in consistency logger when data is "null" (#<I>)
mdn_browser-compat-data
train
js
4c59dd20f0e99729407fd97d781b2ab7ecbfdc0a
diff --git a/services/service-s3.js b/services/service-s3.js index <HASH>..<HASH> 100644 --- a/services/service-s3.js +++ b/services/service-s3.js @@ -56,6 +56,9 @@ module.exports = { }; var uploadFile = function(path, bucket) { + var isDir = fs.lstatSync(path).isDirectory(); + if(isDir) return; + S3.putObject({ ACL: "public-read", Bucket: bucket,
s3: don't upload if it is a directory
donejs_deploy
train
js
5134a97365c5688713df1197cd974d408ccadd79
diff --git a/library/src/com/sothree/slidinguppanel/ViewDragHelper.java b/library/src/com/sothree/slidinguppanel/ViewDragHelper.java index <HASH>..<HASH> 100644 --- a/library/src/com/sothree/slidinguppanel/ViewDragHelper.java +++ b/library/src/com/sothree/slidinguppanel/ViewDragHelper.java @@ -1144,7 +1144,7 @@ public class ViewDragHelper { break; } - final View toCapture = findTopChildUnder((int) x, (int) y); + final View toCapture = findTopChildUnder((int) mInitialMotionX[pointerId], (int) mInitialMotionY[pointerId]); if (checkTouchSlop(toCapture, dx, dy) && tryCaptureViewForDrag(toCapture, pointerId)) { break;
When checking to see if we've passed drag slop, use the initial position of the cursor, not the moved position to get the view. This was causing dragging from close to the panel edge to not work correctly.
umano_AndroidSlidingUpPanel
train
java
2dbf7b9f0c0f3c60f516d60e416f65459803c2fc
diff --git a/mithril.js b/mithril.js index <HASH>..<HASH> 100644 --- a/mithril.js +++ b/mithril.js @@ -558,8 +558,8 @@ var m = (function app(window, undefined) { return (component.controller || noop).apply(this, args) || this } var view = function(ctrl) { - if (arguments.length > 1) args = args.concat([].slice.call(arguments, 1)) - return component.view.apply(component, args ? [ctrl].concat(args) : [ctrl]) + var currentArgs = arguments.length > 1 ? args.concat([].slice.call(arguments, 1)) : args + return component.view.apply(component, currentArgs ? [ctrl].concat(currentArgs) : [ctrl]) } view.$original = component.view var output = {controller: controller, view: view}
Stop subsequent redraws appending arguments to parameterized components
MithrilJS_mithril.js
train
js
bb7ba7e1d375677d11557b6c31cc9860b75440cb
diff --git a/lib/pay/braintree/billable.rb b/lib/pay/braintree/billable.rb index <HASH>..<HASH> 100644 --- a/lib/pay/braintree/billable.rb +++ b/lib/pay/braintree/billable.rb @@ -145,6 +145,8 @@ module Pay attrs = card_details_for_braintree_transaction(transaction) attrs[:amount] = transaction.amount.to_f * 100 attrs[:metadata] = transaction.custom_fields + attrs[:currency] = transaction.currency_iso_code + attrs[:application_fee_amount] = transaction.service_fee_amount # Associate charge with subscription if we can if transaction.subscription_id @@ -153,11 +155,7 @@ module Pay attrs[:metadata] = pay_subscription.metadata end - charge = pay_customer.charges.find_or_initialize_by( - processor_id: transaction.id, - currency: transaction.currency_iso_code, - application_fee_amount: transaction.service_fee_amount - ) + charge = pay_customer.charges.find_or_initialize_by(processor_id: transaction.id) charge.update!(attrs) charge end
Move currency out of query for braintree
jasoncharnes_pay
train
rb
228d9c4e5875802164723c853a228baae03c8c7d
diff --git a/artifacts/definitions.py b/artifacts/definitions.py index <HASH>..<HASH> 100644 --- a/artifacts/definitions.py +++ b/artifacts/definitions.py @@ -4,6 +4,7 @@ # The type indictor constants. TYPE_INDICATOR_ARTIFACT = 'ARTIFACT' TYPE_INDICATOR_COMMAND = 'COMMAND' +TYPE_INDICATOR_DIRECTORY = 'DIRECTORY' TYPE_INDICATOR_ENVIRONMENT = 'ENVIRONMENT' TYPE_INDICATOR_FILE = 'FILE' TYPE_INDICATOR_PATH = 'PATH' @@ -18,9 +19,13 @@ LABELS = { 'Cloud Storage': 'Cloud storage artifacts.', 'Configuration Files': 'Configuration files artifacts.', 'Execution': 'Contain execution events.', + 'ExternalAccount': 'Information about any users\' account, e.g. username, account ID, etc.', 'External Media': 'Contain external media data or events e.g. USB drives.', 'KnowledgeBase': 'Artifacts used in knowledge base generation.', + 'IM': 'Instant Messaging / Chat applications artifacts.', + 'iOS' : 'Artifacts related to iOS devices connected to the system.', 'Logs': 'Contain log files.', + 'Mail': 'Mail client applications artifacts.', 'Memory': 'Artifacts retrieved from memory.', 'Network': 'Describe networking state.', 'Processes': 'Describe running processes.',
updated darwin.yaml and definitions.py after comments review
ForensicArtifacts_artifacts
train
py
a82c42125af16d146c1a9f15672ab6d8be1f954e
diff --git a/test/webdriver/basic.js b/test/webdriver/basic.js index <HASH>..<HASH> 100644 --- a/test/webdriver/basic.js +++ b/test/webdriver/basic.js @@ -80,7 +80,6 @@ browsers.browsers.forEach(function(browser) { await driver.findElement(By.id('content_video')).click(); let log = driver.findElement(By.id('log')); await driver.wait(until.elementTextContains(log, 'start'), 10000); - await driver.sleep(6000); await driver.switchTo().frame(driver.findElement( By.css('#content_video_ima-ad-container > div:nth-child(1) > iframe'))); let skipButton = await driver.findElement(
test: Remove unnecessary sleep in test. (#<I>)
googleads_videojs-ima
train
js
17784ae1fcfb95d440b667968cb40527d1329e12
diff --git a/lib/oauth2/access_token.rb b/lib/oauth2/access_token.rb index <HASH>..<HASH> 100644 --- a/lib/oauth2/access_token.rb +++ b/lib/oauth2/access_token.rb @@ -79,7 +79,7 @@ module OAuth2 def refresh!(params={}) raise "A refresh_token is not available" unless refresh_token params.merge!(:client_id => @client.id, - :client_secret => @client_secret, + :client_secret => @client.secret, :grant_type => 'refresh_token', :refresh_token => refresh_token) new_token = @client.get_token(params)
fixed minor typo causing refresh not to work
oauth-xx_oauth2
train
rb
5121204565d833532683d713a08fd69c9f80df4d
diff --git a/soccer/writers.py b/soccer/writers.py index <HASH>..<HASH> 100644 --- a/soccer/writers.py +++ b/soccer/writers.py @@ -93,12 +93,12 @@ class Stdout(BaseWriter): """Prints the teams scores in a pretty format""" for score in team_scores["fixtures"]: if score["status"] == "FINISHED": - click.echo() + #click.echo() click.secho("%s\t" % score["date"].split('T')[0], fg=self.colors.TIME, nl=False) self.scores(self.parse_result(score)) elif show_datetime: - click.echo() + #click.echo() self.scores(self.parse_result(score), add_new_line=False) click.secho(' %s' % Stdout.convert_utc_to_local_time(score["date"], use_12_hour_format, show_datetime),
Removed the extra space when displaying match results of a team
architv_soccer-cli
train
py
327b9050cdddf7969b8f7f69c55c2f61c8c2ee8d
diff --git a/classes/fields/pick.php b/classes/fields/pick.php index <HASH>..<HASH> 100644 --- a/classes/fields/pick.php +++ b/classes/fields/pick.php @@ -758,12 +758,12 @@ class PodsField_Pick extends PodsField { $options['grouped'] = 1; - if ( empty( $options['pick_object'] ) ) { - $options['pick_object'] = ''; + if ( empty( $options[ $args->type . '_object' ] ) ) { + $options[ $args->type . '_object' ] = ''; } - if ( empty( $options['pick_val'] ) ) { - $options['pick_val'] = ''; + if ( empty( $options[ $args->type . '_val' ] ) ) { + $options[ $args->type . '_val' ] = ''; } $options['table_info'] = array();
Namespace the option args based on type
pods-framework_pods
train
php
cd9182618c768ccd2375e187fd85396853bd10de
diff --git a/lib/selenium-webdriver/webdriver.js b/lib/selenium-webdriver/webdriver.js index <HASH>..<HASH> 100644 --- a/lib/selenium-webdriver/webdriver.js +++ b/lib/selenium-webdriver/webdriver.js @@ -250,13 +250,16 @@ webdriver.WebDriver.prototype.executeAsyncScript = (script, var_args) => {}; webdriver.WebDriver.prototype.call = function(fn, opt_scope, var_args) {}; /** - * Schedules a command to wait for a condition to hold. + * Schedules a command to wait for a condition to hold or {@link + * webdriver.promise.Promise promise} to be resolved. * - * This function may be used to block the command flow on the resolution - * of a {@link webdriver.promise.Promise promise}. When given a promise, the - * command will simply wait for its resolution before completing. A timeout may - * be provided to fail the command if the promise does not resolve before the - * timeout expires. + * This function blocks WebDriver's control flow, not the javascript runtime. + * It will only delay future webdriver commands from being executed (e.g. it + * will cause Protractor to wait before sending future commands to the selenium + * server), and only when the webdriver control flow is enabled. + * + * This function returnes a promise, which can be used if you need to block + * javascript execution and not just the control flow. * * See also {@link ExpectedConditions} *
chore(docs): cleaned up documentation for `browser.wait` (#<I>) The existing documentation was redundant and confusing. Closes <URL>
angular_protractor
train
js
c6c188e064343d233f3d2dff85e2fe536f5560f7
diff --git a/chef-server-webui/app/controllers/environments.rb b/chef-server-webui/app/controllers/environments.rb index <HASH>..<HASH> 100644 --- a/chef-server-webui/app/controllers/environments.rb +++ b/chef-server-webui/app/controllers/environments.rb @@ -195,7 +195,7 @@ class Environments < Application def load_cookbooks begin # @cookbooks is a hash, keys are cookbook names, values are their URIs. - @cookbooks = Chef::REST.new(Chef::Config[:chef_server_url]).get_rest("cookbooks").keys + @cookbooks = Chef::REST.new(Chef::Config[:chef_server_url]).get_rest("cookbooks").keys.sort rescue Net::HTTPServerException => e Chef::Log.error(format_exception(e)) redirect(url(:new_environment), :message => { :error => "Could not load the list of available cookbooks."})
Sort cookbooks by name in environment constraint add form
chef_chef
train
rb
a6089401e0c6bc5ab5a171a752d19bab74535b77
diff --git a/http.js b/http.js index <HASH>..<HASH> 100644 --- a/http.js +++ b/http.js @@ -36,7 +36,7 @@ function start (entry, opts) { if (name === 'styles:bundle') emitter.emit('styles:bundle', node) }) - router.route(/^\/manifest.json$/, function (req, res, params) { + router.route(/^\/manifest\.json$/, function (req, res, params) { compiler.manifest(function (err, node) { if (err) { res.statusCode = 404
correct router regex (#<I>)
choojs_bankai
train
js
a03515d430eb8855c558e0dbe782cae67d3f37f2
diff --git a/example-jar/src/main/java/org/geomajas/gwt/example/client/sample/layer/WmsSample.java b/example-jar/src/main/java/org/geomajas/gwt/example/client/sample/layer/WmsSample.java index <HASH>..<HASH> 100644 --- a/example-jar/src/main/java/org/geomajas/gwt/example/client/sample/layer/WmsSample.java +++ b/example-jar/src/main/java/org/geomajas/gwt/example/client/sample/layer/WmsSample.java @@ -114,6 +114,7 @@ public class WmsSample extends SamplePanel { wmsConfig.setLayers(name); wmsConfig.setVersion(WmsService.WmsVersion.V1_1_1); wmsConfig.setBaseUrl(url); + wmsConfig.setCrs("EPSG:900913"); wmsConfig.setTransparent(true); wmsConfig.setMaximumResolution(Double.MAX_VALUE); wmsConfig.setMinimumResolution(1 / mapWidget.getMapModel().getMapInfo().getMaximumScale());
GWT-<I>: set crs in wms configuration
geomajas_geomajas-project-client-gwt
train
java
d79be3f6b78e2e5ee1eb52694d6f7cf961958854
diff --git a/faq-bundle/src/EventListener/InsertTagsListener.php b/faq-bundle/src/EventListener/InsertTagsListener.php index <HASH>..<HASH> 100644 --- a/faq-bundle/src/EventListener/InsertTagsListener.php +++ b/faq-bundle/src/EventListener/InsertTagsListener.php @@ -26,16 +26,6 @@ class InsertTagsListener */ private $framework; - /** - * @var array - */ - private static $supportedTags = [ - 'faq', - 'faq_open', - 'faq_url', - 'faq_title', - ]; - public function __construct(ContaoFrameworkInterface $framework) { $this->framework = $framework; @@ -48,10 +38,17 @@ class InsertTagsListener */ public function onReplaceInsertTags(string $tag, bool $useCache, $cacheValue, array $flags) { + static $supportedTags = [ + 'faq', + 'faq_open', + 'faq_url', + 'faq_title', + ]; + $elements = explode('::', $tag); $key = strtolower($elements[0]); - if (!\in_array($key, self::$supportedTags, true)) { + if (!\in_array($key, $supportedTags, true)) { return false; }
[Faq] Move static class properties that are only used in one method into this method.
contao_contao
train
php
866fbdaf9a748e558389c1c9f71a3833fc7a22b2
diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php index <HASH>..<HASH> 100644 --- a/classes/PodsAPI.php +++ b/classes/PodsAPI.php @@ -10560,6 +10560,7 @@ class PodsAPI { * @since 2.0.0 */ public function process_form( $params, $obj = null, $fields = null, $thank_you = null ) { + $old_display_errors = $this->display_errors; $this->display_errors = false; @@ -10640,6 +10641,8 @@ class PodsAPI { } } + $this->display_errors = $old_display_errors; + return $id; }
Reset display errors after process_form successfully runs
pods-framework_pods
train
php
804e34ff3afe6f6192caf0aef8fe1f91a36fdadb
diff --git a/IDBStore.js b/IDBStore.js index <HASH>..<HASH> 100644 --- a/IDBStore.js +++ b/IDBStore.js @@ -133,7 +133,6 @@ if(!this.store){ var emptyTransaction = this.db.transaction([this.storeName], this.consts.READ_ONLY); this.store = emptyTransaction.objectStore(this.storeName); - emptyTransaction.abort(); } // check indexes
Do not abort transaction IE<I> complains about the inactive state of the transaction when trying to obtain index data, which is technically correct.
jensarps_IDBWrapper
train
js
cc9c8f70cc1a7cb8cda641f2c95773eae06e8361
diff --git a/conftest.py b/conftest.py index <HASH>..<HASH> 100644 --- a/conftest.py +++ b/conftest.py @@ -27,6 +27,7 @@ import os from pytest import yield_fixture import yabt +from yabt.cli import init_and_get_conf def yabt_project_fixture(project): @@ -50,6 +51,6 @@ def in_dag_project(): @yield_fixture def basic_conf(): - conf = yabt.cli.init_and_get_conf([]) + conf = init_and_get_conf([]) yabt.extend.Plugin.load_plugins(conf) yield conf
fix conftest when running some handpicked test modules
resonai_ybt
train
py
14e109d671e92a6552bb20d61b66e0d0c1bd4f5d
diff --git a/beanstalkc.py b/beanstalkc.py index <HASH>..<HASH> 100755 --- a/beanstalkc.py +++ b/beanstalkc.py @@ -131,9 +131,9 @@ class Connection(object): """Put a job into the current tube. Returns job id.""" assert isinstance(body, str), 'Job body must be a str instance' jid = self._interact_value( - 'put %d %d %d %d\r\n%s\r\n' % - (priority, delay, ttr, len(body), body), - ['INSERTED'], ['JOB_TOO_BIG','BURIED','DRAINING']) + 'put %d %d %d %d\r\n%s\r\n' % ( + priority, delay, ttr, len(body), body), + ['INSERTED'], ['JOB_TOO_BIG', 'BURIED', 'DRAINING']) return int(jid) def reserve(self, timeout=None):
Formatting: fix PEP-8 violations Thanks to Guo Jing for pointing out the improper indendation of the hanging indent.
earl_beanstalkc
train
py
e303e843e883803e238dadbf3f7691c248dfd0a3
diff --git a/owslib/feature/wfs100.py b/owslib/feature/wfs100.py index <HASH>..<HASH> 100644 --- a/owslib/feature/wfs100.py +++ b/owslib/feature/wfs100.py @@ -181,7 +181,8 @@ class WebFeatureService_1_0_0(object): assert len(typename) > 0 request['typename'] = ','.join(typename) - request['propertyname'] = ','.join(propertyname) + if propertyname: + request['propertyname'] = ','.join(propertyname) if featureversion: request['featureversion'] = str(featureversion) if maxfeatures: request['maxfeatures'] = str(maxfeatures)
Added check to getfeature(.) to allow for NoneType to be passed as the propertyname. This mirrors the behavior of wfs<I>.py and allows queries to USGS Soil Data Mart to succeed (<URL>)
geopython_OWSLib
train
py
a67d1336d74e9eab615ba08e0b3908f0bd6c1277
diff --git a/src/Google/IO/Curl.php b/src/Google/IO/Curl.php index <HASH>..<HASH> 100644 --- a/src/Google/IO/Curl.php +++ b/src/Google/IO/Curl.php @@ -93,7 +93,7 @@ class Google_IO_Curl extends Google_IO_Abstract */ public function setOptions($options) { - $this->options = array_merge($this->options, $options); + $this->options += $options; } /** diff --git a/src/Google/IO/Stream.php b/src/Google/IO/Stream.php index <HASH>..<HASH> 100644 --- a/src/Google/IO/Stream.php +++ b/src/Google/IO/Stream.php @@ -135,7 +135,7 @@ class Google_IO_Stream extends Google_IO_Abstract */ public function setOptions($options) { - $this->options = array_merge($this->options, $options); + $this->options += $options; } /**
Fix Google_IO_{Curl,Stream} setOptions - array_merge fores reindex on associative array, nuking the keys.
googleapis_google-api-php-client
train
php,php
5d047708a35536a18ed8474a87f8e7a62aab4f18
diff --git a/gxa/src/main/java/uk/ac/ebi/atlas/resource/ExternalImageController.java b/gxa/src/main/java/uk/ac/ebi/atlas/resource/ExternalImageController.java index <HASH>..<HASH> 100644 --- a/gxa/src/main/java/uk/ac/ebi/atlas/resource/ExternalImageController.java +++ b/gxa/src/main/java/uk/ac/ebi/atlas/resource/ExternalImageController.java @@ -1,11 +1,7 @@ - package uk.ac.ebi.atlas.resource; - import com.google.common.base.Function; import com.google.common.base.Optional; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -18,8 +14,6 @@ import javax.servlet.http.HttpServletResponse; @Controller public class ExternalImageController { - private static final Logger LOGGER = LoggerFactory.getLogger(ExternalImageController.class); - private ContrastImageFactory contrastImageFactory; private ExtraInfoFactory extraInfoFactory;
Remove unusued LOGGER
ebi-gene-expression-group_atlas
train
java
378b92f3266b1919b2e3b24b6ebff898b95217a4
diff --git a/js/seven/seven-fixes.js b/js/seven/seven-fixes.js index <HASH>..<HASH> 100644 --- a/js/seven/seven-fixes.js +++ b/js/seven/seven-fixes.js @@ -8,9 +8,6 @@ */ Drupal.behaviors.sevenFixes = { attach: function(context, settings) { - - var opened = []; - // Emulates bootstrap dropdowns. $(context).find('.dropdown-toggle').once('dropdown-toggle', function () { var link = $(this); @@ -21,6 +18,7 @@ dropdownMenus.push(parent); link.click(function () { child.show(); + return false; }); } });
Stop propagation of the event when clicking on a dropdown toggle link
makinacorpus_drupal-calista
train
js
07ca9900897cdb579190c603d5d3204a93b8419b
diff --git a/modules/MatchProvider.js b/modules/MatchProvider.js index <HASH>..<HASH> 100644 --- a/modules/MatchProvider.js +++ b/modules/MatchProvider.js @@ -19,10 +19,8 @@ class MatchProvider extends React.Component { constructor(props) { super(props) - // React doesn't support a parent calling `setState` from an descendant's - // componentWillMount, so we use an instance property to track matches // **IMPORTANT** we must mutate matches, never reassign, in order for - // server rendering to work + // server rendering to work w/ the two-pass render approach for Miss this.matches = [] this.subscribers = [] this.hasMatches = null // use null for initial value
remove irrelevant code comments we haven’t event released yet and they’re out of date 😞
ReactTraining_react-router
train
js
9588d6ca6004d545bd1a6e1268bc7ca2c6abc1b0
diff --git a/tensorpack/dataflow/common.py b/tensorpack/dataflow/common.py index <HASH>..<HASH> 100644 --- a/tensorpack/dataflow/common.py +++ b/tensorpack/dataflow/common.py @@ -198,10 +198,10 @@ class FixedSizeData(ProxyDataFlow): cnt = 0 while True: try: - dp = self.itr.next() + dp = next(self.itr) except StopIteration: self.itr = self.ds.get_data() - dp = self.itr.next() + dp = next(self.itr) cnt += 1 yield dp
fix <I> (#<I>)
tensorpack_tensorpack
train
py
cd530b703cbcc65a73ba0a98cfe087a418f57156
diff --git a/test/db.test.js b/test/db.test.js index <HASH>..<HASH> 100644 --- a/test/db.test.js +++ b/test/db.test.js @@ -1,6 +1,6 @@ var should = require('chai').should() , assert = require('chai').assert - , testDb = 'workspace/test.db' + , testDb = 'workspace/test2.db' , fs = require('fs') , path = require('path') , _ = require('underscore') @@ -287,6 +287,8 @@ describe('Database', function () { } ex.should.equal('SOME EXCEPTION'); + process.removeListener('uncaughtException', MINE); + done(); }); @@ -316,6 +318,7 @@ describe('Database', function () { } ex.should.equal('SOME EXCEPTION'); + process.removeListener('uncaughtException', MINE); done(); });
Tests: fixes so that the DB's used by db.test.js and cursor.test.js don't interfere and exception checks don't interfere with Mocha
Ivshti_linvodb3
train
js
c7bbea83de83fb62fff37d609c30a5c502568696
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( author_email='[email protected]', license='GPL', packages=find_packages(exclude=['ez_setup']), - install_requires=['Nose>=0.11.0', 'blessings>=1.1,<2.0'], + install_requires=['Nose>=0.11.0', 'blessings>=1.3,<2.0'], url='', include_package_data=True, entry_points="""
Bump required Blessings version to <I>, because we need `number_of_colors`.
erikrose_nose-progressive
train
py
a939ca26b8f76907f625736ae3bf437889b80946
diff --git a/presto-main/src/main/java/com/facebook/presto/operator/ScanFilterAndProjectOperator.java b/presto-main/src/main/java/com/facebook/presto/operator/ScanFilterAndProjectOperator.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/operator/ScanFilterAndProjectOperator.java +++ b/presto-main/src/main/java/com/facebook/presto/operator/ScanFilterAndProjectOperator.java @@ -126,13 +126,13 @@ public class ScanFilterAndProjectOperator } @Override - public final void finish() + public void close() { - close(); + finish(); } @Override - public void close() + public void finish() { if (pageSource != null) { try {
Swap finish and close methods to match TableScan
prestodb_presto
train
java
702083242daf67e84d26c06a5fa563b4a217a4b4
diff --git a/TVMaze/TVMaze.php b/TVMaze/TVMaze.php index <HASH>..<HASH> 100644 --- a/TVMaze/TVMaze.php +++ b/TVMaze/TVMaze.php @@ -43,7 +43,6 @@ class TVMaze { $episode_list = array(); foreach($shows['_embedded']['episodes'] as $episode){ $ep = new Episode($episode); - print_r($episode); array_push($episode_list, $ep); }
Fixed issue where singleSearch was printing for unknown reason
JPinkney_TVMaze-PHP-API-Wrapper
train
php
0de375f06b6b906b4c1740e5ba3430468f3e5d5f
diff --git a/engine.py b/engine.py index <HASH>..<HASH> 100644 --- a/engine.py +++ b/engine.py @@ -100,8 +100,8 @@ class Engine(object): class Context(object): def __init__(self, context_dirs): self.context_dirs = context_dirs - self.__cached_environ_variables = { - key: os.environ[key] for key in os.environ} + self.__cached_environ_variables = dict( + (key, os.environ[key]) for key in os.environ) def get_data(self, file_name): data = open_yaml(self.context_dirs, file_name)
oh python <I> does not support dict comprehension
moremoban_moban-handlebars
train
py
dabac96f44ab833479a4af06ec52bf82b3b4d7a2
diff --git a/test/address_test.rb b/test/address_test.rb index <HASH>..<HASH> 100644 --- a/test/address_test.rb +++ b/test/address_test.rb @@ -23,7 +23,7 @@ class Net::TCPClient::AddressTest < Minitest::Test describe '.addresses' do it 'returns one address for a known DNS' do addresses = Net::TCPClient::Address.addresses('localhost', 80) - assert_equal 1, addresses.count + assert_equal 1, addresses.count, addresses.ai address = addresses.first assert_equal 80, address.port assert_equal '127.0.0.1', address.ip_address diff --git a/test/tcp_client_test.rb b/test/tcp_client_test.rb index <HASH>..<HASH> 100644 --- a/test/tcp_client_test.rb +++ b/test/tcp_client_test.rb @@ -48,7 +48,16 @@ class TCPClientTest < Minitest::Test ca_file: ssl_file_path('ca.pem') } end - @server = SimpleTCPServer.new(options) + count = 0 + begin + @server = SimpleTCPServer.new(options) + rescue Errno::EADDRINUSE + # Give previous test server time to stop + count += 1 + sleep 1 + retry if count <= 5 + end + @server_name = 'localhost:2000' end
Give test server time to stop before starting a new one.
rocketjob_net_tcp_client
train
rb,rb
d9993b92433e7f78b681846678daa74a168dc4cf
diff --git a/Element/BaseElement.php b/Element/BaseElement.php index <HASH>..<HASH> 100644 --- a/Element/BaseElement.php +++ b/Element/BaseElement.php @@ -56,7 +56,8 @@ class BaseElement extends HTMLElement if (is_array($result)) { $serializer = new JsonSerializer(); - $result = new Response($serializer->serialize($result)); + $responseBody = $serializer->serialize($result); + $result = new Response($responseBody, 200, array('Content-Type' => 'application/json')); } return $result; @@ -179,4 +180,4 @@ class BaseElement extends HTMLElement } return $request; } -} \ No newline at end of file +}
Set appropriate Content-Type header for JSON-serialized response
mapbender_data-source
train
php
433d0e445e0814ca3a0fced0bac5f125e9075250
diff --git a/sorna/proto/__init__.py b/sorna/proto/__init__.py index <HASH>..<HASH> 100644 --- a/sorna/proto/__init__.py +++ b/sorna/proto/__init__.py @@ -1,5 +1,5 @@ #! /usr/bin/env python3 -from .serialize import odict, msg_encode, msg_decode +from .serialize import odict, msg_encode, msg_decode, generate_uuid -__all__ = ['odict', 'msg_encode', 'msg_decode'] +__all__ = ['odict', 'msg_encode', 'msg_decode', 'generate_uuid'] diff --git a/sorna/proto/serialize.py b/sorna/proto/serialize.py index <HASH>..<HASH> 100644 --- a/sorna/proto/serialize.py +++ b/sorna/proto/serialize.py @@ -12,3 +12,8 @@ def msg_decode(s): if isinstance(s, bytes): s = s.decode('utf8') return json.loads(s, object_pairs_hook=odict) + +def generate_uuid(): + u = uuid.uuid4() + # Strip the last two padding characters because u always has fixed length. + return base64.urlsafe_b64encode(u.bytes)[:-2]
refs lablup/sorna#9: Add a common key generator with shorter encoding.
lablup_backend.ai-common
train
py,py
7f34d2dcf3d1581b54a6ae4dc0a1ae27a9e496bd
diff --git a/spec/ztk/logger_spec.rb b/spec/ztk/logger_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ztk/logger_spec.rb +++ b/spec/ztk/logger_spec.rb @@ -85,7 +85,7 @@ describe ZTK::Logger do it "should allow writing directly to the log device" do data = "Hello World" - IO.write(subject.logdev, data) + subject.logdev.write(data) IO.read(@logfile).match(data).should_not be nil end
tweak code to make it work under ruby <I>
zpatten_ztk
train
rb
68a8a56dbaed8539c399aabb936b1dfaa48bc12b
diff --git a/src/main/java/io/dropwizard/bundles/assets/AssetServlet.java b/src/main/java/io/dropwizard/bundles/assets/AssetServlet.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/dropwizard/bundles/assets/AssetServlet.java +++ b/src/main/java/io/dropwizard/bundles/assets/AssetServlet.java @@ -79,7 +79,14 @@ public class AssetServlet extends HttpServlet { Iterable<Map.Entry<String, String>> mimeTypes) { this.defaultCharset = defaultCharset; AssetLoader loader = new AssetLoader(resourcePathToUriPathMapping, indexFile, overrides); - this.cache = CacheBuilder.from(spec).weigher(new AssetSizeWeigher()).build(loader); + + CacheBuilder<Object, Object> cacheBuilder = CacheBuilder.from(spec); + // Don't add the weigher if we are using maximumSize instead of maximumWeight. + if (spec.toParsableString().contains("maximumWeight=")) { + cacheBuilder.weigher(new AssetSizeWeigher()); + } + this.cache = cacheBuilder.build(loader); + this.cacheSpec = spec; this.mimeTypes = new MimeTypes(); this.setMimeTypes(mimeTypes);
Remove CacheBuilder 'ignoring weigher' warning by not registering the weigher unless maximumWeight is part of the spec.
dropwizard-bundles_dropwizard-configurable-assets-bundle
train
java
f40f9699c9af361882f697a25b25bcbca6ae91e4
diff --git a/autocompleteServer/src/main/java/de/metalcon/autocompleteServer/Search.java b/autocompleteServer/src/main/java/de/metalcon/autocompleteServer/Search.java index <HASH>..<HASH> 100644 --- a/autocompleteServer/src/main/java/de/metalcon/autocompleteServer/Search.java +++ b/autocompleteServer/src/main/java/de/metalcon/autocompleteServer/Search.java @@ -39,7 +39,7 @@ public class Search { int priority = 100000; try { - FileInputStream saveFile = new FileInputStream("saveFile.sav"); + FileInputStream saveFile = new FileInputStream("Database.save"); ObjectInputStream restore = new ObjectInputStream(saveFile); Object obj = restore.readObject(); @@ -105,4 +105,4 @@ public class Search { } } -} \ No newline at end of file +}
Bugfix: disc-restore method had a different filename than the one the disc-save method has.
renepickhardt_metalcon
train
java
7fa3b2b1f3c45e2e0048bb65d7da7e9d86753a59
diff --git a/scim-schema/src/main/java/org/osiam/resources/scim/ErrorResponse.java b/scim-schema/src/main/java/org/osiam/resources/scim/ErrorResponse.java index <HASH>..<HASH> 100644 --- a/scim-schema/src/main/java/org/osiam/resources/scim/ErrorResponse.java +++ b/scim-schema/src/main/java/org/osiam/resources/scim/ErrorResponse.java @@ -1,5 +1,7 @@ package org.osiam.resources.scim; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.Arrays; @@ -11,7 +13,7 @@ public class ErrorResponse { private String status; private String detail; - public ErrorResponse(int statusCode, String message) { + public ErrorResponse(@JsonProperty("status") int statusCode, @JsonProperty("detail") String message) { status = Integer.toString(statusCode); detail = message; }
Fix deserializability of ErrorResponse This commit adds the lost Jackson annotations again to make the ErrorResponse deserializable again. It is a brown paperbag commit.
osiam_connector4java
train
java
3d5edb8b264b75aee44e17dea90126fa3d89d177
diff --git a/api/service_consumption.go b/api/service_consumption.go index <HASH>..<HASH> 100644 --- a/api/service_consumption.go +++ b/api/service_consumption.go @@ -292,6 +292,13 @@ func serviceInstances(w http.ResponseWriter, r *http.Request, t auth.Token) erro return err } +// title: service instance status +// path: /services/{service}/instances/{instance}/status +// method: GET +// responses: +// 200: List services instances +// 401: Unauthorized +// 404: Service instance not found func serviceInstanceStatus(w http.ResponseWriter, r *http.Request, t auth.Token) error { instanceName := r.URL.Query().Get(":instance") serviceName := r.URL.Query().Get(":service") @@ -388,12 +395,7 @@ func serviceInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error { if err != nil { return err } - b, err := json.Marshal(instances) - if err != nil { - return nil - } - w.Write(b) - return nil + return json.NewEncoder(w).Encode(instances) } func serviceDoc(w http.ResponseWriter, r *http.Request, t auth.Token) error {
api/service: add comments to describe service instance status
tsuru_tsuru
train
go
d5bf79d5685a762b87e109463df2de6ff0dbe4af
diff --git a/src/nfc/dep.py b/src/nfc/dep.py index <HASH>..<HASH> 100644 --- a/src/nfc/dep.py +++ b/src/nfc/dep.py @@ -64,6 +64,7 @@ class DataExchangeProtocol(object): def role(self): """Role in DEP communication, either 'Target' or 'Initiator'""" + class Initiator(DataExchangeProtocol): ROLE = "Initiator"
Need two empty lines before class defintion (flake8).
nfcpy_nfcpy
train
py
b99e642cf061e23d0c240e6e1a0240fbb95b10d4
diff --git a/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java b/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java index <HASH>..<HASH> 100644 --- a/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +++ b/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java @@ -333,9 +333,11 @@ public class DBAdapter extends RubyBasic { boolean migrateDB(DBVersion dbVer, String strRhoDBVer, String strAppDBVer ) { - //1.2.2 -> 1.5.0,1.4.1 + LOG.INFO( "Try migrate database from " + (dbVer != null ? dbVer.m_strRhoVer:"") + " to " + (strRhoDBVer !=null ? strRhoDBVer:"") ); + + //1.2.x -> 1.5.x,1.4.x if ( dbVer != null && strRhoDBVer != null && - dbVer.m_strRhoVer.compareTo("1.2.2") == 0 && (strRhoDBVer.compareTo("1.5.0")==0||strRhoDBVer.compareTo("1.4.1")==0) ) + dbVer.m_strRhoVer.startsWith("1.2") && (strRhoDBVer.startsWith("1.5")||strRhoDBVer.startsWith("1.4")) ) { //sources //priority INTEGER, ADD
support <I>.x in db migrate
rhomobile_rhodes
train
java
5c5ef7078f90bbeb90416fc373edb0946e1adac1
diff --git a/mapchete/io/vector.py b/mapchete/io/vector.py index <HASH>..<HASH> 100644 --- a/mapchete/io/vector.py +++ b/mapchete/io/vector.py @@ -122,6 +122,8 @@ def _validated_crs(crs): return CRS().from_epsg(int(crs)) elif isinstance(crs, int): return CRS().from_epsg(crs) + elif isinstance(crs, dict): + return CRS().from_dict(crs) else: raise TypeError("invalid CRS given")
also enable parsing CRS represented as dict
ungarj_mapchete
train
py
af9fb11f5f3cc220ee2c08071ee9d50f11048b86
diff --git a/src/Bex/Behat/ExtensionDriverLocator/DriverNodeBuilder.php b/src/Bex/Behat/ExtensionDriverLocator/DriverNodeBuilder.php index <HASH>..<HASH> 100644 --- a/src/Bex/Behat/ExtensionDriverLocator/DriverNodeBuilder.php +++ b/src/Bex/Behat/ExtensionDriverLocator/DriverNodeBuilder.php @@ -49,7 +49,7 @@ class DriverNodeBuilder $defaultActiveDrivers = (is_array($defaultActiveDrivers)) ? $defaultActiveDrivers : [$defaultActiveDrivers]; $builder ->children() - ->arrayNode($activeDriversNodeName) + ->variableNode($activeDriversNodeName) ->defaultValue($defaultActiveDrivers) ->beforeNormalization() ->ifString() @@ -59,13 +59,11 @@ class DriverNodeBuilder ->ifTrue($this->getDriverKeyValidator()) ->thenInvalid('%s') ->end() - ->prototype('scalar')->end() ->end() - ->end() - ->fixXmlConfig($driversNodeName . '_child', $driversNodeName) - ->children() ->arrayNode($driversNodeName) + ->useAttributeAsKey('name') ->prototype('array') + ->useAttributeAsKey('name') ->prototype('scalar')->end() ->end() ->end()
Fix driver node builder to be able to merge node values properly by profile
tkotosz_behat-extension-driver-locator
train
php
94592b06fbf56e9bbb369fa71ab1a271b3fa1876
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -199,7 +199,7 @@ else: setuptools.setup( name='grpcio', - version='0.12.0b6', + version='0.12.0b8', license=LICENSE, ext_modules=CYTHON_EXTENSION_MODULES, packages=list(PACKAGES),
Bump Python version for artifact building
grpc_grpc
train
py
ca4fdcec679672ef1976d131a34ebce136ef966e
diff --git a/src/frontend/controllers/SiteController.php b/src/frontend/controllers/SiteController.php index <HASH>..<HASH> 100644 --- a/src/frontend/controllers/SiteController.php +++ b/src/frontend/controllers/SiteController.php @@ -98,6 +98,10 @@ class SiteController extends Controller return $this->redirect(['/site/auth', 'authclient' => 'hiam']); } + public function actionProfile () { + return $this->redirect(['@client/view', 'id' => Yii::$app->user->identity->id]); + } + public function actionLogout () { $back = Yii::$app->request->getHostInfo(); $url = Yii::$app->authClientCollection->getClient()->buildUrl('site/logout',compact('back'));
+ SiteController::actionProfile for redirect to user profile
hiqdev_hipanel-core
train
php
9be8bed66a459fe9ad5cff0e5f762db1b5af9a77
diff --git a/glymur/test/test_opj_suite.py b/glymur/test/test_opj_suite.py index <HASH>..<HASH> 100644 --- a/glymur/test/test_opj_suite.py +++ b/glymur/test/test_opj_suite.py @@ -3447,7 +3447,7 @@ class TestSuiteDump(unittest.TestCase): # Image header self.assertEqual(jp2.box[2].box[0].height, 400) self.assertEqual(jp2.box[2].box[0].width, 700) - self.assertEqual(jp2.box[2].box[0].num_components, 1) + self.assertEqual(jp2.box[2].box[0].num_components, 3) self.assertEqual(jp2.box[2].box[0].bits_per_component, 8) self.assertEqual(jp2.box[2].box[0].signed, False) self.assertEqual(jp2.box[2].box[0].compression, 7) # wavelet
Updated for upstream openjpeg changes. #<I>
quintusdias_glymur
train
py
e8d5e00cc3d8d798fc0dab8d70578dde4a6656b0
diff --git a/conn_test.go b/conn_test.go index <HASH>..<HASH> 100644 --- a/conn_test.go +++ b/conn_test.go @@ -297,8 +297,13 @@ func TestErrOnMaxPayloadLimit(t *testing.T) { defer conn.Close() info := fmt.Sprintf(serverInfo, addr.IP, addr.Port) conn.Write([]byte(info)) - // Wait a bit for client to connect and make a ping - time.Sleep(100 * time.Millisecond) + + // Read connect and ping commands sent from the client + line := make([]byte, 111) + _, err := conn.Read(line) + if err != nil { + t.Fatal("Expected CONNECT and PING from client, got: %s", err) + } conn.Write([]byte("PONG\r\n")) }()
Wait for client to connect on max payload test before sending
nats-io_go-nats
train
go
246dedcf4762019b23d4c577356875a1af78810f
diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index <HASH>..<HASH> 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -3490,7 +3490,7 @@ function workshop_print_submission_title($workshop, $submission) { $ffurl = "file.php?file=/$filearea/$file"; } return "<IMG SRC=\"$CFG->wwwroot/files/pix/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">". - "&nbsp;<A TARGET=\"uploadedfile\" HREF=\"$CFG->wwwroot/$ffurl\">$submission->title</A>"; + "&nbsp;<A TARGET=\"uploadedfile$submission->id\" HREF=\"$CFG->wwwroot/$ffurl\">$submission->title</A>"; } } }
Give new windows different names so they can be compared more easily
moodle_moodle
train
php
b14368f5f1248c6bdf4d20391156b749dd59bae7
diff --git a/src/FileMutex.php b/src/FileMutex.php index <HASH>..<HASH> 100644 --- a/src/FileMutex.php +++ b/src/FileMutex.php @@ -29,7 +29,7 @@ class FileMutex implements Mutex private $fileName; /** - * @param string|null $fileName Name of temporary file to use as a mutex. + * @param string $fileName Name of temporary file to use as a mutex. */ public function __construct(string $fileName) {
Fix docblock type (#<I>)
amphp_sync
train
php
b4ff4332797d0a665e2dfeb382b6121a00e7b82a
diff --git a/src/SheetsRegistry.js b/src/SheetsRegistry.js index <HASH>..<HASH> 100644 --- a/src/SheetsRegistry.js +++ b/src/SheetsRegistry.js @@ -22,6 +22,8 @@ export default class SheetsRegistry { const {registry} = this const {index} = sheet.options + if (registry.indexOf(sheet) !== -1) return + if (registry.length === 0 || index >= this.index) { registry.push(sheet) return diff --git a/tests/integration/sheetsRegistry.js b/tests/integration/sheetsRegistry.js index <HASH>..<HASH> 100644 --- a/tests/integration/sheetsRegistry.js +++ b/tests/integration/sheetsRegistry.js @@ -23,6 +23,13 @@ describe('Integration: sheetsRegistry', () => { expect(sheets.registry.length).to.be(2) }) + it('should not add duplicates', () => { + const sheet = jss.createStyleSheet() + sheets.add(sheet) + sheets.add(sheet) + expect(sheets.registry.length).to.be(1) + }) + it('should add 2 sheets with specific index', () => { const sheet0 = jss.createStyleSheet(null, {index: 1}) const sheet1 = jss.createStyleSheet(null, {index: 0})
prevent duplicates in the sheets registry #<I>
cssinjs_jss
train
js,js
0c4747350889707bff68cdd9ffcea5a2878cd477
diff --git a/lib/facebook_ads/ad_campaign.rb b/lib/facebook_ads/ad_campaign.rb index <HASH>..<HASH> 100644 --- a/lib/facebook_ads/ad_campaign.rb +++ b/lib/facebook_ads/ad_campaign.rb @@ -23,12 +23,17 @@ module FacebookAds raise Exception, "Optimization goal must be one of: #{FacebookAds::AdSet::OPTIMIZATION_GOALS.to_sentence}" unless FacebookAds::AdSet::OPTIMIZATION_GOALS.include?(optimization_goal) raise Exception, "Billing event must be one of: #{FacebookAds::AdSet::BILLING_EVENTS.to_sentence}" unless FacebookAds::AdSet::BILLING_EVENTS.include?(billing_event) - targeting.validate! # Will raise if invalid. + if targeting.is_a(Hash) + # NOP + else + targeting.validate! # Will raise if invalid. + targeting = targeting.to_hash + end ad_set = FacebookAds::AdSet.post("/act_#{account_id}/adsets", query: { # Returns a FacebookAds::AdSet instance. campaign_id: id, name: name, - targeting: targeting.to_hash.to_json, + targeting: targeting.to_json, promoted_object: promoted_object.to_json, optimization_goal: optimization_goal, daily_budget: daily_budget,
Allow a hash or AdTargeting object for AdSet creation.
tophatter_facebook-ruby-ads-sdk
train
rb
26a5f4d8b8396a8792ece1b38a8c68c52247fa22
diff --git a/cmd2.py b/cmd2.py index <HASH>..<HASH> 100755 --- a/cmd2.py +++ b/cmd2.py @@ -1600,10 +1600,11 @@ class Cmd(cmd.Cmd): :return: List[str] - a list of possible tab completions """ - # Used to complete ~ and ~user strings with a list of users that have existing home dirs + # Used to complete ~ and ~user strings def complete_users(): - # We are returning ~user strings that resolve to directories, so don't append a space or quote + # We are returning ~user strings that resolve to directories, + # so don't append a space or quote in the case of a single result. self.allow_appended_space = False self.allow_closing_quote = False @@ -1692,7 +1693,7 @@ class Cmd(cmd.Cmd): matches = [c for c in matches if os.path.isdir(c)] # Don't append a space or closing quote to directory - if len(matches) == 1 and not os.path.isfile(matches[0]): + if len(matches) == 1 and os.path.isdir(matches[0]): self.allow_appended_space = False self.allow_closing_quote = False
Added better check for whether a path is a directory
python-cmd2_cmd2
train
py
c85ea2e05ed3e17602f364f6286b1392702c05d8
diff --git a/lib/function_call.js b/lib/function_call.js index <HASH>..<HASH> 100644 --- a/lib/function_call.js +++ b/lib/function_call.js @@ -56,14 +56,16 @@ util.inherits(FunctionCall, events.EventEmitter); * Fibonacci backoff strategy if none is provided. * @param strategy Optional strategy to use when instantiating the backoff. * @return A backoff instance. + * @private */ -FunctionCall.backoffFactory = function(strategy) { +FunctionCall.backoffFactory_ = function(strategy) { return new Backoff(strategy || new FibonacciBackoffStrategy()); }; /** * Default number of backoffs. + * @private */ FunctionCall.prototype.failAfter_ = 5; @@ -122,7 +124,7 @@ FunctionCall.prototype.call = function(backoffFactory) { throw new Error('Call in progress.'); } - backoffFactory = backoffFactory || FunctionCall.backoffFactory; + backoffFactory = backoffFactory || FunctionCall.backoffFactory_; this.backoff_ = backoffFactory(this.strategy_); this.backoff_.on('ready', this.doCall_.bind(this));
Make backoffFactory a private member.
MathieuTurcotte_node-backoff
train
js
c54e3f35ddabe4b6d976eb0825bb99c6ad0b7999
diff --git a/aeron-archive/src/main/java/io/aeron/archive/ListRecordingsForUriSession.java b/aeron-archive/src/main/java/io/aeron/archive/ListRecordingsForUriSession.java index <HASH>..<HASH> 100644 --- a/aeron-archive/src/main/java/io/aeron/archive/ListRecordingsForUriSession.java +++ b/aeron-archive/src/main/java/io/aeron/archive/ListRecordingsForUriSession.java @@ -66,13 +66,16 @@ class ListRecordingsForUriSession extends AbstractListRecordingsSession return 0; } + recordingId++; scanned++; + decoder.wrap( descriptorBuffer, Catalog.CATALOG_FRAME_LENGTH, RecordingDescriptorDecoder.BLOCK_LENGTH, RecordingDescriptorDecoder.SCHEMA_VERSION); + if (decoder.streamId() != streamId || !decoder.strippedChannel().equals(channel)) { continue; @@ -82,6 +85,7 @@ class ListRecordingsForUriSession extends AbstractListRecordingsSession { continue; } + sentBytes += proxy.sendDescriptor(correlationId, descriptorBuffer, controlPublication); if (sent++ >= count)
[Java] Formatting for readability.
real-logic_aeron
train
java
daa906ffdfea29e28f26a5965100f645736de450
diff --git a/deployment_manifest_primatives.go b/deployment_manifest_primatives.go index <HASH>..<HASH> 100644 --- a/deployment_manifest_primatives.go +++ b/deployment_manifest_primatives.go @@ -38,6 +38,7 @@ type InstanceGroup struct { Jobs []InstanceJob `yaml:"jobs"` Update Update `yaml:"update,omitempty"` Lifecycle string `yaml:"lifecycle,omitempty"` + VMExtensions []string `yaml:"vm_extensions,omitempty"` } type InstanceJob struct {
[#<I>] Added VMExtensions to InstanceGroup
enaml-ops_enaml
train
go
b736c1f257a7ce5b974ccf652126c498d9f04b16
diff --git a/app/controls/MultipleFileUpload/MultipleFileUpload.php b/app/controls/MultipleFileUpload/MultipleFileUpload.php index <HASH>..<HASH> 100644 --- a/app/controls/MultipleFileUpload/MultipleFileUpload.php +++ b/app/controls/MultipleFileUpload/MultipleFileUpload.php @@ -71,8 +71,7 @@ class MultipleFileUpload extends FileUpload { * * @var int Time in seconds */ - //public static $lifeTime = 3600; // 1 hour - public static $lifeTime = 15; // 1 hour + public static $lifeTime = 3600; // 1 hour /** * Cleaning up interval
- default lifeTime changed back to <I>s
jkuchar_MultipleFileUpload
train
php
3e7eebd91f77d6703d329c28d44c1ac73b2ee9ef
diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -31,6 +31,8 @@ class ExceptionController extends ContainerAware * @param DebugLoggerInterface $logger A DebugLoggerInterface instance * @param string $format The format to use for rendering (html, xml, ...) * + * @return Response + * * @throws \InvalidArgumentException When the exception template does not exist */ public function showAction(FlattenException $exception, DebugLoggerInterface $logger = null, $format = 'html') @@ -59,6 +61,9 @@ class ExceptionController extends ContainerAware return $response; } + /** + * @return string + */ protected function getAndCleanOutputBuffering() { // the count variable avoids an infinite loop on @@ -74,6 +79,14 @@ class ExceptionController extends ContainerAware return $currentContent; } + /** + * @param Symfony\Bundle\TwigBundle\TwigEngine $templating + * @param string $format + * @param integer $code An HTTP response status code + * @param Boolean $debug + * + * @return TemplateReference + */ protected function findTemplate($templating, $format, $code, $debug) { $name = $debug ? 'exception' : 'error';
[TwigBundle] Improved ExceptionController docblocks Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: [![Build Status](<URL>) Fixes the following tickets: - Todo: -
symfony_symfony
train
php
1563c33f79294392a5587f06c6befd2d57449b35
diff --git a/lib/block.js b/lib/block.js index <HASH>..<HASH> 100644 --- a/lib/block.js +++ b/lib/block.js @@ -158,9 +158,16 @@ class Block { projectCWD = await resolve.cwd, componentsLockFile = path.join(projectCWD, 'components-lock.json'); + const globOpts = { + ignore: [ + path.join(resolve.entry(), '/**'), + path.join(resolve.sourceDir, '**/tmp/**'), + ] + }; + const projectHash = objectHash().hash({ - srcHash: hashFiles.sync({files: glob.sync(path.join(resolve.sourceDir, '/**/index.js')).sort()}), - projectFiles: glob.sync(path.join(resolve.sourceDir, '/**/*.@(js|ts|styl|ss)')).sort(), + srcHash: hashFiles.sync({files: glob.sync(path.join(resolve.sourceDir, '/**/index.js'), globOpts).sort()}), + projectFiles: glob.sync(path.join(resolve.sourceDir, '/**/*.@(js|ts|styl|ss)'), globOpts).sort(), objToHash: this.objToHash });
Exclude entries and tmp files
pzlr_build-core
train
js
052128c4fc159a7b5f1927a523e7c2826e71fe8f
diff --git a/docs/registry.go b/docs/registry.go index <HASH>..<HASH> 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -25,6 +25,7 @@ import ( "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/httputils" + "github.com/docker/docker/pkg/parsers/kernel" "github.com/docker/docker/utils" ) @@ -956,7 +957,7 @@ func HTTPRequestFactory(metaHeaders map[string][]string) *utils.HTTPRequestFacto httpVersion = append(httpVersion, &simpleVersionInfo{"docker", dockerversion.VERSION}) httpVersion = append(httpVersion, &simpleVersionInfo{"go", runtime.Version()}) httpVersion = append(httpVersion, &simpleVersionInfo{"git-commit", dockerversion.GITCOMMIT}) - if kernelVersion, err := utils.GetKernelVersion(); err == nil { + if kernelVersion, err := kernel.GetKernelVersion(); err == nil { httpVersion = append(httpVersion, &simpleVersionInfo{"kernel", kernelVersion.String()}) } httpVersion = append(httpVersion, &simpleVersionInfo{"os", runtime.GOOS})
Move parsing functions to pkg/parsers and the specific kernel handling functions to pkg/parsers/kernel, and parsing filters to pkg/parsers/filter. Adjust imports and package references. Docker-DCO-<I>-
docker_distribution
train
go
bd6d0ae461cbe82a23eb7578a6972967ff7f0232
diff --git a/multi_key_dict/multi_key_dict.py b/multi_key_dict/multi_key_dict.py index <HASH>..<HASH> 100644 --- a/multi_key_dict/multi_key_dict.py +++ b/multi_key_dict/multi_key_dict.py @@ -99,12 +99,10 @@ class multi_key_dict(object): num_of_keys_we_have = 0 for x in keys: - print x, type(x) try: self.__getitem__(x) num_of_keys_we_have += 1 except Exception, err: - print err continue if num_of_keys_we_have:
removed uninentionally added print statements
formiaczek_multi_key_dict
train
py
f959ff66a1260ed23274c0a58818a6907c0a929e
diff --git a/passwd-linux.js b/passwd-linux.js index <HASH>..<HASH> 100644 --- a/passwd-linux.js +++ b/passwd-linux.js @@ -96,7 +96,7 @@ function changePassword(username, password, callback, algorithm = 6) { if (userFinded) { var passwordHash; - var passwordSalt;; + var passwordSalt = ''; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var i = 0; i < 5; i++) passwordSalt += possible.charAt(Math.floor(Math.random() * possible.length));
Fix 'undefined' password salt. Fixes a bug that causes the password salt to appear as 'undefined' and the password to be invalid.
gherasima_passwd-linux
train
js
c9902e912876ce517bb238bb6ab889f60b1cde8a
diff --git a/lib/script-boilerplate.js b/lib/script-boilerplate.js index <HASH>..<HASH> 100644 --- a/lib/script-boilerplate.js +++ b/lib/script-boilerplate.js @@ -355,6 +355,11 @@ function moduleWrapper(name, module, resultStore) { try { retval = module[methodName].apply(module._this, args); } catch (e) { + // do nothing if error ocurred after the module was disposed (or in a process of being disposed) + // except for init methods of course + if (module._this && !module._this.isInitialized && methodName !== 'init') { + return; + } error = errHelper.getOxygenError(e, name, methodName, args); } diff --git a/ox_modules/module-mob.js b/ox_modules/module-mob.js index <HASH>..<HASH> 100644 --- a/ox_modules/module-mob.js +++ b/ox_modules/module-mob.js @@ -225,9 +225,7 @@ module.exports = function (options, context, rs, logger) { _this.isInitialized = false; try { _this.driver.end(); - } - catch (e) { - logger.error(e); // ignore any error at disposal stage + } catch (e) { } } };
Don't ignore errors from init methods
oxygenhq_oxygen
train
js,js
38f419bfd212b710d0e487ecb4242eb58e42aee1
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -29,7 +29,7 @@ return array( 'label' => 'QTI item model', 'description' => 'TAO QTI item model', 'license' => 'GPL-2.0', - 'version' => '8.4.4', + 'version' => '8.4.5', 'author' => 'Open Assessment Technologies', 'requires' => array( 'taoItems' => '>=4.1.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -498,6 +498,6 @@ class Updater extends \common_ext_ExtensionUpdater $this->setVersion('8.3.0'); } - $this->skip('8.3.0', '8.4.4'); + $this->skip('8.3.0', '8.4.5'); } }
Bump patch version tao-<I>
oat-sa_extension-tao-itemqti
train
php,php
ed1a34dd6c694fdfdd40a8f858f71c6929e00cb1
diff --git a/django_xworkflows/__init__.py b/django_xworkflows/__init__.py index <HASH>..<HASH> 100644 --- a/django_xworkflows/__init__.py +++ b/django_xworkflows/__init__.py @@ -2,5 +2,5 @@ # Copyright (c) 2011-2013 Raphaël Barrois # This code is distributed under the two-clause BSD license. -__version__ = '0.9.2' +__version__ = '0.9.3' __author__ = 'Raphaël Barrois <[email protected]>'
Version bump to <I>, bis.
rbarrois_django_xworkflows
train
py
e587d97d51e1b2affcc3ce1eb802d0e83ceb6b45
diff --git a/src/Mailbox.php b/src/Mailbox.php index <HASH>..<HASH> 100644 --- a/src/Mailbox.php +++ b/src/Mailbox.php @@ -124,8 +124,6 @@ final class Mailbox implements MailboxInterface */ public function setFlag(string $flag, $numbers): bool { - $this->init(); - if (\is_array($numbers)) { $numbers = \implode(',', $numbers); } @@ -143,8 +141,6 @@ final class Mailbox implements MailboxInterface */ public function clearFlag(string $flag, $numbers): bool { - $this->init(); - if (\is_array($numbers)) { $numbers = \implode(',', $numbers); }
Mailbox::init removed by #<I>
ddeboer_imap
train
php
3f26f394beb8f47f69f3a7473da206ad6a164ddc
diff --git a/lib/rest_adapter/exceptions.rb b/lib/rest_adapter/exceptions.rb index <HASH>..<HASH> 100644 --- a/lib/rest_adapter/exceptions.rb +++ b/lib/rest_adapter/exceptions.rb @@ -9,7 +9,7 @@ module DataMapperRest end def to_s - "Resource action failed with code: #{response.code}, message: #{response.message if response.respond_to?(:message)}" + "Resource action failed with code: #{response.code}, message: #{response.message if response.respond_to?(:message)}, body: #{response.body}" end end
[dm-rest-adapter] Added the response body in exception message
datamapper_dm-rest-adapter
train
rb
f12b410f72cfa8a6e91903a98fa7fea1bda6e540
diff --git a/ezp/Persistence/User.php b/ezp/Persistence/User.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/User.php +++ b/ezp/Persistence/User.php @@ -28,17 +28,24 @@ class User extends AbstractValueObject public $login; /** + * User E-Mail address + * + * @var string + */ + public $email; + + /** * User password * * @var string */ - public $pwd; + public $password; /** * Hash algorithm used to has the password * * @var string */ - public $hashAlg; + public $hashAlgorithm; } ?>
Updated user struct User proper variable names and not abbreviations. Added missing email property.
ezsystems_ezpublish-kernel
train
php
c977156f9b7ba3f1348cbfcd88a6122a7e14a080
diff --git a/keychain_darwin.go b/keychain_darwin.go index <HASH>..<HASH> 100644 --- a/keychain_darwin.go +++ b/keychain_darwin.go @@ -1,6 +1,6 @@ package keyring -import keychain "github.com/99designs/aws-vault/Godeps/_workspace/src/github.com/keybase/go-osxkeychain" +import keychain "github.com/99designs/aws-vault/Godeps/_workspace/src/github.com/99designs/go-osxkeychain" type OSXKeychain struct { }
Replace keybase/go-osxkeychain with <I>designs fork
99designs_keyring
train
go
a7d1cf92959ce0f4e656a7fdda7d5adaa4ba9213
diff --git a/common-core-open/src/main/java/com/bbn/bue/common/files/MergeDocIDToFileMaps.java b/common-core-open/src/main/java/com/bbn/bue/common/files/MergeDocIDToFileMaps.java index <HASH>..<HASH> 100644 --- a/common-core-open/src/main/java/com/bbn/bue/common/files/MergeDocIDToFileMaps.java +++ b/common-core-open/src/main/java/com/bbn/bue/common/files/MergeDocIDToFileMaps.java @@ -50,7 +50,7 @@ public class MergeDocIDToFileMaps { final Parameters params = Parameters.loadSerifStyle(new File(argv[0])); final File listOfMaps = params.getExistingFile("inputListOfMaps"); - final File outputMap = params.getExistingFile("outputMap"); + final File outputMap = params.getCreatableFile("outputMap"); final boolean allowDuplicatesAndPreferEarlierEntries = params.getOptionalBoolean("allowDuplicatesAndPreferEarlierEntries").or(false); final Map<Symbol, File> mergedMap = Maps.newHashMap();
output file does not need to exist beforehand
BBN-E_bue-common-open
train
java
a16537203f1f85b73c48b6cb667eaba80c6d28c3
diff --git a/workshift/views.py b/workshift/views.py index <HASH>..<HASH> 100644 --- a/workshift/views.py +++ b/workshift/views.py @@ -70,10 +70,10 @@ def add_workshift_context(request): if not request.user.is_authenticated(): return dict() to_return = dict() - for pos in Manager.objects.filter(workshift_manager=True): - if pos.incumbent and pos.incumbent.user == request.user: - to_return['WORKSHIFT_MANAGER'] = True - break + if Manager.objects.filter(workshift_manager=True, + incumbent__user=request.user).count() > 0 or \ + request.user.is_staff or request.user.is_superuser: + to_return['WORKSHIFT_MANAGER'] = True # Current semester is for navbar notifications try: CURRENT_SEMESTER = Semester.objects.get(current=True)
Allow superuser / staff to see workshift controls
knagra_farnsworth
train
py
8fb61f8c0dc59377fb4f6863c4bad9a51cac54c6
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index <HASH>..<HASH> 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -8,7 +8,17 @@ class TestPsych < Psych::TestCase Psych.domain_types.clear end - def test_line_width + def test_line_width_invalid + assert_raises(ArgumentError) { Psych.dump('x', { :line_width => -2 }) } + end + + def test_line_width_no_limit + data = { 'a' => 'a b' * 50} + expected = "---\na: #{'a b' * 50}\n" + assert_equal(expected, Psych.dump(data, { :line_width => -1 })) + end + + def test_line_width_limit yml = Psych.dump('123456 7', { :line_width => 5 }) assert_match(/^\s*7/, yml) end
Add a failing test for line width #<I>
ruby_psych
train
rb
678065c687f440bd825ef9aec50378fe55e5f58d
diff --git a/plugins/librato/measurement.go b/plugins/librato/measurement.go index <HASH>..<HASH> 100644 --- a/plugins/librato/measurement.go +++ b/plugins/librato/measurement.go @@ -19,6 +19,7 @@ import ( "fmt" "regexp" + log "github.com/Sirupsen/logrus" "github.com/dcos/dcos-metrics/plugins" ) @@ -68,6 +69,9 @@ func (m *measurement) addTag(name string, value string) error { if !matched { return fmt.Errorf("Tag value '%s' is not valid", value) } + if found, ok := m.Tags[name]; ok && found != value { + log.Warnf("Existing tag '%s'='%s' being overwritten with '%s", name, found, value) + } m.Tags[name] = value return nil }
Log a warning if a tag value is overwritten with a different value.
dcos_dcos-metrics
train
go
f54accba480d3a216805662fe2657dc777530d08
diff --git a/physical/zookeeper.go b/physical/zookeeper.go index <HASH>..<HASH> 100644 --- a/physical/zookeeper.go +++ b/physical/zookeeper.go @@ -112,16 +112,12 @@ func (c *ZookeeperBackend) Delete(key string) error { fullPath := c.path + key - exists, _, err := c.client.Exists(fullPath) + err := c.client.Delete(fullPath, -1) - if err != nil { - return err - } - - if exists { - return c.client.Delete(fullPath, -1) - } else { + if err == zk.ErrNoNode { return nil + } else { + return err } }
limit round trips on zk delete
hashicorp_vault
train
go
a0f29277b72203ac507683e3726d633852870ad1
diff --git a/prometheus_flask_exporter/multiprocess.py b/prometheus_flask_exporter/multiprocess.py index <HASH>..<HASH> 100644 --- a/prometheus_flask_exporter/multiprocess.py +++ b/prometheus_flask_exporter/multiprocess.py @@ -40,7 +40,7 @@ class MultiprocessPrometheusMetrics(PrometheusMetrics): __metaclass__ = ABCMeta - def __init__(self, app=None, **kwargs): + def __init__(self, app=None, registry=None, **kwargs): """ Create a new multiprocess-aware Prometheus metrics export configuration. @@ -50,7 +50,7 @@ class MultiprocessPrometheusMetrics(PrometheusMetrics): _check_multiproc_env_var() - registry = kwargs.get('registry') or CollectorRegistry() + registry = registry or CollectorRegistry() MultiProcessCollector(registry) super(MultiprocessPrometheusMetrics, self).__init__(
Fix MultiprocessPrometheusMetrics with explicit registry
rycus86_prometheus_flask_exporter
train
py
ef9c8cc46c096134a0b5738f801e5a9600715b04
diff --git a/src/Ups/Shipping.php b/src/Ups/Shipping.php index <HASH>..<HASH> 100644 --- a/src/Ups/Shipping.php +++ b/src/Ups/Shipping.php @@ -441,7 +441,7 @@ class Shipping extends Ups $request->appendChild($node); $request->appendChild($xml->createElement('RequestAction', 'ShipAccept')); - $container->appendChild($xml->createElement('ShipmentDigest', $shipmentDigest)); + $container->appendChild($xml->createElement('ShipmentDigest', $shipmentDigest->ShipmentDigest)); return $xml->saveXML(); }
Shipping - Line <I> - we need to use the ShipmentDigest string as a parameter, and not the stdObject
gabrielbull_php-ups-api
train
php
f066853d09516c09ee90d5122f832685f3b6bdf3
diff --git a/lib/jss/version.rb b/lib/jss/version.rb index <HASH>..<HASH> 100644 --- a/lib/jss/version.rb +++ b/lib/jss/version.rb @@ -27,6 +27,6 @@ module JSS ### The version of the JSS ruby gem - VERSION = '0.11.3a1'.freeze + VERSION = '1.0.0a1'.freeze end # module
This version will require Jamf<I>x, so we finally hit <I>!
PixarAnimationStudios_ruby-jss
train
rb