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
f9293d838a21f495ea9b56cbe0f6f75533360aed
Remove support for deprecated `Config.TIMEOUT`.
Fizzadar/pyinfra,Fizzadar/pyinfra
pyinfra/api/config.py
pyinfra/api/config.py
import six class Config(object): ''' The default/base configuration options for a pyinfra deploy. ''' state = None # % of hosts which have to fail for all operations to stop FAIL_PERCENT = None # Seconds to timeout SSH connections CONNECT_TIMEOUT = 10 # Temporary directory (on ...
import six from pyinfra import logger class Config(object): ''' The default/base configuration options for a pyinfra deploy. ''' state = None # % of hosts which have to fail for all operations to stop FAIL_PERCENT = None # Seconds to timeout SSH connections CONNECT_TIMEOUT = 10 ...
mit
Python
58e8318121033f457ed47e429f33ec751895ff18
Bump version to 0.2.1
EKT/pyrundeck
pyrundeck/__init__.py
pyrundeck/__init__.py
# Copyright (c) 2007-2015, National Documentation Centre (EKT, www.ekt.gr) # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # Redistributions of source code must retain the above copyright # ...
# Copyright (c) 2007-2015, National Documentation Centre (EKT, www.ekt.gr) # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # Redistributions of source code must retain the above copyright # ...
bsd-3-clause
Python
19f50cee31ff28ff0fe705495bdad656b145bc9f
add progress tracking to extract example script
aheadley/python-naabal
examples/big-extract.py
examples/big-extract.py
#/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Alex Headley <aheadley@waysaboutstuff.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 witho...
#/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Alex Headley <aheadley@waysaboutstuff.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 witho...
mit
Python
528f12da10e579a42c6afac44dc6453d87b96bc9
rewrite python3-compatible print() functions
falcondai/py-ransac
ransac.py
ransac.py
import random def run_ransac(data, estimate, is_inlier, sample_size, goal_inliers, max_iterations, stop_at_goal=True, random_seed=None): best_ic = 0 best_model = None random.seed(random_seed) for i in xrange(max_iterations): s = random.sample(data, int(sample_size)) m = estimate(s) ...
import random def run_ransac(data, estimate, is_inlier, sample_size, goal_inliers, max_iterations, stop_at_goal=True, random_seed=None): best_ic = 0 best_model = None random.seed(random_seed) for i in xrange(max_iterations): s = random.sample(data, int(sample_size)) m = estimate(s) ...
mit
Python
ccb105ac969e5258a28d4f4b5b4523741e6d28db
fix super object call
hzdg/django-modeltools
modeltools/managers.py
modeltools/managers.py
from django.db.models import Manager class FilteredManager(Manager): def __init__(self, **kwargs): self.filter_args = kwargs super(FilteredManager, self).__init__() def get_queryset(self): return super(FilteredManager, self).get_queryset() \ .filter(**self.filter_args)...
from django.db.models import Manager class FilteredManager(Manager): def __init__(self, **kwargs): self.filter_args = kwargs super(FilteredManager, self).__init__() def get_queryset(self): return super(FilteredManager, self).get_query_set() \ .filter(**self.filter_args...
mit
Python
16daa3b2158b7478b01ad2a57790eb914751f00c
Add video link widget
Dalloriam/engel,Dalloriam/engel,Dalloriam/engel
pyui/widgets/media.py
pyui/widgets/media.py
from .base import BaseElement, BaseContainer from .abstract import ViewLink class Image(BaseElement): def __init__(self, id, img_url, classname=None, parent=None): super(Image, self).__init__(id, classname, parent) self.html_tag = "img" self.attributes["src"] = img_url class Video(BaseElement): d...
from .base import BaseElement, BaseContainer from .abstract import ViewLink class Image(BaseElement): def __init__(self, id, img_url, classname=None, parent=None): super(Image, self).__init__(id, classname, parent) self.html_tag = "img" self.attributes["src"] = img_url class Video(BaseElement): d...
mit
Python
5221f5134f3a0eca98787c73d6d6a1a4e7acd30a
Add input file parser. Add conversion to cti
bryanwweber/CanSen,kyleniemeyer/CanSen
cansen.py
cansen.py
#! /usr/bin/python3 def read_input_file(inputFilename): print("Got to input file") reactants = {} with open(inputFilename) as inputFile: for line in inputFile: if line.upper().startswith('CONV'): problemType = 1 elif line.upper().startswith('CONP'): ...
#! /usr/bin/python3 import cantera as ct gas = ct.Solution('mech.cti') gas.TPX = 1000,101325,'H2:2,O2:1,N2:3.76' reac = ct.Reactor(gas) netw = ct.ReactorNet([reac]) tend = 10 time = 0 while time < tend: time = netw.step(tend) print(time,reac.T,reac.thermo.P) if reac.T > 1400: break
mit
Python
3e331d7b7c14a4556a0d137f090c0df9a996a894
Update use_project.py
TJKessler/ECNet
examples/use_project.py
examples/use_project.py
""" EXAMPLE SCRIPT: Using a pre-existing project to obtain results Imports a pre-existing project to the Server environment, imports a testing dataset, obtain results and errors for testing dataset """ from ecnet.server import Server # Create the Server sv = Server() # Opens pre-existing project sv.open_project('c...
""" EXAMPLE SCRIPT: Using a pre-existing project to obtain results Imports a pre-existing project to the Server environment, imports a testing dataset, obtain results and errors for testing dataset """ from ecnet.server import Server # Create the Server sv = Server() # Opens pre-existing project sv.open_project('c...
mit
Python
94596f036270f8958afd84eb9788ce2b15f5cbd4
Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
rafaduran/django-pluggable-registration,rbarrois/django-registration,maraujop/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/django-registration,AndrewLvov/django-registration,AndrewLvov/django-registration,aptivate/django-registration,fedenko/django-registration,CoatedMoose/django-registration,ch...
registration/admin.py
registration/admin.py
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') raw_id_fields = ['user'] search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfil...
from django.contrib import admin from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'activation_key_expired') search_fields = ('user__username', 'user__first_name') admin.site.register(RegistrationProfile, RegistrationAdmin)
bsd-3-clause
Python
499349ec3dc9d91cd1f14f4d95a8a507daea6438
add documentation
eplaut/python-butler
butler/butler_function.py
butler/butler_function.py
import inspect class ButlerFunction(object): """ButlerFunction is object to parse Butler's functions' properties""" def __init__(self, function_name, function_object): """Init properties, using inspect to get function's parameters. :param function_name: name of the function. :param f...
import inspect class ButlerFunction(object): def __init__(self, function_name, function_object): self.function_name = function_name function_name_parts = self.function_name.split('_', 1) # handle function that doesn't contains underscore self.method, self.name = function_name_parts[0].upp...
apache-2.0
Python
b2e36fd8477a79f53e24d15c2cf074836b7935a4
Change author email address
divijbindlish/movienamer
movienamer/__init__.py
movienamer/__init__.py
__author__ = 'Divij Bindlish' __email__ = 'me@divijbindlish.com' __version__ = '0.0.1' __license__ = 'MIT'
__author__ = 'Divij Bindlish' __email__ = 'dvjbndlsh93@gmail.com' __version__ = '0.0.1' __license__ = 'MIT'
mit
Python
f6820b1d5835939b7b3ee4325e57a2b79c2317c5
Fix permission for migrations with south
timsavage/denim
denim/django/south.py
denim/django/south.py
# -*- encoding:utf8 -*- from fabric import colors from fabric.api import task, settings, hide from denim import django from denim.constants import DeployUser __all__ = ('show_migrations', 'migrate',) @task def show_migrations(revision=None, non_applied_only=False): """ Print report of migrations. :param...
# -*- encoding:utf8 -*- from fabric import colors from fabric.api import task, settings, hide from denim import django __all__ = ('show_migrations', 'migrate',) @task def show_migrations(revision=None, non_applied_only=False): """ Print report of migrations. :param revision: revision of the application ...
bsd-2-clause
Python
939306249bfa2673847e4d064a20c5ccff726b9e
change the faster synchronizing so that it actually works without deleting all the venvs all the time
davidhalter/depl,davidhalter/depl
depl/deploy/_utils.py
depl/deploy/_utils.py
import os import textwrap from fabric.api import put, sudo from fabric.contrib.project import upload_project def lazy(func): def wrapper(*args, **kwargs): return lambda: func(*args, **kwargs) return wrapper def nginx_config(url, port, locations): config = """ server { listen ...
import textwrap from fabric.api import put, sudo from fabric.contrib.project import upload_project def lazy(func): def wrapper(*args, **kwargs): return lambda: func(*args, **kwargs) return wrapper def nginx_config(url, port, locations): config = """ server { listen %s; ...
mit
Python
a34986f174c16b34485812fea9d55efd965d3dcd
Update code
chengdujin/newsman,chengdujin/newsman,chengdujin/newsman
newsman/bin/text_based_feeds/remove_bad_feeds.py
newsman/bin/text_based_feeds/remove_bad_feeds.py
#!/usr/bin/env python #-*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('UTF-8') sys.path.append('../..') from config.settings import Collection, db import feedparser col = Collection(db, 'feeds') """ f = open('db_id_list', 'r') feed_ids = f.readlines() feed_ids = [feed_id.strip() for feed_i...
#!/usr/bin/env python #-*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('UTF-8') sys.path.append('../..') from config.settings import Collection, db import feedparser col = Collection(db, 'feeds') """ f = open('db_id_list', 'r') feed_ids = f.readlines() feed_ids = [feed_id.strip() for feed_i...
agpl-3.0
Python
ebe4f55da0f8d2eeee88f464ac601f8d69900013
Update __init__.py
akhilaananthram/nupic,sambitgaan/nupic,arhik/nupic,ywcui1990/nupic,markneville/nupic,akhilaananthram/nupic,chen0031/nupic,rhyolight/nupic,GeraldLoeffler/nupic,lscheinkman/nupic,scottpurdy/nupic,rayNymous/nupic,EricSB/nupic,go-bears/nupic,fergalbyrne/nupic,cngo-github/nupic,loretoparisi/nupic,go-bears/nupic,scottpurdy/n...
nupic/__init__.py
nupic/__init__.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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) 2013, 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
706a97dca2a882501e31f5a44485f105d77d090e
correct data example plots
AndreasMadsen/grace,AndreasMadsen/grace,AndreasMadsen/grace
figures/data_example.py
figures/data_example.py
# -*- coding: utf-8 -*- from setup import * import grace import grace.times import grace.ols import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.basemap as maps initial = (26, 130) # # Generate a world figure # date = 230 fig = plt.figure(figsize=(8, 3.5)) m = maps.Basemap(projection='cyl', lon...
# -*- coding: utf-8 -*- from setup import * import grace import grace.times import grace.ols import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.basemap as maps # # Generate a world figure # date = 230 fig = plt.figure(figsize=(8, 3.5)) m = maps.Basemap(projection='cyl', lon_0=0, resolution='c')...
mit
Python
7c3f22f5f3da25d49203cce412289351c581ef22
Update version 0.5.0 -> 1.0.0.dev1
dwavesystems/dimod,dwavesystems/dimod
dimod/package_info.py
dimod/package_info.py
__version__ = '1.0.0.dev1' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
__version__ = '0.5.0' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
apache-2.0
Python
53a52a23cabb03b2748e15975e6b570b2d5b82a5
bump version number
orcasgit/django-flatcontent,orcasgit/django-flatcontent
flatcontent/__init__.py
flatcontent/__init__.py
VERSION = (0, 1, 1) __version__ = '.'.join(map(str, VERSION))
VERSION = (0, 1, 0) __version__ = '.'.join(map(str, VERSION))
bsd-3-clause
Python
6474728a5f661b896e1601b36c01b145481eb338
add superclass of layers
harpribot/representation-music,harpribot/representation-music
dnn/layers.py
dnn/layers.py
import tensorflow as tf from parameters import weight_variable, bias_variable from regularization import dropout_layer, batch_norm_layer from activation import relu, leaky_relu class Layers(object): def __init__(self): self.layers = dict() def _add_input_layer(self, width, layer_id='input'): ...
mit
Python
013632b7a1763f75d8ebc60238568f9a47715ad9
Increment version to 1.13.0.
GrahamDumpleton/wrapt,GrahamDumpleton/wrapt
src/wrapt/__init__.py
src/wrapt/__init__.py
__version_info__ = ('1', '13', '0') __version__ = '.'.join(__version_info__) from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper, BoundFunctionWrapper, WeakFunctionProxy, PartialCallableObjectProxy, resolve_path, apply_patch, wrap_object, wrap_object_attribute, function_wra...
__version_info__ = ('1', '13', '0rc3') __version__ = '.'.join(__version_info__) from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper, BoundFunctionWrapper, WeakFunctionProxy, PartialCallableObjectProxy, resolve_path, apply_patch, wrap_object, wrap_object_attribute, function_...
bsd-2-clause
Python
41d4bed925624cdc033452c69deeedaabf2f7e88
add logout API
jermowery/xos,jermowery/xos,xmaruto/mcord,cboling/xos,jermowery/xos,xmaruto/mcord,jermowery/xos,xmaruto/mcord,xmaruto/mcord,cboling/xos,cboling/xos,cboling/xos,cboling/xos
xos/core/xoslib/methods/loginview.py
xos/core/xoslib/methods/loginview.py
from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.reverse import reverse from rest_framework import serializers from rest_framework import generics from rest_framework.views import APIView from core.models import * from services.hpc.models import * from serv...
from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.reverse import reverse from rest_framework import serializers from rest_framework import generics from rest_framework.views import APIView from core.models import * from services.hpc.models import * from serv...
apache-2.0
Python
f641e7509c2d9fefc0bd1833987b552ee826ee17
remove unused code
1024inc/django-rq,ui/django-rq,1024inc/django-rq,ui/django-rq
django_rq/settings.py
django_rq/settings.py
from operator import itemgetter from django.conf import settings from django.core.exceptions import ImproperlyConfigured from .queues import get_unique_connection_configs SHOW_ADMIN_LINK = getattr(settings, 'RQ_SHOW_ADMIN_LINK', False) QUEUES = getattr(settings, 'RQ_QUEUES', None) if QUEUES is None: raise Impro...
from operator import itemgetter from django.conf import settings from django.core.exceptions import ImproperlyConfigured from .queues import get_unique_connection_configs SHOW_ADMIN_LINK = getattr(settings, 'RQ_SHOW_ADMIN_LINK', False) QUEUES = getattr(settings, 'RQ_QUEUES', None) if QUEUES is None: raise Impro...
mit
Python
4ae90bab735aa8e4ef649e0b50481e8aba4474c6
Change the module description
acsone/connector-cmis
cmis_write/__openerp__.py
cmis_write/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
Python
69a174d219c889ff9baee2b39e5b729fc9294d72
Add OrderedModelManager
MagicSolutions/django-orderedmodel,MagicSolutions/django-orderedmodel
orderedmodel/models.py
orderedmodel/models.py
from django.db import models from django.core.exceptions import ValidationError class OrderedModelManager(models.Manager): def swap(self, obj1, obj2): tmp, obj2.order = obj2.order, 0 obj2.save(swapping=True) obj2.order, obj1.order = obj1.order, tmp obj1.save() obj2.save() ...
from django.db import models from django.core.exceptions import ValidationError class OrderedModel(models.Model): order = models.PositiveIntegerField(blank=True, default=1, db_index=True) class Meta: abstract = True ordering = ['order'] def save(self, swapping=False, *args, **kwargs): ...
bsd-3-clause
Python
987a6e06fd0e8c276b8abd12102ff356710708bd
Bump version number.
philippbosch/django-geoposition,RamezIssac/django-geoposition,philippbosch/django-geoposition,akiokio/django-geoposition,RamezIssac/django-geoposition,APSL/django-geoposition,akiokio/django-geoposition,lancekrogers/django-geoposition,rmoorman/django-geoposition,coxmediagroup/django-geoposition,mativs/django-geoposition...
geoposition/__init__.py
geoposition/__init__.py
from decimal import Decimal VERSION = (0, 1, 2) __version__ = '.'.join(map(str, VERSION)) class Geoposition(object): def __init__(self, latitude, longitude): if isinstance(latitude, float) or isinstance(latitude, int): latitude = str(latitude) if isinstance(longitude, float) or isinst...
from decimal import Decimal VERSION = (0, 1, 1) __version__ = '.'.join(map(str, VERSION)) class Geoposition(object): def __init__(self, latitude, longitude): if isinstance(latitude, float) or isinstance(latitude, int): latitude = str(latitude) if isinstance(longitude, float) or isinst...
mit
Python
f45f2ee28c6b34818ba7637bd8d0cf6287d54eaf
Improve docstring on RouteViewHandler
meshy/django-conman,Ian-Foote/django-conman,meshy/django-conman
conman/routes/handlers.py
conman/routes/handlers.py
from django.core.urlresolvers import resolve, Resolver404 class BaseHandler: """ Abstract base class for `Route` handlers. Subclasses should define `handle`. """ @classmethod def path(cls): """Get dotted-path of this class.""" return '{}.{}'.format(cls.__module__, cls.__name__...
from django.core.urlresolvers import resolve, Resolver404 class BaseHandler: """ Abstract base class for `Route` handlers. Subclasses should define `handle`. """ @classmethod def path(cls): """Get dotted-path of this class.""" return '{}.{}'.format(cls.__module__, cls.__name__...
bsd-2-clause
Python
aff06c1e2b77287f1d2328a272019aa99abcc9b3
Update bitly parser to better handle case where no API key is specified
obsidianforensics/unfurl,obsidianforensics/unfurl
parsers/parse_bitly.py
parsers/parse_bitly.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
c76d67374c87a2cc3beb84352c5656f75968a192
Add h2o.locate.
YzPaul3/h2o-3,printedheart/h2o-3,kyoren/https-github.com-h2oai-h2o-3,datachand/h2o-3,YzPaul3/h2o-3,datachand/h2o-3,jangorecki/h2o-3,YzPaul3/h2o-3,tarasane/h2o-3,h2oai/h2o-dev,tarasane/h2o-3,tarasane/h2o-3,mathemage/h2o-3,datachand/h2o-3,junwucs/h2o-3,tarasane/h2o-3,mathemage/h2o-3,printedheart/h2o-3,spennihana/h2o-3,ma...
h2o-py/assembly_demo.py
h2o-py/assembly_demo.py
import h2o from h2o import H2OAssembly from h2o.transforms.preprocessing import * from h2o import H2OFrame h2o.init() fr = h2o.import_file(h2o.locate("smalldata/iris/iris_wheader.csv")) # import data assembly = H2OAssembly(steps=[("col_select", H2OColS...
import h2o from h2o import H2OAssembly from h2o.transforms.preprocessing import * from h2o import H2OFrame h2o.init() fr = h2o.import_file("smalldata/iris/iris_wheader.csv") # import data assembly = H2OAssembly(steps=[("col_select", H2OColS...
apache-2.0
Python
ecfba933b2082665ea697b151bcff6ec0f083b69
Fix prinouts
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 from hopsutil import hdfs as hopshdfs import pydoop....
""" 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 from hopsutil import hdfs as hopshdfs import pydoop....
apache-2.0
Python
79b1bd69a81741ae6ea0106df2ff3ac69322f6a9
Terminate connections when restoring
orf/stellar,fastmonkeys/stellar,Wanderfalke/stellar
stellar/operations.py
stellar/operations.py
from sqlalchemy.exc import ProgrammingError from database import stellar_db, Base, raw_connection def create_stellar_tables(): try: raw_connection.execute(''' CREATE DATABASE "stellar_data" ''') except ProgrammingError: return False Base.metadata.create_all(stellar_db) ...
from sqlalchemy.exc import ProgrammingError from database import stellar_db, Base, raw_connection def create_stellar_tables(): try: raw_connection.execute(''' CREATE DATABASE "stellar_data" ''') except ProgrammingError: return False Base.metadata.create_all(stellar_db) ...
mit
Python
836abb9d4e969d5eecc1e45844e095887cc999dd
Update server.py
Rikvanvelzen/TICT-V1CSN-15-Miniproject,Joepieler/TICT-V1CSN-15-Miniproject
server.py
server.py
import socket import time from _thread import * from ClientNode import ClientNode HOST = '' PORT = 5555 client_list = [] server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def parse_data(client_hex, data_header, data): if data == "ALRM_TRIP": pass elif data == "IS_ALIVE": socke...
mit
Python
1d092e626db816c16069d4b5948d43554a82ef3d
Fix server script
JokerQyou/pitools
server.py
server.py
# coding: utf-8 from __future__ import unicode_literals from flask import Flask from pitools import camera from pitools.sensors import bmp085 app = Flask(__name__) app.register_blueprint(camera.blueprint) app.register_blueprint(bmp085.blueprint, url_prefix='/sensors') def serve(): app.run('0.0.0.0', 9876) if _...
# coding: utf-8 from __future__ import unicode_literals from flask import Flask import pitools app = Flask(__name__) app.register_blueprint(pitools.camera.blueprint) app.register_blueprint(pitools.sensors.bmp085.blueprint, url_prefix='/sensors') def serve(): app.run('0.0.0.0', 9876) if __name__ == '__main__': ...
bsd-2-clause
Python
59513d6c833e5697e1c7a3beb3816c49799461be
Add welcome print
jantuomi/chatserver-homework
server.py
server.py
#!/usr/bin/env python3 import socket import threading from functools import partial from datetime import datetime HOST = "0.0.0.0" PORT = 5000 DEBUG = True def debug(string): if (DEBUG): print("{} DEBUG: {}".format(datetime.now(), string)) def parse_message(text): rows = text.split('\n') if (len(...
#!/usr/bin/env python3 import socket import threading from functools import partial from datetime import datetime HOST = "0.0.0.0" PORT = 5000 DEBUG = True def debug(string): if (DEBUG): print("{} DEBUG: {}".format(datetime.now(), string)) def parse_message(text): rows = text.split('\n') if (len(...
mit
Python
d66b1780ce5be018677fbbe71beaa66708db61da
Bump version to 3.4.1a6
platformio/platformio-core,platformio/platformio,platformio/platformio-core
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
Python
ce9c563c9f5c89a5588f0e98e3551e09306043c1
Bump version to 3.5.0b3
platformio/platformio-core,platformio/platformio,platformio/platformio-core
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
Python
abddbf9c7dd174a76d1867f0c72a22ea7fa4ce64
Bump version to 5.0.4a1
platformio/platformio-core,platformio/platformio-core,platformio/platformio
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
Python
4b08dbd602915444c7f208ce58b82a85fe3c81ff
Bump version to 3.5.1a7
platformio/platformio-core,platformio/platformio-core,platformio/platformio
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
Python
883187f9ac3f82c2f6b10c5b1a47bb8987be71c5
Bump version to 5.2.2a1
platformio/platformio-core,platformio/platformio-core,platformio/platformio
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
Python
2a695ed5abbba5ba0ae63b61ecbc2edb0c8065b1
Update netid2name.py
rice-apps/petition-app,rice-apps/petition-app,rice-apps/petition-app
controllers/netid2name.py
controllers/netid2name.py
import urllib2 import json api_key = "" def netid2name(netid): # Get the JSON response from the server apiResponseString = urllib2.urlopen("http://api.riceapps.org/api/people?key=" + api_key + "&net_id=" + netid).read() apiResponse = json.loads(apiResponseString) # Do something useful with it if...
import urllib2 import json api_key = "mhobldbd6gcq2rd7734kiq7xoze897" def netid2name(netid): # Get the JSON response from the server apiResponseString = urllib2.urlopen("http://api.riceapps.org/api/people?key=" + api_key + "&net_id=" + netid).read() apiResponse = json.loads(apiResponseString) # Do s...
mit
Python
09fe9806f387f76ca1096e9ea773b3c3f8aca783
bump to version 1.05
lobocv/crashreporter,lobocv/crashreporter,lobocv/crashreporter_hq,lobocv/crashreporter_hq,lobocv/crashreporter_hq,lobocv/crashreporter_hq
crashreporter/__init__.py
crashreporter/__init__.py
__version__ = '1.05' try: from crashreporter import CrashReporter except ImportError: pass
__version__ = '1.03' try: from crashreporter import CrashReporter except ImportError: pass
mit
Python
e20207a4b0a519fe20f2f1ce471601ff98416ee9
Drop don't needed exceptions
itcrab/dark_keeper,itcrab/dark-keeper
dark_keeper/exceptions.py
dark_keeper/exceptions.py
class DarkKeeperError(Exception): pass class DarkKeeperCacheError(DarkKeeperError): pass class DarkKeeperCacheReadError(DarkKeeperCacheError): pass class DarkKeeperParseError(DarkKeeperError): pass class DarkKeeperParseHTMLError(DarkKeeperParseError): pass class DarkKeeperRequestError(Dark...
import math class DarkKeeperError(Exception): pass class DarkKeeperCacheError(DarkKeeperError): pass class DarkKeeperCacheReadError(DarkKeeperCacheError): pass class DarkKeeperParseError(DarkKeeperError): pass class DarkKeeperParseHTMLError(DarkKeeperParseError): pass class DarkKeeperReq...
mit
Python
126f9b59b6794fe1fc91e7f476148b0dccf1cef4
fix broken prompter temporarily
goude/runcom,goude/runcom,goude/runcom,goude/runcom,goude/runcom
prompt/adv_prompter.py
prompt/adv_prompter.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function import datetime import sysinfo import math SLOWNESS_LIMIT = 1000.0 # cred stackoverflow def make_interpolator(left_min, left_max, right_min, right_max): # Figure out how 'wide' each range is leftSpan = left_max - left_min ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function import datetime import sysinfo import math SLOWNESS_LIMIT = 1000.0 # cred stackoverflow def make_interpolator(left_min, left_max, right_min, right_max): # Figure out how 'wide' each range is leftSpan = left_max - left_min ...
mit
Python
4765a88535262df6373e4f8d2111032fc290da85
Fix class name in test file
robotframework/robotframework,HelioGuilherme66/robotframework,HelioGuilherme66/robotframework,HelioGuilherme66/robotframework,robotframework/robotframework,robotframework/robotframework
atest/testdata/parsing/custom-lang.py
atest/testdata/parsing/custom-lang.py
from robot.conf import Language class Custom(Language): setting_headers = {'H 1'} variable_headers = {'H 2'} test_case_headers = {'H 3'} task_headers = {'H 4'} keyword_headers = {'H 5'} comment_headers = {'H 6'} library = 'L' resource = 'R' variables = 'V' documentation = 'S 1'...
from robot.conf import Language class Fi(Language): setting_headers = {'H 1'} variable_headers = {'H 2'} test_case_headers = {'H 3'} task_headers = {'H 4'} keyword_headers = {'H 5'} comment_headers = {'H 6'} library = 'L' resource = 'R' variables = 'V' documentation = 'S 1' ...
apache-2.0
Python
b5fc80ae626a9d93962239a14a350e73365e50c1
Update Curso.py
AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb
backend/Database/Controllers/Curso.py
backend/Database/Controllers/Curso.py
from Framework.BancoDeDados import BancoDeDados from Database.Models.Curso import Curso as ModelCurso class Curso(object): def pegarCursos(self, condicao, valores): cursos = [] for curso in BancoDeDados().consultarMultiplos("SELECT * FROM curso %s" % (condicao), valores): cursos.append(ModelCurso(curso)) ...
from Framework.BancoDeDados import BancoDeDados from Database.Models.Curso import Curso as ModelCurso class Curso(object): def pegarCursos(self, condicao, valores): cursos = [] for curso in BancoDeDados().consultarMultiplos("SELECT * FROM curso %s" % (condicao), valores): cursos.append(ModelCurso(curso)) ...
mit
Python
ce5acfc0460176509ecd824aca2bbe689e5ed26b
add calcVoc method make Ee and Voc class members use calcVoc and Voc in calcCell
SunPower/PVMismatch
pvmismatch/pvmodule.py
pvmismatch/pvmodule.py
# -*- coding: utf-8 -*- """ Created on Thu May 31 23:17:04 2012 @author: mmikofski """ import numpy from pvconstants import PVconstants from matplotlib import pyplot NUMBERCELLS = [72, 96, 128] _numberCells = 96 class PVmodule(object): """ PVmodule - A Class for PV modules """ def __init__(self, n...
# -*- coding: utf-8 -*- """ Created on Thu May 31 23:17:04 2012 @author: mmikofski """ import numpy from pvconstants import PVconstants from matplotlib import pyplot NUMBERCELLS = [72, 96, 128] _numberCells = 96 class PVmodule(object): """ PVmodule - A Class for PV modules """ def __init__(self, n...
bsd-3-clause
Python
f56f27155e87e3174f5bda54891c6d69d5481bdd
Fix isort (#475)
anthraxx/pwndbg,cebrusfs/217gdb,disconnect3d/pwndbg,disconnect3d/pwndbg,anthraxx/pwndbg,cebrusfs/217gdb,pwndbg/pwndbg,0xddaa/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,0xddaa/pwndbg,0xddaa/pwndbg,disconnect3d/pwndbg,anthraxx/pwndbg,pwndbg/pwndbg,cebrusfs/217gdb,pwndbg/pwndbg,pwndbg/pwndbg
pwndbg/commands/pie.py
pwndbg/commands/pie.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import gdb import pwndbg.auxv import pwndbg.commands import pwndbg.vmmap def translate_addr(offset, modu...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import gdb import pwndbg.commands import pwndbg.vmmap import pwndbg.auxv def translate_addr(offset, module...
mit
Python
c2f8724a5dfe9da14c421239e8890e24eb7ebf46
add documented methods 'register_family' and 'register_data' to public api
pyblish/pyblish-starter
pyblish_starter/api.py
pyblish_starter/api.py
"""Public API Anything that is not defined here is **internal** and unreliable for external use. Motivation for api.py: Storing the API in a module, as opposed to in __init__.py, enables use of it internally. For example, from `pipeline.py`: >> from . import api >> api.do_this() The ...
"""Public API Anything that is not defined here is **internal** and unreliable for external use. Motivation for api.py: Storing the API in a module, as opposed to in __init__.py, enables use of it internally. For example, from `pipeline.py`: >> from . import api >> api.do_this() The ...
mit
Python
76416eded5c5f358977a126d4c6c3d2b9263de8b
Bump version to 4.0.0-dev
pinterest/pymemcache,sontek/pymemcache,pinterest/pymemcache,sontek/pymemcache
pymemcache/__init__.py
pymemcache/__init__.py
__version__ = '4.0.0-dev' from pymemcache.client.base import Client # noqa from pymemcache.client.base import PooledClient # noqa from pymemcache.client.hash import HashClient # noqa from pymemcache.client.base import KeepaliveOpts # noqa from pymemcache.exceptions import MemcacheError # noqa from pymemcache.exc...
__version__ = '3.5.0' from pymemcache.client.base import Client # noqa from pymemcache.client.base import PooledClient # noqa from pymemcache.client.hash import HashClient # noqa from pymemcache.client.base import KeepaliveOpts # noqa from pymemcache.exceptions import MemcacheError # noqa from pymemcache.excepti...
apache-2.0
Python
067c1cfd2dff94314762f537fba0bcab3fcb8383
Fix for ajax results
GrabzIt/grabzit,GrabzIt/grabzit,GrabzIt/grabzit,GrabzIt/grabzit,GrabzIt/grabzit,GrabzIt/grabzit,GrabzIt/grabzit,GrabzIt/grabzit
python/ajax/results.py
python/ajax/results.py
#!/usr/bin/python import os import cgi import cgitb import glob import json cgitb.enable() print ("Content-Type: application/json\n\n") results = [] for infile in glob.glob(".." + os.sep + "results" + os.sep + "*.*"): if ".txt" in infile: continue results.append(infile.repla...
#!/usr/bin/python import os import cgi import cgitb import glob import json cgitb.enable() print ("Content-Type: application/json\n\n") results = [] for infile in glob.glob("." + os.sep + "results" + os.sep + "*.*"): if ".txt" in infile: continue results.append(infile.replace("...
mit
Python
1e6c7bdd569ea79a9079005990b27f316341dec3
Test more imports
ocefpaf/staged-recipes,conda-forge/staged-recipes,ocefpaf/staged-recipes,johanneskoester/staged-recipes,conda-forge/staged-recipes,johanneskoester/staged-recipes
recipes/bigdft/test.py
recipes/bigdft/test.py
# Test that we can import everything import futile import gi import BigDFT # Test A Full Calculation with PyBigDFT from BigDFT.Systems import System from BigDFT.Fragments import Fragment from BigDFT.Atoms import Atom at = Atom({"He": [0, 0, 0]}) frag = Fragment([at]) sys = System({"FRA:0": frag}) from BigDFT.Calcula...
from BigDFT.Systems import System from BigDFT.Fragments import Fragment from BigDFT.Atoms import Atom at = Atom({"He": [0, 0, 0]}) frag = Fragment([at]) sys = System({"FRA:0": frag}) from BigDFT.Calculators import SystemCalculator code = SystemCalculator() from BigDFT.Inputfiles import Inputfile inp = Inputfile() in...
bsd-3-clause
Python
22f3d6d6fdc3e5f07ead782828b406c9a27d0199
Change of import of libraries.
TAURacing/BeagleDash
UDPSender.py
UDPSender.py
from can import Listener from socket import socket class UDPSender(Listener): dataConvert = {"0x600": {"String":"RPM:", "Slot":0, "Conversion":1}, "0x601": {"String":"OIL:", "Slot":2, ...
from can import Listener import socket class UDPSender(Listener): dataConvert = {"0x600": {"String":"RPM:", "Slot":0, "Conversion":1}, "0x601": {"String":"OIL:", "Slot":2, "Convers...
mit
Python
1bab19060a2b12c5ddb95ee4e959c6cdc9a3ae28
Fix syntax error Month.py
SLongofono/448_Project1,SLongofono/448_Project1,SLongofono/448_Project1,SLongofono/448_Project1
app/Month.py
app/Month.py
from Day import Day class Month(): def __init__(self, name, days, year): self.name = name self.days = days self.numDays = len(days) self.year = year for day in days: day.month = self self.weeks = [[]] for day in self.days: if day.weekday == 'Sunday': self.weeks.append([]) ...
from Day import Day class Month(): def __init__(self, name, days, year): self.name = name self.days = days self.numDays = len(days) self.year = year for day in days day.month = self self.weeks = [[]] for day in self.days: if day.weekday == 'Sunday': self.weeks.append([]) ...
mit
Python
9023b8c1c3c65a54885c48ead63b750551c60835
Replace output process.
setokinto/slack-shogi
app/shogi.py
app/shogi.py
import re from slackbot.bot import respond_to from app.modules.shogi_input import ShogiInput from app.modules.shogi_output import ShogiOutput from app.slack_utils.user import User @respond_to('hey', re.IGNORECASE) def res_hey(message): message.reply("Hey") @respond_to('start with <?@?([\d\w_-]+)>?') def start_...
import re from slackbot.bot import respond_to from app.modules.shogi_input import ShogiInput from app.slack_utils.user import User @respond_to('hey', re.IGNORECASE) def res_hey(message): message.reply("Hey") @respond_to('start with <?@?([\d\w_-]+)>?') def start_shogi(message, opponent_name): slacker = mess...
mit
Python
dd595fa50f92daa9f2c7a90aad8f479ad9856a1b
add key expire value
Studio-Link/webapp,Studio-Link/webapp,Studio-Link/webapp,Studio-Link/webapp
app/tasks.py
app/tasks.py
from __future__ import absolute_import from app.celery import celery from app.libs.audio.play import Play import redis @celery.task def add(x, y): return x + y @celery.task def sync_peers(): return True @celery.task def rtp_tx(): return True @celery.task def rtp_rx(): return True @celery.task def p...
from __future__ import absolute_import from app.celery import celery from app.libs.audio.play import Play import redis @celery.task def add(x, y): return x + y @celery.task def sync_peers(): return True @celery.task def rtp_tx(): return True @celery.task def rtp_rx(): return True @celery.task def p...
bsd-2-clause
Python
d4445f012c982ddf917b5c2fe0f42f5505c7aa73
fix print format json
KunihikoKido/elasticsearch-fabric
esfabric/tasks/cat.py
esfabric/tasks/cat.py
# coding=utf-8 from fabric.api import task from fabric.utils import fastprint from .utils import request from .utils import jsonprint def catprint(response, format="", **kwargs): if format.lower() == "json": jsonprint(response) else: fastprint(response) return response @task def aliases(n...
# coding=utf-8 from fabric.api import task from .utils import request @task def aliases(name=None, **kwargs): res = request("aliases", "cat", name=name, **kwargs) print(res) return res @task def allocation(node_id=None, **kwargs): res = request("allocation", "cat", node_id=node_id, **kwargs) print...
mit
Python
da5db320bd96ff881be23c91f8f5d69505d67946
Add missing configuration for DjDT
Clarity-89/clarityv2,Clarity-89/clarityv2,Clarity-89/clarityv2,Clarity-89/clarityv2
src/project_name/urls.py
src/project_name/urls.py
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView urlpatterns = [ url(r'^admin_tools/', includ...
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView urlpatterns = [ url(r'^admin_tools/', includ...
mit
Python
5f5e2d80bb330322950e6b3d05ab595c515a10d0
fix suggested name of client-secrets.json file
ftes/ocr-drive,ftes/ocr-drive
authorize.py
authorize.py
#!/usr/bin/python from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets import os import sys # Path to client-secrets.json which should contain a JSON document such as: # { # "web": { # "client_id": "[[YOUR_CLIENT_ID]]", # "client_secret": "[[YOUR_CLIENT_SEC...
#!/usr/bin/python from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets import os import sys # Path to client_secrets.json which should contain a JSON document such as: # { # "web": { # "client_id": "[[YOUR_CLIENT_ID]]", # "client_secret": "[[YOUR_CLIENT_SEC...
apache-2.0
Python
f1147f9f6873dece16eb73a4a28405bde4e5fb9e
Update example-1 to have logging and subscribe to a channel
joliveros/bitmex-websocket,joliveros/bitmex-websocket
examples/example-1.py
examples/example-1.py
from __future__ import absolute_import from bitmex_websocket.websocket import BitMEXWebsocket from time import sleep import logging import websocket _logger = logging.getLogger('websocket') _logger.setLevel(logging.DEBUG) websocket.enableTrace(True) ws = BitMEXWebsocket() ws.connect() ws.subscribe('instrument') whil...
from __future__ import absolute_import from bitmex_websocket.websocket import BitMEXWebsocket from time import sleep ws = BitMEXWebsocket() ws.connect() while True: sleep(1)
mit
Python
c530baffc1968e0b799024ae76c7b1b30ed7b77b
Add captcha urls as list
openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform
base/urls.py
base/urls.py
from django.conf.urls import url, include from django.urls import path from base import views urlpatterns = [ url(r"^robots.txt$", views.robot), url(r"^$", views.Welcome.as_view(), name="index"), url(r"^about/$", views.redir, {"target": "about"}, name="index"), url(r"^faq/$", views.redir, {"target": "f...
from django.conf.urls import url, include from django.urls import path from base import views urlpatterns = [ url(r"^robots.txt$", views.robot), url(r"^$", views.Welcome.as_view(), name="index"), url(r"^about/$", views.redir, {"target": "about"}, name="index"), url(r"^faq/$", views.redir, {"target": "f...
agpl-3.0
Python
8be2d6c735ebdca542063c34d1048cb70ba7f882
Delete missed reference to tag config option
sassoftware/bob,sassoftware/bob
bob/macro.py
bob/macro.py
# # Copyright (c) 2008 rPath, Inc. # # All rights reserved. # ''' Mechanism for expanding macros from a trove context. ''' import logging def expand(raw, parent, trove=None): '''Transform a raw string with available configuration data.''' macros = {} # Basic info macros.update(parent.cfg.macro) ...
# # Copyright (c) 2008 rPath, Inc. # # All rights reserved. # ''' Mechanism for expanding macros from a trove context. ''' import logging def expand(raw, parent, trove=None): '''Transform a raw string with available configuration data.''' macros = {} # Basic info macros.update(parent.cfg.macro) ...
apache-2.0
Python
c3e5b0c2fe65cea9bc72eb5723ac336ad8be4853
Add builders.
chrisnorman7/pyrts,chrisnorman7/pyrts,chrisnorman7/pyrts
bootstrap.py
bootstrap.py
"""This script will bootstrap the database to a minimal level for usage. You will be left with the following buildings: * Town Hall (homely). * Farm (requires Town Hall). * Stable (requires Farm) You will be left with the following land features: * Mine (provides gold) * Quarry (provides stone) * Lake (provides water...
"""This script will bootstrap the database to a minimal level for usage. You will be left with the following buildings: * Town Hall (homely). * Farm (requires Town Hall). * Stable (requires Farm) You will be left with the following land features: * Mine (provides gold) * Quarry (provides stone) * Lake (provides water...
mpl-2.0
Python
f2f5a08cc123b56b252c0fc8a69124aacbf07f74
Handle role attributes.
cread/pychef,Scalr/pychef,coderanger/pychef,dipakvwarade/pychef,Scalr/pychef,cread/pychef,jarosser06/pychef,jarosser06/pychef,coderanger/pychef,dipakvwarade/pychef
chef/role.py
chef/role.py
from chef.base import ChefObject class Role(ChefObject): """A Chef role object.""" url = '/roles' attributes = { 'description': str, 'run_list': list, 'default_attributes': dict, 'override_attributes': dict, }
from chef.base import ChefObject class Role(ChefObject): """A Chef role object.""" url = '/roles' attributes = { 'description': str, 'run_list': list, }
apache-2.0
Python
a783e91f1498e781ad4f7a8aaab24bf54c48d240
Put the functions from module1 into the default namespace for my package.
matthewkirby/sampleCodeRepo
samplePKG/__init__.py
samplePKG/__init__.py
from .module1 import *
mit
Python
51ebbbfbb86cf3bf17f74d5acd920941abbe169a
make buildroomaction.process skeleton clearer
sourlows/pyagricola
src/actions/field.py
src/actions/field.py
from actions import CompositeAndOrAction, Action from actions.take import TestAction, TestAction2 __author__ = 'djw' class TestCompositeFieldAction(CompositeAndOrAction): """ Filler while other actions are not yet implemented, does nothing """ subactions = { 'a': TestAction(), 'b': T...
from actions import CompositeAndOrAction, Action from actions.take import TestAction, TestAction2 __author__ = 'djw' class TestCompositeFieldAction(CompositeAndOrAction): """ Filler while other actions are not yet implemented, does nothing """ subactions = { 'a': TestAction(), 'b': T...
mit
Python
25b7167b6484f8ee206009033dc5851be358b014
Update nessus_invoker.py
fedex279/OpenDXL
Nessus/nessus_invoker.py
Nessus/nessus_invoker.py
/*Copyright 2017 Uha Durbha * *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, softwar...
import json import logging import os import sys import requests from nessus_common import * from dxlclient.client import DxlClient from dxlclient.client_config import DxlClientConfig from dxlclient.message import Message, Request from bs4 import BeautifulSoup from requests.packages.urllib3.exceptions import InsecureRe...
apache-2.0
Python
c3ea39bfe63b71a30d6f01972179e33378fd84f2
Atualize ListaEncadeada em Python
kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-d...
Python/ListaEncadeada.py
Python/ListaEncadeada.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Lista Ligada: # _________ _________ _________ _________ # head --> | 2 | --|--> | 1 | --|--> | 5 | --|--> | 3 | --|--> None # --------- --------- --------- --------- class Node: def __init__(self, value, next_node = No...
# Lista Ligada: # _________ _________ _________ _________ # head --> | 2 | --|--> | 1 | --|--> | 5 | --|--> | 3 | --|--> None # --------- --------- --------- --------- class Node: def __init__(self, data): self.data = data self.next = None class MyList: ...
mit
Python
a640115d013d6d8b54c088aef664c6e1116c73b9
test basic example -- works from interactive shell
slanglab/phrasemachine,slanglab/phrasemachine,slanglab/phrasemachine
R/comparison_tests/ex.py
R/comparison_tests/ex.py
# can only be run from the py directory, and only in interactive shell # import phrasemachine text = "Barack Obama supports expanding social security." print phrasemachine.get_phrases(text)
import phrasemachine text = "Barack Obama supports expanding social security." print phrasemachine.get_phrases(text)
mit
Python
cabae1394d5b3a0d0c0efa479078c6768472760f
simplify example proposal models
toulibre/symposion,miurahr/symposion,pyohio/symposion,pyconau2017/symposion,NelleV/pyconfr-test,pyconca/2013-web,mbrochh/symposion,pyohio/symposion,TheOpenBastion/symposion,pydata/symposion,NelleV/pyconfr-test,euroscipy/symposion,python-spain/symposion,miurahr/symposion,pyconau2017/symposion,TheOpenBastion/symposion,to...
symposion_project/proposals/models.py
symposion_project/proposals/models.py
from django.db import models from symposion.proposals.models import ProposalBase class Proposal(ProposalBase): AUDIENCE_LEVEL_NOVICE = 1 AUDIENCE_LEVEL_EXPERIENCED = 2 AUDIENCE_LEVEL_INTERMEDIATE = 3 AUDIENCE_LEVELS = [ (AUDIENCE_LEVEL_NOVICE, "Novice"), (AUDIENCE_LEVEL_INTE...
from django.db import models from symposion.proposals.models import ProposalBase class ProposalCategory(models.Model): name = models.CharField(max_length=100) slug = models.SlugField() def __unicode__(self): return self.name class Meta: verbose_name = "proposal category" ...
bsd-3-clause
Python
8265a226d6cfba872e0a23098131e1bc0d3c4883
Add some comments
darthmall/Alfred-Diceware-Workflow
diceware.py
diceware.py
from __future__ import print_function from httplib import HTTPSConnection from random import randint from uuid import uuid4 import json, sys def sysrand(suggestions, words, rolls=5, sides=6, **kwargs): print('sysrand', file=sys.stderr) for i in range(suggestions): yield [''.join(map(str, [randint(1...
from __future__ import print_function from httplib import HTTPSConnection from random import randint from uuid import uuid4 import json, sys def sysrand(suggestions, words, rolls=5, sides=6, **kwargs): print('sysrand', file=sys.stderr) for i in range(suggestions): yield [''.join(map(str, [randint(1...
mit
Python
e4cfd964d593088511506014ca77c71f20126276
Use an enum for methods' usability
LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,expectocode/Telethon
telethon_generator/parsers/methods.py
telethon_generator/parsers/methods.py
import csv import enum class Usability(enum.Enum): UNKNOWN = 0 USER = 1 BOT = 2 BOTH = 4 class MethodInfo: def __init__(self, name, usability, errors): self.name = name self.errors = errors try: self.usability = { 'unknown': Usability.UNKNOWN, ...
import csv class MethodInfo: def __init__(self, name, usability, errors): self.name = name self.usability = usability self.errors = errors def parse_methods(csv_file, errors_dict): """ Parses the input CSV file with columns (method, usability, errors) and yields `MethodInfo` ...
mit
Python
8fce0fca3231302eb926690deedc8f934dc1f0ce
Bump Version
nluedtke/brochat-bot
common.py
common.py
VERSION_YEAR = 2018 VERSION_MONTH = 3 VERSION_DAY = 22 VERSION_REV = 0 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 items_awarded = 0 trump_tweets_seen = ...
VERSION_YEAR = 2018 VERSION_MONTH = 3 VERSION_DAY = 21 VERSION_REV = 0 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 items_awarded = 0 trump_tweets_seen = ...
mit
Python
8c8915639b2343b0e652fbbf8b69dc86eedf4aed
support sending messages to arbitrary users
akrherz/pyWWA,akrherz/pyWWA
common.py
common.py
# Common stuff for the pyWWA ingestors... from twisted.internet import reactor from twisted.words.xish import domish from twisted.python import log from twisted.words.xish.xmlstream import STREAM_END_EVENT from twisted.internet.task import LoopingCall import secret class JabberClient: def __init__(self, myJid):...
# Common stuff for the pyWWA ingestors... from twisted.internet import reactor from twisted.words.xish import domish from twisted.python import log from twisted.words.xish.xmlstream import STREAM_END_EVENT from twisted.internet.task import LoopingCall import secret class JabberClient: def __init__(self, myJid):...
mit
Python
200f4a2089cd4bef7832679cd121a2dbe85d6180
Fix oom_test so that it doesn't try to allocate a giant host buffer when run without --config=cuda. Sadly the best way I could come up with is pretty hacky.
ZhangXinNan/tensorflow,xodus7/tensorflow,Bismarrck/tensorflow,xzturn/tensorflow,Intel-Corporation/tensorflow,Bismarrck/tensorflow,tensorflow/tensorflow,aselle/tensorflow,theflofly/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,kobejean/tensorflow,ppwwyyxx/tensorflow,kobejean/tensorflow,tensorflow/tensorflow-pywra...
tensorflow/compiler/tests/oom_test.py
tensorflow/compiler/tests/oom_test.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
a411d9501beabed1e7611da4db10aa27f001191a
Fix log
koorukuroo/findaconf,koorukuroo/findaconf,cuducos/findaconf,koorukuroo/findaconf,cuducos/findaconf,cuducos/findaconf
findaconf/__init__.py
findaconf/__init__.py
from flask import Flask from flask.ext.assets import Environment from flask.ext.compress import Compress from flask.ext.script import Manager, Server from slimish_jinja import SlimishExtension # add slimish_jinja extension class SlimishApp(Flask): Flask.jinja_options['extensions'].append(SlimishExtension) # init...
from flask import Flask from flask.ext.assets import Environment from flask.ext.compress import Compress from flask.ext.script import Manager, Server from slimish_jinja import SlimishExtension # add slimish_jinja extension class SlimishApp(Flask): Flask.jinja_options['extensions'].append(SlimishExtension) # init...
mit
Python
b2af77862272e10ba6b2ac6a57ac6b1bbfe8c8ed
Fix soundcloud.
bomjacob/VocaBot
constants.py
constants.py
__version__ = "0.1.0" VOCADB_API_ENDPOINT = "http://vocadb.net/api/" OWNER_ID = 95205500 DB_FILE = 'data.sqlite' voca_db_user_agent = 'Telegram-VocaDBBot/{}'.format(__version__) pvServices = ['SoundCloud', 'Youtube', 'NicoNicoDouga', 'Piapro', 'Vimeo', 'Bilibili']
__version__ = "0.1.0" VOCADB_API_ENDPOINT = "http://vocadb.net/api/" OWNER_ID = 95205500 DB_FILE = 'data.sqlite' voca_db_user_agent = 'Telegram-VocaDBBot/{}'.format(__version__) pvServices = ['Soundcloud', 'Youtube', 'NicoNicoDouga', 'Piapro', 'Vimeo', 'Bilibili']
mit
Python
34bad501eb686f2bcc3c0098fdec47ec64f98911
Update rna-calc-inf.py
m4rx9/rna-pdb-tools,m4rx9/rna-pdb-tools
rna_pdb_tools/utils/rna-calc-inf/rna-calc-inf.py
rna_pdb_tools/utils/rna-calc-inf/rna-calc-inf.py
#!/usr/bin/python """ ClaRNA_play required! https://gitlab.genesilico.pl/RNA/ClaRNA_play (internal GS gitlab server) """ import optparse import sys import os import subprocess import re def clarna_run(fn): fn_out = fn + '.outCR' if os.path.isfile(fn_out): pass else: cmd = 'clarna_run.py -...
#!/usr/bin/python import optparse import sys import os import subprocess import re def clarna_run(fn): fn_out = fn + '.outCR' if os.path.isfile(fn_out): pass else: cmd = 'clarna_run.py -ipdb ' + fn + ' > ' + fn_out print cmd os.system(cmd) return fn_out def clarna_comp...
mit
Python
5b65d47adc63e203879dc55bff5a360380adc5e4
return cities light in select language
affan2/django-cities-light,affan2/django-cities-light
cities_light/contrib/autocompletes.py
cities_light/contrib/autocompletes.py
from ..models import Country, Region, City import autocomplete_light class CityAutocomplete(autocomplete_light.AutocompleteModelBase): search_fields = ('search_names',) choices = City.published.get_live_set() def choices_for_request(self): """ Return a queryset based on `choices` using o...
from ..models import Country, Region, City import autocomplete_light class CityAutocomplete(autocomplete_light.AutocompleteModelBase): search_fields = ('search_names',) choices = City.published.get_live_set() def choices_for_request(self): """ Return a queryset based on `choices` using o...
mit
Python
937e2d4d0e394320f697c8d9c647de2a9da2b95a
fix release uri
tony/django-docutils,tony/django-docutils
doc/conf.py
doc/conf.py
# -*- coding: utf-8 -*- import os # Get the project root dir, which is the parent dir of this cwd = os.getcwd() project_root = os.path.dirname(cwd) # package data about = {} with open("../django_docutils/__about__.py") as fp: exec(fp.read(), about) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersp...
# -*- coding: utf-8 -*- import os # Get the project root dir, which is the parent dir of this cwd = os.getcwd() project_root = os.path.dirname(cwd) # package data about = {} with open("../django_docutils/__about__.py") as fp: exec(fp.read(), about) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersp...
mit
Python
ebf4d7ca65779bb7eb9b7329f4b41a9c5c23ff15
Add dt prooperty to Animation
wqferr/AniMathors
core/anim.py
core/anim.py
from math import ceil import matplotlib.pyplot as plt import matplotlib.animation as anim class Animation(object): def __init__(self, *args, **kwargs): self._fig, self._ax = plt.subplots() self._fig.set_facecolor(kwargs.get('facecolor', 'black')) self._ax.set_xlim(*kwargs.get('xlim', (-1,...
from math import ceil import matplotlib.pyplot as plt import matplotlib.animation as anim class Animation(object): def __init__(self, *args, **kwargs): self._fig, self._ax = plt.subplots() self._fig.set_facecolor(kwargs.get('facecolor', 'black')) self._ax.set_xlim(*kwargs.get('xlim', (-1,...
mit
Python
8e76d8781595633c1e4148bbda1d75ed423fc700
Add ability to encode and decode datetimes to our json utility
OmgOhnoes/Flexget,OmgOhnoes/Flexget,cvium/Flexget,Flexget/Flexget,malkavi/Flexget,JorisDeRieck/Flexget,grrr2/Flexget,tarzasai/Flexget,LynxyssCZ/Flexget,gazpachoking/Flexget,ianstalk/Flexget,tobinjt/Flexget,Flexget/Flexget,poulpito/Flexget,lildadou/Flexget,qk4l/Flexget,drwyrm/Flexget,tobinjt/Flexget,antivirtel/Flexget,P...
flexget/utils/json.py
flexget/utils/json.py
""" Helper module that can load whatever version of the json module is available. Plugins can just import the methods from this module. Also allows date and datetime objects to be encoded/decoded. """ from __future__ import unicode_literals, division, absolute_import import datetime from flexget.plugin import Depende...
""" Helper module that can load whatever version of the json module is available. Plugins can just import the methods from this module. """ from __future__ import unicode_literals, division, absolute_import from flexget.plugin import DependencyError try: import simplejson as json except ImportError: try: ...
mit
Python
2a9e892cb1ab8f74cb854db71866b9aa4326a070
add missing import
genome/flow-core,genome/flow-core,genome/flow-core
flow/commands/base.py
flow/commands/base.py
from abc import ABCMeta, abstractmethod import flow.configuration from flow.factories import dictionary_factory import sys import traceback import logging LOG = logging.getLogger() class CommandBase(object): __metaclass__ = ABCMeta default_logging_mode = 'default' @staticmethod def annotate_parser(...
from abc import ABCMeta, abstractmethod import flow.configuration from flow.factories import dictionary_factory import traceback import logging LOG = logging.getLogger() class CommandBase(object): __metaclass__ = ABCMeta default_logging_mode = 'default' @staticmethod def annotate_parser(parser): ...
agpl-3.0
Python
51327aa9a9cdb70f6c251036959eb54e8c97c201
Prepare release: 0.4b16
flux3dp/fluxghost,flux3dp/fluxghost,flux3dp/fluxghost,flux3dp/fluxghost
fluxghost/__init__.py
fluxghost/__init__.py
__version__ = "0.4b16" DEBUG = False
__version__ = "0.4b15" DEBUG = False
agpl-3.0
Python
43107775ed7a3aa8c4c9cd874125d1b2a8c3d643
Update views.py
02agarwalt/FNGS_website,02agarwalt/FNGS_website,ebridge2/FNGS_website,ebridge2/FNGS_website,02agarwalt/FNGS_website,ebridge2/FNGS_website,ebridge2/FNGS_website
fngs/analyze/views.py
fngs/analyze/views.py
from django.http import HttpResponse, Http404 from django.shortcuts import render, get_object_or_404 from django.views import generic from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.core.urlresolvers import reverse_lazy from .models import Submission from .forms import SubmissionFor...
from django.http import HttpResponse, Http404 from django.shortcuts import render, get_object_or_404 from django.views import generic from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.core.urlresolvers import reverse_lazy from .models import Submission from .forms import SubmissionFor...
apache-2.0
Python
4907b4bd6322c3779c4135d2ae6c776dd4e99cdf
change function name
kaduuuken/achievementsystem,kaduuuken/achievementsystem
achievements/validate.py
achievements/validate.py
from django.core.exceptions import ValidationError import settings def validate_max(value): if value >= settings.TROPHY_COUNT: raise ValidationError(u'There are only 0-%s positions' % (settings.TROPHY_COUNT-1))
from django.core.exceptions import ValidationError import settings def validate_max(value): if value > settings.SET_PARAMETER: raise ValidationError(u'There are only 0-%s positions' % settings.SET_PARAMETER)
bsd-2-clause
Python
2853238bec149c38b6722baf1c93dd037bd14913
Fix cmdr run from cmdline
vertexproject/synapse,vertexproject/synapse,vertexproject/synapse
synapse/tools/cmdr.py
synapse/tools/cmdr.py
import sys import logging import synapse.glob as s_glob import synapse.common as s_common import synapse.telepath as s_telepath import synapse.lib.cmdr as s_cmdr logger = logging.getLogger(__name__) async def main(argv): # pragma: no cover if len(argv) != 2: print('usage: python -m synapse.tools.cmdr ...
import sys import asyncio import logging import synapse.common as s_common import synapse.telepath as s_telepath import synapse.lib.cmdr as s_cmdr logger = logging.getLogger(__name__) async def main(argv): # pragma: no cover if len(argv) != 2: print('usage: python -m synapse.tools.cmdr <url>') ...
apache-2.0
Python
a3b108bdb03a74be5156a6b34219758f04b75fe8
Simplify default database setting, but allow it to be overridden
taeram/dynamite,taeram/dynamite
config.py
config.py
from os import getenv class Config(object): API_KEY = getenv('API_KEY') DAEMON_SLEEP_INTERVAL = 6 # hours MAIL_DEBUG = False MAIL_DEFAULT_SENDER = getenv('SENDER_EMAIL', 'dynamite@example.com') MAIL_PASSWORD = getenv('MAILGUN_SMTP_PASSWORD', None) MAIL_PORT = getenv('MAILGUN_SMTP_PORT', 25) ...
from os import getenv class Config(object): API_KEY = getenv('API_KEY') DAEMON_SLEEP_INTERVAL = 6 # hours MAIL_DEBUG = False MAIL_DEFAULT_SENDER = getenv('SENDER_EMAIL', 'dynamite@example.com') MAIL_PASSWORD = getenv('MAILGUN_SMTP_PASSWORD', None) MAIL_PORT = getenv('MAILGUN_SMTP_PORT', 25) ...
mit
Python
a501a8c62c1d25b0478969a1a03fb0e9c8871cca
fix ENV param name error
oxarbitrage/bitshares-python-api-backend
config.py
config.py
import os WEBSOCKET_URL = os.environ.get('WEBSOCKET_URL', "wss://api.bitshares-kibana.info/ws") # Default connection to Elastic Search. ELASTICSEARCH = { 'hosts': os.environ.get('ELASTICSEARCH_URL', 'https://elasticsearch.bitshares-kibana.info/').split(','), 'user': os.environ.get('ELASTICSEARCH_USER', 'B...
import os WEBSOCKET_URL = os.environ.get('WEBSOCKET_URL', "wss://api.bitshares-kibana.info/ws") # Default connection to Elastic Search. ELASTICSEARCH = { 'hosts': os.environ.get('ELASTICSEARCH_URL', 'https://elasticsearch.bitshares-kibana.info/').split(','), 'user': os.environ.get('ELASTICSEARCH_USER', 'B...
mit
Python
378a9d5b21bd71d8c38656caa232f3cd9c246032
Simplify test requirements.
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/modules/rabbitmq.py
tests/integration/modules/rabbitmq.py
# -*- coding: utf-8 -*- # Import python libs import os # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ensure_in_syspath, requires_salt_modules ensure_in_syspath('../../') # Import salt libs import integration @skipIf(os.geteuid() != 0, 'You must be root to run this test'...
# -*- coding: utf-8 -*- # Import python libs import os # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration class RabbitModuleTest(integration.ModuleCase): ''' Validates the rabbitmqctl functions. To run these tes...
apache-2.0
Python
9164ed600758b4753008742fb32bd74d87b1bd6e
Change serializer_class as an empty tuple to None.
24HeuresINSA/pass-checker,spiskommg/mm-v2,24HeuresINSA/pass-checker,spiskommg/mm-v2,Seedstars/django-react-redux-jwt-base,Seedstars/django-react-redux-base,Seedstars/django-react-redux-jwt-base,Seedstars/django-react-redux-base,24HeuresINSA/pass-checker,Seedstars/django-react-redux-base,spiskommg/mm-v2,spiskommg/mm-v2,...
src/accounts/views.py
src/accounts/views.py
from django.shortcuts import get_object_or_404 from django_rest_logger import log from rest_framework import status, parsers, renderers from rest_framework.generics import GenericAPIView from rest_framework.mixins import CreateModelMixin from rest_framework.response import Response from rest_framework.views import APIV...
from django.shortcuts import get_object_or_404 from django_rest_logger import log from rest_framework import status, parsers, renderers from rest_framework.generics import GenericAPIView from rest_framework.mixins import CreateModelMixin from rest_framework.response import Response from rest_framework.views import APIV...
mit
Python
1da2c0e00d43c4fb9a7039e98401d333d387a057
Fix empty search results logic
mociepka/saleor,jreigel/saleor,itbabu/saleor,maferelo/saleor,KenMutemi/saleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,KenMutemi/saleor,tfroehlich82/saleor,jreigel/saleor,KenMutemi/saleor,itbabu/saleor,car3oon/saleor,maferelo/saleor,car3oon/saleor,UITools/saleor,maferelo/saleor,i...
saleor/search/views.py
saleor/search/views.py
from __future__ import unicode_literals from django.core.paginator import Paginator, InvalidPage from django.conf import settings from django.http import Http404 from django.shortcuts import render from .forms import SearchForm from ..product.utils import products_with_details def paginate_results(results, get_data,...
from __future__ import unicode_literals from django.core.paginator import Paginator, InvalidPage from django.conf import settings from django.http import Http404 from django.shortcuts import render from .forms import SearchForm from ..product.utils import products_with_details def paginate_results(results, get_data,...
bsd-3-clause
Python
46e50dd7aab619edfd80480b105149d903afa5b5
use npm phantomjs for tests #5159 (#5161)
stonebig/bokeh,mindriot101/bokeh,ericmjl/bokeh,schoolie/bokeh,DuCorey/bokeh,dennisobrien/bokeh,ericmjl/bokeh,jakirkham/bokeh,rs2/bokeh,bokeh/bokeh,jakirkham/bokeh,mindriot101/bokeh,philippjfr/bokeh,Karel-van-de-Plassche/bokeh,jakirkham/bokeh,rs2/bokeh,schoolie/bokeh,Karel-van-de-Plassche/bokeh,draperjames/bokeh,DuCorey...
tests/plugins/phantomjs_screenshot.py
tests/plugins/phantomjs_screenshot.py
import json import pytest import subprocess import sys from os.path import abspath, dirname, join, pardir, split from .utils import info, fail TOP_PATH = abspath(join(split(__file__)[0], pardir, pardir)) def pytest_addoption(parser): parser.addoption( "--phantomjs", type=str, default=join(TOP_PA...
import json import pytest import subprocess import sys from os.path import join, dirname from .utils import info, fail def pytest_addoption(parser): parser.addoption( "--phantomjs", type=str, default="phantomjs", help="phantomjs executable" ) def get_phantomjs_screenshot(url, screenshot_path, wait,...
bsd-3-clause
Python
d68557f52b69a1a51775ff7b2b61e8b649986152
Fix simple mistake
IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site
tb_website/routers.py
tb_website/routers.py
from django.conf import settings DB = list(settings.DATABASES) class PrivateAppRouter(object): """ Allows an app to have it's own private database if needed """ def db_for_read(self, model, **hints): if model._meta.app_label in DB: return model._meta.app_label db_for_write = db...
from django.conf import settings DB = list(settings.DATABASES) class PrivateAppRouter(object): """ Allows an app to have it's own private database if needed """ db_for_write = db_for_read def db_for_read(self, model, **hints): if model._meta.app_label in DB: return model._meta...
agpl-3.0
Python
1b061569ed5d1591c5e3e9557cd7d17b42fbc388
Update simple.py
ztp99/pyweb,zatuper/pywebstepic,ztp99/pyweb,zatuper/pywebstepic,zatuper/pywebstepic,ztp99/pyweb
etc/simple.py
etc/simple.py
CONFIG = { 'mode': 'wsgi', 'working_dir': '/path/to/my/app', 'python': '/usr/bin/python', 'args': ( '--bind=127.0.0.1:8080', '--workers=16', '--timeout=60', 'app.module', ), } import urlparse spisok='' def application(env, start_response): start_response('200 O...
CONFIG = { 'mode': 'wsgi', 'working_dir': '/path/to/my/app', 'python': '/usr/bin/python', 'args': ( '--bind=127.0.0.1:8080', '--workers=16', '--timeout=60', 'app.module', ), } def application(env, start_response): start_response('200 OK', [('Content-Type', 'text...
apache-2.0
Python
33e26d499c9302131b9d10b9dfb90d22fb0541e1
change the status output
suitai/MyTweetApp,suitai/MyTweetApp,suitai/MyTweetApp
download.py
download.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import sys import getopt import urllib2 def download(url, out_dir, overwrite=False): file_name = url.split('/')[-1] out_dir = os.path.expanduser(out_dir) out_dir = os.path.expandvars(out_dir) out_file = "%s/%s" % (out_dir, file_name) if not o...
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import sys import getopt import urllib2 def download(url, out_dir, overwrite=False): file_name = url.split('/')[-1] out_dir = os.path.expanduser(out_dir) out_dir = os.path.expandvars(out_dir) out_file = "%s/%s" % (out_dir, file_name) if not o...
mit
Python
50e730460fc6853540e3245d20a258883241319e
fix name
tahoe-lafs/perf-tests,tahoe-lafs/perf-tests,tahoe-lafs/perf-tests
download.py
download.py
#! /usr/bin/python import os, sys, json, random, time, requests from gcloud import datastore from rewrite_config import restart_node, wait_for_connections grid_config_id = sys.argv[1] trial_id = sys.argv[2] TAHOE = os.path.expanduser("~/bin/tahoe") BASEDIR = os.path.expanduser("~/.tahoe") EXPECTED_SERVERS = 6 GATEWA...
#! /usr/bin/python import os, sys, json, random, time, requests from gcloud import datastore from rewrite_config import restart_node, wait_for_connections grid_config_id = sys.argv[1] trial_id = sys.argv[2] TAHOE = os.path.expanduser("~/bin/tahoe") BASEDIR = os.path.expanduser("~/.tahoe") EXPECTED_SERVERS = 6 GATEWA...
mit
Python
97a57c0604c9c6b7bea43668a50f7331b909807e
Fix # 457 (#469)
lanpa/tensorboardX,lanpa/tensorboardX
tensorboardX/x2num.py
tensorboardX/x2num.py
# DO NOT alter/distruct/free input object ! from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import numpy as np import six def check_nan(array): tmp = np.sum(array) if np.isnan(tmp) or np.isinf(tmp): logging.warning('NaN or In...
# DO NOT alter/distruct/free input object ! from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import six def check_nan(array): tmp = np.sum(array) if np.isnan(tmp) or np.isinf(tmp): print('Warning: NaN or Inf found in input...
mit
Python
594f535f97e2eaed9723c4e1d49d00d303b9fc1a
Fix label formatting
WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick,pombredanne/pyahocorasick,pombredanne/pyahocorasick,WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick
dump2dot.py
dump2dot.py
""" Aho-Corasick string search algorithm. Author : Wojciech Muła, wojciech_mula@poczta.onet.pl WWW : http://0x80.pl License : public domain """ import ahocorasick import os from ahocorasick import EMPTY, TRIE, AHOCORASICK; def dump2dot(automaton, file): def writeln(text=""): file.write(text + "\...
""" Aho-Corasick string search algorithm. Author : Wojciech Muła, wojciech_mula@poczta.onet.pl WWW : http://0x80.pl License : public domain """ import ahocorasick import os from ahocorasick import EMPTY, TRIE, AHOCORASICK; def dump2dot(automaton, file): def writeln(text=""): file.write(text + "\...
bsd-3-clause
Python
732d4ccb53d2aa89ae998a04a0909f9f71bf6fe0
Fix flake8 and isort errors
saltyrtc/saltyrtc-server-python,saltyrtc/saltyrtc-server-python
saltyrtc/bin/server.py
saltyrtc/bin/server.py
""" The command line interface for the SaltyRTC signalling server. """ import os import click from saltyrtc import __version__ as _version from saltyrtc import server # noqa from saltyrtc import ( aio_serve, enable_logging, ) @click.group() @click.pass_context def cli(ctx): """ Command Line Interfa...
""" The command line interface for the SaltyRTC signalling server. """ import click import os from saltyrtc import __version__ as _version from saltyrtc import server, util from saltyrtc.util import aio_serve @click.group() @click.pass_context def cli(ctx): """ Command Line Interface. Use --help for details....
mit
Python
540a7c25e6fdae3cb0211725481c073224f5b776
Remove omniauth from fabulous file
Woffendm/it_service_inventory,Woffendm/it_service_inventory,Woffendm/it_service_inventory
fabric/app.py
fabric/app.py
from __future__ import with_statement from fabric.api import * from time import localtime, strftime from fabric.colors import green, red from fabric.contrib.console import confirm, prompt # # This file is used to include specific functions for settings # that cannot be included within the general fabric script. # It s...
from __future__ import with_statement from fabric.api import * from time import localtime, strftime from fabric.colors import green, red from fabric.contrib.console import confirm, prompt # # This file is used to include specific functions for settings # that cannot be included within the general fabric script. # It s...
mit
Python
6c9b0b0c7e78524ea889f8a89c2eba8acb57f782
Fix stereotype icon in namespace view
amolenaar/gaphor,amolenaar/gaphor
gaphor/ui/iconname.py
gaphor/ui/iconname.py
""" With `get_icon_name` you can retrieve an icon name for a UML model element. """ from gaphor import UML import re from functools import singledispatch TO_KEBAB = re.compile(r"([a-z])([A-Z]+)") def to_kebab_case(s): return TO_KEBAB.sub("\\1-\\2", s).lower() @singledispatch def get_icon_name(element): "...
""" With `get_icon_name` you can retrieve an icon name for a UML model element. """ from gaphor import UML import re from functools import singledispatch TO_KEBAB = re.compile(r"([a-z])([A-Z]+)") def to_kebab_case(s): return TO_KEBAB.sub("\\1-\\2", s).lower() @singledispatch def get_icon_name(element): "...
lgpl-2.1
Python