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
ff90958a0c79936d5056840ba03a5863bcdef099
Mark as test as "todo" for now.
formal/test/test_util.py
formal/test/test_util.py
from twisted.trial import unittest from formal import util class TestUtil(unittest.TestCase): def test_validIdentifier(self): self.assertEquals(util.validIdentifier('foo'), True) self.assertEquals(util.validIdentifier('_foo'), True) self.assertEquals(util.validIdentifier('_foo_'), True) ...
from twisted.trial import unittest from formal import util class TestUtil(unittest.TestCase): def test_validIdentifier(self): self.assertEquals(util.validIdentifier('foo'), True) self.assertEquals(util.validIdentifier('_foo'), True) self.assertEquals(util.validIdentifier('_foo_'), True) ...
Python
0
5163b23f5060e22aee64b2318fff19775ce68aed
Add unique constraints to FilingIDValue and FilerIDValue
calaccess_processed/models/common.py
calaccess_processed/models/common.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Models for storing general filer and filing data derived from raw CAL-ACCESS data. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from calaccess_processed.managers import ProcessedDa...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Models for storing general filer and filing data derived from raw CAL-ACCESS data. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from calaccess_processed.managers import ProcessedDa...
Python
0
2e7271a33e098d7cdef15207e8caa05e644c3223
Use full URI for build failure reasons
changes/buildfailures/testfailure.py
changes/buildfailures/testfailure.py
from __future__ import absolute_import from jinja2 import Markup from changes.buildfailures.base import BuildFailure from changes.utils.http import build_uri class TestFailure(BuildFailure): def get_html_label(self, build): link = build_uri('/projects/{0}/builds/{1}/tests/?result=failed'.format(build.pr...
from __future__ import absolute_import from jinja2 import Markup from changes.buildfailures.base import BuildFailure class TestFailure(BuildFailure): def get_html_label(self, build): link = '/projects/{0}/builds/{1}/tests/?result=failed'.format(build.project.slug, build.id.hex) try: ...
Python
0
4c303007d6418e2a2f1b2e1778d6b7d0c0573c74
Raise read-only fs on touch
gitfs/views/read_only.py
gitfs/views/read_only.py
from errno import EROFS from fuse import FuseOSError from gitfs import FuseMethodNotImplemented from .view import View class ReadOnlyView(View): def getxattr(self, path, fh): raise FuseMethodNotImplemented def open(self, path, flags): return 0 def create(self, path, fh): raise...
import os from errno import EROFS from fuse import FuseOSError from gitfs import FuseMethodNotImplemented from .view import View class ReadOnlyView(View): def getxattr(self, path, fh): raise FuseMethodNotImplemented def open(self, path, flags): return 0 def create(self, path, fh): ...
Python
0
79acfd42a4c9eccc1d365412fca9186b568e4d6d
Fix performance for AssetForeignKey
glitter/assets/fields.py
glitter/assets/fields.py
from itertools import groupby from django.db import models from django.forms.models import ModelChoiceField, ModelChoiceIterator class GroupedModelChoiceField(ModelChoiceField): def __init__(self, queryset, group_by_field='category', group_label=None, *args, **kwargs): """ group_by_field is the n...
from itertools import groupby from django.db import models from django.forms.models import ModelChoiceField, ModelChoiceIterator class GroupedModelChoiceField(ModelChoiceField): def __init__(self, queryset, group_by_field='category', group_label=None, *args, **kwargs): """ group_by_field is the n...
Python
0
7c3a164b74f345be07843482728b2e0b33a927bc
bump minor version
src/graceful/__init__.py
src/graceful/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 1, 0) # PEP 386 # noqa __version__ = ".".join([str(x) for x in VERSION]) # noqa """ Minimalist framework for self-descriptive RESTful APIs build on top of falcon. It is inspired by Django REST Framework package. Mostly by how object serialization is done but more emphasis is p...
# -*- coding: utf-8 -*- VERSION = (0, 0, 4) # PEP 386 # noqa __version__ = ".".join([str(x) for x in VERSION]) # noqa """ Minimalist framework for self-descriptive RESTful APIs build on top of falcon. It is inspired by Django REST Framework package. Mostly by how object serialization is done but more emphasis is p...
Python
0
9b5d2929f58a3155edc5f03a3cca14ff25356021
Remove pidfile in Container.kill()
src/libcask/container.py
src/libcask/container.py
import os import os.path import time import signal import subprocess import libcask.attach class Container(object): def __init__( self, name, root_path, pid_path, hostname, ipaddr, ipaddr_host, entry_point, ): # Human-readable name for t...
import os import os.path import time import signal import subprocess import libcask.attach class Container(object): def __init__( self, name, root_path, pid_path, hostname, ipaddr, ipaddr_host, entry_point, ): # Human-readable name for t...
Python
0.000001
6f61215263cfe02dc50e508514d1d23208e46d92
Allow modules context processor works without request.user Fix #524
material/frontend/context_processors.py
material/frontend/context_processors.py
from . import modules as modules_registry def modules(request): """Add current module and modules list to the template context.""" module = None if request.resolver_match: module = getattr(request.resolver_match.url_name, 'module', None) return { 'modules': modules_registry.available...
from . import modules as modules_registry def modules(request): """Add current module and modules list to the template context.""" if not hasattr(request, 'user'): raise ValueError('modules context processor requires "django.contrib.auth.context_processors.auth"' 'to be in TEM...
Python
0
0d8c30e58d8b53f90f9318cdf3db26ed1e272602
Fix pep8 violation.
lms/envs/static.py
lms/envs/static.py
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
Python
0
1af17b029cef4c3a197fd3a4813fc704cb277e59
use the correct name
osmaxx-py/osmaxx/excerptexport/urls.py
osmaxx-py/osmaxx/excerptexport/urls.py
from django.conf.urls import url from django.contrib.auth.views import login, logout from django.views.generic import TemplateView from osmaxx.excerptexport.views import ( list_downloads, download_file, extraction_order_status, list_orders, NewExtractionOrderView, access_denied, ) excerpt_exp...
from django.conf.urls import url from django.contrib.auth.views import login, logout from django.views.generic import TemplateView from osmaxx.excerptexport.views import ( list_downloads, download_file, extraction_order_status, list_orders, NewExtractionOrderView, access_denied, ) except_expo...
Python
0.999997
dda9b7576269f7dfc7ca864da33f6b047228e667
remove armeabi and mips targets
config/buildcfg.py
config/buildcfg.py
import sys, os import dragon import apps_tools.android as android import apps_tools.ios as ios android_pdraw_dir = os.path.join(dragon.WORKSPACE_DIR, "packages", "pdraw") android_jni_dir = os.path.join(android_pdraw_dir, "libpdraw", "android", "jni") android_app_dir = os.path.join(android_pdraw_dir, "apps...
import sys, os import dragon import apps_tools.android as android import apps_tools.ios as ios android_pdraw_dir = os.path.join(dragon.WORKSPACE_DIR, "packages", "pdraw") android_jni_dir = os.path.join(android_pdraw_dir, "libpdraw", "android", "jni") android_app_dir = os.path.join(android_pdraw_dir, "apps...
Python
0
b46cf3c17afb7300d7a72725e70650c59a1e67ad
Update fun.py
code/fun.py
code/fun.py
import asyncio import discord from discord.ext import commands class Fun: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, no_pm=True) async def ping(message): if message.content.startswith('!ping'): return await my_bot.say("Hello, world!")
import asyncio import discord from discord.ext import commands class Fun: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, no_pm=True) async def ping(message): if message.content.startswith('!ping'): await client.send_message(message.chann...
Python
0.000001
c6b89b10c78c7a053aa7996c9a85cd64c81860c9
check whole CSV row
apps/views.py
apps/views.py
from django.http import HttpResponse from django.views import generic from django.template import RequestContext, loader from django.db.utils import ConnectionDoesNotExist import string, re from home.models import Crttype, Courts class OutcomeView(generic.View): def court_info(self, outcome_data): court...
from django.http import HttpResponse from django.views import generic from django.template import RequestContext, loader from django.db.utils import ConnectionDoesNotExist import string, re from home.models import Crttype, Courts class OutcomeView(generic.View): def court_info(self, outcome_data): court...
Python
0
a307c5fc2555d282dfa6193cdbcfb2d15e185c0c
Allow query without table to run
aq/parsers.py
aq/parsers.py
import collections from collections import namedtuple from six import string_types from aq.errors import QueryParsingError from aq.select_parser import select_stmt, ParseException TableId = namedtuple('TableId', ('database', 'table', 'alias')) QueryMetadata = namedtuple('QueryMetadata', ('tables',)) class SelectPa...
from collections import namedtuple import collections from six import string_types from aq.errors import QueryParsingError from aq.select_parser import select_stmt, ParseException TableId = namedtuple('TableId', ('database', 'table', 'alias')) QueryMetadata = namedtuple('QueryMetadata', ('tables',)) class SelectP...
Python
0.000003
e2852dc043f179a8e580447580f66674a3cd1534
fix pointer-location delete on codeblock analysis. if we run into a location that's a pointer during code-flow, most times it will not be identified on the location of the instruction, but offset. this also brings up the question: what happens if we completely skip the pointer because it fell within the previous instru...
vivisect/analysis/generic/codeblocks.py
vivisect/analysis/generic/codeblocks.py
""" A function analysis module that will find code blocks in functions by flow and xrefs. This is basically a mandatory module which should be snapped in *very* early by parsers. """ #FIXME this belongs in the core disassembler loop! import sys import envi import vivisect from vivisect.const import * def analyzeF...
""" A function analysis module that will find code blocks in functions by flow and xrefs. This is basically a mandatory module which should be snapped in *very* early by parsers. """ #FIXME this belongs in the core disassembler loop! import sys import envi import vivisect from vivisect.const import * def analyzeF...
Python
0.000139
033a9ba65b70baffef00d5fe7d0b1834e4938959
Clean up fpsyncrc
fpsyncrc.py
fpsyncrc.py
""" Configuration file for the laptop-update.py script. This file should be named either `~/.fpsyncrc.py` or `~/usr/etc/fpsyncrc.py` to be found by default. Otherwise its location must be given at runtime as the `--config` option. This file will be `exec`'d by the calling script in a namespace that has the following ...
""" Configuration file for the laptop-update.py script. This file should be named either `~/.fpsyncrc.py` or `~/usr/etc/fpsyncrc.py` to be found by default. Otherwise its location must be given at runtime as the `--config` option. This file will be `exec`'d by the calling script in a namespace that has the following ...
Python
0.000008
f48c0b25556c3ea89dcb3bd4c4d9608730689be8
Make sure www.example.test is checked.
src/test-saml.py
src/test-saml.py
#!/usr/bin/python3 from sys import argv from xvfbwrapper import Xvfb from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions print("Admin password " + argv[1]) with Xvfb() as xvfb: driver = webdriver.Firefox(log_path = "/tmp/...
#!/usr/bin/python3 from sys import argv from xvfbwrapper import Xvfb from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions print("Admin password " + argv[1]) with Xvfb() as xvfb: driver = webdriver.Firefox(log_path = "/tmp/...
Python
0.999101
aed103de16687b54c7e66e3adef903d1430e4471
remove unused model.
ats/models.py
ats/models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import models from django.contrib import admin from django.contrib.auth.models import User from django.utils.encoding import python_2_unicode_compatible from . import bigint_patch @python_2_unicode_compatible class Project(...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import models from django.contrib import admin from django.contrib.auth.models import User from django.utils.encoding import python_2_unicode_compatible from . import bigint_patch class UserExtraAttr(models.Model): user...
Python
0
aa9c29dda9522008fefc580abc99ca4ffd369b1e
Rework how MPI packing/unpacking is handled.
pyfr/backends/cuda/packing.py
pyfr/backends/cuda/packing.py
# -*- coding: utf-8 -*- import pycuda.driver as cuda from pycuda.compiler import SourceModule from pyfr.backends.cuda.provider import CudaKernelProvider from pyfr.backends.cuda.queue import CudaComputeKernel, CudaMPIKernel from pyfr.util import npdtype_to_ctype, npdtype_to_mpitype class CudaPackingKernels(CudaKerne...
# -*- coding: utf-8 -*- import pycuda.driver as cuda from pycuda.compiler import SourceModule from pyfr.backends.cuda.provider import CudaKernelProvider from pyfr.backends.cuda.queue import CudaComputeKernel, CudaMPIKernel from pyfr.util import npdtype_to_ctype, npdtype_to_mpitype class CudaPackingKernels(CudaKerne...
Python
0
0bbfcaabcee591ca19702ec071d711ac411597fd
Increment version to 0.2.4
approvaltests/version.py
approvaltests/version.py
version_number = "0.2.4"
version_number = "0.2.3"
Python
0.998885
1eda7cfbda31ab7b39182e4a2fdacf8bfcf147a2
Update __init__.py
pytorch_lightning/__init__.py
pytorch_lightning/__init__.py
"""Root package info.""" __version__ = '0.10.0rc1' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' __copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__ __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning' # this has to be simple string,...
"""Root package info.""" __version__ = '0.9.1rc4' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' __copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__ __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning' # this has to be simple string, ...
Python
0.000072
d24cf56d0ad2e8388eb931b10c170df86870c5b0
Update __init__.py (#4308)
pytorch_lightning/__init__.py
pytorch_lightning/__init__.py
"""Root package info.""" __version__ = '1.0.4rc0' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' __copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__ __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning' # this has to be simple string, ...
"""Root package info.""" __version__ = '1.0.3' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' __copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__ __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning' # this has to be simple string, see...
Python
0
59ec603a7bcaabd7bac5901bc265920682d4cfcf
Add another missing self
tictactoe.py
tictactoe.py
from logishort import * from getch import * from logipy import logi_led from logimap import logimap import time class TicTacToe: def __init__(self): init() time.sleep(1) self.accepted_keys = { 't':[0x14, 0, 0], 'y':[0x15, 0, 1], 'u':[0x16, 0, 2], ...
from logishort import * from getch import * from logipy import logi_led from logimap import logimap import time class TicTacToe: def __init__(self): init() time.sleep(1) self.accepted_keys = { 't':[0x14, 0, 0], 'y':[0x15, 0, 1], 'u':[0x16, 0, 2], ...
Python
0.001914
7523ff90cadcefe3d51682d3301f7ceb51c70ced
Revert "Corrige a resolução"
timelapse.py
timelapse.py
import os import datetime import time import picamera from PIL import Image, ImageStat, ImageFont, ImageDraw with picamera.PiCamera() as camera: camera.resolution = (1024, 768) camera.rotation = 180 time.sleep(2) # camera warm-up time for filename in camera.capture_continuous('images/img_{timesta...
import os import datetime import time import picamera from PIL import Image, ImageStat, ImageFont, ImageDraw with picamera.PiCamera() as camera: camera.resolution = (1024, 728) camera.rotation = 180 time.sleep(2) # camera warm-up time for filename in camera.capture_continuous('images/img_{timesta...
Python
0
60f89131b8f18046e4504b20c64f95cb3b30085a
Make sure we allow https flv files
apps/videos/types/flv.py
apps/videos/types/flv.py
# Universal Subtitles, universalsubtitles.org # # Copyright (C) 2010 Participatory Culture Foundation # # 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...
# Universal Subtitles, universalsubtitles.org # # Copyright (C) 2010 Participatory Culture Foundation # # 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...
Python
0
b856016182a9a0c97ccb5e6593aa16f3a269bf79
fix ToDoList class method add_todo to pass non_boolean test
todo_list.py
todo_list.py
import todo_item class ToDoList(object): def __init__(self, name, description, todo_items): self.name = name self.description = description self.todo_items = todo_items def add_todo(self, content, complete = False, *args): if type(complete) != type(True): self.complete = False return item = todo_item...
import todo_item class ToDoList(object): def __init__(self, name, description, todo_items): self.name = name self.description = description self.todo_items = todo_items def add_todo(self, content, complete = False, *args): item = todo_item.ToDoItem(content, complete, *args) self.todo_items.append(item) d...
Python
0.000002
c000dd1d0940b47c13761bb09e0cb50a2adc6a2e
Handle token_endpoint auth type in osc plugin
heatclient/osc/plugin.py
heatclient/osc/plugin.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 # distrib...
# 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 # distrib...
Python
0.000044
ab365a6fdf39feed6f529a4a5170c2d9f674b706
fix unicode issue
weboob/backends/orange/pages/compose.py
weboob/backends/orange/pages/compose.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Nicolas Duhamel # # This file is part of weboob. # # weboob 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 yo...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Nicolas Duhamel # # This file is part of weboob. # # weboob 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 yo...
Python
0.000099
ca327b35c2e45329962da0dc04cfe2354ffd8b35
add lcm gl support to testDrakeVisualizer.py
src/python/tests/testDrakeVisualizer.py
src/python/tests/testDrakeVisualizer.py
from ddapp.consoleapp import ConsoleApp from ddapp.screengrabberpanel import ScreenGrabberPanel from ddapp.drakevisualizer import DrakeVisualizer from ddapp.lcmgl import LCMGLManager from ddapp import objectmodel as om from ddapp import applogic from PythonQt import QtCore, QtGui class DrakeVisualizerApp(ConsoleApp)...
from ddapp.consoleapp import ConsoleApp from ddapp.screengrabberpanel import ScreenGrabberPanel from ddapp.drakevisualizer import DrakeVisualizer from ddapp import objectmodel as om from ddapp import applogic from PythonQt import QtCore, QtGui class DrakeVisualizerApp(ConsoleApp): def __init__(self): C...
Python
0
d73d1ab8844ac0048c3ad0ebd2d2b6c12b8c606c
Make cli for getting files from google folder
featured.py
featured.py
import httplib2 import os import datetime import argparse import io import sys import datetime from apiclient import discovery import oauth2client from oauth2client import client from oauth2client import tools from googleapiclient.http import MediaIoBaseDownload from flask import Flask from flask_restful import Resour...
import httplib2 import os import datetime import argparse import io import sys import datetime from apiclient import discovery import oauth2client from oauth2client import client from oauth2client import tools from googleapiclient.http import MediaIoBaseDownload from flask import Flask from flask_restful import Resour...
Python
0
38939635530223ef7d736c19c9c2d666c67baca4
fix file format generated by ffhlwiki.py
ffhlwiki.py
ffhlwiki.py
#!/usr/bin/env python3 import json import argparse from itertools import zip_longest from urllib.request import urlopen from bs4 import BeautifulSoup def import_wikigps(url): def fetch_wikitable(url): f = urlopen(url) soup = BeautifulSoup(f) table = soup.find_all("table")[0] rows = table.find_all...
#!/usr/bin/env python3 import json import argparse from itertools import zip_longest from urllib.request import urlopen from bs4 import BeautifulSoup def import_wikigps(url): def fetch_wikitable(url): f = urlopen(url) soup = BeautifulSoup(f) table = soup.find_all("table")[0] rows = table.find_all...
Python
0
ce2c34fc9dc010429047613b6bdfc513c799987d
update projecs with voting status and check deadline
bluebottle/projects/management/commands/cron_status_realised.py
bluebottle/projects/management/commands/cron_status_realised.py
from django.core.management.base import BaseCommand, CommandError from django.utils.timezone import now from django.db import connection from bluebottle.clients.models import Client from bluebottle.projects.models import Project from bluebottle.bb_projects.models import ProjectPhase from bluebottle.tasks.models import...
from django.core.management.base import BaseCommand, CommandError from django.utils.timezone import now from django.db import connection from bluebottle.clients.models import Client from bluebottle.projects.models import Project from bluebottle.bb_projects.models import ProjectPhase from bluebottle.tasks.models import...
Python
0
47c76074e010107fb3bfe3fc0f74482058efac50
Add support for constructor keyword arguments (i.e. pass them through to FilesystemCollection).
src/sheared/web/collections/entwined.py
src/sheared/web/collections/entwined.py
# # Sheared -- non-blocking network programming library for Python # Copyright (C) 2003 Sune Kirkeby <sune@mel.interspace.dk> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2...
# # Sheared -- non-blocking network programming library for Python # Copyright (C) 2003 Sune Kirkeby <sune@mel.interspace.dk> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2...
Python
0.000047
829d32fa8f1724bf2e8a738567f48e7047ce11b6
handle error again
cmsplugin_remote_form/cms_plugins.py
cmsplugin_remote_form/cms_plugins.py
import requests from django.core.mail import EmailMultiAlternatives from django.utils.translation import ugettext_lazy as _ from django.conf import settings try: from django.urls import reverse except ImportError: # handle Django < 1.10 from django.core.urlresolvers import reverse from cms.plugin_base impo...
import requests from django.core.mail import EmailMultiAlternatives from django.utils.translation import ugettext_lazy as _ from django.conf import settings try: from django.urls import reverse except ImportError: # handle Django < 1.10 from django.core.urlresolvers import reverse from cms.plugin_base impo...
Python
0
dcda5039755841ee5eb7faa6d45e763fbede3ee0
update serializer api
hwt/synthesizer/utils.py
hwt/synthesizer/utils.py
# -*- coding: utf-8 -*- from io import StringIO import os from hwt.serializer.store_manager import SaveToStream, StoreManager from hwt.serializer.vhdl.serializer import Vhdl2008Serializer from hwt.synthesizer.dummyPlatform import DummyPlatform from hwt.synthesizer.unit import Unit from hwt.serializer.generic.to_hdl_a...
# -*- coding: utf-8 -*- from io import StringIO import os from hwt.serializer.store_manager import SaveToStream, StoreManager from hwt.serializer.vhdl.serializer import Vhdl2008Serializer from hwt.synthesizer.dummyPlatform import DummyPlatform from hwt.synthesizer.unit import Unit from hwt.serializer.generic.to_hdl_a...
Python
0
6fcce1bcecb15000c671c706588d6fd0d92145e5
Add windbg info to header
voltron/entry.py
voltron/entry.py
""" This is the main entry point for Voltron from the debugger host's perspective. This file is loaded into the debugger through whatever means the given host supports. LLDB: (lldb) command script import /path/to/voltron/entry.py GDB: (gdb) source /path/to/voltron/entry.py VDB: (vdb) script /path/to/v...
""" This is the main entry point for Voltron from the debugger host's perspective. This file is loaded into the debugger through whatever means the given host supports. In LLDB: (lldb) command script import /path/to/voltron/entry.py In GDB: (gdb) source /path/to/voltron/entry.py In VDB: (vdb) script /...
Python
0
2f1df9024ae4a0a070bb058ce075acdb8bcf0474
Include date in email send
weekly-update.py
weekly-update.py
#!/usr/bin/python import sys import xmlrpclib import subprocess import yaml import smtplib import json from datetime import datetime print 'Weekly update started at ' + str(datetime.now()) from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import render from config import * def send...
#!/usr/bin/python import sys import xmlrpclib import subprocess import yaml import smtplib import json from datetime import datetime print 'Weekly update started at ' + str(datetime.now()) from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import render from config import * def send...
Python
0.000003
6aadcd9739e6cbee01164fccae56a37f6130455c
Add CLI for yatsm map; TODO port script
yatsm/cli/map.py
yatsm/cli/map.py
""" Command line interface for creating maps of YATSM algorithm output """ import datetime as dt import logging import os import re import click import numpy as np from osgeo import gdal import patsy from yatsm.cli.cli import (cli, date_arg, date_format_opt, rootdir_opt, resultdir_opt, exam...
""" Command line interface for creating maps of YATSM algorithm output """ from datetime import datetime as dt import logging import os import click import numpy as np from yatsm.cli.cli import cli logger = logging.getLogger('yatsm') @cli.command(short_help='Make map of YATSM output for a given date') @click.pass...
Python
0
3275827ef5578142e07747f9feacc4f47fc22006
Update factorial.py
problems/factorial/factorial.py
problems/factorial/factorial.py
# Recursive factorial def fac(n): return 1 if n == 1 else n * fac(n-1) print(fac(3)) # 6 print(fac(33)) # 8683317618811886495518194401280000000 # Iterative factorial def fac(n): res = i = 1 while i <= n: res *= i i += 1 return res print(fac(3)) # 6 print(fac(33)) # 86833176188118864...
def fac(n): return 1 if n == 1 else n * fac(n-1) print fac(3) print fac(33)
Python
0.000002
b250cfacdb45d85bf6ef7f0a1f28b89935c24b9b
Update settings.py
project-name/my_app/settings.py
project-name/my_app/settings.py
# Snippets from Actual Settings.py TEMPLATES = [ { 'BACKEND': 'django_jinja.backend.Jinja2', "DIRS": ["PROJECT_ROOT_DIRECTORY", "..."], 'APP_DIRS': True, 'OPTIONS': { 'match_extension': '.html', 'context_processors': [ 'django.template.context...
# Snippets from Actual Settings.py TEMPLATES = [ { 'BACKEND': 'django_jinja.backend.Jinja2', "DIRS": "PROJECT_ROOT_DIRECTORY", 'APP_DIRS': True, 'OPTIONS': { 'match_extension': '.html', 'context_processors': [ 'django.template.context_processo...
Python
0.000001
94e85fb24a9b2c327094b880e05251ffb00c1335
Add urls for list by topic and by location
bills/urls.py
bills/urls.py
from . import views from django.conf.urls import url urlpatterns = [ url(r'^by_topic/', views.bill_list_by_topic), url(r'^by_location', views.bill_list_by_location), url(r'^latest_activity/', views.latest_bill_activity), url(r'^latest/', views.latest_bill_actions), url(r'^detail/(?P<bill_id>(.*))/...
from . import views from django.conf.urls import url urlpatterns = [ url(r'^list/', views.bill_list), url(r'^latest_activity/', views.latest_bill_activity), url(r'^latest/', views.latest_bill_actions), url(r'^detail/(?P<bill_id>(.*))/$', views.bill_detail, name='bill_detail'), ]
Python
0
318bf52453055ce00fc1d66006d25ef81f013dfa
change output format a little
bin/evtest.py
bin/evtest.py
#!/usr/bin/env python # encoding: utf-8 ''' evdev example - input device event monitor ''' from sys import argv, exit from select import select from evdev import ecodes, InputDevice, list_devices, AbsInfo usage = 'usage: evtest <device> [<type> <value>]' evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}...
#!/usr/bin/env python # encoding: utf-8 ''' evdev example - input device event monitor ''' from sys import argv, exit from select import select from evdev import ecodes, InputDevice, list_devices, AbsInfo usage = 'usage: evtest <device> [<type> <value>]' evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}...
Python
0.000002
b183a200d2e546de955e5190fefe7b7a61a1fc55
check if no devices were found
bin/evtest.py
bin/evtest.py
#!/usr/bin/env python # encoding: utf-8 ''' evdev example - input device event monitor ''' from sys import argv, exit from select import select from evdev import ecodes, InputDevice, list_devices, AbsInfo usage = 'usage: evtest <device> [<type> <value>]' evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}...
#!/usr/bin/env python # encoding: utf-8 ''' evdev example - input device event monitor ''' from sys import argv, exit from select import select from evdev import ecodes, InputDevice, list_devices, AbsInfo usage = 'usage: evtest <device> [<type> <value>]' evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}...
Python
0.000002
1bc7937bf0c4c65996e586aef997250869bf5ed1
Use python from env.
bin/pylama.py
bin/pylama.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import sys import os from pylama.main import shell if __name__ == '__main__': try: virtual_env = os.environ.get('VIRTUAL_ENV', '') activate_this = os.path.join(virtual_env, 'bin', 'activate_this.py') with open(activate_this) as f: ...
#!/usr/bin/python # -*- coding: utf-8 -*- import re import sys import os from pylama.main import shell if __name__ == '__main__': try: virtual_env = os.environ.get('VIRTUAL_ENV', '') activate_this = os.path.join(virtual_env, 'bin', 'activate_this.py') with open(activate_this) as f: ...
Python
0
c3f14716bc646db003b7852c8f718203ae7a3c3c
Use floor division to ensure result is always an integer
truecolor.py
truecolor.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os if os.getenv('COLORTERM') is None: raise RuntimeError('Not a true color terminal') COLORS = { 'white': (127, 127, 127), 'grey': (64, 64, 64), 'black': (0, 0, 0), 'red': (127, 0, 0), 'green': (0, 127, 0), 'blue': (0, 0, 127), 'y...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os if os.getenv('COLORTERM') is None: raise RuntimeError('Not a true color terminal') COLORS = { 'white': (127, 127, 127), 'grey': (64, 64, 64), 'black': (0, 0, 0), 'red': (127, 0, 0), 'green': (0, 127, 0), 'blue': (0, 0, 127), 'y...
Python
0.000007
b2bc2f50c9866e758c242a6c8b57a86153cc418a
bump version
infi/conf/__version__.py
infi/conf/__version__.py
__version__ = "0.0.11"
__version__ = "0.0.10"
Python
0
583a6319230b89a5f19c26e5bab83e28a5a4792e
Fix the but There is an error (cannot concatenate str and int objects) when the user does not specify the inputs.
pywps/processes/dummyprocess.py
pywps/processes/dummyprocess.py
""" DummyProcess to check the WPS structure Author: Jorge de Jesus (jorge.jesus@gmail.com) as suggested by Kor de Jong """ from pywps.Process import WPSProcess import types class Process(WPSProcess): def __init__(self): # init process WPSProcess.__init__(self, ...
""" DummyProcess to check the WPS structure Author: Jorge de Jesus (jorge.de-jesus@jrc.it) as suggested by Kor de Jong """ from pywps.Process import WPSProcess class Process(WPSProcess): def __init__(self): # init process WPSProcess.__init__(self, i...
Python
0.000002
cc7ffbe88b7b71b32e036be6080f03a353fdbafe
Revert to using get_task_logger
rapidsms/router/celery/tasks.py
rapidsms/router/celery/tasks.py
import celery from celery.utils.log import get_task_logger from rapidsms.errors import MessageSendingError logger = get_task_logger(__name__) @celery.task def receive_async(text, connection_id, message_id, fields): """Task used to send inbound message through router phases.""" from rapidsms.models import Co...
import celery import logging from rapidsms.errors import MessageSendingError logger = logging.getLogger(__name__) @celery.task def receive_async(text, connection_id, message_id, fields): """Task used to send inbound message through router phases.""" from rapidsms.models import Connection from rapidsms.r...
Python
0
74b8aeba66a77b34eacfb1bcaac3f66caa0d8dd7
Fix Python script
CI/runTests.py
CI/runTests.py
import sys import os from OMPython import OMCSession class CITests(): ''' Python class used to run CI tests ''' def __init__(self, rootPath): ''' Constructor starts omc and loads MSL ''' self.rootPath = rootPath self.omc = OMCSession() os.chdir(self.root...
import sys import os from OMPython import OMCSession class CITests(): ''' Python class used to run CI tests ''' def __init__(self, rootPath): ''' Constructor starts omc and loads MSL ''' self.rootPath = rootPath self.omc = OMCSession() os.chdir(self.root...
Python
0.999949
83f2fe37c6eda993d6b9e2cf2d187646a366f6d8
Make timer daemon
playserver/trackchecker.py
playserver/trackchecker.py
from threading import Timer from . import track _listeners = [] class TrackChecker(): def __init__(self, interval = 5): self.listeners = [] self.CHECK_INTERVAL = interval self.currentSong = "" self.currentArtist = "" self.currentAlbum = "" self.timer = None def checkSong(self): song = track.getCurren...
from threading import Timer from . import track _listeners = [] class TrackChecker(): def __init__(self, interval = 5): self.listeners = [] self.CHECK_INTERVAL = interval self.currentSong = "" self.currentArtist = "" self.currentAlbum = "" self.timer = None def checkSong(self): song = track.getCurren...
Python
0.000004
0d3082f46f0ffccaca10d3f53f22e6403783d874
change the range of the mean transmittance plot.
plot_mean_transmittance.py
plot_mean_transmittance.py
import matplotlib.pyplot as plt import common_settings import mean_flux lya_center = 1215.67 settings = common_settings.Settings() m = mean_flux.MeanFlux.from_file(settings.get_mean_transmittance_npy()) fig = plt.figure() ax1 = fig.add_subplot(2, 1, 1) ax2 = ax1.twiny() ax1.plot(m.ar_z, m.get_weighted_mean()) # pl...
import matplotlib.pyplot as plt import common_settings import mean_flux lya_center = 1215.67 settings = common_settings.Settings() m = mean_flux.MeanFlux.from_file(settings.get_mean_transmittance_npy()) fig = plt.figure() ax1 = fig.add_subplot(2, 1, 1) ax2 = ax1.twiny() ax1.plot(m.ar_z, m.get_weighted_mean()) # pl...
Python
0
7e8f8b7ba96ade849eaed239751ef3d00c57d0bd
Update plots_digits_classification.py
examples/classification/plot_digits_classification.py
examples/classification/plot_digits_classification.py
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
Python
0.000001
a906b07afd331872752ffe2325674d6f3f8f938c
Allow points with missing r_chromium
experimental/soundwave/soundwave/tables/timeseries.py
experimental/soundwave/soundwave/tables/timeseries.py
# Copyright 2018 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. import pandas # pylint: disable=import-error TABLE_NAME = 'timeseries' COLUMN_TYPES = ( # Index columns. ('test_suite', str), # benchmark name ('...
# Copyright 2018 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. import pandas # pylint: disable=import-error TABLE_NAME = 'timeseries' COLUMN_TYPES = ( # Index columns. ('test_suite', str), # benchmark name ('...
Python
0.000027
746eace7e4677b034743b25e0f8d53aabd07dd5c
Fix bugs?
autopoke.py
autopoke.py
#!/bin/env python from selenium import webdriver from selenium.common.exceptions import StaleElementReferenceException from time import sleep from getpass import getpass if __name__ == '__main__': driver = webdriver.phantomjs.webdriver.WebDriver() driver.get('https://facebook.com') driver.find_element_by_...
#!/bin/env python from selenium import webdriver from selenium.common.exceptions import StaleElementReferenceException from time import sleep from getpass import getpass if __name__ == '__main__': driver = webdriver.phantomjs.webdriver.WebDriver() driver.get('https://facebook.com') driver.find_element_by_...
Python
0
d9fb8d20948e76d4df176d083e4284d3c99258ca
return int index for userid's in the Netflix dataset
polara/datasets/netflix.py
polara/datasets/netflix.py
import pandas as pd import tarfile def get_netflix_data(gz_file): movie_data = [] movie_inds = [] with tarfile.open(gz_file) as tar: training_data = tar.getmember('download/training_set.tar') with tarfile.open(fileobj=tar.extractfile(training_data)) as inner: for item in inner....
import pandas as pd import tarfile def get_netflix_data(gz_file): movie_data = [] movie_name = [] with tarfile.open(gz_file) as tar: training_data = tar.getmember('download/training_set.tar') with tarfile.open(fileobj=tar.extractfile(training_data)) as inner: for item in inner....
Python
0.000011
5e4b661c446ad3fc9d27e55c7b0cfc9b17e4d8f9
add comment
pyalaocl/useocl/state.py
pyalaocl/useocl/state.py
# coding=utf-8 """ Simple metamodel for object states. Contains definitions for: - State, - Object, - Link, - LinkObject. """ from collections import OrderedDict class State(object): def __init__(self): self.objects = OrderedDict() self.links = OrderedDict() self.linkObject = OrderedDict...
# coding=utf-8 from collections import OrderedDict class State(object): def __init__(self): self.objects = OrderedDict() self.links = OrderedDict() self.linkObject = OrderedDict() class StateElement(object): def __init__(self, state): self.state = state class Object(StateE...
Python
0
64357fbd3c32c112bdae471e538f1a5b65a74fff
Remove unused module.
pybossa/cache/helpers.py
pybossa/cache/helpers.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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...
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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...
Python
0
078621494eb9981733412446aa4eabd9bc54fa52
Update URL for pymssql
lib/sqlalchemy/dialects/mssql/pymssql.py
lib/sqlalchemy/dialects/mssql/pymssql.py
# mssql/pymssql.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mssql+pymssql :name: pymssql :dbapi: pymssql :connectstr...
# mssql/pymssql.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mssql+pymssql :name: pymssql :dbapi: pymssql :connectstr...
Python
0
c824120ea5a33d3ee4cebc61b5bdf6b8258cf11f
remove set_printoptions call from debugging
autograd/scipy/linalg.py
autograd/scipy/linalg.py
from __future__ import division import scipy.linalg import autograd.numpy as anp from autograd.numpy.numpy_wrapper import wrap_namespace from autograd.numpy.linalg import atleast_2d_col as al2d wrap_namespace(scipy.linalg.__dict__, globals()) # populates module namespace def _flip(a, trans): if anp.iscomplexob...
from __future__ import division import scipy.linalg import autograd.numpy as anp from autograd.numpy.numpy_wrapper import wrap_namespace from autograd.numpy.linalg import atleast_2d_col as al2d anp.set_printoptions(precision=3) wrap_namespace(scipy.linalg.__dict__, globals()) # populates module namespace def _fli...
Python
0.000002
5dd8c7d2f14e6323655ca9eb879597ab8b2b0ec4
Fix battery voltage calculation
gate_app.py
gate_app.py
from utime import sleep_ms, sleep import webrepl from mqtt import MQTTClient from machine import Pin, ADC, PWM import secrets # Pin constants LED1 = 16 # GPIO16, D0, Nodemcu led LED2 = 2 # GPIO2, D4, ESP8266 led SWITCH = 5 # GPIO5, D1 BATTERY = 0 # ADC0, A0 BUZZER = 14 # GPIO14, D5 # Resistors in voltage d...
from utime import sleep_ms, sleep import webrepl from mqtt import MQTTClient from machine import Pin, ADC, PWM import secrets # Pin constants LED1 = 16 # GPIO16, D0, Nodemcu led LED2 = 2 # GPIO2, D4, ESP8266 led SWITCH = 5 # GPIO5, D1 BATTERY = 0 # ADC0, A0 BUZZER = 14 # GPIO14, D5 # Resistors in voltage d...
Python
0.000754
0a89c9e32e625e53cbe5ea151aff42031fb833a5
Add canonical link
frappe/website/page_controllers/base_template_page.py
frappe/website/page_controllers/base_template_page.py
import frappe from frappe.website.doctype.website_settings.website_settings import get_website_settings from frappe.website.page_controllers.web_page import WebPage from frappe.website.website_components.metatags import MetaTags class BaseTemplatePage(WebPage): def init_context(self): self.context = frappe._dict()...
import frappe from frappe.website.doctype.website_settings.website_settings import get_website_settings from frappe.website.page_controllers.web_page import WebPage from frappe.website.website_components.metatags import MetaTags class BaseTemplatePage(WebPage): def init_context(self): self.context = frappe._dict()...
Python
0
6a7bc9e7dacd30b27b48d37763c47b2419aca2a9
Change the imports to be Python3 compatible
pyipinfodb/pyipinfodb.py
pyipinfodb/pyipinfodb.py
#!/usr/bin/env python """ Simple python wrapper around the IPInfoDB API. """ import json try: from urllib import urlencode except ImportError: from urllib.parse import urlencode try: import urllib2 except ImportError: import urllib.request as urllib2 import socket class IPInfo() : def __init_...
#!/usr/bin/env python """ Simple python wrapper around the IPInfoDB API. """ import json from urllib import urlencode import urllib2 import socket class IPInfo() : def __init__(self, apikey): self.apikey = apikey def get_ip_info(self, baseurl, ip=None): """ Same as get_city a...
Python
0.99999
305e54c328cf212e01a3af7cec7b940894044e55
Use float, not int for random WPM
gen_test.py
gen_test.py
import math import numpy import random from demodulate.cfg import * def gen_test_data(): pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A' cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ radians_per_sample = cycles_per_sample * 2 * math.pi WPM = random.uniform(2,20) elements_per_second = WPM * 50.0 / 60.0 samples_...
import math import numpy import random from demodulate.cfg import * def gen_test_data(): pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A' cycles_per_sample = MORSE_FREQ/SAMPLE_FREQ radians_per_sample = cycles_per_sample * 2 * math.pi WPM = random.randint(2,20) elements_per_second = WPM * 50.0 / 60.0 samples_...
Python
0.000002
dfb1784009549829a9a9bb1b72be51dacd44ec99
Update auth.py
azurecloudify/auth.py
azurecloudify/auth.py
import requests import json import urllib2 from cloudify import ctx import constants def get_token_from_client_credentials(): client_id = ctx.node.properties['client_id'] client_secret = ctx.node.properties['password'] tenant_id = ctx.node.properties['tenant_id'] endpoints = 'https://login.microsoft...
import requests import json import urllib2 from cloudify import ctx import constants def get_token_from_client_credentials(): client_id = ctx.node.properties['client_id'] client_secret = ctx.node.properties['password'] tenant_id = ctx.node.properties['tenant_id'] endpoints = 'https://login.microsoft...
Python
0.000001
89a18ea91fb2d095541510155dcdf94ad76b8374
Fix broken lookdev loader
mindbender/maya/loaders/mindbender_look.py
mindbender/maya/loaders/mindbender_look.py
import json from mindbender import api from mindbender.maya import lib, pipeline from maya import cmds class LookLoader(api.Loader): """Specific loader for lookdev""" families = ["mindbender.lookdev"] def process(self, asset, subset, version, representation): fname = representation["path"].for...
import json from mindbender import api from mindbender.maya import lib, pipeline from maya import cmds class LookLoader(api.Loader): """Specific loader for lookdev""" families = ["mindbender.look"] def process(self, asset, subset, version, representation): fname = representation["path"].format...
Python
0.000001
33fef0560e14f94bab7d74d0c6a62d2016487822
Tidy urls.py
app/urls.py
app/urls.py
from django.conf.urls.defaults import * from django.contrib import admin from django.contrib.auth.views import login from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings from utils import installed from registration.views import register from sso.forms import Registrati...
from django.conf.urls.defaults import * from django.contrib import admin from django.contrib.auth.views import login from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings from utils import installed from registration.views import register from sso.forms import Registrati...
Python
0.000002
8a9422f7c323394af04f90a43a078098197076b9
fix small bug in dynamic urls.py
app/urls.py
app/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^about', views.about, name='about'), url(r'^test', views.test, name='test'), url(r'^champions/$', views.champions), url(r'^champions/.*', views.champion), url(r'^champions/*',...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^about', views.about, name='about'), url(r'^test', views.test, name='test'), url(r'^champions/$', views.champions), url(r'^champions/.*', views.champion), url(r'^champions/*',...
Python
0.000001
2a1b5dbbd3e0c78df76d904602f1c4fcc6157a6b
Clean up imports
mbus/MBusHandle.py
mbus/MBusHandle.py
from ctypes import Structure, c_uint8, c_void_p, c_int, c_byte class MBusHandle(Structure): _fields_ = [("fd", c_int), ("max_data_retry", c_int), ("max_search_retry", c_int), ("purge_first_frame", c_byte), ("is_serial", ...
from ctypes import Structure, c_uint32, c_uint8, c_void_p, c_int, c_byte class MBusHandle(Structure): _fields_ = [("fd", c_int), ("max_data_retry", c_int), ("max_search_retry", c_int), ("purge_first_frame", c_byte), ("is_ser...
Python
0
cdb3e3872ad0dfa722f9955a7beff38b2cfa3547
remove schema form requester
backend/auth/utils.py
backend/auth/utils.py
import json from django.http import HttpResponse from auth.models import Token def json_response(response_dict, status=200): response = HttpResponse(json.dumps(response_dict), content_type="application/json", status=status) response['Access-Control-Allow-Origin'] = 'memorycms.moome.net' response['Access-C...
import json from django.http import HttpResponse from auth.models import Token def json_response(response_dict, status=200): response = HttpResponse(json.dumps(response_dict), content_type="application/json", status=status) response['Access-Control-Allow-Origin'] = 'http://memorycms.moome.net/' response['...
Python
0
2a4bbb19bf32a08e7c398558d39c201f8b089342
change to len
backend/camservice.py
backend/camservice.py
import cherrypy from cammodule import CamModule, get_camera_list, setup_pygame_camera class CamService(object): def __init__(self): self.camera_list = [] setup_pygame_camera() camera_list = get_camera_list() for camera_index, camera_name in enumerate(camera_list): self....
import cherrypy from cammodule import CamModule, get_camera_list, setup_pygame_camera class CamService(object): def __init__(self): self.camera_list = [] setup_pygame_camera() camera_list = get_camera_list() for camera_index, camera_name in enumerate(camera_list): self....
Python
0.99996
74d85b48f3451f306a31942297be93f03992586e
add a function to calculate the Inbreeding coefficient
asmvar/utils/vcfutils.py
asmvar/utils/vcfutils.py
""" A class for output VCF file. PyVCF does not able to add or update information fields for sample's FORMAT field. That make us have to create another classes (like these) to handle that problem """ import re class Header(object): def __init__(self, hInfo = None): """ VCF header information ...
""" A class for output VCF file. PyVCF does not able to add or update information fields for sample's FORMAT field. That make us have to create another classes (like these) to handle that problem """ import re class Header(object): def __init__(self, hInfo = None): """ VCF header information ...
Python
0.000122
ae7cc245938b1e02974f9b54830146019ca9c0c1
make imports init __init__ prettier
pypeerassets/__init__.py
pypeerassets/__init__.py
from pypeerassets.kutil import Kutil from pypeerassets.provider import * from pypeerassets.__main__ import (deck_parser, find_all_valid_cards, find_all_valid_decks, find_deck, deck...
from pypeerassets.kutil import Kutil from pypeerassets.provider import * from pypeerassets.__main__ import *
Python
0.999726
3aa36ff6ef79f061158ad57b1f4a251b3eeafd7a
Add virtual shift dealer_btn method
pypoker2/engine/table.py
pypoker2/engine/table.py
from pypoker2.engine.card import Card from pypoker2.engine.seats import Seats from pypoker2.engine.deck import Deck class Table: def __init__(self, cheat_deck=None): self.dealer_btn = 0 self.seats = Seats() self.deck = cheat_deck if cheat_deck else Deck() self.__community_card = [] def get_commun...
from pypoker2.engine.card import Card from pypoker2.engine.seats import Seats from pypoker2.engine.deck import Deck class Table: def __init__(self, cheat_deck=None): self.dealer_btn = 0 self.seats = Seats() self.deck = cheat_deck if cheat_deck else Deck() self.__community_card = [] def get_commun...
Python
0
4a62c819f65aba0f68fb07fed2777f9bc88ee2d3
Fix return `Group.get_members()`
vk/groups.py
vk/groups.py
# coding=utf-8 from .fetch import fetch from .users import get_users __all__ = ("groups",) class Group(object): """ Docs: https://vk.com/dev/objects/groups """ __slots__ = ("id", "name", "screen_name", "is_closed", "is_deactivated", "type", "has_photo", "photo_50", "photo_100", "phot...
# coding=utf-8 from .fetch import fetch from .users import get_users __all__ = ("groups",) class Group(object): """ Docs: https://vk.com/dev/objects/groups """ __slots__ = ("id", "name", "screen_name", "is_closed", "is_deactivated", "type", "has_photo", "photo_50", "photo_100", "phot...
Python
0.000024
a96f88faeeec4a63f90764b1c4a5b36466fba699
Rework FeatureProducer to be more general
pelops/etl/extract_feats_from_chips.py
pelops/etl/extract_feats_from_chips.py
import numpy as np from keras.applications.resnet50 import preprocess_input from keras.applications.resnet50 import ResNet50 from keras.models import Model from keras.preprocessing import image from PIL import Image as PIL_Image from pelops.datasets.featuredataset import FeatureDataset def load_image(img_path, resiz...
import numpy as np from keras.applications.resnet50 import ResNet50 from keras.preprocessing import image from keras.applications.resnet50 import preprocess_input from keras.models import Model from PIL import Image as PIL_Image from pelops.datasets.featuredataset import FeatureDataset def load_image(img_path, resiz...
Python
0
58a69bf2dd93027f083fe54721847c438f861f10
Fix import of new data after rebase
statsmodels/datasets/statecrime/data.py
statsmodels/datasets/statecrime/data.py
#! /usr/bin/env python """Statewide Crime Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """Public domain.""" TITLE = """Statewide Crime Data 2009""" SOURCE = """ All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below. """ DESCRSHORT = """State ...
#! /usr/bin/env python """Statewide Crime Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """Public domain.""" TITLE = """Statewide Crime Data 2009""" SOURCE = """ All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below. """ DESCRSHORT = """State ...
Python
0
ea92aeed4dc606def49df643cadc696fec6452b3
fix docstring (again)
python/mapbox_geocode.py
python/mapbox_geocode.py
import __future__ import os, sys, json try: # python 3 from urllib.request import urlopen as urlopen from urllib.parse import quote_plus as quote_plus except: # python 2 from urllib import quote_plus as quote_plus from urllib2 import urlopen as urlopen def geocode(mapbox_access_token, query): ...
import __future__ import os, sys, json try: # python 3 from urllib.request import urlopen as urlopen from urllib.parse import quote_plus as quote_plus except: # python 2 from urllib import quote_plus as quote_plus from urllib2 import urlopen as urlopen def geocode(mapbox_access_token, query): ...
Python
0
d6ffb7c91d3cfd9b9e0caeec41921ec3ddce6efa
rewrite custom command for django 1.10 compatibility
students/management/commands/stcount.py
students/management/commands/stcount.py
from django.core.management.base import BaseCommand from django.contrib.auth.models import User from students.models import Student, Group class Command(BaseCommand): help = 'Prints to console number of students related in database.' models = (('student', Student), ('group', Group), ('user', User)) def...
from django.core.management.base import BaseCommand from django.contrib.auth.models import User from students.models import Student, Group class Command(BaseCommand): args = '<model_name model_name ...>' help = 'Prints to console number of students related in database.' models = (('student', Student), (...
Python
0.000001
42ad2c26368dfaa19efcc5ea57902857aae3e2cf
fix horizon metrics
src/horizon/protocols.py
src/horizon/protocols.py
from twisted.internet.error import ConnectionDone from twisted.internet.protocol import DatagramProtocol, ServerFactory from twisted.protocols.basic import LineOnlyReceiver, Int32StringReceiver from twisted.python import log from utils import SafeUnpickler from cache import MetricCache from regexlist import WhiteList,...
from twisted.internet.error import ConnectionDone from twisted.internet.protocol import DatagramProtocol, ServerFactory from twisted.protocols.basic import LineOnlyReceiver, Int32StringReceiver from twisted.python import log from utils import SafeUnpickler from cache import MetricCache from regexlist import WhiteList,...
Python
0.000022
454c7d322af3328279582aef629736b92c87e869
Revert "It seems the mechanism to declare a namespace package changed."
backports/__init__.py
backports/__init__.py
# This file is part of a backport of 'lzma' included with Python 3.3, # exposed under the namespace of backports.lzma following the conventions # laid down here: http://pypi.python.org/pypi/backports/1.0 # Backports homepage: http://bitbucket.org/brandon/backports # A Python "namespace package" http://www.python.org/d...
# This file is part of a backport of 'lzma' included with Python 3.3, # exposed under the namespace of backports.lzma following the conventions # laid down here: http://pypi.python.org/pypi/backports/1.0 # Backports homepage: http://bitbucket.org/brandon/backports # A Python "namespace package" http://www.python.org/d...
Python
0
d1be7f345529594ba25ed5d0f22e544735a64404
Add a custom admin site header.
qubs_data_centre/urls.py
qubs_data_centre/urls.py
from django.conf.urls import url, include from django.contrib import admin admin.site.site_header = 'QUBS Data Centre Admin' urlpatterns = [ url(r'^api/', include('api.urls')), url(r'^admin/', admin.site.urls), ]
from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^api/', include('api.urls')), url(r'^admin/', admin.site.urls), ]
Python
0
914f95b8acc84828c8a5aea1138415542b066a62
switch order
web3/urls.py
web3/urls.py
"""web3 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
"""web3 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
Python
0.000005
7b6a2a9f4e24f50e1f8aaee482d4ccec4294161b
Update vso.py
tasks/vso.py
tasks/vso.py
__author__ = 'sachinpatney' import json import base64 from urllib.request import urlopen from urllib.request import Request from common import ITask from common import BuildNotifier from common import sync_read_status_file from common import Timeline from common import safe_read_dictionary from common import Icons fr...
__author__ = 'sachinpatney' import json import base64 from urllib.request import urlopen from urllib.request import Request from common import ITask from common import BuildNotifier from common import sync_read_status_file from common import Timeline from common import safe_read_dictionary from common import Icons fr...
Python
0.000001
553cd2cf48ed7be12021b2d9718a1d6fa6cdd2f4
Fix a method call to roll in reordering.
incuna_test_utils/testcases/integration.py
incuna_test_utils/testcases/integration.py
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import render from .request import BaseRequestTestCase class BaseIntegrationTestCase(BaseRequestTestCase): """ A TestCase that operates similarly to a Selenium test. Contains methods that access pages and render them to string...
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import render from .request import BaseRequestTestCase class BaseIntegrationTestCase(BaseRequestTestCase): """ A TestCase that operates similarly to a Selenium test. Contains methods that access pages and render them to string...
Python
0
b2270d751146ed8f27a0d0cc85a10a15ea28dab3
Fix float to byte conversion.
avena/np.py
avena/np.py
#!/usr/bin/env python import numpy import sys _eps = 10.0 * sys.float_info.epsilon # Map of NumPy array type strings to types _np_dtypes = { 'int8': numpy.int8, 'int16': numpy.int16, 'int32': numpy.int32, 'int64': numpy.int64, 'uint8': numpy.uint8, 'uint16': numpy.uint16, ...
#!/usr/bin/env python import numpy import sys _eps = 10.0 * sys.float_info.epsilon # Map of NumPy array type strings to types _np_dtypes = { 'int8': numpy.int8, 'int16': numpy.int16, 'int32': numpy.int32, 'int64': numpy.int64, 'uint8': numpy.uint8, 'uint16': numpy.uint16, ...
Python
0
2b21a07ad1a26f7006809936e5a58e5af710f61b
bump version: 1.0.1
admin_footer/__init__.py
admin_footer/__init__.py
# Copyright Collab 2015-2016 # See LICENSE for details. """ `django-admin-footer` application. """ from __future__ import unicode_literals #: Application version. __version__ = (1, 0, 1) def short_version(version=None): """ Return short application version. For example: `1.0.0`. """ v = version or...
# Copyright Collab 2015-2016 # See LICENSE for details. """ `django-admin-footer` application. """ from __future__ import unicode_literals #: Application version. __version__ = (1, 0, 0) def short_version(version=None): """ Return short application version. For example: `1.0.0`. """ v = version or...
Python
0.000002
64619c465378ee34299961a225f0a3efc22c3d41
Remove unused import.
app/handlers/tests/test_stats_handler.py
app/handlers/tests/test_stats_handler.py
# 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 later version. # # This program is distributed in the hope that it will be usefu...
# 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 later version. # # This program is distributed in the hope that it will be usefu...
Python
0
9968247d4a73549f1c5b02abf8976f11662b46f7
Add a default logger. Specifically log repeated regulation node labels
regcore/settings/base.py
regcore/settings/base.py
"""Base settings file; used by manage.py. All settings can be overridden via local_settings.py""" import os from django.utils.crypto import get_random_string INSTALLED_APPS = [ 'haystack', 'regcore', 'regcore_read', 'regcore_write', 'south' ] SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', get_...
"""Base settings file; used by manage.py. All settings can be overridden via local_settings.py""" import os from django.utils.crypto import get_random_string INSTALLED_APPS = [ 'haystack', 'regcore', 'regcore_read', 'regcore_write', 'south' ] SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', get_...
Python
0
16eda1aac6183f612c678ae555367113f1326c0a
Mark upcoming release number.
registration/__init__.py
registration/__init__.py
VERSION = (2, 2, 0, 'alpha', 0) def get_version(): """ Returns a PEP 386-compliant version number from VERSION. """ assert len(VERSION) == 5 assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') # Now build the two parts of the version number: # main = X.Y[.Z] # sub = .devN - for pre...
VERSION = (2, 1, 2, 'final', 0) def get_version(): """ Returns a PEP 386-compliant version number from VERSION. """ assert len(VERSION) == 5 assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') # Now build the two parts of the version number: # main = X.Y[.Z] # sub = .devN - for pre...
Python
0
cdb1af30a0f48adcb7d94b444642f5a43f5905dd
Make release-notes update timing configurable
bin/cron.py
bin/cron.py
#!/usr/bin/env python from __future__ import print_function, unicode_literals import datetime import os import sys from subprocess import check_call import requests from apscheduler.schedulers.blocking import BlockingScheduler from decouple import config from pathlib2 import Path schedule = BlockingScheduler() DEA...
#!/usr/bin/env python from __future__ import print_function, unicode_literals import datetime import os import sys from subprocess import check_call import requests from apscheduler.schedulers.blocking import BlockingScheduler from decouple import config from pathlib2 import Path schedule = BlockingScheduler() DEA...
Python
0
18e4e457752051dc4d5f57e78e83572638c4fe62
Refactor syncdb replacement. Clone existing schemata if they don't exist at syncdb time.
multi_schema/management/commands/syncdb.py
multi_schema/management/commands/syncdb.py
from django.core.management.commands import syncdb from django.db import models, connection, transaction try: from south.management.commands import syncdb except ImportError: pass from ...models import Schema, template_schema class Command(syncdb.Command): def handle_noargs(self, **options): # En...
from django.core.management.commands import syncdb from django.db import models, connection, transaction try: from south.management.commands import syncdb except ImportError: pass class Command(syncdb.Command): def handle_noargs(self, **options): cursor = connection.cursor() # Ensu...
Python
0
2665aa46702175a0d33ae76cfccdbbbddf42d316
Allow for comments in the sql file that do not start the line.
multi_schema/management/commands/syncdb.py
multi_schema/management/commands/syncdb.py
import os.path from django.core.management.commands import syncdb from django.db import models, connection, transaction try: from south.management.commands import syncdb except ImportError: pass from ...models import Schema, template_schema class Command(syncdb.Command): def handle_noargs(self, **option...
import os.path from django.core.management.commands import syncdb from django.db import models, connection, transaction try: from south.management.commands import syncdb except ImportError: pass from ...models import Schema, template_schema class Command(syncdb.Command): def handle_noargs(self, **option...
Python
0
e2555422c12f0b4cf59d8c636a087eddc3150948
allow CR
anaconda_verify/utils.py
anaconda_verify/utils.py
import sys import collections from anaconda_verify.const import MAGIC_HEADERS, DLL_TYPES def get_object_type(data): head = data[:4] if head not in MAGIC_HEADERS: return None lookup = MAGIC_HEADERS.get(head) if lookup == 'DLL': pos = data.find('PE\0\0') if pos < 0: ...
import sys import collections from anaconda_verify.const import MAGIC_HEADERS, DLL_TYPES def get_object_type(data): head = data[:4] if head not in MAGIC_HEADERS: return None lookup = MAGIC_HEADERS.get(head) if lookup == 'DLL': pos = data.find('PE\0\0') if pos < 0: ...
Python
0.00006
20260402fcdab75ddc98c6ad91c412e8a5fe8d01
add test for empty functions
pychecker2/utest/unused.py
pychecker2/utest/unused.py
from pychecker2.TestSupport import WarningTester from pychecker2 import VariableChecks class UnusedTestCase(WarningTester): def testUnusedBasic(self): self.warning('def f(i, j): return i * 2\n', 1, VariableChecks.UnusedCheck.unused, 'j') self.warning('def _unused(): pass\n', ...
from pychecker2.TestSupport import WarningTester from pychecker2 import VariableChecks class UnusedTestCase(WarningTester): def testUnusedBasic(self): self.warning('def f(i, j): return i * 2\n', 1, VariableChecks.UnusedCheck.unused, 'j') self.warning('def _unused(): pass\n', ...
Python
0.000003
bfaa56817fddbe698d2fe29268185ec6dff5dbe4
Remove two more items from drop-down list
pycon/sponsorship/forms.py
pycon/sponsorship/forms.py
from django import forms from django.contrib.admin.widgets import AdminFileWidget from django.forms.models import inlineformset_factory, BaseInlineFormSet from django.utils.translation import ugettext_lazy as _ from multi_email_field.forms import MultiEmailField from pycon.sponsorship.models import Sponsor, SponsorBe...
from django import forms from django.contrib.admin.widgets import AdminFileWidget from django.forms.models import inlineformset_factory, BaseInlineFormSet from django.utils.translation import ugettext_lazy as _ from multi_email_field.forms import MultiEmailField from pycon.sponsorship.models import Sponsor, SponsorBe...
Python
0.000003
57431b251ec17a13e42cd29640da0fbe2e949cf2
Update version to 0.0.1
qdarkgraystyle/__init__.py
qdarkgraystyle/__init__.py
# -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) <2013-2014> <Colin Duquesnoy> # Copyright (c) <2017> <Michell Stuttgart> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software ...
# -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) <2013-2014> <Colin Duquesnoy> # Copyright (c) <2017> <Michell Stuttgart> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software ...
Python
0
d4ff0f80f065b6f3efa79a5cf17bc4e81a6bb6f2
Add TODO comment.
qipipe/staging/__init__.py
qipipe/staging/__init__.py
""" Image processing preparation. The staging package defines the functions used to prepare the study image files for import into XNAT, submission to the TCIA QIN collections and pipeline processing. """ # OHSU - The ohsu module creates the OHSU QIN collections. # TODO - this should be a config item. from . import oh...
""" Image processing preparation. The staging package defines the functions used to prepare the study image files for import into XNAT, submission to the TCIA QIN collections and pipeline processing. """ # The ohsu module creates the OHSU QIN collections. # TODO - this should be a config item. from . import ohsu
Python
0
0d0041678b598e623b3479942c3dd4fc23c5ab23
Upgrade Pip
perfkitbenchmarker/linux_packages/pip.py
perfkitbenchmarker/linux_packages/pip.py
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
0
d25bfd459bfc03ea7a3a84a26d80b9db8036c168
Add new NAMES_TO_EDITIONS mapping
reporters_db/__init__.py
reporters_db/__init__.py
import datetime import json import os import six from .utils import suck_out_editions, suck_out_names, suck_out_variations_only # noinspection PyBroadException def datetime_parser(dct): for k, v in dct.items(): if isinstance(v, six.string_types): try: dct[k] = datetime.datetime...
import datetime import json import os import six from .utils import suck_out_variations_only from .utils import suck_out_editions # noinspection PyBroadException def datetime_parser(dct): for k, v in dct.items(): if isinstance(v, six.string_types): try: dct[k] = datetime.dateti...
Python
0.000002
cf904c835b11a1180a01000a2a2515aa20581dd1
Reimplement RotateTool using correct maths
plugins/Tools/RotateTool/RotateTool.py
plugins/Tools/RotateTool/RotateTool.py
from UM.Tool import Tool from UM.Event import Event, MouseEvent, KeyEvent from UM.Application import Application from UM.Scene.ToolHandle import ToolHandle from UM.Scene.Selection import Selection from UM.Math.Plane import Plane from UM.Math.Vector import Vector from UM.Math.Quaternion import Quaternion from UM.Math.F...
from UM.Tool import Tool from UM.Event import Event, MouseEvent from UM.Application import Application from UM.Scene.ToolHandle import ToolHandle from UM.Scene.Selection import Selection from UM.Math.Plane import Plane from UM.Math.Vector import Vector from UM.Math.Quaternion import Quaternion from UM.Math.Float impor...
Python
0.000001