repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
cucumber/cucumber | tag-expressions/python/cucumber_tag_expressions/parser.py | # -*- coding: UTF-8 -*-
# pylint: disable=missing-docstring
"""
Provides parsing of boolean tag expressions.
.. code-block:: python
expression = TagExpressionParser.parse("a and (b or not c)")
assert True == expression.evaluate(["a", "other"])
assert "( a and ( b or not (c) ) )" == str(expression)
UNSUPP... |
frappe/frappe | frappe/utils/formatters.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
import datetime
from frappe.utils import formatdate, fmt_money, flt, cstr, cint, format_datetime, format_time, format_duration, format_timedelta
from frappe.model.meta import get_field_currency, get_field_pre... |
wbg-optronix-lab/emergence-lab | messaging/redis_config.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pickle
import uuid
from django.conf import settings
from django.utils import timezone
from redis import StrictRedis
class Helper(object):
"""
Helper functions for the app. UPDATE LATER.
"""
def __init__(self):
... |
onyxfish/leather | test.py | # -*- coding: utf8 -*-
import datetime
import leather
# data1 = [
# (2, 'foo'),
# (6, 'bar'),
# (9, 'bing')
# ]
#
# data2 = [
# (3, 'foo'),
# (5, 'bar'),
# (7, 'bing')
# ]
#
# lattice = leather.Lattice(shape=leather.Bars())
# lattice.add_many([data1, data2])
# lattice.to_svg('test.svg')
data... |
datapackages/jsontableschema-py | tableschema/constraints/pattern.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
COMPILED_RE = type(re.compile(""))
# Module API
def check_pattern(constraint, value):
if value is None:
return True
i... |
buildbot/buildbot_travis | buildbot_travis/tests/test_plugins.py | # Copyright 2012-2013 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
frappe/frappe | frappe/core/doctype/translation/test_translation.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# License: MIT. See LICENSE
import frappe
import unittest
from frappe import _
class TestTranslation(unittest.TestCase):
def setUp(self):
frappe.db.delete("Translation")
def tearDown(self):
frappe.local.lang = 'en'
frappe.loca... |
nagyistoce/cloudbucket | py/pdfminer/image.py | #!/usr/bin/env python2
import cStringIO
import logging
import sys
import struct
import os, os.path
from pdftypes import LITERALS_DCT_DECODE
from pdfcolor import LITERAL_DEVICE_GRAY, LITERAL_DEVICE_RGB, LITERAL_DEVICE_CMYK
def align32(x):
return ((x+3)/4)*4
## BMPWriter
##
class BMPWriter(object):
def __init... |
LeChosenOne/LegendCraft | HeartBeat/HeartBeatSaver.py | #Heartbeat Saver Copyright (c) <2013> <LeChosenOne> LegendCraft Team
#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 limitation the rights
#to use, copy, ... |
aaronfang/personal_scripts | external/curvyEdges.py | # import curvyEdges;curvyEdges.UI()
import maya.cmds as cmds
import pymel.core as pm
class UI(object):
def __init__(self):
title = 'curvyEdges'
version = '1.01'
self.ceObj = spline(self)
if pm.window('curvyEdgesWin', exists=True):
pm.deleteUI('curvyEdgesWin')
... |
aangert/PiParty | color_tests/interactive_colortest.py | import psmove
import colorsys
import time
from math import sqrt
from multiprocessing import Process, Queue
from time import sleep
moves = [psmove.PSMove(x) for x in range(psmove.count_connected())]
colors = ['FF0000','FF8000','FFFF00','80FF00','00FF00','00FF80','00FFFF','0080FF','0000FF','8000FF','FF00FF','FF0080']
... |
sejust/pykit | ectypes/test/test_idbase.py | #!/usr/bin/env python2
# coding: utf-8
import unittest
from pykit import utfjson
from pykit.ectypes import BlockGroupID
from pykit.ectypes import BlockID
from pykit.ectypes import BlockIndex
from pykit.ectypes import DriveID
from pykit.ectypes import IDBase
def id_str(_id): return '"{s}"'.format(s=str(_id))
class... |
mkrapp/semic | optimize/optimization_algorithms/cultural_algorithm.py | '''
This is the Python version of the cultural algorithm
presented in
"Clever Algorithms: Nature-Inspired Programming Recipes".
Find the book and the Ruby source codes on GitHub:
https://github.com/jbrownlee/CleverAlgorithms
'''
import random
def objective_function(vector):
return sum([x ** 2.0 f... |
Molecular-Image-Recognition/Molecular-Image-Recognition | code/rmgpy/cantherm/gaussianTest.py | #!/usr/bin/env python
# encoding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu),
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)
#
... |
kalafut/go-ledger | amount.py | from decimal import Decimal
from collections import OrderedDict
class Amount:
"""Amounts are full precision (rational) values of one or more commodities, e.g. ($4, 34 AAPL). Though most
quantities in ledgers deal in a single commodity, is it simpler for any Amount to consist of multiple
commodities. Some s... |
sharkySharks/PythonForDevs | DemoProgs/raise2.py | """
Create your own exception subclass inheriting from Exception.
You can add data that will be passed to the exception handler.
"""
class DepositError(Exception):
pass
def deposit1(amt):
if amt < 1000:
ex = DepositError('Deposit too small')
ex.dep = amt
ex.req = 1000
... |
MTASZTAKI/ApertusVR | plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/deps/v8/tools/unittests/testdata/testroot2/test/sweet/testcfg.py | # Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Dummy test suite extension with some flaky fruity tests.
"""
from testrunner.local import testsuite
from testrunner.objects import testcase
class Tes... |
sylvan5/PRML | ch1/bayes_fitting.py | #coding:utf-8
import numpy as np
from pylab import *
import sys
M = 9
ALPHA = 0.005
BETA = 11.1
def y(x, wlist):
ret = wlist[0]
for i in range(1, M + 1):
ret += wlist[i] * (x ** i)
return ret
def phi(x):
data = []
for i in range(0, M + 1):
data.append(x ** i)
ret = np.matrix(d... |
istresearch/scrapy-cluster | crawler/crawling/redis_dupefilter.py | from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
class RFPDupeFilter(BaseDupeFilter):
'''
Redis-based request duplication filter
'''
def __init__(self, server, key, timeout):
'''
Initialize duplication filter
@param server: th... |
sebastienbarbier/723e_server | seven23/api/changes/views.py | """
Views for api/va/transactions
"""
from itertools import chain
import django_filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import permissions
from rest_framework.decorators import permission_classes
from rest_framework_bulk import BulkModelViewSet
from seven23.models.... |
0vercl0k/rp | src/third_party/beaengine/tests/0fc1.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 progra... |
thebongy/MakeMyOutputs | docx/oxml/__init__.py | # encoding: utf-8
"""
Initializes oxml sub-package, including registering custom element classes
corresponding to Open XML elements.
"""
from __future__ import absolute_import
from lxml import etree
from .ns import NamespacePrefixedTag, nsmap
# configure XML parser
element_class_lookup = etree.ElementNamespaceCla... |
jonsimington/app | project/teams/urls.py | """
project.teams URL Configuration
"""
from django.conf.urls import url
from .views import (team_list_view,
team_detail_view,
team_create_view,
team_leave_view,
team_update_view,
request_send_view,
... |
novapost/workalendar | workalendar/america/paraguay.py | from datetime import date
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('PY')
class Paraguay(WesternCalendar):
"Paraguay"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 14, "Independence Day"),
(6, 12, "Chaco Armistice"),
(9, 19, "... |
jeffjenkins/MongoAlchemy | test/test_schema_tools.py | from __future__ import print_function
from mongoalchemy.py3compat import *
from nose.tools import *
from mongoalchemy.session import Session
from mongoalchemy.document import Document, Index, FieldNotRetrieved
from mongoalchemy.fields import *
from mongoalchemy.query import BadQueryException, Query, BadResultException... |
bnzk/django-painless-redirects | painless_redirects/migrations/0009_redirect_enabled.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-13 06:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('painless_redirects', '0008_auto_20191213_0640'),
]
operations = [
migratio... |
kain88-de/mdanalysis | package/MDAnalysis/topology/PDBParser.py |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... |
AsgerPetersen/QGIS | python/plugins/db_manager/db_manager_plugin.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
fridex/gofed-web | goview/admin.py | from django.contrib import admin
from django import forms
from goview.models import GoProjectRequest, GoProjectReview, GoPage
from goview.models import GoProjectDesc, GoProjectCommit, GoProjectLog
class GoProjectRequestAdmin(admin.ModelAdmin):
fieldsets = [
('Project request', {'fields': ['email', 'scm_url', 'date'... |
fxia22/ASM_xf | PythonD/lib/python2.4/site-packages/link/pyldap/ldap/ldapobject.py | """
ldapobject.py - wraps class _ldap.LDAPObject
written by Michael Stroeder <michael@stroeder.com>
See http://python-ldap.sourceforge.net for details.
\$Id: ldapobject.py,v 1.75 2003/12/23 12:49:09 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
- LDAPObject class should be e... |
ertugerata/iso-work | pisiman/repotools/project.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010 TUBITAK/UEKAE
#
# 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 l... |
twchoi/Netmod_git | pytools/comgraph.py | #!/usr/bin/python
from pynetmod import *
import sys
#size = int(sys.argv[1])
#r = Ran1Random()
#pl = PowerLawDRV(r,-2.0, 2, int(size ** 0.5))
#net = DegreeLawNetFac(size, pl, r, False).create()
net = Network(cin)
cp = ComponentPart()
np = NewmanCom()
comps = cp.partition(net)
p = 0
for comp in comps:
parts = np.par... |
rbian/tp-libvirt | libvirt/tests/src/virsh_cmd/domain/virsh_domfstrim.py | import os
import logging
from autotest.client.shared import error
from autotest.client import utils
from virttest import virsh, utils_misc
from virttest.libvirt_xml import vm_xml
from virttest.libvirt_xml.devices.disk import Disk
from virttest.libvirt_xml.devices.controller import Controller
from provider import libvir... |
lukas/ml-class | examples/scikit/classifier-svm.py | import pandas as pd
import numpy as np
# Get a pandas DataFrame object of all the data in the csv file:
df = pd.read_csv('tweets.csv')
# Get pandas Series object of the "tweet text" column:
text = df['tweet_text']
# Get pandas Series object of the "emotion" column:
target = df['is_there_an_emotion_directed_at_a_bran... |
echohenry2006/tvb-library | tvb/datatypes/graph_scientific.py | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... |
VoIP-co-uk/sftf | HFH/Contentlength.py | #
# Copyright (C) 2004 SIPfoundry Inc.
# Licensed by SIPfoundry under the GPL license.
#
# Copyright (C) 2004 SIP Forum
# Licensed to SIPfoundry under a Contributor Agreement.
#
#
# This file is part of SIP Forum Test Framework.
#
# SIP Forum Test Framework is free software; you can redistribute it
# and/or modify it ... |
cnewcome/sos | sos/policies/__init__.py | from __future__ import with_statement
import os
import re
import platform
import time
import fnmatch
import tempfile
from os import environ
from sos.utilities import (ImporterHelper,
import_module,
shell_out)
from sos.plugins import IndependentPlugin, Experimental... |
Distrotech/bzr | bzrlib/tests/test_rio.py | # Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011 Canonical Ltd
#
# 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.
#
# T... |
mathijsreykers/drupal-7.43 | sites/all/vendor/drupal/drupal-extension/doc/conf.py | # -*- coding: utf-8 -*-
#
# the Drupal Extension to Behat and Mink documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 7 09:40:13 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in thi... |
Snifer/BurpSuite-Plugins | faraday/shell/controller/env.py | #!/usr/bin/env python
'''
Faraday Penetration Test IDE - Community Version
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
'''
import os
import pwd
import re
from cStringIO import StringIO
from model.common import ModelObject
from sh... |
ioannistsanaktsidis/inspire-next | inspire/base/format_elements/bfe_inspire_proceedings.py | # -*- coding: utf-8 -*-
##
## This file is part of INSPIRE.
## Copyright (C) 2015 CERN.
##
## INSPIRE 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) a... |
florisvb/multi_alicat_control | setup.py | from setuptools import setup
setup(
name="alicat",
version="0.1.11",
description="Python driver for Alicat mass flow controllers.",
url="http://github.com/numat/alicat/",
author="Patrick Fuller",
author_email="pat@numat-tech.com",
packages=["alicat"],
install_requires=["pyserial"],
... |
nachandr/cfme_tests | cfme/tests/ansible/test_embedded_ansible_automate.py | import fauxfactory
import pytest
from cfme import test_requirements
from cfme.automate.import_export import FileImportSelectorView
from cfme.automate.simulation import simulate
from cfme.control.explorer import alert_profiles
from cfme.fixtures.automate import DatastoreImport
from cfme.infrastructure.provider.virtualc... |
simontakite/sysadmin | pythonscripts/programmingpython/Ai/TicTacToe/tictactoe.py | # this file has been updated for Python 3.X
from tictactoe_lists import *
# game object generator - external interface
def TicTacToe(mode=Mode, **args):
try:
classname = 'TicTacToe' + mode # e.g., -mode Minimax
classobj = eval(classname) # get class by string nam... |
pmghalvorsen/gramps_branch | gramps/plugins/textreport/simplebooktitle.py | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... |
sergiopasra/megaradrp | megaradrp/recipes/calibration/tests/test_dark.py | #
# Copyright 2015-2021 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
import shutil
from tempfile import mkdtemp
import astropy.io.fits as fits
import numpy
from numina.core import DataFrame, ObservationResult
import numin... |
kwilliams-mo/iris | lib/iris/tests/test_concatenate.py | # (C) British Crown Copyright 2013, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any later ve... |
nopjmp/SickRage | sickbeard/clients/generic.py | # coding=utf-8
# 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 version 3 of the License, or
# (at your option) any late... |
kenorb-contrib/BitTorrent | windows_installer/winprepnsi.py | # 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 in the hope that it will be useful,
# bu... |
jhgoebbert/cvl-fabric-launcher | launcher_version_number.py | # MASSIVE/CVL Launcher - easy secure login for the MASSIVE Desktop and the CVL
#
# Copyright (c) 2012-2013, Monash e-Research Centre (Monash University, Australia)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... |
PortSwigger/elastic-burp | test.py | from doc_HttpRequestResponse import DocHTTPRequestResponse
from elasticsearch_dsl.connections import connections
from elasticsearch_dsl import Index
from datetime import datetime
connections.create_connection(hosts=["localhost"])
idx = Index("test")
idx.doc_type(DocHTTPRequestResponse)
#idx.create()
DocHTTPRequestRe... |
jdemel/gnuradio | gr-blocks/python/blocks/qa_argmax.py | #!/usr/bin/env python
#
# Copyright 2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, blocks
import math
class test_arg_max(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_blo... |
hdlj/MongooseOS | MOSApi.py | #=============================================================================
# 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) ... |
anoidgit/padavan | trunk/user/nfsd/nfs-utils-2.3.1/tools/mountstats/mountstats.py | #!/usr/bin/python
# -*- python-mode -*-
"""Parse /proc/self/mountstats and display it in human readable form
"""
from __future__ import print_function
__copyright__ = """
Copyright (C) 2005, Chuck Lever <cel@netapp.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GN... |
patriczek/faf | src/pyfaf/storage/migrations/versions/2e5f6d8b68f5_add_contact_email_tables.py | # Copyright (C) 2014 ABRT Team
# Copyright (C) 2014 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... |
engla/kupfer | kupfer/kupferui.py | """
Access functions of Kupfer's Interface
"""
from gi.repository import Gtk
from kupfer import utils, version
def _get_time(ctxenv):
return ctxenv.get_timestamp() if ctxenv else \
Gtk.get_current_event_time()
def show_help(ctxenv=None):
"""
Show Kupfer help pages, if possible
"""
if ... |
hzlf/openbroadcast.org | website/tools/mutagen/mp4/_as_entry.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Christoph Reiter
#
# 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.
from mu... |
MingdaZhou/gr-chancoding | python/qa_chancoding_rmg_decoder_vii.py | #!/usr/bin/env python
#
# Copyright 2011 Communications Engineering Lab, KIT
#
# 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 opt... |
mscuthbert/abjad | abjad/tools/pitchtools/test/test_pitchtools_NumberedIntervalClass___init__.py | # -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_NumberedIntervalClass___init___01():
mcic = pitchtools.NumberedIntervalClass(3)
assert repr(mcic) == 'NumberedIntervalClass(3)'
assert str(mcic) == '+3'
assert mcic.number == 3
def test_pitchtools_NumberedIntervalClass___init___02()... |
robwarm/gpaw-symm | gpaw/test/lcao_bsse.py | from ase.structure import molecule
from gpaw import GPAW
from gpaw.poisson import PoissonSolver
from gpaw.atom.basis import BasisMaker
from gpaw.test import equal
# Tests basis set super position error correction
# Compares a single hydrogen atom to a system of one hydrogen atom
# and one ghost hydrogen atom. The sy... |
mscuthbert/abjad | abjad/tools/indicatortools/SystemBreak.py | # -*- encoding: utf-8 -*-
from abjad.tools.abctools.AbjadValueObject import AbjadValueObject
class SystemBreak(AbjadValueObject):
r'''System break indicator.
.. container:: example
**Example 1.** Default system break:
::
>>> staff = Staff("c'4 d'4 e'4 f'4")
>>> bre... |
CiuffysHub/MITMf | mitmflib-0.18.4/mitmflib/impacket/dcerpc/v5/dcom/comev.py | # Copyright (c) 2003-2015 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Author: Alberto Solino (@agsolino)
#
# Description:
# [MS-COMEV]: Component Object Model Plus (COM+... |
dparks1134/Art | SVG/Examples/svg_write/examples/koch_snowflake.py | #!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: svg examples
# Created: 08.09.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
try:
import svgwrite
except ImportError:
# if svgwrite is not 'installed' append parent dir of __file__ to sys.path
import sys, os
sys.path.ins... |
asoliveira/NumShip | scripts/ZigZag.py | # -*- coding: iso-8859-1 -*-
"""
Plota curva de ZigZag
____________________
Variáveis de entrada:
save (True/False) -- Opção para salvar as figuras ou somente mostrar os gráficos, utilizar somente True até o momento;
formato ('png'/'pdf'/'ps'/'eps'/'svg') -- formatos de saída da figura;
passo (float) -- Paso de tempo ... |
cmelange/ansible | test/runner/lib/executor.py | """Execute Ansible tests."""
from __future__ import absolute_import, print_function
import os
import re
import tempfile
import time
import textwrap
import functools
import shutil
import stat
import random
import pipes
import string
import atexit
import lib.pytar
import lib.thread
from lib.core_ci import (
Ansib... |
manjaro/thus | thus/parted3/lvm.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# lvm.py
#
# Copyright © 2013-2015 Antergos
#
# This file is part of Cnchi.
#
# Cnchi 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 t... |
etherkit/OpenBeacon2 | client/win/venv/Lib/site-packages/PyInstaller/hooks/hook-importlib_resources.py | #-----------------------------------------------------------------------------
# Copyright (c) 2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
nortikin/sverchok | node_scripts/SNLite_templates/demo/recursive_subdivision.py | """
in quad_verts v
in quad_faces s
in seed s d=1 n=2
in random_factor s d=0.1 n=2
in iterations s d=1 n=2
out verts v
out edges s
out faces s
"""
from sverchok.utils.modules.geom_utils import interp_v3_v3v3 as lerp
from sverchok.utils.sv_mesh_utils import mesh_join
from sverchok.utils.sv_bmesh_utils import remove_dou... |
cylc/cylc | tests/integration/test_data_store_mgr.py | # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... |
dineshsg/spoken-website | cdcontent/templatetags/cdcontentdata.py | from django.contrib.auth.models import User
from django.conf import settings
from creation.models import *
from django import template
import os
register = template.Library()
def get_foss_name(foss, key):
return foss[key]['foss']
def get_lang_details(foss, key):
data = ''
for lang_key, lang_detail in fos... |
frippe12573/geonode | geonode/base/models.py | from datetime import datetime
import os
import hashlib
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.core.files.base impor... |
adsabs/AdsDataSqlSync | alembic/versions/35972b7b1033_create_metrics_table.py | """create metrics table
Revision ID: 35972b7b1033
Revises:
Create Date: 2016-07-26 14:11:35.655046
"""
# revision identifiers, used by Alembic.
revision = '35972b7b1033'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgr... |
cedadev/jasmin_cis | cis/plotting/comparativescatter.py | """
A scatter plot with one dataset plotted against another (as opposed to plotting data against a coordinate)
"""
import logging
from cis.plotting.genericplot import APlot
class ComparativeScatter(APlot):
def __init__(self, packed_data, *mplargs, **mplkwargs):
"""
Note that the packed_data argum... |
sehrhardt/espresso | samples/python/not-working/thermostat_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
thebestgirl123/CloudBot | cloudbot/util/web.py | """
web.py
Contains functions for interacting with web services.
Created by:
- Bjorn Neergaard <https://github.com/neersighted>
Maintainer:
- Luke Rogers <https://github.com/lukeroge>
License:
GPL v3
"""
import json
import requests
# Constants
DEFAULT_SHORTENER = 'is.gd'
DEFAULT_PASTEBIN = 'hastebin... |
Zlash65/erpnext | erpnext/accounts/doctype/gl_entry/gl_entry.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 frappe, erpnext
from frappe import _
from frappe.utils import flt, fmt_money, getdate, formatdate
from frappe.model.document import Document
from... |
cathyyul/sumo | tools/assign/assign.py | """
@file assign.py
@author Yun-Pang Wang
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2007-11-25
@version $Id: assign.py 14425 2013-08-16 20:11:47Z behrisch $
This script is for executing traffic assignment according to the required assignment model.
The incremental assignment model, the C-Logit ... |
NarlikarLab/DIVERSITY | weblogoMod/weblogolib/_cli.py | #!/usr/bin/env python
# -------------------------------- WebLogo --------------------------------
# Copyright (c) 2003-2004 The Regents of the University of California.
# Copyright (c) 2005 Gavin E. Crooks
# Copyright (c) 2006-2011, The Regents of the University of California, through
# Lawrence Berkeley Nationa... |
hmpf/nav | tests/unittests/topology/analyze_test.py | # Copyright (C) 2017 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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 hope t... |
peterjoel/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/firefox.py | import json
import os
import platform
import signal
import subprocess
import sys
import mozinfo
import mozleak
import mozversion
from mozprocess import ProcessHandler
from mozprofile import FirefoxProfile, Preferences
from mozrunner import FirefoxRunner
from mozrunner.utils import test_environment, get_stack_fixer_fun... |
jwhitlock/kuma | kuma/wiki/tests/test_feeds.py | # -*- coding: utf-8 -*-
import json
from datetime import datetime
import pytest
from django.utils.six.moves.urllib_parse import parse_qs, urlparse
from django.utils.timezone import make_aware
from pyquery import PyQuery as pq
from pytz import AmbiguousTimeError
from kuma.core.tests import assert_shared_cache_header
f... |
cstipkovic/spidermonkey-research | python/mozbuild/mozpack/packager/__init__.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from mozbuild.preprocessor import Preprocessor
import re
import os
from mozpack.... |
jasinner/victims-web | test/__init__.py | # This file is part of victims-web.
#
# Copyright (C) 2013 The Victims Project
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... |
jittat/ku-eng-direct-admission | application/decorators.py | from django.http import HttpResponseRedirect
from commons.utils import redirect_to_index
from models import Applicant
def applicant_required(view_function):
"""
Returns a view function that checks if the requesting user is a
valid applicant.
"""
def decorate(request, *args, **kwargs):
if no... |
superdesk/Live-Blog | documentor/libraries/Sphinx-1.1.3-py3.2/sphinx/ext/refcounting.py | # -*- coding: utf-8 -*-
"""
sphinx.ext.refcounting
~~~~~~~~~~~~~~~~~~~~~~
Supports reference count annotations for C API functions. Based on
refcount.py and anno-api.py in the old Python documentation tools.
Usage: Set the `refcount_file` config value to the path to the reference
count data f... |
ESOedX/edx-platform | openedx/core/djangoapps/schedules/management/commands/__init__.py | """
Base management command for sending emails
"""
from __future__ import absolute_import
import datetime
import pytz
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand
from openedx.core.djangoapps.schedules.utils import PrefixedDebugLoggerMixin
class SendEmailBaseComm... |
shoopio/shoop | shuup/admin/modules/media/utils.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.db import tra... |
anbangr/trusted-juju | juju/charm/tests/test_base.py | import yaml
from juju.charm.base import CharmBase, get_revision
from juju.charm.metadata import MetaData
from juju.errors import CharmError
from juju.lib.testing import TestCase
class MyCharm(CharmBase):
pass
class CharmBaseTest(TestCase):
def setUp(self):
self.charm = MyCharm()
def assertUns... |
archetipo/stock-logistics-workflow | mrp_lock_lot/__openerp__.py | # -*- coding: utf-8 -*-
# © 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# © 2015 AvanzOsc (http://www.avanzosc.es)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "MRP Lock Lot",
"Summary": "Restrict blocked lots in Manufacturing Orders",
"versi... |
fastmonkeys/kuulemma | manage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Kuulemma
# Copyright (C) 2014, Fast Monkeys Oy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... |
asm-products/nested-communities-core | volunteering/migrations/0024_dutyeditable.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('volunteering', '0023_auto_20140806_1432'),
]
operations = [
migrations.CreateModel(
name='DutyEditable',
... |
odoo-brazil/l10n-brazil-wip | sped_account/models/account_account_tree_analysis.py | # -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from __future__ import division, print_function, unicode_literals
from odoo import api, fields, models, _
from odoo.tools.sql import drop_view_if_exists
SQL_ACCOUNT_TREE_ANALYSIS_VIEW = '''
create or repla... |
bblacey/FreeCAD-MacOS-CI | src/Mod/Fem/PyGui/_ViewProviderFemMeshGmsh.py | # ***************************************************************************
# * *
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
bblacey/FreeCAD-MacOS-CI | src/Mod/Path/PathScripts/PathDressupDogbone.py | # -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * ... |
agry/NGECore2 | scripts/mobiles/generic/faction/imperial/imperial_recruiter.py | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(co... |
teamCarel/EyeTracker | src/shared_modules/calibration_routines/calibration_plugin_base.py | '''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
-----------------------------------... |
nerosketch/djing | devapp/tasks.py | from typing import Iterable
from subprocess import run
from celery import shared_task
from devapp.models import Device
@shared_task
def onu_register(device_ids: Iterable[int]):
with open('/etc/dhcp/macs.conf', 'w') as f:
for dev_id in device_ids:
dev = Device.objects.get(pk=dev_id)
... |
dsiddharth/access-keys | keystone/token/providers/pki.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# 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
#
# Unle... |
sridevikoushik31/openstack | nova/tests/test_migration_utils.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Boris Pavlovic (boris@pavlovic.me).
# 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
#
# ... |
tucbill/manila | manila/scheduler/weights/capacity.py | # Copyright (c) 2012 OpenStack, LLC.
# 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 requi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.