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
fc8d0755c48abc61a2f0e660d2210b4d70aad4c0
diff --git a/worldengine/cli/main.py b/worldengine/cli/main.py index <HASH>..<HASH> 100644 --- a/worldengine/cli/main.py +++ b/worldengine/cli/main.py @@ -125,12 +125,23 @@ def operation_ancient_map(world, map_filename, resize_factor, sea_color): print("+ ancient map generated in '%s'" % map_filename) +def __get_last_byte__(filename): + with open(filename, 'rb') as ifile: + data = tmp_data = ifile.read(1024 * 1024) + while tmp_data: + tmp_data = ifile.read(1024 * 1024) + if tmp_data: + data = tmp_data + return ord(data[len(data) - 1]) + + def __seems_protobuf_worldfile__(world_filename): pass def __seems_pickle_file__(world_filename): - pass + last_byte = __get_last_byte__(world_filename) + return last_byte == ord('.') def load_world(world_filename): @@ -356,7 +367,7 @@ def main(): usage( "For generating an ancient map is necessary to specify the " + "world to be used (-w option)") - world = load_world(options.word_file) + world = load_world(options.world_file) print_verbose(" * world loaded")
implemented methods to recognize pickle files Former-commit-id: <I>d1faee4a<I>a9ba6defaa1afc<I>
Mindwerks_worldengine
train
py
e54c4517a78ea87e6611784f9900e82f60a23303
diff --git a/docker/daemon_freebsd.go b/docker/daemon_freebsd.go index <HASH>..<HASH> 100644 --- a/docker/daemon_freebsd.go +++ b/docker/daemon_freebsd.go @@ -1,6 +1,6 @@ // +build daemon -package docker +package main // notifySystem sends a message to the host when the server is ready to be used func notifySystem() {
Fix "./docker" package name on freebsd This fixes "can't load package: package ./docker: found packages client.go (main) and daemon_freebsd.go (docker)"
moby_moby
train
go
7646cac558771ad36c6d70877a5192b9a0c0fc02
diff --git a/lib/Thelia/Action/Module.php b/lib/Thelia/Action/Module.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Action/Module.php +++ b/lib/Thelia/Action/Module.php @@ -129,7 +129,12 @@ class Module extends BaseAction implements EventSubscriberInterface $modules = $moduleValidator->getModulesDependOf(); if (count($modules) > 0) { - $moduleList = implode(', ', array_column($modules, 'code')); + $moduleList = ''; + foreach ($modules as $module) { + $moduleList .= ', ' . $module['code']; + } + $moduleList = ltrim($moduleList, ', '); + $message = (count($modules) == 1) ? Translator::getInstance()->trans( '%s has dependency to module %s. You have to deactivate this module before.'
Removed PHP <I> dependency, fixing #<I>.
thelia_core
train
php
40805037efdec7ae6cf893242fa21c3df2f27fa3
diff --git a/src/Modal.js b/src/Modal.js index <HASH>..<HASH> 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -21,7 +21,7 @@ import Footer from './ModalFooter'; import BaseModal from 'react-overlays/lib/Modal'; import isOverflowing from 'react-overlays/lib/utils/isOverflowing'; -import pick from 'lodash/object/pick'; +import pick from 'lodash-compat/object/pick'; const Modal = React.createClass({
Require lodash-compat instead of lodash from Modal.js lodash-compat is what's listed under package.json. This matches how `pick` is imported from other source files in react-bootstrap too.
react-bootstrap_react-bootstrap
train
js
415afb502969b00a0170598f19f53f32a5ac917b
diff --git a/lib/clamp/help.rb b/lib/clamp/help.rb index <HASH>..<HASH> 100644 --- a/lib/clamp/help.rb +++ b/lib/clamp/help.rb @@ -1,3 +1,5 @@ +require 'stringio' + module Clamp module Help
Oops ... I'd forgotten to require 'stringio'.
mdub_clamp
train
rb
22cdba9db5ca13cc02d7067083a50a2623defc7b
diff --git a/src/DOM.js b/src/DOM.js index <HASH>..<HASH> 100644 --- a/src/DOM.js +++ b/src/DOM.js @@ -243,8 +243,8 @@ Crafty.extend({ */ inner: function(obj) { var rect = obj.getBoundingClientRect(), - x = rect.left, - y = rect.top, + x = rect.left + window.pageXOffset, + y = rect.top + window.pageYOffset, borderX, borderY;
* getBoundingRect includes scroll
craftyjs_Crafty
train
js
2e1e061222f1e614bcb43eb6ea2f7ef020b9dc41
diff --git a/test/plugins/anonymizeTest.js b/test/plugins/anonymizeTest.js index <HASH>..<HASH> 100644 --- a/test/plugins/anonymizeTest.js +++ b/test/plugins/anonymizeTest.js @@ -12,7 +12,9 @@ const anonymize = require('../../plugins/anonymize'), const browser = browserModule(); const dummyCfg = { - forum: 'forumUrl' + core: { + forum: 'forumUrl' + } }; describe('anonymize', () => {
Fixing dummyCfg for tests
SockDrawer_SockBot
train
js
2bcb24d69f0f7bc07b466ee141f46aa08eb038ca
diff --git a/podcast/templatetags/podcast_tags.py b/podcast/templatetags/podcast_tags.py index <HASH>..<HASH> 100644 --- a/podcast/templatetags/podcast_tags.py +++ b/podcast/templatetags/podcast_tags.py @@ -16,10 +16,7 @@ def show_url(context, *args, **kwargs): """Return the show feed URL with different protocol.""" if len(kwargs) != 2: raise TemplateSyntaxError(_('"show_url" tag takes exactly two keyword arguments.')) - try: - request = context['request'] - except IndexError: - raise TemplateSyntaxError(_('"show_url" tag requires request in the template context. Add the request context processor to settings.')) + request = context['request'] current_site = get_current_site(request) url = add_domain(current_site.domain, kwargs['url']) return re.sub(r'https?:\/\/', '%s://' % kwargs['protocol'], url)
Request has been in context since <I>
richardcornish_django-applepodcast
train
py
964b65f98464f3b4f1a18e66144c3ce4db301704
diff --git a/src/Core_Command.php b/src/Core_Command.php index <HASH>..<HASH> 100644 --- a/src/Core_Command.php +++ b/src/Core_Command.php @@ -1263,8 +1263,9 @@ EOT; } $locale_subdomain = 'en_US' === $locale ? '' : substr( $locale, 0, 2 ) . '.'; + $locale_suffix = 'en_US' === $locale ? '' : "-{$locale}"; - return "https://{$locale_subdomain}wordpress.org/wordpress-{$version}-{$locale}.{$file_type}"; + return "https://{$locale_subdomain}wordpress.org/wordpress-{$version}{$locale_suffix}.{$file_type}"; } /**
Fix locale suffix for download URLs
wp-cli_core-command
train
php
86128f544ee356d6ce04a4aed550b598d2d65be5
diff --git a/src/Database/CollectionDelegator.php b/src/Database/CollectionDelegator.php index <HASH>..<HASH> 100644 --- a/src/Database/CollectionDelegator.php +++ b/src/Database/CollectionDelegator.php @@ -225,7 +225,7 @@ class CollectionDelegator implements IteratorAggregate */ public function group() { - $this->query->groupBy(func_get_args()); + call_user_func_array(array($this->query, 'groupBy'), func_get_args()); return $this; }
fix CollectionDelegator's 'group' method alias
doubleleft_hook
train
php
794f8afa584438f60e587396b570d1770c8a16a0
diff --git a/sevenbridges/meta/fields.py b/sevenbridges/meta/fields.py index <HASH>..<HASH> 100644 --- a/sevenbridges/meta/fields.py +++ b/sevenbridges/meta/fields.py @@ -64,9 +64,10 @@ class CompoundField(Field): self.cls = cls def __get__(self, instance, owner): - if instance._data[self.name] is not empty: - return self.cls(api=instance._api, parent=instance, - **(instance._data[self.name])) + data = instance._data[self.name] + # empty is used for read only fields, None all for others + if data is not empty and data is not None: + return self.cls(api=instance._api, parent=instance, **data) else: return None @@ -78,9 +79,10 @@ class CompoundListField(Field): self.cls = cls def __get__(self, instance, owner): - if instance._data[self.name]: - return [self.cls(api=instance._api, **item) for item in - instance._data[self.name]] + data = instance._data[self.name] + # empty is used for read only fields, None for all others + if data is not empty and data is not None: + return [self.cls(api=instance._api, **item) for item in data] else: return []
Fix __get__ methods empty check for CompoundField and CompoundListField
sbg_sevenbridges-python
train
py
368e200bc952c02c44b6f549e6ed6ed4b6c050b5
diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index <HASH>..<HASH> 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -719,7 +719,11 @@ func (tsv *TabletServer) Execute(ctx context.Context, target *querypb.Target, sq if sqltypes.IncludeFieldsOrDefault(options) == querypb.ExecuteOptions_ALL { for _, f := range result.Fields { if f.Database != "" { - f.Database = tsv.sm.target.Keyspace + if qre.plan.PlanID == planbuilder.PlanShow { + f.Database = "information_schema" + } else { + f.Database = tsv.sm.target.Keyspace + } } } }
changed the database name in vttablet
vitessio_vitess
train
go
0bde38d3b182f6fc799eb98b4a56f40223bf708f
diff --git a/djangocms_installer/django/__init__.py b/djangocms_installer/django/__init__.py index <HASH>..<HASH> 100644 --- a/djangocms_installer/django/__init__.py +++ b/djangocms_installer/django/__init__.py @@ -206,6 +206,8 @@ def _build_settings(config_data): def setup_database(config_data): with chdir(config_data.project_directory): + os.environ['DJANGO_SETTINGS_MODULE'] = ( + '{0}.settings'.format(config_data.project_name)) try: import south subprocess.check_call(["python", "-W", "ignore",
Properly setup environment in djangocms_installer.django.setup_database
nephila_djangocms-installer
train
py
8d1018ed6636e44530a04a221b73b1899f4bd2ac
diff --git a/pythran/toolchain.py b/pythran/toolchain.py index <HASH>..<HASH> 100644 --- a/pythran/toolchain.py +++ b/pythran/toolchain.py @@ -261,14 +261,12 @@ def compile_cxxcode(cxxcode, module_so=None, keep_temp=False, # Get a temporary C++ file to compile fd, fdpath = _get_temp(cxxcode) - try: - module_so = compile_cxxfile(fdpath, module_so, **kwargs) - finally: - if not keep_temp: - # remove tempfile - os.remove(fdpath) - else: - logger.warn("Keeping temporary generated file:" + fdpath) + module_so = compile_cxxfile(fdpath, module_so, **kwargs) + if not keep_temp: + # remove tempfile + os.remove(fdpath) + else: + logger.warn("Keeping temporary generated file:" + fdpath) return module_so
keep cpp files when compilation failed * needed and really usefull for debug
serge-sans-paille_pythran
train
py
a20e6fbd4827a67019cd516133db50de74b63aef
diff --git a/src/list.js b/src/list.js index <HASH>..<HASH> 100644 --- a/src/list.js +++ b/src/list.js @@ -45,7 +45,6 @@ List.prototype.update = function (data) { var view = views[i] || (views[i] = new View(initData, item, i)); } var el = view.el; - view.el = el; el.__redom_view = view; view.update && view.update(item);
Remove a line that has no effect
redom_redom
train
js
9e5c6735c3cb284cb87352a8160f49b9c4dad13b
diff --git a/lib/jsi/schema/application/child_application/draft06.rb b/lib/jsi/schema/application/child_application/draft06.rb index <HASH>..<HASH> 100644 --- a/lib/jsi/schema/application/child_application/draft06.rb +++ b/lib/jsi/schema/application/child_application/draft06.rb @@ -4,6 +4,7 @@ module JSI module Schema::Application::ChildApplication::Draft06 include Schema::Application::ChildApplication include Schema::Application::ChildApplication::Items + include Schema::Application::ChildApplication::Contains include Schema::Application::ChildApplication::Properties # @private
Schema::Application::ChildApplication::Draft<I> include ChildApplication::Contains
notEthan_jsi
train
rb
889f017a4e34a838281886cb5d061ec81e87767c
diff --git a/lib/validate.js b/lib/validate.js index <HASH>..<HASH> 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -94,10 +94,15 @@ function validateString(css, filename) { } function validateFile(filename) { - var css = fs.readFileSync(filename, 'utf-8'); var result = {}; + var css; - result[filename] = validate(css, filename); + try { + css = fs.readFileSync(filename, 'utf-8'); + result[filename] = validate(css, filename); + } catch (e) { + result[filename] = [e]; + } return result; }
change validateFile to handle possible read file exception
csstree_validator
train
js
6bbccf856dcc5301bce50970e7a099094357bbe2
diff --git a/liquibase-core/src/main/java/liquibase/database/core/DB2Database.java b/liquibase-core/src/main/java/liquibase/database/core/DB2Database.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/database/core/DB2Database.java +++ b/liquibase-core/src/main/java/liquibase/database/core/DB2Database.java @@ -218,6 +218,9 @@ public class DB2Database extends AbstractJdbcDatabase { @Override public CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName) { + if (rawCatalogName != null && rawSchemaName == null) { + rawSchemaName = rawCatalogName; + } return new CatalogAndSchema(rawSchemaName, null).customize(this); }
CORE-<I> Multi-schema improvements: DB2 schemas come through as catalogs sometimes
liquibase_liquibase
train
java
aba95934df7857fb26ce6f0da96af534bbe16282
diff --git a/tests/Installation/Commands/InstallCommandTest.php b/tests/Installation/Commands/InstallCommandTest.php index <HASH>..<HASH> 100644 --- a/tests/Installation/Commands/InstallCommandTest.php +++ b/tests/Installation/Commands/InstallCommandTest.php @@ -166,7 +166,7 @@ class InstallCommandTest extends PHPUnit_Framework_TestCase $command->execute(); // vendor/bin/wandu -> php vendor/bin/wandu (on ci not working.) - $process = new Process('php ./vendor/bin/wandu', __DIR__ . '/project'); + $process = new Process('php vendor/wandu/framework/bin/wandu', __DIR__ . '/project'); $process->run(); echo "project...\n";
for ci debugging commit
Wandu_Framework
train
php
c23076af255c7992fec22eea582d3ad9eeb325cb
diff --git a/spec/support/database_access.rb b/spec/support/database_access.rb index <HASH>..<HASH> 100644 --- a/spec/support/database_access.rb +++ b/spec/support/database_access.rb @@ -32,8 +32,8 @@ module DatabaseAccess ## # Resets member and admin lists for the test database to []. def clear_security - set_security({ 'users' => [], 'roles' => [] }, - { 'users' => [], 'roles' => [] }) + set_security({ 'names' => [], 'roles' => [] }, + { 'names' => [], 'roles' => [] }) end end
PUT /_security messup: the key is "names", not "users".
yipdw_analysand
train
rb
489efe9c49a5c8943e25857ab2d84d2c6438da94
diff --git a/bzr_commit_handler.py b/bzr_commit_handler.py index <HASH>..<HASH> 100644 --- a/bzr_commit_handler.py +++ b/bzr_commit_handler.py @@ -604,8 +604,9 @@ class InventoryDeltaCommitHandler(GenericCommitHandler): def record_delete(self, path, ie): self._add_entry((path, None, ie.file_id, None)) if ie.kind == 'directory': - for child_path, entry in \ + for child_relpath, entry in \ self.basis_inventory.iter_entries_by_dir(from_dir=ie): + child_path = osutils.pathjoin(path, child_relpath) self._add_entry((child_path, None, entry.file_id, None)) def record_rename(self, old_path, new_path, file_id, old_ie):
fix inv-delta generation when deleting directories
jelmer_python-fastimport
train
py
3a8c1264e87d965ea527d085d8749768db7d20a9
diff --git a/src/com/opencms/template/cache/CmsUri.java b/src/com/opencms/template/cache/CmsUri.java index <HASH>..<HASH> 100644 --- a/src/com/opencms/template/cache/CmsUri.java +++ b/src/com/opencms/template/cache/CmsUri.java @@ -1,7 +1,7 @@ /* * File : $Source: /alkacon/cvs/opencms/src/com/opencms/template/cache/Attic/CmsUri.java,v $ -* Date : $Date: 2001/06/08 12:59:08 $ -* Version: $Revision: 1.8 $ +* Date : $Date: 2001/06/11 09:39:57 $ +* Version: $Revision: 1.9 $ * * Copyright (C) 2000 The OpenCms Group * @@ -151,6 +151,13 @@ public class CmsUri implements I_CmsConstants { } }while(group1 != null); + // maybe an other group of this user has access + Vector allGroups = cms.getGroupsOfUser(cms.getRequestContext().currentUser().getName()); + for(int i=0; i<allGroups.size(); i++){ + if(m_readAccessGroup.equals(((CmsGroup)allGroups.elementAt(i)).getName())){ + return; + } + } // no way to read this sorry throw new CmsException(currentGroup.getName()+" has no read access. ", CmsException.C_ACCESS_DENIED);
bugfix: accessrights in element cache now checks all groups the user is in.
alkacon_opencms-core
train
java
60c0d29585a0a077729cf56e5e438c386b4cf255
diff --git a/pyprophet/export.py b/pyprophet/export.py index <HASH>..<HASH> 100644 --- a/pyprophet/export.py +++ b/pyprophet/export.py @@ -57,7 +57,7 @@ def export_tsv(infile, outfile, format, outcsv, ipf, peptide, protein): protein_present = False if protein: - peptide_present = _check_sqlite_table(con, "SCORE_PROTEIN") + protein_present = _check_sqlite_table(con, "SCORE_PROTEIN") if protein_present and protein: data_protein_run = pd.read_sql_query("select run_id as id_run, protein_id as id_protein, qvalue as m_score_protein_run_specific from score_protein where context == 'run-specific';", con)
[FIX] Export protein q-values when present
PyProphet_pyprophet
train
py
848940a24a816c605199e78e23f4b6f6860c7fa0
diff --git a/core/Version.php b/core/Version.php index <HASH>..<HASH> 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,5 +20,5 @@ final class Piwik_Version * Current Piwik version * @var string */ - const VERSION = '1.12-b19'; + const VERSION = '1.12-b20'; }
Beta <I> (last beta hopefully!)
matomo-org_matomo
train
php
d81881e43ea4d6ed9967d485c396c644e6eb78f1
diff --git a/tweepy/client.py b/tweepy/client.py index <HASH>..<HASH> 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -195,15 +195,15 @@ class Client(BaseClient): Parameters ---------- bearer_token : str | None - Twitter API Bearer Token + Twitter API OAuth 2.0 Bearer Token / Access Token consumer_key : str | None - Twitter API Consumer Key + Twitter API OAuth 1.0a Consumer Key consumer_secret : str | None - Twitter API Consumer Secret + Twitter API OAuth 1.0a Consumer Secret access_token : str | None - Twitter API Access Token + Twitter API OAuth 1.0a Access Token access_token_secret : str | None - Twitter API Access Token Secret + Twitter API OAuth 1.0a Access Token Secret return_type : type[dict | requests.Response | Response] Type to return from requests to the API wait_on_rate_limit : bool
Improve documentation for Client parameters Specify OAuth <I>a or <I> and indicate bearer_token as OAuth <I> access token as well
tweepy_tweepy
train
py
0e50ec8e43d786b4aa88bddc26a84733e2fd250f
diff --git a/src/foundations/core.py b/src/foundations/core.py index <HASH>..<HASH> 100644 --- a/src/foundations/core.py +++ b/src/foundations/core.py @@ -190,11 +190,15 @@ def getCodeLayerName(): @return: Code layer name. ( String ) """ - for frameIndex in range(len(inspect.stack())): - frame = getFrame(frameIndex) - if frame.f_code.co_name not in IGNORED_CODE_LAYERS: - return frame.f_code.co_name - return UNDEFINED_CODE_LAYER + try: + frameIndex = 0 + while True: + codeLayerName = getFrame(frameIndex).f_code.co_name + if codeLayerName not in IGNORED_CODE_LAYERS: + return codeLayerName + frameIndex += 1 + except: + return UNDEFINED_CODE_LAYER def getModule(object): """
Replace "getCodeLayerName" definition "for" loop by special "while" infinite loop resulting in approximately 4 time speed increase.
KelSolaar_Foundations
train
py
0537306605873e8e18bc658045a6022cc20d5beb
diff --git a/p2p/net/swarm/swarm.go b/p2p/net/swarm/swarm.go index <HASH>..<HASH> 100644 --- a/p2p/net/swarm/swarm.go +++ b/p2p/net/swarm/swarm.go @@ -90,6 +90,7 @@ type Swarm struct { limiter *dialLimiter gater connmgr.ConnectionGater + closeOnce sync.Once ctx context.Context // is canceled when Close is called ctxCancel context.CancelFunc @@ -131,8 +132,14 @@ func NewSwarm(local peer.ID, peers peerstore.Peerstore, bwc metrics.Reporter, ex } func (s *Swarm) Close() error { - // Prevents new connections and/or listeners from being added to the swarm. + s.closeOnce.Do(s.close) + return nil +} + +func (s *Swarm) close() { + s.ctxCancel() + // Prevents new connections and/or listeners from being added to the swarm. s.listeners.Lock() listeners := s.listeners.m s.listeners.m = nil @@ -187,8 +194,6 @@ func (s *Swarm) Close() error { } } wg.Wait() - - return nil } func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn, error) {
cancel the ctx when closing, use a sync.Once to only close once
libp2p_go-libp2p
train
go
9d5f4754a8450375c6a28028df683a95ceaa10aa
diff --git a/moneta-core/src/main/java/module-info.java b/moneta-core/src/main/java/module-info.java index <HASH>..<HASH> 100644 --- a/moneta-core/src/main/java/module-info.java +++ b/moneta-core/src/main/java/module-info.java @@ -18,7 +18,7 @@ module org.javamoney.moneta { exports org.javamoney.moneta.format; exports org.javamoney.moneta.function; exports org.javamoney.moneta.spi; - requires transitive javax.money; + requires transitive java.money; requires transitive java.logging; requires java.annotation; requires static org.osgi.core;
Adjusted package name to common practice for JSRs
JavaMoney_jsr354-ri
train
java
53ea1008eb132ad1465eb013dc3c214587a8de92
diff --git a/build/tasks/build.js b/build/tasks/build.js index <HASH>..<HASH> 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -34,7 +34,7 @@ gulp.task('concatDeps', ['bundleSfx'], function() { gulp.src(JS_DEV_DEPS.concat([paths.redocBuilt])) .pipe(sourcemaps.init({loadMaps: true})) .pipe(concat(paths.outputName)) - .pipe(sourcemaps.write()) + .pipe(sourcemaps.write('.')) .pipe(gulp.dest(paths.output)) }); @@ -43,7 +43,7 @@ gulp.task('bundleSfx', ['inlineTemplates'], function(cb) { builder .buildStatic(path.join(paths.tmp, paths.sourceEntryPoint), paths.redocBuilt, - { globalName: 'Redoc', sourceMaps: true } + { globalName: 'Redoc', sourceMaps: true, lowResSourceMaps: true } ) .then(function() { cb();
Fix source map appended as base<I>
Rebilly_ReDoc
train
js
f9760bc410ca6ca1bb2b637bf76d2afc5ee2d4d8
diff --git a/src/Guzzle/Plugin/Cache/DefaultRevalidation.php b/src/Guzzle/Plugin/Cache/DefaultRevalidation.php index <HASH>..<HASH> 100644 --- a/src/Guzzle/Plugin/Cache/DefaultRevalidation.php +++ b/src/Guzzle/Plugin/Cache/DefaultRevalidation.php @@ -100,7 +100,7 @@ class DefaultRevalidation implements RevalidationInterface ->setHeader('If-Modified-Since', $response->getLastModified() ?: $response->getDate()); if ($response->getEtag()) { - $revalidate->setHeader('If-None-Match', '"' . $response->getEtag() . '"'); + $revalidate->setHeader('If-None-Match', $response->getEtag()); } // Remove any cache plugins that might be on the request to prevent infinite recursive revalidations
Fixing If-None-Match ETag
guzzle_guzzle3
train
php
baa6e64547085cdab48b974e0eb18941fdbb77d0
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index <HASH>..<HASH> 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -109,8 +109,12 @@ class ReplyCommand(Command): else: quotestring = 'Quoting %s (%s)\n' % (name, timestamp) mailcontent = quotestring - for line in self.message.accumulate_body().splitlines(): - mailcontent += '> ' + line + '\n' + quotehook = settings.get_hook('text_quote') + if quotehook: + mailcontent += quotehook(self.message.accumulate_body()) + else: + for line in self.message.accumulate_body().splitlines(): + mailcontent += '> ' + line + '\n' envelope = Envelope(bodytext=mailcontent) @@ -214,8 +218,12 @@ class ForwardCommand(Command): else: quote = 'Forwarded message from %s (%s):\n' % (name, timestamp) mailcontent = quote - for line in self.message.accumulate_body().splitlines(): - mailcontent += '>' + line + '\n' + quotehook = settings.get_hook('text_quote') + if quotehook: + mailcontent += quotehook(self.message.accumulate_body()) + else: + for line in self.message.accumulate_body().splitlines(): + mailcontent += '> ' + line + '\n' envelope.body = mailcontent
use hook text_quote for quoting a messag body
pazz_alot
train
py
5da6c5a095fca9fdd6457e981cd2caf4b2c29eee
diff --git a/cli/Valet/PhpFpm.php b/cli/Valet/PhpFpm.php index <HASH>..<HASH> 100644 --- a/cli/Valet/PhpFpm.php +++ b/cli/Valet/PhpFpm.php @@ -44,7 +44,6 @@ class PhpFpm } $this->files->ensureDirExists('/usr/local/var/log', user()); - $this->files->ensureDirExists('/var/run/valet', user()); $this->updateConfiguration(); @@ -62,7 +61,7 @@ class PhpFpm $contents = preg_replace('/^user = .+$/m', 'user = '.user(), $contents); $contents = preg_replace('/^group = .+$/m', 'group = staff', $contents); - $contents = preg_replace('/^listen = .+$/m', 'listen = /var/run/valet/fpm.socket', $contents); + $contents = preg_replace('/^listen = .+$/m', 'listen = /var/run/fpm-valet.socket', $contents); $this->files->put($this->fpmConfigPath(), $contents); }
Move php-fpm socket Subdirectories in /var/run are deleted on reboot. That causes php-fpm to fail after reboot, because the socket in /var/run/valet can't be created, since the subdirecotry does not exist. The php-fpm socket should be moved directly to /var/run.
laravel_valet
train
php
63c119881400eef854a0ef379cd83c6734186d23
diff --git a/app.rb b/app.rb index <HASH>..<HASH> 100644 --- a/app.rb +++ b/app.rb @@ -10,7 +10,7 @@ require "lib/models" require "lib/path" require "lib/overrides" -set :cache_enabled, (Nesta::Config.cache == "true") +set :cache_enabled, Nesta::Config.cache helpers do def set_from_config(*variables)
Fixed caching bug; you could never enable it.
gma_nesta
train
rb
f1ebfef24dcf22986660c2f1a65cbffe9a75dc7a
diff --git a/peyotl/api/phylesystem_api.py b/peyotl/api/phylesystem_api.py index <HASH>..<HASH> 100644 --- a/peyotl/api/phylesystem_api.py +++ b/peyotl/api/phylesystem_api.py @@ -21,7 +21,6 @@ _REFR_NEVER, _REFR_SESSION, _REFR_ALWAYS = range(3) _REFRESH_VALUES = ('never', # *DEFAULT* never call "git pull" 'session', # call "git pull" before the first access 'always', ) # do a "git pull" before each data access -_DEFAULT_SCHEMA = create_content_spec() class _PhylesystemAPIWrapper(_WSWrapper): def __init__(self, domain, **kwargs): @@ -124,7 +123,7 @@ class _PhylesystemAPIWrapper(_WSWrapper): assert self._src_code == _GET_API if self._trans_code == _TRANS_SERVER: if schema is None: - schema = _DEFAULT_SCHEMA + schema = create_content_spec(nexson_version=self.repo_nexml2json) r = self._remote_get_study(study_id, schema) if (isinstance(r, dict) and 'data' in r) and (self._trans_code == _TRANS_CLIENT) and (schema is not None): r['data'] = schema.convert(r['data'])
bug fix to bug in previous commit - need to know the repo_nexml2json to create a default schema
OpenTreeOfLife_peyotl
train
py
6e87beff39bdba284893d99f3faedec054469bfa
diff --git a/lib/butterfli/caching.rb b/lib/butterfli/caching.rb index <HASH>..<HASH> 100644 --- a/lib/butterfli/caching.rb +++ b/lib/butterfli/caching.rb @@ -8,7 +8,12 @@ module Butterfli::Caching @cache = p end def cache - return @cache || (self.cache = ( Butterfli.configuration.cache && Butterfli.configuration.cache.instantiate)) + return @cache || (self.cache = default_cache) + end + + private + def default_cache + (Butterfli.configuration.cache && Butterfli.configuration.cache.instantiate) || Butterfli::Configuration::MemoryCache.new.instantiate end end end
Changed: Default to memory cache if no cache is configured
delner_butterfli
train
rb
18dede0cfb33f9cd703b94b1e954169b01a95676
diff --git a/elasticsearch-api/utils/thor/generate_source.rb b/elasticsearch-api/utils/thor/generate_source.rb index <HASH>..<HASH> 100644 --- a/elasticsearch-api/utils/thor/generate_source.rb +++ b/elasticsearch-api/utils/thor/generate_source.rb @@ -154,12 +154,12 @@ module Elasticsearch return termvectors_path if @method_name == 'termvectors' result = '' - anchor_string = '' + anchor_string = [] @paths.sort { |a, b| b.length <=> a.length }.each_with_index do |path, i| var_string = __extract_path_variables(path).map { |var| "_#{var}" }.join(' && ') - next if anchor_string == var_string + next if anchor_string.include? var_string - anchor_string = var_string + anchor_string << var_string result += if i.zero? "if #{var_string}\n" elsif (i == @paths.size - 1) || var_string.empty?
[API] Generator: Use array to store already used paths
elastic_elasticsearch-ruby
train
rb
7e51a7cc4dc6073d41d6139879f348870bd77036
diff --git a/build-coordinator/src/main/java/org/jboss/pnc/coordinator/builder/datastore/DatastoreAdapter.java b/build-coordinator/src/main/java/org/jboss/pnc/coordinator/builder/datastore/DatastoreAdapter.java index <HASH>..<HASH> 100644 --- a/build-coordinator/src/main/java/org/jboss/pnc/coordinator/builder/datastore/DatastoreAdapter.java +++ b/build-coordinator/src/main/java/org/jboss/pnc/coordinator/builder/datastore/DatastoreAdapter.java @@ -122,6 +122,7 @@ public class DatastoreAdapter { BuildStatus buildRecordStatus = UNKNOWN; BuildRecord.Builder buildRecordBuilder = initBuildRecordBuilder(buildTask); + buildRecordBuilder.buildContentId(buildTask.getContentId()); if (buildResult.getRepourResult().isPresent()) { RepourResult repourResult = buildResult.getRepourResult().get(); @@ -159,8 +160,6 @@ public class DatastoreAdapter { buildRecordStatus = FAILED; //TODO, do not mix statuses } - buildRecordBuilder.buildContentId(repositoryManagerResult.getBuildContentId()); - Collection<Artifact> builtArtifacts = repositoryManagerResult.getBuiltArtifacts(); Map<Artifact, String> builtConflicts = datastore.checkForConflictingArtifacts(builtArtifacts); if (builtConflicts.size() > 0) {
[NCL-<I>] made the database to store buildContentId even if build failed or smth went wrong
project-ncl_pnc
train
java
d0123524ce53c533e23dec137cf7981895a45462
diff --git a/lib/reporters/html/index.js b/lib/reporters/html/index.js index <HASH>..<HASH> 100644 --- a/lib/reporters/html/index.js +++ b/lib/reporters/html/index.js @@ -47,9 +47,12 @@ var fs = require('fs'), */ PostmanHTMLReporter = function (newman, options) { // @todo throw error here or simply don't catch them and it will show up as warning on newman - var htmlTemplate = options.template || path.join(__dirname, DEFAULT_TEMPLATE), + var aggregationPartial = path.join(__dirname, 'partials', 'aggregations.hbs'), + htmlTemplate = options.template || path.join(__dirname, DEFAULT_TEMPLATE), compiler = handlebars.compile(fs.readFileSync(htmlTemplate, FILE_READ_OPTIONS)); + handlebars.registerPartial('aggregations', fs.readFileSync(aggregationPartial, FILE_READ_OPTIONS)); + newman.on('beforeDone', function () { var items = {}, executionMeans = {},
Added partial configuration to html report maker
postmanlabs_newman
train
js
db0dd55c9c30f209daff71764779f5e5620f7572
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,9 @@ setup(name='mappyfile', author_email='[email protected]', license='MIT', packages=['mappyfile'], - # dependency_links=["http://github.com/erezsh/lark/tarball/master#egg=package-1.0"], install_requires=['lark-parser==0.6.2', 'jsonschema >=2.0, <3.0', 'jsonref==0.1'], - zip_safe=False) + zip_safe=False, + entry_points = { + 'console_scripts': ['mappyfile=mappyfile.cli:main'], + } +)
Add new client scripts to setup.py
geographika_mappyfile
train
py
46f79d490733779100ae1516baa327e54ea34bbe
diff --git a/examples/11_to_10_downgrade/openioc_11_to_10.py b/examples/11_to_10_downgrade/openioc_11_to_10.py index <HASH>..<HASH> 100644 --- a/examples/11_to_10_downgrade/openioc_11_to_10.py +++ b/examples/11_to_10_downgrade/openioc_11_to_10.py @@ -136,7 +136,7 @@ class ioc_manager: for link in metadata.xpath('//link'): link_rel = link.get('rel') link_text = link.text - links_11.append((link_rel, link_text, None)) + links_11.append((link_rel, None, link_text)) # get ioc_logic try: ioc_logic = ioc_obj_11.root.xpath('.//criteria')[0]
Fix error in downgrade script when making links.
mandiant_ioc_writer
train
py
2e7cdc61fe71bcd1810f210c5b2de13ddc949a8e
diff --git a/system/Test/bootstrap.php b/system/Test/bootstrap.php index <HASH>..<HASH> 100644 --- a/system/Test/bootstrap.php +++ b/system/Test/bootstrap.php @@ -59,10 +59,5 @@ $loader->initialize(new Config\Autoload(), new Config\Modules()); // Register the loader with the SPL autoloader stack. $loader->register(); -helper('url'); - -$appConfig = config(\Config\App::class); -$app = new \CodeIgniter\CodeIgniter($appConfig); -$app->initialize(); - -$app->run(); +$routes = \Config\Services::routes(); +$routes->getRoutes('*');
call routes->getRoutes() in test bootstrap
codeigniter4_CodeIgniter4
train
php
939ae1760437aa02566f00a929640ac74054875a
diff --git a/tests/Channels/PresenceChannelReplicationTest.php b/tests/Channels/PresenceChannelReplicationTest.php index <HASH>..<HASH> 100644 --- a/tests/Channels/PresenceChannelReplicationTest.php +++ b/tests/Channels/PresenceChannelReplicationTest.php @@ -50,9 +50,9 @@ class PresenceChannelReplicationTest extends TestCase json_encode($channelData), ]) ->assertCalledWithArgs('hgetall', [ - '1234:presence-channel' + '1234:presence-channel', ]); - // TODO: This fails somehow + // TODO: This fails somehow // Debugging shows the exact same pattern as good. /* ->assertCalledWithArgs('publish', [ '1234:presence-channel', diff --git a/tests/Channels/PresenceChannelTest.php b/tests/Channels/PresenceChannelTest.php index <HASH>..<HASH> 100644 --- a/tests/Channels/PresenceChannelTest.php +++ b/tests/Channels/PresenceChannelTest.php @@ -2,7 +2,6 @@ namespace BeyondCode\LaravelWebSockets\Tests\Channels; -use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface; use BeyondCode\LaravelWebSockets\Tests\Mocks\Message; use BeyondCode\LaravelWebSockets\Tests\TestCase; use BeyondCode\LaravelWebSockets\WebSockets\Exceptions\InvalidSignature;
Apply fixes from StyleCI (#<I>)
beyondcode_laravel-websockets
train
php,php
2c9abf9a0fccff0957843b7a600a796097fe6933
diff --git a/allennlp/commands/elmo.py b/allennlp/commands/elmo.py index <HASH>..<HASH> 100644 --- a/allennlp/commands/elmo.py +++ b/allennlp/commands/elmo.py @@ -184,7 +184,9 @@ class ElmoEmbedder(): layer_activations = bilm_output['activations'] mask_with_bos_eos = bilm_output['mask'] - # without_bos_eos is a 3 element list of pairs of (batch_size, num_timesteps, dim) tensors. + # without_bos_eos is a 3 element list of (activation, mask) tensor pairs, + # each with size (batch_size, num_timesteps, dim and (batch_size, num_timesteps) + # respectively. without_bos_eos = [remove_sentence_boundaries(layer, mask_with_bos_eos) for layer in layer_activations] # Converts a list of pairs (activation, mask) tensors to a single tensor of activations.
Minor change of a comment (#<I>) Original comment here about tensor size was a bit confusing.
allenai_allennlp
train
py
a6f44a6a61f2eb2fcdf0c87f08ee860242e25d70
diff --git a/lib/knode.js b/lib/knode.js index <HASH>..<HASH> 100644 --- a/lib/knode.js +++ b/lib/knode.js @@ -257,7 +257,7 @@ exports.KNode.prototype.connect = function(address, port, cb) { assert.ok(this.self.nodeID); var contact = util.make_contact(address, port); this._updateContact(contact, _.bind(function() { - this._iterativeFindNode(this.self, _.bind(function(err, contacts) { + this._iterativeFindNode(this.self.nodeID, _.bind(function(err, contacts) { if (err) { callback(err); return;
call iterativeFindNode with nodeID and not contact
nikhilm_kademlia
train
js
25bd011aeb85796a112dfb03474e25d23c52237c
diff --git a/demo/TestSuites/PlayBack/Selection/TestScript.py b/demo/TestSuites/PlayBack/Selection/TestScript.py index <HASH>..<HASH> 100644 --- a/demo/TestSuites/PlayBack/Selection/TestScript.py +++ b/demo/TestSuites/PlayBack/Selection/TestScript.py @@ -22,7 +22,7 @@ def step1(): @expected Description of the expected result """ - javaguiMI.selectTabId("TABBED_PANE", "SELECTION_PANEL") + javaguiMI.selectTabId("TABBED_PANE", testData.getValue("TAB_ID")) subtitler.setSubtitle(testData.getValue("COMMENT")) component = testData.getValue("COMPONENT_NAME") value = testData.getIntValue("INDEX")
#<I> Fix a regression introduced - wrong tab selection
qspin_qtaste
train
py
30f4d108319b0cd28ae5662947e300aad98c32e9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -62,8 +62,8 @@ requirements = [ pytorch_dep, ] -# Excluding 8.3.0 because of https://github.com/pytorch/vision/issues/4146 -pillow_ver = " >= 5.3.0, !=8.3.0" +# Excluding 8.3.* because of https://github.com/pytorch/vision/issues/4934 +pillow_ver = " >= 5.3.0, !=8.3.*" pillow_req = "pillow-simd" if get_dist("pillow-simd") is not None else "pillow" requirements.append(pillow_req + pillow_ver)
Updates PIL version specifier to prevent issues with padding when image mode = P (#<I>) * chore: Updated pillow version specifier * docs: Updated issue ref in comment
pytorch_vision
train
py
2d3c198643db4550e785e04145266d6cb6217cd6
diff --git a/lib/alipay/client.rb b/lib/alipay/client.rb index <HASH>..<HASH> 100644 --- a/lib/alipay/client.rb +++ b/lib/alipay/client.rb @@ -150,6 +150,7 @@ module Alipay # params = { # out_trade_no: '20160401000000', # trade_status: 'TRADE_SUCCESS' + # sign_type: 'RSA2', # sign: '...' # } # alipay_client.verify?(params)
Add sign_type in client verify comment
chloerei_alipay
train
rb
a9a3c990886c353f8ce64dab6a8857d28463253f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ install_requires = [ 'ConfigArgParse==0.12.0', 'tabulate>=0.7.7', 'humanize', + 'yarl>=1.1.1', ] dev_requires = [ ]
Add yarl as explicit dependency (#<I>)
lablup_backend.ai-client-py
train
py
87de2e77766b8a537b3bbbcf3533bbc4ee528a3e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -133,6 +133,9 @@ setup( 'invenio_base.apps': [ 'invenio_db = invenio_db:InvenioDB', ], + 'invenio_base.api_apps': [ + 'invenio_db = invenio_db:InvenioDB', + ], }, extras_require=extras_require, install_requires=install_requires,
installation: api application entry points * Adds entry point for API application to discover extension.
inveniosoftware_invenio-db
train
py
747b603d0aafde49dbb9d8d703cafd25aa849570
diff --git a/Form/Type/ModelType.php b/Form/Type/ModelType.php index <HASH>..<HASH> 100644 --- a/Form/Type/ModelType.php +++ b/Form/Type/ModelType.php @@ -18,7 +18,7 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Options; +use Symfony\Component\OptionsResolver\Options; use Sonata\AdminBundle\Form\EventListener\MergeCollectionListener; use Sonata\AdminBundle\Form\ChoiceList\ModelChoiceList; diff --git a/Form/Type/TranslatableChoiceType.php b/Form/Type/TranslatableChoiceType.php index <HASH>..<HASH> 100644 --- a/Form/Type/TranslatableChoiceType.php +++ b/Form/Type/TranslatableChoiceType.php @@ -17,7 +17,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormBuilder; -use Symfony\Component\Form\Options; +use Symfony\Component\OptionsResolver\Options; class TranslatableChoiceType extends ChoiceType {
Changed the namespace for the options class used in form types to keep up with the <I> symfony master
sonata-project_SonataAdminBundle
train
php,php
ad1b6310deb6ccaec16016e999049fa307a8a61c
diff --git a/examples/with-google-analytics/pages/_app.js b/examples/with-google-analytics/pages/_app.js index <HASH>..<HASH> 100644 --- a/examples/with-google-analytics/pages/_app.js +++ b/examples/with-google-analytics/pages/_app.js @@ -10,8 +10,10 @@ const App = ({ Component, pageProps }) => { gtag.pageview(url) } router.events.on('routeChangeComplete', handleRouteChange) + router.events.on('hashChangeComplete', handleRouteChange) return () => { router.events.off('routeChangeComplete', handleRouteChange) + router.events.off('hashChangeComplete', handleRouteChange) } }, [router.events])
add support for changing /route/#hashes (#<I>) update with-google-analytics example to also fire events when the hash section of the URL changes.
zeit_next.js
train
js
cbbe27dcd4d496ba76b34f5d000804dd4151f990
diff --git a/host_source.go b/host_source.go index <HASH>..<HASH> 100644 --- a/host_source.go +++ b/host_source.go @@ -97,10 +97,6 @@ func (h *ringDescriber) run(sleep time.Duration) { } for { - select { - case <-h.closeChan: - return - } // if we have 0 hosts this will return the previous list of hosts to // attempt to reconnect to the cluster otherwise we would never find // downed hosts again, could possibly have an optimisation to only @@ -116,5 +112,10 @@ func (h *ringDescriber) run(sleep time.Duration) { } time.Sleep(sleep) + + select { + case <-h.closeChan: + return + } } }
Moved select statement to end of loop
gocql_gocql
train
go
e04d158eaa36339dfeca1795b6fa443a2194ac1b
diff --git a/test/function/algebra/rationalize.test.js b/test/function/algebra/rationalize.test.js index <HASH>..<HASH> 100644 --- a/test/function/algebra/rationalize.test.js +++ b/test/function/algebra/rationalize.test.js @@ -110,6 +110,8 @@ describe('rationalize', function () { }) it('processing tougher expressions', function () { + this.timeout(5000) // For IE/Edge + assert.equal(stri(math.rationalize('2x/(x+2) - x/(x+1)')), 'x^2/(x^2+3*x+2)') assert.equal(stri(math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')), '(-20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)') @@ -136,6 +138,8 @@ describe('rationalize', function () { }) it('testing complete form', function () { + this.timeout(5000) // For IE/Edge + assert.deepEqual(objToStrings(math.rationalize('x+x+x+y', {}, true)), { coefficients: '', denominator: null,
Some larger timeouts for tests to prevent accidental failure on IE/Edge
josdejong_mathjs
train
js
c1cc27c697cd2d9de2ba38e5b66e0b78fee774a2
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/files/require_dep3.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/files/require_dep3.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/files/require_dep3.js +++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/files/require_dep3.js @@ -23,7 +23,10 @@ define([ */ function Foo() { } - + + // Need to determine if this is required by RequireJS or a limitation in Tern +// Foo.prototype.constructor = Foo; + Objects.mixin(Foo.prototype, { /** * @description A simple string var
[nobug] - Open implementation test can pass if constructor set on prototype.
eclipse_orion.client
train
js
a93380570d99e1260fcd47c6d7380c95b58f6e7a
diff --git a/vendor/joomla/libraries/joomla/user/authentication.php b/vendor/joomla/libraries/joomla/user/authentication.php index <HASH>..<HASH> 100644 --- a/vendor/joomla/libraries/joomla/user/authentication.php +++ b/vendor/joomla/libraries/joomla/user/authentication.php @@ -115,6 +115,9 @@ class JAuthentication extends JObservable $className = 'plg'.$plugin->type.$plugin->name; if (class_exists( $className )) { $plugin = new $className($this, (array)$plugin); + } else { + //the plugin class doesn't exists then skip + continue; } // Try to authenticate
fix: if the plugin class doesn't exist then skip instead of calling methods on stdclass
anahitasocial_anahita
train
php
e91eee4fbbe1ce0b463045ec7763c2e8225b78d4
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -51,9 +51,9 @@ export default function parse(str) { while (node.firstChild) { ctx.appendChild(node.firstChild); } - // for convenience, groups can be joined with optional `+` operator - stream.eat(OP_SIBLING); } + // for convenience, groups can be joined with optional `+` operator + stream.eat(OP_SIBLING); continue; }
Support siblings after a group repeater
emmetio_abbreviation
train
js
386560a12b46fb719e3bc31c1e909d1c6bf5e04c
diff --git a/src/java/voldemort/utils/ConsistencyCheck.java b/src/java/voldemort/utils/ConsistencyCheck.java index <HASH>..<HASH> 100644 --- a/src/java/voldemort/utils/ConsistencyCheck.java +++ b/src/java/voldemort/utils/ConsistencyCheck.java @@ -605,4 +605,3 @@ public class ConsistencyCheck { } } } -
Updated ConsistencyCheck.java for new feature
voldemort_voldemort
train
java
402238e7e271acf5f66b59b4335c9c1b398a4e1a
diff --git a/tmuxp/testsuite/test_window.py b/tmuxp/testsuite/test_window.py index <HASH>..<HASH> 100644 --- a/tmuxp/testsuite/test_window.py +++ b/tmuxp/testsuite/test_window.py @@ -91,17 +91,13 @@ class NewTest2(TmuxTestCase): window = self.session.new_window(window_name='test', attach=True) self.assertIsInstance(window, Window) self.assertEqual(1, len(window.panes)) - window.select_layout() window.split_window(attach=True) - window.select_layout() self.assertEqual(2, len(window.panes)) # note: the below used to accept -h, removing because split_window now # has attach as its only argument now - window.select_layout() window.split_window(attach=True) self.assertEqual(3, len(window.panes)) - window.select_layout() class NewTest3(TmuxTestCase):
fix bad test with blank select_layout calls
tmux-python_tmuxp
train
py
b95c3ab89671f5e40be6f2f427c831209b01ad24
diff --git a/login/index.php b/login/index.php index <HASH>..<HASH> 100644 --- a/login/index.php +++ b/login/index.php @@ -6,10 +6,10 @@ if (! record_exists("user", "username", "guest")) { $guest->username = "guest"; $guest->password = md5("guest"); - $guest->firstname = get_string("guestuser"); + $guest->firstname = addslashes(get_string("guestuser")); $guest->lastname = " "; $guest->email = "root@localhost"; - $guest->description = get_string("guestuserinfo"); + $guest->description = addslashes(get_string("guestuserinfo")); $guest->confirmed = 1; $guest->lang = $CFG->lang; $guest->timemodified= time();
Add slashes to data when setting up guest account
moodle_moodle
train
php
cafed90e83150614d9894d4fe4d9f33aeb454df8
diff --git a/src/Reports/Format.php b/src/Reports/Format.php index <HASH>..<HASH> 100644 --- a/src/Reports/Format.php +++ b/src/Reports/Format.php @@ -78,7 +78,7 @@ class Format { $list = static::loadConstants(); - return in_array($value,$list); + return in_array($value,$list) || in_array(strtoupper($value),$list) ; } /**
Update Format can be passed either in upper or lower cases
Edujugon_laravel-google-ads
train
php
c4d7c0bc29a48e27c6e7bd649b361a776adfa521
diff --git a/src/Plugin.php b/src/Plugin.php index <HASH>..<HASH> 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -109,8 +109,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface $this->project = preg_replace('/^drupal\//', '', $name); $this->version = $extra['drupal']['version'] ?: preg_replace('/^(dev)-(.*)$/', '$2-$1', $package->getPrettyVersion()); - $this->datestamp = $extra['drupal']['datestamp'] - ?: strtotime($package->getReleaseDate()); + $this->datestamp = time(); // Generate version information for `.info.yml` files in YAML format. $finder = new Finder(); @@ -151,9 +150,9 @@ class Plugin implements PluginInterface, EventSubscriberInterface $info = <<<METADATA # Information add by drustack/composer-generate-metadata on {$date} -version: "{$this->version}" -project: "{$this->project}" -datestamp: "{$this->datestamp}" +version: '{$this->version}' +project: '{$this->project}' +datestamp: {$this->datestamp} METADATA;
$this->datestamp = time()
drustack_composer-generate-metadata
train
php
1635b0d269f7787e8aef64e4449f048cb02c3e94
diff --git a/internal/config/apparmor/apparmor.go b/internal/config/apparmor/apparmor.go index <HASH>..<HASH> 100644 --- a/internal/config/apparmor/apparmor.go +++ b/internal/config/apparmor/apparmor.go @@ -9,12 +9,8 @@ import ( v1 "k8s.io/api/core/v1" ) -const ( - // DefaultProfile is the default profile name - DefaultProfile = "crio-default" - - unconfined = "unconfined" -) +// DefaultProfile is the default profile name +const DefaultProfile = "crio-default" // Config is the global AppArmor configuration type type Config struct { @@ -38,9 +34,9 @@ func (c *Config) LoadProfile(profile string) error { return nil } - if profile == unconfined { + if profile == v1.AppArmorBetaProfileNameUnconfined { logrus.Info("AppArmor profile is unconfined which basically disables it") - c.defaultProfile = unconfined + c.defaultProfile = v1.AppArmorBetaProfileNameUnconfined return nil }
Switch to Kubernetes AppArmor unconfined const This makes the definition of an own `unconfined` value obsolete by sticking to the predefined ones in Kubernetes.
cri-o_cri-o
train
go
caa9f54badb0b4e693e3b0633541ec768d0cf606
diff --git a/classes/phing/tasks/ext/PhpCodeSnifferTask.php b/classes/phing/tasks/ext/PhpCodeSnifferTask.php index <HASH>..<HASH> 100644 --- a/classes/phing/tasks/ext/PhpCodeSnifferTask.php +++ b/classes/phing/tasks/ext/PhpCodeSnifferTask.php @@ -327,7 +327,7 @@ class PhpCodeSnifferTask extends Task { * Determine PHP_CodeSniffer version number */ if (!$this->skipversioncheck) { - preg_match('/\d\.\d\.\d/', shell_exec('phpcs --version'), $version); + preg_match('/\d\.\d\.\d/', PHP_CodeSniffer::VERSION, $version); if (version_compare($version[0], '1.2.2') < 0) { throw new BuildException(
Replaced phpcs --version by PHP_CodeSniffer::VERSION in version check to improve Composer compatibility.
phingofficial_phing
train
php
4993e90eda88c20380ff747c8274175a1e5e08d0
diff --git a/lib/haml/parser.rb b/lib/haml/parser.rb index <HASH>..<HASH> 100644 --- a/lib/haml/parser.rb +++ b/lib/haml/parser.rb @@ -168,8 +168,8 @@ module Haml return @template_tabs + 1 if flat? && line.whitespace =~ /^#{@flat_spaces}/ message = Error.message(:inconsistent_indentation, - Haml::Util.human_indentation(line.whitespace), - Haml::Util.human_indentation(@indentation) + human_indentation(line.whitespace), + human_indentation(@indentation) ) raise SyntaxError.new(message, line.index) end
Don't fully qualify method name since we already import Haml::Utils
haml_haml
train
rb
18833dac5d97088dab1205f7d0896efd2a7a6ef4
diff --git a/app/controllers/deploys_controller.rb b/app/controllers/deploys_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/deploys_controller.rb +++ b/app/controllers/deploys_controller.rb @@ -17,7 +17,7 @@ class DeploysController < ShipitController def create return redirect_to new_stack_deploy_path(@stack, sha: @until_commit.sha) if !params[:force] && @stack.deploying? - @deploy = @stack.trigger_deploy(@until_commit, current_user, deploy_params[:env]) + @deploy = @stack.trigger_deploy(@until_commit, current_user, env: deploy_params[:env]) respond_with(@deploy.stack, @deploy) end diff --git a/app/models/stack.rb b/app/models/stack.rb index <HASH>..<HASH> 100644 --- a/app/models/stack.rb +++ b/app/models/stack.rb @@ -48,7 +48,7 @@ class Stack < ActiveRecord::Base task end - def trigger_deploy(until_commit, user, env = nil) + def trigger_deploy(until_commit, user, env: nil) since_commit = last_deployed_commit deploy = deploys.create(
Pass env as a named argument
Shopify_shipit-engine
train
rb,rb
f81eafb50d2041ccdde0a5c875c80ad59c588d04
diff --git a/spec/factories.rb b/spec/factories.rb index <HASH>..<HASH> 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -9,22 +9,22 @@ FactoryGirl.define do factory :draft do date 1.week.ago - round rand(100000) - pick rand(100000) - overall rand(100000) + sequence(:round) + sequence(:pick) + sequence(:overall) sequence(:college) {|n| "College #{n}"} association :team association :player end factory :team do - division_id rand(99999) + sequence(:division_id) sequence(:name) { |n| "Team #{n}" } sequence(:manager) { |n| "Manager #{n}" } - founded 1869 + rand(130) - wins(wins = rand(163)) - losses 162 - wins - win_percentage("%.3f" % (wins.to_f / 162).to_f) + sequence(:founded) + sequence(:wins) + sequence(:losses) + sequence(:win_percentage) end factory :league do
FactoryGirl <I> + Ruby <I> seems to not like rand :(
sferik_rails_admin
train
rb
821c2a906279fdcf51f3f06e0fb068417a052700
diff --git a/lib/justin_french/formtastic.rb b/lib/justin_french/formtastic.rb index <HASH>..<HASH> 100644 --- a/lib/justin_french/formtastic.rb +++ b/lib/justin_french/formtastic.rb @@ -108,7 +108,7 @@ module JustinFrench #:nodoc: raise NoMethodError unless @object.respond_to?(method) options[:required] = method_required?(method, options[:required]) - options[:label] ||= method.to_s.humanize + options[:label] ||= method.to_s.titleize options[:as] ||= default_input_type(@object, method) input_method = "#{options[:as]}_input"
Switching humanize to titleize, as for the one example I have, it fits better (Password Confirmation). Let me know if you think otherwise
justinfrench_formtastic
train
rb
67352079366c3b449a6250d26de2e1e9bf252960
diff --git a/www/windows8/InAppBrowserProxy.js b/www/windows8/InAppBrowserProxy.js index <HASH>..<HASH> 100644 --- a/www/windows8/InAppBrowserProxy.js +++ b/www/windows8/InAppBrowserProxy.js @@ -19,7 +19,7 @@ cordova.define("org.apache.cordova.core.inappbrowser.InAppBrowserProxy", functio * */ -/*global Windows:true */ +/*global Windows:true */ @@ -89,13 +89,8 @@ var IAB = { window.location = strUrl; } - - - - //var object = new WinJS.UI.HtmlControl(elem, { uri: strUrl }); - }, injectScriptCode:function(code, bCB) { @@ -108,10 +103,7 @@ var IAB = { } }; - - - module.exports = IAB; -require("cordova/commandProxy").add("InAppBrowser",IAB);}); +require("cordova/windows8/commandProxy").add("InAppBrowser",module.exports);
[windows8] commandProxy was moved
Prasannaa1991_cordova-inappbrowser
train
js
23b9aba5609e9e40f16ad088dc1f923970a52d2e
diff --git a/subliminal/videos.py b/subliminal/videos.py index <HASH>..<HASH> 100644 --- a/subliminal/videos.py +++ b/subliminal/videos.py @@ -144,7 +144,7 @@ class Video(object): return results def __unicode__(self): - return to_unicode(self.path) + return to_unicode(self.path or self.release) def __str__(self): return unicode(self).encode('utf-8')
Fix unicode representation of Video when it does not exist
Diaoul_subliminal
train
py
72a641bd9ec0a16ced4979c7a2c56e836cca24c7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( install_requires=[ "alembic>=0.9.6", "microcosm>=2.0.0", - "psycopg2>=2.7.3.2", + "psycopg2-binary>=2.7.4", "python_dateutil>=2.6.1", "pytz>=2017.3", "SQLAlchemy>=1.2.0",
Upgrade to psycopg2-binary
globality-corp_microcosm-postgres
train
py
72633628ad8720077f001c82911b72dae37c93cc
diff --git a/src/Distill/Extractor/Adapter/AbstractAdapter.php b/src/Distill/Extractor/Adapter/AbstractAdapter.php index <HASH>..<HASH> 100644 --- a/src/Distill/Extractor/Adapter/AbstractAdapter.php +++ b/src/Distill/Extractor/Adapter/AbstractAdapter.php @@ -45,8 +45,6 @@ abstract class AbstractAdapter implements AdapterInterface $process = new Process($command); $process->run(); - ld($command, $process->getOutput(), $process->getErrorOutput()); - return $process->isSuccessful(); } diff --git a/src/Distill/Extractor/Adapter/TarBz2Adapter.php b/src/Distill/Extractor/Adapter/TarBz2Adapter.php index <HASH>..<HASH> 100644 --- a/src/Distill/Extractor/Adapter/TarBz2Adapter.php +++ b/src/Distill/Extractor/Adapter/TarBz2Adapter.php @@ -46,7 +46,7 @@ class TarBz2Adapter extends AbstractAdapter } @mkdir($path); - $command = sprintf("tar -zxvf %s -C %s", escapeshellarg($file->getPath()), escapeshellarg($path)); + $command = sprintf("tar -jxvf %s -C %s", escapeshellarg($file->getPath()), escapeshellarg($path)); return $this->executeCommand($command); }
[tar.bz2] Fixed tar command option
raulfraile_distill
train
php,php
649b8bdb13a746f1884c31d1091edda10a8a5c3f
diff --git a/shared/common-adapters/dropdown.native.js b/shared/common-adapters/dropdown.native.js index <HASH>..<HASH> 100644 --- a/shared/common-adapters/dropdown.native.js +++ b/shared/common-adapters/dropdown.native.js @@ -123,10 +123,14 @@ class Dropdown extends Component<void, Props, State> { } _renderAndroid (): React$Element<*> { + // MM: This is super tricky. _renderPicker is an invisible box that, when clicked, opens + // the native picker. We need to make sure it's the last thing drawn so it lies on top of + // everything else. + // TODO: Clean this up to be less tricky return ( <Box style={{...styleContainer, ...this.props.style}}> - {this._renderPicker(stylePickerAndroid, true)} {this._renderLabelAndCaret()} + {this._renderPicker(stylePickerAndroid, true)} </Box> ) }
Fix dropdown picker on android (#<I>)
keybase_client
train
js
410a363cb2aac1a9d0434cd6df34d5c8fef5c3f3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,8 @@ setup( 'scikit-learn', 'scipy', 'pandas', - 'networkx' + 'networkx', + 'joblib' ], classifiers=( "Programming Language :: Python :: 3",
Hard dependency on joblib added to setup
SpikeInterface_spiketoolkit
train
py
62c5e65433ffb1d033b5e69f0552599fbf4cc438
diff --git a/lib/setup.php b/lib/setup.php index <HASH>..<HASH> 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -91,6 +91,12 @@ if (!defined('NO_DEBUG_DISPLAY')) { define('NO_DEBUG_DISPLAY', false); } +// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined. +// This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this. +if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) { + @date_default_timezone_set(@date_default_timezone_get()); +} + // Detect CLI scripts - CLI scripts are executed from command line, do not have session and we do not want HTML in output // In your new CLI scripts just add: if (isset($_SERVER['REMOTE_ADDR'])) {die;} before requiring config.php. if (!defined('CLI_SCRIPT')) {
MDL-<I> Avoid timezone notices from PHP when PHP doesn't have a default timezone set
moodle_moodle
train
php
ad05447130b72742680121f764a1a4d0c97ef124
diff --git a/src/com/google/javascript/jscomp/AngularPass.java b/src/com/google/javascript/jscomp/AngularPass.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/AngularPass.java +++ b/src/com/google/javascript/jscomp/AngularPass.java @@ -30,7 +30,9 @@ import java.util.List; /** * Compiler pass for AngularJS-specific needs. Generates {@code $inject} \ * properties for functions (class constructors, wrappers, etc) annotated with - * @ngInject. + * @ngInject. Without this pass, AngularJS will not work properly if variable + * renaming is enabled, because the function arguments will be renamed. + * @see http://docs.angularjs.org/tutorial/step_05#a-note-on-minification * * <p>For example, the following code:</p> * <pre>{@code
Add a little more JavaDoc to AngularPass, describing what problem it solves. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
d75ae0f14f28c2c9e994aa870b7f370eb119bacf
diff --git a/packages/ui-toolkit/src/base/global.js b/packages/ui-toolkit/src/base/global.js index <HASH>..<HASH> 100644 --- a/packages/ui-toolkit/src/base/global.js +++ b/packages/ui-toolkit/src/base/global.js @@ -26,6 +26,7 @@ export default ({ theme }) => css` padding: 0; background: ${theme.background}; color: ${theme.text}; + -webkit-font-smoothing: antialiased; } html,
feat(instances): Adds font antialiasing. closes #<I>
yldio_joyent-portal
train
js
b21428ea0df04701af37dab5f4c1646585f35f7a
diff --git a/src/image/transform/resizeBinary.js b/src/image/transform/resizeBinary.js index <HASH>..<HASH> 100644 --- a/src/image/transform/resizeBinary.js +++ b/src/image/transform/resizeBinary.js @@ -16,14 +16,15 @@ export default function resizeBinary(scale = 0.5, options = {}) { let width = Math.floor(this.width * scale); let height = Math.floor(this.height * scale); - let shiftX = Math.round((this.width - width) / 2) + this.position[0]; - let shiftY = Math.round((this.height - height) / 2) + this.position[1]; + let shiftX = Math.round((this.width - width) / 2); + let shiftY = Math.round((this.height - height) / 2); let newImage = Image.createFrom(this, { kind: KindNames.BINARY, width: width, height: height, - position: [shiftX, shiftY] + position: [shiftX, shiftY], + parent: this }); for (let x = 0; x < this.width; x++) {
Set correctly the parent when doing resizeBinary. The resulting image itself is just shifted based on the resizing while the absolute position into an image will be decided by the history of the hierarchy in parent.
image-js_image-js
train
js
f5d8c655b9b0ad1c83673756fbdcd3163f8d2465
diff --git a/app/code/community/Jowens/JobQueue/Model/Worker.php b/app/code/community/Jowens/JobQueue/Model/Worker.php index <HASH>..<HASH> 100644 --- a/app/code/community/Jowens/JobQueue/Model/Worker.php +++ b/app/code/community/Jowens/JobQueue/Model/Worker.php @@ -53,7 +53,7 @@ class Jowens_JobQueue_Model_Worker extends Mage_Core_Model_Abstract $collection->addFieldToFilter('queue', array('eq' => $this->getQueue())) ->addFieldToFilter('run_at', array( array('null' => true), - array('lteq'=> date('Y-m-d H:i:s', Mage::app()->getLocale()->storeTimeStamp())) + array('lteq'=> date('Y-m-d H:i:s')) )) ->addFieldToFilter(array('locked_at', 'locked_by'), array( array('locked_at', 'null' => true),
Fixing timezone gap when selecting scheduled jobs to run
jkowens_magento-jobqueue
train
php
30d62e2caa419453046efe156222993aa9e397c8
diff --git a/device.js b/device.js index <HASH>..<HASH> 100644 --- a/device.js +++ b/device.js @@ -346,7 +346,7 @@ function readMessageInChunksFromOutbox(message_hash, len, handleMessage){ function readChunk(){ db.query("SELECT SUBSTR(message, ?, ?) AS chunk FROM outbox WHERE message_hash=?", [start, CHUNK_LEN, message_hash], function(rows){ if (rows.length !== 1) - throw Error(rows.length+' msgs by hash in outbox'); + throw Error(rows.length+' msgs by hash in outbox, start='+start+', length='+len); message += rows[0].chunk; start += CHUNK_LEN; (start > len) ? handleMessage(message) : readChunk();
better logging of 0 msgs by hash
byteball_ocore
train
js
812dc72793c4f0eda69850c4492e96ef7ec65b21
diff --git a/core/Version.php b/core/Version.php index <HASH>..<HASH> 100644 --- a/core/Version.php +++ b/core/Version.php @@ -17,5 +17,5 @@ */ final class Piwik_Version { - const VERSION = '1.7-b7'; + const VERSION = '1.7-b8'; }
<I>b8 to be deployed on demo, containing few important fixes since last beta git-svn-id: <URL>
matomo-org_matomo
train
php
0d55f2729409a02893c02e8dea50a05b6b2b2340
diff --git a/Routine/Controller/RoutineViewsController.php b/Routine/Controller/RoutineViewsController.php index <HASH>..<HASH> 100644 --- a/Routine/Controller/RoutineViewsController.php +++ b/Routine/Controller/RoutineViewsController.php @@ -158,9 +158,9 @@ abstract class RoutineViewsController extends ViewsController /** * Override this method, if you want to initialize entity before display. For example, with defaults. * - * @param \Colibri\Database\Model $item entity to be initialized - * @param int|mixed $id if equals null, then create action is called, and otherwise edit action is - * called + * @param \Colibri\Database\Model $item entity to be initialized + * @param int|mixed $id if equals null, then create action is called, and otherwise edit action is + * called */ protected function initItem(Database\Model $item, $id = null) {
Apply fixes from StyleCI (#<I>)
PHPColibri_framework
train
php
76d5f22c9bdc1a901a38b5e1c0b169653f693a22
diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index <HASH>..<HASH> 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -319,7 +319,13 @@ abstract class AbstractContainer $config = $this->resolveDependencies($config); - return static::configure($object, $config); + static::configure($object, $config); + + if ($object instanceof Initable) { + $object->init(); + } + + return $object; } /** @@ -341,10 +347,6 @@ abstract class AbstractContainer } } - if ($object instanceof Initable) { - $object->init(); - } - return $object; }
Moved `init()` to allow call configure from init
yiisoft_di
train
php
1f9196b882aeb96a1bd0c0657cd8f387b30a480a
diff --git a/Lib/fontbakery/commands/check_specification.py b/Lib/fontbakery/commands/check_specification.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/commands/check_specification.py +++ b/Lib/fontbakery/commands/check_specification.py @@ -192,9 +192,6 @@ def main(specification=None, values=None): values_[key] = getattr(args, key) try: - if not args.fonts: - raise ValueValidationError, "No files to check specified." - runner = runner_factory(specification , explicit_checks=args.checkid , custom_order=args.order diff --git a/Lib/fontbakery/specifications/ufo_sources.py b/Lib/fontbakery/specifications/ufo_sources.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/ufo_sources.py +++ b/Lib/fontbakery/specifications/ufo_sources.py @@ -59,6 +59,9 @@ fonts_expected_value = ExpectedValue( 'fonts' , default=[] , description='A list of the ufo file paths to check.' + , validator=lambda fonts: (True, None) if len(fonts) \ + else (False, 'Value is empty.') + ) # ----------------------------------------------------------------------------
[check-specification] move 'fonts' validation to the spec, where the dependency originates
googlefonts_fontbakery
train
py,py
2e88817e5bdda15f0f2ca10fcfbb77078a106368
diff --git a/src/main/java/nl/topicus/jdbc/CloudSpannerPooledConnection.java b/src/main/java/nl/topicus/jdbc/CloudSpannerPooledConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/nl/topicus/jdbc/CloudSpannerPooledConnection.java +++ b/src/main/java/nl/topicus/jdbc/CloudSpannerPooledConnection.java @@ -550,6 +550,7 @@ public class CloudSpannerPooledConnection implements PooledConnection, AutoClose @Override public void removeStatementEventListener(StatementEventListener listener) { + // do nothing as pooled statements are not supported } /** @@ -561,6 +562,7 @@ public class CloudSpannerPooledConnection implements PooledConnection, AutoClose @Override public void addStatementEventListener(StatementEventListener listener) { + // do nothing as pooled statements are not supported } public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
added nested comments to explain no-op
olavloite_spanner-jdbc
train
java
8b09c4a81bedbc9868c89898c6a1c7b4c40fc28a
diff --git a/pyes/connection_http.py b/pyes/connection_http.py index <HASH>..<HASH> 100644 --- a/pyes/connection_http.py +++ b/pyes/connection_http.py @@ -9,6 +9,7 @@ from urlparse import urlparse import random import threading import urllib3 +import heapq __all__ = ["connect"] @@ -105,12 +106,12 @@ class Connection(object): def _get_server(self): with self._lock: try: - ts, server = self._inactive_servers.pop() + ts, server = heapq.heappop(self._inactive_servers) except IndexError: pass else: if ts > time(): # Not yet, put it back - self._inactive_servers.append((ts, server)) + heapq.heappush(self._inactive_servers, (ts, server)) else: self._active_servers.append(server) logger.info("Restored server %s into active pool", server) @@ -127,7 +128,7 @@ class Connection(object): except ValueError: pass else: - self._inactive_servers.insert(0, (time() + self._retry_time, server)) + heapq.heappush(self._inactive_servers, (time() + self._retry_time, server)) logger.warning("Removed server %s from active pool", server) connect = Connection
Use heapq operations on the _inactive_servers list, to ensure that we work with the server with the lowest timeout
aparo_pyes
train
py
e78303f29edda776d79c6c03ecb6c0b809642d08
diff --git a/SwatDB/SwatDBDataObject.php b/SwatDB/SwatDBDataObject.php index <HASH>..<HASH> 100644 --- a/SwatDB/SwatDBDataObject.php +++ b/SwatDB/SwatDBDataObject.php @@ -58,13 +58,6 @@ class SwatDBDataObject extends SwatObject implements Serializable protected $table = null; protected $id_field = null; - /** - * @var array - */ - protected $serializable_private_properties = array('table', 'id_field', - 'sub_data_objects', 'property_hashes', 'internal_properties', - 'internal_property_classes', 'date_properties'); - // }}} // {{{ public function __construct() @@ -734,6 +727,16 @@ class SwatDBDataObject extends SwatObject implements Serializable } // }}} + // {{{ protected function getSerializablePrivateProperties() + + protected function getSerializablePrivateProperties() + { + return array('table', 'id_field', + 'sub_data_objects', 'property_hashes', 'internal_properties', + 'internal_property_classes', 'date_properties'); + } + + // }}} } ?>
This is better. Parallel to getSerializableSubDataObjects() and doesn't introduce private data that itself needs serializing. svn commit r<I>
silverorange_swat
train
php
2e31f3c8624685a5d48c9e8f9b9ca4c1614d0752
diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py index <HASH>..<HASH> 100644 --- a/salt/utils/__init__.py +++ b/salt/utils/__init__.py @@ -118,3 +118,16 @@ def profile_func(filename=None): return retval return profiled_func return proffunc + +def which(exe): + ''' + Python clone of POSIX's /usr/bin/which + ''' + (path, name) = os.path.split(exe) + if os.access(exe, os.X_OK): + return exe + for path in os.environ.get('PATH').split(os.pathsep): + full_path = os.path.join(path, exe) + if os.access(full_path, os.X_OK): + return full_path + return None
Add salt.utils.which for returning full paths to executables
saltstack_salt
train
py
7760e52ec9a8146684373ed683613cddf810dbd0
diff --git a/round.js b/round.js index <HASH>..<HASH> 100644 --- a/round.js +++ b/round.js @@ -355,6 +355,9 @@ function getAllCoinbaseRatioByRoundIndex(conn, roundIndex, callback){ throw Error("Can not find any trustme units "); var totalCountOfTrustMe = 0; var witnessRatioOfTrustMe = {}; + witnesses.forEach(function(witness){ + witnessRatioOfTrustMe[witness]=0; + }); var addressTrustMeWl = {}; for (var i=0; i<rows.length; i++){ var row = rows[i];
when supernote's all trustme units of a round aren't on mainchain bug
trustnote_trustnote-pow-common
train
js
2b6fb578c3d9689461040881ed2e41aa91d1e319
diff --git a/core/dnsserver/server_https.go b/core/dnsserver/server_https.go index <HASH>..<HASH> 100644 --- a/core/dnsserver/server_https.go +++ b/core/dnsserver/server_https.go @@ -119,6 +119,14 @@ func (s *ServerHTTPS) ServeHTTP(w http.ResponseWriter, r *http.Request) { // We should expect a packet to be returned that we can send to the client. s.ServeDNS(context.Background(), dw, msg) + // See section 4.2.1 of RFC 8484. + // We are using code 500 to indicate an unexpected situation when the chain + // handler has not provided any response message. + if dw.Msg == nil { + http.Error(w, "No response", http.StatusInternalServerError) + return + } + buf, _ := dw.Msg.Pack() mt, _ := response.Typify(dw.Msg, time.Now().UTC())
DoH: Fixing panic in case if there's no response (#<I>) * Fixing panic in case if there's no response There could be a situation when there's no response after ServeDNS call. With the current implementation, this leads to panic. * Add comment
coredns_coredns
train
go
b38943187501005bc37fc1e67a6e0c5e00eee17e
diff --git a/osrframework/utils/platforms.py b/osrframework/utils/platforms.py index <HASH>..<HASH> 100644 --- a/osrframework/utils/platforms.py +++ b/osrframework/utils/platforms.py @@ -215,7 +215,7 @@ class Platform(): qURL = qURI else: qURL, query = self.createURL(word=query, mode=mode) - print("[*] Launching search using the {} module...".format(self.__class__.__name__)) + i3Browser = browser.Browser() try: # TODO: check if it needs creds @@ -297,6 +297,7 @@ class Platform(): results.append(r) elif mode == "searchfy": + print("[*] Launching search using the {} module...".format(self.__class__.__name__)) # Recovering all the found aliases... ids = re.findall(self.searchfyAliasRegexp, data, re.DOTALL)
Search launcher message change It is now only shown when conducting searchfy searches.
i3visio_osrframework
train
py
110ffb69dee696dca305167d0167c4c78462fde8
diff --git a/pkg/services/notifications/webhook.go b/pkg/services/notifications/webhook.go index <HASH>..<HASH> 100644 --- a/pkg/services/notifications/webhook.go +++ b/pkg/services/notifications/webhook.go @@ -3,6 +3,7 @@ package notifications import ( "bytes" "context" + "crypto/tls" "fmt" "io" "io/ioutil" @@ -26,6 +27,9 @@ type Webhook struct { } var netTransport = &http.Transport{ + TLSClientConfig: &tls.Config{ + Renegotiation: tls.RenegotiateFreelyAsClient, + }, Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: 30 * time.Second,
Fix bug tls renegociation problem in Notification channel (webhook) #<I>
grafana_grafana
train
go
5c335420c81f0b9dfa6a22336a21dce1912e5c7f
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -1,3 +1,4 @@ +require 'thread_safe' require 'active_support/concern' require 'active_support/descendants_tracker' require 'active_support/core_ext/class/attribute' @@ -351,10 +352,18 @@ module ActiveSupport undef_method(name) if method_defined?(name) end - def __callback_runner_name(kind) + def __callback_runner_name_cache + @__callback_runner_name_cache ||= ThreadSafe::Cache.new {|cache, kind| cache[kind] = __generate_callback_runner_name(kind) } + end + + def __generate_callback_runner_name(kind) "_run__#{self.name.hash.abs}__#{kind}__callbacks" end + def __callback_runner_name(kind) + __callback_runner_name_cache[kind] + end + # This is used internally to append, prepend and skip callbacks to the # CallbackChain. def __update_callbacks(name, filters = [], block = nil) #:nodoc:
attempt to fix slow runner name method
rails_rails
train
rb
5042888f5159d3216cea8861ac5affa117e4c6b4
diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index <HASH>..<HASH> 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -58,4 +58,11 @@ describe AnsibleTowerClient::Connection do end end end + + it ".new doesn't cache credentials across all instances" do + conn_1 = described_class.new(:base_url => "example1.com", :username => "admin", :password => "smartvm", :verify_ssl => OpenSSL::SSL::VERIFY_NONE) + conn_2 = described_class.new(:base_url => "example2.com", :username => "user", :password => "password", :verify_ssl => OpenSSL::SSL::VERIFY_NONE) + + expect(conn_1.api.instance).not_to eq(conn_2.api.instance) + end end
Add spec to verify that the connection and api objects are unique
ansible_ansible_tower_client_ruby
train
rb
2bc9a1ff06170b94edf24a33ff66797d2417a95a
diff --git a/Resolver/Factory.php b/Resolver/Factory.php index <HASH>..<HASH> 100644 --- a/Resolver/Factory.php +++ b/Resolver/Factory.php @@ -46,6 +46,16 @@ class Factory protected function addPortToServerIfMissing($nameserver) { - return false === strpos($nameserver, ':') ? "$nameserver:53" : $nameserver; + $colon = strrpos($nameserver, ':'); + + // there is no colon at all or the last one does not have a closing IPv6 bracket right before it + if ($colon === false || (strpos($nameserver, ':') !== $colon && strpos($nameserver, ']') !== ($colon - 1))) { + if (strpos($nameserver, ':') !== $colon) { + // several colons => enclose IPv6 address in square brackets + $nameserver = '[' . $nameserver . ']'; + } + $nameserver .= ':53'; + } + return $nameserver; } }
Fix adding port to IPv6 addresses
reactphp_dns
train
php
60f147b7c1342dfb69a1bb8af4b716219962cf72
diff --git a/py/testdir_single_jvm/test_model_management.py b/py/testdir_single_jvm/test_model_management.py index <HASH>..<HASH> 100644 --- a/py/testdir_single_jvm/test_model_management.py +++ b/py/testdir_single_jvm/test_model_management.py @@ -416,6 +416,7 @@ class ApiTestCase(ModelManagementTestCase): # find all compatible frames models = node.models(key=model_key, find_compatible_frames=1) compatible_frames = models['models'][model_key]['compatible_frames'] + self.assertKeysExist(models, 'models/' + model_key, ['training_duration_in_ms']) self.assertNotEqual(models['models'][model_key]['training_duration_in_ms'], 0, "Expected non-zero training time for model: " + model_key) for frame_key in compatible_frames:
Due to a change in the core the training_duration_in_ms disappeared from GLM. Check for the key before checking its value is > 0.
h2oai_h2o-2
train
py
bed7c4f75738345d565f05f72b363399c76e55f2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -261,8 +261,8 @@ def get_version_info(): # If this is a release or another kind of source distribution of PyCBC except: - version = '1.7.0dev' - release = 'False' + version = '1.6.2' + release = 'True' date = hash = branch = tag = author = committer = status = builder = build_date = '' with open('pycbc/version.py', 'w') as f:
Set for <I> release (#<I>)
gwastro_pycbc
train
py
47f8b0cd79b511805fa0cdbcf86c0ac2ae2eed1a
diff --git a/builtin/providers/aws/resource_aws_ecs_service_test.go b/builtin/providers/aws/resource_aws_ecs_service_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_ecs_service_test.go +++ b/builtin/providers/aws/resource_aws_ecs_service_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" @@ -210,6 +211,10 @@ func testAccCheckAWSEcsServiceDestroy(s *terraform.State) error { Services: []*string{aws.String(rs.Primary.ID)}, }) + if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ClusterNotFoundException" { + continue + } + if err == nil { if len(out.Services) > 0 { return fmt.Errorf("ECS service still exists:\n%#v", out.Services)
provider/aws: fix ECS service CheckDestroy in tests
hashicorp_terraform
train
go
c2e5daeb4c099c75957b42ac24cfb767a5417cda
diff --git a/guest/index.js b/guest/index.js index <HASH>..<HASH> 100644 --- a/guest/index.js +++ b/guest/index.js @@ -45,6 +45,18 @@ module.exports = function storageGuest(source, parent) { return; } + if (response.connectError) { + for (var key in callbacks) { + if (callbacks[key]) { + callbacks[key](response.error); + } + } + + callbacks = {}; + + return; + } + var callback = callbacks[sessionAccessId]; if (sessionAccessId && callback) { diff --git a/host/index.js b/host/index.js index <HASH>..<HASH> 100644 --- a/host/index.js +++ b/host/index.js @@ -16,6 +16,7 @@ module.exports = function storageHost(allowedDomains) { if (!domain) { event.source.postMessage({ id: id, + connectError: true, error: event.origin + ' is not an allowed domain', }, event.origin);
call all callbacks on connect error
MatthewLarner_cross-domain-storage
train
js,js
e03cdeff7d0e6c8aef027b9ed28bf86190dc37e2
diff --git a/test/unexpected.spec.js b/test/unexpected.spec.js index <HASH>..<HASH> 100644 --- a/test/unexpected.spec.js +++ b/test/unexpected.spec.js @@ -3407,10 +3407,7 @@ describe('unexpected', function () { }); }); - // It is very hard to get this working as we need errors thrown asynchronously - // without a promise to be serialized so they will have a message property when - // they get caught by window.onerror. - it.skip('errorMode=diff only includes the diff', function (done) { + it('errorMode=diff only includes the diff', function (done) { errorMode = 'diff'; clonedExpect([3, 2, 1], 'to be sorted after delay', 1, function (err) { expect(err, 'to have message',
Removed skip on test that works now
unexpectedjs_unexpected
train
js
ffad3cdcb96a097457b2186117cc60b1e901cb44
diff --git a/blimpy/filterbank.py b/blimpy/filterbank.py index <HASH>..<HASH> 100755 --- a/blimpy/filterbank.py +++ b/blimpy/filterbank.py @@ -730,7 +730,7 @@ class Filterbank(object): # Reverse oder if vertical orientation. if orientation is not None: if 'v' in orientation: - plt.plot(plot_data, plot_t[::-1], **kwargs) + plt.plot(plot_data, plot_t, **kwargs) else: plt.plot(plot_t, plot_data, **kwargs) plt.xlabel(xlabel)
Bugfix. Also related to the time flip bug.
UCBerkeleySETI_blimpy
train
py