repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
coderfi/ansible-modules-extras | net_infrastructure/bigip_monitor_tcp.py | 33 | 16829 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, serge van Ginderachter <serge@vanginderachter.be>
#
# 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 vers... | gpl-3.0 |
s0undt3ch/sorbic | sorbic/db.py | 2 | 7598 | '''
Interface to interact on a database level
'''
# Import python libs
import os
import io
import shutil
# Import sorbic libs
import sorbic.ind.hdht
import sorbic.stor.files
import sorbic.utils.traverse
# Import third party libs
import msgpack
DB_OPTS = (
'key_delim',
'hash_limit',
'key_hash',
... | apache-2.0 |
Mj258/weiboapi | srapyDemo/envs/Lib/site-packages/twisted/test/test_rebuild.py | 10 | 7749 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
import types
from twisted.trial import unittest
from twisted.python import rebuild
import crash_test_dummy
f = crash_test_dummy.foo
class Foo: pass
class Bar(Foo): pass
class Baz(object): pass
class Buz(Bar, Baz): pass
class Ha... | mit |
roubert/python-phonenumbers | python/phonenumbers/data/region_BE.py | 10 | 2457 | """Auto-generated file, do not edit by hand. BE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BE = PhoneMetadata(id='BE', country_code=32, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{7,8}', possible_number_pattern='... | apache-2.0 |
BryanQuigley/sos | sos/report/plugins/buildah.py | 5 | 1873 | # Copyright (C) 2018 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... | gpl-2.0 |
lebabouin/CouchPotatoServer-develop | libs/tmdb3/cache_file.py | 10 | 13285 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_file.py
# Python Library
# Author: Raymond Wagner
# Purpose: Persistant file-backed cache using /tmp/ to share data
# using flock or msvcrt.locking to allow safe concurrent
# access.
#-----------------------
import s... | gpl-3.0 |
GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awxkit/awxkit/api/pages/organizations.py | 1 | 1807 | from awxkit.api.mixins import HasCreate, HasInstanceGroups, HasNotifications, DSAdapter
from awxkit.utils import random_title, suppress, PseudoNamespace
from awxkit.api.resources import resources
import awxkit.exceptions as exc
from . import base
from . import page
class Organization(HasCreate, HasInstanceGroups, Has... | apache-2.0 |
canaltinova/servo | etc/ci/performance/set_s3_policy.py | 22 | 1108 | #!/usr/bin/env python3
# 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/.
import argparse
import boto3
def main():
parser = argparse.ArgumentParser(
descrip... | mpl-2.0 |
xasopheno/audio_visual | audio/venv/lib/python2.7/site-packages/wheel/archive.py | 62 | 2376 | """
Archive tools for wheel.
"""
import os
import os.path
import time
import zipfile
from distutils import log
def archive_wheelfile(base_name, base_dir):
"""Archive all files under `base_dir` in a whl file and name it like
`base_name`.
"""
olddir = os.path.abspath(os.curdir)
base_name = os.path.... | mit |
vmturbo/nova | nova/tests/unit/virt/libvirt/storage/test_lvm.py | 8 | 8203 | # Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! 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/li... | apache-2.0 |
ain7/www.ain7.org | ain7/annuaire/migrations/0002_auto_20160331_0126.py | 1 | 8973 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-30 23:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('annuair... | lgpl-2.1 |
PSUdaemon/trafficserver | tests/tools/traffic-replay/h2Replay.py | 2 | 13166 | #!/bin/env python3
'''
'''
# 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 ... | apache-2.0 |
pvagner/orca | src/orca/scripts/apps/gnome-mud/script.py | 3 | 6038 | # Orca
#
# Copyright 2005-2008 Sun Microsystems 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.1 of the License, or (at your option) any later version.
#
# This... | lgpl-2.1 |
jfterpstra/bluebottle | bluebottle/utils/staticfiles_finders.py | 2 | 1192 | from django.utils._os import safe_join
import os
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder
from bluebottle.clients.models import Client
class TenantStaticFilesFinder(FileSystemFinder):
def find(self, path, all=False):
"""
Looks for files in th... | bsd-3-clause |
themarkypantz/kafka | tests/kafkatest/services/security/security_config.py | 8 | 14918 | # 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 ... | apache-2.0 |
andyliuliming/WALinuxAgent | azurelinuxagent/common/protocol/imds.py | 2 | 10005 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
import json
import re
import azurelinuxagent.common.utils.restutil as restutil
from azurelinuxagent.common.exception import HttpError
from azurelinuxagent.common.future import ustr
import azure... | apache-2.0 |
noamelf/Open-Knesset | persons/migrations/0005_auto__add_field_person_img_url__add_field_person_phone__add_field_pers.py | 14 | 19706 | # -*- 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 'Person.img_url'
db.add_column('persons_person', 'img_url',
self.gf('dj... | bsd-3-clause |
JPFrancoia/scikit-learn | sklearn/preprocessing/data.py | 13 | 70436 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# Giorgio Patrini <giorgio.patrini@anu.edu.au>
# Lic... | bsd-3-clause |
bcui6611/healthchecker | Cheetah/Utils/Indenter.py | 17 | 4145 | """
Indentation maker.
@@TR: this code is unsupported and largely undocumented ...
This version is based directly on code by Robert Kuzelj
<robert_kuzelj@yahoo.com> and uses his directive syntax. Some classes and
attributes have been renamed. Indentation is output via
$self._CHEETAH__indenter.indent() to prevent '_i... | apache-2.0 |
xkmato/rapidpro-tools | fix-contact-names.py | 2 | 1954 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import os
from docopt import docopt
from rapidpro_tools import logger, change_logging_level
from rapidpro_tools.contacts import (e... | cc0-1.0 |
Russell-IO/ansible | lib/ansible/modules/remote_management/oneview/oneview_san_manager.py | 146 | 7717 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
amitgroup/parts-net | scripts/scripy1.py | 1 | 5953 | from __future__ import division, print_function, absolute_import
#from pnet.vzlog import default as vz
import numpy as np
import amitgroup as ag
import itertools as itr
import sys
import os
import pnet
import time
def test(ims, labels, net):
yhat = net.classify(ims)
return yhat == labels
if pnet.parallel.... | bsd-3-clause |
scripni/rethinkdb | external/v8_3.30.33.16/build/gyp/pylib/gyp/MSVSVersion.py | 486 | 15539 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | agpl-3.0 |
l1ll1/cvl-fabric-launcher | pyinstaller-2.1/PyInstaller/lib/unittest2/case.py | 11 | 43241 | """Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
if sys.version_info[:2] == (2,3):
from sets import Set as set
from sets import ImmutableSet as frozenset
from unittest2 import result
from unittest2.util import\
safe_repr, safe_str, strclass,... | gpl-3.0 |
mgenereu/linux | tools/perf/scripts/python/sctop.py | 1996 | 2102 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
achang97/YouTunes | lib/python2.7/site-packages/werkzeug/contrib/fixers.py | 104 | 10179 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | mit |
OptiPop/external_chromium_org | tools/telemetry/telemetry/core/browser_credentials_unittest.py | 47 | 2272 | # Copyright 2012 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 os
import tempfile
import unittest
from telemetry.core import browser_credentials
SIMPLE_CREDENTIALS_STRING = """
{
"google": {
"username": "e... | bsd-3-clause |
sbidoul/buildbot | worker/buildbot_worker/compat.py | 9 | 2329 | # coding=utf-8
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRAN... | gpl-2.0 |
incaser/odoo-odoo | addons/procurement_jit/procurement_jit.py | 244 | 1543 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
ProjectSWGCore/NGECore2 | scripts/mobiles/generic/faction/imperial/hardened_swamp_trooper_25.py | 2 | 1496 | 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... | lgpl-3.0 |
ActiveState/code | recipes/Python/576531_Circle/recipe-576531.py | 1 | 15215 | #On the name of ALLAH and may the blessing and peace of Allah
#be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam.
#Author :Fouad Teniou
#Date : 08/10/08
#Version : 2.4
""" Class of an equation of a circle of the form Ax^2 + Ay^2 + Dx + Ey + F = 0 (A !=0)
it represents a circle or a point or has no g... | mit |
jdramani/servo | python/mach/mach/registrar.py | 46 | 3774 | # 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, unicode_literals
from .base import MachError
INVALID_COMMAND_CONTEXT = r'''
It... | mpl-2.0 |
jm-begon/scikit-learn | examples/cluster/plot_kmeans_silhouette_analysis.py | 242 | 5885 | """
===============================================================================
Selecting the number of clusters with silhouette analysis on KMeans clustering
===============================================================================
Silhouette analysis can be used to study the separation distance between the... | bsd-3-clause |
ruchikd/Algorithms | Python/CreateLLFromBST/CreateLLFromBST.py | 1 | 1529 | #**************************************************************
# 9
# / \
# 5 11
# / \ / \
# 2 7 10 15
# / / \
# 1 4 6
# /
# ... | gpl-3.0 |
sccblom/vercors | deps/dafny/1.9.6/windows/z3/bin/z3util.py | 4 | 11933 | ############################################
# Copyright (c) 2012 Microsoft Corporation
#
# Z3 Python interface
#
# Authors: Leonardo de Moura (leonardo)
# ThanhVu (Vu) Nguyen <tnguyen@cs.unm.edu>
############################################
"""
Usage:
import common_z3 as CM_Z3
"""
from z3 imp... | mpl-2.0 |
jvkops/django | django/db/models/signals.py | 399 | 2734 | from django.apps import apps
from django.dispatch import Signal
from django.utils import six
class_prepared = Signal(providing_args=["class"])
class ModelSignal(Signal):
"""
Signal subclass that allows the sender to be lazily specified as a string
of the `app_label.ModelName` form.
"""
def __in... | bsd-3-clause |
kevin8909/xjerp | openerp/addons/account_anglo_saxon/invoice.py | 12 | 12123 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C)
# 2004-2010 Tiny SPRL (<http://tiny.be>).
# 2009-2010 Veritos (http://veritos.nl).
# All Rights Reserved
#
# This program is free software: you can redistri... | agpl-3.0 |
HiSPARC/station-software | user/python/Lib/lib-tk/test/test_tkinter/test_images.py | 40 | 13352 | import unittest
import Tkinter as tkinter
import ttk
import test.test_support as support
from test_ttk.support import AbstractTkTest, requires_tcl
support.requires('gui')
class MiscTest(AbstractTkTest, unittest.TestCase):
def test_image_types(self):
image_types = self.root.image_types()
self.ass... | gpl-3.0 |
atul-bhouraskar/django | django/contrib/admin/__init__.py | 562 | 1243 | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.decorators import register
from django.contrib.admin.filters import (
AllValuesFieldListFilter, BooleanFieldListFilter, ChoicesFieldListFilter,
DateFieldListFilter, Fiel... | bsd-3-clause |
TheR3ason/map-your-location-history | LatitudePlot.py | 1 | 4022 | #!/usr/bin/env python
# LatitudePlot.py
# Created 30 July 2013
# Created by snowdonjames@googlemail.com
import os, time, math
from datetime import datetime
from time import mktime
import xml.etree.ElementTree as ET
from PIL import Image, ImageDraw
def GetKmlFiles():
"""Locates and reads local .kml files, returns... | apache-2.0 |
erseco/ugr_desarrollo_aplicaciones_internet | Practica_01/Soluciones Practica 1/ej_01_01.py | 2 | 1972 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Practicas de Desarrollo de Aplicaciones para Internet (DAI)
# Copyright (C) 2013 - Zerjillo (zerjioi@ugr.es)
#
# 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 Softwar... | gpl-3.0 |
felipetomm/POX-Django | pox/web/jsonrpc.py | 45 | 8357 | # Copyright 2011,2012 James McCauley
#
# 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 ... | apache-2.0 |
tedder/ansible | lib/ansible/modules/network/cloudengine/ce_netconf.py | 15 | 5948 | #!/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 distribut... | gpl-3.0 |
jasonbot/django | tests/template_tests/filter_tests/test_dictsort.py | 342 | 1477 | from django.template.defaultfilters import dictsort
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_sort(self):
sorted_dicts = dictsort(
[{'age': 23, 'name': 'Barbara-Ann'},
{'age': 63, 'name': 'Ra Ra Rasputin'},
{'name': 'Jonny B... | bsd-3-clause |
rahulsharma1991/scrapy | tests/test_utils_deprecate.py | 140 | 10526 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import inspect
import unittest
import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
from scrapy.utils.deprecate import create_deprecated_class, update_classpath
from tests import mock
class MyWarning(UserWarning):
pass
class SomeB... | bsd-3-clause |
Outernet-Project/librarian | tests/utils/test_route_mixins.py | 1 | 4074 | import mock
from bottle_utils import csrf
import librarian.utils.route_mixins as mod
# Common test helper
class MockedRouteBase(object):
def __init__(self, *args, **kwargs):
# this way all tests will get a separate instance of the mock
# object when they instantiate their routes, because othe... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.1/Lib/encodings/iso8859_5.py | 4 | 5385 | """ Python Character Mapping Codec generated from '8859-5.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... | mit |
krishnazure/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py | 330 | 3364 | # urllib3/exceptions.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
... | apache-2.0 |
nodejs/node-gyp | gyp/pylib/gyp/flock_tool.py | 3 | 1859 | #!/usr/bin/env python3
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
arrabito/DIRAC | Core/DISET/private/GatewayService.py | 4 | 20150 | """ The gateway service is used for forwarding service calls to the appropriate services.
For this to be used, the following CS option is required:
DIRAC
{
Gateways
{
my.site.org = dips://thisIsAn.url.org:9159/Framework/Gateway
}
}
At the same time, this same gateway ser... | gpl-3.0 |
sauloal/cufflinksviewer | venvwin/Lib/encodings/cp856.py | 93 | 12986 | """ Python Character Mapping Codec cp856 generated from 'MAPPINGS/VENDORS/MISC/CP856.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,i... | mit |
oopy/micropython | tests/float/math_fun.py | 24 | 2538 | # Tests the functions imported from math
try:
from math import *
except ImportError:
print("SKIP")
raise SystemExit
test_values = [-100., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 100.]
test_values_small = [-10., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 10.] # so we don't overflow 32-bit precision
unit_range_t... | mit |
zrax/moul-scripts | Python/clftYeeshaPage08.py | 6 | 9539 | # -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, 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... | gpl-3.0 |
leon-github/cloudlight | mars/common/log.py | 1 | 17223 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 CloudLight, Inc
# All Rights Reserved.
"""Logging handler.
"""
import ConfigParser
import cStringIO
import inspect
import itertools
import logging
import logging.config
import logging.handlers
import os
import sys
import traceback
import json
from oslo.co... | apache-2.0 |
liorvh/golismero | tools/theHarvester/lib/graphs.py | 9 | 28558 | """
+-------------------------------------------------------------------+
| H T M L - G R A P H S (v4.8) |
| |
| Copyright Gerd Tentler www.gerd-tentler.de/tools |
| Created: Sep. 17, 2002 ... | gpl-2.0 |
adamchainz/ansible | test/units/plugins/strategy/test_strategy_base.py | 69 | 21292 | # (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... | gpl-3.0 |
carpyncho/feets | doc/source/JSAnimation/examples.py | 4 | 3126 | import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from JSAnimation import IPython_display
def basic_animation(frames=100, interval=30):
"""Plot a basic sine wave with oscillating amplitude"""
fig = plt.figure()
ax = plt.axes(xlim=(0, 10), ylim=(-2, 2))
line, = ax.... | mit |
welliam/data-structures | src/test_traversal.py | 1 | 5030 | '''Test traversal of adjacency_list.py.'''
import pytest
from .graph import Graph
@pytest.fixture
def self_looped():
g = Graph()
g.add_edge('a', 'a', 0)
return g
# The following fixtures for graphs have two associated variables:
# <NAME>_DEPTH and <NAME>_BREADTH
# which are lists of tuples of two value... | mit |
seanaedmiston/gensim | gensim/corpora/lowcorpus.py | 73 | 7185 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Corpus in GibbsLda++ format of List-Of-Words.
"""
from __future__ import with_statement
import logging
from gensim import utils
... | gpl-3.0 |
BeATz-UnKNoWN/python-for-android | python3-alpha/python3-src/Lib/abc.py | 52 | 7650 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
from _weakrefset import WeakSet
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or der... | apache-2.0 |
shaufi10/odoo | addons/l10n_fr/__init__.py | 424 | 1447 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
phillxnet/rockstor-core | src/rockstor/storageadmin/models/user.py | 2 | 3142 | """
Copyright (c) 2012-2021 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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... | gpl-3.0 |
juniorh/dummyDbGen | postgresql/genDocDb.postgres.testData.py | 1 | 3203 | #!/usr/bin/env python
# How to use
# >python genDocDb.postgres.py -h localhost -P 5432 -u username -p password -d database -t table -n 1000 -r 1
# library:
# pip install psycopg2
import argparse
import psycopg2
import random
import math
import time
import sys
def get_args_parser():
parser = argparse.ArgumentPar... | gpl-2.0 |
asimshankar/tensorflow | tensorflow/contrib/graph_editor/tests/edit_test.py | 132 | 3104 | # 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... | apache-2.0 |
yatish27/mase | src/stockflow.py | 9 | 2560 | from __future__ import print_function, division
import sys
sys.dont_write_bytecode = True
from ok import *
import random
r = random.random
isa = isinstance
"""
# Compartmental Modeling
## Diapers
q +-----+ r +-----+
---->| C |---->| D |--> s
^ +-----+ +-+---+
| |
+-------------... | unlicense |
tonybaloney/st2 | contrib/linux/sensors/file_watch_sensor.py | 1 | 1965 | import os
from logshipper.tail import Tail
from st2reactor.sensor.base import Sensor
class FileWatchSensor(Sensor):
def __init__(self, sensor_service, config=None):
super(FileWatchSensor, self).__init__(sensor_service=sensor_service,
config=config)
s... | apache-2.0 |
skumar07/Air-Share-Real | boilerplate/external/babel/messages/tests/data/setup.py | 19 | 1044 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4 ts=4 fenc=utf-8
# =============================================================================
# $Id: setup.py 114 2007-06-14 21:17:14Z palgarvio $
# =============================================================================
# $URL: http://svn.edgewall... | lgpl-3.0 |
mlc0202/ssdb | deps/cpy/antlr3/tokens.py | 99 | 12016 | """ANTLR3 runtime package"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# 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 ... | bsd-3-clause |
paradoxxxzero/pyjade | pyjade/parser.py | 1 | 10534 | from __future__ import absolute_import
from .lexer import Lexer
from . import nodes
import six
class Parser(object):
def __init__(self,str,filename=None,**options):
self.input = str
self.lexer = Lexer(str,**options)
self.filename = filename
self.bloks = {}
self.options = opt... | mit |
highlando/krypy | krypy/recycling/linsys.py | 1 | 5723 | # -*- coding: utf8 -*-
import numpy
from .. import utils, deflation, linsys
from . import factories, evaluators
class _RecyclingSolver(object):
'''Base class for recycling solvers.'''
def __init__(self, DeflatedSolver,
vector_factory=None
):
'''Initialize recycling so... | mit |
apagac/cfme_tests | cfme/common/vm.py | 1 | 41764 | # -*- coding: utf-8 -*-
"""Module containing classes with common behaviour for both VMs and Instances of all types."""
import json
from datetime import date
from datetime import datetime
from datetime import timedelta
import attr
from cached_property import cached_property
from riggerlib import recursive_update
from ... | gpl-2.0 |
petewarden/tensorflow | tensorflow/python/autograph/pyct/ast_util_test.py | 8 | 8400 | # Copyright 2017 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... | apache-2.0 |
balazssimon/ml-playground | udemy/lazyprogrammer/reinforcement-learning-python/grid_world.py | 1 | 2827 | class Grid: # Environment
def __init__(self, width, height, start):
self.width = width
self.height = height
self.i = start[0]
self.j = start[1]
def set(self, rewards, actions):
# rewards should be a dict of: (i, j): r (row, col): reward
# actions should be a dict of: (i, j): A (row, col): l... | apache-2.0 |
nordri/check_domains | lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py | 31 | 7885 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django.conf import settings
from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper,
BaseDatabaseValidation)
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperation... | gpl-3.0 |
knifenomad/django | tests/delete/tests.py | 222 | 18346 | from __future__ import unicode_literals
from math import ceil
from django.db import IntegrityError, connection, models
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.utils.six.moves import range
from .models import... | bsd-3-clause |
IngenicSemiconductor/KERNEL-WARRIOR | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
joshmoore/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/webclient_gateway.py | 1 | 76419 | #!/usr/bin/env python
#
# webclient_gateway
#
# Copyright (c) 2008-2011 University of Dundee.
#
# 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 (a... | gpl-2.0 |
ayushagrawal288/zamboni | mkt/commonplace/urls.py | 7 | 3562 | from django.conf import settings
from django.conf.urls import include, patterns, url
import mkt
from . import views
def fireplace_route(path, name=None):
"""
Helper function for building Fireplace URLs. `path` is the URL route,
and `name` (if specified) is the name given to the route.
"""
kwargs ... | bsd-3-clause |
graingert/isort | kate_plugin/isort_plugin.py | 12 | 3174 | """ Sorts Python import definitions, and groups them based on type (stdlib, third-party, local).
isort/isort_kate_plugin.py
Provides a simple kate plugin that enables the use of isort to sort Python imports
in the currently open kate file.
Copyright (C) 2013 Timothy Edmund Crosley
Permission is hereby granted, fre... | mit |
baldengineers/mapper | main.py | 1 | 70755 | #easy cs:go mapper: counter-strike: global offensive port of the easy tf2 mapper
#
#in development, not at a working stage.
#DIFFERENCES:
#more prefabrications
#more sections (subsections?)
#improved UI
#improved file count
#multi-game system
# program boots up and variables are set which change what game the progra... | gpl-3.0 |
javachengwc/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/table.py | 96 | 9406 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | apache-2.0 |
sgerhart/ansible | lib/ansible/modules/network/meraki/meraki_device.py | 43 | 15823 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
... | mit |
TheWardoctor/Wardoctors-repo | script.module.liveresolver/lib/liveresolver/__init__.py | 10 | 43372 | # -*- coding: utf-8 -*-
import re
from modules import client,webutils,cloudflare,decryptionUtils,cache,liveresolver_utils,convert
from modules.constants import resolver_dict
from modules.log_utils import log
from modules.liveresolver_utils import *
import urlparse,urllib,base64
from BeautifulSoup import BeautifulSoup a... | apache-2.0 |
jordanaluft/gnome-music | gnomemusic/widgets.py | 1 | 34979 | # Copyright (c) 2013 Vadim Rutkovsky <vrutkovs@redhat.com>
# Copyright (c) 2013 Shivani Poddar <shivani.poddar92@gmail.com>
# Copyright (c) 2013 Arnel A. Borja <kyoushuu@yahoo.com>
# Copyright (c) 2013 Seif Lotfy <seif@lotfy.com>
# Copyright (c) 2013 Sai Suman Prayaga <suman.sai14@gmail.com>
# Copyright (c) 2013 Jackso... | gpl-2.0 |
Richard-Mathie/cassandra_benchmark | vendor/github.com/datastax/python-driver/tests/integration/cqlengine/columns/test_value_io.py | 6 | 7015 | # Copyright 2013-2016 DataStax, 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 or agreed to in writi... | apache-2.0 |
jerbob92/CouchPotatoServer | libs/guessit/transfo/guess_properties.py | 150 | 1273 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
spaceone/pyjs | examples/infohierarchy/public/services/jsonrpc/http.py | 24 | 1236 | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later ... | apache-2.0 |
msultan/mdtraj | mdtraj/utils/test.py | 9 | 6569 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | lgpl-2.1 |
jmathai/elodie | elodie/tests/media/media_test.py | 1 | 5268 | # Project imports
import os
import sys
import hashlib
import random
import re
import shutil
import string
import tempfile
import time
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))))
sys.path.insert(0, os.path.abspath(os.path.dirname(o... | apache-2.0 |
valkjsaaa/sl4a | python/src/Lib/encodings/mac_centeuro.py | 593 | 14358 | """ Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | apache-2.0 |
adamrp/qiime | qiime/nmds.py | 15 | 1417 | #!/usr/bin/env python
from __future__ import division
import numpy
import os.path
import cogent.cluster.nmds as nmds_module
from qiime.format import format_nmds_coords
from qiime.parse import parse_distmat
__author__ = "Justin Kuzynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczyns... | gpl-2.0 |
andrebellafronte/stoq | stoqlib/gui/test/test_qualitytesteditor.py | 3 | 1183 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2012 Async Open Source <http://www.async.com.br>
## 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 published by
## the Free Software Foundati... | gpl-2.0 |
leodavesne/leodavesne.net | leodavesne/settings.py | 1 | 3452 | """
Django settings for leodavesne project.
Generated by 'django-admin startproject' using Django 3.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os... | mit |
MobinRanjbar/hue | desktop/core/ext-py/ndg_httpsclient-0.4.0/ndg/httpsclient/subj_alt_name.py | 79 | 6131 | """NDG HTTPS Client package
Use pyasn1 to provide support for parsing ASN.1 formatted subjectAltName
content for SSL peer verification. Code based on:
http://stackoverflow.com/questions/5519958/how-do-i-parse-subjectaltname-extension-data-using-pyasn1
"""
__author__ = "P J Kershaw"
__date__ = "01/02/12"
__copyright_... | apache-2.0 |
stefan-jonasson/home-assistant | homeassistant/components/device_tracker/keenetic_ndms2.py | 6 | 3728 | """
Support for Zyxel Keenetic NDMS2 based routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.keenetic_ndms2/
"""
import logging
from collections import namedtuple
import requests
import voluptuous as vol
import homeassistant.helper... | mit |
ICromwell/OCaSimTest | 10 - Dentist Screening Appointment.py | 1 | 1935 | # -*- coding: utf-8 -*-
"""
A screening process wherein a person returns for regular checkups at a dentist
"""
# Time interval between appointments
appInt = 6*30
# Create a counter for the number of dental appointments, if one doesn't already exist
if getattr(entity, "count_DentAppt", 0) == 0:
entit... | gpl-3.0 |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/hmac.py | 66 | 4664 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)])
trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)])
# The size of the digests returne... | bsd-2-clause |
fxsjy/pybrain | examples/rl/environments/cartpole/cart_all.py | 30 | 2089 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with several optimization algorithms
# on the CartPoleEnvironment
#
# Requirements: pylab (for plotting only). If not available, comment the
# last 3 lines out
######################################... | bsd-3-clause |
videetssinghai/Blog-Rest-Api | lib/python2.7/site-packages/pip/_vendor/distlib/util.py | 327 | 52991 | #
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
try:
... | mit |
drbild/boto | tests/unit/cloudsearch/test_search.py | 114 | 13726 | #!/usr/bin env python
from tests.compat import mock, unittest
from httpretty import HTTPretty
import json
import requests
from boto.cloudsearch.search import SearchConnection, SearchServiceException
from boto.compat import six, map
HOSTNAME = "search-demo-userdomain.us-east-1.cloudsearch.amazonaws.com"
FULL_URL = '... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.