repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
andreaso/ansible | refs/heads/devel | lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py | 37 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... |
neurodata/ndstore | refs/heads/master | django/ndauth/models.py | 792 | from __future__ import unicode_literals
from django.db import models
# Create your models here.
|
foursquare/pants | refs/heads/master | src/python/pants/backend/project_info/tasks/dependencies.py | 2 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import str
from twitter.common.collections import OrderedSet
from pants.b... |
TheTacoScott/GoAtThrottleUp | refs/heads/master | ServerRelay/cherrypy/lib/auth.py | 40 | import cherrypy
from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
"""If an authorization header contains credentials, return True, else False."""
request = cherrypy.serving.request
if 'authorization' in request.headers:
# make sure the provided credentials are corr... |
gautamkrishnar/hatter | refs/heads/master | scripts/acronym.py | 2 | #!/usr/bin/python
"""
Acronym Decoder v1.0
usage: acronym.py [-max N] [-f] A.C.R.O.N.Y.M.
Prints the known expansions of the specified acronym. If the optional -max
parameter is specified, at most N matches will be output. If -f is passed,
the output is printed in "friendly" mode; otherwise, the matches will be out... |
jimi-c/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_banner.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... |
sirpercival/kivy | refs/heads/master | examples/canvas/lines_extended.py | 17 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.widget import Widget
from kivy.lang import Builder
Builder.load_string('''
<LineEllipse1>:
canvas:
Color:
rgba: 1, .1, .1, .9
Line:
width: 2.
ellipse: (self.x, self.y, self.width, s... |
toniher/biodb-benchmark | refs/heads/master | batch-add/batch-redis-add.py | 1 | import sys
import os
import redis
from Bio import SeqIO
def main(argv):
# Put stuff in JSON config file
r=redis.Redis()
batch = 1000
if len( argv ) > 1:
batch = int(argv[1])
itera = 0
r.flushdb()
pipeline=r.pipeline()
handle = open( argv[0], "r")
for record in SeqIO.parse(handle, "fasta")... |
crast/grpc | refs/heads/master | src/python/grpcio/grpc/framework/alpha/utilities.py | 39 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
JasonCormie/ansible-modules-extras | refs/heads/devel | cloud/profitbricks/profitbricks_datacenter.py | 31 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
apanju/odoo | refs/heads/8.0 | addons/google_calendar/google_calendar.py | 23 | # -*- coding: utf-8 -*-
import operator
import simplejson
import urllib2
import openerp
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, exception_to_unicode
from openerp.tools.translate import _
from openerp.http import ... |
foreni-packages/golismero | refs/heads/master | tools/theHarvester/discovery/DNS/win32dns.py | 46 | """
$Id: win32dns.py,v 1.3.2.1 2007/05/22 20:26:49 customdesigned Exp $
Extract a list of TCP/IP name servers from the registry 0.1
0.1 Strobl 2001-07-19
Usage:
RegistryResolve() returns a list of ip numbers (dotted quads), by
scouring the registry for addresses of name servers
Tested on Windows NT4 S... |
catesandrew/Subler | refs/heads/master | Utilities/tvdb_py/cache.py | 8 | #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvdb_api
#repository:http://github.com/dbr/tvdb_api
#license:Creative Commons GNU GPL v2
# (http://creativecommons.org/licenses/GPL/2.0/)
"""
urllib2 caching handler
Modified from http://code.activestate.com/recipes/491261/
"""
from __future__ import with_... |
apyrgio/snf-ganeti | refs/heads/stable-2.10-bpo2 | test/py/ganeti.ssh_unittest.py | 1 | #!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2008 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... |
gonboy/sl4a | refs/heads/master | python/src/Mac/Modules/ah/ahscan.py | 34 | # Scan an Apple header file, generating a Python file of generator calls.
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
LONG = "AppleHelp"
SHORT = "ah"
OBJECT = "NOTUSED"
def main():
input = LONG + ".h"
output = SHORT + "gen.py"
defsou... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v21/tests/generic_views/models.py | 112 | from django.db import models
from django.db.models import QuerySet
from django.db.models.manager import BaseManager
from django.urls import reverse
class Artist(models.Model):
name = models.CharField(max_length=100)
class Meta:
ordering = ['name']
verbose_name = 'professional artist'
... |
erikabarros/naguil | refs/heads/master | backend/apps/cliente_app/cliente_facade.py | 2 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaegraph.business_base import NodeSearch, DeleteNode
from cliente_app.cliente_commands import ListClienteCommand, SaveClienteCommand, UpdateClienteCommand, ClienteForm,\
GetClienteCommand, DeleteClienteCommand
from gaepermission.d... |
youprofit/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/model/queuelog.py | 122 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
openconnectome/ndobjectdetect | refs/heads/master | maca/packages/theano_membrane_segmentation/em_train.py | 5 | ################################################################################
# (c) [2013] The Johns Hopkins University / Applied Physics Laboratory All Rights Reserved.
# Contact the JHU/APL Office of Technology Transfer for any additional rights. www.jhuapl.edu/ott
#
# Licensed under the Apache License, Version ... |
issi5862/ishida_jbd2_linux-2.0 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py | 2 | # 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 may ... |
Francis-Liu/animated-broccoli | refs/heads/master | nova/virt/xenapi/client/objects.py | 97 | # 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
#
# Unless required by applicable law ... |
mtanski/samba | refs/heads/master | source4/dsdb/tests/python/passwords.py | 27 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This tests the password changes over LDAP for AD implementations
#
# Copyright Matthias Dieter Wallnoefer 2010
#
# Notice: This tests will also work against Windows Server if the connection is
# secured enough (SASL with a minimum of 128 Bit encryption) - consider
# MS-AD... |
azureplus/hue | refs/heads/master | desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/functional.py | 55 | # -*- coding: utf-8 -*-
"""
pygments.lexers.functional
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for functional languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, incl... |
Dhivyap/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_system_autoupdate_push_update.py | 21 | # Copyright 2019 Fortinet, 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
dataculture/mca | refs/heads/master | tests/__init__.py | 3 | # -*- coding: utf-8 -*-
from . import test_mca |
supersven/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/fr/fr_department.py | 314 | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... |
kovacsbalu/ansible-modules-extras | refs/heads/devel | cloud/centurylink/clc_group.py | 60 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... |
cantino/newspaper | refs/heads/master | newspaper/packages/jieba/__init__.py | 2 | from __future__ import with_statement
__version__ = '0.31'
__license__ = 'MIT'
import re
import os
import sys
import finalseg
import time
import tempfile
import marshal
from math import log
import random
import threading
from functools import wraps
DICTIONARY = "dict.txt"
DICT_LOCK = threading.RLock()
trie = None # t... |
leki75/ansible | refs/heads/devel | lib/ansible/modules/network/ovs/openvswitch_port.py | 42 | #!/usr/bin/python
#coding: utf-8 -*-
# pylint: disable=C0111
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
#
# Portions copyright @ 2015 VMware, Inc.
#
# This file is part of Ansible
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... |
asrob-uc3m/rpc_rpi | refs/heads/master | src/python/opencv_python_tutorials/Official_Tutorial_Python_Codes/3_imgproc/smoothing.py | 1 | ''' file name : smoothing.py
Description : This sample shows how to smooth image using various filters
This is Python version of this tutorial : http://opencv.itseez.com/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.html#smoothing
Level : Beginner
Benefits : Learn t... |
stefanhenneking/mxnet | refs/heads/master | tests/nightly/test_tutorial.py | 8 | # 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... |
fernandopinhati/oppia | refs/heads/master | core/controllers/editor_test.py | 7 | # Copyright 2014 The Oppia 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 applicable ... |
tdyas/pants | refs/heads/master | contrib/awslambda/python/src/python/pants/__init__.py | 321 | __import__("pkg_resources").declare_namespace(__name__)
|
vishwaprakashmishra/xmatrix | refs/heads/master | vumi/transports/smpp/processors/sixdee.py | 3 | # -*- test-case-name: vumi.transports.smpp.tests.test_sixdee -*-
from vumi.config import ConfigInt
from vumi.components.session import SessionManager
from vumi.message import TransportUserMessage
from vumi.transports.smpp.processors import default
from vumi import log
from twisted.internet.defer import inlineCallback... |
winklerand/pandas | refs/heads/master | doc/make.py | 8 | #!/usr/bin/env python
"""
Python script for building documentation.
To build the docs you must have all optional dependencies for pandas
installed. See the installation instructions for a list of these.
<del>Note: currently latex builds do not work because of table formats that are not
supported in the latex generat... |
chokribr/invenioold | refs/heads/master | modules/bibauthorid/lib/bibauthorid_cluster_set_unit_tests.py | 11 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio 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 ve... |
thinkopensolutions/geraldo | refs/heads/master | site/newsite/site-geraldo/django/contrib/localflavor/uk/forms.py | 32 | """
UK-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... |
MycChiu/tensorflow | refs/heads/master | tensorflow/python/platform/flags.py | 85 | # 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... |
ajdawson/iris | refs/heads/master | lib/iris/tests/test_analysis.py | 5 | # (C) British Crown Copyright 2010 - 2016, 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 l... |
e-kolpakov/study-model | refs/heads/master | tests/agents/student/behaviors/test_resource_choice.py | 1 | from unittest import mock
from unittest.mock import PropertyMock
import pytest
from model.agents.resource import Resource
from model.agents.student.behaviors.resource_choice import RandomResourceChoiceBehavior, RationalResourceChoiceBehavior
from model.knowledge_representation import Fact, Curriculum
from model.knowl... |
danithaca/mxnet | refs/heads/master | python/mxnet/profiler.py | 15 | # coding: utf-8
# pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, too-many-lines
# pylint: disable=too-many-branches, too-many-statements
"""Profiler setting methods."""
from __future__ import absolute_import
import ctypes
from .base import _LIB, check_call, c_str
def profiler_set_config(mod... |
pyblish/pyblish-win | refs/heads/master | lib/Python27/Lib/lib2to3/__main__.py | 466 | import sys
from .main import main
sys.exit(main("lib2to3.fixes"))
|
360youlun/django-cms | refs/heads/develop | cms/migrations/0018_site_permissions.py | 525 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... |
dbrgn/pygments-mirror | refs/heads/master | tests/test_basic_api.py | 7 | # -*- coding: utf-8 -*-
"""
Pygments basic API tests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import random
import unittest
from pygments import lexers, formatters, filters, format
from pygments.t... |
zaffra/Inquire | refs/heads/master | GAE/django/db/backends/creation.py | 8 | import sys
import time
from django.conf import settings
from django.core.management import call_command
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific diffe... |
fbradyirl/home-assistant | refs/heads/dev | homeassistant/components/microsoft_face_detect/__init__.py | 36 | """The microsoft_face_detect component."""
|
mandeepdhami/neutron | refs/heads/master | neutron/tests/unit/agent/l3/test_dvr_local_router.py | 3 | # Copyright (c) 2015 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 ... |
nmrugg/youtube-dl | refs/heads/master | youtube_dl/extractor/infoq.py | 92 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urlparse,
)
class InfoQIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?infoq\.com/(?:[^/]+/)+(?P<id>[^/]+)'
_TESTS = [{
'url': 'http://www.... |
davidvon/pipa-pay-server | refs/heads/master | site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py | 1729 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... |
lxshopping/p2pool | refs/heads/master | p2pool/bitcoin/getwork.py | 267 | '''
Representation of a getwork request/reply
'''
from __future__ import division
from . import data as bitcoin_data
from . import sha256
from p2pool.util import pack
def _swap4(s):
if len(s) % 4:
raise ValueError()
return ''.join(s[x:x+4][::-1] for x in xrange(0, len(s), 4))
class BlockAttempt(obje... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/django/db/models/fields/related_lookups.py | 11 | from django.db.models.lookups import (
Exact, GreaterThan, GreaterThanOrEqual, In, IsNull, LessThan,
LessThanOrEqual,
)
class MultiColSource(object):
contains_aggregate = False
def __init__(self, alias, targets, sources, field):
self.targets, self.sources, self.field, self.alias = targets, so... |
titasakgm/brc-stock | refs/heads/master | openerp/addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/db/backends/sqlite3/introspection.py | 15 | from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict:
# Maps SQL types to Django Field typ... |
b0ttl3z/SickRage | refs/heads/master | lib/hachoir_metadata/register.py | 67 | from hachoir_core.i18n import _
from hachoir_core.tools import (
humanDuration, humanBitRate,
humanFrequency, humanBitSize, humanFilesize,
humanDatetime)
from hachoir_core.language import Language
from hachoir_metadata.filter import Filter, NumberFilter, DATETIME_FILTER
from datetime import date, datetime, ... |
cartersgenes/namebench | refs/heads/master | nb_third_party/jinja2/environment.py | 199 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... |
VitalPet/addons-onestein | refs/heads/10.0 | hr_absenteeism/models/hr_absenteeism_dates.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class hr_absenteeism_dates(models.Model):
_name = "hr.absenteeism.dates"
_description = "Absenteeism Notification Dates"
name ... |
cliffe/SecGen | refs/heads/master | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/distutils/tests/test_bdist.py | 127 | """Tests for distutils.command.bdist."""
import os
import unittest
from test.test_support import run_unittest
from distutils.command.bdist import bdist
from distutils.tests import support
class BuildTestCase(support.TempdirManager,
unittest.TestCase):
def test_formats(self):
# let's... |
mozilla/stoneridge | refs/heads/master | python/src/Mac/Modules/evt/evtscan.py | 34 | # Scan an Apple header file, generating a Python file of generator calls.
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
LONG = "Events"
SHORT = "evt"
OBJECT = "NOTUSED"
def main():
input = LONG + ".h"
output = SHORT + "gen.py"
defsoutput =... |
madjelan/scikit-learn | refs/heads/master | sklearn/decomposition/factor_analysis.py | 206 | """Factor Analysis.
A latent linear variable model.
FactorAnalysis is similar to probabilistic PCA implemented by PCA.score
While PCA assumes Gaussian noise with the same variance for each
feature, the FactorAnalysis model assumes different variances for
each of them.
This implementation is based on David Barber's B... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python-build/python-libs/gdata/samples/contacts/contacts_example.py | 89 | #!/usr/bin/python
#
# Copyright (C) 2008 Google 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 law ... |
tamsky/ansible-upstream | refs/heads/devel | lib/ansible/executor/task_result.py | 42 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
tchernomax/ansible | refs/heads/devel | contrib/inventory/rudder.py | 27 | #!/usr/bin/env python
# Copyright (c) 2015, Normation SAS
#
# Inspired by the EC2 inventory plugin:
# https://github.com/ansible/ansible/blob/devel/contrib/inventory/ec2.py
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
jclc/discus-inferno | refs/heads/master | flaskenv/lib/python2.7/site-packages/werkzeug/testsuite/test.py | 66 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.test
~~~~~~~~~~~~~~~~~~~~~~~
Tests the testing tools.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
import unittest
from cStringIO import StringIO, OutputTyp... |
isislovecruft/arm | refs/heads/fix/setup.py-install-issues | arm/connections/entries.py | 1 | """
Interface for entries in the connection panel. These consist of two parts: the
entry itself (ie, Tor connection, client circuit, etc) and the lines it
consists of in the listing.
"""
from stem.util import enum
# attributes we can list entries by
ListingType = enum.Enum(("IP_ADDRESS", "IP Address"), "HOSTNAME", "... |
RevelSystems/django | refs/heads/master | tests/migrations/test_migrations_squashed_erroneous/1_auto.py | 1155 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
willingc/oh-mainline | refs/heads/master | vendor/packages/sphinx/tests/test_doctest.py | 22 | # -*- coding: utf-8 -*-
"""
test_doctest
~~~~~~~~~~~~
Test the doctest extension.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import StringIO
from util import with_app
status = StringIO.StringIO()
cleanup_called = 0
@... |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/hpx5/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Hpx5(AutotoolsPackage):
"""The HPX-5 Runtime System. HPX-5 (High Performance ParalleX) is... |
openhatch/oh-mainline | refs/heads/master | vendor/packages/sphinx/sphinx/config.py | 15 | # -*- coding: utf-8 -*-
"""
sphinx.config
~~~~~~~~~~~~~
Build configuration file handling.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import sys
from os import path
from sphinx.errors import ConfigError
from sp... |
cesargtz/YecoraOdoo | refs/heads/master | addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py | 340 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
prdatur/PyRapidPush | refs/heads/master | example.py | 1 | #!/usr/bin/python
from pyrapidpush import PyRapidPush
import sys
def main(api_key):
p = PyRapidPush(api_key)
# Retrieve group test.
groups = p.get_groups()
print (groups)
if groups.has_key('code'):
if groups['code'] == 200:
for item in groups['data']:
print('Go... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Hash/Poly1305.py | 2 | # -*- coding: utf-8 -*-
#
# Hash/Poly1305.py - Implements the Poly1305 MAC
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, pe... |
akhilaananthram/nupic | refs/heads/master | nupic/regions/AnomalyRegion.py | 25 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... |
pquentin/libcloud | refs/heads/trunk | libcloud/test/common/test_google.py | 11 | # 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 ... |
tempbottle/restcommander | refs/heads/master | play-1.2.4/python/Lib/email/header.py | 54 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... |
jazztpt/edx-platform | refs/heads/master | lms/djangoapps/django_comment_client/tests/group_id.py | 41 | import json
import re
from teams.tests.factories import CourseTeamFactory
class GroupIdAssertionMixin(object):
def _data_or_params_cs_request(self, mock_request):
"""
Returns the data or params dict that `mock_request` was called with.
"""
call = [call for call in mock_request.call... |
popazerty/enigma2-4.3 | refs/heads/master | lib/python/Plugins/Extensions/DVDBurn/TitleList.py | 9 | import DVDProject, TitleList, TitleCutter, TitleProperties, ProjectSettings, DVDToolbox, Process
from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Screens.TaskView imp... |
Lordaeron12/padawan | refs/heads/master | padawan/dashboard/models.py | 792 | from __future__ import unicode_literals
from django.db import models
# Create your models here.
|
ytjiang/django | refs/heads/master | tests/model_fields/test_durationfield.py | 36 | import datetime
import json
from django import forms
from django.core import exceptions, serializers
from django.db import models
from django.test import TestCase
from .models import DurationModel, NullDurationModel
class TestSaveLoad(TestCase):
def test_simple_roundtrip(self):
duration = datetime.time... |
keedio/hue | refs/heads/master | desktop/core/ext-py/Paste-2.0.1/paste/debug/doctest_webapp.py | 50 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
#!/usr/bin/env python2.4
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://w... |
collinjackson/mojo | refs/heads/master | third_party/cython/src/Cython/Plex/DFA.py | 102 | #=======================================================================
#
# Python Lexical Analyser
#
# Converting NFA to DFA
#
#=======================================================================
import Machines
from Machines import LOWEST_PRIORITY
from Transitions import TransitionMap
def nfa_to_dfa(old_ma... |
allotria/intellij-community | refs/heads/master | python/helpers/tests/generator3_tests/data/SkeletonGeneration/binary_declares_extra_module_that_fails/mod.py | 12 | import sys
import lib
class FakeModule(object):
def __getattribute__(self, item):
raise AttributeError
sys.modules['extra'] = FakeModule()
del FakeModule
del lib
del sys
|
SCOAP3/invenio | refs/heads/master | invenio/legacy/refextract/xml.py | 15 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio 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
# Li... |
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/perf/benchmarks/service_worker.py | 16 | # 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 collections
import page_sets
import re
from core import perf_benchmark
from telemetry import benchmark
from telemetry.core import util
from telemetr... |
tvalacarta/tvalacarta | refs/heads/master | python/main-classic/lib/youtube_dl/extractor/popcorntv.py | 20 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
int_or_none,
unified_timestamp,
)
class PopcornTVIE(InfoExtractor):
_VALID_URL = r'https?://[^/]+\.popcorntv\.it/guarda/(?P<display_id>[^/]+)/(?P<id>\d+)'
_TESTS = [{
... |
mattjmorrison/Pylint | refs/heads/master | test/input/func_operators.py | 10 | """check operator use"""
#pylint: disable=C0103
#pylint: disable=W0104
__revision__ = 42
a = 1
a += 5
a = +a
b = ++a
++a
c = (++a) * b
a = 1
a -= 5
b = --a
b = a
--a
c = (--a) * b
|
fin09pcap/freight_forwarder | refs/heads/master | freight_forwarder/const.py | 2 | # -*- coding: utf-8; -*-
from __future__ import unicode_literals
VERSION = "1.0.3-dev"
# docker api
DOCKER_DEFAULT_TIMEOUT = 120
DOCKER_API_VERSION = '1.20'
# docker labels
PROJECT_LABEL = 'com.freight-forwarder.project'
TEAM_LABEL = 'com.freight-forwarder.team'
VERSION_LABEL = 'com.freight-forwarder.ve... |
dnevels/heekscnc | refs/heads/master | nc/nclathe_read.py | 35 | ################################################################################
# nc_read.py
#
# Base class for NC code parsing
#
# Hirutso Enni, 2009-01-13
################################################################################
class Parser:
def __init__(self):
self.currentx = 0.0
... |
FujiZ/ns-3 | refs/heads/master | src/virtual-net-device/bindings/callbacks_list.py | 40 | callback_classes = [
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', ... |
laiqiqi886/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/encodings/shift_jisx0213.py | 816 | #
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... |
phillipbroberts/scotch | refs/heads/master | env/Lib/encodings/unicode_escape.py | 852 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is inte... |
jessp01/server | refs/heads/IX-9.19.2 | plugins/content/document/scripts/pdfCreatorCmd.py | 7 | import ntsecuritycon
import win32security
import pywintypes
import win32print
import win32con
import win32api
import os.path
import ctypes
import time
import sys
def getDefaultPrinter():
try:
return win32print.GetDefaultPrinter()
except RuntimeError: # The default printer was not found.
... |
trezor/micropython | refs/heads/trezor-v1.12 | tests/cmdline/repl_emacs_keys.py | 100 | # REPL tests of GNU-ish readline navigation
# history buffer navigation
1
2
3
# input line motion
t = 12
'boofarfbar'
|
blindroot/django | refs/heads/master | tests/postgres_tests/array_default_migrations/0001_initial.py | 377 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='IntegerArrayDefaultModel',
... |
jkshaver/virtualenv-1.8.2 | refs/heads/master | env/lib/python2.7/site-packages/django/utils/version.py | 85 | import django
import re
def get_svn_revision(path=None):
"""
Returns the SVN revision in the form SVN-XXXX,
where XXXX is the revision number.
Returns SVN-unknown if anything goes wrong, such as an unexpected
format of internal SVN files.
If path is provided, it should be a directory whose SV... |
rosmo/ansible | refs/heads/devel | test/sanity/pylint/plugins/deprecated.py | 13 | # (c) 2018, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from distutils.version import LooseVersion
import astroid
from pylint.in... |
roshantha9/AbstractManycoreSim | refs/heads/master | src/libMappingAndScheduling/Decentralised/PSAlgorithmViewer.py | 1 | import pprint
import sys
import itertools
import simpy
import math, random
from operator import itemgetter
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
import time
from SimParams import SimParams
from libDebug.Debug import Debug, DebugCat
####################################... |
sternshus/Arelle | refs/heads/master | arelle/ValidateInfoset.py | 1 | '''
Created on Feb 15, 2012
@author: Mark V Systems Limited
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
from collections import defaultdict
from arelle.ModelDocument import Type
from arelle.ModelValue import qname
from arelle import XmlUtil, XbrlConst
from arelle.ValidateXbrlCalcs import inferr... |
chrisxue815/leetcode_python | refs/heads/master | problems/test_0200_dfs.py | 1 | import unittest
def _set0(grid, i, j):
grid[i][j] = '0'
if i >= 1 and grid[i - 1][j] == '1':
_set0(grid, i - 1, j)
if i + 1 < len(grid) and grid[i + 1][j] == '1':
_set0(grid, i + 1, j)
if j >= 1 and grid[i][j - 1] == '1':
_set0(grid, i, j - 1)
if j + 1 < len(grid[0]) and gr... |
ruohoruotsi/Wavelet-Tree-Synth | refs/heads/master | nnet/keeper_LSTMVRAE-JayHack-RyotaKatoh-chainer/midi/utils.py | 1 | # Author: Nicolas Boulanger-Lewandowski
# University of Montreal (2013)
# RNN-RBM deep learning tutorial
#
# Implements midiread and midiwrite functions to read/write MIDI files to/from piano-rolls
from MidiOutFile import MidiOutFile
from MidiInFile import MidiInFile
from MidiOutStream import MidiOutStream
import mid... |
Stanford-Online/edx-platform | refs/heads/master | openedx/core/djangoapps/password_policy/settings/aws.py | 24 | """
Production settings for the password_policy app.
"""
def plugin_settings(settings):
"""
Override the default password_policy app settings with production settings.
"""
config = dict(settings.PASSWORD_POLICY_COMPLIANCE_ROLLOUT_CONFIG)
config.update(settings.ENV_TOKENS.get('PASSWORD_POLICY_COMPL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.