commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
28518572a472f28c20ba60cdf536c51c7e9a7796 | use metrics_file variable | lenxeon/graph-index,douban/graph-index,douban/graph-index,lenxeon/graph-index | config.py | config.py | graphite_url = 'http://dori.intra.douban.com:8800'
listen_host = '0.0.0.0'
listen_port = 8808
debug = False
metrics_file = 'metrics.json'
| graphite_url = 'http://dori.intra.douban.com:8800'
listen_host = '0.0.0.0'
listen_port = 8808
debug = False
| mit | Python |
5f8ce25447905650343be76f73eba8287196a352 | change blank | holytortoise/abwreservierung,holytortoise/abwreservierung,holytortoise/abwreservierung,holytortoise/abwreservierung | src/reservierung/forms.py | src/reservierung/forms.py | from django import forms
import datetime
from .models import Reservierung,Raum
# Create the form class
class ReservierungForm(forms.Form):
choice = ()
model = Reservierung()
choice = model.create_choice()
reserviertFür = forms.CharField(max_length=40,required=False)
reservierterRaum = forms.Choice... | from django import forms
import datetime
from .models import Reservierung,Raum
# Create the form class
class ReservierungForm(forms.Form):
choice = ()
model = Reservierung()
choice = model.create_choice()
reserviertFür = forms.CharField(max_length=40,blank=True)
reservierterRaum = forms.ChoiceFiel... | mit | Python |
f9548f93e3e6154c3207b0d7b6f3e741ae5287a2 | bump to 0.15.1 | arq5x/gemini,bw2/gemini,heuermh/gemini,heuermh/gemini,bgruening/gemini,xuzetan/gemini,bpow/gemini,bpow/gemini,bpow/gemini,brentp/gemini,arq5x/gemini,udp3f/gemini,brentp/gemini,udp3f/gemini,bw2/gemini,bw2/gemini,bgruening/gemini,arq5x/gemini,bgruening/gemini,bpow/gemini,brentp/gemini,xuzetan/gemini,brentp/gemini,xuzetan... | gemini/version.py | gemini/version.py | __version__="0.15.1"
| __version__="0.15.0"
| mit | Python |
f114141aa1311bae4301e158cf2e6db43fe7391a | Bump version to 2.0.0b1 | vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch | polemarch/__init__.py | polemarch/__init__.py | """
### Polemarch is ansible based service for orchestration infrastructure.
* [Documentation](http://polemarch.readthedocs.io/)
* [Issue Tracker](https://gitlab.com/vstconsulting/polemarch/issues)
* [Source Code](https://gitlab.com/vstconsulting/polemarch)
"""
import os
import warnings
try:
from vstutils.enviro... | """
### Polemarch is ansible based service for orchestration infrastructure.
* [Documentation](http://polemarch.readthedocs.io/)
* [Issue Tracker](https://gitlab.com/vstconsulting/polemarch/issues)
* [Source Code](https://gitlab.com/vstconsulting/polemarch)
"""
import os
import warnings
try:
from vstutils.enviro... | agpl-3.0 | Python |
0c1976007c5f34d14bcc01f2fab9dee7c23e6381 | bump version to 0.5.0b | bpow/gemini,arq5x/gemini,bw2/gemini,udp3f/gemini,bgruening/gemini,bpow/gemini,brentp/gemini,heuermh/gemini,brentp/gemini,bw2/gemini,udp3f/gemini,xuzetan/gemini,xuzetan/gemini,bgruening/gemini,arq5x/gemini,heuermh/gemini,bpow/gemini,heuermh/gemini,brentp/gemini,xuzetan/gemini,arq5x/gemini,xuzetan/gemini,bgruening/gemini... | gemini/version.py | gemini/version.py | __version__="0.5.0b"
| __version__="0.4.0b"
| mit | Python |
245b32775db0de95d4feb54533a423748bddf7a0 | Bump version number | rkhleics/police-api-client-python | police_api/version.py | police_api/version.py | __version__ = '1.0.2'
| __version__ = '1.0.2dev'
| mit | Python |
50ead4fe13eec7ad9760f0f577212beb8e8a51be | Use a queryset to display only kind=page | mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,hzj123/56th,ken-muturi/pombola,mysociety/pombola,patricmutwiri/pombola,patricmutwiri/pombola,ken-muturi/pombola,ken-muturi/pombola,hzj123/56th,ken-muturi/pombola,ken-muturi/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,geoffkilpin/pombola,geoffkilpin/pombola,h... | pombola/info/views.py | pombola/info/views.py | from django.views.generic import DetailView
from models import InfoPage
class InfoPageView(DetailView):
"""Show the page for the given slug"""
model = InfoPage
queryset = InfoPage.objects.filter(kind=InfoPage.KIND_PAGE)
| from django.views.generic import DetailView
from models import InfoPage
class InfoPageView(DetailView):
"""Show the page, or 'index' if no slug"""
model = InfoPage
| agpl-3.0 | Python |
3fa0f7d3a6f52eb9f7cb7b32dc4e3760d1b50f62 | Update __init__.py | morganmeliment/Conway-Life,morganmeliment/Conway-Life | ggame/__init__.py | ggame/__init__.py | from ggame.ggame import *
from ggame.pyinput import *
| from ggame.ggame import *
| mit | Python |
3441b61821f88b0e04655953fb49fe56c950c852 | Use colors from config utils. | probcomp/cgpm,probcomp/cgpm | gpmcc/utils/plots.py | gpmcc/utils/plots.py | # -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Baxter S. Eaves Jr,
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# Lead Developer: Feras Saad <fsaad@mit.edu>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documen... | # -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Baxter S. Eaves Jr,
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# Lead Developer: Feras Saad <fsaad@mit.edu>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documen... | apache-2.0 | Python |
a9b61963d6c1fe6c85c4cafaed47a17f4f5ca589 | Add Version, Author and License info | aurainfosec/burp-multi-browser-highlighting | multi-browser.py | multi-browser.py | # Author: Emmanuel Law
# Version: 1.0
# License: MIT License
from burp import IBurpExtender
from burp import IHttpListener
from burp import IProxyListener
from burp import IInterceptedProxyMessage
from burp import IContextMenuFactory
from javax.swing import JMenuItem
from java.awt.event import ActionListener
fro... | from burp import IBurpExtender
from burp import IHttpListener
from burp import IProxyListener
from burp import IInterceptedProxyMessage
from burp import IContextMenuFactory
from javax.swing import JMenuItem
from java.awt.event import ActionListener
from java.io import PrintWriter
class BurpExtender(IBurpExtender,IPr... | mit | Python |
28de4cfc42fc45d8b0ad019b8334ba79ab0e14bd | Make it work properly. | Motoko11/MotoBot | desutest.py | desutest.py | from motobot import IRCBot, IRCLevel
import desutest as this
import threading
import traceback
def worker():
this.bot.run()
def main():
this.bot.load_plugins('plugins')
this.bot.load_database('desutest.json')
this.bot.join('#MotoChan')
thread = threading.Thread(target=worker)
thread.start... | from motobot import IRCBot, IRCLevel
import desutest as this
import threading
import traceback
def worker():
this.bot.run()
def main():
IRCBot.load_plugins('plugins')
this.bot.load_database('desutest.json')
this.bot.join('#MotoChan')
thread = threading.Thread(target=worker)
thread.start()... | mit | Python |
db87621ec04d599da8b62bb3569d83ac365dca3e | use latest Odoo address, instead of (old) stored ones | OCA/l10n-portugal,OCA/l10n-portugal | l10n_pt_account_invoicexpress/models/res_partner.py | l10n_pt_account_invoicexpress/models/res_partner.py | # Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class ResPartner(models.Model):
_inherit = "res.partner"
def _prepare_invoicexpress_vals(self):
self.ensure_one()
vals = {
"name": self.name,
... | # Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class ResPartner(models.Model):
_inherit = "res.partner"
def _prepare_invoicexpress_vals(self):
self.ensure_one()
vals = {
"name": self.name,
... | agpl-3.0 | Python |
140f4d85ce07d8c2fad5918dd3146c9a1678d705 | fix : remove misc comment | bas524/linuxdependency,bas524/linuxdependency | nautilus-python/extensions/linuxdependency.py | nautilus-python/extensions/linuxdependency.py |
import os, os.path
import urllib
from gi.repository import Nautilus, GObject, GConf
QLDD_KEY = '/usr/bin/Qldd'
class OpenQlddExtension(Nautilus.MenuProvider, GObject.GObject):
def __init__(self):
pass
def _open_qldd(self, file):
filename = urllib.unquote(file.get_uri()[7:])
... | # This example is contributed by Martin Enlund
import os, os.path
import urllib
from gi.repository import Nautilus, GObject, GConf
QLDD_KEY = '/usr/bin/Qldd'
class OpenQlddExtension(Nautilus.MenuProvider, GObject.GObject):
def __init__(self):
pass
def _open_qldd(self, file):
filename... | apache-2.0 | Python |
fe998861aadf2e1964badc90a8881a0329eca439 | Update paramsweep.py with new Python package name | petebachant/UNH-RVAT-turbinesFoam,petebachant/UNH-RVAT-turbinesFoam | paramsweep.py | paramsweep.py | #!/usr/bin/env python
"""
Run multiple simulations varying a single parameter.
"""
import foampy
from foampy.dictionaries import replace_value
import numpy as np
from subprocess import call
import os
import pandas as pd
from py_unh_rvat_turbinesfoam import processing as pr
def zero_tsr_fluc():
"""Set TSR fluctua... | #!/usr/bin/env python
"""
Run multiple simulations varying a single parameter.
"""
import foampy
from foampy.dictionaries import replace_value
import numpy as np
from subprocess import call
import os
import pandas as pd
from modules import processing as pr
def zero_tsr_fluc():
"""Set TSR fluctuation amplitude to... | mit | Python |
d8f6092b023660540c69ffb233716f98eb98208c | make sure the datadog port is an int | DXCanas/content-curation,jonboiser/content-curation,jonboiser/content-curation,jayoshih/content-curation,aronasorman/content-curation,DXCanas/content-curation,jonboiser/content-curation,fle-internal/content-curation,fle-internal/content-curation,jayoshih/content-curation,jayoshih/content-curation,DXCanas/content-curati... | contentcuration/contentcuration/production_settings.py | contentcuration/contentcuration/production_settings.py | import os
from .settings import *
SITE_ID = 3
STORAGE_ROOT = "/contentworkshop_content/storage/"
DB_ROOT = "/contentworkshop_content/databases/"
STATIC_ROOT = "/contentworkshop_static/"
MEDIA_ROOT = STORAGE_ROOT
SITE_ID = 3
SESSION_ENGINE = "django.contrib.sessions.backends.db"
if os.getenv("USE_DATADOG"):
I... | import os
from .settings import *
SITE_ID = 3
STORAGE_ROOT = "/contentworkshop_content/storage/"
DB_ROOT = "/contentworkshop_content/databases/"
STATIC_ROOT = "/contentworkshop_static/"
MEDIA_ROOT = STORAGE_ROOT
SITE_ID = 3
SESSION_ENGINE = "django.contrib.sessions.backends.db"
if os.getenv("USE_DATADOG"):
I... | mit | Python |
0ec52bf3d0764b110f70e677e2ec9ede8dcbfda1 | increase coverage | netkraken/minion,netkraken/minion | src/unittest/python/netkraken_tests.py | src/unittest/python/netkraken_tests.py | from __future__ import print_function
from datetime import datetime
import unittest
from mock import patch
import netkraken
from testhelper import myAssertDictEqual
class NetKrakenTests(unittest.TestCase):
def setUp(self):
netkraken.settings["stagedir"] = "/stage"
netkraken.settings["finaldir"... | from __future__ import print_function
from datetime import datetime
import unittest
from mock import patch
import netkraken
from testhelper import myAssertDictEqual
class NetKrakenTests(unittest.TestCase):
def test_get_timestamp(self):
self.assertEquals(("minute", "2042-12-12T12:12"),
... | apache-2.0 | Python |
00c1cf47fd012b1cbd965a43347615184e404dbe | Fix error in data/geo/airports/download.py (#719) | mbudiu-vmw/hiero,mbudiu-vmw/hiero,mbudiu-vmw/hiero,mbudiu-vmw/hiero,mbudiu-vmw/hiero | data/geo/airports/download.py | data/geo/airports/download.py | #!/usr/bin/env python3
# Copyright (c) 2020 VMware Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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.ap... | #!/usr/bin/env python3
# Copyright (c) 2020 VMware Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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.ap... | apache-2.0 | Python |
0826548cdc2c75db0ddda128124ec443a1a1b29f | set invalid positions to -1 | nathbo/GO_DILab,nathbo/GO_DILab | src/learn/dev_yu/MovePredictionBot.py | src/learn/dev_yu/MovePredictionBot.py | import os
from os.path import dirname, abspath
import numpy as np
import math
from src import Utils
from src.play.model.Board import EMPTY, BLACK, WHITE
from src.play.model.Move import Move
BLACK_VAL = -1.35
WHITE_VAL = 1.25
EMPTY_VAL = 0.25
class MovePredictionBot:
def __init__(self):
project_dir = dir... | import os
from os.path import dirname, abspath
import numpy as np
import math
from src import Utils
from src.play.model.Board import EMPTY, BLACK, WHITE
from src.play.model.Move import Move
BLACK_VAL = -1.35
WHITE_VAL = 1.25
EMPTY_VAL = 0.25
class MovePredictionBot:
def __init__(self):
project_dir = dir... | mit | Python |
7cbcee5dd6488316789fbad6f8d93fc929d560b7 | Update users/admin.py | moodpulse/l2,moodpulse/l2,moodpulse/l2,moodpulse/l2,moodpulse/l2 | users/admin.py | users/admin.py | from django.contrib import admin
from .models import DoctorProfile, AssignmentTemplates, AssignmentResearches, Speciality, Position, AvailableResearchByGroup, DistrictResearchLimitAssign, GroupHideMainMenuButtons
class DocAdmin(admin.ModelAdmin):
list_filter = (
'podrazdeleniye',
'specialities',
... | from django.contrib import admin
from .models import DoctorProfile, AssignmentTemplates, AssignmentResearches, Speciality, Position, AvailableResearchByGroup, DistrictResearchLimitAssign, GroupHideMainMenuButtons
class DocAdmin(admin.ModelAdmin):
list_filter = (
'podrazdeleniye',
'specialities',
... | mit | Python |
06384c5e55498945d5d18cb72ae56fbd63413cd5 | Add GCI programs to program map | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/modules/gci/callback.py | app/soc/modules/gci/callback.py | # Copyright 2009 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 applicable law or agreed to in writ... | # Copyright 2009 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 applicable law or agreed to in writ... | apache-2.0 | Python |
7d114d01a7721f93e8b8adbe9a61ac379dd0f393 | Move variables outside for loop | open-synergy/social,open-synergy/social,acsone/social,acsone/social,open-synergy/social,acsone/social | mail_template_multi_report/models/email_template.py | mail_template_multi_report/models/email_template.py | # -*- coding: utf-8 -*-
# © 2016 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import base64
from openerp import api, fields, models
from openerp.tools.safe_eval import safe_eval
class EmailTemplate(models.Model):
_inherit = 'email.template'
report_line_ids = fields.On... | # -*- coding: utf-8 -*-
# © 2016 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import base64
from openerp import api, fields, models
from openerp.tools.safe_eval import safe_eval
class EmailTemplate(models.Model):
_inherit = 'email.template'
report_line_ids = fields.On... | agpl-3.0 | Python |
e87ee0f670731a203d34e53d5befa30b374d06b9 | Remove whitespace | Gjum/SpockBot,luken/SpockBot,SpockBotMC/SpockBot,gamingrobot/SpockBot,nickelpro/SpockBot | spock/plugins/helpers/start.py | spock/plugins/helpers/start.py | """
This plugin creates a convenient start() method and attaches it directly
to the client. More complex bots will likely want to create their own
initialization plugin, so StartPlugin stays out of the way unless you
call the start() method. However, the start() method is very convenient
for demos and tutorials, and il... | """
This plugin creates a convenient start() method and attaches it directly
to the client. More complex bots will likely want to create their own
initialization plugin, so StartPlugin stays out of the way unless you
call the start() method. However, the start() method is very convenient
for demos and tutorials, and il... | mit | Python |
528edba420089249bd58c0621e06225db84e223f | Add missing translation on logging contrib app | jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps | opps/contrib/logging/models.py | opps/contrib/logging/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from opps.core.models import NotUserPublishable
class Logging(NotUserPublishable):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from opps.core.models import NotUserPublishable
class Logging(NotUserPublishable):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
... | mit | Python |
229fbef2849965bd75005e418a491971feb803ca | support default loc scale for logpdf too | pyro-ppl/numpyro | numpyro/distributions/distribution.py | numpyro/distributions/distribution.py | import scipy.stats as sp
from jax import lax
from jax.numpy.lax_numpy import _promote_args
import jax.numpy as np
from numpy.random import mtrand
class jax_continuous(sp.rv_continuous):
def rvs(self, *args, **kwargs):
rng = kwargs.pop('random_state')
if rng is None:
rng = self.random_s... | import scipy.stats as sp
from jax import lax
from jax.numpy.lax_numpy import _promote_args
import jax.numpy as np
from numpy.random import mtrand
class jax_continuous(sp.rv_continuous):
def rvs(self, *args, **kwargs):
rng = kwargs.pop('random_state')
if rng is None:
rng = self.random_s... | apache-2.0 | Python |
411decbdb193b28bb3060e02e81bfa29483e85a9 | Remove debug code from staticgen views. | mishbahr/staticgen-demo,mishbahr/staticgen-demo,mishbahr/staticgen-demo | staticgen_demo/blog/staticgen_views.py | staticgen_demo/blog/staticgen_views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from staticgen.staticgen_pool import staticgen_pool
from staticgen.staticgen_views import StaticgenView
from .models import Post
class BlogPostListView(StaticgenView):
is_paginated = True
i18n = True
def items(self):
return ('blog... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from staticgen.staticgen_pool import staticgen_pool
from staticgen.staticgen_views import StaticgenView
from .models import Post
class BlogPostListView(StaticgenView):
is_paginated = True
i18n = True
def items(self):
return ('blog... | bsd-3-clause | Python |
2ba5b77b31cec9ccbaca262ce44df9ba175f4485 | Refactor ElectronicAttenuator to use @property | DavidLutton/EngineeringProject | engineering_project/Instrument/ElectronicAttenuator.py | engineering_project/Instrument/ElectronicAttenuator.py | #!/usr/bin/env python3
import time
import logging
# from scipy.interpolate import UnivariateSpline
# import numpy as np
from Instrument.GenericInstrument import GenericInstrument as GenericInstrument
class ElectronicAttenuator(GenericInstrument):
def __init__(self, instrument):
super().__init__(instrumen... | #!/usr/bin/env python3
import time
import logging
# from scipy.interpolate import UnivariateSpline
# import numpy as np
from Instrument.GenericInstrument import GenericInstrument as GenericInstrument
class ElectronicAttenuator(GenericInstrument):
def __init__(self, instrument):
super().__init__(instrumen... | mit | Python |
45df0a7370456b285f7116cc3d1bc05d683f31d1 | Update ElectronicAttenuator.MarconiInstruments2187 with preset value | DavidLutton/EngineeringProject | engineering_project/Instrument/ElectronicAttenuator.py | engineering_project/Instrument/ElectronicAttenuator.py | #!/usr/bin/env python3
"""."""
# import time
# import logging
# from scipy.interpolate import UnivariateSpline
# import numpy as np
try:
from Instrument.GenericInstrument import GenericInstrument
from Instrument.IEEE488 import IEEE488
from Instrument.SCPI import SCPI
except ImportError:
from GenericIns... | #!/usr/bin/env python3
"""."""
# import time
# import logging
# from scipy.interpolate import UnivariateSpline
# import numpy as np
try:
from Instrument.GenericInstrument import GenericInstrument
from Instrument.IEEE488 import IEEE488
from Instrument.SCPI import SCPI
except ImportError:
from GenericIns... | mit | Python |
15be37bfad04ff6ed3514c24e323059b04ccc92e | Add shallow copy comment | bowen0701/algorithms_data_structures | lc0040_combination_sum_ii.py | lc0040_combination_sum_ii.py | """Leetcode 40. Combination Sum II
Medium
URL: https://leetcode.com/problems/combination-sum-ii/
Given a collection of candidate numbers (candidates) and a target number (target),
find all unique combinations in candidates where the candidate numbers sums to target.
Each number in candidates may only be used once in... | """Leetcode 40. Combination Sum II
Medium
URL: https://leetcode.com/problems/combination-sum-ii/
Given a collection of candidate numbers (candidates) and a target number (target),
find all unique combinations in candidates where the candidate numbers sums to target.
Each number in candidates may only be used once in... | bsd-2-clause | Python |
2553f9863a6539e320cb4bbc87cff4e8aef8d9dc | Complete DFS recur udpate sol | bowen0701/algorithms_data_structures | lc0695_max_area_of_island.py | lc0695_max_area_of_island.py | """Leetcode 695. Max Area of Island
Medium
URL: https://leetcode.com/problems/max-area-of-island/
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's
(representing land) connected 4-directionally (horizontal or vertical.)
You may assume all four edges of the grid are surrounded by water.
Find... | """Leetcode 695. Max Area of Island
Medium
URL: https://leetcode.com/problems/max-area-of-island/
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's
(representing land) connected 4-directionally (horizontal or vertical.)
You may assume all four edges of the grid are surrounded by water.
Find... | bsd-2-clause | Python |
16766d1fae67d1a949e6fb27c3147a882d964957 | Revise docstring and main() | bowen0701/algorithms_data_structures | lc206_reverse_linked_list.py | lc206_reverse_linked_list.py | """206. Reverse Linked List
Easy
Reverse a singly linked list.
Example:
Input: 1->2->3->4->5->NULL
Output: 5->4->3->2->1->NULL
Follow up:
A linked list can be reversed either iteratively or recursively.
Could you implement both?
"""
# Definition for singly-linked list.
class ListNode(object):
def __init__(self... | """206. Reverse Linked List
Easy
Reverse a singly linked list.
Example:
Input: 1->2->3->4->5->NULL
Output: 5->4->3->2->1->NULL
Follow up:
A linked list can be reversed either iteratively or recursively. Could you implement both?
"""
# Definition for singly-linked list.
class ListNode(object):
def __init__(self,... | bsd-2-clause | Python |
83dc0283f4b31da76cf6ea1dcb102b11c6dc2a91 | Rearrange tests so that test_zero is only things that don't work with ask() | bukzor/sympy,kumarkrishna/sympy,yukoba/sympy,Vishluck/sympy,souravsingh/sympy,madan96/sympy,shikil/sympy,wanglongqi/sympy,Davidjohnwilson/sympy,oliverlee/sympy,VaibhavAgarwalVA/sympy,Shaswat27/sympy,oliverlee/sympy,atsao72/sympy,Titan-C/sympy,skidzo/sympy,MechCoder/sympy,hargup/sympy,chaffra/sympy,moble/sympy,atreyv/sy... | sympy/assumptions/tests/test_newask.py | sympy/assumptions/tests/test_newask.py | from sympy.assumptions.newask import newask
from sympy import symbols, Q, assuming, Implies
from sympy.utilities.pytest import raises
x, y = symbols('x y')
def test_newask():
# No relevant facts
assert newask(Q.real(x), Q.real(x)) is True
assert newask(Q.real(x), ~Q.real(x)) is False
assert newask(Q... | from sympy.assumptions.newask import newask
from sympy import symbols, Q, assuming, Implies
from sympy.utilities.pytest import raises
x, y = symbols('x y')
def test_newask():
# No relevant facts
assert newask(Q.real(x), Q.real(x)) is True
assert newask(Q.real(x), ~Q.real(x)) is False
assert newask(Q... | bsd-3-clause | Python |
e2a3a54228822c92aed07e2c8c0c49baaf1a509f | fix test modes | gdsfactory/gdsfactory,gdsfactory/gdsfactory | gdsfactory/simulation/gtidy3d/tests/test_modes.py | gdsfactory/simulation/gtidy3d/tests/test_modes.py | import numpy as np
import gdsfactory.simulation.gtidy3d as gt
from gdsfactory.simulation.gtidy3d.modes import Waveguide, group_index, si, sio2
nm = 1e-3
def test_neff_cached():
c = Waveguide(
wavelength=1.55,
wg_width=0.5,
wg_thickness=0.22,
slab_thickness=0.0,
ncore=si,
... | import numpy as np
import gdsfactory.simulation.gtidy3d as gt
from gdsfactory.simulation.gtidy3d.modes import Waveguide, group_index, si, sio2
nm = 1e-3
def test_neff_cached():
c = Waveguide(
wavelength=1.55,
wg_width=0.5,
wg_thickness=0.22,
slab_thickness=0.0,
ncore=si,
... | mit | Python |
1882edc39ad1b98e432445233cc90e91284522ee | Rename spider class name to more specific | fpagnoux/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,Rumel/berniemetrics,fpagnoux/berniemetrics,Rumel/berniemetrics,fpagnoux/berniemetrics,dpxxdp/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,fpagnoux/berniemetrics,dpxxdp/berniemetrics | private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py | private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url):
self.url = url
def start_requests(self):
return [scrapy.FormRequest(self.url,
callback=s... | import scrapy
from realclearpolitics.items import TableItem
class spider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url):
self.url = url
def start_requests(self):
return [scrapy.FormRequest(self.url,
callback=self... | mit | Python |
757d17d4bd4b5803febd2f70e3edc8949dcc77a8 | Add the version number | yuzie007/ph_unfolder,yuzie007/upho | ph_unfolder/phonon/__init__.py | ph_unfolder/phonon/__init__.py | __version__ = '0.2.0'
| mit | Python | |
030af1a74ebf95ca6f255c1830cabcb75c2e32dc | Use create_or_resolve_commit in pipelines | valohai/valohai-cli | valohai_cli/commands/pipeline/run/run.py | valohai_cli/commands/pipeline/run/run.py | import contextlib
from typing import Optional
import click
from click import Context
from valohai_yaml.objs import Config, Pipeline
from valohai_cli.api import request
from valohai_cli.commands.pipeline.run.utils import build_edges, build_nodes, match_pipeline
from valohai_cli.ctx import get_project
from valohai_cli.... | import contextlib
from typing import Optional
import click
from click import Context
from valohai_yaml.objs import Config, Pipeline
from valohai_cli.api import request
from valohai_cli.commands.pipeline.run.utils import build_edges, build_nodes, match_pipeline
from valohai_cli.ctx import get_project
from valohai_cli.... | mit | Python |
673d6cecfaeb0e919f30997f793ee2bb18e399ee | Fix V2 hypervisor server schema attribute | jaspreetw/tempest,openstack/tempest,Vaidyanath/tempest,vedujoshi/tempest,NexusIS/tempest,FujitsuEnablingSoftwareTechnologyGmbH/tempest,tonyli71/tempest,hayderimran7/tempest,xbezdick/tempest,akash1808/tempest,roopali8/tempest,tudorvio/tempest,alinbalutoiu/tempest,flyingfish007/tempest,manasi24/jiocloud-tempest-qatempest... | tempest/api_schema/response/compute/v2/hypervisors.py | tempest/api_schema/response/compute/v2/hypervisors.py | # Copyright 2014 NEC Corporation. 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 ... | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 | Python |
db31d216d1cff540be8382617445a95c1113f69b | fix unicode literal in v4.test_convert | ipython/ipython,ipython/ipython | IPython/nbformat/v4/tests/test_convert.py | IPython/nbformat/v4/tests/test_convert.py | # -*- coding: utf-8 -*-
import copy
import nose.tools as nt
from IPython.nbformat import validate
from .. import convert
from . import nbexamples
from IPython.nbformat.v3.tests import nbexamples as v3examples
from IPython.nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.deepcopy(v3examples.nb0)
... | # -*- coding: utf-8 -*-
import copy
import nose.tools as nt
from IPython.nbformat import validate
from .. import convert
from . import nbexamples
from IPython.nbformat.v3.tests import nbexamples as v3examples
from IPython.nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.deepcopy(v3examples.nb0)
... | bsd-3-clause | Python |
19fae1fc2703aa24f9d26ad1426e1ac3c1acd232 | Add alternative solution for 'Keyboard Row' problem | kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode | Python/keyboard-row.py | Python/keyboard-row.py | # Time: O(n)
# Space: O(1)
# Given a List of words, return the words that can be typed
# using letters of alphabet on only one row's of American keyboard like the image below.
#
# Example 1:
# Input: ["Hello", "Alaska", "Dad", "Peace"]
# Output: ["Alaska", "Dad"]
# Note:
# You may use one character in the keyboard mo... | # Time: O(n)
# Space: O(1)
# Given a List of words, return the words that can be typed
# using letters of alphabet on only one row's of American keyboard like the image below.
#
# Example 1:
# Input: ["Hello", "Alaska", "Dad", "Peace"]
# Output: ["Alaska", "Dad"]
# Note:
# You may use one character in the keyboard mo... | mit | Python |
10abb657bf3ff008785820ffd16d26a27c16dd5e | Increase code readability | kirnap/algorithms-in-python | count_number_of_inversions.py | count_number_of_inversions.py | """
This is for an educational purposes
This is a good practice for intermediate python learners.
The definition of the problem: Suppose you are given a list of n elements with an arbitrary order and
you are asked to find the number of inversions in a given list by using Divide & Conquer Paradigm in computer science
H... | """
This is for an educational purposes
This is a good practice for intermediate python learners.
The definition of the problem: Suppose you are given a list of n elements with an arbitrary order and
you are asked to find the number of inversions in a given list by using Divide & Conquer Paradigm in computer science
H... | mit | Python |
69c6759625c8faacd2ce5194c9845349c61dda7f | Use os_helper to fix ImportError in Python 3.10 | python/importlib_metadata | tests/py39compat.py | tests/py39compat.py | try:
from test.support.os_helper import FS_NONASCII
except ImportError:
from test.support import FS_NONASCII # noqa
| try:
from test.support.os_helpers import FS_NONASCII
except ImportError:
from test.support import FS_NONASCII # noqa
| apache-2.0 | Python |
68f4d0351cb02260f942ab9f4cda0d81e43bb6a6 | Resolve PR comments | zyantific/zydis,zyantific/zydis | tests/regression.py | tests/regression.py | import os
import sys
import shlex
from subprocess import Popen, PIPE
import argparse
TEST_CASE_DIRECTORY = "./cases"
def get_exitcode_stdout_stderr(cmd):
"""
Executes an external command and returns the exitcode, stdout and stderr.
"""
args = shlex.split(cmd)
proc = Popen(args, stdout=PIPE, stder... | import os
import sys
import shlex
from subprocess import Popen, PIPE
import argparse
TEST_CASE_DIRECTORY = "./cases"
def get_exitcode_stdout_stderr(cmd):
"""
Executes an external command and returns the exitcode, stdout and stderr.
"""
args = shlex.split(cmd)
proc = Popen(args, stdout=PIPE, stder... | mit | Python |
4be78b535424f53c1fa313d2a5d483e729b0497b | test data cleanup | alexandrul-ci/robotframework,stasiek/robotframework,alexandrul-ci/robotframework,un33k/robotframework,suvarnaraju/robotframework,dkentw/robotframework,Colorfulstan/robotframework,moto-timo/robotframework,Colorfulstan/robotframework,moto-timo/robotframework,snyderr/robotframework,kyle1986/robortframe,yonglehou/robotfram... | tools/remoteserver/test/atest/arguments.py | tools/remoteserver/test/atest/arguments.py | class MyObject:
def __init__(self, index=0):
self.index = index
def __str__(self):
return '<MyObject%s>' % (self.index or '')
UNICODE = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
LIST_WITH_OBJECTS = [MyObject(1), MyObject(2)]
NESTED_LIST =... | # Can be used in the test data like ${MyObject()} or ${MyObject(1)}
class MyObject:
def __init__(self, index=''):
self.index = index
def __str__(self):
return '<MyObject%s>' % self.index
UNICODE = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
LI... | apache-2.0 | Python |
9d3d6c0b058e7c9e1c386c3726305596f086e594 | Improve command string of convert_to_json (#3477) | facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI | parlai/scripts/convert_data_to_json_format.py | parlai/scripts/convert_data_to_json_format.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Converts data used in a task to json format. (Same as "Conversation" class; ie, for use
in ACUTE-eval)
Specify the t... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Converts data used in a task to json format. (Same as "Conversation" class; ie, for use
in ACUTE-eval)
Specify the t... | mit | Python |
f5d9a361ed4eb6862956604334c636191c7b2241 | Fix future only jobs for api. | cshields/satnogs-network,cshields/satnogs-network,cshields/satnogs-network,cshields/satnogs-network | network/api/views.py | network/api/views.py | from django.utils.timezone import now
import django_filters
from rest_framework import viewsets, mixins
from network.api.perms import StationOwnerCanEditPermission
from network.api import serializers
from network.base.models import (Antenna, Data, Observation, Satellite,
Station, Tran... | import django_filters
from rest_framework import viewsets, mixins
from network.api.perms import StationOwnerCanEditPermission
from network.api import serializers
from network.base.models import (Antenna, Data, Observation, Satellite,
Station, Transponder)
class AntennaView(viewsets.M... | agpl-3.0 | Python |
af3e10c1f717eefca0227736404dbe240687e6e8 | use an absolute scale | xiph/rav1e,xiph/rav1e | tools/draw-importances.py | tools/draw-importances.py | #!/usr/bin/env python3
import struct
import sys
from os.path import splitext
import numpy as np
from PIL import Image, ImageDraw
from matplotlib import pyplot as plt
# Renders block importances output by ContextInner::compute_lookahead_data().
# Usage:
# cargo run --features=dump_lookahead_data <input.y4m> -o ... | #!/usr/bin/env python3
import struct
import sys
from os.path import splitext
import numpy as np
from PIL import Image, ImageDraw
from matplotlib import pyplot as plt
# Renders block importances output by ContextInner::compute_lookahead_data().
# Usage:
# cargo run --features=dump_lookahead_data <input.y4m> -o ... | bsd-2-clause | Python |
25cf3528b96fb93c6622b8b9c31d4de8cddd5fa8 | comment explaining why we are sending a date | ecohealthalliance/EpiTator | annotator/jvm_nlp_annotator.py | annotator/jvm_nlp_annotator.py | #!/usr/bin/env python
"""Annotator to add NLP annotations from REST calls to a webservice"""
import requests
from annotator import *
class JVMNLPAnnotator():
default_base_url = 'http://localhost:8080'
annotate_path = '/annotate/getNLPAnnotations'
def __init__(self, tiers, base_url=None):
"""Sp... | #!/usr/bin/env python
"""Annotator to add NLP annotations from REST calls to a webservice"""
import requests
from annotator import *
class JVMNLPAnnotator():
default_base_url = 'http://localhost:8080'
annotate_path = '/annotate/getNLPAnnotations'
def __init__(self, tiers, base_url=None):
"""Sp... | apache-2.0 | Python |
c33c5795ccaf8d4dbc1470cd3c32d9fdddd980bb | Correct unit tests for Actor-related exceptions | hypatia-software-org/hypatia-engine,lillian-lemmer/hypatia,hypatia-software-org/hypatia-engine,lillian-lemmer/hypatia | tests/test_actor.py | tests/test_actor.py | # This module is part of Hypatia and is released under the
# MIT license: http://opensource.org/licenses/MIT
"""py.test unit testing for hypatia/actor.py
Run py.test on this module to assert hypatia.actor
is completely functional.
"""
import os
import pygame
import pytest
from hypatia import actor
from hypatia im... | # This module is part of Hypatia and is released under the
# MIT license: http://opensource.org/licenses/MIT
"""py.test unit testing for hypatia/actor.py
Run py.test on this module to assert hypatia.actor
is completely functional.
"""
import os
import pygame
import pytest
from hypatia import actor
from hypatia im... | mit | Python |
fee0e9484d7824d767fa31b8c3358a1af88d2c2d | Fix test_check | shkurak/hangman | tests/test_check.py | tests/test_check.py | from hangman import check
def test_check():
assert check('hello', set(['h', 'e', 'l', 'o']))
| from hangman import check
def test_check():
assert check('hello', set('h', 'e', 'l', 'o'))
| mit | Python |
f35a015657bdcf3a149b31026eebe454004fd7ef | Add more tests | sigmavirus24/curryer | tests/test_curry.py | tests/test_curry.py | import pytest
from currypy import curry
class TestCurry:
def test_curry_as_decorator(self):
"""Ensure that currypy.curry can be used as a decorator"""
@curry
def func():
pass
assert func.curried is False
def test_curry_refuses_None(self):
"""Ensure that c... | import pytest
from currypy import curry
class TestCurry:
def test_curry_as_decorator(self):
"""Ensure that currypy.curry can be used as a decorator"""
@curry
def func():
pass
assert func.curried is False
def test_curry_refuses_None(self):
with pytest.rais... | bsd-3-clause | Python |
80b4bae5903d4c3ba8c440d4067f6bd443f261f4 | Improve watermark functionality (3) | jiss-software/jiss-rendering-service,jiss-software/jiss-rendering-service | handler/Watermark.py | handler/Watermark.py | import core
import tornado
import uuid
import time
from utils import open_remote_image, add_watermark, open_image
class WatermarkHandler(core.BaseHandler):
@tornado.web.asynchronous
@tornado.gen.coroutine
def get(self):
self.logger.info('Request watermark generation for remote file')
name... | import core
import tornado
import uuid
import time
import urllib
from utils import open_remote_image, add_watermark, open_image
class WatermarkHandler(core.BaseHandler):
@tornado.web.asynchronous
@tornado.gen.coroutine
def get(self):
self.logger.info('Request watermark generation for remote file')... | apache-2.0 | Python |
15ef4b48962d64f9999f8efbdae394e2e7e0b6b5 | Fix migration | crowdresearch/daemo,crowdresearch/crowdsource-platform,aginzberg/crowdsource-platform,aginzberg/crowdsource-platform,shirishgoyal/crowdsource-platform,shirishgoyal/crowdsource-platform,crowdresearch/crowdsource-platform,crowdresearch/crowdsource-platform,shirishgoyal/crowdsource-platform,crowdresearch/daemo,crowdresear... | crowdsourcing/migrations/0012_auto_20160107_0521.py | crowdsourcing/migrations/0012_auto_20160107_0521.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-07 05:21
from __future__ import unicode_literals
from django.db import migrations
def create_system_financial_account(apps, schema_editor):
# We can't import the FinancialAccount model directly as it may be a newer
# version than this migration exp... | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-07 05:21
from __future__ import unicode_literals
from django.db import migrations
def create_system_financial_account(apps):
# We can't import the FinancialAccount model directly as it may be a newer
# version than this migration expects. We use th... | mit | Python |
711a58c888a9695c37b924a575fcf156ec9864bd | Correct error message | gogoair/foremast,gogoair/foremast | src/foremast/securitygroup/create_securitygroup.py | src/foremast/securitygroup/create_securitygroup.py | """Create Security Groups for Spinnaker Pipelines."""
import logging
import os
import requests
from ..consts import API_URL, HEADERS
from ..exceptions import (SpinnakerSecurityGroupCreationFailed,
SpinnakerTaskError)
from ..utils import check_task, get_template, get_vpc_id
class SpinnakerS... | """Create Security Groups for Spinnaker Pipelines."""
import logging
import os
import requests
from ..consts import API_URL, HEADERS
from ..exceptions import (SpinnakerSecurityGroupCreationFailed,
SpinnakerTaskError)
from ..utils import check_task, get_template, get_vpc_id
class SpinnakerS... | apache-2.0 | Python |
c58a4829918f275941e96fed880f65da7f0474a5 | Create database_mappings directory | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | luigi/tasks/export/ftp/id_mapping/database_mappings.py | luigi/tasks/export/ftp/id_mapping/database_mappings.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | apache-2.0 | Python |
7acb1962b6119a9895e8847b128e6694632ae15c | test char and string parameter methods | SCIP-Interfaces/PySCIPOpt,SCIP-Interfaces/PySCIPOpt | tests/test_model.py | tests/test_model.py | from pyscipopt import Model
def test_model():
# create solver instance
s = Model()
# test parameter methods
pric = s.getParam('lp/pricing')
s.setParam('lp/pricing', 'q')
assert 'q' == s.getParam('lp/pricing')
s.setParam('lp/pricing', pric)
s.setParam('visual/vbcfilename', 'vbcfile')
... | from pyscipopt import Model
def test_model():
# create solver instance
s = Model()
# add some variables
x = s.addVar("x", vtype = 'C', obj = 1.0)
y = s.addVar("y", vtype = 'C', obj = 2.0)
assert x.getObj() == 1.0
assert y.getObj() == 2.0
s.setObjective(4.0 * y + 10.5, clear = False)
... | mit | Python |
1f560a21e0b901f9f0c786f864111a0e92951f5d | fix test | tfmorris/dedupe,01-/dedupe,nmiranda/dedupe,neozhangthe1/dedupe,dedupeio/dedupe,datamade/dedupe,pombredanne/dedupe,nmiranda/dedupe,tfmorris/dedupe,01-/dedupe,dedupeio/dedupe,datamade/dedupe,davidkunio/dedupe,pombredanne/dedupe,davidkunio/dedupe,neozhangthe1/dedupe | tests/test_price.py | tests/test_price.py | import unittest
import dedupe
from dedupe.variables.price import PriceType
class TestPrice(unittest.TestCase):
def test_comparator(self) :
assert PriceType.comparator(1, 10) == 1
assert PriceType.comparator(10, 1) == 1
| import unittest
import dedupe
from dedupe.variables.fieldclasses import PriceType
class TestPrice(unittest.TestCase):
def test_comparator(self) :
assert PriceType.comparator(1, 10) == 1
assert PriceType.comparator(10, 1) == 1
| mit | Python |
9ade5ad4da22d8bb200edaf7b4137522c19525f0 | Set module category | OCA/carrier-delivery | delivery_carrier_label_postlogistics/__openerp__.py | delivery_carrier_label_postlogistics/__openerp__.py | # -*- coding: utf-8 -*-
# © 2013-2016 Yannick Vaucher (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{'name': 'PostLogistics Labels WebService',
'version': '9.0.1.1.0',
'author': "Camptocamp,Odoo Community Association (OCA)",
'maintainer': 'Camptocamp',
'license': 'AGPL-3',
'c... | # -*- coding: utf-8 -*-
# © 2013-2016 Yannick Vaucher (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{'name': 'PostLogistics Labels WebService',
'version': '9.0.1.1.0',
'author': "Camptocamp,Odoo Community Association (OCA)",
'maintainer': 'Camptocamp',
'license': 'AGPL-3',
'c... | agpl-3.0 | Python |
bf4d51ea0b00e091728ecf8d4d51aa295448a416 | fix error exit when doing spack patch without parameters, same as spack stage | krafczyk/spack,lgarren/spack,LLNL/spack,krafczyk/spack,skosukhin/spack,EmreAtes/spack,EmreAtes/spack,tmerrick1/spack,tmerrick1/spack,mfherbst/spack,tmerrick1/spack,LLNL/spack,LLNL/spack,krafczyk/spack,TheTimmy/spack,TheTimmy/spack,lgarren/spack,mfherbst/spack,iulian787/spack,tmerrick1/spack,skosukhin/spack,iulian787/sp... | lib/spack/spack/cmd/patch.py | lib/spack/spack/cmd/patch.py | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | lgpl-2.1 | Python |
677c2859c75fbafe4ee5e1fb2b90d7e8da881120 | Update csrf test to be compatible with Django 1.8 | LabD/django-postcode-lookup | tests/test_views.py | tests/test_views.py | from django.middleware import csrf
from freezegun import freeze_time
from pretend import stub
from rest_framework.test import APIRequestFactory
from django_postcode_lookup import views
from django_postcode_lookup.backends.base import PostcodeLookupResult
def test_valid_api_key():
rf = APIRequestFactory(enforce_c... | from django.middleware.csrf import get_token as get_csrf_token
from freezegun import freeze_time
from pretend import stub
from rest_framework.test import APIRequestFactory
from django_postcode_lookup import views
from django_postcode_lookup.backends.base import PostcodeLookupResult
def test_valid_api_key():
rf =... | mit | Python |
8cfd48449262caa19b0795d4b6c1c537372d0782 | add forward referencing | saurabh6790/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,almeidapaulopt/frappe,saurabh6790/frappe,yashodhank/frappe,frappe/frappe,frappe/frappe,StrellaGroup/frappe,StrellaGroup/frappe,mhbu50/frappe,frappe/frappe,mhbu50/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,yashodhank/frappe,StrellaGroup/fra... | frappe/core/page/background_jobs/background_jobs.py | frappe/core/page/background_jobs/background_jobs.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from typing import TYPE_CHECKING, Dict, List
from rq import Queue, Worker
import frappe
from frappe import _
from frappe.utils import cint, convert_utc_to_user_timezone, format_datetime
from frappe.utils.background_job... | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from typing import TYPE_CHECKING, Dict, List
from rq import Queue, Worker
import frappe
from frappe import _
from frappe.utils import cint, convert_utc_to_user_timezone, format_datetime
from frappe.utils.background_job... | mit | Python |
b465ccc9b26bdf6f06cfc3f72df2cbdb01c597e4 | fix sentry logging in conjunction with celery | schacki/cookiecutter-django,luzfcb/cookiecutter-django,aeikenberry/cookiecutter-django-rest-babel,jondelmil/cookiecutter-django,stepanovsh/project_template,mjhea0/cookiecutter-django,webspired/cookiecutter-django,webspired/cookiecutter-django,drxos/cookiecutter-django-dokku,ingenioustechie/cookiecutter-django-openshift... | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py | {% if cookiecutter.use_celery == "y" %}
from __future__ import absolute_import
import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
{% if cookiecutter.use_sentry == "y" -%}
from raven import Client
from raven.contrib.celery import register_signal
{%- endif %}
if not se... | {% if cookiecutter.use_celery == "y" %}
from __future__ import absolute_import
import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETT... | bsd-3-clause | Python |
462a24e3e78d3bd6ba7346f8e14fdfa18f726378 | Switch test_misc to pytest | ericdill/databroker,ericdill/databroker | databroker/tests/test_misc.py | databroker/tests/test_misc.py | import time as ttime
import uuid
import numpy as np
import pytest
from filestore.test.utils import fs_setup, fs_teardown
from metadatastore.commands import insert_run_start
from metadatastore.test.utils import mds_setup, mds_teardown
from numpy.testing.utils import assert_array_equal
from databroker import DataBroker... | from ..utils.diagnostics import watermark
from databroker.pims_readers import Images, get_images
from databroker import DataBroker as db
from ..examples.sample_data import image_and_scalar
from metadatastore.test.utils import mds_setup, mds_teardown
from filestore.test.utils import fs_setup, fs_teardown
import numpy as... | bsd-3-clause | Python |
27b04ec5b8f425330280743f7dc064c74063497e | Fix collection test | VirusTotal/vt-graph-api,VirusTotal/vt-graph-api | tests/test_create_collection.py | tests/test_create_collection.py | """Test create collection from graph."""
import pytest
import vt_graph_api
import vt_graph_api.errors
test_graph = vt_graph_api.VTGraph(
"Dummy api key", verbose=False, private=False, name="Graph test",
user_editors=["agfernandez"], group_viewers=["virustotal"])
def test_create_collection(mocker):
m = moc... | """Test create collection from graph."""
import pytest
import vt_graph_api
import vt_graph_api.errors
test_graph = vt_graph_api.VTGraph(
"Dummy api key", verbose=False, private=False, name="Graph test",
user_editors=["agfernandez"], group_viewers=["virustotal"])
def test_create_collection(mocker):
m = moc... | apache-2.0 | Python |
de59cc4ec06d3666fc9b8e32272b723ed37501fb | Update docx_parser.py | deanmalmgren/textract,deanmalmgren/textract,deanmalmgren/textract | textract/parsers/docx_parser.py | textract/parsers/docx_parser.py | import docx
from .utils import BaseParser
class Parser(BaseParser):
"""Extract text from docx file using python-docx.
"""
def extract(self, filename, **kwargs):
text = ""
document = docx.Document(filename)
# Extract text from root paragraphs
text += '\n\n'.join([
... | import docx
from .utils import BaseParser
class Parser(BaseParser):
"""Extract text from docx file using python-docx.
"""
def extract(self, filename, **kwargs):
text = ""
document = docx.Document(filename)
# Extract text from root paragraphs
text += '\n\n'.join([
paragraph.text for paragraph in docum... | mit | Python |
6de1083784d8a73e234dd14cabd17e7ee5852949 | Add missing import to utility python script | dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/da... | tools/clean_output_directory.py | tools/clean_output_directory.py | #!/usr/bin/env python
#
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
import shutil
import sys
import subprocess
import utils
def Main():
build_roo... | #!/usr/bin/env python
#
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
import shutil
import sys
import utils
def Main():
build_root = utils.GetBuild... | bsd-3-clause | Python |
39cc0a83e47caf2ba51b679d4f082381d0a6a6d6 | Fix chunk | muddyfish/PYKE,muddyfish/PYKE | node/floor_divide.py | node/floor_divide.py | #!/usr/bin/env python
from nodes import Node
import math
class FloorDiv(Node):
char = "f"
args = 2
results = 1
@Node.test_func([3,2], [1])
@Node.test_func([6,-3], [-2])
def func(self, a:Node.number,b:Node.number):
"""a/b. Rounds down, returns an int."""
return a//b
... | #!/usr/bin/env python
from nodes import Node
class FloorDiv(Node):
char = "f"
args = 2
results = 1
@Node.test_func([3,2], [1])
@Node.test_func([6,-3], [-2])
def func(self, a:Node.number,b:Node.number):
"""a/b. Rounds down, returns an int."""
return a//b
@Node.test... | mit | Python |
e3cae2fb35199383febf9834af272118a39a16f3 | Add solution to Lessson2.08-Handling_Attributes | krzyste/ud032,krzyste/ud032 | Lesson_2_Data_in_More_Complex_Formats/08-Handling_Attributes/authors.py | Lesson_2_Data_in_More_Complex_Formats/08-Handling_Attributes/authors.py | #!/usr/bin/env python
# Your task here is to extract data from xml on authors of an article
# and add it to a list, one item for an author.
# See the provided data structure for the expected format.
# The tags for first name, surname and email should map directly
# to the dictionary keys
import xml.etree.ElementTree as... | #!/usr/bin/env python
# Your task here is to extract data from xml on authors of an article
# and add it to a list, one item for an author.
# See the provided data structure for the expected format.
# The tags for first name, surname and email should map directly
# to the dictionary keys, but you have to extract the at... | agpl-3.0 | Python |
f879f82ad0393a770ed50043c70ee1dd4a12daaa | Rewrite "test_tissue_corr_computation" as a pytest | genenetwork/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2 | wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py | wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py | """module contains tests for correlation functions"""
import unittest
from unittest import mock
from wqflask.correlation.correlation_functions import get_trait_symbol_and_tissue_values
from wqflask.correlation.correlation_functions import cal_zero_order_corr_for_tiss
def test_tissue_corr_computation(mocker):
""... | """module contains tests for correlation functions"""
import unittest
from unittest import mock
from wqflask.correlation.correlation_functions import get_trait_symbol_and_tissue_values
from wqflask.correlation.correlation_functions import cal_zero_order_corr_for_tiss
class TestCorrelationFunctions(unittest.TestCase... | agpl-3.0 | Python |
59a68102c728b94c07b742eeb44fe39788237720 | Change not to use functions starts with an underscore | wkentaro/chainer,wkentaro/chainer,jnishi/chainer,rezoo/chainer,aonotas/chainer,AlpacaDB/chainer,sinhrks/chainer,cupy/cupy,benob/chainer,kashif/chainer,sinhrks/chainer,cupy/cupy,keisuke-umezawa/chainer,cemoody/chainer,delta2323/chainer,benob/chainer,ktnyt/chainer,anaruse/chainer,chainer/chainer,chainer/chainer,chainer/c... | tests/chainer_tests/functions_tests/math_tests/test_batch_l2_norm_squared.py | tests/chainer_tests/functions_tests/math_tests/test_batch_l2_norm_squared.py | import unittest
import numpy as np
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import type_check
def _as_two_dim(x):
if x.... | import unittest
import numpy as np
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer.functions.math.batch_l2_norm_squared import _as_two_dim
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition... | mit | Python |
4b1902ee97dcb7972f800396e8954d99df446362 | Update P05_seleniumBrowser removed redundant parenthesis | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/AutomateTheBoringStuffWithPython/Chapter11/P05_seleniumBrowser.py | books/AutomateTheBoringStuffWithPython/Chapter11/P05_seleniumBrowser.py | # This program uses selenium to parse and interact with websites
#
# Note:
# - geckodriver is needed for Linux
# - download from https://github.com/mozilla/geckodriver/releases
# - place in /usr/local/bin
# - more info https://github.com/SeleniumHQ/selenium/blob/master/py/docs/source/index.rst
from selenium impo... | # This program uses selenium to parse and interact with websites
#
# Note:
# - geckodriver is needed for Linux
# - download from https://github.com/mozilla/geckodriver/releases
# - place in /usr/local/bin
# - more info https://github.com/SeleniumHQ/selenium/blob/master/py/docs/source/index.rst
from selenium impo... | mit | Python |
13c968f9f345f58775750f1f83ca7881cee2755a | Use Tracking DB Service URL rather than localhost in the DB connection string. | llevar/germline-regenotyper,llevar/germline-regenotyper | bootstrap/conf/salt/state/run-tracking-db/scripts/import_sample_data.py | bootstrap/conf/salt/state/run-tracking-db/scripts/import_sample_data.py | import pandas as pd
import sys
df = pd.read_csv(sys.argv[1])
df.columns = [c.lower() for c in df.columns]
from sqlalchemy import create_engine
engine = create_engine('postgresql://pcawg_admin:pcawg@run-tracking-db.service.consul:5432/germline_genotype_tracking')
df.to_sql("pcawg_samples", engine) | import pandas as pd
import sys
df = pd.read_csv(sys.argv[1])
df.columns = [c.lower() for c in df.columns]
from sqlalchemy import create_engine
engine = create_engine('postgresql://pcawg_admin:pcawg@localhost:5432/germline_genotype_tracking')
df.to_sql("pcawg_samples", engine) | mit | Python |
fedff2e76d8d96f1ea407f7a3a48aa8dc7a7e50a | Make x axis label samples for now, though eventually should have a date option | justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools | analysis/opensimulator-stats-analyzer/src/ostagraph.py | analysis/opensimulator-stats-analyzer/src/ostagraph.py | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from pylab import *
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to gr... | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from pylab import *
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to gr... | bsd-3-clause | Python |
bf17fdf1ee348dfe7f170f6c4477535bc9c959cc | update software parameters | cytomine/Cytomine-python-datamining,cytomine/Cytomine-python-datamining | cytomine-datamining/algorithms/sldc/examples/with_pyxit/add_software.py | cytomine-datamining/algorithms/sldc/examples/with_pyxit/add_software.py | import os
import tempfile
if __name__ == "__main__":
import cytomine
# Connect to cytomine, edit connection values
cytomine_host = "demo.cytomine.be"
cytomine_public_key = "XXX" # to complete
cytomine_private_key = "XXX" # to complete
id_project = -1 # to complete
# Connection to Cytom... | import os
import tempfile
if __name__ == "__main__":
import cytomine
# Connect to cytomine, edit connection values
cytomine_host = "demo.cytomine.be"
cytomine_public_key = "XXX" # to complete
cytomine_private_key = "XXX" # to complete
id_project = -1 # to complete
# Connection to Cytom... | apache-2.0 | Python |
114b3f3403e970943618e7096b0b898b8aa5589f | Remove verbose keywork for pip install | wheeler-microfluidics/microdrop | microdrop/core_plugins/electrode_controller_plugin/on_plugin_install.py | microdrop/core_plugins/electrode_controller_plugin/on_plugin_install.py | from datetime import datetime
import logging
from path_helpers import path
from pip_helpers import install
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
logging.info(str(datetime.now()))
requirements_file = path(__file__).parent.joinpath('requirements.txt')
if requirements_file.e... | from datetime import datetime
import logging
from path_helpers import path
from pip_helpers import install
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
logging.info(str(datetime.now()))
requirements_file = path(__file__).parent.joinpath('requirements.txt')
if requirements_file.e... | bsd-3-clause | Python |
b2664b825c5be2b0582ff755df421c5d026947b8 | Update LearnLockerConnection.py | GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU | python_module/SuperGLU/Services/LoggingService/LearnLockerConnection.py | python_module/SuperGLU/Services/LoggingService/LearnLockerConnection.py | '''
Created on May 31, 2018
This service will forward logging messages to LearnLocker as well as log them to a file.
@author: auerbach, Alicia Tsai
'''
from SuperGLU.Core.MessagingGateway import BaseService
from SuperGLU.Services.LoggingService.Constants import XAPI_LOG_VERB
import requests
import uuid
import ... | '''
Created on May 31, 2018
This service will forward logging messages to LearnLocker as well as log them to a file.
@author: auerbach
'''
from SuperGLU.Core.MessagingGateway import BaseService
from SuperGLU.Services.LoggingService.Constants import XAPI_LOG_VERB
import requests
import uuid
import json
cla... | mit | Python |
b6f94c9684e8d58f0ba79849c9303108a8ac3bbd | Mark this test as XFail while I investigate the issue | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | packages/Python/lldbsuite/test/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | packages/Python/lldbsuite/test/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | # TestSwiftPOSysTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRI... | # TestSwiftPOSysTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRI... | apache-2.0 | Python |
c5b7380e46805d8239a0309b06353fe61530e7ec | add docstring to __init__ for module | neurodata/ndio,jhuapl-boss/intern,neurodata/ndio,openconnectome/ndio,neurodata/ndio | ndio/__init__.py | ndio/__init__.py | """
A Python library for open neuroscience data access and manipulation.
"""
version = "1.0.0"
def check_version():
"""
Tells you if you have an old version of ndio.
"""
import requests
r = requests.get('https://pypi.python.org/pypi/ndio/json').json()
r = r['info']['version']
if r != vers... | version = "1.0.0"
def check_version():
"""
Tells you if you have an old version of ndio.
"""
import requests
r = requests.get('https://pypi.python.org/pypi/ndio/json').json()
r = r['info']['version']
if r != version:
print("A newer version of ndio is available. " +
"'... | apache-2.0 | Python |
eb0135828b2384f2242b3e50b244f131c59d8dda | update Mid Devon import script for parl.2017-06-08 | DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_mid_devon.py | polling_stations/apps/data_collection/management/commands/import_mid_devon.py | from data_collection.management.commands import BaseXpressDCCsvInconsistentPostcodesImporter
class Command(BaseXpressDCCsvInconsistentPostcodesImporter):
council_id = 'E07000042'
addresses_name = 'parl.2017-06-08/Version 1/Mid Devon Democracy_Club__08June2017-2.tsv'
stations_name = 'parl.2017-06-08/Version... | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E07000042'
addresses_name = 'MidDevon_Democracy_Club__04May2017.tsv'
stations_name = 'MidDevon_Democracy_Club__04May2017.tsv'
elections = [
'local.... | bsd-3-clause | Python |
d5733fe73e91d01f4203742616d8c6a54fd3b91d | add test for histogram ill-defined data | timsnyder/bokeh,schoolie/bokeh,timsnyder/bokeh,timsnyder/bokeh,DuCorey/bokeh,phobson/bokeh,jakirkham/bokeh,stonebig/bokeh,clairetang6/bokeh,schoolie/bokeh,aiguofer/bokeh,draperjames/bokeh,phobson/bokeh,aavanian/bokeh,quasiben/bokeh,mindriot101/bokeh,stonebig/bokeh,Karel-van-de-Plassche/bokeh,draperjames/bokeh,DuCorey/b... | bokeh/charts/tests/test_stats.py | bokeh/charts/tests/test_stats.py | import pytest
from bokeh.charts.stats import Bins, Histogram
from bokeh.models import ColumnDataSource
import pandas as pd
@pytest.fixture
def ds(test_data):
return ColumnDataSource(test_data.auto_data)
def test_explicit_bin_count(ds):
b = Bins(source=ds, column='mpg', bin_count=2)
assert len(b.bins) ... | import pytest
from bokeh.charts.stats import Bins, Histogram
from bokeh.models import ColumnDataSource
import pandas as pd
@pytest.fixture
def ds(test_data):
return ColumnDataSource(test_data.auto_data)
def test_explicit_bin_count(ds):
b = Bins(source=ds, column='mpg', bin_count=2)
assert len(b.bins) ... | bsd-3-clause | Python |
2eb39ef414d96697e32b168213e4269c957bcba1 | Add 2D maxpool operation | wiseodd/hipsternet,wiseodd/hipsternet | hipsternet/utils.py | hipsternet/utils.py | import numpy as np
def exp_running_avg(running, new, gamma=.9):
return gamma * running + (1. - gamma) * new
def accuracy(y_true, y_pred):
return np.mean(y_pred == y_true)
def onehot(labels):
y = np.zeros([labels.size, np.max(labels) + 1])
y[range(labels.size), labels] = 1.
return y
def conv_... | import numpy as np
def exp_running_avg(running, new, gamma=.9):
return gamma * running + (1. - gamma) * new
def accuracy(y_true, y_pred):
return np.mean(y_pred == y_true)
def onehot(labels):
y = np.zeros([labels.size, np.max(labels) + 1])
y[range(labels.size), labels] = 1.
return y
def conv_... | unlicense | Python |
5881829f3ccf5d3fe853e34302b9e38b0ba01d4a | Bump version | futurecolors/django-httplog,anmekin/django-httplog,Crystalnix/django-httplog | httplog/__init__.py | httplog/__init__.py | __version__ = '0.2.0'
| __version__ = '0.1.0' | bsd-3-clause | Python |
35417f9cadf3e4d2f49ea90e28b9a9f62104c23b | Remove commented alternative method for database type detection. | pansapiens/mytardis,pansapiens/mytardis,pansapiens/mytardis,pansapiens/mytardis | tardis/tardis_portal/migrations/0008_string_value_partial_index_postgres.py | tardis/tardis_portal/migrations/0008_string_value_partial_index_postgres.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations, connection
from tardis.tardis_portal.models import ExperimentParameter, DatasetParameter, \
DatafileParameter, InstrumentParameter
def _generate_index_migrations():
max_length = 256
if hasattr(connec... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations, connection
from tardis.tardis_portal.models import ExperimentParameter, DatasetParameter, \
DatafileParameter, InstrumentParameter
from tardis import settings
def _generate_index_migrations():
max_length ... | bsd-3-clause | Python |
88db4f0b363adfd12c8adaa912b30d3fc316d75c | remove test directory export | peastman/deepchem,lilleswing/deepchem,peastman/deepchem,miaecle/deepchem,deepchem/deepchem,lilleswing/deepchem,lilleswing/deepchem,miaecle/deepchem,miaecle/deepchem,deepchem/deepchem | deepchem/data/__init__.py | deepchem/data/__init__.py | """
Gathers all datasets in one place for convenient imports
"""
# TODO(rbharath): Get rid of * import
from deepchem.data.datasets import pad_features
from deepchem.data.datasets import pad_batch
from deepchem.data.datasets import Dataset
from deepchem.data.datasets import NumpyDataset
from deepchem.data.datasets impor... | """
Gathers all datasets in one place for convenient imports
"""
# TODO(rbharath): Get rid of * import
from deepchem.data.datasets import pad_features
from deepchem.data.datasets import pad_batch
from deepchem.data.datasets import Dataset
from deepchem.data.datasets import NumpyDataset
from deepchem.data.datasets impor... | mit | Python |
a35c2c4e3d332c8ee581608317c4496722fb9b77 | Update wording on path of the image. | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/advertising/models.py | us_ignite/advertising/models.py | from django.db import models
from django_extensions.db.fields import (
AutoSlugField, CreationDateTimeField, ModificationDateTimeField)
from us_ignite.advertising import managers
class Advert(models.Model):
PUBLISHED = 1
DRAFT = 2
REMOVED = 3
STATUS_CHOICES = (
(PUBLISHED, 'Published'),
... | from django.db import models
from django_extensions.db.fields import (
AutoSlugField, CreationDateTimeField, ModificationDateTimeField)
from us_ignite.advertising import managers
class Advert(models.Model):
PUBLISHED = 1
DRAFT = 2
REMOVED = 3
STATUS_CHOICES = (
(PUBLISHED, 'Published'),
... | bsd-3-clause | Python |
983da7ed60aab7debce772f6e1181f29f1e321ac | fix anonymous user exclusion | Fresnoy/kart,Fresnoy/kart | people/api.py | people/api.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from tastypie import fields
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from common.api import WebsiteResource
from .models import Artist, Staff, Organization
# django-guardian anonymous user... | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from tastypie import fields
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from common.api import WebsiteResource
from .models import Artist, Staff, Organization
class UserResource(ModelResource):
class Meta:
querys... | agpl-3.0 | Python |
343dffe048bdbc52ec4c42838bc45cf984bb72cc | Update arlo-snapshot.py | jeffreydwalter/arlo | examples/arlo-snapshot.py | examples/arlo-snapshot.py | from Arlo import Arlo
USERNAME = 'user@example.com'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At... | from Arlo import Arlo
USERNAME = 'user@example.com'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At... | apache-2.0 | Python |
bd7346626568b57878298ff7b26f205afc8a9eec | rename options to config | spaam/svtplay-dl,olof/svtplay-dl,spaam/svtplay-dl,olof/svtplay-dl | lib/svtplay_dl/fetcher/http.py | lib/svtplay_dl/fetcher/http.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
from svtplay_dl.utils.output import ETA, progressbar, output
from svtplay_dl.fetcher import VideoRetriever
class HTTP(VideoRetriever):
@property
def name(self):
return "http... | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
from svtplay_dl.utils.output import ETA, progressbar, output
from svtplay_dl.fetcher import VideoRetriever
class HTTP(VideoRetriever):
@property
def name(self):
return "http... | mit | Python |
872899bdc52dfb2b55132a2db847603e31bf53ea | bump version | markope/AutobahnPython,iffy/AutobahnPython,jvdm/AutobahnPython,inirudebwoy/AutobahnPython,dash-dash/AutobahnPython,nucular/AutobahnPython,oberstet/autobahn-python,schoonc/AutobahnPython,crossbario/autobahn-python,crossbario/autobahn-python,bencharb/AutobahnPython,tomwire/AutobahnPython,iffy/AutobahnPython,tavendo/Autob... | autobahn/autobahn/__init__.py | autobahn/autobahn/__init__.py | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## 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
##
#... | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## 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
##
#... | mit | Python |
3cb14b8bdaf020cc417312516d6bfaf126152823 | Use 1804-style deprovisioning for all versions >= 18.04 (#1483) | rjschwei/WALinuxAgent,rjschwei/WALinuxAgent,Azure/WALinuxAgent,Azure/WALinuxAgent | azurelinuxagent/pa/deprovision/factory.py | azurelinuxagent/pa/deprovision/factory.py | # Copyright 2018 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
#
# Unless required by applicable law or agreed to in... | # Copyright 2018 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
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
1bd7410cc21c6aa9c2ad8fa11fa98d1ad3015f10 | send hls url to hlsparse | dalgr/svtplay-dl,iwconfig/svtplay-dl,olof/svtplay-dl,spaam/svtplay-dl,selepo/svtplay-dl,leakim/svtplay-dl,spaam/svtplay-dl,dalgr/svtplay-dl,iwconfig/svtplay-dl,qnorsten/svtplay-dl,selepo/svtplay-dl,olof/svtplay-dl,leakim/svtplay-dl,leakim/svtplay-dl,qnorsten/svtplay-dl | lib/svtplay_dl/service/dbtv.py | lib/svtplay_dl/service/dbtv.py | from __future__ import absolute_import
import re
import json
import copy
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.utils.urllib import urlparse
from svtplay_dl.fetcher.http import HTTP
from svtplay_dl.fetcher.hls import HLS, hlsparse
from svtplay_dl.log import log
class Dbtv(Service,... | from __future__ import absolute_import
import re
import json
import copy
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.utils.urllib import urlparse
from svtplay_dl.fetcher.http import HTTP
from svtplay_dl.fetcher.hls import HLS, hlsparse
from svtplay_dl.log import log
class Dbtv(Service,... | mit | Python |
aaa88075d4cf799509584de439f207476e092584 | Use alternate import for RTD. | ohsu-qin/qiprofile-rest,ohsu-qin/qirest | doc/conf.py | doc/conf.py | import os
import sys
try:
import qirest
except ImportError:
# A ReadTheDocs build does not install qirest. In that case,
# load the module directly.
src_dir = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(src_dir)
import qirest
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.int... | import os
import sys
import qirest
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']
autoclass_content = "both"
autodoc_default_flags= ['members', 'show-inheritance']
source_suffix = '.rst'
master_doc = 'index'
project = u'qirest'
copyright = u'2014, OHSU Knight Cancer Institute. This so... | bsd-2-clause | Python |
3c9d6c6db3d8f8f46047993a1541b92c8a1b1a9b | fix bug | BillBillBillBill/Take-out,BillBillBillBill/Take-out,BillBillBillBill/Take-out,BillBillBillBill/Take-out | backend/takeout/bussiness/models/store.py | backend/takeout/bussiness/models/store.py | # coding: utf-8
from django.db import models
from bussiness.models.seller import Seller
from lib.models.image import ImageStore
from lib.utils.misc import get_timestamp_from_datetime
class Store(models.Model):
BAN_STATUS = (
("Y", "yes"),
("N", "no")
)
name = models.CharField(max_length=20... | # coding: utf-8
from django.db import models
from bussiness.models.seller import Seller
from lib.models.image import ImageStore
from lib.utils.misc import get_timestamp_from_datetime
class Store(models.Model):
BAN_STATUS = (
("Y", "yes"),
("N", "no")
)
name = models.CharField(max_length=20... | mit | Python |
d9b8943563120a3d3606ffb070318eea1768415c | update reference implementation to reflect new kwargs and python-requests api usage | amlweems/python-paddingoracle,mwielgoszewski/python-paddingoracle | example.py | example.py | # -*- coding: utf-8 -*-
from paddingoracle import BadPaddingException, PaddingOracle
from base64 import b64encode, b64decode
from urllib import quote, unquote
import requests
import socket
import time
class PadBuster(PaddingOracle):
def __init__(self, **kwargs):
super(PadBuster, self).__init__(**kwargs)
... | # -*- coding: utf-8 -*-
from paddingoracle import BadPaddingException, PaddingOracle
from base64 import b64encode, b64decode
from urllib import quote, unquote
import requests
import socket
import time
class PadBuster(PaddingOracle):
def __init__(self, **kwargs):
super(PadBuster, self).__init__(**kwargs)
... | bsd-2-clause | Python |
f85fb38926893643205de6ce05127ca77713b58c | Reorder qfunction | davidrobles/mlnd-capstone-code | capstone/algorithms/qlearning.py | capstone/algorithms/qlearning.py | import random
from capstone.player import RandPlayer
class RandomPolicy(object):
def action(self, env, vf=None, qf=None):
return random.choice(env.actions(env.cur_state()))
class QLearning(object):
def __init__(self, env, policy=RandomPolicy(), qf={}, alpha=0.1,
gamma=0.99, n_epis... | import random
from capstone.player import RandPlayer
class RandomPolicy(object):
def action(self, env, vf=None, qf=None):
return random.choice(env.actions(env.cur_state()))
class QLearning(object):
def __init__(self, env, policy=RandomPolicy(), qf={}, alpha=0.1,
gamma=0.99, n_epis... | mit | Python |
5353bb9ea8d0224d02960cdaf50ae94880d17b07 | Update sample | fabaff/python-mystrom | example.py | example.py | """
Copyright (c) 2015-2016 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import time
import pymystrom
plug = pymystrom.MyStromPlug('10.100.0.137')
# Preserve state
STATE_ON = plug.get_relay_state()
# Switch relay on if the plug is currently off
if not STATE_ON:
p... | """
Copyright (c) 2015-2016 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import time
import pymystrom
plug = pymystrom.MyStromPlug('10.100.0.137')
# Switch relay on
plug.set_relay_on()
# Get the state of the switch
print('Relay state: ', plug.get_relay_state())
print... | mit | Python |
a43c609253c757e31e0b18f9d365d6e6b0fecfe7 | Fix path to example Spark fixture | xq262144/hue,lumig242/Hue-Integration-with-CDAP,Peddle/hue,cloudera/hue,lumig242/Hue-Integration-with-CDAP,Peddle/hue,MobinRanjbar/hue,cloudera/hue,xq262144/hue,cloudera/hue,fangxingli/hue,kawamon/hue,fangxingli/hue,fangxingli/hue,todaychi/hue,kawamon/hue,MobinRanjbar/hue,Peddle/hue,cloudera/hue,cloudera/hue,kawamon/hu... | desktop/libs/notebook/src/notebook/management/commands/notebook_setup.py | desktop/libs/notebook/src/notebook/management/commands/notebook_setup.py | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 | Python |
61c2f4e61e152cf69593dfc55c987cb7180e1a5f | enable logging by default | delimited0/generals2,toshima/generalsio | example.py | example.py | #!/bin/python
import generals
import logging
logging.basicConfig(level=logging.DEBUG)
# 1v1
g = generals.Generals('your userid', 'your username', '1v1')
# ffa
# g = generals.Generals('your userid', 'your username', 'ffa')
# private game
# g = generals.Generals('your userid', 'your username', 'private', 'your gameid... | #!/bin/python
import generals
# 1v1
g = generals.Generals('your userid', 'your username', '1v1')
# ffa
# g = generals.Generals('your userid', 'your username', 'ffa')
# private game
# g = generals.Generals('your userid', 'your username', 'private', 'your gameid')
# 2v2 game
# g = generals.Generals('your userid', 'y... | epl-1.0 | Python |
2a59f53886af32d735a02eb3e7849b6d1a23f13e | Fix some bugs with the api. | johnbachman/indra,bgyori/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,johnbachman/indra,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy | indra_db_api/api.py | indra_db_api/api.py | from flask import Flask, request, abort, jsonify
from indra.db.util import get_statements_by_gene_role_type
app = Flask(__name__)
@app.route('/statements', methods=['GET'])
def get_statments():
"""Get some statements constrained by query."""
json_req = request.get_json()
if not json_req:
abort(400... | from flask import Flask, request, abort, jsonify
from indra.db.util import get_statements_by_gene_role_type
app = Flask(__name__)
@app.route('/statements', methods=['GET'])
def get_statments():
"""Get some statements constrained by query."""
json_req = request.get_json()
if not json_req:
abort(400... | bsd-2-clause | Python |
610eab797018e3047f5973d1fd195862e6bfcd49 | Fix gunicorn_config tests | SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui | swh/web/tests/test_gunicorn_config.py | swh/web/tests/test_gunicorn_config.py | # Copyright (C) 2019-2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import os
from unittest.mock import patch
import swh.web.gunicorn_c... | # Copyright (C) 2019-2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import os
from unittest.mock import patch
import swh.web.gunicorn_c... | agpl-3.0 | Python |
58e3c68924246ce1278e7b65d53b9bbbdc631e03 | Reorder imports | Ghostkeeper/Luna | plugins/configuration/configurationtype/__init__.py | plugins/configuration/configurationtype/__init__.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | cc0-1.0 | Python |
4d621d515dfa8daa1a9653a09a94013d0e4f717e | Update __init__.py | wolfiex/ipython-dev-reload,wolfiex/ipython-dev-reload | build/lib/ipyReload/__init__.py | build/lib/ipyReload/__init__.py | import time,os,functools,re
from concurrent.futures import ThreadPoolExecutor
from IPython import get_ipython
ipython = get_ipython()
global future,filename,finish,executor,altfn
altfn=False
def CheckUpdate(x):
global filename
filename=x
modtime = os.path.getmtime(filename)
x=0
while True:
... | import time,os,functools,re
from concurrent.futures import ThreadPoolExecutor
from IPython import get_ipython
ipython = get_ipython()
global future,filename,finish,executor,altfn
altfn=False
def CheckUpdate(x):
global filename
filename=x
modtime = os.path.getmtime(filename)
x=0
while True:
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.