commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
ca8dec97321fdf2ceee459b95c3d885edebca15b | Bump DeletionWatcher up to 20 minutes | deletionwatcher.py | deletionwatcher.py | import json
import requests
import time
import websocket
from bs4 import BeautifulSoup
from threading import Thread
from metasmoke import Metasmoke
from globalvars import GlobalVars
from datahandling import is_false_positive, is_ignored_post, get_post_site_id_link
class DeletionWatcher:
@classmethod
def updat... | import json
import requests
import time
import websocket
from bs4 import BeautifulSoup
from threading import Thread
from metasmoke import Metasmoke
from globalvars import GlobalVars
from datahandling import is_false_positive, is_ignored_post, get_post_site_id_link
class DeletionWatcher:
@classmethod
def updat... | Python | 0 |
a492e805fa51940d746a1d251232bc4f13417165 | fix waftools/man.py to install manpages again. | waftools/man.py | waftools/man.py | import Common, Object, Utils, Node, Params
import sys, os
import gzip
from misc import copyobj
def gzip_func(task):
env = task.m_env
infile = task.m_inputs[0].abspath(env)
outfile = task.m_outputs[0].abspath(env)
input = open(infile, 'r')
output = gzip.GzipFile(outfile, mode='w')
output.write(... | import Common, Object, Utils, Node, Params
import sys, os
import gzip
from misc import copyobj
def gzip_func(task):
env = task.m_env
infile = task.m_inputs[0].abspath(env)
outfile = task.m_outputs[0].abspath(env)
input = open(infile, 'r')
output = gzip.GzipFile(outfile, mode='w')
output.write(... | Python | 0 |
f6648a0206258e911c0fe4c9c8d0b8cd1334d119 | Test also what it returns from the api_translate view | appcomposer/tests/translator/test_sync.py | appcomposer/tests/translator/test_sync.py | import json
from flask import request
from mock import patch
from appcomposer.login import graasp_oauth_login_redirect
from appcomposer.tests.translator.fake_requests import create_requests_mock
from appcomposer.tests.utils import ComposerTest
from appcomposer.translator.tasks import synchronize_apps_no_cache_wrapper
f... | import json
from mock import patch
from appcomposer.login import graasp_oauth_login_redirect
from appcomposer.tests.translator.fake_requests import create_requests_mock
from appcomposer.tests.utils import ComposerTest
from appcomposer.translator.tasks import synchronize_apps_no_cache_wrapper
from appcomposer.translator... | Python | 0 |
89c1b58da23cfe16e8e195c61313b818a6d5f890 | Add persist.py | darwin/persist.py | darwin/persist.py |
import joblib
from .version import __version__, VERSION
class PersistenceMixin(object):
"""
Mixin that adds joblib persistence load and save function to any class.
"""
@classmethod
def from_file(cls, objdump_path):
'''
Parameters
----------
objdump_path: str
... |
import joblib
from .version import __version__, VERSION
class PersistenceMixin(object):
"""
Mixin that adds joblib persistence load and save function to any class.
"""
@classmethod
def from_file(cls, objdump_path):
'''
Parameters
----------
objdump_path: str
... | Python | 0.000001 |
735a52b8ad4ebf7b6b8bb47e14667cd9004e624b | add some mappings | algo/lru.py | algo/lru.py | mapping = {}
class Node:
def __init__(self, val):
self.next = None
self.prev = None
self.value = val
class DoublyLinkedList:
def __init__(self):
self.head = None
def insert(self, val):
node = Node(val)
mapping[val] = node
head = self.hea... | class Node:
def __init__(self, val):
self.next = None
self.prev = None
self.value = val
class DoublyLinkedList:
def __init__(self):
self.head = None
def insert(self, val):
node = Node(val)
head = self.head
if self.head == None:
self.head... | Python | 0.000011 |
6bb58e13b657c1546f4f5d1afa70d48a9187f168 | Update server.py | gprs/server.py | gprs/server.py | from socket import *
from modules import decode_packet
import sys
from modules import params
Parser = params.Parser()
argv = Parser.createParser()
ip_and_port = argv.parse_args(sys.argv[1:])
#host = ip_and_port.ip
#port = int(ip_and_port.port)
host = "0.0.0.0"
port = 5100
addr = (host, port)
print(host,port)
tcp_socke... | from socket import *
from modules import decode_packet
import sys
from modules import params
Parser = params.Parser()
argv = Parser.createParser()
ip_and_port = argv.parse_args(sys.argv[1:])
#host = ip_and_port.ip
#port = int(ip_and_port.port)
host = "0.0.0.0"
port = 5300
addr = (host, port)
print(host,port)
tcp_socke... | Python | 0.000001 |
9e5b42fa14b50d91840a67646ed6779d8f5c22ae | Make ``cursor_kinds`` private | bears/c_languages/ClangComplexityBear.py | bears/c_languages/ClangComplexityBear.py | from clang.cindex import Index, CursorKind
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.SourceRange import SourceRange
from bears.c_languages.ClangBear import clang_available, ClangBear
class ClangComplexityBear(LocalBear):
"""
Calculates cyclomati... | from clang.cindex import Index, CursorKind
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.SourceRange import SourceRange
from bears.c_languages.ClangBear import clang_available, ClangBear
class ClangComplexityBear(LocalBear):
"""
Calculates cyclomati... | Python | 0 |
22952f57c33070f83c4e9c38b2a96543ed983f4e | Make ndb_persistence execute Context's complete event | furious/extras/appengine/ndb_persistence.py | furious/extras/appengine/ndb_persistence.py | #
# Copyright 2014 WebFilings, 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 2014 WebFilings, 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... | Python | 0.000009 |
d428f6df195c0293340089b884b934fa16ef7ff6 | Use local timezone if available. Fixes #3 | wanikani/cli.py | wanikani/cli.py | import argparse
import logging
import os
# If the tzlocal package is installed, then we will help the user out
# and print things out in the local timezone
LOCAL_TIMEZONE = None
try:
import tzlocal
LOCAL_TIMEZONE = tzlocal.get_localzone()
except ImportError:
pass
from wanikani.core import WaniKani, Radica... | import argparse
import logging
import os
from wanikani.core import WaniKani, Radical, Kanji, Vocabulary
CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.wanikani')
logger = logging.getLogger(__name__)
def config():
if os.path.exists(CONFIG_PATH):
logger.debug('Loading config from %s', CONFIG_PATH)... | Python | 0.000001 |
b53bee8978c6fe407fce7769e16ac4991e36fcda | Return unknown status if geolocation API is unavailable | client/plugins/geolocation.py | client/plugins/geolocation.py | #!/usr/bin/env python3
import pickle
import json
import os
import re
import requests
import subprocess
import sys
from qlmdm import top_dir, var_dir
from qlmdm.client import get_setting
cache_file = os.path.join(var_dir, 'geolocation.cache')
os.chdir(top_dir)
def unknown():
print(json.dumps('unknown'))
sy... | #!/usr/bin/env python3
import pickle
import json
import os
import re
import requests
import subprocess
import sys
from qlmdm import top_dir, var_dir
from qlmdm.client import get_setting
cache_file = os.path.join(var_dir, 'geolocation.cache')
os.chdir(top_dir)
def unknown():
print(json.dumps('unknown'))
sy... | Python | 0.000002 |
85775847e93b35ac19e09962bc2b10f9be666e33 | Update analysis.py with new finallist.py method | analysis.py | analysis.py | import random
import linecache
from unidecode import unidecode
# Process links into list
finallist = [None] * 5716809
with open('links-simple-sorted.txt', 'r') as src:
for line in src:
[oNode, dNode] = line.split(':')
finallist[int(oNode)] = dNode.rstrip('\n')[1:]
# ACTUALLY: pick a random line in links-sorted, ... | import random
import linecache
from unidecode import unidecode
# ACTUALLY: pick a random line in links-sorted, and translate the numbers from there
# Get a random node, and pull that line from the links doc––want this to be an option
# Pull from links because some titles don't have link lines
lineno = random.randint(... | Python | 0 |
6a3f0ade1d8fe16eeda6d339220b7ef877b402e5 | Add no-break options | LFI.TESTER.py | LFI.TESTER.py | '''
@KaiyiZhang Github
'''
import sys
import urllib2
import getopt
import time
target = ''
depth = 6
file = 'etc/passwd'
html = ''
prefix = ''
url = ''
keyword = 'root'
force = False
def usage():
print "LFI.Tester.py Help:"
print "Usage: LFI.TESTER.py -t [-d] [-f] [-k]"
print " -t,--target The test url"
prin... | '''
@KaiyiZhang Github
'''
import sys
import urllib2
import getopt
import time
target = ''
depth = 6
file = 'etc/passwd'
html = ''
prefix = ''
url = ''
keyword='root'
def usage():
print "LFI.Tester.py Help:"
print "Usage: LFI.TESTER.py -t [-d] [-f] [-k]"
print " -t,--target The test url"
print " -d,--depth ... | Python | 0.998376 |
68c0c054e5b9874f8a6423c35fb83c9de351b9e0 | fix doc build | examples/plot_benktander.py | examples/plot_benktander.py | """
====================================================================
Benktander: Relationship between Chainladder and BornhuetterFerguson
====================================================================
This example demonstrates the relationship between the Chainladder and
BornhuetterFerguson methods by way fo... | """
====================================================================
Benktander: Relationship between Chainladder and BornhuetterFerguson
====================================================================
This example demonstrates the relationship between the Chainladder and
BornhuetterFerguson methods by way fo... | Python | 0 |
15307ebe2c19c1a3983b0894152ba81fdde34619 | Add comment on dist of first function | exp/descriptivestats.py | exp/descriptivestats.py | import pandas
import numpy
import matplotlib.pyplot as plt
def univariate_stats():
# Generate 1000 random numbers from a normal distribution
num_examples = 1000
z = pandas.Series(numpy.random.randn(num_examples))
# Minimum
print(z.min())
# Maximum
print(z.max())
# Mean
print(z.mea... | import pandas
import numpy
import matplotlib.pyplot as plt
def univariate_stats():
num_examples = 1000
z = pandas.Series(numpy.random.randn(num_examples))
# Minimum
print(z.min())
# Maximum
print(z.max())
# Mean
print(z.mean())
# Median
print(z.median())
# Variance
pri... | Python | 0 |
7ff6a0dc3a4f6f1ed47f999340f25fe3d5546bd4 | fix command order in shell help test | tests/ps_schedstatistics/tests/01-run.py | tests/ps_schedstatistics/tests/01-run.py | #!/usr/bin/env python3
# Copyright (C) 2017 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
PS_EXPECTED = (
(r'\tpid | name | state... | #!/usr/bin/env python3
# Copyright (C) 2017 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
PS_EXPECTED = (
(r'\tpid | name | state... | Python | 0.000001 |
9af7c8bfc22a250ce848d50ca26877e177f767c1 | Fix execution on Monday | management.py | management.py | from logging import _nameToLevel as nameToLevel
from argparse import ArgumentParser
from Common.emailer import Emailer
from DesksReminder.reminders import HelpDeskTechReminder, HelpDeskLabReminder, HelpDeskOtherReminder, \
UrgentDeskReminder, AccountsDeskReminder
from HelpDesk.synchr... | from logging import _nameToLevel as nameToLevel
from argparse import ArgumentParser
from Common.emailer import Emailer
from DesksReminder.reminders import HelpDeskTechReminder, HelpDeskLabReminder, HelpDeskOtherReminder, \
UrgentDeskReminder, AccountsDeskReminder
from HelpDesk.synchr... | Python | 0.000047 |
c67a32e731037143baf44841bc7e5a8b5e14473c | Add Reverse Method and Initialize an array from an list | LinkedList.py | LinkedList.py | class Node(object):
def __init__(self, data=None, next_node=None):
self.data = data
self.next = next_node
class LinkedList(object):
#default constructor
def __init__(self,array=None):
self.head=None
self.length=0
if(array!=None):
self.initArray(array)
#constructor with list a... | class Node(object):
def __init__(self, data=None, next_node=None):
self.data = data
self.next = next_node
class LinkedList(object):
def __init__(self):
self.head=None
self.length=0
def prepend(self, data):
self.head=Node(data,self.head)
self.length+=1
def append(self, data):
temp... | Python | 0.000001 |
ecd2821a99dee895f3ab7c5dbcc6d86983268560 | Update src url for dev in views | __init__.py | __init__.py | from flask import Flask, request, redirect, url_for
from twilio.rest import TwilioRestClient
from PIL import Image, ImageDraw, ImageFont
import time
app = Flask(__name__, static_folder='static', static_url_path='')
client = TwilioRestClient(
account='ACb01b4d6edfb1b41a8b80f5fed2c19d1a',
token='97e6b9c0074b27... | from flask import Flask, request, redirect, url_for
from twilio.rest import TwilioRestClient
from PIL import Image, ImageDraw, ImageFont
import time
app = Flask(__name__, static_folder='static', static_url_path='')
client = TwilioRestClient(
account='ACb01b4d6edfb1b41a8b80f5fed2c19d1a',
token='97e6b9c0074b27... | Python | 0 |
598bb39414825ff8ab561babb470b85f06c58020 | Update __init__.py | __init__.py | __init__.py | from mlpack.linear_regression import linear_regression
from mlpack.logistic_regression import logistic_regression
"""
MlPack
======
Provides
1. A Variety of Machine learning packages
2. Good and Easy hand written programs with good documentation
3. Linear Regression, Logistic Regression
Available subpackages
... | from mlpack import linear_regression
from mlpack import logistic_regression
"""
MlPack
======
Provides
1. A Variety of Machine learning packages
2. Good and Easy hand written programs with good documentation
3. Linear Regression, Logistic Regression
Available subpackages
---------------------
1. Linear Regr... | Python | 0 |
7875c6b4848e7c30a6d5a53c2b3c01d7aba5fa65 | improve voting results test | scraper/test.py | scraper/test.py | from django.test import TestCase
import scraper.documents
import scraper.votings
# metadata = scraper.documents.get_metadata(document_id='kst-33885-7')
# print(metadata)
# page_url = 'https://zoek.officielebekendmakingen.nl/kst-33885-7.html?zoekcriteria=%3fzkt%3dEenvoudig%26pst%3d%26vrt%3d33885%26zkd%3dInDeGeheleTex... | from django.test import TestCase
import scraper.documents
import scraper.votings
# metadata = scraper.documents.get_metadata(document_id='kst-33885-7')
# print(metadata)
# page_url = 'https://zoek.officielebekendmakingen.nl/kst-33885-7.html?zoekcriteria=%3fzkt%3dEenvoudig%26pst%3d%26vrt%3d33885%26zkd%3dInDeGeheleTex... | Python | 0.000003 |
b8d0344f0ca5c906e43d4071bc27a8d2acf114d1 | bump version | webmpris/__init__.py | webmpris/__init__.py | __version__ = '1.1'
__description__ = 'REST API to control media players via MPRIS2 interfaces'
requires = [
'pympris'
]
README = """webmpris is a REST API
to control media players via MPRIS2 interfaces.
Supported intefaces:
org.mpris.MediaPlayer2 via /players/<id>/Root
org.mpris.MediaPlayer2.Player ... | __version__ = '1.0'
__description__ = 'REST API to control media players via MPRIS2 interfaces'
requires = [
'pympris'
]
README = """webmpris is a REST API
to control media players via MPRIS2 interfaces.
Supported intefaces:
org.mpris.MediaPlayer2 via /players/<id>/Root
org.mpris.MediaPlayer2.Player ... | Python | 0 |
9acf7857167bb87438c7c0bebca1a7eda93ac23b | Make saml2idp compatible with Django 1.9 | saml2idp/registry.py | saml2idp/registry.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
Registers and loads Processor classes from settings.
"""
import logging
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from . import exceptions
from . import saml2idp_metadata
logger = logging.getLogger(... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
Registers and loads Processor classes from settings.
"""
# Python imports
import logging
# Django imports
from django.utils.importlib import import_module
from django.core.exceptions import ImproperlyConfigured
# Local imports
from . import exceptions
f... | Python | 0 |
b8cd1b6869651cd0cbe2cbeebc59c641f13e0e5b | Add todo for scopes permissions | polyaxon/scopes/permissions/scopes.py | polyaxon/scopes/permissions/scopes.py | from scopes.authentication.ephemeral import is_ephemeral_user
from scopes.authentication.internal import is_internal_user
from scopes.permissions.base import PolyaxonPermission
class ScopesPermission(PolyaxonPermission):
"""
Scopes based Permissions, depends on the authentication backend.
"""
ENTITY =... | from scopes.authentication.ephemeral import is_ephemeral_user
from scopes.authentication.internal import is_internal_user
from scopes.permissions.base import PolyaxonPermission
class ScopesPermission(PolyaxonPermission):
"""
Scopes based Permissions, depends on the authentication backend.
"""
ENTITY =... | Python | 0 |
ebacfc3ffe1cd1c9c58908c1f9dd78fe9eca9acd | fix for lambton not needed | ca_on_lambton/people.py | ca_on_lambton/people.py | from pupa.scrape import Scraper
from utils import lxmlize, CanadianLegislator as Legislator
import re
COUNCIL_PAGE = 'http://www.lambtononline.ca/home/government/accessingcountycouncil/countycouncillors/Pages/default.aspx'
class LambtonPersonScraper(Scraper):
def get_people(self):
page = lxmlize(COUNCIL_PAGE... | from pupa.scrape import Scraper
from utils import lxmlize, CanadianLegislator as Legislator
import re
COUNCIL_PAGE = 'http://www.lambtononline.ca/home/government/accessingcountycouncil/countycouncillors/Pages/default.aspx'
SGC = {
'St. Clair' : '3538003',
'Dawn-Euphemia' : '3538007',
'Brooke-Alvinst... | Python | 0 |
c202a3a945453a4955f0acbf369227f8c9cee148 | Rename link in init | __init__.py | __init__.py | import os
from .batchflow import *
__path__ = [os.path.join(os.path.dirname(__file__), 'batchflow')]
| import os
from .dataset import *
__path__ = [os.path.join(os.path.dirname(__file__), 'dataset')]
| Python | 0 |
4a4731eda22170a77bb24dd3c7fc8ff4cafecf9d | bump version to 2.7b1 | __init__.py | __init__.py | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
__revision__ = "$Id$"
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "2.7b1"
#-... | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
__revision__ = "$Id$"
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "2.7a4"
#-... | Python | 0 |
bc43827ee733af9c37ca3b97b471ec1d2cde294b | Add unsubcribed handler to server. | echidna/server.py | echidna/server.py | import json
from cyclone.web import Application, RequestHandler, HTTPError
from cyclone.websocket import WebSocketHandler
from echidna.cards.memory_store import InMemoryCardStore
class EchidnaServer(Application):
def __init__(self, root, **settings):
self.store = InMemoryCardStore()
handlers = [... | import json
from cyclone.web import Application, RequestHandler, HTTPError
from cyclone.websocket import WebSocketHandler
from echidna.cards.memory_store import InMemoryCardStore
class EchidnaServer(Application):
def __init__(self, root, **settings):
self.store = InMemoryCardStore()
handlers = [... | Python | 0 |
86eb16da4a6c3579eb514fa5ca73def7be8afd84 | Add noqa codestyle | geotrek/api/v2/views/__init__.py | geotrek/api/v2/views/__init__.py | from rest_framework import response, permissions
from rest_framework.views import APIView
from django.conf import settings
from django.contrib.gis.geos import Polygon
from .authent import StructureViewSet # noqa
from .common import TargetPortalViewSet, ThemeViewSet, SourceViewSet, ReservationSystemViewSet, LabelViewS... | from rest_framework import response, permissions
from rest_framework.views import APIView
from django.conf import settings
from django.contrib.gis.geos import Polygon
from .authent import StructureViewSet # noqa
from .common import TargetPortalViewSet, ThemeViewSet, SourceViewSet, ReservationSystemViewSet, LabelViewS... | Python | 0 |
dded8beb4a075dfc44938d5355727cc4058ba80b | Fix typo | athenet/data_loader/data_loader_buffer.py | athenet/data_loader/data_loader_buffer.py | """Buffer for storing large network data."""
import numpy as np
import theano
class Buffer(object):
"""Buffer storing data from contiguous subsequence of minibatches.
Content of a buffer is a 4-dimensional floating-point tensor.
"""
def __init__(self, data_loader=None):
"""Create data Buffe... | """Buffer for storing large network data."""
import numpy as np
import theano
class Buffer(object):
"""Buffer storing data from contiguous subsequence of minibatches.
Content of a buffer is a 4-dimensional floating-point tensor.
"""
def __init__(self, data_loader=None):
"""Create data Buffe... | Python | 0.999999 |
a962f1e0aced277e673eddc6b70e316bba482f24 | fix typo | api/mail.py | api/mail.py | from flask import Flask, render_template
from api import app
from api.models import User, Invites, Reset
from flask_mail import Mail
from flask_mail import Message
app.config.update(
MAIL_SERVER = 'smtp.yandex.com',
MAIL_PORT = 465,
MAIL_USE_SSL = True ,
MAIL_USERNAME = 'cross-apps@yandex.com',
... | from flask import Flask, render_template
from api import app
from api.models import User, Invites, Reset
from flask_mail import Mail
from flask_mail import Message
app.config.update(
MAIL_SERVER = 'smtp.yandex.com',
MAIL_PORT = 465,
MAIL_USE_SSL = True ,
MAIL_USERNAME = 'cross-apps@yandex.com',
... | Python | 0.998939 |
f9a1da6e60bfbd9c9e5be769f1223d628cec6481 | set the module version | base_external_referentials/__openerp__.py | base_external_referentials/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Akretion (<http://www.akretion.com>). All Rights Reserved
# authors: Raphaël Valyi, Sharoon Thomas
#
# This program is free software: you... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Akretion (<http://www.akretion.com>). All Rights Reserved
# authors: Raphaël Valyi, Sharoon Thomas
#
# This program is free software: you... | Python | 0 |
6eeb2b4f79c2f735552cf7c061b48425d3299e51 | Use argparse. | validate_equajson.py | validate_equajson.py | #! /usr/bin/env python3
import json
import jsonschema
import sys
import os
import argparse
def main(equajson_path, schema_path):
global filepath
filepath = equajson_path
with open(schema_path) as schema_file:
try:
equajson_schema = json.load(schema_file)
except:
... | #! /usr/bin/env python3
import json
import jsonschema
import sys
import os
def main(equajson_path, schema_path):
global filepath
filepath = equajson_path
with open(schema_path) as schema_file:
try:
equajson_schema = json.load(schema_file)
except:
s... | Python | 0.000001 |
5ecd20d86a0fe2586cbac4daadd34bb13443f94d | set central prototype executable | central/CentralProto.py | central/CentralProto.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
from app.nrf24 import NRF24
from app.cipher import XTEA
from app.message import MessageType
# RF Communication constants
NETWORK = 0xC05A
SERVER_ID = 0x01
# Hardware constants
CE_PIN = 25
# Timing constants
PERIOD_REFRESH_KEY_SECS = 120.0
CODE = '123456'
#TODO... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
from app.nrf24 import NRF24
from app.cipher import XTEA
from app.message import MessageType
# RF Communication constants
NETWORK = 0xC05A
SERVER_ID = 0x01
# Hardware constants
CE_PIN = 25
# Timing constants
PERIOD_REFRESH_KEY_SECS = 120.0
CODE = '123456'
#TODO... | Python | 0.000001 |
e6cb1617e588d6b276fe01c401f2c1b34cf88d5f | fix stuff | api/read.py | api/read.py | import datetime
from django.http import JsonResponse
from dateutil.parser import parse
from django.contrib.auth.decorators import login_required
from api.models import ( Applicant, Client, Disabilities, EmploymentEducation,
Enrollment, HealthAndDV, IncomeBenefits, Services )
def get_applicants(request):
appli... | import datetime
from django.http import JsonResponse
from dateutil.parser import parse
from django.contrib.auth.decorators import login_required
from api.models import ( Applicant, Client, Disabilities, EmploymentEducation,
Enrollment, HealthAndDV, IncomeBenefits, Services )
def get_applicants(request):
appli... | Python | 0.000002 |
ae7b583cab8d38b04ce57571f50221b4a2e429f6 | Update base.py | webhook/base.py | webhook/base.py | """
Base webhook implementation
"""
import json
from django.http import HttpResponse
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
class WebhookBase(View):
"""
Simple Webhook base class to handle the most stand... | """
Base webhook implementation
"""
import json
from django.http import HttpResponse
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
class WebhookBase(View):
"""
Simple Webhook base class to handle the most stand... | Python | 0.000001 |
46b860e93d8a9e8dda3499b7306e30ebcd0e0174 | handle session stopped | webnotes/app.py | webnotes/app.py | import sys, os
import json
sys.path.insert(0, '.')
sys.path.insert(0, 'app')
sys.path.insert(0, 'lib')
from werkzeug.wrappers import Request, Response
from werkzeug.local import LocalManager
from webnotes.middlewares import StaticDataMiddleware
from werkzeug.exceptions import HTTPException
from werkzeug.contrib.profi... | import sys, os
import json
sys.path.insert(0, '.')
sys.path.insert(0, 'app')
sys.path.insert(0, 'lib')
from werkzeug.wrappers import Request, Response
from werkzeug.local import LocalManager
from webnotes.middlewares import StaticDataMiddleware
from werkzeug.exceptions import HTTPException
from werkzeug.contrib.profi... | Python | 0 |
e38fa3f55b0e60a1d6c7fa0cf194e6f3bd4b899d | add histogram util | corehq/util/datadog/gauges.py | corehq/util/datadog/gauges.py | from functools import wraps
from celery.task import periodic_task
from corehq.util.datadog import statsd, datadog_logger
from corehq.util.soft_assert import soft_assert
def datadog_gauge_task(name, fn, run_every, enforce_prefix='commcare'):
"""
helper for easily registering datadog gauges to run periodically
... | from functools import wraps
from celery.task import periodic_task
from corehq.util.datadog import statsd, datadog_logger
from corehq.util.soft_assert import soft_assert
def datadog_gauge_task(name, fn, run_every, enforce_prefix='commcare'):
"""
helper for easily registering datadog gauges to run periodically
... | Python | 0.000786 |
3643f0ce1b7ea7982e8081ae29e726c73471cc4b | update description | vcspull/__about__.py | vcspull/__about__.py | __title__ = 'vcspull'
__package_name__ = 'vcspull'
__description__ = 'synchronize your repos'
__version__ = '1.0.0'
__author__ = 'Tony Narlock'
__email__ = 'tony@git-pull.com'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2016 Tony Narlock'
| __title__ = 'vcspull'
__package_name__ = 'vcspull'
__description__ = 'vcs project manager'
__version__ = '1.0.0'
__author__ = 'Tony Narlock'
__email__ = 'tony@git-pull.com'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2016 Tony Narlock'
| Python | 0.000001 |
42561d709a2ecfee71103dfbb55116cec1128b71 | fix redirect after upload | website/apps/home/views/UploadView.py | website/apps/home/views/UploadView.py | #!/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet Zika modeling interface.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/zika
#
# This Source Code Form is... | #!/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet Zika modeling interface.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/zika
#
# This Source Code Form is... | Python | 0 |
c9a915692b30458717ead2f83fce77ce295e5ed9 | add recipe_folder member (#10527) | conans/pylint_plugin.py | conans/pylint_plugin.py | """Pylint plugin for ConanFile"""
import astroid
from astroid import MANAGER
def register(linter):
"""Declare package as plugin
This function needs to be declared so astroid treats
current file as a plugin.
"""
pass
def transform_conanfile(node):
"""Transform definition of ConanFile class s... | """Pylint plugin for ConanFile"""
import astroid
from astroid import MANAGER
def register(linter):
"""Declare package as plugin
This function needs to be declared so astroid treats
current file as a plugin.
"""
pass
def transform_conanfile(node):
"""Transform definition of ConanFile class s... | Python | 0 |
4b5ae262bab0bc0c83555d39400049f20aaca9cd | Add CONVERSATION_LABEL_MAX_LENGTH constant | chatterbot/constants.py | chatterbot/constants.py | """
ChatterBot constants
"""
'''
The maximum length of characters that the text of a statement can contain.
This should be enforced on a per-model basis by the data model for each
storage adapter.
'''
STATEMENT_TEXT_MAX_LENGTH = 400
'''
The maximum length of characters that the text label of a conversation can contai... | """
ChatterBot constants
"""
'''
The maximum length of characters that the text of a statement can contain.
This should be enforced on a per-model basis by the data model for each
storage adapter.
'''
STATEMENT_TEXT_MAX_LENGTH = 400
# The maximum length of characters that the name of a tag can contain
TAG_NAME_MAX_LE... | Python | 0.999974 |
7a1e57fa5c6d2c6330a73e8fab95c5ef6fa0ea35 | Fix indentation | tomviz/python/SetNegativeVoxelsToZero.py | tomviz/python/SetNegativeVoxelsToZero.py | def transform_scalars(dataset):
"""Set negative voxels to zero"""
from tomviz import utils
import numpy as np
data = utils.get_array(dataset)
data[data<0] = 0 #set negative voxels to zero
# set the result as the new scalars.
utils.set_array(dataset, data) | def transform_scalars(dataset):
"""Set negative voxels to zero"""
from tomviz import utils
import numpy as np
data = utils.get_array(dataset)
data[data<0] = 0 #set negative voxels to zero
# set the result as the new scalars.
utils.set_array(dataset, data)
| Python | 0.017244 |
e504ef393f9f11d243fed88b2e4acc1566ea912c | Delete unread messages | scripts/read.py | scripts/read.py | import time
import cache
import vkapi
from log import datetime_format
def main(a, args):
dialogs = a.messages.getDialogs(unread=1)['items']
messages = {}
users = []
chats = []
for msg in dialogs:
def cb(req, resp):
messages[req['peer_id']] = resp['items'][::-1]
a.messa... | import time
import cache
import vkapi
from log import datetime_format
def main(a, args):
dialogs = a.messages.getDialogs(unread=1)['items']
messages = {}
users = []
chats = []
for msg in dialogs:
def cb(req, resp):
messages[req['peer_id']] = resp['items'][::-1]
a.messa... | Python | 0.000015 |
46e2997cb51e45dc58f5a97cea6642ba64d03188 | Fix 9.0 version | purchase_all_shipments/__openerp__.py | purchase_all_shipments/__openerp__.py | # Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | # Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | Python | 0 |
5aca45a68a229f43a25dd97d2c680716c9baabf5 | add travis env to sgen | scripts/sgen.py | scripts/sgen.py | #!/usr/bin/python
# Generate original static file to another with new prefix
# ./sgen index.html old_prefix static_index.html new_prefix
import sys
from os import walk, path, environ
# File lists
# The two file lists should be aligned.
root = environ['TRAVIS_BUILD_DIR']
files = []
for (dirpath, dirname, filenames)... | #!/usr/bin/python
# Generate original static file to another with new prefix
# ./sgen index.html old_prefix static_index.html new_prefix
import sys
from os import walk, path
# File lists
# The two file lists should be aligned.
files = []
for (dirpath, dirname, filenames) in walk("../static"):
for f in filename... | Python | 0 |
24cebbd351875103067162733cf682320df29cf6 | Update VMfileconvert_V2.py | pyecog/light_code/VMfileconvert_V2.py | pyecog/light_code/VMfileconvert_V2.py | import glob, os, numpy, sys
try:
import stfio
except:
sys.path.append('C:\Python27\Lib\site-packages')
import stfio
def main():
searchpath = os.getcwd()
exportdirectory = searchpath+'/ConvertedFiles/'
# Make export directory
if not os.path.exists(exportdirectory):
os.mak... | import glob, os, numpy
import stfio
def main():
searchpath = os.getcwd()
exportdirectory = searchpath+'/ConvertedFiles/'
# Make export directory
if not os.path.exists(exportdirectory):
os.makedirs(exportdirectory)
# Walk through and find abf files
pattern = '*.a... | Python | 0 |
52cbd272ec08a382b4f16dca1579a3ef72365069 | use numpy mean | examples/train_multi_gpu.py | examples/train_multi_gpu.py | '''
Created on Feb 6, 2017
@author: julien
'''
import numpy
from os.path import join
import tempfile
from keras.metrics import categorical_accuracy
from examples.ga.dataset import get_reuters_dataset
from minos.experiment.experiment import Experiment, ExperimentParameters
from minos.experiment.training import Traini... | '''
Created on Feb 6, 2017
@author: julien
'''
import numpy
from os.path import join
import tempfile
from keras.metrics import categorical_accuracy
from examples.ga.dataset import get_reuters_dataset
from minos.experiment.experiment import Experiment, ExperimentParameters
from minos.experiment.training import Traini... | Python | 0.000225 |
a49ddd64758b23565870439bda36fafd5e1dac39 | Put survey back otherwise | gwells/urls.py | gwells/urls.py | """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... | """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... | Python | 0 |
393bde7e7f3902f734e8c01f265b216f2d3eef26 | remove leftover | models/dulsine_commons.py | models/dulsine_commons.py | # -*- coding: utf-8 -*-
# vim: set ts=4
# Common enumerations used in some places
CIVILITES = (
('M.', 'Monsieur'),
('Mme', 'Madame'),
('Mlle', 'Mademoiselle')
)
CIRCUITS = (
('O', 'ouvert'),
('F', 'ferme'),
('N', 'pas de circuit')
)
TYPES_ACTEURS = (
('P', 'Professionn... | # -*- coding: utf-8 -*-
# vim: set ts=4
# Common enumerations used in some places
CIVILITES = (
('M.', 'Monsieur'),
('Mme', 'Madame'),
('Mlle', 'Mademoiselle')
)
CIRCUITS = (
('O', 'ouvert'),
('F', 'ferme'),
('N', 'pas de circuit')
)
TYPES_ACTEURS = (
('P', 'Professionn... | Python | 0.000017 |
f9a99102a7053e444021926d08750f04a662fd9f | remove unnecessary print statements | pyspecdata/load_files/open_subpath.py | pyspecdata/load_files/open_subpath.py | from ..core import *
from ..datadir import dirformat
import os.path
from zipfile import ZipFile
def open_subpath(file_reference,*subpath,**kwargs):
"""
Parameters
----------
file_reference: str or tuple
If a string, then it's the name of a directory.
If it's a tuple, then, it has three ... | from ..core import *
from ..datadir import dirformat
import os.path
from zipfile import ZipFile
def open_subpath(file_reference,*subpath,**kwargs):
"""
Parameters
----------
file_reference: str or tuple
If a string, then it's the name of a directory.
If it's a tuple, then, it has three ... | Python | 0.999982 |
ba370231fe80280dec806c7c2515061e8607b360 | Add SCA into mbio | Correlation/__init__.py | Correlation/__init__.py | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
from os import path
Clist = ['mi.c', 'omes.c']
for c in Clist:
if not path.exists(_path__+'/'+c.replace('.c', '_c.so')):
from mbio import _make
... | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
from os import path
Clist = ['mi.c', 'omes.c']
for c in Clist:
if not path.exists(_path__+'/'+c.replace('.c', '_c.so')):
from mbio import _make
... | Python | 0.99929 |
2277c82efdc456e5873987eabac88810b2cece5b | Fix pep8 whitespace violation. | lms/djangoapps/courseware/features/video.py | lms/djangoapps/courseware/features/video.py | #pylint: disable=C0111
from lettuce import world, step
from common import *
############### ACTIONS ####################
@step('when I view it it does autoplay')
def does_autoplay(step):
assert(world.css_find('.video')[0]['data-autoplay'] == 'True')
@step('the course has a Video component')
def view_video(ste... | #pylint: disable=C0111
from lettuce import world, step
from common import *
############### ACTIONS ####################
@step('when I view it it does autoplay')
def does_autoplay(step):
assert(world.css_find('.video')[0]['data-autoplay'] == 'True')
@step('the course has a Video component')
def view_video(ste... | Python | 0.000003 |
54b0feebb18816a936f4a7f323a77808f9973eb2 | Update testes.py | Src/testes.py | Src/testes.py | import jogovelha
import sys
erroInicializar = False
jogo = jogovelha.inicializar()
if len(jogo) != 3:
erroInicializar = True
else:
for linha in jogo:
if len(linha) != 3:
erroInicializar = True
else:
for elemento in linha:
if elemento != "X":
... | import jogovelha
import sys
erroInicializar = False
jogo = jogovelha.inicializar()
if len(jogo) != 3:
erroInicializar = True
else:
for linha in jogo:
if len(linha) != 3:
erroInicializar = True
else:
for elemento in linha:
if elemento != ".":
... | Python | 0 |
73ceff96b2f065517a7d67cb0b25361f5bd61388 | Delete fixture after running tests | src/gramcore/filters/tests/test_edges.py | src/gramcore/filters/tests/test_edges.py | """Tests for module gramcore.filters.edges"""
import os
import numpy
from PIL import Image, ImageDraw
from nose.tools import assert_equal
from skimage import io
from gramcore.filters import edges
def setup():
"""Create image fixture
The background color is set by default to black (value == 0).
.. not... | """Tests for module gramcore.filters.edges"""
import os
import numpy
from PIL import Image, ImageDraw
from nose.tools import assert_equal
from skimage import io
from gramcore.filters import edges
def setup():
"""Create image fixture
The background color is set by default to black (value == 0).
.. not... | Python | 0 |
bd8caf6ab48bb1fbefdced7f33edabbdf017894a | Change of names | Demo/sockets/echosvr.py | Demo/sockets/echosvr.py | #! /usr/local/python
# Python implementation of an 'echo' tcp server: echo all data it receives.
#
# This is the simplest possible server, sevicing a single request only.
import sys
from socket import *
# The standard echo port isn't very useful, it requires root permissions!
# ECHO_PORT = 7
ECHO_PORT = 50000 + 7
BU... | #! /usr/local/python
# Python implementation of an 'echo' tcp server: echo all data it receives.
#
# This is the simplest possible server, sevicing a single request only.
import sys
from socket import *
# The standard echo port isn't very useful, it requires root permissions!
# ECHO_PORT = 7
ECHO_PORT = 50000 + 7
BU... | Python | 0.001373 |
89502d8b8b5e81ba57a16d71c895e0192eae6182 | Update for pandas 17 | hetio/stats.py | hetio/stats.py | import pandas
import matplotlib
import matplotlib.backends.backend_pdf
import seaborn
def get_degrees_for_metanode(graph, metanode):
"""
Return a dataframe that reports the degree of each metaedge for
each node of kind metanode.
"""
metanode_to_nodes = graph.get_metanode_to_nodes()
nodes = meta... | import pandas
import matplotlib
import matplotlib.backends.backend_pdf
import seaborn
def get_degrees_for_metanode(graph, metanode):
"""
Return a dataframe that reports the degree of each metaedge for
each node of kind metanode.
"""
metanode_to_nodes = graph.get_metanode_to_nodes()
nodes = meta... | Python | 0 |
49839733a7f26070e8d666d91fae177711154e1d | Change histogram_proto to use a custom logger. | tracing/tracing/proto/histogram_proto.py | tracing/tracing/proto/histogram_proto.py | # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
try:
# Note: from tracing.proto import histogram_pb2 would make more sense here,
# but unfortunately protoc does n... | # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import logging
try:
# Note: from tracing.proto import histogram_pb2 would make more sense here,
# but unfortunatel... | Python | 0.000001 |
527ceabcdbded592c02ee2dce18a19ffce0248c2 | Remove unnecesary comment | trunk/bdp_fe/src/bdp_fe/jobconf/views.py | trunk/bdp_fe/src/bdp_fe/jobconf/views.py | """
Module bdp_fe.jobconf.views
"""
import logging
from django import forms
from django.contrib import auth, messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseNotFound
from django.shortcuts import get_object_or_404, red... | """
Module bdp_fe.jobconf.views
"""
import logging
from django import forms
from django.contrib import auth, messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseNotFound
from django.shortcuts import get_object_or_404, red... | Python | 0 |
9371b1484e7843e479c5c54997d339d46cf4aedd | add logging | fastapp/plugins/__init__.py | fastapp/plugins/__init__.py | import os
import logging
logger = logging.getLogger(__name__)
class Singleton(type):
def __init__(cls, name, bases, dict):
super(Singleton, cls).__init__(name, bases, dict)
cls.instance = None
def __call__(cls,*args,**kw):
if cls.instance is None:
logger.info("Create singleton instance for %s" % cls)
c... | import os
import logging
logger = logging.getLogger(__name__)
class Singleton(type):
def __init__(cls, name, bases, dict):
super(Singleton, cls).__init__(name, bases, dict)
cls.instance = None
def __call__(cls,*args,**kw):
if cls.instance is None:
logger.info("Create singleton instance for %s" % cls)
c... | Python | 0.000001 |
279bebc53c2f589db943c91f31240a38ad059d72 | optimize username loginfield for mobile devices | features/gestalten/forms.py | features/gestalten/forms.py | import allauth
from crispy_forms import bootstrap, layout
import django
from django import forms
from django.contrib.auth import models as auth_models
from django.contrib.sites import models as sites_models
from features.groups import models as groups
from utils import forms as utils_forms
from features.gestalten impo... | import allauth
from crispy_forms import bootstrap, layout
import django
from django import forms
from django.contrib.auth import models as auth_models
from django.contrib.sites import models as sites_models
from features.groups import models as groups
from utils import forms as utils_forms
from features.gestalten impo... | Python | 0 |
64804965e031f365937ef8fe70dc749c4532053d | fix abstract scraper, can't use lxml's url parsing because we need a custom user agent | tx_highered/scripts/initial_wikipedia.py | tx_highered/scripts/initial_wikipedia.py | #! /usr/bin/env python
try:
from django.utils.timezone import now
except ImportError:
from datetime.datetime import now
import requests
from lxml.html import document_fromstring, tostring
from tx_highered.models import Institution
def get_wiki_title(name):
endpoint = "http://en.wikipedia.org/w/api.php"
... | #! /usr/bin/env python
import datetime
import requests
from lxml.html import parse, tostring
from tx_highered.models import Institution
def get_wiki_title(name):
endpoint = "http://en.wikipedia.org/w/api.php"
params = dict(action="opensearch",
search=name,
limit=1,
namespace=0,
... | Python | 0.000001 |
db3f71f537a85396d777ba28d3ad6c8156137c24 | Change pg key | src/python/pagerduty.py | src/python/pagerduty.py | import json
import urllib2
PD_URL = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
TIMEOUT = 10
def request(action, json_str):
obj = json.loads(json_str)
description = "%s %s is %s ( %s )" % (
obj.get('host', 'unknown host'),
obj.get('service', 'unknown service'),... | import json
import urllib2
PD_URL = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
TIMEOUT = 10
def request(action, json_str):
obj = json.loads(json_str)
description = "%s %s is %s ( %s )" % (
obj.get('host', 'unknown host'),
obj.get('service', 'unknown service'),... | Python | 0.000001 |
8c959354b59fb25f63ca73ecdcbd0f59197cabc9 | Add --random option. | scanless/cli/main.py | scanless/cli/main.py | #!/usr/bin/env python
#
# scanless - public port scan scrapper
# https://github.com/vesche/scanless
#
import argparse
import sys
from random import choice
from scanless.scanners import *
SCAN_LIST = '''Scanner Name | Website
---------------|------------------------------
yougetsignal | http://www.yougetsignal.... | #!/usr/bin/env python
#
# scanless - public port scan scrapper
# https://github.com/vesche/scanless
#
import argparse
import sys
from scanless.scanners import *
SCAN_LIST = '''Scanner Name | Website
---------------|------------------------------
yougetsignal | http://www.yougetsignal.com
viewdns | http:... | Python | 0.000001 |
3999e9812a766066dcccf6a4d07174144cb9f72d | Add Minecraft Wiki link to version item | wurstmineberg.45s.py | wurstmineberg.45s.py | #!/usr/local/bin/python3
import requests
people = requests.get('https://api.wurstmineberg.de/v2/people.json').json()
status = requests.get('https://api.wurstmineberg.de/v2/world/wurstmineberg/status.json').json()
print(len(status['list']))
print('---')
print('Version: {ver}|href=http://minecraft.gamepedia.com/{ver}... | #!/usr/local/bin/python3
import requests
people = requests.get('https://api.wurstmineberg.de/v2/people.json').json()
status = requests.get('https://api.wurstmineberg.de/v2/world/wurstmineberg/status.json').json()
print(len(status['list']))
print('---')
print('Version: {}|color=gray'.format(status['version']))
for w... | Python | 0 |
d792201bc311a15e5df48259008331b771c59aca | Fix CSS problem when Flexx is enbedded in page-app | flexx/ui/layouts/_layout.py | flexx/ui/layouts/_layout.py | """ Layout widgets
"""
from . import Widget
class Layout(Widget):
""" Abstract class for widgets that organize their child widgets.
Panel widgets are layouts that do not take the natural size of their
content into account, making them more efficient and suited for
high-level layout. Other layout... | """ Layout widgets
"""
from . import Widget
class Layout(Widget):
""" Abstract class for widgets that organize their child widgets.
Panel widgets are layouts that do not take the natural size of their
content into account, making them more efficient and suited for
high-level layout. Other layout... | Python | 0.000059 |
a9cfdf8fdb6853f175cdc31abc2dec91ec6dcf3a | fix import | InvenTree/part/tasks.py | InvenTree/part/tasks.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.utils.translation import gettext_lazy as _
import InvenTree.helpers
import InvenTree.tasks
import common.notifications
import part.models
logger = logging.getLogger("inventree")
def notify_low_stock(part: part.models.Part)... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.utils.translation import gettext_lazy as _
import InvenTree.helpers
import InvenTree.tasks
import common.notifications
import part.models
from part import tasks as part_tasks
logger = logging.getLogger("inventree")
def not... | Python | 0.000001 |
26a21a9f5da718852c193420a0132ad822139ec0 | Remove PHPBB crap | apps/devmo/context_processors.py | apps/devmo/context_processors.py | from django.conf import settings
from django.utils import translation
def i18n(request):
return {'LANGUAGES': settings.LANGUAGES,
'LANG': settings.LANGUAGE_URL_MAP.get(translation.get_language())
or translation.get_language(),
'DIR': 'rtl' if translation.get_language_bi... | from django.conf import settings
from django.utils import translation
def i18n(request):
return {'LANGUAGES': settings.LANGUAGES,
'LANG': settings.LANGUAGE_URL_MAP.get(translation.get_language())
or translation.get_language(),
'DIR': 'rtl' if translation.get_language_bi... | Python | 0 |
5c9452a125bd3d2bbeb15224db0a7effa94e5330 | Correct showVisible value. | apps/python/PartyLaps/ACTable.py | apps/python/PartyLaps/ACTable.py | """
A table drawing utility for Assetto Corsa.
"""
class ACTable(object):
def __init__(self, ac, window):
self.ac = ac
self.window = window
self.setTablePadding(0, 0)
self.setCellSpacing(0, 0)
self.data = {}
self.cells = {}
def draw(self):
"""
... | """
A table drawing utility for Assetto Corsa.
"""
class ACTable(object):
def __init__(self, ac, window):
self.ac = ac
self.window = window
self.setTablePadding(0, 0)
self.setCellSpacing(0, 0)
self.data = {}
self.cells = {}
def draw(self):
"""
... | Python | 0 |
2bf43e3ba86cc248e752175ffb82f4eab1803119 | delete question module had bug previously | survey/models/question_module.py | survey/models/question_module.py | from survey.models import BaseModel
from django.db import models
class QuestionModule(BaseModel):
name = models.CharField(max_length=255)
description = models.TextField(null=True, blank=True)
def remove_related_questions(self):
self.question_templates.all().delete()
def __unicode__(self):
... | from survey.models import BaseModel
from django.db import models
class QuestionModule(BaseModel):
name = models.CharField(max_length=255)
description = models.TextField(null=True, blank=True)
def remove_related_questions(self):
self.question_templates.delete()
def __unicode__(self):
... | Python | 0 |
e21e2ff9b8258be5533261f7834438c80b0082cc | Use iter(...) instead of .iter() | framework/tasks/handlers.py | framework/tasks/handlers.py | # -*- coding: utf-8 -*-
import logging
import functools
from flask import g
from celery import group
from website import settings
logger = logging.getLogger(__name__)
def celery_before_request():
g._celery_tasks = []
def celery_teardown_request(error=None):
if error is not None:
return
try:... | # -*- coding: utf-8 -*-
import logging
import functools
from flask import g
from celery import group
from website import settings
logger = logging.getLogger(__name__)
def celery_before_request():
g._celery_tasks = []
def celery_teardown_request(error=None):
if error is not None:
return
try:... | Python | 0.000004 |
9e2f9b040d0dde3237daca1c483c8b2bf0170663 | Update Arch package to 2.7 | archlinux/archpack_settings.py | archlinux/archpack_settings.py | #
# Biicode Arch Linux package settings.
#
# Check PKGBUILD_template docs for those settings and
# what they mean.
#
def settings():
return { "version": "2.7",
"release_number": "1",
"arch_deps": ["cmake>=3.0.2",
"zlib",
"glibc",
"sqlite",
... | #
# Biicode Arch Linux package settings.
#
# Check PKGBUILD_template docs for those settings and
# what they mean.
#
def settings():
return { "version": "2.6.1",
"release_number": "1",
"arch_deps": ["cmake>=3.0.2",
"zlib",
"glibc",
"sqlite",
... | Python | 0 |
98e4452e07256aa3285906bba60e16ce4dfd1dc3 | Replace do_add_subscription() in add_users_to_streams. | zerver/management/commands/add_users_to_streams.py | zerver/management/commands/add_users_to_streams.py | from __future__ import absolute_import
from __future__ import print_function
from optparse import make_option
from typing import Any
from django.core.management.base import BaseCommand
from zerver.lib.actions import create_stream_if_needed, bulk_add_subscriptions
from zerver.models import UserProfile, get_realm, ge... | from __future__ import absolute_import
from __future__ import print_function
from optparse import make_option
from typing import Any
from django.core.management.base import BaseCommand
from zerver.lib.actions import create_stream_if_needed, do_add_subscription
from zerver.models import UserProfile, get_realm, get_u... | Python | 0 |
ecd33e00eb5eb8ff58358e01a6d618262e8381a6 | Update upstream version of vo | astropy/io/vo/setup_package.py | astropy/io/vo/setup_package.py | from distutils.core import Extension
from os.path import join
from astropy import setup_helpers
def get_extensions(build_type='release'):
VO_DIR = 'astropy/io/vo/src'
return [Extension(
"astropy.io.vo.tablewriter",
[join(VO_DIR, "tablewriter.c")],
include_dirs=[VO_DIR])]
def get_pa... | from distutils.core import Extension
from os.path import join
from astropy import setup_helpers
def get_extensions(build_type='release'):
VO_DIR = 'astropy/io/vo/src'
return [Extension(
"astropy.io.vo.tablewriter",
[join(VO_DIR, "tablewriter.c")],
include_dirs=[VO_DIR])]
def get_pa... | Python | 0 |
dc7ac28109609e2a90856dbaf01ae8bbb2fd6985 | Repair the test (adding a docstring to the module type changed the docstring for an uninitialized module object). | Lib/test/test_module.py | Lib/test/test_module.py | # Test the module type
from test_support import verify, vereq, verbose, TestFailed
import sys
module = type(sys)
# An uninitialized module has no __dict__ or __name__, and __doc__ is None
foo = module.__new__(module)
verify(foo.__dict__ is None)
try:
s = foo.__name__
except AttributeError:
pass
else:
rai... | # Test the module type
from test_support import verify, vereq, verbose, TestFailed
import sys
module = type(sys)
# An uninitialized module has no __dict__ or __name__, and __doc__ is None
foo = module.__new__(module)
verify(foo.__dict__ is None)
try:
s = foo.__name__
except AttributeError:
pass
else:
rai... | Python | 0 |
5abac5e7cdc1d67ec6ed0996a5b132fae20af530 | Use the URLs input in the UI boxes | compare_text_of_urls.py | compare_text_of_urls.py | #!/usr/bin/env python
from __future__ import print_function
import json
import os
from os.path import join, dirname, abspath
import subprocess
import sys
from get_text_from_url import process_page
def main(argv=None):
if argv is None:
argv = sys.argv
arg = argv[1:]
# Enter two URLs with a spac... | #!/usr/bin/env python
from __future__ import print_function
import json
import os
from os.path import join, dirname, abspath
import subprocess
import sys
from get_text_from_url import process_page
def main(argv=None):
if argv is None:
argv = sys.argv
arg = argv[1:]
# Enter two URLs with a spac... | Python | 0 |
f81c36d4fe31815ed6692b573ad660067151d215 | Drop use of 'oslo' namespace package | zaqarclient/_i18n.py | zaqarclient/_i18n.py | # Copyright 2014 Red Hat, Inc
# 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... | # Copyright 2014 Red Hat, Inc
# 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... | Python | 0.998108 |
962114f65db5de4a0e58ebec93ec8f06147ae790 | add RAMONVolume#data | ndio/ramon/RAMONVolume.py | ndio/ramon/RAMONVolume.py | from __future__ import absolute_import
from .enums import *
from .errors import *
import numpy
from .RAMONBase import RAMONBase
class RAMONVolume(RAMONBase):
"""
RAMONVolume Object for storing neuroscience data with a voxel volume
"""
def __init__(self,
xyz_offset=(0, 0, 0),
... | from __future__ import absolute_import
from .enums import *
from .errors import *
import numpy
from .RAMONBase import RAMONBase
class RAMONVolume(RAMONBase):
"""
RAMONVolume Object for storing neuroscience data with a voxel volume
"""
def __init__(self,
xyz_offset=(0, 0, 0),
... | Python | 0 |
1cba70e91b6592253a74d2c030e9c57faf0a1485 | add header to backend.py | zmq/sugar/backend.py | zmq/sugar/backend.py | """Import basic exposure of libzmq C API as a backend"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPY... | # this will be try/except when other
try:
from zmq.core import (
Context,
Socket, IPC_PATH_MAX_LEN,
Frame, Message,
Stopwatch,
device, proxy,
strerror, zmq_errno,
zmq_poll,
zmq_version_info,
constants,
)
except ImportError:
# here will ... | Python | 0.000001 |
9d3d06e760cb4210405a3b720eb67c5da0478f72 | remove succes_message variable | sync_settings/thread_progress.py | sync_settings/thread_progress.py | # -*- coding: utf-8 -*-
#Credits to @wbond package_control
import sublime, threading
class ThreadProgress():
"""
Animates an indicator, [= ], in the status area while a thread runs
:param thread:
The thread to track for activity
:param message:
The message to display next to the activit... | # -*- coding: utf-8 -*-
#Credits to @wbond package_control
import sublime, threading
class ThreadProgress():
"""
Animates an indicator, [= ], in the status area while a thread runs
:param thread:
The thread to track for activity
:param message:
The message to display next to the activit... | Python | 0.000774 |
c691c256682bec5f9a242ab71ab42d296bbf88a9 | Add `Post`, `Tag` models to Admin | nightreads/posts/admin.py | nightreads/posts/admin.py | from django.contrib import admin
from .models import Post, Tag
admin.site.register(Post)
admin.site.register(Tag)
| from django.contrib import admin
# Register your models here.
| Python | 0.000001 |
afea4f0732e68f5cbb38f5a8ac194698aec8e520 | Allow any of the previous tasks to satisfy requirements. | taskflow/patterns/linear_flow.py | taskflow/patterns/linear_flow.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. 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
#
# ... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. 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
#
# ... | Python | 0.001182 |
e77380401d04feb1ff283add4dca9f6bad57f330 | Rewrite order/tests/MemberViewTests. | haveaniceday/order/tests.py | haveaniceday/order/tests.py | from django.test import TestCase
from .models import Member
from website_component.models import CustomWebPage, CustomComponent
# Create your tests here.
class OrderViewTests(TestCase):
def test_order_view(self):
response = self.client.get('/order/')
self.assertEqual(response.status_code, 200)
... | from django.test import TestCase
from .models import Member
# Create your tests here.
class OrderViewTests(TestCase):
def test_order_view(self):
response = self.client.get('/order/')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'order/home.html')
class Memb... | Python | 0 |
718049a991470b6fa95d8db65a6482735219fc57 | Fix get_acl_on | openquake/server/utils.py | openquake/server/utils.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | Python | 0.000001 |
4f2b4b07131c462873b87b869e8df1de41af5848 | Add some test code | RNACompete/SeqStruct.py | RNACompete/SeqStruct.py | # Copyright 2000-2002 Brad Chapman.
# Copyright 2004-2005 by M de Hoon.
# Copyright 2007-2015 by Peter Cock.
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Modified Copyright... | # Copyright 2000-2002 Brad Chapman.
# Copyright 2004-2005 by M de Hoon.
# Copyright 2007-2015 by Peter Cock.
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Modified Copyright... | Python | 0.000037 |
951c0dbcfeb016dbde6e1a7a3f0eacc506c9211e | Rename sockjs router prefix to /ws/api/ | ws.py | ws.py | import json
from tornado import web, ioloop
from sockjs.tornado import SockJSRouter, SockJSConnection
from blimp.utils.websockets import WebSocketsRequest
class RESTAPIConnection(SockJSConnection):
def on_open(self, info):
self.send_json({'connected': True})
def on_message(self, data):
resp... | import json
from tornado import web, ioloop
from sockjs.tornado import SockJSRouter, SockJSConnection
from blimp.utils.websockets import WebSocketsRequest
class EchoConnection(SockJSConnection):
def on_open(self, info):
self.send_json({'connected': True})
def on_message(self, data):
respons... | Python | 0.000002 |
4fe8a1c1b294f0d75a901d4e8e80f47f5583e44e | Fix for test failure introduced by basic auth changes | pages/lms/info.py | pages/lms/info.py | from e2e_framework.page_object import PageObject
from ..lms import BASE_URL
class InfoPage(PageObject):
"""
Info pages for the main site.
These are basically static pages, so we use one page
object to represent them all.
"""
# Dictionary mapping section names to URL paths
SECTION_PATH = {... | from e2e_framework.page_object import PageObject
from ..lms import BASE_URL
class InfoPage(PageObject):
"""
Info pages for the main site.
These are basically static pages, so we use one page
object to represent them all.
"""
# Dictionary mapping section names to URL paths
SECTION_PATH = {... | Python | 0 |
4d942291734641bbdd6a71e16167fefca37a68e7 | Fix default config file path on auto creation | passpie/config.py | passpie/config.py | import copy
import logging
import os
import yaml
DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.passpierc')
DB_DEFAULT_PATH = os.path.join(os.path.expanduser('~'), '.passpie')
DEFAULT_CONFIG = {
'path': DB_DEFAULT_PATH,
'short_commands': False,
'key_length': 4096,
'genpass_length': 32,... | import copy
import logging
import os
import yaml
DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.passpierc')
DB_DEFAULT_PATH = os.path.join(os.path.expanduser('~'), '.passpie')
DEFAULT_CONFIG = {
'path': DB_DEFAULT_PATH,
'short_commands': False,
'key_length': 4096,
'genpass_length': 32,... | Python | 0.000001 |
2559fa50a80ac90f36c3aed251bf397f1af83dd2 | bump version to 0.1b2 | paste/__init__.py | paste/__init__.py | name = 'paste'
version = '0.1b2'
| name = 'paste'
version = '0.1b1'
| Python | 0.000001 |
cf716e0d35df2a76c57c0b08a027c092ff60fd47 | Refactor `.open(...)` for clarity | pdfplumber/pdf.py | pdfplumber/pdf.py | import itertools
import logging
import pathlib
from pdfminer.layout import LAParams
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFParser
from pdfminer.psparser import PSException
from .container imp... | import itertools
import logging
import pathlib
from pdfminer.layout import LAParams
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFParser
from pdfminer.psparser import PSException
from .container imp... | Python | 0 |
a9808c822e598fd17148b8fc4063ea11f0a270e9 | Add bawler specific exception | pg_bawler/core.py | pg_bawler/core.py | '''
==============
pg_bawler.core
==============
Base classes for LISTEN / NOTIFY.
Postgresql documentation for
`LISTEN <https://www.postgresql.org/docs/current/static/sql-listen.html>`_ /
`NOTIFY <https://www.postgresql.org/docs/current/static/sql-notify.html>`_.
'''
import asyncio
import logging
import aiopg
LOG... | '''
==============
pg_bawler.core
==============
Base classes for LISTEN / NOTIFY.
Postgresql documentation for
`LISTEN <https://www.postgresql.org/docs/current/static/sql-listen.html>`_ /
`NOTIFY <https://www.postgresql.org/docs/current/static/sql-notify.html>`_.
'''
import asyncio
import logging
import aiopg
LOG... | Python | 0.000001 |
d350c180606060e9539c12d7d49eed4d6802ac8b | Bump to 1.1.5 | pilkit/pkgmeta.py | pilkit/pkgmeta.py | __title__ = 'pilkit'
__author__ = 'Matthew Tretter'
__version__ = '1.1.5'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| __title__ = 'pilkit'
__author__ = 'Matthew Tretter'
__version__ = '1.1.4'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| Python | 0.000205 |
b1bd2acbe756922a4cfa2b3a307d60b7e89734c2 | Update command.py | pipwin/command.py | pipwin/command.py | # -*- coding: utf-8 -*-
"""pipwin installs compiled python binaries on windows provided by Christoph
Gohlke
Usage:
pipwin install (<package> | [-r=<file> | --file=<file>])
pipwin uninstall <package>
pipwin download (<package> | [-r=<file> | --file=<file>]) [-d=<dest> | --dest=<dest>]
pipwin search <package>
... | # -*- coding: utf-8 -*-
"""pipwin installs compiled python binaries on windows provided by Christoph
Gohlke
Usage:
pipwin install (<package> | [-r=<file> | --file=<file>])
pipwin uninstall <package>
pipwin download (<package> | [-r=<file> | --file=<file>]) [-d=<dest> | --dest=<dest>]
pipwin search <package>
... | Python | 0.000002 |
3ce78ad88d8c963dfb819b323b40b2415d8624b2 | Split create user feature into two functions | api.py | api.py | #!/usr/bin/env python
"""
Copyright 2016 Brian Quach
Licensed under MIT (https://github.com/brianquach/udacity-nano-fullstack-conference/blob/master/LICENSE) # noqa
"""
import endpoints
from protorpc import remote
from resource import StringMessage
from resource import USER_REQUEST
@endpoints.api(name='poker', ver... | #!/usr/bin/env python
"""
Copyright 2016 Brian Quach
Licensed under MIT (https://github.com/brianquach/udacity-nano-fullstack-conference/blob/master/LICENSE) # noqa
"""
import endpoints
from protorpc import remote
from resource import StringMessage
from resource import USER_REQUEST
@endpoints.api(name='poker', ver... | Python | 0 |
ce8ba26877505481795edd024c3859b14c548ffd | Refactor comics.py | plugins/comics.py | plugins/comics.py | # Copyright 2017 Starbot Discord Project
#
# 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... | # Copyright 2017 Starbot Discord Project
#
# 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... | Python | 0.000001 |
318e6b5fd2382766c065574f6b202fd09e68cf6e | increment version # | pmagpy/version.py | pmagpy/version.py | """
Module contains current pmagpy version number.
Version number is displayed by GUIs
and used by setuptools to assign number to pmagpy/pmagpy-cli.
"""
"pmagpy-3.11.1"
version = 'pmagpy-3.11.1'
| """
Module contains current pmagpy version number.
Version number is displayed by GUIs
and used by setuptools to assign number to pmagpy/pmagpy-cli.
"""
"pmagpy-3.11.0"
version = 'pmagpy-3.11.0'
| Python | 0.000001 |
7150413cccbf8f812b3fd4a1fc2b82a4020aed9f | fix heroku postgresql path to allow sqlalchemy upgrade | app.py | app.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_compress import Compress
from flask_debugtoolbar import DebugToolbarExtension
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from sqlalchemy.pool import NullPool
import logging
import sys
import os
import requests... | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_compress import Compress
from flask_debugtoolbar import DebugToolbarExtension
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from sqlalchemy.pool import NullPool
import logging
import sys
import os
import requests... | Python | 0 |
b8bf769d55a61f9d29b15c4b657d9df293045304 | convert to int | app.py | app.py | #!/usr/bin/env python
from flask import Flask, render_template, Response, request
from i2c import I2C
from camera_pi import Camera
RobotArduino = I2C(); #The robot's arduino controller
app = Flask(__name__, template_folder='site')
@app.route('/')
def index():
"""Main page: controller + video stream"""
return... | #!/usr/bin/env python
from flask import Flask, render_template, Response, request
from i2c import I2C
from camera_pi import Camera
RobotArduino = I2C(); #The robot's arduino controller
app = Flask(__name__, template_folder='site')
@app.route('/')
def index():
"""Main page: controller + video stream"""
return... | Python | 1 |
c432ae2dc25b2af77b3f57d610b111a24919d987 | Add collision detection on paste creation | app.py | app.py | __author__ = 'zifnab'
from flask import Flask, redirect, request, render_template, flash, current_app as app, abort
from mongoengine import connect
from flask_admin import Admin
from flask_debugtoolbar import DebugToolbarExtension
from flask_login import LoginManager, login_user, login_required, logout_user, current_us... | __author__ = 'zifnab'
from flask import Flask, redirect, request, render_template, flash, current_app as app, abort
from mongoengine import connect
from flask_admin import Admin
from flask_debugtoolbar import DebugToolbarExtension
from flask_login import LoginManager, login_user, login_required, logout_user, current_us... | Python | 0 |
038196b5bc478ff561b6f8031ecbcb37a765ba3e | Change to be more pep8 compliant. | bot.py | bot.py | import praw
import urllib
import cv2
import numpy as np
from PIL import Image
import time
import getpass
import re
# Eye Classifier
eyeData = "xml/eyes.xml"
eyeClass = cv2.CascadeClassifier(eyeData)
# Glasses Asset
glasses = cv2.imread('assets/glasses.png', cv2.IMREAD_UNCHANGED)
ratio = glasses.shape[1] / glasses.shap... | import praw
import urllib
import cv2, numpy as np
from PIL import Image
import time
import getpass
import re
# Eye Classifier
eyeData = "xml/eyes.xml"
eyeClass = cv2.CascadeClassifier(eyeData)
# Glasses Asset
glasses = cv2.imread('assets/glasses.png', cv2.IMREAD_UNCHANGED)
ratio = glasses.shape[1] / glasses.shape[0]
#... | Python | 0 |
f67807b0f2064e1c6374fe4c10ed87c7a9222426 | mark all events after processing it | bot.py | bot.py | #! /usr/bin/env python
from time import gmtime, strftime
from foaas import foaas
from diaspy_client import Client
import re
import urllib2
def log_write(text):
f = open('bot.log', 'a')
f.write(strftime("%a, %d %b %Y %H:%M:%S ", gmtime()))
f.write(text)
f.write('\n')
f.close()
client=Client()
notify = clie... | #! /usr/bin/env python
from time import gmtime, strftime
from foaas import foaas
from diaspy_client import Client
import re
import urllib2
def log_write(text):
f = open('bot.log', 'a')
f.write(strftime("%a, %d %b %Y %H:%M:%S ", gmtime()))
f.write(text)
f.write('\n')
f.close()
client=Client()
notify = clie... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.