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 |
|---|---|---|---|---|---|---|---|---|
08ed241814824222d5283b1dabb62f663b088fac | Use inward issue instead of outward if available | kylef/goji | goji/models.py | goji/models.py | class Model(object):
pass
class User(Model):
@classmethod
def from_json(cls, json):
if json:
return cls(json['name'], json['displayName'], json.get('emailAddress'))
def __init__(self, username, name, email=None):
self.username = username
self.name = name
sel... | class Model(object):
pass
class User(Model):
@classmethod
def from_json(cls, json):
if json:
return cls(json['name'], json['displayName'], json.get('emailAddress'))
def __init__(self, username, name, email=None):
self.username = username
self.name = name
sel... | bsd-2-clause | Python |
ac19471508b0ee795f4ab2e84a8f29bf8ad6147c | edit admin page for Goods model | Beomi/irkshop,Beomi/irkshop,Beomi/irkshop | goods/admin.py | goods/admin.py | from django.contrib import admin
from .models import Goods
from .models import GoodsImage
from .models import Category
from .models import Shipping
from .models import Order
from .models import OrderDetail
from core.export_csv import export_as_csv_action
class GoodsImageInline(admin.TabularInline):
model = Good... | from django.contrib import admin
from .models import Goods
from .models import GoodsImage
from .models import Category
from .models import Shipping
from .models import Order
from .models import OrderDetail
from core.export_csv import export_as_csv_action
class GoodsImageInline(admin.TabularInline):
model = Good... | apache-2.0 | Python |
dad67ef8cbe185a671f7d66f3c5e9737b3dfc4a2 | bump v0.1.4 | amyangfei/GorMW | gor/version.py | gor/version.py | __version__ = "0.1.4"
| __version__ = "0.1.3"
| mit | Python |
1c059a32d58db964974b3d91cdf006f8956a4148 | remove comment | simeonf/pybay,simeonf/pybay | pybay/urls.py | pybay/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
from symposion.teams import urls as teams_urls
from symposion.proposals import urls as proposals_urls
WIKI_SL... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
# from symposion.views import SignupView
from symposion.teams import urls as teams_urls
from symposion.proposal... | apache-2.0 | Python |
f8fa3acbb37ef50e2ef1eef2d3e3ea50baa3c880 | add docstrings | emaadmanzoor/pyipmi,Cynerva/pyipmi | pyipmi/sdr.py | pyipmi/sdr.py | """SDR records
These are really bare right now - look at the SDR commands to see
how they actually get filled out.
"""
class Sdr(object):
"""Base SDR record type for others to inherit"""
pass
class AnalogSdr(Sdr):
"""An analog SDR record"""
pass
class DiscreteSdr(Sdr):
"""A discrete SDR record""... | class Sdr(object):
pass
class AnalogSdr(Sdr):
pass
class DiscreteSdr(Sdr):
pass
| bsd-3-clause | Python |
1d20ffaa86138bece0c01faeb3d42a7db8dbcfba | add test to assert forced_slave can collapse | Incubaid/arakoon,Incubaid/arakoon,openvstorage/arakoon,openvstorage/arakoon,Incubaid/arakoon,openvstorage/arakoon | extension/test/server/left/test_collapse.py | extension/test/server/left/test_collapse.py | """
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact d... | """
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact d... | apache-2.0 | Python |
f590080fc4d431b333f73ad548a50bc24d4fcf5b | Send char string instead of widechar string | jaybosamiya/fuzzing-numpy,jaybosamiya/fuzzing-numpy,jaybosamiya/fuzzing-numpy | fuzzer/main.py | fuzzer/main.py | import generator
from ctypes import CDLL
import numpy as np
# Initializes the harness and sets it up for work
harness = CDLL("harness/harness.so")
while True:
t = generator.generate()
harness.register_testcase(bytes(t, 'ascii'))
try:
exec(t, {'np':np})
except:
# If the exec fails, then... | import generator
from ctypes import CDLL
import numpy as np
# Initializes the harness and sets it up for work
harness = CDLL("harness/harness.so")
while True:
t = generator.generate()
harness.register_testcase(t)
try:
exec(t, {'np':np})
except:
# If the exec fails, then we should not s... | apache-2.0 | Python |
af3c3c6aa20b00559c0c1fd50529e94d4b310d1f | Update test_oneview_appliance_ssh_access_facts.py | HewlettPackard/oneview-ansible,HewlettPackard/oneview-ansible | test/test_oneview_appliance_ssh_access_facts.py | test/test_oneview_appliance_ssh_access_facts.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2021) Hewlett Packard Enterprise Development LP
#
# 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/L... | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2021) Hewlett Packard Enterprise Development LP
#
# 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/L... | apache-2.0 | Python |
b017eadf3b797ffd220ceb3ce672bcbc6ce37b86 | Rename documents | n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb | intern/urls.py | intern/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'dokumente/$', views.documents, name='documents'),
] | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'documents/$', views.documents, name='documents'),
] | mit | Python |
6eeb2189a3c454a4467a819fa5307ff107945ef5 | Support relative image urls | easton402/pinax-blog,swilcox/pinax-blog,salamer/pinax-blog,easton402/pinax-blog,miurahr/pinax-blog,swilcox/pinax-blog,pinax/pinax-blog,pinax/pinax-blog,pinax/pinax-blog,cdvv7788/pinax-blog,miurahr/pinax-blog | biblion/parsers/markdown_parser.py | biblion/parsers/markdown_parser.py | from markdown import Markdown
from markdown.inlinepatterns import ImagePattern, IMAGE_LINK_RE
from biblion.models import Image
class ImageLookupImagePattern(ImagePattern):
def sanitize_url(self, url):
if url.startswith("http"):
return url
else:
try:
image ... | from markdown import Markdown
from markdown.inlinepatterns import ImagePattern, IMAGE_LINK_RE
from biblion.models import Image
class ImageLookupImagePattern(ImagePattern):
def sanitize_url(self, url):
if url.startswith("http"):
return url
else:
try:
image ... | mit | Python |
07ce46668f4cf647af075d6a33875faefd895458 | remove kb icon and module | saurabh6790/frappe,paurosello/frappe,mhbu50/frappe,saurabh6790/frappe,almeidapaulopt/frappe,maxtorete/frappe,bohlian/frappe,vjFaLk/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,paurosello/frappe,tundebabzy/frappe,bcornwellmott/frappe,elba7r/builder,elba7r/frameworking,maxtorete/frappe,tmimori/frappe,rohitwaghchaur... | frappe/patches/v7_2/merge_knowledge_base.py | frappe/patches/v7_2/merge_knowledge_base.py | import frappe
from frappe.patches.v7_0.re_route import update_routes
from frappe.installer import remove_from_installed_apps
def execute():
if 'knowledge_base' in frappe.get_installed_apps():
frappe.reload_doc('website', 'doctype', 'help_category')
frappe.reload_doc('website', 'doctype', 'help_article')
update... | import frappe
from frappe.patches.v7_0.re_route import update_routes
from frappe.installer import remove_from_installed_apps
def execute():
if 'knowledge_base' in frappe.get_installed_apps():
frappe.reload_doc('website', 'doctype', 'help_category')
frappe.reload_doc('website', 'doctype', 'help_article')
update... | mit | Python |
b7a03edf25af35f131b90df74e5724ae8ef52536 | Add eager query to cycle task groups | jmakov/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,jmakov/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,j... | src/ggrc_workflows/models/cycle_task_group.py | src/ggrc_workflows/models/cycle_task_group.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from sqlalchemy import orm
from ggrc import db
from ggrc.models.mixins import (
... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc import db
from ggrc.models.mixins import (
Base, Titled, Described,... | apache-2.0 | Python |
989f7fbb7c8b3f17137249eaeedc4f0be99e0ada | Add make_ordinal function | NewAcropolis/api,NewAcropolis/api,NewAcropolis/api | app/utils/time.py | app/utils/time.py | from datetime import datetime
import pytz
TIMEZONE_STR = 'Europe/London'
TIMEZONE = pytz.timezone(TIMEZONE_STR)
def get_local_time(dt):
tz_local = pytz.timezone(TIMEZONE_STR)
return dt.replace(tzinfo=pytz.utc).astimezone(tz_local)
def make_ordinal(n):
n = int(n)
suffix = ['th', 'st', 'nd', 'rd', 't... | from datetime import datetime
import pytz
TIMEZONE_STR = 'Europe/London'
TIMEZONE = pytz.timezone(TIMEZONE_STR)
def get_local_time(dt):
tz_local = pytz.timezone(TIMEZONE_STR)
return dt.replace(tzinfo=pytz.utc).astimezone(tz_local)
| mit | Python |
9451b7958a6e9b63b8e67a4f79abfd1688a7ff32 | Fix test_memory.py | fsspec/filesystem_spec,fsspec/filesystem_spec,intake/filesystem_spec | fsspec/implementations/tests/test_memory.py | fsspec/implementations/tests/test_memory.py | import pytest
import sys
def test_1(m):
m.touch("/somefile") # NB: is found with or without initial /
m.touch("afiles/and/anothers")
files = m.find("")
if "somefile" in files:
assert files == ["afiles/and/anothers", "somefile"]
else:
assert files == ["/somefile", "afiles/and/anoth... | import pytest
import sys
def test_1(m):
m.touch("/somefile") # NB: is found with or without initial /
m.touch("afiles/and/anothers")
assert m.find("") == ["afiles/and/anothers", "somefile"]
assert list(m.get_mapper("")) == ["afiles/and/anothers", "somefile"]
@pytest.mark.xfail(
sys.version_info... | bsd-3-clause | Python |
954cd7a418736716d1cd3ffa45632d3f453a2623 | Bump 1.3.0 | appium/python-client,appium/python-client | appium/version.py | appium/version.py | version = '1.3.0'
| version = '1.2.0'
| apache-2.0 | Python |
b14dc4285348a671da0f8b013ac72a77841ff04d | Bump 2.1.0 | appium/python-client,appium/python-client | appium/version.py | appium/version.py | version = '2.1.0'
| version = '2.0.0'
| apache-2.0 | Python |
27723753dd2c96bedbd9c7fe253d337aa7f5fb9f | bump version number for pypi | google/jax,google/jax,google/jax,tensorflow/probability,google/jax,tensorflow/probability | jax/version.py | jax/version.py | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
b8d4cb43afc6823f0c41fbe5a930850d6126a676 | Modify fmri test so we don't get the NoneType deletion error in pynifti. | alexis-roche/register,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/niseg,bthirion/nipy,alexis-roche/niseg,bthirion/nipy,bthirion/nipy,alexis-roche/register,alexis-roche/nipy,nipy/nipy-labs,arokem/nipy,arokem/nipy,alexis-roche/nipy,alexis-roche/nireg,nipy/nireg,alexis-roche/nireg,alexis-roche/nipy,alexis-roche/register... | neuroimaging/modalities/fmri/tests/test_fmri.py | neuroimaging/modalities/fmri/tests/test_fmri.py | import gc, os
from tempfile import mkstemp
import warnings
import numpy as np
import nose.tools
import neuroimaging.core.reference.coordinate_map as coordinate_map
from neuroimaging.modalities.fmri.api import FmriImageList, fmri_generator, fromimage
from neuroimaging.core.api import Image, data_generator, parcels, f... | import gc, os
from tempfile import mkstemp
import warnings
import numpy as np
import nose.tools
import neuroimaging.core.reference.coordinate_map as coordinate_map
from neuroimaging.modalities.fmri.api import FmriImageList, fmri_generator, fromimage
from neuroimaging.core.api import Image, data_generator, parcels
fr... | bsd-3-clause | Python |
2fc83b5d53ab96b97d7027c2e9a4c4d75bf1e9a6 | Fix escaping of the embed `<iframe>`'s `src` attribute | sim642/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate | reddit_liveupdate/scraper.py | reddit_liveupdate/scraper.py | import urllib
import urlparse
from pylons import g, c
from r2.lib.hooks import HookRegistrar
from r2.lib.media import Scraper, MediaEmbed
from r2.lib.template_helpers import format_html
from r2.lib.utils import UrlParser
hooks = HookRegistrar()
_EMBED_TEMPLATE = """
<div class="psuedo-selftext">
<iframe src="%(ur... | import urllib
import urlparse
from pylons import g, c
from r2.lib.hooks import HookRegistrar
from r2.lib.media import Scraper, MediaEmbed
from r2.lib.utils import UrlParser
hooks = HookRegistrar()
_EMBED_TEMPLATE = """
<div class="psuedo-selftext">
<iframe src="{url}" height="{height}"></iframe>
</div>
"""
clas... | bsd-3-clause | Python |
f7a03a37caf5b1ddb702dee9a06b3f2c215f635d | Remove unnecessary param | akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr | akvo/rsr/management/commands/fix_project_hierarchy_missing_periods.py | akvo/rsr/management/commands/fix_project_hierarchy_missing_periods.py | # -*- coding: utf-8 -*-
# Akvo Reporting is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from django.core.management.bas... | # -*- coding: utf-8 -*-
# Akvo Reporting is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from django.core.management.bas... | agpl-3.0 | Python |
bc22dbd750228c546bdf47b26957154448bb2c5b | Add line break to allowed HTML tags | hugoatease/atrium,hugoatease/atrium,hugoatease/atrium | atrium/api/bleachconfig.py | atrium/api/bleachconfig.py | import bleach
ALLOWED_TAGS = bleach.ALLOWED_TAGS + [
'div', 'span', 's', 'u', 'img', 'br'
]
ALLOWED_STYLES = bleach.ALLOWED_STYLES + [
'font-weight', 'font-family', 'font-size'
]
ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES
ALLOWED_ATTRIBUTES['*'] = ['style']
| import bleach
ALLOWED_TAGS = bleach.ALLOWED_TAGS + [
'div', 'span', 's', 'u', 'img'
]
ALLOWED_STYLES = bleach.ALLOWED_STYLES + [
'font-weight', 'font-family', 'font-size'
]
ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES
ALLOWED_ATTRIBUTES['*'] = ['style'] | apache-2.0 | Python |
1dfcd2ada2057a6478186275bdec8649def87a5b | Work on figuring out the trestle tile position format | openslide/openslide,openslide/openslide,openslide/openslide,openslide/openslide | misc/decode-trestle-tile-position.py | misc/decode-trestle-tile-position.py | #!/usr/bin/python
import struct, sys, os
f = open(sys.argv[1])
i = 0
def printX(bb):
print ("%5.02x" * 32) % bb
def printB(bb):
print ("%5d" * 32) % bb
def printH(hh):
print ("%10d" * 16) % hh
def printI(ii):
print ("%20d" * 8) % ii
def printF(ff):
print ("%20g" * 8) % ff
def printD(dd):
... | #!/usr/bin/python
import struct, sys, os
f = open(sys.argv[1])
i = 0
def printX(bb):
print ("%5.02x" * 32) % bb
def printB(bb):
print ("%5d" * 32) % bb
def printH(hh):
print ("%10d" * 16) % hh
def printI(ii):
print ("%20d" * 8) % ii
def printF(ff):
print ("%20g" * 8) % ff
def printD(dd):
... | lgpl-2.1 | Python |
6584f0dcbc8d8c28572ba31f84c2a3985f389d2c | Adjust tests with mock_methods | marcelometal/thumbor,abaldwin1/thumbor,gi11es/thumbor,abaldwin1/thumbor,abaldwin1/thumbor,kkopachev/thumbor,fanhero/thumbor,marcelometal/thumbor,okor/thumbor,scorphus/thumbor,davduran/thumbor,gi11es/thumbor,voxmedia/thumbor,Bladrak/thumbor,davduran/thumbor,fanhero/thumbor,marcelometal/thumbor,voxmedia/thumbor,gi11es/th... | tests/loaders/test_file_loader_http_fallback.py | tests/loaders/test_file_loader_http_fallback.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from mock import patch
from os.path import abspath, join, dirname
fr... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import abspath, join, dirname
from unittest import Test... | mit | Python |
4e4df9a0bc077aeb373b8cdaaddf31045a7e6dea | Revert "cache get_last_synclog_for_user" | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/ex-submodules/casexml/apps/phone/dbaccessors/sync_logs_by_user.py | corehq/ex-submodules/casexml/apps/phone/dbaccessors/sync_logs_by_user.py | from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import get_db
def get_last_synclog_for_user(user_id):
results = synclog_view(
"phone/sync_logs_by_user",
startkey=[user_id, {}],
endkey=[user_id],
descending=True,
limit=1,
reduce=False,
... | from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import get_db
from corehq.util.quickcache import quickcache
@quickcache(['user_id'], timeout=60 * 60)
def get_last_synclog_for_user(user_id):
results = synclog_view(
"phone/sync_logs_by_user",
startkey=[user_id, {}],
... | bsd-3-clause | Python |
d2946f21770acee419de46e52e8a1da1006e8d64 | remove debug print | freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut | tests/twisted/avahi/tubes-to-nonexistant-ids.py | tests/twisted/avahi/tubes-to-nonexistant-ids.py | """
Test that requests for Tubes and StreamTube channels to ids which aren't
actually on the network fail gracefully with NotAvailable
"""
from saluttest import exec_test
from constants import (
HT_CONTACT, CONN_IFACE_REQUESTS,
CHANNEL_TYPE, TARGET_HANDLE_TYPE, TARGET_HANDLE,
CHANNEL_TYPE_TUBES, CHANNEL_T... | """
Test that requests for Tubes and StreamTube channels to ids which aren't
actually on the network fail gracefully with NotAvailable
"""
from saluttest import exec_test
from constants import (
HT_CONTACT, CONN_IFACE_REQUESTS,
CHANNEL_TYPE, TARGET_HANDLE_TYPE, TARGET_HANDLE,
CHANNEL_TYPE_TUBES, CHANNEL_T... | lgpl-2.1 | Python |
acf94d9c317bf5de01eca8dbd7f9e5d1e7f94eb4 | Add channel specific link | metabrainz/botbot-web,metabrainz/botbot-web,metabrainz/botbot-web | botbot/apps/plugins/core/logger.py | botbot/apps/plugins/core/logger.py | from botbot.apps.logs.models import Log
from botbot.apps.plugins.utils import convert_nano_timestamp
from botbot_plugins.base import BasePlugin
import botbot_plugins.config as config
class Config(config.BaseConfig):
ignore_prefix = config.Field(
default="!-",
required=False,
help_text="Don'... | from botbot.apps.logs.models import Log
from botbot.apps.plugins.utils import convert_nano_timestamp
from botbot_plugins.base import BasePlugin
import botbot_plugins.config as config
class Config(config.BaseConfig):
ignore_prefix = config.Field(
default="!-",
required=False,
help_text="Don'... | mit | Python |
c13dccc27e9b5fdedf7f316b01725e159b3684d0 | use `npm ci` instead of `npm install` (#49) | googleapis/google-cloud-node,googleapis/google-cloud-node,googleapis/google-cloud-node,googleapis/google-cloud-node | packages/google-cloud-bigquery-datatransfer/synth.py | packages/google-cloud-bigquery-datatransfer/synth.py | import synthtool as s
import synthtool.gcp as gcp
import logging
from pathlib import Path
import subprocess
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
# tasks has two product names, and a poorly named artman yaml
version = 'v1'
library = gapic.node_library(
'bigquerydatatransfer', ver... | import synthtool as s
import synthtool.gcp as gcp
import logging
from pathlib import Path
import subprocess
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
# tasks has two product names, and a poorly named artman yaml
version = 'v1'
library = gapic.node_library(
'bigquerydatatransfer', ver... | apache-2.0 | Python |
627729380b8fbd6d1b4e4eec0362418dbf698d55 | Change url to get stable version number | roramirez/qpanel,roramirez/qpanel,skazancev/qpanel,skazancev/qpanel,skazancev/qpanel,roramirez/qpanel,roramirez/qpanel,skazancev/qpanel | libs/qpanel/upgrader.py | libs/qpanel/upgrader.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
from urllib2 import Request, urlopen
from distutils.version import LooseVersion
BRANCH = 'stable'
REPO = 'git@github.com:roramirez/qpanel.git'
URL_STABLE_VERSION = 'https://rodrigoramirez.com/qpanel/version/' + BR... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
from urllib2 import Request, urlopen
from distutils.version import LooseVersion
BRANCH = 'stable'
REPO = 'git@github.com:roramirez/qpanel.git'
URL_STABLE_VERSION = 'https://raw.githubusercontent.com/roramirez/qpan... | mit | Python |
fbaf599135aeda2616c74501d1c7901aec75acca | Add avatar to EmployeeSerializer | belatrix/BackendAllStars | employees/serializers.py | employees/serializers.py | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | apache-2.0 | Python |
e817936eee869be072bde563642b4cc22e46f2be | Update constants.py | pathakvaidehi2391/WorkSpace,pathakvaidehi2391/WorkSpace | azurecloudify/constants.py | azurecloudify/constants.py | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | apache-2.0 | Python |
2f811a16f905e721ec50375b2999d07d8d232613 | update girder id for unit test | DigitalSlideArchive/HistomicsTK,DigitalSlideArchive/HistomicsTK | histomicstk/saliency/tests/cellularity_detection_thresholding_test.py | histomicstk/saliency/tests/cellularity_detection_thresholding_test.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 09:47:52 2019.
@author: mtageld
"""
import unittest
import tempfile
import shutil
import girder_client
# import numpy as np
from pandas import read_csv
from histomicstk.annotations_and_masks.annotation_and_mask_utils import (
delete_annotatio... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 09:47:52 2019.
@author: mtageld
"""
import unittest
import tempfile
import shutil
import girder_client
# import numpy as np
from pandas import read_csv
from histomicstk.annotations_and_masks.annotation_and_mask_utils import (
delete_annotatio... | apache-2.0 | Python |
c2c1f255ce0ab7f9ea5d322d00fea4be0bf7fe95 | Update ipc_lista2.01.py | any1m1c/ipc20161 | lista2/ipc_lista2.01.py | lista2/ipc_lista2.01.py | #ipc_lista2.1
#Professor: Jucimar
| #ipc_lista2.1
#Professor
| apache-2.0 | Python |
38bea29c326a64761cc42a304288fa6049f6bf27 | Update ipc_lista2.02.py | any1m1c/ipc20161 | lista2/ipc_lista2.02.py | lista2/ipc_lista2.02.py | #ipc_lista2.02
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça um valor e mostre na tela se o valor é
| #ipc_lista2.02
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça um valor e mostre na tela se o valor
| apache-2.0 | Python |
c6addf983a79861c32f985ba5343a222112a5661 | Update ipc_lista2.06.py | any1m1c/ipc20161 | lista2/ipc_lista2.06.py | lista2/ipc_lista2.06.py | #ipc_lista2.06
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que leia três números e mostre o maior deles.
num1 = int(input("Insira um numero: ")
num2 = int(input("Insira outro numero: ")
num3 = int(input("Insira mais um numero: ")
if num1>num2
if
if num2>num1
if
if nu... | #ipc_lista2.06
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que leia três números e mostre o maior deles.
num1 = int(input("Insira um numero: ")
num2 = int(input("Insira outro numero: ")
num3 = int(input("Insira mais um numero: ")
if num1>num2
if num2>num1
if num3>num1
| apache-2.0 | Python |
a8ccc2b805097622b06dad52ad61e01fe5ae9437 | Update ipc_lista2.06.py | any1m1c/ipc20161 | lista2/ipc_lista2.06.py | lista2/ipc_lista2.06.py | #ipc_lista2.06
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que leia três números e mostre o maior deles.
number1 = int(input("Insira um numero: ")
number2 = int(input("Insira outro numero: ")
number3 = int(input("Insira mais um numero: ")
if n1>n2
if n2>n1
if n3>n2
| #ipc_lista2.06
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que leia três números e mostre o maior deles.
number1 = int(input("Insira um numero: ")
number2 = int(input("Insira outro numero: ")
number3 = int(input("Insira mais um numero: ")
if n1>n2
if n2>n1
if
| apache-2.0 | Python |
28328a7bea2910d705fe8853fea5620b3243ff7f | Fix bug in tool-info module for Veriabs, it must not change the passed list options. | sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,IljaZakharov/benchexec,martin-neuhaeusser/benchexec,martin-neuhaeusser/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,martin-neuhaeusser/benchexec,ultimate-pa/ben... | benchexec/tools/veriabs.py | benchexec/tools/veriabs.py | """
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
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
... | """
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
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
... | apache-2.0 | Python |
f49757518833785c15e5c08b91035d67ff4a91dd | Refactor shakyo.__main__ | raviqqe/shakyo | shakyo/__main__.py | shakyo/__main__.py | #!/usr/bin/env python
import sys
from . import consolekit as ck
from . import arggetter
from . import path_to_x
from . import pygments_util
from . import shakyo
from . import text_to_lines
from . import log
def get_example_lines(example_path,
console,
*,
... | #!/usr/bin/env python
import sys
from . import consolekit as ck
from . import arggetter
from . import path_to_x
from . import pygments_util
from . import shakyo
from . import text_to_lines
from . import log
# main routine
def main():
args = arggetter.get_args()
if not sys.stdout.isatty(): log.error("stdout i... | unlicense | Python |
55f9566bb6a823ad504913d8b17e10c377e47391 | brush up engine | vuphan314/LED,vuphan314/LED | src/led_engine.py | src/led_engine.py | """LED engine.
Translate an LED program into
a semantically equivalent SL program.
"""
############################################################
import argparse
import os
import sys
import time
from debugtools.debug_tool import *
import led_parser
import led_translator
import led_weaver
########################... | """LED engine.
Translate an LED program into
a semantically equivalent SL program.
"""
############################################################
"""Import."""
import argparse
import os
import sys
import time
from debugtools.debug_tool import *
import led_parser
import led_translator
import led_weaver
##########... | mit | Python |
798a716cb6c3acd6e636d3b9cab755950ead5539 | Fix process_voting_round to reflect contract model | WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder | Seeder/voting/signals.py | Seeder/voting/signals.py | # pylint: disable=W0613
from django.dispatch import receiver
from django.db.models.signals import post_save
from voting import constants
from source.models import Source
from voting.models import VotingRound
from source import constants as source_constants
from contracts.models import Contract
@receiver(signal=post_... | # pylint: disable=W0613
from django.dispatch import receiver
from django.db.models.signals import post_save
from voting import constants
from source.models import Source
from voting.models import VotingRound
from source import constants as source_constants
from contracts.models import Contract
@receiver(signal=post_... | mit | Python |
4c9200ed39ff9a9356bbb29cab1331a2debb5600 | Add support in cue_dump for Cue's tags | world-federation-of-advertisers/cross-media-measurement,world-federation-of-advertisers/cross-media-measurement,world-federation-of-advertisers/cross-media-measurement | src/main/k8s/macros.bzl | src/main/k8s/macros.bzl | # Copyright 2020 The Cross-Media Measurement 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 ... | # Copyright 2020 The Cross-Media Measurement 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 ... | apache-2.0 | Python |
856207c8399d94e99a6f2ffb1e10befecb6150cf | Fix line endings in CSV and stdout typo | geometalab/osm2vectortiles,geometalab/osm2vectortiles,osm2vectortiles/osm2vectortiles,osm2vectortiles/osm2vectortiles | src/generate-jobs/calculate_quad_key.py | src/generate-jobs/calculate_quad_key.py | #!/usr/bin/env python
"""Calculate QuadKey for TSV file and append it as column
Usage:
calculate_quad_key.py <list_file>
calculate_quad_key.py (-h | --help)
calculate_quad_key.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
impor... | #!/usr/bin/env python
"""Calculate QuadKey for TSV file and append it as column
Usage:
calculate_quad_key.py <list_file>
calculate_quad_key.py (-h | --help)
calculate_quad_key.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
import system
im... | mit | Python |
473fc0bc89910b2a199d6c0b70961f8eee4993bf | Fix styles | toslunar/chainerrl,toslunar/chainerrl | chainerrl/explorers/additive_ou.py | chainerrl/explorers/additive_ou.py | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
from logging import getLogger
from chainer import cuda
import numpy... | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from logging import getLogger
from chainer import cuda
import numpy as np
from chainerrl import e... | mit | Python |
0d84a6dcd82f98624fc02827076e3618c5fa6790 | 优化 infoQ 爬虫 | dyingbleed/zhangxinyun-scrapy,zhangxinyun/zhangxinyun-scrapy | zhangxinyun_scrapy/spiders/infoq.py | zhangxinyun_scrapy/spiders/infoq.py | from urlparse import urlparse
import re
from scrapy import Request
from scrapy.spiders import XMLFeedSpider
from bs4 import BeautifulSoup
from ..items import ArticleItem
class InfoQSpider(XMLFeedSpider):
name = 'infoq'
allowed_domains = ['infoq.com']
start_urls = ['http://www.infoq.com/cn/feed']
iter... | # -*- coding: utf-8 -*-
import scrapy
from zhangxinyun_scrapy.items import ArticleItem
class InfoqSpider(scrapy.Spider):
name = "infoq"
allowed_domains = ["infoq.com"]
def __init__(self, category=None, *args, **kwargs):
super(InfoqSpider, self).__init__(*args, **kwargs)
self.start_urls = ... | mit | Python |
5fd9bdcb49681cfbeb795738ddc0bb89c48c3aac | fix bug where pictures for a new collection wouldn't save | Datateknologerna-vid-Abo-Akademi/date-website,Datateknologerna-vid-Abo-Akademi/date-website,Datateknologerna-vid-Abo-Akademi/date-website,Datateknologerna-vid-Abo-Akademi/date-website | archive/forms.py | archive/forms.py | from django import forms
from .models import Collection, Picture, Document
class PictureUploadForm(forms.Form):
album = forms.CharField()
images = forms.ImageField(required=False, widget=forms.ClearableFileInput(attrs={'multiple': True}))
class PictureAdminForm(forms.ModelForm):
images = forms.FileField... | from django import forms
from .models import Collection, Picture, Document
class PictureUploadForm(forms.Form):
album = forms.CharField()
images = forms.ImageField(required=False, widget=forms.ClearableFileInput(attrs={'multiple': True}))
class PictureAdminForm(forms.ModelForm):
images = forms.FileField... | cc0-1.0 | Python |
81f2a827d8e1cb9711d1e45dc7d98eadfdffdaf0 | Fix 2.5 breakage | gratipay/aspen.py,gratipay/aspen.py | aspen/logging.py | aspen/logging.py | """Aspen logging. It's simple.
There are log and log_dammit functions that take arbitrary positional
arguments, stringify them, write them to stdout, and flush stdout. Each line
written is prepended with process and thread identifiers. The philosophy is
that additional abstraction layers above Aspen can handle timesta... | """Aspen logging. It's simple.
There are log and log_dammit functions that take arbitrary positional
arguments, stringify them, write them to stdout, and flush stdout. Each line
written is prepended with process and thread identifiers. The philosophy is
that additional abstraction layers above Aspen can handle timesta... | mit | Python |
8aa22a13b9d32ccdd7c32ff9c29f6b87d4eb1c8e | Bump version | Farama-Foundation/Gymnasium,dianchen96/gym,dianchen96/gym,Farama-Foundation/Gymnasium | gym/version.py | gym/version.py | VERSION = '0.4.5'
| VERSION = '0.4.4'
| mit | Python |
659bab1555895dc5cd4b0cb7e55f66175e161b2c | PUT vs POST | StackStorm/st2contrib,StackStorm/st2contrib,pearsontechnology/st2contrib,armab/st2contrib,tonybaloney/st2contrib,pearsontechnology/st2contrib,tonybaloney/st2contrib,pearsontechnology/st2contrib,tonybaloney/st2contrib,psychopenguin/st2contrib,lmEshoo/st2contrib,lmEshoo/st2contrib,digideskio/st2contrib,armab/st2contrib,p... | packs/smartthings/sensors/smartthings_sensor.py | packs/smartthings/sensors/smartthings_sensor.py | import eventlet
import json
from flask import json, Flask
from st2reactor.sensor.base import Sensor
eventlet.monkey_patch(
os=True,
select=True,
socket=True,
thread=True,
time=True)
class SmartThingsSensor(Sensor):
def __init__(self, sensor_service, config=None):
super(SmartThingsSens... | import eventlet
import json
from flask import json, Flask
from st2reactor.sensor.base import Sensor
eventlet.monkey_patch(
os=True,
select=True,
socket=True,
thread=True,
time=True)
class SmartThingsSensor(Sensor):
def __init__(self, sensor_service, config=None):
super(SmartThingsSens... | apache-2.0 | Python |
4e6043e05e2270a86409365b407674db43eff231 | Migrate lightwave light to ColorMode (#70849) | w1ll1am23/home-assistant,toddeye/home-assistant,mezz64/home-assistant,nkgilley/home-assistant,nkgilley/home-assistant,mezz64/home-assistant,toddeye/home-assistant,w1ll1am23/home-assistant | homeassistant/components/lightwave/light.py | homeassistant/components/lightwave/light.py | """Support for LightwaveRF lights."""
from __future__ import annotations
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from h... | """Support for LightwaveRF lights."""
from __future__ import annotations
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import ... | apache-2.0 | Python |
f8eabe98c56f9b13887362cdf5de658582963bdb | test mongo | freeslugs/hacknyfall2014 | app.py | app.py | import requests
from flask import Flask, request
from flask.ext import restful
from flask.ext.mongoengine import MongoEngine
app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {'DB': "hacknyfall2014"}
connect('hacknyfall2014', host='mongodb://columbia:giladabc@ds047040.mongolab.com:47040/hacknyfall2014')
api = re... | import requests
from flask import Flask, request
from flask.ext import restful
from flask.ext.mongoengine import MongoEngine
app = Flask(__name__)
api = restful.Api(app)
db = MongoEngine(app)
### USER GUI ###
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/instagram-redirect')
def instagram... | apache-2.0 | Python |
56a25d77d24f994c3ea9bea33059aed4781eaef3 | initialize Flask with static_folder=None for flask-gae-static 1.0 (snarfed/flask-gae-static@daabc99b364861c817178f1b6d6ad26df379e38e) | snarfed/oauth-dropins,snarfed/oauth-dropins,snarfed/oauth-dropins | app.py | app.py | """Example oauth-dropins app. Serves the front page and discovery files.
"""
import importlib
import logging
import urllib.parse
from flask import Flask, render_template, request
import flask
import flask_gae_static
from google.cloud import ndb
from oauth_dropins.webutil import flask_util, util
import requests
from we... | """Example oauth-dropins app. Serves the front page and discovery files.
"""
import importlib
import logging
import urllib.parse
from flask import Flask, render_template, request
import flask
import flask_gae_static
from google.cloud import ndb
from oauth_dropins.webutil import flask_util, util
import requests
from we... | unlicense | Python |
9a00780cdf7bd115ead2b0aa74e6fbc53edea79e | Update example app | christabor/flask_jsondash,christabor/flask_jsondash,christabor/flask_jsondash | app.py | app.py | """This is your typical app, demonstrating usage."""
from flask_jsondash.charts_builder import charts
from flask import Flask
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.debug = True
app.register_blueprint(charts)
@app.route('/', methods=['GET'])
def index():
"""Sample index."""
re... | """This is your typical app, demonstrating usage."""
from charts_builder.charts_builder import charts
from flask import Flask
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.debug = True
app.register_blueprint(charts)
@app.route('/', methods=['GET'])
def index():
"""Sample index."""
re... | mit | Python |
74fdffc5fec09ee8040af6084e0486352494b168 | Add exception classes | amalshehu/exercism-python | circular-buffer/circular_buffer.py | circular-buffer/circular_buffer.py | # File: circular_buffer.py
# Purpose: A data structure that uses a single, fixed-size buffer
# as if it were connected end-to-end.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 29 September 2016, 10:48 PM
class CircularBuffer(object):
def __init__(self, size_ma... | # File: circular_buffer.py
# Purpose: A data structure that uses a single, fixed-size buffer
# as if it were connected end-to-end.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 29 September 2016, 10:48 PM
class CircularBuffer(object):
def __init__(self, size_ma... | mit | Python |
8f11eeddb3705842eb44c0c008e8e5aaff171f0b | Update ut_settings.py | gregoil/rotest | src/rotest/common/django_utils/ut_settings.py | src/rotest/common/django_utils/ut_settings.py | """Django configuration file for developement."""
# pylint: disable=wildcard-import,unused-wildcard-import,protected-access
import platform
from rotest.common import core_log
from settings_common import *
INSTALLED_APPS = ('rotest.core',
'rotest.management',
# Administrator Relat... | """Django configuration file for developement."""
# pylint: disable=wildcard-import,unused-wildcard-import,protected-access
import platform
from rotest.common import core_log
from settings_common import *
INSTALLED_APPS = ('rotest.core',
'rotest.management',
# Administrator Relat... | mit | Python |
b5138d39568a1598ee0c73bd8639c016a22da9eb | fix pool example | aio-libs/aioodbc,jettify/aioodbc | examples/example_pool.py | examples/example_pool.py | import asyncio
import aioodbc
loop = asyncio.get_event_loop()
async def test_pool():
dsn = 'Driver=SQLite;Database=sqlite.db'
pool = await aioodbc.create_pool(dsn=dsn, loop=loop)
async with pool.get() as conn:
cur = await conn.cursor()
await cur.execute("SELECT 42;")
r = await c... | import asyncio
import aioodbc
loop = asyncio.get_event_loop()
async def test_pool():
dsn = 'Driver=SQLite;Database=sqlite.db'
pool = await aioodbc.create_pool(dsn=dsn, loop=loop)
async with pool.get as conn:
cur = await conn.cursor()
await cur.execute("SELECT 42;")
r = await cur... | apache-2.0 | Python |
74ce850d7db766328e2931f5a8119b7e2e5b1ded | Switch to main method in examples | ALSchwalm/sparqllib | examples/basic_example.py | examples/basic_example.py | #!/usr/bin/env python
'''
A simple script using sparqllib and rdflib to retrieve a JSON representation
of some information about Barack Obama from dbpedia.
'''
from sparqllib import Query
from rdflib import BNode, Literal
from rdflib.namespace import FOAF
from pprint import pprint
def main():
# construct the que... | #!/usr/bin/env python
'''
A simple script using sparqllib and rdflib to retrieve a JSON representation
of some information about Barack Obama from dbpedia.
'''
from sparqllib import Query
from rdflib import BNode, Literal
from rdflib.namespace import FOAF
from pprint import pprint
if __name__ == "__main__":
# co... | mit | Python |
a4dc3f427cdb18a68ecca412bc048272f9a7c151 | Update identity_api.py | datasift/datasift-python | examples/identity_api.py | examples/identity_api.py | from __future__ import print_function
import time
from datasift import Client
import json
user_name = "your username"
api_key = "your API key"
datasift = Client(user_name, api_key, False)
print("Create an identity for a customer")
identity = datasift.account.identity.create('Customer name')
print(identity)
print("U... | from __future__ import print_function
import time
from datasift import Client
import json
user_name = "your username"
api_key = "your API key"
datasift = Client(user_name, api_key, False)
print("Create an identity for a customer")
identity = datasift.account.identity.create('Customer name')
print(identity)
print("U... | mit | Python |
067b6fd26fb8f420d4bd8a24f5947501a7dc9a93 | Fix numba deprecation in count_multiplicities | tamasgal/km3pipe,tamasgal/km3pipe | km3modules/hits.py | km3modules/hits.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:set ts=4 sts=4 sw=4 et:
"""
Functions and modules to work with hits.
"""
from __future__ import absolute_import, print_function, division
import numpy as np
import km3pipe as kp
log = kp.logger.get_logger(__name__)
try:
from numba import jit
except ImportError:... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:set ts=4 sts=4 sw=4 et:
"""
Functions and modules to work with hits.
"""
from __future__ import absolute_import, print_function, division
import numpy as np
import km3pipe as kp
log = kp.logger.get_logger(__name__)
try:
from numba import jit
except ImportError:... | mit | Python |
5808978363cbd4647184a919bff38dc3df9258f3 | Bump version to 5.6.0 | mindbender-studio/core,getavalon/core,mindbender-studio/core,getavalon/core | avalon/version.py | avalon/version.py | """Version includes the Git revision number
This module separates between deployed and development versions of allzpark.
A development version draws its minor version directly from Git, the total
number of commits on the current branch equals the revision number. Once
deployed, this number is embedded into the Python ... | """Version includes the Git revision number
This module separates between deployed and development versions of allzpark.
A development version draws its minor version directly from Git, the total
number of commits on the current branch equals the revision number. Once
deployed, this number is embedded into the Python ... | mit | Python |
ee49f4f592cf04199f9d82c2da2af9e34dd1d9d4 | Add error handling to station endpoint | flyinactor91/AVWX-API,flyinactor91/AVWX-API,flyinactor91/AVWX-API | avwx_api/views.py | avwx_api/views.py | """
Michael duPont - michael@mdupont.com
avwx_api.views - Routes and views for the Quart application
"""
# pylint: disable=W0702
# stdlib
from dataclasses import asdict
# library
import avwx
from quart import Response, jsonify
from quart_openapi.cors import crossdomain
# module
from avwx_api import app
# Static Web ... | """
Michael duPont - michael@mdupont.com
avwx_api.views - Routes and views for the Quart application
"""
# pylint: disable=W0702
# stdlib
from dataclasses import asdict
# library
import avwx
from quart import Response, jsonify
from quart_openapi.cors import crossdomain
# module
from avwx_api import app
# Static Web ... | mit | Python |
e00877911168b68faa1d395efa533eab473eea05 | Add in import and make sure to set the timezone on parsed time | oldarmyc/anchor,oldarmyc/anchor,oldarmyc/anchor | anchor/context_functions.py | anchor/context_functions.py | # Copyright 2014 Dave Kludt
#
# 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, s... | # Copyright 2014 Dave Kludt
#
# 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, s... | apache-2.0 | Python |
dfe9a527b4d05f17a3b9cbf22e485e7f1a1927bc | add charithm-mac to ping_slack | ithemal/Ithemal,ithemal/Ithemal,ithemal/Ithemal,ithemal/Ithemal,ithemal/Ithemal | aws/ping_slack.py | aws/ping_slack.py | #!/usr/bin/env python
import argparse
import json
import subprocess
import urllib2
import os
from typing import Optional
WEBHOOK_URL = 'https://hooks.slack.com/services/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'
SLACK_USERNAME = 'AWS'
SLACK_CHANNEL = 'aws-notifications'
SLACK_ICON = 'https://raw.githubusercontent.... | #!/usr/bin/env python
import argparse
import json
import subprocess
import urllib2
import os
from typing import Optional
WEBHOOK_URL = 'https://hooks.slack.com/services/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'
SLACK_USERNAME = 'AWS'
SLACK_CHANNEL = 'aws-notifications'
SLACK_ICON = 'https://raw.githubusercontent.... | mit | Python |
4402f950c52a123c72d101aa379372d69e9ec722 | Make modules uninstallable | brain-tec/l10n-switzerland,brain-tec/l10n-switzerland,brain-tec/l10n-switzerland,BT-jmichaud/l10n-switzerland | l10n_ch_pain_credit_transfer/__openerp__.py | l10n_ch_pain_credit_transfer/__openerp__.py | # -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Switzerland - PAIN Credit Transfer",
"summary": "Generate ISO 20022 credit transfert (SEPA and not SEPA)",
"version": "9.0.1.0.0",
"cate... | # -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Switzerland - PAIN Credit Transfer",
"summary": "Generate ISO 20022 credit transfert (SEPA and not SEPA)",
"version": "9.0.1.0.0",
"cate... | agpl-3.0 | Python |
ce8ea142b7e35e71ce239556aa6837364d35d9f0 | implement unit tests for build command | fretboardfreak/space,fretboardfreak/space | tests/lib/cmdline/commands/test_build.py | tests/lib/cmdline/commands/test_build.py | # Copyright 2015 Curtis Sand
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2015 Curtis Sand
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
ff73a174b1ba87b7484b671100f2835b4a60d845 | Update slowkdf_python3.py | vstoykovbg/slowkdf,vstoykovbg/slowkdf | slowkdf_python3.py | slowkdf_python3.py | #!/usr/bin/python3
import scrypt
import binascii
import getpass
def SlowKDF(password, salt, max_counter):
counter = 0
digest = password
while counter < max_counter:
counter += 1
print ("Iteration %s from %s..." % (counter, max_counter) )
digest = scrypt.hash(digest, salt, N = 10485... | #!/usr/bin/python3
import scrypt
import binascii
import getpass
def SlowKDF(password, salt, max_counter):
counter = 0
digest = password
while counter < max_counter:
counter += 1
print ("Iteration %s from %s..." % (counter, max_counter) )
digest = scrypt.hash(digest, salt, N = 10485... | mit | Python |
78f4e5ba3271871d4de915cb053012f5cc98fc89 | Bump to 0.11.0 | aio-libs/sockjs | sockjs/__init__.py | sockjs/__init__.py | # pyramid_sockjs
# Session, SessionManager are not imported
from sockjs.session import Session
from sockjs.session import SessionManager
from sockjs.exceptions import SessionIsClosed
from sockjs.exceptions import SessionIsAcquired
from sockjs.protocol import STATE_NEW
from sockjs.protocol import STATE_OPEN
from sock... | # pyramid_sockjs
# Session, SessionManager are not imported
from sockjs.session import Session
from sockjs.session import SessionManager
from sockjs.exceptions import SessionIsClosed
from sockjs.exceptions import SessionIsAcquired
from sockjs.protocol import STATE_NEW
from sockjs.protocol import STATE_OPEN
from sock... | apache-2.0 | Python |
fb301d91bfacae7135ceaa863b9cceeb25b01ab0 | Fix typo in the comments. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/encodings/bz2_codec.py | Lib/encodings/bz2_codec.py | """ Python 'bz2_codec' Codec - bz2 compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import ... | """ Python 'bz2_codec' Codec - bz2 compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Adapted by Raymond Hettinger from bz2_codec which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import code... | mit | Python |
37fb30d7ab30ece842b733ac8f0482b46f5446df | allow sending of "archive" parameter for restores | robweber/xbmcbackup,mjrulesamrat/xbmcbackup | default.py | default.py | import urlparse
import xbmcgui
import resources.lib.utils as utils
from resources.lib.backup import XbmcBackup
def get_params():
param = {}
if(len(sys.argv) > 1):
for i in sys.argv:
args = i
if(args.startswith('?')):
args = args[1:]
param.update(... | import xbmcgui
import resources.lib.utils as utils
from resources.lib.backup import XbmcBackup
#the program mode
mode = -1
#check if mode was passed in as an argument
if(len(sys.argv) > 1):
if(sys.argv[1].lower() == 'backup'):
mode = 0
elif(sys.argv[1].lower() == 'restore'):
mode = 1
if(mode ... | mit | Python |
ed17bbd4229651e9c02c74a81fe3f27c1154701d | Update shutdow.py instructions | pageauc/pi-timolo,pageauc/pi-timolo | source/shutdown.py | source/shutdown.py | #!/usr/bin/env python
# written by Claude Pageau ver 11.13
# Safely shutdown Raspberry pi using a momentary switch
# use a physical push button, toggle switch or just short two gpio jumper wires
# You can salvage an old switch from a computer or other device.
# Connect momentary switch to pin 5 and 6 (default)
# or se... | #!/usr/bin/env python
# written by Claude Pageau
# Safely shutdown Raspberry pi using a momentary switch
# use a physical push button, toggle switch or just short two gpio jumper wires
# You can salvage an old switch from a computer or other device.
# Connect momentary switch to pin 5 and 6 (default)
# or set gpio_pin... | mit | Python |
89c7dd14b83182152e191b1e5506e41158481801 | add --version option | google/kasane,google/kasane | kasane/cmd.py | kasane/cmd.py | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 | Python |
60fa020eca7c8ba1e1b3c8c3999ceb31a36a60ed | fix map encoding | mmisiewicz/slask,ruhee/limbo,TetraEtc/limbo,TetraEtc/limbo,michaelMinar/limbo,sentinelleader/limbo,llimllib/limbo,kylemsguy/limbo,dorian1453/limbo,freshbooks/limbo,Marclass/limbo,shawnsi/limbo,palachu/sdbot,llimllib/limbo,rizaon/limbo,signalnine/alanabot,serverdensity/sdbot | limbo/plugins/map.py | limbo/plugins/map.py | # -*- coding: utf-8 -*-
"""!map <place> return a map of place. Optional "zoom" and "maptype" parameters are accepted."""
# example queries:
# !map new york city
# !map united states zoom=4
# !map united states zoom=4 maptype=satellite
from urllib import quote
import re
def makemap(query):
querywords = []
args... | # -*- coding: utf-8 -*-
"""!map <place> return a map of place. Optional "zoom" and "maptype" parameters are accepted."""
# example queries:
# !map new york city
# !map united states zoom=4
# !map united states zoom=4 maptype=satellite
from urllib import quote
import re
def makemap(query):
querywords = []
args... | mit | Python |
a59ccad59954a765efd8b9e41b9e8fa821159a76 | Make sure the UnicodeReader for CSV is compatible with the original CSV interface - line_number ought to work. | dsanders11/django-newsletter,ctxis/django-newsletter,dsanders11/django-newsletter,viaregio/django-newsletter,viaregio/django-newsletter,ctxis/django-newsletter,dsanders11/django-newsletter,ctxis/django-newsletter | newsletter/addressimport/csv_util.py | newsletter/addressimport/csv_util.py | import csv, codecs, cStringIO
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
def __iter__(self):
return self
def next(self):
return self.read... | import csv, codecs, cStringIO
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
def __iter__(self):
return self
def next(self):
return self.read... | agpl-3.0 | Python |
8733a5b00aa313a9bd99dc7a598660242d05aec0 | Rename legislation_json to legislation | openfisca/country-template,openfisca/country-template | openfisca_country_template/reforms/modify_social_security_taxation.py | openfisca_country_template/reforms/modify_social_security_taxation.py | # -*- coding: utf-8 -*-
# This file defines a reform.
# A reform is a set of modifications to be applied to a reference tax and benefit system to carry out experiments.
# See https://doc.openfisca.fr/reforms.html
# Import from openfisca-core the common python objects used to code the legislation in OpenFisca
from op... | # -*- coding: utf-8 -*-
# This file defines a reform.
# A reform is a set of modifications to be applied to a reference tax and benefit system to carry out experiments.
# See https://doc.openfisca.fr/reforms.html
# Import from openfisca-core the common python objects used to code the legislation in OpenFisca
from op... | agpl-3.0 | Python |
c808bb394bb5fb9582ac59b8f3cd0998da5cd271 | add type docstring | wanshot/templa | kunai/ansi.py | kunai/ansi.py | # -*- coding: utf-8 -*-
STYLE = {
'reset': 0,
'bold': 1,
'underline': 2,
'negative1': 3,
'negative2': 5,
}
FOREGROUND_COLORS = {
'black': 30,
'red': 31,
'green': 32,
'yellow': 33,
'blue': 34,
'purple': 35,
'cyan': 36,
'white': 37,
}
BACKGROUND_CO... | # -*- coding: utf-8 -*-
STYLE = {
'reset': 0,
'bold': 1,
'underline': 2,
'negative1': 3,
'negative2': 5,
}
FOREGROUND_COLORS = {
'black': 30,
'red': 31,
'green': 32,
'yellow': 33,
'blue': 34,
'purple': 35,
'cyan': 36,
'white': 37,
}
BACKGROUND_CO... | mit | Python |
757bf4b6a4aea361b6bf7f4742e8077e51a7875a | Rename functions, add a current data test | pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality | iatidq/inforesult.py | iatidq/inforesult.py |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | agpl-3.0 | Python |
561085dec3ca2bbca25e44dc7a725bd72bb937c7 | Fix skip/fail marks on passing canary | poldracklab/niworkflows,oesteban/niworkflows,poldracklab/niworkflows,oesteban/niworkflows,oesteban/niworkflows | niworkflows/utils/tests/test_misc.py | niworkflows/utils/tests/test_misc.py | """Test misc module."""
import os
import shutil
from unittest import mock
import pytest
from ..misc import pass_dummy_scans, check_valid_fs_license
@pytest.mark.parametrize(
"algo_dummy_scans,dummy_scans,expected_out", [(2, 1, 1), (2, None, 2), (2, 0, 0)]
)
def test_pass_dummy_scans(algo_dummy_scans, dummy_scans... | """Test misc module."""
import os
import shutil
from unittest import mock
import pytest
from ..misc import pass_dummy_scans, check_valid_fs_license
@pytest.mark.parametrize(
"algo_dummy_scans,dummy_scans,expected_out", [(2, 1, 1), (2, None, 2), (2, 0, 0)]
)
def test_pass_dummy_scans(algo_dummy_scans, dummy_scans... | apache-2.0 | Python |
2d20123a662e17318ef9ab7b3f352d93aea024ca | Add tests to simple HSA compilation | sklam/numba,IntelLabs/numba,ssarangi/numba,seibert/numba,ssarangi/numba,seibert/numba,sklam/numba,stonebig/numba,gdementen/numba,pitrou/numba,pombredanne/numba,stefanseefeld/numba,gmarkall/numba,stuartarchibald/numba,seibert/numba,gmarkall/numba,jriehl/numba,cpcloud/numba,GaZ3ll3/numba,numba/numba,jriehl/numba,stonebig... | numba/hsa/tests/hsapy/test_simple.py | numba/hsa/tests/hsapy/test_simple.py | from __future__ import print_function, absolute_import
import numpy as np
from numba import hsa
import numba.unittest_support as unittest
class TestSimple(unittest.TestCase):
def test_array_access(self):
magic_token = 123
@hsa.jit
def udt(output):
output[0] = magic_token
... | from __future__ import print_function, absolute_import
import numpy as np
from numba import hsa
import numba.unittest_support as unittest
class TestSimple(unittest.TestCase):
def test_array_access(self):
magic_token = 123
@hsa.jit
def udt(output):
output[0] = magic_token
... | bsd-2-clause | Python |
3c91ce7af6043ff8ea7ba3b2abfeb1f62ece4000 | Add SQL query context to postgres PREPARE errors | sprymix/importkit | importkit/context.py | importkit/context.py | ##
# Copyright (c) 2008-2012 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import sys
from metamagic.utils.datastructures import registry
class SourcePoint(object):
def __init__(self, line, column, pointer):
self.line = line
self.column = column
self.pointer = point... | ##
# Copyright (c) 2008-2012 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import sys
from metamagic.utils.datastructures import registry
class SourcePoint(object):
def __init__(self, line, column, pointer):
self.line = line
self.column = column
self.pointer = point... | mit | Python |
b4f3399534931aa557c8fc89e9bd4b3a77386489 | Add reverse inheritance test for Tornado | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | python/ql/test/experimental/library-tests/frameworks/tornado/basic.py | python/ql/test/experimental/library-tests/frameworks/tornado/basic.py | import tornado.web
class BasicHandler(tornado.web.RequestHandler):
def get(self):
self.write("BasicHandler " + self.get_argument("xss"))
def post(self):
self.write("BasicHandler (POST)")
class DeepInheritance(BasicHandler):
def get(self):
self.write("DeepInheritance" + self.get_... | import tornado.web
class BasicHandler(tornado.web.RequestHandler):
def get(self):
self.write("BasicHandler " + self.get_argument("xss"))
def post(self):
self.write("BasicHandler (POST)")
class DeepInheritance(BasicHandler):
def get(self):
self.write("DeepInheritance" + self.get_... | mit | Python |
ef342351b976f53ac82a192f7ed427217f6a8d0a | Remove filling spaces in logger. | riga/law,riga/law | law/logger.py | law/logger.py | # -*- coding: utf-8 -*-
"""
Law logging setup.
"""
__all__ = ["console_handler", "setup_logging", "LogFormatter"]
import logging
from law.util import colored
from law.config import Config
#: Instance of a ``logging.StreamHandler`` that is used by logs in law. Its formatting is done by
#: :py:class:`LogFormatter... | # -*- coding: utf-8 -*-
"""
Law logging setup.
"""
__all__ = ["console_handler", "setup_logging", "LogFormatter"]
import logging
from law.util import colored
from law.config import Config
#: Instance of a ``logging.StreamHandler`` that is used by logs in law. Its formatting is done by
#: :py:class:`LogFormatter... | bsd-3-clause | Python |
a7f652fb464e3ff3a41b3972b4a0406c16ed9321 | fix pyflakes | laurent-george/weboob,frankrousseau/weboob,Konubinix/weboob,willprice/weboob,RouxRC/weboob,nojhan/weboob-devel,willprice/weboob,nojhan/weboob-devel,Konubinix/weboob,willprice/weboob,frankrousseau/weboob,Konubinix/weboob,RouxRC/weboob,laurent-george/weboob,sputnick-dev/weboob,sputnick-dev/weboob,laurent-george/weboob,Ro... | modules/hybride/test.py | modules/hybride/test.py | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... | agpl-3.0 | Python |
9d318d7597d1c7ff2e4795c9464273e7a82a25d9 | make add_test_run call atomic wrt the DB | terceiro/squad,terceiro/squad,terceiro/squad,terceiro/squad | squad/api/views.py | squad/api/views.py | from django.db import transaction
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseForbidden
from django.http import HttpResponse
from squad.core.models import Group
fro... | from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseForbidden
from django.http import HttpResponse
from squad.core.models import Group
from squad.core.models import Project... | agpl-3.0 | Python |
9eb85629fc1a1632ae7f69cd723413551cfb1735 | Normalize spelling | rambo/python-holviapi,rambo/python-holviapi | holviapi/tests/test_api_idempotent.py | holviapi/tests/test_api_idempotent.py | # -*- coding: utf-8 -*-
import os
import pytest
import holviapi
@pytest.fixture
def connection():
pool = os.environ.get('HOLVI_POOL', None)
key = os.environ.get('HOLVI_KEY', None)
if not pool or not key:
raise RuntimeError("HOLVI_POOL and HOLVI_KEY must be in ENV for these tests")
cnc = holviap... | # -*- coding: utf-8 -*-
import os
import pytest
import holviapi
@pytest.fixture
def connection():
pool = os.environ.get('HOLVI_POOL', None)
key = os.environ.get('HOLVI_KEY', None)
if not pool or not key:
raise RuntimeError("HOLVI_POOL and HOLVI_KEY must be in ENV for these tests")
cnc = holviap... | mit | Python |
6d32f6ad0763d8990d794f2f84b1a552a2120232 | update examples | arokem/pyAFQ,yeatmanlab/pyAFQ,yeatmanlab/pyAFQ,arokem/pyAFQ | examples/plot_afq_api.py | examples/plot_afq_api.py | """
==========================
AFQ API
==========================
An example using the AFQ API
"""
import os.path as op
import matplotlib.pyplot as plt
import nibabel as nib
import pandas as pd
from AFQ import api
import AFQ.data as afd
##########################################################################
#... | """
==========================
AFQ API
==========================
An example using the AFQ API
"""
import os.path as op
import matplotlib.pyplot as plt
import nibabel as nib
import pandas as pd
from AFQ import api
import AFQ.data as afd
##########################################################################
#... | bsd-2-clause | Python |
90f11056484f1ef3ca5b83ffc594a7cf71e3e7f7 | Update show_related.py | plamere/spotipy | examples/show_related.py | examples/show_related.py |
# shows related artists for the given seed artist
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import sys
import pprint
if len(sys.argv) > 1:
artist_name = sys.argv[1]
else:
artist_name = 'weezer'
client_credentials_manager = SpotifyClientCredentials()
sp = spotipy.Spotify(client_cred... |
# shows related artists for the given seed artist
import spotipy
import sys
import pprint
if len(sys.argv) > 1:
artist_name = sys.argv[1]
else:
artist_name = 'weezer'
sp = spotipy.Spotify()
result = sp.search(q='artist:' + artist_name, type='artist')
try:
name = result['artists']['items'][0]['name']
... | mit | Python |
42443ba3cf6606e9cc8a71fe4dbd2ba59ce32661 | Add more pykeen documentation | pybel/pybel,pybel/pybel,pybel/pybel | src/pybel/io/pykeen.py | src/pybel/io/pykeen.py | # -*- coding: utf-8 -*-
"""Entry points for PyKEEN.
This example shows how you can parse/load the triples from a BEL document with the `*.bel` extension.
.. code-block:: python
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/cthoyt/selventa-knowledge/master/selventa_knowledge... | # -*- coding: utf-8 -*-
"""Entry points for PyKEEN.
This example shows how you can parse/load the triples from a BEL document with the `*.bel` extension.
.. code-block:: python
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/cthoyt/selventa-knowledge/master/selventa_knowledge... | mit | Python |
10cf123646c7be640bfd4a4f3c5e5513a2d1d7ef | Increment version to 0.2.9 | dgwartney-io/import-io-api-python,dgwartney-io/import-io-api-python | importio2/version.py | importio2/version.py | #
# Copyright 2016 Import.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | #
# Copyright 2016 Import.io
#
# 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, ... | apache-2.0 | Python |
6e91131ee6fc69ef004a40ce69ab93c97a630333 | update inventory tests to use real host counts. | snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,snahelou/awx | awx/main/tests/licenses.py | awx/main/tests/licenses.py | # Copyright (c) 2013 AnsibleWorks, Inc.
# All Rights Reserved.
import datetime
import json
from django.conf import settings
from django.contrib.auth.models import User as DjangoUser
import django.test
from django.test.client import Client
from django.core.urlresolvers import reverse
from awx.main.models import Host, ... | # Copyright (c) 2013 AnsibleWorks, Inc.
# All Rights Reserved.
import datetime
import json
from django.conf import settings
from django.contrib.auth.models import User as DjangoUser
import django.test
from django.test.client import Client
from django.core.urlresolvers import reverse
from awx.main.models import *
from... | apache-2.0 | Python |
cede82b4de4bec4b780831369b2e292d4ccb6299 | Enable testing of epsilon_insensitive | sony/nnabla,sony/nnabla,sony/nnabla | python/test/function/test_epsilon_insensitive_loss.py | python/test/function/test_epsilon_insensitive_loss.py | # Copyright (c) 2017 Sony 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 by applicabl... | # Copyright (c) 2017 Sony 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 by applicabl... | apache-2.0 | Python |
c5c12e1f5aaeb56921b69cbb64a7d6a1b7585936 | Define `search_fields` for Admin classes | cordery/django-languages-plus | languages_plus/admin.py | languages_plus/admin.py | from django.contrib import admin
from .models import Language, CultureCode
class LanguageAdmin(admin.ModelAdmin):
list_display = ('name_en', 'name_native', 'iso_639_1', 'iso_639_2T', 'iso_639_2B', 'iso_639_2T',
'iso_639_3', 'iso_639_6', 'notes')
list_display_links = ('name_en',)
searc... | from django.contrib import admin
from .models import Language, CultureCode
class LanguageAdmin(admin.ModelAdmin):
list_display = ('name_en', 'name_native', 'iso_639_1', 'iso_639_2T', 'iso_639_2B', 'iso_639_2T',
'iso_639_3', 'iso_639_6', 'notes')
list_display_links = ('name_en',)
class C... | mit | Python |
fbb581dfdf3a1b700fac6f4e38354fed7981b491 | clean up formatting | bruckhaus/challenges,bruckhaus/challenges,bruckhaus/challenges,bruckhaus/challenges | python_challenges/project_euler/p015_lattice_paths.py | python_challenges/project_euler/p015_lattice_paths.py | from scipy.misc import comb
class LatticePaths:
# Lattice paths
# Problem 15
# Starting in the top left corner of a 2x2 grid, and only being able to move to the right and down,
# there are exactly 6 routes to the bottom right corner.
# How many such routes are there through a 20x20 grid?
def ... | from scipy.misc import comb
__author__ = 'tilmannbruckhaus'
class LatticePaths:
# Lattice paths
# Problem 15
# Starting in the top left corner of a 2x2 grid, and only being able to move to the right and down,
# there are exactly 6 routes to the bottom right corner.
# How many such routes are the... | mit | Python |
e3f13e6a2fbc740bcab6b6c3cd3f39629169b9ca | Fix for loop. | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | sara_flexbe_states/src/sara_flexbe_states/for_loop.py | sara_flexbe_states/src/sara_flexbe_states/for_loop.py | #!/usr/bin/env python
from flexbe_core import EventState, Logger
class ForLoop(EventState):
"""
Allow to loop a certain number of time
-- repeat int number of repetitions
<= index current index
<= do loop
<= end finished
"""
def __init__(self, repea... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
import rospy
class ForLoop(EventState):
"""
Allow to loop a certain number of time
-- repeat int number of repetitions
<= index current index
<= do loop
<= end finished
"""
def _... | bsd-3-clause | Python |
32070c5647879a3fe9f98a6bbc13eb98ed6f3dd9 | update num | zenozeng/automatic-control-theory | root_locus.py | root_locus.py | import matplotlib.pyplot as pyplot
import control
import sympy
import numpy
S = sympy.symbols('S')
denominator = (S**2) * (S + 2)
denominator = denominator.expand()
denominator = sympy.poly(denominator, S).all_coeffs()
denominator = list(map(float, denominator))
numerator = [1, 1]
sys = control.matlab.tf(numerator, d... | import matplotlib.pyplot as pyplot
import control
import sympy
import numpy
S = sympy.symbols('S')
denominator = (S**2) * (S + 2)
denominator = denominator.expand()
denominator = sympy.poly(denominator, S).all_coeffs()
denominator = list(map(float, denominator))
numerator = [1.]
sys = control.matlab.tf(numerator, den... | mit | Python |
f02ce757d8a29389fc95edf1ed8db53db2a90499 | fix version module import handling | kentfrazier/Exhibitionist,kentfrazier/Exhibitionist,kentfrazier/Exhibitionist | exhibitionist/__init__.py | exhibitionist/__init__.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import six
from exhibitionist.settings import TORNADO_LOG_FILE
import exhibitionist.decorators as decorators
import exhibitionist.exceptions as exceptions
import exhibitionist.isubscriber as isubscriber
import exhibitionist.log as log
import exhibitionist.... | # -*- coding: utf-8 -*-
from __future__ import print_function
import six
from exhibitionist.settings import TORNADO_LOG_FILE
from exhibitionist.version import short_version, version
import exhibitionist.decorators as decorators
import exhibitionist.exceptions as exceptions
import exhibitionist.isubscriber as isubscri... | bsd-3-clause | Python |
48ac765bbf817b8156f5fb10d439e64e81f48f15 | make sure timestamps are ints | firba1/irq,firba1/irq,firba1/irq | batch/backfill.py | batch/backfill.py | import sqlite3
import time
def read_quotes_file(path):
with open(path) as f:
raw_text = f.read()
return [
unicode(quote.strip())
for quote in raw_text.decode("utf-8").split('\n%') if quote.strip()
]
def create_table(cursor, path):
with open(path) as f:
schema = f.read... | import sqlite3
import time
def read_quotes_file(path):
with open(path) as f:
raw_text = f.read()
return [
unicode(quote.strip())
for quote in raw_text.decode("utf-8").split('\n%') if quote.strip()
]
def create_table(cursor, path):
with open(path) as f:
schema = f.read... | mit | Python |
46f8fb6e9edddca868fbc4962966a47a0a22b344 | Add Staff childclass | Alweezy/alvin-mutisya-dojo-project | app/models/people/people.py | app/models/people/people.py | class Person(object):
"""Models the kind of people available at Andela,
It forms the base class from which classes Fellow and Staff inherit"""
def __init__(self, fname, lname, occupation):
"""Initializes the base class Person
:param fname: A string denoting person's first name
:para... | class Person(object):
"""Models the kind of people available at Andela,
It forms the base class from which classes Fellow and Staff inherit"""
def __init__(self, fname, lname, occupation):
"""Initializes the base class Person
:param fname: A string denoting person's first name
:para... | mit | Python |
03b94dffc2850d5c1c70d0cdaaa313a89fa2b2cc | Optimize DeviceTempFile() by combining logic into a single "adb shell" | CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve... | build/android/pylib/utils/device_temp_file.py | build/android/pylib/utils/device_temp_file.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A temp file that automatically gets pushed and deleted from a device."""
# pylint: disable=W0622
from pylib import cmd_helper
from pylib.device import d... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A temp file that automatically gets pushed and deleted from a device."""
# pylint: disable=W0622
import random
import time
from pylib import cmd_helper... | bsd-3-clause | Python |
b069b03e9428c445d660a6003548baf7600e61df | Use UTC in order overdue check | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/services/shop/order/transfer/models.py | byceps/services/shop/order/transfer/models.py | """
byceps.services.shop.order.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime, timedelta
from decimal imp... | """
byceps.services.shop.order.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime, timedelta
from decimal imp... | bsd-3-clause | Python |
8d9ca58ebb0e786ea24aa497d7bb133f37e0e031 | transpose quaternion | adrn/KingKong | kincon/util.py | kincon/util.py | # coding: utf-8
""" Misc. utilities """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os
import sys
# Third-party
import numpy as np
from astropy import log as logger
import astropy.units as u
# Project
# ...
__all__ = ['']
def quaternion... | # coding: utf-8
""" Misc. utilities """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os
import sys
# Third-party
import numpy as np
from astropy import log as logger
import astropy.units as u
# Project
# ...
__all__ = ['']
def quaternion... | mit | Python |
233d359b310fa75735b540f83089e3f6dc8230bb | Prepare for release 0.3.0: Updating version number (#59) | intentionet/netconan | netconan/__version__.py | netconan/__version__.py | """Version and other information for the project."""
# Copyright 2018 Intentionet
#
# 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
... | """Version and other information for the project."""
# Copyright 2018 Intentionet
#
# 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
... | apache-2.0 | Python |
1ea46e9c527be0d1e887389aa9c623e9ba9aa5ce | Remove debugging statements | mwcraig/msumastro | run_triage.py | run_triage.py | import image_collection as tff
import sys
import os
object_name_file_name = 'NEEDS_OBJECT_NAME.txt'
pointing_file_name = 'NEEDS_POINTING_INFO.txt'
filter_file_name = 'NEEDS_FILTER.txt'
file_list = 'Manifest.txt'
def write_list(dir, file, info):
out = open(os.path.join(dir,file), 'wb')
out.write('\n'.join(info)... | import image_collection as tff
import sys
import os
#import pdb
object_name_file_name = 'NEEDS_OBJECT_NAME.txt'
pointing_file_name = 'NEEDS_POINTING_INFO.txt'
filter_file_name = 'NEEDS_FILTER.txt'
file_list = 'Manifest.txt'
def write_list(dir, file, info):
out = open(os.path.join(dir,file), 'wb')
out.write('... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.