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
d0c187230c46c4995bf07fe69cd5f520d8cff533
Add comment
Turbasen/turbasen.py
turbasen/__init__.py
turbasen/__init__.py
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals VERSION = '1.0.0' # Import the models we want directly available through the 'turbasen' module from .models import \ Omrade, \ Sted def configure(**settings): from .settings import Settings for key, v...
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals VERSION = '1.0.0' from .models import \ Omrade, \ Sted def configure(**settings): from .settings import Settings for key, value in settings.items(): Settings.setattr(key, value)
mit
Python
8729144ef2457002091f6110c25a5fe07d2a1561
update version
bird-house/pywps-proxy,bird-house/twitcher,bird-house/pywps-proxy
twitcher/__init__.py
twitcher/__init__.py
import logging logger = logging.getLogger(__name__) __version__ = '0.3.2' def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ from pyramid.config import Configurator config = Configurator(settings=settings) # include twitcher components config....
import logging logger = logging.getLogger(__name__) __version__ = '0.3.1' def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ from pyramid.config import Configurator config = Configurator(settings=settings) # include twitcher components config....
apache-2.0
Python
46846bbc17a3f0fb1c6eea350ec3abdf5363a18d
Use relative path to python in virtual env.
emeitner/1-1e100,emeitner/1-1e100
update-google-ips.py
update-google-ips.py
#!./venv/bin/python from urllib.request import urlopen import bs4 import lxml from bs4 import BeautifulSoup from netaddr import * import re #import tempfile #temp_fd,temp_path = tempfile.mkstemp() #print temp_path netnames= [ 'GOGL' ,'GOOGL-2' ] for netname in netnames: url = 'https://whois.arin.net/rest/o...
#!/home/1-1e100/venv/bin/python from urllib.request import urlopen import bs4 import lxml from bs4 import BeautifulSoup from netaddr import * import re #import tempfile #temp_fd,temp_path = tempfile.mkstemp() #print temp_path netnames= [ 'GOGL' ,'GOOGL-2' ] for netname in netnames: url = 'https://whois.ari...
mit
Python
ebbb6d38c5fbaa8f5a74ef38fdd34f29c0d9720d
fix not knowing what feed is
edlongman/thescoop,edlongman/thescoop,edlongman/thescoop
update_categories.py
update_categories.py
import MySQLdb, config sql = MySQLdb.connect(host="localhost", user=config.username, passwd=config.passwd, db=config.db) sql.query("SELECT `site` FROM `sites` ") sites=sql.store_result().fetch_row(0) def print_site_data(site): p...
import MySQLdb, config sql = MySQLdb.connect(host="localhost", user=config.username, passwd=config.passwd, db=config.db) sql.query("SELECT `site` FROM `sites` ") sites=sql.store_result().fetch_row(0) def print_site_data(site): p...
apache-2.0
Python
0d53948c7adb427917e3884c480e55ad0d79fa65
Update OpenVINO sha256 (#1060)
plaidml/plaidml,plaidml/plaidml,plaidml/plaidml,plaidml/plaidml
vendor/openvino/repo.bzl
vendor/openvino/repo.bzl
# Copyright 2020 Intel Corporation load("//vendor/bazel:repo.bzl", "http_archive") # Sanitize a dependency so that it works correctly from code that includes it as a submodule. def clean_dep(dep): return str(Label(dep)) def openvino_workspace(): http_archive( name = "ade", sha256 = "6660e1b66...
# Copyright 2020 Intel Corporation load("//vendor/bazel:repo.bzl", "http_archive") # Sanitize a dependency so that it works correctly from code that includes it as a submodule. def clean_dep(dep): return str(Label(dep)) def openvino_workspace(): http_archive( name = "ade", sha256 = "6660e1b66...
apache-2.0
Python
438af7c6bda50ad5805784b3191f3cc7c53a7dfb
Remove wav creation since it's not working
bertrandvidal/stuff,bertrandvidal/stuff,bertrandvidal/stuff,bertrandvidal/stuff
audio_to_img_to_audio/img_to_audio.py
audio_to_img_to_audio/img_to_audio.py
#!/usr/bin/env python import struct import sys import wave from PIL import Image width = None height = None sampleRate = 48000 duration = 3 frequency = 440.0 bw_image = None debug_image = None with Image.open(sys.argv[1]) as img: # convert image to 1-bit B&W image bw_image = img.convert("1") debug_imag...
#!/usr/bin/env python import struct import sys import wave from PIL import Image width = None height = None sampleRate = 48000 duration = 3 frequency = 440.0 bw_image = None debug_image = None with Image.open(sys.argv[1]) as img: # convert image to 1-bit B&W image bw_image = img.convert("1") debug_imag...
unlicense
Python
35594a4f8c549d507c7d7030141ae511aed57c09
Add Credentials to root namespace
ABASystems/pyworkflowmax
workflowmax/__init__.py
workflowmax/__init__.py
from .api import WorkflowMax # noqa from .credentials import Credentials # noqa __version__ = "0.1.0"
from .api import WorkflowMax # noqa __version__ = "0.1.0"
bsd-3-clause
Python
eb7e9458f9d6cae3d021f4b269ac1ae4f561f222
Bump version
hanjae/upstream,Storj/upstream
upstream/__init__.py
upstream/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014 Paul Durivage for Storj Labs # # 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 restrictio...
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014 Paul Durivage for Storj Labs # # 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 restrictio...
mit
Python
4c902c519b5a345fdfd26a8f77133d6dd2c7d79e
Increase pagination
hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website
userprofile/views.py
userprofile/views.py
from django.contrib.auth.models import User # For merging user and profile forms from django.forms import inlineformset_factory, widgets from django.shortcuts import get_object_or_404, redirect, render from django.contrib.auth.decorators import login_required from django.http import Http404 from committees.models impor...
from django.contrib.auth.models import User # For merging user and profile forms from django.forms import inlineformset_factory, widgets from django.shortcuts import get_object_or_404, redirect, render from django.contrib.auth.decorators import login_required from django.http import Http404 from committees.models impor...
mit
Python
edbc364ab476a17be9c536caf793c52dd2d5ce1d
update webhook
Windfarer/episode,Windfarer/episode
webhooks.py
webhooks.py
from http.server import HTTPServer, BaseHTTPRequestHandler import json import os import shutil from episode import GitRepo, Episode WORK_DIR = "repo" class WebHookHandler(BaseHTTPRequestHandler): def do_POST(self): event_type = self.headers.get('X-Github-Event') if event_type != 'push': ...
from http.server import HTTPServer, BaseHTTPRequestHandler import json import os from episode import GitRepo, Episode class WebHookHandler(BaseHTTPRequestHandler): def do_POST(self): event_type = self.headers.get('X-Github-Event') if event_type != 'push': return length = int(s...
mit
Python
47a1a5feb7b8b7612d4487a9bf8bd32b6d14b70b
remove default fallbacks for walkocr
hoover/snoop,hoover/snoop
snoop/management/commands/walkocr.py
snoop/management/commands/walkocr.py
import sys from django.core.management.base import BaseCommand from ... import models from ...ocr import walk class Command(BaseCommand): help = "Ingest OCRed files" def add_arguments(self, parser): parser.add_argument( 'collection_slug', help="The slug of the collection" ...
import sys from django.core.management.base import BaseCommand from ... import models from ...ocr import walk class Command(BaseCommand): help = "Ingest OCRed files" def add_arguments(self, parser): parser.add_argument( 'collection_slug', default=None, help="The sl...
mit
Python
36b3738839db0c144a36b7146bd48dabb1df1863
Set abstention to enabled from December 1st, 2017 on
DemokratieInBewegung/abstimmungstool,DemokratieInBewegung/abstimmungstool,DemokratieInBewegung/abstimmungstool,DemokratieInBewegung/abstimmungstool
voty/initproc/globals.py
voty/initproc/globals.py
from datetime import date class NOTIFICATIONS: """ All internal notifications """ class INVITE: SEND = "inivited" ACCEPTED = "invite_accepted" REJECTED = "invite_rejected" class INITIATIVE: EDITED = "init_edited" SUBMITTED = "init_submitted" PUBLISH...
from datetime import date class NOTIFICATIONS: """ All internal notifications """ class INVITE: SEND = "inivited" ACCEPTED = "invite_accepted" REJECTED = "invite_rejected" class INITIATIVE: EDITED = "init_edited" SUBMITTED = "init_submitted" PUBLISH...
agpl-3.0
Python
ab5aac0c9b0e075901c4cd8dd5d134e79f0e0110
Set utf-8 as default encoding.
pghilardi/live-football-client
brasileirao/spiders/results_spider.py
brasileirao/spiders/results_spider.py
# -*- coding: utf-8 -*- import scrapy import scrapy.selector from brasileirao.items import BrasileiraoItem import hashlib class ResultsSpider(scrapy.Spider): name = "results" start_urls = [ 'https://esporte.uol.com.br/futebol/campeonatos/brasileirao/jogos/', ] def parse(self, response): ...
import scrapy import scrapy.selector from brasileirao.items import BrasileiraoItem import hashlib class ResultsSpider(scrapy.Spider): name = "results" start_urls = [ 'https://esporte.uol.com.br/futebol/campeonatos/brasileirao/jogos/', ] def parse(self, response): actual_round = 0 ...
mit
Python
caa80c95d58b2d45082a59fa3ac41e35824cb3c0
remove some comments..
robotenique/mlAlgorithms
supervisedLearning/nnMultiClass/ex3.py
supervisedLearning/nnMultiClass/ex3.py
import sys import scipy.io import numpy as np from matplotlib import use use('TkAgg') from oneVsAll import oneVsAll from predictOneVsAll import predictOneVsAll from displayData import displayData # 20x20 Input Images of Digits input_layer_size = 400 # 10 labels, from 1 to 10 ("0" is mapped to 10) num_labels = 10 # =...
import sys import scipy.io import numpy as np from matplotlib import use use('TkAgg') from oneVsAll import oneVsAll from predictOneVsAll import predictOneVsAll from displayData import displayData # 20x20 Input Images of Digits input_layer_size = 400 # 10 labels, from 1 to 10 ("0" is mapped to 10) num_labels = 10 # =...
unlicense
Python
a3c1822dd2942de4b6bf5cac14039e6789babf85
Add reversion support to Pages
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
wafer/pages/admin.py
wafer/pages/admin.py
from django.contrib import admin from wafer.pages.models import File, Page from reversion.admin import VersionAdmin class PageAdmin(VersionAdmin, admin.ModelAdmin): prepopulated_fields = {"slug": ("name",)} list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule') admin.site.register(...
from django.contrib import admin from wafer.pages.models import File, Page class PageAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("name",)} list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule') admin.site.register(Page, PageAdmin) admin.site.register(File)
isc
Python
85055b827644c111408e9ff3d4b3d22140fe122b
Add default_auto_field
torchbox/wagtailmedia,torchbox/wagtailmedia,torchbox/wagtailmedia
wagtailmedia/apps.py
wagtailmedia/apps.py
from django.apps import AppConfig class WagtailMediaAppConfig(AppConfig): default_auto_field = 'django.db.models.AutoField' name = "wagtailmedia" label = "wagtailmedia" verbose_name = "Wagtail media" def ready(self): from wagtailmedia.signal_handlers import register_signal_handlers ...
from django.apps import AppConfig class WagtailMediaAppConfig(AppConfig): name = "wagtailmedia" label = "wagtailmedia" verbose_name = "Wagtail media" def ready(self): from wagtailmedia.signal_handlers import register_signal_handlers register_signal_handlers()
bsd-3-clause
Python
8074e15e222177a6a85141cf8a8699c7941b2729
Add backup name generator.
tomwys/fabric-utils
fabric_utils/backup.py
fabric_utils/backup.py
import datetime from fabric.api import env, run, sudo def postgresql(database, file): owner = sudo("stat -c %%U `dirname %s`" % file) sudo("chown postgres `dirname %s`" % file) sudo("pg_dump %s > %s" % (database, file), user='postgres') sudo("chown %s `dirname %s` %s" % (owner, file, file)) class Tmp...
from fabric.api import env, run, sudo def postgresql(database, file): owner = sudo("stat -c %%U `dirname %s`" % file) sudo("chown postgres `dirname %s`" % file) sudo("pg_dump %s > %s" % (database, file), user='postgres') sudo("chown %s `dirname %s` %s" % (owner, file, file)) class TmpDir(object): ...
mit
Python
79edf12d3f8e1d5fa897dbe6c3980f2d85aba76b
revert dictionary
NCI-GDC/gdcdatamodel,NCI-GDC/gdcdatamodel
setup.py
setup.py
from setuptools import setup, find_packages setup( name='gdcdatamodel', packages=find_packages(), install_requires=[ 'pytz==2016.4', 'graphviz==0.4.2', 'jsonschema==2.5.1', 'python-dateutil==2.4.2', 'dictionaryutils', 'gdcdictionary', 'psqlgraph', ...
from setuptools import setup, find_packages setup( name='gdcdatamodel', packages=find_packages(), install_requires=[ 'pytz==2016.4', 'graphviz==0.4.2', 'jsonschema==2.5.1', 'python-dateutil==2.4.2', 'dictionaryutils', 'gdcdictionary', 'psqlgraph', ...
apache-2.0
Python
58c8a61d926783ed0b6aef49602d616170974326
add email rate-limiting
zplab/rpc-scope
scope/client_util/incubator_check.py
scope/client_util/incubator_check.py
# -*- coding: utf-8 -*- import platform import datetime import time from .. import scope_client from .. import scope_job_runner from ..config import scope_configuration def main(scope_host='127.0.0.1'): runner = scope_job_runner.JobRunner() jobs = runner.jobs.get_jobs() to_email = set() for job in jo...
# -*- coding: utf-8 -*- import platform import datetime import time from .. import scope_client from .. import scope_job_runner def main(scope_host='127.0.0.1'): runner = scope_job_runner.JobRunner() jobs = runner.jobs.get_jobs() to_email = set() for job in jobs: if job.status == scope_job_ru...
mit
Python
d30605d82d5f04e8478c785f1bb5086066e50878
Fix import error by calling prepare_env first
wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx
awx/wsgi.py
awx/wsgi.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. import logging from awx import __version__ as tower_version # Prepare the AWX environment. from awx import prepare_env prepare_env() from django.core.wsgi import get_wsgi_application """ WSGI config for AWX project. It exposes the WSGI callable as a module-...
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. import logging from django.core.wsgi import get_wsgi_application from awx import prepare_env from awx import __version__ as tower_version """ WSGI config for AWX project. It exposes the WSGI callable as a module-level variable named ``application``. For more...
apache-2.0
Python
4076fb322814848d802d1f925d163e90b3d629a9
Split get_input from set_input in FormTestMixin.
nimbis/django-selenium-testcase,nimbis/django-selenium-testcase
selenium_testcase/testcases/forms.py
selenium_testcase/testcases/forms.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from selenium.webdriver.common.by import By from .utils import wait_for class FormTestMixin: # default search element form_search_list = ( (By.ID, '{}',), (By.NAME, '{}',), (By.XPATH, '//form[@action="{}"]',), (...
# -*- coding: utf-8 -*- from __future__ import absolute_import from selenium.webdriver.common.by import By from .utils import wait_for class FormTestMixin: # default search element form_search_list = ( (By.ID, '{}',), (By.NAME, '{}',), (By.XPATH, '//form[@action="{}"]',), (...
bsd-3-clause
Python
77002198808c8ecfed54b2353f010effa16431f4
Update version
rolurq/flask-gulp
flask_gulp/__init__.py
flask_gulp/__init__.py
from collections import namedtuple Task = namedtuple('Task', ['function', 'items', 'watched']) File = namedtuple('File', ['filename', 'rel_name', 'content']) from .static import Static from .extensions import extension __all__ = [ 'Static', 'extension' ] __version__ = '0.3.0'
from collections import namedtuple Task = namedtuple('Task', ['function', 'items', 'watched']) File = namedtuple('File', ['filename', 'rel_name', 'content']) from .static import Static from .extensions import extension __all__ = [ 'Static', 'extension' ] __version__ = '0.2.8'
mit
Python
02fec8e08f54c8472fede019ef62e4fee84ced94
Bump up version
martinrusev/imbox
imbox/__init__.py
imbox/__init__.py
from imbox.imbox import Imbox __version_info__ = (0, 9, 7) __version__ = '.'.join([str(x) for x in __version_info__]) __all__ = ['Imbox']
from imbox.imbox import Imbox __version_info__ = (0, 9, 6) __version__ = '.'.join([str(x) for x in __version_info__]) __all__ = ['Imbox']
mit
Python
89e230e6729b263f3b5f41cff5ba64cb5c9e67ef
Clean up model repr
projectweekend/song-feed-worker
worker/spotify_models.py
worker/spotify_models.py
from datetime import datetime import spotipy class SpotifyItem(object): def __init__(self, **entries): self.__dict__.update(entries) self._client = spotipy.Spotify() class Artist(SpotifyItem): def __init__(self, **entries): super(Artist, self).__init__(**entries) def __repr__(...
from datetime import datetime import spotipy class SpotifyItem(object): def __init__(self, **entries): self.__dict__.update(entries) self._client = spotipy.Spotify() class Artist(SpotifyItem): def __init__(self, **entries): super(Artist, self).__init__(**entries) def __repr__(...
mit
Python
e957b7d26f02192a5e95c4e9e14f6d69554063d8
Align xml list env with windows RCE-1204
sassoftware/rpath-tools,sassoftware/rpath-tools
rpath_tools/client/sysdisco/parsevalues.py
rpath_tools/client/sysdisco/parsevalues.py
#!/usr/conary/bin/python2.6 # # Copyright (C) 2010 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at htt...
#!/usr/conary/bin/python2.6 # # Copyright (C) 2010 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at htt...
apache-2.0
Python
d70bea63e2f85784fc1fea0456803fd935a09baa
Add test for Job.get_server_elements.
fhirschmann/penchy,fhirschmann/penchy
penchy/tests/test_job.py
penchy/tests/test_job.py
import unittest2 from penchy.jobs import job from penchy.jobs.dependency import Edge from penchy.jobs.jvms import JVM class JobClientElementsTest(unittest2.TestCase): def setUp(self): super(JobClientElementsTest, self).setUp() self.config = job.makeJVMNodeConfiguration(JVM('foo'), 'pseudo_node') ...
import unittest2 from penchy.jobs import job from penchy.jobs.dependency import Edge from penchy.jobs.jvms import JVM class JobClientElementsTest(unittest2.TestCase): def setUp(self): super(JobClientElementsTest, self).setUp() self.config = job.makeJVMNodeConfiguration(JVM('foo'), 'pseudo_node') ...
mit
Python
5ac3b7c358ba6b1a790c8d5b96dbf2406e09acf1
Make `pheweb make-wsgi -h`
statgen/pheweb,statgen/pheweb,statgen/pheweb,statgen/pheweb,statgen/pheweb
pheweb/load/make_wsgi.py
pheweb/load/make_wsgi.py
from __future__ import print_function, division, absolute_import from .. import utils conf = utils.conf import os template1 = ''' import os.path import sys ''' template2 = ''' path = os.path.join('{venv_dir}/bin/activate_this.py') with open(path) as f: code = compile(f.read(), path, 'exec') exec(code, dict...
from __future__ import print_function, division, absolute_import from .. import utils conf = utils.conf import os template1 = ''' import os.path import sys ''' template2 = ''' path = os.path.join('{venv_dir}/bin/activate_this.py') with open(path) as f: code = compile(f.read(), path, 'exec') exec(code, dict...
agpl-3.0
Python
b97448fc7199d4bbd840f3b2372fae90b03aa45a
modify test ver
karaage0703/python-image-processing,karaage0703/python-image-processing
photo-exif-date-print.py
photo-exif-date-print.py
# -*- coding: utf-8 -*- # import cv2 import sys from PIL import Image, ImageDraw, ImageFont from PIL.ExifTags import TAGS, GPSTAGS font_size = 32 font_opacity = 64 font_color = (255, 255, 255) def get_exif(file,field): img = Image.open(file) exif = img._getexif() exif_data = [] for id, value in ex...
# -*- coding: utf-8 -*- # import cv2 import sys from PIL import Image, ImageDraw, ImageFont from PIL.ExifTags import TAGS, GPSTAGS font_size = 32 font_opacity = 64 font_color = (255, 255, 255) def get_exif(file,field): img = Image.open(file) exif = img._getexif() exif_data = [] for id, value in ex...
mit
Python
05009dbef9ab18b19c00990a3ea9fec088105e09
transform & transform indirect
cprogrammer1994/ModernGL,cprogrammer1994/ModernGL,cprogrammer1994/ModernGL
moderngl/next/vertex_array.py
moderngl/next/vertex_array.py
from typing import Any from .buffer import Buffer from .program import Program from .scope import Scope class VertexArray: __slots__ = ['__mglo', '__ibo', 'program', 'scope', 'mode', 'vertices', 'extra'] def __init__(self): self.__mglo = None # type: Any self.__ibo = None # type: Buffer ...
from typing import Any from .buffer import Buffer from .program import Program from .scope import Scope class VertexArray: __slots__ = ['__mglo', '__ibo', 'program', 'scope', 'mode', 'vertices', 'extra'] def __init__(self): self.__mglo = None # type: Any self.__ibo = None # type: Buffer ...
mit
Python
b4530d4aa647a2a8493d667e5fade327fc932d90
Implement collection_name
numberly/mongo-thingy
mongo_thingy/model.py
mongo_thingy/model.py
from thingy import classproperty, DatabaseThingy class Model(DatabaseThingy): _collection = None @classproperty def collection(cls): return cls._collection or cls.table @classproperty def collection_name(cls): return cls.collection.name @classproperty def _table(cls): ...
from thingy import classproperty, DatabaseThingy class Model(DatabaseThingy): _collection = None @classproperty def collection(cls): return cls._collection or cls._table @classproperty def _table(cls): return cls._collection @classmethod def _get_database_from_table(cls,...
mit
Python
68db8458c062ed703cb333546b0fea9f2eb057a9
undo part of previous change
MLR-au/esrc-indexer
indexer/Poster.py
indexer/Poster.py
import logging import os from Index import Index from lxml import etree log = logging.getLogger('POSTER') class Poster: def __init__(self, input_folder, solr_service, site): # what to send to solr self.input_folder = input_folder # where to send it self.solr_service = solr_servic...
import logging import os import os.path from Index import Index from lxml import etree log = logging.getLogger('POSTER') class Poster: def __init__(self, input_folder, solr_service, site): # what to send to solr self.input_folder = input_folder # where to send it self.solr_servic...
bsd-3-clause
Python
9d7ad36e3e84e66f42ef652dfd3aafefafd857ae
improve search subcommand test coverage
BlackstoneEngineering/yotta,BlackstoneEngineering/yotta,autopulated/yotta,autopulated/yotta,ARMmbed/yotta,ARMmbed/yotta
yotta/test/cli/search.py
yotta/test/cli/search.py
#!/usr/bin/env python # Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import unittest # internal modules: from . import cli class TestCLISearch(unittest.TestCase): def test_bothModule(self): stdout = self.run...
#!/usr/bin/env python # Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import unittest # internal modules: from . import cli class TestCLISearch(unittest.TestCase): def test_bothModule(self): stdout = self.run...
apache-2.0
Python
0636b2794e30fb6c14782a57e5afce510b485b4d
Make entity description field larger
cgwire/zou
zou/app/models/entity.py
zou/app/models/entity.py
from sqlalchemy_utils import UUIDType from zou.app import db from zou.app.models.serializer import SerializerMixin from zou.app.models.base import BaseMixin from zou.app.utils import fields from sqlalchemy.dialects.postgresql import JSONB entity_link = db.Table( 'entity_link', db.Column( 'entity_in_...
from sqlalchemy_utils import UUIDType from zou.app import db from zou.app.models.serializer import SerializerMixin from zou.app.models.base import BaseMixin from zou.app.utils import fields from sqlalchemy.dialects.postgresql import JSONB entity_link = db.Table( 'entity_link', db.Column( 'entity_in_...
agpl-3.0
Python
c09453427f14a68df334485cc3f0974a8b4fb615
Revert "check master tls secrets file before using it"
cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo
modules/processing/dumptls.py
modules/processing/dumptls.py
# Copyright (C) 2010-2014 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.abstracts import Processing class TLSMasterSecrets(Processing): """Cross-references TLS master secrets extracted from the m...
# Copyright (C) 2010-2014 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import os.path from lib.cuckoo.common.abstracts import Processing log = logging.getLogger(__name__) class TLSMasterSecrets(Processing...
mit
Python
0aa6717f124681fc641c10de06226945e3d3e6fb
Fix tools/dmon.py not working since base sync ctx handlers removed
vertexproject/synapse,vertexproject/synapse,vertexproject/synapse
synapse/tools/dmon.py
synapse/tools/dmon.py
import os import sys import json import logging import argparse import subprocess import synapse.glob as s_glob import synapse.common as s_common import synapse.daemon as s_daemon import synapse.lib.output as s_output import synapse.lib.certdir as s_certdir import synapse.lib.thishost as s_thishost logger = logging....
import os import sys import json import logging import argparse import subprocess import synapse.glob as s_glob import synapse.common as s_common import synapse.daemon as s_daemon import synapse.lib.output as s_output import synapse.lib.certdir as s_certdir import synapse.lib.thishost as s_thishost logger = logging....
apache-2.0
Python
f1e07baa8fbfb1841b6d475f07f066756af80c21
Handle compiler output for library contracts
b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril
mythril/ether/util.py
mythril/ether/util.py
from ethereum.abi import encode_abi, encode_int from ethereum.utils import zpad from ethereum.abi import method_id from mythril.exceptions import CompilerError from subprocess import Popen, PIPE import binascii import os import re def safe_decode(hex_encoded_string): if (hex_encoded_string.startswith("0x")): ...
from ethereum.abi import encode_abi, encode_int from ethereum.utils import zpad from ethereum.abi import method_id from mythril.exceptions import CompilerError from subprocess import Popen, PIPE import binascii import os import re def safe_decode(hex_encoded_string): if (hex_encoded_string.startswith("0x")): ...
mit
Python
149a8091333766068cac445db770ea73055d8647
Make the userhook take the length arg b/c why not
axt/angr,schieb/angr,tyb0807/angr,chubbymaggie/angr,chubbymaggie/simuvex,chubbymaggie/angr,chubbymaggie/simuvex,f-prettyland/angr,axt/angr,angr/angr,f-prettyland/angr,tyb0807/angr,schieb/angr,axt/angr,chubbymaggie/angr,f-prettyland/angr,iamahuman/angr,tyb0807/angr,iamahuman/angr,angr/angr,iamahuman/angr,angr/angr,schie...
simuvex/procedures/stubs/UserHook.py
simuvex/procedures/stubs/UserHook.py
import simuvex class UserHook(simuvex.SimProcedure): NO_RET = True # pylint: disable=arguments-differ def run(self, user_func=None, user_kwargs=None, default_return_addr=None, length=None): result = user_func(self.state, **user_kwargs) if result is None: self.add_successor(self...
import simuvex class UserHook(simuvex.SimProcedure): NO_RET = True # pylint: disable=arguments-differ def run(self, user_func=None, user_kwargs=None, default_return_addr=None): result = user_func(self.state, **user_kwargs) if result is None: self.add_successor(self.state, defau...
bsd-2-clause
Python
0b3173c1193b71926713e4f8563617bfe54d74f3
Fix differences using sqlite backend
openstack/solar,zen/solar,openstack/solar,Mirantis/solar,loles/solar,zen/solar,loles/solar,Mirantis/solar,Mirantis/solar,loles/solar,pigmej/solar,Mirantis/solar,pigmej/solar,loles/solar,pigmej/solar,zen/solar,zen/solar,openstack/solar
solar/solar/dblayer/test/test_log.py
solar/solar/dblayer/test/test_log.py
import pytest from solar.dblayer.solar_models import LogItem, NegativeCounter from solar.dblayer.model import StrInt def test_separate_logs(): history = 'history' staged = 'staged' history_uids = set() staged_uids = set() for i in range(2): l = LogItem.new({'log': history}) l.sav...
import pytest from solar.dblayer.solar_models import LogItem, NegativeCounter from solar.dblayer.model import StrInt def test_separate_logs(): history = 'history' staged = 'staged' history_uids = set() staged_uids = set() for i in range(2): l = LogItem.new({'log': history}) l.sav...
apache-2.0
Python
76565c3a3b70f0b8affbb8e036acbd2c5635e72d
Fix empty callback error
novapost/insight
insight/worker.py
insight/worker.py
# -*- coding: utf-8 -*- from redis import StrictRedis import json import requests from insight.reader import get_file_for_url from insight.engines import documents from insight.writer import get_thumb_from_cache, have_cache_for_kwargs, get_thumb_path_for_kwargs try: import settings except ImportError: pass R...
# -*- coding: utf-8 -*- from redis import StrictRedis import json import requests from insight.reader import get_file_for_url from insight.engines import documents from insight.writer import get_thumb_from_cache, have_cache_for_kwargs, get_thumb_path_for_kwargs try: import settings except ImportError: pass R...
mit
Python
79c0c177644f09d89afe9cc501af3618f1cba539
Fix subdomain parsing
Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto
mysite/multitenancy/tenant.py
mysite/multitenancy/tenant.py
from contextlib import contextmanager from threading import local _current_tenant = local() _MAIN = 'main' class _DBTable(object): def __get__(self, obj, objtype): orig = getattr(obj, '_db_table', '') if orig: # TODO exempt some tables so they're shared (will screw up migrate...) ...
from contextlib import contextmanager from threading import local _current_tenant = local() _MAIN = 'main' class _DBTable(object): def __get__(self, obj, objtype): orig = getattr(obj, '_db_table', '') if orig: # TODO exempt some tables so they're shared (will screw up migrate...) ...
bsd-3-clause
Python
f9e29895c388c05e20374009e3d1af7538de1787
Change network_zone column handler
kr41/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,prasannav7/ggrc-core,VinnieJohns/ggrc-core,jmakov/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,jmakov/ggrc-core,hyperNURb/ggrc-core,j0gurt/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,AleksNeStu/ggrc-core,andrei...
src/ggrc/converters/column_handlers.py
src/ggrc/converters/column_handlers.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: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from ggrc.converters import handlers from ggrc.extensions import get_extension_...
# 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: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from ggrc.converters import handlers from ggrc.extensions import get_extension_...
apache-2.0
Python
038389af7bddab9835923bd0bddcfafc27f50dad
Add psutil to reqs
tyarkoni/pliers,tyarkoni/featureX
pliers/tests/conftest.py
pliers/tests/conftest.py
import os from psutil import Process from collections import namedtuple from itertools import groupby import gc _proc = Process(os.getpid()) def get_consumed_ram(): return _proc.memory_info().rss START = 'START' END = 'END' ConsumedRamLogEntry = namedtuple( 'ConsumedRamLogEntry', ('nodeid', 'on', 'consumed...
import os from psutil import Process from collections import namedtuple from itertools import groupby _proc = Process(os.getpid()) def get_consumed_ram(): return _proc.memory_info().rss START = 'START' END = 'END' ConsumedRamLogEntry = namedtuple( 'ConsumedRamLogEntry', ('nodeid', 'on', 'consumed_ram')) co...
bsd-3-clause
Python
b1f42b4ec490a5adb4d8dc4f220f3730c0f40619
use existing fixture in test
Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout
tests/adapter/mongo/test_matchmaker.py
tests/adapter/mongo/test_matchmaker.py
def test_case_mme_update(populated_database, case_obj, user_obj, mme_patient, mme_submission): """ Test the function that registers an effected individual as submitted to MatchMaker """ adapter = populated_database mme_submission['server_responses'] = [ {'patient': mme_patient }] # Make sure no c...
def test_case_mme_update(populated_database, case_obj, user_obj, mme_patient): """ Test the function that registers an effected individual as submitted to MatchMaker """ adapter = populated_database mme_subm_obj = { 'features' : [], 'disorders' : [], 'genes_only' : True, 's...
bsd-3-clause
Python
ff5509295a2dc6ef294f035bdc93d469a63ea56c
remove useless test
ceph/ceph-ansible,ceph/ceph-ansible
tests/functional/tests/test_install.py
tests/functional/tests/test_install.py
import pytest import re class TestInstall(object): def test_ceph_dir_exists(self, host, node): assert host.file('/etc/ceph').exists def test_ceph_dir_is_a_directory(self, host, node): assert host.file('/etc/ceph').is_directory def test_ceph_conf_exists(self, host, node): assert ...
import pytest import re class TestInstall(object): def test_ceph_dir_exists(self, host, node): assert host.file('/etc/ceph').exists def test_ceph_dir_is_a_directory(self, host, node): assert host.file('/etc/ceph').is_directory def test_ceph_conf_exists(self, host, node): assert ...
apache-2.0
Python
d1380d0fd8a8dc584953a2b9e85aad4a741e6cde
add random_bernoulli
vacancy/TensorArtist,vacancy/TensorArtist
tartist/nn/opr/rng.py
tartist/nn/opr/rng.py
# -*- coding:utf8 -*- # File : rng.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 3/17/17 # # This file is part of TensorArtist. import tensorflow as tf from tensorflow.python.ops import random_ops from .migrate import migrate_opr from .helper import as_varnode, wrap_varnode_func, wrap_named_...
# -*- coding:utf8 -*- # File : rng.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 3/17/17 # # This file is part of TensorArtist. import tensorflow as tf from tensorflow.python.ops import random_ops from .migrate import migrate_opr from .helper import wrap_varnode_func from .shape import canon...
mit
Python
04672391c8c9a82ee8374337e2a935357639ab4f
Update capy_captcha_example.py
AndreiDrang/python-rucaptcha
src/examples/capy_captcha_example.py
src/examples/capy_captcha_example.py
import asyncio from python_rucaptcha.CapyPuzzle import CapyPuzzle, aioCapyPuzzle from python_rucaptcha.enums import CapyPuzzleEnm # Rucaptcha API Key from your account RUCAPTCHA_KEY = "ad9053f31821111111111608fa758570" captchakey = "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w" pageurl = "https://www.capy.me/account/regist...
import asyncio from python_rucaptcha.CapyPuzzle import CapyPuzzle, aioCapyPuzzle from python_rucaptcha.enums import CapyPuzzleEnm # Rucaptcha API Key from your account RUCAPTCHA_KEY = "ad9053f3182ca81755768608fa758570" captchakey = "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w" pageurl = "https://www.capy.me/account/registe...
mit
Python
f68d4bd72036256cd94def884de3e2910f45d326
Add fvisibility=hidden for macOS
parro-it/libui-node,parro-it/libui-node,parro-it/libui-node,parro-it/libui-node
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "nbind", "includes": [ "auto.gypi" ], "conditions": [ ["OS=='win'", { "sources": [ '<!@(node list-sources.js)', ], "libraries": [ "<(module_root_dir)/libui.lib" ], 'msvs_settings': { 'VCCLCompilerTool': { 'Additiona...
{ "targets": [ { "target_name": "nbind", "includes": [ "auto.gypi" ], "conditions": [ ["OS=='win'", { "sources": [ '<!@(node list-sources.js)', ], "libraries": [ "<(module_root_dir)/libui.lib" ], 'msvs_settings': { 'VCCLCompilerTool': { 'Additiona...
mit
Python
20594502d8a678bac2596764f4501f3a59210d0e
add raw SAB viewer
mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf
src/ezdxf/addons/acisbrowser/data.py
src/ezdxf/addons/acisbrowser/data.py
# Copyright (c) 2022, Manfred Moitzi # License: MIT License from typing import List, Iterator from ezdxf.acis.sab import parse_sab class AcisData: def __init__(self, name: str = "unknown", handle: str = ""): self.lines: List[str] = [] self.name: str = name self.handle: str = handle cl...
# Copyright (c) 2022, Manfred Moitzi # License: MIT License from typing import List, Iterator from ezdxf.acis.sat import parse_sat from ezdxf.acis.sab import parse_sab class AcisData: def __init__(self, name: str = "unknown", handle: str = ""): self.lines: List[str] = [] self.name: str = name ...
mit
Python
763be24e2a87a27189146d365689d8523c901ccc
Update hook.py
nerdzeu/NERDZCrush,MediaCrush/MediaCrush,nerdzeu/NERDZCrush,nerdzeu/NERDZCrush,MediaCrush/MediaCrush,roderickm/MediaCrush,roderickm/MediaCrush,roderickm/MediaCrush
gifquick/views/hook.py
gifquick/views/hook.py
from flask.ext.classy import FlaskView, route from flask import abort, request import json from subprocess import call from ..config import _cfg from ..network import * class HookView(FlaskView): def post(self): allow = False for ip in _cfg("hook_ips").split(","): parts = ip.split("/"...
from flask.ext.classy import FlaskView, route from flask import abort import json from subprocess import call from ..config import _cfg from ..network import * class HookView(FlaskView): def post(self): allow = False for ip in _cfg("hook_ips").split(","): parts = ip.split("/") ...
mit
Python
9fbf5c2e82996989ca25b302bdd2c44373e325be
Disable assertions in binding file
addaleax/node-levenshtein-sse,addaleax/node-levenshtein-sse,addaleax/node-levenshtein-sse
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "levenshtein_sse", "sources": [ "src/node-levenshtein-sse.cpp" ], "include_dirs": ["<!(node -e \"require('nan')\")"], "cflags": ['-march=native -DNDEBUG'] } ] }
{ "targets": [ { "target_name": "levenshtein_sse", "sources": [ "src/node-levenshtein-sse.cpp" ], "include_dirs": ["<!(node -e \"require('nan')\")"], "cflags": ['-march=native'] } ] }
mit
Python
be3bb7531ae843d80815a54f1d436c2702142a97
update binding.gyp to compile
XadillaX/aliyun-ons,XadillaX/aliyun-ons,XadillaX/aliyun-ons
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "ons", "sources": [ "src/entry.cpp", "src/consumer_ack.cpp", "src/consumer.cpp", "src/producer.cpp" ], "include_dirs": [ "src/third_party/include", ...
{ "targets": [ { "target_name": "ons", "sources": [ "src/entry.cpp", "src/consumer.cpp", "src/producer.cpp" ], "include_dirs": [ "src/third_party/include", "<!(node -e \"require('n...
mit
Python
ef5fbb8b33602a4b36ed8307737fa13f47eaee07
Rename `async` to `_async`
skylines-project/skylines,skylines-project/skylines,skylines-project/skylines,skylines-project/skylines
skylines/commands/flights/find_meetings.py
skylines/commands/flights/find_meetings.py
from __future__ import print_function from flask_script import Command, Option from flask import current_app from skylines.database import db from skylines.model import Flight from skylines.worker import tasks from .selector import selector_options, select class FindMeetings(Command): """ Find meetings points b...
from __future__ import print_function from flask_script import Command, Option from flask import current_app from skylines.database import db from skylines.model import Flight from skylines.worker import tasks from .selector import selector_options, select class FindMeetings(Command): """ Find meetings points b...
agpl-3.0
Python
c56b0b591770310e8af9b9f44bf76a8b8a492cb8
Replace deprecated oslo.messaging.get_transport with get_notification_transport
openstack/octavia,openstack/octavia,openstack/octavia
octavia/controller/queue/event_queue.py
octavia/controller/queue/event_queue.py
# Copyright 2015 Rackspace # # 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 t...
# Copyright 2015 Rackspace # # 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 t...
apache-2.0
Python
3d28a1b43a2ab6fd38b1ed71bb3ad54da30f0fae
Add some tests for supervised FoM
odlgroup/odl,odlgroup/odl,aringh/odl,aringh/odl,kohr-h/odl,kohr-h/odl
odl/contrib/fom/test/test_supervised.py
odl/contrib/fom/test/test_supervised.py
import numpy as np import pytest import scipy.signal import scipy.misc import odl import odl.contrib.fom from odl.contrib.fom.util import filter_image_sep2d from odl.util.testutils import simple_fixture fft_impl = simple_fixture('fft_impl', [odl.util.testutils.never_skip('numpy'), ...
import numpy as np import pytest import scipy.signal import scipy.misc import odl from odl.contrib.fom.util import filter_image_sep2d from odl.util.testutils import simple_fixture fft_impl_params = [odl.util.testutils.never_skip('numpy'), odl.util.testutils.skip_if_no_pyfftw('pyfftw')] fft_impl = si...
mpl-2.0
Python
d8cbea619caca500077bc483685e5bb3075d8524
Support for change dir before execution. Added missing API docs
zynga/jasy,sebastian-software/jasy,sebastian-software/jasy,zynga/jasy
jasy/core/Util.py
jasy/core/Util.py
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # import re, os, hashlib, tempfile, subprocess, sys import jasy.core.Console as Console def executeCommand(args, failmsg=None, path=None): """ Executes the given process and outputs failmsg when errors happen. Returns the combined shell o...
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # import re, os, hashlib, tempfile, subprocess, sys import jasy.core.Console as Console def executeCommand(args, msg): """Executes the given process and outputs message when errors happen.""" Console.debug("Executing command: %s", " ".join(a...
mit
Python
6e8007f2ef72bc141eafe808ae7415cd57f97789
Add repository presentation file iteration.
joeyespo/gitpress
gitpress/repository.py
gitpress/repository.py
import os import subprocess from .helpers import copy_files repo_dir = '.gitpress' templates_path = os.path.join(os.path.dirname(__file__), 'templates') default_template_path = os.path.join(templates_path, 'default') class RepositoryAlreadyExistsError(Exception): """Indicates 'repo_dir' already exists while att...
import os import subprocess from .helpers import copy_files repo_dir = '.gitpress' templates_path = os.path.join(os.path.dirname(__file__), 'templates') default_template_path = os.path.join(templates_path, 'default') class RepositoryAlreadyExistsError(Exception): """Indicates 'repo_dir' already exists while att...
mit
Python
8528beef5d10355af07f641b4987df3cd64a7b0f
Make it safe to import __version__.
sprockets/sprockets.mixins.metrics
sprockets/mixins/metrics/__init__.py
sprockets/mixins/metrics/__init__.py
try: from .influxdb import InfluxDBMixin from .statsd import StatsdMixin except ImportError as error: def InfluxDBMixin(*args, **kwargs): raise error def StatsdMixin(*args, **kwargs): raise error version_info = (1, 0, 0) __version__ = '.'.join(str(v) for v in version_info) __all__ = ['...
from .influxdb import InfluxDBMixin from .statsd import StatsdMixin version_info = (1, 0, 0) __version__ = '.'.join(str(v) for v in version_info) __all__ = ['InfluxDBMixin', 'StatsdMixin']
bsd-3-clause
Python
e103e304f5948ce259040c526ac81ba2dc5d15b9
make img directory optional
TheGhouls/oct,karec/oct,TheGhouls/oct,TheGhouls/oct,karec/oct
oct/results/writer.py
oct/results/writer.py
import os import shutil class ReportWriter(object): """A class representing a report, used to output the result :param str results_dir: the output directory for the report :param str parent: the parent directory """ def __init__(self, results_dir, parent): self.results_dir = results_dir ...
import os import shutil class ReportWriter(object): """A class representing a report, used to output the result :param str results_dir: the output directory for the report :param str parent: the parent directory """ def __init__(self, results_dir, parent): self.results_dir = results_dir ...
mit
Python
4152a761415fd4ed32eac8f1e747dd66dac1cfd4
Fix bug in JSON loading when installing from share code.
LiaungYip/Cat-Herder
atlauncher_share_code.py
atlauncher_share_code.py
""" Li-aung "Lewis" Yip minecraft@penwatch.net """ import urllib2 import re import json from atlauncher_import import atlauncher_to_catherder def get_share_code_json (share_code): assert re.match("[A-Za-z0-9]{8}", share_code) url = "https://api.atlauncher.com/v1/share-codes/" + share_code try: d =...
""" Li-aung "Lewis" Yip minecraft@penwatch.net """ import urllib2 import re import json from atlauncher_import import atlauncher_to_catherder def get_share_code_json (share_code): assert re.match("[A-Za-z0-9]{8}", share_code) url = "https://api.atlauncher.com/v1/share-codes/" + share_code try: d =...
mit
Python
23b1798d381f75d3d882995c2b7c9fed0f57fd73
Make oidc_auth essential
ByteInternet/drf-oidc-auth
oidc_auth/settings.py
oidc_auth/settings.py
from django.conf import settings from rest_framework.settings import APISettings USER_SETTINGS = getattr(settings, 'OIDC_AUTH', None) DEFAULTS = { 'OIDC_ENDPOINT': None, # Currently unimplemented 'OIDC_ENDPOINTS': [], # The Claims Options can now be defined by a static string. # ref: https://doc...
from django.conf import settings from rest_framework.settings import APISettings USER_SETTINGS = getattr(settings, 'OIDC_AUTH', None) DEFAULTS = { 'OIDC_ENDPOINT': None, # Currently unimplemented 'OIDC_ENDPOINTS': [], # The Claims Options can now be defined by a static string. # ref: https://doc...
mit
Python
b208e0515c7be1b4b6ada67728af557f13172c8f
Update table name
m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps
scripts/generate_sql_to_delete_user.py
scripts/generate_sql_to_delete_user.py
#!/usr/bin/env python """Generate the SQL statements to remove a user and his/her various traces from the database. :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import click from byceps.util.system import get_config_filename_from_env_or_exit from _util import app_...
#!/usr/bin/env python """Generate the SQL statements to remove a user and his/her various traces from the database. :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import click from byceps.util.system import get_config_filename_from_env_or_exit from _util import app_...
bsd-3-clause
Python
d01ea7ad4521bcfc298d5898febd6b612da10102
check service account file existance
eunchong/build,eunchong/build,eunchong/build,eunchong/build
scripts/master/buildbucket/__init__.py
scripts/master/buildbucket/__init__.py
# Copyright 2015 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. """buildbucket module implements buildbucket-buildbot integration. The main entry point is buildbucket.setup() that accepts master configuration dict with o...
# Copyright 2015 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. """buildbucket module implements buildbucket-buildbot integration. The main entry point is buildbucket.setup() that accepts master configuration dict with o...
bsd-3-clause
Python
27d142ed2bf2bd7e81fb77f1746a0097e5623f4a
order status
AsherYang/ThreeLine,AsherYang/ThreeLine,AsherYang/ThreeLine
server/ffstore/constant/OrderStatus.py
server/ffstore/constant/OrderStatus.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Author: AsherYang Email : ouyangfan1991@gmail.com Date : 2018/6/13 Desc : 订单状态 """ # 待支付 STATUS_NO_PAYMENT = 0 # 待发货(已支付) STATUS_NO_DELIVERY = 1 # 待收货(已发货, 快递中) STATUS_NO_TAKE_DELIVERY = 2 # 订单完成 STATUS_COMPLETE = 10
#!/usr/bin/python # -*- coding: utf-8 -*- """ Author: AsherYang Email : ouyangfan1991@gmail.com Date : 2018/6/13 Desc : 订单状态 """
apache-2.0
Python
07c0c1f17f609f2cc90b4cb825a243a47220bde8
Update the user during the oq restore phase
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine
openquake/commands/restore.py
openquake/commands/restore.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2017-2019 GEM Foundation # OpenQuake 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...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2017-2019 GEM Foundation # OpenQuake 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...
agpl-3.0
Python
41b129a36ab190733221bdced3ac4d8420dc320d
update function name
chubbymaggie/angr,axt/angr,axt/angr,chubbymaggie/angr,iamahuman/angr,chubbymaggie/simuvex,tyb0807/angr,axt/angr,f-prettyland/angr,f-prettyland/angr,angr/angr,f-prettyland/angr,iamahuman/angr,chubbymaggie/simuvex,chubbymaggie/simuvex,iamahuman/angr,chubbymaggie/angr,tyb0807/angr,schieb/angr,schieb/angr,angr/angr,schieb/...
simuvex/procedures/libc.so.6/__read.py
simuvex/procedures/libc.so.6/__read.py
import simuvex import symexec ###################################### # __read ###################################### import struct class __read(simuvex.SimProcedure): def __init__(self, state, options=None, mode=None): simuvex.SimProcedure.__init__(self, state, options=options, mode=mode) if...
import simuvex import symexec ###################################### # __libc_start_main ###################################### import struct class __read(simuvex.SimProcedure): def __init__(self, state, options=None, mode=None): simuvex.SimProcedure.__init__(self, state, options=options, mode=mode) ...
bsd-2-clause
Python
68d20672102d62b426be12867cb2e2856bca488a
Update run.py
DEV3L/python-flask-example,DEV3L/python-flask-example
wsgi/run.py
wsgi/run.py
from flask import Flask app = Flask(__name__) # Create our index or root / route @app.route("/") @app.route("/index") def index(): return "Python - Hello World! v1.1 - Hi Candace" if __name__ == "__main__": app.run() # debug="True")
from flask import Flask app = Flask(__name__) # Create our index or root / route @app.route("/") @app.route("/index") def index(): return "Python - Hello World! v1.1 - Hi Mike" if __name__ == "__main__": app.run() # debug="True")
mit
Python
afa6687c317191b77949ba246f3dcc0909c435f5
Revert to Tag Detail URL pattern.
jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8
organizer/urls/tag.py
organizer/urls/tag.py
from django.conf.urls import url from ..views import ( TagCreate, TagDelete, TagDetail, TagList, TagPageList, TagUpdate) urlpatterns = [ url(r'^$', TagList.as_view(), name='organizer_tag_list'), url(r'^create/$', TagCreate.as_view(), name='organizer_tag_create'), ur...
from django.conf.urls import url from ..models import Tag from ..utils import DetailView from ..views import ( TagCreate, TagDelete, TagList, TagPageList, TagUpdate) urlpatterns = [ url(r'^$', TagList.as_view(), name='organizer_tag_list'), url(r'^create/$', TagCreate.as_view(),...
bsd-2-clause
Python
38abfd7fc311894fc13f324d77cf09b51362e9ce
clear global request when it's over
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/util/global_request/middleware.py
corehq/util/global_request/middleware.py
from __future__ import absolute_import from __future__ import unicode_literals from django.utils.decorators import method_decorator from django.utils.deprecation import MiddlewareMixin from django.views.decorators.debug import sensitive_post_parameters from .api import set_request class GlobalRequestMiddleware(Middl...
from __future__ import absolute_import from __future__ import unicode_literals from django.utils.decorators import method_decorator from django.utils.deprecation import MiddlewareMixin from django.views.decorators.debug import sensitive_post_parameters from .api import set_request class GlobalRequestMiddleware(Middl...
bsd-3-clause
Python
4485406ff0f74cd25c231d5e583418f9d460abef
Adjust format
ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools
cronjobs/extract_kalliope_originators.py
cronjobs/extract_kalliope_originators.py
#!/usr/bin/python3 import re import sys import xml.etree.ElementTree as ET valid_gnd = re.compile('[0-9\-X]+') def Main(): if len(sys.argv) != 2: print("Usage: " + sys.argv[0] + " kalliope_originator_record_file") exit(1) root = ET.parse(sys.argv[1]).getroot() gnds_and_type = {} for re...
#!/usr/bin/python3 import re import sys import xml.etree.ElementTree as ET valid_gnd = re.compile('[0-9\-X]+') def Main(): if len(sys.argv) != 2: print("Usage: " + sys.argv[0] + " kalliope_originator_record_file") exit(1) root = ET.parse(sys.argv[1]).getroot() gnds_and_type = {} for re...
agpl-3.0
Python
7b1d520278b8fe33b68103d26f9aa7bb945f6791
Make the default backend be a multi-backend
bwhmather/cryptography,Ayrx/cryptography,bwhmather/cryptography,Lukasa/cryptography,Ayrx/cryptography,bwhmather/cryptography,kimvais/cryptography,skeuomorf/cryptography,dstufft/cryptography,kimvais/cryptography,Lukasa/cryptography,dstufft/cryptography,Ayrx/cryptography,skeuomorf/cryptography,Lukasa/cryptography,sholsap...
cryptography/hazmat/backends/__init__.py
cryptography/hazmat/backends/__init__.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
bsd-3-clause
Python
317261b387264e96a86a4eab47d1415381b2ad89
Update tests
lucasdavid/edge
tests/algorithms_test.py
tests/algorithms_test.py
from unittest import TestCase from edge import algorithms, GraphGenerator class EdgeScoreTest(TestCase): def test_simple_graph(self): g = GraphGenerator(n=4).graph() algorithms.EdgeScore(g).solve() def test_random_graph(self): g = GraphGenerator(n=10, m=30).graph() algorithms...
from unittest import TestCase from edge import algorithms, GraphGenerator class EdgeScoreTest(TestCase): def test_simple_graph(self): g = GraphGenerator(n=4).weighted_graph() algorithms.EdgeScore(g).solve() def test_random_graph(self): g = GraphGenerator(n=10, m=30).weighted_graph() ...
mit
Python
0f3b413b269f8b95b6f8073ba39d11f156ae632c
Allow graceful exit from announcement test.
basilfx/python-zeroconf,daid/python-zeroconf,jstasiak/python-zeroconf,gbiddison/python-zeroconf,giupo/python-zeroconf,AndreaCensi/python-zeroconf,nameoftherose/python-zeroconf,balloob/python-zeroconf,wmcbrine/pyzeroconf,decabyte/python-zeroconf,jantman/python-zeroconf
zwebtest.py
zwebtest.py
from zeroconf import * import socket desc = {'path': '/~paulsm/'} info = ServiceInfo("_http._tcp.local.", "Paul's Test Web Site._http._tcp.local.", socket.inet_aton("10.0.1.2"), 80, 0, 0, desc, "ash-2.local.") r = Zeroconf() print "Registration of a service......
""" Multicast DNS Service Discovery for Python, v0.14-wmcbrine Copyright 2003 Paul Scott-Murphy, 2014 William McBrine This module provides a unit test suite for the Multicast DNS Service Discovery for Python module. This library is free software; you can redistribute it and/or modify it under the ...
lgpl-2.1
Python
41c3723f9bf8100f84e78c9173c97cd0aa95fd27
update fast test suite
dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy
tests/fast_test_suite.py
tests/fast_test_suite.py
import unittest from test_evaluation_metrics import EvaluationMetricsTestCase from test_appliance_trace import ApplianceTraceTestCase from test_appliance_instance import ApplianceInstanceTestCase from test_appliance_set import ApplianceSetTestCase from test_appliance_type import ApplianceTypeTestCase from test_utils im...
import unittest from test_evaluation_metrics import EvaluationMetricsTestCase from test_appliance_trace import ApplianceTraceTestCase from test_appliance_instance import ApplianceInstanceTestCase from test_appliance_set import ApplianceSetTestCase from test_appliance_type import ApplianceTypeTestCase from test_utils im...
mit
Python
5957999c52f939691cbe6b8dd5aa929980a24501
Remove the unused pytest import
kiwicom/iwant-bot
tests/unit/test_start.py
tests/unit/test_start.py
from iwant_bot import start def test_add(): assert start.add_numbers(0, 0) == 0 assert start.add_numbers(1, 1) == 2
import pytest from iwant_bot import start def test_add(): assert start.add_numbers(0, 0) == 0 assert start.add_numbers(1, 1) == 2
mit
Python
f5d4da9fa71dbb59a9459e376fde8840037bf39a
Remove import models from init in sepa_credit_transfer
open-synergy/bank-payment,sergio-incaser/bank-payment,hbrunn/bank-payment,sergio-teruel/bank-payment,ndtran/bank-payment,David-Amaro/bank-payment,rlizana/bank-payment,sergiocorato/bank-payment,damdam-s/bank-payment,CompassionCH/bank-payment,CompassionCH/bank-payment,incaser/bank-payment,Antiun/bank-payment,sergio-terue...
account_banking_sepa_credit_transfer/__init__.py
account_banking_sepa_credit_transfer/__init__.py
# -*- encoding: utf-8 -*- ############################################################################## # # SEPA Credit Transfer module for OpenERP # Copyright (C) 2010-2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you ...
# -*- encoding: utf-8 -*- ############################################################################## # # SEPA Credit Transfer module for OpenERP # Copyright (C) 2010-2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you ...
agpl-3.0
Python
5e4dfb0643e47677961cbb3ac551a5823bc53969
Fix version of the module.
akretion/account-fiscal-rule,thinkopensolutions/account-fiscal-rule
account_fiscal_position_rule_sale/__openerp__.py
account_fiscal_position_rule_sale/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################### # # account_fiscal_position_rule_sale for OpenERP # Copyright (C) 2009-TODAY Akretion <http://www.akretion.com> # @author Renato Lima <renato.lima@akretion.com> # Copyright 2012 Camptocamp SA # @author:...
# -*- coding: utf-8 -*- ############################################################################### # # account_fiscal_position_rule_sale for OpenERP # Copyright (C) 2009-TODAY Akretion <http://www.akretion.com> # @author Renato Lima <renato.lima@akretion.com> # Copyright 2012 Camptocamp SA # @author:...
agpl-3.0
Python
da7299b0ab00f1d8b8e25ec999cfc64b759766fa
update settings.py
cartologic/cartoview-project-template
project_name/settings.py
project_name/settings.py
# -*- coding: utf-8 -*- try: from .pre_settings import * except: pass import os from cartoview.app_manager.settings import load_apps from cartoview.settings import * PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(PROJECT_DIR) APPS_DIR = os.path.abspath(os.path.join(BASE_DI...
# -*- coding: utf-8 -*- try: from .pre_settings import * except: pass import os import cartoview PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(PROJECT_DIR) cartoview_settings_path = os.path.join( os.path.dirname(cartoview.__file__), 'settings.py') execfile(cartoview_s...
bsd-2-clause
Python
78c6eca923c4676c89bbfb2e51b6fba1894d97e8
allow other packages to extend karta namespace
fortyninemaps/karta,fortyninemaps/karta,fortyninemaps/karta
karta/__init__.py
karta/__init__.py
""" Karta is a collection of Python modules for handling vector and raster geospatial data. """ import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) __version__ = 0.4 __all__ = ["vector", "raster", "crs", "errors"] from . import vector from . import raster from . import crs from . import errors from .ve...
""" Karta is a collection of Python modules for handling vector and raster geospatial data. """ __version__ = 0.4 __all__ = ["vector", "raster", "crs", "errors"] from . import vector from . import raster from . import crs from . import errors from .vector import * from .raster import *
mit
Python
f1a1272bebcc4edf9063c75d3fe29fdcb9e277eb
Add PPChipInterpolator unit conversion class
willrogers/pml,razvanvasile/RML,willrogers/pml
rml/unitconversion.py
rml/unitconversion.py
import numpy as np from scipy.interpolate import PchipInterpolator class UnitConversion(): def __init__(self, coef): self.p = np.poly1d(coef) def machine_to_physics(self, machine_value): return self.p(machine_value) def physics_to_machine(self, physics_value): roots = (self.p - p...
import numpy as np class UnitConversion(): def __init__(self, coef): self.p = np.poly1d(coef) def machine_to_physics(self, machine_value): return self.p(machine_value) def physics_to_machine(self, physics_value): roots = (self.p - physics_value).roots positive_roots = [ro...
apache-2.0
Python
3a1da2dcdf8b6c30ff37319d9f1f696a9e0e9240
Fix bad job names
ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod
scheduler/schedule.py
scheduler/schedule.py
import sys import time import logging logging.basicConfig(level=logging.DEBUG) from redis import StrictRedis from rq import Queue from apscheduler.schedulers.blocking import BlockingScheduler sys.path.append('/d1lod') from d1lod import jobs conn = StrictRedis(host='redis', port='6379') q = Queue(connection=conn) sc...
import sys import time import logging logging.basicConfig(level=logging.DEBUG) from redis import StrictRedis from rq import Queue from apscheduler.schedulers.blocking import BlockingScheduler sys.path.append('/d1lod') from d1lod import jobs conn = StrictRedis(host='redis', port='6379') q = Queue(connection=conn) sc...
apache-2.0
Python
00e4663940ed1d22e768b3de3d1c645c8649aecc
Change to better argument name
Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary
src/WhiteLibrary/keywords/items/textbox.py
src/WhiteLibrary/keywords/items/textbox.py
from TestStack.White.UIItems import TextBox from WhiteLibrary.keywords.librarycomponent import LibraryComponent from WhiteLibrary.keywords.robotlibcore import keyword class TextBoxKeywords(LibraryComponent): @keyword def input_text_to_textbox(self, locator, input_value): """ Writes text to a t...
from TestStack.White.UIItems import TextBox from WhiteLibrary.keywords.librarycomponent import LibraryComponent from WhiteLibrary.keywords.robotlibcore import keyword class TextBoxKeywords(LibraryComponent): @keyword def input_text_to_textbox(self, locator, input): """ Writes text to a textbox...
apache-2.0
Python
dd52a967803d3f865a3c5757af838514f146bd09
Update the setup.py configurations
AKSW/KBox,AKSW/KBox
kbox.pip/setup.py
kbox.pip/setup.py
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup( name="KBox", version="0.0.2-alpha", author="Edgard Marx", author_email='edgard.marx@htwk-leipzig.de', url='https://github.com/AKSW/KBox/tree/master/kbox.pip', description="Python distributio...
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup( name="KBox", version="0.0.1", author="Edgard Marx", author_email='edgard.marx@htwk-leipzig.de', url='https://github.com/AKSW/KBox/tree/master/kbox.pip', description="application will allow u...
apache-2.0
Python
0afa393b3ff873f13e8d3a8d72f8bd1d455de583
Update the BUILD number to 4570.
google/mozc,fcitx/mozc,google/mozc,fcitx/mozc,fcitx/mozc,fcitx/mozc,google/mozc,google/mozc,google/mozc,fcitx/mozc
src/data/version/mozc_version_template.bzl
src/data/version/mozc_version_template.bzl
# Copyright 2010-2021, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
# Copyright 2010-2021, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
bsd-3-clause
Python
afce60fe351496895bfc724ac6a862a882f4f2cb
build GTK# from the 2.12 branch, not trunk
mono/bockbuild,BansheeMediaPlayer/bockbuild,bl8/bockbuild,bl8/bockbuild,bl8/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild
packages/gtk-sharp.py
packages/gtk-sharp.py
def svn_co_or_up (package): os.chdir ('..') if os.path.isdir ('svn'): os.chdir ('svn') os.system ('svn up') else: os.system ('svn co http://anonsvn.mono-project.com/source/branches/gtk-sharp-2-12-branch svn') os.chdir ('svn') os.chdir ('..') package = { 'name': 'gtk-sharp', 'version': '2.12.10-svn', ...
def svn_co_or_up (package): os.chdir ('..') if os.path.isdir ('gtk-sharp-svn'): os.chdir ('gtk-sharp-svn') os.system ('svn up') else: os.system ('svn co http://anonsvn.mono-project.com/source/trunk/gtk-sharp gtk-sharp-svn') os.chdir ('gtk-sharp-svn') os.chdir ('..') package = { 'name': 'gtk-sharp', 'v...
mit
Python
23f32962e136dae32b3165f15f8ef7e2d5319530
Set minimum lint-trap version to 0.4.0
Raynos/SublimeLinter-contrib-lint-trap
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # regex below borrowed from https://github.com/roadhump/SublimeLinter-eslint # and is MIT-licensed from roadhump. # # Written by andrewdeandrade # Copyright (c) 2014 andrewdeandrade # # License: MIT # """This module exports the...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # regex below borrowed from https://github.com/roadhump/SublimeLinter-eslint # and is MIT-licensed from roadhump. # # Written by andrewdeandrade # Copyright (c) 2014 andrewdeandrade # # License: MIT # """This module exports the...
mit
Python
e92d7b10f3cb066f9976d30ee76c431253d5d2a9
Bump version
laughingman7743/PyAthenaJDBC,laughingman7743/PyAthenaJDBC
pyathenajdbc/__init__.py
pyathenajdbc/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime __version__ = '1.0.3' __athena_driver_version__ = '1.0.0' # Globals https://www.python.org/dev/peps/pep-0249/#globals apilevel = '2.0' threadsafety = 3 paramstyle = 'pyformat' ATHENA_JAR = 'Athe...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime __version__ = '1.0.2' __athena_driver_version__ = '1.0.0' # Globals https://www.python.org/dev/peps/pep-0249/#globals apilevel = '2.0' threadsafety = 3 paramstyle = 'pyformat' ATHENA_JAR = 'Athe...
mit
Python
b71ccf6be3b06d58fd003b9c9bf0a1a272faa68c
Return section option keys in config cli when option is missing.
riga/law,riga/law
law/cli/config.py
law/cli/config.py
# -*- coding: utf-8 -*- """ "law config" cli subprogram. """ from law.config import Config from law.util import abort def setup_parser(sub_parsers): """ Sets up the command line parser for the *config* subprogram and adds it to *sub_parsers*. """ parser = sub_parsers.add_parser("config", prog="law ...
# -*- coding: utf-8 -*- """ "law config" cli subprogram. """ from law.config import Config from law.util import abort def setup_parser(sub_parsers): """ Sets up the command line parser for the *config* subprogram and adds it to *sub_parsers*. """ parser = sub_parsers.add_parser("config", prog="law ...
bsd-3-clause
Python
4ede3460847e7f42a26dbc0c48bd0506c6deac92
fix documentation
sdpython/python3_module_template
src/project_name/subproject2/myexample2.py
src/project_name/subproject2/myexample2.py
""" @file @brief This the documentation of this module (myexample2). The following documentation comes from a directive `runpython <http://www.xavierdupre.fr/app/pyquickhelper/helpsphinx/pyquickhelper/helpgen/sphinx_runpython_extension.html>`_ which outputs documentation on the standard output:: .. runpython:: ...
""" @file @brief This the documentation of this module (myexample2). The following documentation comes from a directive `runpython <http://www.xavierdupre.fr/app/pyquickhelper/helpsphinx/pyquickhelper/helpgen/sphinx_runpython_extension.html>`_ which outputs documentation on the standard output:: .. runpython:: ...
mit
Python
c94c835d196d9eaba1cf25f4a02eb6165969fe81
order factories: fix imports and model references
savoirfairelinux/santropol-feast,madmath/sous-chef,savoirfairelinux/santropol-feast,savoirfairelinux/sous-chef,savoirfairelinux/sous-chef,madmath/sous-chef,savoirfairelinux/santropol-feast,madmath/sous-chef,savoirfairelinux/sous-chef
django/santropolFeast/order/factories.py
django/santropolFeast/order/factories.py
# coding=utf-8 import factory from member.factories import MemberFactory from order.models import Order, Order_item class OrderFactory(factory.DjangoModelFactory): class Meta: model = Order order_date = '01/02/2016' type = "paid" value = "1223" client = MemberFactory order_items = "ma...
# coding=utf-8 import factory from santropolFeast.order.models import Order, OrderItem class OrderFactory(factory.DjangoModelFactory): class Meta: model = Order order_date = '01/02/2016' type = "paid" value = "1223" client = MemberFactory order_items = "main" class OrderItemFactory(...
agpl-3.0
Python
dc41177c9f1c3f3382951ea3b9c292a847c743a5
Change the server urls around, for disambiguation.
TomDataworks/angular-inventory,TomDataworks/angular-inventory
server/server/urls.py
server/server/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from accounts import views as views admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'django_inventory.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^django/inventor...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'django_inventory.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^django/inventory/$', 'inventory.views.index'), u...
agpl-3.0
Python
a14ffa36d94d36318cb26ca848696b875aeee800
Add logging
MaestroGraph/sparse-hyper
identity.experiment.py
identity.experiment.py
import sampling, hyper, gaussian import torch, random, sys from torch.autograd import Variable from torch import nn, optim from tqdm import trange from tensorboardX import SummaryWriter import matplotlib.pyplot as plt import util, logging logging.basicConfig(filename='run.log',level=logging.INFO) torch.manual_seed(2...
import sampling, hyper, gaussian import torch, random, sys from torch.autograd import Variable from torch import nn, optim from tqdm import trange from tensorboardX import SummaryWriter import matplotlib.pyplot as plt import util torch.manual_seed(2) """ Simple experiment: learn the identity function from one tensor...
mit
Python
78330da04edda6e29437703193582529a05599d3
Add __version__ to ipywidgets package
SylvainCorlay/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,ip...
ipywidgets/__init__.py
ipywidgets/__init__.py
import os from IPython import get_ipython from ._version import version_info, __version__ from .widgets import * def find_static_assets(): """Return the path to static assets for widgets (js, css)""" here = os.path.abspath(__file__) return os.path.join(os.path.dirname(here), 'static') def load_ipython_...
import os from IPython import get_ipython from .widgets import * def find_static_assets(): """Return the path to static assets for widgets (js, css)""" here = os.path.abspath(__file__) return os.path.join(os.path.dirname(here), 'static') def load_ipython_extension(ip): """Set up IPython to work wit...
bsd-3-clause
Python
78a711ce982a20b9e72d2b36e0ee746bf1725824
test the error case too
ImmobilienScout24/afp-cli,ImmobilienScout24/afp-cli,ImmobilienScout24/afp-cli
src/unittest/python/cli_functions_tests.py
src/unittest/python/cli_functions_tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from unittest2 import TestCase import afp_cli.cli_functions as cli from datetime import datetime class CliFunctionsTest(TestCase): def test_format_aws_credentials_with_prefix(self): credentials = {"AWS_ACCESS_KEY_ID": "testAccessKey"} self.assertEqua...
#!/usr/bin/env python # -*- coding: utf-8 -*- from unittest2 import TestCase import afp_cli.cli_functions as cli from datetime import datetime class CliFunctionsTest(TestCase): def test_format_aws_credentials_with_prefix(self): credentials = {"AWS_ACCESS_KEY_ID": "testAccessKey"} self.assertEqua...
apache-2.0
Python
ee81d7e85dd274573fcca169862a5f38794f90f1
add command 'adduser'
Muxi-Studio/guisheng2,Muxi-Studio/guisheng2,Muxi-Studio/guisheng2,Muxi-Studio/guisheng2,neo1218/guisheng2,neo1218/guisheng2,Muxi-Studio/guisheng2,neo1218/guisheng2,neo1218/guisheng2,neo1218/guisheng2
manage.py
manage.py
# -*- coding: UTF-8 -*- # !/usr/bin/python """ manage.py ~~~~~~~~~ 桂声APP管理文件 1.app对象创建 2.数据库管理 1>数据库迁移: python manage.py db init; python manage.py db migrate -m "#" 2>数据库更新: python manage.py db upgrade 3>虚拟数据创建: python manage.py shell >>>User.generate_...
# -*- coding: UTF-8 -*- # !/usr/bin/python """ manage.py ~~~~~~~~~ 桂声APP管理文件 1.app对象创建 2.数据库管理 1>数据库迁移: python manage.py db init; python manage.py db migrate -m "#" 2>数据库更新: python manage.py db upgrade 3>虚拟数据创建: python manage.py shell >>>User.generate_...
mit
Python
5cbae4953ea0bde97b0cf7cd914a3a5263fa74be
Make base module default DJANGO_SETTINGS_MODULE
jpadilla/feedleap,jpadilla/feedleap
manage.py
manage.py
#!/usr/bin/env python import os import sys import re def read_env(): """Pulled from Honcho code with minor updates, reads local default environment variables from a .env file located in the project root directory. """ try: with open('.env') as f: content = f.read() except ...
#!/usr/bin/env python import os import sys import re def read_env(): """Pulled from Honcho code with minor updates, reads local default environment variables from a .env file located in the project root directory. """ try: with open('.env') as f: content = f.read() except ...
mit
Python
13ce4e0ea514627e1cbab17ce7fae4744f229fcf
Remove test command from manage.py
ets-labs/dependency_injector,rmk135/objects,rmk135/dependency_injector,ets-labs/python-dependency-injector
manage.py
manage.py
"""CLI Commands.""" import os from setup import version from manager import Manager manager = Manager() @manager.command def publish(with_tag=True): """Publish current version to PyPi.""" os.system('python setup.py sdist upload') if with_tag: tag() @manager.command def tag(): """Make tag ...
"""CLI Commands.""" import os from setup import version from manager import Manager manager = Manager() @manager.command def publish(with_tag=True): """Publish current version to PyPi.""" os.system('python setup.py sdist upload') if with_tag: tag() @manager.command def tag(): """Make tag ...
bsd-3-clause
Python
f7b979eb0352b9db003e46154bf056b6258500b3
Add unittests command to manager.
sthoma/gramhammer.com,sthoma/gramhammer.com,sthoma/flask-jumpstart,sthoma/gramhammer.com,sthoma/flask-jumpstart
manage.py
manage.py
import os COV = None if os.environ.get('FLASK_COVERAGE'): import coverage COV = coverage.coverage(branch=True, include='app/*') COV.start() if os.path.exists('.env-vars'): print('Importing environment from .env-vars...'), for line in open('.env-vars'): var = line.strip().split('=') ...
import os if os.path.exists('.env-vars'): print('Importing environment from .env-vars...'), for line in open('.env-vars'): var = line.strip().split('=') if len(var) == 2: os.environ[var[0]] = var[1] print('complete!') from app import create_app from flask.ext.script import Man...
mit
Python
c7385d532534abd43b4f3bf506f01af51443da06
Fix test runner management command to explicitly run from virtualenv
ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public
manage.py
manage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import subprocess import sys from flask_script import Manager, Shell, Server from cla_public.app import create_app log = logging.getLogger(__name__) os.environ.setdefault('CLA_PUBLIC_CONFIG', 'config/base.py') app = create_app() manager = Manage...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import shlex import subprocess import sys from flask_script import Manager, Shell, Server from cla_public.app import create_app log = logging.getLogger(__name__) os.environ.setdefault('CLA_PUBLIC_CONFIG', 'config/base.py') app = create_app() mana...
mit
Python
a75e564e35e2f2f0e2a71d9c1ff2b022a38fdeaa
fix docstring & error messages"
Djiit/err-meetup
meetup.py
meetup.py
# coding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) from datetime import datetime import json try: from http import client except ImportError: import httplib as client from jinja2 import Environment from errbot import BotPlugin, botcmd ...
# coding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) from datetime import datetime import json try: from http import client except ImportError: import httplib as client from jinja2 import Environment from errbot import BotPlugin, botcmd ...
mit
Python
385e33681614318b237592a69c6d55b4e386822c
switch back to prior version and fixed tag to be class level attribute.
UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,Baumelbi/IntroPython2016,weidnem/IntroPython2016,Baumelbi/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016
students/crobison/session07/html_render.py
students/crobison/session07/html_render.py
#!/usr/bin/env python3 class Element: tag = "html" def __init__(self, content=None): self.content = [] if content is not None: self.content.append(content) def append(self, content): self.content.append(content) def render(self, out_file, indent=""): out_fi...
#!/usr/bin/env python3 class Element: def __init__(self, content=None): self.content = [] self.tag = "html" if content is not None: self.content.append(content) def append(self, content): self.content.append(content) def render(self, out_file, indent=""): ...
unlicense
Python