text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix super call for Python 2.7
import json from django import forms from .models import PublicBody class PublicBodySelect(forms.Widget): input_type = "text" template_name = 'publicbody/_chooser.html' initial_search = None class Media: extend = False js = ('js/publicbody.js',) def set_initial_search(self, sea...
import json from django import forms from .models import PublicBody class PublicBodySelect(forms.Widget): input_type = "text" template_name = 'publicbody/_chooser.html' initial_search = None class Media: extend = False js = ('js/publicbody.js',) def set_initial_search(self, sea...
Fix custom collection comparison matcher
customMatchers = { toEqualCollection : function(util, customEqualityTesters) { return { compare : function(actual, expected) { var result = {}; var actualArray = _.toArray(actual); var expectedArray = expected.find({}).fetch(); result.pass = util.equals(actualArray, expectedA...
customMatchers = { toEqualCollection : function(util, customEqualityTesters) { return { compare : function(actual, expected) { var result = {}; var expectedArray = expected.find({}).fetch(); result.pass = util.equals(actual, expectedArray, customEqualityTesters); return resul...
Fix check for Wells/Calabretta convention
from __future__ import absolute_import def check(header, convention=None, dimensions=[0, 1]): ix = dimensions[0] + 1 iy = dimensions[1] + 1 ctypex = header['CTYPE%i' % ix] crvaly = header['CRVAL%i' % iy] # Check for CRVAL2!=0 for CAR projection if ctypex[4:] == '-CAR' and crvaly != 0: ...
from __future__ import absolute_import def check(header, convention=None, dimensions=[0, 1]): ix = dimensions[0] + 1 iy = dimensions[1] + 1 ctypex = header['CTYPE%i' % ix] crvaly = header['CRVAL%i' % iy] crpixy = header['CRPIX%i' % iy] cdelty = header['CDELT%i' % iy] # Check for CRVAL2!...
Fix bug where list rows are not cleaned up
var _ = require('lodash'); module.exports = function($templateRequest, $compile, $interpolate) { typeCounts = {}; return { restrict: 'E', link: function($scope, $element, $attrs) { var type = $scope.type, newScope = $scope.$new(); var templates = [ ...
var _ = require('lodash'); module.exports = function($templateRequest, $compile, $interpolate) { typeCounts = {}; return { restrict: 'E', link: function($scope, $element, $attrs) { var type = $scope.type, newScope = $scope.$new(); var templates = [ ...
Change the topic name used in the test
require('./harness'); var testName = __filename.replace(__dirname+'/','').replace('.js',''); connection.addListener('ready', function () { puts("connected to " + connection.serverProperties.product); var callbacksCalled = 0; connection.exchange('node.'+testName+'.exchange', {type: 'topic'}, function(e...
require('./harness'); var testName = __filename.replace(__dirname+'/','').replace('.js',''); connection.addListener('ready', function () { puts("connected to " + connection.serverProperties.product); var callbacksCalled = 0; connection.exchange('node.'+testName+'.exchange', {type: 'topic'}, function(e...
Fix deprecation warning in Java unit test
package com.genymobile.scrcpy; import org.junit.Assert; import org.junit.Test; import java.nio.charset.StandardCharsets; public class StringUtilsTest { @Test @SuppressWarnings("checkstyle:MagicNumber") public void testUtf8Truncate() { String s = "aÉbÔc"; byte[] utf8 = s.getBytes(Standard...
package com.genymobile.scrcpy; import junit.framework.Assert; import org.junit.Test; import java.nio.charset.StandardCharsets; public class StringUtilsTest { @Test @SuppressWarnings("checkstyle:MagicNumber") public void testUtf8Truncate() { String s = "aÉbÔc"; byte[] utf8 = s.getBytes(S...
Fix masonry item alignment issue
import React from 'react'; import { StyleSheet, View, Text, Image } from 'react-native'; import { SharedElementTransition } from 'react-native-navigation'; const SHOW_DURATION = 240; const HIDE_DURATION = 200; class Item extends React.Component { static navigatorStyle = { navBarHidden: true, draw...
import React from 'react'; import { StyleSheet, View, Text, Image } from 'react-native'; import { SharedElementTransition } from 'react-native-navigation'; const SHOW_DURATION = 240; const HIDE_DURATION = 200; class Item extends React.Component { static navigatorStyle = { navBarHidden: true, draw...
FIX redirect to checkout after guest login
var ValidationService = require("services/ValidationService"); var ApiService = require("services/ApiService"); Vue.component("guest-login", { props: [ "template" ], data: function() { return { email: "" }; }, created: function() { this.$option...
var ValidationService = require("services/ValidationService"); var ApiService = require("services/ApiService"); Vue.component("guest-login", { props: [ "template" ], data: function() { return { email: "" }; }, created: function() { this.$option...
Refresh layout header on login-changed event Refresh layout header on login-changed event so that the header correctly shows the logged-in user when following an invitation link.
isic.views.LayoutHeaderView = isic.View.extend({ events: { 'mouseenter .dropdown': function (event) { $(event.currentTarget).addClass('open'); }, 'mouseleave .dropdown': function (event) { $(event.currentTarget).removeClass('open'); }, 'click .dropdown...
isic.views.LayoutHeaderView = isic.View.extend({ events: { 'mouseenter .dropdown': function (event) { $(event.currentTarget).addClass('open'); }, 'mouseleave .dropdown': function (event) { $(event.currentTarget).removeClass('open'); }, 'click .dropdown...
Use MediaType instead of user-written string
package <%=packageName%>.web.rest; import <%=packageName%>.security.AuthoritiesConstants; import <%=packageName%>.service.AuditEventService; import <%=packageName%>.web.propertyeditors.LocaleDateTimeEditor; import org.joda.time.LocalDateTime; import org.springframework.boot.actuate.audit.AuditEvent; import org.springf...
package <%=packageName%>.web.rest; import <%=packageName%>.security.AuthoritiesConstants; import <%=packageName%>.service.AuditEventService; import <%=packageName%>.web.propertyeditors.LocaleDateTimeEditor; import org.joda.time.LocalDateTime; import org.springframework.boot.actuate.audit.AuditEvent; import org.springf...
Fix bug that dropped RSS item titles
"use strict"; var components = require("server-components"); var truncateHtml = require("truncate-html"); var moment = require("moment"); var feedparser = require('feedparser-promised'); var cache = require("memory-cache"); function getRss(url) { var cachedResult = cache.get(url); if (cachedResult) return P...
"use strict"; var components = require("server-components"); var truncateHtml = require("truncate-html"); var moment = require("moment"); var feedparser = require('feedparser-promised'); var cache = require("memory-cache"); function getRss(url) { var cachedResult = cache.get(url); if (cachedResult) return P...
Add getFirst method to customers service (saas-185)
'use strict'; (function() { angular.module('ncsaas') .service('customersService', ['RawCustomer', customersService]); function customersService(RawCustomer) { /*jshint validthis: true */ var vm = this; vm.getCustomersList = getCustomersList; vm.createCustomer = createCustomer; vm.getCustom...
'use strict'; (function() { angular.module('ncsaas') .service('customersService', ['RawCustomer', customersService]); function customersService(RawCustomer) { /*jshint validthis: true */ var vm = this; vm.getCustomersList = getCustomersList; vm.createCustomer = createCustomer; vm.getCustom...
Fix unset type_options in list form_filters config
<?php declare(strict_types=1); namespace AlterPHP\EasyAdminExtensionBundle\Helper; use Symfony\Component\Form\FormFactory; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\RequestStack; /** * This file is part of the EasyAdmin Extension package. */ class ListFormFiltersHelper { /...
<?php declare(strict_types=1); namespace AlterPHP\EasyAdminExtensionBundle\Helper; use Symfony\Component\Form\FormFactory; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\RequestStack; /** * This file is part of the EasyAdmin Extension package. */ class ListFormFiltersHelper { /...
Change func_code to __code__ to work with python 3
import inspect from . import fields from .utils import fn_name_to_pretty_description class BaseActions(object): """ Classes that hold a collection of actions to use with the rules engine should inherit from this. """ @classmethod def get_all_actions(cls): methods = inspect.getmembers(cls)...
import inspect from . import fields from .utils import fn_name_to_pretty_description class BaseActions(object): """ Classes that hold a collection of actions to use with the rules engine should inherit from this. """ @classmethod def get_all_actions(cls): methods = inspect.getmembers(cls)...
Update lock should be last
'use strict'; angular.module('repicbro.services') .factory('PostsManager', function ($rootScope, Posts) { var posts = [], current = null, index = 0, latest = '', updating = false; var broadcastCurrentUpdate = function (current) { $rootScope.$broadcast('PostsManager.Cur...
'use strict'; angular.module('repicbro.services') .factory('PostsManager', function ($rootScope, Posts) { var posts = [], current = null, index = 0, latest = '', updating = false; var broadcastCurrentUpdate = function (current) { $rootScope.$broadcast('PostsManager.Cur...
Add additional check for count
<?php /* * This file is part of Mannequin. * * (c) 2017 Last Call Media, Rob Bayliss <rob@lastcallmedia.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace LastCall\Mannequin\Drupal\Drupal; use Drupal\Core\Template\TwigTransTokenPar...
<?php /* * This file is part of Mannequin. * * (c) 2017 Last Call Media, Rob Bayliss <rob@lastcallmedia.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace LastCall\Mannequin\Drupal\Drupal; use Drupal\Core\Template\TwigTransTokenPar...
Use division_id in place of bounary_id
import os import logging import unicodecsv from billy.core import settings, db from billy.bin.commands import BaseCommand logger = logging.getLogger('billy') class LoadDistricts(BaseCommand): name = 'loaddistricts' help = 'Load in the Open States districts' def add_args(self): self.add_argument...
import os import logging import unicodecsv from billy.core import settings, db from billy.bin.commands import BaseCommand logger = logging.getLogger('billy') class LoadDistricts(BaseCommand): name = 'loaddistricts' help = 'Load in the Open States districts' def add_args(self): self.add_argument...
Allow the callback parameter name to be changed in the constructor. Signed-off-by: Jason Lewis <b136be6b8ecc2c62ceb9857ec62bf85489a45e0c@gmail.com>
<?php namespace Dingo\Api\Http\ResponseFormat; class JsonpResponseFormat extends JsonResponseFormat { /** * Name of JSONP callback paramater. * * @var string */ protected $callbackName = 'callback'; /** * Create a new JSONP response formatter instance. * * @param string...
<?php namespace Dingo\Api\Http\ResponseFormat; class JsonpResponseFormat extends JsonResponseFormat { /** * Name of JSONP callback paramater. * * @var string */ protected $callbackName = 'callback'; /** * Determine if a callback is valid. * * @return bool */ pro...
Allow canary build to fail for now (embroider compatibility issue)
'use strict'; const getChannelURL = require('ember-source-channel-url'); module.exports = async function () { return { useYarn: true, scenarios: [ { name: 'ember-release', npm: { devDependencies: { 'ember-source': await getChannelURL('release'), }, ...
'use strict'; const getChannelURL = require('ember-source-channel-url'); module.exports = async function () { return { useYarn: true, scenarios: [ { name: 'ember-release', npm: { devDependencies: { 'ember-source': await getChannelURL('release'), }, ...
Add hold all function to dicebag
import random class Die(object): def __init__(self, sides = 6): self.sides = sides self.held = False self.die_face = 1 def change_held(self, held): self.held = held def roll_die(self): if (self.held == False): self.die_face = random.randint(1, self.sides) ...
import random class Die(object): def __init__(self, sides = 6): self.sides = sides self.held = False self.die_face = 1 def change_held(self, held): self.held = held def roll_die(self): if (self.held == False): self.die_face = random.randint(1, self.sides) ...
Fix Sauce Labs username and key
var util = require('util'); var request = require('superagent'); module.exports = { local: { dontReportSauceLabs: true }, reporter: function(results, done) { var passed = results.failed === 0 && results.errors === 0; console.log('Final result: "{ passed: ' + passed + ' }"'); ...
var util = require('util'); var request = require('superagent'); module.exports = { local: { dontReportSauceLabs: true }, reporter: function(results, done) { var passed = results.failed === 0 && results.errors === 0; console.log('Final result: "{ passed: ' + passed + ' }"'); ...
Update installer autocreate for games with no icon
import json from django.core.management.base import BaseCommand from games import models from accounts.models import User class Command(BaseCommand): def handle(self, *args, **options): with open("steamdb.json") as steamdb_file: steamdb = json.loads(steamdb_file.read()) steam_runner = ...
import json from django.core.management.base import BaseCommand from games import models from accounts.models import User class Command(BaseCommand): def handle(self, *args, **options): with open("steamdb.json") as steamdb_file: steamdb = json.loads(steamdb_file.read()) steam_runner = ...
Change docstrings and function names.
#!/usr/bin/env python # -*- coding: utf-8 -*- # (C) 2015 Jean Nassar # Released under BSD version 4 """ Reduce /ardrone/image_raw framerate from 30 Hz to 2 Hz. """ import rospy from sensor_msgs.msg import Image class ImageFeature(object): """ A ROS image Publisher/Subscriber. """ def __init__(self)...
#!/usr/bin/env python # -*- coding: utf-8 -*- # (C) 2015 Jean Nassar # Released under BSD version 4 """ Reduce /ardrone_camera framerate to 2 Hz. """ import rospy from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError class ImageFeature(object): """ A ROS image Publisher/Subscriber....
Call the callback if the credential isn't found.
const fs = require('fs'); const passport = require('passport'); const JWTStrategy = require('passport-jwt').Strategy; const extractors = require('./extractors'); const services = require('../../services'); module.exports = function (params) { const secretOrKey = params.secretOrPubKeyFile ? fs.readFileSync(params.sec...
const fs = require('fs'); const passport = require('passport'); const JWTStrategy = require('passport-jwt').Strategy; const extractors = require('./extractors'); const services = require('../../services'); module.exports = function (params) { const secretOrKey = params.secretOrPubKeyFile ? fs.readFileSync(params.sec...
Fix first functional test class
<?php namespace Bolt\Extension\Leskis\BoltSendEmailForNewContent\Tests; use Bolt\Tests\BoltUnitTest; use Bolt\Extension\Leskis\BoltSendEmailForNewContent\BoltSendEmailForNewContentExtension; /** * BoltSendEmailForNewContent testing class. * * @author Nicolas Béhier-Dévigne */ class ExtensionTest extends BoltUnit...
<?php namespace Bolt\Extension\Leskis\BoltFieldGeojson\Tests; use Bolt\Tests\BoltUnitTest; use Bolt\Extension\Leskis\BoltFieldGeojson\BoltFieldGeojsonExtension; /** * BoltFieldGeojson testing class. * * @author Nicolas Béhier-Dévigne */ class ExtensionTest extends BoltUnitTest { /** * Ensure that the Bo...
Fix copy/pasta mistake and use ID from configuration yaml
<?php namespace Grav\Plugin; use Grav\Common\Plugin; class Pingdom_RUMPlugin extends Plugin { /** * @return array */ public static function getSubscribedEvents() { return [ 'onAssetsInitialized' => ['onAssetsInitialized', 0] ]; } /** * Add GoSquared JS in ...
<?php namespace Grav\Plugin; use Grav\Common\Plugin; class Pingdom_RUMPlugin extends Plugin { /** * @return array */ public static function getSubscribedEvents() { return [ 'onAssetsInitialized' => ['onAssetsInitialized', 0] ]; } /** * Add GoSquared JS in ...
Fix misconfiguration in static root path computation
import os AUTOCLAVE_APP_NAME = "autoclave" AUTOCLAVE_USER_NAME = AUTOCLAVE_APP_NAME AUTOCLAVE_DEPLOY_ROOT = os.path.join("/opt", AUTOCLAVE_APP_NAME) AUTOCLAVE_DEPLOY_SRC_ROOT = os.path.join(AUTOCLAVE_DEPLOY_ROOT, "src") AUTOCLAVE_API_ROOT ...
import os AUTOCLAVE_APP_NAME = "autoclave" AUTOCLAVE_USER_NAME = AUTOCLAVE_APP_NAME AUTOCLAVE_DEPLOY_ROOT = os.path.join("/opt", AUTOCLAVE_APP_NAME) AUTOCLAVE_DEPLOY_SRC_ROOT = os.path.join(AUTOCLAVE_DEPLOY_ROOT, "src") AUTOCLAVE_API_ROOT ...
Fix typo in field name
import twitter from django.core.management.base import BaseCommand from django.conf import settings from core.models import Tweet class Command(BaseCommand): help = "Send out tweets." def handle(self, *args, **options): for tweet in Tweet.objects.filter(was_sent=False, failed_trials__lte=5): ...
import twitter from django.core.management.base import BaseCommand from django.conf import settings from core.models import Tweet class Command(BaseCommand): help = "Send out tweets." def handle(self, *args, **options): for tweet in Tweet.objects.filter(was_sent=False, failed_trails__lte=5): ...
Add extra condition to show "user joined" notification If you open the page and without clicking anything you go to other app, then you won't get the notification => I don't know how to solve this. If you open the page and without clicking anything you go to other tab, then you won't get the notification => It should...
const push = require('push.js'); angular.module('opentok-meet').factory('Push', () => push); angular.module('opentok-meet').factory('NotificationService', ['$window', 'OTSession', 'Push', function NotificationService($window, OTSession, Push) { let focused = true; $window.addEventListener('blur', () => { ...
const push = require('push.js'); angular.module('opentok-meet').factory('Push', () => push); angular.module('opentok-meet').factory('NotificationService', ['$window', 'OTSession', 'Push', function NotificationService($window, OTSession, Push) { let focused = true; $window.addEventListener('blur', () => { ...
Add extend_list method to OratioIgnoreParser To make oratioignoreparser.py easily testable using unit tests.
import os import re class OratioIgnoreParser(): def __init__(self): self.ignored_paths = ["oratiomodule.tar.gz"] def load(self, oratio_ignore_path): with open(oratio_ignore_path, "r") as f: self.ignored_paths.extend([line.strip() for line in f]) def extend_list(self, ignored_...
import os import re class OratioIgnoreParser(): def __init__(self): self.ignored_paths = ["oratiomodule.tar.gz"] def load(self, oratio_ignore_path): with open(oratio_ignore_path, "r") as f: self.ignored_paths.extend([line.strip() for line in f]) def should_be_ignored(self, fi...
ADD auto submit after select search
/** * Created by sylva on 30/05/2017. */ $(document).ready(function () { $('#lastFMSearch').autocomplete({ source: function( request, response ) { $.ajax({ url: "https://ws.audioscrobbler.com/2.0/?method=artist.search&artist="+$('#lastFMSearch').val()+"&api_key=f6734ae2b988748...
/** * Created by sylva on 30/05/2017. */ $(document).ready(function () { $('#lastFMSearch').autocomplete({ source: function( request, response ) { $.ajax({ url: "https://ws.audioscrobbler.com/2.0/?method=artist.search&artist="+$('#lastFMSearch').val()+"&api_key=f6734ae2b988748...
Add support for monitor deletion
# # Copyright (c) 2014 NSONE, Inc. # # License under The MIT License (MIT). See LICENSE in project root. # from . import resource class Monitors(resource.BaseResource): ROOT = 'monitoring/jobs' PASSTHRU_FIELDS = ['name', 'config'] def list(self, callback=None, errback=None): return self._make_re...
# # Copyright (c) 2014 NSONE, Inc. # # License under The MIT License (MIT). See LICENSE in project root. # from . import resource class Monitors(resource.BaseResource): ROOT = 'monitoring/jobs' PASSTHRU_FIELDS = ['name', 'config'] def list(self, callback=None, errback=None): return self._make_re...
Use context.unload instead of controller.unload
var TextInput, TextArea (function() { var factory = function(tag) { return { controller: function(args) { var oldValue, element, composing, setComposing = function() { composing = true }, resetComposing = function() { composing = false }, ...
var TextInput, TextArea (function() { var factory = function(tag) { return { controller: function(args) { var oldValue, element, composing, setComposing = function() { composing = true }, resetComposing = function() { composing = false }, ...
Exit with 1 if there's a difference
from __future__ import print_function import argparse import sys from . import diff RED = '\033[1;31m' GREEN = '\033[1;32m' END = '\033[0m' def format_option(opt): """Return a formatted option in the form name=value.""" return '{}={}\n'.format(opt.option, opt.value) def format_output(first, second, colo...
from __future__ import print_function from . import diff import argparse RED = '\033[1;31m' GREEN = '\033[1;32m' END = '\033[0m' def format_option(opt): """Return a formatted option in the form name=value.""" return '{}={}\n'.format(opt.option, opt.value) def format_output(first, second, color=True): ...
Change value to c to make figuring out its HTML less confusing.
$(document).ready(function() { var data = {}; $('#testform').render({ ifaces: ['viewform'], form: { widgets: [ { ifaces: ['composite_field'], name: 'composite', widgets: [ {...
$(document).ready(function() { var data = {}; $('#testform').render({ ifaces: ['viewform'], form: { widgets: [ { ifaces: ['composite_field'], name: 'composite', widgets: [ {...
Fix but with reset always triggering
let videoImage = document.getElementById('video_image'); videoImage.src = `http://${document.domain}:8080/?action=stream`; let cameraJoystick = { zone: videoImage, color: 'red' }; let cameraJoystickManager = nipplejs.create(cameraJoystick); const clickTimeout = 500; var lastStartClick = Date.now(); cameraJoyst...
let videoImage = document.getElementById('video_image'); videoImage.src = `http://${document.domain}:8080/?action=stream`; let cameraJoystick = { zone: videoImage, color: 'red' }; let cameraJoystickManager = nipplejs.create(cameraJoystick); const clickTimeout = 500; var lastStartClick = Date.now(); cameraJoyst...
Remove debug printing from test case
import os from xml.etree import ElementTree from utils import with_app, pretty_print_xml #============================================================================= # Tests @with_app(buildername="xml", srcdir="basics") def test_basics(app, status, warning): app.build() tree = ElementTree.pars...
import os from xml.etree import ElementTree from utils import with_app, pretty_print_xml #============================================================================= # Tests @with_app(buildername="xml", srcdir="basics") def test_basics(app, status, warning): app.build() tree = ElementTree.pars...
Remove odata part in the accept - Office365 is not happy
<?php /** * This file is part of the CalendArt package * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. * * @copyright Wisembly * @license http://www.opensource.org/licenses/MIT-License MIT License */ namespace CalendArt\Adapter\Of...
<?php /** * This file is part of the CalendArt package * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. * * @copyright Wisembly * @license http://www.opensource.org/licenses/MIT-License MIT License */ namespace CalendArt\Adapter\Of...
Fix default sidebar search label.
<div id="sidebar"> <div id="leftbar"> <div class="sidebartext"> <ul> <?php if (!dynamic_sidebar("Footer Left")) { ?> <li><ul><?php wp_list_bookmarks(); ?></ul></li> <li> <h2>Meta</h2> <?php wp...
<div id="sidebar"> <div id="leftbar"> <div class="sidebartext"> <ul> <?php if (!dynamic_sidebar("Footer Left")) { ?> <li><ul><?php wp_list_bookmarks(); ?></ul></li> <li> <h2>Meta</h2> <?php wp...
Fix Route Declaration of Settings
<?php namespace LaravelFlare\Settings; use Illuminate\Routing\Router; use LaravelFlare\Flare\Admin\Modules\ModuleAdmin; class SettingsModule extends ModuleAdmin { /** * Admin Section Icon. * * Font Awesome Defined Icon, eg 'user' = 'fa-user' * * @var string */ protected $icon = ...
<?php namespace LaravelFlare\Settings; use Illuminate\Routing\Router; use LaravelFlare\Flare\Admin\Modules\ModuleAdmin; class SettingsModule extends ModuleAdmin { /** * Admin Section Icon. * * Font Awesome Defined Icon, eg 'user' = 'fa-user' * * @var string */ protected $icon = ...
Use the github repo as the project url
import codecs from os import path from setuptools import find_packages, setup def read(*parts): filename = path.join(path.dirname(__file__), *parts) with codecs.open(filename, encoding="utf-8") as fp: return fp.read() setup( author="Pinax Team", author_email="team@pinaxproject.com", des...
import codecs from os import path from setuptools import find_packages, setup def read(*parts): filename = path.join(path.dirname(__file__), *parts) with codecs.open(filename, encoding="utf-8") as fp: return fp.read() setup( author="Pinax Team", author_email="team@pinaxproject.com", des...
Remove Box wrapping List component
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP import React, { Component, PropTypes } from 'react'; import classnames from 'classnames'; import List from './List'; import CSSClassnames from '../utils/CSSClassnames'; const CLASS_ROOT = CSSClassnames.ACCORDION; export default class Accordion ext...
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP import React, { Component, PropTypes } from 'react'; import classnames from 'classnames'; import Box from './Box'; import List from './List'; import CSSClassnames from '../utils/CSSClassnames'; const CLASS_ROOT = CSSClassnames.ACCORDION; export de...
Make the digestion of the google geo result standardized
angular .module('app') .factory('googleMapsService', ['$rootScope', '$q', function($rootScope, $q) { var methods = {}; methods.geo = function(address, type) { var geocoder = new google.maps.Geocoder(); var geoData = {}; var han...
angular .module('app') .factory('googleMapsService', ['$rootScope', '$q', function($rootScope, $q) { /* // Load the Google Maps scripts Asynchronously (function(d){ var js, id = 'google-maps', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} ...
Allow null as defining class.
/* * Copyright (C) 2008, 2010 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICENSE.txt file. * * Created on 13. October 2008 by Joerg Schaible */ package com....
/* * Copyright (C) 2008 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICENSE.txt file. * * Created on 13. October 2008 by Joerg Schaible */ package com.though...
Create commands for labextension and nbextension
from setuptools import setup from setupbase import create_cmdclass, install_npm cmdclass = create_cmdclass(['labextension', 'nbextension']) cmdclass['labextension'] = install_npm('labextension') cmdclass['nbextension'] = install_npm('nbextension') setup_args = dict( name = '{{cookiecutter.extensio...
from setuptools import setup from setupbase import create_cmdclass, install_npm cmdclass = create_cmdclass(['js']) cmdclass['js'] = install_npm() setup_args = dict( name = '{{cookiecutter.extension_name}}', version = '0.18.0', packages = ['{{cookiecutter.extension_...
Replace string.trimEnd with string.trimRight for Node 8.
// @ts-check "use strict"; const { addErrorContext, isBlankLine } = require("../helpers"); const { flattenedLists } = require("./cache"); const quotePrefixRe = /^[>\s]*/; module.exports = { "names": [ "MD032", "blanks-around-lists" ], "description": "Lists should be surrounded by blank lines", "tags": [ "bull...
// @ts-check "use strict"; const { addErrorContext, isBlankLine } = require("../helpers"); const { flattenedLists } = require("./cache"); const quotePrefixRe = /^[>\s]*/; module.exports = { "names": [ "MD032", "blanks-around-lists" ], "description": "Lists should be surrounded by blank lines", "tags": [ "bull...
Add simple test for coverage.
""" Tests utility scripts """ import os from django.test import TestCase, RequestFactory from django.test.utils import override_settings import pivot from pivot.utils import get_latest_term, is_more_recent from pivot.templatetags.pivot_extras import year_select_tab TEST_CSV_PATH = os.path.join(os.path.dirname(pivot...
""" Tests utility scripts """ import os from django.test import TestCase, RequestFactory from django.test.utils import override_settings import pivot from pivot.utils import get_latest_term, is_more_recent from pivot.templatetags.pivot_extras import year_select_tab TEST_CSV_PATH = os.path.join(os.path.dirname(pivot...
Add Helper singleton class for querying/adding notification to db.
package org.zeropage.apps.zeropage.database.notification; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import org.zeropage.apps.zeropage.notification.Notification; import java.util.ArrayList; import java.util.List...
package org.zeropage.apps.zeropage.database.notification; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import org.zeropage.apps.zeropage.notification.Notification; import java.util.ArrayList; import java.util.List...
Fix for angular-jwt injecting authorization header
'use strict'; angular.module('mean.admin').controller('ThemesController', ['$scope', 'Global', '$rootScope', '$http', function($scope, Global, $rootScope, $http) { $scope.global = Global; $scope.themes = []; $scope.init = function() { $http({ method: 'GET', ...
'use strict'; angular.module('mean.admin').controller('ThemesController', ['$scope', 'Global', '$rootScope', '$http', function($scope, Global, $rootScope, $http) { $scope.global = Global; $scope.themes = []; $scope.init = function() { $http({ method: 'GET', ...
Fix for 'CreateListFromArrayLike called on non-object'
if (!window['$']) var $ = function a(){} (function a(){ $.get('https://api.github.com/repos/KaMeHb-UA/LeNode/releases/latest', function(data, status){ if (status != 'success') a(); else { $('a[rel="download"]').attr('href', data.assets[0].browser_download_url); $('#latest-version').h...
if (!window['$']) var $ = function a(){} (function a(){ $.get('https://api.github.com/repos/KaMeHb-UA/LeNode/releases/latest', function(data, status){ if (status != 'success') a(); else { $('a[rel="download"]').attr('href', data.assets[0].browser_download_url); $('#latest-version').h...
Update URL for new cross-platform endpoint
const autoUpdater = require('electron').autoUpdater const Menu = require('electron').Menu var state = 'checking' exports.initialize = function () { autoUpdater.on('checking-for-update', function () { state = 'checking' exports.updateMenu() }) autoUpdater.on('update-available', function () { state =...
const autoUpdater = require('electron').autoUpdater const Menu = require('electron').Menu var state = 'checking' exports.initialize = function () { autoUpdater.on('checking-for-update', function () { state = 'checking' exports.updateMenu() }) autoUpdater.on('update-available', function () { state =...
Fix first id being 0
<?php namespace Backend\Modules\ContentBlocks\ContentBlock; use Backend\Core\Language\Locale; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query; class ContentBlockRepository extends EntityRepository { /** * @param Locale $locale * * @return Query */ public function getDataGridQuer...
<?php namespace Backend\Modules\ContentBlocks\ContentBlock; use Backend\Core\Language\Locale; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query; class ContentBlockRepository extends EntityRepository { /** * @param Locale $locale * * @return Query */ public function getDataGridQuer...
Fix dropdown width in adresses settings
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { msgid, c } from 'ttag'; import { SimpleDropdown, DropdownMenu } from 'react-components'; const MemberAddresses = ({ member, addresses }) => { const list = addresses.map(({ ID, Email }) => ( <div...
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { msgid, c } from 'ttag'; import { SimpleDropdown, DropdownMenu } from 'react-components'; const MemberAddresses = ({ member, addresses }) => { const list = addresses.map(({ ID, Email }) => ( <div...
LB-1458: Check on admin all POST, PUT, DELETE URLs to use my Cleared a console.log
define([ 'angular', 'lib/livedesk/scripts/js/manage-feeds/manage-feeds', 'lib/livedesk/scripts/js/manage-feeds/services/providers-blogs-data', 'lib/livedesk/scripts/js/manage-feeds/services/all-blog-sources' ],function(ngular, feeds){ feeds.factory('chainedBlogsData', ['$http', '$q','providersBlogsData'...
define([ 'angular', 'lib/livedesk/scripts/js/manage-feeds/manage-feeds', 'lib/livedesk/scripts/js/manage-feeds/services/providers-blogs-data', 'lib/livedesk/scripts/js/manage-feeds/services/all-blog-sources' ],function(ngular, feeds){ feeds.factory('chainedBlogsData', ['$http', '$q','providersBlogsData'...
Extend tabs to allow callbacks for unrouted tab navigation
import classNames from 'classnames/dedupe'; import {Link} from 'react-router'; import React from 'react'; class PageHeaderTabs extends React.Component { render() { let {props: {tabs}} = this; let tabElements = tabs.map(function (tab, index) { let {isActive, callback} = tab; let classes = classNa...
import classNames from 'classnames/dedupe'; import {Link} from 'react-router'; import React from 'react'; class PageHeaderTabs extends React.Component { render() { let {props: {tabs}} = this; let tabElements = tabs.map(function (tab, index) { let {isActive, callback} = tab; let classes = classNa...
Add admin label and icon to account general view
import React from "react"; import { capitalize, map } from "lodash-es"; import { connect } from "react-redux"; import { Label } from "react-bootstrap"; import { Flex, FlexItem, Identicon, Icon } from "../../base"; import ChangePassword from "./Password"; import Email from "./Email"; export const AccountGeneral = ({ i...
import React from "react"; import { capitalize, map } from "lodash-es"; import { connect } from "react-redux"; import { Label } from "react-bootstrap"; import { Flex, FlexItem, Identicon } from "../../base"; import ChangePassword from "./Password"; import Email from "./Email"; export const AccountGeneral = ({ id, gro...
Initialize char_length with a number And make var name `file` less ambiguous by using `file_name` instead. Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
Change of function name due to deprecation.
import pandas as PD INFO_LINK = 'http://ds.iris.edu/files/earthscope/usarray/_US-MT-StationList.txt' """Full URL link to USArray MT site information text file.""" HEADER = 'VNET NET STA SITE DESCRIPTION LAT LON ELEV START END STATUS INSTALL CERT' """Header line of data file.""" def get_info_map(info_link=INFO_LIN...
import pandas as PD INFO_LINK = 'http://ds.iris.edu/files/earthscope/usarray/_US-MT-StationList.txt' """Full URL link to USArray MT site information text file.""" HEADER = 'VNET NET STA SITE DESCRIPTION LAT LON ELEV START END STATUS INSTALL CERT' """Header line of data file.""" def get_info_map(info_link=INFO_LIN...
Fix the issue where the mock is persisting calls
import mock import github3 import unittest def build_url(self, *args, **kwargs): # We want to assert what is happening with the actual calls to the # Internet. We can proxy this. return github3.session.GitHubSession().build_url(*args, **kwargs) class UnitHelper(unittest.TestCase): # Sub-classes must...
import mock import github3 import unittest MockedSession = mock.create_autospec(github3.session.GitHubSession) def build_url(self, *args, **kwargs): # We want to assert what is happening with the actual calls to the # Internet. We can proxy this. return github3.session.GitHubSession().build_url(*args, **...
Correct paths to database and translations
<?php namespace Niku\Cms; use Illuminate\Support\ServiceProvider; class CmsServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { // Register migrations $this->loadMigrationsFrom(__DIR__.'/../dat...
<?php namespace Niku\Cms; use Illuminate\Support\ServiceProvider; class CmsServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { // Register migrations $this->loadMigrationsFrom(__DIR__.'/databa...
Include subdirectories in pip install
import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'name': 'clouseau', 'description': 'A silly git repo inspector', 'long_description': None , # Needs to be restructed text # os.path.join(os.path.dirname(__f...
import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'name': 'clouseau', 'description': 'A silly git repo inspector', 'long_description': None , # Needs to be restructed text # os.path.join(os.path.dirname(__f...
Revert "travis? are you here?" This reverts commit a5a924a2df9ba4a47a4b3998a1495f8801668092.
<?php namespace Step\Acceptance; class EmailMan extends \AcceptanceTester { /** * Go to email settings */ public function gotoEmailSettings() { $I = new NavigationBar($this->getScenario()); $I->clickUserMenuItem('#admin_link'); $I->click('#mass_Email_config'); } ...
<?php namespace Step\Acceptance; class EmailMan extends \AcceptanceTester { /** * Go to email settings */ public function gotoEmailSettings() { $I = new NavigationBar($this->getScenario()); $I->clickUserMenuItem('#admin_link'); $I->click('#mass_Email_config'); } ...
Fix newline output of downloaded srt
from termcolor import colored from .parser import Addic7edParser from .file_crawler import FileCrawler from .logger import init_logger from .config import Config def addic7ed(): try: init_logger() Config.load() main() except (EOFError, KeyboardInterrupt, SystemExit): print(col...
from termcolor import colored from .parser import Addic7edParser from .file_crawler import FileCrawler from .logger import init_logger from .config import Config def addic7ed(): try: init_logger() Config.load() main() except (EOFError, KeyboardInterrupt, SystemExit): print(col...
Remove default form submit behavior
"use strict"; var React = require('react'); module.exports = React.createClass({ displayName: 'Home', getInitialState: function(){ return {};//getStateFromStores(); }, render: function() { //var self = this; //var props = this.props; //var state = this.state; ...
"use strict"; var React = require('react'); module.exports = React.createClass({ displayName: 'Home', getInitialState: function(){ return {};//getStateFromStores(); }, render: function() { //var self = this; //var props = this.props; //var state = this.state; ...
Fix an error when number of predictor columns is less than max_features.
import numbers from sklearn.ensemble import RandomForestClassifier as RandomForest from sklearn.preprocessing import Imputer from numpy import isnan import Orange.data import Orange.classification def replace_nan(X, imp_model): # Default scikit Imputer # Use Orange imputer when implemented if isnan(X).s...
# import numpy from sklearn.ensemble import RandomForestClassifier as RandomForest from sklearn.preprocessing import Imputer from numpy import isnan import Orange.data import Orange.classification def replace_nan(X, imp_model): # Default scikit Imputer # Use Orange imputer when implemented if i...
Add more information to the product sale track call
import db from '.'; import analytics from '../components/stats'; const trackProductUsage = transactionProduct => { let product = null; let customer = null; let transaction = null; db.Product.findOne({ where: { id: transactionProduct.productId } }) .then(result => { ...
import db from '.'; import analytics from '../components/stats'; const trackProductUsage = transactionProduct => { db.Product.findOne({ where: { id: transactionProduct.productId } }) .then(product => { if (product) { return analytics.track({ a...
Add Check if the network exists
import { Window } from '../Util'; import _each from 'lodash/each'; export default class Share { /** * Share Constructor. * * @param {String} selector */ constructor(selector = 'data-social') { this.networks = {}; this.selector = selector; } /** * Register a...
import { Window } from '../Util'; import _each from 'lodash/each'; export default class Share { /** * Share Constructor. * * @param {String} selector */ constructor(selector = 'data-social') { this.networks = {}; this.selector = selector; } /** * Register a...
Remove unused import / stale comment
package org.commcare.android.adapters; import android.os.Parcel; import android.os.Parcelable; import android.view.View; /** * Created by jschweers on 9/2/2015. */ public class ListItemViewStriper implements ListItemViewModifier, Parcelable { private int mOddColor; private int mEvenColor; ...
package org.commcare.android.adapters; import android.annotation.SuppressLint; import android.os.Parcel; import android.os.Parcelable; import android.view.View; /** * Created by jschweers on 9/2/2015. */ public class ListItemViewStriper implements ListItemViewModifier, Parcelable { private int mOddCo...
Fix dangerous default mutable value
from flask_seguro.products import Products from flask import current_app as app class Cart: def __init__(self, cart_dict=None): cart_dict = cart_dict or {} if cart_dict == {}: self.total = 0 self.subtotal = 0 self.items = [] else: self.total...
from flask_seguro.products import Products from flask import current_app as app class Cart: def __init__(self, cart_dict={}): if cart_dict == {}: self.total = 0 self.subtotal = 0 self.items = [] else: self.total = cart_dict["total"] self...
Rename `users` relationship to `members` to be a more accurate description
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Team extends Model { use SoftDeletes; /** * The attributes that are not mass assignable. * * @var array */ protected $guarded = [ 'id', 'deleted_at', ...
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Team extends Model { use SoftDeletes; /** * The attributes that are not mass assignable. * * @var array */ protected $guarded = [ 'id', 'deleted_at', ...
Allow user to save search result movies to favorites
package me.maxdev.popularmoviesapp.data; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import javax.inject.Inject; public class FavoritesService { private final Context context; @Inject public FavoritesService(Context context) { this.conte...
package me.maxdev.popularmoviesapp.data; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import javax.inject.Inject; public class FavoritesService { private final Context context; @Inject public FavoritesService(Context context) { this.conte...
Set app requirements to Symfony 5
<?php declare(strict_types=1); /* * This file is part of SolidInvoice project. * * (c) Pierre du Plessis <open-source@solidworx.co> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace SolidInvoice; use Symfony\Requirements\SymfonyRequir...
<?php declare(strict_types=1); /* * This file is part of SolidInvoice project. * * (c) Pierre du Plessis <open-source@solidworx.co> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace SolidInvoice; use Symfony\Requirements\SymfonyRequir...
Fix for broken last version jquery destination
module.exports = function (grunt) { grunt.initConfig({ karma: { options: { basePath: '', frameworks: ['mocha', 'sinon-chai'], files: [ { pattern: 'spec/fixtures/*.html', included: true }, 'bower_components/jquery/dist/jquery.js', 'bower_comp...
module.exports = function (grunt) { grunt.initConfig({ karma: { options: { basePath: '', frameworks: ['mocha', 'sinon-chai'], files: [ { pattern: 'spec/fixtures/*.html', included: true }, 'bower_components/jquery/jquery.js', 'bower_component...
Fix PHP 7.2 Compatibility Check
<?php namespace Mollie\Api; use Mollie\Api\Exceptions\IncompatiblePlatform; class CompatibilityChecker { /** * @var string */ public const MIN_PHP_VERSION = "7.2"; /** * @throws IncompatiblePlatform * @return void */ public function checkCompatibility() { if (! $...
<?php namespace Mollie\Api; use Mollie\Api\Exceptions\IncompatiblePlatform; class CompatibilityChecker { /** * @var string */ public const MIN_PHP_VERSION = "7.0"; /** * @throws IncompatiblePlatform * @return void */ public function checkCompatibility() { if (! $...
Return COMSPEC as the shell for Windows
# -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import os # Import third party libs import yaml import logging # Import salt libs import salt.utils.files import salt.utils.platform log = logging.getLogger(__name__) def shell(): ''' Return the default shell to use on th...
# -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import os # Import third party libs import yaml import logging # Import salt libs import salt.utils.files log = logging.getLogger(__name__) def shell(): ''' Return the default shell to use on this system ''' # Pro...
Fix order for 'first to complete' calculation
from optparse import make_option import sys from django.core.management.base import BaseCommand from challenge.models import Challenge, UserChallenge from resources.models import Resource from django.conf import settings from django.db.models import Avg, Max, Min, Count class Command(BaseCommand): args = "" he...
from optparse import make_option import sys from django.core.management.base import BaseCommand from challenge.models import Challenge, UserChallenge from resources.models import Resource from django.conf import settings from django.db.models import Avg, Max, Min, Count class Command(BaseCommand): args = "" he...
Send data using traces format to realtime analysis.
'use strict'; var sessions = require('../sessions'); var kafkaConsumer = function (kafkaConfig) { var kafka = require('../services/kafka')(kafkaConfig.uri); var players = require('../players'); return { addTraces: function (playerId, versionId, gameplayId, data) { return sessions.find(...
'use strict'; var sessions = require('../sessions'); var kafkaConsumer = function (kafkaConfig) { var kafka = require('../services/kafka')(kafkaConfig.uri); var players = require('../players'); return { addTraces: function (playerId, versionId, gameplayId, data) { return sessions.find(...
Replace class with new name.
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Symfony\Bundle\FrameworkBundle...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Symfony\Bundle\FrameworkBundle...
:white_check_mark: Delete user after dashboard test
<?php namespace Tests\Feature; use Tests\TestCase; use App\User; class StatusTest extends TestCase { /** * Test the home page returns a 200 status code (OK) * * @return void */ public function testHomePage() { $response = $this->get('/'); $response->assertStatus(200);...
<?php namespace Tests\Feature; use Tests\TestCase; use App\User; class StatusTest extends TestCase { /** * Test the home page returns a 200 status code (OK) * * @return void */ public function testHomePage() { $response = $this->get('/'); $response->assertStatus(200);...
Sort tests, to verify they are complete Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
import unittest from parameterized import parameterized from som.vm.universe import Universe class SomTest(unittest.TestCase): @parameterized.expand([ ("Array" ,), ("Block" ,), ("ClassLoading" ,), ("ClassStructure",), ("Closure" ,), ("Coercio...
import unittest from parameterized import parameterized from som.vm.universe import Universe class SomTest(unittest.TestCase): @parameterized.expand([ ("ClassStructure",), ("Array" ,), ("Block" ,), ("ClassLoading" ,), ("Closure" ,), ("Coercio...
Move configuration details to docs
""" homeassistant.components.device_tracker.owntracks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OwnTracks platform for the device tracker. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.owntracks.html """ import json import logging...
""" homeassistant.components.device_tracker.owntracks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OwnTracks platform for the device tracker. device_tracker: platform: owntracks """ import json import logging import homeassistant.components.mqtt as mqtt DEPENDENCIES = ['mqtt'] LOCATION_TOPIC = 'owntracks/+/...
Move signup form before login for responsive screens
import React, { Component } from 'react'; import SignupForm from './SignupForm'; import LoginForm from '../common/LoginForm'; class Intro extends Component { render() { return ( <div className="intro-section"> <div className="container"> <div className="row">...
import React, { Component } from 'react'; import SignupForm from './SignupForm'; import LoginForm from '../common/LoginForm'; class Intro extends Component { render() { return ( <div className="intro-section"> <div className="container"> <div className="row">...
Send all sensor data to Azure IoTHub
var GrovePi = require('node-grovepi').GrovePi; var GrovePiSensors = require('./GrovePiSensors'); var Commands = GrovePi.commands; var Board = GrovePi.board; var DeviceCommunication = require('./DeviceCommunication'); var deviceCommunication = new DeviceCommunication(onInit = () => { var board = new Board({ ...
var GrovePi = require('node-grovepi').GrovePi; var GrovePiSensors = require('./GrovePiSensors'); var Commands = GrovePi.commands; var Board = GrovePi.board; var DeviceCommunication = require('./DeviceCommunication'); var deviceCommunication = new DeviceCommunication(onInit = () => { var board = new Board({ ...
Fix mobile and wifi check logic
package com.breadwallet.tools.util; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; /** * Created by byfieldj on 2/15/18. * <p> * <p> * Reusable class to quick check whether user is connect to Wifi or mobile data */ public class BRConnectivityStatus { ...
package com.breadwallet.tools.util; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; /** * Created by byfieldj on 2/15/18. * <p> * <p> * Reusable class to quick check whether user is connect to Wifi or mobile data */ public class BRConnectivityStatus { ...
Add docstrings in Delegated class
from .base import AuthenticationBase class Delegated(AuthenticationBase): """Delegated authentication endpoints. Args: domain (str): Your auth0 domain (e.g: username.auth0.com) """ def __init__(self, domain): self.domain = domain def get_token(self, client_id, target, api_type,...
from .base import AuthenticationBase class Delegated(AuthenticationBase): def __init__(self, domain): self.domain = domain def get_token(self, client_id, target, api_type, grant_type, id_token=None, refresh_token=None): if id_token and refresh_token: raise Valu...
Add logout url and regirect to main page after successful login.
package bj.pranie.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; ...
package bj.pranie.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; ...
Change in the implementation of normal distribution
import numpy class dist: normal, random = range(2) # Monte carlo simulation data def montecarlo(callback, samples, **kwargs): """ generate random samples based on values """ vals = {} for var in kwargs: if isinstance(kwargs[var], tuple): (minVal, maxVal, distribution) = kwargs[var]...
import numpy class dist: normal, random = range(2) # Monte carlo simulation data def montecarlo(callback, samples, **kwargs): """ generate random samples based on values """ vals = {} for var in kwargs: if isinstance(kwargs[var], tuple): (minVal, maxVal, distribution) = kwargs[var]...
Fix commander fragment using wrong fragment manager
package fr.corenting.edcompanion.fragments; import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import butterknife.BindVi...
package fr.corenting.edcompanion.fragments; import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import butterknife.BindVi...
Change description for help and version
package com.crowdin.cli.commands.parts; import com.crowdin.cli.utils.MessageSource; import com.crowdin.cli.utils.Utils; import picocli.CommandLine; import java.util.ResourceBundle; @CommandLine.Command( name = "crowdin", versionProvider = Command.VersionProvider.class, synopsisHeading = "%n@|...
package com.crowdin.cli.commands.parts; import com.crowdin.cli.utils.MessageSource; import com.crowdin.cli.utils.Utils; import picocli.CommandLine; import java.util.ResourceBundle; @CommandLine.Command( name = "crowdin", versionProvider = Command.VersionProvider.class, mixinStandardHelpOption...
Throw a ValueError if we get a non-JID for the JID
import os import json import datetime from pupa.core import db from pupa.models import Organization from pupa.models.utils import DatetimeValidator from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema def import_jurisdiction(org_importer, jurisdiction): obj = jurisdiction.get_db_object() ...
import os import json import datetime from pupa.core import db from pupa.models import Organization from pupa.models.utils import DatetimeValidator from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema def import_jurisdiction(org_importer, jurisdiction): obj = jurisdiction.get_db_object() ...
Make approved fields nullable and remigrate
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateWorksTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { // Schema::create('works', function(Blueprint $table) { ...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateWorksTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { // Schema::create('works', function(Blueprint $table) { ...
Make hive_primary_DIMENSION.id primary key, so autoincrement works.
""" HiveDB client access via SQLAlchemy """ import sqlalchemy as sq metadata = sq.MetaData() hive_primary = sq.Table( 'hive_primary_DIMENSION', metadata, sq.Column('id', sq.Integer, primary_key=True), sq.Column('node', sq.SmallInteger, nullable=False, index=True, ...
""" HiveDB client access via SQLAlchemy """ import sqlalchemy as sq metadata = sq.MetaData() hive_primary = sq.Table( 'hive_primary_DIMENSION', metadata, sq.Column('id', sq.Integer, nullable=False, index=True, ), sq.Column('node', sq.SmallInteger, ...
Load clients and impostors data
import argparse import numpy def load_default(): print "TODO: load default scores" return None, None def get_data(): """ Get scores data. If there are no arguments in command line load default """ parser = argparse.ArgumentParser(description="Solve the ROC curve") parser.add_argument("-...
import argparse import numpy def load_default(): print "TODO: load default scores" return None, None def get_data(): """ Get scores data. If there are no arguments in command line load default """ parser = argparse.ArgumentParser(description="Solve the ROC curve") parser.add_argument("-...
Remove backref in main migration
# -*- coding: utf-8 -*- """Get public registrations for staff members. python -m scripts.staff_public_regs """ from collections import defaultdict import logging from modularodm import Q from website.models import Node, User from website.app import init_app logger = logging.getLogger('staff_public_regs') STAFF...
# -*- coding: utf-8 -*- """Get public registrations for staff members. python -m scripts.staff_public_regs """ from collections import defaultdict import logging from modularodm import Q from website.models import Node, User from website.app import init_app logger = logging.getLogger('staff_public_regs') STAFF...
Debug flag to insert tank into game board
import Queue import json import EBQP from . import world from . import types from . import consts from . import loc class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): reques...
import Queue import json import EBQP from . import world from . import types from . import consts from . import loc class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): reques...
Make default saving option relative Saving workflows with wd=True only works when you use a working dir. Since this is optional, it makes more sense to use relative paths (and assume the user uses the nlppln CWL_PATH to save their workflows).
from scriptcwl import WorkflowGenerator as WFGenerator from .utils import CWL_PATH class WorkflowGenerator(WFGenerator): def __init__(self, working_dir=None): WFGenerator.__init__(self, steps_dir=CWL_PATH, working_dir=working_dir) self.load(step_file='https://raw.githubusercontent.com/nlppln/' ...
from scriptcwl import WorkflowGenerator as WFGenerator from .utils import CWL_PATH class WorkflowGenerator(WFGenerator): def __init__(self, working_dir=None): WFGenerator.__init__(self, steps_dir=CWL_PATH, working_dir=working_dir) self.load(step_file='https://raw.githubusercontent.com/nlppln/' ...
Test Utils: Cleans up the code
"""Utilities for tests. """ import errno import codecs import os import re def strip_ansi(string): """Strip ANSI encoding from given string. Parameters ---------- string : str String from which encoding needs to be removed Returns ------- str Encoding free string ...
"""Utilities for tests. """ import codecs import codecs import os import re def strip_ansi(string): """Strip ANSI encoding from given string. Parameters ---------- string : str String from which encoding needs to be removed Returns ------- str Encoding free string...
Prepare test hashing for complex types.
# Copyright (c) 2016-2018 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import hashlib class CallJob(object): """ Base class for...
# Copyright (c) 2016 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import hashlib class CallJob(object): """ Base class for jobs...
Fix resolution of dependencies in a regular install of lexicon distribution
""" This module takes care of finding information about the runtime of Lexicon: * what are the providers installed, and available * what is the version of Lexicon """ import pkgutil import pkg_resources from lexicon import providers def find_providers(): """Find all providers registered in Lexicon, and their av...
""" This module takes care of finding information about the runtime of Lexicon: * what are the providers installed, and available * what is the version of Lexicon """ import pkgutil import pkg_resources from lexicon import providers def find_providers(): """Find all providers registered in Lexicon, and their av...
Return more relations when a discussion is created
<?php namespace Flarum\Api\Actions\Discussions; use Flarum\Core\Commands\StartDiscussionCommand; use Flarum\Core\Commands\ReadDiscussionCommand; use Flarum\Api\Actions\BaseAction; use Flarum\Api\Actions\ApiParams; use Flarum\Api\Serializers\DiscussionSerializer; class CreateAction extends BaseAction { /** * ...
<?php namespace Flarum\Api\Actions\Discussions; use Flarum\Core\Commands\StartDiscussionCommand; use Flarum\Core\Commands\ReadDiscussionCommand; use Flarum\Api\Actions\BaseAction; use Flarum\Api\Actions\ApiParams; use Flarum\Api\Serializers\DiscussionSerializer; class CreateAction extends BaseAction { /** * ...