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 |
|---|---|---|---|---|---|---|---|---|
6c51b30d2382177a68ed9a339df92180c925338e | correct documentation now wrapper is not Atari specific | deepmind/acme,deepmind/acme | acme/wrappers/noop_starts.py | acme/wrappers/noop_starts.py | """NoOp Starts wrapper to allow stochastic initial state for deterministic Python environments."""
from typing import Optional
from acme.wrappers import base
import dm_env
import numpy as np
class NoopStartsWrapper(base.EnvironmentWrapper):
"""Implements random noop starts to episodes.
This introduces randomnes... | """NoOp Starts wrapper to allow stochastic initial state for deterministic Python environments."""
from typing import Optional
from acme.wrappers import base
import dm_env
import numpy as np
class NoopStartsWrapper(base.EnvironmentWrapper):
"""Implements random noop starts to episodes."""
def __init__(self,
... | apache-2.0 | Python |
3a61c09a089483c5b480ac54395c97085e059bdc | add null fields to FooModel. | ulule/django-linguist | linguist/tests/translations.py | linguist/tests/translations.py | # -*- coding: utf-8 -*_
from django.db import models
from ..base import ModelTranslationBase
from ..mixins import ModelMixin, ManagerMixin
class FooManager(ManagerMixin, models.Manager):
pass
class BarManager(ManagerMixin, models.Manager):
pass
class FooModel(ModelMixin, models.Model):
title = models... | # -*- coding: utf-8 -*_
from django.db import models
from ..base import ModelTranslationBase
from ..mixins import ModelMixin, ManagerMixin
class FooManager(ManagerMixin, models.Manager):
pass
class BarManager(ManagerMixin, models.Manager):
pass
class FooModel(ModelMixin, models.Model):
title = models... | mit | Python |
7cc700889466e84cfcce5284e46ac6f9f467bc86 | update quickstart animated line server example | evidation-health/bokeh,ericmjl/bokeh,maxalbert/bokeh,mindriot101/bokeh,msarahan/bokeh,CrazyGuo/bokeh,dennisobrien/bokeh,aavanian/bokeh,timothydmorton/bokeh,dennisobrien/bokeh,daodaoliang/bokeh,azjps/bokeh,mindriot101/bokeh,ptitjano/bokeh,philippjfr/bokeh,dennisobrien/bokeh,phobson/bokeh,rhiever/bokeh,bokeh/bokeh,jakirk... | sphinx/source/docs/examples/line_server_animated.py | sphinx/source/docs/examples/line_server_animated.py | import time
from bokeh.plotting import figure, output_server, cursession, show
#prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to static HTML file
output_server("animated_line")
# Plot a `line` renderer setting the color, line thickness, title, and legend value.
p = figure(title="One Line")
p.lin... | import time
from bokeh.plotting import figure, output_server, cursession, show
#prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to static HTML file
output_server("animated_line")
# Plot a `line` renderer setting the color, line thickness, title, and legend value.
p = figure(title="One Line")
p.lin... | bsd-3-clause | Python |
92ed0092459b07f3316f3a4d324e0d9ddf503a23 | Add keyboard interrupt handler | StijnRuts/dotbot,StijnRuts/dotbot,pulgalipe/dotbot,bchretien/dotbot,pulgalipe/dotbot,imattman/dotbot,anishathalye/dotbot,imattman/dotbot,bchretien/dotbot,imattman/dotbot,bchretien/dotbot,anishathalye/dotbot,pulgalipe/dotbot,StijnRuts/dotbot | dotbot/cli.py | dotbot/cli.py | from argparse import ArgumentParser
from .config import ConfigReader, ReadingError
from .dispatcher import Dispatcher, DispatchError
from .messenger import Messenger
from .messenger import Level
def add_options(parser):
parser.add_argument('-Q', '--super-quiet', dest = 'super_quiet', action = 'store_true',
... | from argparse import ArgumentParser
from .config import ConfigReader, ReadingError
from .dispatcher import Dispatcher, DispatchError
from .messenger import Messenger
from .messenger import Level
def add_options(parser):
parser.add_argument('-Q', '--super-quiet', dest = 'super_quiet', action = 'store_true',
... | mit | Python |
803e50631f29f74e0b1aafd57db007830ae0bb40 | fix spritesheet for python3 | euclio/rocket-propelled-rpg | rprpg/render/spritesheet.py | rprpg/render/spritesheet.py | # This class handles sprite sheets
# This was taken from www.scriptefun.com/transcript-2-using
# sprite-sheets-and-drawing-the-background
# I've added some code to fail if the file wasn't found..
# Note: When calling images_at the rect is the format:
# (x, y, x + offset, y + offset)
# Adapted for Py3k by Andy Russell
... | # This class handles sprite sheets
# This was taken from www.scriptefun.com/transcript-2-using
# sprite-sheets-and-drawing-the-background
# I've added some code to fail if the file wasn't found..
# Note: When calling images_at the rect is the format:
# (x, y, x + offset, y + offset)
import pygame
class spritesheet(... | mit | Python |
e933c6010f3a8ff00065b0b5e2ceb5f4c6f63502 | Rename CustomWriter action attribute to writer | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/write/custom_writer.py | hoomd/write/custom_writer.py | # Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Implement CustomWriter."""
from hoomd.custom import (CustomOperation, _InternalCustomOperation, Action)
from hoomd.operation import Writer
class _WriterPro... | # Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Implement CustomWriter."""
from hoomd.custom import (CustomOperation, _InternalCustomOperation, Action)
from hoomd.operation import Writer
class _WriterPro... | bsd-3-clause | Python |
02b75802189fc997c3a95802a451c5054186bd1c | Cut 13.04.16 release | miing/mci_migo,miing/mci_migo,miing/mci_migo | identityprovider/__init__.py | identityprovider/__init__.py | # Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__version__ = '13.04.16-r798'
| # Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__version__ = '13.04.10-r780'
| agpl-3.0 | Python |
6e04ff7837b29e74aa60be248f3cc150c8123a09 | Clean up __init__.py | einekatze/image_processing | image_processing/__init__.py | image_processing/__init__.py | # There is nothing to see here!
| __author__ = 'user'
| mit | Python |
de02c92510a6117aad01be7666d737d2ad861fd7 | Improve logic in determining latest contribution | dellsystem/github-streak-saver | send_sms.py | send_sms.py | #!/usr/bin/env python
import json
import sys
import requests
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_message = "You haven't committe... | #!/usr/bin/env python
import datetime
import json
import sys
import requests
import pytz
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_mes... | mit | Python |
d8f21fbffda1b22c1085c10a0ee2f3980d7176f1 | fix bug in despiking... seems to work,but needs more testing | ColumbiaCMB/kid_readout,ColumbiaCMB/kid_readout | kid_readout/utils/despike.py | kid_readout/utils/despike.py | import numpy as np
from scipy.ndimage import filters
import scipy.signal
from kid_readout.utils.fftfilt import fftfilt
import random
def lpf256(ts):
return fftfilt(scipy.signal.firwin(256,1/256.),ts)
def medmadmask(ts,thresh=8,axis=0):
med = np.median(ts,axis=axis)
deviations = np.abs(ts-med)
mad = np... | import numpy as np
from scipy.ndimage import filters
import scipy.signal
from kid_readout.utils.fftfilt import fftfilt
import random
def lpf256(ts):
return fftfilt(scipy.signal.firwin(256,1/256.),ts)
def medmadmask(ts,thresh=8,axis=0):
med = np.median(ts,axis=axis)
deviations = np.abs(ts-med)
mad = np... | bsd-2-clause | Python |
73a795d4891c6cdde96f585053b8c187e7dac7b5 | Add normalize_time() function and HTTPConnector._get_years() method. | bolidozor/python-bolidozor-postprocessing | src/bzpost.py | src/bzpost.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""bzpost module.
Author: Jan Milík <milikjan@fit.cvut.cz>
"""
import urlparse
import httplib
import datetime
import re
__version__ = "0.1"
def normalize_time(value, including = False):
if isinstance(value, int):
return datetime.fromtimestamp(value)
elif ... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""bzpost module.
Author: Jan Milík <milikjan@fit.cvut.cz>
"""
import urlparse
import httplib
__version__ = "0.1"
class HTTPConnector(object):
def __init__(self, base_url, station_name = "<none>"):
self.base_url = base_url
self.station_name = station_... | bsd-2-clause | Python |
e226e799dff53b0e53438ab9acd7b0192b556a76 | Clean up settings | mrteera/who-broke-build-slack,zkan/who-broke-build-slack,prontodev/who-broke-build-slack,prontodev/who-broke-build-slack,zkan/who-broke-build-slack,mrteera/who-broke-build-slack | settings.py | settings.py | import socket
AF_INET = socket.AF_INET
SOCK_DGRAM = socket.SOCK_DGRAM
JENKINS_USERNAME = 'your_jenkins_username'
JENKINS_PASSWORD = 'your_jenkins_password'
JENKINS_NOTIFICATION_UDP_PORT = 22222
JENKINS_USERS_TO_SLACK_USERS = {
'jenkins_username': 'slack_username'
}
SLACK_TOKEN = ''
| import socket
AF_INET = socket.AF_INET
SOCK_DGRAM = socket.SOCK_DGRAM
JENKINS_USERNAME = 'your_jenkins_username'
JENKINS_PASSWORD = 'your_jenkins_password'
JENKINS_NOTIFICATION_UDP_PORT = 22222
TEAM_MEMBERS = []
| mit | Python |
2ca4504ddda7ac7751c5972e6c2494c3f8d17fa9 | fix settings | ykoga-kyutech/Brain_Hacker,tech-sketch/Brain_Hacker,ykoga-kyutech/Brain_Hacker,tech-sketch/Brain_Hacker,Hironsan/Brain_Hacker,ykoga-kyutech/Brain_Hacker,Hironsan/Brain_Hacker,ykoga-kyutech/Brain_Hacker,tech-sketch/Brain_Hacker,Hironsan/Brain_Hacker | settings.py | settings.py | import os
import tornado
from tornado.options import define, options
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
define('port', default=8888, help="run on the given port", type=int)
define('debug', default=True, help='debug mode')
tornado.options.parse_command_line()
settings = {}
settings['debug'] = opt... | import os
import tornado
from tornado.options import define, options
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
define('port', default=8888, help="run on the given port", type=int)
define('debug', default=True, help='debug mode')
tornado.options.parse_command_line()
settings = {}
settings['debug'] = opt... | mit | Python |
3d3d874b3185af9276ac03d671e10b6ea1418e9a | Replace package dir only once. | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | setuplib.py | setuplib.py | import os
__all__ = ['find_files']
def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
... | import os
__all__ = ['find_files']
def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
... | bsd-3-clause | Python |
feaab7a2c2dfd0466cd498fd9771362f7180a8d4 | Update test_connection.py | Koheron/lase | ldk/tests/test_connection.py | ldk/tests/test_connection.py | # -*- coding: utf-8 -*-
import os
import pytest
from koheron_tcp_client import KClient
from ..utilities import install_instrument
from ..drivers import Oscillo
@pytest.mark.real
class TestConnection:
def test(self):
current_path = os.getcwd()
host = os.getenv('HOST','192.168.1.100')
... | # -*- coding: utf-8 -*-
import os
import pytest
from koheron_tcp_client import KClient
from ..utilities import HTTPInterface
from ..drivers import Oscillo
@pytest.mark.real
class TestConnection:
def test(self):
current_path = os.getcwd()
host = os.getenv('HOST','192.168.1.100')
http... | mit | Python |
e2d85e65590a29d64408452df28d456f71d3619c | Support for seperate language publishing | FinalAngel/djangocms-installer,frost-nzcr4/djangocms-installer,nephila/djangocms-installer,divio/djangocms-installer,nephila/djangocms-installer,FinalAngel/djangocms-installer,FinalAngel/djangocms-installer,frost-nzcr4/djangocms-installer,divio/djangocms-installer,divio/djangocms-installer | aldryn_installer/share/starting_page.py | aldryn_installer/share/starting_page.py | import json
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from cms.models import Placeholder
from cms.api import create_page, add_plugin, publish_page
placeholder = {}
with open('starting_page.json') as data_file:
content = ... | import json
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from cms.models import Placeholder
from cms.api import create_page, add_plugin, publish_page
placeholder = {}
with open('starting_page.json') as data_file:
content = ... | bsd-3-clause | Python |
a7b189ccc17e2eb60caa7d492235cac5e9e7f5da | Change xrange to range | cn04/smalltwo | smalltwo.py | smalltwo.py | import math
import json
import operator
def euclideanDistance(firstPoint, secondPoint, length):
#Calculate the distance between firstPoint and secondPoint, which are arrays of size length.
distance = 0
for i in range(length):
paramDifference = firstPoint[i] - secondPoint[i]
distance += pow(paramDifference, 2)
... | import math
import json
import operator
def euclideanDistance(firstPoint, secondPoint, length):
#Calculate the distance between firstPoint and secondPoint, which are arrays of size length.
distance = 0
for i in xrange(length):
paramDifference = firstPoint[i] - secondPoint[i]
distance += pow(paramDifference, 2)... | cc0-1.0 | Python |
00b54a445a8a642302228ed8d6bc270ceab18002 | update cppcheck script | fmwviormv/mygui,scrawl/mygui,Anomalous-Software/mygui,al2950/mygui,fmwviormv/mygui,Anomalous-Software/mygui,scrawl/mygui,scrawl/mygui,al2950/mygui,Anomalous-Software/mygui,al2950/mygui,Anomalous-Software/mygui,scrawl/mygui,al2950/mygui,fmwviormv/mygui,fmwviormv/mygui | Scripts/cppcheck/cppcheck.py | Scripts/cppcheck/cppcheck.py | # run from root sources directory: python Scripts/cppcheck/cppcheck.py
import os
ignoredContent = [
# "It is safe to deallocate a NULL pointer", # ignore, fine for us
"Exception thrown in destructor.", # ignore, fine for us
# "::initialise' can be const.", # ignore, because some are not const and we keep all non-cons... | # run from root sources directory: python Scripts/cppcheck/cppcheck.py
import os
ignoredContent = [
# "It is safe to deallocate a NULL pointer", # ignore, fine for us
"Exception thrown in destructor.", # ignore, fine for us
# "::initialise' can be const.", # ignore, because some are not const and we keep all non-cons... | mit | Python |
9461baac03df29fb1808bcc4aa281d4df266716d | return matrix in CSR format instead of COO, since it is more efficient to work with | pwm1234/eigen3-hdf5,garrison/eigen3-hdf5,WaveBlocks/eigen3-hdf5,WaveBlocks/eigen3-hdf5,pwm1234/eigen3-hdf5,garrison/eigen3-hdf5 | sparseh5.py | sparseh5.py | # to be used with h5py
import numpy as np
from scipy.sparse import coo_matrix
def to_sparse_repr(mat):
mat = coo_matrix(mat)
dtype = [('r', int), ('c', int), ('v', mat.dtype)]
m = np.zeros(shape=(mat.nnz,), dtype=dtype)
m["r"] = mat.row
m["c"] = mat.col
m["v"] = mat.data
return m
def from... | # to be used with h5py
import numpy as np
from scipy.sparse import coo_matrix
def to_sparse_repr(mat):
mat = coo_matrix(mat)
dtype = [('r', int), ('c', int), ('v', mat.dtype)]
m = np.zeros(shape=(mat.nnz,), dtype=dtype)
m["r"] = mat.row
m["c"] = mat.col
m["v"] = mat.data
return m
def from... | mit | Python |
99b99ec939365f337f01bfe748939580d37a9d18 | add init_schema to base64 implementation | EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base | calvin/runtime/south/calvinlib/base64lib/Base64.py | calvin/runtime/south/calvinlib/base64lib/Base64.py | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson AB
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson AB
#
# 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 ... | apache-2.0 | Python |
e221fb975befb5e7982d3e24a7e3851ee8b4e331 | Remove unused import | Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI | src/config.py | src/config.py | ''' SmartAPI Configuration '''
from biothings.web.settings.default import QUERY_KWARGS
from config_key import *
# *****************************************************************************
# Credentials
# *****************************************************************************
# Define in <project_folder>/co... | ''' SmartAPI Configuration '''
from biothings.web.settings.default import ES_RESULT_TRANSFORM, QUERY_KWARGS
from config_key import *
# *****************************************************************************
# Credentials
# *****************************************************************************
# Define i... | mit | Python |
e9f295c06ae959c3d72427601e94c01994ca869b | Test out of bounds ramp value | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/pytest/test_variant.py | hoomd/pytest/test_variant.py | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
import numpy
import hoomd
import hoomd.variant
import pytest
def test_constant():
""" Test construction and properties of variant.constant
"""
a =... | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
import numpy
import hoomd
import hoomd.variant
def test_constant():
""" Test construction and properties of variant.constant
"""
a = hoomd.variant... | bsd-3-clause | Python |
ff4e4e399cff816007e36ec7a6b9239f32d3fb28 | Remove an unused import | thombashi/sqlitebiter,thombashi/sqlitebiter | test/test_file_subcommand_fifo.py | test/test_file_subcommand_fifo.py | # encoding: utf-8
from __future__ import print_function
import os
from concurrent.futures import ProcessPoolExecutor
import pytest
from click.testing import CliRunner
from simplesqlite import SimpleSQLite
from sqlitebiter._enum import ExitCode
from sqlitebiter.sqlitebiter import cmd
from .common import print_traceb... | # encoding: utf-8
from __future__ import print_function
import os
import platform
from concurrent.futures import ProcessPoolExecutor
import pytest
from click.testing import CliRunner
from simplesqlite import SimpleSQLite
from sqlitebiter._enum import ExitCode
from sqlitebiter.sqlitebiter import cmd
from .common imp... | mit | Python |
42bb50b6f698b248d136dd5c95c5c6b742a48b51 | Fix bug | neuroidss/nupic.research,subutai/htmresearch,ThomasMiconi/nupic.research,subutai/htmresearch,subutai/htmresearch,ThomasMiconi/htmresearch,mrcslws/htmresearch,ywcui1990/nupic.research,marionleborgne/nupic.research,ywcui1990/nupic.research,numenta/htmresearch,ywcui1990/htmresearch,BoltzmannBrain/nupic.research,cogmission... | sequence_prediction/sequence_generator/sequence_generator.py | sequence_prediction/sequence_generator/sequence_generator.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 | Python |
71a7527b99604cfd7c807e849220179664d1e21c | remove print=silent from firebase push call. fixes #458 | verycumbersome/the-blue-alliance,jaredhasenklein/the-blue-alliance,verycumbersome/the-blue-alliance,1fish2/the-blue-alliance,josephbisch/the-blue-alliance,bvisness/the-blue-alliance,1fish2/the-blue-alliance,the-blue-alliance/the-blue-alliance,fangeugene/the-blue-alliance,phil-lopreiato/the-blue-alliance,fangeugene/the-... | tba_config.py | tba_config.py | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | mit | Python |
d1ef441facadbd0d0455e97a224821c87b5c3c29 | Add basic script which use leafletjs | kenhys/sphinxcontrib-openstreetmap,kenhys/sphinxcontrib-openstreetmap | sphinxcontrib/openstreetmap.py | sphinxcontrib/openstreetmap.py | # -*- coding: utf-8 -*-
"""
sphinxcontrib.openstreetmap
===========================
Embed OpenStreetMap on your documentation.
:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com>
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
from docutils.parsers.rst import directives
from sphi... | # -*- coding: utf-8 -*-
"""
sphinxcontrib.openstreetmap
===========================
Embed OpenStreetMap on your documentation.
:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com>
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
from docutils.parsers.rst import directives
from sphi... | bsd-2-clause | Python |
061629b66651c82d46754b109871556af31a2363 | clean code | wartalker/BlogSpider,alone-walker/BlogSpider,wartalker/BlogSpider,wartalker/BlogSpider,alone-walker/BlogSpider,hack4code/BlogSpider,alone-walker/BlogSpider,alone-walker/BlogSpider,hack4code/BlogSpider,hack4code/BlogSpider,wartalker/BlogSpider,hack4code/BlogSpider | spider/mydm/pipelines/store.py | spider/mydm/pipelines/store.py | # -*- coding: utf-8 -*-
from ..model import is_exists_article, save_article
from ..ai import get_category
def get_article_lang(item):
if any(ord(c) > 19967 for c in item['title']):
return 'zh'
return 'en'
class StorePipeline(object):
"""
save content to mongodb
"""
@classmetho... | # -*- coding: utf-8 -*-
from ..model import is_exists_article, save_article
from ..ai import get_category
def get_article_lang(item):
if any(ord(c) > 19967 for c in item['title']):
return 'zh'
return 'en'
class StorePipeline(object):
"""
save content to mongodb
"""
@classmetho... | mit | Python |
698db53b2f5eb16dc55f1590a7359dd63012bd78 | Make repoze.what Identity unprintable, this also solves https://github.com/Pylons/webob/pull/139 | lucius-feng/tg2,lucius-feng/tg2 | tg/configuration/auth/metadata.py | tg/configuration/auth/metadata.py | from zope.interface import implementer
from repoze.who.interfaces import IMetadataProvider, IAuthenticator
from repoze.who.api import Identity
class TGAuthMetadata(object):
"""
Provides a way to lookup for user, groups and permissions
given the current identity. This has to be specialized
for each stor... | from zope.interface import implementer
from repoze.who.interfaces import IMetadataProvider, IAuthenticator
class TGAuthMetadata(object):
"""
Provides a way to lookup for user, groups and permissions
given the current identity. This has to be specialized
for each storage backend.
By default it ret... | mit | Python |
08622088789896fa056e2643f4aa05d0aed3d2f2 | refactor to split up contenttype queryset from actual models | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/aggregate/utils.py | src/python/expedient/clearinghouse/aggregate/utils.py | '''
Created on Aug 2, 2010
@author: jnaous
'''
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
def get_aggregate_classes():
"""
Get the list of modules that are the aggregate classes
of aggregate plugins.
"""
agg_plugin_names = getattr(settings, "AGGREGA... | '''
Created on Aug 2, 2010
@author: jnaous
'''
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
def get_aggregate_types():
"""
Return the ContentType queryset of installed plugin aggregate models.
"""
agg_plugin_names = getattr(settings, "AGGREGATE_PLUGINS", ... | bsd-3-clause | Python |
29d2d792e0d0bac90e6fa8b65a3fac7798120e61 | Update main.py | PetukhovVictor/compiler,PetukhovVictor/compiler | src/main.py | src/main.py | import argparse
import os
import sys
from Compiler.ASM.Core.run import compile_asm
from Compiler.VM.Helpers.run import compile_vm
from Interpreter.Helpers.run import interpret
from Lexer.run import run as lex
from Parser.run import parse
from Parser.Helpers.ast_printer import ast_print
from VM.parser import parse as v... | import argparse
import os
import sys
from Compiler.ASM.Core.run import compile_asm
from Compiler.VM.Helpers.run import compile_vm
from Interpreter.Helpers.run import interpret
from Lexer.run import run as lex
from Parser.run import parse
from Parser.Helpers.ast_printer import ast_print
from VM.parser import parse as v... | mit | Python |
c6f9d3228d9302c2a7d402a2b10c4d8556314907 | set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#487) | googleapis/google-cloud-node,googleapis/google-cloud-node,googleapis/google-cloud-node,googleapis/google-cloud-node | packages/google-cloud-translate/synth.py | packages/google-cloud-translate/synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
bd7a8fe3db49f0a08d6050d13e2f681adebb3352 | Add initial solution | CubicComet/exercism-python-solutions | bob/bob.py | bob/bob.py | def hey(s):
s = s.strip()
if s.isupper():
return "Whoa, chill out!"
elif s == "":
return "Fine. Be that way!"
elif s[-1] == "?":
return "Sure."
else:
return "Whatever."
| def hey(string):
pass
| agpl-3.0 | Python |
d9f8d79513ab295a6da4faaf7dd68da034c1f18c | Clean up util functions | dguo/churn | src/util.py | src/util.py | import configparser
from datetime import datetime
from decimal import Decimal
import os
import re
import sqlite3
import click
from pick import pick
from . import errors
DB_NAME = 'churn.db'
def get_config_dir():
return click.get_app_dir('churn')
def get_config_path():
return os.path.join(get_config_dir(), ... | import configparser
from datetime import datetime
import os
import re
import sqlite3
import click
from pick import pick
from . import errors
DB_NAME = 'churn.db'
def get_config_dir():
return click.get_app_dir('churn')
def get_config_path():
return os.path.join(get_config_dir(), 'churn.ini')
def get_db_pat... | mit | Python |
9593621143f9b47c450403bf36eda11b9dabf58c | rename test_object | mattdeckard/wherewithal | test.py | test.py | #!/usr/bin/env python3
import Transaction
import unittest
class TestTransaction(unittest.TestCase) :
def setUp(self) :
self.test_object = Transaction.Transaction()
def tearDown(self) :
pass
def test_not_None(self) :
self.assertIsNotNone(self.test_object)
if __name__ == '__main... | #!/usr/bin/env python3
import Transaction
import unittest
class TestTransaction(unittest.TestCase) :
def setUp(self) :
self.t = Transaction.Transaction()
def tearDown(self) :
pass
def test_not_None(self) :
self.assertIsNotNone(self.t)
if __name__ == '__main__' :
unittest.m... | apache-2.0 | Python |
9a05c74f03af73403960ff9f7656e5f47728e726 | Add Dockerfile and requirements.txt | Sheday/GuildAudit,Sheday/GuildAudit | test.py | test.py | from constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from writer import log
from pympler.tracker import SummaryTracker, muppy, summary
tracker = SummaryTracker()
try:
guild_ids = str(sys.argv[1]).split(',')
log('info','Not using all guild IDs, but only the foll... | from constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from writer import log
try:
guild_ids = str(sys.argv[1]).split(',')
log('info','Not using all guild IDs, but only the following: {0}'.format(', '.join(guild_ids)))
except Exception:
guild_ids = False
sta... | mit | Python |
5ce351a6f618e72f8d0c6e59d57d6a4f0a43f32d | Replace tabs with spaces as God intended | callummcgregor/okeydoke-p | test.py | test.py | import os
__author__ = 'callum'
import traceback
def _read_approved(test_name):
with open(test_name + '.approved') as f:
return f.read()
def _write_actual(thing, test_name):
with open(test_name + '.actual', 'w') as f:
return f.write(thing)
def _write_approved(thing, test_name):
with ... | import os
__author__ = 'callum'
import traceback
def _read_approved(test_name):
with open(test_name + '.approved') as f:
return f.read()
def _write_actual(thing, test_name):
with open(test_name + '.actual', 'w') as f:
return f.write(thing)
def _write_approved(thing, test_name):
with open(test_name + '.a... | bsd-2-clause | Python |
c91d843e395ec3fc99ed43c50c75f80ca711b267 | Correct typo in test.py | ericfourrier/pwnedapi | test.py | test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-u
"""
Purpose : Some tests for the HaveiBeenPwnedApi class
To run the tests : $ python -m unittest -v test
"""
import unittest
from pwnedapi.pwnedapi import HaveIBeenPwnedApi
from pwnedapi.exception import NotValidEmail, BreachNotFound, UnvalidParameters
class TestHaveIB... | #!/usr/bin/env python
# -*- coding: utf-8 -*-u
"""
Purpose : Some tests for the HaveiBeenPwnedApi class
To run the tests : $ python -m unittest -v test
"""
import unittest
from pwnedapi import HaveIBeenPwnedApi
from exception import NotValidEmail, BreachNotFound, UnvalidParameters
class TestHaveIBeenPwnedApi(unitte... | mit | Python |
a2f9b9c50acc9862092cba57916db8f895ad6c5f | add comment | maxigas/hostsmoke,maxigas/uzta | uzta.py | uzta.py | #!/usr/bin/python3
from bs4 import BeautifulSoup as bs
from requests import get, post, Session
from requests.utils import cookiejar_from_dict, dict_from_cookiejar
with open ("password.txt", "r") as password_file:
password=password_file.read().replace('\n', '')
# Will not work without https (because login secu... | #!/usr/bin/python3
from bs4 import BeautifulSoup as bs
from requests import get, post, Session
from requests.utils import cookiejar_from_dict, dict_from_cookiejar
with open ("password.txt", "r") as password_file:
password=password_file.read().replace('\n', '')
url = 'https://n-1.cc/'
username = 'maxigas'
post... | agpl-3.0 | Python |
cc39b736939815c23aba520cb89febb0f170efcf | Declare data variables | apdavison/space-station-transylvania | xkcd.py | xkcd.py | """
Example taken from http://matplotlib.org/1.5.0/examples/showcase/xkcd.html
"""
import matplotlib.pyplot as plt
import numpy as np
with plt.xkcd():
# Based on "The Data So Far" from XKCD by Randall Monroe
# http://xkcd.com/373/
index = [0, 1]
data = [0, 100]
labels = ['CONFIRMED BY EXPERIMENT'... | """
Example taken from http://matplotlib.org/1.5.0/examples/showcase/xkcd.html
"""
import matplotlib.pyplot as plt
import numpy as np
with plt.xkcd():
# Based on "The Data So Far" from XKCD by Randall Monroe
# http://xkcd.com/373/
fig = plt.figure()
ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))
ax.bar(... | mit | Python |
87457d90334d7b568e161e72f4cedf109dcd091e | set alarm logic | paradime/smart_alarm,paradime/smart_alarm | Alarm.py | Alarm.py | config_file = "secret_config.json"
from Configuration import Configuration
from datetime import datetime
import json
class Alarm:
def __init__(self, config):
alarm_string = config.alarm["alarmtime"]
self.set_alarm(alarm_string)
def set_alarm(self, alarm_string):
currtime = datetime.now... | config_file = "secret_config.json"
from Configuration import Configuration
from datetime import datetime
import json
class Alarm:
def __init__(self, config):
alarm_string = config.alarm["alarmtime"]
self.alarm_time = datetime.strptime(alarm_string, '%I:%M%p')
def set_alarm(new_time):
s... | mit | Python |
67913476c33a4f8b3635f63c379bde0a48a5e714 | Disable date_hierarchy for now since it requires tzinfo in MySQL | mback2k/django-app-bugs | admin.py | admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | mit | Python |
3631391faf0167fab3f1914d1a399dba0b64c9ff | fix typo, tack @sylvinite | ewels/ngi_reports,senthil10/ngi_reports,senthil10/ngi_reports,ewels/ngi_reports,NationalGenomicsInfrastructure/ngi_reports,senthil10/ngi_reports,NationalGenomicsInfrastructure/ngi_reports,ewels/ngi_reports | ngi_reports/utils/config.py | ngi_reports/utils/config.py | """ Load and parse configuration file
"""
import ConfigParser
import os
from string import Template
def load_config(config_file=None):
"""Loads a configuration file.
By default it assumes ~/.ngi_config/ngi_reports.conf
"""
try:
if not config_file:
config_file = os.path.join(os.envi... | """ Load and parse configuration file
"""
import ConfigParser
import os
from string import Template
def load_config(config_file=None):
"""Loads a configuration file.
By default it assumes ~/.ngi_config/ngi_reports.conf
"""
try:
if not config_file:
config_file = os.path.join(os.envi... | mit | Python |
e5a940b542579e37f452ec2e5e5e4998218d6999 | update cryptography to 2.5.0 (#2140) | cloudify-cosmo/cloudify-manager,cloudify-cosmo/cloudify-manager,cloudify-cosmo/cloudify-manager | rest-service/setup.py | rest-service/setup.py | ########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | ########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 | Python |
1d93d751c9ab9d0ed0e4596fec009633d4615e22 | fix pep8 nits | UWIT-IAM/iam-resttools | resttools/test/nws.py | resttools/test/nws.py | import json
import logging
from nose.tools import *
from resttools.nws import NWS
import resttools.test.test_settings as settings
import logging.config
logging.config.dictConfig(settings.LOGGING)
logger = logging.getLogger(__name__)
class NWS_Test():
def __init__(self):
self.nws = NWS(settings.NWS_CONF... | import json
import logging
from nose.tools import *
from resttools.nws import NWS
import resttools.test.test_settings as settings
import logging.config
logging.config.dictConfig(settings.LOGGING)
logger = logging.getLogger(__name__)
class NWS_Test():
def __init__(self):
self.nws = NWS(settings.NWS_CONF... | apache-2.0 | Python |
81478b8bea60acb5d4cee06c08be350cdc44c36e | Bump version for new release | saltstack/salt-pylint | saltpylint/version.py | saltpylint/version.py | # -*- coding: utf-8 -*-
'''
saltpylint.version
~~~~~~~~~~~~~~~~~~~
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
'''
# Import Python libs
from __future__ impo... | # -*- coding: utf-8 -*-
'''
saltpylint.version
~~~~~~~~~~~~~~~~~~~
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
'''
# Import Python libs
from __future__ impo... | apache-2.0 | Python |
5f824011f13f00e7b7f650604fb476423c26d8aa | Bump version for release | saltstack/salt-pylint | saltpylint/version.py | saltpylint/version.py | # -*- coding: utf-8 -*-
'''
saltpylint.version
~~~~~~~~~~~~~~~~~~~
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
'''
# Import Python libs
from __future__ impo... | # -*- coding: utf-8 -*-
'''
saltpylint.version
~~~~~~~~~~~~~~~~~~~
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
'''
# Import Python libs
from __future__ impo... | apache-2.0 | Python |
22862d71cd7441db5330ef8e8c031623c169c801 | Fix for ejdb _ids. | zeth/magpy,zeth/magpy,catsmith/magpy,catsmith/magpy | magpy/server/_ejdb.py | magpy/server/_ejdb.py | """EJDB driver for Magpy.
Currently does not do much except support certain command line scripts.
"""
import os
import pyejdb
from pyejdb.bson import BSON_ObjectId
from pyejdb.typecheck import InputParameterError
class Database(object):
"""Simple database connection for use in serverside scripts etc."""
def __... | """EJDB driver for Magpy.
Currently does not do much except support certain command line scripts.
"""
import os
import pyejdb
class Database(object):
"""Simple database connection for use in serverside scripts etc."""
def __init__(self,
database_name=None,
config_file=None):
... | bsd-3-clause | Python |
fda8510f1c5e2073e7861f359a3e38781d7b5501 | Fix bug introduced in previous commit: weekly tag cloud should show 7 days, not 70 | RobFisher/mailshare,RobFisher/mailshare,RobFisher/mailshare | mailshareapp/views.py | mailshareapp/views.py | # License: https://github.com/RobFisher/mailshare/blob/master/LICENSE
import datetime
from django.template import RequestContext, loader
from django.http import HttpResponse
from django.db.models import Q
from mailshareapp.models import Mail, Contact, Tag
import search
import email_utils
import tags
def index_view(r... | # License: https://github.com/RobFisher/mailshare/blob/master/LICENSE
import datetime
from django.template import RequestContext, loader
from django.http import HttpResponse
from django.db.models import Q
from mailshareapp.models import Mail, Contact, Tag
import search
import email_utils
import tags
def index_view(r... | bsd-3-clause | Python |
5231d2ed12ed67083821dbc6ba208c6e3cd684f7 | Remove unecessary python code | ggear/cloudera-framework,ggear/cloudera-framework,ggear/cloudera-framework | cloudera-framework-assembly/src/main/resources/python/script_util.py | cloudera-framework-assembly/src/main/resources/python/script_util.py | ###############################################################################
#
# Python script utilities as included from the cloudera-framework-assembly,
# do not edit directly
#
###############################################################################
import os
import re
def qualify(path):
return path... | ###############################################################################
#
# Python script utilities as included from the cloudera-framework-assembly,
# do not edit directly
#
###############################################################################
import os
import re
def qualify(path):
return path... | apache-2.0 | Python |
1853efbfad57f5ec05c9238724d77081c9f8571b | Add /browser URL rewrite rule to HTTPD config snippet. | vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit | src/deploy.py | src/deploy.py | """Deploy app to Apache."""
from subprocess import call
import os
import sys
import coils
# Read command-line parameters.
WWW_ROOT = sys.argv[1]
CONFIG = sys.argv[2] if len(sys.argv)>=3 else 'wabbit.cfg'
# Load configuration file.
config = coils.Config(CONFIG)
# Create destination directories.
cmd = 'mkdir -p {}'.f... | """Deploy app to Apache."""
from subprocess import call
import os
import sys
import coils
# Read command-line parameters.
WWW_ROOT = sys.argv[1]
CONFIG = sys.argv[2] if len(sys.argv)>=3 else 'wabbit.cfg'
# Load configuration file.
config = coils.Config(CONFIG)
# Create destination directories.
cmd = 'mkdir -p {}'.f... | mit | Python |
452d9f22504a72390e116388aec6257b6cc852e2 | update controller | Mellcap/MellPlayer | MellPlayer/controller.py | MellPlayer/controller.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
MellPlayer Controller
Created on 2017-03-05
@author: Mellcap
'''
import threading
import player
import ui
SONG_CATEGORIES = ui.SONG_CATEGORIES
# ===========================
# Initial
# ===========================
def mell_logger(loglevel, component, message):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
MellPlayer Controller
Created on 2017-03-05
@author: Mellcap
'''
import threading
import player
import ui
SONG_CATEGORIES = ui.SONG_CATEGORIES
def mell_logger(loglevel, component, message):
if loglevel == 'error':
# print('[{}] {}: {}\r'.format(logleve... | mit | Python |
7eae0479de74278b3528dbdef5728b1c279c35a5 | Add documentation too bool | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | mythril/laser/smt/bool.py | mythril/laser/smt/bool.py | import z3
from typing import Union
from mythril.laser.smt.expression import Expression
# fmt: off
class Bool(Expression):
"""
This is a Bool expression
"""
@property
def is_false(self) -> bool:
""" Specifies whether this variable can be simplified to false"""
self.simplify()
... | import z3
from mythril.laser.smt.expression import Expression
# fmt: off
class Bool(Expression):
@property
def is_false(self) -> bool:
return z3.is_false(self.raw)
@property
def is_true(self) -> bool:
return z3.is_true(self.raw)
def is_false(a: Bool) -> bool:
return is_false(... | mit | Python |
712600bd28d483748fc1bf837a7615299dadc4ca | Fix format size routine | vuolter/pyload,vuolter/pyload,vuolter/pyload | src/pyload/core/utils/format.py | src/pyload/core/utils/format.py | # -*- coding: utf-8 -*-
import datetime
import os
import bitmath
from .check import is_iterable
from .convert import BYTE_PREFIXES, to_str
from .fs import fullpath
from .misc import is_plural
def attributes(obj, ignore=None):
if ignore is None:
attrs = tuple(map(to_str, obj))
else:
ignored ... | # -*- coding: utf-8 -*-
import datetime
import os
from .check import is_iterable
from .convert import BYTE_PREFIXES, to_str
from .fs import fullpath
from .misc import is_plural
try:
import bitmath
except ImportError:
bitmath = None
def attributes(obj, ignore=None):
if ignore is None:
attrs = tu... | agpl-3.0 | Python |
edd7dfb9ddaf002b5904dc200b73e4a3f86785c5 | add a measurement to my test so I see the digitizer | BBN-Q/pyqgl2,BBN-Q/pyqgl2 | src/python/pyqgl2/test/multi.py | src/python/pyqgl2/test/multi.py | from qgl2.qgl1 import QubitFactory, Id, X, MEAS
from qgl2.qgl2 import qgl2decl, sequence, concur, seq
from qgl2.basic_sequences.qgl2_plumbing import init
@qgl2decl
def multiQbitTest() -> sequence:
q1 = QubitFactory('q1')
q2 = QubitFactory('q2')
with concur:
with seq:
init(q1)
... | from qgl2.qgl1 import QubitFactory, Id, X
from qgl2.qgl2 import qgl2decl, sequence, concur, seq
from qgl2.basic_sequences.qgl2_plumbing import init
@qgl2decl
def multiQbitTest() -> sequence:
q1 = QubitFactory('q1')
q2 = QubitFactory('q2')
with concur:
with seq:
init(q1)
Id(... | apache-2.0 | Python |
9c60a9118317b6a38e1b090fcaa31d6f96fd3499 | Add point.polar | platipy/spyral | point.py | point.py | import math as math
def sub(p1, p2):
""" Computes p2-p1. """
return (p1[0] - p2[0], p1[1] - p2[1])
def add(p1, p2):
""" Computes p1 + p2. """
return (p2[0] + p1[0], p2[1] + p1[1])
def angle(p):
""" Calculates the angle that p makes with the x axis, in radians. """
return math.atan2(p[... | import math as math
def sub(p1, p2):
""" Computes p2-p1. """
return (p1[0] - p2[0], p1[1] - p2[1])
def add(p1, p2):
""" Computes p1 + p2. """
return (p2[0] + p1[0], p2[1] + p1[1])
def angle(p):
""" Calculates the angle that p makes with the x axis, in radians. """
return math.atan2(p[... | lgpl-2.1 | Python |
d78ab4af92ca944f01bd6d499c21bb45aafad7d2 | Bump version | geographika/mappyfile,geographika/mappyfile | mappyfile/__init__.py | mappyfile/__init__.py | import logging
import pkg_resources
import sys
from types import ModuleType
# allow high-level functions to be accessed directly from the mappyfile module
from mappyfile.utils import open, load, loads, find, findall, dumps, dump, save, write
__version__ = "0.7.0"
__all__ = ['open', 'load', 'loads', 'find', 'findall',... | import logging
import pkg_resources
import sys
from types import ModuleType
# allow high-level functions to be accessed directly from the mappyfile module
from mappyfile.utils import open, load, loads, find, findall, dumps, dump, save, write
__version__ = "0.6.2"
__all__ = ['open', 'load', 'loads', 'find', 'findall',... | mit | Python |
4dc467e1e87284fbeb551adfd4dbf23bf295d25b | Patch bump. | tensorflow/similarity | tensorflow_similarity/__init__.py | tensorflow_similarity/__init__.py | # Copyright 2021 The TensorFlow 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 ... | # Copyright 2021 The TensorFlow 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 ... | apache-2.0 | Python |
b9d3633f6970fa2db3d33c937ed9bc434959f167 | Add Queue.increment_move() | supermitch/mech-ai,supermitch/mech-ai,supermitch/mech-ai | queue.py | queue.py | import datetime
import json
import utils
class Queue(object):
""" An object essentially describing whose turn it is. """
def __init__(self, players=None):
"""
Note that we may init an empty Queue, if we are loading from the repo.
"""
self.current_move = 0
self.last_mov... | import datetime
import json
import utils
class Queue(object):
""" An object essentially describing whose turn it is. """
def __init__(self, players=None):
"""
Note that we may init an empty Queue, if we are loading from the repo.
"""
self.current_move = 0
self.last_mov... | mit | Python |
89687462e4a8268dbaa98d058519434c7614f352 | Remove backtracking survey link | pfmoore/pip,pfmoore/pip,pradyunsg/pip,sbidoul/pip,pypa/pip,pradyunsg/pip,pypa/pip,sbidoul/pip | src/pip/_internal/resolution/resolvelib/reporter.py | src/pip/_internal/resolution/resolvelib/reporter.py | from collections import defaultdict
from logging import getLogger
from typing import Any, DefaultDict
from pip._vendor.resolvelib.reporters import BaseReporter
from .base import Candidate, Requirement
logger = getLogger(__name__)
class PipReporter(BaseReporter):
def __init__(self) -> None:
self.backtra... | from collections import defaultdict
from logging import getLogger
from typing import Any, DefaultDict
from pip._vendor.resolvelib.reporters import BaseReporter
from .base import Candidate, Requirement
logger = getLogger(__name__)
class PipReporter(BaseReporter):
def __init__(self) -> None:
self.backtra... | mit | Python |
79bbd5f70903b8fc59a2ed5a2d36662214ea98f3 | remove print statements | n0ano/gantt,n0ano/gantt | nova/scheduler/manager.py | nova/scheduler/manager.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Openstack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Openstack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | apache-2.0 | Python |
f4991076348a287c2e82cfa12487c46a7c9018c2 | Fix channel.send bug in semaphore release. | kirkeby/sheared | src/sheared/python/semaphore.py | src/sheared/python/semaphore.py | #
# Sheared -- non-blocking network programming library for Python
# Copyright (C) 2003 Sune Kirkeby <sune@mel.interspace.dk>
#
# This program 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 2... | #
# Sheared -- non-blocking network programming library for Python
# Copyright (C) 2003 Sune Kirkeby <sune@mel.interspace.dk>
#
# This program 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 2... | mit | Python |
7c58d74785c340d39b2570c07b0caaa611227269 | Remove an extra newline. | google/fedjax,google/fedjax | setup.py | setup.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
#
# http://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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
6655feff54a67bab96906209c8ac6ca45cc5eeb2 | Fix trove classifiers | incuna/django-user-management,incuna/django-user-management | setup.py | setup.py | from setuptools import find_packages, setup
version = '17.0.0'
install_requires = (
'djangorestframework>=3.4.0,<3.5',
'incuna_mail>=2.0.0,<4.0.0',
'incuna-pigeon>=0.1.0,<1.0.0',
)
extras_require = {
'avatar': [
'django-imagekit>=3.2',
],
'utils': [
'raven>=5.1.1',
],
}
... | from setuptools import find_packages, setup
version = '17.0.0'
install_requires = (
'djangorestframework>=3.4.0,<3.5',
'incuna_mail>=2.0.0,<4.0.0',
'incuna-pigeon>=0.1.0,<1.0.0',
)
extras_require = {
'avatar': [
'django-imagekit>=3.2',
],
'utils': [
'raven>=5.1.1',
],
}
... | bsd-2-clause | Python |
d65516d208eaf0e966c260ff1140549f7dbe5525 | bump version | Hipo/django-sloop,Hipo/django-sloop | setup.py | setup.py | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-sloop',
version='1.0.3',
... | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-sloop',
version='1.0.2',
... | apache-2.0 | Python |
ef4cbdab883972f0ebb5d3b4ad71331b8ec0c2dd | remove pythin versions | vedarthk/async_runner | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'cel... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'cel... | mit | Python |
f0d3e254e427e8b8ff5022f042e1acca2ff4c7fc | Bump to v0.1.1 | gisce/osconf | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='osconf',
version='0.1.1',
packages=find_packages(),
url='https://github.com/gisce/osconf',
license='MIT',
author='GISCE-TI, S.L.',
author_email='devel@gisce.net',
description='Configure from environment variables'
)
| from setuptools import setup, find_packages
setup(
name='osconf',
version='0.1.0',
packages=find_packages(),
url='https://github.com/gisce/osconf',
license='MIT',
author='GISCE-TI, S.L.',
author_email='devel@gisce.net',
description='Configure from environment variables'
)
| mit | Python |
271f2c35e44ba756dd5deb04d00aa8f0db2a3fa8 | Tag as v2.18.1 to include slug field | tswicegood/django-timelinejs2 | setup.py | setup.py | from distutils.core import setup
import os
# Stolen from django-registration
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
for dirpath, dirnames, filenames in os.... | from distutils.core import setup
import os
# Stolen from django-registration
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
for dirpath, dirnames, filenames in os.... | apache-2.0 | Python |
77f06c052e168116acb8b07a515fa814f56872b9 | Remove sherlock | disqus/codebox,disqus/codebox | codesharer/apps/snippets/views.py | codesharer/apps/snippets/views.py | from flask import current_app as app, g, request, Module, render_template, redirect
from codesharer.apps.snippets.models import Snippets
from codesharer.apps.snippets.forms import NewSnippetForm
from codesharer.utils.readability import summarize_url
frontend = Module(__name__)
@frontend.route('/:org/new', methods=['... | from flask import current_app as app, g, request, Module, render_template, redirect
from disqusapi import DisqusAPI
from sherlock.apps.snippets.models import Snippets
from sherlock.apps.snippets.forms import NewSnippetForm
from sherlock.utils.readability import summarize_url
frontend = Module(__name__)
@frontend.rou... | apache-2.0 | Python |
9679b1d1913bc759a6096e1e67b1ed24dcb9a9fd | Bump version | jbasko/idempotent-sequence | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='idempotent-sequence',
version='2.0.0',
author='Jazep... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='idempotent-sequence',
version='1.0.3',
author='Jazep... | mit | Python |
fad30270490fbdd9f7fde57f656e1b528ead1fb0 | Fix wrong path to news file. | rolando/crochet,itamarst/crochet,wrmsr/crochet | setup.py | setup.py | import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_crochet_version():
"""
Get crochet version from version module without importing more than
necessary.
"""
this_dir_path = os.path.dirname(__file__)
crochet_module_path = os.path.jo... | import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_crochet_version():
"""
Get crochet version from version module without importing more than
necessary.
"""
this_dir_path = os.path.dirname(__file__)
crochet_module_path = os.path.jo... | mit | Python |
2bf430d924a200cb03c85ea1f00b0696dabd1228 | Bump version to 1.0.1 | gtaylor/python-route53 | setup.py | setup.py | from setuptools import setup
DESCRIPTION = "A simple Route53 API for Python 2.7/3.x, powered by requests."
LONG_DESCRIPTION = open('README.rst').read()
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operatin... | from setuptools import setup
DESCRIPTION = "A simple Route53 API for Python 2.7/3.x, powered by requests."
LONG_DESCRIPTION = open('README.rst').read()
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operatin... | mit | Python |
a1d32961051ad58add07e2c3f7aee9d25fea009b | Fix my patch-applying-fail from r1516. | old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google | test/configurations/invalid/standalone_static_library.gyp | test/configurations/invalid/standalone_static_library.gyp | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'configurations',
'type': 'none',
'configurations': {
'Debug': {
'standalone_static_libra... | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'configurations',
'type': 'none',
'configurations': {
'Debug': {
'standalone_static_libra... | bsd-3-clause | Python |
64d5ad26784bd55506e41a4a114decc14b00d4cf | Fix test error | Kotaimen/stonemason,Kotaimen/stonemason | tests/stonemason/renderer/cartographer/test_factory.py | tests/stonemason/renderer/cartographer/test_factory.py | # -*- encoding: utf-8 -*-
__author__ = 'ray'
__date__ = '4/21/15'
import os
import unittest
from stonemason.renderer.cartographer import LayerFactory
from stonemason.renderer.cartographer.imagery import Color, Blend, MinPILFilter
from stonemason.mason.theme import SAMPLE_THEME_DIRECTORY
from tests import skipUnless... | # -*- encoding: utf-8 -*-
__author__ = 'ray'
__date__ = '4/21/15'
import os
import unittest
from stonemason.renderer.cartographer import LayerFactory
from stonemason.renderer.cartographer.imagery import Color, Filter, Blend
from stonemason.mason.theme import SAMPLE_THEME_DIRECTORY
from tests import skipUnlessHasSci... | mit | Python |
1b36c314c66cf6405ef020c24196f310bc02399f | remove unneeded includes from syncmaster.py | frioux/offlineimap,frioux/offlineimap | offlineimap/syncmaster.py | offlineimap/syncmaster.py | # OfflineIMAP synchronization master code
# Copyright (C) 2002-2007 John Goerzen
# <jgoerzen@complete.org>
#
# This program 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 2 of the Lice... | # OfflineIMAP synchronization master code
# Copyright (C) 2002-2007 John Goerzen
# <jgoerzen@complete.org>
#
# This program 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 2 of the Lice... | apache-2.0 | Python |
94acf1dd4b8433d43dd27077b8258c609bf62a67 | Fix long-line warnings | astralblue/ctorrepr | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
]
setup_requirements = [
'pytes... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TODO: put package requirements... | mit | Python |
36c6388b6f7d39ea09ed5c3e52262128fe1e7e6c | update to latest releases | ployground/bsdploy,ployground/bsdploy | setup.py | setup.py | from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
version = "2.1.0.dev0"
install_requires = [
'PyYAML',
'jinja2',
'setuptools',
'ploy>=1.2.0',
'pl... | from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
version = "2.1.0.dev0"
install_requires = [
'PyYAML',
'jinja2',
'setuptools',
'ploy>=1.1.0',
'pl... | bsd-3-clause | Python |
c914d026eb6b6a8920052a9c1a64b2ab7902537e | update library versions | wq/wq.core,wq/wq.core | setup.py | setup.py | import os
from setuptools import setup
LONG_DESCRIPTION = """
The wq command line tool.
"""
def readme():
try:
readme = open('README.md')
except IOError:
return LONG_DESCRIPTION
return readme.read()
def create_wq_namespace():
"""
Generate the wq namespace package
(not checke... | import os
from setuptools import setup
LONG_DESCRIPTION = """
The wq command line tool.
"""
def readme():
try:
readme = open('README.md')
except IOError:
return LONG_DESCRIPTION
return readme.read()
def create_wq_namespace():
"""
Generate the wq namespace package
(not checke... | mit | Python |
9f8b51559010e76c71dde60ea801903bf772738c | use latest setuptest | praekelt/jmbo-banner,praekelt/jmbo-banner | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='jmbo-banner',
version='0.0.5',
description='Jmbo banner app.',
long_description = open('README.rst', 'r').read(),
author='Praekelt Foundation',
author_email='dev@praekelt.com',
license='BSD',
url='http://github.com/praekelt/jmbo-b... | from setuptools import setup, find_packages
from setuptools.command.test import test
def run_tests(self):
from setuptest.runtests import runtests
return runtests(self)
test.run_tests = run_tests
setup(
name='jmbo-banner',
version='0.0.5',
description='Jmbo banner app.',
long_description = open... | bsd-3-clause | Python |
6248905351a568be303394ee5d932cc2103d9539 | Edit author email | jma127/pcu,jma127/pcu,jma127/pcu,jma127/pcu,jma127/pcu | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='pcu',
version='0.1.1',
description='Comprehensive suite for competitive programming.',
author='Jerry Ma',
author_email='jmnospam@mail.com',
url='https://github.com/jma127/pcu',
license='BSD-new',
packages=find_packages(),
scr... | from setuptools import setup, find_packages
setup(
name='pcu',
version='0.1.1',
description='Comprehensive suite for competitive programming.',
author='Jerry Ma',
author_email='jma127@users.noreply.github.com',
url='https://github.com/jma127/pcu',
license='BSD-new',
packages=find_packa... | bsd-3-clause | Python |
e1644c6878302e8fe498db5afd9f6670a46c4248 | bump to next beta version | whitews/FlowIO | setup.py | setup.py | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='FlowIO',
version='0.9.12b',
packages=['flowio'],
package_data={'': []},
description='Flow Cytometry Standard I/O',
long_description=long_description,
long_description_content_type=... | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='FlowIO',
version='0.9.11',
packages=['flowio'],
package_data={'': []},
description='Flow Cytometry Standard I/O',
long_description=long_description,
long_description_content_type="... | bsd-3-clause | Python |
02711dedb30d27a6cf69cb04f96b8afaa7c6e761 | Update setup.py | mtmtech/mbed-ls,jjones646/mbed-ls,jjones646/mbed-ls,bridadan/mbed-ls,jupe/mbed-ls,mtmtech/mbed-ls,mazimkhan/mbed-ls,bridadan/mbed-ls,0xc0170/mbed-ls,jupe/mbed-ls,mazimkhan/mbed-ls | setup.py | setup.py | # Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
"""
This module defines the attributes of the
PyPI package for the mbed SDK test suite ecosystem tools
"""
import os
from distutils.core import setup
from setuptools import find_packages
DESCRIPTION =... | # Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
"""
This module defines the attributes of the
PyPI package for the mbed SDK test suite ecosystem tools
"""
import os
from distutils.core import setup
from setuptools import find_packages
DESCRIPTION =... | apache-2.0 | Python |
5b18ec2219cbdfa479a1d32f9bf62f7460171f09 | Set verbose_name_plural properly for queue.Entry. | debian-live/live-studio,debian-live/live-studio,lamby/live-studio,lamby/live-studio,lamby/live-studio,debian-live/live-studio | live_studio/queue/models.py | live_studio/queue/models.py | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | agpl-3.0 | Python |
6066170a737b84986b34f18cf969f4e02826f71b | Bump version to 5.14.0 | hhursev/recipe-scraper | setup.py | setup.py | import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name="recipe_scrapers",
url="https://github.com/hhursev/recipe-scrapers/",
version="5.14.... | import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name="recipe_scrapers",
url="https://github.com/hhursev/recipe-scrapers/",
version="5.8.1... | mit | Python |
0013f5ed2eb70d2182fd4d293b78f58a7c39982b | update dependencies | bwesterb/sarah | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
from get_git_version import get_git_version
setup(name='sarah',
version=get_git_version(),
description='Library with miscellaneous functionality',
author='Bas Westerbaan',
author_email='bas@westerbaan.name',
url='http://gi... | #!/usr/bin/env python
from setuptools import setup, find_packages
from get_git_version import get_git_version
setup(name='sarah',
version=get_git_version(),
description='Library with miscellaneous functionality',
author='Bas Westerbaan',
author_email='bas@westerbaan.name',
url='http://gi... | agpl-3.0 | Python |
7fb65580eb476030e490455de72c775e9f50ec1e | Bump py2neo to 1.6.2 | cristigociu/neomodel_dh,andrefsp/neomodel,robinedwards/neomodel,fpieper/neomodel,pombredanne/neomodel,bleib1dj/neomodel,bleib1dj/neomodel,robinedwards/neomodel,wcooley/neomodel | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='neomodel',
version='0.4.0',
description='An object mapper for the neo4j graph database.',
long_description=open('README.rst').read(),
author='Robin Edwards',
author_email='robin.ge@gmail.com',
zip_safe=True,
url='http://github.com... | from setuptools import setup, find_packages
setup(
name='neomodel',
version='0.4.0',
description='An object mapper for the neo4j graph database.',
long_description=open('README.rst').read(),
author='Robin Edwards',
author_email='robin.ge@gmail.com',
zip_safe=True,
url='http://github.com... | mit | Python |
f9f52504d0372dfad3ab00983091f32434a28a9a | Fix github provider fetch method. | olofk/fusesoc,olofk/fusesoc,lowRISC/fusesoc,lowRISC/fusesoc | orpsoc/provider/github.py | orpsoc/provider/github.py | from orpsoc.provider import Provider
import subprocess
import os.path
import sys
import tarfile
if sys.version_info[0] >= 3:
import urllib.request as urllib
else:
import urllib
class GitHub(Provider):
def __init__(self, config):
self.user = config.get('user')
self.repo = config.get('re... | from orpsoc.provider import Provider
import subprocess
import os.path
import sys
import tarfile
if sys.version_info[0] >= 3:
import urllib.request as urllib
else:
import urllib
class GitHub(Provider):
def __init__(self, config):
self.user = config.get('user')
self.repo = config.get('re... | bsd-2-clause | Python |
59375ae96d0b5a4dc5bdb84145633f059ee1de8d | Bump version | pstray/udiskie,mathstuf/udiskie,coldfix/udiskie,pstray/udiskie,khardix/udiskie,coldfix/udiskie | setup.py | setup.py | # encoding: utf-8
from setuptools import setup
# check availability of runtime dependencies
def check_any(*packages):
"""Issue a warning if none of the packages is available."""
errors = []
for package in packages:
try:
__import__(package)
return True
except ImportEr... | # encoding: utf-8
from setuptools import setup
# check availability of runtime dependencies
def check_any(*packages):
"""Issue a warning if none of the packages is available."""
errors = []
for package in packages:
try:
__import__(package)
return True
except ImportEr... | mit | Python |
7d942dfe60d16ac454967cb1727c7948a231dba5 | tag version | gbrammer/grizli | setup.py | setup.py | #from distutils.core import setup
#from distutils.extension import Extension
from setuptools import setup
from setuptools.extension import Extension
import subprocess
import os
import numpy
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
if not os.path.ex... | #from distutils.core import setup
#from distutils.extension import Extension
from setuptools import setup
from setuptools.extension import Extension
import subprocess
import os
import numpy
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
if not os.path.ex... | mit | Python |
4185a72fead5091f67bd474be9c7d56e4a20d687 | Add pycrypto so there is RSA keys on websocket token generation | plone/plone.server,plone/plone.server | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import find_packages
from setuptools import setup
setup(
name='plone.server',
version=open('src/plone.server/VERSION').read().strip(),
long_description=(open('src/plone.server/README.rst').read() + '\n' +
open('src/plone.server/CHANGELOG.rst').r... | # -*- coding: utf-8 -*-
from setuptools import find_packages
from setuptools import setup
setup(
name='plone.server',
version=open('src/plone.server/VERSION').read().strip(),
long_description=(open('src/plone.server/README.rst').read() + '\n' +
open('src/plone.server/CHANGELOG.rst').r... | bsd-2-clause | Python |
db156ed47c6e68737534f4c2f357514277dc8386 | bump version number | saippuakauppias/django-banzai,Tapo4ek/django-banzai | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='django-banzai',
version='0.2',
license='MIT',
description='Django API wrapper for mailing delivery '
'service: http://get-n... | import os
from setuptools import setup, find_packages
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='django-banzai',
version='0.1',
license='MIT',
description='Django API wrapper for mailing delivery '
'service: http://get-n... | mit | Python |
64adeb22f6ea6a41fe867b572ad6d68576aca071 | Bump version | WebSQL/sdk | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
try:
from sphinx.setup_command import BuildDoc as _BuildDoc
class BuildDoc(_BuildDoc):
def finalize_options(self):
super().finalize_options()
if not self.project:
self.project = self.distribution.name
... | #!/usr/bin/env python
from setuptools import setup
try:
from sphinx.setup_command import BuildDoc as _BuildDoc
class BuildDoc(_BuildDoc):
def finalize_options(self):
super().finalize_options()
if not self.project:
self.project = self.distribution.name
... | mit | Python |
30d22305f240677283da017c704fb3fa0b6f14ca | add nose to setup. | whiteavian/data_compare | setup.py | setup.py | from setuptools import setup
setup(
name='SQLDatabase',
version='0.1dev',
py_modules=['data_compare',],
license='Creative Commons Attribution-Noncommercial-Share Alike license',
long_description=open('README.txt').read(),
install_requires=[
'nose',
'nose-pudb',
'sqlalche... | from setuptools import setup
setup(
name='SQLDatabase',
version='0.1dev',
py_modules=['data_compare',],
license='Creative Commons Attribution-Noncommercial-Share Alike license',
long_description=open('README.txt').read(),
install_requires=[
'sqlalchemy',
'sqlalchemy-utils',
... | mit | Python |
fe8b8e4b89e2d6ae883e00eaad5305b7a2d4f47d | Set keyworks key at setup.py | lerrua/django-allejo | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
import re
import sys
version = '0.1.0'
name = 'django-allejo'
package = 'allejo'
description = 'Management and creation for custom tournaments and \
rankings for many sports.'
url = 'http://github.com/lerrua/django-allejo'
author = 'Igor P. L... | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
import re
import sys
version = '0.1.0'
name = 'django-allejo'
package = 'allejo'
description = 'Management and creation for custom tournaments and \
rankings for many sports.'
url = 'http://github.com/lerrua/django-allejo'
author = 'Igor P. L... | mit | Python |
d6cd284903e2928908cc6b1a539029e463f59620 | Add description and long_description to setup() | wylee/django-local-settings,PSU-OIT-ARC/django-local-settings,kfarr2/django-local-settings | setup.py | setup.py | import sys
from setuptools import find_packages, setup
VERSION = sys.version_info[:2]
with open('README.md') as fp:
long_description = fp.read()
install_requires = [
'six',
]
if VERSION < (2, 7):
install_requires += [
'argparse',
'configparser',
]
setup(
name='django-local-s... | import sys
from setuptools import find_packages, setup
VERSION = sys.version_info[:2]
install_requires = [
'six',
]
if VERSION < (2, 7):
install_requires += [
'argparse',
'configparser',
]
setup(
name='django-local-settings',
version='1.0a1',
author='Wyatt Baldwin',
au... | mit | Python |
ed0b44a037e917b713c1f4270d0030b0a30460d7 | Bump v1.1.3 | sqlboy/fileseq | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
descript = 'A Python library for parsing frame ranges and file ' \
'sequences based on a similar library found in Katana.'
setup(name='Fileseq',
version='1.1.3',
package_dir = {'': 'src'},
packages=find_packages('... | #!/usr/bin/env python
from setuptools import setup, find_packages
descript = 'A Python library for parsing frame ranges and file ' \
'sequences based on a similar library found in Katana.'
setup(name='Fileseq',
version='1.1.2',
package_dir = {'': 'src'},
packages=find_packages('... | mit | Python |
59a54905eabc2c601217621fab457a13b32b29ce | fix offline dependencies (#21345) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-dictdiffer/package.py | var/spack/repos/builtin/packages/py-dictdiffer/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyDictdiffer(PythonPackage):
"""Dictdiffer is a helper module that helps you to diff and p... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyDictdiffer(PythonPackage):
"""Dictdiffer is a helper module that helps you to diff and p... | lgpl-2.1 | Python |
170fae80dc511f42c1a9b4825447c8b2e5ad76d1 | Bump version to v0.9.1 | yunojuno/django-onfido | setup.py | setup.py | # -*- coding: utf-8 -*-
from os import path, pardir, chdir
from setuptools import setup, find_packages
README = open(path.join(path.dirname(__file__), 'README.rst')).read()
# requirements.txt must be included in MANIFEST.in and include_package_data must be True
# in order for this to work; ensures that tox can use the... | # -*- coding: utf-8 -*-
from os import path, pardir, chdir
from setuptools import setup, find_packages
README = open(path.join(path.dirname(__file__), 'README.rst')).read()
# requirements.txt must be included in MANIFEST.in and include_package_data must be True
# in order for this to work; ensures that tox can use the... | mit | Python |
0f183708aa8a0c9503d847a65f072de07dc800ea | Check for maximize in args. | GoldenLine/gtlaunch | tests.py | tests.py | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | mit | Python |
a18437f7b95d701eda063484346bd5af3d34d27e | Document HTTPException | nickfrostatx/malt | malt/exceptions.py | malt/exceptions.py | # -*- coding: utf-8 -*-
"""HTTP exception object."""
from .wrappers import Response
class HTTPException(Response, Exception):
"""This can be raised from middleware to render an error page."""
| # -*- coding: utf-8 -*-
"""HTTP exception object."""
from .wrappers import Response
class HTTPException(Response, Exception):
""""""
| mit | Python |
8adbd77fad411dc80aaacb65ec7e2a506dc0edfb | fix some noise | hortont424/contrasty,hortont424/contrasty,hortont424/contrasty | src/reduce.py | src/reduce.py | import math
import sys
import pyopencl as cl
import numpy
import numpy.numarray.nd_image
from PIL import Image
from log import *
def reduceImage(image, clContext, clQueue, buckets):
if not hasattr(reduceImage, "program"):
kernelFile = open('src/reduceImage.cl', 'r')
reduceImage.program = cl.Progr... | import math
import sys
import pyopencl as cl
import numpy
from PIL import Image
from log import *
def reduceImage(image, clContext, clQueue, buckets):
if not hasattr(reduceImage, "program"):
kernelFile = open('src/reduceImage.cl', 'r')
reduceImage.program = cl.Program(clContext, kernelFile.read()... | bsd-2-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.