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 |
|---|---|---|---|---|---|---|---|---|
d98e33d28105c8180b591e3097af83e42599bfc5 | Remove the usage of nargs to avoid different behaviors between chronograph and command line. | weijia/django-local-apps,weijia/django-local-apps | django_local_apps/management/commands/docker_exec.py | django_local_apps/management/commands/docker_exec.py | import logging
import docker
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase
log = logging.getLogger()
class DockerExecutor(DjangoCmdBase):
def add_arguments(self, parser):
# Positional arguments
"""
:param: in the args it could be: /usr/local/bin/python /... | import logging
import docker
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase
log = logging.getLogger()
class DockerExecutor(DjangoCmdBase):
def add_arguments(self, parser):
# Positional arguments
"""
:param: in the args it could be: /usr/local/bin/python /... | bsd-3-clause | Python |
36e7af17c8d7c4bdb9cfd20387c470697e1bac96 | Simplify f-string to remove cast | amolenaar/gaphor,amolenaar/gaphor | po/build-babel.py | po/build-babel.py | import subprocess
from pathlib import Path
po_path: Path = Path(__file__).resolve().parent
def run_babel(command: str, input: Path, output_file: Path, locale: str):
subprocess.run(
[
"pybabel",
command,
f"--input={input}",
f"--output-file={output_file}",
... | import subprocess
from pathlib import Path
po_path: Path = Path(__file__).resolve().parent
def run_babel(command: str, input: Path, output_file: Path, locale: str):
subprocess.run(
[
"pybabel",
command,
f"--input={str(input)}",
f"--output-file={str(output_f... | lgpl-2.1 | Python |
74d1dfabe7ccab9d75b53d596c47768220bfced2 | Rewrite solution | derekmpham/interview-prep,derekmpham/interview-prep | string/first-str-substr-occr.py | string/first-str-substr-occr.py | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
if len(substr) >=... | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | mit | Python |
2a588df23755bd94924e42dae517705aca3938d8 | Use Pseudo-Normalized verbiage | gstaubli/pndb | proof_of_concept.py | proof_of_concept.py | import time
import csv
tables = [
{
'test_table':
{
'file_name': 'raw_data.tsv',
'column_structure': (
{'id': int},
{'first_name': str}
)
}
}
]
field_lookups = {
'first_name':
{
'type': str,
'values': {
1: 'John',
2: 'Bob',
3: 'Robert',
4: 'Michael',
5: 'Erin',
6: 'Vict... | import time
import csv
tables = [
{
'test_table':
{
'file_name': 'raw_data.tsv',
'column_structure': (
{'id': int},
{'first_name': str}
)
}
}
]
field_lookups = {
'first_name':
{
'type': str,
'values': {
1: 'John',
2: 'Bob',
3: 'Robert',
4: 'Michael',
5: 'Erin',
6: 'Vict... | mit | Python |
a2ac7b84f9578ba8414c00769a0ab4e87ef87c6e | Clean up client | petrvanblokland/Xierpa3,petrvanblokland/Xierpa3 | xierpa3/sites/typo2014/client.py | xierpa3/sites/typo2014/client.py | # -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
# xierpa server
# Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com
#
# X I E R P A 3
# Distribution by the MIT License.
#
# -----------------------------------------------------------... | # -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
# xierpa server
# Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com
#
# X I E R P A 3
# Distribution by the MIT License.
#
# -----------------------------------------------------------... | mit | Python |
9d84b469b3f05b111c08ea83d8f465a4d4fbcca4 | FIX : obob in mpl_helpers | giltis/xray-vision,licode/xray-vision,licode/xray-vision,giltis/xray-vision,sameera2004/xray-vision,ericdill/xray-vision,sameera2004/xray-vision,ericdill/xray-vision | xray_vision/utils/mpl_helpers.py | xray_vision/utils/mpl_helpers.py | import matplotlib
import matplotlib.pyplot as plt
from functools import wraps
def ensure_ax(func):
@wraps(func)
def inner(*args, **kwargs):
if 'ax' in kwargs:
ax = kwargs.pop('ax', None)
elif len(args) > 0 and isinstance(args[0], matplotlib.axes.Axes):
ax = args[0]
... | import matplotlib
import matplotlib.pyplot as plt
from functools import wraps
def ensure_ax(func):
@wraps(func)
def inner(*args, **kwargs):
if 'ax' in kwargs:
ax = kwargs.pop('ax', None)
elif len(args) > 0 and isinstance(args[0], matplotlib.axes.Axes):
ax = args[0]
... | bsd-3-clause | Python |
718071622d8bae486dd8bc250daf1e1626d59d97 | use float comparisons | BT-ojossen/account-invoicing,iDTLabssl/account-invoicing,archetipo/account-invoicing,kittiu/account-invoicing,gurneyalex/account-invoicing,kmee/account-invoicing,eezee-it/account-invoicing,charbeljc/account-invoicing,open-synergy/account-invoicing,sysadminmatmoz/account-invoicing,Endika/account-invoicing,acsone/account... | account_invoice_zero/account_invoice.py | account_invoice_zero/account_invoice.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 | Python |
4258ffab62236c9648f15ecd32f238c56f06550b | fix argument name | yosida95/python-jsmapper | jsmapper/examples/product.py | jsmapper/examples/product.py | # -*- coding: utf-8 -*-
from jsmapper import (
JSONSchema,
Array,
Mapping,
Number,
Object,
String,
)
from jsmapper.defines import JSONSchemaDraftV4
class Product(Mapping):
class Dimensions(Mapping):
length = JSONSchema(type=Number())
width = JSONSchema(type=Number())
... | # -*- coding: utf-8 -*-
from jsmapper import (
JSONSchema,
Array,
Mapping,
Number,
Object,
String,
)
from jsmapper.defines import JSONSchemaDraftV4
class Product(Mapping):
id = JSONSchema(type=Number(),
description="The unique identifier for a product")
name = JSO... | mit | Python |
2bc8f9a633a6c433a9a5c9564a2f161adefc381e | Enable username hack by default (it's up to 255 characters now). | release-engineering/kobo,pombredanne/https-git.fedorahosted.org-git-kobo,release-engineering/kobo,release-engineering/kobo,release-engineering/kobo,pombredanne/https-git.fedorahosted.org-git-kobo,pombredanne/https-git.fedorahosted.org-git-kobo,pombredanne/https-git.fedorahosted.org-git-kobo | kobo/django/auth/__init__.py | kobo/django/auth/__init__.py | # -*- coding: utf-8 -*-
# enable the username hack
# make sure that 'kobo.django.auth' precedes 'django.contrib.auth' in INSTALLED_APPS
import hacks
| lgpl-2.1 | Python | |
281997bf43f4e91fe48de97e7c09716b1c63b6aa | Enable the gallery plugin | jtiki/djangocms-cascade,jrief/djangocms-cascade,haricot/djangocms-bs4forcascade,rfleschenberg/djangocms-cascade,jtiki/djangocms-cascade,jrief/djangocms-cascade,rfleschenberg/djangocms-cascade,jrief/djangocms-cascade,rfleschenberg/djangocms-cascade,haricot/djangocms-bs4forcascade,jtiki/djangocms-cascade | cmsplugin_cascade/bootstrap3/settings.py | cmsplugin_cascade/bootstrap3/settings.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cmsplugin_cascade.settings import CMSPLUGIN_CASCADE, orig_config
CASCADE_PLUGINS = ('buttons', 'carousel', 'accordion', 'container', 'image', 'picture', 'panel',... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cmsplugin_cascade.settings import CMSPLUGIN_CASCADE, orig_config
CASCADE_PLUGINS = ('buttons', 'carousel', 'accordion', 'container', 'image', 'picture', 'panel',... | mit | Python |
7cee7edabad08b01ceda0ed8f2798ebf47c87e95 | Fix catch-all URLs with prefix | uranusjr/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,uranusjr/pycontw2016,pycontw/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016 | src/pycontw2016/urls.py | src/pycontw2016/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from core.views import flat_page
from users.views import user_dashboard
urlpatterns = [
url(r'^$', TemplateView.as_v... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from core.views import flat_page
from users.views import user_dashboard
urlpatterns = [
url(r'^$', TemplateView.as_v... | mit | Python |
c35be6d48a462d668c9a57f381682da905725329 | Update the version number. | jeremiedecock/pydfm,jeremiedecock/pydfm | pydfm/__init__.py | pydfm/__init__.py | # PyDuplicateFileManager
# The MIT License
#
# Copyright (c) 2010,2011,2012,2013,2015 Jeremie DECOCK (http://www.jdhp.org)
#
# 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 restricti... | # PyDuplicateFileManager
# The MIT License
#
# Copyright (c) 2010,2011,2012,2013,2015 Jeremie DECOCK (http://www.jdhp.org)
#
# 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 restricti... | mit | Python |
30471ac300005a9c272a68237953161951ea35f4 | Add import matplotlib back | softwaresaved/international-survey | analysis/data_process/uk_2017/config.py | analysis/data_process/uk_2017/config.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Config file for the cleaning - plotting and notebook process"""
class CleaningConfig:
# Unprocessed dataset
raw_data = './dataset/raw_results-survey245554.csv'
# load the different answers to questions to classify questions based on that
question_fil... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Config file for the cleaning - plotting and notebook process"""
class CleaningConfig:
# Unprocessed dataset
raw_data = './dataset/raw_results-survey245554.csv'
# load the different answers to questions to classify questions based on that
question_fil... | bsd-3-clause | Python |
44131b55cac2dadee7cb76b82bad455152a92139 | include \. in attachments file slugs | labkaxita/lakaxita,labkaxita/lakaxita,labkaxita/lakaxita | lakaxita/attachments/urls.py | lakaxita/attachments/urls.py | from django.conf.urls.defaults import patterns, url
from lakaxita.attachments.views import AttachmentDetail, FileRedirect
urlpatterns = patterns('',
url('^(?P<slug>(\w|\d|-)+)/$', AttachmentDetail.as_view(), name='detail'),
url('^file/(?P<slug>(\w|\d|-|\.)+)/$', FileRedirect.as_view(), name='file'),
... | from django.conf.urls.defaults import patterns, url
from lakaxita.attachments.views import AttachmentDetail, FileRedirect
urlpatterns = patterns('',
url('^(?P<slug>(\w|\d|-)+)/$', AttachmentDetail.as_view(), name='detail'),
url('^file/(?P<slug>(\w|\d|-)+)/$', FileRedirect.as_view(), name='file'),
)
| agpl-3.0 | Python |
8ce19d44bce3d6325e4883739a16431e45b01792 | Add command-line parsing and control of the listening address to crossdomaind.py. | glamrock/flashproxy,infinity0/flashproxy,glamrock/flashproxy,arlolra/flashproxy,infinity0/flashproxy,arlolra/flashproxy,infinity0/flashproxy,arlolra/flashproxy,arlolra/flashproxy,arlolra/flashproxy,infinity0/flashproxy,glamrock/flashproxy,arlolra/flashproxy,infinity0/flashproxy,infinity0/flashproxy,glamrock/flashproxy,... | crossdomaind.py | crossdomaind.py | #!/usr/bin/env python
import getopt
import socket
import sys
DEFAULT_ADDRESS = "0.0.0.0"
DEFAULT_PORT = 843
POLICY = """\
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
\0"""
class options(object):
pass
def usage(f = sys.stdout):
print """\
Usage: %(progname)s <OP... | #!/usr/bin/env python
# A simple daemon to serve a cross-domain policy.
import socket
ADDRESS = ("0.0.0.0", 843)
POLICY = """\
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
\0"""
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(ADDRESS)
... | mit | Python |
2651b475e998d6033d1cf31047398f985c89f23c | Correct usage message | cvra/can-bootloader,cvra/can-bootloader,cvra/can-bootloader,cvra/can-bootloader | client/cvra_bootloader/read_config.py | client/cvra_bootloader/read_config.py | #!/usr/bin/env python3
from cvra_bootloader import commands, utils
import msgpack
import json
def parse_commandline_args():
"""
Parses the program commandline arguments.
"""
DESCRIPTION = 'Read board configs and dumps to JSON'
parser = utils.ConnectionArgumentParser(description=DESCRIPTION)
pa... | #!/usr/bin/env python3
from cvra_bootloader import commands, utils
import msgpack
import json
def parse_commandline_args():
"""
Parses the program commandline arguments.
"""
DESCRIPTION = 'Read board configs and dumps to JSON'
parser = utils.ConnectionArgumentParser(description=DESCRIPTION)
pa... | bsd-2-clause | Python |
37b12e53aff8eb4df8d2f106489da4bd4201c125 | Bump version to 0.4.2. | yunojuno/django-inbound-email | django_inbound_email/__init__.py | django_inbound_email/__init__.py | """An inbound email handler for Django."""
__title__ = 'django-inbound-email'
__version__ = '0.4.2'
__author__ = 'YunoJuno Ltd'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 YunoJuno'
__description__ = 'A Django app for receiving inbound emails.'
| """An inbound email handler for Django."""
__title__ = 'django-inbound-email'
__version__ = '0.4.1'
__author__ = 'YunoJuno Ltd'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 YunoJuno'
__description__ = 'A Django app for receiving inbound emails.'
| mit | Python |
7d75f1dd14374d6bfbb8011fc1853d7d53f4c98c | Fix dtype | wenleix/EdgePPR,wenleix/EdgePPR | src/python/genPriorV.py | src/python/genPriorV.py | # The preprocessing step of DEIM: given ppr_1, ppr_2, ... ppr_k, generate the orthogonal basis.
# This is based on SVD so the basis are sorted according to the singular values (from large to small)
import sys
import os
from sys import argv
import numpy as np
import time
from scipy import linalg
import deimCommon
... | # The preprocessing step of DEIM: given ppr_1, ppr_2, ... ppr_k, generate the orthogonal basis.
# This is based on SVD so the basis are sorted according to the singular values (from large to small)
import sys
import os
from sys import argv
import numpy as np
import time
from scipy import linalg
import deimCommon
... | apache-2.0 | Python |
7851328ceec4a5fbe944f81783912706c7495d11 | Complete iter sol | bowen0701/algorithms_data_structures | lc0404_sum_of_left_leaves.py | lc0404_sum_of_left_leaves.py | """Leetcode 404. Sum of Left Leaves
Easy
URL: https://leetcode.com/problems/sum-of-left-leaves/
Find the sum of all left leaves in a given binary tree.
Example:
3
/ \
9 20
/ \
15 7
There are two left leaves in the binary tree, with values 9 and 15 respectively.
Return 24.
"""
# Definition for ... | """Leetcode 404. Sum of Left Leaves
Easy
URL: https://leetcode.com/problems/sum-of-left-leaves/
Find the sum of all left leaves in a given binary tree.
Example:
3
/ \
9 20
/ \
15 7
There are two left leaves in the binary tree, with values 9 and 15 respectively.
Return 24.
"""
# Definition for ... | bsd-2-clause | Python |
a04e783c99f54ad7cc2525287ad95ae1308769b1 | clean up the users in the example | SupermanScott/Redboy | examples/user.py | examples/user.py | # -*- coding: utf-8 -*-
#
# © 2012 Scott Reynolds
# Author: Scott Reynolds <scott@scottreynolds.us>
#
"""Example of a User Model"""
from redboy.record import Record, MirroredRecord
from redboy.key import Key
from redboy.view import Queue, Stack, Score
from time import time
import redboy.exceptions as exc
user_prefix ... | # -*- coding: utf-8 -*-
#
# © 2012 Scott Reynolds
# Author: Scott Reynolds <scott@scottreynolds.us>
#
"""Example of a User Model"""
from record import Record, MirroredRecord
from redboy.key import Key
from redboy.view import Queue, Stack, Score
from time import time
import redboy.exceptions as exc
user_prefix = "user... | bsd-3-clause | Python |
d10860567eca20b95e652d13b8741338ec85f35e | Refresh cache when modifying tasks from API | OpenNewsLabs/pybossa,geotagx/pybossa,inteligencia-coletiva-lsd/pybossa,PyBossa/pybossa,geotagx/pybossa,Scifabric/pybossa,jean/pybossa,jean/pybossa,Scifabric/pybossa,OpenNewsLabs/pybossa,PyBossa/pybossa,inteligencia-coletiva-lsd/pybossa | pybossa/api/task.py | pybossa/api/task.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 | Python |
e2cbd73218e6f5cf5b86718f6adebd92e9fee2a3 | Make sure land filters are set up when testing | GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,makinacorpus/... | geotrek/trekking/tests/test_filters.py | geotrek/trekking/tests/test_filters.py | # Make sure land filters are set up when testing
from geotrek.land.filters import * # NOQA
from geotrek.land.tests.test_filters import LandFiltersTest
from geotrek.trekking.filters import TrekFilterSet
from geotrek.trekking.factories import TrekFactory
class TrekFilterLandTest(LandFiltersTest):
filterclass = T... | from geotrek.land.tests.test_filters import LandFiltersTest
from geotrek.trekking.filters import TrekFilterSet
from geotrek.trekking.factories import TrekFactory
class TrekFilterLandTest(LandFiltersTest):
filterclass = TrekFilterSet
def test_land_filters_are_well_setup(self):
filterset = TrekFilter... | bsd-2-clause | Python |
d5780089b268f353e49d9a0a6460d3a2dde3888f | Update to 0.1.1 | britny/djangocms-styledlink,mkoistinen/djangocms-styledlink,mkoistinen/djangocms-styledlink,britny/djangocms-styledlink | djangocms_styledlink/__init__.py | djangocms_styledlink/__init__.py | __version__ = '0.1.1' | __version__ = '0.1.0' | bsd-3-clause | Python |
beafa2d2e34a55486fecae6944c8b9e365f35fc9 | Use create instead of created | jeffdwyatt/taiga-back,crr0004/taiga-back,xdevelsistemas/taiga-back-community,gam-phon/taiga-back,EvgeneOskin/taiga-back,gam-phon/taiga-back,CoolCloud/taiga-back,19kestier/taiga-back,astronaut1712/taiga-back,dycodedev/taiga-back,WALR/taiga-back,coopsource/taiga-back,seanchen/taiga-back,Rademade/taiga-back,taigaio/taiga-... | taiga/events/signal_handlers.py | taiga/events/signal_handlers.py | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | agpl-3.0 | Python |
301ba33c0b9fcc1924a90aba646cc375a9ef76e5 | Simplify logic | daevaorn/sentry,gencer/sentry,fotinakis/sentry,alexm92/sentry,ifduyue/sentry,nicholasserra/sentry,mitsuhiko/sentry,mvaled/sentry,nicholasserra/sentry,zenefits/sentry,JamesMura/sentry,BuildingLink/sentry,ifduyue/sentry,BuildingLink/sentry,JackDanger/sentry,jean/sentry,ifduyue/sentry,gencer/sentry,alexm92/sentry,looker/s... | src/sentry/api/endpoints/group_tags.py | src/sentry/api/endpoints/group_tags.py | from __future__ import absolute_import
from rest_framework.response import Response
from collections import defaultdict
from sentry.api.bases.group import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.models import GroupTagValue, GroupTagKey, TagKey, TagKeyStatus
class GroupTagsEndpoint(Gro... | from __future__ import absolute_import
from rest_framework.response import Response
from collections import defaultdict
from itertools import chain
from sentry.api.bases.group import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.models import GroupTagValue, GroupTagKey, TagKey, TagKeyStatus
... | bsd-3-clause | Python |
718b7fe643fc49d1b4261338f68c2216a3391df4 | correct dev version | samuelcolvin/pydantic,samuelcolvin/pydantic | pydantic/version.py | pydantic/version.py | __all__ = ['VERSION', 'version_info']
VERSION = '1.4a1'
def version_info() -> str:
import platform
import sys
from importlib import import_module
from pathlib import Path
from .main import compiled
optional_deps = []
for p in ('typing-extensions', 'email-validator', 'devtools'):
... | __all__ = ['VERSION', 'version_info']
VERSION = '1.3a1'
def version_info() -> str:
import platform
import sys
from importlib import import_module
from pathlib import Path
from .main import compiled
optional_deps = []
for p in ('typing-extensions', 'email-validator', 'devtools'):
... | mit | Python |
751339df0a9c8b45c32b3e55e3a36e1e456d7f99 | Remove VerboseHook. | DOV-Vlaanderen/pydov | pydov/util/hooks.py | pydov/util/hooks.py | import sys
class AbstractHook(object):
def __init__(self, name):
self.name = name
def wfs_search(self, typename):
pass
def wfs_result(self, number_of_results):
pass
def xml_requested(self, url):
pass
def xml_cache_hit(self, url):
pass
def xml_cache_... | import sys
class AbstractHook(object):
def __init__(self, name):
self.name = name
def wfs_search(self, typename):
pass
def wfs_result(self, number_of_results):
pass
def xml_requested(self, url):
pass
def xml_cache_hit(self, url):
pass
def xml_cache_... | mit | Python |
e5dd9b6348a00815b3de59c4f41bc4e17cd4231e | remove loading messages from validator | NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint | fdp/validator.py | fdp/validator.py | import pkg_resources
from pyshacl import validate
from rdflib.graph import Graph
def _validate(data, shapes_file, fdp=False):
try:
data_format = 'turtle'
shapes_file_format = 'turtle'
# validate number of subjects or focus nodes
g = Graph()
g.parse(data=data, format=data_fo... | import pkg_resources
from pyshacl import validate
from rdflib.graph import Graph
def _validate(data, shapes_file, fdp=False):
try:
data_format = 'turtle'
shapes_file_format = 'turtle'
# validate number of subjects or focus nodes
g = Graph()
g.parse(data=data, format=data_fo... | apache-2.0 | Python |
dd2a0849b10feaf44d09f8a37e12e6da91c97c8f | annotate bad PDF function | zpace/stellarmass_pca | figures_tools.py | figures_tools.py | import os
import numpy as np
import matplotlib.pyplot as plt
from copy import copy
from astropy.wcs import WCS
from astropy.wcs.utils import skycoord_to_pixel, proj_plane_pixel_scales
import astropy.coordinates as coords
import warnings
try:
from astropy.wcs.utils import linear_offset_coordinates
except ImportE... | import os
from astropy.wcs import WCS
from astropy.wcs.utils import skycoord_to_pixel, proj_plane_pixel_scales
import astropy.coordinates as coords
import warnings
try:
from astropy.wcs.utils import linear_offset_coordinates
except ImportError:
pass
else:
warnings.warn('linear_offset_coordinates now avai... | mit | Python |
df12df3fd16baebcf9656b396d20d1a2bf4ddea0 | bump version | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/__init__.py | radar/__init__.py | __version__ = '2.48.12_beta'
| __version__ = '2.48.11'
| agpl-3.0 | Python |
44460760f4f5f202477947fd1946209801846e82 | Fix name | DoublePlusGood23/lc-president-challenge | first_problem.py | first_problem.py | def getFizzBuzz(num):
if num % 5 == 0 and num % 3 == 0:
return 'fizzbuzz'
elif num % 3 == 0:
return 'fizz'
elif num % 5 == 0:
return 'buzz'
else:
return str(num)
num = eval(input())
print(getFizzBuzz(num))
| def getFizz(num):
if num % 5 == 0 and num % 3 == 0:
return 'fizzbuzz'
elif num % 3 == 0:
return 'fizz'
elif num % 5 == 0:
return 'buzz'
else:
return str(num)
num = eval(input())
print(getFizz(num)) | mit | Python |
c1b0cfe9fdfbacf71ffbba45b4a8f7efe3fe36a7 | Update wront port script to Python3 | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | docker/dev_wrong_port_warning.py | docker/dev_wrong_port_warning.py | #!/usr/bin/env python
"""
Per kobotoolbox/kobo-docker#301, we have changed the uWSGI port to 8001. This
provides a helpful message to anyone still trying to use port 8000
"""
import sys
from http.server import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
se... | #!/usr/bin/env python
"""
Per kobotoolbox/kobo-docker#301, we have changed the uWSGI port to 8001. This
provides a helpful message to anyone still trying to use port 8000
"""
import BaseHTTPServer
import sys
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(503)
... | bsd-2-clause | Python |
a0ea737e40863067db90ca8c1d6d811ed0505d26 | Update run_dc.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | apps/deeplearning/darknet-rpi/run_dc.py | apps/deeplearning/darknet-rpi/run_dc.py | ## Crate by TJ, https://github.com/taijoon
import serial,os,time
import sys
import RPi.GPIO as GPIO
import picamera
import subprocess
import datetime
import os
# check pin location
gled = 19
rled = 26
# HW setup, GPIO
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(rled, GPIO.OUT)
GPIO.setup(gled, GPIO.OUT)
time.sl... |
## Crate by TJ, https://github.com/taijoon
import serial,os,time
import sys
import RPi.GPIO as GPIO
import picamera
import subprocess
import datetime
import os
# check pin location
gled = 19
rled = 26
# HW setup, GPIO
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(rled, GPIO.OUT)
GPIO.setup(gled, GPIO.OUT)
time.s... | bsd-2-clause | Python |
e7ac7e44fb63c81909e287040fb76bd15dc65df0 | Set version as 1.1.1 | Alignak-monitoring-contrib/alignak-checks-nrpe,Alignak-monitoring-contrib/alignak-checks-nrpe | version.py | version.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
"""
Alignak - Checks pack for NRPE monitored Linux hosts/services
"""
# Package name
__pkg_name__ = u"alignak_checks_nrpe"
# Checks types for PyPI keywords
# Used for:
# - PyPI keywords
# -... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
"""
Alignak - Checks pack for NRPE monitored Linux hosts/services
"""
# Package name
__pkg_name__ = u"alignak_checks_nrpe"
# Checks types for PyPI keywords
# Used for:
# - PyPI keywords
# -... | agpl-3.0 | Python |
04bc0dc59276dff6d8b19f691695a1d4300b8705 | fix feed | tdhopper/westminster-daily,tdhopper/westminster-daily,olneyhymn/westminster-daily,tdhopper/westminster-daily,olneyhymn/westminster-daily,olneyhymn/westminster-daily,olneyhymn/westminster-daily | generate_feed.py | generate_feed.py | from feedgen.feed import FeedGenerator
import datetime as dt
import pytz
from premailer import transform
import markdown
from functools import lru_cache
from bs4 import BeautifulSoup
URL = "https://pandoc--westminster-daily.netlify.com/westminster-daily"
FILENAME = "feed.rss"
NUMBER_OF_DAYS = 30
@lru_cache()
def mar... | from feedgen.feed import FeedGenerator
import datetime as dt
import pytz
from premailer import transform
import markdown
from functools import lru_cache
from bs4 import BeautifulSoup
URL = "https://pandoc--westminster-daily.netlify.com/westminster-daily"
FILENAME = "feed.rss"
NUMBER_OF_DAYS = 30
@lru_cache()
def mar... | bsd-3-clause | Python |
b256ed37b581b71c986772a3691d425d148400d9 | support iter_documents on cases | qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/form_processor/document_stores.py | corehq/form_processor/document_stores.py | from corehq.blobs import Error as BlobError
from corehq.form_processor.exceptions import CaseNotFound, XFormNotFound
from corehq.form_processor.interfaces.dbaccessors import FormAccessors, CaseAccessors
from pillowtop.dao.exceptions import DocumentNotFoundError
from pillowtop.dao.interface import ReadOnlyDocumentStore
... | from corehq.blobs import Error as BlobError
from corehq.form_processor.exceptions import CaseNotFound, XFormNotFound
from corehq.form_processor.interfaces.dbaccessors import FormAccessors, CaseAccessors
from pillowtop.dao.exceptions import DocumentNotFoundError
from pillowtop.dao.interface import ReadOnlyDocumentStore
... | bsd-3-clause | Python |
a758175da8d2ebad0769fc45679fabe8ef7eacd8 | Bump version to 3.2-alpha | Shockblast/godot,ex/godot,Paulloz/godot,josempans/godot,godotengine/godot,vkbsb/godot,Faless/godot,Faless/godot,akien-mga/godot,Zylann/godot,Valentactive/godot,Shockblast/godot,vkbsb/godot,sanikoyes/godot,MarianoGnu/godot,Zylann/godot,Paulloz/godot,MarianoGnu/godot,Faless/godot,sanikoyes/godot,godotengine/godot,Zylann/... | version.py | version.py | short_name = "godot"
name = "Godot Engine"
major = 3
minor = 2
status = "alpha"
module_config = ""
year = 2019
website = "https://godotengine.org"
| short_name = "godot"
name = "Godot Engine"
major = 3
minor = 2
status = "dev"
module_config = ""
year = 2019
website = "https://godotengine.org"
| mit | Python |
9014bcff07ad98035bfde6b46fb7c71c11762bd6 | remove prints | simonvh/genomepy | genomepy/base.py | genomepy/base.py | import os
import sys
import re
import norns
config = norns.config("genomepy", default="cfg/default.yaml")
class Plugin(object):
active = False
def name(self):
n = type(self).__name__.replace("Plugin", "")
return convert(n)
def activate(self):
self.active = True
def deactiva... | import os
import sys
import re
import norns
config = norns.config("genomepy", default="cfg/default.yaml")
class Plugin(object):
active = False
def name(self):
n = type(self).__name__.replace("Plugin", "")
return convert(n)
def activate(self):
self.active = True
def deactiva... | mit | Python |
823fd5f18a300ba919ab478bf94c3253dcbffd3a | Fix merge issue | iotile/python_iotile_cloud | version.py | version.py | version = '0.6.0'
| <<<<<<< HEAD
version = '0.6.0'
=======
version = '0.5.2'
>>>>>>> origin/master
| mit | Python |
81e3519e3f9927120c7a0ee32546607c1c40407f | patch rev bump | Applied-GeoSolutions/gippy,Applied-GeoSolutions/gippy,Applied-GeoSolutions/gippy | gippy/version.py | gippy/version.py | #!/usr/bin/env python
################################################################################
# GIPPY: Geospatial Image Processing library for Python
#
# AUTHOR: Matthew Hanson
# EMAIL: matt.a.hanson@gmail.com
#
# Copyright (C) 2015 Applied Geosolutions
#
# Licensed under the Apache License, Ve... | #!/usr/bin/env python
################################################################################
# GIPPY: Geospatial Image Processing library for Python
#
# AUTHOR: Matthew Hanson
# EMAIL: matt.a.hanson@gmail.com
#
# Copyright (C) 2015 Applied Geosolutions
#
# Licensed under the Apache License, Ve... | apache-2.0 | Python |
d16ed87c69f281a204ff8c46cca41112c82d1337 | Fix Global | MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI | EmeraldAI/Logic/Modules/Global.py | EmeraldAI/Logic/Modules/Global.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import platform
RootPath = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))).rstrip(os.sep) + os.sep
EmeraldPath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))).rstrip(os.sep) + os.sep
OS = platform.system().lowe... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import platform
RootPath = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))).rstrip(os.sep) + os.sep
EmeraldPath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))).rstrip(os.sep) + os.sep
OS = platform.system().lowe... | apache-2.0 | Python |
d68db1bf08e1df17acd37f4aeca8958eaa48b2ab | switch back to development version | vgteam/toil-vg,vgteam/toil-vg | version.py | version.py | # Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 o... | # Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 o... | apache-2.0 | Python |
c25943811b3e821d6824d8c67ff1a4efb3580988 | Update __init__.py | walchko/pyxl320 | pyxl320/__init__.py | pyxl320/__init__.py | #!/usr/bin/env python
__version__ = '0.8.0'
__copyright__ = 'Copyright (c) 2016 Kevin Walchko'
__license__ = 'MIT'
__author__ = 'Kevin J. Walchko'
import Packet
from ServoSerial import ServoSerial, DummySerial
import utils
import xl320
| #!/usr/bin/env python
__version__ = '0.7.6'
__copyright__ = 'Copyright (c) 2016 Kevin Walchko'
__license__ = 'MIT'
__author__ = 'Kevin J. Walchko'
import Packet
from ServoSerial import ServoSerial, DummySerial
import utils
import xl320
# __doc__ = """
# pyxl320
# ========
#
# A python library to talk with Dynamixel ... | mit | Python |
ebcf97f786f7d3535bc7cb532a14fafa10161c86 | update model field | pyprism/Hiren-Git-Commit-Reminder,pyprism/Hiren-Git-Commit-Reminder | github/models.py | github/models.py | from django.db import models
# Create your models here.
class Hiren(models.Model):
access_token = models.CharField(max_length=200)
authorized = models.BooleanField(default=False)
class Counter(models.Model):
number = models.IntegerField
date = models.DateField(auto_now_add=True)
| from django.db import models
# Create your models here.
class Hiren(models.Model):
access_token = models.CharField(max_length=200)
authorized = models.BooleanField(default=False)
class Counter(models.Model):
number = models.BigIntegerField()
date = models.DateTimeField()
| mit | Python |
f6c8a005b497c896734623c2560d7692fae03fa9 | Increment provision version for upgradation of python dependencies. | blaze225/zulip,jrowan/zulip,vaidap/zulip,dawran6/zulip,timabbott/zulip,christi3k/zulip,brainwane/zulip,eeshangarg/zulip,amanharitsh123/zulip,hackerkid/zulip,andersk/zulip,j831/zulip,sonali0901/zulip,samatdav/zulip,mahim97/zulip,synicalsyntax/zulip,amanharitsh123/zulip,kou/zulip,brockwhittaker/zulip,brainwane/zulip,jrow... | version.py | version.py | ZULIP_VERSION = "1.4.1+git"
PROVISION_VERSION = '3.3'
| ZULIP_VERSION = "1.4.1+git"
PROVISION_VERSION = '3.2'
| apache-2.0 | Python |
6e002721023de4d5994a54c0d49f01d5c5ec1f86 | Add some keywords to default and c_mode | philipdexter/vx,philipdexter/vx | vx/mode.py | vx/mode.py | import vx
import os.path
def mode_from_filename(file):
root, ext = os.path.splitext(file)
ext = ext if ext else root
mode = None
if ext == '.c':
return c_mode
class mode:
def __init__(self, window):
self.breaks = ('_', ' ', '\n', '\t')
self.keywords = ()
class python_mod... | import vx
import os.path
def mode_from_filename(file):
root, ext = os.path.splitext(file)
ext = ext if ext else root
mode = None
if ext == '.c':
return c_mode
class mode:
def __init__(self, window):
self.breaks = ('_', ' ', '\n', '\t')
class python_mode(mode):
def __init__(s... | mit | Python |
302ee4e6c5fce43213556405851c48afc3c340db | implement effigies comments on PR 580 | INCF/pybids | bids/layout/tests/test_path_building.py | bids/layout/tests/test_path_building.py | import pytest
from bids.layout import BIDSLayout
from os.path import join, abspath, sep
from pathlib import Path
from bids.tests import get_test_data_path
@pytest.fixture(scope='module')
def layout():
data_dir = join(get_test_data_path(), '7t_trt')
return BIDSLayout(data_dir)
def test_bold_construction(layo... | import pytest
from bids.layout import BIDSLayout
from os.path import join, abspath, sep
from bids.tests import get_test_data_path
@pytest.fixture(scope='module')
def layout():
data_dir = join(get_test_data_path(), '7t_trt')
return BIDSLayout(data_dir)
def test_bold_construction(layout):
ents = dict(subj... | mit | Python |
da11faa1540bed04d96336422d259de3847fcefe | add mail asserts | Larhard/Maildir-Notifier,Larhard/Maildir-Notifier | watcher.py | watcher.py | import pyinotify
import re
import notify
import mailbox
class MailEventHandler(pyinotify.ProcessEvent):
def my_init(self, maildir):
self.maildir = mailbox.Maildir(maildir)
assert self.maildir is not None
def process_IN_MOVED_TO(self, event):
self.new_mail_notify(event.name)
def p... | import pyinotify
import re
import notify
import mailbox
class MailEventHandler(pyinotify.ProcessEvent):
def my_init(self, maildir):
self.maildir = mailbox.Maildir(maildir)
def process_IN_MOVED_TO(self, event):
self.new_mail_notify(event.name)
def process_IN_CREATE(self, event):
s... | mit | Python |
a085f8f3124b926e48e979e67194f2b2318a568c | Add blank line (#95) | GoogleCloudPlatform/ai-platform-samples,GoogleCloudPlatform/ai-platform-samples | quickstart/setup.py | quickstart/setup.py | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# 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 a... | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# 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 a... | apache-2.0 | Python |
fee10efeae410a0bc51842877ef8ffb5fe8b97af | Add gtk implementation of open_file | natduca/trace_event_viewer,natduca/trace_event_viewer,natduca/trace_event_viewer | src/file_dialogs.py | src/file_dialogs.py | #!/usr/bin/env python
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | #!/usr/bin/env python
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | Python |
494749fae544aac11c36c6d5277d1673de3140d7 | use pythonic way to test if a list is empty in mini solver (it's faster). | theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver | rando/MiniSolver.py | rando/MiniSolver.py |
import log, random
from smboolmanager import SMBoolManager
class MiniSolver(object):
def __init__(self, startAP, areaGraph, restrictions):
self.startAP = startAP
self.areaGraph = areaGraph
self.restrictions = restrictions
self.settings = restrictions.settings
self.smbm = S... |
import log, random
from datetime import datetime
from smboolmanager import SMBoolManager
class MiniSolver(object):
def __init__(self, startAP, areaGraph, restrictions):
self.startAP = startAP
self.areaGraph = areaGraph
self.restrictions = restrictions
self.settings = restrictions.s... | mit | Python |
c3f176c2d4f4c177679c2c7b5c308e245a91311a | Implement remark presentation | michaeljoseph/remarkable,michaeljoseph/remarkable,michaeljoseph/remarkable | remarkable/cli.py | remarkable/cli.py | """
remarkable.
Usage:
remarkable [options] another-command <param>
remarkable [options] remark <path-to-markdown-file>
remarkable -h | --help
Options:
--kw-arg=<kw> Keyword option description.
-b --boolean Boolean option description.
--debug Debug.
-h --help ... | """
remarkable.
Usage:
remarkable [options] command <param> <another_params>
remarkable [options] another-command <param>
remarkable -h | --help
Options:
--kw-arg=<kw> Keyword option description.
-b --boolean Boolean option description.
--debug Debug.
-h --help ... | apache-2.0 | Python |
790427faccee15c4a398e340ffe11d0e1ee1488f | Update version.py | RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,beeva-fernandocerezal/rasa_nlu,RasaHQ/rasa_nlu,PHLF/rasa_nlu,PHLF/rasa_nlu,beeva-fernandocerezal/rasa_nlu | rasa_nlu/version.py | rasa_nlu/version.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
__version__ = '0.9.0a6'
| from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
__version__ = '0.9.0a5'
| apache-2.0 | Python |
361f28d341e30392cc69a1b0d4e538feee77f7c7 | Fix rainy weather condition code | admk/tmux-batteries | weather.py | weather.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import os
import sys
import urllib.request
import json
location = 'London'
celcius = True
precision = 1
emoji = True
def fetch(location, celcius=True):
unit = 'metric' if celcius else 'imperial'
weather_url = \
'http://api.openweathermap.org/data/2.... | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import os
import sys
import urllib.request
import json
location = 'London'
celcius = True
precision = 1
emoji = True
def fetch(location, celcius=True):
unit = 'metric' if celcius else 'imperial'
weather_url = \
'http://api.openweathermap.org/data/2.... | mit | Python |
2c744e5e18fcf43c4ca55244b3595ea9159eab5e | fix typo in get.perfetto.dev am: d03fd291f3 am: 86c5037948 am: c6e9282977 | google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto | infra/perfetto-get.appspot.com/main.py | infra/perfetto-get.appspot.com/main.py | # Copyright (C) 2019 The Android Open Source Project
#
# 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 ... | # Copyright (C) 2019 The Android Open Source Project
#
# 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 ... | apache-2.0 | Python |
900336adbbd41b87c71512f4109d6918988f2e4b | bump version | mgedmin/readme,pypa/readme,pypa/readme_renderer,sigmavirus24/readme | readme/__about__.py | readme/__about__.py | # Copyright 2014 Donald Stufft
#
# 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, so... | # Copyright 2014 Donald Stufft
#
# 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, so... | apache-2.0 | Python |
d642d545d3755fc8686c9da14d578b4af0bc8f3f | Remove deprecated get_model from tasks | fcurella/django-recommends,fcurella/django-recommends,python-recsys/django-recommends,python-recsys/django-recommends | recommends/tasks.py | recommends/tasks.py | from celery.task import task, periodic_task
from celery.schedules import crontab
from .utils import filelock
from .settings import RECOMMENDS_TASK_RUN, RECOMMENDS_TASK_CRONTAB, RECOMMENDS_TASK_EXPIRES
def recommends_precompute():
results = []
from .providers import recommendation_registry
# I know this ... | from celery.task import task, periodic_task
from celery.schedules import crontab
from .utils import filelock
from .settings import RECOMMENDS_TASK_RUN, RECOMMENDS_TASK_CRONTAB, RECOMMENDS_TASK_EXPIRES
def recommends_precompute():
results = []
from .providers import recommendation_registry
# I know this ... | mit | Python |
325aa95e39a7a581f58578ba64ea2b447f52e34a | update comment | tkerola/chainer,jnishi/chainer,okuta/chainer,wkentaro/chainer,hvy/chainer,okuta/chainer,hvy/chainer,hvy/chainer,keisuke-umezawa/chainer,chainer/chainer,chainer/chainer,jnishi/chainer,niboshi/chainer,jnishi/chainer,ktnyt/chainer,chainer/chainer,ktnyt/chainer,pfnet/chainer,wkentaro/chainer,ktnyt/chainer,wkentaro/chainer,... | tests/chainer_tests/conftest.py | tests/chainer_tests/conftest.py | import pytest
import chainerx
if not chainerx.is_available():
# Skip all ChainerX tests if ChainerX is unavailable.
# TODO(kmaehashi) This is an tentative fix. This file should be removed
# once chainer-test supports ChainerX.
pytest.mark.chainerx = pytest.mark.skip
# testing.run_module(__name__, _... | import pytest
import chainerx
if not chainerx.is_available():
# Skip all ChainerX tests if it is unavailable.
# TODO(kmaehashi) add `not chainerx` condition to chainer-test.
pytest.mark.chainerx = pytest.mark.skip
# testing.run_module(__name__, __file__)
| mit | Python |
6104b111b4ceaec894018b77cbea4a0de31400d4 | Add name to the snapshot extension | hvy/chainer,jnishi/chainer,ktnyt/chainer,chainer/chainer,cupy/cupy,hvy/chainer,ktnyt/chainer,cupy/cupy,wkentaro/chainer,ysekky/chainer,kikusu/chainer,pfnet/chainer,jnishi/chainer,okuta/chainer,keisuke-umezawa/chainer,ktnyt/chainer,okuta/chainer,niboshi/chainer,niboshi/chainer,cupy/cupy,rezoo/chainer,chainer/chainer,hvy... | chainer/trainer/extensions/_snapshot.py | chainer/trainer/extensions/_snapshot.py | from chainer.serializers import npz
from chainer.trainer import extension
def snapshot(savefun=npz.save_npz,
filename='snapshot_iter_{.updater.iteration}'):
"""Return a trainer extension to take snapshots of the trainer.
This extension serializes the trainer object and saves it to the output
... | from chainer.serializers import npz
from chainer.trainer import extension
def snapshot(savefun=npz.save_npz,
filename='snapshot_iter_{.updater.iteration}'):
"""Return a trainer extension to take snapshots of the trainer.
This extension serializes the trainer object and saves it to the output
... | mit | Python |
ab6b61d8d0b91ebc2d0b1b8cbd526cfbb6a45a42 | Check for a user from previously in the pipeline before checking for duplicate user. | chicagopython/chipy.org,tanyaschlusser/chipy.org,agfor/chipy.org,bharathelangovan/chipy.org,tanyaschlusser/chipy.org,chicagopython/chipy.org,brianray/chipy.org,chicagopython/chipy.org,tanyaschlusser/chipy.org,chicagopython/chipy.org,bharathelangovan/chipy.org,brianray/chipy.org,agfor/chipy.org,bharathelangovan/chipy.or... | chipy_org/libs/social_auth_pipelines.py | chipy_org/libs/social_auth_pipelines.py | from django.contrib.auth import get_user_model
from django.utils.translation import ugettext
from social_auth.exceptions import AuthAlreadyAssociated
from social_auth.backends.pipeline.associate import associate_by_email as super_associate_by_email
def associate_by_email(*args, **kwargs):
"""Check if a user with ... | from django.contrib.auth import get_user_model
from django.utils.translation import ugettext
from social_auth.exceptions import AuthAlreadyAssociated
from social_auth.backends.pipeline.associate import associate_by_email as super_associate_by_email
def associate_by_email(*args, **kwargs):
"""Check if a user with ... | mit | Python |
5ff5faa7b7d7edb0bd591e794fdb2dae113e5771 | Use cached_property | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/hqwebapp/async_handler.py | corehq/apps/hqwebapp/async_handler.py | import json
from django.http import HttpResponse, HttpRequest
from django.utils.functional import cached_property
class AsyncHandlerMixin(object):
"""
To be mixed in with a TemplateView.
todo write better documentation on this (biyeun)
"""
async_handlers = []
@property
def handler_slug(se... | import json
from django.http import HttpResponse, HttpRequest
from dimagi.utils.decorators.memoized import memoized
class AsyncHandlerMixin(object):
"""
To be mixed in with a TemplateView.
todo write better documentation on this (biyeun)
"""
async_handlers = []
@property
def handler_slug(... | bsd-3-clause | Python |
cb19fccce26071378a445844e230b78456961af8 | bump up version | kratsg/ironman | ironman/__init__.py | ironman/__init__.py | __version__ = '0.2.17'
__all__ = ['communicator',
'hardware',
'history',
'interfaces',
'packet',
'server',
'utilities']
def engage(proto='udp'):
''' Fire thrusters.
'''
from ironman.server import ServerFactory
from twisted.internet impor... | __version__ = '0.2.16'
__all__ = ['communicator',
'hardware',
'history',
'interfaces',
'packet',
'server',
'utilities']
def engage(proto='udp'):
''' Fire thrusters.
'''
from ironman.server import ServerFactory
from twisted.internet impor... | mit | Python |
eb1e1cbe0b529e4c3ccc88809639deb1f2c354c5 | mark percentile tests as xfail, still not sure why this happens | maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex | tests/percentile_approx_test.py | tests/percentile_approx_test.py | import platform
import numpy as np
import vaex
import pytest
import sys
version = tuple(map(int, np.__version__.split('.')))
@pytest.mark.skipif(((1,17,0) <= version <= (1,18,1)) and platform.system().lower() == 'windows', reason="strange ref count issue with numpy")
@pytest.mark.skipif(((1,17,0) <= version <= (1,18... | import platform
import numpy as np
import vaex
import pytest
import sys
version = tuple(map(int, np.__version__.split('.')))
@pytest.mark.skipif(((1,17,0) <= version <= (1,18,1)) and platform.system().lower() == 'windows', reason="strange ref count issue with numpy")
@pytest.mark.skipif(((1,17,0) <= version <= (1,18... | mit | Python |
690fdb11ab2dfb7fc9e729de085d64101b31ec1d | increase test timeout | cladmi/RIOT,cladmi/RIOT,lazytech-org/RIOT,mfrey/RIOT,avmelnikoff/RIOT,x3ro/RIOT,yogo1212/RIOT,authmillenon/RIOT,kbumsik/RIOT,rfuentess/RIOT,aeneby/RIOT,mtausig/RIOT,jasonatran/RIOT,smlng/RIOT,BytesGalore/RIOT,yogo1212/RIOT,miri64/RIOT,aeneby/RIOT,OTAkeys/RIOT,basilfx/RIOT,BytesGalore/RIOT,toonst/RIOT,OTAkeys/RIOT,basil... | tests/unittests/tests/01-run.py | tests/unittests/tests/01-run.py | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
def testfunc(child):
child.expect(u"OK... | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
def testfunc(child):
child.expect(u"OK... | lgpl-2.1 | Python |
2ab738e3d966402511d436fef88325542deac008 | remove debug print | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | lib/neuroimaging/__init__.py | lib/neuroimaging/__init__.py | """
Insert long description here.
"""
import re
from path import path
__version__ = "0.01a"
packages = (
'neuroimaging',
'neuroimaging.tests',
'neuroimaging.data',
'neuroimaging.data.tests',
'neuroimaging.fmri',
'neuroimaging.fmri.tests',
'neuroimaging.fmri.fmristat',
'neuroimaging.fmri.fmristat.tests... | """
Insert long description here.
"""
import re
from path import path
__version__ = "0.01a"
packages = (
'neuroimaging',
'neuroimaging.tests',
'neuroimaging.data',
'neuroimaging.data.tests',
'neuroimaging.fmri',
'neuroimaging.fmri.tests',
'neuroimaging.fmri.fmristat',
'neuroimaging.fmri.fmristat.tests... | bsd-3-clause | Python |
00f7cc6eb910b6272b84ead68aeb221886c3d91c | Hide the YT call | pculture/unisubs,pculture/unisubs,ofer43211/unisubs,eloquence/unisubs,ReachingOut/unisubs,ofer43211/unisubs,wevoice/wesub,norayr/unisubs,ofer43211/unisubs,ReachingOut/unisubs,wevoice/wesub,ReachingOut/unisubs,eloquence/unisubs,eloquence/unisubs,norayr/unisubs,pculture/unisubs,ujdhesa/unisubs,norayr/unisubs,ujdhesa/unis... | apps/auth/templatetags/auth_tags.py | apps/auth/templatetags/auth_tags.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | agpl-3.0 | Python |
567feb08488d6e4bc58dca80ed736bbec8050b29 | change comment | totalvoice/totalvoice-python | totalvoice/cliente/api/validanumero.py | totalvoice/cliente/api/validanumero.py | # coding=utf-8
from __future__ import absolute_import
from .helper import utils
from .helper.routes import Routes
from totalvoice.cliente.api.totalvoice import Totalvoice
import json, requests
class ValidaNumero(Totalvoice):
def __init__(self, cliente):
super(ValidaNumero, self).__init__(cliente)
de... | # coding=utf-8
from __future__ import absolute_import
from .helper import utils
from .helper.routes import Routes
from totalvoice.cliente.api.totalvoice import Totalvoice
import json, requests
class ValidaNumero(Totalvoice):
def __init__(self, cliente):
super(ValidaNumero, self).__init__(cliente)
de... | mit | Python |
3e7847fcfb33dd0aa06fea2ccbf02f5c07e2b5ea | Enable webrtc on non-android since those tests don't seem to fail. | axinging/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,hgl888/chromium-crossw... | tools/perf/benchmarks/webrtc.py | tools/perf/benchmarks/webrtc.py | # Copyright 2014 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.
from core import perf_benchmark
from measurements import webrtc
import page_sets
from telemetry import benchmark
# http://crbug.com/501383
# http://crbug.... | # Copyright 2014 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.
from core import perf_benchmark
from measurements import webrtc
import page_sets
from telemetry import benchmark
@benchmark.Disabled # http://crbug.com/5... | bsd-3-clause | Python |
1da94e9512944f2cdb33c9f3520ebc0216026950 | Update file helpers | NejcZupec/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,edofic/ggrc-co... | src/lib/file_ops.py | src/lib/file_ops.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
import os
import logging
try:
import yaml
except ImportError:
pass
... | import os
import logging
try:
import yaml
except ImportError:
pass
logger = logging.getLogger(__name__)
def create_directory(path):
"""
Creates a directory if it doesn't already exist.
"""
# Check if path is a file_path or a dir_path. Dir path is a string that ends with os.sep.
if path[-... | apache-2.0 | Python |
47e91a816e196ff357e348bc8fd02819bf00059a | remove useless broker conf in dev. | soasme/rio,soasme/rio,soasme/rio | rio/settings/dev.py | rio/settings/dev.py | # -*- coding: utf-8 -*-
DEBUG = True
SECRET_KEY = 'OOxdXBtiwPHGpjxaACWvzpYCbDhBmaYk'
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/rio.db'
CELERY_BROKER_URL = 'redis://localhost/2'
CELERY_RESULT_BACKEND = 'db+' + SQLALCHEMY_DATABASE_URI
| # -*- coding: utf-8 -*-
DEBUG = True
SECRET_KEY = 'OOxdXBtiwPHGpjxaACWvzpYCbDhBmaYk'
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/rio.db'
BROKER_URL = 'redis://localhost/2'
CELERY_BROKER_URL = 'redis://localhost/2'
CELERY_RESULT_BACKEND = 'db+' + SQLALCHEMY_DATABASE_URI
| mit | Python |
418faae8f7e1052e3a198ef7e69dff55deb7d141 | Add max password length check. | alex-march/micropython,turbinenreiter/micropython,hosaka/micropython,ryannathans/micropython,tobbad/micropython,tralamazza/micropython,matthewelse/micropython,alex-march/micropython,selste/micropython,hiway/micropython,MrSurly/micropython-esp32,HenrikSolver/micropython,SHA2017-badge/micropython-esp32,pfalcon/micropytho... | esp8266/scripts/webrepl_setup.py | esp8266/scripts/webrepl_setup.py | import sys
import socket
import time
from websocket import *
import websocket_helper
def setup_server():
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
ai = socket.getaddrinfo("0.0.0.0", 8266)
addr = ai[0][4]
s.bind(addr)
s.listen(1)
return s
def getpass(st... | import sys
import socket
import time
from websocket import *
import websocket_helper
def setup_server():
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
ai = socket.getaddrinfo("0.0.0.0", 8266)
addr = ai[0][4]
s.bind(addr)
s.listen(1)
return s
def getpass(st... | mit | Python |
5b69d2666b7f51d1b25bbdbcaad615e33e4e099d | Fix crash when enemy in sensor tower range + support destructible rocksu | Dentosal/python-sc2 | sc2/game_state.py | sc2/game_state.py | from .units import Units
from .power_source import PsionicMatrix
from .pixel_map import PixelMap
class Common(object):
ATTRIBUTES = [
"player_id",
"minerals", "vespene",
"food_cap", "food_used",
"food_army", "food_workers",
"idle_worker_count", "army_count",
"warp_ga... | from .units import Units
from .power_source import PsionicMatrix
class Common(object):
ATTRIBUTES = [
"player_id",
"minerals", "vespene",
"food_cap", "food_used",
"food_army", "food_workers",
"idle_worker_count", "army_count",
"warp_gate_count", "larva_count"
]
... | mit | Python |
bd5978083cdd096fa1f83e43a4e8dbb36cd5f2a7 | Clean up the lunar heightmap | Cynerva/jttcotm | states/lunar_surface.py | states/lunar_surface.py | import math
import random
import pygame
from Box2D import *
import backgrounds
from camera import Camera
from player import Player
from heightmap import heightmap_1d
from config import screen_height
from debug import draw_body
class LunarSurface(object):
def __init__(self):
""" Good god what is this even... | import math
import pygame
from Box2D import *
import backgrounds
from camera import Camera
from player import Player
from heightmap import heightmap_1d
from debug import draw_body
class LunarSurface(object):
def __init__(self):
self.background = backgrounds.LunarSurface()
self.camera = Camera()
... | bsd-3-clause | Python |
b1f8e376f343bfad5c740f2dce1a0fbc066d3b01 | Add command line args for the pH. | dmccloskey/component-contribution,dmccloskey/component-contribution | scripts/calc_E.py | scripts/calc_E.py | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 25th 2015
@author: flamholz
"""
from component_contribution.component_contribution_trainer import ComponentContribution
from component_contribution.kegg_reaction import KeggReaction
from component_contribution.thermodynamic_constants import F, default_T
import argparse
... | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 25th 2015
@author: flamholz
"""
from component_contribution.component_contribution_trainer import ComponentContribution
from component_contribution.kegg_reaction import KeggReaction
from component_contribution.thermodynamic_constants import F, default_T
import argparse
... | mit | Python |
4016dbec6a2ea903bc8162ea41d77c3ae811a6f0 | fix pylint warnings in rdp module | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/rdp.py | salt/modules/rdp.py | # -*- coding: utf-8 -*-
'''
Manage RDP Service on Windows servers
'''
# Import python libs
import re
# Import salt libs
import salt.utils
POWERSHELL = 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'
def __virtual__():
'''
Only works on Windows systems
'''
if salt.utils.is_windows():... | # -*- coding: utf-8 -*-
'''
Manage RDP Service on Windows servers
'''
# Import python libs
import re
# Import salt libs
import salt.utils
POWERSHELL='C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'
def __virtual__():
'''
Only works on Windows systems
'''
if salt.utils.is_windows():
... | apache-2.0 | Python |
e1067ab4e5d028fa22437ac0451ae3237f7d3a2f | update guestbook example css | fission/fission,platform9/fission,fission/fission,life1347/fission,life1347/fission,life1347/fission,fission/fission,life1347/fission,life1347/fission,platform9/fission,life1347/fission,fission/fission,platform9/fission,life1347/fission,platform9/fission,life1347/fission,life1347/fission | examples/python/guestbook/get.py | examples/python/guestbook/get.py | #
# Handles GET /guestbook -- returns a list of items in the guestbook
# with a form to add more.
#
from flask import current_app, escape
import redis
# Connect to redis. This is run only when this file is loaded; as
# long as the pod is alive, the connection is reused.
redisConnection = redis.StrictRedis(host='redi... | #
# Handles GET /guestbook -- returns a list of items in the guestbook
# with a form to add more.
#
from flask import current_app, escape
import redis
# Connect to redis. This is run only when this file is loaded; as
# long as the pod is alive, the connection is reused.
redisConnection = redis.StrictRedis(host='redi... | apache-2.0 | Python |
c951576e0c6f3e7b4a4df6ba843c144e49ff1ba8 | add missing new line at the end of file | tojonmz/treeherder,deathping1994/treeherder,kapy2010/treeherder,parkouss/treeherder,gbrmachado/treeherder,tojon/treeherder,adusca/treeherder,moijes12/treeherder,adusca/treeherder,gbrmachado/treeherder,gbrmachado/treeherder,edmorley/treeherder,akhileshpillai/treeherder,edmorley/treeherder,moijes12/treeherder,sylvestre/t... | treeherder/workers/management/commands/shutdown_workers.py | treeherder/workers/management/commands/shutdown_workers.py | from django.core.management.base import BaseCommand
from celery.task.control import broadcast
class Command(BaseCommand):
help = "Broadcast a warm shutdown event to all the workers."
def handle(self, *args, **options):
self.stdout.write("Sending shutdown event")
broadcast("shutdown")
... | from django.core.management.base import BaseCommand
from celery.task.control import broadcast
class Command(BaseCommand):
help = "Broadcast a warm shutdown event to all the workers."
def handle(self, *args, **options):
self.stdout.write("Sending shutdown event")
broadcast("shutdown")
... | mpl-2.0 | Python |
bd9526e0044f6cdf47c4ed2e45ddde58f67905b3 | add line to run unittests | funginstitute/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor | lib/new_xml_parsing/test_xml_driver.py | lib/new_xml_parsing/test_xml_driver.py | #!/usr/bin/env python
import os
import re
import unittest
from xml_driver import XMLElement, XMLHandler
from xml.sax import make_parser, handler
# Directory of test files
xml_files = [x for x in os.listdir('test_xml_files')
if re.match(r"2012_\d.xml", x) != None] # Match fixtures
parsed_xml = []
for xf ... | #!/usr/bin/env python
import os
import re
import unittest
from xml_driver import XMLElement, XMLHandler
from xml.sax import make_parser, handler
# Directory of test files
xml_files = [x for x in os.listdir('test_xml_files')
if re.match(r"2012_\d.xml", x) != None] # Match fixtures
parsed_xml = []
for xf ... | bsd-2-clause | Python |
708439135d26a8a4b38ad84665938f742a6e7f8c | Update description | davidrobles/mlnd-capstone-code | examples/tic_ql_tabular_fixed.py | examples/tic_ql_tabular_fixed.py | '''
Q-Learning is used to estimate the state-action values for a
Tic-Tac-Toe board position against a fixed Alpha-Beta opponent
'''
from capstone.game.games import TicTacToe
from capstone.game.players import AlphaBeta, RandPlayer
from capstone.game.utils import tic2pdf
from capstone.rl import FixedGameMDP, Environment
... | '''
Q-Learning is used to learn the state-action values for a
Tic-Tac-Toe board position against a fixed Alpha-Beta opponent
'''
from capstone.game.games import TicTacToe
from capstone.game.players import AlphaBeta, RandPlayer
from capstone.game.utils import tic2pdf
from capstone.rl import FixedGameMDP, Environment
fro... | mit | Python |
37bec74984f1d3b88f640f2bc9d7788090acdf58 | Remove commented out code | khosrow/lvsm,khosrow/lvsm | lvsm/__main__.py | lvsm/__main__.py | #!/usr/bin/env python
# Khosrow Ebrahimpour - Sep 2012
"""
lvsm - LVS Manager
LVS Manager is a shell that eases the management of a linux virtual server.
Using it without arguments will enter an interactive shell. Supplying one or
more command-line arguments will run lvsm for a "single-shot" use.
Usage: lvsm [-h] [-... | #!/usr/bin/env python
# Khosrow Ebrahimpour - Sep 2012
"""
lvsm - LVS Manager
LVS Manager is a shell that eases the management of a linux virtual server.
Using it without arguments will enter an interactive shell. Supplying one or
more command-line arguments will run lvsm for a "single-shot" use.
Usage: lvsm [-h] [-... | mit | Python |
cb14fb14f5c227aa780a06a2ce7bff758c74962c | update version | pavlov99/jsonapi,pavlov99/jsonapi | jsonapi/__init__.py | jsonapi/__init__.py | """ JSON:API realization."""
__version = (0, 7, 4)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| """ JSON:API realization."""
__version = (0, 7, 3)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| mit | Python |
88753822c379177a309a1e195520d487835b10cf | update hotfix version | bradical987/jumpbox,bradical987/jumpbox | jumpbox/_version.py | jumpbox/_version.py | # Copyright (C) 2017 Bradley Sakdol <bsakdol@turnitin.com>
#
# This file is part of Jumpbox
#
# Jumpbox 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
# (at your option) an... | # Copyright (C) 2017 Bradley Sakdol <bsakdol@turnitin.com>
#
# This file is part of Jumpbox
#
# Jumpbox 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
# (at your option) an... | mit | Python |
ece5438dda41e8d50346860bc33931c109f14ec8 | bump version number for win32 port | kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn | kapteyn/__init__.py | kapteyn/__init__.py | """Kapteyn package.
"""
from os import path
package_dir = path.abspath(path.dirname(__file__))
__all__=['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils',
'mplutil', 'positions', 'shapes', 'rulers', 'filters',
'interpolation','kmpfit']
__version__='2.3.1'
| """Kapteyn package.
"""
from os import path
package_dir = path.abspath(path.dirname(__file__))
__all__=['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils',
'mplutil', 'positions', 'shapes', 'rulers', 'filters',
'interpolation','kmpfit']
__version__='2.3'
| bsd-3-clause | Python |
7365a739660927f373cbf613e1d869265fb16e7d | remove some obsolete code | nschloe/meshio | meshio/_files.py | meshio/_files.py | from contextlib import contextmanager
def is_buffer(obj, mode):
return ("r" in mode and hasattr(obj, "read")) or (
"w" in mode and hasattr(obj, "write")
)
@contextmanager
def open_file(path_or_buf, mode="r"):
if is_buffer(path_or_buf, mode):
yield path_or_buf
else:
with open(... | import sys
from contextlib import contextmanager
try:
# Python 3.6+
from os import PathLike
except ImportError:
from pathlib import PurePath as PathLike
def is_buffer(obj, mode):
return ("r" in mode and hasattr(obj, "read")) or (
"w" in mode and hasattr(obj, "write")
)
@contextmanager
d... | mit | Python |
30794989f1c33c55ff8adfc91aa575a47bd98dfd | Increment version to 1.0.6 | SpectralAngel/django-select2-forms,hkmshb/django-select2-forms,sandow-digital/django-select2-forms,JP-Ellis/django-select2-forms,SpectralAngel/django-select2-forms,hkmshb/django-select2-forms,sandow-digital/django-select2-forms,SpectralAngel/django-select2-forms,hkmshb/django-select2-forms,sandow-digital/django-select2... | select2/__init__.py | select2/__init__.py | __version_info__ = (1, 0, 6)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (1, 0, 5)
__version__ = '.'.join(map(str, __version_info__))
| bsd-2-clause | Python |
d95412425a5d5a76cacb463fc8c137f576c8b7ad | Fix line-wrapping of help text. | synicalsyntax/zulip,brainwane/zulip,vaidap/zulip,ryanbackman/zulip,aakash-cr7/zulip,jrowan/zulip,eeshangarg/zulip,blaze225/zulip,vabs22/zulip,Galexrt/zulip,brockwhittaker/zulip,SmartPeople/zulip,zulip/zulip,PhilSk/zulip,aakash-cr7/zulip,tommyip/zulip,rht/zulip,christi3k/zulip,kou/zulip,dhcrzf/zulip,blaze225/zulip,dhcrz... | zerver/management/commands/generate_realm_creation_link.py | zerver/management/commands/generate_realm_creation_link.py | from __future__ import absolute_import
from __future__ import print_function
from argparse import ArgumentParser, RawTextHelpFormatter
from typing import Any
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import ProgrammingError
from confirmation.models import gener... | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import ProgrammingError
from confirmation.models import generate_realm_creation_url
from zerver.models import Realm
imp... | apache-2.0 | Python |
a1e028c4cbd414073163f076fb766f64068eb728 | Bump version | thoas/django-sequere | sequere/__init__.py | sequere/__init__.py | version = (0, 2, 5)
__version__ = '.'.join(map(str, version))
from .registry import register, autodiscover
__all__ = ['register', 'autodiscover']
default_app_config = 'sequere.apps.SequereConfig'
| version = (0, 2, 4)
__version__ = '.'.join(map(str, version))
from .registry import register, autodiscover
__all__ = ['register', 'autodiscover']
default_app_config = 'sequere.apps.SequereConfig'
| mit | Python |
081be22efa042db2f706cf3adc08e40ab605c6d0 | modify comment | dasadc/conmgr,dasadc/conmgr,dasadc/conmgr,dasadc/conmgr | server/datastore.py | server/datastore.py | # -*- coding: utf-8 -*-
#
from google.appengine.ext import ndb
def qdata_key(year=2015):
"問題データのparent"
return ndb.Key('Qdata', year)
def userlist_key():
"UserInfoのparent"
return ndb.Key('Users', 'all')
class UserInfo(ndb.Model):
username = ndb.StringProperty()
password = ndb.StringProperty... | # -*- coding: utf-8 -*-
#
from google.appengine.ext import ndb
def qdata_key(year=2015):
"問題データのparent"
return ndb.Key('Qdata', year)
def userlist_key():
"UserInfoのparent"
return ndb.Key('Users', 'all')
class UserInfo(ndb.Model):
username = ndb.StringProperty()
password = ndb.StringProperty... | bsd-3-clause | Python |
fb6c8d2be457f6043a51ceaae2f9469a02b2aeca | Update MultiWii.py | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | service/MultiWii.py | service/MultiWii.py | #########################################
# MultiWii.py
# categories: sensor
# more info @: http://myrobotlab.org/service/MultiWii
#########################################
# uncomment for virtual hardware
# virtual = True
# port = "/dev/ttyUSB0"
port = "COM15"
# start optional virtual arduino service, used for test
... | #########################################
# MultiWii.py
# categories: sensor
# more info @: http://myrobotlab.org/service/MultiWii
#########################################
# uncomment for virtual hardware
virtual = True
# port = "/dev/ttyUSB0"
port = "COM15"
# start optional virtual arduino service, used for test
if... | apache-2.0 | Python |
e8e0aa64437bcf7eb98f1d8ee89e7fcf918c81ca | Update Multiwii.py | sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,mecax/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,mecax/pyrobotlab | service/Multiwii.py | service/Multiwii.py | #define POLL_PERIOD 20
serial = Runtime.start("serial","Serial")
COMPORT= "COM19"
BAUDRATE = 9600
#define MSP_SET_RAW_RC 200
#define MSP_SET_RAW_RC_LENGTH 16
RC_MIN = 1000
RC_MID = 1500
RC_MAX = 2000
ROLL = 0
PITCH = 1
YAW = 2
THROTTLE = 3
AUX1 = 4
AUX2 = 5
AUX3 = 6
AUX4 = ... | #define POLL_PERIOD 20
serial = Runtime.start("serial","Serial")
COMPORT= "COM19"
BAUDRATE = 9600
#define MSP_SET_RAW_RC 200
#define MSP_SET_RAW_RC_LENGTH 16
RC_MIN = 1000
RC_MID = 1500
RC_MAX = 2000
ROLL = 0
PITCH = 1
YAW = 2
THROTTLE = 3
AUX1 = 4
AUX2 = 5
AUX3 = 6
AUX4 = ... | apache-2.0 | Python |
62a04170e41d599d653e94afe0844576e175c314 | Add comments on variable settings | AustralianAntarcticDataCentre/save_emails_to_files,AustralianAntarcticDataCentre/save_emails_to_files | settings_example.py | settings_example.py | import os
import re
from imap import EmailCheckError, EmailServer
from postgresql import DatabaseServer
CSV_FOLDER = os.getcwd()
# Values come from `EMAIL_SUBJECT_RE`.
CSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.csv'
# Restrict emails by sender.
EMAIL_FROM = 'sender@example.com'
# Restrict emails by su... | import os
import re
from imap import EmailCheckError, EmailServer
from postgresql import DatabaseServer
CSV_FOLDER = os.getcwd()
CSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.csv'
# Restrict emails by sender.
EMAIL_FROM = 'sender@example.com'
# Restrict emails by subject.
EMAIL_SUBJECT_RE = re.compile(''... | mit | Python |
ce1c46ecbf5623ec99c8fc2871d0cb35c5dc9100 | Update sshkey.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | setup/ssh/sshkey.py | setup/ssh/sshkey.py | # -*- coding: utf-8 -*-
# Author : jeonghoonkang, https://github.com/jeonghoonkang
from __future__ import print_function
import subprocess
import os
import sys
if __name__ == '__main__':
print ("usage : python sshkey.py {ID@IP_ADD} {PORT}, {} : user should input")
if len(sys.argv) < 2:
exit("[bye] y... | # -*- coding: utf-8 -*-
# Author : jeonghoonkang, https://github.com/jeonghoonkang
from __future__ import print_function
import subprocess
import os
import sys
if __name__ == '__main__':
print ("usage : python sshkey.py {IP_ADD} {PORT}, {} : user should input")
if len(sys.argv) < 2:
exit("[bye] you ... | bsd-2-clause | Python |
0df211c91ce899e34bfb5691dde0e0ba1a78f36d | Add fiware-ut-12 tag to the test_objectstorage_available_to_widgets | rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud | src/wirecloud/fiware/tests/selenium.py | src/wirecloud/fiware/tests/selenium.py | from wirecloud.commons.utils.testcases import WirecloudSeleniumTestCase
__test__ = False
class FiWareSeleniumTestCase(WirecloudSeleniumTestCase):
def test_add_fiware_marketplace(self):
self.login()
self.add_marketplace('fiware', 'http://localhost:8080', 'fiware')
test_add_fiware_marketpla... | from wirecloud.commons.utils.testcases import WirecloudSeleniumTestCase
__test__ = False
class FiWareSeleniumTestCase(WirecloudSeleniumTestCase):
def test_add_fiware_marketplace(self):
self.login()
self.add_marketplace('fiware', 'http://localhost:8080', 'fiware')
test_add_fiware_marketpla... | agpl-3.0 | Python |
2078ba357b331f071e1bd36e71ed69ed68cceb1d | Add todo annotation. | dennybaa/st2,pixelrebel/st2,pixelrebel/st2,peak6/st2,Plexxi/st2,pixelrebel/st2,punalpatel/st2,punalpatel/st2,peak6/st2,nzlosh/st2,StackStorm/st2,emedvedev/st2,Plexxi/st2,Plexxi/st2,lakshmi-kannan/st2,tonybaloney/st2,dennybaa/st2,peak6/st2,dennybaa/st2,lakshmi-kannan/st2,StackStorm/st2,Plexxi/st2,tonybaloney/st2,tonybal... | st2actions/st2actions/runners/utils.py | st2actions/st2actions/runners/utils.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 | Python |
0e345fb7624e5d30e7e689bb3d6a05dfe7193d13 | Convert major and minor versions to integers for version matching | celery/kombu,mverrilli/kombu,numb3r3/kombu,daevaorn/kombu,bmbouter/kombu,cce/kombu,Elastica/kombu,tkanemoto/kombu,numb3r3/kombu,Elastica/kombu,jindongh/kombu,jindongh/kombu,mverrilli/kombu,ZoranPavlovic/kombu,bmbouter/kombu,ZoranPavlovic/kombu,cce/kombu,tkanemoto/kombu,iris-edu-int/kombu,daevaorn/kombu,iris-edu-int/kom... | kombu/utils/text.py | kombu/utils/text.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from difflib import SequenceMatcher
from kombu import version_info_t
def fmatch_iter(needle, haystack, min_ratio=0.6):
for key in haystack:
ratio = SequenceMatcher(None, needle, key).ratio()
if ratio >= min_ratio:
yield r... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from difflib import SequenceMatcher
from kombu import version_info_t
def fmatch_iter(needle, haystack, min_ratio=0.6):
for key in haystack:
ratio = SequenceMatcher(None, needle, key).ratio()
if ratio >= min_ratio:
yield r... | bsd-3-clause | Python |
0fabc8d522c07c7f64557d840b53ecb723a7b07f | Rename char | muddyfish/PYKE,muddyfish/PYKE | node/rickroll.py | node/rickroll.py | #!/usr/bin/env python
from nodes import Node
class RickRoll(Node):
char = "Never gonna give you up"
args = 0
results = 1
def func(self):
"""Redirect to RickRoll"""
return "Never gonna let you down" | #!/usr/bin/env python
from nodes import Node
class RickRoll(Node):
char = "never gonna give you up"
args = 0
results = 1
def func(self):
"""Redirect to RickRoll"""
return "Never gonna let you down" | mit | Python |
c8be023cb26e34fd1a1055b11b320f570c87b4ab | Fix undefined version | mkukielka/oddt,oddt/oddt,mkukielka/oddt,oddt/oddt | oddt/__init__.py | oddt/__init__.py | """Open Drug Discovery Toolkit
==============================
Universal and easy to use resource for various drug discovery tasks, ie docking, virutal screening, rescoring.
Attributes
----------
toolkit : module,
Toolkits backend module, currenlty OpenBabel [ob] and RDKit [rdk].
This settin... | """Open Drug Discovery Toolkit
==============================
Universal and easy to use resource for various drug discovery tasks, ie docking, virutal screening, rescoring.
Attributes
----------
toolkit : module,
Toolkits backend module, currenlty OpenBabel [ob] and RDKit [rdk].
This settin... | bsd-3-clause | Python |
0cf45657c01349b6304470e0ee7349e9f62874f5 | Bump version 0.19.0rc3 --> 0.19.0rc4 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.19.0rc4"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.19.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
4bcf0ab7fb40902b49b877f41fc4dbbb7d5b7c56 | Bump version 0.20.2rc1 --> 0.20.2rc2 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.20.2rc2"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.20.2rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
e83ff4772251d5c997ddcdc70686c898ea454c82 | Bump version 0.20.1rc1 --> 0.20.1rc2 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.20.1rc2"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.20.1rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.