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 |
|---|---|---|---|---|---|
Proteus-tech/nikola | nikola/plugins/compile/wiki.py | 1 | 2555 | # -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... | mit |
magsilva/pae-helper | examples/tr1/3309267/corrigido-v1.py | 1 | 1686 | Alecio Elias Vitiello
Maikel Thiago Favarin Jacob
CONTINUAÇÃO DA LISTA 2 DE EXERCÍCIOS
# ERRO TOTAL 1.1: Não foi feito.
# ERRO TOTAL 1.2: Não foi feito.
1.3)
def isBeetween(x,y,z):
if (y<=x) and (x<=z):
return 1
else:
return 0
1.4)
def inversa(palavra):
for i in range(1,len(palavra)+1):
... | gpl-2.0 |
alshedivat/tensorflow | tensorflow/python/kernel_tests/pooling_ops_3d_test.py | 5 | 15370 | # 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... | apache-2.0 |
jonobrien/School_Backups | cs1-python/Labs/week 8/hashtable.py | 1 | 9784 | """
Edited by: Jon O'Brien
Due date: 10/29/13
lab8 - hash tables
This program is used by word_cout.py to take an input text file and output the
number of unique words, total number of words, the words that appeared the most,
and the word count. A hash table was used to store the values for the text file
and the table... | gpl-3.0 |
zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_math.py | 34 | 6550 | # Python test set -- math module
# XXXX Should not do tests around zero only
from test.test_support import TestFailed, verbose
seps='1e-05'
eps = eval(seps)
print 'math module, testing with eps', seps
import math
def testit(name, value, expected):
if abs(value-expected) > eps:
raise TestFailed, '%s retur... | epl-1.0 |
mzhaom/grpc | src/python/src/grpc/framework/face/_service.py | 41 | 7187 | # 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... | bsd-3-clause |
foodszhang/kbengine | kbe/src/lib/python/Lib/encodings/iso8859_7.py | 272 | 12844 | """ Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.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,input,errors='... | lgpl-3.0 |
claell/plugin.video.prime_instant | default.py | 1 | 66195 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import socket
import mechanize
import cookielib
import sys
import re
import os
import json
import time
import string
import random
import shutil
import subprocess
import xbmcplugin
import xbmcgui
import xbmcaddon
import xbmcvfs
... | gpl-2.0 |
santosjorge/cufflinks | cufflinks/quant_figure.py | 1 | 38707 |
"""
QuantFigure allows you to create a persistent object.
Annotations and Technical Studies can be added on demand.
It accepts any dataframe with a timeseries index.
Try it out:
qf=cf.QuantFig(cf.datagen.ohlc())
qf.iplot()
"""
from __future__ import absolute_import
import plotly.graph_objs as go
import json... | mit |
frdb194/django | django/template/response.py | 84 | 5682 | from django.http import HttpResponse
from django.utils import six
from .loader import get_template, select_template
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __init__(self... | bsd-3-clause |
rohanp/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 102 | 5177 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxdataobject_functions.py | 1 | 10035 | # Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | apache-2.0 |
moonboots/tensorflow | tensorflow/python/ops/nn_grad.py | 4 | 12062 | # 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 a... | apache-2.0 |
stefanfoulis/django-cms | cms/south_migrations/0028_limit_visibility_in_menu_step1of3.py | 1680 | 20032 | # -*- 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... | bsd-3-clause |
darknao/btClubSportWheel | tools/arm/arm-none-eabi/share/gdb/python/gdb/command/pretty_printers.py | 137 | 14474 | # Pretty-printer commands.
# Copyright (C) 2010-2013 Free Software Foundation, 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 la... | gpl-2.0 |
garimakhulbe/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureReport/setup.py | 10 | 1137 | # 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 ... | mit |
joshcooper/nogotofail | nogotofail/mitm/connection/handlers/data/xmpp.py | 6 | 5469 | r'''
Copyright 2014 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 agreed to i... | apache-2.0 |
BanBxda/Linux-3.0.X | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
sebrandon1/nova | plugins/xenserver/xenapi/etc/xapi.d/plugins/ipxe.py | 13 | 4225 | #!/usr/bin/env python
# Copyright (c) 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 ... | apache-2.0 |
lociii/googleads-python-lib | examples/adspygoogle/dfa/v1_20/upload_in_stream_asset.py | 3 | 2858 | #!/usr/bin/python
#
# Copyright 2013 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 b... | apache-2.0 |
rebost/django | django/contrib/sitemaps/tests/http.py | 8 | 5922 | from __future__ import unicode_literals
import os
from datetime import date
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sitemaps import Sitemap, GenericSitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from... | bsd-3-clause |
leighpauls/k2cro4 | third_party/closure_linter/closure_linter/gjslint.py | 135 | 7991 | #!/usr/bin/env python
# python2.6 for command-line runs using p4lib. pylint: disable-msg=C6301
#
# Copyright 2007 The Closure Linter 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 co... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/identity/azure-identity/azure/identity/_credentials/environment.py | 1 | 5957 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import logging
import os
from .. import CredentialUnavailableError
from .._constants import EnvironmentVariables
from .._internal.decorators import log_get_token
from ... | mit |
dllsf/odootest | openerp/addons/base/module/wizard/__init__.py | 365 | 1250 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
interlegis/saap | config/rest_framework/pagination.py | 1 | 30293 | # coding: utf-8
"""
Pagination serializers determine the structure of the output that should
be used for paginated responses.
"""
from __future__ import unicode_literals
from base64 import b64decode, b64encode
from collections import OrderedDict, namedtuple
from django.core.paginator import InvalidPage
from django.co... | gpl-3.0 |
ikben/troposphere | tests/test_rds.py | 2 | 11005 | import unittest
import troposphere.rds as rds
from troposphere import If, Parameter, Ref
AWS_NO_VALUE = "AWS::NoValue"
class TestRDS(unittest.TestCase):
def test_it_allows_an_rds_instance_created_from_a_snapshot(self):
rds_instance = rds.DBInstance(
'SomeTitle',
AllocatedStorage=... | bsd-2-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 354 | 5544 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | mit |
xianjunzhengbackup/Cloud-Native-Python | env/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.py | 355 | 4939 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from ..constants import namespaces, voidElements, spaceCharacters
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
DOCUMENT = Node.DOCUMEN... | mit |
yulang/linux-2.6.39.2_tcp_lab | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
amygdala/tensorflow-workshop | workshop_sections/getting_started/starter_tf_graph/tf_matrix_mul.py | 1 | 1548 | #!/usr/bin/env python
# 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 ... | apache-2.0 |
vj-ug/gcloud-python | gcloud/credentials.py | 7 | 14075 | # Copyright 2014 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 a... | apache-2.0 |
miguelparaiso/OdooAccessible | addons/hr_attendance/wizard/__init__.py | 375 | 1073 | # -*- 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... | agpl-3.0 |
maxwellalive/YCDIVFX_MaxPlus | packages/maxconnect/tomax.py | 2 | 7941 | '''
Taken from Sublime3dsmax : http://cbuelter.de/?p=535
'''
############################################################################
#
# This module finds 3ds Max and the MAXScript Listener and can
# send strings and button strokes to it.
#
# Completely based on m2u: http://alfastuff.wordpress.com/2013/10/13... | gpl-2.0 |
CyanHacker-Lollipop/kernel_htc_msm8974 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
rhjdjong/SlipLib | src/sliplib/slip.py | 2 | 8106 | # Copyright (c) 2020. Ruud de Jong
# This file is part of the SlipLib project which is released under the MIT license.
# See https://github.com/rhjdjong/SlipLib for details.
"""
Constants
---------
.. data:: END
.. data:: ESC
.. data:: ESC_END
.. data:: ESC_ESC
These constants represent the special bytes
us... | mit |
TheYorickable/tf300t_jb_kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
atpaino/socialsonar | twitter-1.10.0/build/lib/twitter/timezones.py | 26 | 1766 | # Retrieved from http://docs.python.org/2/library/datetime.html on 2013-05-24
from datetime import tzinfo, timedelta, datetime
ZERO = timedelta(0)
HOUR = timedelta(hours=1)
# A UTC class.
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC... | mit |
rat4/blackcoin | contrib/linearize/linearize-hashes.py | 105 | 2762 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
impor... | mit |
SEL-Columbia/bamboo | fabfile.py | 2 | 2204 | import os
import sys
from fabric.api import env, run, cd
DEPLOYMENTS = {
'prod': {
'home': '/var/www/',
'host_string': 'bamboo@bamboo.io',
'virtual_env': 'bamboo',
'repo_name': 'current',
'project': 'bamboo',
'docs': 'docs',
'branc... | bsd-3-clause |
s-hertel/ansible | test/units/modules/conftest.py | 35 | 1278 | # Copyright (c) 2017 Ansible Project
# 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
import json
import pytest
from ansible.module_utils.six import string_types
from ansible.module_ut... | gpl-3.0 |
jazkarta/edx-platform | common/lib/xmodule/xmodule/word_cloud_module.py | 104 | 7981 | """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... | agpl-3.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/test/test_tools/test_i18n.py | 5 | 2590 | """Tests to cover the Tools/i18n package"""
import os
import unittest
from test.support.script_helper import assert_python_ok
from test.test_tools import skip_if_missing, toolsdir
from test.support import temp_cwd
skip_if_missing()
class Test_pygettext(unittest.TestCase):
"""Tests for the pygettext.py tool"""... | mit |
40223139/2015cdaa5-12 | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | 8143 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... | gpl-3.0 |
pschmitt/home-assistant | tests/components/abode/test_init.py | 12 | 1508 | """Tests for the Abode module."""
from homeassistant.components.abode import (
DOMAIN as ABODE_DOMAIN,
SERVICE_CAPTURE_IMAGE,
SERVICE_SETTINGS,
SERVICE_TRIGGER_AUTOMATION,
)
from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_DOMAIN
from .common import setup_platform
from tests.as... | apache-2.0 |
androidarmv6/android_external_chromium_org | chrome/common/extensions/docs/server2/PRESUBMIT.py | 102 | 3631 | # Copyright (c) 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.
"""Presubmit script for changes affecting extensions docs server
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more de... | bsd-3-clause |
shlomif/PySolFC | pysollib/kivy/selecttree.py | 1 | 3420 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------#
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwar... | gpl-3.0 |
kimimj/scrapy | scrapy/utils/log.py | 108 | 6012 | # -*- coding: utf-8 -*-
import sys
import logging
import warnings
from logging.config import dictConfig
from twisted.python.failure import Failure
from twisted.python import log as twisted_log
import scrapy
from scrapy.settings import overridden_settings, Settings
from scrapy.exceptions import ScrapyDeprecationWarni... | bsd-3-clause |
jrahlf/3D-Non-Contact-Laser-Profilometer | xpcc/scons/site_tools/hosted.py | 1 | 2890 | #!/usr/bin/env python
#
# Copyright (c) 2009, Roboterclub Aachen e.V.
# 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
# ... | mit |
DazWorrall/ansible | lib/ansible/modules/packaging/os/redhat_subscription.py | 15 | 29767 | #!/usr/bin/python
# James Laska (jlaska@redhat.com)
#
# 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',
'status': ['prev... | gpl-3.0 |
alexallah/django | django/contrib/admindocs/urls.py | 97 | 1192 | from django.conf.urls import url
from django.contrib.admindocs import views
urlpatterns = [
url(r'^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'),
name='django-admindocs-docroot'),
url(r'^bookmarklets/$',
views.BookmarkletsView.as_view(),
name='django-... | bsd-3-clause |
chris-allan/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/templatetags/webclient_tags.py | 3 | 1519 | #!/usr/bin/env python
#
#
#
# Copyright (c) 2008 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 (at your option) any la... | gpl-2.0 |
kingoflolz/hearthbreaker | jsonschema/exceptions.py | 35 | 6973 | from collections import defaultdict, deque
import itertools
import pprint
import textwrap
from jsonschema import _utils
from jsonschema.compat import PY3, iteritems
WEAK_MATCHES = frozenset(["anyOf", "oneOf"])
STRONG_MATCHES = frozenset()
_unset = _utils.Unset()
class _Error(Exception):
def __init__(
... | mit |
avanzosc/odoo-addons | contract_sale_school/wizards/contract_line_create.py | 1 | 2167 | # Copyright 2020 Oihane Crucelaegui - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ContractLineCreate(models.TransientModel):
_name = "contract.line.create"
_description = "Contract Line Creation Wizard"
student_ids = fields.Ma... | agpl-3.0 |
ahamilton55/ansible | lib/ansible/modules/network/panos/panos_lic.py | 78 | 4915 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/__init__.py | 76 | 3229 | """MySQLdb - A DB API v2.0 compatible interface to MySQL.
This package is a wrapper around _mysql, which mostly implements the
MySQL C API.
connect() -- connects to server
See the C API specification and the MySQL documentation for more info
on other items.
For information on how MySQLdb handles type conv... | gpl-2.0 |
Roboy/MKR1000_Lighthouse_Embed | tools/gcc-arm-none-eabi/arm-none-eabi/share/gdb/python/gdb/function/strfns.py | 137 | 2684 | # Useful gdb string convenience functions.
# Copyright (C) 2012-2013 Free Software Foundation, 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 you... | gpl-3.0 |
beni55/networkx | networkx/convert.py | 12 | 13210 | """Functions to convert NetworkX graphs to and from other formats.
The preferred way of converting data to a NetworkX graph is through the
graph constuctor. The constructor calls the to_networkx_graph() function
which attempts to guess the input type and convert it automatically.
Examples
--------
Create a graph wit... | bsd-3-clause |
thnee/ansible | lib/ansible/modules/storage/netapp/_sf_volume_access_group_manager.py | 59 | 8956 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# 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',
'status': ['deprecated'],
... | gpl-3.0 |
catmaid/CATMAID | django/applications/catmaid/control/user.py | 2 | 6080 | # -*- coding: utf-8 -*-
import json
from typing import Any, Dict, Iterable
from guardian.utils import get_anonymous_user
from django.http import HttpRequest, JsonResponse
from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth import views as auth_views
from django.contrib.auth.mixins im... | gpl-3.0 |
kawasaki2013/python-for-android-x86 | python-modules/twisted/twisted/python/urlpath.py | 81 | 3431 | # -*- test-case-name: twisted.test.test_paths -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
import urlparse
import urllib
class URLPath:
def __init__(self, scheme='', netloc='localhost', path='',
query='', fragment=''):
self.scheme = scheme or 'h... | apache-2.0 |
ikezue/ardupilot-arducopter-3.1.0 | Tools/autotest/dump_logs.py | 229 | 1762 | #!/usr/bin/env python
# dump flash logs from SITL
# Andrew Tridgell, April 2013
import pexpect, os, sys, shutil, atexit
import optparse, fnmatch, time, glob, traceback, signal
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pysim'))
import util
############## main program #############
... | gpl-3.0 |
coen-hyde/dotfiles | libs/eb/lib/aws/requests/api.py | 32 | 4285 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Retur... | mit |
taotie12010/bigfour | cms/djangoapps/contentstore/management/commands/export_all_courses.py | 91 | 2323 | """
Script for exporting all courseware from Mongo to a directory and listing the courses which failed to export
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_course_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.content... | agpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pythonwin/pywin/tools/browser.py | 17 | 11796 | # basic module browser.
# usage:
# >>> import browser
# >>> browser.Browse()
# or
# >>> browser.Browse(your_module)
import sys
import types
import __main__
import win32ui
from pywin.mfc import dialog
import hierlist
special_names = [ '__doc__', '__name__', '__self__' ]
#
# HierList items
class HLIPythonObject(hierl... | gpl-3.0 |
Andrew-Katcha/storyteller | env/lib/python3.4/site-packages/setuptools/tests/test_resources.py | 345 | 23973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove
import os
import sys
import tempfile
import shutil
from unittest import TestCase
import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
Distribution... | mit |
laiqiqi886/kbengine | kbe/src/lib/python/Lib/sqlite3/test/userfunctions.py | 90 | 15023 | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warran... | lgpl-3.0 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_gdbm.py | 105 | 2540 | import unittest
import os
from test.test_support import TESTFN, run_unittest, unlink, import_module
gdbm = import_module('gdbm')
filename = TESTFN
class TestGdbm(unittest.TestCase):
def setUp(self):
self.g = None
def tearDown(self):
if self.g is not None:
self.g.close()
... | gpl-2.0 |
Tinkerforge/brickv | src/brickv/plugin_system/plugins/motion_detector_v2/motion_detector_v2.py | 1 | 7195 | # -*- coding: utf-8 -*-
"""
Motion Detector V2 Plugin
Copyright (C) 2017 Olaf Lüke <olaf@tinkerforge.com>
motion_detector_v2.py: Motion Detector V2 Plugin Implementation
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 S... | gpl-2.0 |
xifle/home-assistant | homeassistant/components/sensor/apcupsd.py | 29 | 7186 | """
Provides a sensor to track various status aspects of a UPS.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.apcupsd/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.... | mit |
GertBurger/pygame_cffi | test/test_utils/__init__.py | 18 | 5834 | #################################### IMPORTS ###################################
is_pygame_pkg = __name__.startswith('pygame.tests.')
if is_pygame_pkg:
from pygame.tests.test_utils import unittest
else:
from test.test_utils import unittest
import tempfile, sys, pygame, time, os
##############################... | lgpl-2.1 |
gmatteo/pymatgen | pymatgen/io/feff/tests/test_sets.py | 5 | 11111 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import shutil
import unittest
import numpy as np
from pymatgen.core.structure import Structure
from pymatgen.io.cif import CifFile, CifParser
from pymatgen.io.feff.inputs import Atoms, Header, Pote... | mit |
tinfoil/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_input.py | 125 | 2612 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
elover/python-django-blog | myblog/pygments/styles/murphy.py | 364 | 2751 | # -*- coding: utf-8 -*-
"""
pygments.styles.murphy
~~~~~~~~~~~~~~~~~~~~~~
Murphy's style from CodeRay.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment,... | mit |
strk/QGIS | python/plugins/processing/algs/qgis/GeometryConvert.py | 4 | 9956 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Gridify.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*****************************... | gpl-2.0 |
masamichi/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/hmac.py | 403 | 3286 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
(This file is modified from the standard library version to do faster
copying)
"""
def _strxor(s1, s2):
"""Utility method. XOR the two strings s1 and s2 (must have same length).
"""
r... | apache-2.0 |
Anonymouslemming/ansible | test/units/modules/network/vyos/test_vyos_system.py | 113 | 3870 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
dendisuhubdy/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sigmoid_test.py | 14 | 2451 | # 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 |
haradashinya/flask-admin | flask_admin/contrib/sqla/tools.py | 7 | 6906 | import types
from sqlalchemy import tuple_, or_, and_, inspect
from sqlalchemy.ext.declarative.clsregistry import _class_resolver
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.ext.associationproxy import ASSOCIATION_PROXY
from sqlalchemy.sql.operators import eq
from sqlalchemy.exc import DBAPIError... | bsd-3-clause |
311labs/SRL | radmin/python/config.py | 1 | 6036 | """
module: radmin.confg
Config file logic
Created by Ian Starnes 2007-11-27
"""
class Config(object):
"""The Config class."""
def __init__(self, filename):
self.filename = filename
self._items = {}
execfile(filename, globals(), self._items)
def add(self, key, value):
... | mit |
harej/wikiproject_scripts | reportsbot/config.py | 2 | 2143 | # -*- coding: utf-8 -*-
import errno
from os import path
import yaml
from .exceptions import ConfigError
__all__ = ["Config"]
class Config:
"""Stores general-purpose bot configuration."""
def __init__(self, base_dir):
self._base_dir = base_dir
self._data = {}
self._load()
def ... | mit |
DemocracyLab/CivicTechExchange | common/management/commands/project_external_updates.py | 1 | 4929 | from django.core.management.base import BaseCommand
from common.helpers.db import bulk_delete
from common.helpers.github import fetch_github_info, get_owner_repo_name_from_public_url, \
get_repo_endpoint_from_owner_repo_name, get_repo_names_from_owner_repo_name, get_branch_name_from_public_url
from common.helpers.d... | mit |
rodrigolucianocosta/ControleEstoque | rOne/Storage101/django-localflavor/django-localflavor-1.3/tests/test_fi.py | 10 | 16297 | from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.fi.forms import FIMunicipalitySelect, FISocialSecurityNumber, FIZipCodeField
class FILocalFlavorTests(SimpleTestCase):
def test_FIMunicipalitySelect(self):
f = FIMunicipalitySelect()
out = '''<select ... | gpl-3.0 |
soldag/home-assistant | homeassistant/components/file/sensor.py | 11 | 2946 | """Support for sensor value(s) stored in local files."""
import logging
import os
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE
import homeassistant.helpers.config_validation as cv
from home... | apache-2.0 |
CollabQ/CollabQ | vendor/django/contrib/gis/geos/tests/test_io.py | 321 | 4159 | import binascii, ctypes, unittest
from django.contrib.gis.geos import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
class GEOSIOTest(unittest.TestCase):
def test01_wktreader(self):
# Creating a WKTReader instance
wkt_r = WKTReader()
wkt = 'POINT (5 23)'
... | apache-2.0 |
takeshineshiro/nova | nova/tests/functional/v3/test_user_data.py | 3 | 1811 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 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... | apache-2.0 |
Krossom/python-for-android | python-build/python-libs/gdata/build/lib/atom/service.py | 135 | 28680 | #!/usr/bin/python
#
# Copyright (C) 2006, 2007, 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 app... | apache-2.0 |
PandaWei/tp-libvirt | libguestfs/tests/guestfs_part_operations.py | 8 | 15077 | import re
import os
import logging
from autotest.client.shared import error, utils
from virttest import virt_vm, data_dir, remote, aexpect
from virttest import utils_test
def test_formatted_part(vm, params):
"""
1) Fall into guestfish session w/ inspector
2) Do some necessary check
3) Format additiona... | gpl-2.0 |
Aasmi/scikit-learn | sklearn/metrics/ranking.py | 75 | 25426 | """Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | bsd-3-clause |
fbradyirl/home-assistant | homeassistant/components/supla/__init__.py | 1 | 4458 | """Support for Supla devices."""
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.const import CONF_ACCESS_TOKEN
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import load_platform
from homeassistant.helpers.entity import Entity
REQUIRE... | apache-2.0 |
kylelwm/ponus | venv/Lib/encodings/euc_kr.py | 816 | 1027 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | mit |
sliz1/servo | tests/wpt/css-tests/css21_dev/xhtml1print/reference/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
SymbiFlow/symbiflow-arch-defs | utils/lib/collections_extra.py | 1 | 8235 | #!/usr/bin/env python3
import enum
import io
import pprint
import sys
from types import MappingProxyType
def frozendict(*args, **kwargs):
"""Version of a dictionary which can't be changed."""
return MappingProxyType(dict(*args, **kwargs))
class MostlyReadOnly:
"""Object which is **mostly** read only. ... | isc |
perdona/django-pipeline | tests/tests/test_glob.py | 6 | 3728 | from __future__ import unicode_literals
import os
import shutil
from django.core.files.base import ContentFile
from django.core.files.storage import FileSystemStorage
from django.test import TestCase
from pipeline import glob
def local_path(path):
return os.path.join(os.path.dirname(__file__), path)
class Gl... | mit |
Slattsveen/eduROV_v2 | eduROV_v01.py | 1 | 6154 | import sys, pygame, pygame.camera, os, time, serial
from sense_hat import SenseHat
# to add the piCam to the list of available cameras, run command:
# sudo modprobe bcm2835-v4l2
os.system("sudo modprobe bcm2835-v4l2")
##ititiating pygame module, camera, serial port, senseHat
pygame.init()
pygame.camera.init()
senseHat... | gpl-3.0 |
adobe-type-tools/python-scripts | buildAll.py | 1 | 3612 | #!/usr/bin/env python
import os
import sys
import time
from subprocess import Popen, PIPE
__doc__ = """
buildAll v1.2 - Dec 01 2019
This script takes a path to a folder as input, finds all UFO files or Type 1
fonts (.pfa files) inside that folder and its subdirectories, and builds
OpenType (.otf) fonts using the FD... | mit |
r888888888/models | street/python/vgsl_eval.py | 22 | 2048 | # 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... | apache-2.0 |
enriclluelles/ansible-modules-extras | packaging/os/swdepot.py | 8 | 6163 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Raul Melo
# Written by Raul Melo <raulmelo@gmail.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-3.0 |
kawamon/hue | desktop/core/ext-py/billiard-3.5.0.5/billiard/resource_sharer.py | 9 | 5361 | #
# We use a background thread for sharing fds on Unix, and for sharing
# sockets on Windows.
#
# A client which wants to pickle a resource registers it with the resource
# sharer and gets an identifier in return. The unpickling process will connect
# to the resource sharer, sends the identifier and its pid, and then ... | apache-2.0 |
kwlzn/pants | src/python/pants/goal/goal.py | 4 | 8317 | # 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, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.goal.erro... | apache-2.0 |
chrisfilda/edx_platform | lms/djangoapps/instructor/views/api_urls.py | 7 | 2854 | """
Instructor API endpoint urls.
"""
from django.conf.urls import patterns, url
urlpatterns = patterns('', # nopep8
url(r'^students_update_enrollment$',
'instructor.views.api.students_update_enrollment', name="students_update_enrollment"),
url(r'^list_course_role_members$',
'instructor.views... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.