repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
joakim-hove/ert | res/enkf/queue_config.py | # Copyright (C) 2017 Equinor ASA, Norway.
#
# The file 'site_config.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 Lic... |
t-wissmann/qutebrowser | tests/unit/utils/test_qtutils.py | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
suhe/odoo | addons/payroll_cancel/controllers/controllers.py | # -*- coding: utf-8 -*-
from openerp import http
# class PayrollCancel(http.Controller):
# @http.route('/payroll_cancel/payroll_cancel/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/payroll_cancel/payroll_cancel/objects/', auth='public')
# def list(self, **k... |
nexedi/dream | dream/simulation/Exit.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... |
QTB-HHU/ModelHeatShock | HSM_ODEsSystem10or9eqs.py | from HSM_Reactions import *
########## RIGHT MEMBERS OF ODEs, rewritten with only 10 equations to isolate those that are independent ##############
def f10eqs(t, y, ksetDict, TparamSet, REACparamSet, DirectControlnuPp, IC_PplusPp, IC_SplusSs):
#P = y[0]
Ph = y[0]
#S = y[2]
Ss = y[1]
F = y[2]
... |
dspaccapeli/bus-arrival | visualization/plot_delay_evo.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Description:
Plot the delay evolution during a run
for multiple ones having the run_time
(in seconds) shown on the X axis.
@author: dspaccapeli
"""
#imports to manage the sql db
import sqlite3 as lite
import pandas as pd
#to make the plot show-up from command l... |
SeanTater/tscan | tscan/destripe.py | import numpy
import scipy.ndimage
import scipy.signal
import cv2
import cli
import code
@cli.Plugin.register
class Destripe(cli.Plugin):
''' Looks for out-of-place vertical or horizontal lines and inpaints them
'''
_args = []
_name = 'destripe'
def neighbor_threshold(self, image):
... |
t3dev/odoo | addons/test_mass_mailing/tests/test_mail_auto_blacklist.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common
import datetime
class TestAutoBlacklist(common.TransactionCase):
def test_mail_bounced_auto_blacklist(self):
mass_mailing_contacts = self.env['mail.mass_mailing.contact']
... |
junwoo091400/MyCODES | Projects/FootPad_Logger/logged_data_analyzer_LSTM/Train.py | from Base import *
from RNN_LSTM import *
from Data_manipulation import *
import ipdb
def log_2_Batch_Y32(log):
# Encodes Y as 0~31.
print('log_2_Batch. log Data raw count:',len(log.Data)*200,str(log))
X = []#Must be 5 seconds/ each.
Y = []
idx = 0
for datum in log.Data:#Each server uploads -> 20 seconds.
for ... |
ohickman/etch-a-sketch | point.py | """
Extensible image processing and Etch-a-sketch drawing program
Copyright (C) 2014 Oliver Hickman
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... |
Samweli/inasafe | safe/impact_functions/volcanic/volcano_point_population/impact_function.py | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Volcano Point on
Population Impact Function.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 So... |
guardicore/monkey | monkey/monkey_island/cc/resources/attack/attack_report.py | import flask_restful
from flask import current_app, json
from monkey_island.cc.resources.auth.auth import jwt_required
from monkey_island.cc.services.attack.attack_report import AttackReportService
from monkey_island.cc.services.attack.attack_schema import SCHEMA
class AttackReport(flask_restful.Resource):
@jwt_... |
kaleid0scope/SITE-database | DjangoWebProject/DjangoWebProject/app/lecture.py | # -*- coding: UTF-8 -*-
from django.shortcuts import render
from DjangoWebProject import settings
from django.http import HttpRequest
from django.template import RequestContext
from django.template.loader import get_template
from datetime import datetime
from django.shortcuts import render_to_response
from django.cont... |
mgard/epater | i18n.py | import gettext
class I18n:
"""
This class is used for internationalization without a specific language.
Objects can be stored as msgid from gettext or as str.
"""
def __init__(self, msg, isSTR=False):
if isSTR:
self.content = [msg]
else:
self.content = [self... |
emoronayuso/beeton | asterisk-bee/asteriskbee/api_status/scripts_graficas/script_crontab.py | from crontab import CronTab
from django.conf import settings
#####################################################
###Para mas info sobre el uso de python-crontab######
### https://pypi.python.org/pypi/python-crontab ######
#####################################################
##Directorio de la aplicaion
### STATIC_... |
jimbelton/wikidata | lib/simplify.py | # See https://www.wikidata.org/wiki/Special:ListDatatypes for descriptions of the wikidata data types
# Simplifies a wikidata time. The result is a either a date or a time (date and time), depending on the precision. Leading + signs
# are removed and dates lack the time component, but the types are otherwise like wiki... |
hackultura/octofiles | docs/source/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Octofiles documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 10 14:51:08 2016.
#
# 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
# ... |
octogene/hadaly | hadaly/painter.py | # -*- coding: utf-8 -*-
import math
from kivy.uix.widget import Widget
from kivy.graphics import Color, Line
from kivy.vector import Vector
from kivy.properties import StringProperty, DictProperty, BooleanProperty, BoundedNumericProperty, ListProperty
class Painter(Widget):
tools = DictProperty({'arrow': {'color... |
belokop/indico_bare | indico/modules/rb/forms/reservations.py | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
yancharkin/games_nebula_goglib_scripts | the_temple_of_elemental_evil/settings.py | import sys, os
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib
import gettext
import imp
nebula_dir = os.getenv('NEBULA_DIR')
modules_dir = nebula_dir + '/modules'
set_visuals = imp.load_source('set_visuals', modules_dir + '/set_visuals.py')
gettext.bindtextdomain('games_nebula', ... |
pytroll/satpy | satpy/modifiers/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Satpy developers
#
# This file is part of satpy.
#
# satpy 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... |
zhuangjun1981/retinotopic_mapping | retinotopic_mapping/DisplayStimulus.py | '''
Visual Stimulus codebase implements several classes to display stimulus routines.
Can display frame by frame or compress data for certain stimulus routines and
display by index. Used to manage information between experimental devices and
interact with `StimulusRoutines` to produce visual display and log data. May a... |
minlexx/pyevemon | esi_client/models/get_markets_structures_structure_id_200_ok.py | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class GetMarketsStructuresStructureId200Ok(object):
"""
... |
miquelramirez/lwaptk-v2 | external/fd/pddl/conditions.py | from __future__ import print_function
from . import pddl_types
def parse_condition(alist):
condition = parse_condition_aux(alist, False)
# TODO: The next line doesn't appear to do anything good,
# since uniquify_variables doesn't modify the condition in place.
# Conditions in actions or axioms are uni... |
LouisePaulDelvaux/Til-Liam | src_liam/setup.py | from __future__ import print_function
import sys
from distutils.extension import Extension
from cx_Freeze import setup, Executable
from Cython.Distutils import build_ext
import numpy as np
# cython options
# Add the output directory of cython build_ext to sys.path so that build_exe
# finds and copies C extensions
... |
markstoehr/phoneclassification | local/CExtractPatches_from_spec.py | from __future__ import division
import numpy as np
import argparse, itertools
from scipy.io import wavfile
from template_speech_rec import configParserWrapper
from TestSVMBernoulli import get_bernoulli_templates
from scipy.ndimage.filters import maximum_filter
from amitgroup.stats import bernoullimm
import matplotlib.p... |
Thraxis/pymedusa | sickbeard/indexers/indexer_config.py | # coding=utf-8
from tvdb_api.tvdb_api import Tvdb
from sickbeard import helpers
initConfig = {
'valid_languages': [
"da", "fi", "nl", "de", "it", "es", "fr", "pl", "hu", "el", "tr",
"ru", "he", "ja", "pt", "zh", "cs", "sl", "hr", "ko", "en", "sv", "no"
],
'langabbv_to_id': {
'el': ... |
cjaymes/pyscap | src/scap/model/oval_5/sc/unix/EntityItemEncryptMethodType.py | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
utisam/gfly | gfly/__init__.py | #-*- coding:utf-8 -*-
import string
from gi.repository import GObject, Gedit, Gtk, Pango
from settings import errorGenerator, jump_to_error_key, notification
ui_str = """<ui>
<menubar name="MenuBar">
<menu name="EditMenu" action="Edit">
<placeholder name="EditOps_6">
<menuitem name="gfly" action="gfly"/>
... |
dmaccarthy/sc8pr | sc8pr/gui/dialog.py | # Copyright 2015-2020 D.G. MacCarthy <https://dmaccarthy.github.io/sc8pr>
#
# This file is part of "sc8pr".
#
# "sc8pr" 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... |
seba3c/scamera | notifications/migrations/0002_auto_20161014_0113.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-14 01:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
... |
privateLittleVaginalTeasingMogicSchool/Fall-of-Cinnamon-Twig | Demo-Kazeshima-Python/card.py | # KazeshimaAya@gmail.com
# 03.13.2017 UTC
# A simple relization of idea.
from math import pow as power
class Hero:
'Class of Hero card. Dinstinct hero has fixed Chuang, Zhi and Fu properties'
Name = ''
Chuang = 0
Zhi = 0
Fu = 0
MaxFanNum = 1 # The number of fans is HP
BaseAtk = 1
BaseD... |
Ilias95/lib389 | lib389/cli_conf/plugin.py | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2016 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
from lib389.plugins import Plugin, Plugins
import argparse
from lib389.cli_base import (
_generic_list,
_generic... |
RedhawkSDR/integration-gnuhawk | qa/gnuradio/gr/top_block.py | #
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by the Free Software
# F... |
hltdi/semeval2013 | src/extract_training.py | #!/usr/bin/env python3
"""Given a source word, source text and target text filenames, produce training
data files."""
import sys
import os
import argparse
import functools
import re
import nltk
from nltk.stem import wordnet
import get_possible_senses
import treetagger
from Aligner import target_words_for_each_sourc... |
DT42/BerryNet | berrynet/service/movidius_service.py | # Copyright 2017 DT42
#
# This file is part of BerryNet.
#
# BerryNet 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.
#
# BerryNet is d... |
ic-hep/DIRAC | src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/FileMetadata.py | """ DIRAC FileCatalog plugin class to manage file metadata
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
import six
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities.Time import queryTime
from DIRAC.Core.Utilities.List impor... |
15Mpedia/15Mpedia-scripts | import-flickr-photos.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 emijrp <emijrp@gmail.com>
# 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 optio... |
jeremiah-c-leary/vhdl-style-guide | vsg/tests/process/test_rule_014.py |
import os
import unittest
from vsg.rules import process
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_014_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDir, ... |
ftp21/BoilerPi | server.py | import multiprocessing
import socket
import re
import time
def handle(connection, address):
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("process-%r" % (address,))
try:
logger.debug("Connected %r at %r", connection, address)
while True:
d... |
hamish2014/optTune | docs/conf.py | # -*- coding: utf-8 -*-
#
# optTune documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 11 12:14:27 2012.
#
# 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.
#
# All... |
ESSolutions/ESSArch_Core | ESSArch_Core/api/forms/widgets.py | from django import forms
class MultipleTextWidget(forms.widgets.Widget):
template_name = 'django/forms/widgets/text.html'
def format_value(self, value):
"""Return selected values as a list."""
if value is None:
return []
if not isinstance(value, (tuple, list)):
... |
xupingmao/xnote | xutils/dbutil_sortedset.py | # -*- coding:utf-8 -*-
# @author xupingmao
# @since 2021/12/05 11:25:18
# @modified 2022/01/24 14:47:38
# @filename dbutil_sortedset.py
"""【待实现】有序集合,用于各种需要排名的场景,比如
- 最近编辑的笔记
- 访问次数最多的笔记
如果使用了LdbTable的索引功能,其实就不需要这个了
"""
from xutils.dbutil_base import *
from xutils.dbutil_hash import LdbHashTable
register_table("_ran... |
kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/sale_stock_quantity/tests/test_sale_stock_quantity.py | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import unittest
import doctest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import doctest_setup, docte... |
lucarebuffi/OASYS1 | oasys/widgets/tools/ow_surface_file_merger.py | import os, sys
import numpy
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import QApplication, QMessageBox, QLabel, QSizePolicy
from PyQt5.QtGui import QTextCursor, QFont, QPalette, QColor, QPixmap
from matplotlib import cm
from oasys.widgets.gui import FigureCanvas3D
from matplotlib.figure import Figure
f... |
whatevsz/autobackup | autobackup/cron.py | # -*- encoding: utf-8 -*-
# Copyright (c) 2013 Hannes Körber <hannes.koerber@gmail.com>
#
# This file is part of autobackup.
#
# autobackup 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 t... |
gribvirus74/Bee-per | Error.py | class ParametrizedError(Exception):
def __init__(self, problem, invalid):
self.problem = str(problem)
self.invalid = str(invalid)
def __str__(self):
print('--- Error: {0}\n--- Caused by: {1}'.format(self.problem, self.invalid))
class InvalidToken(ParametrizedError):
pass
class ToneError(Parametri... |
tedlaz/pyted | tests/dbapi/logger.py | # -*- coding: utf-8 -*-
"""
author Ted Lazaros <tedlaz@gmail.com>
"""
import logging
# Log Levels
# ------------
# CRITICAL 50
# ERROR 40
# WARNING 30
# INFO 20
# DEBUG 10
# NOTSET 0
frm = "%(asctime)s %(module)s : %(levelname)s %(message)s"
# Initialize logging module, give basic formats and... |
CSIOM/piPi | src/managers/models.py | #!/usr/bin/env python
"""
This file is part of piPi project.
Copyright (C) 2015 CSIOM, http://www.csiom.com
Authors: The Csiom Team
piPi 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 Li... |
mohclips/k5-ansible-modules | k5_novnc_console.py | #!/usr/bin/python
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: k5_novnc_console
short_description: Display the URL to the NoVNC Console
version_added: "1.0"
description:
- returns a URL to the noVN... |
UltramaticOrange/xkcd_news | news_consts.py | # C is for constants ...and that's good enough for me.
class C(object):
# used in python
FEEDS_FILE = 'feeds.yaml'
SUBS_FILE = 'substitutions.yaml'
SUBS_KWARG = 'transformations'
TEMPLATE_CONFIG_FILE = 'template.yaml'
# used in template.yaml config file
TEMPLATE_FILE = 'templateFile'
TE... |
hamgravy/volk-fft | python/volk_fft_modtool/cfg.py | #!/usr/bin/env python
#
# Copyright 2013, 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opti... |
tiancj/emesene | emesene/e3/xmpp/SleekXMPP/sleekxmpp/plugins/xep_0085/chat_states.py | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permissio
"""
import logging
import sleekxmpp
from sleekxmpp.stanza import Message
from sleekxmpp.xmlstream.handler import Callback
from sleek... |
kermitfr/kermit-webui | src/webui/platforms/jboss/operations.py | '''
Created on Nov 8, 2011
@author: mmornati
'''
from webui.abstracts import ContextOperation
from webui import settings
from webui.core import kermit_modules
from guardian.shortcuts import get_objects_for_user
from webui.agent.models import Agent, Action
class JbossDeployContextMenu(ContextOperation):
def g... |
jingwangian/tutorial | python/test/t1.py | #!/usr/bin/env python3
'''
input:
4
a a c d
2
'''
import os
from collections import OrderedDict
statinfo = os.stat('t2.py')
print(statinfo)
print(statinfo.st_mode)
statinfo = os.stat('t3.py')
print(statinfo)
print(statinfo.st_mode)
stat_result_1 = os.stat_result(range(1, 11))
print(stat_result_1.st_mode)
s1... |
nonZero/demos-python | src/examples/short/technology/grep.py | #!/usr/bin/python2
'''
Implemting grep in python in less than 10 lines of code...
'''
import re # for compile, finditer
import sys # for argv
# command line usage...
if len(sys.argv) < 3:
print('usage: grep.py [expr] [files...]')
sys.exit(1)
# first compile the regular expression...
c = re.compile(sys.argv... |
govarguz/espressopp | src/esutil/RNG.py | # Copyright (C) 2012,2013,2019
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of ... |
mazvv/travelcrm | travelcrm/lib/qb/orders_stats.py | # -*coding: utf-8-*-
from datetime import datetime, timedelta
from sqlalchemy import func
from ...models.resource import Resource
from ...models.order import Order
from ...lib.qb import ResourcesQueryBuilder
class OrdersStatsQueryBuilder(ResourcesQueryBuilder):
def __init__(self, context):
super(Orde... |
tallus/pos-scale-emulator | swrapper.py | #!/usr/bin/env python
'''Module that provides functionality to emulate pos scales with
serial interfaces'''
# Copyright Paul Munday 2013
# 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 Fou... |
gwpy/gwpy | gwpy/table/gravityspy.py | # -*- coding: utf-8 -*-
# Copyright (C) Scott Coughlin (2017-2021)
# Cardiff University (2021)
#
# This file is part of GWpy.
#
# GWpy 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 versi... |
adrienverge/yamllint | tests/test_yamllint_directives.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Adrien Vergé
#
# 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.
#
# This pro... |
JonasWallin/logisticnormal | logisticnormal/PurePython/multivariatenormal.py | '''
Created on Jun 30, 2014
@author: jonaswallin
'''
import copy as cp
import numpy as np
import pickle
class Multivariatenormal(object):
'''
Class for sampling from a Multivariate normal distribution on the form
f(X| Y, \Sigma, \mu_p, \Sigma_p) \propto N(Y; X, \Sigma) N(X; \mu_p, \Sigma_p)
'''
def pickle(s... |
Tristramg/mumoro | server.py | # -*- coding: utf-8 -*-
# This file is part of Mumoro.
#
# Mumoro 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.
#
# ... |
retext-project/retext | ReText/icontheme.py | # This file is part of ReText
# Copyright: 2015-2016 Dmitry Shachnev
#
# 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.
#... |
hgsoft/hgsoft-addons | custom_account_payment_v11/__manifest__.py | # -*- coding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2018 HGSOFT - www.hgsoft.com.br #
# ... |
jeremiah-c-leary/vhdl-style-guide | vsg/tests/process/test_rule_011.py |
import os
import unittest
from vsg.rules import process
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_011_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDir, ... |
citibeth/twoway | stieglitz/gic2stieglitz.py | import os
import sys
import numpy as np
from giss.ncutil import copy_nc
import netCDF4
import argparse
from modele.constants import SHI,LHM,RHOI,RHOS,UI_ICEBIN,UI_NOTHING
parser = argparse.ArgumentParser(description='Convert GIC file for old snow/firn model to one for Stieglitz.')
parser.add_argument('igic',
help... |
sdlarsen1/CMPUT291 | prjcode/Doctor.py | import os
from LogInOut import logout
def doctorCommands(cursor, conn, staff_id):
loggedOut = False
while not loggedOut:
os.system("clear")
choice = int(raw_input('''Type integer value of desired task:
1. Get patient chart info.
2. Rec... |
Kozea/Radicale | radicale/app/options.py | # This file is part of Radicale - CalDAV and CardDAV server
# Copyright © 2008 Nicolas Kandel
# Copyright © 2008 Pascal Halter
# Copyright © 2008-2017 Guillaume Ayoub
# Copyright © 2017-2018 Unrud <unrud@outlook.com>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
aliparsai/LittleDarwin | utils/NullExperiment/CompareMutantDatabases.py | import os
import sys
import shelve
import random
import math
import scipy.stats.stats
class MutantResults(object):
def __init__(self, sourceDatabase, resultsDatabase):
# self.resultsDatabase = shelve.open(resultsDatabase, "r")
try:
self.resultsDatabase = shelve.open(resultsDatabase, "r... |
steakunderscore/Bandwidth-Monitoring | src/user.py | '''
Created on 5/02/2010
@author: henry@henryjenkins.name
'''
import datetime
class user(object):
'''
classdocs
'''
dataUp = None
dataDown = None
macAddress = ""
name = ""
def __init__(self, mac="", name=""):
'''
Constructor
'''
self.name = name
... |
rohitwaghchaure/erpnext_develop | erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe, erpnext
import frappe.model
from frappe.utils import cint, flt, today, nowdate, add_days
import frappe.defaults
from erp... |
xinpuyuandu/awesome-python3-webapp | www/models.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time, uuid
from orm import Model, StringField, BooleanField, FloatField, TextField
def next_id():
return '%015d%s000' % (int(time.time() * 1000), uuid.uuid4().hex)
class User(Model):
__table__ = 'users'
id = StringField(primary_key=True, default=next_id... |
hellrich/coling2016 | python/compare_word_over_models.py | import gensim
import sys
import collections
import codecs
import re
import math
from copy import deepcopy
def compare(word, topn, models):
words = {}
counts = {}
sim = {}
for m in models:
model = gensim.models.Word2Vec.load_word2vec_format(m, binary=True)
words[m] = model.most_similar(... |
thtrieu/essence | src/modules/recurring.py | from .module import Module
from src.utils import xavier, guass
import numpy as np
from .activations import *
class Recurring(Module):
"""
Recurring is a type of module that cache intermediate
activations in a stack during unrolling of recurrent layers
Its backward() is expected to be called several tim... |
jetskijoe/SickGear | sickbeard/db.py | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... |
lukeroge/CloudbotX | plugins/help.py | import asyncio
import re
from operator import attrgetter
from stratus.loader import hook
plugin_info = {
"plugin_category": "core",
"command_category_name": "Informational"
}
@asyncio.coroutine
@hook.command("help", autohelp=False)
def help_command(text, conn, bot, notice, has_permission):
"""[command] ... |
yorvic/.vim | bundle/python-mode/pylibs/ropevim.py | """ropevim, a vim mode for using rope refactoring library"""
import glob
import os
import tempfile
import re
from ropemode import decorators
from ropemode import environment
from ropemode import interface
import vim
# Gobal var to be able to shutup output
_rope_quiet = False
class VimUtils(environment.Environment)... |
qdev-dk/Majorana | alazar_controllers/acq_helpers.py | import numpy as np
import math
def sample_to_volt_u12(raw_samples, bps, input_range_volts):
"""
Applies volts conversion for 12 bit sample data stored
in 2 bytes
return:
samples_magnitude_array
samples_phase_array
"""
# right_shift 16-bit sample by 4 to get 12 bit sample
s... |
chalbersma/persist_transaction | archive.py | #!/usr/bin/env python3
from configparser import ConfigParser
from colorama import Fore, Back, Style
import time
import argparse
import ast
import pymysql
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", help="JSON Config File with our Storage Info", required=True... |
valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/voicerepublic.py | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
sanitized_Request,
)
class VoiceRepublicIE(InfoExtractor):
_VALID_URL = r'https?://voicerepublic\.com/(?:... |
badloop/SickRage | sickrage/show/Show.py | # This file is part of SickRage.
#
# URL: https://www.sickrage.tv
# Git: https://github.com/SickRage/SickRage.git
#
# 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 version 3 of the License, o... |
dstansby/heliopy | heliopy/data/helios.py | """
Methods for importing Helios data.
"""
from datetime import date, time, datetime, timedelta
import os
import pathlib
import urllib.error
from urllib.error import URLError
from collections import OrderedDict
import warnings
import astropy.constants as constants
import astropy.units as u
import numpy as np
import pa... |
studywolf/NDMPS-paper | code/test_ndmps_fs_discrete_spa_frontend.py | import numpy as np
import importlib
import itertools
import nengo
from models import ndmps_fs_discrete_spa_frontend
importlib.reload(ndmps_fs_discrete_spa_frontend)
from models.ndmps_fs_discrete_spa_frontend import generate
input_signals = ['ZERO']#, 'ONE', 'TWO', 'THREE', 'FOUR',
# 'FIVE', 'SIX', '... |
jyejare/robottelo | tests/foreman/ui/test_hostcollection.py | """Test class for Host Collection UI
:Requirement: Hostcollection
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: HostCollections
:Assignee: swadeley
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import time
import pytest
from broker import VMBroker
from nailgun import entitie... |
adybbroe/atrain_match | atrain_match/reshaped_files_scr/plot_kuipers_on_area.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Read all matched data and make some plotting
"""
import os
from glob import glob
import numpy as np
from matchobject_io import (readTruthImagerMatchObj,
CalipsoImagerTrackObject)
from plot_kuipers_on_area_util import (PerformancePlottingObjec... |
chaos95/fluxxbot | pyGBot/Plugins/probability/Roll.py | ##
## Roll - a plugin for pyGBot
## Copyright (C) 2008 Morgan Lokhorst-Blight, Alex Soborov
##
## 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 Lic... |
imphil/fusesoc | fusesoc/provider/coregen.py | import logging
import os
import shutil
from fusesoc.provider.provider import Provider
from fusesoc.utils import Launcher
logger = logging.getLogger(__name__)
class Coregen(Provider):
def _checkout(self, local_dir):
script_file = self.config.get('script_file')
project_file = self.config.get('proj... |
IBT-FMI/SAMRI | samri/plotting/blender_visualization.py | import bpy
from bpy import context
import os
import sys
import argparse
## Example call from commandline: blender -b -P decimate_mesh_blender.py -- -f mesh.obj -o mesh_dec.obj -r 0.5 -i 2 -n 4 -l 0.5
## Blender will ignore all options after -- so parameters can be passed to python script.
# get the args passed to ble... |
sanguinariojoe/aquagpusph | examples/3D/spheric_testcase2_dambreak_mpi/cMake/plot_h.py | #******************************************************************************
# *
# * ** * * * * *
# * * * * * * * * * *
... |
szarroug3/X-Ray_Calibre_Plugin | lib/utilities.py | # utilities.py
'''General utility functions used throughout plugin'''
import re
import os
import time
import socket
from httplib import HTTPException
from calibre.library import current_library_path
from calibre_plugins.xray_creator.lib.exceptions import PageDoesNotExist
HONORIFICS = 'mr mrs ms esq prof dr fr rev pr ... |
chrisRubiano/TAP | indexing/buscar.py | import sys
import argparse
import pickle
def read_index(pickleFile):
pickleFile = open(pickleFile, 'rb')
index = pickle.load(pickleFile)
return index
def main(args):
wordIndex = read_index('indice.pickle')
docIndex = read_index('indice_doc.pickle')
wordList = args.palabras
for word in wo... |
apyrgio/synnefo | snf-astakos-app/astakos/im/views/im.py | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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.
#
# This program is distributed i... |
yuuagh/pywork | 20171127/go.py | # -*- coding:utf-8 -*-
# @author yuding
# 2017-09-23
import re
import os
import shutil
import msvcrt
import traceback
def mkdir(path):
# 去除首位空格
path = path.strip()
# 去除尾部 \ 符号
path = path.rstrip("\\")
isExists = os.path.exists(path)
if not isExists:
os.makedirs(path)
... |
pandastrail/InfoEng | scripting/exercises/p06_requests_web_files.py | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 26 14:42:10 2017
@author: ksagilop
Use requests modules to retrieve info from website and download files
A nice tutorial:
https://gist.github.com/phillipsm/0ed98b2585f0ada5a769
TODO: List of books available
TODO: Merge this function with Gender Detection script
TODO: A... |
sistason/kinksorter2 | src/kinksorter_app/management/commands/kink_besteffortsync.py | from os import path, access, W_OK, R_OK
import argparse
import logging
from django.core.management.base import BaseCommand, CommandError
from kinksorter_app.functionality.movie_handling import merge_movie, recognize_movie
from kinksorter_app.models import Movie, PornDirectory
from kinksorter_app.functionality.directo... |
Br3nda/docvert | core/document_type.py | # -*- coding: utf-8 -*-
import zipfile
class types(object):
oasis_open_document = "oasis_open_document (any version)"
pdf = "portable document format (any version)"
xml = "xml"
unknown_type = "unknown file type"
def detect_document_type(data):
data.seek(0)
try:
# 1. Try OpenDocument
... |
stickypants/asset_manager | pygal/view.py | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2016 Kozea
#
# 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... |
airodactyl/qutebrowser | qutebrowser/browser/webkit/webview.py | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
yozel/alskdjBlog | apps/comment/models.py | from django.contrib.auth.models import User
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db.models.signals import post_save
from django.core.cache import cache
from django.utils.translation import ugettext_lazy as _
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.