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
eccd53679e4afa3e6343c22144e34a29ae320eef
diff --git a/sos/R/kernel.py b/sos/R/kernel.py index <HASH>..<HASH> 100644 --- a/sos/R/kernel.py +++ b/sos/R/kernel.py @@ -224,16 +224,12 @@ class sos_R: def lan_to_sos(self, items): # first let us get all variables with names starting with sos - response = self.sos_kernel.get_response('..py.repr(ls(all=TRUE))', ('display_data', 'execute_result')) + response = self.sos_kernel.get_response('..py.repr(ls())', ('display_data', 'execute_result')) expr = response['data']['text/plain'] all_vars = eval(eval(expr.split(' ', 1)[-1])) all_vars = [all_vars] if isinstance(all_vars, str) else all_vars - for item in items: - if item not in all_vars: - self.sos_kernel.warn('{} is not defined.'.format(item)) - - items = [x for x in items if x in all_vars] + [x for x in all_vars if x.startswith('sos')] + items += [x for x in all_vars if x.startswith('sos')] for item in items: if '.' in item:
Properly implement magic variables during kernel switch #<I> and document the updated interface
vatlab_SoS
train
py
ac7a95b4a62db3465abb47bc0c3bd9eb29ddca1e
diff --git a/lib/knife-attribute/version.rb b/lib/knife-attribute/version.rb index <HASH>..<HASH> 100644 --- a/lib/knife-attribute/version.rb +++ b/lib/knife-attribute/version.rb @@ -1,3 +1,3 @@ module KnifeAttribute - VERSION = "0.1.2" + VERSION = '1.0.0' end
Bump to version <I> - initial design goals implemented!
pdf_knife-attribute
train
rb
a821983e4e7a93daf16eacdf50b4f7faa14f37af
diff --git a/question/type/gapselect/questiontypebase.php b/question/type/gapselect/questiontypebase.php index <HASH>..<HASH> 100755 --- a/question/type/gapselect/questiontypebase.php +++ b/question/type/gapselect/questiontypebase.php @@ -84,7 +84,7 @@ abstract class qtype_gapselect_base extends question_type { // Delete old answer records foreach ($oldanswers as $oa) { - delete_records('question_answers', 'id', $oa->id); + $DB->delete_records('question_answers', array('id' => $oa->id)); } $options = $DB->get_record('question_' . $this->name(),
MDL-<I> gapselect: NOBUG noticed use of deprecated database function.
moodle_moodle
train
php
49e82de1873cb533e7595a1cec37e05eea628139
diff --git a/shared/teams/team/container.js b/shared/teams/team/container.js index <HASH>..<HASH> 100644 --- a/shared/teams/team/container.js +++ b/shared/teams/team/container.js @@ -234,6 +234,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { onInviteByEmail, onCreateSubteam, onLeaveTeam, + onManageChat, onOpenFolder, onEditDescription, onSetOpenTeamRole,
Pipe through onManageChat in team container (#<I>)
keybase_client
train
js
0745cf848322968e19ff25540df2e0d827d23f40
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,16 @@ var sitemap = require("./lib/sitemap"); -// sitemap.getSites("http://www.cbs.com/sitemaps/show/show_siteMap_index.xml", function(err, sites){ -// if(!err)console.log(sites);else console.log(err); -// }); +sitemap.getSites("http://www.cbs.com/sitemaps/show/show_siteMap_index.xml", function(err, sites){ + if(!err)console.log(sites);else console.log(err); +}); // sitemap.getSites("http://www.cnn.com/sitemaps/sitemap-index.xml", function(err,sites){ // if(!err)console.log(sites);else console.log(err); // }); -sitemap.getSites("http://www.walmart.com/sitemap_ip.xml", function(err,sites){ - if(!err)console.log(sites);else console.log(err); -}); +// sitemap.getSites("http://www.walmart.com/sitemap_ip.xml", function(err,sites){ +// if(!err)console.log(sites);else console.log(err); +// }); // sitemap.getSites("http://www.rakuten.com/sitemapxml/sitemapindex.xml", function(err,sites){ // if(!err)console.log(sites);else console.log(err);
Changing the index.js file to run CBS instead of walmart
seantomburke_sitemapper
train
js
ddcbd8a00922a4a461c184024c1a617a19ff5f9c
diff --git a/pydsl/Grammar/Symbol.py b/pydsl/Grammar/Symbol.py index <HASH>..<HASH> 100644 --- a/pydsl/Grammar/Symbol.py +++ b/pydsl/Grammar/Symbol.py @@ -114,15 +114,6 @@ class StringTerminalSymbol(TerminalSymbol): return "<StringTS: '" + self.definition + "'>" -class CharTerminalSymbol(StringTerminalSymbol): - def __init__(self, char): - if len(char) != 1: - raise TypeError - StringTerminalSymbol.__init__(self, char) - - def __str__(self): - return "<CharTS: '" + self.definition + "'>" - class WordTerminalSymbol(TerminalSymbol):#boundariesrules: priority, [max,min,fixedsize] #If token is another grammar Word, it stores its semantic info def __init__(self, name, definitionrequirementsdic, boundariesrules):
deleted CharTerminalSymbol (II)
nesaro_pydsl
train
py
6a5e19f2df0f02585b1f6d3f2cb3f85bcab0cee9
diff --git a/lib/Cisco.php b/lib/Cisco.php index <HASH>..<HASH> 100755 --- a/lib/Cisco.php +++ b/lib/Cisco.php @@ -173,7 +173,7 @@ class Cisco $invlines = explode("\r\n", $show_inventory); foreach ($invlines as $line) { // LEGACY PERL CODE: $x =~ /^\s*PID:\s(\S+).*SN:\s+(\S+)\s*$/; - if (preg_match('/.*PID:\s(\S+)\s.*/', $line, $reg)) { + if (preg_match('/.*PID:\s(\S+?)(,|\s).*/', $line, $reg)) { $model = $reg[1]; return $model;
Update Cisco.php Modified inventory-to-model detection to remove commas at end
metaclassing_utility
train
php
ee528c6b59d3038fee47d372c5fc13fbc9b49a43
diff --git a/lib/stompede/stomp.rb b/lib/stompede/stomp.rb index <HASH>..<HASH> 100644 --- a/lib/stompede/stomp.rb +++ b/lib/stompede/stomp.rb @@ -13,6 +13,8 @@ module Stompede module Stomp Parser = if defined?(CParser) CParser + elsif defined?(JavaParser) + JavaParser else RubyParser end
Enable JavaParser by default on JRuby
varvet_stomp_parser
train
rb
34e56bed0f4af53fbdb2357adebc1eb37c149f6e
diff --git a/andes/models/renewable/reeca1.py b/andes/models/renewable/reeca1.py index <HASH>..<HASH> 100644 --- a/andes/models/renewable/reeca1.py +++ b/andes/models/renewable/reeca1.py @@ -332,7 +332,7 @@ class REECA1Model(Model): self.Iqcmd = ExtAlgeb(model='RenGen', src='Iqcmd', indexer=self.reg, export=False, info='Retrieved Iqcmd of RenGen', - e_str='-Iqcmd0 - IqHL_y', + e_str='-Iqcmd0 + IqHL_y', ) self.p0 = ExtService(model='RenGen',
Fixed Iqcmd equations in REECA1.
cuihantao_andes
train
py
cfd2ba4c37b457782c0822cc603296c35451c026
diff --git a/examples/js/basic-chart.js b/examples/js/basic-chart.js index <HASH>..<HASH> 100644 --- a/examples/js/basic-chart.js +++ b/examples/js/basic-chart.js @@ -11,6 +11,9 @@ require ('ansicolor').nice; (async function main () { + // experimental, not yet implemented for all exchanges + // your contributions are welcome ;) + const index = 4 // [ timestamp, open, high, low, close, volume ] const ohlcv = await new ccxt.okcoinusd ().fetchOHLCV ('BTC/USD', 900) const lastPrice = ohlcv[ohlcv.length - 1][index] // closing price
added a comment to basic-chart.js [ci skip]
ccxt_ccxt
train
js
5408abfd66858c84dd61095360aca28e2043a89c
diff --git a/lib/nucleon/project/github.rb b/lib/nucleon/project/github.rb index <HASH>..<HASH> 100644 --- a/lib/nucleon/project/github.rb +++ b/lib/nucleon/project/github.rb @@ -12,10 +12,10 @@ class Github < Git def normalize if reference = delete(:reference, nil) - myself.name = reference + myself.plugin_name = reference else if url = get(:url, nil) - myself.name = url + myself.plugin_name = url set(:url, myself.class.expand_url(url, get(:ssh, false))) end end @@ -49,7 +49,7 @@ class Github < Git if private_key && ssh_key begin - deploy_keys = client.deploy_keys(self.name) + deploy_keys = client.deploy_keys(myself.plugin_name) github_id = nil keys_match = true @@ -63,11 +63,11 @@ class Github < Git if github_id unless keys_match - client.edit_deploy_key(self.name, github_id, { :key => ssh_key }) + client.edit_deploy_key(myself.plugin_name, github_id, { :key => ssh_key }) verify_key end else - client.add_deploy_key(self.name, key_id, ssh_key) + client.add_deploy_key(myself.plugin_name, key_id, ssh_key) verify_key end
Fixing name issues that prevent key loading/saving in the github project provider.
coralnexus_nucleon
train
rb
4b55ae36f1bc7a91eecb2f7bd8aaa4f5c34d658f
diff --git a/src/ServiceManager.php b/src/ServiceManager.php index <HASH>..<HASH> 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -146,9 +146,10 @@ class ServiceManager implements ServiceLocatorInterface } if ($this->allowOverride === false && $this->has($name)) { - throw new Exception\InvalidServiceNameException( - 'A service by this name or alias already exists and cannot be overridden, please use an alternate name.' - ); + throw new Exception\InvalidServiceNameException(sprintf( + 'A service by the name or alias "%s" already exists and cannot be overridden, please use an alternate name', + $name + )); } $this->factories[$name] = $factory;
Allow merging Service Manager configuration - Allows specifying a "service_manager" key in module / application configuration - Configuration provided by a module is merged with internal services configuration - During loadModules.post, all merged service configuration is then used to configure the ServiceManager - Thus, modules and/or application configuration can override services! EXCEPT for services in the default configuration...
mxc-commons_mxc-servicemanager
train
php
378d829e8fce8eab9b0a9af9ffe74585e00e3dca
diff --git a/tests/api/RestfulServiceTest.php b/tests/api/RestfulServiceTest.php index <HASH>..<HASH> 100644 --- a/tests/api/RestfulServiceTest.php +++ b/tests/api/RestfulServiceTest.php @@ -172,12 +172,14 @@ class RestfulServiceTest extends SapphireTest { public function testHttpHeaderParseing() { $headers = "content-type: text/html; charset=UTF-8\r\n". "Server: Funky/1.0\r\n". + "X-BB-ExampleMANycaPS: test\r\n". "Set-Cookie: foo=bar\r\n". "Set-Cookie: baz=quux\r\n". "Set-Cookie: bar=foo\r\n"; $expected = array( 'Content-Type' => 'text/html; charset=UTF-8', 'Server' => 'Funky/1.0', + 'X-BB-ExampleMANycaPS' => 'test', 'Set-Cookie' => array( 'foo=bar', 'baz=quux',
Adding test to prove issue with HTTP Header parsing in RestfulService I have a header like: X-BB-Auth: xxxx and it is being given back to me as X-Bb-Auth - i want to prove the issue and the fix
silverstripe_silverstripe-framework
train
php
afe886d2b55b041ce4beca694bedc8924264c3b3
diff --git a/PHPDaemon/DNode/Generic.php b/PHPDaemon/DNode/Generic.php index <HASH>..<HASH> 100755 --- a/PHPDaemon/DNode/Generic.php +++ b/PHPDaemon/DNode/Generic.php @@ -24,6 +24,7 @@ abstract class Generic extends \PHPDaemon\WebSocket\Route { protected $localMethods = []; protected $ioMode = false; protected $timer; + protected $traceCalls = false; /** * Called when the connection is handshaked. @@ -265,9 +266,10 @@ abstract class Generic extends \PHPDaemon\WebSocket\Route { } } elseif (isset($this->persistentCallbacks[$m])) { - if ($name = array_search($this->persistentCallbacks[$m], $this->localMethods, true)) { - //D($args); - Daemon::log('===>'.$name.'('.$this->toJsonDebug($args).')'); + if ($this->traceCalls) { + if ($name = array_search($this->persistentCallbacks[$m], $this->localMethods, true)) { + Daemon::log('===>'.$name.'('.$this->toJsonDebug($args).')'); + } } call_user_func_array($this->persistentCallbacks[$m], $args); }
DNode: traceCalls property
kakserpom_phpdaemon
train
php
a22bbfd211139511e3e08688cb6037ba5368f1a3
diff --git a/install/local/portableSharedLibraries/OAT/scale.raphael.js b/install/local/portableSharedLibraries/OAT/scale.raphael.js index <HASH>..<HASH> 100644 --- a/install/local/portableSharedLibraries/OAT/scale.raphael.js +++ b/install/local/portableSharedLibraries/OAT/scale.raphael.js @@ -9,7 +9,7 @@ * @author Bertrand Chevrier <[email protected]> for OAT SA * - Code refactoring to fit AMD modules */ -define(['IMSGLOBAL/jquery_2_1_1', 'OAT/raphael'], function($, Raphael){ +define(['IMSGlobal/jquery_2_1_1', 'OAT/raphael'], function($, Raphael){ var scaleRaphael = function(container, width, height){ var wrapper = container.style ? container : document.getElementById(container);
(re)fixed typo in shared lib ns
oat-sa_extension-tao-itemqti
train
js
0446201cd9097b9b252ede53860a1b3090b1871b
diff --git a/aegean.py b/aegean.py index <HASH>..<HASH> 100755 --- a/aegean.py +++ b/aegean.py @@ -123,25 +123,6 @@ class IslandFittingData(object): self.doislandflux = doislandflux -class DummyMP(object): - """ - A dummy copy of the mpfit class that just holds the parinfo variables - This class doesn't do a great deal, but it makes it 'looks' like the mpfit class - and makes it easy to estimate source parameters when you don't want to do any fitting. - """ - - def __init__(self, parinfo, perror): - self.params = [] - for var in parinfo: - try: - val = var['value'][0] - except: - val = var['value'] - self.params.append(val) - self.perror = perror - self.errmsg = "There is no error, I just didn't bother fitting anything!" - - class DummyLM(object): """ A dummy copy of the mpfit class that just holds the parinfo variables
removed DummyMP as it is no longer used.
PaulHancock_Aegean
train
py
00a6897390d5fbc48e200c6ac39fd807ded16689
diff --git a/test/send.js b/test/send.js index <HASH>..<HASH> 100644 --- a/test/send.js +++ b/test/send.js @@ -529,7 +529,7 @@ allocCluster.test('send() with requestDefaults', 2, function t(cluster, assert) subOne.handler.register('foo', function foo(req, res) { res.headers.as = 'raw'; - res.sendOk('', req.headers.cn); + res.sendOk('', req.callerName); }); subTwo.request({
test/send: switch to req.callerName
uber_tchannel-node
train
js
55ea1fd54aef044c83388148108c3685850658fb
diff --git a/src/Traits/LoadsTranslatedCachedRoutes.php b/src/Traits/LoadsTranslatedCachedRoutes.php index <HASH>..<HASH> 100644 --- a/src/Traits/LoadsTranslatedCachedRoutes.php +++ b/src/Traits/LoadsTranslatedCachedRoutes.php @@ -58,7 +58,8 @@ trait LoadsTranslatedCachedRoutes { $path = $this->getDefaultCachedRoutePath(); - if ( ! in_array(request()->segment(1), $localeKeys)) { + $localeSegment = request()->segment(1); + if ($localeSegment && ! in_array($localeSegment, $localeKeys)) { return $path; }
Fixed an issue where route:trans:list wouldn’t show the correct routes
czim_laravel-localization-route-cache
train
php
01ee776553f199fed2dd82d404c39c27e5b85a25
diff --git a/woven/deployment.py b/woven/deployment.py index <HASH>..<HASH> 100644 --- a/woven/deployment.py +++ b/woven/deployment.py @@ -121,10 +121,8 @@ def deploy_files(local_dir, remote_dir, pattern = '',rsync_exclude=['*.pyc','.*' run(' '.join(['mkdir -pv',remote_staging_dir])).split('\n') created_list = [remote_staging_dir] - extra_opts = None - #upload into remote staging - rsync_project(local_dir=staging_dir,remote_dir=remote_staging_dir,extra_opts=extra_opts,exclude=rsync_exclude,delete=True) + rsync_project(local_dir=staging_dir,remote_dir=remote_staging_dir,exclude=rsync_exclude,delete=True) #create the final destination created_dir_list = mkdirs(remote_dir, use_sudo)
fixed issue with extra_opts for rsync custom port
bretth_woven
train
py
b8eb3f87abe24a85aab8ba545e149e2575cb7270
diff --git a/src/pybel/parser/parse_metadata.py b/src/pybel/parser/parse_metadata.py index <HASH>..<HASH> 100644 --- a/src/pybel/parser/parse_metadata.py +++ b/src/pybel/parser/parse_metadata.py @@ -205,6 +205,9 @@ class MetadataParser(BaseParser): def handle_annotation_pattern(self, s, l, tokens): name = tokens['name'] + + return tokens + self.annotations_re[name] = tokens['value'] return tokens
Remove url rewriting and better logging
pybel_pybel
train
py
41df7fb0c507922fc0c8a75431ef4913e342ea7e
diff --git a/hrpg/core.py b/hrpg/core.py index <HASH>..<HASH> 100644 --- a/hrpg/core.py +++ b/hrpg/core.py @@ -77,7 +77,7 @@ def cli(): hrpg dailies done <task-id> hrpg dailies undo <task-id> hrpg todos done <task-id> - hrpg todos add <task> + hrpg todos add <task>... hrpg server options: @@ -181,7 +181,7 @@ def cli(): print('marked todo \'%s\' complete' % todos[tid]['text']) del(todos[tid]) elif args['add']: - ttext = args['<task>'] + ttext = ' '.join(args['<task>']) hbt.user.tasks(type='todo', text=ttext, _method='post') todos.insert(0, {'completed': False, 'text': ttext})
close #2 `todos add` arg no longer requires quotes
ASMfreaK_habitipy
train
py
7f12135cb6e39878bc63ddb6f76bbacc0de247ce
diff --git a/holoviews/core/pprint.py b/holoviews/core/pprint.py index <HASH>..<HASH> 100644 --- a/holoviews/core/pprint.py +++ b/holoviews/core/pprint.py @@ -124,9 +124,10 @@ class Info(object): if hasattr(node.last, 'children'): # Must be an Overlay overlay_info = cls.overlay_info(level, node.last, siblings, value_dims=True) element_info, additional_lines = overlay_info - # NdOverlays, AxisLayout, Ndlayouts + # NdOverlays, GridSpace, Ndlayouts elif node.last is not None and getattr(node.last, '_deep_indexable'): - pass # TODO + element_info = cls.dotted(node.last) # Incomplete + additional_lines = [] else: _, [info] = cls.element_info(level, node.last, siblings, value_dims=True) _, element_info = info
Temporary fix to pprinter for UniformNdMappings
pyviz_holoviews
train
py
144fce9ec0e92329c86036fbad2dd8f36935e4eb
diff --git a/src/AntiCSRF.php b/src/AntiCSRF.php index <HASH>..<HASH> 100644 --- a/src/AntiCSRF.php +++ b/src/AntiCSRF.php @@ -77,7 +77,7 @@ class AntiCSRF if( $echo ) { echo $ret; - return; + return null; } return $ret; }
consistent return value "null" is returned anyway if called with no value
paragonie_anti-csrf
train
php
6c71dc7844e5dc5d1e6c55559fd2c25122dff83b
diff --git a/pynlpir/nlpir.py b/pynlpir/nlpir.py index <HASH>..<HASH> 100644 --- a/pynlpir/nlpir.py +++ b/pynlpir/nlpir.py @@ -15,7 +15,8 @@ logger.debug("Loading NLPIR module on a %s %s system." % ('64-bit' if is_64bit if not is_linux and not is_windows: logger.error("Platform '%s' is not supported by NLPIR." % sys.platform) -#: The absolute path to this package. +#: The absolute path to this package (used by NLPIR to find the ``Data`` +#: directory). PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__)) #: The absolute path to this path's lib directory.
Clarifies comments on module-level constants.
tsroten_pynlpir
train
py
a0be3303192c2c285462566cb9e2a5b9199da8b0
diff --git a/pkg/terminal/terminal.go b/pkg/terminal/terminal.go index <HASH>..<HASH> 100644 --- a/pkg/terminal/terminal.go +++ b/pkg/terminal/terminal.go @@ -247,10 +247,10 @@ func (t *Term) handleExit() (int, error) { func (t *Term) loadConfig() api.LoadConfig { r := api.LoadConfig{true, 1, 64, 64, -1} - if t.conf.MaxStringLen != nil { + if t.conf != nil && t.conf.MaxStringLen != nil { r.MaxStringLen = *t.conf.MaxStringLen } - if t.conf.MaxArrayValues != nil { + if t.conf != nil && t.conf.MaxArrayValues != nil { r.MaxArrayValues = *t.conf.MaxArrayValues }
check that t.conf is not nil in loadConfig
go-delve_delve
train
go
faccffed194a895a64f2e90e2a31b54b66b7d986
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -8,8 +8,7 @@ module ActionController class MissingRenderer < LoadError def initialize(format) - @format = format - super("No renderer defined for format: #{@format}") + super "No renderer defined for format: #{format}" end end
Do not use instance variables if they are not reused elsewhere
rails_rails
train
rb
8d1c53b57d71ea2ff1741e8a656ce25e857ca453
diff --git a/empyrical/stats.py b/empyrical/stats.py index <HASH>..<HASH> 100644 --- a/empyrical/stats.py +++ b/empyrical/stats.py @@ -714,7 +714,8 @@ def beta(returns, factor_returns, risk_free=0.0): if np.absolute(joint.var().iloc[1]) < 1.0e-30: return np.nan - return np.cov(joint.values.T, ddof=0)[0, 1] / np.var(joint.iloc[:, 1]) + cov = np.cov(joint.values.T, ddof=0) + return cov[0, 1] / cov[1, 1] def stability_of_timeseries(returns):
MAINT Beta calculation does not require explicity variance calculation.
quantopian_empyrical
train
py
cea8c7f3ea8986124bb07d2eab0b08f0300b5a19
diff --git a/see/context/resources/network.py b/see/context/resources/network.py index <HASH>..<HASH> 100644 --- a/see/context/resources/network.py +++ b/see/context/resources/network.py @@ -76,15 +76,15 @@ def create(hypervisor, identifier, configuration): """ with open(configuration['configuration']) as xml_file: - xml_string = xml_file.read() + xml_config = xml_file.read() for _ in range(MAX_ATTEMPTS): if 'dynamic_address' in configuration: address = generate_address(hypervisor, configuration['dynamic_address']) - xml_string = network_xml(identifier, xml_string, address=address) + xml_string = network_xml(identifier, xml_config, address=address) else: - xml_string = network_xml(identifier, xml_string) + xml_string = network_xml(identifier, xml_config) try: return hypervisor.networkCreateXML(xml_string)
network: fix creation attempts error handling The XML configuration was overwritten thus causing the next attempt to fail because the IP being already set within it.
F-Secure_see
train
py
aa890a334da856e28939338da035c6724c4e4b10
diff --git a/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go b/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go index <HASH>..<HASH> 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go @@ -115,6 +115,10 @@ func (og *operationGenerator) GenerateVolumesAreAttachedFunc( volumeSpecMap := make(map[*volume.Spec]v1.UniqueVolumeName) // Iterate each volume spec and put them into a map index by the pluginName for _, volumeAttached := range attachedVolumes { + if volumeAttached.VolumeSpec == nil { + glog.Errorf("VerifyVolumesAreAttached.GenerateVolumesAreAttachedFunc: nil spec for volume %s", volumeAttached.VolumeName) + continue + } volumePlugin, err := og.volumePluginMgr.FindPluginBySpec(volumeAttached.VolumeSpec) if err != nil || volumePlugin == nil {
UPSTREAM: <I>: Fix c-m crash while verifying attached volumes
openshift_origin
train
go
e4fe8c836751596f048afb85ee6cd60a0ccf0811
diff --git a/echo_test.go b/echo_test.go index <HASH>..<HASH> 100644 --- a/echo_test.go +++ b/echo_test.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io/ioutil" + "net" "net/http" "net/http/httptest" "reflect" @@ -730,8 +731,24 @@ var listenerNetworkTests = []struct { {"tcp6 ipv6 address", "tcp6", "[::1]:1323"}, } +func supportsIPv6() bool { + addrs, _ := net.InterfaceAddrs() + for _, addr := range addrs { + // Check if any interface has local IPv6 assigned + if strings.Contains(addr.String(), "::1") { + return true + } + } + return false +} + func TestEchoListenerNetwork(t *testing.T) { + hasIPv6 := supportsIPv6() for _, tt := range listenerNetworkTests { + if !hasIPv6 && strings.Contains(tt.address, "::") { + t.Skip("Skipping testing IPv6 for " + tt.address + ", not available") + continue + } t.Run(tt.test, func(t *testing.T) { e := New() e.ListenerNetwork = tt.network
Fix failing tests on systems not supporting IPv6
labstack_echo
train
go
7c1ca638e044a1ff127f0aa82f3703a27707de88
diff --git a/src/key.js b/src/key.js index <HASH>..<HASH> 100644 --- a/src/key.js +++ b/src/key.js @@ -793,6 +793,7 @@ steal('src/synthetic.js','src/browsers.js',function(Syn) { if ( defaultResult !== null ) { setTimeout(function() { + Syn.trigger('input', Syn.key.options(key, 'input'), element) Syn.trigger('keyup', Syn.key.options(key, 'keyup'), element) callback(runDefaults, element) }, 1) diff --git a/test/qunit/key_test.js b/test/qunit/key_test.js index <HASH>..<HASH> 100644 --- a/test/qunit/key_test.js +++ b/test/qunit/key_test.js @@ -79,10 +79,11 @@ test("Key Event Order", 1, function(){ st.binder("key","keydown", recorder ); st.binder("key","keypress", recorder ); + st.binder("key","input", recorder ); st.binder("key","keyup", recorder ); stop(); Syn.key("B","key", function(){ - deepEqual(order,["keydown","keypress","keyup"],"Key order is correct") + deepEqual(order,["keydown","keypress", "input", "keyup"],"Key order is correct") start(); });
added input event to type() and respective test
bitovi_syn
train
js,js
dbf5baa067fc9b536014862800aaec5f892a11c4
diff --git a/src/SocialShare/SocialShare.php b/src/SocialShare/SocialShare.php index <HASH>..<HASH> 100644 --- a/src/SocialShare/SocialShare.php +++ b/src/SocialShare/SocialShare.php @@ -110,6 +110,22 @@ class SocialShare } /** + * Gets the total number of share of the given URL for all providers + * + * @param string $url + * @throws \RuntimeException + * @return int + */ + public function getSharesTotal( $url ) + { + $shares = 0; + foreach($this->providers as $providerName => $provider) { + $shares += $this->getShares($providerName, $url); + } + return $shares; + } + + /** * Updates delayed URLs */ public function update()
Add method to get the total number of shares (#5)
dunglas_php-socialshare
train
php
13e981305f2d046f82f58b930873a9921ca208f1
diff --git a/devices/useelink.js b/devices/useelink.js index <HASH>..<HASH> 100644 --- a/devices/useelink.js +++ b/devices/useelink.js @@ -36,6 +36,9 @@ module.exports = [ await reporting.bind(device.getEndpoint(ID), coordinatorEndpoint, ['genOnOff']); } }, + endpoint: (device) => { + return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4, 'l5': 5}; + }, }, { fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_tvuarksa'}],
Missing endpoint mapping (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
fa8ebc7154f43f21f3ba0ad957c23c0683468206
diff --git a/yandextank/plugins/Telegraf/tests/test_plugin.py b/yandextank/plugins/Telegraf/tests/test_plugin.py index <HASH>..<HASH> 100644 --- a/yandextank/plugins/Telegraf/tests/test_plugin.py +++ b/yandextank/plugins/Telegraf/tests/test_plugin.py @@ -28,4 +28,4 @@ class TestTelegrafPlugin(object): try: telegraf_plugin.configure() except ValueError: - pass \ No newline at end of file + pass
pytests for telegraf
yandex_yandex-tank
train
py
efb365f1af8e2f49d088a2a8faf81b2cc4723498
diff --git a/nautilus/services/service.py b/nautilus/services/service.py index <HASH>..<HASH> 100644 --- a/nautilus/services/service.py +++ b/nautilus/services/service.py @@ -93,6 +93,7 @@ class Service: # base the service on a flask app self.app = self.tornado_app + # setup various functionalities self.init_action_handler(action_handler) # self.setup_auth() @@ -207,14 +208,17 @@ class Service: Example: - import nautilus + .. code-block:: python - service = nautilus.Service(...) + import nautilus + from nauilus.network.http import RequestHandler - @service.route('/') - class HelloWorld(nautilus.network.http.RequestHandler): - def get(self): - return self.finish('hello world') + service = nautilus.Service(...) + + @service.route('/') + class HelloWorld(RequestHandler): + def get(self): + return self.finish('hello world') """ def decorator(cls, **kwds): # add the endpoint at the given route
added missing codeblock directive in service.route documentation
AlecAivazis_graphql-over-kafka
train
py
8ab0b6206e2ad323dedc0c0b806eaa01d477a90a
diff --git a/openapi_core/schema/operations/generators.py b/openapi_core/schema/operations/generators.py index <HASH>..<HASH> 100644 --- a/openapi_core/schema/operations/generators.py +++ b/openapi_core/schema/operations/generators.py @@ -31,6 +31,7 @@ class OperationsGenerator(object): parameters_list = operation_deref.get('parameters', []) parameters = self.parameters_generator.generate_from_list( parameters_list) + operation_id = operation_deref.get('operationId') request_body = None if 'requestBody' in operation_deref: @@ -43,6 +44,7 @@ class OperationsGenerator(object): Operation( http_method, path_name, responses, list(parameters), request_body=request_body, deprecated=deprecated, + operation_id=operation_id, ), ) diff --git a/tests/integration/test_petstore.py b/tests/integration/test_petstore.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_petstore.py +++ b/tests/integration/test_petstore.py @@ -74,6 +74,7 @@ class TestPetstore(object): assert type(operation) == Operation assert operation.path_name == path_name assert operation.http_method == http_method + assert operation.operation_id is not None operation_spec = spec_dict['paths'][path_name][http_method]
Populate operation_id attr
p1c2u_openapi-core
train
py,py
a880cf76b99df8b03055663fd212c6bb3e20483a
diff --git a/src/components/Image/Image.js b/src/components/Image/Image.js index <HASH>..<HASH> 100644 --- a/src/components/Image/Image.js +++ b/src/components/Image/Image.js @@ -120,7 +120,7 @@ class Image extends CloudinaryComponent { containerWidth = Util.width(element); } } - return containerWidth; + return Math.round(containerWidth); }; applyBreakpoints(width, steps, options) {
Round off containerWidth fixes issue #<I>
cloudinary_cloudinary-react
train
js
f5ea154480819fde89026ffadda7f3611deca501
diff --git a/source/rafcon/gui/mygaphas/aspect.py b/source/rafcon/gui/mygaphas/aspect.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/mygaphas/aspect.py +++ b/source/rafcon/gui/mygaphas/aspect.py @@ -188,7 +188,10 @@ class SegmentHandleSelection(ItemHandleSelection): after = handles[handle_index + 1] d, p = distance_line_point(before.pos, after.pos, handle.pos) - if d < 1. / item.hierarchy_level: + # Checks how far the waypoint is from an imaginary line connecting the previous and next way/end point + # If it is close, the two segments are merged to one + merge_distance = item.line_width * 4 + if d < merge_distance: assert len(self.view.canvas.solver._marked_cons) == 0 Segment(item, self.view).merge_segment(segment)
fix(SegmentHandleSelection): Properly merge segments The merging of segments (removal of waypoints) should now properly work on all zoom and hierarchy levels. The commit fixes the issues, where it was no longer possible to create new waypoints on a deeply nested state.
DLR-RM_RAFCON
train
py
6a8d670b50ac12b57e6fcf17ad6757c7eb7f44f6
diff --git a/lib/nydp.rb b/lib/nydp.rb index <HASH>..<HASH> 100644 --- a/lib/nydp.rb +++ b/lib/nydp.rb @@ -2,6 +2,8 @@ require 'date' require 'set' module Nydp + class Namespace < Hash + end def self.apply_function ns, function_name, *args function = r2n(function_name.to_sym, ns).value args = r2n args, ns diff --git a/lib/nydp/plugin.rb b/lib/nydp/plugin.rb index <HASH>..<HASH> 100644 --- a/lib/nydp/plugin.rb +++ b/lib/nydp/plugin.rb @@ -21,7 +21,7 @@ module Nydp end def self.build_nydp extra_files=nil, &block - ns = { } + ns = Namespace.new setup(ns) PLUGINS.each { |plg| loadall ns, plg, plg.loadfiles, &block
vm: use Namespace class instead of plain hash, so plugins can decorate with useful features
conanite_nydp
train
rb,rb
5a1c104eb389e34d9168574db056351e6609a68d
diff --git a/salt/returners/slack_webhook_return.py b/salt/returners/slack_webhook_return.py index <HASH>..<HASH> 100644 --- a/salt/returners/slack_webhook_return.py +++ b/salt/returners/slack_webhook_return.py @@ -176,7 +176,6 @@ def _generate_payload(author_icon, title, report): text += "Total: {}\n".format(report[TOTAL_KEY]) if DURATION_KEY in report: - "color": "danger", text += "Duration: {:.2f} secs".format(float(report[DURATION_KEY])) attachments = [{ @@ -348,9 +347,7 @@ def _post_message(webhook, author_icon, title, report): payload = _generate_payload(author_icon, title, report) - data = _urlencode({ - "payload": json.dumps(payload, ensure_ascii=False) - }) + data = _urlencode({"payload": json.dumps(payload, ensure_ascii=False)}) webhook_url = _urljoin("https://hooks.slack.com/services/", webhook) query_result = salt.utils.http.query(webhook_url, "POST", data=data)
bugfix: Fix bug introduced resolving conflicts
saltstack_salt
train
py
735b7540dfc2ad4de905b7e765c323a48aae2e3d
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -12,6 +12,10 @@ var stampit = require('stampit'); var _ = require('lodash'); var EventEmitter = require('events').EventEmitter; +var AssignFirstArgument = stampit({ init(opts) { + Object.assign(this, opts); +}}); + var StateMachine = stampit({ props: { // can be an object or an array @@ -25,7 +29,7 @@ var StateMachine = stampit({ initial: 'none', current: 'none' }, - static: { + statics: { Promise: global.Promise || require('es6-promise').Promise, FsmError: FsmError, callbackPrefix: 'on', @@ -397,7 +401,7 @@ var StateMachine = stampit({ return target; } }, - init: function init (context) { + init: function init (opts, context) { this.factory = context.stamp; var events = this.events; @@ -419,4 +423,6 @@ var StateMachine = stampit({ } }); +StateMachine = AssignFirstArgument.compose(StateMachine); + module.exports = StateMachine;
fixed breaking changes: statics, init signature, assignment of first argument
vstirbu_fsm-as-promised
train
js
ae789facd5ade79af415165cb4e815d4f5fbbee7
diff --git a/bosh_cli/lib/cli/validation.rb b/bosh_cli/lib/cli/validation.rb index <HASH>..<HASH> 100644 --- a/bosh_cli/lib/cli/validation.rb +++ b/bosh_cli/lib/cli/validation.rb @@ -29,9 +29,11 @@ module Bosh::Cli private def step(name, error_message, kind = :non_fatal, &block) + say("%-60s " % [name], "") + passed = yield - say("%-60s %s" % [name, passed ? "OK".make_green : "FAILED".make_red]) + say("%s" % [passed ? "OK".make_green : "FAILED".make_red]) unless passed errors << error_message
Show step message before long-running block result [finishes #<I>] This means #step can be used to display what is currently happening whilst determining OK/FAILED.
cloudfoundry_bosh
train
rb
08d5a51677917649ea1439bc020b783961a44b0e
diff --git a/tests/test_flask_kvsession.py b/tests/test_flask_kvsession.py index <HASH>..<HASH> 100644 --- a/tests/test_flask_kvsession.py +++ b/tests/test_flask_kvsession.py @@ -167,7 +167,7 @@ def test_session_expires_without_backend_support(app, client): s = json_dec(rv.data) assert s['k1'] == 'value1' - client.get('/make-session-permanent/') + rv = client.get('/make-session-permanent/') # assert that the session has a non-zero timestamp sid, created = split_cookie(app, rv)
Properly use return value in permanency/expiration test.
mbr_flask-kvsession
train
py
2de60b66495f1a43e3500b3c67d3864749889aa6
diff --git a/lib/exception_handling/version.rb b/lib/exception_handling/version.rb index <HASH>..<HASH> 100644 --- a/lib/exception_handling/version.rb +++ b/lib/exception_handling/version.rb @@ -1,3 +1,3 @@ module ExceptionHandling - VERSION = "1.3.0" + VERSION = "1.3.0".freeze end
TECH-<I> honeybadger upgrade: add freeze to version constant
Invoca_exception_handling
train
rb
365f2b8dad5323a28df8f369948b70d2062f2f71
diff --git a/tensorboard/defs/rollup_config.js b/tensorboard/defs/rollup_config.js index <HASH>..<HASH> 100644 --- a/tensorboard/defs/rollup_config.js +++ b/tensorboard/defs/rollup_config.js @@ -23,4 +23,7 @@ module.exports = { }), commonjs(), ], + output: { + strict: false, + }, };
sync: relax rollup config for imperfect deps (#<I>) Projector depends on Weblas, a 3rd party dependency that throws runtime errors when run in a browser's strict mode: <URL>: `blaze run tensorboard/plugins/projector/polymer3/vz_projector:standalone`
tensorflow_tensorboard
train
js
ef8e0b323fe2b9070b848e187b64d97d67396368
diff --git a/modeltranslation/settings.py b/modeltranslation/settings.py index <HASH>..<HASH> 100644 --- a/modeltranslation/settings.py +++ b/modeltranslation/settings.py @@ -5,8 +5,8 @@ from django.core.exceptions import ImproperlyConfigured TRANSLATION_FILES = tuple(getattr(settings, 'MODELTRANSLATION_TRANSLATION_FILES', ())) -AVAILABLE_LANGUAGES = getattr(settings, 'MODELTRANSLATION_LANGUAGES', - [l[0] for l in settings.LANGUAGES]) +AVAILABLE_LANGUAGES = list(getattr(settings, 'MODELTRANSLATION_LANGUAGES', + (l[0] for l in settings.LANGUAGES))) DEFAULT_LANGUAGE = getattr(settings, 'MODELTRANSLATION_DEFAULT_LANGUAGE', None) if DEFAULT_LANGUAGE and DEFAULT_LANGUAGE not in AVAILABLE_LANGUAGES: raise ImproperlyConfigured('MODELTRANSLATION_DEFAULT_LANGUAGE not in LANGUAGES setting.')
Ensure AVAILABLE_LANGUAGES is a list (close #<I>).
deschler_django-modeltranslation
train
py
a8d0b57edae02b60523be8faa750e2a1b9635158
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,7 @@ 'use strict'; var AWS; +/* istanbul ignore if */ if (process.LLTRACE_ON) { AWS = require('lltrace-aws-sdk').AWS; } else { @@ -28,6 +29,7 @@ var AwsHelper = { // initialisation method (Optional) function init (context, event) { + /* istanbul ignore if */ if (process.LLTRACE_ON) { AWS.init(context.functionName); }
Ignore ifs for coverage
numo-labs_aws-lambda-helper
train
js
b2d394350f2165cbd754336d674da0e154fb7f11
diff --git a/eventkit/models.py b/eventkit/models.py index <HASH>..<HASH> 100644 --- a/eventkit/models.py +++ b/eventkit/models.py @@ -281,6 +281,16 @@ class AbstractEvent(PolymorphicMPTTModel, AbstractBaseModel): missing = rruleset.between(starts, end_repeat) return missing + @property + def period(self): + """ + Return "AM" or "PM", depending on when this event starts. + """ + try: + return 'PM' if timezone.localize(self.starts).hour >= 12 else 'AM' + except AttributeError: + pass + @transaction.atomic def save(self, propagate=False, *args, **kwargs): """
Add `period` property. Returns "AM" or "PM" for the localised starts time.
ic-labs_django-icekit
train
py
9c61414b077260f7826825a2d7a45e14ded980f5
diff --git a/src/sap.m/src/sap/m/WheelSlider.js b/src/sap.m/src/sap/m/WheelSlider.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/WheelSlider.js +++ b/src/sap.m/src/sap/m/WheelSlider.js @@ -911,8 +911,8 @@ sap.ui.define([ $aItems.eq(this._iSelectedItemIndex).addClass("sapMWSItemSelected"); //WAI-ARIA region oDescriptionElement = document.getElementById(this.getId() + "-valDescription"); - if (oDescriptionElement.innerHTML !== sAriaLabel) { - oDescriptionElement.innerHTML = sAriaLabel; + if (oDescriptionElement.innerText !== sAriaLabel) { + oDescriptionElement.innerText = sAriaLabel; } };
[INTERNAL] sap.m.WheelSlider: Corrected API usage Change-Id: Ibca4e4d<I>e0cf<I>d3ceeea<I>ae<I>a<I>a8
SAP_openui5
train
js
3aba2e48e1dceb8e23276427d8a5b1f2775fe755
diff --git a/grab/spider/task.py b/grab/spider/task.py index <HASH>..<HASH> 100644 --- a/grab/spider/task.py +++ b/grab/spider/task.py @@ -53,5 +53,8 @@ class Task(object): for key, value in kwargs.items(): setattr(task, key, value) + + if 'grab' in kwargs: + task.url = kwargs['grab'].config['url'] return task
Fix bug in Task clone method
lorien_grab
train
py
3fefa292c1c419f0c4c3e2697cdd94cafaeb4b66
diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index <HASH>..<HASH> 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -1511,7 +1511,7 @@ class Trainer: return else: rng_file = os.path.join(checkpoint, "rng_state.pth") - if not os.path.isfile(os.path.join(checkpoint, rng_file)): + if not os.path.isfile(rng_file): logger.info( "Didn't find an RNG file, if you are resuming a training that was launched in a distributed " "fashion, reproducibility is not guaranteed."
Trainer._load_rng_state() path fix (#<I>) (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
71c4a67d80c66f0678a1863859dfbea9afb38a41
diff --git a/src/Core.php b/src/Core.php index <HASH>..<HASH> 100755 --- a/src/Core.php +++ b/src/Core.php @@ -138,7 +138,7 @@ } catch (Exception $e) { - if (self::getService('core.logger') instanceof Logger) { + if (self::hasService('core.logger')) { self::getService('core.logger')->critical($e->getMessage()); @@ -224,6 +224,16 @@ } /** + * Returns TRUE when a service exists under given service name, FALSE otherwise. + * @param string $service_name + * @return bool + */ + public static function hasService(string $service_name): bool + { + return array_key_exists($service_name, self::$services); + } + + /** * Returns service by service name. * @param string $service_name * @return mixed
Add Core::hasService method Fix a bug when Core log service was called while not yet registered
Lou117_core
train
php
d735fee00c1f8422c65340077cc9772e097a4ef5
diff --git a/src/jash.js b/src/jash.js index <HASH>..<HASH> 100644 --- a/src/jash.js +++ b/src/jash.js @@ -143,7 +143,8 @@ function addBinaries(binaries) { } //if the last arg is an object, it's the options object - if (typeof args[args.length-1] == 'object') { + var lastArg = args[args.length-1]; + if (typeof lastArg == 'object' && !lastArg.length) { options = args.pop(); } //if the first argument was an array, the args were passed as
fix a bug where passing args as an array with nothing else broke
gameclosure_jash
train
js
44bc1fb0d3033571ea2ff7df4bcf2a272c7015e0
diff --git a/presto-product-tests/src/main/java/com/facebook/presto/tests/hive/TestTablePartitioningSelect.java b/presto-product-tests/src/main/java/com/facebook/presto/tests/hive/TestTablePartitioningSelect.java index <HASH>..<HASH> 100644 --- a/presto-product-tests/src/main/java/com/facebook/presto/tests/hive/TestTablePartitioningSelect.java +++ b/presto-product-tests/src/main/java/com/facebook/presto/tests/hive/TestTablePartitioningSelect.java @@ -28,7 +28,6 @@ import java.sql.SQLException; import java.util.Optional; import static com.facebook.presto.tests.TestGroups.HIVE_CONNECTOR; -import static com.facebook.presto.tests.TestGroups.QUARANTINE; import static com.teradata.tempto.Requirements.allOf; import static com.teradata.tempto.assertions.QueryAssert.Row.row; import static com.teradata.tempto.assertions.QueryAssert.assertThat; @@ -87,7 +86,7 @@ public class TestTablePartitioningSelect ); } - @Test(groups = {HIVE_CONNECTOR, QUARANTINE}) + @Test(groups = {HIVE_CONNECTOR}) public void testSelectPartitionedHiveTableDifferentFormats() throws SQLException {
Unquarantine TestTablePartitioningSelect This test was failling because of the resources filtering issue
prestodb_presto
train
java
1cfa3c7fe3ee4a39cc1c8af85ea8d76eda4584e0
diff --git a/unpack-browser.js b/unpack-browser.js index <HASH>..<HASH> 100644 --- a/unpack-browser.js +++ b/unpack-browser.js @@ -6,12 +6,12 @@ var ndarray = require("ndarray") function unpackPNG(w, h, c, str) { var canvas = document.createElement("canvas") - canvas.width = w - canvas.height = h + canvas.width = h + canvas.height = w var img = new Image() img.src = "data:image/png;base64," + str var context = canvas.getContext("2d") context.drawImage(img, 0, 0) - var pixels = context.getImageData(0, 0, w, h) + var pixels = context.getImageData(0, 0, h, w) return ndarray(pixels.data, [h, w, c], [4*w, 4, 1], 0) } \ No newline at end of file
Fix image orientation in unpack-browser.js width/height were reversed :)
mikolalysenko_ndpack-image
train
js
93a7230200487290beb3709a09c07c9eab77fb2b
diff --git a/lib/worker.js b/lib/worker.js index <HASH>..<HASH> 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -213,13 +213,13 @@ module.exports = function(opts, done) { */ if (opts.topology === 'cluster') { server = startCluster(opts); - delay = 1000; + delay = 10000; } else if (opts.topology === 'replicaset') { server = startReplicaset(opts); delay = 5000; } else { server = startStandalone(opts); - delay = 10000; + delay = 0; } debug('starting `%s`...', opts.name);
:zap: more debug
mongodb-js_runner
train
js
38e690ba859bb189e579af25e4b2d4cf2b934441
diff --git a/config/construction/Init.php b/config/construction/Init.php index <HASH>..<HASH> 100644 --- a/config/construction/Init.php +++ b/config/construction/Init.php @@ -4,7 +4,7 @@ * @Author: Cleberson Bieleski * @Date: 2017-12-23 04:54:45 * @Last Modified by: Cleberson Bieleski - * @Last Modified time: 2018-01-18 07:07:59 + * @Last Modified time: 2018-01-18 07:53:07 */ namespace DwPhp; @@ -706,8 +706,10 @@ class Init{ $this->setPageCtrl($directory_ctrl); $this->setPageView($directory_view); } - if(!file_exists($directory_view) || !is_file($directory_view)){ + if(!file_exists($directory_ctrl) || !is_file($directory_ctrl)){ $this->setPageCtrl($this->getPathApplication('controllers/error/','404.php')); + } + if(!file_exists($directory_view) || !is_file($directory_view)){ $this->setPageView($this->getPathApplication('views/error/','404.php')); }
controller access without the need of the view
dezwork_dwphp-framework
train
php
764bbb801e683c8fea08465ac14780ba11ebf695
diff --git a/activesupport/test/array_inquirer_test.rb b/activesupport/test/array_inquirer_test.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/array_inquirer_test.rb +++ b/activesupport/test/array_inquirer_test.rb @@ -51,6 +51,11 @@ class ArrayInquirerTest < ActiveSupport::TestCase assert_respond_to arr, :foo assert_not_respond_to arr, :nope ensure - Array.send :undef_method, :respond_to_missing? + Array.class_eval do + undef_method :respond_to_missing? + def respond_to_missing?(name, include_private = false) + super + end + end end end diff --git a/activesupport/test/string_inquirer_test.rb b/activesupport/test/string_inquirer_test.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/string_inquirer_test.rb +++ b/activesupport/test/string_inquirer_test.rb @@ -34,6 +34,11 @@ class StringInquirerTest < ActiveSupport::TestCase assert_not_respond_to str, :nope ensure - String.send :undef_method, :respond_to_missing? + String.class_eval do + undef_method :respond_to_missing? + def respond_to_missing?(name, include_private = false) + (name == :bar) || super + end + end end end
It would be safer not to totally undef core classes' respond_to_missing? instead, rewrite them to no-op
rails_rails
train
rb,rb
c1f10c9556ec3b6345095a5100e9281a3cfcce4c
diff --git a/lib/plugins/aws/deployFunction/index.js b/lib/plugins/aws/deployFunction/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/aws/deployFunction/index.js +++ b/lib/plugins/aws/deployFunction/index.js @@ -69,16 +69,14 @@ class AwsDeployFunction { ZipFile: data, }; - this.sdk.request( + return this.sdk.request( 'Lambda', 'updateFunctionCode', params, this.options.stage, this.options.region - ); - - this.serverless.cli.log(`Successfully deployed function "${this.options.function}"`); - - return BbPromise.resolve(); + ).then(() => { + this.serverless.cli.log(`Successfully deployed function "${this.options.function}"`); + }); } cleanup() {
Fix Promise chain in deployFunction plugin
serverless_serverless
train
js
472b91e91a525e167b622e360966567dcad3e588
diff --git a/firebase.go b/firebase.go index <HASH>..<HASH> 100644 --- a/firebase.go +++ b/firebase.go @@ -143,6 +143,10 @@ func (fb *Firebase) doRequest(method string, body []byte) ([]byte, error) { if e1.Timeout() { return nil, ErrTimeout{err} } + case net.Error: + if err.Timeout() { + return nil, ErrTimeout{err} + } } defer resp.Body.Close()
also handler net.Errors directly
zabawaba99_firego
train
go
c08c399e4cefa0604c71a9c9366bff83e780d49c
diff --git a/steam/util/binary.py b/steam/util/binary.py index <HASH>..<HASH> 100644 --- a/steam/util/binary.py +++ b/steam/util/binary.py @@ -8,10 +8,21 @@ class StructReader(object): :type data: :class:`bytes` """ if not isinstance(data, bytes): - raise ValueError("Requires bytes") + raise ValueError("Only works with bytes") self.data = data self.offset = 0 + def __len__(self): + return len(self.data) + + def rlen(self): + """Number of remaining bytes that can be read + + :return: number of remaining bytes + :rtype: :class:`int` + """ + return max(0, len(self) - self.offset) + def read(self, n=1): """Return n bytes
StructReader: added __len__() and rlen()
ValvePython_steam
train
py
15b106d77d8731d89d01bdeedad013d26e4db139
diff --git a/tests/LaTeX.js b/tests/LaTeX.js index <HASH>..<HASH> 100644 --- a/tests/LaTeX.js +++ b/tests/LaTeX.js @@ -128,8 +128,12 @@ var cases = { decimal_TeX: '\\frac{x \\cdot \\left(x+1\\right)}{x^{2}+2 \\cdot x+1}' }, 'x^2+2*x+y^2+y+6': { - TeX: '\\frac{x \\cdot \\left(x+1\\right)}{x^{2}+2 \\cdot x+1}', - decimal_TeX: '\\frac{x \\cdot \\left(x+1\\right)}{x^{2}+2 \\cdot x+1}' + TeX: 'x^{2}+2 \\cdot x+y^{2}+y+6', + decimal_TeX: 'x^{2}+2 \\cdot x+y^{2}+y+6' + }, + '(-1*(x-1))': { + TeX: '-\\left(x-1\\right)', + decimal_TeX: '-\\left(x-1\\right)' }, };
Update tests to include issue #<I>
jiggzson_nerdamer
train
js
ac94d497760563d5da50f3820751fd379db1ca53
diff --git a/src/MediaBundle/Provider/YoutubeProvider.php b/src/MediaBundle/Provider/YoutubeProvider.php index <HASH>..<HASH> 100644 --- a/src/MediaBundle/Provider/YoutubeProvider.php +++ b/src/MediaBundle/Provider/YoutubeProvider.php @@ -215,4 +215,19 @@ class YoutubeProvider extends AbstractProvider return $thumb; } + + + /** + * Get the full url to the original video. + * + * @param MediaInterface $media + * + * @return string + */ + public function getUrl(MediaInterface $media) + { + $metadata = $media->getMetaData(); + + return sprintf('https://youtube.com/?watch=%s', $metadata['id']); + } }
Added youtubeprovider getUrl method
Opifer_Cms
train
php
c519e582b5012889ff66fa456d5c1c0427962463
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -695,6 +695,7 @@ func expandTilde(p string) string { return getHomeDir() } + p = filepath.FromSlash(p) if !strings.HasPrefix(p, fmt.Sprintf("~%c", os.PathSeparator)) { return p }
Expand tilde on Windows as well (fixes #<I>)
syncthing_syncthing
train
go
ab03adcf708d995f18b082da00a9e0c20e0bd0c1
diff --git a/src/LdapTools/ParameterResolver.php b/src/LdapTools/ParameterResolver.php index <HASH>..<HASH> 100644 --- a/src/LdapTools/ParameterResolver.php +++ b/src/LdapTools/ParameterResolver.php @@ -241,7 +241,7 @@ class ParameterResolver } elseif (array_key_exists(strtolower($parameter), array_change_key_case($attributes))) { $value = array_change_key_case($attributes)[strtolower($parameter)]; } - $original = preg_replace("/%$parameter%/", $value, $original); + $original = preg_replace("/".self::PARAM_MARKER.$parameter.self::PARAM_MARKER."/", $value, $original); } return $original;
Use the constant designated for the parameter marker character.
ldaptools_ldaptools
train
php
4fa6639441223e6e7df935ae9f406fbd6e57e16c
diff --git a/app.js b/app.js index <HASH>..<HASH> 100644 --- a/app.js +++ b/app.js @@ -118,8 +118,8 @@ if(process.env.CONN_NAME && process.env.DB_USERNAME && process.env.DB_PASSWORD & connection_string: 'mongodb://' + process.env.DB_USERNAME + ':' + process.env.DB_PASSWORD + '@' + process.env.DB_HOST + ':' + process.env.DB_PORT }; } - -if(!fs.existsSync(config_connections)) fs.writeFileSync(config_connections, JSON.stringify(configConnection)); +if (!fs.existsSync(config_connections) || fs.readFileSync(config_connections, 'utf8') === '{}') + fs.writeFileSync(config_connections, JSON.stringify(configConnection)); // if config files exist but are blank we write blank files for nconf if(fs.existsSync(config_app, 'utf8')){
#<I> Override default config.json with connection from env
mrvautin_adminMongo
train
js
ba1e5d63a6d7ff27e6e5a8ea8466d815fdbd2d0e
diff --git a/test/main.js b/test/main.js index <HASH>..<HASH> 100644 --- a/test/main.js +++ b/test/main.js @@ -50,6 +50,14 @@ describe('gulp-browserify', function() { }).end(fakeFile); }); + it('should return a browserify require file without entry point contents', function(done) { + var fakeFile = createFakeFile('normal.js', null); + gulpB().once('data', function(bundled) { + expect(bundled.contents.toString()).to.equal(fs.readFileSync('test/expected/normal.js', 'utf8')); + done(); + }).end(fakeFile); + }); + it('should bundles multiple entry points', function(done) { var fakeFile1 = createFakeFile('normal.js', fs.readFileSync('test/fixtures/normal.js')); var fakeFile2 = createFakeFile('normal2.js', fs.readFileSync('test/fixtures/normal2.js'));
Add a test for no entry point contents.
deepak1556_gulp-browserify
train
js
c0ecccd333584328ee739341529cc5101b886cb0
diff --git a/pyramid/__init__.py b/pyramid/__init__.py index <HASH>..<HASH> 100644 --- a/pyramid/__init__.py +++ b/pyramid/__init__.py @@ -4,7 +4,7 @@ # # The pyramid module -__version__ = "0.7.0-dev" +__version__ = "0.7.0-dev0" try: # this var is injected in the setup build to enable
[ci skip] Bump to dev version
tgsmith61591_pmdarima
train
py
d7247a1fa3067da547409f2dade396ce6327deaf
diff --git a/pyp2rpm/name_convertor.py b/pyp2rpm/name_convertor.py index <HASH>..<HASH> 100644 --- a/pyp2rpm/name_convertor.py +++ b/pyp2rpm/name_convertor.py @@ -43,6 +43,10 @@ class NameConvertor(object): rpmized_name = name if self.distro == 'mageia': exclude_string = 'python-' + if name not in ['pyp2rpm', + 'py', + 'pyflation'] and name[0:2] == 'py': + name = name[2:] else: exclude_string = 'py'
remove initial "py" to fit mageia conventions
fedora-python_pyp2rpm
train
py
de99f2046d5872ceca09f281736a3ca7b3c031d7
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -1,8 +1,9 @@ from contextlib import contextmanager -import unittest import logging import os +import stat import sys +import unittest from os.path import expanduser, join, abspath from textwrap import dedent @@ -276,9 +277,18 @@ class FunctionalityTests(unittest.TestCase): self.assertNotIn(join('testdata', 'test.ini'), conf.loaded_files) def test_secured_file(self): + # make sure the file is secured. This information is lost through git so + # we need to set it here manually. Also, this is only available on *nix, + # so we need to skip if necessary + if sys.platform != 'linux': + self.skipTest('Only runnable on *nix') + + path = join('testdata', 'secure.ini') + os.chmod(path, stat.S_IRUSR | stat.S_IWUSR) + conf = SecuredConfig('hello', 'world', filename='secure.ini', search_path='testdata') - self.assertIn(join('testdata', 'secure.ini'), conf.loaded_files) + self.assertIn(path, conf.loaded_files) def test_secured_nonexisting_file(self): conf = SecuredConfig('hello', 'world', filename='nonexisting.ini',
Make sure the secured file is secured On a fresh git clone the permissions are lost.
exhuma_config_resolver
train
py
01cd55dd0f0b5e6ae15452684038ba4f549cd647
diff --git a/tabu_sampler.py b/tabu_sampler.py index <HASH>..<HASH> 100644 --- a/tabu_sampler.py +++ b/tabu_sampler.py @@ -127,7 +127,7 @@ class TabuSampler(Sampler): def _bqm_sample_to_tabu_sample(self, sample, bqm): assert len(sample) == len(bqm) _, values = zip(*sorted(sample_as_dict(sample).items())) - return values + return list(map(int, values)) def _tabu_sample_to_bqm_sample(self, sample, bqm): varorder = sorted(list(bqm.adj.keys()))
Bugfix: properly handle BQMs with string variable names
dwavesystems_dwave-tabu
train
py
699d8046c2eb04ac784392a1ec56ac84b3f89e56
diff --git a/batchAntiSpoof.php b/batchAntiSpoof.php index <HASH>..<HASH> 100644 --- a/batchAntiSpoof.php +++ b/batchAntiSpoof.php @@ -12,7 +12,7 @@ $batchSize = 1000; $result = $dbw->select( 'user', 'user_name', null, 'batchAntiSpoof.php' ); $n = 0; -foreach( $res as $row ) { +foreach( $result as $row ) { if ( $n++ % $batchSize == 0 ) { echo "$wgDBname $n\n"; }
followup r<I> typo in var name
wikimedia_mediawiki-extensions-AntiSpoof
train
php
3c8a47d5853710a10f07df8c576cecbcb22054f4
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -198,6 +198,7 @@ module.exports = { 'packages/components/**/*', 'packages/composite-checkout/**/*', 'packages/data-stores/**/*', + 'packages/js-utils/**/*', 'packages/launch/**/*', 'packages/wpcom-checkout/**/*', 'test/e2e/**/*', diff --git a/packages/js-utils/src/test/unique-by.js b/packages/js-utils/src/test/unique-by.js index <HASH>..<HASH> 100644 --- a/packages/js-utils/src/test/unique-by.js +++ b/packages/js-utils/src/test/unique-by.js @@ -1,6 +1,3 @@ -/** - * Internal dependencies - */ import uniqueBy from '../unique-by'; describe( 'uniqueBy()', () => {
chore: migrate packages/js-utils to import/order (#<I>)
Automattic_wp-calypso
train
js,js
13413b7454fc752dc75927c007980c1147beb18a
diff --git a/cmsplugin_cascade/bootstrap3/image.py b/cmsplugin_cascade/bootstrap3/image.py index <HASH>..<HASH> 100644 --- a/cmsplugin_cascade/bootstrap3/image.py +++ b/cmsplugin_cascade/bootstrap3/image.py @@ -24,12 +24,12 @@ class ImageFormMixin(object): tuple(t for t in getattr(LinkForm, 'LINK_TYPE_CHOICES') if t[0] != 'email') def __init__(self, *args, **kwargs): + super(ImageFormMixin, self).__init__(*args, **kwargs) try: - self.base_fields['image_file'].initial = kwargs['instance'].image.pk + self.fields['image_file'].initial = kwargs['instance'].image.pk except (AttributeError, KeyError): pass - self.base_fields['image_file'].widget = AdminFileWidget(ManyToOneRel(FilerImageField, Image, 'file_ptr'), site) - super(ImageFormMixin, self).__init__(*args, **kwargs) + self.fields['image_file'].widget = AdminFileWidget(ManyToOneRel(FilerImageField, Image, 'file_ptr'), site) def clean_glossary(self): # TODO: remove this someday
fixed: image_file initial The base_fields class attribute is the *class-wide* definition of fields,it will keep previous instance state. if kwargs['instance'].image is None, image_file initial wrong value.
jrief_djangocms-cascade
train
py
61f02d4b481360ee5ad8bb7e9e7c3a5518f6111e
diff --git a/safe/impact_functions/earthquake/earthquake_building/impact_function.py b/safe/impact_functions/earthquake/earthquake_building/impact_function.py index <HASH>..<HASH> 100644 --- a/safe/impact_functions/earthquake/earthquake_building/impact_function.py +++ b/safe/impact_functions/earthquake/earthquake_building/impact_function.py @@ -144,7 +144,6 @@ class EarthquakeBuildingFunction(ContinuousRHClassifiedVE, (tr('High'), {}), (tr('Medium'), {}), (tr('Low'), {}), - (self._not_affected_value, {}) ]) removed = [] for i in range(interpolate_size): @@ -211,8 +210,8 @@ class EarthquakeBuildingFunction(ContinuousRHClassifiedVE, category = tr('High') else: # Not reported for less than level t0 - cls = 0 - category = self._not_affected_value + continue + attributes[i][self.target_field] = cls self.affected_buildings[ category][usage][tr('Buildings Affected')] += 1 @@ -222,7 +221,7 @@ class EarthquakeBuildingFunction(ContinuousRHClassifiedVE, self.affected_buildings[category][usage][ tr('Contents value ($M)')] += contents_value / 1000000.0 - # remove uncategorized element + # remove un-categorized element removed.reverse() geometry = interpolate_result.get_geometry() for i in range(0, len(removed)):
Remove not affected handling from IF Eq
inasafe_inasafe
train
py
aa2a31d60ae14c0696e0b9eff8741bf41e93d485
diff --git a/py/nupic/encoders/vector.py b/py/nupic/encoders/vector.py index <HASH>..<HASH> 100644 --- a/py/nupic/encoders/vector.py +++ b/py/nupic/encoders/vector.py @@ -125,10 +125,10 @@ class VectorEncoderOPF(VectorEncoder): ################################################################################################# class SimpleVectorEncoder(VectorEncoder): """Vector encoder for beginners, easy to create and play with; - encodes list of 5 elements, numbers 0-100""" + by default encodes list of 5 elements, numbers 0-100""" - def __init__(self, length=5): - sc = ScalarEncoder(5, 0, 100, n=40) + def __init__(self, length=5, minval=0, maxval=100, resolution=1, name='vect'): + sc = ScalarEncoder(5, minval, maxval, resolution=resolution, name='idx') super(SimpleVectorEncoder, self).__init__(length, sc, typeCastFn=float)
SimpleVector: make little more customizable
numenta_nupic
train
py
877ffcb8d03a241716261e1bc8b1109ad154e60a
diff --git a/lib/responders/flash_responder.rb b/lib/responders/flash_responder.rb index <HASH>..<HASH> 100644 --- a/lib/responders/flash_responder.rb +++ b/lib/responders/flash_responder.rb @@ -86,6 +86,9 @@ module Responders mattr_accessor :flash_keys @@flash_keys = [ :notice, :alert ] + mattr_reader :helper + @@helper = Object.new.extend(ActionView::Helpers::TranslationHelper) + def initialize(controller, resources, options={}) super @flash = options.delete(:flash) @@ -106,10 +109,6 @@ module Responders protected - def helper - @helper ||= Object.new.extend(ActionView::Helpers::TranslationHelper) - end - def set_flash_message! if has_errors? set_flash(:alert, @alert) @@ -122,7 +121,7 @@ module Responders return if controller.flash[status].present? options = mount_i18n_options(status) - message = helper.t options[:default].shift, options + message = Responders::FlashResponder.helper.t options[:default].shift, options set_flash(status, message) end
Caching helper as a class variable.
plataformatec_responders
train
rb
d693a719a77372ac3e8523e5a6465e59481d2fd3
diff --git a/context/context.go b/context/context.go index <HASH>..<HASH> 100644 --- a/context/context.go +++ b/context/context.go @@ -451,6 +451,10 @@ func (ctx *Context) ModifyImport(ps *pkgspec.Pkg, mod Modify) error { } } + if canonicalImportPath == "" { + canonicalImportPath = sourcePath + } + // Does the local import exist? // If so either update or just return. // If not find the disk path from the canonical path, copy locally and rewrite (if needed).
context: fix setting path when it doesn't exist anywhere yet
kardianos_govendor
train
go
cad073489fbcc4d7b4d2f9282cfda9466f1ccabf
diff --git a/axis/__init__.py b/axis/__init__.py index <HASH>..<HASH> 100644 --- a/axis/__init__.py +++ b/axis/__init__.py @@ -120,8 +120,16 @@ class AxisDevice(object): self._event_topics = '{}|{}'.format(self._event_topics, event_topic) + def minimum_firmware(self, constraint): + """Checks that firmwware isn't older than constraint.""" + from packaging import version + return version.parse(self._version) >= version.parse(constraint) + def initiate_metadatastream(self): """Set up gstreamer pipeline and data callback for metadatastream""" + if not self.minimum_firmware('5.50'): + _LOGGER.info("Too old firmware for metadatastream") + return False try: from .stream import MetaDataStream except ImportError as err: @@ -206,6 +214,7 @@ class AxisDevice(object): elif data['Operation'] == 'Deleted': _LOGGER.debug("Deleted event from stream") + # ToDo: # keep a list of deleted events and a follow up timer of X, # then clean up. This should also take care of rebooting a camera
Added check to ensure minimum firmware version of <I> for metadatastream
Kane610_axis
train
py
b8f037ba812e8b41d8d9daa857d74df80180e9e1
diff --git a/mod/assignment/type/offline/assignment.class.php b/mod/assignment/type/offline/assignment.class.php index <HASH>..<HASH> 100644 --- a/mod/assignment/type/offline/assignment.class.php +++ b/mod/assignment/type/offline/assignment.class.php @@ -66,9 +66,8 @@ class assignment_offline extends assignment_base { if (!$grading_info->items[0]->grades[$feedback->userid]->locked and !$grading_info->items[0]->grades[$feedback->userid]->overridden) { - $submission->grade = $feedback->grade; - $submission->submissioncomment = $feedback->submissioncomment; - $submission->format = $feedback->format; + $submission->grade = $feedback->xgrade; + $submission->submissioncomment = $feedback->submissioncomment_editor['text']; $submission->teacher = $USER->id; $mailinfo = get_user_preferences('assignment_mailinfo', 0); if (!$mailinfo) {
assignment MDL-<I> some assignment changes were left out for offline assignment type , fixed processing grading.
moodle_moodle
train
php
434fcc48ae69280d9295327ec6592c462ba55ab3
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,7 +9,10 @@ module.exports = (env, options) => ({ entry: path.resolve(__dirname, 'demo/js/demo.js'), output: { path: path.resolve(__dirname, 'pages'), - filename: '[name][chunkhash].js', + filename: + options.mode === 'production' + ? '[name][chunkhash].js' + : '[name].js', }, module: { rules: [
Fix chunkhash not allowed in development
springload_react-accessible-accordion
train
js
2bce2837fb6244a16a571af3efc80dd8fb675be5
diff --git a/src/datastore/leveldb_shard_datastore.go b/src/datastore/leveldb_shard_datastore.go index <HASH>..<HASH> 100644 --- a/src/datastore/leveldb_shard_datastore.go +++ b/src/datastore/leveldb_shard_datastore.go @@ -198,14 +198,14 @@ func (self *LevelDbShardDatastore) closeOldestShard() { } func (self *LevelDbShardDatastore) closeShard(id uint32) { - delete(self.shardRefCounts, id) - delete(self.shards, id) - delete(self.lastAccess, id) - delete(self.shardsToClose, id) shard := self.shards[id] if shard != nil { shard.close() } + delete(self.shardRefCounts, id) + delete(self.shards, id) + delete(self.lastAccess, id) + delete(self.shardsToClose, id) } // // returns true if the point has the correct field id and is
Fix bug where I was deleting the shard reference before pulling out the shard to close it
influxdata_influxdb
train
go
b2ff6b3ab684d6967ff2a6b776c089d60f825aec
diff --git a/lib/MapboxInspect.js b/lib/MapboxInspect.js index <HASH>..<HASH> 100644 --- a/lib/MapboxInspect.js +++ b/lib/MapboxInspect.js @@ -187,9 +187,17 @@ MapboxInspect.prototype._onMousemove = function (e) { if (!features.length) { this._popup.remove(); } else { - this._popup.setLngLat(e.lngLat) - .setHTML(this.options.renderPopup(features)) - .addTo(this._map); + this._popup.setLngLat(e.lngLat); + + var type = typeof this.options.renderPopup(features); + + if (type === 'string') { + this._popup.setHTML(this.options.renderPopup(features)); + } else { + this._popup.setDOMContent(this.options.renderPopup(features)); + } + + this._popup.addTo(this._map); } } };
Support for htmlNodes (Nodes) in popups
lukasmartinelli_mapbox-gl-inspect
train
js
866fe9fe81039ed9a5839698092b2bde7dc548f9
diff --git a/test/test_f90nml.py b/test/test_f90nml.py index <HASH>..<HASH> 100644 --- a/test/test_f90nml.py +++ b/test/test_f90nml.py @@ -890,6 +890,12 @@ class Test(unittest.TestCase): self.assert_file_equal('types.yaml', 'tmp.yaml') os.remove('tmp.yaml') + def test_cli__read(self): + cmd = ['f90nml', 'types.yaml'] + source_str = self.get_cli_output(cmd) + + # TODO: Check output after resolving the ordering issue + def test_cli_missing_yaml(self): orig_has_yaml = f90nml.cli.has_yaml f90nml.cli.has_yaml = False
CLI: YAML read test
marshallward_f90nml
train
py
e5377d785e5de4573a5d8ab185ce782deb19185b
diff --git a/src/common.js b/src/common.js index <HASH>..<HASH> 100644 --- a/src/common.js +++ b/src/common.js @@ -9,7 +9,7 @@ let __nimiqLoaded = null; // Defaults for development. Build script replaces CONFIG.ALLOWED_ORIGIN and CONFIG.NETWORK. const CONFIG = { ALLOWED_ORIGIN: '*', - NETWORK: Constants.NETWORK.TEST, + NETWORK: 'test', BASE_URL: '/src/', };
revert unrelated change to constant, because it breaks tests
nimiq_keyguard-next
train
js
235cd218b692d5a648a03cf574f5a049202845ea
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -296,6 +296,10 @@ module ActionController # article_comments_url(:article_id => @article) # article_comment_url(:article_id => @article, :id => @comment) # + # If you don't want to load all objects from the database you might want to use the <tt>article_id</tt> directly: + # + # articles_comments_url(@comment.article_id, @comment) + # # * <tt>:name_prefix</tt> - Define a prefix for all generated routes, usually ending in an underscore. # Use this if you have named routes that may clash. #
note on increasing performance a bit when using restful urls
rails_rails
train
rb
d6691fbee84bac0ed756b30ea20cd4d2902c7416
diff --git a/mod/quiz/module.js b/mod/quiz/module.js index <HASH>..<HASH> 100644 --- a/mod/quiz/module.js +++ b/mod/quiz/module.js @@ -219,8 +219,8 @@ M.mod_quiz.secure_window = { window.location = 'about:blank'; } Y.delegate('contextmenu', M.mod_quiz.secure_window.prevent, document, '*'); - Y.delegate('mousedown', M.mod_quiz.secure_window.prevent_mouse, document, '*'); - Y.delegate('mouseup', M.mod_quiz.secure_window.prevent_mouse, document, '*'); + Y.delegate('mousedown', M.mod_quiz.secure_window.prevent_mouse, 'body', '*'); + Y.delegate('mouseup', M.mod_quiz.secure_window.prevent_mouse, 'body', '*'); Y.delegate('dragstart', M.mod_quiz.secure_window.prevent, document, '*'); Y.delegate('selectstart', M.mod_quiz.secure_window.prevent, document, '*'); Y.delegate('cut', M.mod_quiz.secure_window.prevent, document, '*');
MDL-<I> mod_quiz: Scrollbar not working in Javascript Security Popup Quiz window in Chrome
moodle_moodle
train
js
65b995adcb9357d66c45109692319a0e8e5e199a
diff --git a/views/search.py b/views/search.py index <HASH>..<HASH> 100644 --- a/views/search.py +++ b/views/search.py @@ -439,6 +439,10 @@ def search(collection, p, of, so, rm): argd = argd_orig = wash_search_urlargd(request.args) argd['of'] = 'id' + # fix for queries like `/search?p=+ellis` + if 'p' in argd: + argd['p'] = argd['p'].strip() + # update search arguments with the search user preferences if 'rg' not in request.values and current_user.get('rg'): argd['rg'] = int(current_user.get('rg'))
search: quick fix for queries with leading space * Strips leading/trailing white space from `p` argument to `/search`. This quick-fixes queries like `/search?p=+ellis` that were otherwise leading to "Showing records 1 to 0 out of 0 results" situations.
inveniosoftware_invenio-search
train
py
c99d0ec1a2ca76c95e0a9ab81bd86ce38d330fa0
diff --git a/lib/js/Mixin.js b/lib/js/Mixin.js index <HASH>..<HASH> 100644 --- a/lib/js/Mixin.js +++ b/lib/js/Mixin.js @@ -50,7 +50,7 @@ module.exports = function(settings, done) { if ( (hasNewIndex && hasNewStep) || didToggleTooltip || hasNewX || hasNewY ) { this._renderLayer(); - } else if ( hasSteps && !hasNewStep ) { + } else if ( hasSteps && hasNewIndex && !hasNewStep ) { this.completionCallback(); this._unrenderLayer(); }
fix completionCallback being called too soon
jakemmarsh_react-tour-guide
train
js
07a0d0702f320e3472ec5ce40931588749d99691
diff --git a/go_agent/src/bosh/agent/applier/applyspec/v1_apply_spec.go b/go_agent/src/bosh/agent/applier/applyspec/v1_apply_spec.go index <HASH>..<HASH> 100644 --- a/go_agent/src/bosh/agent/applier/applyspec/v1_apply_spec.go +++ b/go_agent/src/bosh/agent/applier/applyspec/v1_apply_spec.go @@ -10,7 +10,7 @@ type V1ApplySpec struct { PackageSpecs map[string]PackageSpec `json:"packages"` ConfigurationHash string `json:"configuration_hash"` NetworkSpecs map[string]interface{} `json:"networks"` - ResourcePoolSpecs map[string]interface{} `json:"resource_pool"` + ResourcePoolSpecs interface{} `json:"resource_pool"` Deployment string `json:"deployment"` Index int `json:"index"`
Ignore ResourcePoolSpec structure in apply message but pass it through resource_pool in apply message differs from compile vm to job vm
cloudfoundry_bosh
train
go
3078d481789f19f90779149726d9504126952f07
diff --git a/src/babel/transformation/transformers/es6/block-scoping.js b/src/babel/transformation/transformers/es6/block-scoping.js index <HASH>..<HASH> 100644 --- a/src/babel/transformation/transformers/es6/block-scoping.js +++ b/src/babel/transformation/transformers/es6/block-scoping.js @@ -139,7 +139,12 @@ var hoistVarDeclarationsVisitor = { enter(node, parent, scope, self) { if (this.isForStatement()) { if (isVar(node.init, node)) { - node.init = t.sequenceExpression(self.pushDeclar(node.init)); + var nodes = self.pushDeclar(node.init); + if (nodes.length === 1) { + node.init = nodes[0]; + } else { + node.init = t.sequenceExpression(nodes); + } } } else if (this.isFor()) { if (isVar(node.left, node)) {
don't rely on sequence expressions for <= 1 sequence expressions in blockScoping transformer
babel_babel
train
js
d0a8980eb3853b02c3bb2611b633931f712107cd
diff --git a/container.go b/container.go index <HASH>..<HASH> 100644 --- a/container.go +++ b/container.go @@ -316,7 +316,7 @@ type PidLimits struct { // Limits the number of pids a container may create before new forks or clones are disallowed to processes in the container. // Note: this may only be enforced when a process attempts to fork, so it does not guarantee that a new container.Run(ProcessSpec) // will not succeed even if the limit has been exceeded, but the process will not be able to spawn further processes or threads. - Limit uint64 `json:"limit,omitempty"` + Max uint64 `json:"max,omitempty"` } // Resource limits.
Rename pid limit * Max better represents what type of limit is being applied [#<I>]
cloudfoundry_garden
train
go
cb33b0fab7f8864998b2c3db0f9e7ff85c1c0965
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,8 @@ from setuptools import setup +with open('requirements.txt', 'r') as f: + requirements = [line.strip() for line in f] + packages = ["qiskit", "qiskit.backends", "qiskit.dagcircuit", @@ -14,16 +17,6 @@ packages = ["qiskit", "qiskit.tools.qcvv", "qiskit.tools.qi"] -requirements = ["IBMQuantumExperience>=1.8.13", - "requests>=2.18,<2.19", - "networkx>=1.11,<1.12", - "ply==3.10", - "numpy>=1.13,<1.14", - "scipy>=0.19,<0.20", - "matplotlib>=2.0,<2.1", - "sphinx>=1.6,<1.7", - "sympy>=1.0"] - setup( name="qiskit", version="0.4.0",
Issue <I> - One entry point for requirements (#<I>)
Qiskit_qiskit-terra
train
py
3ad0af570af1a2fdd8db4926b8b36617cb425921
diff --git a/download.js b/download.js index <HASH>..<HASH> 100644 --- a/download.js +++ b/download.js @@ -238,12 +238,14 @@ function getFilesSizes() { getFilesSizes(); function getFileContents(filepath) { - return new Promise(function(resolve) { + return new Promise(function(resolve, reject) { $u.xhr({ url: filepath, callback: function(xhr) { if (xhr.status < 400) { resolve(xhr.responseText); + } else { + reject(); } } }); @@ -350,6 +352,7 @@ function generateCode(){ promises.push({ contentsPromise: cache[path].contentsPromise, + path: path, type: type }); } @@ -389,6 +392,11 @@ function buildCode(promises) { i++; f(resolve); }); + p.contentsPromise['catch'](function() { + code[p.type] += '/* Error downloading file '+p.path+' */' + '\n'; + i++; + f(resolve); + }); } else { resolve(code); }
Reject promise if file does not exist
PrismJS_prism
train
js
c803e68687755974c2226a925695c9c886958d3a
diff --git a/buildozer/__init__.py b/buildozer/__init__.py index <HASH>..<HASH> 100644 --- a/buildozer/__init__.py +++ b/buildozer/__init__.py @@ -342,8 +342,8 @@ class Buildozer(object): else: stderr.write(chunk) - stdout.flush() - stderr.flush() + stdout.flush() + stderr.flush() process.communicate() if process.returncode != 0 and break_on_error:
Made sure to print all lines of license question by always flushing
kivy_buildozer
train
py
dd75d8a005f24b234fe386ed69033c797d5e9b10
diff --git a/js/server/Connection.js b/js/server/Connection.js index <HASH>..<HASH> 100644 --- a/js/server/Connection.js +++ b/js/server/Connection.js @@ -26,7 +26,6 @@ exports = Class(net.protocols.rtjp.RTJPProtocol, function(supr) { this._clientConnected = false // TODO do we need to unsubscribe from redis channels? this._redisClient.close() - delete this._redisClient } this.getId = function() { return this._id }
Don't delete the redis client, since it seems like the closing of the connection can be called multiple times
marcuswestin_fin
train
js
371ea25f1a1efe772ded3bbcdb15dbef9ab8ef33
diff --git a/active-sync.js b/active-sync.js index <HASH>..<HASH> 100644 --- a/active-sync.js +++ b/active-sync.js @@ -52,7 +52,6 @@ ActiveSync.prototype = { onConnect: function onConnect () { BaseSync.prototype.onConnect.apply(this, arguments) this.sendConnect() - this.syncSince(this.synced) } } diff --git a/messages/connect.js b/messages/connect.js index <HASH>..<HASH> 100644 --- a/messages/connect.js +++ b/messages/connect.js @@ -31,6 +31,7 @@ module.exports = { if (this.options.fixTime) this.connectSended = this.log.timer()[0] this.startTimeout() this.send(message) + this.syncSince(this.synced) }, sendConnected: function sendConnected (start, end) {
Move first sync after connect message to BaseSync
logux_core
train
js,js
dfec859048b1f505ae301ee919e2a41fd8194583
diff --git a/src/Http/Client.php b/src/Http/Client.php index <HASH>..<HASH> 100644 --- a/src/Http/Client.php +++ b/src/Http/Client.php @@ -4,7 +4,7 @@ namespace PeterColes\Betfair\Http; use Exception; use GuzzleHttp\Client as GuzzleClient; -use GuzzleHttp\Psr7\Response; +use Psr\Http\Message\ResponseInterface; use PeterColes\Betfair\Api\Auth; use stdClass; @@ -313,23 +313,12 @@ class Client } /** - * Get status code from http response. - * - * @param Response $response - * @return integer - */ - protected function getStatus(Response $response) - { - return (int) $response->getStatusCode(); - } - - /** * Get http response body, cast to json and decode. * - * @param Response $response + * @param ResponseInterface $response * @return array */ - protected function getBody(Response $response) + protected function getBody(ResponseInterface $response) { return json_decode((string) $response->getBody()); }
remove redundant method and type hint to interface rather than concrete implementation
petercoles_Betfair-Exchange
train
php
db4edfacdf6cfa02a3f172a52ecbe8a85decf591
diff --git a/res/middleware/consoler.js b/res/middleware/consoler.js index <HASH>..<HASH> 100644 --- a/res/middleware/consoler.js +++ b/res/middleware/consoler.js @@ -1,4 +1,4 @@ -<script type="text/javascript" src="/socket.io/socket.io.js"></script> +<script type="text/javascript" src="http://127.0.0.1:3000/socket.io/socket.io.js"></script> <script type="text/javascript"> (function(window) { var socket = io('http://127.0.0.1:3000');
[#<I>] Fix console to load the client socket library.
phonegap_connect-phonegap
train
js
84afbc91aa25e9ba275b9ea1f4309b59908f9de1
diff --git a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java +++ b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java @@ -261,7 +261,7 @@ public class ORecordSerializerJSON extends ORecordSerializerStringAbstract { // SET THE OWNER ((ODocument) collectionItem).addOwner(iRecord); - if (collectionItem instanceof String && ((String) collectionItem).length() > 0) + if (collectionItem instanceof String && ((String) collectionItem).length() == 0) continue; ((Collection<Object>) embeddedCollection).add(collectionItem);
Problem with JSON string array deserialization was fixed.
orientechnologies_orientdb
train
java