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 |
|---|---|---|---|---|---|---|---|---|
842ce7998e7bd1f7ca5c52d8bdb3a44a023bdd0e | Update reapi.py | ArtiomL/tls-scan,ArtiomL/tls-scan | lib/reapi.py | lib/reapi.py | #!/usr/bin/env python
# tls-scan - lib: REST API
# https://github.com/ArtiomL/tls-scan
# Artiom Lichtenstein
# v0.0.1, 07/11/2016
import json
import requests
import log
__author__ = 'Artiom Lichtenstein'
__license__ = 'MIT'
__version__ = '0.0.1'
# SSL Labs REST API
class clsSAPI(object):
def __init__(self):
# API... | mit | Python | |
81c5bccd9689bb6cec7db439f754b0adda3b60b7 | save relative path instead of abstract path | wrenchzc/photomanager | src/db/imagehandler.py | src/db/imagehandler.py | import os
from src.pmconst import TODO_INX_NAME
from src.imageutils import ImageInfo
from src.db.helper import exif_to_model
from src.db.models import Option
def quote_str(s):
return '"{s}"'.format(s=s)
class ImageDBHandler:
def __init__(self, folder, session):
"""
:param session: db session... | import os
from src.pmconst import TODO_INX_NAME
from src.imageutils import ImageInfo
from src.db.helper import exif_to_model
from src.db.models import Option
def quote_str(s):
return '"{s}"'.format(s=s)
class ImageDBHandler:
def __init__(self, folder, session):
"""
:param session: db session... | mit | Python |
ff626be2b3378cdad5f1e22bde2f5ba552a18e5a | fix call to wrong base class method | vyos/vyos-1x,vyos/vyos-1x,vyos/vyos-1x,vyos/vyos-1x | scripts/cli/test_interfaces_wireless.py | scripts/cli/test_interfaces_wireless.py | #!/usr/bin/env python3
#
# Copyright (C) 2020 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... | #!/usr/bin/env python3
#
# Copyright (C) 2020 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... | lgpl-2.1 | Python |
9928201902b2e2d5fde1e835384df4a7796b1a00 | Prepare 8.0.0 | thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie | genie/__version__.py | genie/__version__.py | __version__ = "8.0.0"
| __version__ = "8.0.0-dev"
| mit | Python |
8948e063ab304a2b6311a947a16e59251c4a5357 | Bump minor release | DenisCarriere/geocoder | geocoder/__init__.py | geocoder/__init__.py | #!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
"""
Geocoder
~~~~~~~~
Simple and consistent geocoding library written in Python.
Many online providers such as Google & Bing have geocoding services,
these providers do not include Python libraries and have different
JSON responses between each... | #!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
"""
Geocoder
~~~~~~~~
Simple and consistent geocoding library written in Python.
Many online providers such as Google & Bing have geocoding services,
these providers do not include Python libraries and have different
JSON responses between each... | mit | Python |
34870792593f1f9d6103d927e8d8c1f986680556 | Bring back time to logging | stackforge/fuel-octane,stackforge/fuel-octane,Mirantis/octane,Mirantis/octane | octane/log.py | octane/log.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 |
4f9d3250648a51f37ba97ef32fb7301d7dd21a37 | use working directory for imports | evil-mad/plotink | plotink/plot_utils_import.py | plotink/plot_utils_import.py | from importlib import import_module
import sys
import os
'''
this handles importing in two major cases
In one case, the program is being run as a python script/library without inkscape. Everything can proceed normally.
In the other, AxiDraw's dependencies are siloed into DEPENDENCY_DIR_NAME so as not to mess with ot... | from importlib import import_module
import sys
import os
'''
this handles importing in two major cases
In one case, the program is being run as a python script/library without inkscape. Everything can proceed normally.
In the other, AxiDraw's dependencies are siloed into DEPENDENCY_DIR_NAME so as not to mess with ot... | mit | Python |
d86ef6248eb2d6c836e2c75a3abcb809df6211bb | add config-path has an option to allow users to specify where the configuration file is instead of using the default in home dir | dcsg/dropman | dropman/cli.py | dropman/cli.py | # The MIT License (MIT)
# Copyright (c) 2016 Daniel Gomes <me@danielcsgomes.com>
#
# 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 restriction, including without limitation
# the righ... | # The MIT License (MIT)
# Copyright (c) 2016 Daniel Gomes <me@danielcsgomes.com>
#
# 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 restriction, including without limitation
# the righ... | mit | Python |
ebb28b6405a797ad812c4369abdefb17bfd7bb3d | bump version to 20221105 | AOSC-Dev/acbs,AOSC-Dev/acbs,AOSC-Dev/acbs,AOSC-Dev/acbs | acbs/__init__.py | acbs/__init__.py | __version__ = '20221105'
| __version__ = '20221102'
| lgpl-2.1 | Python |
9d9b7536496ad77e01bf15968ddf280a1ecee42c | Fix quietness cmdline option help | project-generator/project_generator_definitions,ohagendorf/project_generator_definitions | project_generator_definitions/main.py | project_generator_definitions/main.py | # Copyright 2015 0xc0170
#
# 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, soft... | # Copyright 2015 0xc0170
#
# 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, soft... | apache-2.0 | Python |
44a5f687fd5c8a00a7c120e3775a340f033f178c | Update nltk tagger to conform to new interface spec | Typecraft/typecraft_python | typecraft_python/integrations/nltk/tagger.py | typecraft_python/integrations/nltk/tagger.py | import sys
from typecraft_python.core.interfaces import TypecraftTagger
from typecraft_python.parsing.convenience import word_pos_tuples_to_phrase
try:
import nltk
except ImportError:
nltk = None
sys.stderr.write("Unable to load NLTK, are you sure it is installed?")
class NltkTagger(TypecraftTagger):
... | import sys
from typecraft_python.core.interfaces import TypecraftTagger
from typecraft_python.parsing.convenience import word_pos_tuples_to_phrase
try:
import nltk
except ImportError:
nltk = None
sys.stderr.write("Unable to load NLTK, are you sure it is installed?")
class NltkTagger(TypecraftTagger):
... | mit | Python |
d207bf14b30636959e09659607bddcf4e349852b | Fix import order which was important | 3YOURMIND/django-migration-linter | django_migration_linter/sql_analyser/__init__.py | django_migration_linter/sql_analyser/__init__.py | from .base import BaseAnalyser # noqa
from .mysql import MySqlAnalyser # noqa
from .postgresql import PostgresqlAnalyser # noqa
from .sqlite import SqliteAnalyser # noqa
from .analyser import analyse_sql_statements # noqa isort:skip
| from .analyser import analyse_sql_statements # noqa
from .base import BaseAnalyser # noqa
from .mysql import MySqlAnalyser # noqa
from .postgresql import PostgresqlAnalyser # noqa
from .sqlite import SqliteAnalyser # noqa
| apache-2.0 | Python |
0346f4d4f408bdaa7401d074da6ba0c8fbc5c8da | bump version to v0.5.4 | briney/abstar | abstar/version.py | abstar/version.py | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.5.4' | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.5.3' | mit | Python |
acdd623a06644fd1eee6e9e3ce8985076c7ca0f3 | fix select current project | calvin620707/reservoir,calvin620707/reservoir | accounts/views.py | accounts/views.py | import logging
from django import forms
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.views import View
from django.views.generic import ListView, UpdateView
from accounts.models import Project
logger = logging.getLogge... | import logging
from django import forms
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views import View
from django.views.generic import ListView, UpdateView
from accounts.models import Project
logger = logging.getLogger()
class MyProje... | mit | Python |
e14c7f06ffd39c48bbd8ab42c19382f5029b5bc7 | Add comments, improve docstrings, add more descriptive names and clean some unnecessary code | AlanCristhian/symbolic_old,AlanCristhian/symbolic_old | expressions/types.py | expressions/types.py | """A library that define numeric sets."""
__all__ = ['Natural']
# Supose that I wish to define a vector with the below sintax:
# >>> v = Natural**3
# The upper expression mean that `v` is a 3-vector with Natural numbers. The
# _VectorMakerMeta metaclass add this feature to the `Natural` class through
# the `_Vecto... | """A library that define numeric sets."""
__all__ = ['Natural']
class _NumberMeta(type):
"""A metaclass that define mathematical operators for the class."""
def __init__(cls, name, bases, namespace):
return super().__init__(name, bases, namespace)
def __pow__(cls, exponent):
"""Make an ... | mit | Python |
c110c1a186f0466aade564813ece8247fbf91e52 | Remove VGG | MarvinTeichmann/KittiBox,MarvinTeichmann/KittiBox | encoder/vgg.py | encoder/vgg.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_fcn import fcn8_vgg
import tensorflow as tf
def inference(hypes, images, train=True):
"""Build the MNIST model up to where it may be used for inference.
Args:
images: Images pl... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_fcn import fcn8_vgg
import tensorflow as tf
def inference(hypes, images, train=True):
"""Build the MNIST model up to where it may be used for inference.
Args:
images: Images pl... | mit | Python |
c8d9fc7f8ce00e8e9676cac9bdc1978a93367c46 | Replace asserts with proper exceptions. | Ayrx/python-aead,Ayrx/python-aead | aead/__init__.py | aead/__init__.py | import base64
import os
import struct
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, hmac, padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
class AEAD(object):
def __init__(self, key, backend=default_backend()):
... | import base64
import os
import struct
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, hmac, padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
class AEAD(object):
def __init__(self, key, backend=default_backend()):
... | apache-2.0 | Python |
a9ff306231162a2a62d1dec67ac09da2169679fc | Reduce code outside of decomposeGlyph's recursion. | moyogo/roboto,moyogo/roboto,anthrotype/roboto,anthrotype/roboto,googlefonts/roboto,googlefonts/roboto | scripts/lib/fontbuild/decomposeGlyph.py | scripts/lib/fontbuild/decomposeGlyph.py | def decomposeGlyph(font, glyphName):
"""Moves the components of a glyph to its outline."""
glyph = font[glyphName]
decompose(font, glyph, glyph, (0, 0), (1, 1))
glyph.clearComponents()
def decompose(font, parent, component, offset, scale):
"""Copy contours to parent from component, including nest... | def decomposeGlyph(font, glyphName):
"""Moves the components of a glyph to its outline."""
glyph = font[glyphName]
for component in glyph.components:
decompose(font, glyphName, component.baseGlyph,
component.offset, component.scale)
glyph.clear(contours=False, anchors=False, g... | apache-2.0 | Python |
5f113ffd768431991f87cea1f5f804a25a1777d3 | Use rename doc instead of manually moving the data | StrellaGroup/frappe,saurabh6790/frappe,mhbu50/frappe,yashodhank/frappe,frappe/frappe,yashodhank/frappe,almeidapaulopt/frappe,yashodhank/frappe,frappe/frappe,mhbu50/frappe,almeidapaulopt/frappe,adityahase/frappe,saurabh6790/frappe,frappe/frappe,adityahase/frappe,mhbu50/frappe,adityahase/frappe,almeidapaulopt/frappe,yash... | frappe/patches/v13_0/replace_old_data_import.py | frappe/patches/v13_0/replace_old_data_import.py | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.rename_doc('DocType', 'Data Import', 'Data Import Legacy')
frappe.db.commit()
frappe.db.sql("DROP TABLE IF EXISTS `tabData Import`")
frap... | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql(
"""INSERT INTO `tabData Import Legacy` SELECT * FROM `tabData Import`"""
)
frappe.db.commit()
frappe.db.sql("DROP TABLE IF EXIS... | mit | Python |
f6262d0f7fc63995fc78939e59de2d5d55bbc4ea | Refactor of __init__ for style | ThoriumGroup/animatedSnap3D | animatedSnap3D/__init__.py | animatedSnap3D/__init__.py | #!/usr/bin/env python
"""
Animated Snap 3D
================
An extension to Nuke's "snap" options for animated 3D objects. Based on a
selection of vertices, this allows for objects to match the position, rotation
and scale of that selection over a specified frame range.
## Public Functions
run()
Adds th... | from animatedSnap3D import *
import nuke
# Add menu items under the Axis Menu
try:
m = nuke.menu('Axis').findItem('Snap')
m.addSeparator()
m.addCommand('Match position - ANIMATED', 'animatedSnap3D.translateThisNodeToPointsAnimated()')
m.addCommand('Match position, orientation - ANIMATED', 'animatedSnap3... | mit | Python |
068681dbff52ceb69ad3251db345e3326444e118 | Update Number_of_Islands.py | UmassJin/Leetcode | Array/Number_of_Islands.py | Array/Number_of_Islands.py | '''
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
11110
11010
11000
00000
Answer: 1
Example 2:
... | Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
11110
11010
11000
00000
Answer: 1
Example 2:
110... | mit | Python |
dcd47856c05fdbe390556803553bd86b57376a7c | Bump version to 0.6.8 | thorgate/tg-hammer,thorgate/tg-hammer | hammer/__init__.py | hammer/__init__.py | hammer_name = 'tg-hammer'
hammer_description = 'Helpers for fabric based deployments.'
hammer_version = '0.6.8'
__name__ = hammer_name
__description__ = hammer_description
__version__ = hammer_version
| hammer_name = 'tg-hammer'
hammer_description = 'Helpers for fabric based deployments.'
hammer_version = '0.6.7'
__name__ = hammer_name
__description__ = hammer_description
__version__ = hammer_version
| bsd-3-clause | Python |
b536ae34b5d43b6e9bb7466bdc0ce454600089a8 | Bump version | Frojd/django-react-templatetags,Frojd/django-react-templatetags,Frojd/django-react-templatetags | django_react_templatetags/__init__.py | django_react_templatetags/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
django_react_templatetags
----------
This extension allows you to add React components into your django templates.
"""
__title__ = "django_react_templatetags"
__version__ = "5.4.0"
__build__ = 540
__author__ = "Martin Sandström"
__license__ = "MIT"
__copyright__ = "Co... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
django_react_templatetags
----------
This extension allows you to add React components into your django templates.
"""
__title__ = "django_react_templatetags"
__version__ = "5.3.0"
__build__ = 530
__author__ = "Martin Sandström"
__license__ = "MIT"
__copyright__ = "Co... | mit | Python |
640544bd1d9131f8814e5dc8b4ea0d050889b502 | Add Django migrations | linovia/fab-bundle,linovia/fab-bundle | fab_bundle/django.py | fab_bundle/django.py | from fabric.api import env, run
from .utils import die, template
from .db import postgres
def manage(command, noinput=True):
"""Runs a management command"""
noinput = '--noinput' if noinput else ''
run('%s/env/bin/django-admin.py %s %s --settings=settings' % (
env.bundle_root, command, noinput))
... | from fabric.api import env, run
from .utils import die, template
from .db import postgres
def manage(command, noinput=True):
"""Runs a management command"""
noinput = '--noinput' if noinput else ''
run('%s/env/bin/django-admin.py %s %s --settings=settings' % (
env.bundle_root, command, noinput))
... | bsd-3-clause | Python |
bba05002911f7df2af4a0df536e30b2c48e01b9b | Change mesh.py to use textwrap to make it clearer what is going on | fangohr/oommf-python,fangohr/oommf-python,fangohr/oommf-python | joommf/mesh.py | joommf/mesh.py | import textwrap
class Mesh(object):
def __init__(self, lengths, mesh_spacing, scale=1e-9):
assert len(lengths) == 3, "Lengths must contain three values"
assert len(mesh_spacing) == 3, "mesh_spacing must contain a value" + \
"for each coordinate direction"
components = ['x', 'y',... | class Mesh(object):
def __init__(self, lengths, mesh_spacing, scale=1e-9):
assert len(lengths) == 3, "Lengths must contain three values"
assert len(mesh_spacing) == 3, "mesh_spacing must contain a value" + \
"for each coordinate direction"
components = ['x', 'y', 'z']
fo... | bsd-2-clause | Python |
94976f34bfc5f2472df0ad24adab1d8e3ebdd348 | Update doc | DTL-FAIRData/ODEX4all-UseCases,DTL-FAIRData/ODEX4all-UseCases,DTL-FAIRData/ODEX4all-UseCases | B4F/src/ontomap_breed.py | B4F/src/ontomap_breed.py | #!/usr/bin/env python
#
# This script maps breed names to Livestock Breed Ontology (LBO) IDs.
#
# Input files:
# ONTO.tsv with two columns: id (format: <ontology_acronym>:<term_id>) and name
# pigQTLdb.tsv with two columns: qtl_id and breed (comma-separated field of values)
#
# Output (STDOUT):
# three columns s... | #!/usr/bin/env python
#
# This script maps breed names to Livestock Breed Ontology (LBO) IDs.
#
# Input files:
# ONTO.tsv with two columns: id and name
# pigQTLdb.tsv with two columns: qtl_id and breed (comma-separated field of values)
#
# Output (STDOUT):
# three columns separated by \t: id, name, LBO breed IDs... | mit | Python |
2b9ebfd094ebc198f1d9fefbe91bd47199e42484 | Fix PEP8 issue | scriptotek/almar,scriptotek/lokar | almar/concept.py | almar/concept.py | # coding=utf-8
from __future__ import unicode_literals
import logging
from copy import copy, deepcopy
from six import python_2_unicode_compatible
from colorama import Fore, Back, Style
log = logging.getLogger(__name__)
@python_2_unicode_compatible
class Concept(object):
def __init__(self, term, vocabulary, tag='... | # coding=utf-8
from __future__ import unicode_literals
import logging
from copy import copy, deepcopy
from six import python_2_unicode_compatible
from colorama import Fore, Back, Style
log = logging.getLogger(__name__)
@python_2_unicode_compatible
class Concept(object):
def __init__(self, term, vocabulary, tag='... | agpl-3.0 | Python |
216294a0ea36c2fbabb43c31ce4fde3a9eee4bf3 | Update model for CBS host and volume information | oldarmyc/anchor,oldarmyc/anchor,oldarmyc/anchor | anchor/models.py | anchor/models.py | # Copyright 2014 Dave Kludt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2014 Dave Kludt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
95d77930c67dee4dc40b364435894e215394980c | Return a random URL from boss which has both sides > minimum_side | alexmic/great-again,alexmic/great-again | ga/boss.py | ga/boss.py | # -*- coding: utf-8 -*-
import random
from requests_oauthlib import OAuth1Session
from ga import settings
class BossImage(object):
def __init__(self, obj):
self.url = obj['url']
self.width = int(obj['width'])
self.height = int(obj['height'])
def image_url_for_term(term, minimum_side=se... | # -*- coding: utf-8 -*-
from requests_oauthlib import OAuth1Session
from ga import settings
class BossImage(object):
def __init__(self, obj):
self.url = obj['url']
self.width = int(obj['width'])
self.height = int(obj['height'])
def image_url_for_term(term, minimum_width=settings.IMAGE_... | mit | Python |
e729af04dd554df47feeb266637d8554c196c98d | Fix __exit__ method of contextobj | LilliJane/docido-python-sdk,cogniteev/docido-python-sdk | docido_sdk/toolbox/collections_ext.py | docido_sdk/toolbox/collections_ext.py | import copy
from peak.util.proxies import ObjectWrapper
class nameddict(dict):
""" Provides dictionary whose keys are accessible via the property
syntax: `obj.key`
"""
def __init__(self, *args, **kwargs):
super(nameddict, self).__init__(*args, **kwargs)
self.__dict__ = self
se... | import copy
from peak.util.proxies import ObjectWrapper
class nameddict(dict):
""" Provides dictionary whose keys are accessible via the property
syntax: `obj.key`
"""
def __init__(self, *args, **kwargs):
super(nameddict, self).__init__(*args, **kwargs)
self.__dict__ = self
se... | apache-2.0 | Python |
1d1dd7cfe24683c0bdffe3ac1ce6469233a25b53 | Update SyncServos.py | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | home/Mats/SyncServos.py | home/Mats/SyncServos.py | # A script to show how to syncronize two servos using the publish / subscribe pattern
# Works from version 1.0.1739
speech = Runtime.createAndStart("Speech","AcapelaSpeech")
speech.setVoice("Will")
speech.speakBlocking("Startting Arduino")
# Minimal script to syncronize 2 servos
arduino = Runtime.createAndStart("Arduin... | # This part will execute every time the left eye changes position
# and will make the right eye servo move in sync with the left
# This also allows for a point to adjust any offset between the eyes
# and also the posibility to have the servos move in opposite direction
def onServoEvent(pos):
eyeXR.moveTo(pos)
# Get th... | apache-2.0 | Python |
297f59db21ae93c6467009fe37988fd069113006 | add banner to fabfile | imsky/quickstart,imsky/quickstart | files/ops/fabfile.py | files/ops/fabfile.py | # Fabfile from Quickstart
# qkst.io/ops/fabfile
from fabric.api import (
task, parallel, roles
run, local, sudo, put,
env, settings
)
from fabric.contrib.project import rsync_project
from fabric.context_managers import cd, prefix
env.user = 'root'
env.roledefs = {
'local': ['localhost:22']
}
env.roledefs['... | from fabric.api import (
task, parallel, roles
run, local, sudo, put,
env, settings
)
from fabric.contrib.project import rsync_project
from fabric.context_managers import cd, prefix
env.user = 'root'
env.roledefs = {
'local': ['localhost:22']
}
env.roledefs['all'] = [host for role in env.roledefs.values() f... | mit | Python |
f482a845d724bc38199c8a413c2452b8d7216e73 | use os.getcwd() | hopshadoop/hops-util-py,hopshadoop/hops-util-py | hopsutil/tensorboard.py | hopsutil/tensorboard.py | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import pydoop.hdfs as hdfs
pdir = os.getcwd()
logpa... | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import pydoop.hdfs as hdfs
pdir = os.getenv("PDIR")... | apache-2.0 | Python |
115071fc5a8a631addb762e34f0af07e755dad1b | Use hostname instead of ip | hopshadoop/hops-util-py,hopshadoop/hops-util-py | hopsutil/tensorboard.py | hopsutil/tensorboard.py | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import pydoop.hdfs as pyhdfs
def register(logdir):
... | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import pydoop.hdfs as pyhdfs
def register(logdir):
... | apache-2.0 | Python |
3ebc983b25a3d6f06ca6dc1bd2f134b7149fc950 | Fix imageCapture result test | corerd/camshot | camgrab.py | camgrab.py | #!/usr/bin/python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Corrado Ubezio
#
# 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 restriction, including without limitation the rig... | #!/usr/bin/python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Corrado Ubezio
#
# 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 restriction, including without limitation the rig... | mit | Python |
c53144694c0735826135d3f639d178d80170a432 | Add rainy or sunny | ShuaiVerisk/flaskDemo,ShuaiVerisk/flaskDemo | Deploy/visualChecker/app.py | Deploy/visualChecker/app.py | # -*- coding: utf-8 -*-
import flask
import tornado.wsgi
import tornado.httpserver
import sys
import yweather
reload(sys)
sys.setdefaultencoding('utf8')
#########################################
# Obtain the flask app object
app = flask.Flask(__name__)
client = yweather.Client()
@app.route('/')
def index():
# St... | # -*- coding: utf-8 -*-
import flask
import tornado.wsgi
import tornado.httpserver
import sys
import re
import os
reload(sys)
sys.setdefaultencoding('utf8')
#########################################
# Obtain the flask app object
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_templat... | apache-2.0 | Python |
020afbe2f772732fea2703d24ccc862bf61be967 | Debug image_cap_loop error. | gnfrazier/YardCam | capture.py | capture.py | #!/usr/bin/python3
from picamera import PiCamera
import time
import os
import delay
import shutil
def setup(camera, resolution=None):
"""Starts preview, sets resolution, sleep allows time for sensor warming"""
camera.start_preview()
if resolution:
camera.resolution = (resolution)
else:
... | #!/usr/bin/python3
from picamera import PiCamera
import time
import os
import delay
import shutil
def setup(camera, resolution=None):
"""Starts preview, sets resolution, sleep allows time for sensor warming"""
camera.start_preview()
if resolution:
camera.resolution = (resolution)
else:
... | mit | Python |
1a2e60f9a72d26364050b376d2e3ab2a14f04bdc | Improve settings import error message | osantana/forecast | forecast/settings.py | forecast/settings.py | # coding: utf-8
from collections import OrderedDict
from copy import deepcopy
from forecast.utils import import_object
from forecast.exceptions import SettingsError
from forecast.defaults import DEFAULT_SETTINGS
class Settings(object):
def __init__(self, settings_list, _prefix=""):
self.settings_list = ... | # coding: utf-8
from collections import OrderedDict
from copy import deepcopy
from forecast.utils import import_object
from forecast.exceptions import SettingsError
from forecast.defaults import DEFAULT_SETTINGS
class Settings(object):
def __init__(self, settings_list, _prefix=""):
self.settings_list = ... | mit | Python |
31fb8b576edda4d88685fd45537f68d3f067ae7b | Use Exception instead of StandardError | startling/cytoplasm | source/cytoplasm/errors.py | source/cytoplasm/errors.py | class CytoplasmError(Exception): pass
class ControllerError(CytoplasmError): pass
class InterpreterError(CytoplasmError): pass
| class ControllerError(StandardError): pass
class InterpreterError(StandardError): pass
| mit | Python |
77b90ff008f64d396e91d29db11752e667d26a87 | set py to subpy | lewangbtcc/anti-XSS,lewangbtcc/anti-XSS | getLink.py | getLink.py | #encoding: utf8
# links ia a global set that stroe all of the links in the particular domain.
links = set()
global DOMAIN
# Return a set of url links in src page
def getLink(src):
source = src.lower()
# links = set()
head = 0
length = len(source)
flag = True
while ((flag) and (head < length)):... | #encoding: utf8
# links ia a global set that stroe all of the links in the particular domain.
links = set()
global DOMAIN
# Return a set of url links in src page
def getLink(src):
source = src.lower()
# links = set()
head = 0
length = len(source)
flag = True
while ((flag) and (head < length)):... | mit | Python |
48601c1022f55150e4b8b47f48e2f9a5e252a8f6 | use post_config_hook | vvoland/py3status,alexoneill/py3status,tobes/py3status,valdur55/py3status,ultrabug/py3status,Andrwe/py3status,valdur55/py3status,Andrwe/py3status,docwalter/py3status,guiniol/py3status,ultrabug/py3status,ultrabug/py3status,valdur55/py3status,tobes/py3status,guiniol/py3status | py3status/modules/scratchpad_async.py | py3status/modules/scratchpad_async.py | # -*- coding: utf-8 -*-
"""
Display number of windows and urgency hints asynchronously.
Configuration parameters:
always_show: always display the format (default False)
format: display format for this module (default "{counter} ⌫")
Format placeholders:
{counter} number of scratchpad windows
Requires:
... | # -*- coding: utf-8 -*-
"""
Display number of windows and urgency hints asynchronously.
Configuration parameters:
always_show: always display the format (default False)
format: display format for scratchpad_async (default "{counter} ⌫")
Format placeholders:
{counter} number of scratchpad windows
Requires... | bsd-3-clause | Python |
dc2cee5a167e49a00d185a5bcca928ac05f890b0 | fix split bson file | Zhenxingzhang/kaggle-cdiscount-classification,Zhenxingzhang/kaggle-cdiscount-classification | src/data_preparation/random_sample_bson_file.py | src/data_preparation/random_sample_bson_file.py | from bson import BSON
import random, bson
from tqdm import tqdm
import argparse
import os
def random_sample_bson(input_bson_filename, output_bson_filename, n=100, number_random_example=10):
data = bson.decode_file_iter(open(input_bson_filename, 'rb'))
random_items = random.sample(range(n), number_random_ex... | from bson import BSON
import random, bson
from tqdm import tqdm
import argparse
import os
def random_sample_bson(input_bson_filename, output_bson_filename, n=100, number_random_example=10):
data = bson.decode_file_iter(open(input_bson_filename, 'rb'))
random_items = random.sample(range(n), number_random_exa... | apache-2.0 | Python |
af5a78559fb785b6e7ab2807006959744493fe59 | update apikeys | n0bel/PiClock,n0bel/PiClock,n0bel/PiClock,n0bel/PiClock,n0bel/PiClock | Clock/ApiKeys-example.py | Clock/ApiKeys-example.py | # change this to your API keys
# Map API keys -- only needs 1 of the following
# Google Maps API key (if usemapbox is not set in Config)
googleapi = 'YOUR GOOGLE MAPS API KEY'
# Mapbox API key (access_token) [if usemapbox is set in Config]
mbapi = 'YOUR MAPBOX ACCESS TOKEN'
# If you want to use Openweathermap.o... | # change this to your API keys
# Map API keys -- only needs 1 of the following
# Google Maps API key (if usemapbox is not set in Config)
googleapi = 'YOUR GOOGLE MAPS API KEY'
# Mapbox API key (access_token) [if usemapbox is set in Config]
mbapi = 'YOUR MAPBOX ACCESS TOKEN'
# If you want to use Openweathermap.o... | mit | Python |
229ecaf0ea69ad586587ea70b8a90d59e0e64005 | Add numbers and definitions (#10665) | explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy | spacy/lang/vi/lex_attrs.py | spacy/lang/vi/lex_attrs.py | from ...attrs import LIKE_NUM
_num_words = [
"không", # Zero
"một", # One
"mốt", # Also one, irreplacable in niché cases for unit digit such as "51"="năm mươi mốt"
"hai", # Two
"ba", # Three
"bốn", # Four
"tư", # Also four, used in certain cases for unit ... | from ...attrs import LIKE_NUM
_num_words = [
"không",
"một",
"hai",
"ba",
"bốn",
"năm",
"sáu",
"bảy",
"bẩy",
"tám",
"chín",
"mười",
"chục",
"trăm",
"nghìn",
"tỷ",
]
def like_num(text):
if text.startswith(("+", "-", "±", "~")):
text = text[1... | mit | Python |
04482374615d90245d9458b436ebc1e1bae7ea1b | Add back missing newline | DMOJ/judge,DMOJ/judge,DMOJ/judge | dmoj/executors/OCTAVE.py | dmoj/executors/OCTAVE.py | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | agpl-3.0 | Python |
a85c21dc324750c3fa7e96d2d0baf3c45657201e | Add convenience function to load in some test data | saltstack/salt-console | sconsole/static.py | sconsole/static.py | '''
Holds static data components, like the palette
'''
import pprint
def tree_seed():
return {'jids': [
{'_|-76789876543456787654': [{'localhost': {'return': True}},
{'otherhost': {'return': True}}],},
{'_|-7678987654345678765... | '''
Holds static data components, like the palette
'''
def msg(msg, logfile='console_log.txt'):
'''
Send a message to a logfile, defaults to console_log.txt.
This is useful to replace a print statement since curses does put
a bit of a damper on this
'''
with open(logfile, 'a+') as fp_:
... | apache-2.0 | Python |
75bc608b20b38b29ecc5e2ff1e62df51b7b927a4 | Update mapper_lowercase.py | dragoon/kilogram,dragoon/kilogram,dragoon/kilogram | mapreduce/filter/mapper_lowercase.py | mapreduce/filter/mapper_lowercase.py | #!/usr/bin/env python
import sys
# Open just for read
dbpediadb = set(open('dbpedia_labels.txt').read().splitlines())
dbpediadb_lower = set(x.lower() for x in open('dbpedia_labels.txt').read().splitlines())
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the li... | #!/usr/bin/env python
import sys
# Open just for read
dbpediadb = set(open('dbpedia_labels.txt').read().splitlines())
dbpediadb_lower = set(x.lower() for x in open('dbpedia_labels.txt').read().splitlines())
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the li... | apache-2.0 | Python |
7e3adef42f6a777d1656fb33d078d53ffb7bc188 | reduce CPU usage | phelpsw/SiK,jschall/SiK,tomszilagyi/SiK,tridge/DavisSi1000,chrissnell/DavisSi1000,RFDesign/SiK,phelpsw/SiK,weera00/SiK,gardners/SiK,joeman155/SiK,joeman155/SiK,Dronecode/SiK,mikeclement/SiK,Serveurperso/SiK,geeksville/SiK,mikeclement/SiK,mikeclement/SiK,jschall/SiK,davidbuzz/SiK,nusepo/SiK,GaloisInc/smaccmpilot-SiK,phe... | Firmware/tools/reflector.py | Firmware/tools/reflector.py | #!/usr/bin/env python
# reflect input bytes to output, printing as it goes
import serial, sys, optparse
parser = optparse.OptionParser("reflector")
parser.add_option("--baudrate", type='int', default=115200, help='baud rate')
parser.add_option("--echo", action='store_true', default=False, help='echo to stdout')
opts... | #!/usr/bin/env python
# reflect input bytes to output, printing as it goes
import serial, sys, optparse
parser = optparse.OptionParser("reflector")
parser.add_option("--baudrate", type='int', default=115200, help='baud rate')
parser.add_option("--echo", action='store_true', default=False, help='echo to stdout')
opts... | bsd-2-clause | Python |
b0b6cd8e392f1722ed52c6e397a32addd373287a | Make dlpack code robust against upcoming XLA Python binding change. (#2876) | tensorflow/probability,tensorflow/probability,google/jax,google/jax,google/jax,google/jax | jax/dlpack.py | jax/dlpack.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
1d4227bc3d08e8d95fcffe3878e865495907b294 | Fix broken API call, and broken build (#55) | all-of-us/raw-data-repository,all-of-us/raw-data-repository,all-of-us/raw-data-repository | rest-api-client/participant_client.py | rest-api-client/participant_client.py | """Simple client demonstrating how to create and retrieve a participant"""
import pprint
from client.client import Client, HttpException
def main():
client = Client('rdr/v1')
first_name = 'Mister'
last_name = 'Pants'
date_of_birth = '1975-08-21'
# Create a new participant.
participant = {
'first_... | """Simple client demonstrating how to create and retrieve a participant"""
import pprint
from client.client import Client, HttpException
def main():
client = Client('participant/v1')
first_name = 'Mister'
last_name = 'Pants'
date_of_birth = '1975-08-21'
# Create a new participant.
participant = {
... | bsd-3-clause | Python |
64da37ce02e66c4972d345f6b1f7c29cad3c0c79 | stop symbolic link | yasokada/python-151113-lineMonitor,yasokada/python-151113-lineMonitor | dummySerial.py | dummySerial.py |
'''
v0.1 2015/11/13
- add dummySerial.py
'''
class CDummySerial:
def __init__(self):
# do nothing
return
def read(self):
# do nothing
# print "read:" # TODO: 0 > remove
return ""
def write(self,txstr):
# do nothing
# print "write:", txstr # TODO: 0 > remove
return ""
@staticmethod
def Serial(n... | mit | Python | |
a2adc956b9508ec513c00fde6dbed235a06db489 | bump to 1.7.8 | 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 = "1.7.8"
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.7.7"
def _generate_version(base_version):
"""Generate a version ... | apache-2.0 | Python |
a7d44c7dc38282d8097aa5fc7f9acc62d716df21 | bump to 0.35.2 | efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol,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.35.2"
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.35.1"
def _generate_version(base_version):
"""Generate a versio... | apache-2.0 | Python |
835c0fa2826a7edca55ee86c0f099c51c375b692 | bump to 0.9.5 | martin-hunt/hublib | hublib/__init__.py | hublib/__init__.py | from pint import UnitRegistry
ureg = UnitRegistry()
ureg.autoconvert_offset_to_baseunit = True
Q_ = ureg.Quantity
__version__ = "0.9.5"
| from pint import UnitRegistry
ureg = UnitRegistry()
ureg.autoconvert_offset_to_baseunit = True
Q_ = ureg.Quantity
__version__ = "0.9.4"
| mit | Python |
5d694d597459288d40962ee2ab781452a0accbcb | add todos | cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/db-webcrawler | scripts/analyze.py | scripts/analyze.py | #!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core"))
import re
import sqlparse
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cmudbac.settings")
import django
django.setup()
from library.... | #!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core"))
import re
import sqlparse
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cmudbac.settings")
import django
django.setup()
from library.... | apache-2.0 | Python |
2edf27c39d71ceb1395fae9fe4d8f11cb456d0af | Change python3 to python. | rsmith-nl/scripts,rsmith-nl/scripts | passphrase.py | passphrase.py | #!/usr/bin/env python
# file: passphrase.py
# vim:fileencoding=utf-8:ft=python
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# Created: 2015-12-28 12:11:31 +0100
# Last modified: 2020-10-03T12:20:58+0200
"""
Creates a passphrase.
It picks words from a word list, and adds filler characters between the words.
"""
import ar... | #!/usr/bin/env python3
# file: passphrase.py
# vim:fileencoding=utf-8:ft=python
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# Created: 2015-12-28 12:11:31 +0100
# Last modified: 2020-10-03T12:20:58+0200
"""
Creates a passphrase.
It picks words from a word list, and adds filler characters between the words.
"""
import a... | mit | Python |
3fcac70e0a37d4882e3c911e479bc93dbe4d2719 | Fix import of main in test_cli and update languages | hackebrot/cookiedozer,hackebrot/cookiedozer | {{cookiecutter.repo_name}}/tests/test_cli.py | {{cookiecutter.repo_name}}/tests/test_cli.py | import pytest
from click.testing import CliRunner
from {{cookiecutter.repo_name}}.cli import main
@pytest.fixture
def runner():
return CliRunner()
@pytest.fixture(params=['en', 'de'])
def lang(request):
return request.param
@pytest.fixture(params=['-l', '--language'])
def cli_param(request):
return r... | import pytest
from click.testing import CliRunner
from cli import main
@pytest.fixture
def runner():
return CliRunner()
@pytest.fixture(params=['fr', 'en', 'tlh'])
def lang(request):
return request.param
@pytest.fixture(params=['-l', '--language'])
def cli_param(request):
return request.param
@pyte... | mit | Python |
62bbdc9d7f0fa5835953e8e6d1df45023414f5ed | Update __init__.py with new version 1.5.0 | F5Networks/f5-common-python,F5Networks/f5-common-python | f5/__init__.py | f5/__init__.py | # Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 | Python |
4f238b550121fe6a9a088f2726ba5e14c3e6bbdb | Cut down contents of the settings file. | Letractively/kay-framework,Letractively/kay-framework,Letractively/kay-framework,Letractively/kay-framework | settings.py | settings.py | # -*- coding: utf-8 -*-
"""
A sample of kay settings.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
DEFAULT_TIMEZONE = 'Asia/Tokyo'
DEBUG = True
PROFILE = False
SECRET_... | # -*- coding: utf-8 -*-
"""
A sample of kay settings.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
DEFAULT_TIMEZONE = 'Asia/Tokyo'
DEBUG = True
PROFILE = False
SECRET_... | bsd-3-clause | Python |
9c0739b758cac6d1c38abe2ce0bd979f9caf2b1b | Add comments to settings. | ggordan/GutterColor,ggordan/GutterColor | settings.py | settings.py | from os.path import dirname, realpath, join
# The path where the color cache is stored
CACHE_PATH = join(dirname(realpath(__file__)), '.cache')
# The path where the icons are stored
ICON_PATH = join(dirname(realpath(__file__)), 'icons')
| from os.path import dirname, realpath, join
CACHE_PATH = join(dirname(realpath(__file__)), '.cache')
ICON_PATH = join(dirname(realpath(__file__)), 'icons')
| mit | Python |
a814762f052a093c5e7ae8232c322e19730fee69 | fix LocationQuery iter | NoMoKeTo/transit,NoMoKeTo/choo | src/choo/queries/locations.py | src/choo/queries/locations.py | from ..models import POI, Address, Location, Stop
from .base import Query
class LocationQuery(Query):
Model = Location
_settings_defaults = {'max_distance': 1000}
def max_distance(self, max_distance):
if not isinstance(max_distance, int) or max_distance < 1:
raise TypeError('max_dista... | from ..models import POI, Address, Location, Stop
from .base import Query
class LocationQuery(Query):
Model = Location
_settings_defaults = {'max_distance': 1000}
def max_distance(self, max_distance):
if not isinstance(max_distance, int) or max_distance < 1:
raise TypeError('max_dista... | apache-2.0 | Python |
ae217fb3ac4233a588672b4372be876ee89962e8 | Update fixcounters to remove corrupted chat lines and sessions automatically. | MSPARP/MSPARP,MSPARP/MSPARP,MSPARP/MSPARP | fixcounters.py | fixcounters.py | from lib import SEARCH_PERIOD, ARCHIVE_PERIOD, OUBLIETTE_ID, get_time, validate_chat_url
from lib.characters import CHARACTER_GROUPS, CHARACTERS, CHARACTER_DETAILS
from lib.messages import parse_line
from lib.sessions import CASE_OPTIONS
from redis import ConnectionPool, Redis, UnixDomainSocketConnection
from progressb... | from lib import SEARCH_PERIOD, ARCHIVE_PERIOD, OUBLIETTE_ID, get_time, validate_chat_url
from lib.characters import CHARACTER_GROUPS, CHARACTERS, CHARACTER_DETAILS
from lib.messages import parse_line
from lib.sessions import CASE_OPTIONS
from redis import ConnectionPool, Redis, UnixDomainSocketConnection
from progressb... | mit | Python |
bfddb2abd0e530fc0eaba77ab4dcae11c6e08d27 | Create a ReadOnly editor for Time. Create stubs for the Custom and the Text editors while I'm in here. | geggo/pyface,pankajp/pyface,brett-patterson/pyface,geggo/pyface | enthought/traits/ui/wx/time_editor.py | enthought/traits/ui/wx/time_editor.py | #------------------------------------------------------------------------------
#
# Copyright (c) 2008, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions... | #------------------------------------------------------------------------------
#
# Copyright (c) 2008, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions... | bsd-3-clause | Python |
5e0c1d04aa189c9c51e4e4f17d77a2963046f955 | mark as not installable | acsone/bank-statement-reconcile,damdam-s/bank-statement-reconcile,brain-tec/bank-statement-reconcile,VitalPet/bank-statement-reconcile,BT-ojossen/bank-statement-reconcile,raycarnes/bank-statement-reconcile,hbrunn/bank-statement-reconcile,jakar/odoo-bank-statement-reconcile,StefanRijnhart/bank-statement-reconcile,brain-... | __unported__/account_advanced_reconcile_bank_statement/__openerp__.py | __unported__/account_advanced_reconcile_bank_statement/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Matthieu Dietrich
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Matthieu Dietrich
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 | Python |
401e60837c13af5a350b1487225a296c2e803069 | Use a saner test filename, to work on Windows. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_dumbdbm.py | Lib/test/test_dumbdbm.py | #! /usr/bin/env python
"""Test script for the dumbdbm module
Original by Roger E. Masse
"""
# XXX This test is a disgrace. It doesn't test that it works.
import dumbdbm as dbm
from dumbdbm import error
from test_support import verbose, TESTFN as filename
d = dbm.open(filename, 'c')
d['a'] = 'b'
d['12345678910'] ... | #! /usr/bin/env python
"""Test script for the dumbdbm module
Original by Roger E. Masse
"""
# XXX This test is a disgrace. It doesn't test that it works.
import dumbdbm as dbm
from dumbdbm import error
from test_support import verbose
filename = '/tmp/delete_me'
d = dbm.open(filename, 'c')
d['a'] = 'b'
d['12345... | mit | Python |
37ade5f4ce1feb44cdb7f8de1e373f5085c77a40 | Add simple server for testing purposes. | thurloat/socrates,thurloat/socrates | socrates.py | socrates.py | from socrates.main import main
from socrates.bootstrap import run
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-i', '--init', action='store_true', help='Some help')
parser.add_option('-g', '--generate', action='store_true', help='Some help')
parser.add_option('-r', '--run', action='sto... | from socrates.main import main
from socrates.bootstrap import run
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-i', '--init', action='store_true', help='Some help')
parser.add_option('-g', '--generate', action='store_true', help='Some help')
options, args = parser.parse_args()
if opt... | bsd-3-clause | Python |
cf245e71e770d21db8a48a74f8833d1099157e73 | Reduce undoings of multi-prefix on users | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/modules/ircv3/multiprefix.py | txircd/modules/ircv3/multiprefix.py | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class MultiPrefix(ModuleData):
implements(IPlugin, IModuleData)
name = "MultiPrefix"
def actions(self):
return [ ("channelstatuses", 2, self.allStatuses),
("capabilit... | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class MultiPrefix(ModuleData):
implements(IPlugin, IModuleData)
name = "MultiPrefix"
def actions(self):
return [ ("channelstatuses", 2, self.allStatuses),
("capabilit... | bsd-3-clause | Python |
7abcb9cd4cc5faa0c8c8ffbd641133d4f867b90f | Clean up urlconf (part of major refactor) | arpitremarkable/importd,hitul007/importd,pombredanne/importd,akshar-raaj/importd,janusnic/importd,pombredanne/importd,janusnic/importd,arpitremarkable/importd,hitul007/importd,akshar-raaj/importd | importd/urlconf.py | importd/urlconf.py | # -*- coding: utf-8 -*-
try:
from django.conf.urls import patterns
except ImportError:
from django.conf.urls.defaults import patterns
finally:
urlpatterns = patterns("")
| try:
from django.conf.urls import patterns
except ImportError:
from django.conf.urls.defaults import patterns
urlpatterns = patterns("")
| bsd-3-clause | Python |
c0ad373b64f75d1cde214543a567e65ee7d021ce | Add user active check | atulmishra-one/dairy_manager,atulmishra-one/dairy_manager,atulmishra-one/dairy_manager | app/default/controllers.py | app/default/controllers.py | """
This is default module controller
It define default routes
"""
from flask import render_template
from flask import request
from flask import flash
from flask import redirect
from flask import url_for
from flask_login import login_user
from flask_login import logout_user
from flask_login import current_user
from a... | """
This is default module controller
It define default routes
"""
from flask import render_template
from flask import request
from flask import flash
from flask import redirect
from flask import url_for
from flask_login import login_user
from flask_login import logout_user
from flask_login import current_user
from a... | mit | Python |
c1240af4f152c457752f4b134c0afd6f3e8d2e74 | add altered priors function | iancze/Starfish | Starfish/emulator/_utils.py | Starfish/emulator/_utils.py | import logging
import numpy as np
from scipy.special import loggamma
log = logging.getLogger(__name__)
def get_w_hat(eigenspectra, fluxes):
"""
Since we will overflow memory if we actually calculate Phi, we have to
determine w_hat in a memory-efficient manner.
"""
m = len(eigenspectra)
M = ... | import logging
import numpy as np
log = logging.getLogger(__name__)
def get_w_hat(eigenspectra, fluxes, M):
"""
Since we will overflow memory if we actually calculate Phi, we have to
determine w_hat in a memory-efficient manner.
"""
m = len(eigenspectra)
out = np.empty((M * m,))
for i i... | bsd-3-clause | Python |
b3ce9f575c90901372a53cadb77e6079f0f8311a | Fix settings.py lint | jrg365/gpytorch,jrg365/gpytorch,jrg365/gpytorch | gpytorch/settings.py | gpytorch/settings.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class _feature_flag(object):
_state = False
@classmethod
def on(cls):
return cls._state
@classmethod
def _set_state(cls, state):
cl... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class _feature_flag(object):
_state = False
@classmethod
def on(cls):
return cls._state
@classmethod
def _set_state(cls, state):
cls... | mit | Python |
248ceda310d43b87343e8e0a4681df10ac4d3681 | Normalize the chromite import pathway injected. | zhang0137/chromite,coreos/chromite,zhang0137/chromite,bpsinc-native/src_third_party_chromite,coreos/chromite,bpsinc-native/src_third_party_chromite,bpsinc-native/src_third_party_chromite,zhang0137/chromite,chadversary/chromiumos.chromite,chadversary/chromiumos.chromite,coreos/chromite | scripts/wrapper.py | scripts/wrapper.py | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS 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 functools
import os
import signal
import sys
# We want to use correct version of libraries even when executed through symlin... | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS 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 functools
import os
import signal
import sys
# We want to use correct version of libraries even when executed through symlin... | bsd-3-clause | Python |
9e61c84a8714513e994fba7ab27047ac6fe8bfb7 | remove unused import of PrimitiveT | ssato/python-anyconfig,ssato/python-anyconfig | src/anyconfig/backend/base/datatypes.py | src/anyconfig/backend/base/datatypes.py | #
# Copyright (C) 2021 Satoru SATOH <satoru.satoh @ gmail.com>
# SPDX-License-Identifier: MIT
#
r"""Utility functions in anyconfig.backend.base.
"""
import typing
from ...common import (
InDataT, IOInfo, PathOrIOInfoT, InDataExT
)
OutDataExT = InDataExT
IoiT = IOInfo
MaybeFilePathT = typing.Optional[PathOrIOInf... | #
# Copyright (C) 2021 Satoru SATOH <satoru.satoh @ gmail.com>
# SPDX-License-Identifier: MIT
#
r"""Utility functions in anyconfig.backend.base.
"""
import typing
from ...common import (
InDataT, IOInfo, PathOrIOInfoT, PrimitiveT, InDataExT
)
OutDataExT = InDataExT
IoiT = IOInfo
MaybeFilePathT = typing.Optional... | mit | Python |
6501c08fed33874e0610e80c3eb7d39ae1350ccf | fix brunel bar chart stacked | ibm-cds-labs/pixiedust,ibm-cds-labs/pixiedust,ibm-cds-labs/pixiedust,ibm-cds-labs/pixiedust | pixiedust/display/chart/renderers/brunel/barChartDisplay.py | pixiedust/display/chart/renderers/brunel/barChartDisplay.py | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | apache-2.0 | Python |
e352f7974b617c516621ec236bc383a226990f97 | Remove urlpattern in demo | EliotBerriot/django-app-namespace-template-loader,bittner/django-app-namespace-template-loader,EliotBerriot/django-app-namespace-template-loader,Fantomas42/django-app-namespace-template-loader,Fantomas42/django-app-namespace-template-loader,bittner/django-app-namespace-template-loader | app_namespace/demo/urls.py | app_namespace/demo/urls.py | """Urls for the app_namespace demo"""
from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(
template_name='application/template.html')),
]
| """Urls for the app_namespace demo"""
from django.conf.urls import url
from django.conf.urls import patterns
from django.views.generic import TemplateView
urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(
template_name='application/template.html')),
)
| bsd-3-clause | Python |
f979000779492f057214a31a76c5bff2202c7ea9 | modify file : modify form | KIKUYA-Takumi/NippoKun,KIKUYA-Takumi/NippoKun,KIKUYA-Takumi/NippoKun | NippoKun/report/forms.py | NippoKun/report/forms.py | from django import forms
from .models import Report, Score
class ReportForm(forms.ModelForm):
class Meta:
model = Report
fields = ('report_title', 'report_content')
widget = {
'report_title': forms.TextInput(attrs={'size': 50}),
'report_content': forms.Textarea(att... | from django import forms
from .models import Report, Score
class ReportForm(forms.ModelForm):
class Meta:
model = Report
fields = ('report_title', 'report_content')
widget = {
'report_title': forms.TextInput(attrs={'size': 50}),
'report_content': forms.Textarea(att... | mit | Python |
f3476d63ec422231acd2e46b4112768f4d31a825 | Fix validator | hackupc/backend,hackupc/backend,hackupc/backend,hackupc/backend | applications/validators.py | applications/validators.py | import os
from django.core.exceptions import ValidationError
from django.conf import settings
def validate_file_extension(value):
(_, ext) = os.path.splitext(value.name)
valid_extensions = settings.SUPPORTED_RESUME_EXTENSIONS
if valid_extensions and not ext.lower() in valid_extensions:
raise Valid... | import os
from django.core.exceptions import ValidationError
from django.conf import settings
def validate_file_extension(value):
(_, ext) = os.path.splitext(value.name)
valid_extensions = settings.SUPPORTED_RESUME_EXTENSIONS
if not ext.lower() in valid_extensions:
raise ValidationError('Unsupport... | mit | Python |
8e583d018fe222cef04e6c30106475a9012f6e42 | rename variables to match mcproject's name;separate operations to lines. | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | web/impact/impact/v0/views/utils.py | web/impact/impact/v0/views/utils.py | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
import base64
import hashlib
import os
from time import time
from Crypto.Cipher import AES
from django.conf import settings
from accelerator.models import (
Site,
SiteProgramAuthorization,
)
BADGE_DISPLAYS = ("STARTUP_LIST", "STARTUP_LIST_AND_PROFILE")... | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
import base64
import hashlib
import os
from time import time
from Crypto.Cipher import AES
from django.conf import settings
from accelerator.models import (
Site,
SiteProgramAuthorization,
)
BADGE_DISPLAYS = ("STARTUP_LIST", "STARTUP_LIST_AND_PROFILE")... | mit | Python |
d653a44bb53f0f6e64faf61ea8f63c90fddb369b | Add news exceptions | mstuttgart/pycep-correios | pycep_correios/exceptions.py | pycep_correios/exceptions.py |
class BaseException(Exception):
"""Base class for exceptions"""
class InvalidCEP(BaseException):
"""Exception raised to invalid CEP requests"""
class CEPNotFound(BaseException):
"""Exception raised to CEP not founded requests"""
class ConnectionError(BaseException):
"""Exception raised to request... |
class BaseException(Exception):
""" base exception"""
def __init__(self, message=''):
super(BaseException, self).__init__(message)
self.message = message
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, self.message)
| mit | Python |
351e5488bad06efc187573274e14ac34c575de6e | change quotes | rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh | fabfile/doc.py | fabfile/doc.py | from fabric.api import task, local
import sys
import os
browser = "firefox"
if sys.platform == 'darwin':
browser = "open"
@task
def view():
"""view the documentation in a browser"""
local("{browser} doc/build/html/index.html".format(browser=browser))
@task
def html():
# disable Flask RSTPAGES due to... | from fabric.api import task, local
import sys
import os
browser = "firefox"
if sys.platform == 'darwin':
browser = "open"
@task
def view():
"""view the documentation in a browser"""
local("{browser} doc/build/html/index.html".format(browser=browser))
@task
def html():
# disable Flask RSTPAGES due to... | apache-2.0 | Python |
ed49bd428e4782a23a606340b96e779019060611 | Bump version to v1.9.11.dev14 | DirkHoffmann/indico,pferreir/indico,OmeGak/indico,OmeGak/indico,indico/indico,pferreir/indico,mvidalgarcia/indico,ThiefMaster/indico,ThiefMaster/indico,mvidalgarcia/indico,mvidalgarcia/indico,indico/indico,mic4ael/indico,OmeGak/indico,indico/indico,mic4ael/indico,OmeGak/indico,indico/indico,DirkHoffmann/indico,DirkHoff... | indico/__init__.py | indico/__init__.py | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | mit | Python |
e4344c0abf35b1683dfdf253427e9b2728e88814 | bump version to 0.7.2 | sckott/habanero | habanero/__init__.py | habanero/__init__.py | # -*- coding: utf-8 -*-
# habanero
'''
habanero library
~~~~~~~~~~~~~~~~~~~~~
habanero is a low level client for the Crossref search API.
Usage::
from habanero import Crossref
cr = Crossref()
# setup a different base URL
Crossref(base_url = "http://some.other.url")
# setup an api key
Crossref(a... | # -*- coding: utf-8 -*-
# habanero
'''
habanero library
~~~~~~~~~~~~~~~~~~~~~
habanero is a low level client for the Crossref search API.
Usage::
from habanero import Crossref
cr = Crossref()
# setup a different base URL
Crossref(base_url = "http://some.other.url")
# setup an api key
Crossref(a... | mit | Python |
972dc664eb9ed1043b8fc3f3e662e963fe114e11 | Remove unneccessary string to array conversion | joke2k/faker,joke2k/faker,danhuss/faker | faker/providers/ssn/fr_CH/__init__.py | faker/providers/ssn/fr_CH/__init__.py | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as SsnProvider
class Provider(SsnProvider):
ssn_formats = ("###.####.####.##",)
def ssn(self):
"""
Returns a 13 digits Swiss SSN named AHV (German) or
AVS (French and It... | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as SsnProvider
class Provider(SsnProvider):
ssn_formats = ("###.####.####.##",)
def ssn(self):
"""
Returns a 13 digits Swiss SSN named AHV (German) or
AVS (French and It... | mit | Python |
f7f83bf768887b015f1bfd16df2b8f9941e3dc3a | Update ledinit.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | apps/led_berepi/ledinit.py | apps/led_berepi/ledinit.py | ## This code for LED BD 00
thispath='...BerePi/trunk/apps/led_berepi'
import time
import sys
import RPi.GPIO as GPIO
debug_print = 1
# if LED PCB has GND pcb_GND = 1, otherwise 0
# hsetting : it is HW setting, you should check it
pcb_GND = 1
# important, sensorname shuould be pre-defined, unique sensorname
bdname =... | ## This code for LED BD 00
thispath='...BerePi/trunk/apps/led_berepi'
import time
import sys
import RPi.GPIO as GPIO
debug_print = 1
# if LED PCB has GND pcb_GND = 1, otherwise 0
# hsetting : it is HW setting, you should check it
pcb_GND = 1
# important, sensorname shuould be pre-defined, unique sensorname
bdname =... | bsd-2-clause | Python |
30a90e30d3f9f4c15bc4bef72710885885a33ca8 | fix handling of nans in streamcluster | jck/accept,uwsampa/accept,uwsampa/accept,uwsampa/accept,jck/accept,jck/accept,jck/accept,uwsampa/accept | apps/streamcluster/eval.py | apps/streamcluster/eval.py | import munkres
import math
def load(fn='output.txt'):
centers = []
with open(fn) as f:
while True:
ident = f.readline()
if not ident:
break
weight = f.readline()
coords = f.readline()
f.readline()
centers.append((... | import munkres
def load(fn='output.txt'):
centers = []
with open(fn) as f:
while True:
ident = f.readline()
if not ident:
break
weight = f.readline()
coords = f.readline()
f.readline()
centers.append((int(ident), ... | mit | Python |
aec8e6e33c22dd2b4e6b733b1b6d11e04418168d | update howdoicode command to link to new docs site (#48) | PJB3005/MoMMI,PJB3005/MoMMI,PJB3005/MoMMI | MoMMI/Modules/howdoicode.py | MoMMI/Modules/howdoicode.py | from typing import Match
from discord import Message
from MoMMI import MChannel, master, command
@command("howdoicode", "howdoicode")
async def dance(channel: MChannel, match: Match, message: Message) -> None:
await channel.send("https://docs.spacestation14.io/en/getting-started/how-do-i-code")
| from typing import Match
from discord import Message
from MoMMI import MChannel, master, command
@command("howdoicode", "howdoicode")
async def dance(channel: MChannel, match: Match, message: Message) -> None:
await channel.send("https://hackmd.io/@ss14/howdoicode")
| mit | Python |
887c8efe48b2756b5458f54c378065cbdb8d59f5 | Make get_time_dist() | jeongmincha/pyjsonts | pyjsonts/time_series_json.py | pyjsonts/time_series_json.py | import json
import ijson
import numpy as np
class TimeSeriesJSON:
def __init__(self, f=None, fn=None, tag='item'):
"""
:param f: file object (_io.TextIOWrapper)
:param fn: file name as a string
:param tag: tag for dividing json items
default value is 'item' because thi... | import json
import ijson
class TimeSeriesJSON:
def __init__(self, f=None, fn=None, tag='item'):
"""
:param f: file object (_io.TextIOWrapper)
:param fn: file name as a string
:param tag: tag for dividing json items
default value is 'item' because this value is default ... | apache-2.0 | Python |
33b6adc005f54d8e588d0ae75535a6ae0f76326d | fix spacing | jeremy-miller/life-python | life/game.py | life/game.py | import logging
from time import sleep
import numpy
from life.configuration import ConfigurationClass
from life.display import DisplayClass
from life.patterns import PatternsClass
class GameClass(object):
def __init__(self):
configuration = ConfigurationClass().get_configuration()
self._max_rows = configurat... | import logging
from time import sleep
import numpy
from life.configuration import ConfigurationClass
from life.display import DisplayClass
from life.patterns import PatternsClass
class GameClass(object):
def __init__(self):
configuration = ConfigurationClass().get_configuration()
self._max_rows = configurat... | mit | Python |
5c55173fe84e773004000ffc41e3c0ccd794b5c5 | Read config path from KUBECONFIG env or default location | LeastAuthority/kubetop | src/kubetop/_script.py | src/kubetop/_script.py | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
The command-line interface.
Theory of Operation
===================
#. Convert command line arguments to structured configuration, supplying defaults where necessary.
#. Construct the top-level kubetop service from the configuration.
#. Run the ... | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
The command-line interface.
Theory of Operation
===================
#. Convert command line arguments to structured configuration, supplying defaults where necessary.
#. Construct the top-level kubetop service from the configuration.
#. Run the ... | mit | Python |
8cde356ce51384c1c3e5a8923a1ea7c4e264000b | add unflushable parser | PeerAssets/pypeerassets | pypeerassets/card_parsers.py | pypeerassets/card_parsers.py | '''parse cards according to deck issue mode'''
from .pautils import exponent_to_amount
def none_parser(cards):
'''parser for NONE [0] issue mode'''
return None
def custom_parser(cards, parser=None):
'''parser for CUSTOM [1] issue mode,
please provide your custom parser as argument'''
if not p... | '''parse cards according to deck issue mode'''
from .pautils import exponent_to_amount
def none_parser(cards):
'''parser for NONE [0] issue mode'''
return None
def custom_parser(cards, parser=None):
'''parser for CUSTOM [1] issue mode,
please provide your custom parser as argument'''
if not p... | bsd-3-clause | Python |
5052c049ca6e1dc32a0f5ea32924fa0812dc6180 | Bump version | thombashi/pytablewriter | pytablewriter/__version__.py | pytablewriter/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.41.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.40.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
9a2b8042c74f9117ed35400d781a7033800d00f3 | Remove hardcoded spot id | Smotko/surfbot,Smotko/surfbot | src/lambda_function.py | src/lambda_function.py | """lambda_function.py main entry point for aws lambda"""
import json
import urllib.request
from typing import Dict, Optional
import settings
from logger import logger
from spot import to_msw_id
def close(fulfillment_state: str, message: Dict[str, str]) -> dict:
"""Close dialog generator"""
return {
... | """lambda_function.py main entry point for aws lambda"""
import json
import urllib.request
from typing import Dict, Optional
import settings
from logger import logger
def close(fulfillment_state: str, message: Dict[str, str]) -> dict:
"""Close dialog generator"""
return {
'dialogAction': {
... | mit | Python |
12f835d9060decfc675c81f7a1499b373b78f4cc | Fix issue where idx test uses wrong bytes object | tmerr/trevornet | TrevorNet/tests/test_idx.py | TrevorNet/tests/test_idx.py | from .. import idx
import os
def test__count_dimensions():
yield check__count_dimensions, 9, 0
yield check__count_dimensions, [1, 2], 1
yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2
yield check__count_dimensions, [[[1,2], [2]]], 3
def check__count_dimensions(lst, i):
assert idx._count_dime... | from .. import idx
import os
def test__count_dimensions():
yield check__count_dimensions, 9, 0
yield check__count_dimensions, [1, 2], 1
yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2
yield check__count_dimensions, [[[1,2], [2]]], 3
def check__count_dimensions(lst, i):
assert idx._count_dime... | mit | Python |
55b74e4de12acb2e18bd2874b61f730d893ac8a4 | Fix max_reruns plugin | thalamus/Flexget,oxc/Flexget,poulpito/Flexget,ianstalk/Flexget,X-dark/Flexget,ibrahimkarahan/Flexget,drwyrm/Flexget,camon/Flexget,X-dark/Flexget,Flexget/Flexget,tsnoam/Flexget,tarzasai/Flexget,oxc/Flexget,OmgOhnoes/Flexget,Danfocus/Flexget,lildadou/Flexget,voriux/Flexget,dsemi/Flexget,cvium/Flexget,jacobmetrick/Flexget... | flexget/plugins/operate/max_reruns.py | flexget/plugins/operate/max_reruns.py | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import validator
from flexget.task import Task
from flexget.plugin import register_plugin
log = logging.getLogger('max_reruns')
class MaxReRuns(object):
"""Overrides the maximum amount of re-runs allowed by a task."""
... | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import validator
from flexget.task import Task
from flexget.plugin import register_plugin
log = logging.getLogger('max_reruns')
class MaxReRuns(object):
"""Overrides the maximum amount of re-runs allowed by a task."""
... | mit | Python |
bb7791678d9c5ac68ae3c1f1bd21e46d4dd64e76 | Allow implicit multiplication! | stephenjust/fastmath,stephenjust/fastmath,stephenjust/fastmath,stephenjust/fastmath | fm/mathengine/problemTypes/problem.py | fm/mathengine/problemTypes/problem.py | from sympy import *
from sympy.parsing.sympy_parser import parse_expr, standard_transformations, implicit_multiplication
import random
import fm.mathengine.mmlparser as mmlparser
class Problem:
"""
Base class representing all math problems
"""
random_seed = 0
problem_statement = None
x = Symbol('x')
def __ini... | from sympy import *
from sympy.parsing.sympy_parser import parse_expr
import random
import fm.mathengine.mmlparser as mmlparser
class Problem:
"""
Base class representing all math problems
"""
random_seed = 0
problem_statement = None
x = Symbol('x')
def __init__(self, random_seed):
random.seed(random_seed)
... | mit | Python |
d6fd83ba9ea820d97ccaba49f0e450faa2c324f1 | update worker_pool docs | obfuscurity/graphite-web,DanCech/graphite-web,graphite-project/graphite-web,cbowman0/graphite-web,graphite-project/graphite-web,obfuscurity/graphite-web,drax68/graphite-web,mcoolive/graphite-web,drax68/graphite-web,obfuscurity/graphite-web,DanCech/graphite-web,obfuscurity/graphite-web,criteo-forks/graphite-web,mcoolive... | webapp/graphite/worker_pool/pool.py | webapp/graphite/worker_pool/pool.py | import Queue
import time
from threading import Lock
from multiprocessing.pool import ThreadPool
_init_lock = Lock()
_pools = {}
class Job(object):
"""A job to be executed by a pool
The job accepts a function and arguments.
When it is run, it will execute the function with the specified arguments.
The ret... | import Queue
import time
from threading import Lock
from multiprocessing.pool import ThreadPool
_init_lock = Lock()
_pools = {}
class Job(object):
"""A job to be executed by a pool
The job accepts a function and arguments.
When it is run, it will execute the function with the specified arguments.
The ret... | apache-2.0 | Python |
a0bc415277712fc843d1ff0106a2f8802a29e87d | Fix indent | bmordue/nb,bmordue/nb | nb.py | nb.py | from ddtrace import patch_all
from datadog import statsd
from tasks.populate import populate
from tasks.add_comment_counts import add_comment_counts
from tasks.prune import prune_starred
from tasks.add_domains import add_domains
from utility.NbConfig import NbConfig
from utility import client_factory
from utility imp... | from ddtrace import patch_all
from datadog import statsd
from tasks.populate import populate
from tasks.add_comment_counts import add_comment_counts
from tasks.prune import prune_starred
from tasks.add_domains import add_domains
from utility.NbConfig import NbConfig
from utility import client_factory
from utility imp... | mit | Python |
f8892d540ad11310020e9abebe57620941b4c93f | remove unused module references in keystone.backends | darren-wang/ks3,darren-wang/ks3 | keystone/backends.py | keystone/backends.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 |
626848ef2f09aff48c267fe10c33dfb9cef957b9 | Use absolute paths in git_version.py | dwalton76/ev3dev-lang-python,rhempel/ev3dev-lang-python,dwalton76/ev3dev-lang-python | git_version.py | git_version.py | from subprocess import Popen, PIPE
import os, sys
pyver = sys.version_info
#----------------------------------------------------------------------------
# Get version string from git
#
# Author: Douglas Creager <dcreager@dcreager.net>
# http://dcreager.net/2010/02/10/setuptools-git-version-numbers/
#
# PEP 386 adapta... | from subprocess import Popen, PIPE
import os, sys
pyver = sys.version_info
#----------------------------------------------------------------------------
# Get version string from git
#
# Author: Douglas Creager <dcreager@dcreager.net>
# http://dcreager.net/2010/02/10/setuptools-git-version-numbers/
#
# PEP 386 adapta... | mit | Python |
939b4a3655a57746b94e69462a07e901f2a4836f | change print to return string | ivoryhuang/LOL_simple_text_version | items/Morellonomicon.py | items/Morellonomicon.py | from items.Item import Item, Cool_Down_Item
from items.Fiendish_Codex import Fiendish_Codex
from items.Lost_Chapter import Lost_Chapter
from items.Amplifying_Tome import Amplifying_Tome
class Morellonomicon(Item, Cool_Down_Item):
def __init__(self):
Item.__init__(self, name='Morellonomicon', code=3165, cost=2900, s... | from items.Item import Item, Cool_Down_Item
from items.Fiendish_Codex import Fiendish_Codex
from items.Lost_Chapter import Lost_Chapter
from items.Amplifying_Tome import Amplifying_Tome
class Morellonomicon(Item, Cool_Down_Item):
def __init__(self):
Item.__init__(self, name='Morellonomicon', code=3165, cost=2900, s... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.