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
|
---|---|---|---|---|---|
65d8d4110156712e2d40837dfc7540b87dce1cc2
|
diff --git a/src/Validation.php b/src/Validation.php
index <HASH>..<HASH> 100644
--- a/src/Validation.php
+++ b/src/Validation.php
@@ -9,6 +9,7 @@ namespace Nutrition;
*/
use Base;
+use Cursor;
use DB\SQL\Mapper as SQLMapperOri;
use DB\Jig\Mapper as JigMapperOri;
use DB\Mongo\Mapper as MongoMapperOri;
@@ -41,7 +42,7 @@ class Validation
*/
protected $cursor;
- public function __construct(MapperInterface $map = null)
+ public function __construct(Cursor $map = null)
{
$this->map = $map;
$this->messages = Base::instance()->get('validation_messages');
|
Bugfix: wrong type hinting on Validation
|
eghojansu_nutrition
|
train
|
php
|
56b9f0ffb6718b8f42d96340435012ef95d4ef20
|
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
@@ -48,6 +48,19 @@ module ArJdbc
# TODO: Explain this!
end
+ def prefetch_primary_key?(table_name = nil)
+ # TRUE if the table has no identity column
+ names = table_name.upcase.split(".")
+ sql = "SELECT 1 FROM SYSCAT.COLUMNS WHERE IDENTITY = 'Y' "
+ sql += "AND TABSCHEMA = '#{names.first}' " if names.size == 2
+ sql += "AND TABNAME = '#{names.last}'"
+ select_one(sql).nil?
+ end
+
+ def next_sequence_value(sequence_name)
+ select_value("select next value for #{sequence_name} from sysibm.sysdummy1")
+ end
+
module Column
def type_cast(value)
return nil if value.nil? || value =~ /^\s*null\s*$/i
|
Fetch a sequence value manually for tables with no identity columns
This is to support legacy tables for which the sequence needs to be
manually specified in ActiveRecord
|
jruby_activerecord-jdbc-adapter
|
train
|
rb
|
05bb8b62a7a974a583da1778b7819658b47ae8f9
|
diff --git a/public/js/chrome/navigation.js b/public/js/chrome/navigation.js
index <HASH>..<HASH> 100644
--- a/public/js/chrome/navigation.js
+++ b/public/js/chrome/navigation.js
@@ -49,7 +49,7 @@ function opendropdown(el) {
var menu;
if (!dropdownOpen) {
menu = $(el).closest('.menu').addClass('open').trigger('open');
- var input = menu.find('input:first').focus()[0];
+ var input = menu.find('input:visible:first').focus()[0];
if (input) setTimeout(function () {
input.select();
}, 0);
|
correctly select/set focus on the first _visible_ input element on form based menus (like login)
|
jsbin_jsbin
|
train
|
js
|
3ddff9fbbeec15fe51e5012ac2ac5aa34c732c4d
|
diff --git a/ORM/PaginatedRepository.php b/ORM/PaginatedRepository.php
index <HASH>..<HASH> 100644
--- a/ORM/PaginatedRepository.php
+++ b/ORM/PaginatedRepository.php
@@ -40,9 +40,7 @@ class PaginatedRepository extends EntityRepository
{
$qb = $this->createPaginatedQueryBuilder($criteria);
$qb->addSelect($this->getEntityAlias());
- if (is_array($orderBy)) {
- $qb->addOrder($orderBy, $this->getEntityAlias());
- }
+ $this->processOrderBy($qb, $orderBy);
$qb->addPagination($page, $rpp);
$results = $qb->getQuery()->getResult();
@@ -100,6 +98,17 @@ class PaginatedRepository extends EntityRepository
}
/**
+ * @param PaginatedQueryBuilder $qb
+ * @param array|null $orderBy
+ */
+ protected function processOrderBy(PaginatedQueryBuilder $qb, array $orderBy = null)
+ {
+ if (is_array($orderBy)) {
+ $qb->addOrder($orderBy, $this->getEntityAlias());
+ }
+ }
+
+ /**
* @return string
*/
protected function getEntityAlias()
|
PaginatedRepository move order logic to protected method
|
javihgil_doctrine-pagination
|
train
|
php
|
a5eec0f76b7c4c58d30325875249f3c07100bd18
|
diff --git a/lib/serf/client.js b/lib/serf/client.js
index <HASH>..<HASH> 100644
--- a/lib/serf/client.js
+++ b/lib/serf/client.js
@@ -84,7 +84,7 @@ Client.prototype = {
var name = member.Name;
if (members.some(function(member) {
- return member.Tags["have-unprocessed-messages-for-" + name] == "true";
+ return member.Tags["buffered-for-" + name] == "true";
}))
return false;
|
Follow to change of droonga-engine
|
droonga_express-droonga
|
train
|
js
|
22776d36c7f2757ce04fda0cdcf2e45367b6620e
|
diff --git a/lib/browser.js b/lib/browser.js
index <HASH>..<HASH> 100644
--- a/lib/browser.js
+++ b/lib/browser.js
@@ -18,3 +18,4 @@ require('./http/xhr');
if (typeof window !== 'undefined') window.AWS = AWS;
if (typeof module !== 'undefined') module.exports = AWS;
+if (typeof self !== 'undefined') self.AWS = AWS;
|
adding AWS namespace to self to support running in webworkers
|
aws_aws-sdk-js
|
train
|
js
|
eae5851192f790edf4b3c871fbca2f239bcf4588
|
diff --git a/java/server/src/org/openqa/selenium/remote/server/handler/GetSessionCapabilities.java b/java/server/src/org/openqa/selenium/remote/server/handler/GetSessionCapabilities.java
index <HASH>..<HASH> 100644
--- a/java/server/src/org/openqa/selenium/remote/server/handler/GetSessionCapabilities.java
+++ b/java/server/src/org/openqa/selenium/remote/server/handler/GetSessionCapabilities.java
@@ -30,12 +30,7 @@ public class GetSessionCapabilities extends ResponseAwareWebDriverHandler {
public ResultType call() {
Session session = getSession();
-
Map<String, Object> capabilities = (Map<String, Object>) session.getCapabilities().asMap();
- // To facilitate the server-side selenium emulation, put the session ID
- // into the capabilities.
- capabilities.put("webdriver.remote.sessionid", session.getSessionId().toString());
-
response.setValue(describeSession(capabilities));
return ResultType.SUCCESS;
|
DanielWagnerHall: Reverting revision <I> because it breaks the remote server - the Capabilities map is immutable. Make a copy if you want to change it.
r<I>
|
SeleniumHQ_selenium
|
train
|
java
|
542383bba881ef24fe0bb9dfcd46d978b811d662
|
diff --git a/closure/goog/ui/drilldownrow.js b/closure/goog/ui/drilldownrow.js
index <HASH>..<HASH> 100644
--- a/closure/goog/ui/drilldownrow.js
+++ b/closure/goog/ui/drilldownrow.js
@@ -217,14 +217,6 @@ goog.ui.DrilldownRow.prototype.removeChild = function(child) {
};
-/** @override */
-goog.ui.DrilldownRow.prototype.disposeInternal = function() {
- delete this.html_;
- this.children_ = null;
- goog.ui.DrilldownRow.superClass_.disposeInternal.call(this);
-};
-
-
/**
* Rendering of DrilldownRow's is on need, do not call this directly
* from application code.
|
No access to private member.
-------------
Created by MOE: <URL>
|
google_closure-library
|
train
|
js
|
0e96acf9527c55a72b5ec6d385b6a779d9927b61
|
diff --git a/molvs/normalize.py b/molvs/normalize.py
index <HASH>..<HASH> 100644
--- a/molvs/normalize.py
+++ b/molvs/normalize.py
@@ -39,7 +39,7 @@ class Normalization(object):
@memoized_property
def transform(self):
log.debug('Loading Normalization transform: %s', self.name)
- return AllChem.ReactionFromSmarts(str(self.transform_str.encode('utf8')))
+ return AllChem.ReactionFromSmarts(str(self.transform_str))
def __repr__(self):
return 'Normalization({!r}, {!r})'.format(self.name, self.transform_str)
|
Fix ReactionFromSmarts for both python 2 and 3
|
mcs07_MolVS
|
train
|
py
|
ae329374fdd3ea86b2811bbdf4e65ab4002f2259
|
diff --git a/components/dialog-ng/dialog-ng.js b/components/dialog-ng/dialog-ng.js
index <HASH>..<HASH> 100644
--- a/components/dialog-ng/dialog-ng.js
+++ b/components/dialog-ng/dialog-ng.js
@@ -187,7 +187,7 @@ class DialogController {
Reflect.deleteProperty(this, 'DIALOG_NAMESPACE');
- if (shortcuts.getScope().pop() === this.dialogService.DIALOG_NAMESPACE) {
+ if (shortcuts.getScope().indexOf(this.dialogService.DIALOG_NAMESPACE) > -1) {
shortcuts.setScope(this.currentShortcutsScope);
}
}
|
RG-<I> re-implement
Former-commit-id: fc<I>f<I>a<I>a<I>bfc8ada0b4ce<I>f7e<I>e
|
JetBrains_ring-ui
|
train
|
js
|
49c8001c2499b60d0f1bc3a5e9f35d87221fd6ee
|
diff --git a/src/inode.js b/src/inode.js
index <HASH>..<HASH> 100644
--- a/src/inode.js
+++ b/src/inode.js
@@ -264,6 +264,7 @@ export function makeInodeHeaderBlob( datastore_id, inode_type, owner_id, inode_u
'type': inode_type,
'owner': owner_id,
'uuid': inode_uuid,
+ 'readers': [], // unused for now
'data_hash': data_hash,
'version': version,
'proto_version': BLOCKSTACK_STORAGE_PROTO_VERSION,
|
empty list of readers in each inode, for now
|
blockstack_blockstack-storage-js
|
train
|
js
|
556d85e31fb0aba53d4939e66795c5be7554199b
|
diff --git a/lib/svtplay_dl/fetcher/dash.py b/lib/svtplay_dl/fetcher/dash.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/fetcher/dash.py
+++ b/lib/svtplay_dl/fetcher/dash.py
@@ -94,5 +94,6 @@ class DASH(VideoRetriever):
if self.options.output != "-":
file_d.close()
+ progressbar(bytes_so_far, total_size, "ETA: complete")
progress_stream.write('\n')
self.finished = True
|
dash: complete the progress bar after file is downloaded
The progress bar wasn't updated after the downloaded completed,
so the final progress bar would look something like this:
[<I>/<I>][===============================.] ETA: 0:<I>:<I>
This can be interpreted as the file didn't download completely.
Reported-by: rooth
|
spaam_svtplay-dl
|
train
|
py
|
3da79b350b78d57409f0688e45d967c5963666dc
|
diff --git a/libraries/joomla/cache/storage/file.php b/libraries/joomla/cache/storage/file.php
index <HASH>..<HASH> 100644
--- a/libraries/joomla/cache/storage/file.php
+++ b/libraries/joomla/cache/storage/file.php
@@ -9,8 +9,6 @@
defined('JPATH_PLATFORM') or die;
-jimport('joomla.filesystem.file');
-
/**
* File cache storage handler
*
@@ -202,12 +200,8 @@ class JCacheStorageFile extends JCacheStorage
{
$result = true;
// files older than lifeTime get deleted from cache
- $files = $this->_filesInFolder($this->_root, '', true, true);
+ $files = $this->_filesInFolder($this->_root, '', true, true, array('.svn', 'CVS','.DS_Store','__MACOSX', 'index.html'));
foreach($files As $file) {
- if('index.html' == JFile::getName($file)) {
- // Don't delete index.html files
- continue;
- }
$time = @filemtime($file);
if (($time + $this->_lifetime) < $this->_now || empty($time)) {
$result |= @unlink($file);
|
[#<I>] JCacheFIle should not use JFile calls at all
|
joomla_joomla-framework
|
train
|
php
|
fd05ba4f86e251e6fa0cca399de406d8dc2a97c9
|
diff --git a/src/console/controllers/Migrate.php b/src/console/controllers/Migrate.php
index <HASH>..<HASH> 100644
--- a/src/console/controllers/Migrate.php
+++ b/src/console/controllers/Migrate.php
@@ -89,7 +89,7 @@ class Migrate extends Controller
$custom_name = false;
- if (count($argv)) {
+ if ($argv && count($argv)) {
$custom_name = mb_strtolower($argv[0], 'utf-8');
}
diff --git a/src/web/Form.php b/src/web/Form.php
index <HASH>..<HASH> 100755
--- a/src/web/Form.php
+++ b/src/web/Form.php
@@ -46,7 +46,7 @@ class Form
$data = $data->to_array();
}
- if (count($data)) {
+ if (is_array($data)) {
foreach (array_intersect_key($data, $this->_fields) as $key => $value) {
$this->set($key, $value);
}
|
Fix count (php<I>)
|
levmorozov_mii
|
train
|
php,php
|
4817bc57cd91d976d82345e921eb87366013b6b5
|
diff --git a/pymc3/distributions/mixture.py b/pymc3/distributions/mixture.py
index <HASH>..<HASH> 100644
--- a/pymc3/distributions/mixture.py
+++ b/pymc3/distributions/mixture.py
@@ -397,6 +397,19 @@ class Mixture(Distribution):
return comp_dist_shapes, broadcast_shape
def logp(self, value):
+ """
+ Calculate log-probability of defined Mixture distribution at specified value.
+
+ Parameters
+ ----------
+ value : numeric
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
+ values are desired the values must be provided in a numpy array or theano tensor
+
+ Returns
+ -------
+ TensorVariable
+ """
w = self.w
return bound(logsumexp(tt.log(w) + self._comp_logp(value), axis=-1),
@@ -404,6 +417,22 @@ class Mixture(Distribution):
broadcast_conditions=False)
def random(self, point=None, size=None):
+ """
+ Draw random values from defined Mixture distribution.
+
+ Parameters
+ ----------
+ point : dict, optional
+ Dict of variable values on which random values are to be
+ conditioned (uses default point if not specified).
+ size : int, optional
+ Desired size of random sample (returns one sample if not
+ specified).
+
+ Returns
+ -------
+ array
+ """
# Convert size to tuple
size = to_tuple(size)
# Draw mixture weights and infer the comp_dists shapes
|
Add doc strings for random and logp class methods for mixture distribution
|
pymc-devs_pymc
|
train
|
py
|
cc6c07e656bd1330f1d85c9110d6b8675607d550
|
diff --git a/system/Config/DotEnv.php b/system/Config/DotEnv.php
index <HASH>..<HASH> 100644
--- a/system/Config/DotEnv.php
+++ b/system/Config/DotEnv.php
@@ -183,7 +183,7 @@ class DotEnv
$value = $this->resolveNestedVariables($value);
// Handle hex2bin prefix
- if ($name === 'encryption.key' && substr($value, 0, 8) === 'hex2bin:')
+ if ($name === 'encryption.key' && strpos($value, 'hex2bin:') === 0)
{
$value = hex2bin(substr($value, 8));
}
|
Update system/Config/DotEnv.php
|
codeigniter4_CodeIgniter4
|
train
|
php
|
fdf8825477d8dd1e4315339b488a03a16b36d3b6
|
diff --git a/salt/modules/file.py b/salt/modules/file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -686,7 +686,7 @@ def find(path, *args, **kwargs):
except ValueError as ex:
return 'error: {0}'.format(ex)
- ret = [item for i in [finder.find(os.path.expanduser(p)) for p in glob.glob(path)] for item in i]
+ ret = [item for i in [finder.find(p) for p in glob.glob(os.path.expanduser(path))] for item in i]
ret.sort()
return ret
|
Preserve previous behaviour when doing glob expansion in file.find
|
saltstack_salt
|
train
|
py
|
06eaaec3d75d2987b5bc66f19e2aa99a7b9b55b2
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,9 +1,3 @@
-# temporary
-puts "Running rubocop..."
-output = `rubocop`
-puts output
-raise "Rubocop failed" unless output.include? "no offenses detected"
-
require 'coveralls'
Coveralls.wear! unless ENV["FASTLANE_SKIP_UPDATE_CHECK"]
|
Rubocop is now being run by fastlane and not spaceship
|
fastlane_fastlane
|
train
|
rb
|
a990524be343a306197e9e76a4fb246fecd7b2a2
|
diff --git a/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java b/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java
+++ b/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java
@@ -377,6 +377,7 @@ public class PersistenceManagerImpl implements PersistenceManager {
final AdvancedCache<Object, Object> flaggedCache = getCacheForStateInsertion();
return Flowable.fromPublisher(preloadCl.entryPublisher(null, true, true))
.take(maxEntries)
+ .observeOn(cpuScheduler)
.doOnNext(me -> preloadKey(flaggedCache, me.getKey(), me.getValue(), me.getMetadata()))
.count()
.subscribeOn(persistenceScheduler)
|
ISPN-<I> Preload write is performed on persistence thread
* Make sure to observe on the CPU thread
|
infinispan_infinispan
|
train
|
java
|
9e3b3fe456a60afd9d3d355d999331f2c6c013ab
|
diff --git a/src/get-region-from-meta.js b/src/get-region-from-meta.js
index <HASH>..<HASH> 100644
--- a/src/get-region-from-meta.js
+++ b/src/get-region-from-meta.js
@@ -33,12 +33,7 @@ function getRegionFromMeta({ v, /*c, */r25th, r40th, r50th, r75th, r90th } = {},
regionMean.right = regionMean.left + regionMean.width - 1;
regionMean.bottom = regionMean.top + regionMean.height - 1;
-/*
- if (regionMean.right >= imageWidth) {
- regionMean.left -= (regionMean.right - imageWidth);
- regionMean.right = regionMean.left + regionMean.width - 1;
- }
-*/
+
return regionMean;
}
|
should be no need for redundant boundary detection
|
asilvas_salient-autofocus
|
train
|
js
|
3404061fdd4ee67eb0cee73e2eb2528ab9bd57af
|
diff --git a/views/boom/editor/footer.php b/views/boom/editor/footer.php
index <HASH>..<HASH> 100644
--- a/views/boom/editor/footer.php
+++ b/views/boom/editor/footer.php
@@ -22,4 +22,4 @@
//]]>
</script>
</body>
-</html>
+</html>
\ No newline at end of file
|
Removed blank link at EOF
|
boomcms_boom-core
|
train
|
php
|
6352cf23742c53f3312f3a004c762a077bdb73d7
|
diff --git a/testing/test_session.py b/testing/test_session.py
index <HASH>..<HASH> 100644
--- a/testing/test_session.py
+++ b/testing/test_session.py
@@ -126,14 +126,14 @@ class SessionTests(object):
)
reprec = testdir.inline_run(p)
passed, skipped, failed = reprec.listoutcomes()
- assert len(failed) == 1
+ assert (len(passed), len(skipped), len(failed)) == (1, 0, 1)
out = failed[0].longrepr.reprcrash.message
assert (
out.find(
"""[Exception("Ha Ha fooled you, I'm a broken repr().") raised in repr()]"""
)
!= -1
- ) # '
+ )
def test_skip_file_by_conftest(self, testdir):
testdir.makepyfile(
|
test_implicit_bad_repr1: harden/cleanup
|
pytest-dev_pytest
|
train
|
py
|
aae3c3538492f19f1c4e1fcfe6c942ff72a30ce1
|
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
@@ -102,10 +102,6 @@ module ActiveRecord
ActiveRecord::Base.pluralize_table_names ? table_name.to_s.pluralize : table_name
end
- def interpolate_sql(sql)
- instance_eval("%@#{sql.gsub('@', '\@')}@", __FILE__, __LINE__)
- end
-
private
def allocate_aliases
@@ -120,7 +116,7 @@ module ActiveRecord
end
def process_conditions(conditions, table_name)
- Arel.sql(interpolate_sql(sanitize_sql(conditions, table_name)))
+ Arel.sql(sanitize_sql(conditions, table_name))
end
def sanitize_sql(condition, table_name)
|
removing interpolate_sql from join associations
|
rails_rails
|
train
|
rb
|
d7ead114762937659181896eac31b2972f7490f6
|
diff --git a/config/config.php b/config/config.php
index <HASH>..<HASH> 100644
--- a/config/config.php
+++ b/config/config.php
@@ -8,6 +8,7 @@ return [
'productionEnvironments' => [
'prod',
'production',
+ 'live',
],
/*
|
add 'live' as default production env
|
beyondcode_laravel-self-diagnosis
|
train
|
php
|
bee905c5b6991f4878086c5f03ca4de7e9aa1228
|
diff --git a/message.php b/message.php
index <HASH>..<HASH> 100644
--- a/message.php
+++ b/message.php
@@ -161,7 +161,7 @@ if ($action=='send' && $good_to_send) {
echo WT_I18N::translate('Message was not sent'), '<br />';
AddToLog('Unable to send message. FROM:'.$from.' TO:'.$to.' (recipient does not exist)', 'error');
} else if (addMessage($message)) {
- echo WT_I18N::translate('Message successfully sent to %s', '<b>'.getUserFullName($to_user_id).'</b>');
+ echo WT_I18N::translate('Message successfully sent to %s', '<b>'.$to.'</b>');
} else {
echo WT_I18N::translate('Message was not sent'), '<br />';
AddToLog('Unable to send message. FROM:'.$from.' TO:'.$to.' (failed to send)', 'error');
|
message.php - undefined variable (error from previous change)
|
fisharebest_webtrees
|
train
|
php
|
57a4a687ebff4cf04a2e8ea72770bb7b32d72861
|
diff --git a/game.rb b/game.rb
index <HASH>..<HASH> 100644
--- a/game.rb
+++ b/game.rb
@@ -47,16 +47,16 @@ class Grid
cells << @storage[index - 1] unless beginning_of_row?(index)
cells << @storage[index + 1] unless end_of_row?(index)
- unless index < size
+ unless first_row?(index)
cells << @storage[above(index - 1)] unless beginning_of_row?(index)
- cells << @storage[above(index)]
cells << @storage[above(index + 1)] unless end_of_row?(index)
+ cells << @storage[above(index)]
end
unless last_row?(index)
cells << @storage[below(index) - 1] unless beginning_of_row?(index)
- cells << @storage[below(index)]
cells << @storage[below(index) + 1] unless end_of_row?(index)
+ cells << @storage[below(index)]
end
cells
@@ -94,6 +94,10 @@ class Grid
(index + 1) % size == 0
end
+ def first_row?(index)
+ index < size
+ end
+
def last_row?(index)
index >= (size * size - size)
end
|
Minor changes for consistency
- And reordering to highlight duplication
|
enocom_ruby_life
|
train
|
rb
|
8fb9c2a11dec6f71d180301562fa27e132537207
|
diff --git a/state.go b/state.go
index <HASH>..<HASH> 100644
--- a/state.go
+++ b/state.go
@@ -814,6 +814,14 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {
case *GuildDelete:
err = s.GuildRemove(t.Guild)
case *GuildMemberAdd:
+ // Updates the MemberCount of the guild.
+ guild, err := s.Guild(t.Member.GuildID)
+ if err != nil {
+ return err
+ }
+ guild.MemberCount++
+
+ // Caches member if tracking is enabled.
if s.TrackMembers {
err = s.MemberAdd(t.Member)
}
@@ -822,6 +830,14 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {
err = s.MemberAdd(t.Member)
}
case *GuildMemberRemove:
+ // Updates the MemberCount of the guild.
+ guild, err := s.Guild(t.Member.GuildID)
+ if err != nil {
+ return err
+ }
+ guild.MemberCount--
+
+ // Removes member from the cache if tracking is enabled.
if s.TrackMembers {
err = s.MemberRemove(t.Member)
}
|
track membercount on memberAdd and leave (#<I>)
* track membercount on memberAdd and leave
* requested changes
|
bwmarrin_discordgo
|
train
|
go
|
5e3dc75e3d1dfdb6e33e39fedda54a82a493ba99
|
diff --git a/src/file.js b/src/file.js
index <HASH>..<HASH> 100644
--- a/src/file.js
+++ b/src/file.js
@@ -167,7 +167,7 @@ exports = module.exports = {
* @return {Boolean}
*/
isDirectory: function (path) {
- return fs.lstatSync(path).isDirectory();
+ return fs.statSync(path).isDirectory();
},
/**
|
Use `stat` instead of `lstat` to support symlinks
|
SassDoc_sassdoc
|
train
|
js
|
12ce73a1a2b93196c15da63663ac1a76e7b2f191
|
diff --git a/media/player/html5video/tests/player_test.php b/media/player/html5video/tests/player_test.php
index <HASH>..<HASH> 100644
--- a/media/player/html5video/tests/player_test.php
+++ b/media/player/html5video/tests/player_test.php
@@ -60,7 +60,7 @@ class media_html5video_testcase extends advanced_testcase {
/**
* Test method get_supported_extensions()
*/
- public function test_supported_extensions() {
+ public function test_get_supported_extensions() {
$nativeextensions = file_get_typegroup('extension', 'html_video');
// Make sure that the list of extensions from the setting is exactly the same as html_video group.
@@ -70,6 +70,25 @@ class media_html5video_testcase extends advanced_testcase {
}
/**
+ * Test method list_supported_urls()
+ */
+ public function test_list_supported_urls() {
+ global $CFG;
+ require_once($CFG->libdir . '/filelib.php');
+
+ $nativeextensions = file_get_typegroup('extension', 'html_video');
+
+ // Create list of URLs for each extension.
+ $urls = array_map(function($ext){
+ return new moodle_url('http://example.org/video.' . $ext);
+ }, $nativeextensions);
+
+ // Make sure that the list of supported URLs is not filtering permitted extensions.
+ $player = new media_html5video_plugin();
+ $this->assertCount(count($urls), $player->list_supported_urls($urls));
+ }
+
+ /**
* Test embedding without media filter (for example for displaying file resorce).
*/
public function test_embed_url() {
|
MDL-<I> media_html5video: Add test for native extensions support.
This is to verify that all files of html_video mime type extensions are
passing list_supported_urls method correctly.
|
moodle_moodle
|
train
|
php
|
5e5a280254082a6f697b91bf43eea2addbb74366
|
diff --git a/src/test/java/org/attribyte/wp/db/DBTest.java b/src/test/java/org/attribyte/wp/db/DBTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/attribyte/wp/db/DBTest.java
+++ b/src/test/java/org/attribyte/wp/db/DBTest.java
@@ -78,16 +78,18 @@ public class DBTest {
user = db().selectUser(createdUser.id);
assertNotNull(user);
assertEquals(createdUser.username, user.username);
+ assertEquals(createdUser.username.toLowerCase(), user.slug);
}
@Test
public void userByUsername() throws Exception {
String username = StringUtil.randomString(8);
- User user = new User(0L, username, username.toUpperCase(), username + "@testy.com", System.currentTimeMillis(), ImmutableList.of());
+ User user = new User(0L, username, username.toUpperCase(), username + "test-slug", username + "@testy.com", System.currentTimeMillis(), ImmutableList.of());
User createdUser = db().createUser(user, "XXXX");
user = db().selectUser(createdUser.username);
assertNotNull(user);
assertEquals(createdUser.id, user.id);
+ assertEquals(username + "test-slug", user.slug);
}
@Test
|
Make sure "slug" is set when specified during construction & generated automatically.
|
attribyte_wpdb
|
train
|
java
|
2a064a4e83d9b7e832ae7b09c713aa46527db85c
|
diff --git a/chill-java/src/main/java/com/twitter/chill/SerDeState.java b/chill-java/src/main/java/com/twitter/chill/SerDeState.java
index <HASH>..<HASH> 100644
--- a/chill-java/src/main/java/com/twitter/chill/SerDeState.java
+++ b/chill-java/src/main/java/com/twitter/chill/SerDeState.java
@@ -50,8 +50,8 @@ public class SerDeState {
public void setInput(byte[] in, int offset, int count) { input.setBuffer(in, offset, count); }
public void setInput(InputStream in) { input.setInputStream(in); }
- public int numOfWrittenBytes() { return output.total(); }
- public int numOfReadBytes() { return input.total(); }
+ public long numOfWrittenBytes() { return output.total(); }
+ public long numOfReadBytes() { return input.total(); }
// Common operations:
public <T> T readObject(Class<T> cls) {
|
Changed numOfWrittenBytes to long to match Kryo
|
twitter_chill
|
train
|
java
|
1ab9522055ccba912dcf704a09b858035d4e31cf
|
diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -29,9 +29,9 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2020061500.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2020061500.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
-$release = '4.0dev (Build: 20200615)'; // Human-friendly version name
+$release = '4.0dev (Build: 20200618)'; // Human-friendly version name
$branch = '40'; // This version's branch.
$maturity = MATURITY_ALPHA; // This version's maturity level.
|
weekly on-sync release <I>dev
|
moodle_moodle
|
train
|
php
|
d305da5762f0aa94e79d2c57f756a0072cfb98d6
|
diff --git a/spec/unit/restclient_spec.rb b/spec/unit/restclient_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/restclient_spec.rb
+++ b/spec/unit/restclient_spec.rb
@@ -71,9 +71,9 @@ describe RestClient do
end
describe 'version' do
- it 'has a version ~> 1.7.0.alpha' do
+ it 'has a version ~> 2.0.0.alpha' do
ver = Gem::Version.new(RestClient.version)
- Gem::Requirement.new('~> 1.7.0.alpha').should be_satisfied_by(ver)
+ Gem::Requirement.new('~> 2.0.0.alpha').should be_satisfied_by(ver)
end
end
end
|
Fix version spec tests for <I>
|
rest-client_rest-client
|
train
|
rb
|
0708f2779cbcd10e08c6e4cb6551ccea93d75f09
|
diff --git a/tests/child_processes_test.py b/tests/child_processes_test.py
index <HASH>..<HASH> 100644
--- a/tests/child_processes_test.py
+++ b/tests/child_processes_test.py
@@ -80,7 +80,7 @@ def spawn_process_which_dies_with_children():
# we need to sleep before the shell exits, or dumb-init might send
# TERM to print_signals before it has had time to register custom
# signal handlers
- '{python} -m testing.print_signals & sleep 0.1'.format(
+ '{python} -m testing.print_signals & sleep 1'.format(
python=sys.executable,
),
),
|
Fix test on slow machines, increasing the sleep time
The original sleep time is too short, the tests failed on
architectures like mips*, armhf. I think it's because the
python interpreter can't start in <I>s.
After increasing the sleep time, it passed on most architectures
which Debian supports.
The result can be found at:
<URL>
|
Yelp_dumb-init
|
train
|
py
|
ac3ac3ce38bc6d25d2d38f49107e35c203c61afd
|
diff --git a/lib/models/graph-object.js b/lib/models/graph-object.js
index <HASH>..<HASH> 100644
--- a/lib/models/graph-object.js
+++ b/lib/models/graph-object.js
@@ -21,6 +21,7 @@ function GraphModelFactory (Model) {
instanceId: {
type: 'string',
required: true,
+ unique: true,
uuidv4: true
},
context: {
|
adding unique constraint to graph object instance id
|
RackHD_on-core
|
train
|
js
|
e57c3b9b75760159a44ce59777eb0bbb5e14da1b
|
diff --git a/lib/polygon/helpers.rb b/lib/polygon/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/polygon/helpers.rb
+++ b/lib/polygon/helpers.rb
@@ -13,8 +13,12 @@ module Polygon
settings.templates
end
+ def database
+ settings.database
+ end
+
def lispy(&bl)
- @lispy ||= Alf.lispy(settings.database)
+ @lispy ||= Alf.lispy(database)
bl ? @lispy.evaluate(&bl) : @lispy
end
|
Let database be known in App instance.
|
blambeau_polygon
|
train
|
rb
|
03fc3d0647f1b0d8435b2693c4ff23035d51403b
|
diff --git a/lib/moonshine/manifest/rails.rb b/lib/moonshine/manifest/rails.rb
index <HASH>..<HASH> 100644
--- a/lib/moonshine/manifest/rails.rb
+++ b/lib/moonshine/manifest/rails.rb
@@ -8,17 +8,18 @@ class Moonshine::Manifest::Rails < Moonshine::Manifest
group "rails",
:ensure => "present",
- :gid => 1001,
:allowdupe => false
- user "rails",
+ user "create-rails-user",
+ :name => "user"
:ensure => "present",
- :uid => 1001,
- :gid => 1001,
+ :notify => reference(:exec, "passwd-rails")
+
+ user "rails",
:home => "/srv/rails",
:shell => "/bin/bash",
+ :groups => "admin"
:allowdupe => false,
- :notify => reference(:exec, "passwd-rails")
file "/srv/rails",
:ensure => "directory",
|
create rails user and change password in two steps
|
railsmachine_shadow_puppet
|
train
|
rb
|
4f8b8ff1d04fb6f8f35f3bbcc5cbab0e64ac7188
|
diff --git a/test/test_datasets_utils.py b/test/test_datasets_utils.py
index <HASH>..<HASH> 100644
--- a/test/test_datasets_utils.py
+++ b/test/test_datasets_utils.py
@@ -7,6 +7,7 @@ import zipfile
import tarfile
import gzip
import warnings
+from torch._six import PY2
from torch._utils_internal import get_file_path_2
from common_utils import get_tmp_dir
@@ -40,6 +41,7 @@ class Tester(unittest.TestCase):
self.assertTrue(utils.check_integrity(existing_fpath))
self.assertFalse(utils.check_integrity(nonexisting_fpath))
+ @unittest.skipIf(PY2, "https://github.com/pytorch/vision/issues/1268")
def test_download_url(self):
with get_tmp_dir() as temp_dir:
url = "http://github.com/pytorch/vision/archive/master.zip"
@@ -51,6 +53,7 @@ class Tester(unittest.TestCase):
warnings.warn(msg, RuntimeWarning)
raise unittest.SkipTest(msg)
+ @unittest.skipIf(PY2, "https://github.com/pytorch/vision/issues/1268")
def test_download_url_retry_http(self):
with get_tmp_dir() as temp_dir:
url = "https://github.com/pytorch/vision/archive/master.zip"
|
Disable download tests for Python2 (#<I>)
|
pytorch_vision
|
train
|
py
|
e94cfb9d7d8071dff663be2b533861ee903a199e
|
diff --git a/src/Executor/Result.php b/src/Executor/Result.php
index <HASH>..<HASH> 100644
--- a/src/Executor/Result.php
+++ b/src/Executor/Result.php
@@ -17,11 +17,13 @@ class Result {
// Datetime weirdness. Apparently this is caused by theming issues on the
// remote theme. Why it is being called when executed via CLI is another
// story.
- if (strpos($output[0], 'date_timezone_set() expects parameter') === 0) {
- array_shift($output);
- }
- if (strpos($output[0], 'date_format() expects parameter') === 0) {
- array_shift($output);
+ if (isset($output[0])) {
+ if (strpos($output[0], 'date_timezone_set() expects parameter') === 0) {
+ array_shift($output);
+ }
+ if (strpos($output[0], 'date_format() expects parameter') === 0) {
+ array_shift($output);
+ }
}
$this->command = $command;
|
Fix PHP warning, when output was not an array.
|
drutiny_drutiny
|
train
|
php
|
bc7e0f037435e875009b39582c58ef17bfacc312
|
diff --git a/data/account.pb.go b/data/account.pb.go
index <HASH>..<HASH> 100644
--- a/data/account.pb.go
+++ b/data/account.pb.go
@@ -8,7 +8,7 @@ Package data is a generated protocol buffer package.
It is generated from these files:
account.proto
karma.proto
- user_agent.proto
+ useragent.proto
It has these top-level messages:
Account
|
Updates protobuffer autogen annotation.
I really hate that these have to be in vcs at all.
|
turnage_graw
|
train
|
go
|
671c85bbd7edc44b887227774ee9cbf023008b20
|
diff --git a/tentacoli.js b/tentacoli.js
index <HASH>..<HASH> 100644
--- a/tentacoli.js
+++ b/tentacoli.js
@@ -106,6 +106,12 @@ function Tentacoli (opts) {
this._main.on('error', this.emit.bind(this, 'error'))
this._parser.on('error', this.emit.bind(this, 'error'))
+ this.on('finish', function () {
+ Object.keys(this._requests).forEach(function (reqId) {
+ this._requests[reqId].callback(new Error('connection closed'))
+ }, this)
+ })
+
var self = this
function Reply () {
this.response = null
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -303,3 +303,19 @@ test('errors if piping something errors', function (t) {
t.fail('it never happens')
})
})
+
+test('errors if the connection fails', function (t) {
+ t.plan(2)
+
+ var s = setup()
+ var msg = 'the answer to life, the universe and everything'
+
+ s.sender.request(msg, function (err) {
+ t.ok(err, 'should error')
+ })
+
+ s.receiver.on('request', function (req, reply) {
+ t.deepEqual(req, msg, 'request matches')
+ s.receiver.end()
+ })
+})
|
Calls callbacks with errors if the connection closes.
|
mcollina_tentacoli
|
train
|
js,js
|
c1334da2e009ce3dd086599f9f986c552a3bda46
|
diff --git a/travis/tests/test_encrypt.py b/travis/tests/test_encrypt.py
index <HASH>..<HASH> 100644
--- a/travis/tests/test_encrypt.py
+++ b/travis/tests/test_encrypt.py
@@ -24,7 +24,7 @@ def test_encrypt_key(repository):
public_key = retrieve_public_key(repository)
password = 'SUPER_SECURE_PASSWORD'
encrypted_password = encrypt_key(public_key, password.encode())
- assert isinstance(encrypted_password, bytes)
+ assert isinstance(encrypted_password, str)
def test_password_output():
|
Changed test of bytes to str
|
mandeep_Travis-Encrypt
|
train
|
py
|
b15d7eb8f7f884c22934b86ede0d2b94a4ed5bdd
|
diff --git a/zk_coordinator.go b/zk_coordinator.go
index <HASH>..<HASH> 100644
--- a/zk_coordinator.go
+++ b/zk_coordinator.go
@@ -673,6 +673,8 @@ func (this *ZookeeperCoordinator) waitForMembersToJoin(barrierPath string, expec
}
// Haven't seen all expected consumers on this barrier path. Watch for changes to the path...
select {
+ case <-stopChan:
+ return
case <-zkMemberJoinedWatcher:
continue
}
|
Added case for stopChan on inner select to break out.
|
elodina_go_kafka_client
|
train
|
go
|
fb8a9d908c6a0865e6a3b9e01b4a49c7eb60adb7
|
diff --git a/anytree/resolver.py b/anytree/resolver.py
index <HASH>..<HASH> 100644
--- a/anytree/resolver.py
+++ b/anytree/resolver.py
@@ -219,7 +219,7 @@ class Resolver(object):
re_pat += "."
else:
re_pat += re.escape(char)
- return re_pat + r'\Z(?ms)'
+ return r'(?ms)' + re_pat + r'\Z'
class ResolverError(RuntimeError):
|
Update resolver.py
Avoid to throw /my/path/resolver.py:<I>: DeprecationWarning: Flags not at the start of the expression 'expr\\Z(?ms)' in python <I>
|
c0fec0de_anytree
|
train
|
py
|
e50fd942d2f116e3eb69c63b5f3ef107e4975ecc
|
diff --git a/test/spec/index.js b/test/spec/index.js
index <HASH>..<HASH> 100644
--- a/test/spec/index.js
+++ b/test/spec/index.js
@@ -2,6 +2,8 @@ import { expect } from "chai";
import pakit from "../../src/pakit";
describe("pakit test suite", function() {
+ this.timeout(10000);
+
describe("when bundling a module with no dependencies", function() {
var result;
before(function () {
|
bumped test timeout to <I> seconds
|
MiguelCastillo_pakit
|
train
|
js
|
adcdf6a36251c57019214287c0c0edf7aa8f8f1b
|
diff --git a/lib/with_advisory_lock/concern.rb b/lib/with_advisory_lock/concern.rb
index <HASH>..<HASH> 100644
--- a/lib/with_advisory_lock/concern.rb
+++ b/lib/with_advisory_lock/concern.rb
@@ -16,6 +16,10 @@ module WithAdvisoryLock
self.class.with_advisory_lock(lock_name, timeout_seconds, &block)
end
+ def advisory_lock_exists?(lock_name)
+ self.class.advisory_lock_exists?(lock_name)
+ end
+
module ClassMethods
def with_advisory_lock(lock_name, timeout_seconds=nil, &block)
impl = impl_class.new(connection, lock_name, timeout_seconds)
@@ -28,7 +32,7 @@ module WithAdvisoryLock
end
private
-
+
def impl_class
das = WithAdvisoryLock::DatabaseAdapterSupport.new(connection)
impl_class = if das.postgresql?
diff --git a/test/concern_test.rb b/test/concern_test.rb
index <HASH>..<HASH> 100644
--- a/test/concern_test.rb
+++ b/test/concern_test.rb
@@ -12,4 +12,9 @@ describe "with_advisory_lock.concern" do
it "adds advisory_lock_exists? to ActiveRecord classes" do
assert Tag.respond_to?(:advisory_lock_exists?)
end
+
+ it "adds advisory_lock_exists? to ActiveRecord classes" do
+ assert Label.new.respond_to?(:advisory_lock_exists?)
+ end
+
end
|
add advisory_lock_exists? to ActiveRecord instances
|
ClosureTree_with_advisory_lock
|
train
|
rb,rb
|
e70fd54d7b003d17048574ce374cde5ba08b989d
|
diff --git a/src/hamster/widgets/activityentry.py b/src/hamster/widgets/activityentry.py
index <HASH>..<HASH> 100644
--- a/src/hamster/widgets/activityentry.py
+++ b/src/hamster/widgets/activityentry.py
@@ -531,7 +531,6 @@ class ActivityEntry():
for category in runtime.storage.get_categories():
category_name = category['name']
category_id = category['id']
- c_iter = self.model.append(["", category_name, "@{}".format(category_name)])
for activity in runtime.storage.get_category_activities(category_id):
activity_name = activity["name"]
text = "{}@{}".format(activity_name, category_name)
|
remove @category lines
They were more disturbing than helpful.
There is already a specific category entry.
|
projecthamster_hamster
|
train
|
py
|
0ce37fdf7e71b588d1c165866af94da996c9890f
|
diff --git a/test/scraped_test.rb b/test/scraped_test.rb
index <HASH>..<HASH> 100644
--- a/test/scraped_test.rb
+++ b/test/scraped_test.rb
@@ -36,6 +36,11 @@ describe Scraped do
decorator FindReplaceDecorator, find: 'Hello', replace: 'Hi!'
end
+ class PageWithMultipleDecorators < PageNoDecorators
+ decorator FindReplaceDecorator, find: 'Hello', replace: 'Hi!'
+ decorator UpcaseDecorator
+ end
+
it 'does not change the response with no decorators' do
PageNoDecorators.new(response: response).body.must_equal 'Hello'
end
@@ -49,5 +54,11 @@ describe Scraped do
response: response
).body.must_equal 'Hi!'
end
+
+ it 'works with multiple decorators' do
+ PageWithMultipleDecorators.new(
+ response: response
+ ).body.must_equal 'HI!'
+ end
end
end
|
Add a test for a page with multiple decorators
|
everypolitician_scraped
|
train
|
rb
|
c1d250204853089e1996c078e5321bce4eb31431
|
diff --git a/addon/fold/foldgutter.js b/addon/fold/foldgutter.js
index <HASH>..<HASH> 100644
--- a/addon/fold/foldgutter.js
+++ b/addon/fold/foldgutter.js
@@ -52,7 +52,7 @@
function isFolded(cm, line) {
var marks = cm.findMarksAt(Pos(line));
for (var i = 0; i < marks.length; ++i)
- if (marks[i].__isFold && marks[i].find().from.line == line) return true;
+ if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
}
function marker(spec) {
@@ -98,7 +98,9 @@
if (!state) return;
var opts = state.options;
if (gutter != opts.gutter) return;
- cm.foldCode(Pos(line, 0), opts.rangeFinder);
+ var folded = isFolded(cm, line);
+ if (folded) folded.clear();
+ else cm.foldCode(Pos(line, 0), opts.rangeFinder);
}
function onChange(cm) {
|
[foldgutter addon] Make sure unfolding markers work, even when fold range is broken
Closes #<I>
|
codemirror_CodeMirror
|
train
|
js
|
deb5dd415f78d4902db7f10a417dfbccbf54685b
|
diff --git a/sdl/error.go b/sdl/error.go
index <HASH>..<HASH> 100644
--- a/sdl/error.go
+++ b/sdl/error.go
@@ -23,7 +23,11 @@ func (ec ErrorCode) c() C.SDL_errorcode {
// GetError (https://wiki.libsdl.org/SDL_GetError)
func GetError() error {
if err := C.SDL_GetError(); err != nil {
- return errors.New(C.GoString(err))
+ gostr := C.GoString(err)
+ // SDL_GetError returns "an empty string if there hasn't been an error message"
+ if len(gostr) > 0 {
+ return errors.New(gostr)
+ }
}
return nil
}
|
SDL_GetError returns an empty string, not nil, when there are no errors. (#<I>)
|
veandco_go-sdl2
|
train
|
go
|
d2b95f29b0320ee0e573e2d7864bff8e6d2fe073
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -69,7 +69,6 @@ process.on('exit', function () {
if (cur) {
cur.error(new Error('bench was never ended'))
console.log('\n# fail\n')
- process.exit(1)
return
}
console.log('\n# total ~' + prettyHrtime(total) + ' ' + rawTime(total) + '\n\n# ok\n')
|
do not process exit - messes up logs
|
mafintosh_nanobench
|
train
|
js
|
e89d36bd074572a061e1ec7d037378e6f742e6b5
|
diff --git a/flatfs.go b/flatfs.go
index <HASH>..<HASH> 100644
--- a/flatfs.go
+++ b/flatfs.go
@@ -40,6 +40,8 @@ var _ datastore.Datastore = (*Datastore)(nil)
type ShardFunc func(string) string
+var IPFS_DEF_SHARD = "v1/next-to-last/2"
+
func New(path string, fun0 string, sync bool) (*Datastore, error) {
fun0 = NormalizeShardFunc(fun0)
|
Add constant for default shard func used by IPFS.
|
ipfs_go-ds-flatfs
|
train
|
go
|
7628deaebf9ebd0bc3822f69c94917697b149648
|
diff --git a/models/classes/runner/time/TimerAdjustmentMapInterface.php b/models/classes/runner/time/TimerAdjustmentMapInterface.php
index <HASH>..<HASH> 100644
--- a/models/classes/runner/time/TimerAdjustmentMapInterface.php
+++ b/models/classes/runner/time/TimerAdjustmentMapInterface.php
@@ -50,7 +50,7 @@ interface TimerAdjustmentMapInterface
public function decrease(string $sourceId, string $type, int $seconds): TimerAdjustmentMapInterface;
/**
- * Gets the calculated adjustment in seconds
+ * Gets the calculated total adjustments of all types stored for provided source ID in seconds.
* @param string $sourceId
* @return int
*/
|
Updated method phpdoc description.
|
oat-sa_extension-tao-test
|
train
|
php
|
eceebebb7674db43fffa2b519210d184d66492e8
|
diff --git a/lib/accounting/booking.rb b/lib/accounting/booking.rb
index <HASH>..<HASH> 100644
--- a/lib/accounting/booking.rb
+++ b/lib/accounting/booking.rb
@@ -1,6 +1,6 @@
module Accounting
class Booking < ActiveRecord::Base
- validates_presence_of :debit_account, :credit_account, :amount, :value_date
+ validates_presence_of :debit_account, :credit_account, :title, :amount, :value_date
belongs_to :debit_account, :foreign_key => 'debit_account_id', :class_name => "Account"
belongs_to :credit_account, :foreign_key => 'credit_account_id', :class_name => "Account"
|
Validate precense of title for bookings.
|
huerlisi_has_accounts
|
train
|
rb
|
9de359401415538c92b93ca560304ae6bf815b90
|
diff --git a/tests/Generators/FileSystemTreeGeneratorTest.php b/tests/Generators/FileSystemTreeGeneratorTest.php
index <HASH>..<HASH> 100644
--- a/tests/Generators/FileSystemTreeGeneratorTest.php
+++ b/tests/Generators/FileSystemTreeGeneratorTest.php
@@ -14,7 +14,6 @@ class FileSystemTreeGeneratorTest extends \PHPUnit_Framework_TestCase
private function getGenerator()
{
- $fileSystem = $this->getMock('Illuminate\Filesystem\Filesystem');
$generator = new FileSystemTreeGenerator($fileSystem);
return $generator;
|
Updated test to reflect Filesystem contract
|
newup_core
|
train
|
php
|
b3421f120f531424256739ddb942d990d7b3c9b0
|
diff --git a/kubernetes/src/main/java/io/kubernetes/client/custom/IntOrString.java b/kubernetes/src/main/java/io/kubernetes/client/custom/IntOrString.java
index <HASH>..<HASH> 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/custom/IntOrString.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/custom/IntOrString.java
@@ -44,6 +44,11 @@ public class IntOrString {
return intValue;
}
+ @Override
+ public String toString() {
+ return (isInt ? String.valueOf(intValue) : strValue);
+ }
+
public static class IntOrStringAdapter extends TypeAdapter<IntOrString> {
@Override
public void write(JsonWriter jsonWriter, IntOrString intOrString) throws IOException {
|
adding toString method to IntOrString
|
kubernetes-client_java
|
train
|
java
|
85468d3a0dab31e2e2f571245f478e6101f664d7
|
diff --git a/lib/Models/GeoJsonCatalogItem.js b/lib/Models/GeoJsonCatalogItem.js
index <HASH>..<HASH> 100644
--- a/lib/Models/GeoJsonCatalogItem.js
+++ b/lib/Models/GeoJsonCatalogItem.js
@@ -805,6 +805,7 @@ function filterArray(pts, func) {
function updateOpacity(item) {
const entities = item.dataSource.entities.values;
+ item.dataSource.entities.suspendEvents();
for (var i = 0; i < entities.length; i++) {
const entity = entities[i];
@@ -838,6 +839,7 @@ function updateOpacity(item) {
.withAlpha(item.opacity);
}
}
+ item.dataSource.entities.resumeEvents();
item.terria.currentViewer.notifyRepaintRequired();
}
|
suspend and resume events on setting geojson opacity
|
TerriaJS_terriajs
|
train
|
js
|
a2e3cef94cf29bbaa51b4f868291ca5b0aa77a45
|
diff --git a/spec/seahorse/client/plugin_spec.rb b/spec/seahorse/client/plugin_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/seahorse/client/plugin_spec.rb
+++ b/spec/seahorse/client/plugin_spec.rb
@@ -18,7 +18,9 @@ module Seahorse
describe Plugin do
let(:handlers) { HandlerList.new }
- let(:config) { Configuration.new}
+
+ let(:config) { Configuration.new }
+
let(:plugin_class) { Class.new(Plugin) }
describe '#add_options' do
|
Updated a few specs helpers to use let.
|
aws_aws-sdk-ruby
|
train
|
rb
|
b5a5dcf506c4be39afdc9a9a0700272f9807efaf
|
diff --git a/test/unit/index.js b/test/unit/index.js
index <HASH>..<HASH> 100644
--- a/test/unit/index.js
+++ b/test/unit/index.js
@@ -1,3 +1,17 @@
+// mock passive event listener support and upsupport
+(() => {
+ const originAddListener = window.addEventListener;
+ let flag;
+
+ window.addEventListener = (...args) => {
+ // try to read passive property and only read once time if it is accessible
+ if (!flag && args[2] && args[2].passive) {
+ flag = false;
+ }
+ originAddListener.apply(window, args);
+ };
+})();
+
const testsContext = require.context('./specs', true, /\.spec$/);
testsContext.keys().forEach(testsContext);
|
Improve unit tests for passive event support logic
|
PeachScript_vue-infinite-loading
|
train
|
js
|
00b93f3296d2cfc05852b4f46dba0058bda503d9
|
diff --git a/spec/unit/resource/api1600/c7000/volume_attachment_spec.rb b/spec/unit/resource/api1600/c7000/volume_attachment_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/resource/api1600/c7000/volume_attachment_spec.rb
+++ b/spec/unit/resource/api1600/c7000/volume_attachment_spec.rb
@@ -1,3 +1,14 @@
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# You may not use this file except in compliance with the License.
+# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed
+# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+# CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
require 'spec_helper'
RSpec.describe OneviewSDK::API1600::C7000::VolumeAttachment do
|
Update volume_attachment_spec.rb
|
HewlettPackard_oneview-sdk-ruby
|
train
|
rb
|
f1e601d836aad7142be1d0dc7bb9bde5c1c4abea
|
diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js
index <HASH>..<HASH> 100644
--- a/js/jquery.mapael.js
+++ b/js/jquery.mapael.js
@@ -490,6 +490,16 @@
if (typeof opt.mapOptions === "object") {
if (opt.replaceOptions === true) options = $.extend(true, {}, defaultOptions, opt.mapOptions);
else $.extend(true, options, opt.mapOptions);
+
+ // IF we update areas, plots or legend, then reset all legend state to "show"
+ if (typeof opt.mapOptions.areas != "undefined" || typeof opt.mapOptions.plots != "undefined" || typeof opt.mapOptions.legend != "undefined") {
+ $("[data-type='elem']", $container).each(function (id, elem) {
+ if ($(elem).attr('data-hidden') === "1") {
+ // Toggle state of element by clicking
+ $(elem).trigger('click', [false, animDuration]);
+ }
+ });
+ }
}
// Delete plots by name if deletePlotKeys is array
|
Update event: reset legend state if areas, plots or legend is updated
|
neveldo_jQuery-Mapael
|
train
|
js
|
1b7f8938c00b5b61d647b57fb0306c28cafb0981
|
diff --git a/formBinder.go b/formBinder.go
index <HASH>..<HASH> 100644
--- a/formBinder.go
+++ b/formBinder.go
@@ -458,7 +458,15 @@ func (dec *Decoder) decode() error {
case reflect.Struct:
switch dec.curr.Interface().(type) {
case time.Time:
- t, err := time.Parse("2006-01-02", dec.values[0])
+ d := dec.values[0]
+ var t time.Time
+ var err error
+ // Parsing RFC3339 is ~3 times more expensive than "2006-01-02", check first if it complies, then attempt best route
+ if len(d) > 10 && d[10] == 'T' {
+ t, err = time.Parse(time.RFC3339, d)
+ } else {
+ t, err = time.Parse("2006-01-02", d)
+ }
if err != nil {
return newError(fmt.Errorf("the value of field \"%v\" in path \"%v\" is not a valid datetime", dec.field, dec.path))
}
|
Added ability to parse ISO <I> date format on formBind.
|
iris-contrib_formBinder
|
train
|
go
|
5e590caa436bdd12e8aa94e6333d97b5e4b80a19
|
diff --git a/packages/desktop/src/main/cli.js b/packages/desktop/src/main/cli.js
index <HASH>..<HASH> 100644
--- a/packages/desktop/src/main/cli.js
+++ b/packages/desktop/src/main/cli.js
@@ -1,5 +1,5 @@
-import { Observable } from "rxjs/Observable";
-import { merge, catchError, mergeMap } from "rxjs/operators";
+import { catchError, mergeMap } from "rxjs/operators";
+import { merge } from "rxjs/observable/merge";
import { join } from "path";
import { dialog } from "electron";
@@ -34,12 +34,10 @@ const setWinPathObservable = (exe, rootDir, binDir) => {
.filter((item, index, array) => array.indexOf(item) === index);
env.push(binDir);
const envPath = env.join(";");
- return Observable.pipe(
- merge(
- spawn("SETX", ["PATH", `${envPath}`]),
- spawn("SETX", ["NTERACT_EXE", exe]),
- spawn("SETX", ["NTERACT_DIR", rootDir])
- )
+ return merge(
+ spawn("SETX", ["PATH", `${envPath}`]),
+ spawn("SETX", ["NTERACT_EXE", exe]),
+ spawn("SETX", ["NTERACT_DIR", rootDir])
);
};
|
Fix windows CLI (#<I>)
|
nteract_nteract
|
train
|
js
|
2ef5b3541f81b034bc34f6d27562fedd75206fd6
|
diff --git a/Views/backend/plentymarkets/view/log/grid.js b/Views/backend/plentymarkets/view/log/grid.js
index <HASH>..<HASH> 100644
--- a/Views/backend/plentymarkets/view/log/grid.js
+++ b/Views/backend/plentymarkets/view/log/grid.js
@@ -87,7 +87,17 @@ Ext.define('Shopware.apps.Plentymarkets.view.log.Grid', {
}, {
header: 'Meldung',
dataIndex: 'message',
- flex: 7
+ flex: 7,
+ listeners: {
+ click: function(a, b, c, d, e, record, g)
+ {
+ Ext.Msg.show({
+ title: '#' + record.get('id') + ' – ' + record.get('identifier'),
+ msg: Ext.util.Format.nl2br(record.get('message')),
+ buttons: Ext.Msg.OK,
+ });
+ }
+ }
}];
me.callParent(arguments);
|
UPDATE Log (message overlay)
|
plentymarkets_plentymarkets-shopware-connector
|
train
|
js
|
9dc9fbd59a550ae94e0051688fcaca866eb7a556
|
diff --git a/lib/Resque/Resque.php b/lib/Resque/Resque.php
index <HASH>..<HASH> 100644
--- a/lib/Resque/Resque.php
+++ b/lib/Resque/Resque.php
@@ -136,7 +136,8 @@ abstract class Resque
));
if ($trackStatus) {
- Status::create($id);
+ $status = new Status($id, $this);
+ $status->create();
}
return $id;
|
Main resque class support for status tracking fixed
|
vend_php-resque
|
train
|
php
|
23baa8b428ed6602d2b7e3bd4dd7182aa68dc659
|
diff --git a/lib/abort_if.rb b/lib/abort_if.rb
index <HASH>..<HASH> 100644
--- a/lib/abort_if.rb
+++ b/lib/abort_if.rb
@@ -51,10 +51,13 @@ module AbortIf
#
# @note The abort_if style methods don't interpolate arguments to
# msg as the Assert module methods do
+ #
+ # @note When rescuing AbortIf::Exit, the msg will be passed if you
+ # want to display it in the rescue block
def abort_if test, msg="Fatal error"
if test
logger.fatal msg
- raise Exit
+ raise Exit, msg
end
end
diff --git a/spec/abort_if_spec.rb b/spec/abort_if_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/abort_if_spec.rb
+++ b/spec/abort_if_spec.rb
@@ -69,9 +69,11 @@ describe AbortIf do
expect(klass.abort_if false_test).to be nil
end
- it "raises AbortIf::Exit if truthy" do
+ it "raises AbortIf::Exit with msg if truthy" do
test = hash.has_key? :a
- expect { klass.abort_if true_test }.to raise_error AbortIf::Exit
+ msg = "Teehee"
+ expect { klass.abort_if true_test, msg }.
+ to raise_error AbortIf::Exit, msg
end
include_examples "for logging a fatal error", :abort_if, true
|
raise AbortIf::Exit with message for rescuing
|
mooreryan_abort_if
|
train
|
rb,rb
|
ffeafa83e1bce96a0b19c46978cdbae09878dd6b
|
diff --git a/src/Collection/CollectionTrait.php b/src/Collection/CollectionTrait.php
index <HASH>..<HASH> 100644
--- a/src/Collection/CollectionTrait.php
+++ b/src/Collection/CollectionTrait.php
@@ -49,7 +49,7 @@ trait CollectionTrait
* type of returned collection interface
*
* @param mixed $args,.. Constructor arguments.
- * @return CollectionInterface
+ * @return \Cake\Collection\CollectionInterface
*/
protected function newCollection(...$args)
{
|
Collection trait: provide a FQCN in docblock
|
cakephp_cakephp
|
train
|
php
|
d941f1cc105a023fa1c32e8b8d003e88ff5b860c
|
diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -289,6 +289,7 @@
for( var j = index; j < elements.length; j++ ){
var jid = elements[j]._private.data.id;
id2index[ jid ]--;
+ elements[j]._private.index--;
}
}
}
|
Issue with edge hit detection when removing/adding edges with mappers (ele index out of sync) #<I>
|
cytoscape_cytoscape.js
|
train
|
js
|
230576af7ddd7e3b1d4c552bfb0096aa16b7a55f
|
diff --git a/zinnia/__init__.py b/zinnia/__init__.py
index <HASH>..<HASH> 100644
--- a/zinnia/__init__.py
+++ b/zinnia/__init__.py
@@ -1,5 +1,5 @@
"""Zinnia"""
-__version__ = '0.14.1'
+__version__ = '0.15.dev'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
|
Bumping to version <I>.dev
|
Fantomas42_django-blog-zinnia
|
train
|
py
|
a11b50a23849ad0e46048ac37d38c25b86361190
|
diff --git a/lib/congress/version.rb b/lib/congress/version.rb
index <HASH>..<HASH> 100644
--- a/lib/congress/version.rb
+++ b/lib/congress/version.rb
@@ -1,3 +1,3 @@
module Congress
- VERSION = "0.0.3"
+ VERSION = "0.0.4"
end
|
Bump gem version to <I>
|
codeforamerica_congress
|
train
|
rb
|
631ea1a76acb9cdbe30fb70cf4dfa729de5c9b2b
|
diff --git a/wrapper/wrapper.go b/wrapper/wrapper.go
index <HASH>..<HASH> 100644
--- a/wrapper/wrapper.go
+++ b/wrapper/wrapper.go
@@ -229,6 +229,10 @@ OUTER:
}
close(pkgChan)
wg.Wait()
+ select {
+ case err = <-errChan:
+ default:
+ }
return err
}
|
wrapper: try to notice the last error
After executing all commands, make one last check on the error
channel, to see whether the last command errored.
|
square_goprotowrap
|
train
|
go
|
29a7d51f37ae49c0e60b2da8d4be1671d1b1b999
|
diff --git a/riscvmodel/model.py b/riscvmodel/model.py
index <HASH>..<HASH> 100644
--- a/riscvmodel/model.py
+++ b/riscvmodel/model.py
@@ -8,7 +8,8 @@ from .program import Program
class State(object):
def __init__(self, variant: Variant):
self.variant = variant
- self.intreg = RegisterFile(variant.intregs, 32, {0: 0x0})
+ intregs = 32 if variant.baseint == "I" else 16
+ self.intreg = RegisterFile(intregs, 32, {0: 0x0})
self.pc = Register(32)
self.pc_update = Register(32)
self.memory = Memory()
|
Set intregs as defined by baseint
|
wallento_riscv-python-model
|
train
|
py
|
aca6982606e9582dda2c1be5c0269610910a6616
|
diff --git a/js/poloniex.js b/js/poloniex.js
index <HASH>..<HASH> 100644
--- a/js/poloniex.js
+++ b/js/poloniex.js
@@ -814,6 +814,8 @@ module.exports = class poloniex extends Exchange {
const feedback = this.id + ' ' + this.json (response);
if (error === 'Invalid order number, or you are not the person who placed the order.') {
throw new OrderNotFound (feedback);
+ } else if (error === 'Order not found, or you are not the person who placed it.') {
+ throw new OrderNotFound (feedback);
} else if (error === 'Invalid API key/secret pair.') {
throw new AuthenticationError (feedback);
} else if (error.indexOf ('Total must be at least') >= 0) {
|
Throw OrderNotFound if order not found in fetchOrderTrades
|
ccxt_ccxt
|
train
|
js
|
918194e4f1b9b6734f89fe141d8f0c63dde0f460
|
diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -1184,6 +1184,17 @@ func (d *qemu) Start(stateful bool) error {
return err
}
+ // Enable extended topology information if needed.
+ cpuType := "host"
+
+ // Only x86_64 requires the use of topoext when SMT is used.
+ if d.architecture == osarch.ARCH_64BIT_INTEL_X86 {
+ _, _, nrThreads, _, _, err := d.cpuTopology(d.expandedConfig["limits.cpu"])
+ if err != nil && nrThreads > 1 {
+ cpuType = "host,topoext"
+ }
+ }
+
// Start QEMU.
qemuCmd := []string{
"--",
@@ -1192,7 +1203,7 @@ func (d *qemu) Start(stateful bool) error {
"-name", d.Name(),
"-uuid", instUUID,
"-daemonize",
- "-cpu", "host",
+ "-cpu", cpuType,
"-nographic",
"-serial", "chardev:console",
"-nodefaults",
|
lxd/instances/qemu: Enable topoext on x<I>_<I> with SMT
|
lxc_lxd
|
train
|
go
|
b9e2b669293279e53320edf041833f137cf5f1ff
|
diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go
index <HASH>..<HASH> 100644
--- a/internal/service/firehose/delivery_stream.go
+++ b/internal/service/firehose/delivery_stream.go
@@ -69,7 +69,6 @@ func dynamicPartitioningConfigurationSchema() *schema.Schema {
Type: schema.TypeBool,
Optional: true,
Default: false,
- ForceNew: true,
},
"retry_options": {
Type: schema.TypeList,
|
Update allowed, ForceNew should not be necessary
|
terraform-providers_terraform-provider-aws
|
train
|
go
|
edd3b0257af5a166021af90f284fbc18c296fb0e
|
diff --git a/nptdms/tdms.py b/nptdms/tdms.py
index <HASH>..<HASH> 100644
--- a/nptdms/tdms.py
+++ b/nptdms/tdms.py
@@ -670,6 +670,19 @@ class TdmsObject(object):
else:
self.data.extend(new_data)
+ def as_dataframe(self):
+ """
+ Converts the TDMS object to a DataFrame
+ :return: The TDMS object data.
+ :rtype: Pandas DataFrame
+ """
+
+ import pandas as pd
+
+ return pd.DataFrame(self.data,
+ index=self.time_track(),
+ columns=[self.path])
+
class _TdmsSegmentObject(object):
"""
|
Added the export to dataframe from within a TdmsObject.
Objects like channels (tested on a channel) can now be exported as a
pandas dataframe.
|
adamreeve_npTDMS
|
train
|
py
|
637a29f1140efcb6af2da8db9f7915a60cbb78e9
|
diff --git a/lib/cocoapods-chillax-swift.rb b/lib/cocoapods-chillax-swift.rb
index <HASH>..<HASH> 100644
--- a/lib/cocoapods-chillax-swift.rb
+++ b/lib/cocoapods-chillax-swift.rb
@@ -1,3 +1,3 @@
module CocoaPodsChillaxSwift
- VERSION = "0.1.0"
+ VERSION = "0.2.0"
end
diff --git a/lib/installer.rb b/lib/installer.rb
index <HASH>..<HASH> 100644
--- a/lib/installer.rb
+++ b/lib/installer.rb
@@ -22,6 +22,7 @@ module CocoaPodsChillaxSwift
targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
+ config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '0'
end
end
|
Disables GCC optimizations, too.
|
ashfurrow_cocoapods-chillax-swift
|
train
|
rb,rb
|
955350ba7c23712ad710a89891f5b51e7b82e263
|
diff --git a/app/models/unidom/visitor/application_record.rb b/app/models/unidom/visitor/application_record.rb
index <HASH>..<HASH> 100644
--- a/app/models/unidom/visitor/application_record.rb
+++ b/app/models/unidom/visitor/application_record.rb
@@ -1,3 +1,6 @@
+##
+# Application record 是模块内所有模型的抽象基类。
+
class Unidom::Visitor::ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
|
1, Improve the Application record for the document.
|
topbitdu_unidom-visitor
|
train
|
rb
|
7fd1cfc3957db003850225d70756bb93d8658699
|
diff --git a/heartbeat/heartbeat.py b/heartbeat/heartbeat.py
index <HASH>..<HASH> 100644
--- a/heartbeat/heartbeat.py
+++ b/heartbeat/heartbeat.py
@@ -95,13 +95,13 @@ class Heartbeat(object):
if challenge.block > (self.file_size - chunk_size):
end_slice = (
- challenge.get_position() - (self.file_size - CHUNK_SIZE)
+ challenge.block - (self.file_size - chunk_size)
)
h.update(self.file_object.read(end_slice))
self.file_object.seek(0)
- h.update(self.file_object.read(CHUNK_SIZE - end_slice))
+ h.update(self.file_object.read(chunk_size - end_slice))
else:
- h.update(self.file_object.read(CHUNK_SIZE))
+ h.update(self.file_object.read(chunk_size))
h.update(seed)
|
fix for refactored vars and challenge class refactors
|
StorjOld_heartbeat
|
train
|
py
|
2d4f01eb318d09105c988af974b5e25340f615c5
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -115,7 +115,7 @@ function parseInput (input, opts, cb) {
file.getStream = getStreamStream(item, file)
file.length = 0
} else if (typeof item === 'string') {
- if (typeof fs.readdir !== 'function') {
+ if (typeof fs.stat !== 'function') {
throw new Error('filesystem paths do not work in the browser')
}
var keepRoot = numPaths > 1 || isSingleFileTorrent
|
fix unhelpful message in browser
In the browser, WebTorrent’s `client.seed()` function returns “Uncaught
TypeError: fs.stat is not a function” when passing in a file path,
because fs.readdir is defined by brfs (I think). Let’s check for
fs.stat instead.
For <URL>
|
webtorrent_create-torrent
|
train
|
js
|
7bd4dd8a71765e1f048a4edd189b4a7b43c0421e
|
diff --git a/locale/ko.js b/locale/ko.js
index <HASH>..<HASH> 100644
--- a/locale/ko.js
+++ b/locale/ko.js
@@ -53,22 +53,8 @@ var ko = moment.defineLocale('ko', {
y : '일 년',
yy : '%d년'
},
- dayOfMonthOrdinalParse : /\d{1,2}(일|월|주)/,
- ordinal : function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '일';
- case 'M':
- return number + '월';
- case 'w':
- case 'W':
- return number + '주';
- default:
- return number;
- }
- },
+ dayOfMonthOrdinalParse : /\d{1,2}일/,
+ ordinal : '%d일',
meridiemParse : /오전|오후/,
isPM : function (token) {
return token === '오후';
|
ndo the changes to locale/ko.js
its autogenerated
|
moment_moment
|
train
|
js
|
a5c57e7df75c2f1c525e10cedaf3025554445445
|
diff --git a/empire/server/releases.go b/empire/server/releases.go
index <HASH>..<HASH> 100644
--- a/empire/server/releases.go
+++ b/empire/server/releases.go
@@ -10,9 +10,11 @@ import (
"github.com/remind101/empire/empire"
)
-// newHkRelease converts an empire Release to a heroku Release.
-func newHkRelease(r *empire.Release) *heroku.Release {
- return &heroku.Release{
+type Release heroku.Release
+
+// newRelease decorates an empire.Release as a heroku.Release.
+func newRelease(r *empire.Release) *Release {
+ return &Release{
Id: string(r.ID),
Version: int(r.Ver),
Slug: &struct {
@@ -48,7 +50,7 @@ func (h *GetRelease) ServeHTTP(w http.ResponseWriter, r *http.Request) error {
}
w.WriteHeader(200)
- return Encode(w, newHkRelease(rel))
+ return Encode(w, newRelease(rel))
}
type GetReleases struct {
|
Alias Release as heroku.Release
|
remind101_empire
|
train
|
go
|
7cdf2793ae2443d76787d132ad37f50b8f31823d
|
diff --git a/lib/rib/shell.rb b/lib/rib/shell.rb
index <HASH>..<HASH> 100644
--- a/lib/rib/shell.rb
+++ b/lib/rib/shell.rb
@@ -46,7 +46,7 @@ class Rib::Shell
input = get_input
throw(:rib_exit, input) if config[:exit].include?(input)
if input.strip == ''
- history.pop
+ eval_input(input)
else
print_result(eval_input(input))
end
|
still need to eval the input if it's empty (for multiline), and don't
pop history!
|
godfat_rib
|
train
|
rb
|
85a0c21de197d1a8e3590f960effae98c42fcd52
|
diff --git a/kubeshell/client.py b/kubeshell/client.py
index <HASH>..<HASH> 100644
--- a/kubeshell/client.py
+++ b/kubeshell/client.py
@@ -8,6 +8,7 @@ import urllib3
# disable warnings on stdout/stderr from urllib3 connection errors
ulogger = logging.getLogger("urllib3")
ulogger.setLevel("ERROR")
+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class KubernetesClient(object):
|
fixes #<I>: disable InsecureRequestWarning from urllib3
(cherry picked from commit 3f3a<I>dc<I>e<I>b<I>e9ccd3eae<I>d<I>ffbb)
|
cloudnativelabs_kube-shell
|
train
|
py
|
aa3af75f97ffb1fe9836ab33a951455072739d3a
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ def extras_require():
def main():
setup(
name='straitlets',
- version='0.2.1',
+ version='0.2.2',
description="Serializable IPython Traitlets",
author="Quantopian Team",
author_email="[email protected]",
|
MAINT: Bump PyPI.
|
quantopian_serializable-traitlets
|
train
|
py
|
a6fcb58611d0dbe54e7a51380b2e5d19bd94fea5
|
diff --git a/IlluminaUtils/lib/fastqlib.py b/IlluminaUtils/lib/fastqlib.py
index <HASH>..<HASH> 100644
--- a/IlluminaUtils/lib/fastqlib.py
+++ b/IlluminaUtils/lib/fastqlib.py
@@ -163,9 +163,9 @@ class FileOutput(object):
def __init__(self, file_path, compressed = False):
self.file_path = file_path
- self.compressed = compressed
+ self.compressed_output = compressed
- if self.compressed:
+ if self.compressed_output:
self.file_pointer = gzip.open(file_path, 'w')
else:
self.file_pointer = open(file_path, 'w')
@@ -214,8 +214,8 @@ class FastQSource:
self.pos = 0
self.forced_raw = False
- self.compressed = compressed or file_path.endswith('.gz')
- if self.compressed:
+ self.compressed_input = compressed or file_path.endswith('.gz')
+ if self.compressed_input:
# wrap it with TextIOWrapper to prevent gzip.open to return byte\
# objects.
self.file_pointer = io.TextIOWrapper(gzip.open(file_path, 'r'))
|
distinct variables for compressed input/output
|
merenlab_illumina-utils
|
train
|
py
|
7d7edc35b106bf533dca88f8538df6253424b5b7
|
diff --git a/src-test/core/domhelpertest.js b/src-test/core/domhelpertest.js
index <HASH>..<HASH> 100644
--- a/src-test/core/domhelpertest.js
+++ b/src-test/core/domhelpertest.js
@@ -106,3 +106,13 @@ DomHelperTest.prototype.testHasSupportForStyle = function() {
this.domHelper_.supportForStyle_ = true;
assertTrue(this.domHelper_.hasSupportForStyle_());
};
+
+DomHelperTest.prototype.testInsertNullFontStyle = function() {
+ var counter = webfont.DomHelper.nullFontCounter_,
+ name = this.domHelper_.insertNullFontStyle('');
+
+ assertNotNull(name);
+ assertEquals(name, '__webfontloader_test_' + counter + '__');
+ assertNotEquals(counter, webfont.DomHelper.nullFontCounter_);
+ assertNotNull(webfont.DomHelper.nullFontStyles_[name]);
+};
|
Added test for insertNullFontStyle.
|
typekit_webfontloader
|
train
|
js
|
0ac4a26d0962cd7f623eb433950329c202e4f671
|
diff --git a/apostrophe.js b/apostrophe.js
index <HASH>..<HASH> 100644
--- a/apostrophe.js
+++ b/apostrophe.js
@@ -4513,16 +4513,15 @@ function Apos() {
function(callback) {
uploadfs.copyOut(originalFile, tempFile, callback);
},
- // function(callback) {
- // uploadfs.copyImageIn(tempFile, originalFile, callback);
- // }
+ function(callback) {
+ uploadfs.copyImageIn(tempFile, originalFile, callback);
+ }
], callback);
},
// Don't forget to recrop as well!
function(callback) {
async.forEachSeries(file.crops || [], function(crop, callback) {
var originalFile = '/files/' + file._id + '-' + file.name + '.' + crop.left + '.' + crop.top + '.' + crop.width + '.' + crop.height + '.' + file.extension;
- console.log('recropping ' + originalFile);
uploadfs.copyImageIn(tempFile, originalFile, { crop: crop }, callback);
}, callback);
},
|
Whoops, the actual work of apostrophe:rescale was shut off for a while
|
apostrophecms_apostrophe
|
train
|
js
|
31ed3b4105a69a49458687b9778b8c7c13281e34
|
diff --git a/sample_test.go b/sample_test.go
index <HASH>..<HASH> 100644
--- a/sample_test.go
+++ b/sample_test.go
@@ -17,7 +17,7 @@ func TestSample(t *testing.T) {
for i := 0; i < iters; i++ {
s := stream.Sequence(
stream.Numbers(0, space-1),
- stream.Sample(samples),
+ stream.SampleWithSeed(samples, int64(i)),
)
stream.ForEach(s, func(s string) {
num := -1 // Will cause panic below if Scan fails
|
sample_test uses deterministic seeding for reproducibility
|
ghemawat_stream
|
train
|
go
|
62654ade1d4a924f0de0cc4c5e08e7069c8d1a22
|
diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/pillar/__init__.py
+++ b/salt/pillar/__init__.py
@@ -476,10 +476,15 @@ class Pillar(object):
log.error(msg)
errors.append(msg)
else:
- log.debug('Specified SLS {0!r} in environment {1!r} is not'
- ' found, which might be due to environment {1!r}'
- ' not being present in "pillar_roots" yet!'
- .format(sls, saltenv))
+ log.debug(
+ 'Specified SLS \'%s\' in environment \'%s\' was not '
+ 'found. This could be because SLS \'%s\' is in an '
+ 'environment other than \'%s\', but \'%s\' is included in '
+ 'that environment\'s Pillar top file. It could also be '
+ 'due to environment \'%s\' not being defined in '
+ '"pillar_roots"',
+ sls, saltenv, sls, saltenv, saltenv, saltenv
+ )
# return state, mods, errors
return None, mods, errors
state = None
|
Add additional reason for pillar env being found
|
saltstack_salt
|
train
|
py
|
1a2038c54faedeb6d7adf6ddaf0e73f8ce4920d4
|
diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go
index <HASH>..<HASH> 100644
--- a/integration-cli/docker_cli_inspect_test.go
+++ b/integration-cli/docker_cli_inspect_test.go
@@ -328,18 +328,6 @@ func (s *DockerSuite) TestInspectSizeFlagContainer(c *check.C) {
c.Assert(strings.TrimSpace(sz[1]), check.Not(check.Equals), "<nil>")
}
-func (s *DockerSuite) TestInspectSizeFlagImage(c *check.C) {
- runSleepingContainer(c, "-d")
-
- formatStr := "--format='{{.SizeRw}},{{.SizeRootFs}}'"
- out, _, err := dockerCmdWithError("inspect", "-s", "--type=image", formatStr, "busybox")
-
- // Template error rather than <no value>
- // This is a more correct behavior because images don't have sizes associated.
- c.Assert(err, check.Not(check.IsNil))
- c.Assert(out, checker.Contains, "Template parsing error")
-}
-
func (s *DockerSuite) TestInspectTemplateError(c *check.C) {
// Template parsing error for both the container and image.
|
Remove unused "size" query parameter for images
Image inspect doesn't have a "size" query parameter.
The client sent this (when doing `docker inspect --size`),
but was unused in the daemon.
This removes the unused parameter, and a test that
didn't actually test anything.
|
moby_moby
|
train
|
go
|
a84124a2b1159579a808cb5e966101a30bee6e0f
|
diff --git a/Lib/glyphsLib/filters/eraseOpenCorners.py b/Lib/glyphsLib/filters/eraseOpenCorners.py
index <HASH>..<HASH> 100644
--- a/Lib/glyphsLib/filters/eraseOpenCorners.py
+++ b/Lib/glyphsLib/filters/eraseOpenCorners.py
@@ -25,10 +25,8 @@ class EraseOpenCornersPen(BasePen):
self.outpen = outpen
def _moveTo(self, p1):
- if self.segments or self.is_closed:
- raise ValueError(
- "EraseOpenCornersPen should only be used on single contours"
- )
+ self.segments = []
+ self.is_closed = False
def _operate(self, *points):
self.segments.append((self._getCurrentPoint(), *points))
@@ -106,13 +104,10 @@ class EraseOpenCornersFilter(BaseFilter):
if not len(glyph):
return False
- affected = False
contours = list(glyph)
glyph.clearContours()
outpen = glyph.getPen()
+ p = EraseOpenCornersPen(outpen)
for contour in contours:
- p = EraseOpenCornersPen(outpen)
contour.draw(p)
- if p.affected:
- affected = True
- return affected
+ return p.affected
|
Reset pen after use, only draw once
|
googlefonts_glyphsLib
|
train
|
py
|
acc79514edee44cc7f4ca976916586bb3df0f833
|
diff --git a/eZ/Publish/Core/Repository/UserService.php b/eZ/Publish/Core/Repository/UserService.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Repository/UserService.php
+++ b/eZ/Publish/Core/Repository/UserService.php
@@ -717,7 +717,7 @@ class UserService implements UserServiceInterface
$userGroups = array();
foreach ( $searchResult->searchHits as $resultItem )
{
- $userGroups = $this->buildDomainUserGroupObject( $resultItem->valueObject );
+ $userGroups[] = $this->buildDomainUserGroupObject( $resultItem->valueObject );
}
return $userGroups;
|
Fixed: UserService::loadUserGroupsOfUser should return an array
|
ezsystems_ezpublish-kernel
|
train
|
php
|
13024bd9524ec8ea86b0f3535c846815e61bb68b
|
diff --git a/modulate.js b/modulate.js
index <HASH>..<HASH> 100644
--- a/modulate.js
+++ b/modulate.js
@@ -37,19 +37,11 @@ Modulator.prototype = {
var bufLen = Math.ceil(data.length * 8 * this.encoder.samplesPerBit());
var modulatedData = new Float32Array(bufLen);
- if (type === undefined)
+ if (type === undefined) {
type = 16;
-
- var timeStart = 0;
- var timeEnd = 0;
- if ((typeof performance) === "object") {
- timeStart = performance.now();
}
+
this.encoder.modulate(data, modulatedData); // writes outputFloatArray in-place
- if ((typeof performance) === "object") {
- timeEnd = performance.now();
- }
- var timeElapsed = timeEnd - timeStart;
if (type === 16) {
var pcmData = new Int16Array(modulatedData.length);
|
modulate: remove unused time measurement code
This was used for the console.log message, which is now gone. Remove
this code, as it's now unused.
|
chibitronics_ltc-npm-modulate
|
train
|
js
|
f4e74699e3838586575a4910383e04626c517875
|
diff --git a/py2/h2o_sandbox.py b/py2/h2o_sandbox.py
index <HASH>..<HASH> 100755
--- a/py2/h2o_sandbox.py
+++ b/py2/h2o_sandbox.py
@@ -165,6 +165,7 @@ def check_sandbox_for_errors(LOG_DIR=None, python_test_name='',
#[Loaded java.lang.Error from /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar]
foundBadPartial = regex1.search(line)
foundBad = foundBadPartial and not (
+ ('Skipping field that lacks an annotation' in line) or # can have DeepLearningModel$Errors
('python_test_name' in line) or
('Retrying after IO error' in line) or
('Error on' in line) or
diff --git a/py2/testdir_single_jvm/test_GLM_covtype.py b/py2/testdir_single_jvm/test_GLM_covtype.py
index <HASH>..<HASH> 100644
--- a/py2/testdir_single_jvm/test_GLM_covtype.py
+++ b/py2/testdir_single_jvm/test_GLM_covtype.py
@@ -13,7 +13,7 @@ class Basic(unittest.TestCase):
global SEED
SEED = h2o.setup_random_seed()
- h2o.init(3)
+ h2o.init(1)
@classmethod
def tearDownClass(cls):
|
change test_GLM_covtype.py to single_jvm
allow seeing lines with 'Errors" due to schema warnings (in h2o_sandox.py)
|
h2oai_h2o-3
|
train
|
py,py
|
457887fb0a4db1814fba1e0d8f8ac7f1a41e1d3f
|
diff --git a/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/Preference.java b/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/Preference.java
index <HASH>..<HASH> 100644
--- a/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/Preference.java
+++ b/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/Preference.java
@@ -39,8 +39,7 @@ public interface Preference<T> {
@NonNull T get();
/**
- * Change this preference's stored value to {@code value}. A value of {@code null} will delete
- * the preference.
+ * Change this preference's stored value to {@code value}.
*/
void set(@NonNull T value);
@@ -57,8 +56,7 @@ public interface Preference<T> {
@CheckResult @NonNull Observable<T> asObservable();
/**
- * An action which stores a new value for this preference. Passing {@code null} will delete the
- * preference.
+ * An action which stores a new value for this preference.
*/
@CheckResult @NonNull Consumer<? super T> asConsumer();
}
|
Remove outdated null docs.
|
f2prateek_rx-preferences
|
train
|
java
|
80d594a87312c1133249464c27a522b820ff8cae
|
diff --git a/lib/webcat/driver/safariwatir_driver.rb b/lib/webcat/driver/safariwatir_driver.rb
index <HASH>..<HASH> 100644
--- a/lib/webcat/driver/safariwatir_driver.rb
+++ b/lib/webcat/driver/safariwatir_driver.rb
@@ -43,7 +43,9 @@ class Webcat::Driver::SafariWatir
end
def find(selector)
- browser.send(:scripter).by_xpath(selector).map { |node| Node.new(node) }
+ foo = Struct.new(:what).new
+ foo.what = selector
+ browser.send(:scripter).operate_by_xpath(foo){}.map { |node| Node.new(node) }
end
private
@@ -62,4 +64,4 @@ private
@_browser
end
-end
\ No newline at end of file
+end
|
Slight improvement to safariwatir driver
(still doesn't work though)
|
teamcapybara_capybara
|
train
|
rb
|
02f9db1cc00902dcb6c1dc8c65be8ddcd2cdfb73
|
diff --git a/lib/flor/migrations/0001_tables.rb b/lib/flor/migrations/0001_tables.rb
index <HASH>..<HASH> 100644
--- a/lib/flor/migrations/0001_tables.rb
+++ b/lib/flor/migrations/0001_tables.rb
@@ -81,7 +81,6 @@ Sequel.migration do
String :nid, null: true
String :tracer, null: false # 'executor', 'trace'
String :text, null: false # 'blah blah blah'
- File :content # JSON (msg if necessary)
Time :tstamp
index :exid
|
revert "store "content" in flor_traces"
This reverts commit b7bb0d7df8a<I>db<I>c<I>b<I>f.
I forgot that the "trace" concept was not a "trail" at all...
|
floraison_flor
|
train
|
rb
|
55597e34de7d7fb659979d82839e63b77d6b2c87
|
diff --git a/src/azure_devtools/scenario_tests/patches.py b/src/azure_devtools/scenario_tests/patches.py
index <HASH>..<HASH> 100644
--- a/src/azure_devtools/scenario_tests/patches.py
+++ b/src/azure_devtools/scenario_tests/patches.py
@@ -14,6 +14,15 @@ def patch_time_sleep_api(unit_test):
_mock_in_unit_test(unit_test, 'time.sleep', _time_sleep_skip)
+def patch_long_run_operation_delay(unit_test):
+ def _shortcut_long_run_operation(*args, **kwargs): # pylint: disable=unused-argument
+ return
+
+ _mock_in_unit_test(unit_test,
+ 'msrestazure.azure_operation.AzureOperationPoller._delay',
+ _shortcut_long_run_operation)
+
+
def _mock_in_unit_test(unit_test, target, replacement):
import mock
import unittest
|
Reinstate patch_long_run_operation_delay
|
Azure_azure-python-devtools
|
train
|
py
|
7a9d75ce7daff50c247640cdf67a3c898e907bb7
|
diff --git a/lib/super_resources/url_helpers.rb b/lib/super_resources/url_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/super_resources/url_helpers.rb
+++ b/lib/super_resources/url_helpers.rb
@@ -81,11 +81,6 @@ module SuperResources
def super_url(chain, options={})
polymorphic_url(chain, options)
- rescue NoMethodError => e
- object = chain.pop
-
- chain.empty? ?
- raise(e) : super_path(chain.slice(0...-1) << object, options)
end
end
end
|
simplify super_url to only call polymorphic_url
|
habanerohq_super_resources
|
train
|
rb
|
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.