commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
3b8269857b1370e550664b47a20af30427992204
kolibri/core/test/test_key_urls.py
kolibri/core/test/test_key_urls.py
from __future__ import absolute_import, print_function, unicode_literals from django.core.urlresolvers import reverse from rest_framework.test import APITestCase from kolibri.auth.test.test_api import FacilityFactory from kolibri.auth.test.helpers import create_superuser, provision_device DUMMY_PASSWORD = "password...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from django.core.urlresolvers import reverse from rest_framework.test import APITestCase from kolibri.auth.test.helpers import create_superuser from kolibri.auth.test.helpers import provision_device fr...
Update KolibriTagNavigationTestCase to handle new redirect method
Update KolibriTagNavigationTestCase to handle new redirect method
Python
mit
learningequality/kolibri,lyw07/kolibri,indirectlylit/kolibri,benjaoming/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,DXCanas/kolibri,benjaoming/kolibri,learningequality/kolibri,lyw07/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri,indirectlylit/kolibri,DXCanas/kolibri,benjaoming/kol...
1a4f8b2565b0e6ccdef8eba8982633825ddd978c
telemetry/telemetry/core/profile_types.py
telemetry/telemetry/core/profile_types.py
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os PROFILE_TYPE_MAPPING = { 'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1', 'power_user': 'chrome/test/data/extensio...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os PROFILE_TYPE_MAPPING = { 'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1', 'power_user': 'chrome/test/data/extensio...
Use correct profile for power_user.
[Telemetry] Use correct profile for power_user. TEST=None BUG=None NOTRY=True Review URL: https://chromiumcodereview.appspot.com/12775015 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@188294 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
sahiljain/catapult,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,benschmaus/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,benschmaus/catapult,Summe...
de7043594786780a29d5451f5ec21132634ec878
wsgiproxy/requests_client.py
wsgiproxy/requests_client.py
# -*- coding: utf-8 -*- import requests class HttpClient(object): """A HTTP client using requests""" default_options = dict(verify=False, allow_redirects=False) def __init__(self, chunk_size=1024 * 24, **requests_options): options = self.default_options.copy() options.update(requests_opt...
# -*- coding: utf-8 -*- import requests class HttpClient(object): """A HTTP client using requests""" default_options = dict(verify=False, allow_redirects=False) def __init__(self, chunk_size=1024 * 24, session=None, **requests_options): options = self.default_options.copy() options.updat...
Allow custom session object for the requests backend.
Allow custom session object for the requests backend.
Python
mit
gawel/WSGIProxy2
d8a4cfcf50462050d186d086733ee9cbb2a2ec3b
imhotep_jsl/plugin.py
imhotep_jsl/plugin.py
from imhotep.tools import Tool from collections import defaultdict import re class JSL(Tool): regex = re.compile( r'^(?P<type>[WE]) ' r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$') def invoke(self, dirname, filenames=set()): retval = defaultdict(lambda: defaultdict(list...
from imhotep.tools import Tool from collections import defaultdict import re class JSL(Tool): regex = re.compile( r'^(?P<type>[WE]) ' r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$') def invoke(self, dirname, filenames=set(), linter_configs=set()): retval = defaultdict(la...
Update for api change with linter_configs.
Update for api change with linter_configs.
Python
mit
hayes/imhotep_jsl
35fb8c91bac3d68d255223b20dbbfd84ab34b3b1
quant/ichimoku/ichimoku_test.py
quant/ichimoku/ichimoku_test.py
import pandas as pd import numpy as np import os #from ta import ichimoku from util import get_data, plot_data from pandas import DataFrame, Series from technical_analysis import ichimoku from datetime import datetime, timedelta,date import os import time import sys import getopt,argparse def test_run(stock='000725'...
import pandas as pd import numpy as np import os #from ta import ichimoku from util import get_data, plot_data from pandas import DataFrame, Series from technical_analysis import ichimoku from datetime import datetime, timedelta,date import os import time import sys import getopt,argparse MAX_ROLLING = 100 def test_r...
Add the missing data for ichimoku with additional data fed
Add the missing data for ichimoku with additional data fed
Python
apache-2.0
yunfeiz/py_learnt
bd2636db55396cac2ff6766593d5082562d865e2
lightning/types/decorators.py
lightning/types/decorators.py
from lightning import Lightning def viztype(VizType): def plotter(self, *args, **kwargs): viz = VizType.baseplot(self.session, VizType._name, *args, **kwargs) self.session.visualizations.append(viz) return viz if not hasattr(VizType,'_func'): func = VizType._name else: ...
from lightning import Lightning def viztype(VizType): def plotter(self, *args, **kwargs): if not hasattr(self, 'session'): self.create_session() viz = VizType.baseplot(self.session, VizType._name, *args, **kwargs) self.session.visualizations.append(viz) return viz ...
Create session if one doesn't exist
Create session if one doesn't exist
Python
mit
peterkshultz/lightning-python,garretstuber/lightning-python,lightning-viz/lightning-python,garretstuber/lightning-python,garretstuber/lightning-python,lightning-viz/lightning-python,peterkshultz/lightning-python,peterkshultz/lightning-python
dc6c8b77ea944e97a9f49dd1f7ae2244f4cad2ca
bluebottle/test/factory_models/organizations.py
bluebottle/test/factory_models/organizations.py
import factory from bluebottle.organizations.models import OrganizationContact, Organization, OrganizationMember from .geo import CountryFactory from .accounts import BlueBottleUserFactory class OrganizationFactory(factory.DjangoModelFactory): class Meta(object): model = Organization name = factory....
import factory from bluebottle.organizations.models import OrganizationContact, Organization from .geo import CountryFactory from .accounts import BlueBottleUserFactory class OrganizationFactory(factory.DjangoModelFactory): class Meta(object): model = Organization name = factory.Sequence(lambda n: '...
Remove unused org member in factory
Remove unused org member in factory
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
ee2cb8687f6e4ecddfef797cc63c7daa40731dc8
user_management/models/tests/factories.py
user_management/models/tests/factories.py
import factory from django.contrib.auth import get_user_model class UserFactory(factory.DjangoModelFactory): FACTORY_FOR = get_user_model() name = factory.Sequence(lambda i: 'Test User {}'.format(i)) email = factory.Sequence(lambda i: 'email{}@example.com'.format(i)) @classmethod def _prepare(cl...
import factory from django.contrib.auth import get_user_model class UserFactory(factory.DjangoModelFactory): FACTORY_FOR = get_user_model() name = factory.Sequence(lambda i: 'Test User {}'.format(i)) email = factory.Sequence(lambda i: 'email{}@example.com'.format(i)) password = factory.PostGeneration...
Use PostGenerationMethodCall instead of _prepare.
Use PostGenerationMethodCall instead of _prepare.
Python
bsd-2-clause
incuna/django-user-management,incuna/django-user-management
275257cfcf17fa1d2498e64735754cb4b8a3f2e8
floo/sublime.py
floo/sublime.py
import sys from collections import defaultdict import time timeouts = defaultdict(list) top_timeout_id = 0 cancelled_timeouts = set() def windows(*args, **kwargs): return [] def set_timeout(func, timeout, *args, **kwargs): global top_timeout_id timeout_id = top_timeout_id top_timeout_id + 1 if...
import sys from collections import defaultdict import time timeouts = defaultdict(list) top_timeout_id = 0 cancelled_timeouts = set() calling_timeouts = False def windows(*args, **kwargs): return [] def set_timeout(func, timeout, *args, **kwargs): global top_timeout_id timeout_id = top_timeout_id ...
Stop exception if someone calls timeouts from a timeout.
Stop exception if someone calls timeouts from a timeout.
Python
apache-2.0
Floobits/floobits-emacs
a02f2a1ba8f2cbf0cda0a6b8b794c4970bb4b4f2
hackfmi/urls.py
hackfmi/urls.py
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'hackfmi.views.home', name='home'), # url(r'^hackfmi/', include('hackfmi.foo.urls')), # Unc...
from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'hackfmi.views.home', name='home'), # url(r'^hackfmi/', include...
Add url for media files
Add url for media files
Python
mit
Hackfmi/Diaphanum,Hackfmi/Diaphanum
4095b95930a57e78e35592dba413a776959adcde
logistic_order/model/sale_order.py
logistic_order/model/sale_order.py
# -*- coding: utf-8 -*- from openerp.osv import orm, fields class sale_order(orm.Model): _inherit = 'sale.order' _columns = { # override only to change the 'string' argument # from 'Customer' to 'Requesting Entity' 'partner_id': fields.many2one( 'res.partner', ...
# -*- coding: utf-8 -*- from openerp.osv import orm, fields class sale_order(orm.Model): _inherit = 'sale.order' _columns = { # override only to change the 'string' argument # from 'Customer' to 'Requesting Entity' 'partner_id': fields.many2one( 'res.partner', ...
Rename state of SO according to LO and Cost Estimate
[IMP] Rename state of SO according to LO and Cost Estimate
Python
agpl-3.0
yvaucher/vertical-ngo,mdietrichc2c/vertical-ngo,jorsea/vertical-ngo,gurneyalex/vertical-ngo,jorsea/vertical-ngo,jgrandguillaume/vertical-ngo
be8b6e9b3cd81a22d85046c769e0d267b41004e3
MoMMI/types.py
MoMMI/types.py
class SnowflakeID(int): """ Represents a Discord Snowflake ID. """ pass
from typing import Union class SnowflakeID(int): """ Represents a Discord Snowflake ID. """ pass MIdentifier = Union[SnowflakeID, str]
Add string and snowflake identifier union.
Add string and snowflake identifier union.
Python
mit
PJB3005/MoMMI,PJB3005/MoMMI,PJB3005/MoMMI
e10af1954feb6834da02ab5e641f0fe7a1785b0e
soapbox/templatetags/soapbox.py
soapbox/templatetags/soapbox.py
from django import template from soapbox.models import Message register = template.Library() class MessagesForPageNode(template.Node): def __init__(self, url, varname): self.url = template.Variable(url) self.varname = varname def render(self, context): try: url = self.u...
from django import template from ..models import Message register = template.Library() class MessagesForPageNode(template.Node): def __init__(self, url, varname): self.url = template.Variable(url) self.varname = varname def render(self, context): try: url = self.url.res...
Clean up the template tags module a bit.
Clean up the template tags module a bit.
Python
bsd-3-clause
ubernostrum/django-soapbox,ubernostrum/django-soapbox
5c43036e44e94d55c86567d4e98689acde0510e5
app/py/cuda_sort/sort_sep.py
app/py/cuda_sort/sort_sep.py
from cudatext import * def _sort(s, sep_k, sep_v): if not sep_k in s: return s key, val = s.split(sep_k, 1) vals = sorted(val.split(sep_v)) return key+sep_k+sep_v.join(vals) def do_sort_sep_values(): while 1: res = dlg_input_ex(2, 'Sort: separator chars', ...
from cudatext import * def _sort(s, sep_k, sep_v): if sep_k: if not sep_k in s: return s key, val = s.split(sep_k, 1) vals = sorted(val.split(sep_v)) return key+sep_k+sep_v.join(vals) else: vals = sorted(s.split(sep_v)) return sep_v.join(vals) def ...
Sort new cmd: allow empty separator
Sort new cmd: allow empty separator
Python
mpl-2.0
Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText
5e80122c20e04b9208f6bc4ce13bc7ab7f757ff8
web/impact/impact/v1/helpers/matching_criterion_helper.py
web/impact/impact/v1/helpers/matching_criterion_helper.py
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from django.db.models import Q from impact.v1.helpers.criterion_helper import CriterionHelper class MatchingCriterionHelper(CriterionHelper): def __init__(self, subject): super().__init__(subject) self._app_ids_to_targets = {} self._t...
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from django.db.models import Q from impact.v1.helpers.criterion_helper import CriterionHelper class MatchingCriterionHelper(CriterionHelper): def __init__(self, subject): super().__init__(subject) self._app_ids_to_targets = {} self._t...
Remove dead code and minor refactor
[AC-5625] Remove dead code and minor refactor
Python
mit
masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api
ba8939167379633b5b572cd7b70c477f101b95dd
application.py
application.py
#!/usr/bin/env python import os from app import create_app from flask.ext.script import Manager, Server application = create_app(os.getenv('FLASH_CONFIG') or 'default') manager = Manager(application) manager.add_command("runserver", Server(port=5003)) if __name__ == '__main__': manager.run()
#!/usr/bin/env python import os from app import create_app from flask.ext.script import Manager, Server application = create_app( os.getenv('DM_SUPPLIER_FRONTEND_ENVIRONMENT') or 'default' ) manager = Manager(application) manager.add_command("runserver", Server(port=5003)) if __name__ == '__main__': manager....
Rename FLASH_CONFIG to match common convention
Rename FLASH_CONFIG to match common convention
Python
mit
mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphag...
4ab6009a01f71abaff72db7311f3a74d88ec524c
examples/pax_mininet_node.py
examples/pax_mininet_node.py
# coding: latin-1 """ pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node. """ from mininet.node import Node from mininet.log import info, warn class PaxNode( Node ): "PaxNode: A node which allows Pax to behave as the sole packet hander on that node." def __in...
# coding: latin-1 """ pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node. """ from mininet.node import Node from mininet.log import info, warn class PaxNode( Node ): "PaxNode: A node which allows Pax to behave as the sole packet hander on that node." def __in...
Disable ip_forward in the Pax Mininet node class
Disable ip_forward in the Pax Mininet node class
Python
apache-2.0
niksu/pax,TMVector/pax,niksu/pax,TMVector/pax,niksu/pax
5d634511af87150cf1e1b57c52b2bb7136890eb4
twilix/cmd.py
twilix/cmd.py
import os import subprocess import errno def cmd_pwd(*args): return subprocess.check_output(['pwd']) def cmd_ls(*args): return subprocess.check_output(*args) def cmd_cd(*args): if path[0] == '~': path[0] = os.path.expanduser(path[0]) os.chdir(path[0]) return run_pwd() def cmd_mkdir(*args...
import os import subprocess import errno def cmd_pwd(*args): return subprocess.check_output(['pwd']) def cmd_ls(*args): return subprocess.check_output(*args) def cmd_cd(*args): if args[0][1] == '~': args[0][1] = os.path.expanduser(args[0][1]) os.chdir(args[0][1]) return cmd_pwd() def cmd...
Add option tu run piped commands
Add option tu run piped commands
Python
mit
ueg1990/twilix,ueg1990/twilix
c5467b2ad4fbb0dbc37809df077e5c69915489c9
go_cli/send.py
go_cli/send.py
""" Send messages via an HTTP API (nostream) conversation. """ import click from go_http.send import HttpApiSender @click.option( '--conversation', '-c', help='HTTP API conversation key') @click.option( '--token', '-t', help='HTTP API conversation token') @click.option( '--csv', type=click.File(...
""" Send messages via an HTTP API (nostream) conversation. """ import csv import json import click from go_http.send import HttpApiSender @click.option( '--conversation', '-c', help='HTTP API conversation key') @click.option( '--token', '-t', help='HTTP API conversation token') @click.option( '...
Add CSV and JSON parsing.
Add CSV and JSON parsing.
Python
bsd-3-clause
praekelt/go-cli,praekelt/go-cli
a154db2de427a31746c51c39077c6020f70478b6
export.py
export.py
#! /usr/bin/env python3 import sqlite3 import bcrypt import hashlib from Crypto.Cipher import AES import codecs import json from password import encrypt, decrypt, toHex, fromHex pwdatabase = 'passwords.db' jsonfile = open('passwords.json', mode='w') password = input('Enter password: ') conn = sqlite3.connect(pwdata...
#! /usr/bin/env python3 import sqlite3 import bcrypt import hashlib from Crypto.Cipher import AES import codecs import json from password import encrypt, decrypt, toHex, fromHex pwdatabase = 'passwords.db' jsonfile = open('passwords.json', mode='w') password = input('Enter password: ') conn = sqlite3.connect(pwdata...
Print encrypted records for debugging.
Print encrypted records for debugging.
Python
mit
tortxof/cherry-password,tortxof/cherry-password,tortxof/cherry-password
6663f7baefd68a059c963d464afaf3fcbfbdf2db
tests/markdown/MarkdownBearTest.py
tests/markdown/MarkdownBearTest.py
from bears.markdown.MarkdownBear import MarkdownBear from coalib.testing.LocalBearTestHelper import verify_local_bear test_file1 = """1. abc 1. def """ test_file2 = """1. abc 2. def """ test_file3 = """1. abcdefghijklm 2. nopqrstuvwxyz """ MarkdownBearTest = verify_local_bear(MarkdownBear, ...
import unittest from queue import Queue from bears.markdown.MarkdownBear import MarkdownBear from coalib.testing.BearTestHelper import generate_skip_decorator from coalib.testing.LocalBearTestHelper import verify_local_bear, execute_bear from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.settings.S...
Add test to check message for error
MarkdownBear: Add test to check message for error A better test for MarkdownBear to check the exact message of the result for a maximum line length error. Related to https://github.com/coala/coala-bears/issues/1235
Python
agpl-3.0
Asnelchristian/coala-bears,damngamerz/coala-bears,aptrishu/coala-bears,srisankethu/coala-bears,incorrectusername/coala-bears,yash-nisar/coala-bears,Shade5/coala-bears,madhukar01/coala-bears,naveentata/coala-bears,shreyans800755/coala-bears,damngamerz/coala-bears,Vamshi99/coala-bears,shreyans800755/coala-bears,horczech/...
deadcc641c0ff544e8074ad79808d3ce292892a3
open_folder.py
open_folder.py
import os, platform # I intend to hide the Operating Specific details of opening a folder # here in this module. # # On Mac OS X you do this with "open" # e.g. "open '\Users\golliher\Documents\Tickler File'" # On Windows you do this with "explorer" # e.g. "explorer c:\Documents and Settings\Tickler File" def op...
import os, platform # I intend to hide the Operating Specific details of opening a folder # here in this module. # # On Mac OS X you do this with "open" # e.g. "open '\Users\golliher\Documents\Tickler File'" # On Windows you do this with "explorer" # e.g. "explorer c:\Documents and Settings\Tickler File" # On Lin...
Raise exception if we don't know how to handle users operating system
Raise exception if we don't know how to handle users operating system
Python
mit
golliher/dg-tickler-file
e92b45ad68b665095cfce5daea7ff82550fcbfb1
psqtraviscontainer/printer.py
psqtraviscontainer/printer.py
# /psqtraviscontainer/printer.py # # Utility functions for printing unicode text. # # See /LICENCE.md for Copyright information """Utility functions for printing unicode text.""" import sys def unicode_safe(text): """Print text to standard output, handle unicode.""" # Don't trust non-file like replacements o...
# /psqtraviscontainer/printer.py # # Utility functions for printing unicode text. # # See /LICENCE.md for Copyright information """Utility functions for printing unicode text.""" import sys def unicode_safe(text): """Print text to standard output, handle unicode.""" # If a replacement of sys.stdout doesn't h...
Check for the isatty property on sys.stdout.
Check for the isatty property on sys.stdout. Previously we were checking to see if it was of type "file", but the type changed between python 2 and 3. Really, all we want to do is check if it is a tty and if we can't be sure of that, don't enable utf8 output.
Python
mit
polysquare/polysquare-travis-container
4e584b66db979878d413cfae4e6e9d085d40f811
main/modelx.py
main/modelx.py
# -*- coding: utf-8 -*- import hashlib class BaseX(object): @classmethod def retrieve_one_by(cls, name, value): cls_db_list = cls.query(getattr(cls, name) == value).fetch(1) if cls_db_list: return cls_db_list[0] return None class ConfigX(object): @classmethod def get_master_db(cls): r...
# -*- coding: utf-8 -*- import hashlib class BaseX(object): @classmethod def retrieve_one_by(cls, name, value): cls_db_list = cls.query(getattr(cls, name) == value).fetch(1) if cls_db_list: return cls_db_list[0] return None class ConfigX(object): @classmethod def get_master_db(cls): r...
Support for size of gravatar image
Support for size of gravatar image Added support for the size (s) argument in the Gravatar API
Python
mit
tonyin/optionstg,gae-init/gae-init-babel,d4rr3ll/gae-init-docker,lipis/the-smallest-creature,lipis/the-smallest-creature,lipis/the-smallest-creature,gmist/alice-box,gae-init/gae-init-upload,mdxs/gae-init,mdxs/gae-init,lovesoft/gae-init,wilfriedE/gae-init,JoeyCodinja/INFO3180LAB3,topless/gae-init,gmist/five-studio2,geor...
d63480d00206a08a3e41c6af7512181198aced05
object_join.py
object_join.py
__author__ = 'stuart' class JoinedObject(object): def __init__(self, left, right): self.left = left self.right = right def __getattr__(self, attr): if attr == 'left': return self.left elif attr == 'right': return self.right else: ret...
__author__ = 'stuart' class JoinedObject(object): def __init__(self, left, right): self.left = left self.right = right def __getattr__(self, attr): if attr == 'left': return self.left elif attr == 'right': return self.right else: ret...
Add proper `__dir__` reporting, fix bug in AttributeError
Add proper `__dir__` reporting, fix bug in AttributeError
Python
mit
StuartAxelOwen/datastreams
403250e91905079c7480bb8ea54cf2d2a301022f
moto/s3/urls.py
moto/s3/urls.py
from .responses import S3ResponseInstance url_bases = [ "https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3.amazonaws.com" ] url_paths = { '{0}/$': S3ResponseInstance.bucket_response, '{0}/(?P<key_name>[a-zA-Z0-9\-_.]+)': S3ResponseInstance.key_response, }
from .responses import S3ResponseInstance url_bases = [ "https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3.amazonaws.com" ] url_paths = { '{0}/$': S3ResponseInstance.bucket_response, '{0}/(?P<key_name>.+)': S3ResponseInstance.key_response, }
Fix S3 URL Regex to allow slashes in key names.
Fix S3 URL Regex to allow slashes in key names.
Python
apache-2.0
heddle317/moto,gjtempleton/moto,rocky4570/moto,jszwedko/moto,dbfr3qs/moto,okomestudio/moto,whummer/moto,2rs2ts/moto,Brett55/moto,ZuluPro/moto,whummer/moto,kefo/moto,ZuluPro/moto,botify-labs/moto,rocky4570/moto,rocky4570/moto,whummer/moto,spulec/moto,Brett55/moto,william-richard/moto,2rs2ts/moto,rocky4570/moto,jrydberg/...
802bed896c147fc6bb6dc72f62a80236bc3cd263
soccermetrics/rest/resources/personnel.py
soccermetrics/rest/resources/personnel.py
from soccermetrics.rest.resources import Resource class Personnel(Resource): """ Represents a Personnel REST resource (/personnel/<resource> endpoint). The Personnel resources let you access biographic and demographic data on all personnel involved in a football match – players, managers, and matc...
from soccermetrics.rest.resources import Resource class Personnel(Resource): """ Represents a Personnel REST resource (/personnel/<resource> endpoint). The Personnel resources let you access biographic and demographic data on the following personnel involved in a football match: * Players, ...
Remove stray non-ASCII character in docstring
Remove stray non-ASCII character in docstring
Python
mit
soccermetrics/soccermetrics-client-py
4a62214f0c9e8789b8453a48c0a880c4ac6236cb
saleor/product/migrations/0123_auto_20200904_1251.py
saleor/product/migrations/0123_auto_20200904_1251.py
# Generated by Django 3.1 on 2020-09-04 12:51 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("product", "0122_auto_20200828_1135"), ] operations = [ migrations.AlterUniqueTogether( name="variantimage", unique_together={("variant", "...
# Generated by Django 3.1 on 2020-09-04 12:51 from django.db import migrations from django.db.models import Count def remove_variant_image_duplicates(apps, schema_editor): ProductImage = apps.get_model("product", "ProductImage") VariantImage = apps.get_model("product", "VariantImage") duplicated_images ...
Drop duplicated VariantImages before migration to unique together
Drop duplicated VariantImages before migration to unique together
Python
bsd-3-clause
mociepka/saleor,mociepka/saleor,mociepka/saleor
874acdfcca178759e39c154f5f2c844710db7ab0
json_field/__init__.py
json_field/__init__.py
try: from json_field.fields import JSONField except ImportError: pass # fails when imported by setup.py, no worries __version__ = '0.4.2'
from django.core.exceptions import ImproperlyConfigured try: from json_field.fields import JSONField except (ImportError, ImproperlyConfigured): pass # fails when imported by setup.py, no worries __version__ = '0.4.2'
Fix install with Django 1.5.
Fix install with Django 1.5.
Python
bsd-3-clause
doordash/django-json-field,hoh/django-json-field,EyePulp/django-json-field,derek-schaefer/django-json-field,matllubos/django-json-field
770c898e205e1c927e3371402a3ebba32471d4a7
actions/run.py
actions/run.py
import requests import urllib import urlparse from st2actions.runners.pythonrunner import Action class ActiveCampaignAction(Action): def run(self, **kwargs): if kwargs['api_key'] is None: kwargs['api_key'] = self.config['api_key'] return self._get_request(kwargs) def _get_r...
import requests import urllib import urlparse from st2actions.runners.pythonrunner import Action class ActiveCampaignAction(Action): def run(self, **kwargs): if kwargs['api_key'] is None: kwargs['api_key'] = self.config['api_key'] return self._get_request(kwargs) def _get_r...
Remove extraneous logging and bad param
Remove extraneous logging and bad param
Python
apache-2.0
DoriftoShoes/activecampaign
615d036c6735d94609d6398dff676cd8e3a8f58a
app/__init__.py
app/__init__.py
import os from flask import Flask from flask.ext.bootstrap import Bootstrap from config import config from datetime import timedelta from .main import main as main_blueprint from .main.helpers.auth import requires_auth bootstrap = Bootstrap() def create_app(config_name): application = Flask(__name__) applic...
from flask import Flask from flask.ext.bootstrap import Bootstrap from config import config from datetime import timedelta from .main import main as main_blueprint from .main.helpers.auth import requires_auth bootstrap = Bootstrap() def create_app(config_name): application = Flask(__name__, ...
Set static path for the Flask app
Set static path for the Flask app
Python
mit
alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace...
c86c90f5be35359b5bd87b956bdd0d7d0021cfea
busstops/management/commands/import_scotch_operator_contacts.py
busstops/management/commands/import_scotch_operator_contacts.py
""" Usage: ./manage.py import_scotch_operator_contacts < NOC_DB.csv """ import requests from ..import_from_csv import ImportFromCSVCommand from ...models import Operator class Command(ImportFromCSVCommand): scotch_operators = { operator['code']: operator for operator in requests.get('http://...
""" Usage: ./manage.py import_scotch_operator_contacts < NOC_DB.csv """ import requests from ..import_from_csv import ImportFromCSVCommand from ...models import Operator class Command(ImportFromCSVCommand): scotch_operators = { operator['code']: operator for operator in requests.get('http://...
Fix scotch operator contact import
Fix scotch operator contact import
Python
mpl-2.0
stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk
582428262daa447d3c4cc06c1b7961fdafd96b59
src/zeit/content/volume/tests/test_reference.py
src/zeit/content/volume/tests/test_reference.py
import zeit.cms.content.interfaces import zeit.content.article.edit.volume import zeit.content.volume.testing import zope.component class VolumeReferenceTest(zeit.content.volume.testing.FunctionalTestCase): def setUp(self): from zeit.content.volume.volume import Volume super(VolumeReferenceTest, ...
import lxml.objectify import zeit.cms.content.interfaces import zeit.content.article.edit.volume import zeit.content.volume.testing import zope.component class VolumeReferenceTest(zeit.content.volume.testing.FunctionalTestCase): def setUp(self): from zeit.content.volume.volume import Volume super...
Rewrite test to how IReference actually works
BUG-633: Rewrite test to how IReference actually works
Python
bsd-3-clause
ZeitOnline/zeit.content.volume,ZeitOnline/zeit.content.volume
8be5e7f7945a47dd0cc6efb57d882f10c9686f2f
pava/demo.py
pava/demo.py
import pava # Tell pava where it can find Java user-defined classes pava.set_classpath(['c:/Users/laffr/PycharmProjects/pava/pava']) try: import java class Out(object): def println(self, s): print s java.lang.System.out = Out() except ImportError: pass # Load a Java class and ca...
import os import pava # Tell pava where it can find Java user-defined classes print '1. Loading Java...' pava.set_classpath([os.path.dirname(__file__)]) try: import java class Out(object): def println(self, s): print s java.lang.System.out = Out() except ImportError: pass # # Loa...
Make the classpath relative, not absolute and add some steps.
Make the classpath relative, not absolute and add some steps.
Python
mit
laffra/pava,laffra/pava
d08973c3854d10755e156b1457972a8aaebb251b
bottle_utils/form/__init__.py
bottle_utils/form/__init__.py
""" .. module:: bottle_utils.form :synopsis: Form processing and validation library .. moduleauthor:: Outernet Inc <hello@outernet.is> """ from .exceptions import ValidationError from .fields import (DormantField, Field, StringField, PasswordField, ...
""" .. module:: bottle_utils.form :synopsis: Form processing and validation library .. moduleauthor:: Outernet Inc <hello@outernet.is> """ from .exceptions import ValidationError from .fields import (DormantField, Field, StringField, PasswordField, ...
Include LengthValidator in list of exporeted objects
Include LengthValidator in list of exporeted objects Signed-off-by: Branko Vukelic <26059cc39872530f89fec69552bb1050e1cc2caa@outernet.is>
Python
bsd-2-clause
Outernet-Project/bottle-utils
039f6fa4b26b747432138a8bf9e2754c6daafec3
byceps/blueprints/api/decorators.py
byceps/blueprints/api/decorators.py
""" byceps.blueprints.api.decorators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from functools import wraps from typing import Optional from flask import abort, request from werkzeug.datastructures import WWWAuthenticate fro...
""" byceps.blueprints.api.decorators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from functools import wraps from typing import Optional from flask import abort, request from werkzeug.datastructures import WWWAuthenticate fro...
Add `invalid_token` error to `WWW-Authenticate` header if API token is suspended
Add `invalid_token` error to `WWW-Authenticate` header if API token is suspended
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
ed4fea914435b934cf8f0539cfbf31ece15130b9
trunk/bdp_fe/src/bdp_fe/jobconf/models.py
trunk/bdp_fe/src/bdp_fe/jobconf/models.py
from django.db import models # Create your models here.
""" Module bdp_fe.jobconf.models Create your models here. """ from django.db import models class Job(models.Model): """ A Job is a calculation to be run on the BDP """ date = models.DateTimeField('date created')
Include a first model, Job
Include a first model, Job
Python
apache-2.0
telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform
3356cd0c5c85a09107a6ba48e028a54eb5ca076c
script.py
script.py
import ast import click from parsing.parser import FileVisitor @click.command() @click.argument('code', type=click.File('rb')) @click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file') @click.option('--remove-builtins', default=False, is_flag=True, help='...
import ast import click from graphing.graph import FunctionGrapher from parsing.parser import FileVisitor @click.command() @click.argument('code', type=click.File('rb')) @click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file') @click.option('--remove-bui...
Add graphviz file output argument
Add graphviz file output argument
Python
mit
LaurEars/codegrapher
fd7eef57a562f2963500d34cbbeb607913b5bb21
txircd/modules/extra/extban_registered.py
txircd/modules/extra/extban_registered.py
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from txircd.utils import ircLower from zope.interface import implements class RExtbans(ModuleData): implements(IPlugin, IModuleData) name = "RExtbans" # R extbans take the following forms: # "R:*" Match any...
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from txircd.utils import ircLower from zope.interface import implements class RExtbans(ModuleData): implements(IPlugin, IModuleData) name = "RExtbans" # R extbans take the following forms: # "R:*" Match any...
Remove a user's statuses in all channels when they logout
Remove a user's statuses in all channels when they logout
Python
bsd-3-clause
Heufneutje/txircd,ElementalAlchemist/txircd
b1271aed5f6f5d465fe9d250737d5074dac9d45a
tests/integration/test_mmhint.py
tests/integration/test_mmhint.py
from __future__ import print_function, division, absolute_import import glob import pytest from psautohint.autohint import ACOptions, hintFiles from .differ import main as differ from . import make_temp_copy, DATA_DIR class Options(ACOptions): def __init__(self, reference, inpaths, outpaths): super(Op...
from __future__ import print_function, division, absolute_import import glob import pytest from psautohint.autohint import ACOptions, ACHintError, hintFiles from .differ import main as differ from . import make_temp_copy, DATA_DIR class Options(ACOptions): def __init__(self, reference, inpaths, outpaths): ...
Add test for incompatible masters
Add test for incompatible masters
Python
apache-2.0
khaledhosny/psautohint,khaledhosny/psautohint
0aa0d4658518417f15cb58e80c5099e22ef9b806
app/models.py
app/models.py
from flask_login import UserMixin import spotify import spotipy import db_utils import application as app class User(UserMixin): ''' User class for Flask-Login ''' def __init__(self, user_id, username=None): self.id = int(user_id) self.username = username self._spotify = None @pro...
from flask_login import UserMixin import spotify import spotipy import db_utils import application as app class User(UserMixin): ''' User class for Flask-Login ''' def __init__(self, user_id, username=None): self.id = int(user_id) self.username = username self._spotify = None @pro...
Fix Spotify api object creation
Fix Spotify api object creation
Python
mit
DropMuse/DropMuse,DropMuse/DropMuse
9ff59c13f0c1295e9a0acd45913f00d8c9a5c0af
mongoctl/errors.py
mongoctl/errors.py
__author__ = 'abdul' ############################################################################### # Mongoctl Exception class ############################################################################### class MongoctlException(Exception): def __init__(self, message,cause=None): self.message = messag...
__author__ = 'abdul' ############################################################################### # Mongoctl Exception class ############################################################################### class MongoctlException(Exception): def __init__(self, message, cause=None): super(MongoctlExcepti...
Remove ref to deprecated "message" property of BaseException
Remove ref to deprecated "message" property of BaseException
Python
mit
mongolab/mongoctl
6acdef03da862c6daa7d2b4cc333933afb3f912a
piper/utils.py
piper/utils.py
class DotDict(object): """ Immutable dict-like objects accessible by dot notation Used because the amount of configuration access is very high and just using dots instead of the dict notation feels good. """ def __init__(self, data): self.data = data def __repr__(self): # pragma...
class DotDict(object): """ Immutable dict-like objects accessible by dot notation Used because the amount of configuration access is very high and just using dots instead of the dict notation feels good. """ def __init__(self, data): self.data = data def __repr__(self): # pragma...
Make DotDict dict methods return those objects
Make DotDict dict methods return those objects
Python
mit
thiderman/piper
17a28964785f3eb39f96d07968358b20be12e30e
marathon/exceptions.py
marathon/exceptions.py
class MarathonError(Exception): pass class MarathonHttpError(MarathonError): def __init__(self, response): """ :param :class:`requests.Response` response: HTTP response """ content = response.json() self.status_code = response.status_code self.error_message = c...
class MarathonError(Exception): pass class MarathonHttpError(MarathonError): def __init__(self, response): """ :param :class:`requests.Response` response: HTTP response """ self.error_message = response.reason or '' if response.content: content = response.j...
Handle HTTP errors without content graceful
Handle HTTP errors without content graceful HTTP errors like 503 do not have a content set by Marathon. Try to use the response reason string as an alternative error message.
Python
mit
thefactory/marathon-python,thefactory/marathon-python
dabc1f4a869f8da5106248dcf860c75d1fe9f538
geotrek/common/management/commands/update_permissions.py
geotrek/common/management/commands/update_permissions.py
import logging from django.conf import settings from django.utils.importlib import import_module from django.db.models import get_apps from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.c...
import logging from django.conf import settings from django.utils.importlib import import_module from django.db.models import get_apps from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.c...
Fix update_permission command for legacy content types
Fix update_permission command for legacy content types
Python
bsd-2-clause
johan--/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek,Anaethelion/Geot...
60bdc3cb6d503e675f029a6d2bbf4941267a2087
pysswords/__main__.py
pysswords/__main__.py
import os import argparse def default_db(): return os.path.join(os.path.expanduser("~"), "~/.pysswords") def parse_args(args): parser = argparse.ArgumentParser(prog="Pysswords") group_init = parser.add_argument_group("Init options") group_init.add_argument("-I", "--init", action="store_true") g...
import os import argparse def default_db(): return os.path.join(os.path.expanduser("~"), "~/.pysswords") def parse_args(args): parser = argparse.ArgumentParser(prog="Pysswords") group_db = parser.add_argument_group("Databse options") group_db.add_argument("-I", "--init", action="store_true") gr...
Refactor parse args db options
Refactor parse args db options
Python
mit
scorphus/passpie,eiginn/passpie,marcwebbie/passpie,marcwebbie/pysswords,eiginn/passpie,scorphus/passpie,marcwebbie/passpie
b371ec9e8d1fc15c2d3e1093b305b4c8e0944694
corehq/apps/locations/middleware.py
corehq/apps/locations/middleware.py
from .permissions import is_location_safe, location_restricted_response class LocationAccessMiddleware(object): """ Many large projects want to restrict data access by location. Views which handle that properly are called "location safe". This middleware blocks access to any non location safe features...
from .permissions import is_location_safe, location_restricted_response class LocationAccessMiddleware(object): """ Many large projects want to restrict data access by location. Views which handle that properly are called "location safe". This middleware blocks access to any non location safe features...
Clarify usage in docstring
Clarify usage in docstring [ci skip]
Python
bsd-3-clause
qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
b7ea2db86ad67410330d412a8733cb4dab2c4109
partner_academic_title/models/partner_academic_title.py
partner_academic_title/models/partner_academic_title.py
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of partner_academic_title, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # partner_academic_title is free software: # you can redistribute it an...
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of partner_academic_title, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # partner_academic_title is free software: # you can redistribute it an...
Add translate=True on academic title name
Add translate=True on academic title name
Python
agpl-3.0
sergiocorato/partner-contact
364cb2307021cc11de5a31f577e12a5f3e1f6bf6
openpathsampling/engines/toy/snapshot.py
openpathsampling/engines/toy/snapshot.py
""" @author: JD Chodera @author: JH Prinz """ from openpathsampling.engines import BaseSnapshot, SnapshotFactory import openpathsampling.engines.features as feats from . import features as toy_feats @feats.attach_features([ toy_feats.velocities, toy_feats.coordinates, toy_feats.instantaneous_temperature...
""" @author: JD Chodera @author: JH Prinz """ from openpathsampling.engines import BaseSnapshot, SnapshotFactory from openpathsampling.engines import features as feats from . import features as toy_feats @feats.attach_features([ toy_feats.velocities, toy_feats.coordinates, toy_feats.instantaneous_temper...
Fix for bad merge decision
Fix for bad merge decision
Python
mit
openpathsampling/openpathsampling,dwhswenson/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsampling,openpathsampling/openpathsampling,openpathsampling/openpathsampling,choderalab/openp...
7eb580d11dc8506cf656021d12884562d1a1b823
dumper/site.py
dumper/site.py
from six import string_types from django.db.models import signals from .invalidation import invalidate_paths def register(model): register_instance_function_at_save(model, invalidate_model_paths) def register_instance_function_at_save(model, function): def save_function(sender, instance, **kwargs): ...
from six import string_types from django.db.models import signals from .invalidation import invalidate_paths def register(model): register_instance_function_at_save(model, invalidate_model_paths) def register_instance_function_at_save(model, function): def save_function(sender, instance, **kwargs): ...
Use keyword based `format` to maintain 2.6 compatibility
Use keyword based `format` to maintain 2.6 compatibility
Python
mit
saulshanabrook/django-dumper
91c33bdeea9214c9594d2d3f9bd1255403d62034
notify_levure_app_of_save.py
notify_levure_app_of_save.py
import sublime import sublime_plugin import re class LevureAppNotify(sublime_plugin.EventListener): def on_post_save(self, view): # 1. Get script only stack name. line 1: script "Name" [done] # 2. Get project key from project settings # 3. Send notification over socket with project key, scr...
import sublime import sublime_plugin import re import socket import urllib class LevureAppNotify(sublime_plugin.EventListener): def on_post_save(self, view): # 1. Get script only stack name. line 1: script "Name" [done] # 2. Get project key from project settings # 3. Send notification over ...
Send update notification to server
Send update notification to server
Python
mit
trevordevore/livecode-sublimetext
881ceeb7f814bf640caf2d7a803bfc2d350b082d
plumeria/storage/__init__.py
plumeria/storage/__init__.py
import aiomysql from .. import config from ..event import bus from .migration import MigrationManager host = config.create("storage", "host", fallback="localhost", comment="The database server host") port = config.create("storage", "port", type=int, fallback=3306, comment="The database server port") user = config.cre...
import aiomysql from .. import config from ..event import bus from .migration import MigrationManager host = config.create("storage", "host", fallback="localhost", comment="The database server host") port = config.create("storage", "port", type=int, fallback=3306, comment="The database server port") user = config.cre...
Make sure to set MySQL charset.
Make sure to set MySQL charset.
Python
mit
sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria
89b9fb1cb14aeb99cb7c96717830898aead4fef1
src/waldur_core/core/management/commands/createstaffuser.py
src/waldur_core/core/management/commands/createstaffuser.py
from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand, CommandError from django.utils import timezone class Command(BaseCommand): help = "Create a user with a specified username and password. User will be created as staff." def add_arguments(self, parser): ...
from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand, CommandError from django.utils import timezone class Command(BaseCommand): help = "Create a user with a specified username and password. User will be created as staff." def add_arguments(self, parser): ...
Allow setting email when creating a staff account.
Allow setting email when creating a staff account. Otherwise makes it hard to start using HomePort as it requires email validation.
Python
mit
opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind
5c9e9d33113c7fcf49223853abf52f1e91b17687
frappe/integrations/doctype/google_maps_settings/google_maps_settings.py
frappe/integrations/doctype/google_maps_settings/google_maps_settings.py
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document import googlemaps import datetime class GoogleMapsSettings(Document...
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import googlemaps import frappe from frappe import _ from frappe.model.document import Document class GoogleMapsSettings(Document): def valid...
Check if Google Maps is enabled when trying to get the client
Check if Google Maps is enabled when trying to get the client
Python
mit
adityahase/frappe,adityahase/frappe,ESS-LLP/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,yashodhank/frappe,RicardoJohann/frappe,yashodhank/frappe,ESS-LLP/frappe,frappe/frappe,mhbu50/frappe,saurabh6790/frappe,saurabh6790/frappe,adityahase/frappe,vjFaLk/frappe,yashodhank/frappe,mhbu50/frappe,vjFaLk/frappe,almeidapaul...
7f0121b4ade7a14f47cbf3d1573134dffaaf86ee
src/nodeconductor_assembly_waldur/slurm_invoices/apps.py
src/nodeconductor_assembly_waldur/slurm_invoices/apps.py
from django.apps import AppConfig from django.db.models import signals class SlurmInvoicesConfig(AppConfig): name = 'nodeconductor_assembly_waldur.slurm_invoices' verbose_name = 'SLURM invoices' def ready(self): from nodeconductor_assembly_waldur.invoices import registrators from waldur_s...
from django.apps import AppConfig from django.db.models import signals class SlurmInvoicesConfig(AppConfig): name = 'nodeconductor_assembly_waldur.slurm_invoices' verbose_name = 'Batch packages' def ready(self): from nodeconductor_assembly_waldur.invoices import registrators from waldur_s...
Rename SLURM invoices application for better Django dashoard menu item.
Rename SLURM invoices application for better Django dashoard menu item.
Python
mit
opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind
ecd7f5f46146fa9378000ac469f6eca8f64ac31d
stoq/tests/data/plugins/archiver/dummy_archiver/dummy_archiver.py
stoq/tests/data/plugins/archiver/dummy_archiver/dummy_archiver.py
#!/usr/bin/env python3 # Copyright 2014-2018 PUNCH Cyber Analytics Group # # 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 # # Un...
#!/usr/bin/env python3 # Copyright 2014-2018 PUNCH Cyber Analytics Group # # 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 # # Un...
Fix test signature value type for task
Fix test signature value type for task
Python
apache-2.0
PUNCH-Cyber/stoq
aadcb7f700391d1e1b8a6442198a9a2131e6f407
asyncio_irc/connection.py
asyncio_irc/connection.py
import asyncio from .message import Message class Connection: """ Communicates with an IRC network. Incoming data is transformed into Message objects, and sent to `listeners`. """ def __init__(self, listeners, host, port, ssl=True): self.listeners = listeners self.host = host ...
import asyncio from .message import Message class Connection: """ Communicates with an IRC network. Incoming data is transformed into Message objects, and sent to `listeners`. """ def __init__(self, listeners, host, port, ssl=True): self.listeners = listeners self.host = host ...
Move disconnect decision into Connection.handle
Move disconnect decision into Connection.handle
Python
bsd-2-clause
meshy/framewirc
eb7e36629a61515778029096370ccfb41399590f
bluebottle/activities/migrations/0018_auto_20200212_1025.py
bluebottle/activities/migrations/0018_auto_20200212_1025.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-02-12 09:25 from __future__ import unicode_literals from django.db import migrations, connection from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant from django.contrib.au...
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-02-12 09:25 from __future__ import unicode_literals from django.db import migrations, connection from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant from django.contrib.au...
Fix migration for new tenants
Fix migration for new tenants
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
b966f81af56d9f68414e72d30b0e3b3a49011ac4
node/lookup.py
node/lookup.py
import zmq class QueryIdent: def __init__(self): self._ctx = zmq.Context() self._socket = self._ctx.socket(zmq.REQ) # Point to OpenBazaar Identity server for now self._socket.connect("tcp://seed.openbazaar.org:5558") def lookup(self, user): self._socket.send(u...
import zmq class QueryIdent: def __init__(self): self._ctx = zmq.Context() self._socket = self._ctx.socket(zmq.REQ) # Point to OpenBazaar Identity server for now self._socket.connect("tcp://seed.openbazaar.org:5558") def lookup(self, user): self._socket.send(u...
Remove default cedes pointless search
Remove default cedes pointless search
Python
mit
yagoulas/OpenBazaar,tortxof/OpenBazaar,im0rtel/OpenBazaar,tortxof/OpenBazaar,akhavr/OpenBazaar,saltduck/OpenBazaar,dlcorporation/openbazaar,rllola/OpenBazaar,STRML/OpenBazaar,must-/OpenBazaar,kordless/OpenBazaar,bankonme/OpenBazaar,kujenga/OpenBazaar,tortxof/OpenBazaar,freebazaar/FreeBazaar,dlcorporation/openbazaar,Ren...
e93fa13dc27e0590786d9b12d40145c19dbd3794
podium/talks/models.py
podium/talks/models.py
from django.db import models TALK_STATUS_CHOICES = ( ('S', 'Submitted'), ('A', 'Approved'), ('R', 'Rejected'), ('C', 'Confirmed'), ) class Talk(models.Model): speaker_name = models.CharField(max_length=1000) speaker_email = models.CharField(max_length=1000) title = models.CharField(max_le...
from django.db import models from django.urls import reverse TALK_STATUS_CHOICES = ( ('S', 'Submitted'), ('A', 'Approved'), ('R', 'Rejected'), ('C', 'Confirmed'), ) class Talk(models.Model): speaker_name = models.CharField(max_length=1000) speaker_email = models.CharField(max_length=1000) ...
Use reverse to implement get_absolute_url.
Use reverse to implement get_absolute_url.
Python
mit
pyatl/podium-django,pyatl/podium-django,pyatl/podium-django
77492f53bf718d01fe6166f2a2e1f57203ce6852
class4/exercise5.py
class4/exercise5.py
from getpass import getpass import time from netmiko import ConnectHandler password = getpass() pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'username': 'pyclass', 'password': password, 'port': 8022} ssh_connection = ConnectHandler(**pynet_rtr2) time.sleep(2) ssh_connection.config_mode() output = ...
# Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode). from getpass import getpass import time from netmiko import ConnectHandler password = getpass() pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'usern...
Use PExpect to change the logging buffer size (logging buffered <size>) on pynet-rtr2. Verify this change by examining the output of 'show run'.
Use PExpect to change the logging buffer size (logging buffered <size>) on pynet-rtr2. Verify this change by examining the output of 'show run'.
Python
apache-2.0
linkdebian/pynet_course
bd0c2f19558033e68a5272dd84b153ff3f6fc9b3
py_controller_client/src/py_controller_client/waypoint_client.py
py_controller_client/src/py_controller_client/waypoint_client.py
#! /usr/bin/env python import rospy import actionlib import cpp_controller_msgs.msg def waypoint_client(): pass if __name__ == '__main__': try: rospy.init_node("waypoint_client_py") result = waypoint_client() print "Result:", result except rospy.ROSInterruptException as e: ...
#! /usr/bin/env python import rospy import actionlib from cpp_controller_msgs.msg import * from geometry_msgs.msg import Pose2D def waypoint_client(waypoints = []): # Create the client, passing the type of the action to the constructor. client = actionlib.SimpleActionClient("waypoint_following", ...
Add a simple Python action client
[py_controller_client] Add a simple Python action client
Python
bsd-3-clause
spmaniato/cs2024_ros_cpp_project,spmaniato/cs2024_ros_cpp_project
6c29585d1d47ff7cafc7f4fbc03abc977211e885
jasylibrary.py
jasylibrary.py
# Little helper to allow python modules in current jasylibrarys path import sys, os.path, inspect filename = inspect.getframeinfo(inspect.currentframe()).filename path = os.path.dirname(os.path.abspath(filename)) sys.path.append(path) import konstrukteur.Konstrukteur import jasy.asset.Manager @share def build(profil...
# Little helper to allow python modules in current jasylibrarys path import sys, os.path, inspect filename = inspect.getframeinfo(inspect.currentframe()).filename path = os.path.dirname(os.path.abspath(filename)) sys.path.append(path) import konstrukteur.Konstrukteur import jasy.asset.Manager @share def build(profil...
Fix detecting css output folder in different jasy versions
Fix detecting css output folder in different jasy versions
Python
mit
fastner/konstrukteur,fastner/konstrukteur,fastner/konstrukteur
0f68cbe43506db577e08a18f97cc8cba6f7367cf
combine/manifest.py
combine/manifest.py
# Copyright (c) 2010 John Reese # Licensed under the MIT license import yaml from combine import CombineError MANIFEST_FORMAT = 1 class Manifest: def __init__(self): self.properties = {"manifest-format": MANIFEST_FORMAT} self.actions = [] def add_property(self, name, value): self.p...
# Copyright (c) 2010 John Reese # Licensed under the MIT license import yaml from combine import CombineError MANIFEST_FORMAT = 1 class Manifest: def __init__(self): self.properties = {"manifest-format": MANIFEST_FORMAT} self.actions = [] def add_property(self, name, value): self.p...
Fix issues with loading from dict
Fix issues with loading from dict
Python
mit
redmatter/combine
c7511d81236f2a28019d8d8e103b03e0d1150e32
django_website/blog/admin.py
django_website/blog/admin.py
from __future__ import absolute_import from django.contrib import admin from .models import Entry admin.site.register(Entry, list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author'), list_filter = ('is_active',), exclude = ('summary_html', 'body_html'), prepopulated_fields = {"s...
from __future__ import absolute_import from django.contrib import admin from .models import Entry class EntryAdmin(admin.ModelAdmin): list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author') list_filter = ('is_active',) exclude = ('summary_html', 'body_html') prepopulated_fields...
Use proper ModelAdmin for blog entry
Use proper ModelAdmin for blog entry
Python
bsd-3-clause
khkaminska/djangoproject.com,nanuxbe/django,rmoorman/djangoproject.com,gnarf/djangoproject.com,relekang/djangoproject.com,relekang/djangoproject.com,django/djangoproject.com,alawnchen/djangoproject.com,vxvinh1511/djangoproject.com,nanuxbe/django,nanuxbe/django,django/djangoproject.com,xavierdutreilh/djangoproject.com,g...
d6c493df4df06f5195c1f964224728ca4e5ace06
django_project/realtime/management/commands/loadfloodtestdata.py
django_project/realtime/management/commands/loadfloodtestdata.py
# coding=utf-8 import os import shutil from tempfile import mkdtemp from django.core.management.base import BaseCommand from realtime.tasks.test.test_realtime_tasks import flood_layer_uri from realtime.tasks.realtime.flood import process_flood class Command(BaseCommand): """Script to load flood test data for de...
# coding=utf-8 import os import shutil from tempfile import mkdtemp from django.core.management.base import BaseCommand from realtime.tasks.test.test_realtime_tasks import flood_layer_uri from realtime.tasks.realtime.flood import process_flood class Command(BaseCommand): """Script to load flood test data for de...
Fix wrong path to flood data to push.
Fix wrong path to flood data to push.
Python
bsd-2-clause
AIFDR/inasafe-django,AIFDR/inasafe-django,AIFDR/inasafe-django,AIFDR/inasafe-django
5709a160e6aad62bcdd8ae35c1b8bf9e8a6f7b6c
wagtail/contrib/wagtailfrontendcache/signal_handlers.py
wagtail/contrib/wagtailfrontendcache/signal_handlers.py
from django.db import models from django.db.models.signals import post_save, post_delete from wagtail.wagtailcore.models import Page from wagtail.contrib.wagtailfrontendcache.utils import purge_page_from_cache def post_save_signal_handler(instance, **kwargs): purge_page_from_cache(instance) def post_delete_si...
from django.db import models from django.db.models.signals import post_delete from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.signals import page_published from wagtail.contrib.wagtailfrontendcache.utils import purge_page_from_cache def page_published_signal_handler(instance, **kwargs): pur...
Use page_published signal for cache invalidation instead of post_save
Use page_published signal for cache invalidation instead of post_save
Python
bsd-3-clause
nrsimha/wagtail,nrsimha/wagtail,kurtrwall/wagtail,quru/wagtail,tangentlabs/wagtail,nutztherookie/wagtail,hanpama/wagtail,kaedroho/wagtail,Klaudit/wagtail,marctc/wagtail,mixxorz/wagtail,stevenewey/wagtail,taedori81/wagtail,willcodefortea/wagtail,Klaudit/wagtail,rsalmaso/wagtail,serzans/wagtail,nealtodd/wagtail,Tivix/wag...
bf042cbe47c9fcfc0e608ff726a73d0e562027d0
tests/test_with_hypothesis.py
tests/test_with_hypothesis.py
import pytest from aead import AEAD hypothesis = pytest.importorskip("hypothesis") @hypothesis.given(bytes, bytes) def test_round_trip_encrypt_decrypt(plaintext, associated_data): cryptor = AEAD(AEAD.generate_key()) ct = cryptor.encrypt(plaintext, associated_data) assert plaintext == cryptor.decrypt(ct...
import pytest from aead import AEAD hypothesis = pytest.importorskip("hypothesis") @hypothesis.given( hypothesis.strategies.binary(), hypothesis.strategies.binary() ) def test_round_trip_encrypt_decrypt(plaintext, associated_data): cryptor = AEAD(AEAD.generate_key()) ct = cryptor.encrypt(plaintext,...
Fix the Hypothesis test to work with new API.
Fix the Hypothesis test to work with new API. The Hypothesis API has since moved on from the last time we pushed a change. Fix the test suite to work with the new API.
Python
apache-2.0
Ayrx/python-aead,Ayrx/python-aead
5520ebc1c232a69994d0941b7563f567d8defd0b
telemetry/telemetry/core/cast_interface.py
telemetry/telemetry/core/cast_interface.py
# Copyright 2022 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper for common operations on a device with Cast capabilities.""" import os from telemetry.core import util CAST_BROWSERS = [ 'platform_app' ] ...
# Copyright 2022 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper for common operations on a device with Cast capabilities.""" import os from telemetry.core import util CAST_BROWSERS = [ 'platform_app' ] ...
Change user and password used for Cast hardware devices
[cast3p] Change user and password used for Cast hardware devices Change-Id: Id636d40afea79d08ce9af952438d5396add505e3 Reviewed-on: https://chromium-review.googlesource.com/c/catapult/+/3602946 Commit-Queue: Chong Gu <2b40eb872a3eb33d1a32a10811f471f8a41ba08b@google.com> Auto-Submit: Chong Gu <2b40eb872a3eb33d1a32a10811...
Python
bsd-3-clause
catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult
2b46bee644222c2e1c29d20ffc23768ed11006d6
VMEncryption/main/oscrypto/encryptstates/SelinuxState.py
VMEncryption/main/oscrypto/encryptstates/SelinuxState.py
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # 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 # # U...
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # 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 # # U...
Disable SELinux before OS disk encryption
Disable SELinux before OS disk encryption
Python
apache-2.0
vityagi/azure-linux-extensions,vityagi/azure-linux-extensions,andyliuliming/azure-linux-extensions,andyliuliming/azure-linux-extensions,soumyanishan/azure-linux-extensions,bpramod/azure-linux-extensions,krkhan/azure-linux-extensions,vityagi/azure-linux-extensions,jasonzio/azure-linux-extensions,andyliuliming/azure-linu...
0128a0cc3c266848181ed2f6af3db34cc9c99b5d
terroroftinytown/services/googl.py
terroroftinytown/services/googl.py
from terroroftinytown.services.base import BaseService from terroroftinytown.services.status import URLStatus import re class GooglService(BaseService): def process_response(self, response): status_code = response.status_code if status_code in self.params['redirect_codes']: if self.ratelimited(response): ...
from terroroftinytown.services.base import BaseService from terroroftinytown.services.status import URLStatus import re class GooglService(BaseService): def process_response(self, response): status_code = response.status_code if status_code in self.params['redirect_codes']: if self.rat...
Use spaces instead of tabs
Use spaces instead of tabs
Python
mit
ArchiveTeam/terroroftinytown,ArchiveTeam/terroroftinytown,ArchiveTeam/terroroftinytown
ba4b348e03f5f875bb170a8b7d5c560ba7c6968f
features/groups/migrations/0002_auto_20160922_1108.py
features/groups/migrations/0002_auto_20160922_1108.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 09:08 from __future__ import unicode_literals from django.db import migrations def copy_groups(apps, schema_editor): Group1 = apps.get_model('entities.Group') Group2 = apps.get_model('groups.Group') for g in Group1.objects.all(): ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 09:08 from __future__ import unicode_literals from django.db import migrations def copy_groups(apps, schema_editor): Group1 = apps.get_model('entities.Group') Group2 = apps.get_model('groups.Group') for g in Group1.objects.order_by('id'):...
Order groups by id when copying
Order groups by id when copying
Python
agpl-3.0
stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten
25db9110d34760118b47b2bdf637cf6947154c2c
tests/unit/distributed/test_objectstore.py
tests/unit/distributed/test_objectstore.py
import pytest from bcbio.distributed import objectstore from bcbio.distributed.objectstore import GoogleDrive @pytest.fixture def mock_api(mocker): mocker.patch('bcbio.distributed.objectstore.ServiceAccountCredentials') mocker.patch('bcbio.distributed.objectstore.Http') mocker.patch('bcbio.distributed.ob...
import pytest from bcbio.distributed import objectstore from bcbio.distributed.objectstore import GoogleDrive @pytest.fixture def mock_api(mocker): mocker.patch('bcbio.distributed.objectstore.ServiceAccountCredentials') mocker.patch('bcbio.distributed.objectstore.Http') mocker.patch('bcbio.distributed.ob...
Test json file with api key is in API service class
Test json file with api key is in API service class
Python
mit
a113n/bcbio-nextgen,lbeltrame/bcbio-nextgen,biocyberman/bcbio-nextgen,biocyberman/bcbio-nextgen,chapmanb/bcbio-nextgen,vladsaveliev/bcbio-nextgen,biocyberman/bcbio-nextgen,vladsaveliev/bcbio-nextgen,chapmanb/bcbio-nextgen,lbeltrame/bcbio-nextgen,a113n/bcbio-nextgen,lbeltrame/bcbio-nextgen,vladsaveliev/bcbio-nextgen,cha...
68812938503901df48b9f3c7cd3b3160d51a52fa
txaws/client/_validators.py
txaws/client/_validators.py
# Licenced under the txaws licence available at /LICENSE in the txaws source. """ attrs validators for internal use. """ import attr from attr import validators def list_of(validator): """ Require a value which is a list containing elements which the given validator accepts. """ return _ListOf(v...
# Licenced under the txaws licence available at /LICENSE in the txaws source. """ attrs validators for internal use. """ import attr from attr import validators def list_of(validator): """ Require a value which is a list containing elements which the given validator accepts. """ return _Containe...
Introduce set_of (similar to list_of validator)
Introduce set_of (similar to list_of validator)
Python
mit
oubiwann/txaws,mithrandi/txaws,mithrandi/txaws,twisted/txaws,twisted/txaws,oubiwann/txaws
6dab7ceeb4de601c47b4d370c6184ddcd0110e89
doc/conf.py
doc/conf.py
# -*- coding: utf-8 -*- import os import sys import sphinx_rtd_theme sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) import sphinxcontrib; reload(sphinxcontrib) extensions = ['sphinxcontrib.ros'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'sphinxcontr...
# -*- coding: utf-8 -*- import os import sys import sphinx_rtd_theme import pkg_resources sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) import sphinxcontrib; reload(sphinxcontrib) extensions = ['sphinxcontrib.ros'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' pr...
Use the source version as a doc version
Use the source version as a doc version
Python
bsd-2-clause
otamachan/sphinxcontrib-ros,otamachan/sphinxcontrib-ros
d5fd80a02ca619655f0b6d470acb745ec4432ba5
e2e_test.py
e2e_test.py
# Copyright 2015, Google, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy of the # License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable # law or agreed to in writing, software d...
# Copyright 2015, Google, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy of the # License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable # law or agreed to in writing, software d...
Add Print Statement For Easier Debugging
Add Print Statement For Easier Debugging
Python
apache-2.0
bshaffer/appengine-python-vm-hello,googlearchive/appengine-python-vm-hello,bshaffer/appengine-python-vm-hello,googlearchive/appengine-python-vm-hello
5a8f107f987198740a0f0b9f1ee1f79d90662109
txircd/modules/rfc/cmode_n.py
txircd/modules/rfc/cmode_n.py
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import IMode, IModuleData, Mode, ModuleData from txircd.utils import ModeType from zope.interface import implements class NoExtMsgMode(ModuleData, Mode): implements(IPlugin, IModuleData, IMode) name = "...
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import IMode, IModuleData, Mode, ModuleData from txircd.utils import ModeType from zope.interface import implements class NoExtMsgMode(ModuleData, Mode): implements(IPlugin, IModuleData, IMode) name = "...
Fix mode +n specification so that it actually fires ever
Fix mode +n specification so that it actually fires ever
Python
bsd-3-clause
Heufneutje/txircd,ElementalAlchemist/txircd
3ff9f60e857c9ffbd7c72c53403ae7bf3afecab8
test/features/steps/system.py
test/features/steps/system.py
from __future__ import print_function import sys import subprocess import os @given('a system executable {exe}') def step_impl(context, exe): binary = None if sys.platform.startswith('win'): try: binary = subprocess.check_output(["where", exe]).decode('utf8').strip() except: ...
from __future__ import print_function import sys import subprocess import os @given('a system executable {exe}') def step_impl(context, exe): binary = None if sys.platform.startswith('win'): try: binary = subprocess.check_output(["where", exe]).decode('utf8').strip() except: ...
Fix OS X test skip.
tests.features: Fix OS X test skip.
Python
bsd-3-clause
hotgloupi/configure,hotgloupi/configure,hotgloupi/configure,hotgloupi/configure,hotgloupi/configure
1dfe45d9ce6c81e5ae2396f97cc979192251c906
selectable/apps.py
selectable/apps.py
try: from django.apps import AppConfig except ImportError: AppConfig = object class SelectableConfig(AppConfig): """App configuration for django-selectable.""" name = 'selectable' def ready(self): self.module.registry.autodiscover()
try: from django.apps import AppConfig except ImportError: AppConfig = object class SelectableConfig(AppConfig): """App configuration for django-selectable.""" name = 'selectable' def ready(self): from . import registry registry.autodiscover()
Update auto-registration to work while running the tests.
Update auto-registration to work while running the tests.
Python
bsd-2-clause
affan2/django-selectable,affan2/django-selectable,mlavin/django-selectable,affan2/django-selectable,mlavin/django-selectable,mlavin/django-selectable
96ace17d9cd800a5649ad32a8cb496a55d73ca9f
wapps/templatetags/wagtail.py
wapps/templatetags/wagtail.py
import jinja2 from django.conf import settings from django_jinja import library from jinja2.ext import Extension from wagtail.wagtailcore.models import Page from wagtail.contrib.wagtailroutablepage.templatetags.wagtailroutablepage_tags import ( routablepageurl as dj_routablepageurl ) from wapps.utils import get_i...
import jinja2 from django.conf import settings from django_jinja import library from jinja2.ext import Extension from wagtail.wagtailcore.models import Page from wagtail.contrib.wagtailroutablepage.templatetags.wagtailroutablepage_tags import ( routablepageurl as dj_routablepageurl ) from wapps.utils import get_i...
Fix is_site_root when no page
Fix is_site_root when no page
Python
mit
apihackers/wapps,apihackers/wapps,apihackers/wapps,apihackers/wapps
020ffbe8436da2f7ee654fa6a12d50f9915db17f
examples/collection/views.py
examples/collection/views.py
from cruditor.contrib.collection import CollectionViewMixin from cruditor.views import CruditorAddView, CruditorChangeView, CruditorDeleteView, CruditorListView from django.urls import reverse, reverse_lazy from examples.mixins import ExamplesMixin from store.models import Person from .filters import PersonFilter fro...
from cruditor.contrib.collection import CollectionViewMixin from cruditor.views import CruditorAddView, CruditorChangeView, CruditorDeleteView, CruditorListView from django.urls import reverse, reverse_lazy from examples.mixins import ExamplesMixin from store.models import Person from .filters import PersonFilter fro...
Make use of auto generated table classes.
Make use of auto generated table classes.
Python
mit
moccu/django-cruditor,moccu/django-cruditor,moccu/django-cruditor
4ce7f8ce338c84b44e7ad16475ff68bc0fad970e
dddp/accounts/tests.py
dddp/accounts/tests.py
"""Django DDP Accounts test suite.""" from __future__ import unicode_literals import sys from dddp import tests class AccountsTestCase(tests.DDPServerTestCase): # gevent-websocket doesn't work with Python 3 yet @tests.expected_failure_if(sys.version_info.major == 3) def test_login_no_accounts(self): ...
"""Django DDP Accounts test suite.""" from __future__ import unicode_literals import sys from dddp import tests # gevent-websocket doesn't work with Python 3 yet @tests.expected_failure_if(sys.version_info.major == 3) class AccountsTestCase(tests.DDPServerTestCase): def test_login_no_accounts(self): soc...
Move expected test failure to TestCase class.
Move expected test failure to TestCase class.
Python
mit
commoncode/django-ddp,django-ddp/django-ddp,commoncode/django-ddp,django-ddp/django-ddp,django-ddp/django-ddp,commoncode/django-ddp,django-ddp/django-ddp,commoncode/django-ddp
02f7a546cda7b8b3ce31616a74f3aa3518632885
djangocms_spa_vue_js/templatetags/router_tags.py
djangocms_spa_vue_js/templatetags/router_tags.py
import json from django import template from django.utils.safestring import mark_safe from ..menu_helpers import get_vue_js_router register = template.Library() @register.simple_tag(takes_context=True) def vue_js_router(context): if context.has_key('vue_js_router'): router = context['vue_js_router'] ...
import json from django import template from django.utils.safestring import mark_safe from ..menu_helpers import get_vue_js_router register = template.Library() @register.simple_tag(takes_context=True) def vue_js_router(context): if 'vue_js_router' in context: router = context['vue_js_router'] else...
Use `in` rather than `has_key`
Use `in` rather than `has_key`
Python
mit
dreipol/djangocms-spa-vue-js
15bbe3aaaa017513ac652bf246b906139a71be00
doc/tutorials/examples/general/client/headers.py
doc/tutorials/examples/general/client/headers.py
import base64 from pyamf.remoting.client import RemotingService gw = RemotingService('http://demo.pyamf.org/gateway/recordset') gw.addHTTPHeader('Set-Cookie', 'sessionid=QT3cUmACNeKQo5oPeM0') gw.removeHTTPHeader('Set-Cookie') username = 'admin' password = 'admin' auth = base64.encodestring('%s:%s' % (username, pass...
from pyamf.remoting.client import RemotingService gw = RemotingService('http://demo.pyamf.org/gateway/recordset') gw.addHTTPHeader('Set-Cookie', 'sessionid=QT3cUmACNeKQo5oPeM0') gw.removeHTTPHeader('Set-Cookie') username = 'admin' password = 'admin' auth = ('%s:%s' % (username, password)).encode('base64')[:-1] gw.a...
Apply client authorization fix from wiki
Apply client authorization fix from wiki git-svn-id: f3978d5834b2aa37aa734927aace4f0b92cf88c5@2985 2dde4cc4-cf3c-0410-b1a3-a9b8ff274da5
Python
mit
cardmagic/PyAMF,cardmagic/PyAMF,cardmagic/PyAMF
a3c3a6ed4d01f1857fc4728b10505e330af9e6ae
code/helper/easierlife.py
code/helper/easierlife.py
#! /usr/bin/env python3 """ Helper functions to make our life easier. Originally obtained from the 'pharm' repository, but modified. """ import fileinput import json import os.path from dstruct import Sentence ## BASE_DIR denotes the application directory BASE_DIR, throwaway = os.path.split(os.path.realpath(__file_...
#! /usr/bin/env python3 """ Helper functions to make our life easier. Originally obtained from the 'pharm' repository, but modified. """ import fileinput import json import os.path import sys from dstruct.Sentence import Sentence ## BASE_DIR denotes the application directory BASE_DIR, throwaway = os.path.split(os.p...
Fix import, use fileinput.iput as context, and fix its argument
Fix import, use fileinput.iput as context, and fix its argument
Python
apache-2.0
amwenger/dd-genomics,rionda/dd-genomics,HazyResearch/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,rionda/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics
91aa7ed06d168700692a33fd3c51add585d60ac0
backend/uclapi/roombookings/migrations/0007_auto_20170327_1323.py
backend/uclapi/roombookings/migrations/0007_auto_20170327_1323.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-27 13:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('roombookings', '0006_bookinga_bookingb_lock'), ] operations = [ ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-27 13:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('roombookings', '0006_bookinga_bookingb_lock'), ] operations = [ ...
Fix up migration to have only one PK
Fix up migration to have only one PK
Python
mit
uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi
61e30e91ffc87a7a8f575d32fba43e61a65b477a
bot/storage/data_source/data_sources/sqlite/sqlite.py
bot/storage/data_source/data_sources/sqlite/sqlite.py
from sqlite_framework.log.logger import SqliteLogger from sqlite_framework.session.session import SqliteSession from bot.storage.data_source.data_source import StorageDataSource class SqliteStorageDataSource(StorageDataSource): def __init__(self, database_filename: str, debug: bool, logger: SqliteLogger): ...
from sqlite_framework.log.logger import SqliteLogger from sqlite_framework.session.session import SqliteSession from bot.storage.data_source.data_source import StorageDataSource class SqliteStorageDataSource(StorageDataSource): def __init__(self, session: SqliteSession, logger: SqliteLogger): super().__i...
Update SqliteStorageDataSource to receive the SqliteSession already built, so that clients can have more control over its construction
Update SqliteStorageDataSource to receive the SqliteSession already built, so that clients can have more control over its construction
Python
agpl-3.0
alvarogzp/telegram-bot,alvarogzp/telegram-bot
023e814e6661c11bfe58a4e3e4ce4167ae63cd7f
rdio_dl/cli.py
rdio_dl/cli.py
import click import youtube_dl from .config import storage_load from .extractor import RdioIE @click.command() @click.option(u'-u', u'--user', help=u'A Rdio user') @click.option(u'-p', u'--password', help=u'The password') @click.argument(u'urls', required=True, nargs=-1) def main(user, password, urls): storage = ...
# -*- coding: utf-8 -*- import click import youtube_dl from .config import storage_load from .extractor import RdioIE def add_info_extractor_above_generic(ydl, ie): generic = ydl._ies.pop() ydl.add_info_extractor(ie) ydl.add_info_extractor(generic) @click.command() @click.option(u'-u', u'--user', help=...
Fix generic extractor being always selected
Fix generic extractor being always selected Turns out our extractor was being inserted *after* the GenericIE. Now we are inserting our RdioIE right above GenericIE.
Python
mit
ravishi/rdio-dl
fb3f1023faedda37e5ca16b87d2b9ddc38a2196c
deployer/tasks/util.py
deployer/tasks/util.py
from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionEx...
import socket from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException from deployer.util import retry __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): ...
Add retry for socket error
Add retry for socket error
Python
mit
totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer
d0ea27a56013af944ef9e7fef9ebe1c8f44e3aab
community_blog/__openerp__.py
community_blog/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron # Copyright 2013 Yannick Buron # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron # Copyright 2013 Yannick Buron # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
Change name of module community_blog
Change name of module community_blog Changement de nom
Python
agpl-3.0
YannickB/vertical-community,Valeureux/wezer-exchange,Valeureux/wezer-exchange,codoo/vertical-community,open-synergy/vertical-community,Valeureux/wezer-exchange,Valeureux/wezer-exchange
a7f467589c49020977328e45eed4eff5b607231f
checker/tests/downstream/test_check_files_menu_agreements.py
checker/tests/downstream/test_check_files_menu_agreements.py
import magic import os.path as op from checker.base import BakeryTestCase as TestCase, tags from checker.metadata import Metadata class CheckFontsMenuAgreements(TestCase): path = '.' name = __name__ targets = ['metadata'] tool = 'lint' def menufile(self, font_metadata): return '%s.menu'...
import magic import os.path as op from checker.base import BakeryTestCase as TestCase, tags from checker.metadata import Metadata class CheckFontsMenuAgreements(TestCase): path = '.' name = __name__ targets = ['metadata'] tool = 'lint' def read_metadata_contents(self): return open(self....
Fix check menu files agreement test
Fix check menu files agreement test
Python
apache-2.0
davelab6/fontbakery,googlefonts/fontbakery,moyogo/fontbakery,moyogo/fontbakery,graphicore/fontbakery,jessamynsmith/fontbakery,graphicore/fontbakery,googlefonts/fontbakery,graphicore/fontbakery,moyogo/fontbakery,googlefonts/fontbakery
ead5d7aa7a4a6fe4557c0e792ebc11e25359722f
rx/concurrency/scheduleditem.py
rx/concurrency/scheduleditem.py
from rx.disposables import SingleAssignmentDisposable def default_sub_comparer(x, y): return 0 if x == y else 1 if x > y else -1 class ScheduledItem(object): def __init__(self, scheduler, state, action, duetime, comparer=None): self.scheduler = scheduler self.state = state self.actio...
from rx.core import Disposable from rx.disposables import SingleAssignmentDisposable def default_sub_comparer(x, y): return 0 if x == y else 1 if x > y else -1 class ScheduledItem(object): def __init__(self, scheduler, state, action, duetime, comparer=None): self.scheduler = scheduler self.s...
Check if action returns disposable
Check if action returns disposable
Python
mit
ReactiveX/RxPY,ReactiveX/RxPY
840aef8fee59c9f1a9863177e060b05b09fcacd4
tests/utils.py
tests/utils.py
# -*- coding: utf-8 -*- def has_no_django(): try: import django return False except ImportError: return True
# -*- coding: utf-8 -*- def has_no_django(): try: import django # noqa isort:skip return False except ImportError: return True
Add noqa to conditional import
Add noqa to conditional import
Python
mit
python-thumbnails/python-thumbnails,relekang/python-thumbnails
5ddde4a43ede87770543984e96eb8ccaf1d829b2
lib/methods/drupalconsole.py
lib/methods/drupalconsole.py
from base import BaseMethod from fabric.api import * from lib.utils import SSHTunnel, RemoteSSHTunnel from fabric.colors import green, red from lib import configuration import copy class DrupalConsoleMethod(BaseMethod): @staticmethod def supports(methodName): return methodName == 'drupalconsole' def instal...
from base import BaseMethod from fabric.api import * from lib.utils import SSHTunnel, RemoteSSHTunnel from fabric.colors import green, red from lib import configuration import copy class DrupalConsoleMethod(BaseMethod): @staticmethod def supports(methodName): return methodName == 'drupalconsole' def instal...
Fix exception when running install-task
Fix exception when running install-task
Python
mit
factorial-io/fabalicious,factorial-io/fabalicious
ae1de4000a6e9f3fc70d14c6214038e83772a5f6
Part2/main.py
Part2/main.py
import detectLang import graph # ==================================================================================================== # La detection est rapide car toute les perplexites sont stockées dans les fichiers binaires pp_EN etc # Pour regénerer les fichiers : # Executer detectLang.create_all_pp_and_save_to_di...
import detectLang import graph # ==================================================================================================== # La detection est rapide car toute les perplexites sont stockées dans les fichiers binaires pp_EN etc # Pour regénerer les fichiers : # Executer detectLang.create_all_pp_and_save_to_di...
Update doc and add one call
Update doc and add one call
Python
mit
Focom/NLPWork1,Focom/NLPWork1,Focom/NLPWork1
19cb68209252615c66cee0a1c6df1069f81f6f77
stock_request_picking_type/models/stock_request_order.py
stock_request_picking_type/models/stock_request_order.py
# Copyright 2019 Open Source Integrators # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import api, fields, models class StockRequestOrder(models.Model): _inherit = 'stock.request.order' @api.model def _get_default_picking_type(self): return self.env['stock.picki...
# Copyright 2019 Open Source Integrators # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import api, fields, models class StockRequestOrder(models.Model): _inherit = 'stock.request.order' @api.model def _get_default_picking_type(self): return self.env['stock.picki...
Set Picking Type in Create
[IMP] Set Picking Type in Create [IMP] Flake8
Python
agpl-3.0
Vauxoo/stock-logistics-warehouse,Vauxoo/stock-logistics-warehouse,Vauxoo/stock-logistics-warehouse
b6139583bf5074c73c0de6626391b6f128ed6e34
export_jars.py
export_jars.py
#!/usr/bin/env python import os import shutil from glob import glob from subprocess import call, check_output OUTPUT_DIR_NAME = 'jars' def call_unsafe(*args, **kwargs): kwargs['shell'] = True call(*args, **kwargs) call_unsafe('./gradlew clean javadocRelease jarRelease') try: os.mkdir(OUTPUT_DIR_NAME)...
#!/usr/bin/env python import os import shutil from glob import glob from subprocess import call, check_output OUTPUT_DIR_NAME = 'jars' def call_unsafe(*args, **kwargs): kwargs['shell'] = True call(*args, **kwargs) call_unsafe('./gradlew clean javadocRelease jarRelease') try: os.mkdir(OUTPUT_DIR_NAME)...
Remove existing JARs before building new ones
Remove existing JARs before building new ones
Python
mit
swstack/Bean-Android-SDK,PunchThrough/bean-sdk-android,colus001/Bean-Android-SDK,PunchThrough/Bean-Android-SDK,hongbinz/Bean-Android-SDK,androidgrl/Bean-Android-SDK,PunchThrough/Bean-Android-SDK,swstack/Bean-Android-SDK,PunchThrough/bean-sdk-android,androidgrl/Bean-Android-SDK,hongbinz/Bean-Android-SDK,colus001/Bean-An...
1b7a3f045bf7a23ef993d136b481f22258c4a778
wagtail/wagtailimages/rich_text.py
wagtail/wagtailimages/rich_text.py
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...
Refactor try-catch block by limiting code in the try block
Refactor try-catch block by limiting code in the try block Always good to know which line will raise an exception and limit the try block to that statement
Python
bsd-3-clause
Toshakins/wagtail,timorieber/wagtail,nrsimha/wagtail,kurtrwall/wagtail,timorieber/wagtail,FlipperPA/wagtail,inonit/wagtail,davecranwell/wagtail,nealtodd/wagtail,iansprice/wagtail,thenewguy/wagtail,nutztherookie/wagtail,jnns/wagtail,kaedroho/wagtail,iansprice/wagtail,serzans/wagtail,inonit/wagtail,kurtw/wagtail,mixxorz/...
7e1ec1b27d69882005ac5492809c8847c21e2198
baro.py
baro.py
from datetime import datetime class Baro: """This class represents a Baro item and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end...
from datetime import datetime import utils class Baro: """This class contains info about the Void Trader and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation'...
Change class Baro to use timedelta_to_string, some fixes
Change class Baro to use timedelta_to_string, some fixes
Python
mit
pabletos/Hubot-Warframe,pabletos/Hubot-Warframe
d3078cafd4e64e9c093d9d823df2035b8380d643
meta-refkit-computervision/recipes-computervision/caffe-bvlc-reference/files/dnn-test.py
meta-refkit-computervision/recipes-computervision/caffe-bvlc-reference/files/dnn-test.py
#!/usr/bin/env python3 # Classify an image using a suitable model. The image conversion magic # is from # https://github.com/opencv/opencv_contrib/blob/master/modules/dnn/samples/googlenet_python.py # (3-clause BSD license). import numpy as np import cv2 import sys if len(sys.argv) != 4: print("Usage: dnn.py <pr...
#!/usr/bin/env python3 # Classify an image using a suitable model. The image conversion magic # is from # https://github.com/opencv/opencv_contrib/blob/master/modules/dnn/samples/googlenet_python.py # (3-clause BSD license). import numpy as np import cv2 import sys if len(sys.argv) != 4: print("Usage: dnn.py <pr...
Fix DNN test to be compatible with OpenCV 3.3.
convnet: Fix DNN test to be compatible with OpenCV 3.3. OpenCV DNN module API changed with OpenCV 3.3. Fix the tests to use the new API. Signed-off-by: Ismo Puustinen <75dda586a9213f0e0695eb79120c94222bb30e60@intel.com>
Python
mit
intel/intel-iot-refkit,mythi/intel-iot-refkit,mythi/intel-iot-refkit,intel/intel-iot-refkit,intel/intel-iot-refkit,intel/intel-iot-refkit,mythi/intel-iot-refkit,klihub/intel-iot-refkit,klihub/intel-iot-refkit,klihub/intel-iot-refkit,klihub/intel-iot-refkit,klihub/intel-iot-refkit,klihub/intel-iot-refkit,mythi/intel-iot...