text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix problem on no-longer existing bands that are still as logged in session available
from flask import session, redirect, url_for, g, jsonify, Response from flask.views import MethodView from server.models import Band class RestrictedBandPage(MethodView): def dispatch_request(self, *args, **kwargs): if not 'bandId' in session: return redirect(url_for('bands.session.index')) ...
from flask import session, redirect, url_for, g, jsonify, Response from flask.views import MethodView from server.models import Band class RestrictedBandPage(MethodView): def dispatch_request(self, *args, **kwargs): if not 'bandId' in session: return redirect(url_for('bands.session.index')) ...
Correct variable name is singular here
from app.actions.mslookup import proteinquant as lookups from app.drivers.mslookup import base class ProteinQuantLookupDriver(base.LookupDriver): """Creates lookup of protein tables that contain quant data""" lookuptype = 'prottable' def __init__(self, **kwargs): super().__init__(**kwargs) ...
from app.actions.mslookup import proteinquant as lookups from app.drivers.mslookup import base class ProteinQuantLookupDriver(base.LookupDriver): """Creates lookup of protein tables that contain quant data""" lookuptype = 'prottable' def __init__(self, **kwargs): super().__init__(**kwargs) ...
Modify request to add necessary header
'use strict'; angular.module('scratchApp') .controller('ContractCtrl', function ($scope, $http, $location) { var serversPublicKey, wallet, paymentTx, refundTx, signedTx; $scope.generate = function () { getServersPublicKey($scope.walet_pub...
'use strict'; angular.module('scratchApp') .controller('ContractCtrl', function ($scope, $http, $location) { var serversPublicKey, wallet, paymentTx, refundTx, signedTx; $scope.generate = function () { getServersPublicKey($scope.walet_pub...
Add some logs to scheduling.
package com.novoda.downloadmanager; import android.content.Context; import com.evernote.android.job.JobManager; import com.evernote.android.job.JobRequest; import com.novoda.notils.logger.simple.Log; import java.util.concurrent.TimeUnit; class LiteDownloadsNetworkRecoveryEnabled implements DownloadsNetworkRecovery ...
package com.novoda.downloadmanager; import android.content.Context; import android.util.Log; import com.evernote.android.job.JobManager; import com.evernote.android.job.JobRequest; import java.util.concurrent.TimeUnit; class LiteDownloadsNetworkRecoveryEnabled implements DownloadsNetworkRecovery { private fina...
Check for null and empty body before trying to map a json string to an object. Signed-off-by: Clement Escoffier <6397137e57d1f87002962a37058f2a1c76fca9db@gmail.com>
package org.wisdom.content.bodyparsers; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Instantiate; import org.apache.felix.ipojo.annotations.Provides; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wisdom.api.content.BodyParser; import org.wisdom.ap...
package org.wisdom.content.bodyparsers; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Instantiate; import org.apache.felix.ipojo.annotations.Provides; import org.wisdom.api.content.BodyParser; import org.wisdom.api.http.Context; import org.wisdom.api.http.MimeTypes; imp...
Fix API description for Subscribe Controller
package com.royalrangers.controller; import com.royalrangers.dto.ResponseResult; import com.royalrangers.dto.user.EmailDto; import com.royalrangers.service.SubscribeService; import com.royalrangers.utils.ResponseBuilder; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springfra...
package com.royalrangers.controller; import com.royalrangers.dto.ResponseResult; import com.royalrangers.dto.user.EmailDto; import com.royalrangers.service.SubscribeService; import com.royalrangers.utils.ResponseBuilder; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springfra...
Remove support for python 2.x
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs from setuptools import setup, find_packages from axes import get_version setup( name='django-axes', version=get_version(), description="Keep track of failed login attempts in Django-powered sites.", long_description=( codecs.open("REA...
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs from setuptools import setup, find_packages from axes import get_version setup( name='django-axes', version=get_version(), description="Keep track of failed login attempts in Django-powered sites.", long_description=( codecs.open("REA...
Add retries to cppn param test
from __future__ import absolute_import, division, print_function import pytest import numpy as np import tensorflow as tf import logging from lucid.optvis.param.cppn import cppn log = logging.getLogger(__name__) @pytest.mark.slow def test_cppn_fits_xor(): with tf.Graph().as_default(), tf.Session() as sess:...
from __future__ import absolute_import, division, print_function import pytest import numpy as np import tensorflow as tf import logging from lucid.optvis.param.cppn import cppn log = logging.getLogger(__name__) @pytest.mark.slow def test_cppn_fits_xor(): with tf.Graph().as_default(), tf.Session() as sess:...
Fix incorrect indentation messing up PySide
import pkg_resources import glob import os def check(cmd, mf): name = 'PySide' m = mf.findNode(name) if m is None or m.filename is None: return None from PySide import QtCore plugin_dir = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath) resources = [pkg_resources.resource...
import pkg_resources import glob import os def check(cmd, mf): name = 'PySide' m = mf.findNode(name) if m is None or m.filename is None: return None from PySide import QtCore plugin_dir = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath) resources = [pkg_resources.resource...
Update sending request status message
$(document).ready(function(){ $('#deleteAccountSubmitLabel').on('click',function(){ var userID = $('#userIDValue').val(); var verifyCode = $('#verifyCodeValue').val(); var password = $('#passwordValue').val(); var updateField = '#deleteAccountSubmitMessage'; confirmDelete(us...
$(document).ready(function(){ $('#deleteAccountSubmitLabel').on('click',function(){ var userID = $('#userIDValue').val(); var verifyCode = $('#verifyCodeValue').val(); var password = $('#passwordValue').val(); var updateField = '#deleteAccountSubmitMessage'; confirmDelete(us...
Update ConnectedSWFObject: raise KeyError if credentials are not set
# -*- coding:utf-8 -*- from boto.swf.layer1 import Layer1 AWS_CREDENTIALS = { #'aws_access_key_id': AWS_ACCESS_KEY_ID, #'aws_secret_access_key': AWS_SECRET_ACCESS_KEY, } def set_aws_credentials(aws_access_key_id, aws_secret_access_key): """Set default credentials.""" AWS_CREDENTIALS.update({ ...
# -*- coding:utf-8 -*- from boto.swf.layer1 import Layer1 AWS_CREDENTIALS = { 'aws_access_key_id': None, 'aws_secret_access_key': None } def set_aws_credentials(aws_access_key_id, aws_secret_access_key): """Set default credentials.""" AWS_CREDENTIALS.update({ 'aws_access_key_id': aws_access_...
Set as FAILED when maxTries is set to 0
<?php namespace Imtigger\LaravelJobStatus\EventManagers; use Carbon\Carbon; use Illuminate\Queue\Events\JobExceptionOccurred; use Illuminate\Queue\Events\JobFailed; use Illuminate\Queue\Events\JobProcessed; use Illuminate\Queue\Events\JobProcessing; class DefaultEventManager extends EventManager { public functio...
<?php namespace Imtigger\LaravelJobStatus\EventManagers; use Carbon\Carbon; use Illuminate\Queue\Events\JobExceptionOccurred; use Illuminate\Queue\Events\JobFailed; use Illuminate\Queue\Events\JobProcessed; use Illuminate\Queue\Events\JobProcessing; class DefaultEventManager extends EventManager { public functio...
Move register outside of guard Even if we don't load the ``verbatim`` tag backbport, the module still needs to have a ``register`` variable. Addresses #660
""" Handlebars templates use constructs like: {{if condition}} print something{{/if}} This, of course, completely screws up Django templates, because Django thinks {{ and }} mean something. Wrap {% verbatim %} and {% endverbatim %} around those blocks of Handlebars templates and this will try its best to output ...
""" Handlebars templates use constructs like: {{if condition}} print something{{/if}} This, of course, completely screws up Django templates, because Django thinks {{ and }} mean something. Wrap {% verbatim %} and {% endverbatim %} around those blocks of Handlebars templates and this will try its best to output ...
Use consistent naming for 'Print / Export' section
Ext.define('SlateAdmin.view.progress.NavPanel', { extend: 'SlateAdmin.view.LinksNavPanel', xtype: 'progress-navpanel', title: 'Student Progress', data: true, applyData: function(data) { if (data !== true) { return data; } return [ { ...
Ext.define('SlateAdmin.view.progress.NavPanel', { extend: 'SlateAdmin.view.LinksNavPanel', xtype: 'progress-navpanel', title: 'Student Progress', data: true, applyData: function(data) { if (data !== true) { return data; } return [ { ...
Change inline css to href
import React from 'react'; import Helmet from 'react-helmet'; import { prefixLink } from 'gatsby-helpers'; const BUILD_TIME = new Date().getTime(); module.exports = React.createClass({ displayName: 'HTML', propTypes: { body: React.PropTypes.string, }, render() { const { body } = this.props; const ...
import React from 'react'; import Helmet from 'react-helmet'; import { prefixLink } from 'gatsby-helpers'; const BUILD_TIME = new Date().getTime(); module.exports = React.createClass({ displayName: 'HTML', propTypes: { body: React.PropTypes.string, }, render() { const { body } = this.props; const ...
Use database to detect the duplication. But the md5 value does not match. Need to add some code here
__author__ = 'mjwtom' import sqlite3 import unittest class Fp_Index(object): def __init__(self, name): if name.endswith('.db'): self.name = name else: self.name = name + '.db' self.conn = sqlite3.connect(name) self.c = self.conn.cursor() self.c.exec...
__author__ = 'mjwtom' import sqlite3 import unittest class fp_index: def __init__(self, name): if name.endswith('.db'): self.name = name else: self.name = name + '.db' self.conn = sqlite3.connect(name) self.c = self.conn.cursor() self.c.execute('''C...
Use config instead of hardcoding target channel
from irc3.plugins.command import command from irc3.plugins.cron import cron import irc3 from teamspeak_web_utils import nplstatus @irc3.plugin class TS3NPL(object): def __init__(self, bot): self.bot = bot self.npl_status = None config = bot.config.get('ts3npl', {}) self.target_cha...
from irc3.plugins.command import command from irc3.plugins.cron import cron import irc3 from teamspeak_web_utils import nplstatus @irc3.plugin class TS3NPL(object): def __init__(self, bot): self.bot = bot self.npl_status = None self.target_channel = '#teamspeak' @cron('* * * * *') ...
Watch only tests root folder
module.exports = function(grunt) { "use strict"; grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), watch: { php: { files: ["src/**/*.php", "tests/*.php"], tasks: ["testphp"] } }, phpunit: { unit: { ...
module.exports = function(grunt) { "use strict"; grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), watch: { php: { files: ["src/**/*.php", "tests/**/*.php"], tasks: ["testphp"] } }, phpunit: { unit: {...
Add in handling for a user being unmuted
module.exports = function (bot) { bot.on('modMute', function (data) { if (config.verboseLogging) { console.log('[EVENT] modMute ', JSON.stringify(data, null, 2)); } var duration = 'unknown'; switch (data.d) { case 's': duration = '15'; ...
module.exports = function (bot) { bot.on('modMute', function (data) { if (config.verboseLogging) { console.log('[EVENT] modMute ', JSON.stringify(data, null, 2)); } var duration = 'unknown'; switch (data.d) { case 's': duration = '15'; ...
Support ipv6 for status endpoint security
package org.apereo.cas.configuration.model.core.web.security; import org.springframework.core.io.Resource; /** * This is {@link AdminPagesSecurityProperties}. * * @author Misagh Moayyed * @since 5.0.0 */ public class AdminPagesSecurityProperties { private String ip = "127\\.0\\.0\\.1|0:0:0:0:0:0:0:1"; ...
package org.apereo.cas.configuration.model.core.web.security; import org.springframework.core.io.Resource; /** * This is {@link AdminPagesSecurityProperties}. * * @author Misagh Moayyed * @since 5.0.0 */ public class AdminPagesSecurityProperties { private String ip = "127\\.0\\.0\\.1"; private String a...
Add dump function in development environment.
<?php /** * This file is part of the Miny framework. * (c) Dániel Buga <daniel@bugadani.hu> * * For licensing information see the LICENCE file. */ namespace Modules\Templating\Extensions; use Miny\Application\Application; use Miny\Application\BaseApplication; use Modules\Templating\Compiler\Functions\MethodFunc...
<?php /** * This file is part of the Miny framework. * (c) Dániel Buga <daniel@bugadani.hu> * * For licensing information see the LICENCE file. */ namespace Modules\Templating\Extensions; use Miny\Application\Application; use Miny\Application\BaseApplication; use Modules\Templating\Compiler\Functions\MethodFunc...
Add ability to pass extra parameters for property types.
<?php namespace CatLab\Requirements\Traits; use CatLab\Requirements\Enums\PropertyType; /** * Class TypeSetter * @package CatLab\Requirements\Enums\PropertyType */ trait TypeSetter { /** * @param $type * @return $this */ public abstract function setType($type); /** * @return $this...
<?php namespace CatLab\Requirements\Traits; use CatLab\Requirements\Enums\PropertyType; /** * Class TypeSetter * @package CatLab\Requirements\Enums\PropertyType */ trait TypeSetter { /** * @param $type * @return $this */ public abstract function setType($type); /** * @return $this...
Mod: Make comment removal a fallback when failed.
# -*- coding: utf-8 -*- """ JSON-LD extractor """ import json import re import lxml.etree import lxml.html HTML_OR_JS_COMMENTLINE = re.compile('^\s*(//.*|<!--.*-->)') class JsonLdExtractor(object): _xp_jsonld = lxml.etree.XPath('descendant-or-self::script[@type="application/ld+json"]') def extract(self, ...
# -*- coding: utf-8 -*- """ JSON-LD extractor """ import json import re import lxml.etree import lxml.html HTML_OR_JS_COMMENTLINE = re.compile('^\s*(//.*|<!--.*-->)') class JsonLdExtractor(object): _xp_jsonld = lxml.etree.XPath('descendant-or-self::script[@type="application/ld+json"]') def extract(self, ...
Revert cherry-picked jsma tutorial constant change
import unittest import numpy as np class TestMNISTTutorialJSMA(unittest.TestCase): def test_mnist_tutorial_jsma(self): np.random.seed(42) import tensorflow as tf tf.set_random_seed(42) from tutorials import mnist_tutorial_jsma # Run the MNIST tutorial on a dataset of red...
import unittest import numpy as np class TestMNISTTutorialJSMA(unittest.TestCase): def test_mnist_tutorial_jsma(self): np.random.seed(42) import tensorflow as tf tf.set_random_seed(42) from tutorials import mnist_tutorial_jsma # Run the MNIST tutorial on a dataset of red...
Set default contentStyle prop to make message more readable
import React, { Component } from 'react'; import { connect } from 'react-redux'; import Snackbar from 'material-ui/Snackbar'; import { red900, grey50 } from 'material-ui/styles/colors'; class ErrorReporting extends Component { static defaultProps = { open: false, action: '', error: null, ...
import React, { Component } from 'react'; import { connect } from 'react-redux'; import Snackbar from 'material-ui/Snackbar'; import { red900, grey50 } from 'material-ui/styles/colors'; class ErrorReporting extends Component { static defaultProps = { open: false, action: '', error: null, ...
Test something with the mailer.
<?php require_once(__DIR__ . "/../libs/sendgrid-php/sendgrid-php.php"); // Simple class to send email notifications. class Mailer { public static function sendMail($clientAddress, $body) { $request_body = json_decode('{ "personalizations": [ { "to": [ { ...
<?php require_once("libs/sendgrid-php/sendgrid-php.php"); // Simple class to send email notifications. class Mailer { public static function sendMail($clientAddress, $body) { $request_body = json_decode('{ "personalizations": [ { "to": [ { ...
Fix a small typo in the github url Signed-off-by: Ben Lopatin <91803bfd2e5cab57e71a67949d71dc9d68ed4677@wellfireinteractive.com>
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open('README.rst').read() history = open('HISTORY.rst...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open('README.rst').read() history = open('HISTORY.rst...
Add missing keywords, fix typo from vim syntax file
define(function (require) { 'use strict'; var jquery = require('jquery'); var monaco = require('monaco'); var cpp = require('vs/basic-languages/src/cpp'); function definition() { var ispc = jquery.extend(true, {}, cpp.language); // deep copy ispc.tokenPostfix = '.ispc'; is...
define(function (require) { 'use strict'; var jquery = require('jquery'); var monaco = require('monaco'); var cpp = require('vs/basic-languages/src/cpp'); function definition() { var ispc = jquery.extend(true, {}, cpp.language); // deep copy ispc.tokenPostfix = '.ispc'; is...
Fix wrong stackOffset / stack slicing problem
define(['summernote/core/range'], function (range) { /** * History * @class */ var History = function ($editable) { var stack = [], stackOffset = -1; var editable = $editable[0]; var makeSnapshot = function () { var rng = range.create(); var emptyBookmark = {s: {path: [0], offset: ...
define(['summernote/core/range'], function (range) { /** * History * @class */ var History = function ($editable) { var stack = [], stackOffset = 0; var editable = $editable[0]; var makeSnapshot = function () { var rng = range.create(); var emptyBookmark = {s: {path: [0], offset: 0...
Use Object.defineProperty() to define Response methods. git-svn-id: fac99be8204c57f0935f741ea919b5bf0077cdf6@9491 688a9155-6ab5-4160-a077-9df41f55a9e9
include('helma.buffer'); import('helma.system', 'system'); if (!global.Response) { system.addHostObject(org.helma.web.Response); /** * Render a skin to the response's buffer * @param skin * @param context * @param scope */ Object.defineProperty(Response.prototype, 'render', { ...
include('helma.buffer'); import('helma.system', 'system'); system.addHostObject(org.helma.web.Response); (function() { /** * Render a skin to the response's buffer * @param skin * @param context * @param scope */ this.render = function render(skin, context, scope) { var rende...
Support kwargs along with args for functions
""" This module is to include utils for managing compatibility between Python and Odin releases. """ import inspect import warnings def deprecated(message, category=DeprecationWarning): """ Decorator for marking classes/functions as being deprecated and are to be removed in the future. :param message: Me...
""" This module is to include utils for managing compatibility between Python and Odin releases. """ import inspect import warnings def deprecated(message, category=DeprecationWarning): """ Decorator for marking classes/functions as being deprecated and are to be removed in the future. :param message: Me...
Add missing number and object static methods Took from "Object static methods" and "Number properties" sections here https://kangax.github.io/compat-table/es6/
'use strict'; module.exports = { meta: { docs: { description: 'Forbid methods added in ES6' }, schema: [{ type: 'object', properties: { exceptMethods: { type: 'array', items: { type: 'string' } } } }] }, create(cont...
'use strict'; module.exports = { meta: { docs: { description: 'Forbid methods added in ES6' }, schema: [{ type: 'object', properties: { exceptMethods: { type: 'array', items: { type: 'string' } } } }] }, create(cont...
Split the Tomat mining commandlet into an Unreal part and a TomatConsole part.
# -*- coding: utf-8 -*- from nimp.commands._cis_command import * from nimp.utilities.ue3 import * from nimp.utilities.deployment import * from nimp.utilities.file_mapper import * import tempfile import shutil #------------------------------------------------------------------------------- class CisTomatMini...
# -*- coding: utf-8 -*- from nimp.commands._cis_command import * from nimp.utilities.ue3 import * from nimp.utilities.deployment import * from nimp.utilities.file_mapper import * #------------------------------------------------------------------------------- class CisTomatMining(CisCommand): abstract = ...
Change development status to beta
#!/usr/bin/env python from setuptools import setup,find_packages METADATA = dict( name='django-allauth', version='0.0.1', author='Raymond Penners', author_email='raymond.penners@intenct.nl', description='Integrated set of Django applications addressing authentication, registration, account manageme...
#!/usr/bin/env python from setuptools import setup,find_packages METADATA = dict( name='django-allauth', version='0.0.1', author='Raymond Penners', author_email='raymond.penners@intenct.nl', description='Integrated set of Django applications addressing authentication, registration, account manageme...
Remove default argument syntax on getVersionedGithubPath() Summary: Removes ES6 syntax of default arguments to fix website building as per #7434. [More info](https://github.com/facebook/react-native/pull/7434). Closes https://github.com/facebook/react-native/pull/7439 Differential Revision: D3274206 fb-gh-sync-id: 3...
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @provides...
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @provides...
Fix access of yaml config
package net.md_5.bungee.config; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.util.Map; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; @NoArgsConstructor(access = Acce...
package net.md_5.bungee.config; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.util.Map; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; class YamlConfiguration extends ConfigurationProvider { private final ThreadLocal<Yaml>...
Remove reliance on distutils log verbosity.
import pytest from jaraco import path from setuptools.command.test import test from setuptools.dist import Distribution from .textwrap import DALS @pytest.mark.usefixtures('tmpdir_cwd') def test_tests_are_run_once(capfd): params = dict( name='foo', packages=['dummy'], ) files = { ...
import pytest from jaraco import path from setuptools.command.test import test from setuptools.dist import Distribution from .textwrap import DALS @pytest.fixture def quiet_log(): # Running some of the other tests will automatically # change the log level to info, messing our output. import distutils.lo...
Use smallint for Firebird if tinyint is requested
package liquibase.datatype.core; import liquibase.database.Database; import liquibase.database.core.DerbyDatabase; import liquibase.database.core.MSSQLDatabase; import liquibase.database.core.OracleDatabase; import liquibase.database.core.PostgresDatabase; import liquibase.datatype.DataTypeInfo; import liquiba...
package liquibase.datatype.core; import liquibase.database.Database; import liquibase.database.core.DerbyDatabase; import liquibase.database.core.MSSQLDatabase; import liquibase.database.core.OracleDatabase; import liquibase.database.core.PostgresDatabase; import liquibase.datatype.DataTypeInfo; import liquiba...
Update BitbucketAuthenticatedMethodsTest's test_get_tags and test_get_branches methods. Signed-off-by: Baptiste Millou <1cfd48a9a65a966defdcd720f66cd790094000c4@smoothie-creative.com>
# -*- coding: utf-8 -*- import unittest from bitbucket.bitbucket import Bitbucket from bitbucket.tests.private import USERNAME, PASSWORD TEST_REPO_SLUG = 'test_bitbucket_api' class AuthenticatedBitbucketTest(unittest.TestCase): """ Bitbucket test base class for authenticated methods.""" def setUp(self): ...
# -*- coding: utf-8 -*- import unittest from bitbucket.bitbucket import Bitbucket from bitbucket.tests.private import USERNAME, PASSWORD TEST_REPO_SLUG = 'test_bitbucket_api' class AuthenticatedBitbucketTest(unittest.TestCase): """ Bitbucket test base class for authenticated methods.""" def setUp(self): ...
Add Python 3.8 to supported versions
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name...
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name...
Replace calls to deprecated Symfony2 functions, fix phpdoc
<?php namespace Ddeboer\VatinBundle\Validator\Constraints; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Constraint; use Ddeboer\Vatin\Validator; /** * Validate a VAT identification number using the ddeboer/vatin library * */ class VatinValidator extends ConstraintValidator ...
<?php namespace Ddeboer\VatinBundle\Validator\Constraints; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Constraint; use Ddeboer\Vatin\Validator; /** * Validate a VAT identification number using the ddeboer/vatin library * */ class VatinValidator extends ConstraintValidator ...
Make it possible to step() in a newly created env, rather than throwing AttributeError
from gym import Env from gym import spaces import numpy as np def categorical_sample(prob_n): """ Sample from categorical distribution Each row specifies class probabilities """ prob_n = np.asarray(prob_n) csprob_n = np.cumsum(prob_n) return (csprob_n > np.random.rand()).argmax() class Di...
from gym import Env from gym import spaces import numpy as np def categorical_sample(prob_n): """ Sample from categorical distribution Each row specifies class probabilities """ prob_n = np.asarray(prob_n) csprob_n = np.cumsum(prob_n) return (csprob_n > np.random.rand()).argmax() class Di...
Remove 3.1 and 3.2 from python_requires (and classifiers) to allow it to still install for those versions
import io import os import re from setuptools import setup, find_packages def find_version(): file_dir = os.path.dirname(__file__) with io.open(os.path.join(file_dir, 'auth0', '__init__.py')) as f: version = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', f.read()) if version: ret...
import io import os import re from setuptools import setup, find_packages def find_version(): file_dir = os.path.dirname(__file__) with io.open(os.path.join(file_dir, 'auth0', '__init__.py')) as f: version = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', f.read()) if version: ret...
Use ECMAScript strict mode, fix jslint errors.
/*jslint browser: true, forin: true */ (function($, window) { "use strict"; var REFRESH_SERVICES_TIMEOUT = 5000; $.ajaxSetup({ error: function(e, req, options, error) { $('#url').text(options.url); $('#error').show(); } }); var needRefreshServices, r...
(function($) { var REFRESH_SERVICES_TIMEOUT = 5000; $.ajaxSetup({ error: function(e, req, options, error) { $('#url').text(settings.url); $('#error').show(); } }); var needRefreshServices; var refreshServices = function() { refreshService...
Handle cases where [anonymous function].name is undefined instead of "".
(function(global) { "use strict"; // ulta-simple Object.create polyfill (only does half the job) var create = Object.create || (function() { var Maker = function(){}; return function(prototype) { Maker.prototype = prototype; return new Maker(); } }()); var newless = function(construc...
(function(global) { "use strict"; // ulta-simple Object.create polyfill (only does half the job) var create = Object.create || (function() { var Maker = function(){}; return function(prototype) { Maker.prototype = prototype; return new Maker(); } }()); var newless = function(construc...
Use url in query, not path
// Mine const getResponse = query => { const token = require('../config.json').token || false; if (!token) { throw new Error(`token is not defined`); } return require('gh-got')('https://api.github.com/graphql', { json: true, headers: { authorization: `bearer ${token}` }, body: { ...
// Mine const getResponse = query => { const token = require('../config.json').token || false; if (!token) { throw new Error(`token is not defined`); } return require('gh-got')('https://api.github.com/graphql', { json: true, headers: { authorization: `bearer ${token}` }, body: { ...
Fix fail when no StyleBlock classes are allowed
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Libraries\Markdown\StyleBlock; use Ds\Set; use InvalidArgumentException; use League\CommonMark\Block\Element\AbstractBloc...
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Libraries\Markdown\StyleBlock; use Ds\Set; use InvalidArgumentException; use League\CommonMark\Block\Element\AbstractBloc...
Fix glibc version detect string
import sys import platform from setuptools import setup, Extension cpython = platform.python_implementation() == 'CPython' is_glibc = platform.libc_ver()[0] == 'glibc' if is_glibc: glibc_ver = platform.libc_ver()[1] libc_numeric = tuple(int(x) for x in glibc_ver.split('.') if x.isdigit()) libc_ok = libc_nu...
import sys import platform from setuptools import setup, Extension cpython = platform.python_implementation() == 'CPython' is_glibc = platform.libc_ver()[0] == 'glibc' libc_ok = is_glibc and platform.libc_ver()[1] >= '2.9' windows = sys.platform.startswith('win') min_win_version = windows and sys.version_info >= (3, 5...
Add Pomodoro and remove pomodoro functionality
// @flow import React, { Component } from "react"; import { connect } from "react-redux"; import { addTask } from "../actions/task"; import type { actionType } from "../reducers/task"; type Props = { cancel: () => void, dispatch: (action: actionType) => void }; type State = { pomodoros: number }; class AddInput...
// @flow import React, { Component } from "react"; import { connect } from "react-redux"; import { addTask } from "../actions/task"; import type { actionType } from "../reducers/task"; type Props = { cancel: () => void, dispatch: (action: actionType) => void }; type State = { pomodoros: number }; class AddInput...
Remove (Participant) relationship displayed after the last non PI researcher CC2608
@if (isset($related['researchers']) && sizeof($related['researchers']['docs']) > 0) <?php // preparation $researchers_array = array(); foreach ($related['researchers']['docs'] as $col) { $col['display_relationship'] = str_replace("Participant, ","", $col['display_relationship']);...
@if (isset($related['researchers']) && sizeof($related['researchers']['docs']) > 0) <?php // preparation $researchers_array = array(); foreach ($related['researchers']['docs'] as $col) { $researchers_array[$col['display_relationship']][] = $col; } ?> <p> <strong>R...
Fix - No isAdmin function
<div class="navigation"> <div class="ui list"> <div class="mobile"><a href="javascript:void(0);" class="active"><i class="sidebar icon"></i></a></div> <div><a href="{{ route('dashboard.index') }}" class="{{ Request::is('dashboard*') || Request::is('check*') ? 'active' : null }}">Checks</a></div> ...
<div class="navigation"> <div class="ui list"> <div class="mobile"><a href="javascript:void(0);" class="active"><i class="sidebar icon"></i></a></div> <div><a href="{{ route('dashboard.index') }}" class="{{ Request::is('dashboard*') || Request::is('check*') ? 'active' : null }}">Checks</a></div> ...
Support for symmetrization of DIRECTIVE and REFERENCE. See the 1.20 Parser.jjt PR: Obtained from: Submitted by: Reviewed by: git-svn-id: 7267684f36935cb3df12efc1f4c0216d758271d4@73570 13f79535-47bb-0310-9956-ffa450edef68
/* Generated By:JJTree: Do not edit this line. ASTText.java */ package org.apache.velocity.runtime.parser.node; import java.io.Writer; import java.io.IOException; import org.apache.velocity.Context; import org.apache.velocity.runtime.parser.*; public class ASTText extends SimpleNode { private String text; ...
/* Generated By:JJTree: Do not edit this line. ASTText.java */ package org.apache.velocity.runtime.parser.node; import java.io.Writer; import java.io.IOException; import org.apache.velocity.Context; import org.apache.velocity.runtime.parser.*; public class ASTText extends SimpleNode { private String text; ...
Send the charset with simpleBody.
/*! * Ext JS Connect * Copyright(c) 2010 Ext JS, Inc. * MIT Licensed */ /** * Module dependencies. */ var http = require('http'), Buffer = require('buffer').Buffer; var resProto = http.ServerResponse.prototype; /** * Respond with custom status code * if the message is a non-buffer object, send it as JSO...
/*! * Ext JS Connect * Copyright(c) 2010 Ext JS, Inc. * MIT Licensed */ /** * Module dependencies. */ var http = require('http'), Buffer = require('buffer').Buffer; var resProto = http.ServerResponse.prototype; /** * Respond with custom status code * if the message is a non-buffer object, send it as JSO...
Add note describing array copy if discontiguous
import numpy as np def unique_rows(ar): """Remove repeated rows from a 2D array. Parameters ---------- ar : 2D np.ndarray The input array. Returns ------- ar_out : 2D np.ndarray A copy of the input array with repeated rows removed. Raises ------ ValueError : ...
import numpy as np def unique_rows(ar): """Remove repeated rows from a 2D array. Parameters ---------- ar : 2D np.ndarray The input array. Returns ------- ar_out : 2D np.ndarray A copy of the input array with repeated rows removed. Raises ------ ValueError : ...
Update router metric to Histogram. Use toggleable service label for router metric. Bug: T238658 Bug: T247820
'use strict'; function emitMetric(hyper, req, res, specInfo, startTime) { let statusCode = 'unknown'; if (res && res.status) { statusCode = res.status; } hyper.metrics.makeMetric({ type: 'Histogram', name: 'router', prometheus: { name: 'hyperswitch_router_dur...
'use strict'; function emitMetric(hyper, req, res, specInfo, startTime) { let statusCode = 'unknown'; if (res && res.status) { statusCode = res.status; } hyper.metrics.makeMetric({ type: 'Gauge', name: 'router', prometheus: { name: 'hyperswitch_router_duratio...
Add neutron client without test
""" OpenstackDriver for Network based on NetworkDriver """ from neutronclient.v2_0 import client from network_driver import NetworkDriver class OpenstackNetWorkDriver(NetworkDriver): """docstring for OpenstackNetWorkDriver""" def __init__(self, auth_url, project_name, username, passwor...
""" OpenstackDriver for Network based on NetworkDriver """ from neutronclient.v2_0 import client from network_driver import NetworkDriver class OpenstackNetWorkDriver(NetworkDriver): """docstring for OpenstackNetWorkDriver""" def __init__(self, auth_url, project_name, username, password...
Allow the package to be built without Sphinx being required.
import os from distutils.core import setup try: from sphinx.setup_command import BuildDoc cmdclass = {'build_sphinx': BuildDoc} except ImportError: print "Sphinx not installed--needed to build documentation" # default cmdclass to None to avoid cmdclass = {} import django_assets def fi...
import os from distutils.core import setup from sphinx.setup_command import BuildDoc import django_assets def find_packages(root): # so we don't depend on setuptools; from the Storm ORM setup.py packages = [] for directory, subdirectories, files in os.walk(root): if '__init__.py' in fi...
Remove Input in favour of Request
<?php namespace Forma; class Helpers { public static function url($string) { if (static::isLaravel()) { return \URL::to($string); } return $string; } public static function hasLang($string) { if (static::isLaravel()) { retur...
<?php namespace Forma; class Helpers { public static function url($string) { if (static::isLaravel()) { return \URL::to($string); } return $string; } public static function hasLang($string) { if (static::isLaravel()) { retur...
Use correct method for broadCast
var Promise = require('bluebird'), dbUtils = require('utils/database'), socketUtils = require('utils/socket'); module.exports = { all : All, add : Add, rename : Rename, delete : Delete }; function All(request,reply) { dbUtils.list() .then(function(data){ reply.data = data; ...
var Promise = require('bluebird'), dbUtils = require('utils/database'), socketUtils = require('utils/socket'); module.exports = { all : All, add : Add, rename : Rename, delete : Delete }; function All(request,reply) { dbUtils.list() .then(function(data){ reply.data = data; ...
Add tags - that was too easy
import uuid import jsonschema import changeling.exception class Change(object): schema = { 'name': 'change', 'properties': { 'id': {'type': 'string'}, 'name': {'type': 'string'}, 'description': {'type': 'string'}, 'tags': {'type': 'array'}, ...
import uuid import jsonschema import changeling.exception class Change(object): schema = { 'name': 'change', 'properties': { 'id': {'type': 'string'}, 'name': {'type': 'string'}, 'description': {'type': 'string'}, }, 'additionalProperties': Fa...
Raise a `RuntimeError` if the device cannot be opened
import threading from robotd.native import _cvcapture class CaptureDevice(object): def __init__(self, path=None): if path is not None: argument_c = _cvcapture.ffi.new( 'char[]', path.encode('utf-8'), ) else: argument_c = _cvcaptur...
import threading from robotd.native import _cvcapture class CaptureDevice(object): def __init__(self, path=None): if path is not None: argument_c = _cvcapture.ffi.new( 'char[]', path.encode('utf-8'), ) else: argument_c = _cvcaptur...
BB-7975: Add to configuration select with segment lists - cs fix
<?php namespace Oro\Bundle\SegmentBundle\Form\Type; use Doctrine\Common\Persistence\ManagerRegistry; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\OptionsResolver\OptionsResolver; class SegmentChoiceType extends AbstractType { /** @var ...
<?php namespace Oro\Bundle\SegmentBundle\Form\Type; use Doctrine\Common\Persistence\ManagerRegistry; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\OptionsResolver\OptionsResolver; class SegmentChoiceType extends AbstractType { /** @var ...
Add comment of things to do
/* * Copyright 2016-2018 Talsma ICT * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
/* * Copyright 2016-2018 Talsma ICT * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
Add y log option and title offset
import matplotlib.pyplot as plt #class RgChart(object): #__metaclass__ = ABCMeta class RgChart(object): TITLE_Y_OFFSET = 1.08 def with_grids(self): self._ax.xaxis.grid(True) self._ax.yaxis.grid(True) return self def save_as(self, filename): self._create_plot() ...
import matplotlib.pyplot as plt #class RgChart(object): #__metaclass__ = ABCMeta class RgChart(object): def with_grids(self): self._ax.xaxis.grid(True) self._ax.yaxis.grid(True) return self def save_as(self, filename): self._create_plot() self._fig.savefig(fil...
Set user as the default role for new accounts
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\User; use App\Providers\RouteServiceProvider; use Illuminate\Auth\Events\Registered; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Inertia\Inertia; class Registe...
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\User; use App\Providers\RouteServiceProvider; use Illuminate\Auth\Events\Registered; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Inertia\Inertia; class Registe...
Use new Date() in place of Date.now() to avoid any difference of behavior when using datejs
// // Server side activity detection for the session timeout // // Meteor settings: // - staleSessionInactivityTimeout: the amount of time (in ms) after which, if no activity is noticed, a session will be considered stale // - staleSessionPurgeInterval: interval (in ms) at which stale sessions are purged i.e. found and...
// // Server side activity detection for the session timeout // // Meteor settings: // - staleSessionInactivityTimeout: the amount of time (in ms) after which, if no activity is noticed, a session will be considered stale // - staleSessionPurgeInterval: interval (in ms) at which stale sessions are purged i.e. found and...
Change dev status to beta, not pre-alpha There's no RC classifier, so beta looks like the closest one we can use.
#!/usr/bin/env python from setuptools import setup, find_packages with open('README.rst') as readme_file: README = readme_file.read() install_requires = [ 'click==6.6', 'botocore>=1.5.40,<2.0.0', 'typing==3.5.3.0', 'six>=1.10.0,<2.0.0', 'pip>=9,<10' ] setup( name='chalice', version=...
#!/usr/bin/env python from setuptools import setup, find_packages with open('README.rst') as readme_file: README = readme_file.read() install_requires = [ 'click==6.6', 'botocore>=1.5.40,<2.0.0', 'typing==3.5.3.0', 'six>=1.10.0,<2.0.0', 'pip>=9,<10' ] setup( name='chalice', version=...
Add homepage to plugin details
<?php namespace PKleindienst\BlogSearch; use System\Classes\PluginBase; /** * blogSearch Plugin Information File */ class Plugin extends PluginBase { /** * @var array Plugin dependencies */ public $require = ['RainLab.Blog']; /** * Returns information about this plugin. * * @re...
<?php namespace PKleindienst\BlogSearch; use System\Classes\PluginBase; /** * blogSearch Plugin Information File */ class Plugin extends PluginBase { /** * @var array Plugin dependencies */ public $require = [ 'RainLab.Blog' ]; /** * Returns information about this plugin. * * @...
Refactor REST controller to use overall @RequestMapping
package com.elderstudios.controller; import com.elderstudios.domain.GuestBookEntry; import com.elderstudios.service.GuestBookService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.persistence.criteria.CriteriaBuilder; import java.util.Lis...
package com.elderstudios.controller; import com.elderstudios.domain.GuestBookEntry; import com.elderstudios.service.GuestBookService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; im...
Add module for conditional content
/* globals _ */ (function () { 'use strict'; moj.Modules.Conditional = { el: '.js-Conditional', init: function () { _.bindAll(this, 'render'); this.cacheEls(); this.bindEvents(); }, bindEvents: function () { this.$conditionals.on('change deselect', this.toggle); moj...
(function () { 'use strict'; moj.Modules.Conditional = { el: '.js-Conditional', init: function () { var _this = this; this.cacheEls(); this.bindEvents(); this.$conditionals.each(function () { _this.toggleEl($(this)); }); }, bindEvents: function () { v...
Allow users to manually zoom in on mobile devices.
<!DOCTYPE html> <html lang="<?= LANG ?>"> <head> <title><?= PageTitle() ?></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="copyright" content="<?= T('copyright') ?>"> <meta name="description" content="<?= PageDescription() ?>"> <meta name="k...
<!DOCTYPE html> <html lang="<?= LANG ?>"> <head> <title><?= PageTitle() ?></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <meta name="copyright" content="<?= T('copyright') ?>"> <meta name="description" content="<?= PageDescription() ?>"...
Drop type-hint for Response to support multiple Guzzle versions
<?php namespace Hub\Client\Common; use Hub\Client\Exception\BadRequestException; use Hub\Client\Exception\NotFoundException; use Hub\Client\Exception\NotAuthorizedException; use RuntimeException; class ErrorResponseHandler { public static function handle($response) { if ($response->getStatusCode() ==...
<?php namespace Hub\Client\Common; use Hub\Client\Exception\BadRequestException; use Hub\Client\Exception\NotFoundException; use Hub\Client\Exception\NotAuthorizedException; use GuzzleHttp\Psr7\Response; use RuntimeException; class ErrorResponseHandler { public static function handle(Response $response) { ...
Add isset check to SQL Pending user
<?php namespace Auth; class SQLPendingUser extends PendingUser { private $hash; private $time; private $blob; private $table; public function __construct($data, $table = false) { $this->hash = $data['hash']; $this->time = new \DateTime($data['time']); $this->blob = json...
<?php namespace Auth; class SQLPendingUser extends PendingUser { private $hash; private $time; private $blob; private $table; public function __construct($data, $table = false) { $this->hash = $data['hash']; $this->time = new \DateTime($data['time']); $this->blob = json...
fix: Use better help for --elb-subnet See also: PSOBAT-1359
"""Create DNS record.""" import argparse import logging from ..args import add_debug from ..consts import LOGGING_FORMAT from .create_dns import SpinnakerDns def main(): """Run newer stuffs.""" logging.basicConfig(format=LOGGING_FORMAT) log = logging.getLogger(__name__) parser = argparse.ArgumentPar...
"""Create DNS record.""" import argparse import logging from ..args import add_debug from ..consts import LOGGING_FORMAT from .create_dns import SpinnakerDns def main(): """Run newer stuffs.""" logging.basicConfig(format=LOGGING_FORMAT) log = logging.getLogger(__name__) parser = argparse.ArgumentPar...
Add only the value to a members extra info Signed-off-by: Gawain Lynch <f745ec5336bcd096400627fc09f6ec7139408726@gmail.com>
<?php namespace Bolt\Extension\Bolt\Members; use Bolt\Extension\Bolt\ClientLogin\ClientRecords; use Bolt\Extension\Bolt\ClientLogin\Session; /** * Members Profiles * * @author Gawain Lynch <gawain.lynch@gmail.com> */ class MembersProfiles { public function __construct(\Bolt\Application $app) { $t...
<?php namespace Bolt\Extension\Bolt\Members; use Bolt\Extension\Bolt\ClientLogin\ClientRecords; use Bolt\Extension\Bolt\ClientLogin\Session; /** * Members Profiles * * @author Gawain Lynch <gawain.lynch@gmail.com> */ class MembersProfiles { public function __construct(\Bolt\Application $app) { $t...
Read requirements from the .txt file
#! /usr/bin/env python from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import os import sys os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'saleor.settings') class PyTest(TestCommand): user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')] ...
#! /usr/bin/env python from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import os import sys os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'saleor.settings') class PyTest(TestCommand): user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')] ...
Make sure a transaction completes exceptionally if it fails to start
package peergos.shared.storage; import peergos.shared.crypto.hash.*; import java.util.concurrent.*; import java.util.function.*; public class Transaction { /** Run a series of operations under a transaction, ensuring that it is closed correctly * * @param owner * @param processor * @param ip...
package peergos.shared.storage; import peergos.shared.crypto.hash.*; import java.util.concurrent.*; import java.util.function.*; public class Transaction { /** Run a series of operations under a transaction, ensuring that it is closed correctly * * @param owner * @param processor * @param ip...
Return a comma-separated string of all ips in the X-Forwarded-For header. This mimics the behavior of the sample app https://cryptic-ridge-9197.herokuapp.com/api/whoami/ when the user supplies its own header.
'use strict'; const express = require('express'); const app = express(); // Settings app.enable('trust proxy'); app.set('json spaces', 1); // Static files app.use(express.static(process.cwd() + '/public')); app.route('/') .get((req, res) => { res.sendFile(process.cwd() + '/public/index.html'); }); ...
'use strict'; const express = require('express'); const app = express(); // Settings app.enable('trust proxy'); app.set('json spaces', 1); // Static files app.use(express.static(process.cwd() + '/public')); app.route('/') .get((req, res) => { res.sendFile(process.cwd() + '/public/index.html'); }); ...
Add correct protocol to the Pandas client @nicolajkirchhof Is this what you were talking about?
import argparse import pandas as pd from influxdb import DataFrameClient def main(host='localhost', port=8086): user = 'root' password = 'root' dbname = 'example' protocol = 'json' client = DataFrameClient(host, port, user, password, dbname) print("Create pandas DataFrame") df = pd.Data...
import argparse import pandas as pd from influxdb import DataFrameClient def main(host='localhost', port=8086): user = 'root' password = 'root' dbname = 'example' client = DataFrameClient(host, port, user, password, dbname) print("Create pandas DataFrame") df = pd.DataFrame(data=list(range(...
Refactor test for new view added with upgrade
import json from django.test import TestCase from django_extensions.management.commands.show_urls import Command class UrlTests(TestCase): def is_exception(self, url): exceptions = [".txt", ".ics", ".geojson"] for exception in exceptions: if exception in url: return Tru...
import json from django.test import TestCase from django_extensions.management.commands.show_urls import Command class UrlTests(TestCase): def is_exception(self, url): exceptions = [".txt", ".ics", ".geojson"] for exception in exceptions: if exception in url: return Tru...
Remove test that was removed with 'redundant abstract' diagnostic
package org.jetbrains.kotlin.ui.tests.editors.quickfix.autoimport; import org.junit.Test; public class KotlinAbstractModifierQuickFixTest extends KotlinQuickFixTestCase { @Override protected String getTestDataRelativePath() { return "../common_testData/ide/quickfix/abstract/"; } @Test ...
package org.jetbrains.kotlin.ui.tests.editors.quickfix.autoimport; import org.junit.Test; public class KotlinAbstractModifierQuickFixTest extends KotlinQuickFixTestCase { @Override protected String getTestDataRelativePath() { return "../common_testData/ide/quickfix/abstract/"; } @Test ...
Fix typo in associative array
<?php /** * Service for the Salesforce data API. * * @license http://opensource.org/licenses/MIT The MIT License (MIT) */ namespace Salesforce\Service; use GuzzleHttp\ClientInterface as HttpClientInterface; use skyflow\Domain\OAuthUser; use skyflow\Service\OAuthServiceInterface; use skyflow\Service\RestOAuthAut...
<?php /** * Service for the Salesforce data API. * * @license http://opensource.org/licenses/MIT The MIT License (MIT) */ namespace Salesforce\Service; use GuzzleHttp\ClientInterface as HttpClientInterface; use skyflow\Domain\OAuthUser; use skyflow\Service\OAuthServiceInterface; use skyflow\Service\RestOAuthAut...
Fix class property, prefer non-static
<?php namespace GB2260; class GB2260 { protected $data; public function __construct() { $this->data = require 'data.php'; } public function get($code) { $code = preg_replace('/(00)+$/', '', $code); $codeLength = strlen($code); if ($codeLength < 2 || $codeLeng...
<?php namespace GB2260; class GB2260 { protected static $_data; public function __construct() { self::$_data = require 'data.php'; } public function get($code) { $code = preg_replace('/(00)+$/', '', $code); $codeLength = strlen($code); if ($codeLength < 2 || ...
Fix index names in migrations This can be reverted when we upgrade to Laravel 5.7.
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Flarum\Database\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\...
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; return [ '...
Remove commonjs in top level
import commonjs from '@rollup/plugin-commonjs'; import glslify from 'rollup-plugin-glslify'; import resolve from '@rollup/plugin-node-resolve'; import copy from "rollup-plugin-copy"; export default { input: ['source/gltf-sample-viewer.js'], output: [ { file: 'dist/gltf-viewer.js', ...
import commonjs from '@rollup/plugin-commonjs'; import glslify from 'rollup-plugin-glslify'; import resolve from '@rollup/plugin-node-resolve'; import copy from "rollup-plugin-copy"; export default { input: ['source/gltf-sample-viewer.js'], output: [ { file: 'dist/gltf-viewer.js', ...
Remove host and port attributes from Neo4j
import requests from py2neo import Graph, authenticate class Neo4j: def __init__(self, host, port, username=None, password=None): self.username = username self.password = password self.host_port = "{host}:{port}".format(host=host, port=port) self.url = "http://{host_port}/db/data...
import requests from py2neo import Graph, authenticate class Neo4j: def __init__(self, host, port, username=None, password=None): self.host = host self.port = port self.username = username self.password = password self.host_port = "{host}:{port}".format(host=host, port=po...
Fix test generating graph file
from jg.__main__ import main, generate_template_graph from mock import patch FIXTURE_GRAPH = ( 'digraph {\n' '\t"snippets/sub/analytics.html"\n' '\t"snippets/ga.html"\n' '\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n' '\t"header.html"\n' '\t"analytics.html"\...
from jg.__main__ import main, generate_template_graph from mock import patch FIXTURE_GRAPH = ( 'digraph {\n' '\t"snippets/sub/analytics.html"\n' '\t"snippets/ga.html"\n' '\t\t"snippets/ga.html" -> "snippets/sub/analytics.html"\n' '\t"header.html"\n' '\t"analytics.html"\...
Remove version requirement, add pathlib
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('git_externals/__init__.py') as fp: exec(fp.read()) classifiers = [ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('git_externals/__init__.py') as fp: exec(fp.read()) classifiers = [ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming...
Support large meshes on Fermi-class hardware.
# -*- coding: utf-8 -*- import numpy as np from pyfr.backends.cuda.provider import CudaKernelProvider from pyfr.backends.cuda.queue import CudaComputeKernel from pyfr.nputil import npdtype_to_ctype class CudaBlasExtKernels(CudaKernelProvider): def __init__(self, backend): super(CudaBlasExtKernels, self)....
# -*- coding: utf-8 -*- import numpy as np from pyfr.backends.cuda.provider import CudaKernelProvider from pyfr.backends.cuda.queue import CudaComputeKernel from pyfr.nputil import npdtype_to_ctype class CudaBlasExtKernels(CudaKernelProvider): def __init__(self, backend): super(CudaBlasExtKernels, self)....
Revert watch if not production
const path = require('path'); const webpack = require('webpack'); const production = process.env.NODE_ENV === 'production'; const plugins = [ new webpack.ProvidePlugin({ $ : 'jquery', jQuery : 'jquery', 'window.jQuery': 'jquery', }), ]; const productionPlugins = p...
const path = require('path'); const webpack = require('webpack'); const production = process.env.NODE_ENV === 'production'; const plugins = [ new webpack.ProvidePlugin({ $ : 'jquery', jQuery : 'jquery', 'window.jQuery': 'jquery', }), ]; const productionPlugins = p...
[test-studio] Add example of using custom icon for list item
import React from 'react' import S from '@sanity/desk-tool/structure-builder' import RefreshIcon from 'part:@sanity/base/sync-icon' import JsonDocumentDump from './components/JsonDocumentDump' // For testing. Bump the timeout to introduce som lag const delay = val => new Promise(resolve => setTimeout(resolve, 10, val)...
import S from '@sanity/desk-tool/structure-builder' import RefreshIcon from 'part:@sanity/base/sync-icon' import JsonDocumentDump from './components/JsonDocumentDump' // For testing. Bump the timeout to introduce som lag const delay = val => new Promise(resolve => setTimeout(resolve, 10, val)) export default () => ...
Add ability to set karma file through env
module.exports = function(config) { const { KARMA_FILE = 'src/**/*.spec.js' } = process.env; const FILE = KARMA_FILE || 'src/**/*.spec.js'; config.set({ basePath: '', frameworks: ['mocha'], webpack: { mode: 'development', module: { rules: [ { test: /\.js$/, ...
module.exports = function(config) { config.set({ basePath: '', frameworks: ['mocha'], webpack: { mode: 'development', module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', op...
Move 'allowed' to noop group
<?php namespace Pheasant\Database; class MysqlPlatform { public function columnSql($column, $type, $options) { return trim(sprintf('`%s` %s %s', $column, $type, $this->_options($options))); } /** * Returns mysql column options for a given {@link Options} * @return string */ ...
<?php namespace Pheasant\Database; class MysqlPlatform { public function columnSql($column, $type, $options) { return trim(sprintf('`%s` %s %s', $column, $type, $this->_options($options))); } /** * Returns mysql column options for a given {@link Options} * @return string */ ...
Set cookie to http only
require('dotenv').config(); const express = require('express'); const bodyParser = require('body-parser'); const cookieParser = require('cookie-parser'); const login = require('./login.js'); const getPullRequests = require('./getPullRequests.js'); const Maybe = require('folktale/maybe'); const app = express(); app.use(...
require('dotenv').config(); const express = require('express'); const bodyParser = require('body-parser'); const cookieParser = require('cookie-parser'); const login = require('./login.js'); const getPullRequests = require('./getPullRequests.js'); const Maybe = require('folktale/maybe'); const app = express(); app.use(...
Make the example camera matrices sane
window.addEvent("domready", function() { var BasicApp = new Class({ Extends: App, initialize: function(element, options) { this.parent(element, options); this.renderer = new BasicRenderer(); this.camera = new Camera(); this.camera.perspective(45, this....
window.addEvent("domready", function() { var BasicApp = new Class({ Extends: App, initialize: function(element, options) { this.parent(element, options); this.renderer = new BasicRenderer(); this.camera = new Camera(); this.camera.perspective(45, this....
Move sheet_by_name after expected interfaces.
from django.conf import settings import xlrd import os base_loader_error = 'The Loader class can only be used by extending it.' extensions = getattr( settings, 'IMPORTER_EXTENSIONS', { 'excel': ('.xls', '.xlsx'), } ) class Loader(object): def __init__(self, file_info, autoload=True): ...
from django.conf import settings import xlrd import os base_loader_error = 'The Loader class can only be used by extending it.' extensions = getattr( settings, 'IMPORTER_EXTENSIONS', { 'excel': ('.xls', '.xlsx'), } ) class Loader(object): def __init__(self, file_info, autoload=True): ...
Use correct environment for Intercom Whoops ¯\_(ツ)_/¯
@if (app()->environment('production') && $appId = config('services.intercom.app_id')) <script> window.intercomSettings = { @if (Auth::check()) user_id: {{ Auth::user()->id() }}, user_hash: "{{ Auth::user()->intercomHash() }}", name: "{{ Auth::user(...
@if (app()->environment('local') && $appId = config('services.intercom.app_id')) <script> window.intercomSettings = { @if (Auth::check()) user_id: {{ Auth::user()->id() }}, user_hash: "{{ Auth::user()->intercomHash() }}", name: "{{ Auth::user()->na...
Change homepage landing to dashboard
package io.github.pbremer.icecreammanager.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class SimpleGreetingController { public static final Str...
package io.github.pbremer.icecreammanager.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class SimpleGreetingController { public static final Str...
Remove t() from PHPdoc example to avoid confusion
<?php namespace Kanboard\Core\ExternalLink; /** * External Link Provider Interface * * @package externalLink * @author Frederic Guillot */ interface ExternalLinkProviderInterface { /** * Get provider name (label) * * @access public * @return string */ public function getName()...
<?php namespace Kanboard\Core\ExternalLink; /** * External Link Provider Interface * * @package externalLink * @author Frederic Guillot */ interface ExternalLinkProviderInterface { /** * Get provider name (label) * * @access public * @return string */ public function getName()...
Select path for page context.
"use strict"; import React, { Component, PropTypes } from 'react'; import { getItems } from '../../actions'; import PageItem from './PageItem'; export default class PageContext extends Component { constructor () { super(); this.state = { pages: [] }; } componentDidMount () { this._load(this.props);...
"use strict"; import React, { Component, PropTypes } from 'react'; import { getItems } from '../../actions'; import PageItem from './PageItem'; export default class PageContext extends Component { constructor () { super(); this.state = { pages: [] }; } componentDidMount () { this._load(this.props);...