🐙OctoPack
Collection
13 items • Updated • 4
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 |