repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
sigma-random/pwntools-write-ups | refs/heads/master | wargames/overthewire-vortex/level4/libformatstr/guess.py | 4 | #!/usr/bin/env python2
#-*- coding:utf-8 -*-
from .pattern import *
import sys
def guess_argnum(result, buffer_size, start_index=1):
pattern_size = buffer_size // 8
pat = msfpattern(pattern_size * 4)
if result[:len(pat)] != pat:
return None
result = result[len(pat):].replace("(nil)", "0x00000... |
austinharris/gem5-riscv | refs/heads/master | src/arch/x86/isa/insts/x87/arithmetic/addition.py | 50 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
hinerm/ITK | refs/heads/master | Wrapping/Generators/Ruby/Tests/notYetUsable/ImageRegistration5.py | 4 | #
from InsightToolkit import *
from sys import argv
#
# Read the fixed and moving images using filenames
# from the command line arguments
#
fixedImageReader = itkImageFileReaderF2_New()
movingImageReader = itkImageFileReaderF2_New()
fixedImageReader.SetFileName( argv[1] )
movingImageReader.SetFileName( argv[2] )
... |
snakazawa/qibluemix | refs/heads/master | sample/sttproxy/sttproxy.py | 1 | # -*- coding: utf-8 -*-
u"""
see readme.md
"""
import os
import sys
import time
from naoqi import ALBroker
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from qibluemix import STTProxy, get_logger
from qibluemix.pepper import SpeechRecognitionMemory, StreamingAudioRecorder
from qibluemix.wats... |
michaelpacer/python-future | refs/heads/master | src/libpasteurize/fixes/fix_next.py | 71 | u"""
Fixer for:
it.__next__() -> it.next().
next(it) -> it.next().
"""
from lib2to3.pgen2 import token
from lib2to3.pygram import python_symbols as syms
from lib2to3 import fixer_base
from lib2to3.fixer_util import Name, Call, find_binding, Attr
bind_warning = u"Calls to builtin next() possibly shadowed by global bin... |
datacats/ckanext-webhooks | refs/heads/master | ckanext/webhooks/commands.py | 3 | import ckan.plugins as p
import paste.script
import db
import logging
from ckan.lib.cli import CkanCommand
from ckan import model
log = logging.getLogger(__name__)
class WebhookCommands(CkanCommand):
"""
ckanext-webhooks commands:
Usage::
paster webhooks migrate
"""
summary = __doc__.s... |
moto-timo/ironpython3 | refs/heads/master | Src/IronPython/Lib/runpy.py | 9 | """runpy.py - locating and running Python code using the module namespace
Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.
This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as wel... |
eezee-it/addons-yelizariev | refs/heads/8.0 | mail_move_message/mail_move_message_models.py | 2 | from openerp import api, models, fields, SUPERUSER_ID
from openerp.tools.translate import _
class wizard(models.TransientModel):
_name = 'mail_move_message.wizard'
message_id = fields.Many2one('mail.message', string='Message')
message_body = fields.Html(related='message_id.body', string='Message to move',... |
angelapper/edx-platform | refs/heads/master | common/test/acceptance/tests/lms/test_lms_index.py | 33 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS Index page (aka, Home page). Note that this is different than
what students see @ edx.org because we redirect requests to a separate web application.
"""
import datetime
from common.test.acceptance.pages.lms.index import IndexPage
from common.test.acceptance.te... |
leezu/mxnet | refs/heads/master | tests/python/gpu/test_device.py | 7 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
lfairchild/PmagPy | refs/heads/master | programs/conversion_scripts2/generic_magic2.py | 2 | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from builtins import str
from builtins import range
from past.utils import old_div
import sys
import scipy
import copy
import os
from pmagpy import pmag
def main(command_line=True, **kwargs):
"""
NAME
generic_ma... |
baslr/ArangoDB | refs/heads/3.1-silent | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/pyasn1/pyasn1/codec/der/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
QinerTech/QinerApps | refs/heads/master | openerp/addons/web_settings_dashboard/__openerp__.py | 26 | # -*- coding: utf-8 -*-
{
'name': 'Odoo Settings Dashboard',
'version': '1.0',
'summary': 'Quick actions for installing new app, adding users, completing planners, etc.',
'category': 'Tools',
'description':
"""
Odoo dashboard
==============
* Quick access to install apps
* Quick users add
* Acce... |
TheMOOCAgency/edx-platform | refs/heads/master | openedx/core/djangoapps/monkey_patch/third_party_auth.py | 58 | """
Monkey patch implementation for a python_social_auth Django ORM method that is not Django 1.8-compatible.
Remove once the module fully supports Django 1.8!
"""
from django.db import transaction
from social.storage.django_orm import DjangoUserMixin
from social.apps.django_app.default.models import (
UserSocialA... |
bdh1011/cupeye | refs/heads/master | venv/lib/python2.7/site-packages/pytz/tzinfo.py | 380 | '''Base classes and helpers for building zone specific tzinfo classes'''
from datetime import datetime, timedelta, tzinfo
from bisect import bisect_right
try:
set
except NameError:
from sets import Set as set
import pytz
from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError
__all__ = []
_time... |
UPDDI/mps-database-server | refs/heads/master | resources/migrations/0006.py | 1 | # Generated by Django 2.1.11 on 2019-08-12 19:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('resources', '0005'),
]
operations = [
migrations.AlterField(
model_name='definition',
name='locked',
fi... |
rotcehcm/Dev.f | refs/heads/master | home/models.py | 10644 | from django.db import models
# Create your models here.
|
twistsys/basic-project | refs/heads/master | twist/models.py | 10644 | from django.db import models
# Create your models here.
|
GMOD/jbrowse | refs/heads/master | tests/selenium_tests/welcome_page_test.py | 5 | import unittest
from jbrowse_selenium import JBrowseTest
class WelcomePageTest( JBrowseTest, unittest.TestCase ):
data_dir = 'nonexistent'
def test_volvox( self ):
self.assert_element('//div[contains(@class,"fatal_error")]/h1')
|
genodeftest/yumex-dnf | refs/heads/develop | src/yumex/config.py | 1 | # 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 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
XiaodunServerGroup/medicalmooc | refs/heads/master | common/lib/xmodule/xmodule/util/duedate.py | 256 | """
Miscellaneous utility functions.
"""
from functools import partial
def get_extended_due_date(node):
"""
Gets the actual due date for the logged in student for this node, returning
the extendeded due date if one has been granted and it is later than the
global due date, otherwise returning the glob... |
watchdogpolska/feder | refs/heads/master | feder/institutions/migrations/0006_auto_20160907_2016.py | 1 | # Generated by Django 1.10.1 on 2016-09-07 20:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("institutions", "0005_auto_20160907_1814")]
operations = [
migrations.AlterModelOptions(
name="email",
options={
"ordering... |
urba1n/fabric-bolt | refs/heads/master | src/fabric_bolt/projects/migrations/0002_load_project_type.py | 18 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models import ModelName".
# Use orm.... |
OpusVL/odoo | refs/heads/master | openerp/sql_db.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
seppi91/priceScheduler | refs/heads/master | pricescheduler/contrib/sites/migrations/0001_initial.py | 378 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... |
stutivarshney/Bal-Aveksha | refs/heads/master | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/contrib/contenttypes/models.py | 49 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class ContentTypeManager(models.Manager):
use_in_migrations = True
def __init__(... |
rhertzog/django | refs/heads/master | tests/forms_tests/widget_tests/test_selectdatewidget.py | 35 | from datetime import date
from django.forms import DateField, Form, SelectDateWidget
from django.test import override_settings
from django.utils import translation
from django.utils.dates import MONTHS_AP
from .base import WidgetTest
class SelectDateWidgetTest(WidgetTest):
maxDiff = None
widget = SelectDate... |
windyuuy/opera | refs/heads/master | chromium/src/third_party/scons-2.0.1/engine/SCons/Options/ListOption.py | 61 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 without restriction, including
# without li... |
DarkRebel/myrobotlab | refs/heads/master | src/resource/Python/examples/Tracking.face.py | 2 | from java.lang import String
from java.lang import Class
from java.awt import Rectangle
from org.myrobotlab.service import Runtime
from org.myrobotlab.service import OpenCV
from org.myrobotlab.opencv import OpenCVData
from com.googlecode.javacv.cpp.opencv_core import CvPoint;
from org.myrobotlab.service import OpenCV
f... |
cedub/tower-cli | refs/heads/master | tests/test_resources_inventory_source.py | 2 | # Copyright 2014, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# 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 requi... |
italiangrid/cream-es-testsuite | refs/heads/master | cream_es_testing.py | 1 | # Copyright 2012 Dimosthenes Fioretos dfiore -at- noc -dot- edunet -dot- gr
#
# 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 3 of the License, or
# (at your option) any later ver... |
joshjo/django-sentry | refs/heads/master | sentry/client/celery/__init__.py | 4 | """
sentry.client.celery
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from client import CelerySentryClient |
auduny/home-assistant | refs/heads/dev | homeassistant/components/microsoft/tts.py | 7 | """Support for the Microsoft Cognitive Services text-to-speech service."""
from http.client import HTTPException
import logging
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
from homeassistant.const import CONF_API_KEY, CONF_TYPE
import homeassistant.helpers.co... |
ringcentral/python-sdk | refs/heads/master | ringcentral/subscription/__init__.py | 3 | #!/usr/bin/env python
# encoding: utf-8
from .subscription import Subscription
from .events import Events
|
dannguyen/csvkit | refs/heads/master | csvkit/utilities/csvjoin.py | 3 | #!/usr/bin/env python
import agate
from csvkit.cli import CSVKitUtility, match_column_identifier
class CSVJoin(CSVKitUtility):
description = 'Execute a SQL-like join to merge CSV files on a specified column or columns.'
epilog = 'Note that the join operation requires reading all files into memory. Don\'t tr... |
gpoesia/servo | refs/heads/master | tests/wpt/web-platform-tests/mathml/tools/radicals.py | 101 | #!/usr/bin/python
from utils import mathfont
import fontforge
def createStretchyRadical(aFont):
radicalCodePoint = 0x221a
mathfont.createSquareGlyph(aFont, radicalCodePoint)
g = aFont.createChar(-1, "size1")
mathfont.drawRectangleGlyph(g, mathfont.em, 2 * mathfont.em, 0)
g = aFont.createChar(-1, "... |
bzennn/blog_flask | refs/heads/master | python/lib/python3.5/site-packages/flask_admin/contrib/appengine/form.py | 10 | from wtforms_appengine.ndb import ModelConverter
from .fields import GeoPtPropertyField
from flask_admin.model.form import converts
class AdminModelConverter(ModelConverter):
@converts('GeoPt')
def convert_GeoPtProperty(self, model, prop, kwargs):
"""Returns a form field for a ``ndb.GeoPtPrope... |
jefemagril/fermipy | refs/heads/master | fermipy/diffuse/binning.py | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Small helper class to represent the binning used for a single component
of a summed likelihood in diffuse analysis
"""
from __future__ import absolute_import, division, print_function
import math
import yaml
# Map event type 'key' to evtype bin mask ... |
vaygr/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/sts_session_token.py | 33 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... |
wldcordeiro/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/utils/spider.py | 436 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... |
imruahmed/microblog | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/codec/__init__.py | 96 | # Copyright 2012 Matt Chaput. 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 the... |
S2R2/viper | refs/heads/master | viper/modules/rats/pandora.py | 6 | # Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/Pandora.py
import pefile
def version_21(raw_config):
if raw_config != None:
conf_dict = {}
conf_dict['Version'] = '2.1'
conf_dict['Domain'] = raw_config[0]
conf_dict['Port... |
Micronaet/micronaet-mx | refs/heads/master | sale_discount/__openerp__.py | 1 | ###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# 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 ... |
datachand/h2o-3 | refs/heads/master | h2o-docs/src/booklets/v2_2015/source/glm/glm_poisson_example.py | 10 | # No equivalent running example provided for python due to the
# license of the MASS R package.
#
# poisson_fit = h2o.glm(y = "Claims", x = ["District", "Group", "Age"], training_frame = h2o_df, family = "poisson")
|
bdrillard/spark | refs/heads/master | python/docs/conf.py | 20 | # -*- coding: utf-8 -*-
#
# pyspark documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 28 15:17:47 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... |
szha/mxnet | refs/heads/master | python/mxnet/contrib/quantization.py | 3 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
tbinjiayou/Odoo | refs/heads/master | openerp/osv/query.py | 380 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
ikool/metact06 | refs/heads/master | main.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging, json
from google.appengine.api import users
from flask import Flask, render_template, request, redirect, jsonify
from google.appengine.ext import ndb
from functools import wraps
import os
app = Flask(__name__)
app.jinja_env.line_statement_pref... |
junhe/linux | refs/heads/master | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/withings/const.py | 14 | """Constants used by the Withings component."""
from enum import Enum
import homeassistant.const as const
CONF_PROFILES = "profiles"
CONF_USE_WEBHOOK = "use_webhook"
DATA_MANAGER = "data_manager"
CONFIG = "config"
DOMAIN = "withings"
LOG_NAMESPACE = "homeassistant.components.withings"
PROFILE = "profile"
PUSH_HANDL... |
ResolveWang/algrithm_qa | refs/heads/master | other/q34.py | 1 | """
问题描述:一条直线上有居民点,邮局只能建在居民点上。给定一个有序整型数组arr,
每个值代表居民点的一维坐标,再给定一个正数num,表示邮局数量。选择num个居民
点建立num个邮局,使所有的居民点到邮局的总距离最短,返回最短的总距离。
举例:
arr=[1,2,3,4,5,1000],num=2
第一个邮局建立在3位置,第二个建立在1000位置,那么1位置到邮局距离为2,2位置到
邮局距离为1,3位置到邮局距离为0,4位置到邮局距离为1,5位置到邮局距离为2,1000位置
到邮局距离为0.这种方案下,距离最短,为6,所以返回6
"""
import sys
class PostAddress:
@classm... |
wkjeong/ITK | refs/heads/GPU-Beta | Wrapping/WrapITK/Languages/SwigInterface/pygccxml-1.0.0/pygccxml/declarations/class_declaration.py | 13 | # Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
defines classes, that describes C++ classes
This modules contains definition for next C++ declarations:
- class defini... |
AffiliateCoaches/MerchPy | refs/heads/master | merch.py | 1 | import webbrowser, sys, csv, re, selenium, os, time, shutil
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
def write_le... |
xpansa/account-financial-tools | refs/heads/8.0 | async_move_line_importer/tests/test_async_import.py | 36 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
Emercoin/emercoin | refs/heads/master | qa/rpc-tests/test_framework/blockstore.py | 97 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# BlockStore: a helper class that keeps a map of blocks and implements
# helper functions for ... |
HM2MC/Webfront | refs/heads/master | reportlab-2.5/build/lib.win32-2.7/reportlab/graphics/charts/__init__.py | 14 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/__init__.py
__version__=''' $Id: __init__.py 3345 2008-12-12 17:55:22Z damian $ '''
__doc__='''Business charts'''
|
Exanis/cannelloni | refs/heads/master | backend/filters/csv_export.py | 1 | # -*- coding: utf8 -*-
"Export a flux to a csv file"
from .abstract import AbstractFilter
class CsvExport(AbstractFilter):
"Export a flux to a csv file"
name = "Exportateur CSV"
description = "Export un fichier en CSV"
node_in = ['contenu']
parameters = [
{
'name': 'Chemin d... |
wilywampa/python-mode | refs/heads/develop | pymode/libs/pylint/checkers/python3.py | 2 | # Copyright (c) 2014-2015 Brett Cannon <brett@python.org>
# Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015 Simu Toni <simutoni@gmail.com>
# Copyright (c) 2015 Pavel Roskin <proski@gnu.org>
# Copyright (c) 2015 Viorel Stirbu <viorels@gmail.com>
# Copyright (c) 2015 Cosmin Poieana <cmin... |
Tlxxxxxxx/tera | refs/heads/master | test/testcase/test_launch_ts_first.py | 10 | """
Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
"""
import nose
import common
import time
import subprocess
'''
Test launch TS first
'''
@nose.tools.nottest
@nose.tools.with_setup()
def test_launch_ts_first()... |
dol-sen/portage | refs/heads/master | pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py | 17 | # Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import re
import portage
from portage import os
from portage.const import PORTAGE_PYM_PATH
from portage.tests import TestCase
from portage.util._eventloop.global_event_loop import global_event_loop
from _emerge.... |
prateeksaxena2809/opencog | refs/heads/master | opencog/python/pln_old/examples/context/context_example.py | 28 | """
For running the ContextAgent without the cogserver
"""
from __future__ import print_function
from pln.examples.context import context_agent
from opencog.atomspace import types, AtomSpace, TruthValue
from opencog.scheme_wrapper import load_scm, scheme_eval, scheme_eval_h, __init__
from pln.examples.interactive_agen... |
mohamedhagag/community-addons | refs/heads/8.0 | project_wbs/models/form_button.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Matmoz d.o.o. (Matjaž Mozetič)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import models, api, _
class FormView(models.Model):
_inherit = 'project.project'
@api.multi
def button_save_data(self):
return True... |
andreyvit/pyjamas | refs/heads/master | library/pyjamas/ui/platform/PopupPanelmshtml.py | 7 | #class PopupPanel:
#
# # PopupImpl.onShow
# def onShowImpl(self, popup):
# frame = doc().createElement('iframe')
# frame.scrolling = 'no'
# frame.frameBorder = 0
# frame.style.position = 'absolute'
#
# popup.__frame = frame
# frame.__popup = popup
# fra... |
Therp/odoo | refs/heads/8.0 | addons/purchase/stock.py | 6 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
tylerjereddy/scipy | refs/heads/master | scipy/_lib/_threadsafety.py | 12 | import threading
import scipy._lib.decorator
__all__ = ['ReentrancyError', 'ReentrancyLock', 'non_reentrant']
class ReentrancyError(RuntimeError):
pass
class ReentrancyLock:
"""
Threading lock that raises an exception for reentrant calls.
Calls from different threads are serialized, and nested c... |
jelugbo/hebs_master | refs/heads/master | common/djangoapps/util/tests/test_request.py | 50 | """Tests for util.request module."""
import unittest
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.test.client import RequestFactory
from util.request import course_id_from_url, safe_get_host
class ResponseTestCase(unittest.TestCase):
""" Tests for response... |
mvaled/OpenUpgrade | refs/heads/8.0 | addons/gamification/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
nicodee/mestmentorplatform | refs/heads/master | bs4/tests/test_soup.py | 15 | # -*- coding: utf-8 -*-
"""Tests of Beautiful Soup as a whole."""
import unittest
from bs4 import (
BeautifulSoup,
BeautifulStoneSoup,
)
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
SoupStrainer,
NamespacedAttribute,
)
import bs4.dammit
from bs4.dammit imp... |
scorphus/django | refs/heads/master | django/utils/version.py | 344 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... |
zoyahav/incubator-airflow | refs/heads/master | airflow/contrib/hooks/gcs_hook.py | 8 | # -*- coding: utf-8 -*-
#
# 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
... |
anbangr/trusted-juju | refs/heads/master | juju/control/tests/test_add_relation.py | 1 | import logging
from twisted.internet.defer import inlineCallbacks
from juju.control import main, add_relation
from juju.control.tests.common import ControlToolTest
from juju.charm.tests.test_repository import RepositoryTestBase
from juju.state.tests.test_service import ServiceStateManagerTestBase
class ControlAddRe... |
FezVrasta/js-beautify | refs/heads/master | python/jsbeautifier/tests/testindentation.py | 104 | import re
import unittest
import jsbeautifier
class TestJSBeautifierIndentation(unittest.TestCase):
def test_tabs(self):
test_fragment = self.decodesto
self.options.indent_with_tabs = 1;
test_fragment('{tabs()}', "{\n\ttabs()\n}");
def test_function_indent(self):
test_fragment... |
ddico/odoo | refs/heads/master | addons/website_forum/controllers/__init__.py | 738 | # -*- coding: utf-8 -*-
from . import main
|
Modified-MW-DF/modified-MDF | refs/heads/Master-Branch | MWDF Project/MasterworkDwarfFortress/Utilities/Quickfort/src/qfconvert/geometry.py | 3 | """
Various forms of geometry and geometry related classes used throughout
qfconvert.
"""
from math import sqrt
def compare_points((x1, y1), (x2, y2)):
"""
Returns 0 if the two points are equal.
Returns 1 if x1>x2 or y1>y2.
Returns -1 otherwise.
"""
if x1 == x2 and y1 == y2:
... |
t794104/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_gslbgeodbprofile.py | 28 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.2
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
probcomp/cgpm | refs/heads/master | tests/test_logsumexp.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pylint/test/input/func_w0623_py_30.py | 7 | """Test for W0623, overwriting names in exception handlers."""
# pylint: disable=broad-except,bare-except,print-statement,no-absolute-import,duplicate-except
import exceptions
__revision__ = ''
class MyError(Exception):
"""Special exception class."""
pass
def some_function():
"""A function."""
exc =... |
kenshay/ImageScript | refs/heads/master | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testpkg-packages/pkg/sub2/__init__.py | 26 | """ pkg.sub2.init """
|
K-OverCloud/Composable-VM-Migration | refs/heads/master | dependency/traceAnalyzer.py | 1 | '''
Created on Feb 7, 2017
@author: Jargal
'''
file_path = ""
VMs = []
f = open(file_path, 'r')
class Queue:
def __init__(self):
self.items = []
def isEmpty(self):
return self.items == []
def enqueue(self, item):
self.items.insert(0,item)
def dequeue(self):
return... |
jonnorstrom/CerealKillers | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... |
CruiseDevice/coala | refs/heads/master | coalib/output/printers/__init__.py | 66 | """
This package holds printer objects. Printer objects are general purpose and not
tied to coala.
If you need logging capabilities please take a look at the LogPrinter object
which adds logging capabilities "for free" if used as base class for any other
printer.
"""
|
red010182/pygooglevoice | refs/heads/master | setup.py | 39 | from distutils.core import setup
README = """Python Google Voice
====================
Joe McCall & Justin Quick
Exposing the Google Voice "API" to the Python language
-------------------------------------------------------
Google Voice for Python Allows you to place calls, send sms, download voicemail, and check t... |
Pistachitos/Sick-Beard | refs/heads/Pistachitos | lib/imdb/parser/http/searchKeywordParser.py | 128 | """
parser.http.searchKeywordParser module (imdb package).
This module provides the HTMLSearchKeywordParser class (and the
search_company_parser instance), used to parse the results of a search
for a given keyword.
E.g., when searching for the keyword "alabama", the parsed page would be:
http://akas.imdb.com/find?... |
Menooker/gem5_pcm | refs/heads/master | src/mem/ruby/structures/RubyPrefetcher.py | 22 | # Copyright (c) 2012 Mark D. Hill and David A. Wood
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditio... |
losnikitos/googleads-python-lib | refs/heads/master | examples/dfp/v201411/inventory_service/get_all_ad_units.py | 4 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
dataxu/ansible | refs/heads/dx-stable-2.5 | test/units/modules/network/iosxr/iosxr_module.py | 73 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
hhru/pycerberus-deb | refs/heads/master | pycerberus/lib/attribute_dict.py | 4 | # -*- coding: UTF-8 -*-
# License: Public Domain
# Authors: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
#
# Version 1.0
# 1.0 (06.02.2010)
# - initial release
from unittest import TestCase
__all__ = ['AttrDict']
class AttrDict(dict):
def __getattr__(self, name):
if name not in self:
r... |
zofuthan/edx-platform | refs/heads/master | lms/djangoapps/certificates/migrations/0006_auto__chg_field_generatedcertificate_certificate_id.py | 188 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'GeneratedCertificate.certificate_id'
db.alter_column('certificates_generatedcertificate', 'cert... |
jjx02230808/project0223 | refs/heads/master | sklearn/tests/test_discriminant_analysis.py | 9 | import sys
import numpy as np
from nose import SkipTest
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
fro... |
mohsenSy/zulip | refs/heads/master | zerver/management/commands/process_queue.py | 5 | from __future__ import absolute_import
from types import FrameType
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from django.conf import settings
from django.utils import autoreload
from zerver.worker.queu... |
olujicz/api | refs/heads/master | onelove/schemas/service.py | 5 | from marshmallow import fields
from .application import ApplicationSchema
from .auth import UserSchema
from .base import BaseSchema
class ServiceSchema(BaseSchema):
id = fields.String(description='ID', dump_only=True)
name = fields.String(required=True, description='Service name')
applications = fields.N... |
leonardowolf/bookfree | refs/heads/master | flask/lib/python2.7/site-packages/pip/exceptions.py | 142 | """Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Unin... |
thiagopnts/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/tasks/generate.py | 15 | import os
from pathlib import Path
from subprocess import check_output, check_call
import invoke
@invoke.task(help={
'version': 'version being released',
})
def announce(ctx, version):
"""Generates a new release announcement entry in the docs."""
# Get our list of authors
stdout = check_output(["git"... |
meigrafd/Sample-Code | refs/heads/master | cpuinfo.py | 1 | #!/usr/bin/python
#
# Get CPU Info of RaspberrPi for only one core.
# (c) 10.2015 by meigrafd
#
from __future__ import print_function
def get_cpu_info():
info = [{}]
try:
fo = open('/proc/cpuinfo')
except EnvironmentError, e:
print("Error:", str(e))
else:
for line in fo:
... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/mobile/shared_dressed_weaponsmith_trainer_01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_weaponsmith_trainer_01.iff"
result.attribute_template_... |
jm-begon/randconv | refs/heads/master | randconv/image/imagebuffer.py | 1 | # -*- coding: utf-8 -*-
# Author : Jean-Michel Begon
# Date : Feb 23 2014
"""
A set of container for (image, label) pairs with load-on-request capacities
"""
from copy import copy
try:
import Image
except ImportError:
from PIL import Image
import numpy as np
from .numpy_pil_converter import NumpyToPILConverto... |
pombredanne/pyjs | refs/heads/master | pygtkweb/demos/014-tooltip.py | 6 | #!/usr/bin/env python
# example tooltip.py
import pygtk
pygtk.require('2.0')
import gtk
# Create an Arrow widget with the specified parameters
# and pack it into a button
def create_arrow_button(arrow_type, shadow_type):
button = gtk.Button()
arrow = gtk.Arrow(arrow_type, shadow_type)
button.add(arrow)
... |
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/nx584/binary_sensor.py | 5 | """Support for exposing NX584 elements as sensors."""
import logging
import threading
import time
from nx584 import client as nx584_client
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OPENING,
DEVICE_CLASSES,
PLATFORM_SCHEMA,
BinarySensorEn... |
abdoosh00/edx-rtl-final | refs/heads/master | cms/djangoapps/contentstore/features/textbooks.py | 13 | #pylint: disable=C0111
#pylint: disable=W0621
from lettuce import world, step
from django.conf import settings
from common import upload_file
from nose.tools import assert_equal
TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
@step(u'I go to the textbooks page')
def go_to_uploads(_step):
world.wait_for_js_to_load()
... |
superibk/orp | refs/heads/master | third-party/qemu-orp/scripts/tracetool/format/d.py | 69 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
trace/generated-tracers.dtrace (DTrace only).
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.