commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
16c0f9fee7ee9f67a64645f41584083373ebb2cd | fix indexing in the donation db model | blueprints/donations/donation_model.py | blueprints/donations/donation_model.py | __author__ = 'HansiHE'
from mongoengine import *
from datetime import datetime
from blueprints.auth.user_model import User
class TransactionLog(Document):
username = StringField()
date = DateTimeField(required=True, default=datetime.utcnow)
data = DictField()
class DonationTransactionSta... | __author__ = 'HansiHE'
from mongoengine import *
from datetime import datetime
from blueprints.auth.user_model import User
class TransactionLog(Document):
username = StringField()
date = DateTimeField(required=True, default=datetime.utcnow)
data = DictField()
class DonationTransactionSta... | Python | 0.000001 |
b9c076865f4e0ff9b4ab007472cbab735ccf01ab | Bump version to 3.1.2 | osg_configure/version.py | osg_configure/version.py | __version__ = "3.1.2"
| __version__ = "3.1.1"
| Python | 0.000001 |
214f4094b6b5c2f4a43ff96567a7bbe87ba63d28 | Update bob.py | Python_sessions/session-2/practice_codes/bob.py | Python_sessions/session-2/practice_codes/bob.py | hello = "Hi Human, I am B.O.B. "
question1 = "What is your name? "
response1 = "Thats a lovely name! "
input(hello+question1)
print response1
answer_type = "Please answer in 'yes' or 'no'. "
question2 = "Can I help you? "
response2 = "I am a computer, not a human. "
input(question2+answer_type)
print response2
questi... | hello = "Hi Human, I am B.O.B. "
question1 = "What is your name? "
response1 = "Thats a lovely name! "
input(hello+question1)
print response1
answer_type = "Please answer in 'yes' of 'no'. "
question2 = "Can I help you? "
response2 = "I am a computer, not a human. "
input(question2+answer_type)
print response2
questi... | Python | 0.000002 |
0845eddc933e439fba77083c0668a3bcf74f975e | add index for format for python 2.6 | encrypted_fields/tests.py | encrypted_fields/tests.py |
import re
from datetime import datetime
from django.db import models, connection
from django.test import TestCase
from .fields import (
EncryptedCharField,
EncryptedTextField,
EncryptedDateTimeField,
EncryptedIntegerField,
)
class TestModel(models.Model):
char = EncryptedCharField(max_length=25... |
import re
from datetime import datetime
from django.db import models, connection
from django.test import TestCase
from .fields import (
EncryptedCharField,
EncryptedTextField,
EncryptedDateTimeField,
EncryptedIntegerField,
)
class TestModel(models.Model):
char = EncryptedCharField(max_length=25... | Python | 0.000002 |
f44c7670ee06d0ff3976c11b921cc3f288b0259b | add TestMPEventLoopRunner.test_ProgressMonitor | tests/EventReader/test_MPEventLoopRunner.py | tests/EventReader/test_MPEventLoopRunner.py | from AlphaTwirl.EventReader import MPEventLoopRunner
import unittest
import os
##____________________________________________________________________________||
class MockReader(object):
def __init__(self):
self._results = None
def setResults(self, results):
self._results = results
def res... | from AlphaTwirl.EventReader import MPEventLoopRunner
import unittest
##____________________________________________________________________________||
class MockReader(object):
def __init__(self):
self._results = None
def setResults(self, results):
self._results = results
def results(self)... | Python | 0.000001 |
e6e0d96790d71caccb3f00487bfeeddccdc78139 | Fix variable and return value | app/raw/tasks.py | app/raw/tasks.py | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scrape... | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scrape... | Python | 0.000005 |
8c1e0e5a7aef661152fc76757fb8f1403af56133 | fix tests | tests/dataset/test_highly_variable_genes.py | tests/dataset/test_highly_variable_genes.py | from unittest import TestCase
import numpy as np
from scvi.dataset import GeneExpressionDataset, BrainLargeDataset
class TestHighlyVariableGenes(TestCase):
def test_sparse_no_batch_correction(self):
for flavor in ["seurat", "cell_ranger", "seurat_v3"]:
dataset = BrainLargeDataset(
... | from unittest import TestCase
import numpy as np
from scvi.dataset import GeneExpressionDataset, BrainLargeDataset
class TestHighlyVariableGenes(TestCase):
def test_sparse_no_batch_correction(self):
for flavor in ["seurat", "cell_ranger", "seurat_v3"]:
dataset = BrainLargeDataset(
... | Python | 0.000001 |
600e68fc3e4b708090f5c3349d002ea9c3d2fbf8 | improve examples group | tests/examples/user_code/publisher_group.py | tests/examples/user_code/publisher_group.py | import time
from celery import chord, group
from .worker import function_aggregate, function_test
chord(
group(function_test.s(0, value=i) for i in range(1000)),
function_aggregate.s(from_chord=True)
)()
time.sleep(5)
| import time
from celery import chord, group
from .tasks import *
chord(
group(function_value.s(0, value=i) for i in range(1000)),
function_any.s(from_chord=True)
)()
time.sleep(5)
| Python | 0.000002 |
902cbd511f2f42948991713cdf0a98c4473c66c0 | add tqdm to hagrid setup.py | packages/hagrid/setup.py | packages/hagrid/setup.py | # stdlib
import platform
# third party
from setuptools import find_packages
from setuptools import setup
__version__ = "0.2.89"
DATA_FILES = {
"img": ["hagrid/img/*.png"],
}
packages = [
"ascii_magic",
"click",
"cryptography>=37.0.2",
"gitpython",
"jinja2",
"names",
"packaging>=21.3"... | # stdlib
import platform
# third party
from setuptools import find_packages
from setuptools import setup
__version__ = "0.2.89"
DATA_FILES = {
"img": ["hagrid/img/*.png"],
}
packages = [
"ascii_magic",
"click",
"cryptography>=37.0.2",
"gitpython",
"jinja2",
"names",
"packaging>=21.3"... | Python | 0 |
f520d71d75dea757794b33f2d0e8a7c8c6204717 | Add legacy_url for accepted orgs | app/soc/modules/gsoc/views/accepted_orgs.py | app/soc/modules/gsoc/views/accepted_orgs.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... | Python | 0 |
e04b71d4fed675e3d8333e59ecf1df5a67ce42ac | remove martor app from django | oeplatform/settings.py | oeplatform/settings.py | """
Django settings for oeplatform project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | """
Django settings for oeplatform project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | Python | 0.000001 |
b6c78bc88b53e2cfbda4ef4d337ff1971f805051 | Change enum ordering | paperwork_parser/base.py | paperwork_parser/base.py | import inspect
from enum import IntEnum
from pdfquery import PDFQuery
class DocFieldType(IntEnum):
TEXT = 1
NUMBER = 2
CUSTOM = 3 # TODO: Forget this and have 'type' take a callable instead?
class DocField(object):
def __init__(self, bbox, type=DocFieldType.TEXT, required=False,
d... | import inspect
from enum import IntEnum
from pdfquery import PDFQuery
class DocFieldType(IntEnum):
NUMBER = 1
TEXT = 2
CUSTOM = 3 # TODO: Forget this and have 'type' take a callable instead?
class DocField(object):
def __init__(self, bbox, type=DocFieldType.TEXT, required=False,
d... | Python | 0.000001 |
35bc179c6e6c7c8d9230de8da0672a106a372954 | Install plugins using package. | testcases/cloud_admin/run_sos_report.py | testcases/cloud_admin/run_sos_report.py | #!/usr/bin/python
import os
import time
from eucaops import Eucaops
from eutester.eutestcase import EutesterTestCase
from eutester.machine import Machine
class SampleTest(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
self.start_time = self.ticket_number =... | #!/usr/bin/python
import os
import time
from eucaops import Eucaops
from eutester.eutestcase import EutesterTestCase
from eutester.machine import Machine
class SampleTest(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
self.start_time = self.ticket_number =... | Python | 0 |
10ba0ea095e4765a2d60751371f7dca8e36e2d18 | Fix infinite loop in grit headers clobbering script. | build/win/clobber_generated_headers.py | build/win/clobber_generated_headers.py | #!/usr/bin/python
# Copyright (c) 2009 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.
# This script helps workaround IncrediBuild problem on Windows.
# See http://crbug.com/17706.
import os
import sys
_SRC_PATH = os.pat... | #!/usr/bin/python
# Copyright (c) 2009 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.
# This script helps workaround IncrediBuild problem on Windows.
# See http://crbug.com/17706.
import os
import sys
_SRC_PATH = os.pat... | Python | 0.000029 |
e71870736959efcde2188bdcbd89838b67ca8582 | Add AbstractSanitizer/AbstractValidator class to import path | pathvalidate/__init__.py | pathvalidate/__init__.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._base import AbstractSanitizer, AbstractValidator
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_ch... | Python | 0 |
42609dfaf39c09fa591ff1b40e23ab1795a6d7a5 | test fix | vitrage/tests/unit/datasources/test_alarm_transformer_base.py | vitrage/tests/unit/datasources/test_alarm_transformer_base.py | # Copyright 2017 - Nokia
#
# 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, sof... | # Copyright 2017 - Nokia
#
# 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, sof... | Python | 0.000006 |
8e1f573edb01aac1df45030182ab73d423914f8f | check if REDIS_URL exists before connect to redis brain | robot.py | robot.py | # coding: utf-8
from __future__ import unicode_literals
from gevent.monkey import patch_all
patch_all()
import gevent
import logging
from gevent.pool import Pool
from redis import StrictRedis
from importlib import import_module
from slackclient import SlackClient
from settings import APPS, SLACK_TOKEN, REDIS_URL
po... | # coding: utf-8
from __future__ import unicode_literals
from gevent.monkey import patch_all
patch_all()
import gevent
import logging
from gevent.pool import Pool
from redis import StrictRedis
from importlib import import_module
from slackclient import SlackClient
from settings import APPS, SLACK_TOKEN, REDIS_URL
po... | Python | 0 |
395617afca4d242de12e2a75a3ae7d2a258f75a7 | use template string | paystackapi/constants.py | paystackapi/constants.py | """Script used to define constants used across codebase."""
PAYSTACK_SECRET_KEY = 'sk_test_0a246ef179dc841f42d20959bebdd790f69605d8'
HEADERS = {'Authorization': 'Bearer {}'}
API_URL = 'https://api.paystack.co/'
| """Script used to define constants used across codebase."""
PAYSTACK_SECRET_KEY = 'sk_test_0a246ef179dc841f42d20959bebdd790f69605d8'
HEADERS = {'Authorization': 'Bearer ' + PAYSTACK_SECRET_KEY}
API_URL = 'https://api.paystack.co/'
| Python | 0.000001 |
39beb9cbb3d0158dab58787cbe95651c8ec66db9 | Bump up minor version. | patroni/version.py | patroni/version.py | __version__ = '0.76'
| __version__ = '0.75'
| Python | 0 |
d0568b2c132ebe2cdf1f656ee96442a0888257cd | add NSecurity class | CorpFin/Security.py | CorpFin/Security.py | from HelpyFuncs.SymPy import sympy_theanify
class Security:
def __init__(self, label='', bs_val=0., val=0.):
self.label = label
self.bs_val_expr = bs_val
self.bs_val = sympy_theanify(bs_val)
self.val_expr = val
self.val = sympy_theanify(val)
def __call__(self, **kwar... | from HelpyFuncs.SymPy import sympy_theanify
class Security:
def __init__(self, label='', bs_val=0., val=0.):
self.label = label
self.bs_val_expr = bs_val
self.bs_val = sympy_theanify(bs_val)
self.val_expr = val
self.val = sympy_theanify(val)
def __call__(self, **kwar... | Python | 0 |
99818f02ebc46debe349a6c1b6bba70be6e04968 | Update error message for no plugins | skimage/io/_plugins/null_plugin.py | skimage/io/_plugins/null_plugin.py | __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to the docstring for ``skimage.io``
for a list of available plugins. You may specify a plugin explicitly as
an argument to ``imread``, e.g. ``imread("image.jpg", plugin='pil')``.
'''
def i... | __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to
skimage.io.plugins()
for a list of available plugins.'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(Runtime... | Python | 0 |
265052b981e04afe4815e9dceafbb7f2b06d2b0c | disable script host key checking | king/name-server.py | king/name-server.py | from twisted.internet import reactor
from twisted.names import dns, client, server
from rpyc.utils.factory import ssh_connect
from plumbum import SshMachine
from threading import Thread
import argparse
parser = argparse.ArgumentParser(description='Central Name Server')
parser.add_argument('--full', default=False, acti... | from twisted.internet import reactor
from twisted.names import dns, client, server
from rpyc.utils.factory import ssh_connect
from plumbum import SshMachine
from threading import Thread
import argparse
parser = argparse.ArgumentParser(description='Central Name Server')
parser.add_argument('--full', default=False, acti... | Python | 0 |
c9170cb4c0d63a6dc75f0fa7ca76faa688a1678a | Make tags optional | ppb/forms.py | ppb/forms.py | from pinax.blog.forms import FIELDS, AdminPostForm
from pinax.blog.models import Post
from taggit.forms import TagField
FIELDS.append("tags")
class AdminPostTagsForm(AdminPostForm):
tags = TagField(required=False)
class Meta:
model = Post
fields = FIELDS
| from pinax.blog.forms import FIELDS, AdminPostForm
from pinax.blog.models import Post
from taggit.forms import TagField
FIELDS.append("tags")
class AdminPostTagsForm(AdminPostForm):
tags = TagField()
class Meta:
model = Post
fields = FIELDS
| Python | 0.000001 |
9ee9ba34e447e99c868fcb43d40ce905cebf5fb9 | Add list and define functions. | noah/noah.py | noah/noah.py | import json
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['word'] == word), ... | import json
class Noah(object):
pass | Python | 0 |
48e15ea8494d72ee2a4cb7d05b5ee5d626d581c5 | Add groups to serf inventory plugin | plugins/inventory/serf.py | plugins/inventory/serf.py | #!/usr/bin/env python
# (c) 2015, Marc Abramowitz <marca@surveymonkey.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | #!/usr/bin/env python
# (c) 2015, Marc Abramowitz <marca@surveymonkey.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | Python | 0 |
0dd2bd0a8d2b041672afdf66666df63e2dd1a044 | Add author friends url. | rest/urls.py | rest/urls.py | # Author: Braedy Kuzma
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^posts/$', views.PostsView.as_view(), name='posts'),
url(r'^posts/(?P<pid>[0-9a-fA-F\-]+)/$', views.PostView.as_view(),
name='post'),
url(r'^posts/(?P<pid>[0-9a-fA-F\-]+)/comments/$',
views.Com... | # Author: Braedy Kuzma
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^posts/(?P<pid>[0-9a-fA-F\-]+)/$', views.PostView.as_view(),
name='post'),
url(r'^posts/$', views.PostsView.as_view(), name='posts'),
url(r'^author/(?P<aid>[0-9a-fA-F\-]+)/$', views.AuthorView.as_view(... | Python | 0 |
0cf7fda731a71524651de95821b444b5c554260e | Move initial_fetch() up | inferno-cli.py | inferno-cli.py | #!/usr/bin/env python3
import argparse
import collections
import datetime
import logging
import os
import re
import sys
import time
import bs4
import requests
import setproctitle
import util
class Shoutbox:
base_url = ""
inferno_url = ""
s = None
lines = []
read = collections.deque(maxlen=21)
... | #!/usr/bin/env python3
import argparse
import collections
import datetime
import logging
import os
import re
import sys
import time
import bs4
import requests
import setproctitle
import util
class Shoutbox:
base_url = ""
inferno_url = ""
s = None
lines = []
read = collections.deque(maxlen=21)
... | Python | 0.000005 |
6fce2e52715f1a77edb19eca8b1133875fff3d34 | Set HearingViewSet read Only | kk/views/hearing.py | kk/views/hearing.py | import django_filters
from rest_framework import viewsets
from rest_framework import serializers
from rest_framework import filters
from rest_framework.decorators import detail_route
from rest_framework.response import Response
from kk.models import Hearing
from .image import ImageFieldSerializer, ImageSerializer
... | import django_filters
from rest_framework import viewsets
from rest_framework import serializers
from rest_framework import filters
from rest_framework.decorators import detail_route
from rest_framework.response import Response
from kk.models import Hearing
from .image import ImageFieldSerializer, ImageSerializer
... | Python | 0 |
b0fa9031b4eabd33a6c6f8f27e22351b14e1eeee | Set a new primary avatar when deleting the primary avatar. | avatar/views.py | avatar/views.py | import os.path
from avatar.models import Avatar, avatar_file_path
from avatar.forms import PrimaryAvatarForm, DeleteAvatarForm
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_require... | import os.path
from avatar.models import Avatar, avatar_file_path
from avatar.forms import PrimaryAvatarForm, DeleteAvatarForm
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_require... | Python | 0 |
829ddcdf0ceff4f43cf871b7438170d4e4971a70 | Fix cyclomatic complexity problem in exception handling | surveymonkey/exceptions.py | surveymonkey/exceptions.py | # -*- coding: utf-8 -*-
class SurveyMonkeyException(Exception):
def __init__(self, response):
data = response.json()
super(SurveyMonkeyException, self).__init__(data["error"]["message"])
self.status_code = response.status_code
self.error_code = data["error"]["id"]
class SurveyMon... | # -*- coding: utf-8 -*-
class SurveyMonkeyException(Exception):
def __init__(self, response):
data = response.json()
super(SurveyMonkeyException, self).__init__(data["error"]["message"])
self.status_code = response.status_code
self.error_code = data["error"]["id"]
class SurveyMon... | Python | 0.000041 |
954c06d2715090e15dbe9a76dffb0eeabda06a48 | make flake8 happy | bids/grabbids/__init__.py | bids/grabbids/__init__.py | from .bids_layout import BIDSLayout
__all__ = ["BIDSLayout"]
| __all__ = ["bids_layout"]
| Python | 0 |
31c5071203fa234521cb8d3270f0c0f75488934d | Add test for IX prefixes. | peeringdb/tests.py | peeringdb/tests.py | from __future__ import unicode_literals
from django.test import TestCase
from django.utils import timezone
from .api import PeeringDB
from .models import Network, NetworkIXLAN
class PeeringDBTestCase(TestCase):
def test_time_last_sync(self):
api = PeeringDB()
# Test when no sync has been done
... | from __future__ import unicode_literals
from django.test import TestCase
from django.utils import timezone
from .api import PeeringDB
from .models import Network, NetworkIXLAN
class PeeringDBTestCase(TestCase):
def test_time_last_sync(self):
api = PeeringDB()
# Test when no sync has been done
... | Python | 0 |
93eb1fb058629f25f919a9c5f3647702c2767b22 | test parsing nested rules and toplevel imports | peru/test/test_parser.py | peru/test/test_parser.py | from textwrap import dedent
import unittest
from peru.parser import parse_string
from peru.remote_module import RemoteModule
from peru.rule import Rule
class ParserTest(unittest.TestCase):
def test_parse_empty_file(self):
scope, local_module = parse_string("")
self.assertDictEqual(scope, {})
... | from textwrap import dedent
import unittest
from peru.parser import parse_string
from peru.remote_module import RemoteModule
from peru.rule import Rule
class ParserTest(unittest.TestCase):
def test_parse_empty_file(self):
scope, local_module = parse_string("")
self.assertDictEqual(scope, {})
... | Python | 0 |
8bb77e1cf4c5ec284641a178a106300db2f5575d | Use UTC | petitions/views.py | petitions/views.py | from django.shortcuts import render, get_object_or_404, render, redirect
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from django.db.models import F
from datetime import datetime
from petitions.models import Petition
from profile.models import Profile
... | from django.shortcuts import render, get_object_or_404, render, redirect
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from django.db.models import F
from datetime import datetime
from petitions.models import Petition
from profile.models import Profile
... | Python | 0 |
03b17837ed2c88692f1b99ec5b9b477f86fdddb6 | Update version to 2.2b4-dev | openslides/__init__.py | openslides/__init__.py | __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.2b4-dev'
__license__ = 'MIT'
__url__ = 'https://openslides.org'
args = None
| __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.2b3'
__license__ = 'MIT'
__url__ = 'https://openslides.org'
args = None
| Python | 0 |
356fdc5d69dadbddeb7cd064593ab31b7993a0bc | Use shared helper code for palevoccbot. | abusehelper/contrib/abusech/palevoccbot.py | abusehelper/contrib/abusech/palevoccbot.py | """
abuse.ch Palevo C&C feed RSS bot.
Maintainer: Lari Huttunen <mit-code@huttu.net>
"""
from abusehelper.core import bot
from . import is_ip, split_description, AbuseCHFeedBot
class PalevoCcBot(AbuseCHFeedBot):
feeds = bot.ListParam(default=["https://palevotracker.abuse.ch/?rssfeed"])
# If treat_as_dns_so... | """
abuse.ch Palevo C&C feed RSS bot.
Maintainer: Lari Huttunen <mit-code@huttu.net>
"""
from abusehelper.core import bot, events
from abusehelper.contrib.rssbot.rssbot import RSSBot
from . import is_ip
class PalevoCcBot(RSSBot):
feeds = bot.ListParam(default=["https://palevotracker.abuse.ch/?rssfeed"])
# ... | Python | 0 |
49f68d89d28650609e92db515063d3847d614eb8 | use isotropic sigma | tests/mesh/test_cylMeshInnerProducts.py | tests/mesh/test_cylMeshInnerProducts.py | from SimPEG import Mesh
import numpy as np
import sympy
from sympy.abc import r, t, z
import unittest
TOL = 1e-1
class CylInnerProducts_Test(unittest.TestCase):
def test_FaceInnerProduct(self):
# Here we will make up some j vectors that vary in space
# j = [j_r, j_z] - to test face inner products... | from SimPEG import Mesh
import numpy as np
import sympy
from sympy.abc import r, t, z
import unittest
TOL = 1e-1
class CylInnerProducts_Test(unittest.TestCase):
def test_FaceInnerProduct(self):
# Here we will make up some j vectors that vary in space
# j = [j_r, j_z] - to test face inner products... | Python | 0.000004 |
490230242d51d23650406085a7af92dfbb14c16d | Use shop ID from order | byceps/blueprints/shop/orders/views.py | byceps/blueprints/shop/orders/views.py | """
byceps.blueprints.shop.orders.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import abort, g
from ....services.party import service as party_service
from ....services.shop.order import service as order_service
f... | """
byceps.blueprints.shop.orders.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import abort, g
from ....services.party import service as party_service
from ....services.shop.order import service as order_service
f... | Python | 0 |
652711e9a4884a31be74df6ae791e47dcd401871 | remove deprecated test suite declarations | account_partner_required/tests/__init__.py | account_partner_required/tests/__init__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account partner required module for OpenERP
# Copyright (C) 2014 Acsone (http://acsone.eu).
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# This program is free software: you can redistribu... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account partner required module for OpenERP
# Copyright (C) 2014 Acsone (http://acsone.eu).
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# This program is free software: you can redistribu... | Python | 0 |
55983401814bc0e7158d213885ebdfdbc7e02e9b | Add dependency on the requests module and refactor | DeployUtil/authentication.py | DeployUtil/authentication.py | import requests
import json
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
# But we cannot verify our HTTPS cert yet because we cannot get it off
# of all devices.
# If the tooling gets smarter... | import urllib.request
import http.cookiejar
import DeployUtil.toolsession as session
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin=... | Python | 0.000001 |
40957fe0b273f92a28e0b5f27cc4a46ba5e1f2b8 | Add coverage pragma | sktracker/trajectories/__init__.py | sktracker/trajectories/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import logging
log = logging.getLogger(__name__)
from .trajectories import Trajectories
try: # pragma: no cover
from . import draw
__a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import logging
log = logging.getLogger(__name__)
from .trajectories import Trajectories
try:
from . import draw
__all__ = ['Trajectorie... | Python | 0.000003 |
0610cebeccbd8431906558506ba22654e1104ea9 | fix test | corehq/ex-submodules/couchexport/tests/test_writers.py | corehq/ex-submodules/couchexport/tests/test_writers.py | # coding: utf-8
from codecs import BOM_UTF8
import StringIO
from couchexport.writers import ZippedExportWriter, CsvFileWriter, PythonDictWriter
from django.test import SimpleTestCase
from mock import patch, Mock
class ZippedExportWriterTests(SimpleTestCase):
def setUp(self):
self.zip_file_patch = patch... | # coding: utf-8
from codecs import BOM_UTF8
import StringIO
from couchexport.writers import ZippedExportWriter, CsvFileWriter, PythonDictWriter
from django.test import SimpleTestCase
from mock import patch, Mock
class ZippedExportWriterTests(SimpleTestCase):
def setUp(self):
self.zip_file_patch = patch... | Python | 0.000002 |
92ebaf9e1507acf1fc10f4448fc00db43508f23b | Allow alternate string key lookup for enums | djstripe/enums.py | djstripe/enums.py | from enum import Enum as _Enum
from django.utils.decorators import classproperty
class Enum(_Enum):
@classproperty
def choices(cls):
return tuple((cls.keys.get(k, k), v.value) for k, v in cls.__members__.items())
@classproperty
def keys(cls):
# Returns a mapping of key overrides.
... | from enum import Enum as _Enum
from django.utils.decorators import classproperty
class Enum(_Enum):
@classproperty
def choices(cls):
return tuple((k, v.value) for k, v in cls.__members__.items())
class CardTokenizationMethod(Enum):
apple_pay = "Apple Pay"
android_pay = "Android Pay"
| Python | 0 |
eadfd0c784d077db4b48facb5e7161c76ede598a | remove commented out code | graphitepager/worker.py | graphitepager/worker.py | import datetime
import time
import redis
import requests
import requests.exceptions
from graphitepager.config import get_config
from graphitepager.description import get_descriptions
from graphitepager.description import missing_target_descriptions
from graphitepager.graphite_data_record import GraphiteDataRecord
fro... | import datetime
import time
import redis
import requests
import requests.exceptions
from graphitepager.config import get_config
from graphitepager.description import get_descriptions
from graphitepager.description import missing_target_descriptions
from graphitepager.graphite_data_record import GraphiteDataRecord
fro... | Python | 0 |
ec5cc5d30b50e12c2e11f6206c220b4f2731e352 | implement class | pgmapcss/misc/pgcache.py | pgmapcss/misc/pgcache.py | class PGCache:
def __init__(self, id, read_id=False, read_geo=False):
global PGCaches
try:
PGCaches
except:
PGCaches = {}
PGCaches[id] = self
self.id = id
self.read_id = read_id
self.read_geo = read_geo
self.cache_id = len(PGCa... | class PGCache:
def __init__(self, id, read_id=False, read_geo=False):
global PGCaches
try:
PGCaches
except:
PGCaches = {}
PGCaches[id] = self
def add(self, data, id=None, geo=None):
pass
def get(self, id=None):
pass
def query(se... | Python | 0.000001 |
6094b147dccc4abf3ef23d5e54b1e23a955d6ecb | remove prints | slider/templatetags/slider_tags.py | slider/templatetags/slider_tags.py | # -*- coding: utf-8 -*-
from django import template
from slider.models import SliderImage
register = template.Library()
@register.assignment_tag
def get_slider_images(limit=False, randomize=True, slider=1):
qs = SliderImage.objects.filter(is_visible=True,slider=slider)
if randomize:
qs = qs.order... | # -*- coding: utf-8 -*-
from django import template
from slider.models import SliderImage
register = template.Library()
@register.assignment_tag
def get_slider_images(limit=False, randomize=True, slider=1):
qs = SliderImage.objects.filter(is_visible=True,slider=slider)
print randomize
if randomize:
... | Python | 0.000012 |
2378a64ab1e106c8f6f455a9023d350eaf627767 | add manual | oa_manual.py | oa_manual.py | from collections import defaultdict
from time import time
from util import elapsed
# things to set here:
# license, free_metadata_url, free_pdf_url
# free_fulltext_url is set automatically from free_metadata_url and free_pdf_url
def get_overrides_dict():
override_dict = defaultdict(dict)
# cindy wu ex... | from collections import defaultdict
from time import time
from util import elapsed
# things to set here:
# license, free_metadata_url, free_pdf_url
# free_fulltext_url is set automatically from free_metadata_url and free_pdf_url
def get_overrides_dict():
override_dict = defaultdict(dict)
# cindy wu ex... | Python | 0 |
8206ea76804cf08298eeab8673b2326440aa8663 | check for existing bonds before drawing | orbis/gui/sketchpad.py | orbis/gui/sketchpad.py | import matplotlib
import matplotlib.patches
import numpy
import wx
from plots import Plot
#====================================================================================
class SketchPad(Plot):
"""sketch pad for drawing molecules"""
ATOM_RADIUS = 0.1
PICK_TOLERANCE = 5
#--------------------... | import matplotlib
import matplotlib.patches
import numpy
import wx
from plots import Plot
#====================================================================================
class SketchPad(Plot):
"""sketch pad for drawing molecules"""
ATOM_RADIUS = 0.1
PICK_TOLERANCE = 5
#--------------------... | Python | 0 |
f6740a7b2662ce8ad4112757663cf0e4ab184394 | convert all sample fields to their respective types | rowprocsv.py | rowprocsv.py | """
Module for reading and exporting csv files exported from Concept2 RowPro
"""
import datetime
import tcx
class RowProCSV:
HEADER_SUMMARY = 'Date,TotalTime,TotalDistance,'
FIELDS_SUMMARY = [
'date', 'total_time', 'total_distance', 'avg_pace', 'unit', 'origin', 'total_cals', 'duty_cycle', 'type',
... | """
Module for reading and exporting csv files exported from Concept2 RowPro
"""
import datetime
import tcx
class RowProCSV:
HEADER_SUMMARY = 'Date,TotalTime,TotalDistance,'
FIELDS_SUMMARY = [
'date', 'total_time', 'total_distance', 'avg_pace', 'unit', 'origin', 'total_cals', 'duty_cycle', 'type',
... | Python | 0.002177 |
d3d9e0f5c0da8408bcdb241509cb7dd1f41fd4bd | use hash when title not present | src/you_get/extractors/imgur.py | src/you_get/extractors/imgur.py | #!/usr/bin/env python
from ..common import *
from ..extractor import VideoExtractor
from .universal import *
class Imgur(VideoExtractor):
name = "Imgur"
stream_types = [
{'id': 'original'},
{'id': 'thumbnail'},
]
def prepare(self, **kwargs):
if re.search(r'imgur\.com/a/', sel... | #!/usr/bin/env python
from ..common import *
from ..extractor import VideoExtractor
from .universal import *
class Imgur(VideoExtractor):
name = "Imgur"
stream_types = [
{'id': 'original'},
{'id': 'thumbnail'},
]
def prepare(self, **kwargs):
if re.search(r'imgur\.com/a/', sel... | Python | 0.000083 |
c55f21aa4925f6227086dedca2a3f839db98d8e1 | implement unit tests for debug command | tests/lib/cmdline/commands/test_debug.py | tests/lib/cmdline/commands/test_debug.py | # Copyright 2015 Curtis Sand
#
# 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, ... | # Copyright 2015 Curtis Sand
#
# 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, ... | Python | 0.000005 |
ecdcfe6d3e5f076f92b38b4a76d2975bce2bc4a2 | add -b and -sp | rna_tools/tools/md/rna_minimize.py | rna_tools/tools/md/rna_minimize.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ddd
"""
from __future__ import print_function
from openmm.app import *
from openmm import *
from openmm.unit import *
from sys import stdout
import argparse
from rna_tools.tools.mq.lib.timex import timex
def get_parser():
parser = argparse.ArgumentParser(
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import print_function
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys import stdout
import argparse
def get_parser():
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=arg... | Python | 0.000004 |
482f9ffaf1c2998fafc924a91b07656d3c054c91 | fix string | bin/extract_darkmatter.py | bin/extract_darkmatter.py | #!/usr/bin/env python
import argparse
import leveldb
import os
import shutil
import sys
from Bio import SeqIO
def main(args):
parser = argparse.ArgumentParser(description="Script to extract darkmatter - predicted proteins with no similarities")
parser.add_argument("-i", "--input", dest="input", help="Name of ... | #!/usr/bin/env python
import argparse
import leveldb
import os
import shutil
import sys
from Bio import SeqIO
def main(args):
parser = argparse.ArgumentParser(description="Script to extract darkmatter - predicted proteins with no similarities")
parser.add_argument("-i", "--input", dest="input", help="Name of ... | Python | 0.999999 |
b49f22af96644daa67c8d75881f59edd98b652b0 | Fix import broken by s/html/serialization | kraken/transcrib.py | kraken/transcrib.py | # -*- coding: utf-8 -*-
#
# Copyright 2015 Benjamin Kiessling
#
# 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 applicab... | # -*- coding: utf-8 -*-
#
# Copyright 2015 Benjamin Kiessling
#
# 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 applicab... | Python | 0.000001 |
19d5d98350c8ef6f8e3d9153a899a6ce466e5e21 | Rename `UserOwnedModelManager` to just `UserOwnedManager` for consistency with Django naming convention. Replace `_for_user` methods with methods that override the base manager methods - this should help enforce a user context for models, and implement initial set of method overrides in this manner. | owned_models/models.py | owned_models/models.py | from django.conf import settings
from django.db import models
class UserOwnedManager(models.Manager):
"""
Wraps standard Manager query methods and adds a required `user` argument, to enforce all calls
made through this manager to be made within a user context.
"""
def all(self, user):
ret... | from django.conf import settings
from django.db import models
class UserOwnedModelManager(models.Manager):
def filter_for_user(self, user, *args, **kwargs):
return super(UserOwnedModelManager, self).get_queryset().filter(user = user, *args, **kwargs)
def get_for_user(self, user, *args, **kwargs):
... | Python | 0 |
aa6b1daedbd911c23857033bcc601bdae37627f0 | Fix the Stream wrapping class. It had moved from elsewhere, but wasn't corrected for its new home in util.py | subversion/bindings/swig/python/svn/util.py | subversion/bindings/swig/python/svn/util.py | #
# svn.util: public Python interface for miscellaneous bindings
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2001 CollabNet. All rights reserved.
#
# This software... | #
# svn.util: public Python interface for miscellaneous bindings
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2001 CollabNet. All rights reserved.
#
# This software... | Python | 0.999587 |
b41ad87d9cb941abce185d367c973e0a3f2802cb | Update flaskext sqlalchemy module import. | pystil/db.py | pystil/db.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Florian Mounier, Kozea
# This file is part of pystil, licensed under a 3-clause BSD license.
from flask_sqlalchemy import SQLAlchemy
from datetime import timedelta
from sqlalchemy import func, desc
from sqlalchemy.orm import column_property
from sqla... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Florian Mounier, Kozea
# This file is part of pystil, licensed under a 3-clause BSD license.
from flaskext.sqlalchemy import SQLAlchemy
from datetime import timedelta
from sqlalchemy import func, desc
from sqlalchemy.orm import column_property
from s... | Python | 0 |
be10731cab38445a3d1c3a6df3703fba3fecc93f | Fix accessing argv | examples/move-by-label.py | examples/move-by-label.py | #!/usr/bin/env python
"""
Example script to move torrents based on their label set in ruTorrent.
./move-by-label.py USERNAME HOSTNAME [PATH]
"""
from __future__ import print_function
from time import sleep
import sys
from xirvik.client import ruTorrentClient
USERNAME = sys.argv[1]
HOST = sys.argv[2]
try:
PATH = ... | #!/usr/bin/env python
"""
Example script to move torrents based on their label set in ruTorrent.
./move-by-label.py USERNAME HOSTNAME [PATH]
"""
from __future__ import print_function
from time import sleep
import sys
from xirvik.client import ruTorrentClient
USERNAME = sys.argv[1]
HOST = sys.arg[2]
try:
PATH = s... | Python | 0.000006 |
b2fd88546c73e4aadb0e697233a7bfd20398e429 | Check the PBS_NUM_NODES environment variable first when auto_npar = True. | sshcustodian/vasp/sshjobs.py | sshcustodian/vasp/sshjobs.py | # File: sshcustodian/vasp/sshjobs.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
"""
"""
import os
import shutil
import math
from pymatgen.io.vasp import Incar
from pymatgen.io.smart import read_structure
from pymatgen.io.vasp.sets import MPVaspInputSet
from custodian.vasp.interpreter... | # File: sshcustodian/vasp/sshjobs.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
"""
"""
import os
import shutil
import math
from pymatgen.io.vasp import Incar
from pymatgen.io.smart import read_structure
from pymatgen.io.vasp.sets import MPVaspInputSet
from custodian.vasp.interpreter... | Python | 0 |
6ece7062e539e2196ff04c49f07913c884907878 | rearrange lines to make colors to player map clear | run-relax.py | run-relax.py | #!/usr/bin/env python
import sys
import time
from Mindwave.mindwave import BluetoothHeadset, FakeHeadset
# Note: on OS X, BluetoothHeadset will not work
from parameters import SharedParameters
from threads import HeadsetThread
from gameplay import GameObject
from game_effects import generate_player_renderer
from contr... | #!/usr/bin/env python
import sys
import time
from Mindwave.mindwave import BluetoothHeadset, FakeHeadset
# Note: on OS X, BluetoothHeadset will not work
from parameters import SharedParameters
from threads import HeadsetThread
from gameplay import GameObject
from game_effects import generate_player_renderer
from contr... | Python | 0 |
0f0fc4037997f6ae4eef019547e3c8d8cf05db9c | modify test data | drda/tests/test_derby.py | drda/tests/test_derby.py | ##############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2016 Hajime Nakagami
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... | ##############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2016 Hajime Nakagami
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... | Python | 0.000006 |
2ab1c23ca4be991c174514998496ea4f7c8f6c3a | Make indentation consistent with other code | serve.py | serve.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module serves a WSGI application using werkzeug.
Author: Logan Raarup <logan@logan.dk>
"""
import importlib
import os
import sys
try:
from werkzeug import serving
except ImportError: # pragma: no cover
sys.exit('Unable to import werkzeug (run: pip instal... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module serves a WSGI application using werkzeug.
Author: Logan Raarup <logan@logan.dk>
"""
import importlib
import os
import sys
try:
from werkzeug import serving
except ImportError: # pragma: no cover
sys.exit('Unable to import werkzeug (run: pip instal... | Python | 0.000144 |
89ad9ad4e8d8820b89b65b281375782d80275446 | Fix status | aldryn_essential_addons_dashboard/views.py | aldryn_essential_addons_dashboard/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import re
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from versionfield.version import Version
from versionfield.constants import DEFAULT_NUMBER_BITS
from ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import re
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from versionfield.version import Version
from versionfield.constants import DEFAULT_NUMBER_BITS
from ... | Python | 0.000001 |
cdedb1d6875a8ab5f42369b1801a1fc0ee205654 | Add option to generate coverage report | run_tests.py | run_tests.py | #!/usr/bin/env python
"""
Driver script for testing nu-TuLiP. Try calling it with "-h" flag.
SCL; 5 Sep 2013.
"""
import sys
import os.path
import nose
if __name__ == "__main__":
if ("-h" in sys.argv) or ("--help" in sys.argv):
print """Usage: run_tests.py [--cover] [--fast] [OPTIONS...] [[-]TESTFILES..... | #!/usr/bin/env python
"""
Driver script for testing nu-TuLiP. Try calling it with "-h" flag.
SCL; 6 May 2013.
"""
import sys
import os.path
import nose
if __name__ == "__main__":
if ("-h" in sys.argv) or ("--help" in sys.argv):
print """Usage: run_tests.py [--fast] [OPTIONS...] [[-]TESTFILES...]
TE... | Python | 0 |
b74d9d3a780082b8cb326a553a9b4c84ca5368be | Add IS_OFFLINE environment variable to serve | serve.py | serve.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module serves a WSGI application using werkzeug.
Author: Logan Raarup <logan@logan.dk>
"""
import importlib
import os
import sys
try:
from werkzeug import serving
except ImportError: # pragma: no cover
sys.exit('Unable to import werkzeug (run: pip instal... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module serves a WSGI application using werkzeug.
Author: Logan Raarup <logan@logan.dk>
"""
import importlib
import os
import sys
try:
from werkzeug import serving
except ImportError: # pragma: no cover
sys.exit('Unable to import werkzeug (run: pip instal... | Python | 0 |
224aa339ee7f1720ebb3616aa62ba06975c1a11d | handle .blend model sources | pak_profiles/common.py | pak_profiles/common.py | #! /usr/bin/env python3
#-*- coding: UTF-8 -*-
### Legal
#
# Author: Thomas DEBESSE <dev@illwieckz.net>
# License: ISC
#
file_common_deps = {
"file_base": "DEPS",
"description": "Package DEPS file",
"action": "copy",
}
file_common_external_editor = {
"file_ext": [
"xcf",
"psd",
"ora",
],
"description":... | #! /usr/bin/env python3
#-*- coding: UTF-8 -*-
### Legal
#
# Author: Thomas DEBESSE <dev@illwieckz.net>
# License: ISC
#
file_common_deps = {
"file_base": "DEPS",
"description": "Package DEPS file",
"action": "copy",
}
file_common_external_editor = {
"file_ext": [
"xcf",
"psd",
"ora",
],
"description":... | Python | 0 |
52d835ec8a3dfec53c3cab23598be6f63da9addc | Update prims_minimum_spanning.py | algorithms/graph/prims_minimum_spanning.py | algorithms/graph/prims_minimum_spanning.py | '''
This Prim's Algorithm Code is for finding weight of minimum spanning tree
of a connected graph.
For argument graph, it should be a dictionary type
such as
graph = {
'a': [ [3, 'b'], [8,'c'] ],
'b': [ [3, 'a'], [5, 'd'] ],
'c': [ [8, 'a'], [2, 'd'], [4, 'e'] ],
'd': [ [5, 'b'], [2, 'c'], [6, 'e'] ],
... | import heapq # for priority queue
# prim's algo. to find weight of minimum spanning tree
def prims(graph):
vis=[]
s=[[0,1]]
prim = []
mincost=0
while(len(s)>0):
v=heapq.heappop(s)
x=v[1]
if(x in vis):
continue
mincost += v[0]
prim.append(x)... | Python | 0 |
0227f7e964dcc1a31b4accc657eb40f78b0282d1 | Deal with Django 1.8 deprecation/removal of django.test.simple. | run_tests.py | run_tests.py | #!/usr/bin/env python
import os, sys
from django.conf import settings
from django.test.utils import get_runner
import django
DIRNAME = os.path.dirname(__file__)
if django.VERSION[1] < 4:
# If the version is NOT django 4 or greater
# then remove the TZ setting.
settings.configure(DEBUG=True,
... | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DIRNAME = os.path.dirname(__file__)
if django.VERSION[1] < 4:
# If the version is NOT django 4 or greater
# then remove the TZ setting.
settings.configure(DEBUG=True,
DATABASES={
... | Python | 0 |
608225fa8a62cb5c0aa42b1a2e371c1e1b731d58 | fix bug in GrandPrixWidget | driver27/admin/common.py | driver27/admin/common.py | from django import forms
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from tabbed_admin import TabbedModelAdmin
from django.utils.safestring import mark_safe
from django.utils.html import format_html
from django.utils.encoding import force_text
class GrandPrixWidget... | from django import forms
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from tabbed_admin import TabbedModelAdmin
from django.utils.safestring import mark_safe
from django.utils.html import format_html
from django.utils.encoding import force_text
class GrandPrixWidget... | Python | 0 |
9e0f62c3eedd2c5376af4178a0ecf529898a041b | Update command doc for open | guild/commands/open_.py | guild/commands/open_.py | # Copyright 2017-2020 TensorHub, 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 writ... | # Copyright 2017-2020 TensorHub, 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 writ... | Python | 0 |
f12b3f5c5a1409f44fc2acbb54d53fc668028e4a | Set print options for numpy 1.14 to 1.13. | landlab/__init__.py | landlab/__init__.py | #! /usr/bin/env python
"""The Landlab
:Package name: TheLandlab
:Release date: 2013-03-24
:Authors: Greg Tucker, Nicole Gasparini, Erkan Istanbulluoglu, Daniel Hobley,
Sai Nudurupati, Jordan Adams, Eric Hutton
:URL: http://csdms.colorado.edu/trac/landlab
:License: MIT
"""
from __future__ import absolute_import
im... | #! /usr/bin/env python
"""The Landlab
:Package name: TheLandlab
:Release date: 2013-03-24
:Authors: Greg Tucker, Nicole Gasparini, Erkan Istanbulluoglu, Daniel Hobley,
Sai Nudurupati, Jordan Adams, Eric Hutton
:URL: http://csdms.colorado.edu/trac/landlab
:License: MIT
"""
from __future__ import absolute_import
im... | Python | 0.000107 |
bcac5b2faf882fda49a3bff7eae147bcb8cbd460 | Fix spelling of setup-readme.md | setup.py | setup.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from os import sys
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip instal... | # -*- coding: utf-8 -*-
from __future__ import print_function
from os import sys
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip instal... | Python | 0.000008 |
caf45bc9d92bb496a3fb32b494db623b5b405208 | bump version | picker/__init__.py | picker/__init__.py | VERSION = (0, 5, 0)
default_app_config = 'picker.apps.PickerConfig'
def get_version():
return '.'.join(map(str, VERSION))
| VERSION = (0, 4, 0)
default_app_config = 'picker.apps.PickerConfig'
def get_version():
return '.'.join(map(str, VERSION))
| Python | 0 |
2b939c703951c0a7042fa336d9c685c437fb0586 | Bump to version 1.2 | setup.py | setup.py | """Setup script for templer.django-project-app"""
from setuptools import setup
from setuptools import find_packages
version = '1.2'
setup(
name='templer.django-project-app',
version=version,
description='Templer extension for creating '
'Django applications within projects.',
long_description=open... | """Setup script for templer.django-project-app"""
from setuptools import setup
from setuptools import find_packages
version = '1.1'
setup(
name='templer.django-project-app',
version=version,
description='Templer extension for creating '
'Django applications within projects.',
long_description=open... | Python | 0 |
9669a99d1a76f346b2cfb9b4197636ac3142f9d2 | Update users table in a batched manner | synapse/storage/schema/delta/30/as_users.py | synapse/storage/schema/delta/30/as_users.py | # Copyright 2016 OpenMarket Ltd
#
# 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 writin... | # Copyright 2016 OpenMarket Ltd
#
# 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 writin... | Python | 0 |
da5a05c27f1c19c69ce23f5cd6cd0f09edb9d7f7 | Refactor common serializer selection code. | paranuara_api/views.py | paranuara_api/views.py | from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class MultiSerializerMixin(object):
def get_serializer_class(self):
return self.s... | from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class CompanyViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
... | Python | 0 |
a2a849f3d425e9c544a66d2b04ab80555be16add | Fix path error | drivnal/handlers/path.py | drivnal/handlers/path.py | from drivnal.constants import *
from drivnal.backup import Client
import drivnal.utils as utils
from drivnal import server
import os
import flask
@server.app.route('/path', methods=['GET'])
@server.app.route('/path/<path:path>', methods=['GET'])
def path_get(path=None):
path = '/' + (path or '')
paths = []
... | from drivnal.constants import *
from drivnal.backup import Client
import drivnal.utils as utils
from drivnal import server
import os
import flask
@server.app.route('/path', methods=['GET'])
@server.app.route('/path/<path:path>', methods=['GET'])
def path_get(path=None):
path = '/' + (path or '')
paths = []
... | Python | 0.000014 |
9728d151967b6796ef2a34d8a9867fd109fe48f3 | remove psutil from setup.py | setup.py | setup.py | # Copyright 2013-2014 MongoDB, 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 writin... | # Copyright 2013-2014 MongoDB, 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 writin... | Python | 0.000001 |
90cec05ed692e9be580d0df6a7738684fe76a6a1 | Add print method | publisher.py | publisher.py | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# 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 b... | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# 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 b... | Python | 0.000068 |
f8ee0fc34d060016f0f601e1d84000b9c612efc6 | exclude "abstract" methods from coverage | muninn/storage/base.py | muninn/storage/base.py | import os.path
import muninn.util as util
class StorageBackend(object):
def __init__(self):
self.supports_symlinks = False
self.global_prefix = ''
def get_tmp_root(self, product):
if self._tmp_root:
tmp_root = os.path.join(self._tmp_root, product.core.archive_path)
... | import os.path
import muninn.util as util
class StorageBackend(object):
def __init__(self):
self.supports_symlinks = False
self.global_prefix = ''
def get_tmp_root(self, product):
if self._tmp_root:
tmp_root = os.path.join(self._tmp_root, product.core.archive_path)
... | Python | 0 |
5261aa35eb5ab697310efc5bc8b7d11e8655127b | Update project info | setup.py | setup.py | """ setup script for "portal" package
for development:
python setup.py develop
to install:
python setup.py install
"""
from setuptools import setup
project = "portal"
# maintain long_description as a single long line.
# workaround for a bug in pkg_info._get_metadata("PKG-INFO")
long_description =\
"""Alph... | """ setup script for "portal" package
for development:
python setup.py develop
to install:
python setup.py install
"""
from setuptools import setup
project = "portal"
# maintain long_description as a single long line.
# workaround for a bug in pkg_info._get_metadata("PKG-INFO")
long_description =\
"""Alph... | Python | 0 |
6ce8537236f6bbc92789dc57a07befad391e2bc8 | fix install_requires | setup.py | setup.py | from setuptools import setup
version = '2.4.2'
setup(
name='cbagent',
version=version,
description='Stats collectors package for Couchbase Server monitoring',
author='Couchbase',
license='Apache Software License',
packages=[
'cbagent',
'cbagent.collectors',
'cbagent.col... | from setuptools import setup
version = '2.4.1'
setup(
name='cbagent',
version=version,
description='Stats collectors package for Couchbase Server monitoring',
author='Couchbase',
license='Apache Software License',
packages=[
'cbagent',
'cbagent.collectors',
'cbagent.col... | Python | 0.000001 |
cfc5b528a25b0c77086208755d7075bf1f17efbc | Add patient id in SimplePatientSerializer | patient/serializers.py | patient/serializers.py | from django.contrib.auth.models import User
from .models import Patient
from rest_framework import serializers
import datetime
from next_of_kin.models import NextOfKin
from next_of_kin.serializers import NextOfKinSerializer
class SimpleUserSerializer(serializers.ModelSerializer):
full_name = serializers.Serializer... | from django.contrib.auth.models import User
from .models import Patient
from rest_framework import serializers
import datetime
from next_of_kin.models import NextOfKin
from next_of_kin.serializers import NextOfKinSerializer
class SimpleUserSerializer(serializers.ModelSerializer):
full_name = serializers.Serializer... | Python | 0.000001 |
b1933e4d998d703a14bbb1769e04a078fac215bc | Update HexStats.py | HexChat/HexStats.py | HexChat/HexStats.py | import hexchat
#Based on Weechat's Weestats: https://weechat.org/scripts/source/weestats.py.html/
#By Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com>
__module_name__ = 'HexStats'
__module_version__ = '0.0.1'
__module_description__ = 'Displays HexChat-wide User Statistics'
__module_author__ = 'Vlek'
def st... | import hexchat
#Based on Weechat's Weestats: https://weechat.org/scripts/source/weestats.py.html/
#By Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com>
__module_name__ = 'HexStats'
__module_version__ = '0.0.1'
__module_description__ = 'Displays HexChat Wide User Statistics'
__module_author__ = 'Vlek'
def st... | Python | 0.000001 |
1a6b79629c4e79e3917287a693047fbe5e0129ad | Check user if admin before lockdown | plugins/lock_the_chat.py | plugins/lock_the_chat.py | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | """
Echo plugin example
"""
import octeon
global locked
locked = []
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
@plugin.message(regex=".*") # You pass regex pattern
def lock_check(bot, update):
if update.message.chat_i... | Python | 0.000001 |
b3204ccf3bd3ac26cabb4e6aa75bdb9dbf3f9e75 | Sentence case the biscuit | elections/uk/migrations/0005_add_favourite_biscuits.py | elections/uk/migrations/0005_add_favourite_biscuits.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
def create_simple_fields(apps, schema_editor):
ExtraField = apps.get_model('candidates', 'ExtraField')
db_alias = schema_editor.connection.alias
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
def create_simple_fields(apps, schema_editor):
ExtraField = apps.get_model('candidates', 'ExtraField')
db_alias = schema_editor.connection.alias
... | Python | 0.999999 |
d60f0fa1f942a24ca38ce20f2b5a617eb5181456 | update session backend | hiren/hiren/settings.py | hiren/hiren/settings.py | """
Django settings for hiren project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | """
Django settings for hiren project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | Python | 0.000001 |
8b01df8ffb790a66cb054206def0a425275539c4 | Fix encoding issue and comment improvement (#1807) | endpoints/getting-started/clients/google-jwt-client.py | endpoints/getting-started/clients/google-jwt-client.py | #!/usr/bin/env python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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... | #!/usr/bin/env python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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... | Python | 0 |
243c4ba66d35efbe58944ff973d668d9a3b7c6f8 | Update __init__.py | VertexActions/__init__.py | VertexActions/__init__.py | #
| Python | 0.000072 | |
9a9a6643bbc26a3f359df52b0b4bbb4207225017 | Update VariationalAutoencoderRunner.py | autoencoder/VariationalAutoencoderRunner.py | autoencoder/VariationalAutoencoderRunner.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from autoencoder_models.VariationalAutoencoder import VariationalAutoe... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from autoencoder_models.VariationalAutoencoder import VariationalAutoe... | Python | 0.000001 |
32fa9354c221f91cc6790177371a00468d22cb85 | Fix the scan script | scan/scan.py | scan/scan.py | # Add your Python code here. E.g.
from microbit import *
MAX_ROWS=4
level = 9
def scan(pause=500, reverse=False):
for i in range(0,10):
x = 0
rows = i
cols = i
while x <= i:
for y in range(0,rows+1):
if x <= MAX_ROWS and y <= MAX_ROWS:
... | # Add your Python code here. E.g.
from microbit import *
MAX_ROWS=4
def scan(level,pause=500, reverse=False):
for i in range(0,10):
x = 0
rows = i
cols = i
while x <= i:
for y in range(0,rows+1):
if x <= MAX_ROWS and y <= MAX_ROWS:
co... | Python | 0.001609 |
9360c15f8883543ad5d83aa7dc870c60a1fed5ec | add infos | setup.py | setup.py | #!/usr/bin/env python3
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Philippe Proulx <philippe.proulx@efficios.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, i... | #!/usr/bin/env python3
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Philippe Proulx <philippe.proulx@efficios.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, i... | Python | 0 |
dc1773eaf3e66ddf5cbaa564bb55dbb8e51218ff | Fix #752: test case failed | topbeat/tests/system/test_filesystem.py | topbeat/tests/system/test_filesystem.py | from topbeat import TestCase
import numbers
"""
Contains tests for ide statistics.
"""
class Test(TestCase):
def test_filesystems(self):
"""
Checks that system wide stats are found in the output and
have the expected types.
"""
self.render_config_template(
syst... | from topbeat import TestCase
"""
Contains tests for ide statistics.
"""
class Test(TestCase):
def test_filesystems(self):
"""
Checks that system wide stats are found in the output and
have the expected types.
"""
self.render_config_template(
system_stats=False... | Python | 0 |
1dacd99bbe1b32586a013d7d6f0874271e097e7c | Revise var to reach | lc0055_jump_game.py | lc0055_jump_game.py | """Leetcode 55. Jump Game
Medium
URL: https://leetcode.com/problems/jump-game/
Given an array of non-negative integers, you are initially positioned at the
first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.
E... | """Leetcode 55. Jump Game
Medium
URL: https://leetcode.com/problems/jump-game/
Given an array of non-negative integers, you are initially positioned at the
first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.
E... | Python | 0 |
e908792a8a47b4afc478a89f479ab836d7acea5e | set 2to3 False | setup.py | setup.py | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
#
# Standard imports
#
import glob
import os
import sys
from setuptools import setup, find_packages
#
# desiutil needs to import some of its own code.
#
sys.path.insert(... | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
#
# Standard imports
#
import glob
import os
import sys
from setuptools import setup, find_packages
#
# desiutil needs to import some of its own code.
#
sys.path.insert(... | Python | 0.999999 |
012230b2693a1922cae4bbf163de1b4d23d00b40 | Fix beta sample | tensorforce/core/distributions/beta.py | tensorforce/core/distributions/beta.py | # Copyright 2017 reinforce.io. All Rights Reserved.
#
# 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... | # Copyright 2017 reinforce.io. All Rights Reserved.
#
# 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... | Python | 0.000011 |
32fe6ea4fa2aa710d2627b6c19c0e25013b72a1d | Test fixture update. | awx/main/tests/functional/test_rbac_workflow.py | awx/main/tests/functional/test_rbac_workflow.py | import pytest
from awx.main.access import (
WorkflowJobTemplateAccess,
WorkflowJobTemplateNodeAccess,
WorkflowJobAccess,
# WorkflowJobNodeAccess
)
@pytest.fixture
def wfjt(workflow_job_template_factory, organization):
objects = workflow_job_template_factory('test_workflow', organization=organizati... | import pytest
from awx.main.access import (
WorkflowJobTemplateAccess,
WorkflowJobTemplateNodeAccess,
WorkflowJobAccess,
# WorkflowJobNodeAccess
)
@pytest.fixture
def wfjt(workflow_job_template_factory, organization):
objects = workflow_job_template_factory('test_workflow', organization=organizati... | Python | 0 |
25ff2bcd545c7429dda5f3cd48ff8272c28d8965 | Complete recur sort w/ iter merge sol | lc0148_sort_list.py | lc0148_sort_list.py | """Leetcode 148. Sort List
Medium
URL: https://leetcode.com/problems/sort-list/
Sort a linked list in O(n log n) time using constant space complexity.
Example 1:
Input: 4->2->1->3
Output: 1->2->3->4
Example 2:
Input: -1->5->3->4->0
Output: -1->0->3->4->5
"""
# Definition for singly-linked list.
class ListNode(obje... | """Leetcode 148. Sort List
Medium
URL: https://leetcode.com/problems/sort-list/
Sort a linked list in O(n log n) time using constant space complexity.
Example 1:
Input: 4->2->1->3
Output: 1->2->3->4
Example 2:
Input: -1->5->3->4->0
Output: -1->0->3->4->5
"""
# Definition for singly-linked list.
class ListNode(obje... | Python | 0 |
d3d8267588b60f77b6c55ffd8461ddfa163501da | add dependency for protobuf | setup.py | setup.py | #!/usr/bin/env python
# Copyright 2011 The fast-python-pb Authors.
#
# 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 a... | #!/usr/bin/env python
# Copyright 2011 The fast-python-pb Authors.
#
# 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 a... | Python | 0 |
2035099fd78b1d0906403ec836a4b7e7144a6bbc | bump to 0.0.6 | swingtix/bookkeeper/__init__.py | swingtix/bookkeeper/__init__.py | __VERSION__='0.0.6'
| __VERSION__='0.0.5'
| Python | 0.000005 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.