repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
ledtvavs/repository.ledtv | plugin.video.UFC/default.py | # -*- coding: utf-8 -*-
#----------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Addon: UFC
# Author: Al
#----------------------------------------------------------------
import os # access operating system commands
import urlparse # spl... |
EcoFun/fasta-tools | fastaSortName.py | #!/bin/env python2
__author__ = "Ludovic Duvaux"
__maintainer__ = "Ludovic Duvaux"
__license__ = "GPL_v3"
import sys, numpy, argparse
v=0
# 0.1) get options from commands lines
parser = argparse.ArgumentParser(description='Sort alphabetically sequences from a fasta file')
parser.add_argument('-f', '--first', help='N... |
jeremiah-c-leary/vhdl-style-guide | vsg/rules/generate/rule_013.py |
from vsg import token
from vsg.rules import single_space_between_token_pairs
lTokens = []
lTokens.append([token.case_generate_statement.end_generate_keyword, token.case_generate_statement.end_generate_label])
lTokens.append([token.for_generate_statement.end_generate_keyword, token.for_generate_statement.end_generate... |
MediffRobotics/DeepRobotics | Experiments/ImitationDetection/PreprocessImgs.py | import os.path
import numpy as np
from six.moves import urllib
import tensorflow as tf
import re
from tensorflow.python.framework import graph_util
from tensorflow.python.framework import tensor_shape
from tensorflow.python.platform import gfile
from tensorflow.python.util import compat
import cv2
class Preprocessing... |
Taifxx/xxtrep | context.addtolib/resources/lib/ext/comps.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# 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 version.... |
qmarlats/pyquizz | env-3/bin/rst2odt.py | #!/home/qmarlats/Documents/Projets/utbm/pyquizz/env-3/bin/python3
# $Id: rst2odt.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
A front end to the Docutils Publisher, producing OpenOffice documents.
"""
import sys
... |
HiSPARC/topaz | 150224_501_510/detector_offsets.py | import tables
from numpy import arange, histogram
from scipy.optimize import curve_fit
from artist import Plot
from sapphire.utils import gauss
EVENTDATA_PATH = '/Users/arne/Datastore/501_510/e_501_510_141101_150201.h5'
COLORS = ['black', 'green', 'blue', 'teal', 'orange', 'purple', 'cyan', 'red',
'gray']... |
fumitoh/modelx | modelx/tests/core/space/dynamic_spaces/test_space_parameters.py | import pytest
from textwrap import dedent
from modelx import *
@pytest.fixture
def samplemodel():
model = new_model()
base_space = model.new_space(name="base")
foo_def = dedent(
"""\
def foo(x):
if x == 0:
return x0
else:
return foo(x - 1)
"""
... |
palmtree5/palmtree5-cogs | srrecords/srrecords.py | import asyncio
import datetime
import os
from datetime import datetime as dt
from random import choice as randchoice
import aiohttp
import discord
from redbot.core import Config, checks, commands
from redbot.core.i18n import Translator
numbs = {"next": "➡", "back": "⬅", "exit": "❌"}
class SRRecords(commands.Cog):
... |
p0psicles/SickRage | sickbeard/providers/newpct.py | # coding=utf-8
# Author: CristianBB
# Greetings to Mr. Pine-apple
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 versio... |
Mkaysi/weechat.org | weechat/news/feeds.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat.org.
#
# WeeChat.org 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 versio... |
mganeva/mantid | scripts/test/IndirectCommonTests.py | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
"""Test suite for the utility functions in th... |
doirisks/dori | models/10.1161:CIRCULATIONAHA.108.816694/exampled.py | """
exampled.py
by Ted Morin
contains example code for 30-year CVD calculator
10.1161/CIRCULATIONAHA.108.816694
2009 Predicting the Thirty-year Risk of Cardiovascular Disease
The Framingham Heart Study
"""
from modeld import model as d
dscores = []
dscores.append( d(1,53,125,1,0,1,20) ) #m,53yrs,125sbp,treated,nosmo... |
robocomp/robocomp | tools/yaku/pyaku/_main.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import sys
from collections import OrderedDict
from time import sleep
import dbus
import os
import shlex
import subprocess
from pyaku import get_logger
logger = get_logger(__name__)
TAB_SHELL_CODE = """
#create new tab for %s
qdbus org.kde.yakuake /yakua... |
oczkers/gdown | gdown/cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""gdown (command-line interface to the gdown library)
Usage:
gdown
gdown -h | --help | --version
gdown accinfo site username passwd
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
from . import __title_... |
mmariani/dream | dream/simulation/Part.py | # ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Founda... |
lisiyuan656/Speaker-Recognizer | src/preprocessing/4_20NN.py | import numpy as np
import speaker_recognizer
from six.moves import cPickle as pickle
def tanh(x):
return np.tanh(x)
def tanh_deriv(x):
return 1.0 - np.tanh(x)**2
def logistic(x):
return 1/(1 + np.exp(-x))
def logistic_derivative(x):
return logistic(x)*(1-logistic(x))
class NeuralNetwork:
def _... |
madscatt/sasmol | src/python/test_sasmol/test_sasio/test_unit_sasio_Files_get_resnames.py | '''
SASMOL: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
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 version.
... |
yetercatikkas/ulakbus | tests/fake/ders.py | # -*- coding: utf-8 -*-
"""
"""
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
from ulakbus.models.ogrenci import Program, Donem, Ders
from ulakbus.models.personel import Personel
from .general import fake, ints
from random... |
carloszan/ufv2py | app/models/line.py | from .graph import Graph
from .data import Data
from ..helpers.imports import *
import matplotlib.pyplot as plt
class Line(Graph):
def __init__(self, **kwargs):
self.data = Data(self.__init_data(**kwargs))
self.__init_figure()
def __init_figure(self):
self.fig = plt.figure()
... |
MiroK/DolfinSurface | demo/undocumented/contact-vi-snes/python/demo_contact-vi-snes.py | """This demo program uses of the interface to SNES solver for variational inequalities
to solve a contact mechanics problems in FEnics.
The example considers a heavy hyperelastic circle in a box of the same size"""
# Copyright (C) 2012 Corrado Maurini
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you... |
aflavio/linux-stuffs | backup-tools/backup-Applications.py | #! /usr/bin/env python
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# Copyright 2010 (c) Augusto Morais
# All rights reserved.
__author__="Augusto Morais <aflavio at smartlinks.com.br>"
__date__ ="$Jan 11, 2010 6:14:02 PM$"
class ... |
andrmuel/gr-dab | python/qa/qa_ofdm_move_and_insert_zero.py | #!/usr/bin/env python
from gnuradio import gr, gr_unittest, blocks
import grdab
class qa_ofdm_move_and_insert_zero(gr_unittest.TestCase):
"""
@brief QA for the block that moves the signal to the middle of the band and inserts the zero carrier in the middle.
This class implements a test bench to verify the corresp... |
onpon4/naev | utils/mission_map.py | #!/usr/bin/env python3
# This file reads missions data and maps it
import xml.etree.ElementTree as ET
import pygraphviz as pgv
import glob
import os
import argparse
parser = argparse.ArgumentParser(
description=("Tool to display the relationships between the missions in"
" Naikari."))
parser.add_... |
johnlb/strange_wp | strange_bak/html.py |
# coding: utf-8
"""
weasyprint.html
---------------
Specific handling for some HTML elements, especially replaced elements.
Replaced elements (eg. <img> elements) are rendered externally and
behave as an atomic opaque box in CSS. In general, they may or may not
have intrinsic dimens... |
syphernl/python-protobix | tests/test_02Items_Deprecated.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import time
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import protobix
class TestDeprecatedItems(unittest.TestCase):
data = {
"myhost1": {
"my.zabbix.item1": 0,
"my.zabbix.item... |
diging/jars | cookies/filters.py | from django.db.models import Q, Count
from django.http import QueryDict
import django_filters
from cookies.models import *
from cookies import authorization
from django.conf import settings
logger = settings.LOGGER
class GilesUploadFilter(django_filters.FilterSet):
class Meta:
model = GilesUpload
... |
didrocks/snapcraft | snapcraft/tests/test_parser.py | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/operators/all.py | """Operations on many graphs.
"""
from itertools import zip_longest
import networkx as nx
__all__ = ["union_all", "compose_all", "disjoint_union_all", "intersection_all"]
def union_all(graphs, rename=(None,)):
"""Returns the union of all graphs.
The graphs must be disjoint, otherwise an exception is raised.... |
tobetter/linaro-image-tools | linaro_image_tools/tests/test_utils.py | # Copyright (C) 2010, 2011 Linaro
#
# Author: Guilherme Salgado <guilherme.salgado@linaro.org>
#
# This file is part of Linaro Image Tools.
#
# Linaro Image Tools 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... |
francoel69/adiuc-salary-calculator | salary_calculator_app/database_scripts/remuneraciones_retenciones_data.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#=============================================
#
# Copyright 2012 David Racca and Matias Molina.
#
# This file is part of ADIUC Salary Calculator.
#
# ADIUC Salary Calculator is free software: you can redistribute it and/or
# modify it under the terms of the GNU General P... |
NDGuthrie/pyxtuml | xtuml/tools.py | # encoding: utf-8
# Copyright (C) 2014 John Törnblom
class Visitor(object):
def enter(self, inst):
name = 'enter_' + inst.__class__.__name__
fn = getattr(self, name, self.default_enter)
fn(inst)
def leave(self, inst):
name = 'leave_' + inst.__class__.__name__
fn = geta... |
tapas-cantina/tapas | tapas/server.py | import asyncio
from datetime import datetime
from collections import (
defaultdict,
OrderedDict
)
from aiohttp import web
from aiohttp.errors import WSClientDisconnectedError
import aiohttp_cors
import tapas.models as m
import tapas.models.flaneur
from tapas.models.core import (
find_models_starting_with
... |
Donkyhotay/MoonPy | twisted/web2/xmlrpc.py | # -*- test-case-name: twisted.web2.test.test_xmlrpc -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A generic resource for publishing objects via XML-RPC.
Maintainer: Itamar Shtull-Trauring
"""
# System Imports
import xmlrpclib
# Sibling Imports
from twisted.web2 import ... |
LaboratoireMecaniqueLille/GPGPU | test_pyCUDA/tex.py | #coding: utf-8
from __future__ import division, print_function
import numpy as np
import cv2
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
import pycuda.gpuarray as gpuarray
import sys
import pycuda.autoinit
img_addr = '../Images/lena.png'
out_addr = 'out.png'
offX = 10.58
offY = 35.4257
img ... |
abice-sbr/adaptsearch | 01_concatenate_v3.0.py | #!/usr/bin/python
## Author: Eric Fontanillas
## Last modification: 17/06/2011
## Subject: find and remove indels
###############################
##### DEF 0 : Dico fasta #####
###############################
def dico(F2):
dicoco = {}
while 1:
next2 = F2.readline()
if not next2:
b... |
icaoberg/cellorganizer-galaxy-tools | datatypes/util/image_util.py | """Provides utilities for working with image files."""
import logging
import imghdr
try:
import Image as PIL
except ImportError:
try:
from PIL import Image as PIL
except:
PIL = None
log = logging.getLogger(__name__)
def image_type( filename, image=None ):
format = ''
if PIL is no... |
nnmware/nnmware | apps/publication/views.py | # nnmware(c)2012-2020
from __future__ import unicode_literals
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DateDetailView, Year... |
pyrocko/pyrocko | src/scenario/targets/base.py | # http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division, print_function
import numpy as num
from pyrocko import util
from ..base import Generator
class TargetGenerator(Generator):
def get_time_range(self, sourc... |
stromnet/pyowmaster | pyowmaster/device/DS1820.py | # vim: set expandtab sw=4 softtabstop=4 fileencoding=utf8 :
#
# Copyright 2014-2015 Johan Ström
#
# This python package 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... |
tfiedor/perun | perun/check/integral_comparison.py | """
The module contains the methods, that executes the computational logic of
`integral_comparison` detection method.
"""
import numpy as np
import scipy.integrate as integrate
import perun.check.factory as factory
import perun.check.nonparam_helpers as nparam_helpers
import perun.postprocess.regression_analysis.regr... |
tarunrs/pSnipSuggest | generate_test_data_sets.py | from sqlparser import ParsedQuery, SELECT_CLAUSE, FROM_CLAUSE, WHERE_CLAUSE, GROUPBY_CLAUSE, ORDERBY_CLAUSE, HAVING_CLAUSE
from random import *
from snip_suggest import get_suggestions, find_feature_ids_with_clauses, clause, find_feature_ids, snippets
f1 = open("exclude/queries.from0", "w")
f2 = open("exclude/queries... |
kg-bot/SupyBot | plugins/RawLogger/config.py | ###
# Copyright (c) 2005, Jeremiah Fincher
# 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 conditi... |
sndrtj/wisecondor | wisestork/gc_correct.py | # Copyright (C) 2016-2019 Sander Bollen
#
# This file is part of wisestork
#
# 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 opt... |
brettcs/diffoscope | diffoscope/comparators/utils/file.py | # -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016 Chris Lamb <lamby@debian.org>
#
# diffoscope 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,... |
fernandojvdasilva/algorithm-studies | chapter1/solution_1_1.py | '''
Created on 29 de set de 2017
@author: fernando
'''
'''
Implement an algorithm to determine if a string has all unique characters. What if you
can not use additional data structures?
'''
def has_all_unique_characters(string):
''' If I can use data structures, the obvious answer is to use a set (aka. hashset... |
sumihai-tekindo/account_sicepat | bank_voucher_report/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 STI (<https://github.com/sumihai-tekindo>).
# @author Pambudi Satria <pambudi.satria@yahoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
pashazz/pyflibusta | test/tests.py | '''
Tests for flibusta
'''
import unittest, os
from flibusta import catalog
class FlibustaTest(unittest.TestCase):
def test_findFile(self):
'''check if findFile works'''
id = '249564'
directory = ('/home/pasha/media/books/Флибуста')
t = catalog.findFile(id, directory)
... |
MTgeophysics/mtpy | mtpy/usgs/nims.py | # -*- coding: utf-8 -*-
"""
===============
NIMS
===============
* deals with reading in NIMS DATA.BIN files
Created on Thu Oct 31 10:03:20 2019
@author: jpeacock
"""
# =============================================================================
# Imports
# =================================================... |
AnimeshKoratana/DeepSpeech | DeepSpeech.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import sys
log_level_index = sys.argv.index('--log_level') + 1 if '--log_level' in sys.argv else 0
os.environ['TF_CPP_MIN_LOG_LEVEL'] = sys.argv[log_level_index] if log_level_index > 0 and log_leve... |
g-rich/AuthCurity | lib/adminauth.py | #!/usr/bin/env python
# -*- coding=utf-8 -*-
## AuthCurity One Time Password
## Author: Greg Rich <gregrich at gmail dot com>
## https://github.com/g-rich/AuthCurity
## License: Mozilla Public License (MPL) Version 2
"""
Usage:
import adminauth
adminauth.adminauth()
"""
# Prompt for admin user and password, an... |
vesellov/bitdust.devel | services/service_private_messages.py | #!/usr/bin/python
# service_private_messages.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (service_private_messages.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... |
Cadasta/ckanext-project | ckanext/cadastaroles/tests/logic/auth/base.py | from ckan.tests import helpers, factories
from ckan import model
from ckan.logic import schema
from ckan.plugins import toolkit
from ckan.plugins.core import unload, load
from nose.tools import assert_raises, assert_true
class TestProjectBase(helpers.FunctionalTestBase):
@classmethod
def setup_class(cls):
... |
gpodder/mygpo | mygpo/urls.py | import os.path
from django.urls import include, path, register_converter, re_path
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
# This URLs should be always be served, even during maintenance mode
urlpatterns = static(settings.STATIC_URL, document_root=se... |
wadobo/papersplease | papersplease/papers/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import papers.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Attachment',
fields=[
('id... |
serversquared/SSMGlobal | main.py | #!/usr/bin/env python3
'''=========================================================================\\\
||| serversquared Modification Global Backend |||
||| Copyright (C) 2015 Niko Geil. |||
||| ... |
uclouvain/OSIS-Louvain | infrastructure/tests/learning_unit/repository/test_learning_unit.py | from django.test import TestCase
from base.models.enums import organization_type
from base.models.enums.learning_container_year_types import LearningContainerYearType
from base.models.enums.learning_unit_year_periodicity import PeriodicityEnum
from base.models.enums.learning_unit_year_subtypes import FULL
from base.mo... |
reingart/gestionlibre | languages/es.py | # coding: utf8
{
'': '',
' Quotas: %(quotas)s x%(quota_amount).2f': ' Quotas: %(quotas)s x%(quota_amount).2f',
' Transaction number: %s': ' Transaction number: %s',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression lik... |
cherrygirl/micronaet7 | product_adr/__openerp__.py | # -*- coding: utf-8 -*-
###############################################################################
#
# 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 a... |
muccg/rdrf | rdrf/registry/groups/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='CustomUser',
... |
MarcosCommunity/odoo | comunity_modules/auto_backup/backup_scheduler.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modif... |
blueset/ehForwarderBot | tests/mocks/slave.py | import threading
from logging import getLogger
from typing import Set, Optional, List
from ehforwarderbot import Message, Status, MsgType, Chat
from ehforwarderbot.channel import SlaveChannel
from ehforwarderbot.chat import PrivateChat, GroupChat
from ehforwarderbot.exceptions import EFBChatNotFound
from ehforwarderbo... |
foosel/OctoPrint | tests/util/test_misc.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
import unittest
im... |
greising/python-mpv | mpv.py |
from ctypes import *
import threading
import os
import asyncio
from warnings import warn
# vim: ts=4 sw=4
backend = CDLL('libmpv.so')
class MpvHandle(c_void_p):
pass
class ErrorCode:
""" For documentation on these, see mpv's libmpv/client.h """
SUCCESS = 0
EVENT_QUEUE_FULL ... |
voer-platform/vp.repo | vpr/vpr_log/mongodb_handler.py | from pymongo import MongoClient, DESCENDING
from django.conf import settings
from base import BaseLogHandler
class MongoDBHandler(BaseLogHandler):
""" Provide basic functions for saving/storing logs into MongoDB
"""
log_db = None
def __init__(self):
self.log_db = getMongoDB()
def store... |
Vauxoo/e-commerce | website_sale_stock_provisioning_date/models/product_template.py | # Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
show_next_provisioning_date = fields.Boolean(
help="Shows the next provisioning date in ... |
Open365/Open365 | lib/Tools/ServiceConfigGenerator.py | import json as global_json
import tempfile as global_tempfile
class ServiceConfigGenerator:
def __init__(self, tempfile=None, json=None):
self.tempfile = tempfile or global_tempfile
self.json = json or global_json
def generate_change_log_level(self, log_level):
with self.tempfile.Name... |
iw3hxn/LibrERP | dt_product_serial/models/pallet.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Product serial module for OpenERP
# Copyright (C) 2008 Raphaël Valyi
# Copyright (C) 2014 Didotech SRL
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
mbareta/edx-platform-ft | common/lib/xmodule/xmodule/x_module.py | import logging
import os
import sys
import time
import yaml
from contracts import contract, new_contract
from functools import partial
from lxml import etree
from collections import namedtuple
from pkg_resources import (
resource_exists,
resource_listdir,
resource_string,
resource_isdir,
)
from webob i... |
Stanford-Online/edx-analytics-dashboard | analytics_dashboard/settings/dev.py | """Common developpment settings"""
import os
from analytics_dashboard.settings.base import *
from analytics_dashboard.settings.logger import get_logger_config
########## DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
########## END DEBUG CONFIGURATION
########## E... |
ddico/odoo | addons/website_slides/models/slide_channel.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import uuid
from collections import defaultdict
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, tools, _
from odoo.addons.http_routing.models.ir_http import slug
from odoo.excepti... |
jdrumgoole/advancedaggregation | originalsummary.py | '''
@author: jdrumgoole
'''
from agg import Agg
def cars( collection ):
return SummaryCollection( collection, output="carsByAgeAndMileage2013", limit=None )
def SummaryCollection( collection, limit=1000, output=None ):
match = { "FirstUseDate" : { "$ne" : "NULL" }}
ageinusecs = { "$subtract" : ... |
fastio/pedis | idl-compiler.py | #!/usr/bin/python3
#
# Copyright 2016 ScyllaDB
#
#
# This file is part of Scylla.
#
# Scylla is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
JesseWeinstein/internetarchive | tests/conftest.py | from __future__ import absolute_import
import sys
import os
import pytest
import responses
from internetarchive import get_session
if sys.version_info < (2, 7, 9):
protocol = 'http:'
else:
protocol = 'https:'
@pytest.fixture
def json_filename():
return os.path.join(os.path.dirname(__file__), 'data/nas... |
multidadosti-erp/multidadosti-addons | calendar_event_timesheet/wizards/calendar_event_finish.py | import datetime
from odoo import api, models
from odoo.exceptions import UserError
from odoo.tools.translate import _
class CalendarEventFinish(models.TransientModel):
_inherit = 'calendar.event.finish'
@api.multi
def action_finish_calendar_event(self):
"""Finaliza evento de calendário e cria en... |
suutari/shoop | shuup/core/utils/form_mixins.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
class Pr... |
eltoncarr/tubular | tubular/scripts/push_public_to_private.py | #! /usr/bin/env python3
"""
Command-line script to push the results of a merge of private changes to public back over to the private
repo to keep the repo branches in-sync.
"""
from __future__ import absolute_import
import io
from os import path
import sys
import logging
import yaml
import click
import click_log
# A... |
i3visio/osrframework | osrframework/wrappers/occupywallst.py | ################################################################################
#
# Copyright 2015-2020 Félix Brezo and Yaiza Rubio
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... |
OpusVL/odoo | addons/portal/tests/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
alephobjects/ohai-kit | ohai_kit/migrations/0005_auto_20151214_1957.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.files.storage
class Migration(migrations.Migration):
dependencies = [
('ohai_kit', '0004_auto_20151103_1900'),
]
operations = [
migrations.AlterField(
... |
jolyonb/edx-platform | common/test/acceptance/pages/studio/utils.py | """
Utility methods useful for Studio page tests.
"""
from bok_choy.javascript import js_defined
from bok_choy.promise import EmptyPromise
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from common.test.acceptance.pages.common.utils import click_css, sy... |
cherrygirl/micronaet7 | account_invoice_multipartner/multipartner.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP module
# Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>)
#
# Italian OpenERP Community (<http://www.openerp-italia.com>)
#
#####################################################... |
uclouvain/OSIS-Louvain | base/tests/forms/test_learning_unit_postponement.py | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
Real-Instruments/fflib | fflib/ssh/ssh.py | #!/usr/bin/env python3
# The MIT License (MIT)
# Copyright (c) 2016 Michael Sasser <Michael.Sasser@Real-Instruments.de>
#
# 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... |
IONISx/edx-platform | common/test/acceptance/pages/studio/video/video.py | """
CMS Video
"""
import time
import os
import requests
from bok_choy.promise import EmptyPromise, Promise
from bok_choy.javascript import wait_for_js, js_defined
from ....tests.helpers import YouTubeStubConfig
from ...lms.video.video import VideoPage
from ...common.utils import wait_for_notification
from selenium.webd... |
prarthitm/edxplatform | openedx/core/djangoapps/celery_utils/persist_on_failure.py | """
Celery utility code for persistent tasks.
"""
from celery import Task
from .models import FailedTask
class PersistOnFailureTask(Task): # pylint: disable=abstract-method
"""
Custom Celery Task base class that persists task data on failure.
"""
def on_failure(self, exc, task_id, args, kwargs, ei... |
zimmerman-zimmerman/Narrowcasting-application | narrowcasting_server/ncs/serializers/slideimage_serializer.py | from rest_framework import serializers
from ncs.models import SlideImage
class SlideImageSerializer(serializers.ModelSerializer):
image_url = serializers.SerializerMethodField()
class Meta:
model = SlideImage
fields = (
'id',
'slide',
'image_type',
... |
jor-/matrix-decomposition | matrix/dense/calculate.py | import numpy as np
import scipy.linalg.lapack
import scipy.linalg.misc
import matrix.constants
import matrix.decompositions
import matrix.errors
import matrix.permute
import matrix.util
import matrix.dense.constants
import matrix.dense.permute
import matrix.dense.util
def _decompose(A, permutation=None, return_type=... |
Edraak/edx-platform | lms/djangoapps/mobile_api/video_outlines/serializers.py | """
Serializer for video outline
"""
from rest_framework.reverse import reverse
from xmodule.modulestore.mongo.base import BLOCK_TYPES_WITH_CHILDREN
from xmodule.modulestore.django import modulestore
from courseware.access import has_access
from courseware.courses import get_course_by_id
from courseware.model_data imp... |
BT-astauder/odoo | openerp/tools/translate.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
telefonicaid/fiware-IoTAgent-Cplusplus | tests/e2e_tests/common/gw_configuration.py | # -*- coding: utf-8 -*-
'''
(c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights
Reserved.
The copyright to the software program(s) is property of Telefonica I+D.
The program(s) may be used and or copied only with the express written
consent of Telefonica I+D or in accordance with the terms... |
victims/victims-db-builder | victims_db_builder/library.py | import itertools
import string
import urllib.request as urllib2
from decimal import *
from distutils.version import LooseVersion
from version import Version
class BaseLibrary(object):
def __init__(self, versionRanges):
# For soup/direct maven index:
self.versions = []
if not isinstance(ve... |
cherrygirl/micronaet-mx8 | production_order_line_family/family.py | # -*- coding: utf-8 -*-
###############################################################################
#
# 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 a... |
gem/oq-hazardlib | openquake/hazardlib/tests/gsim/toro_1997_test.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
fbanquez/livestock | livestock_specie_animal.py | # -*- coding: utf-8 -*-
from datetime import datetime
from openerp import models, fields, api, _
class livestock_specie_animal(models.Model):
_name = 'livestock.specie.animal'
_description = "Configuration Model Animal Specie in Livestock"
_order = "name"
# Fields of the Configuration Animal Model
... |
xemul/p.haul | phaul/criu_cr.py | #
# Generic functionality for p.haul modules
#
import logging
import pycriu.rpc_pb2
import criu_req
def criu_predump(htype, pid, img, criu_connection, fs):
logging.info("\tIssuing pre-dump command to service")
req = criu_req.make_predump_req(pid, htype, img, criu_connection, fs)
resp = criu_connection.send_req(... |
iulian787/spack | var/spack/repos/builtin/packages/charmpp/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import platform
import shutil
import sys
from spack import *
class Charmpp(Package):
"""Charm++ is a para... |
kelvinlawson/pykaraoke | pycdgAux.py | #
# Copyright (C) 2010 Kelvin Lawson (kelvinl@users.sourceforge.net)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later v... |
zaheerm/gst-python | testsuite/test_pad.py | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# gst-python - Python bindings for GStreamer
# Copyright (C) 2002 David I. Lehn
# Copyright (C) 2004 Johan Dahlin
# Copyright (C) 2005 Edward Hervey
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General... |
skosukhin/spack | lib/spack/spack/fetch_strategy.py | #
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/spack
# Please also see th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.