repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
PabloCastellano/nodeshot | nodeshot/core/api/urls.py | from django.conf.urls import patterns, include, url
from .settings import settings, API_PREFIX, API_APPS_ENABLED
urlpatterns = patterns('nodeshot.core.api.views',
url(r'^%s$' % API_PREFIX, 'root_endpoint', name='api_root_endpoint'),
)
if 'rest_framework_swagger' in settings.INSTALLED_APPS:
urlpatterns += pa... |
bboalimoe/ndn-cache-policy | docs/sphinx-contrib/osaka/doc/conf.py | # -*- coding: utf-8 -*-
#
# sphinxcontrib-osaka documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 10 11:39:05 2010.
#
# 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 f... |
AXAz0r/apex-sigma-core | sigma/modules/moderation/server_settings/roles/role_control/removerole.py | import discord
from sigma.core.utilities.role_processing import user_matching_role, matching_role
async def removerole(cmd, message, args):
if message.author.permissions_in(message.channel).manage_roles:
if args:
if len(args) >= 2:
if message.mentions:
targ... |
ldjebran/robottelo | tests/foreman/api/test_foremantask.py | """Unit tests for the ``foreman_tasks/api/v2/tasks`` paths.
:Requirement: Foremantask
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: TasksPlugin
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from nailgun import entities
from requests.exceptions import HTTPError
from robottelo.de... |
tsdgeos/snapcraft | snapcraft/internal/common.py | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 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... |
drxaero/calibre | setup/install.py | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys, os, textwrap, subprocess, shutil, tempfile, atexit, glob
from setup imp... |
QuantumElephant/horton | horton/grid/test/test_rtransform.py | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... |
tiredtyrant/CloudBot | plugins/giphy.py | import random
import requests
from cloudbot import hook
from cloudbot.bot import bot
api_url = 'http://api.giphy.com/v1/gifs'
@hook.command("gif", "giphy")
def giphy(text):
"""<query> - Searches giphy.com for a gif using the provided search term."""
api_key = bot.config.get_api_key("giphy")
term = text... |
tremby/deluge-yarss-plugin | yarss2/lib/numrangeregex/numrangeregex_test.py | import re
import unittest
from numrangeregex import generate_numeric_range_regex
class NrRangeRegexGeneratorTest(unittest.TestCase):
def _verify_range(self, regex, min_, max_, from_min_, to_max_):
for nr in xrange(from_min_, to_max_ + 1):
if min_ <= nr <= max_:
self.assertTru... |
bepatient-fr/itools | itools/xml/namespaces.py | # -*- coding: UTF-8 -*-
# Copyright (C) 2005-2008, 2010 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2008 David Versmisse <versmisse@lil.univ-littoral.fr>
# Copyright (C) 2008 Sylvain Taverne <taverne.sylvain@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
emakis/erpnext | erpnext/regional/india/utils.py | import frappe, re
from frappe import _
from erpnext.regional.india import states, state_numbers
def validate_gstin_for_india(doc, method):
if not hasattr(doc, 'gstin'):
return
if doc.gstin:
doc.gstin = doc.gstin.upper()
if doc.gstin != "NA":
p = re.compile("[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]... |
tojonmz/treeherder | tests/test_utils.py | import datetime
import json
import responses
from tests.sampledata import SampleData
from treeherder.client.thclient import TreeherderClient
from treeherder.etl.jobs import store_job_data
from treeherder.etl.push import store_push_data
from treeherder.model import models
def post_collection(project, th_collection):... |
blckshrk/Weboob | modules/arretsurimages/browser.py | # -*- coding: utf-8 -*-
# Copyright(C) 2013 franek
#
# This file is part of weboob.
#
# weboob 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... |
mvs-live/metaverse | test/test-rpc-v3/TestCase/MVSTestCase.py | import unittest
from utils import mvs_rpc, common, code
from Roles import Alice, Bob, Cindy, Dale, Eric, Frank, Zac
class MVSTestCaseBase(unittest.TestCase):
roles = (Alice, Bob, Cindy, Dale, Eric, Frank, Zac)
need_mine = True
def setUp(self):
for role in self.roles:
try:
... |
kinnou02/navitia | source/tyr/tests/integration/endpoints_test.py | # coding: utf-8
# Copyright (c) 2001-2019, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to... |
indictranstech/biggift-erpnext | erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.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
import frappe.defaults
from frappe import msgprint, _
from frappe.utils import cstr, flt, cint
from erpnext.stock.stock_ledger import upda... |
Nosferatul/coala | tests/settings/SettingTest.py | import os
import unittest
from collections import OrderedDict
from coalib.bearlib.languages import Language
from coalib.settings.Setting import (
Setting, path, path_list, url, typed_dict, typed_list, typed_ordered_dict,
glob, glob_list,
language,
float_list, bool_list, int_list, str_list,
)
from coali... |
DeveloperMal/wger | wger/manager/migrations/0007_auto_20160311_2258.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def convert_logs(apps, schema_editor):
'''
Adds a unit to users who have imperial units in the profile
'''
WorkoutLog = apps.get_model('manager', 'WorkoutLog')
UserProfile = apps.get_model('c... |
AdamWill/blivet | blivet/devicelibs/edd.py | #
# edd.py
# BIOS EDD data parsing functions
#
# Copyright 2010-2015 Red Hat, Inc.
#
# 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 la... |
GStreamer/gst-python | examples/plugins/python/identity.py | #!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# identity.py
# 2016 Marianna S. Buschle <msb@qtec.com>
#
# Simple identity element in python
#
# You can run the example from the source doing from gst-python/:
#
# $ export GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD/plugin:$PWD/examples/plugins
# $... |
tchx84/debian-pkg-sugar-toolkit | src/sugar/graphics/toolbox.py | # Copyright (C) 2007, Red Hat, Inc.
#
# 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 of the License, or (at your option) any later version.
#
# This library is distrib... |
z25/pyZOCP | examples/signal_subscriber.py | #!/usr/bin/python3
from zocp import ZOCP
import socket
import logging
class SubscriberNode(ZOCP):
# Constructor
def __init__(self, nodename):
super(SubscriberNode, self).__init__(nodename)
self.string_value = ''
self.count_value = 0
def run(self):
self.register_string("My ... |
zuck/prometeo-erp | projects/forms.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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... |
Baumelbi/IntroPython2016 | Examples/Session09/yield_example.py | def counter():
print('counter: starting counter')
i = -3
while i < 3:
i = i + 1
print('counter: yield', i)
yield i
return None
# if __name__ == '__main__':
# print "the generator function:"
# print repr(counter)
# print "call generator function"
# c = counter()... |
rushiagr/keystone | keystone/contrib/revoke/backends/sql.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
yamt/tempest | tempest/services/compute/json/hypervisor_client.py | # Copyright 2013 IBM Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
takeshineshiro/nova | nova/api/openstack/compute/server_metadata.py | # Copyright 2011 OpenStack Foundation
# 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 requ... |
asascience-open/ooi-ui-services | ooiservices/tests/test_log_entries.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Tests for log entry API
'''
import unittest
from base64 import b64encode
from ooiservices.app import create_app, db
from ooiservices.app.models import User, UserScope
from ooiservices.app.models import OperatorEvent, OperatorEventType, Organization
from ooiservices.ap... |
mnubo/kubernetes-py | kubernetes_py/K8sNode.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
import json
import time
from kubernetes_py.K8sExceptions import DrainNodeException, TimedOutException, NotFoundException
from kubernetes_py.K... |
NeCTAR-RC/swift | test/unit/container/test_auditor.py | # Copyright (c) 2010-2012 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
#
# Unless required by applicable law or agree... |
benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice_binding.py | #
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# 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 l... |
pczhaoyun/obtainfo | zinnia/migrations/0013_compute_discussion_count.py | from django.db.models import Q
from django.contrib.comments.models import CommentFlag
from zinnia.flags import PINGBACK
from zinnia.flags import TRACKBACK
from south.v2 import DataMigration
from zinnia.migrations import user_name
from zinnia.migrations import user_table
from zinnia.migrations import user_orm_label
f... |
tuxology/bcc | tools/compactsnoop.py | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# compactsnoop Trace compact zone and print details including issuing PID.
# For Linux, uses BCC, eBPF.
#
# This uses in-kernel eBPF maps to cache process details (PID and comm) by
# compact zone begin, as well as a starting timestamp for calculati... |
nburn42/tensorflow | tensorflow/python/keras/applications/nasnet.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
tonybaloney/st2contrib | packs/vdx/tests/test_action_system_host_name.py | """Generated test for checking pynos based actions
"""
import xml.etree.ElementTree as ET
from st2tests.base import BaseActionTestCase
from system_host_name import system_host_name
__all__ = [
'TestSystemHostName'
]
class MockCallback(object): # pylint:disable=too-few-public-methods
"""Class to hold mock ca... |
USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/helix/extraction/felix_furnace_hot_blank.py | '''
eqtime: 30
'''
def main():
start_response_recorder()
info('Felix Furnace Hot Blank')
# prepare bone for furnace analysis
close('F')
open('D')
# isolate furnace from bone
close('J')
close('FC')
open('FH')
info('Running a Hot Blank')
do_extraction()
... |
KaranToor/MA450 | google-cloud-sdk/lib/surface/compute/groups/remove_members.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
affo/nova | nova/tests/functional/v3/test_baremetal_nodes.py | # Copyright 2015 IBM Corp.
#
# 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 t... |
badock/nova | nova/virt/libvirt/imagecache.py | # Copyright 2012 Michael Still and Canonical Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
clinc/models | slim/datasets/dataset_utils.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
axt/angr | angr/procedures/cgc/random.py | import angr
import itertools
rand_count = itertools.count()
class random(angr.SimProcedure):
#pylint:disable=arguments-differ
IS_SYSCALL = True
def run(self, buf, count, rnd_bytes):
if self.state.mode == 'fastpath':
# Special case for CFG
if (not self.state.se.symbolic(co... |
jnns/wagtail | wagtail/search/tests/test_indexed_class.py | from contextlib import contextmanager
from django.core import checks
from django.test import TestCase
from wagtail.core.models import Page
from wagtail.search import index
from wagtail.tests.search import models
from wagtail.tests.testapp.models import EventPage, SingleEventPage
@contextmanager
def patch_search_fie... |
materialsvirtuallab/nano266 | labs/lab4/fcc_surf_gen.py | from __future__ import division
import numpy as np
import math
import argparse
coords100 = np.array(
[[0.0, 0.0, 0.0],
[0.5, 0.5, 0.0],
[0.5, 0.0, 0.5],
[0.0, 0.5, 0.5]]
)
def generate_slab(args):
a = args.a
nslab = args.nslab
nvac = args.nvac
k = args.k
nlayers = nslab + nvac... |
Chilledheart/chromium | third_party/android_platform/development/scripts/symbol.py | #!/usr/bin/python
#
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
navotsil/Open-Knesset | agendas/models.py | from __future__ import division
from itertools import chain
from operator import itemgetter, attrgetter
from collections import defaultdict
import math
from django.db import connection
from django.db import models
from django.db.models import Sum, Q, Count, F
from django.utils.translation import ugettext_lazy as _
fro... |
petrlosa/ella | ella/positions/admin.py | from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.target:
return '-- %s --' % ugettext('em... |
torchbox/wagtail | wagtail/users/tests/test_admin_views.py | import unittest.mock
from django import forms
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploadedfile import SimpleUp... |
SinnerSchraderMobileMirrors/django-cms | cms/extensions/extension_pool.py | from cms.exceptions import SubClassNeededError
from cms.models import Title
from .models import PageExtension, TitleExtension
class ExtensionPool(object):
def __init__(self):
self.page_extensions = set()
self.title_extensions = set()
self.signaling_activated = False
def register(self... |
catapult-project/catapult | systrace/profile_chrome/util.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import gzip
import os
import time
import zipfile
import six
def ArchiveFiles(host_files, output):
with zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) ... |
konstantinoskostis/sqlalchemy-utils | tests/aggregate/test_simple_paths.py | import pytest
import sqlalchemy as sa
from sqlalchemy_utils.aggregates import aggregated
@pytest.fixture
def Thread(Base):
class Thread(Base):
__tablename__ = 'thread'
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.Unicode(255))
@aggregated('comments', sa.Column... |
pylbert/upm | examples/python/grovescam.py | #!/usr/bin/env python
#
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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
# wit... |
HOQTEC/MCP | jumpgate/identity/drivers/core.py | import base64
import json
import logging
import time
from jumpgate.common import aes
from jumpgate.common import exceptions
from jumpgate.common import utils
from jumpgate import config
DEFAULT_TOKEN_DURATION = 60 * 60 * 24
LOG = logging.getLogger(__name__)
def auth_driver():
return utils.load_driver(config.CON... |
Flexget/Flexget | flexget/components/sites/sites/koreus.py | import re
from loguru import logger
from flexget import plugin
from flexget.components.sites.urlrewriting import UrlRewritingError
from flexget.event import event
from flexget.utils.soup import get_soup
logger = logger.bind(name='koreus')
class UrlRewriteKoreus:
"""Koreus urlrewriter."""
# urlrewriter API... |
wenhulove333/ScutServer | Sample/Doudizhu/Server/src/ZyGames.Doudizhu.HostServer/bin/Debug/Script/PyScript/Action/Action2008.py | """2008_明牌通知接口"""
import clr, sys
from action import *
from lang import Lang
clr.AddReference('ZyGames.Framework.Game')
clr.AddReference('ZyGames.Doudizhu.Lang')
clr.AddReference('ZyGames.Doudizhu.Model')
clr.AddReference('ZyGames.Doudizhu.Bll')
from ZyGames.Framework.Game.Service import *
from ZyGames.Doudiz... |
livingbio/libsaas | libsaas/services/zendesk/resources.py | from libsaas import http, parsers, port
from libsaas.services import base
class ZendeskResource(base.RESTResource):
path = None
@base.apimethod
def get(self, page=None, per_page=None):
"""
For single-object resources, fetch the object's data. For collections,
fetch all of the obj... |
willbarton/clouseau | clouseau/commit_parser.py |
import os
import sys
import re
import subprocess
import pprint
from clouseau_model import ClouseauModel
# -----------------------------------------------------------------------------------------------
class CommitParser:
"""
Converts git-show's stdout to Python dictionary for any commit messages and file ch... |
rajashreer7/autotest-client-tests | linux-tools/hostname/hostname.py | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class hostname(test.test):
"""
Autotest module for testing basic functionality
of hostname
@author Basavaraju.G <basavarg@in.ibm.com>
"""
version = 1
nfail = 0
... |
kawamuray/ganeti | lib/storage/drbd_cmdgen.py | #
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013 Google Inc.
#
# 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.
#
... |
slashdd/sos | sos/policies/runtimes/podman.py | # Copyright (C) 2020 Red Hat, Inc., Jake Hunsaker <jhunsake@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU Gen... |
herow/planning_qgis | python/plugins/processing/algs/qgis/SelectByLocation.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
SelectByLocation.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... |
matthewrmshin/rose | .travis/sitecustomize.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-8 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
nojhan/weboob-devel | modules/colisprive/module.py | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Florent Fourcot
#
# This file is part of weboob.
#
# weboob 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 op... |
mmpagani/oq-hazardlib | openquake/hazardlib/tests/source/non_parametric_test.py | # The Hazard Library
# Copyright (C) 2013-2014, GEM Foundation
#
# 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 later version.
... |
jfriedly/rethinkdb | scripts/nightly-test/remotely.py | # Copyright 2010-2012 RethinkDB, all rights reserved.
import sys, subprocess32, tempfile, string, signal, os
class RemotelyInternalError(Exception):
pass
class ScriptFailedError(Exception):
def __init__(self, exit_code):
self.exit_code = exit_code
def __str__(self):
return "Remote script f... |
VitalPet/c2c-rd-addons | stock_invoice_service/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
renatonlima/PySPED | pysped/xml_sped/certificado.py | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... |
monikagrabowska/osf.io | api/preprint_providers/serializers.py | from rest_framework import serializers as ser
from api.base.utils import absolute_reverse
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class PreprintProviderSerializer(JSONAPISerializer):
filterable_fields = frozenset([
'name',
'description',
'id'
... |
leppa/home-assistant | homeassistant/components/satel_integra/binary_sensor.py | """Support for Satel Integra zone states- represented as binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import (
CONF_OUTPUTS,
CONF_ZONE... |
stackforge/cloudbase-init | cloudbaseinit/tests/plugins/common/test_trim.py | # Copyright 2017 Cloudbase Solutions Srl
#
# 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 l... |
vishnu-kumar/PeformanceFramework | rally_os/plugins/openstack/context/heat/stacks.py | # Copyright 2015: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
johnbelamaric/themis | vendor/github.com/grpc-ecosystem/grpc-opentracing/python/tests/_tracer.py | from collections import defaultdict
import enum
import opentracing
@enum.unique
class SpanRelationship(enum.Enum):
NONE = 0
FOLLOWS_FROM = 1
CHILD_OF = 2
class _SpanContext(opentracing.SpanContext):
def __init__(self, identity):
self.identity = identity
class _Span(opentracing.Span):
... |
mtagle/airflow | tests/providers/google/marketing_platform/hooks/test_search_ads.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
ultimateprogramer/formhub | odk_viewer/models/parsed_instance.py | import base64
import datetime
import re
import json
from dateutil import parser
from bson import json_util
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save, pre_delete
from restservice.utils import call_service
from stats.tasks import stat_log
from utils.deco... |
Yawning/obfsproxy | obfsproxy/transports/scramblesuit/util.py | """
This module implements several commonly used utility functions.
The implemented functions can be used to swap variables, write and read data
from files and to convert a number to raw text.
"""
import obfsproxy.common.log as logging
import os
import time
import const
import mycrypto
log = logging.get_obfslogger... |
Lh4cKg/brython | www/tests/test_string_format.py | #########################
## NEW STYLE FORMAT ##
## ie, string.format() ##
#########################
#accessing arguments by position
assert '{0}, {1}, {2}'.format('a', 'b', 'c') == 'a, b, c'
assert '{}, {}, {}'.format('a', 'b', 'c') == 'a, b, c'
assert '{2}, {1}, {0}'.format('a', 'b', 'c') == 'c, b, a'
assert '{2}... |
catapult-project/catapult | third_party/gsutil/third_party/pyu2f/pyu2f/convenience/localauthenticator.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
chirilo/remo | vendor-local/lib/python/django_browserid/compat.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/.
"""Imports that vary depending on available libraries or python versions."""
# If funfactory is available, we want to u... |
0-wiz-0/psutil | scripts/pstree.py | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Similar to 'ps aux --forest' on Linux, prints the process list
as a tree structure.
$ python scripts/pstree.py
0 ?
|- 1 init
| ... |
santisiri/popego | popego/popserver/fixture/command/generate/__init__.py |
class code_str(str):
"""string that reproduces without quotes.
"""
def __repr__(self):
return str.__repr__(self)[1:-1]
import generate
from generate import *
__doc__ = generate.__doc__
# load modules so they can register themselves (better way?)
try:
import generate_sqlobject
except Impo... |
0xwindows/InfoLeak | test/test_protocol_http.py | import socket
from io import BytesIO
from netlib.exceptions import HttpSyntaxException
from netlib.http import http1
from netlib.tcp import TCPClient
from netlib.tutils import treq, raises
import tutils
import tservers
class TestHTTPResponse:
def test_read_from_stringio(self):
s = (
b"HTTP/1.... |
SUSE/azure-sdk-for-python | azure-mgmt-scheduler/azure/mgmt/scheduler/models/http_authentication.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
caglar10ur/func | func/minion/modules/overlord.py | # Copyright 2008, Red Hat, Inc
# Steve Salevan <ssalevan@redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., ... |
yochow/autotest | client/tests/pktgen/pktgen.py | import os, logging
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
class pktgen(test.test):
version = 1
def execute(self, eth='eth0', count=50000, clone_skb=1, \
dst_ip='192.168.210.210', dst_mac='01:02:03:04:05:07'):
if not os.path... |
golismero/golismero | plugins/testing/recon/punkspider.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it under the terms of... |
fhedberg/ardupilot | Tools/autotest/ardusub.py | #!/usr/bin/env python
'''
Dive ArduSub in SITL
AP_FLAKE8_CLEAN
'''
from __future__ import print_function
import os
import sys
import time
from pymavlink import mavutil
from common import AutoTest
from common import NotAchievedException
from common import AutoTestTimeoutException
if sys.version_info[0] < 3:
Co... |
Hernanarce/pelisalacarta | python/main-classic/channels/mcanime.py | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para mcanime
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import urlparse
from core import config
from core imp... |
louyihua/edx-platform | common/lib/xmodule/xmodule/word_cloud_module.py | """Word cloud is ungraded xblock used by students to
generate and view word cloud.
On the client side we show:
If student does not yet answered - `num_inputs` numbers of text inputs.
If student have answered - words he entered and cloud.
"""
import json
import logging
from pkg_resources import resource_string
from x... |
fawcettc/planning-features | torchlight/GENERATE-VARS/translate/tests/test_normalization.py | try:
# Python 2
from StringIO import StringIO
except ImportError:
# Python 3
from io import StringIO
import pddl
from pddl_to_prolog import Rule, PrologProgram
def test_normalization():
prog = PrologProgram()
prog.add_fact(pddl.Atom("at", ["foo", "bar"]))
prog.add_fact(pddl.Atom("truck", [... |
garlick/flux-core | t/ingest/bad-validate.py | ##############################################################
# Copyright 2021 Lawrence Livermore National Security, LLC
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
#
# This file is part of the Flux resource manager framework.
# For details, see https://github.com/flux-framework.
#
# SPDX-License-Identifier: LGPL-3.0
#####... |
jordanemedlock/psychtruths | temboo/core/Library/Amazon/CloudDrive/Files/DownloadFile.py | # -*- coding: utf-8 -*-
###############################################################################
#
# DownloadFile
# Retrieves the content for a specific file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
arenadata/ambari | ambari-agent/src/test/python/resource_management/TestFcntlBasedProcessLock.py | '''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
wileeam/airflow | tests/cli/commands/test_version_command.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
kobejean/tensorflow | tensorflow/python/ops/control_flow_ops_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
OlivierLarrieu/HYDV2_EFL | Xlib/xobject/resource.py | # Xlib.xobject.resource -- any X resource object
#
# Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# 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 t... |
wdurhamh/statsmodels | statsmodels/tsa/statespace/tests/results/results_structural.py | """
Results for SARIMAX tests
Results from R, KFAS library using script `test_ucm.R`.
See also Stata time series documentation.
Author: Chad Fulton
License: Simplified-BSD
"""
from numpy import pi
irregular = {
'models': [
{'irregular': True},
{'level': 'irregular'},
{'level': 'ntrend'},
... |
saifrahmed/DjangoBB | djangobb_forum/south_migrations/0006_auto__add_field_forum_forum_logo.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Forum.forum_logo'
db.add_column('djangobb_forum_forum', 'forum_logo',
... |
shiquanwang/pylearn2 | pylearn2/scripts/find_gpu_fields.py | #!/usr/bin/env python
"""
.. todo::
WRITEME
"""
#argument: path to a pkl file
#loads the pkl file and figures out which fields are CudaNDArrays
import sys
if __name__ == "__main__":
path = sys.argv[1]
from pylearn2.utils import serial
import inspect
obj = serial.load(path)
from theano.sand... |
vyscond/cocos | utest/test_director_scene_changes.py | from __future__ import division, print_function, unicode_literals
# important: set cocos_utest=1 in the environment before run.
# that simplifies the pyglet mockup needed
# remember to erase or set to zero for normal runs
import os
assert os.environ['cocos_utest']
# set the desired pyglet mockup
import sys
sys.path.i... |
pankajp/pyface | pyface/dock/__init__.py | #-------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions ... |
fossilet/6.00x | week7/problemset7/ps7_visualize.py | # Problem Set 6:
# Visualization code for simulated robots.
#
# See the problem set for instructions on how to use this code.
import math
import time
from Tkinter import *
class RobotVisualization:
def __init__(self, num_robots, width, height, delay = 0.2):
"Initializes a visualization with the specified... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.