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
e1cb95db85ef7edb274a278e1e2c46c2e87d0cb1
Update NLP thingie
api/controllers/nlp.py
api/controllers/nlp.py
from flask import Flask from flask import session from flask import Response from flask import request from flask import redirect, url_for from flask import render_template from api.core import app, db from api.models.user import User from api.models.page import Page from gensim import corpora, models, similarities i...
from flask import Flask from flask import session from flask import Response from flask import request from flask import redirect, url_for from flask import render_template from api.core import app, db from api.models.user import User from api.models.page import Page from gensim import corpora, models, similarities i...
Python
0
425de26b5a7041905862519c727491dd8ec17173
Add root tag.
api/gen_detail_file.py
api/gen_detail_file.py
import timeit import gevent import math from gevent.queue import Queue from detail import AnimeDetail from gen_id_file import IDS_FILENAME from gevent import monkey; monkey.patch_socket() DETAILS_FILENAME = 'animes.xml' BATCH_SIZE = 10 WORKER_NUM = 8 MAXIMUM_WORKER_NUM = 8 NAMES_FOR_WORKER = ['Joe', 'Adam', 'Matt',...
import timeit import gevent import math from gevent.queue import Queue from detail import AnimeDetail from gen_id_file import IDS_FILENAME from gevent import monkey; monkey.patch_socket() DETAILS_FILENAME = 'animes.xml' BATCH_SIZE = 10 WORKER_NUM = 8 MAXIMUM_WORKER_NUM = 8 NAMES_FOR_WORKER = ['Joe', 'Adam', 'Matt',...
Python
0
5a1cb6408397e3dd8eed227f0adcea924de7b0e1
enable new checkin report
reporting/utils.py
reporting/utils.py
""" Utility functions for reports """ from .reports import FamilyTotalOverTimeReport, DependentsTotalOverTimeReport from .reports import FamilyCheckoutsPerWeekReport, DependentCheckoutsPerWeekReport from .reports import EmptyFamilyCheckoutsPerWeekReport, FamilyCheckInsPerWeekReport from .reports import ItemsPerCategor...
""" Utility functions for reports """ from .reports import FamilyTotalOverTimeReport, DependentsTotalOverTimeReport from .reports import FamilyCheckoutsPerWeekReport, DependentCheckoutsPerWeekReport from .reports import EmptyFamilyCheckoutsPerWeekReport from .reports import ItemsPerCategoryPerMonthReport, IndividualsB...
Python
0
0c1b0a7787bd6824815ae208edab8f208b53af09
Add comment to override of status code
api/base/exceptions.py
api/base/exceptions.py
def jsonapi_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array with a 'detail' member """ from rest_framework.views import exception_handler response = exception_handler(exc, context) if response is not None: if 'detail' in response.dat...
def jsonapi_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array with a 'detail' member """ from rest_framework.views import exception_handler response = exception_handler(exc, context) if response is not None: if 'detail' in response.dat...
Python
0
b225011d1892f285b96f67f0c0734c62b4e196b6
Make transactions work again #nodebug
api/base/middleware.py
api/base/middleware.py
from pymongo.errors import OperationFailure from raven.contrib.django.raven_compat.models import sentry_exception_handler from framework.transactions import commands, messages, utils from .api_globals import api_globals # TODO: Verify that a transaction is being created for every # individual request. class TokuTra...
from pymongo.errors import OperationFailure from raven.contrib.django.raven_compat.models import sentry_exception_handler from framework.transactions import commands, messages, utils from .api_globals import api_globals # TODO: Verify that a transaction is being created for every # individual request. class TokuTra...
Python
0.000001
47b9aeff1400beb723cd759109993003d9b0586b
Comment out alpha version of answer generation algorithm.
src/answer_processing/answer_processing.py
src/answer_processing/answer_processing.py
# LING 573 Question Answering System # Code last updated 4/18/14 by Claire Jaja # This code implements an Answer Processor for the question answering system. from general_classes import AnswerTemplate, Passage from operator import itemgetter, attrgetter from collections import Counter, defaultdict class AnswerProcess...
# LING 573 Question Answering System # Code last updated 4/18/14 by Claire Jaja # This code implements an Answer Processor for the question answering system. from general_classes import AnswerTemplate, Passage from operator import itemgetter, attrgetter from collections import Counter, defaultdict class AnswerProcess...
Python
0
0bd4224bfa737942930bfa1e1a67ecfdf25e70e7
Apply WidgetAdapter to CheckboxSelectMultiple.
wagtail/core/widget_adapters.py
wagtail/core/widget_adapters.py
""" Register Telepath adapters for core Django form widgets, so that they can have corresponding Javascript objects with the ability to render new instances and extract field values. """ from django import forms from django.utils.functional import cached_property from wagtail.admin.staticfiles import versioned_static...
""" Register Telepath adapters for core Django form widgets, so that they can have corresponding Javascript objects with the ability to render new instances and extract field values. """ from django import forms from django.utils.functional import cached_property from wagtail.admin.staticfiles import versioned_static...
Python
0
8b38f24fbdee425fde52d33b2154812d10c9d3db
Bump version
wagtailaltgenerator/__init__.py
wagtailaltgenerator/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ wagtailaltgenerator ---------- Insert image description and tags with the help of computer vision """ __title__ = "wagtailaltgenerator" __version__ = "4.1.1" __build__ = 411 __author__ = "Martin Sandström" __license__ = "MIT" __copyright__ = "Copyright 2016-2019 Marti...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ wagtailaltgenerator ---------- Insert image description and tags with the help of computer vision """ __title__ = "wagtailaltgenerator" __version__ = "4.1.0" __build__ = 410 __author__ = "Martin Sandström" __license__ = "MIT" __copyright__ = "Copyright 2016-2018 Marti...
Python
0
a155e8654a95969abc2290d4198622991d6cb00e
Remove duplicate entry for vikidia and gutenberg in burundi boxes
ideascube/conf/idb_bdi.py
ideascube/conf/idb_bdi.py
"""Generic config for Ideasbox of Burundi""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ USER_FORM_FIELDS = ( ('Ideasbox', ['serial', 'box_awareness']), (_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa (...
"""Generic config for Ideasbox of Burundi""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ USER_FORM_FIELDS = ( ('Ideasbox', ['serial', 'box_awareness']), (_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa (...
Python
0
923bcc555c6a039df649d1c2725cc67ad8c79660
Make CMS errors JSON-able if requested via AJAX
cms/djangoapps/contentstore/views/error.py
cms/djangoapps/contentstore/views/error.py
from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound) from mitxmako.shortcuts import render_to_string, render_to_response import functools import json __all__ = ['not_found', 'server_error', 'render_404', 'render_500'] def jsonable_error(status=500, message="T...
from django.http import HttpResponseServerError, HttpResponseNotFound from mitxmako.shortcuts import render_to_string, render_to_response __all__ = ['not_found', 'server_error', 'render_404', 'render_500'] def not_found(request): return render_to_response('error.html', {'error': '404'}) def server_error(reques...
Python
0.000002
f164dd8141133cb78ceeab3ecccc5d756c36da3c
Add optional structured properties for og:image and og:video
lassie/filters/social.py
lassie/filters/social.py
# -*- coding: utf-8 -*- """ lassie.filters.social ~~~~~~~~~~~~~~~~~~~~~ This module contains data social related content to help Lassie filter for content. """ from ..compat import str import re SOCIAL_MAPS = { 'meta': { 'open_graph': { # http://ogp.me/ 'pattern': re.compile(r"^og:", re.I...
# -*- coding: utf-8 -*- """ lassie.filters.social ~~~~~~~~~~~~~~~~~~~~~ This module contains data social related content to help Lassie filter for content. """ from ..compat import str import re SOCIAL_MAPS = { 'meta': { 'open_graph': { # http://ogp.me/ 'pattern': re.compile(r"^og:", re.I...
Python
0
bc199a9eaa2416b35d1d691f580e6c9ca0b1a2ae
Remove node counts and update docstrings on new view for activity
website/discovery/views.py
website/discovery/views.py
from website import settings from website.project import Node from website.project import utils from modularodm.query.querydialect import DefaultQueryDialect as Q def activity(): """Reads node activity from pre-generated popular projects and registrations. New and Noteworthy projects are set manually or thro...
from website import settings from website.project import Node from website.project import utils from modularodm.query.querydialect import DefaultQueryDialect as Q def activity(): node_data = utils.get_node_data() if node_data: hits = utils.hits(node_data) else: hits = {} # New Proje...
Python
0
daba688f4898bdca680ac1cd4b1e2efbc3ef1a1f
Deal with incorrect username.
lastscrape/lastscrape.py
lastscrape/lastscrape.py
#!/usr/bin/env python #-*- coding: utf-8 -*- """usage: lastscrape.py USER [OUTPUT_FILE]""" import sys import time import codecs import urllib2 from BeautifulSoup import BeautifulSoup sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout) def parse_page(page): """Parse a page of recently listened tracks and return a ...
#!/usr/bin/env python #-*- coding: utf-8 -*- """usage: lastscrape.py USER [OUTPUT_FILE]""" import sys import time import codecs import urllib2 from BeautifulSoup import BeautifulSoup sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout) def parse_page(page): """Parse a page of recently listened tracks and return a ...
Python
0
a9803a8a523b8603db93ae18eb7e75e63bb8c44b
Add `dpi` option into `plot_setup`; Fix an importing bug with `matplotlib.pyplot` (#4)
easypyplot/pdf.py
easypyplot/pdf.py
""" $lic$ Copyright (c) 2016-2021, Mingyu Gao This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the imp...
""" $lic$ Copyright (c) 2016-2021, Mingyu Gao This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the imp...
Python
0.000001
1147781292b32177e0733be134f8c83101f0abbf
add comment
weiss/flows/flowManager.py
weiss/flows/flowManager.py
""" Flow Manager NOTE: this class should be created by singleton factory in factory.py this class is responsible for 1. register a user's flow 2. loop up flow by user id Author: Ming Fang <mingf@cs.cmu.edu> """ import logging logger = logging.getLogger(__name__) class FlowManager: def __init__(self):...
""" Flow Mnager NOTE: this class should be created by signleton factory in factory.py this class is responsible for 1. user state factory. 2. loop up state by sid 3. make transit from one state based on a given action Author: Ming Fang <mingf@cs.cmu.edu> """ import logging logger = logging.getLogger(__...
Python
0
c36b90db0f3e633f459afa3328e50b6f5e8b4e1b
Remove debug print.
redash/authentication.py
redash/authentication.py
import functools import hashlib import hmac from flask import request, make_response from flask.ext.googleauth import GoogleFederated import time from werkzeug.contrib.fixers import ProxyFix import werkzeug.wrappers from redash import data, settings class HMACAuthentication(object): def __init__(self, auth): ...
import functools import hashlib import hmac from flask import request, make_response from flask.ext.googleauth import GoogleFederated import time from werkzeug.contrib.fixers import ProxyFix import werkzeug.wrappers from redash import data, settings class HMACAuthentication(object): def __init__(self, auth): ...
Python
0.000001
0e2d058efd310c2060df2a86b1de989eca1e2ea5
Modify cafetaria scraper
server/scraper/resto/cafetaria.py
server/scraper/resto/cafetaria.py
import argparse import os from backoff import retry_session from bs4 import BeautifulSoup from util import parse_money, write_json_to_file import sys from requests.exceptions import ConnectionError, Timeout HTML_PARSER = 'lxml' BASE_URL = 'https://www.ugent.be/student/nl/meer-dan-studeren/resto/ophetmenu/' def get_...
from backoff import retry_session from bs4 import BeautifulSoup from util import parse_money, stderr_print import json import sys from requests.exceptions import ConnectionError, Timeout HTML_PARSER = 'lxml' OUTFILE = "resto/2.0/extrafood.json" BASE_URL = 'https://www.ugent.be/student/nl/meer-dan-studeren/resto/ophet...
Python
0.000001
bb35e83b7977e15cd7df9d1f2e810a730dbafa45
update happy number
leetcode/happy_number.py
leetcode/happy_number.py
# Created by lujin at 6/3/2017 # # 202. Happy Number # # Description: # # Write an algorithm to determine if a number is "happy". # # A happy number is a number defined by the following process: Starting with any positive integer, # replace the number by the sum of the squares of its digits, and repeat the process unti...
# Created by lujin at 6/3/2017 # # 202. Happy Number # # Description: # # Write an algorithm to determine if a number is "happy". # # A happy number is a number defined by the following process: Starting with any positive integer, # replace the number by the sum of the squares of its digits, and repeat the process unti...
Python
0.000002
08ddc93dbea5ccfd8c3f2bc3adf5f9976b0fa54b
Update mrf_clean, slightly more efficient
src/gdal_mrf/mrf_apps/mrf_clean.py
src/gdal_mrf/mrf_apps/mrf_clean.py
#------------------------------------------------------------------------------- # Name: mrf_clean # Purpose: # Copy the tile data and index files of an MRF, ignoring the unused parts # # Author: lucian # # Created: 05/10/2016 # Updated: 07/07/2017 Creates index files with holes if possible # Update...
#------------------------------------------------------------------------------- # Name: mrf_clean # Purpose: # Copy the tile data and index files of an MRF, ignoring the unused parts # # Author: lucian # # Created: 05/10/2016 # Updated: 07/07/2017 Creates index files with holes if possible # # Copy...
Python
0.000002
c91dcf3a55bf12ae8e19b167bfd593cc6dbfc980
Fixing whitespace
windmill/browser/chrome.py
windmill/browser/chrome.py
import commands import tempfile import logging import signal import subprocess import sys, os import urlparse import windmill logger = logging.getLogger(__name__) import safari class Chrome(safari.Safari): def __init__(self): self.chrome_binary = windmill.settings['CHROME_BINARY'] self.test_url = wind...
import commands import tempfile import logging import signal import subprocess import sys, os import urlparse import windmill logger = logging.getLogger(__name__) import safari class Chrome(safari.Safari): def __init__(self): self.chrome_binary = windmill.settings['CHROME_BINARY'] self.test_url = wind...
Python
0.999999
06e0499c5a83a15dafc8563579295b9a8b51f79f
Remove typing annotations for backwards compatibility
cppimport/find.py
cppimport/find.py
import os import sys import cppimport.config def find_file_in_folders(filename, paths): for d in paths: if not os.path.exists(d): continue if os.path.isfile(d): continue for f in os.listdir(d): if f == filename: return os.path.join(d, f...
import os import sys import cppimport.config def find_file_in_folders(filename, paths): for d in paths: if not os.path.exists(d): continue if os.path.isfile(d): continue for f in os.listdir(d): if f == filename: return os.path.join(d, f...
Python
0.000001
aa059d6f2fd45ec0d7de7bb2cd0477ff3552eb14
Handle TLS errors in receivequeuethread
src/network/receivequeuethread.py
src/network/receivequeuethread.py
import errno import Queue import socket import sys import threading import time import addresses from bmconfigparser import BMConfigParser from debug import logger from helper_threading import StoppableThread from inventory import Inventory from network.connectionpool import BMConnectionPool from network.bmproto impor...
import Queue import sys import threading import time import addresses from bmconfigparser import BMConfigParser from debug import logger from helper_threading import StoppableThread from inventory import Inventory from network.connectionpool import BMConnectionPool from network.bmproto import BMProto from queues impor...
Python
0
e968983001cced5391a163ab282ef2f2ded492f6
Remove link to private document.
eliot/__init__.py
eliot/__init__.py
""" Eliot: Logging as Storytelling Suppose we turn from outside estimates of a man, to wonder, with keener interest, what is the report of his own consciousness about his doings or capacity: with what hindrances he is carrying on his daily labors; what fading of hopes, or what deeper fixity of self-del...
""" Eliot: An Opinionated Logging Library Suppose we turn from outside estimates of a man, to wonder, with keener interest, what is the report of his own consciousness about his doings or capacity: with what hindrances he is carrying on his daily labors; what fading of hopes, or what deeper fixity of s...
Python
0
6b2e24700a420c55aca7af214d8a16b79ff90fd4
Fix single commit diff.
ellen/git/diff.py
ellen/git/diff.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from pygit2 import GIT_OBJ_COMMIT from pygit2 import GIT_DIFF_IGNORE_WHITESPACE from ellen.utils import JagareError from ellen.utils.git import _resolve_version from ellen.utils.git import format_diff def diff_wrapper(repository, *w, **kw): ''' Jagare's diff wrapper...
#!/usr/bin/env python # -*- coding: utf-8 -*- from pygit2 import GIT_OBJ_COMMIT from pygit2 import GIT_DIFF_IGNORE_WHITESPACE from ellen.utils import JagareError from ellen.utils.git import _resolve_version from ellen.utils.git import format_diff def diff_wrapper(repository, *w, **kw): ''' Jagare's diff wrapper...
Python
0.000001
f1a84b0dc2d14b25b7d6e2e3f2f2d68002600d1a
Update routes
proptrunk/proptrunk.py
proptrunk/proptrunk.py
from flask import Flask, request, render_template app = Flask(__name__) @app.route('/', methods=['GET']) def hello_world(): return render_template('templates/index.html'. title='Prop Trunk') @app.route('/inventory', methods=['GET']) def get_inventory(): return 'Inventory' @app.route('/inventory', methods=['...
from flask import Flask, request, render_template app = Flask(__name__) @app.route('/') def hello_world(): return render_template('templates/index.html'. title='Prop Trunk') @app.route('/inventory') def inventory(): return 'Inventory' @app.route('/checkout') def checkout(): return 'Checkout' @app.route...
Python
0.000001
cbe84c3220a3da4db36f10d84c63dc08231b3b9f
fix indentation
src/cirrus/plugins/uploaders/fabric_put.py
src/cirrus/plugins/uploaders/fabric_put.py
#!/usr/bin/env python """ _fabric_put_ Uploader plugin that uses fabric to do a remote put """ from fabric.operations import put from cirrus.fabric_helpers import FabricHelper from cirrus.logger import get_logger from cirrus.upload_plugins import Uploader from cirrus.configuration import get_pypi_auth LOGGER = get_...
#!/usr/bin/env python """ _fabric_put_ Uploader plugin that uses fabric to do a remote put """ from fabric.operations import put from cirrus.fabric_helpers import FabricHelper from cirrus.logger import get_logger from cirrus.upload_plugins import Uploader from cirrus.configuration import get_pypi_auth LOGGER = get_...
Python
0.000358
d332f6586a11d9bb122146155bbd5c981dbf8bd4
Add error handling for missing parameters for codeModule image
endpoint/image.py
endpoint/image.py
import os import magic import falcon from sqlalchemy.exc import SQLAlchemyError from .profile import ALLOWED_MIME_TYPES from db import session import model import util class Image(object): def on_get(self, req, resp, context, id): if context == 'profile': try: user = session....
import os import magic import falcon from sqlalchemy.exc import SQLAlchemyError from .profile import ALLOWED_MIME_TYPES from db import session import model import util class Image(object): def on_get(self, req, resp, context, id): if context == 'profile': try: user = session....
Python
0
3b053c1f1c490ee9426bf65c5032e24e9f184568
Increase delay
broken_links/broken_links/settings.py
broken_links/broken_links/settings.py
# -*- coding: utf-8 -*- # Scrapy settings for broken_links project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/en/latest/topics/settings.html # BOT_NAME = 'broken_links' SPIDER_MODULES = ['broken_links...
# -*- coding: utf-8 -*- # Scrapy settings for broken_links project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/en/latest/topics/settings.html # BOT_NAME = 'broken_links' SPIDER_MODULES = ['broken_links...
Python
0.000002
7ccd320aede6ad1674915cd8367206ee1ea3dff3
Remove unused import
smoothtest/autotest/TestRunner.py
smoothtest/autotest/TestRunner.py
# -*- coding: utf-8 -*- ''' Smoothtest Copyright (c) 2014 Juju. Inc Code Licensed under MIT License. See LICENSE file. ''' import importlib import unittest import rel_imp; rel_imp.init() from .base import ChildBase from smoothtest.autotest.base import TestException class TestRunner(ChildBase): ''' Responsabi...
# -*- coding: utf-8 -*- ''' Smoothtest Copyright (c) 2014 Juju. Inc Code Licensed under MIT License. See LICENSE file. ''' import importlib import unittest import rel_imp; rel_imp.init() from .base import ChildBase from smoothtest.autotest.base import TestResult, TestException class TestRunner(ChildBase): ''' ...
Python
0.000001
e2d29e9260528c2ab055d204d0ab547acd8a9560
Use correct section name.
zipline/pipeline/pipeline.py
zipline/pipeline/pipeline.py
from zipline.utils.preprocess import expect_types, optional from .term import Term from .filters import Filter from .graph import TermGraph class Pipeline(object): """ A Pipeline object represents a collection of named expressions to be compiled and executed by a PipelineEngine. A Pipeline has two i...
from zipline.utils.preprocess import expect_types, optional from .term import Term from .filters import Filter from .graph import TermGraph class Pipeline(object): """ A Pipeline object represents a collection of named expressions to be compiled and executed by a PipelineEngine. A Pipeline has two i...
Python
0
51771a5a0365c4f70df77ecd5d76ed51b2be1fe2
add some more messages for tests
csp/test/basic.py
csp/test/basic.py
from twisted.trial.unittest import TestCase from twisted.internet.defer import Deferred from csp.test_helpers import async from csp import Channel, put, take, go, sleep, stop from csp import put_then_callback, take_then_callback class Putting(TestCase): @async def test_immediate_taken(self): ch = Cha...
from twisted.trial.unittest import TestCase from twisted.internet.defer import Deferred from csp.test_helpers import async from csp import Channel, put, take, go, sleep, stop from csp import put_then_callback, take_then_callback class Putting(TestCase): @async def test_immediate_taken(self): ch = Cha...
Python
0
6f6bfa4601ecbba57b7dbce32f337141fb4c9add
long_description
src/setup.py
src/setup.py
# Copyright (c) 2015, DjaoDjin inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
# Copyright (c) 2015, DjaoDjin inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
Python
0.999367
794af1c9c3368af21eab23dcc39818edae53e022
Simplify the trajectory in MacSmoother.
src/prpy/planning/mac_smoother.py
src/prpy/planning/mac_smoother.py
#!/usr/bin/env python # Copyright (c) 2013, Carnegie Mellon University # All rights reserved. # Authors: Michael Koval <mkoval@cs.cmu.edu> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source...
#!/usr/bin/env python # Copyright (c) 2013, Carnegie Mellon University # All rights reserved. # Authors: Michael Koval <mkoval@cs.cmu.edu> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source...
Python
0.000001
5bda2697254744dc42420751c1b49219f65be380
add head 'animation'
src/snake.py
src/snake.py
#!/usr/bin/python from lib_common import * class Snake: def __init__(self, x=0, y=0, size=0): self.position = Vec2(x,y) self.speed = Vec2(0,0) self.body_parts = list() self.body_parts.append(self.position) self.turning_points = list() self.turning_points.append(self.position) for i in xrange(1, s...
#!/usr/bin/python from lib_common import * class Snake: def __init__(self, x=0, y=0, size=0): self.position = Vec2(x,y) self.speed = Vec2(0,0) self.body_parts = list() self.body_parts.append(self.position) self.turning_points = list() self.turning_points.append(self.position) for i in xrange(1, s...
Python
0.003916
075877c728e2db439b53a894fc66dff7d35922ba
Add search in landing
cultures/views.py
cultures/views.py
from django.shortcuts import get_object_or_404 from django.db.models import Q from django.views.generic import( ListView, DetailView, TemplateView ) from .models import ( Culture, God, Temple, Museum, CultureHasPeriod, ) class LandingView(ListView): template_name = 'prueba.html'...
from django.shortcuts import get_object_or_404 from django.views.generic import( ListView, DetailView, TemplateView ) from .models import ( Culture, God, Temple, Museum, CultureHasPeriod, ) class LandingView(ListView): template_name = 'prueba.html' model = Culture class Adv...
Python
0.000001
944ba46e135aea3b58dad63550aeba6cb97bf05e
Set manual episode limit to FUNimation episode feed
src/services/stream/funimation.py
src/services/stream/funimation.py
# All shows: http://www.funimation.com/feeds/ps/shows?limit=100000 # Single show: http://www.funimation.com/feeds/ps/videos?ut=FunimationSubscriptionUser&show_id=7556914&limit=100000 from logging import debug, info, warning, error from datetime import datetime from .. import AbstractServiceHandler from data.models im...
# All shows: http://www.funimation.com/feeds/ps/shows?limit=100000 # Single show: http://www.funimation.com/feeds/ps/videos?ut=FunimationSubscriptionUser&show_id=7556914 from logging import debug, info, warning, error from datetime import datetime from .. import AbstractServiceHandler from data.models import Episode ...
Python
0
446fe02ce407e3d14c1dddd5e58c7b3f54b2ccf9
delete functions
src/video.py
src/video.py
# # video.py # Created by pira on 2017/07/31. # #coding: utf-8 u"""For video processing.""" import numpy as np import cv2 def video2image(filename, n=0): u"""Read mpeg video and divide into jpeg images. @param filename:video filename @param n :number of export images (if n=0, this function exports all im...
# # video.py # Created by pira on 2017/07/31. # #coding: utf-8 u"""For video processing.""" import numpy as np import cv2 def showVideo(filename): pass def video2image(filename, n=0): u"""Read mpeg video and divide into jpeg images. @param filename:video filename @param n :number of export images (if n...
Python
0.000006
f43450ac6ecff870693bf3fcb0d638fcf334d492
Update template file.
src/project_euler/P000_Template.py
src/project_euler/P000_Template.py
# Description: Write Here import logging """ Technique - Write Here Note - Write Here Instrumentation - System Details: 8x Intel Core i7-3630QM CPU @ 2.40GHz, 16GB RAM, Ubuntu 14.04 - Input Details: Write Here - Time for 100 runs: Minimum - NA sec, Average - NA sec, Maximum NA sec - Write Here """ def function_name...
# Description: Write Here """ Technique - Write Here Note - Write Here Instrumentation - System Details: 8x Intel Core i7-3630QM CPU @ 2.40GHz, 16GB RAM, Ubuntu 14.04 - Input Details: Write Here - Time for 100 runs: Minimum - NA sec, Average - NA sec, Maximum NA sec - Write Here """ def function_name(): pass # ...
Python
0
7c9abfc0e9c0187378c0d2f8be0af87c5dbd145a
Update mapplot.py
src/pyensae/graphhelper/mapplot.py
src/pyensae/graphhelper/mapplot.py
""" @file @brief Plotting maps. """ def plot_map_france(ax=None, scale='50m'): """ Creates a map for France using :epkg:`cartopy`. @param ax existing axes or None to create ones @param scale scale in (`10m`, `50m`, `110m`) @return ax .. plot:: ...
""" @file @brief Plotting maps. """ def plot_map_france(ax=None, scale='50m'): """ Creates a map for France using :epkg:`cartopy`. @param ax existing axes or None to create ones @param scale scale in (`10m`, `50m`, `110m`) @return ax .. plot:: ...
Python
0.000001
0d04ec0a0298011740190faf1b110860ef85a668
Change JVM defaults to use Temurin JDK distribution (#15009)
src/python/pants/jvm/subsystems.py
src/python/pants/jvm/subsystems.py
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from pants.option.option_types import DictOption, StrListOption, StrOption from pants.option.subsystem import Subsystem from pants.util.strutil import s...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from pants.option.option_types import DictOption, StrListOption, StrOption from pants.option.subsystem import Subsystem from pants.util.strutil import s...
Python
0
1ae42227d9df745420c1a3db11893589d91ba83e
Add search and search_auto_paging_iter abstract methods (#873)
stripe/api_resources/abstract/searchable_api_resource.py
stripe/api_resources/abstract/searchable_api_resource.py
from __future__ import absolute_import, division, print_function from stripe.api_resources.abstract.api_resource import APIResource class SearchableAPIResource(APIResource): @classmethod def _search( cls, search_url, api_key=None, stripe_version=None, stripe_account=No...
from __future__ import absolute_import, division, print_function from stripe.api_resources.abstract.api_resource import APIResource class SearchableAPIResource(APIResource): @classmethod def _search( cls, search_url, api_key=None, stripe_version=None, stripe_account=No...
Python
0
96a567e8e2d7fe351e90d2b5408f9d1a4cd3a499
Make sure that tracing is always cleaned up for v8_gc_times page_test
telemetry/telemetry/unittest_util/page_test_test_case.py
telemetry/telemetry/unittest_util/page_test_test_case.py
# Copyright 2014 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. """Provide a TestCase base class for PageTest subclasses' unittests.""" import unittest from telemetry import benchmark from telemetry.core import exceptio...
# Copyright 2014 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. """Provide a TestCase base class for PageTest subclasses' unittests.""" import unittest from telemetry import benchmark from telemetry.core import exceptio...
Python
0.000004
5f7bf4f2e885c2343b89bc180b7aaad634b3a011
Remove TestConnectRemote decorator for FreeBSD
test/functionalities/connect_remote/TestConnectRemote.py
test/functionalities/connect_remote/TestConnectRemote.py
""" Test lldb 'process connect' command. """ import os import unittest2 import lldb import pexpect from lldbtest import * class ConnectRemoteTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def test_connect_remote(self): """Test "process connect connect:://localhost:12345".""" #...
""" Test lldb 'process connect' command. """ import os import unittest2 import lldb import pexpect from lldbtest import * class ConnectRemoteTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureFreeBSD('llvm.org/pr18313') def test_connect_remote(self): """Test "process co...
Python
0.000001
2c967d42f141f744e0d84c552dd66ea8e3d75db1
fix end timestep for flows
stockflow.py
stockflow.py
import numpy as np import collections class simulation: def __init__(self, tstep): self.stocks = {} self.flows = collections.OrderedDict() self.tstep = tstep def __getattr__(self,key): return self.stocks[key] if key in self.stocks else self.flows[key]['vals'] def validate_key(self,key): i...
import numpy as np class simulation: def __init__(self, tstep): self.stocks = {} self.flows = {} self.tstep = tstep def __getattr__(self,key): return self.stocks[key] if key in self.stocks else self.flows[key]['vals'] def validate_key(self,key): if key in self.stocks or key in self.flows:...
Python
0.000002
5746233789e87dec900ada1f1d4d1f4f35a50dd0
fix hardcode forward slashes for file paths
Sound.py
Sound.py
import sublime, sublime_plugin from subprocess import check_output, call import threading, random, os class EventSound(sublime_plugin.EventListener): def __init__(self, *args, **kwargs): super(EventSound, self).__init__(*args, **kwargs) if sublime.platform() == "osx": self.play = self....
import sublime, sublime_plugin from subprocess import check_output, call import threading, random class EventSound(sublime_plugin.EventListener): def __init__(self, *args, **kwargs): super(EventSound, self).__init__(*args, **kwargs) if sublime.platform() == "osx": self.play = self.osx_...
Python
0.000002
4791a4a97200a62c195931475c1ee3d7bb3731f8
Add Table to reverb/__init__.py.
reverb/__init__.py
reverb/__init__.py
# Copyright 2019 DeepMind Technologies Limited. # # 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 agr...
# Copyright 2019 DeepMind Technologies Limited. # # 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 agr...
Python
0.000157
f82f41e8c14d665eef6dedc94dfef84054970e9d
modify how we define trusted root basedir
geni/util/trustedroot.py
geni/util/trustedroot.py
import os from gid import * from geni.util.config import Config class TrustedRootList(): def __init__(self, dir=None): if not dir: config = Config() self.basedir = config.path + os.sep + 'trusted_roots' else: self.basedir = dir # create the directory to ...
import os from gid import * class TrustedRootList(): def __init__(self, dir="./trusted_roots"): self.basedir = dir # create the directory to hold the files try: os.makedirs(self.basedir) # if the path already exists then pass except OSError, (errno, strerr): ...
Python
0
62f40f2121f15421cfcb5aef1cad75bce7208fb1
Fix bug with HiddenImageCropWidget
image_cropping/widgets.py
image_cropping/widgets.py
import logging import inspect import warnings from django.db.models import get_model, ObjectDoesNotExist from django.contrib.admin.widgets import AdminFileWidget, ForeignKeyRawIdWidget from django.conf import settings from easy_thumbnails.files import get_thumbnailer logger = logging.getLogger(__name__) def thumbn...
import logging import inspect import warnings from django.db.models import get_model, ObjectDoesNotExist from django import forms from django.contrib.admin.widgets import AdminFileWidget, ForeignKeyRawIdWidget from django.conf import settings from easy_thumbnails.files import get_thumbnailer logger = logging.getLogg...
Python
0
dcc9c2cd5cd66797d4d6f5438bcf74089c667f3c
Modify to make category directory
imagenet/image_crawler.py
imagenet/image_crawler.py
import os import time import random import requests IMAGE_URL_API = 'http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=' OUTPUT_DIR = "images" MAX_NUM_IMAGES_PER_CATEGORY = 100 def download_image(url, filename): try: r = requests.get(url) except Exception: return False if n...
import os import time import requests IMAGE_URL_API = 'http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=' OUTPUT_DIR = "images" MAX_NUM_IMAGES_PER_CATEGORY = 1 def download_image(url, filename): try: r = requests.get(url) except Exception: return False if not r.ok: ...
Python
0
6168b224249f68170f4c41eaff83e9a9dd379bfb
remove add_bindings method
kaarmebot/dispatcher.py
kaarmebot/dispatcher.py
import collections Message = collections.namedtuple('Message', ['source', 'target', 'contents']) class MessageDispatcher: def __init__(self): self.routing_classes = {} def add_binding(self, routing_class, predicate, handler): rc = self.routing_classes.get(routing_class) if rc: ...
import collections Message = collections.namedtuple('Message', ['source', 'target', 'contents']) class MessageDispatcher: def __init__(self): self.routing_classes = {} def add_binding(self, routing_class, predicate, handler): rc = self.routing_classes.get(routing_class) if rc: ...
Python
0.000001
51d435f5815b5e85e09a547b0dab5debb940aad5
drop damaged data
xbaydns/tools/master/idcview.py
xbaydns/tools/master/idcview.py
#!/usr/bin/env python # encoding: utf-8 """ idcview.py Created by QingFeng on 2008-03-17. Copyright (c) 2007 xBayDNS Team. All rights reserved. """ from decimal import Decimal from operator import itemgetter import os, sys, time from xbaydns.conf import sysconf def convfiles(files): agents = [] data = {} ...
#!/usr/bin/env python # encoding: utf-8 """ idcview.py Created by QingFeng on 2008-03-17. Copyright (c) 2007 xBayDNS Team. All rights reserved. """ from decimal import Decimal from operator import itemgetter import os, sys, time from xbaydns.conf import sysconf def convfiles(files): agents = [] data = {} ...
Python
0
98f33028451122b39c49a89d367a406dfd641dc0
use PID class
src/boat_pid_control/src/boat_pid_control/rudderPID.py
src/boat_pid_control/src/boat_pid_control/rudderPID.py
""" PID control for the sailing robot controling sail position based on goal sail direction Inputs: - current heading - goal heading Output: - Change in motor position/motor position TODO: consider tack and jibe """ import rospy from pid_controller_class import PID PROPORTIONAL_GAIN = 0.1 INTEGRAL_GAIN = 0 DERIVA...
""" PID control for the sailing robot controling sail position based on goal sail direction Inputs: - current heading - goal heading Output: - Change in motor position/motor position TODO: consider tack and jibe """ import rospy PROPORTIONAL_GAIN = 0.1 INTEGRAL_GAIN = 0 DERIVATIVE_GAIN = 0 currentHeading = 23 ...
Python
0.000001
ce51f1c3829ac44e67c51a8fc97577f5f897d9e7
bump version
require_i18n/__init__.py
require_i18n/__init__.py
# Copyright Collab 2015 # shortcuts from .util import extract_tower_json # version information __version__ = (1, 0, 0, 'b2') #: For example: `2.0.0` short_version = '.'.join([str(x) for x in __version__[:3]]) #: For example: `2.0.0a1` version = '{}{}'.format('.'.join([str(x) for x in __version__[:-1]]), __versi...
# Copyright Collab 2015 # shortcuts from .util import extract_tower_json # version information __version__ = (1, 0, 0, 'b1') #: For example: `2.0.0` short_version = '.'.join([str(x) for x in __version__[:3]]) #: For example: `2.0.0a1` version = '{}{}'.format('.'.join([str(x) for x in __version__[:-1]]), __versi...
Python
0
f8f9453569667fba4aabe7aaa1669cbfe9e6eb0a
Add a link to the password change page.
DjangoPlugin/tracdjangoplugin/__init__.py
DjangoPlugin/tracdjangoplugin/__init__.py
from trac.core import Component, implements from trac.web.chrome import INavigationContributor from trac.web.api import IRequestFilter, IRequestHandler from trac.wiki.web_ui import WikiModule from trac.util import Markup class CustomWikiModule(WikiModule): """Works in combination with the CustomNavigationBar and ...
from trac.core import Component, implements from trac.web.chrome import INavigationContributor from trac.web.api import IRequestFilter, IRequestHandler from trac.wiki.web_ui import WikiModule from trac.util import Markup class CustomWikiModule(WikiModule): """Works in combination with the CustomNavigationBar and ...
Python
0
3995a031b919705a721cfcd1362076ddf8ffa797
Simplify TestingDumpedMockTask
buildlet/tests/test_dumpedmocktask.py
buildlet/tests/test_dumpedmocktask.py
""" Same as test_cachedtask but mock data is dumped in datastore. This test module serves as functional test for datastore and basis for parallel runner (such as `multiprocessing`) testing. """ from ..datastore.inmemory import ( DataStoreNestableInMemory, DataValuePickledInMemory) # Avoid importing test case at...
""" Same as test_cachedtask but mock data is dumped in datastore. This test module serves as functional test for datastore and basis for parallel runner (such as `multiprocessing`) testing. """ from ..datastore.inmemory import ( DataStoreNestableInMemory, DataValuePickledInMemory) # Avoid importing test case at...
Python
0.000002
4d46001296ad083df6827a9c97333f0f093f31bd
Document new evil magic, and add required var.
example/config.py
example/config.py
# Mnemosyne configuration # ======================= # # This file is a Python script. When run, the following variables will be # defined for you; you may change or add to them as you see fit. # # * ``entries_dir``: a Maildir containing all the blog entries. # * ``layout_dir``: the blog's layout, as a skeleton director...
# Mnemosyne configuration # ======================= # # This file is a Python script. When run, the following variables will be # defined for you; you may change or add to them as you see fit. # # ``entries_dir``: a Maildir containing all the blog entries. # ``layout_dir``: the blog's layout, as a skeleton directory tr...
Python
0
f818b7b8e23bae7d9ceb359ff9a0a3264c8ba69f
Remove unused DATABASE_URL env variable
example_config.py
example_config.py
""" File to easily switch between configurations between production and development, etc. """ import os # You must set each of these in your heroku environment with the heroku # config:set command. See README.md for more information. HEROKU_ENV_REQUIREMENTS = ('HEROKU', 'SECRET_KEY', 'GITHUB_CLIENT_ID', ...
""" File to easily switch between configurations between production and development, etc. """ import os # You must set each of these in your heroku environment with the heroku # config:set command. See README.md for more information. HEROKU_ENV_REQUIREMENTS = ('HEROKU', 'SECRET_KEY', 'GITHUB_CLIENT_ID', ...
Python
0.000001
549190dc81bd4e666a8ca52eed8726a5717a8dde
fix syntax error
migrate/__init__.py
migrate/__init__.py
# -*- coding: utf-8 -*- from .migration import Migration from importlib import import_module import os class Migrator(object): def __init__(self, count, runner_path, migrations_dir, direction, *args, **kwargs): self.count = count self.migrations_dir = migrations_dir self.direction = directi...
# -*- coding: utf-8 -*- from .migration import Migration from importlib import import_module import os class Migrator(object): def __init__(self, count, runner_path, migrations_dir, direction, *args, **kwargs): self.count = count self.migrations_dir = migrations_dir self.direction = directi...
Python
0.000047
68b6444eed6f3a748aa3a0126c20a52a5d56e6f9
Comment added for missing code.
app/notifications/rest.py
app/notifications/rest.py
import uuid from flask import ( Blueprint, jsonify, request ) from app import (notify_alpha_client, api_user) from app.aws_sqs import add_notification_to_queue from app.dao import (templates_dao) from app.schemas import ( email_notification_schema, sms_template_notification_schema) notifications = Bl...
import uuid from flask import ( Blueprint, jsonify, request ) from app import (notify_alpha_client, api_user) from app.aws_sqs import add_notification_to_queue from app.dao import (templates_dao) from app.schemas import ( email_notification_schema, sms_template_notification_schema) notifications = Bl...
Python
0
65e3dcb5f085a0c70c5ad4cc607e561b95b07a49
Replace a verbose patch call with a function that does the same thing
corehq/apps/users/tests/test_middleware.py
corehq/apps/users/tests/test_middleware.py
from __future__ import absolute_import from django.test import TestCase from django.contrib.auth import get_user_model from django.test.client import Client from django_otp.middleware import OTPMiddleware from corehq.util.test_utils import flag_enabled from corehq.apps.users.models import CouchUser from corehq.apps.use...
from __future__ import absolute_import from django.test import TestCase from django.contrib.auth import get_user_model from django.test.client import Client from django_otp.middleware import OTPMiddleware from corehq.util.test_utils import flag_enabled from corehq.apps.users.models import CouchUser from corehq.apps.use...
Python
0.000178
cf61408831d6c0a184076b2a0cbc3050c14aa241
Fix tar content type check (#1398)
insights/core/archives.py
insights/core/archives.py
#!/usr/bin/env python import logging import os import tempfile from contextlib import contextmanager from insights.util import fs, subproc from insights.util.content_type import from_file as content_type_from_file logger = logging.getLogger(__name__) COMPRESSION_TYPES = ("zip", "tar", "gz", "bz2", "xz") class Inv...
#!/usr/bin/env python import logging import os import tempfile from contextlib import contextmanager from insights.util import content_type, fs, subproc from insights.util.content_type import from_file logger = logging.getLogger(__name__) COMPRESSION_TYPES = ("zip", "tar", "gz", "bz2", "xz") class InvalidArchive(...
Python
0
b480426bdc7f5a59523cc9e6250efedd311d0854
fix other minor remark
lib/vsc/utils/testing.py
lib/vsc/utils/testing.py
#!/usr/bin/env python ## # # Copyright 2014-2014 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the H...
#!/usr/bin/env python ## # # Copyright 2014-2014 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the H...
Python
0.003494
5c86a27f3ff324a8a7f74e161eeff4bda62fe0ab
add asynchronous dump
integration_tests/dump.py
integration_tests/dump.py
import os.path import sys import base64 import asyncio from app import Application def dump(request): body = request.body if body is not None: body = base64.b64encode(body).decode('ascii') result = { "method": request.method, "path": request.path, "query_string": request...
import os.path import sys import base64 from app import Application def dump(request): body = request.body if body is not None: body = base64.b64encode(body).decode('ascii') result = { "method": request.method, "path": request.path, "query_string": request.query_string, ...
Python
0.000001
de0c0edafb3e3a128c8ad54e9841c7a188cba328
Format output (#85)
modules/src/time.py
modules/src/time.py
import requests import config import os from templates.text import TextTemplate from datetime import datetime MAPQUEST_CONSUMER_KEY = os.environ.get('MAPQUEST_CONSUMER_KEY', config.MAPQUEST_CONSUMER_KEY) TIME_ZONE_DB_API_KEY = os.environ.get('TIME_ZONE_DB_API_KEY', config.TIME_ZONE_DB_API_KEY) def process(input, enti...
import requests import config import os from templates.text import TextTemplate from datetime import datetime MAPQUEST_CONSUMER_KEY = os.environ.get('MAPQUEST_CONSUMER_KEY', config.MAPQUEST_CONSUMER_KEY) TIME_ZONE_DB_API_KEY = os.environ.get('TIME_ZONE_DB_API_KEY', config.TIME_ZONE_DB_API_KEY) def process(input, enti...
Python
0.000877
38ba5ddbadd02df7d3781526350eb5b060f702fb
remove one of the two softmask items in the doc
librosa/util/__init__.py
librosa/util/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Utilities ========= Array operations ---------------- .. autosummary:: :toctree: generated/ frame pad_center fix_length fix_frames index_to_slice softmask sync axis_sort normalize roll_sparse sparsify_rows buf_to_f...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Utilities ========= Array operations ---------------- .. autosummary:: :toctree: generated/ frame pad_center fix_length fix_frames index_to_slice softmask sync softmask axis_sort normalize roll_sparse sparsify_rows ...
Python
0
bd3a075dd5c08546883b55b868f4e90f4e2e25fa
Fixing typo in target name.
src/untrusted/pthread/pthread.gyp
src/untrusted/pthread/pthread.gyp
# Copyright (c) 2011 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. { 'includes': [ '../../../build/common.gypi', ], 'variables': { 'common_sources': [ 'nc_thread.c', 'nc_mutex.c', 'nc_cond...
# Copyright (c) 2011 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. { 'includes': [ '../../../build/common.gypi', ], 'variables': { 'common_sources': [ 'nc_thread.c', 'nc_mutex.c', 'nc_cond...
Python
0.999999
de5b159360686839cffe82347d0db90301843e22
Update NASM.py
executors/NASM.py
executors/NASM.py
import os import subprocess from cptbox import CHROOTSecurity, SecurePopen from error import CompileError from .utils import test_executor from .resource_proxy import ResourceProxy from judgeenv import env ASM_FS = ['.*\.so'] class Executor(ResourceProxy): def __init__(self, problem_id, source_code): su...
import os import subprocess from cptbox import CHROOTSecurity, SecurePopen from error import CompileError from .utils import test_executor from .resource_proxy import ResourceProxy from judgeenv import env ASM_FS = ['.*\.so'] class Executor(ResourceProxy): def __init__(self, problem_id, source_code): su...
Python
0
3192634b5468c3aff64367366f7419ad0aabf49b
Fix Objective-C executor
executors/OBJC.py
executors/OBJC.py
from subprocess import check_output, CalledProcessError from GCCExecutor import GCCExecutor from judgeenv import env class Executor(GCCExecutor): ext = '.m' objc_flags = [] objc_ldflags = [] command = env['runtime'].get('gobjc') name = 'OBJC' address_grace = 131072 test_program = r''' #i...
from subprocess import check_output, CalledProcessError from GCCExecutor import GCCExecutor from judgeenv import env class Executor(GCCExecutor): ext = '.m' objc_flags = [] objc_ldflags = [] command = env['runtime'].get('gobjc') name = 'OBJC' address_grace = 131072 test_program = r''' #i...
Python
0.998125
47a7321682f3f47c638c133ccbcb3f9daea32e77
add help text for language
molo/core/models.py
molo/core/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from wagtail.wagtailsearch import index from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailimages.edit_handlers import ImageChooserPanel class HomePage(Page): ...
from django.db import models from wagtail.wagtailcore.models import Page from wagtail.wagtailsearch import index from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailimages.edit_handlers import ImageChooserPanel class HomePage(Page): pass class Main(Page): parent_page_types = [] ...
Python
0.00002
9ffcb95f0475c9d3a090b8de62073049f999fcf0
update version
mongoctl/version.py
mongoctl/version.py
__author__ = 'abdul' MONGOCTL_VERSION = '0.9.1'
__author__ = 'abdul' MONGOCTL_VERSION = '0.9.0'
Python
0
b6b8ae74eabd69defcbf46a2e0bd46512872bd40
Add tools to write bidsignore and dataset_description.json
mriqc/utils/bids.py
mriqc/utils/bids.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """PyBIDS tooling""" import os import json from pathlib import Path from collections import defaultdict DEFAULT_TYPES = ["bold", "T1w", "T2w"] def collect_bids_data( layout, participant_label=None, s...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """PyBIDS tooling""" from collections import defaultdict DEFAULT_TYPES = ["bold", "T1w", "T2w"] def collect_bids_data( layout, participant_label=None, session=None, run=None, task=None, bids_type=Non...
Python
0
363bb6f409b4c3184a5b9e72c095b6aca207a11f
Cut 0.9.1 final
fabric/version.py
fabric/version.py
""" Current Fabric version constant plus version pretty-print method. This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during installation, which in turn needs access to this version information.) """ VERSION = (0, 9, 1, "final", 0...
""" Current Fabric version constant plus version pretty-print method. This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during installation, which in turn needs access to this version information.) """ VERSION = (0, 9, 0, "final", 0...
Python
0
9a3cade010fac5831db3aac2b6af020c3f816b73
Make use of CMS content in image group test helper
src/zeit/content/image/testing.py
src/zeit/content/image/testing.py
from __future__ import with_statement import gocept.httpserverlayer.wsgi import gocept.selenium import mimetypes import os.path import pkg_resources import zeit.cms.repository.interfaces import zeit.cms.testing import zeit.content.image.image import zeit.content.image.imagegroup import zeit.workflow.testing import zope...
from __future__ import with_statement import gocept.httpserverlayer.wsgi import gocept.selenium import mimetypes import os.path import pkg_resources import zeit.cms.repository.interfaces import zeit.cms.testing import zeit.content.image.image import zeit.content.image.imagegroup import zeit.workflow.testing import zope...
Python
0
cbf5f26d4a1860082d9e29524146298ad0b4e0db
Support for pkgdb teams.
fedmsg_genacls.py
fedmsg_genacls.py
# -*- coding: utf-8 -*- """ A fedmsg consumer that listens to pkgdb messages to update gitosis acls Authors: Janez Nemanič <janez.nemanic@gmail.com> Ralph Bean <rbean@redhat.com> """ import pprint import subprocess import os import fedmsg.consumers import moksha.hub.reactor class GenACLsConsumer(fed...
# -*- coding: utf-8 -*- """ A fedmsg consumer that listens to pkgdb messages to update gitosis acls Authors: Janez Nemanič <janez.nemanic@gmail.com> Ralph Bean <rbean@redhat.com> """ import pprint import subprocess import os import fedmsg.consumers import moksha.hub.reactor class GenACLsConsumer(fed...
Python
0
5022dada0153bca2c99f2faf302827307078e91a
Remove timestamp from forms
fellowms/forms.py
fellowms/forms.py
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "user", "home_lon", "home_lat", "funding_notes", "inaugur...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "user", "home_lon", "home_lat", "funding_notes", "inaugur...
Python
0.000054
49dc6eec1a6d408723159dec85fb00770edb7fc5
raise error if chunk out of range
lacli/source/chunked.py
lacli/source/chunked.py
from __future__ import division import os import math from sys import maxint from itertools import imap from tempfile import mkstemp from boto.utils import compute_md5 from filechunkio import FileChunkIO class FileHash(object): def __get__(self, instance, owner): try: return (instance.md5, i...
from __future__ import division import os import math from sys import maxint from itertools import imap from tempfile import mkstemp from boto.utils import compute_md5 from filechunkio import FileChunkIO class FileHash(object): def __get__(self, instance, owner): try: return (instance.md5, i...
Python
0.000002
7163894c9c93ff31757de22dab01d1a2f00c67bf
Remove deprecated contrib package access.
law/contrib/__init__.py
law/contrib/__init__.py
# coding: utf-8 __all__ = ["available_packages", "loaded_packages", "load", "load_all"] import os import logging import glob import law from law.util import law_src_path, flatten thisdir = os.path.dirname(os.path.abspath(__file__)) logger = logging.getLogger(__name__) #: List of names of available contrib packa...
# coding: utf-8 __all__ = ["available_packages", "loaded_packages", "load", "load_all"] import os import logging import types import uuid import glob import law from law.util import law_src_path, flatten thisdir = os.path.dirname(os.path.abspath(__file__)) logger = logging.getLogger(__name__) #: List of names o...
Python
0
2a1a5b738bd59880ea223606a321584145d6ba2b
Add archlinux chromium location
leapcast/environment.py
leapcast/environment.py
from __future__ import unicode_literals import argparse import glob import logging import os import sys import uuid logger = logging.getLogger('Environment') def _get_chrome_path(): if sys.platform == 'win32': # First path includes fallback for Windows XP, because it doesn't have # LOCALAPPDATA v...
from __future__ import unicode_literals import argparse import glob import logging import os import sys import uuid logger = logging.getLogger('Environment') def _get_chrome_path(): if sys.platform == 'win32': # First path includes fallback for Windows XP, because it doesn't have # LOCALAPPDATA v...
Python
0.000001
e97a43f4558b19311eea9a5ef508502c7151256f
fix periodic task schedule_updates()
mygpo/data/tasks.py
mygpo/data/tasks.py
from operator import itemgetter from datetime import datetime, timedelta from celery.decorators import periodic_task from mygpo.data.podcast import calc_similar_podcasts from mygpo.celery import celery from mygpo.podcasts.models import Podcast from celery.utils.log import get_task_logger logger = get_task_logger(__n...
from operator import itemgetter from datetime import datetime, timedelta from celery.decorators import periodic_task from mygpo.data.podcast import calc_similar_podcasts from mygpo.celery import celery from mygpo.podcasts.models import Podcast @celery.task def update_podcasts(podcast_urls): """ Task to update a...
Python
0.000001
140b8b829f566a75a09a1ff7bc2d7d4ba4ea5272
fix version
newfies/__init__.py
newfies/__init__.py
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2012 Star2B...
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2012 Star2B...
Python
0.000001
df5bcec8f6d05a27ba6be3ea0af401ab6045d636
Bump version to 0.5.2
nio_cli/__init__.py
nio_cli/__init__.py
__version__ = '0.5.2'
__version__ = '0.5.1'
Python
0.000001
1ba61407beaa25944badeea5ea535393b982b733
update aliases based on signals
lib/smashlib/aliases.py
lib/smashlib/aliases.py
""" smashlib.aliases """ from types import StringTypes from collections import defaultdict, namedtuple from smashlib.util import list2table, colorize, report from smashlib.smash_plugin import SmashPlugin def add_new_aliases(bus, name=None): """ this function will be attached to the post-activation signal """ ...
""" smashlib.aliases """ from types import StringTypes from collections import defaultdict, namedtuple from smashlib.smash_plugin import SmashPlugin class Alias(namedtuple('Alias', 'alias affiliation'.split())): pass class RegistrationList(list): def __repr__(self): return '<{0}: {1}>'.format(self....
Python
0.000001
37f6e4f362586d6d966aad52b1df7d5e00baf148
Update regsvr32.py
lib/stagers/regsvr32.py
lib/stagers/regsvr32.py
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'regsvr32', 'Author': ['@subTee', '@enigma0x3'], 'Description': ('Generates an sct file (COM Scriptlet) Host this anywhere'), 'Comments': [ ...
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'regsvr32', 'Author': ['@subTee', '@enigma0x3'], 'Description': ('Generates an sct file (COM Scriptlet) Host this anywhere'), 'Comments': [ ...
Python
0
30b2247a9a7117a0662a111ae7161edc52634b17
Make sure users without a first name aren't returned
lily/users/api/views.py
lily/users/api/views.py
import django_filters from rest_framework import viewsets, mixins, status from rest_framework.authtoken.models import Token from rest_framework.decorators import list_route from rest_framework.exceptions import PermissionDenied from rest_framework.response import Response from .serializers import LilyGroupSerializer, ...
import django_filters from rest_framework import viewsets, mixins, status from rest_framework.authtoken.models import Token from rest_framework.decorators import list_route from rest_framework.exceptions import PermissionDenied from rest_framework.response import Response from .serializers import LilyGroupSerializer, ...
Python
0
8c5de29849ca061ed528c93c36fb3479aef34e41
Update ipc_lista1.15.py
lista1/ipc_lista1.15.py
lista1/ipc_lista1.15.py
#ipc_lista1.15 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # # qHora = input("Quanto você ganha por hora: ") hT = input("Quantas horas você trabalhou: ") SalBruto = qHora ir = (11/100.0 * salBruto) inss = (8/100.0m* SalBruto) sindicato = (5/100.0 * SalBruto) vT = ir + sindicato SalLiq = SalBru...
#ipc_lista1.15 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # # qHora = input("Quanto você ganha por hora: ") hT = input("Quantas horas você trabalhou: ") SalBruto = qHora ir = (11/100.0 * salBruto) inss = (8/100.0m* SalBruto) sindicato = (5/100.0 * SalBruto) vT = ir + sindicato SalLiq = SalBru...
Python
0
6653e7d9289290b97f06e2b46314a12e194bfc6a
Update ipc_lista1.18.py
lista1/ipc_lista1.18.py
lista1/ipc_lista1.18.py
#ipc_lista1.18 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça o tamanho de um arquivo para download(em MB) e a velocidade de um link de internet (em Mbps), calcule e informe o tempo aproximado de downloado do arquivo usando este link (em minutos). arquivo = input("Infor...
#ipc_lista1.18 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça o tamanho de um arquivo para download(em MB) e a velocidade de um link de internet (em Mbps), calcule e informe o tempo aproximado de downloado do arquivo usando este link (em minutos). #
Python
0
6c4d6587939b6e186fdc7c76448803559a00d5ea
Update ipc_lista2.02.py
lista2/ipc_lista2.02.py
lista2/ipc_lista2.02.py
#ipc_lista2.02 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça um valor e mostre na tela
#ipc_lista2.02 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça um valor e mostre
Python
0
b029ecf823cb97c1d70a7599787bd798b9a95ac6
Update ipc_lista2.06.py
lista2/ipc_lista2.06.py
lista2/ipc_lista2.06.py
#ipc_lista2.06 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que leia três números e mostre o maior deles. number1 = number2
#ipc_lista2.06 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que leia três números e mostre o maior deles.
Python
0
37a55d4d0d4dd5827f1cd3e8cc62f3ac59f645fb
Remove old 'MIDDLEWARE_CLASSES'.
xadmin/plugins/language.py
xadmin/plugins/language.py
from django.conf import settings from django.template import loader from django.views.i18n import set_language from xadmin.plugins.utils import get_context_dict from xadmin.sites import site from xadmin.views import BaseAdminPlugin, CommAdminView, BaseAdminView class SetLangNavPlugin(BaseAdminPlugin): def block...
from django.conf import settings from django.template import loader from django.views.i18n import set_language from xadmin.plugins.utils import get_context_dict from xadmin.sites import site from xadmin.views import BaseAdminPlugin, CommAdminView, BaseAdminView class SetLangNavPlugin(BaseAdminPlugin): def block...
Python
0.000042
5b0386d0872d4106902655ada78389503c62a95a
Add some default feedback types for item requests
yunity/models/relations.py
yunity/models/relations.py
from django.db.models import ForeignKey, DateTimeField, ManyToManyField from yunity.models.entities import User, Location, Mappable, Message from yunity.models.utils import BaseModel, MaxLengthCharField from yunity.utils.decorators import classproperty class Chat(BaseModel): participants = ManyToManyField(User) ...
from django.db.models import ForeignKey, DateTimeField, ManyToManyField from yunity.models.entities import User, Location, Mappable, Message from yunity.models.utils import BaseModel, MaxLengthCharField from yunity.utils.decorators import classproperty class Chat(BaseModel): participants = ManyToManyField(User) ...
Python
0
38b93a1c71aae112ec5a18234b1814b49d41066c
Add a test for operator / with an integer.
jpmesh/test/test_angle.py
jpmesh/test/test_angle.py
""" Tests for jpmesh.angle. """ import unittest from jpmesh.angle import Angle class TestAngle(unittest.TestCase): """ Tests for jpmesh.angle.Angle. """ def test_properties(self): """ Test for properties. """ millisecond = 3600000 angle = Angle.from_milliseco...
""" Tests for jpmesh.angle. """ import unittest from jpmesh.angle import Angle class TestAngle(unittest.TestCase): """ Tests for jpmesh.angle.Angle. """ def test_properties(self): """ Test for properties. """ millisecond = 3600000 angle = Angle.from_milliseco...
Python
0.000002
af4c5a72afb80ff59662cc6992ce3084fed75dfe
Fix dedupe not preserving order
node/deduplicate.py
node/deduplicate.py
#!/usr/bin/env python from nodes import Node class Deduplicate(Node): char = "}" args = 1 results = 1 @Node.test_func([2], [4]) @Node.test_func([1.5], [3]) def double(self, inp: Node.number): """inp*2""" return inp*2 @Node.test_func([[1,2,3,1,1]], [[1,2,3]]) ...
#!/usr/bin/env python from nodes import Node class Deduplicate(Node): char = "}" args = 1 results = 2 @Node.test_func([2], [4]) @Node.test_func([1.5], [3]) def double(self, inp: Node.number): """inp*2""" self.results = 1 return inp*2 def func(self, seq...
Python
0.000144
2c41bcc21f01be159be384fe5fa30c824dfb345c
Bump version to 14.0.0a7
resolwe_bio/__about__.py
resolwe_bio/__about__.py
"""Central place for package metadata.""" # NOTE: We use __title__ instead of simply __name__ since the latter would # interfere with a global variable __name__ denoting object's name. __title__ = 'resolwe-bio' __summary__ = 'Bioinformatics pipelines for the Resolwe platform' __url__ = 'https://github.com/genial...
"""Central place for package metadata.""" # NOTE: We use __title__ instead of simply __name__ since the latter would # interfere with a global variable __name__ denoting object's name. __title__ = 'resolwe-bio' __summary__ = 'Bioinformatics pipelines for the Resolwe platform' __url__ = 'https://github.com/genial...
Python
0
05c319f868215f832e97577f5e158edf82fab074
Change version for next release
markdown/__version__.py
markdown/__version__.py
# # markdown/__version__.py # # version_info should conform to PEP 386 # (major, minor, micro, alpha/beta/rc/final, #) # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" # (1, 2, 0, 'beta', 2) => "1.2b2" version_info = (2, 6, 0, 'zds', 8) def _get_version(): " Returns a PEP 386-compliant version number from version_info. " ...
# # markdown/__version__.py # # version_info should conform to PEP 386 # (major, minor, micro, alpha/beta/rc/final, #) # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" # (1, 2, 0, 'beta', 2) => "1.2b2" version_info = (2, 6, 0, 'zds', 7) def _get_version(): " Returns a PEP 386-compliant version number from version_info. " ...
Python
0
2905d3ede8a34db95fc6a9321d77f60c59f90cc1
Suppress multiple long reports
stores/weathprov/providerutils.py
stores/weathprov/providerutils.py
import json import config import logsupport from logsupport import ConsoleWarning, ConsoleDetail WeathProvs = {} TermShortener = {} StillLong = {} GenericShortener = { 'moderate': 'mdrt', 'thunder': 'thndr', 'patchy': 'pchy', 'chance': 'chc', 'freezing': 'frzing', 'light': 'lt', 'heavy': 'hvy', 'shower': '...
import json import config import logsupport from logsupport import ConsoleWarning, ConsoleDetail WeathProvs = {} TermShortener = {} StillLong = {} GenericShortener = { 'moderate': 'mdrt', 'thunder': 'thndr', 'patchy': 'pchy', 'chance': 'chc', 'freezing': 'frzing', 'light': 'lt', 'heavy': 'hvy', 'shower': '...
Python
0.999489
ad3231adb29bc130cfff6a9d42bcd407d13ba17b
Test handling errors from Client 2.1 HTTPConnection/HTTPSConnection
a10_neutron_lbaas/tests/unit/test_acos_client_extensions.py
a10_neutron_lbaas/tests/unit/test_acos_client_extensions.py
# Copyright 2016, A10 Networks # # 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 agre...
# Copyright 2016, A10 Networks # # 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 agre...
Python
0
ab10f3d134065047a7260662d3c39295904795b8
Add fkey constraints at the same time
migration/versions/001_initial_migration.py
migration/versions/001_initial_migration.py
from sqlalchemy import * from migrate import * import annotateit from annotateit import db from annotateit.model import Consumer, User meta = MetaData() consumer = Table('consumer', meta, Column('id', Integer, primary_key=True, nullable=False), Column('key', String), Column('secret', String), Column(...
from __future__ import print_function from getpass import getpass import readline import sys from sqlalchemy import * from migrate import * from migrate.changeset.constraint import ForeignKeyConstraint import annotateit from annotateit import db from annotateit.model import Consumer, User meta = MetaData() consumer...
Python
0.000001
2690f80cc389b2747a07a5327927e1f5a6158bf9
move to get/set model
supernova_keyring_helper/shell.py
supernova_keyring_helper/shell.py
import sys import getpass import argparse from supernova import supernova from supernova import executable def write(msg): sys.stdout.write(msg) sys.stdout.flush() def input_value(): try: value = sys.stdin.readline().rstrip('\n') except KeyboardInterrupt: value = '' if len(value)...
import sys import getpass import argparse from supernova import supernova from supernova import executable def write(msg): sys.stdout.write(msg) sys.stdout.flush() def get_value(): try: value = sys.stdin.readline().rstrip('\n') except KeyboardInterrupt: value = '' if len(value) <...
Python
0
6ea40899c81a563f4e9a51b8c087f11f8557374b
Add continuous matching toggle check box
microphone_match_gui.py
microphone_match_gui.py
#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QCheckBox, QProgressBar) from PyQt5.QtCore i...
#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QProgressBar) from PyQt5.QtCore import (QCoreApplication, QThread, QBasicTimer) import microphone_match def...
Python
0
d8e7bc454a3dea91f48905d32adeb9b1e8f11c5e
Add check_download_path to configuration and changes the get method
migmig/configuration.py
migmig/configuration.py
# Configuration module # ## tmp note: you should add logger module and modify this module # from ConfigParser import SafeConfigParser import os program_name = "migmig" # config file short path (hard coded !) cfg_short_path = "~/." + program_name + ".ini" server_address = "localhost" server_port = "50001" class Co...
# Configuration module # ## tmp note: you should add logger module and modify this module # from ConfigParser import SafeConfigParser import os program_name = "migmig" # config file short path (hard coded !) cfg_short_path = "~/." + program_name + ".ini" server_address = "localhost" server_port = "50001" class Co...
Python
0