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 |
|---|---|---|---|---|---|---|---|---|
bfa01854a629d66c3beb6f60bbcdb7036bb81013 | 添加utf-8编码头 | encorehu/webqq | webqq/client.py | webqq/client.py | # -*- coding: utf-8 -*-
class WebQQClient(object):
def __init__(self, *args, **kwargs):
self.handle_count = 0
self.set_runflag(False)
def login(self, username=None, password=None):
self.set_runflag(True)
return True
def logout(self):
pass
def hea... | class WebQQClient(object):
def __init__(self, *args, **kwargs):
self.handle_count = 0
self.set_runflag(False)
def login(self, username=None, password=None):
self.set_runflag(True)
return True
def logout(self):
pass
def heartbeat(self):
prin... | mit | Python |
7afbcde733f4654d6c66a7c2bc701e07a80df804 | add modular exponentiation by repetitive squarring | divkakwani/cryptos | cryptos/numt.py | cryptos/numt.py | """
Collection of some useful number theoretic functions
@author: Divyanshu Kakwani <divkakwani@gmail.com>
@license: MIT
"""
from math import sqrt
def naive_primality_test(n):
"""
Returns true iff n is a prime number
"""
return (n > 2) and (n % 2 != 0) and all(n % i for i in range(3, int(sqrt(n))+1,... | """
Collection of some useful number theoretic functions
@author: Divyanshu Kakwani <divkakwani@gmail.com>
@license: MIT
"""
from math import sqrt
def naive_primality_test(n):
"""
Returns true iff n is a prime number
"""
return (n > 2) and (n % 2 != 0) and all(n % i for i in range(3, int(sqrt(n))+1,... | mit | Python |
56e764835e75035452a6a1ea06c386ec61dbe872 | Fix the auto-generated docstrings of style sheets | brechtm/rinohtype,brechtm/rinohtype,brechtm/rinohtype | src/rinoh/stylesheets/__init__.py | src/rinoh/stylesheets/__init__.py | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import inspect
import os
import sys
from .. import DATA... | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import inspect
import os
import sys
from .. import DATA... | agpl-3.0 | Python |
ed6fa1639057d938d60a936d99d71a07c0c8aea3 | add default route to admin | allen-garvey/block-quote-django | block_quote_2/urls.py | block_quote_2/urls.py | """block_quote_2 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | """block_quote_2 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | mit | Python |
c5677decd3612a793a17a4b2a8cf7176e6f0e016 | bump to 0.86.3 | efiop/dvc,dmpetrov/dataversioncontrol,efiop/dvc,dmpetrov/dataversioncontrol | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.86.3"
def _generate_version(base_version):
"""Generate a versio... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.86.2"
def _generate_version(base_version):
"""Generate a versio... | apache-2.0 | Python |
7a31a35cbf531213f6bca529004dac44a350b1e4 | bump to 1.0.0b0 | dmpetrov/dataversioncontrol,efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "1.0.0b0"
def _generate_version(base_version):
"""Generate a versio... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "1.0.0a11"
def _generate_version(base_version):
"""Generate a versi... | apache-2.0 | Python |
c989b28eae536f08767d3cb32e790187d63a581b | bump to 1.10.2 | dmpetrov/dataversioncontrol,efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "1.10.2"
def _generate_version(base_version):
"""Generate a version... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "1.10.1"
def _generate_version(base_version):
"""Generate a version... | apache-2.0 | Python |
1ea8c68f8abe897750857c7ad4b6cfd42dc7cf4d | add 'std' condition to VersionList.print() | CaptainDesAstres/Simple-Blender-Render-Manager,CaptainDesAstres/Blender-Render-Manager | settingMod/VersionList.py | settingMod/VersionList.py | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage list of all know version of Blender in the system'''
import xml.etree.ElementTree as xmlMod
import os
class VersionList:
'''class dedicated to Blender version managing'''
def __init__(self, xml= None):
'''initialize Blender version list with default... | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage list of all know version of Blender in the system'''
import xml.etree.ElementTree as xmlMod
import os
class VersionList:
'''class dedicated to Blender version managing'''
def __init__(self, xml= None):
'''initialize Blender version list with default... | mit | Python |
af83923ff8b4a8a8dd94c4d0a1e494a22e7a528e | Add boot compare API endpoint | kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend | app/dashboard/default_settings.py | app/dashboard/default_settings.py | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | lgpl-2.1 | Python |
b6a65532517a0011cce49210a0c4aaa929ffcc03 | bump version | ArabellaTech/ydcommon,ArabellaTech/ydcommon,ArabellaTech/ydcommon | ydcommon/__init__.py | ydcommon/__init__.py | """
YD Technology common libraries
"""
VERSION = (0, 1, 24)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns shorter version (digit parts only) as string.
"""
version = '.'.join((str(each) for each in VERSION[:3]))
if len(VERSION) > 3:
version +=... | """
YD Technology common libraries
"""
VERSION = (0, 1, 23)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns shorter version (digit parts only) as string.
"""
version = '.'.join((str(each) for each in VERSION[:3]))
if len(VERSION) > 3:
version +=... | mit | Python |
8817b16941c658b8d67043cdb861f2fefef9d87e | add easy access to cuds classes | simphony/simphony-common | simphony/cuds/__init__.py | simphony/cuds/__init__.py | from .abc_lattice import ABCLattice
from .abc_mesh import ABCMesh
from .abc_particles import ABCParticles
from .mesh import Mesh, Point, Element, Edge, Face, Cell
from .lattice import Lattice, LatticeNode
from .particles import Particles, Particle, Bond
__all__ = [
'ABCLattice', 'ABCMesh', 'ABCParticles',
'Mes... | bsd-2-clause | Python | |
bc76ddcac23aedadd99663bab0c476979c35445c | update pick_work_order_server for new json format | pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc | jsk_arc2017_common/node_scripts/pick_work_order_server.py | jsk_arc2017_common/node_scripts/pick_work_order_server.py | #!/usr/bin/env python
from jsk_arc2017_common.msg import WorkOrder
from jsk_arc2017_common.msg import WorkOrderArray
import json
import os.path as osp
import rospy
class WorkOrderServer(object):
def __init__(self):
json_dir = rospy.get_param('~json_dir', None)
self.rate = rospy.get_param('~rate'... | #!/usr/bin/env python
from jsk_arc2017_common.msg import WorkOrder
from jsk_arc2017_common.msg import WorkOrderArray
import json
import rospy
class WorkOrderServer(object):
def __init__(self):
self.json_file = rospy.get_param('~json', None)
self.rate = rospy.get_param('~rate', 1.0)
if se... | bsd-3-clause | Python |
b202a94ebfb53f69d646aeb358ba0b85b35f5479 | Allow uppercase input for Word Cookie letters | atpage/computer_club | word_cookies/solver.py | word_cookies/solver.py | #!/usr/bin/env python
"""Goal: find all the valid words in a dictionary that use only the specified
letters."""
################################### Imports: ###################################
import argparse
################################## Functions: ##################################
def load_dict(dict_filena... | #!/usr/bin/env python
"""Goal: find all the valid words in a dictionary that use only the specified
letters."""
################################### Imports: ###################################
import argparse
################################## Functions: ##################################
def load_dict(dict_filena... | mit | Python |
32fe75b36d9d143b0bf8f94eba635f71524a2edc | Add load of properties from Uploader ini file | tomdoel/pyxnatbrowser | browser/configsave.py | browser/configsave.py | import os
from configparser import ConfigParser
from browser.PropertyParser import PropertyParser
from browser.browserconfiguration import BrowserConfiguration
from database.restconfiguration import RestConfiguration
class ConfigSave(object):
def __init__(self, file_name, default_configuration):
self.def... | import os
from configparser import ConfigParser
from database.restconfiguration import RestConfiguration
class ConfigSave(object):
def __init__(self, file_name, default_configuration):
self.default_configuration = default_configuration
self.file_name = file_name
def load(self):
confi... | bsd-2-clause | Python |
e9df17b0319e50351cdaa39abb504dfafc77de6d | Use port 81 instead of 8889. | MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension | glitch/config.py | glitch/config.py | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
#server_domain = "http://www.infiniteglitch.net"
server_domain = "http://50.116.55.59"
http_port = 8888 # Port for the main web site, in debug mode
renderer_port = 81... | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
#server_domain = "http://www.infiniteglitch.net"
server_domain = "http://50.116.55.59"
http_port = 8888 # Port for the main web site, in debug mode
renderer_port = 88... | artistic-2.0 | Python |
01d0eed0197c006fdd3f6ba902872191d3090ba2 | Test failed clone behavior | grade-it/grader,redkyn/grader,redkyn/grader | grader/grader/test/test_new.py | grader/grader/test/test_new.py | import os
import pytest
import yaml
def test_new_without_repo(parse_and_run):
"""Test vanilla assignment initialization
"""
path = parse_and_run(["init", "cpl"])
parse_and_run(["new", "assignment1"])
a_path = os.path.join(path, "assignments", "assignment1")
gs_path = os.path.join(a_path, "gra... | import os
import pytest
import yaml
def test_new_without_repo(parse_and_run):
"""Test vanilla assignment initialization
"""
path = parse_and_run(["init", "cpl"])
parse_and_run(["new", "assignment1"])
a_path = os.path.join(path, "assignments", "assignment1")
gs_path = os.path.join(a_path, "gra... | mit | Python |
9b34aad2b17dadd50ea7836093cef6a11f1734af | Add a request context. | pnomolos/greatbigcrane,pnomolos/greatbigcrane | greatbigcrane/project/views.py | greatbigcrane/project/views.py | from django.shortcuts import render_to_response
from django.views.generic.list_detail import object_list
from django.views.generic.list_detail import object_detail
from django.views.generic.create_update import create_object
from django.template import RequestContext
from project.models import Project
def index(reques... | from django.shortcuts import render_to_response
from django.views.generic.list_detail import object_list
from django.views.generic.list_detail import object_detail
from django.views.generic.create_update import create_object
from project.models import Project
def index(request):
'''We should move this to a differe... | apache-2.0 | Python |
d7071c5fa5a76b81182c2a00ec835c825d837e97 | add auto generated spec test for changed file | mick-d/nipype,mick-d/nipype,mick-d/nipype,mick-d/nipype | nipype/interfaces/ants/tests/test_auto_BrainExtraction.py | nipype/interfaces/ants/tests/test_auto_BrainExtraction.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..segmentation import BrainExtraction
def test_BrainExtraction_inputs():
input_map = dict(anatomical_image=dict(argstr='-a %s',
mandatory=True,
),
args=dict(argstr='%s',
),
brain_probability_mask=di... | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..segmentation import BrainExtraction
def test_BrainExtraction_inputs():
input_map = dict(anatomical_image=dict(argstr='-a %s',
mandatory=True,
),
args=dict(argstr='%s',
),
brain_probability_mask=di... | bsd-3-clause | Python |
ebcc1949ae64420fea46b1d768dbf5eeef8906d2 | Fix TypoFail | Pynitus-Universe/Pynitus,Pynitus-Universe/Pynitus-Backend,Pynitus-Universe/Pynitus,Pynitus-Universe/Pynitus-Backend | src/data/Tagging/TagReader.py | src/data/Tagging/TagReader.py | import taglib
from typing import Dict, List
from src.data.Tagging.TagSupport import TAGLIB_INTERNAL_NAMES
class TagReader(object):
def __init__(self, file_path: str) -> None:
"""
Construct Audio File Tag
:param file_path: Path to File (types that tests passed .aiff, .flac, .m4a, .mp3, .ogg... | import taglib
from typing import Dict, List
from src.data.Tagging.TagSupport import TAGLIB_INTERNAL_NAMES
class TagReader(object):
def __init__(self, file_path: str) -> None:
"""
Construct Audio File Tag
:param file_path: Path to File (types that tests passed .aiff, .flac, .m4a, .mp3, .ogg... | agpl-3.0 | Python |
2139f3f0b1331622c98eb534d608336f9991a384 | Use mode 'wb' when writing preparsed templates to filesystem due to corresponds with Windows platform. | IanLewis/kay,IanLewis/kay,IanLewis/kay,IanLewis/kay | kay/utils/jinja2utils/compiler.py | kay/utils/jinja2utils/compiler.py | # -*- coding: utf-8 -*-
"""
gaefy.jinja2.compiler
~~~~~~~~~~~~~~~~~~~~~
Helper functions to parse Jinja2 templates and store them as Python code.
The compiled templates can be loaded using gaefy.jinja2.code_loaders,
avoiding all the parsing process.
To compile a whole dir:
from jinja2 import Environment
from gae... | # -*- coding: utf-8 -*-
"""
gaefy.jinja2.compiler
~~~~~~~~~~~~~~~~~~~~~
Helper functions to parse Jinja2 templates and store them as Python code.
The compiled templates can be loaded using gaefy.jinja2.code_loaders,
avoiding all the parsing process.
To compile a whole dir:
from jinja2 import Environment
from gae... | bsd-3-clause | Python |
8049e5fd59c623f5930a087bcc95355c2a3de2a8 | Add 'missing' space in "Where are you?" (#161) | jackm/Kijiji-Repost-Headless | kijiji_repost_headless/get_ids.py | kijiji_repost_headless/get_ids.py | import json
import requests
def find_where(d, area_id=None):
"""
:param d: dictionary available here: http://www.kijiji.ca/j-locations.json
:param area_id: string, parent's region's ID
:return: tuple, containing the location id and area id of the selected_dict region
"""
list_of_dicts = sort... | import json
import requests
def find_where(d, area_id=None):
"""
:param d: dictionary available here: http://www.kijiji.ca/j-locations.json
:param area_id: string, parent's region's ID
:return: tuple, containing the location id and area id of the selected_dict region
"""
list_of_dicts = sort... | mit | Python |
fbabc3680ddaba5ab7a0683f367dfaa268b47ba4 | Return something when setting status endpoint, mostly for ease of debugging. | openaustralia/scraperwiki-python,tlevine/scraperwiki-python,openaustralia/scraperwiki-python,scraperwiki/scraperwiki-python,scraperwiki/scraperwiki-python,tlevine/scraperwiki-python,hudsonkeithl/scraperwiki-python,hudsonkeithl/scraperwiki-python | scraperwiki/utils.py | scraperwiki/utils.py | #!/usr/bin/env python2
# utils.py
# David Jones, ScraperWiki Limited
# Thomas Levine, ScraperWiki Limited
'''
Local version of ScraperWiki Utils, documentation here:
https://scraperwiki.com/docs/python/python_help_documentation/
'''
import os
import warnings
import tempfile
import urllib, urllib2
import requests
def... | #!/usr/bin/env python2
# utils.py
# David Jones, ScraperWiki Limited
# Thomas Levine, ScraperWiki Limited
'''
Local version of ScraperWiki Utils, documentation here:
https://scraperwiki.com/docs/python/python_help_documentation/
'''
import os
import warnings
import tempfile
import urllib, urllib2
import requests
def... | bsd-2-clause | Python |
fdb4f9c1bf121772387183f71223cbd0153d1901 | include all binary data | schriftgestalt/drawbot | setupAsModule.py | setupAsModule.py | #!/usr/bin/env python
from setuptools import setup
from drawBotSettings import __version__
try:
import fontTools
except:
print "*** Warning: drawBot requires FontTools, see:"
print " https://github.com/behdad/fonttools"
try:
import vanilla
except:
print "*** Warning: drawBot requires vanilla,... | #!/usr/bin/env python
from setuptools import setup
from drawBotSettings import __version__
try:
import fontTools
except:
print "*** Warning: drawBot requires FontTools, see:"
print " https://github.com/behdad/fonttools"
try:
import vanilla
except:
print "*** Warning: drawBot requires vanilla,... | bsd-2-clause | Python |
3f3d876274287b164275ee66c808f31d92b3a774 | Add published_time_telegram to publish_date tags (#55) | goose3/goose3,goose3/goose,goose3/goose,goose3/goose3 | goose3/extractors/publishdate.py | goose3/extractors/publishdate.py | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 | Python |
345ac9ba7dfa95f9dd76650346bb68592162e612 | Rename obsolete "description" key to "message" for job information | SmartJog/spvd | share/basejob.py | share/basejob.py | """ BaseJob class definitions. """
import logging
import traceback
class BaseJobRuntimeError(Exception):
""" BaseJob Exceptions. """
def __init__(self, error):
""" Init method. """
Exception.__init__(self, error)
class BaseJob:
""" Base class for job implementation in spvd. """
de... | """ BaseJob class definitions. """
import logging
import traceback
class BaseJobRuntimeError(Exception):
""" BaseJob Exceptions. """
def __init__(self, error):
""" Init method. """
Exception.__init__(self, error)
class BaseJob:
""" Base class for job implementation in spvd. """
de... | lgpl-2.1 | Python |
ba81417fee88b55f323ada191879c487e001e8e1 | Add installer admin | lutris/website,lutris/website,Turupawn/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,Turupawn/website | games/admin.py | games/admin.py | """Admin configuration for Lutris games"""
from django.contrib import admin
from . import models
class CompanyAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ("name", )}
ordering = ('name', )
class PlatformAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
ordering = ('name'... | """Admin configuration for Lutris games"""
from django.contrib import admin
from . import models
class CompanyAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ("name", )}
ordering = ('name', )
class PlatformAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
ordering = ('name'... | agpl-3.0 | Python |
72debbe3340292e1f3ff6c44d6f1d65aec677ee9 | Update getEdgelist.py | lorcan/edgetools,lorcan/edgetools | getEdgelist.py | getEdgelist.py | #!/usr/bin/python
import argparse
import string
import csv
import heapq
from sets import Set
parser = argparse.ArgumentParser(description='Takes a file containing ego identifiers (the seed egos) and a csv edgelist file and produces the subset of the edgelist containing all lines where the first entry is one of the see... | import argparse
import string
import csv
import heapq
from sets import Set
parser = argparse.ArgumentParser(description='Takes a file containing ego identifiers (the seed egos) and a csv edgelist file and produces the subset of the edgelist containing all lines where the first entry is one of the seed list. The edgeli... | mit | Python |
fae4571fdb472add8aa716663578c314d1fffbd2 | Update version.py | peterk87/sistr_cmd | sistr/version.py | sistr/version.py | __version__ = '0.3.5'
| __version__ = '0.3.4'
| apache-2.0 | Python |
a125521554c4b22122f6d3c531bcb77f1dd82dc5 | Update multi docs | CactusDev/CactusBot | cactusbot/commands/magic/multi.py | cactusbot/commands/magic/multi.py | """Generate a multistream link."""
from . import Command
from ...packets import MessagePacket
_BASE_URL = "https://multistream.me/"
_SERVICES = ['t', 'b', 'h', 'y']
class MultiStream(Command):
"""Generate a multistream link."""
COMMAND = "multi"
@Command.command(hidden=True)
async def default(self... | """Generate a multistream link."""
from . import Command
from ...packets import MessagePacket
_BASE_URL = "https://multistream.me/"
_SERVICES = ['t', 'b', 'h', 'y']
class MultiStream(Command):
"""Generate a multistream link."""
COMMAND = "multi"
@Command.command(hidden=True)
async def default(self... | mit | Python |
3e0adb422ad0bfd4fb49a434c69e1175ea63ddbe | add date_added to subtitle storage, fixes #59 | pannal/Subliminal.bundle,pannal/Subliminal.bundle,pannal/Subliminal.bundle | Contents/Code/support/storage.py | Contents/Code/support/storage.py | # coding=utf-8
import datetime
def storeSubtitleInfo(videos, subtitles, storage_type):
"""
stores information about downloaded subtitles in plex's Dict()
"""
if not "subs" in Dict:
Dict["subs"] = {}
storage = Dict["subs"]
for video, video_subtitles in subtitles.items():
part = videos[video... | # coding=utf-8
import datetime
def storeSubtitleInfo(videos, subtitles, storage_type):
"""
stores information about downloaded subtitles in plex's Dict()
"""
if not "subs" in Dict:
Dict["subs"] = {}
storage = Dict["subs"]
for video, video_subtitles in subtitles.items():
part = videos[video... | mit | Python |
46029b19af4a410ef527ea4a5384dd311c41f754 | remove print | SonyCSL/CSLAIER,SonyCSL/CSLAIER,SonyCSL/CSLAIER,SonyCSL/CSLAIER | src/deeplearning/train/utils.py | src/deeplearning/train/utils.py | import shutil
import os
def remove_resume_file(base_path):
try:
shutil.rmtree(os.path.join(base_path, 'resume'))
except OSError:
pass
| import shutil
import os
def remove_resume_file(base_path):
print('remove_resume_file')
try:
shutil.rmtree(os.path.join(base_path, 'resume'))
except OSError:
pass
| mit | Python |
fe0f4f9826fc7b0d095fb7399898535ff4d6157c | fix a doc error | chainer/chainer,chainer/chainer,wkentaro/chainer,rezoo/chainer,cupy/cupy,wkentaro/chainer,anaruse/chainer,okuta/chainer,aonotas/chainer,pfnet/chainer,ysekky/chainer,jnishi/chainer,wkentaro/chainer,keisuke-umezawa/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,niboshi/chainer,chainer/chainer,okuta/chainer,jnishi/ch... | chainer/datasets/tuple_dataset.py | chainer/datasets/tuple_dataset.py | import six
class TupleDataset(object):
"""Dataset of a tuple of datasets.
It combines multiple datasets into one dataset. Each example is represented
by a tuple whose ``i``-th item corresponds to the i-th dataset.
Args:
datasets: Underlying datasets. The ``i``-th one is used for the
... | import six
class TupleDataset(object):
"""Dataset of a tuple of datasets.
It combines multiple datasets into one dataset. Each example is represented
by a tuple whose ``i``-th item corresponds to the i-th dataset.
Args:
datasets: Underlying datasets. The ``i``-th one is used for the
... | mit | Python |
27deb367c8fb080ad3a05c684920d2a90fb207f5 | Make _CustomAnalyzer a private class | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/analyze/python_analyzer.py | hoomd/analyze/python_analyzer.py | from hoomd.python_action import _PythonAction, _InternalPythonAction
from hoomd.custom_action import _CustomAction, _InternalCustomAction
class _CustomAnalyzer(_CustomAction):
def analyze(self, timestep):
return self.act(timestep)
class _InternalCustomAnayzer(_InternalCustomAction):
def analyze(self... | from hoomd.python_action import _PythonAction, _InternalPythonAction
from hoomd.custom_action import _CustomAction, _InternalCustomAction
class CustomAnalyzer(_CustomAction):
def analyze(self, timestep):
return self.act(timestep)
class _InternalCustomAnayzer(_InternalCustomAction):
def analyze(self,... | bsd-3-clause | Python |
4cfdb4f8fc13b8e501712bb60742b41f52193f09 | Add new property in constructor | Relrin/Helenae,Relrin/Helenae,Relrin/Helenae | helenae/utils/statuschecker.py | helenae/utils/statuschecker.py | import sys
from twisted.internet.task import deferLater
from twisted.internet import reactor
from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS
CONFIG_IP = 'localhost'
CONFIG_PORT = 9000
def isOffline(status):
print '%s|%d|%s' % (CONFIG_IP, CONFIG_PORT, status)
c... | import sys
from twisted.internet.task import deferLater
from twisted.internet import reactor
from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS
CONFIG_IP = 'localhost'
CONFIG_PORT = 9000
def isOffline(status):
print '%s|%d|%s' % (CONFIG_IP, CONFIG_PORT, status)
c... | mit | Python |
5d4ad5e38f70d1784e608e4340b8e0a09ab8f974 | index the order field | sunlightlabs/coleslaw,sunlightlabs/coleslaw,sunlightlabs/coleslaw,sunlightlabs/coleslaw | laws/models.py | laws/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.core.urlresolvers import reverse
class Law(models.Model):
#
# Note that there can be multiple entries with the same title, section,
# and psection, because of the nested structure.
#
# Title 1, sec 13 # order 1
... | # -*- coding: utf-8 -*-
from django.db import models
from django.core.urlresolvers import reverse
class Law(models.Model):
#
# Note that there can be multiple entries with the same title, section,
# and psection, because of the nested structure.
#
# Title 1, sec 13 # order 1
... | bsd-3-clause | Python |
6e73c9cddbda60389d4ae63184dda6d9e86b0761 | modify path | belheber/le-comparateur,belheber/le-comparateur,belheber/le-comparateur | compareprice/views.py | compareprice/views.py | from django.shortcuts import render
from subprocess import Popen
from .forms import SerachForm
# Create your views here.
from pkgs.webscrap import scrap as sc
from pkgs.webscrap import all
Popen(["Python","./pkgs/webscrap/scraper.py"], close_fds=True)
def get_name(request):
product = ''
# if this is a POST ... | from django.shortcuts import render
from subprocess import Popen
from .forms import SerachForm
# Create your views here.
from pkgs.webscrap import scrap as sc
from pkgs.webscrap import all
Popen(["Python","scraper.py"], close_fds=True)
def get_name(request):
product = ''
# if this is a POST request we need ... | mit | Python |
f9549565e630d721bbb4cba84f0b09bafbb84d59 | Implement file deletion | mgarbacz/bucketeer | bucketeer/uploader.py | bucketeer/uploader.py | import boto, os, hashlib
# We want to upload all modified files to the s3 bucket
def upload(bucket_name, src_folder):
success = False
try:
# Requires S3 creds, which are set as environment variables
connection = boto.connect_s3();
bucket = connection.lookup(bucket_name)
if bucket == None:
#... | import boto, os, hashlib
# We want to upload all modified files to the s3 bucket
def upload(bucket_name, src_folder):
success = False
try:
# Requires S3 creds, which are set as environment variables
connection = boto.connect_s3();
bucket = connection.lookup(bucket_name)
if bucket == None:
#... | mit | Python |
d6383f02f60268dfd7e4226a2915afeccc66a776 | Add a test | bjodah/symengine.py,symengine/symengine.py,bjodah/symengine.py,bjodah/symengine.py,symengine/symengine.py,symengine/symengine.py | csympy/tests/test_functions.py | csympy/tests/test_functions.py | from csympy import Symbol, sin, cos, sqrt, Add, function_symbol
def test_sin():
x = Symbol("x")
e = sin(x)
assert e == sin(x)
assert e != cos(x)
assert sin(x).diff(x) == cos(x)
assert cos(x).diff(x) == -sin(x)
e = sqrt(x).diff(x).diff(x)
f = sin(e)
g = f.diff(x).diff(x)
assert... | from csympy import Symbol, sin, cos, sqrt, Add, function_symbol
def test_sin():
x = Symbol("x")
e = sin(x)
assert e == sin(x)
assert e != cos(x)
assert sin(x).diff(x) == cos(x)
assert cos(x).diff(x) == -sin(x)
e = sqrt(x).diff(x).diff(x)
f = sin(e)
g = f.diff(x).diff(x)
assert... | mit | Python |
22dd723aa3a057e6e8c114bf8b7692f187b489d1 | Fix bug in method name | joaduo/xpathwebdriver,joaduo/xpathwebdriver | xpathwebdriver/base.py | xpathwebdriver/base.py | # -*- coding: utf-8 -*-
'''
Smoothtest
Copyright (c) 2014, Juju inc.
Copyright (c) 2011-2013, Joaquin G. Duo
'''
import rel_imp; rel_imp.init()
import logging
import re
import os
from .logger import Logger
from .solve_settings import solve_settings, register_settings
class singleton_decorator(object):
'''
... | # -*- coding: utf-8 -*-
'''
Smoothtest
Copyright (c) 2014, Juju inc.
Copyright (c) 2011-2013, Joaquin G. Duo
'''
import rel_imp; rel_imp.init()
import logging
import re
import os
from .logger import Logger
from .solve_settings import solve_settings, register_settings
class singleton_decorator(object):
'''
... | mit | Python |
b448d52e5a30346633dd20e52431af39eb6859ec | Remove the pointless cluster health check | despawnerer/theatrics,despawnerer/theatrics,despawnerer/theatrics | importer/importer/connections.py | importer/importer/connections.py | import aioes
from .utils import wait_for_all_services
from .settings import ELASTICSEARCH_ENDPOINTS
async def connect_to_elasticsearch():
print("Connecting to Elasticsearch...")
await wait_for_all_services(ELASTICSEARCH_ENDPOINTS, timeout=10)
elastic = aioes.Elasticsearch(ELASTICSEARCH_ENDPOINTS)
re... | import aioes
from .utils import wait_for_all_services
from .settings import ELASTICSEARCH_ENDPOINTS
async def connect_to_elasticsearch():
print("Connecting to Elasticsearch...")
await wait_for_all_services(ELASTICSEARCH_ENDPOINTS, timeout=10)
elastic = aioes.Elasticsearch(ELASTICSEARCH_ENDPOINTS)
aw... | mit | Python |
70d435e1176a1132db6a04c34c04567df354d1d9 | Send weekly report to aws | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/reports/management/commands/mi_cb1_report.py | cla_backend/apps/reports/management/commands/mi_cb1_report.py | # coding=utf-8
import logging
from django.core.management.base import BaseCommand
from reports.tasks import ExportTask
from core.models import get_web_user
from django.views.decorators.csrf import csrf_exempt
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"... | # coding=utf-8
import logging
from django.core.management.base import BaseCommand
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"
def handle(self, *args, **options):
self.create_report()
def create_report():
print("stuff goes her... | mit | Python |
1d30e3c9be05724c40e7dc2d715c4eb74d35b536 | Fix TaskUpdateView to work with POST and only POST | PersonalGenomesOrg/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans,OpenHumans/open-humans,OpenHumans/open-humans | activities/views.py | activities/views.py | from datetime import datetime
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from twenty_three_and_me.models import DataExtractionTask as DataExtractionTask23andme
from .models import TASK_SUCCESSFUL, TASK_FAILED
class TaskUpdateView(... | from datetime import datetime
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from twenty_three_and_me.models import DataExtractionTask as DataExtractionTask23andme
from .models import TASK_SUCCESSFUL, TASK_FAILED
class TaskUpdateView(... | mit | Python |
aed5edd3f5a48128c1471361e4f669643fe626ec | send update data | upd89/agent,upd89/agent | demodata_send_system_notify.py | demodata_send_system_notify.py | #!/usr/bin/env python
import os,sys,time,json,urllib2
from random import randint
from json import JSONEncoder
class Update:
def __init__(self, name, version, arch, repository, baseversion):
self.name = name
self.version = version
self.architecture = arch
self.repository = repository
self.basever... | #!/usr/bin/env python
import os,sys,time,json,urllib2
from random import randint
from json import JSONEncoder
class System:
def __init__(self, name, urn, os, address, reboot_required):
self.name = name
self.urn = urn
self.os = os
self.address = address
self.reboot_required = reboot_required
cla... | mit | Python |
631706421084104ba79d92220ae1fbdb5e2d2979 | Fix source map extraction for hash-named files. | shubhamdhama/zulip,zulip/zulip,rht/zulip,jackrzhang/zulip,rht/zulip,andersk/zulip,dhcrzf/zulip,eeshangarg/zulip,brainwane/zulip,rht/zulip,kou/zulip,punchagan/zulip,dhcrzf/zulip,brainwane/zulip,tommyip/zulip,rishig/zulip,zulip/zulip,synicalsyntax/zulip,hackerkid/zulip,jackrzhang/zulip,rishig/zulip,showell/zulip,zulip/zu... | zerver/lib/unminify.py | zerver/lib/unminify.py |
import re
import os
import sourcemap
from typing import Dict, List
class SourceMap:
'''Map (line, column) pairs from generated to source file.'''
def __init__(self, sourcemap_dirs: List[str]) -> None:
self._dirs = sourcemap_dirs
self._indices = {} # type: Dict[str, sourcemap.SourceMapDecod... |
import re
import os
import sourcemap
from typing import Dict, List
class SourceMap:
'''Map (line, column) pairs from generated to source file.'''
def __init__(self, sourcemap_dirs: List[str]) -> None:
self._dirs = sourcemap_dirs
self._indices = {} # type: Dict[str, sourcemap.SourceMapDecod... | apache-2.0 | Python |
88bb07d41b071b6b0733cb0892527e4c8aa49108 | Remove missing headers from libyuv.gyp. Review URL: http://webrtc-codereview.appspot.com/321002 | flykickbird/libyuv,flykickbird/libyuv,flykickbird/libyuv | libyuv.gyp | libyuv.gyp | # Copyright (c) 2011 The LibYuv project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | # Copyright (c) 2011 The LibYuv project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | bsd-3-clause | Python |
6f38152a8537c928ec051cbdd9d2fc23ba489972 | fix a debug parameter | liujinliu/squirrel | src/squirrel/utils/__init__.py | src/squirrel/utils/__init__.py | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
USER_CACHE_MAX = 1000
MONTH_FMT = '%Y/%m'
DAY_FMT = '%Y/%m/%d'
def month_last(month_str):
day_str = '%s/10' % month_str
dt = datetime.strptime(day_str, DAY_FMT)
new_dt = dt + timedelta(days=-20)
return datetime.strftime(new_dt, MONTH_FM... | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
USER_CACHE_MAX = 10
MONTH_FMT = '%Y/%m'
DAY_FMT = '%Y/%m/%d'
def month_last(month_str):
day_str = '%s/10' % month_str
dt = datetime.strptime(day_str, DAY_FMT)
new_dt = dt + timedelta(days=-20)
return datetime.strftime(new_dt, MONTH_FMT)... | apache-2.0 | Python |
436c620483e58336e4c60b6f3e5054f2e3b7b6e0 | rename ObjectAttrMapper.converters to ObjectAttrMapper.attr_converters | biosustain/venom | venom/converter.py | venom/converter.py | from abc import ABCMeta, abstractmethod
from typing import Generic, TypeVar, Callable
from typing import Type
from venom.message import items, field_names
T = TypeVar('T', bool, int, float, str, bytes, 'venom.message.Message')
P = TypeVar('P')
class Converter(Generic[T, P], metaclass=ABCMeta):
wire: Type[T]
... | from abc import ABCMeta, abstractmethod
from typing import Generic, TypeVar, Callable
from typing import Type
from venom.message import items, field_names
T = TypeVar('T', bool, int, float, str, bytes, 'venom.message.Message')
P = TypeVar('P')
class Converter(Generic[T, P], metaclass=ABCMeta):
wire: Type[T]
... | mit | Python |
f6deba6665a44156b2665de103415280157fb86d | Switch to RunSQL | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds_reports/migrations/0151_drop_duplicate_indexes.py | custom/icds_reports/migrations/0151_drop_duplicate_indexes.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-25 21:31
from __future__ import unicode_literals
import os
from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
('icds_reports', '0150_update_agg_awc_monthly_view'),
]
operat... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-25 21:31
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Mi... | bsd-3-clause | Python |
727b2dc98eb5e910859ed4e5b43465ade65ae694 | Correct regex for c identifiers | thunsaker/cloudpebble,pebble/cloudpebble,thunsaker/cloudpebble,thunsaker/cloudpebble,pebble/cloudpebble,pebble/cloudpebble,pebble/cloudpebble,thunsaker/cloudpebble,pebble/cloudpebble | ide/utils/regexes.py | ide/utils/regexes.py | from django.core.validators import RegexValidator
class RegexHolder(object):
regex_dictionary = {
# Match major[.minor], where major and minor are numbers between 0 and 255 with no leading 0s
'sdk_version': r'^(0|[1-9]\d?|1\d{2}|2[0-4]\d|25[0-5])(\.(0|[1-9]\d?|1\d{2}|2[0-4]\d|25[0-5]))?$',
... | from django.core.validators import RegexValidator
class RegexHolder(object):
regex_dictionary = {
# Match major[.minor], where major and minor are numbers between 0 and 255 with no leading 0s
'sdk_version': r'^(0|[1-9]\d?|1\d{2}|2[0-4]\d|25[0-5])(\.(0|[1-9]\d?|1\d{2}|2[0-4]\d|25[0-5]))?$',
... | mit | Python |
771bed6d6d9001626038dd66b2ecdbd15677b535 | Increment version to 0.1.2 | 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 |
ac4b0e73525d2273eb4f12db9bec5e9baa64eba7 | Add missing import | mariocesar/django-tricks | django_tricks/models/mixins.py | django_tricks/models/mixins.py | from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class VerboseNameModel(object):
"""Return a more meaningful model representation, if found
a field name or method verbose_name() use it, or build
a new representation.
example:
>>> user = User.objects.... | @python_2_unicode_compatible
class VerboseNameModel:
"""Return a more meaningful model representation, if found
a field name or method verbose_name() use it, or build
a new representation.
example:
>>> user = User.objects.get(pk=1)
>>> print(user)
"<django.contrib.auth.models:U... | isc | Python |
2dde26475322bcd655d8f37f11cd249338380d10 | add hypothesis integration test for method and match_dict | squeaky-pl/japronto,squeaky-pl/japronto,squeaky-pl/japronto,squeaky-pl/japronto,squeaky-pl/japronto | integration_tests/test_integr.py | integration_tests/test_integr.py | import pytest
import subprocess
import sys
import urllib3.connection
import socket
import psutil
import time
import json
import urllib.parse
import string
from hypothesis import given, strategies as st, settings, Verbosity
@pytest.fixture(autouse=True)
def server():
server = subprocess.Popen([sys.executable, 'int... | import pytest
import subprocess
import sys
import urllib3.connection
import socket
import psutil
import time
import json
@pytest.fixture(autouse=True)
def server():
server = subprocess.Popen([sys.executable, 'integration_tests/dump.py'])
proc = psutil.Process(server.pid)
# wait until the server socket is... | mit | Python |
478ef90204c9aef864cd8f5d02775c328f7d1b87 | Add mandatory on_delete | aapris/IoT-Web-Experiments | iotendpoints/endpoints/models.py | iotendpoints/endpoints/models.py | import os
from django.db import models
from django.utils import timezone
from django.conf import settings
from django.contrib.auth.models import User
class Request(models.Model):
"""
Metadata about Request.
"""
user = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE, verbose_nam... | import os
from django.db import models
from django.utils import timezone
from django.conf import settings
from django.contrib.auth.models import User
class Request(models.Model):
"""
Metadata about Request.
"""
user = models.ForeignKey(User, blank=True, null=True, verbose_name='Sender')
status = m... | mit | Python |
3fefd879e62f04a30dc3928eb871a3ab3cf04aa1 | Raise CommandError if no directory specified | MeirKriheli/statirator,MeirKriheli/statirator,MeirKriheli/statirator | statirator/core/management/commands/init.py | statirator/core/management/commands/init.py | import os
import logging
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
class Command(BaseCommand):
help = "Init the static site project"
args = '[directory]'
option_list = (
make_option(
'--title', '-t', dest='title', default='Def... | import os
import logging
from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = "Init the static site project"
args = '[directory]'
option_list = (
make_option(
'--title', '-t', dest='title', default='Default site',
... | mit | Python |
28803e4669f4c7b2b84e53e39e3a0a99ff57572d | Fix “python -m skyfield” following ∆T array rename | skyfielders/python-skyfield,skyfielders/python-skyfield | skyfield/__main__.py | skyfield/__main__.py | # -*- coding: utf-8 -*-
import pkg_resources
import numpy as np
import skyfield
from skyfield.api import load
from skyfield.functions import load_bundled_npy
def main():
print('Skyfield version: {0}'.format(skyfield.__version__))
print('jplephem version: {0}'.format(version_of('jplephem')))
print('sgp4 ve... | # -*- coding: utf-8 -*-
import pkg_resources
import skyfield
from skyfield.api import load
from skyfield.functions import load_bundled_npy
def main():
print('Skyfield version: {0}'.format(skyfield.__version__))
print('jplephem version: {0}'.format(version_of('jplephem')))
print('sgp4 version: {0}'.format(... | mit | Python |
29fd85b1c30941934e3fb0991db976f571f5f2b3 | sort queries | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/form_processor/management/commands/list_data_by_shard.py | corehq/form_processor/management/commands/list_data_by_shard.py | from collections import Counter
from django.core.management.base import BaseCommand
from corehq.form_processor.backends.sql.dbaccessors import ShardAccessor
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors, FormAccessors
class Command(BaseCommand):
help = "List forms and cases in a domain by... | from collections import Counter
from django.core.management.base import BaseCommand
from corehq.form_processor.backends.sql.dbaccessors import ShardAccessor
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors, FormAccessors
class Command(BaseCommand):
help = "List forms and cases in a domain by... | bsd-3-clause | Python |
712fc1f63075225411a6631c7e793ba3b710b69d | fix import error in organizer | natemara/sortroms | sortrom/organizer.py | sortrom/organizer.py | import os
import json
import glob
import shutil
from .utils import get_data_file
cd = os.chdir
pwd = os.getcwd
def main():
tags = get_tags()
folders = get_folders()
for folder in folders:
input('Press ENTER to org "{}"...'.format(folder))
cd(folder)
org_by_tags(tags)
return 0
de... | import os
import json
import glob
import shutil
from utils import get_data_file
cd = os.chdir
pwd = os.getcwd
def main():
tags = get_tags()
folders = get_folders()
for folder in folders:
input('Press ENTER to org "{}"...'.format(folder))
cd(folder)
org_by_tags(tags)
return 0
def... | mit | Python |
84ad3018a9f057a2d53e69635672aa067f8eef5a | reorder function calls to do exactly what x02c.c does. In particular drop extra plbop at end that was generating an extra empty file for the png driver in familying mode. Also use same plwid argument as in the C example and move two commands out of inner loop. Result: no extra empty file in familying mode, exact agreem... | FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot | examples/python/xw02.py | examples/python/xw02.py | #!/usr/bin/env python
# Multiple window and color map 0 demo.
import math
import sys
import os
module_dir = "@MODULE_DIR@"
if module_dir[0] == '@':
module_dir = os.getcwd ()
sys.path.insert (0, module_dir)
from Numeric import *
from pl import *
# Demonstrates multiple windows and default color map 0 palette.
d... | #!/usr/bin/env python
# Multiple window and color map 0 demo.
import math
import sys
import os
module_dir = "@MODULE_DIR@"
if module_dir[0] == '@':
module_dir = os.getcwd ()
sys.path.insert (0, module_dir)
from Numeric import *
from pl import *
# Demonstrates multiple windows and default color map 0 palette.
d... | lgpl-2.1 | Python |
04e7d79aafadad87bcb99879ead7195a7aee6d0c | Test GitHub | eddiedb6/ej,eddiedb6/ej,eddiedb6/ej | web/EJDBHandler.py | web/EJDBHandler.py | import os
import sys
# Test GitHub
thisDir = os.path.split(os.path.realpath(__file__))[0]
pdbDir = os.path.join(thisDir, "../pdb")
sys.path.append(pdbDir)
sys.path.append(os.path.join(pdbDir, "schema"))
import PDBConst
from metadata import PDBConfig
from schema import SchemaChecker
w3Dir = os.path.join(thisDir, "..... | import os
import sys
thisDir = os.path.split(os.path.realpath(__file__))[0]
pdbDir = os.path.join(thisDir, "../pdb")
sys.path.append(pdbDir)
sys.path.append(os.path.join(pdbDir, "schema"))
import PDBConst
from metadata import PDBConfig
from schema import SchemaChecker
w3Dir = os.path.join(thisDir, "../w3")
sys.path... | mit | Python |
9478010060dea4e57e2ae15053f4eb79b7eecdf8 | Return 404 for non-existent config templates | tnewman/KazooCommission | kazoocommission/controllers.py | kazoocommission/controllers.py | from flask import abort, Flask, make_response, render_template, request
from functools import wraps
from jinja2.exceptions import TemplateNotFound
from kazoocommission import config
from kazoocommission.services import KazooDeviceService
app = Flask(__name__)
def authenticate(fn):
@wraps(fn)
def decorated_vi... | from flask import abort, Flask, make_response, render_template, request
from functools import wraps
from kazoocommission import config
from kazoocommission.services import KazooDeviceService
app = Flask(__name__)
def authenticate(fn):
@wraps(fn)
def decorated_view(*args, **kwargs):
device_service = k... | mit | Python |
73f758b6da315d99a684a083051c1fac8df02766 | add docstrings to persistence strategies | keenlabs/KeenClient-Python,isotoma/KeenClient-Python,ruleant/KeenClient-Python | keen/persistence_strategies.py | keen/persistence_strategies.py | __author__ = 'dkador'
class BasePersistenceStrategy(object):
"""
A persistence strategy is responsible for persisting a given event
somewhere (i.e. directly to Keen, a local cache, a Redis queue, etc.)
"""
def persist(self, event):
"""Persists the given event somewhere.
:param eve... | __author__ = 'dkador'
class BasePersistenceStrategy(object):
"""
A persistence strategy is responsible for persisting a given event
somewhere (i.e. directly to Keen, a local cache, a Redis queue, etc.)
"""
def persist(self, event):
"""Persists the given event somewhere.
:param eve... | mit | Python |
b812a8da81ec9943d11b8cb9f709e234c90a2282 | Add the function back for now | alcarney/stylo,alcarney/stylo | stylo/utils.py | stylo/utils.py | import inspect
from uuid import uuid4
def get_parameters(f):
return list(inspect.signature(f).parameters.keys())
class MessageBus:
"""A class that is used behind the scenes to coordinate events and timings of
animations.
"""
def __init__(self):
self.subs = {}
def new_id(self):
... | from uuid import uuid4
class MessageBus:
"""A class that is used behind the scenes to coordinate events and timings of
animations.
"""
def __init__(self):
self.subs = {}
def new_id(self):
"""Use this to get a name to use for your events."""
return str(uuid4())
def re... | mit | Python |
818010ebe404e17b2fc29256f70afff8580ea591 | Update the redis counter prefix | mixcloud/django-experiments,robertobarreda/django-experiments,bjarnoldus/django-experiments,uhuramedia/django-experiments,bjarnoldus/django-experiments,squamous/django-experiments,mixcloud/django-experiments,squamous/django-experiments,uhuramedia/django-experiments,uhuramedia/django-experiments,mixcloud/django-experime... | experiments/counters.py | experiments/counters.py | from django.conf import settings
import redis
from redis.exceptions import ConnectionError, ResponseError
REDIS_HOST = getattr(settings, 'EXPERIMENTS_REDIS_HOST', 'localhost')
REDIS_PORT = getattr(settings, 'EXPERIMENTS_REDIS_PORT', 6379)
REDIS_EXPERIMENTS_DB = getattr(settings, 'EXPERIMENTS_REDIS_DB', 0)
r = redis.... | from django.conf import settings
import redis
from redis.exceptions import ConnectionError, ResponseError
REDIS_HOST = getattr(settings, 'EXPERIMENTS_REDIS_HOST', 'localhost')
REDIS_PORT = getattr(settings, 'EXPERIMENTS_REDIS_PORT', 6379)
REDIS_EXPERIMENTS_DB = getattr(settings, 'EXPERIMENTS_REDIS_DB', 0)
r = redis.... | mit | Python |
d1fd66ee4cea11ade18e471d45a79ccda5de27e9 | Add entries with page and repository URLs | khalim19/gimp-plugin-export-layers,khalim19/gimp-plugin-export-layers | export_layers/config.py | export_layers/config.py | # -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2016 khalim19 <khalim19@gmail.com>
#
# Export Layers is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | # -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2016 khalim19 <khalim19@gmail.com>
#
# Export Layers is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | bsd-3-clause | Python |
03efcd1ddd5fb45bc8143a082e5d57bc8b6eb7ae | Add pause even with annotation that has no text | melonmanchan/achso-video-exporter,melonmanchan/achso-video-exporter | exporter/annotations.py | exporter/annotations.py | from moviepy.editor import *
import os
marker_image = ImageClip(os.path.join(os.path.dirname(__file__), "./AS_annotation_small.png"))
ANNOTATION_INITIAL_PAUSE_TIME = 1.0
def get_annotations_added_duration(annotations):
if (len(annotations)) == 0:
return ANNOTATION_INITIAL_PAUSE_TIME
duration = 0;
... | from moviepy.editor import *
import os
marker_image = ImageClip(os.path.join(os.path.dirname(__file__), "./AS_annotation_small.png"))
def get_annotations_added_duration(annotations):
duration = 0
for annotation in annotations:
duration += get_annotation_duration(annotation)
return duration
def ... | mit | Python |
75623ee619f7fd4b4369cc37b30dcd6f8d0b5071 | Implement basic structure of killmail poster | randomic/antinub-gregbot | ext/killmails/poster.py | ext/killmails/poster.py | import logging
import esipy
from discord.ext import commands
ESI_SWAGGER_JSON = 'https://esi.evetech.net/latest/swagger.json'
def setup(bot: commands.Bot):
bot.add_cog(KillmailPoster(bot))
class KillmailPoster:
def __init__(self, bot: commands.Bot):
self.logger = logging.getLogger(__name__)
... | import logging
from discord.ext import commands
def setup(bot: commands.Bot):
bot.add_cog(KillmailPoster(bot))
class KillmailPoster:
def __init__(self, bot):
self.logger = logging.getLogger(__name__)
self.logger.info("%s %s", type(self).__name__, 3)
def __unload(self):
self.log... | mit | Python |
a3439cdd5489ded03ad4d3e53cbf906071f39863 | fix __init__.py inside models | akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil | l10n_br_crm/models/__init__.py | l10n_br_crm/models/__init__.py | # -*- coding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2015 Renato Lima - Akretion #
# ... | # -*- coding: utf-8 -*-
| agpl-3.0 | Python |
2e631e8e3b3fe738d9f41ab46f138769f688d00f | Increment version number to 0.17.5 | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.17.5"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.17.4"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| mit | Python |
d852a39faea27c5e4fee793b5eabf0d22b693eba | Debug memory issue | rshkv/goethe | goethe/utils/pairs/__main__.py | goethe/utils/pairs/__main__.py | import itertools as it
import functools as ft
import multiprocessing as mp
import random
import argparse
import spacy
# from .window import Window
# from .squirrel import Squirrel
from .methods import Racoon, POSRacoon, MinRacoon, Squirrel
from ..utils import args_to_kwargs, chunks, smart_open, iterlen
LANG = 'de'
BA... | import itertools as it
import functools as ft
import multiprocessing as mp
import random
import argparse
import spacy
# from .window import Window
# from .squirrel import Squirrel
from .methods import Racoon, POSRacoon, MinRacoon, Squirrel
from ..utils import args_to_kwargs, chunks, smart_open, iterlen
LANG = 'de'
BA... | mit | Python |
7f176879f227404b976a96164ca98a116cd4887a | Bump version, new pip package. | magenta/ddsp,magenta/ddsp | ddsp/version.py | ddsp/version.py | # Copyright 2019 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | # Copyright 2019 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 | Python |
588c28fe459d29026c0f153ef1948873ec1dca1b | Fix project pull when deps missing | honnibal/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy | spacy/cli/project/pull.py | spacy/cli/project/pull.py | from pathlib import Path
from wasabi import msg
from .remote_storage import RemoteStorage
from .remote_storage import get_command_hash
from .._util import project_cli, Arg
from .._util import load_project_config
@project_cli.command("pull")
def project_pull_cli(
# fmt: off
remote: str = Arg("default", help="N... | from pathlib import Path
from wasabi import msg
from .remote_storage import RemoteStorage
from .remote_storage import get_command_hash
from .._util import project_cli, Arg
from .._util import load_project_config
@project_cli.command("pull")
def project_pull_cli(
# fmt: off
remote: str = Arg("default", help="N... | mit | Python |
6c5897320c6c44a258762c514aadd915d4df35c3 | print separator | mbdebian/py-playground,mbdebian/py-playground | effective_python/coroutines.py | effective_python/coroutines.py | #
# Author : Manuel Bernal Llinares
# Project : py-playground
# Timestamp : 05-10-2017 8:41
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
Coroutines example from the book
"""
def my_coroutine():
while True:
received = yield
print('Received: ', rece... | #
# Author : Manuel Bernal Llinares
# Project : py-playground
# Timestamp : 05-10-2017 8:41
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
Coroutines example from the book
"""
def my_coroutine():
while True:
received = yield
print('Received: ', rece... | apache-2.0 | Python |
eab9d2422efded2d04f2759ae72241a268dd1021 | change parameters for verifylist | armijnhemel/binaryanalysis | src/maintenance/verifylist.py | src/maintenance/verifylist.py | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2012 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
Helper script to verify the LIST files generated by generatelist.py. This is useful to see if any typos were made.
'''
import sys, os, os.p... | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2012 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
Helper script to verify the LIST files generated by generatelist.py. This is useful to see if any typos were made.
'''
import sys, os, os.p... | apache-2.0 | Python |
eb4d480d8bf7807f7a0d38f445a5779331f8d3f3 | Convert old-style class to new-style class | ueg1990/aids | aids/stack/stack.py | aids/stack/stack.py | '''
Implementation of Stack data structure
'''
class Stack(object):
def __init__(self):
'''
Initialize stack
'''
self.items = []
def is_empty(self):
'''
Return True if stack if empty else False
'''
return self.item == []
def push(self, item):
'''
Push item to stack
'''
self.items.app... | '''
Implementation of Stack data structure
'''
class Stack:
def __init__(self):
'''
Initialize stack
'''
self.items = []
def is_empty(self):
'''
Return True if stack if empty else False
'''
return self.item == []
def push(self, item):
'''
Push item to stack
'''
self.items.append(item... | mit | Python |
bfd48c7e6861528e21474d6bb5077433c249d369 | Remove the Print Statements | 2016-ksu-cis-open-house/tree-display,2016-ksu-cis-open-house/tree-display,2016-ksu-cis-open-house/tree-display | special_names/sortNames.py | special_names/sortNames.py | ###########################################################
# Alphabetize Names
#
# Author: Joy Hauser
# Date: 3/9/2016
###########################################################
import sys
import os
# Initialize variables
nameList = []
sortedNameList = []
fileName = 'whitelist.txt'
# Get names from raw_input file
w... | ###########################################################
# Alphabetize Names
#
# Author: Joy Hauser
# Date: 3/9/2016
###########################################################
import sys
import os
# Initialize variables
nameList = []
sortedNameList = []
fileName = 'whitelist.txt'
# Get names from raw_input file
w... | mit | Python |
a335210d9108e84d16ad02179bc42c557879033b | Fix import order on __init__.py | chukysoria/pyspotify-connect,chukysoria/pyspotify-connect | spotifyconnect/__init__.py | spotifyconnect/__init__.py | from __future__ import unicode_literals
import threading
__version__ = '0.1.1'
# Global reentrant lock to be held whenever libspotify functions are called or
# libspotify owned data is worked on. This is the heart of pyspotify's thread
# safety.
_lock = threading.RLock()
# Reference to the spotifyconnect.Session ... | from __future__ import unicode_literals
import threading
from spotifyconnect.audio import * # noqa
from spotifyconnect.config import * # noqa
from spotifyconnect.connect_ffi import ffi, lib, C # noqa
from spotifyconnect.connection import * # noqa
from spotifyconnect.error import * # noqa
from spotifyconnect.even... | apache-2.0 | Python |
009fff11b2113a17d29eb1fb9bf1ccd8c8330c16 | index everything | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | cat/search_indexes.py | cat/search_indexes.py | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | bsd-3-clause | Python |
51193c445662a7ff4acbd5f85d1003311e60b1f6 | add messaging model unit tests. | credativ/gofer,credativ/gofer,jortel/gofer,kgiusti/gofer,jortel/gofer,kgiusti/gofer | test/unit/messaging/test_model.py | test/unit/messaging/test_model.py | # Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | # Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | lgpl-2.1 | Python |
30cf00f44da0d38450ea08f9fc874b392db0ae01 | add ajax_selects inlines | wabarr/census-paleo,wabarr/census-paleo,wabarr/census-paleo | census_paleo/admin.py | census_paleo/admin.py | from census_paleo.models import *
from django.contrib import admin
from ajax_select import make_ajax_form
from ajax_select.admin import AjaxSelectAdmin
#this is straight out of django docs
class taxonomyAdmin(admin.ModelAdmin):
list_display = ("tclass","order","family","subFamily","tribe","genusName","specificEp... | from census_paleo.models import *
from django.contrib import admin
from ajax_select import make_ajax_form
from ajax_select.admin import AjaxSelectAdmin
#this is straight out of django docs
class taxonomyAdmin(admin.ModelAdmin):
list_display = ("tclass","order","family","subFamily","tribe","genusName","specificEp... | mit | Python |
7cfdc70e24ed5f75c6f6d47284aed4a143d78d62 | Update makebin logging. | AdamGagorik/pydarkstar,LegionXI/pydarkstar | makebin.py | makebin.py | from sys import platform
import logging
import stat
import os
lfmt = '[%(asctime)s][%(process)5d][%(levelname)-5s]: %(message)s'
dfmt = "%Y-%m-%d %H:%M:%S"
logging.basicConfig(level=logging.INFO, format=lfmt, datefmt=dfmt)
def chmod(path):
os.chmod(path,
# user
stat.S_IRUSR | # read
stat.S... | from sys import platform
import logging
import stat
import os
logging.basicConfig(level=logging.DEBUG)
def chmod(path):
os.chmod(path,
# user
stat.S_IRUSR | # read
stat.S_IWUSR | # write
stat.S_IXUSR | # execute
# group
stat.S_IRGRP | # read
stat.S_IWGRP | ... | mit | Python |
ef35ad8c963619e1d518d41e1f9c0139d1cd9ec0 | Debug worker | legco-watch/legco-watch,comsaint/legco-watch,comsaint/legco-watch,comsaint/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,legco-watch/legco-watch,legco-watch/legco-watch | app/raw/tasks.py | app/raw/tasks.py | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
from celery.contrib import rdb
import os
from raw.scraper.spiders.legco_library import Libr... | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scrape... | mit | Python |
b36efd8f8f7c1d5b68e341b84ce62f11e6eea4c5 | switch to argparse | zingale/pyro2,harpolea/pyro2,harpolea/pyro2,zingale/pyro2 | analysis/plotvar.py | analysis/plotvar.py | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import argparse
import mesh.patch as patch
# plot a single variable from an output file
#
# Usage: ./plotvar.py filename variable
def makeplot(plotfile, variable, outfile):
myg, myd = patch.read(plotfile)
plt.figure(num=1, figsize=(6... | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import sys
import getopt
import mesh.patch as patch
# plot a single variable from an output file
#
# Usage: ./plotvar.py filename variable
def makeplot(myd, variable, outfile):
plt.figure(num=1, figsize=(6.5,5.25), dpi=100, facecolor='w')... | bsd-3-clause | Python |
39cec0e77bd8b70ee18cc3f47ebae9676e76c12f | Disable coverage in depot_tools tests. | CoherentLabs/depot_tools,CoherentLabs/depot_tools | testing_support/coverage_utils.py | testing_support/coverage_utils.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.
import distutils.version
import os
import sys
import textwrap
import unittest
ROOT_PATH = os.path.abspath(os.path.join(
os.path.dirname(os.path.dirname(... | # 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.
import distutils.version
import os
import sys
import textwrap
import unittest
ROOT_PATH = os.path.abspath(os.path.join(
os.path.dirname(os.path.dirname(... | bsd-3-clause | Python |
48d349f3dcf21ac44f68c0a48baa078c2808fbe5 | Move user policies to DocumentedRuleDefault | openstack/keystone,mahak/keystone,openstack/keystone,openstack/keystone,mahak/keystone,mahak/keystone | keystone/common/policies/user.py | keystone/common/policies/user.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 t... | # 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 t... | apache-2.0 | Python |
64df1ac616e9c63230575b063b3ddf51f7ddc887 | fix spelling | leonardo-modules/leonardo-admin-sso,leonardo-modules/leonardo-admin-sso | leonardo_admin_sso/__init__.py | leonardo_admin_sso/__init__.py |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
default_app_config = 'leonardo_admin_sso.Config'
LEONARDO_OPTGROUP = 'Admin SSO'
LEONARDO_APPS = ['leonardo_admin_sso', 'admin_sso']
LEONARDO_AUTH_BACKENDS = [
'admin_sso.auth.DjangoSSOAuthBackend',
]
LEONARDO_CONFIG = {
... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
default_app_config = 'leonardo_admin_sso.Config'
LEONARDO_OPTGROUP = 'Admin SSO'
LEONARDO_APPS = ['leonardo_admin_sso', 'admin_sso']
LEONARDO_AUTH_BACKENDS = [
'admin_sso.auth.DjangoSSOAuthBackend',
]
LEONARDO_CONFIG = {
... | bsd-3-clause | Python |
1bb8c3ea16902b7c118d76412c99b33daf3aa0dd | Fix migration | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/690_add_brief_length_to_published_briefs.py | migrations/versions/690_add_brief_length_to_published_briefs.py | """Give published specialist briefs a requirementsLength of '2 weeks'
Revision ID: 690
Revises: 680
Create Date: 2016-07-28 12:30:11.406853
"""
# revision identifiers, used by Alembic.
revision = '690'
down_revision = '680'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | """Give published specialist briefs a requirementsLength of '2 weeks'
Revision ID: 690
Revises: 680
Create Date: 2016-07-28 12:30:11.406853
"""
# revision identifiers, used by Alembic.
revision = '690'
down_revision = '680'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | mit | Python |
28d5bdc40f6fd12831a0d3fac62765ef4fe1104f | bump to version 0.0.2 | arraystream/fftoptionlib | fftoptionlib/version.py | fftoptionlib/version.py | # -*- coding: utf-8 -*-
__version__ = '0.0.2'
| # -*- coding: utf-8 -*-
__version__ = '0.0.1'
| bsd-3-clause | Python |
8cc662c5147e835a5df8e7dbcad3a61729d45be4 | Change parameter name | brunosmmm/hdltools,brunosmmm/hdltools | hdltools/hdllib/axi/modules.py | hdltools/hdllib/axi/modules.py | """AXI skeleton modules."""
from hdltools.abshdl.module import HDLModule, HDLModuleParameter
from hdltools.abshdl.instance import HDLInstance
from hdltools.abshdl.interface import HDLInterfaceDeferred
from hdltools.hdllib.axi.interfaces import AXI4LiteSlaveIf
class AXI4LiteSlaveMod(HDLModule):
"""AXI4 Lite slave... | """AXI skeleton modules."""
from hdltools.abshdl.module import HDLModule, HDLModuleParameter
from hdltools.abshdl.instance import HDLInstance
from hdltools.abshdl.interface import HDLInterfaceDeferred
from hdltools.hdllib.axi.interfaces import AXI4LiteSlaveIf
class AXI4LiteSlaveMod(HDLModule):
"""AXI4 Lite slave... | mit | Python |
d209a7680292a2d466c7e8f6b7472338be2819a5 | Integrate LLVM at llvm/llvm-project@9b25d868f43e | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "9b25d868f43e951eb93844d4861a85bdd66b10aa"
LLVM_SHA256 = "02b3dd75336ef3ee2d7247d510cd4195d5209e4226c602506669e5c820fd0747"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "63e711549c7f20334e241d3143cd41d4b5508b44"
LLVM_SHA256 = "f27f0efa9b6f496f68f3892d0e9043956fc4504f09adf8999bb096ebe06d8eaa"
tfrt_http_archive(
... | apache-2.0 | Python |
8106048051586f100fa8b807774ea14fe839ac03 | Integrate LLVM at llvm/llvm-project@adf1ffe95854 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "adf1ffe95854a245cbc48bbaea55f60b003d5f76"
LLVM_SHA256 = "6de6045e2ec95ab0a149a0c4fe94ac8c3bae33c86168d5b269c2ed9dc102498e"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "79bb915fb60b2cd220d89e3bb54f67abb8cdb7bd"
LLVM_SHA256 = "ca35b53f932a9b47663f28630e10188f594826b74bfbb1c26d1e0e6eeaa14ee6"
tfrt_http_archive(
... | apache-2.0 | Python |
f9da1b74244f03e890e999b185885d34fbcd91c4 | Handle publish_date == "" in newspaper_extractor | fhamborg/news-please,fhamborg/news-please | newsplease/pipeline/extractor/extractors/newspaper_extractor.py | newsplease/pipeline/extractor/extractors/newspaper_extractor.py | import logging
from newspaper import Article
from .abstract_extractor import AbstractExtractor
from ..article_candidate import ArticleCandidate
class NewspaperExtractor(AbstractExtractor):
"""This class implements Newspaper as an article extractor. Newspaper is
a subclass of ExtractorsInterface
"""
... | import logging
from newspaper import Article
from .abstract_extractor import AbstractExtractor
from ..article_candidate import ArticleCandidate
class NewspaperExtractor(AbstractExtractor):
"""This class implements Newspaper as an article extractor. Newspaper is
a subclass of ExtractorsInterface
"""
... | apache-2.0 | Python |
c0264e52dbc5ec744259b9c6e3dc96398786b563 | Bump version | chbrown/filesequence | filesequence/version.py | filesequence/version.py | __version__ = '0.1.5'
| __version__ = '0.1.4'
| mit | Python |
7092bbb661858650b30d3f11f85584c1a240862a | Update AGEpy.py | mpg-age-bioinformatics/AGEpy,mpg-age-bioinformatics/AGEpy | AGEpy/AGEpy.py | AGEpy/AGEpy.py | """Bioinformatics tools developed at the Max Planck Institute for Biology of Ageing"""
from bed import *
from biom import *
from david import *
from fasta import *
from go import *
from gtf import *
from homology import *
from kegg import *
from meme import *
from plots import *
from rbiom import *
from sam import *
fr... | """Bioinformatics tools developed at the Max Planck Institute for Biology of Ageing"""
from bed import *
from biom import *
from david import *
from fasta import *
from go import *
from gtf import *
from homology import *
from kegg import *
from meme import *
from plots import *
from rbiom import *
from sam import *
fr... | mit | Python |
602184794c3f38bf6307cf68f4d61294b523c009 | Edit path and external evaluation | studiawan/pygraphc | examples/LKE_example.py | examples/LKE_example.py | from pygraphc.misc.LKE import *
from pygraphc.evaluation.ExternalEvaluation import *
# set input and output path
dataset_path = '/home/hudan/Git/labeled-authlog/dataset/Hofstede2014/dataset1_perday/'
groundtruth_file = dataset_path + 'Dec 1.log.labeled'
analyzed_file = 'Dec 1.log'
OutputPath = '/home/hudan/Git/pygraph... | from pygraphc.misc.LKE import *
from pygraphc.evaluation.ExternalEvaluation import *
# set input and output path
ip_address = '161.166.232.17'
standard_path = '/home/hudan/Git/labeled-authlog/dataset/Hofstede2014/dataset1/' + ip_address
standard_file = standard_path + 'auth.log.anon.labeled'
analyzed_file = 'auth.log.... | mit | Python |
2739999c6fa0628e7cfe7a918e3cde3b7d791d66 | Modify test to match changes in class | brianthomas/astroplpython,brianthomas/astroplpython | tests/astroplpython/data/test_Timeseries.py | tests/astroplpython/data/test_Timeseries.py | '''
Created on Jul 16, 2014
@author: thomas
'''
import unittest
class TestTimeseries (unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_strToXTArray (self):
import astroplpython.data.Timeseries as Timeseries
# test data stra... | '''
Created on Jul 16, 2014
@author: thomas
'''
import unittest
class TestTimeseries (unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_strToXTArray (self):
import astroplpython.data.Timeseries as t
strarr = ['(1,1.)', '(2,2.)', '(2.1,3.)', '... | mit | Python |
b03de1c92f2788dd5e8914cb17a5d5741c47b117 | Address code review from litterrobot PR (#78699) | w1ll1am23/home-assistant,mezz64/home-assistant,mezz64/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant,nkgilley/home-assistant | tests/components/litterrobot/test_switch.py | tests/components/litterrobot/test_switch.py | """Test the Litter-Robot switch entity."""
from unittest.mock import MagicMock
from pylitterbot import Robot
import pytest
from homeassistant.components.switch import (
DOMAIN as PLATFORM_DOMAIN,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
from ... | """Test the Litter-Robot switch entity."""
from unittest.mock import MagicMock
from pylitterbot import Robot
import pytest
from homeassistant.components.switch import (
DOMAIN as PLATFORM_DOMAIN,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
from ... | apache-2.0 | Python |
7cedcbddd5eaaf45387b165a5ad610f47511dac6 | fix up prim.py script to pass test | timsnyder/bokeh,DuCorey/bokeh,aavanian/bokeh,timothydmorton/bokeh,khkaminska/bokeh,muku42/bokeh,rhiever/bokeh,ericdill/bokeh,dennisobrien/bokeh,eteq/bokeh,abele/bokeh,ericdill/bokeh,daodaoliang/bokeh,azjps/bokeh,lukebarnard1/bokeh,paultcochrane/bokeh,srinathv/bokeh,roxyboy/bokeh,percyfal/bokeh,clairetang6/bokeh,KasperP... | examples/glyphs/prim.py | examples/glyphs/prim.py | from __future__ import print_function
import sys
import os.path
import requests
import numpy as np
from bokeh.objects import (
Plot, Range1d, LinearAxis, Grid,
Glyph, ColumnDataSource,
PanTool, WheelZoomTool)
from bokeh.glyphs import *
from bokeh import session
x = np.arange(1,6)
y = np.arange(5, 0, -1)... | from __future__ import print_function
import sys
import os.path
import requests
import numpy as np
from bokeh.objects import (
Plot, Range1d, LinearAxis, Grid,
Glyph, ColumnDataSource,
PanTool, WheelZoomTool)
from bokeh.glyphs import *
from bokeh import session
x = np.arange(1,6)
y = np.arange(5, 0, -1)... | bsd-3-clause | Python |
edd637bc583c589c4872c784cabb5e6ad9e6cb65 | Complete lc347_top_k_frequent_elements.py | bowen0701/algorithms_data_structures | lc347_top_k_frequent_elements.py | lc347_top_k_frequent_elements.py | """Leetcode 347. Top K Frequent Elements
Medium
Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 <= k <= number of unique elements.
Your algo... | """Leetcode 347. Top K Frequent Elements
Medium
Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Your algori... | bsd-2-clause | Python |
3468ddf47800fe806073e883e48a25451b28e570 | fix merge conflicts | nettube/mbtapuller,nettube/mbtapuller,nettube/mbtapuller | initial_setup.py | initial_setup.py | import APIFunctions
import datetime
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from Classes import Base, Trip, Station, TripRecord
#TODO everything
db = create_engine('sqlite:///mbta.db', echo=False)
Base.metadata.create_all(db)
Session = sessionmaker(bind=db)
session = Session()
... | import APIFunctions
import datetime
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from Classes import Base, Trip, Station, TripRecord
#TODO everything
db = create_engine('sqlite:///mbta.db', echo=False)
Base.metadata.create_all(db)
Session = sessionmaker(bind=db)
session = Session()
... | mit | Python |
c58237df7b67dd22c795cb1a8031291e29bfdb7e | Make a full RSS URL | markpasc/instapaperout | instapaperout.py | instapaperout.py | from datetime import datetime
import json
import logging
import os
from os.path import join
import re
from urllib.parse import urljoin
from xml.etree import ElementTree
import argh
from argh.interaction import confirm
import arghlog
import requests
def instapaper_out(exportpath: 'name of the directory to export to',... | from datetime import datetime
import json
import logging
import os
from os.path import join
import re
from xml.etree import ElementTree
import argh
from argh.interaction import confirm
import arghlog
import requests
def instapaper_out(exportpath: 'name of the directory to export to',
rss_url: 'URL... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.