repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
cogeorg/black_rhino | examples/firesales_SA/networkx/algorithms/bipartite/projection.py | 53 | 16253 | # -*- coding: utf-8 -*-
"""One-mode (unipartite) projections of bipartite graphs.
"""
import networkx as nx
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['A... | gpl-3.0 |
salguarnieri/intellij-community | python/lib/Lib/warnings.py | 80 | 9150 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import sys, types
import linecache
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings"]
# filters conta... | apache-2.0 |
qwcode/pip | contrib/get-pip.py | 54 | 556782 | #! /usr/bin/env python
sources = """
QlpoOTFBWSZTWcC/jl0G3b5///////////////////////9AwIAAgAMABABAAmIAgABEYmKFss+w
y2c7JLvjyw85vVtbvvt58za+3r06d93PSrbX177PpH2bK23Zz3d0W+x7fOn3dxoKU7pZ0Ks19777
6qXno+6WDVthUsKeigoEhKoopVQAFU0dOcG0D3w+U97eeMRKSpKdsru4+73hQAfVABr5dKfIvej7
vF7va2Xa+LhLUNsqqW+ruzFaDQrp3Y21CtHQabbqHbKogiIVubq... | mit |
mancoast/CPythonPyc_test | fail/340_test_hmac.py | 84 | 20691 | import functools
import hmac
import hashlib
import unittest
import warnings
from test import support
def ignore_warning(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
with warnings.catch_warnings():
warnings.filterwarnings("ignore",
category... | gpl-3.0 |
cloudbau/nova | nova/api/openstack/compute/plugins/v3/server_metadata.py | 11 | 9307 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | apache-2.0 |
Larspolo/linux | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
wwj718/murp-edx | lms/djangoapps/certificates/migrations/0013_auto__add_field_generatedcertificate_error_reason.py | 188 | 5642 | # -*- 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 'GeneratedCertificate.error_reason'
db.add_column('certificates_generatedcertificate', 'error... | agpl-3.0 |
naslanidis/ansible | lib/ansible/utils/module_docs_fragments/netapp.py | 2 | 2483 | #
# (c) 2016, Sumit Kumar <sumit4@netapp.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) any later versi... | gpl-3.0 |
jazkarta/edx-platform | openedx/core/djangoapps/content/course_overviews/tests.py | 28 | 18156 | """
Tests for course_overviews app.
"""
import datetime
import ddt
import itertools
import math
import mock
import pytz
from django.utils import timezone
from lms.djangoapps.certificates.api import get_active_web_certificate
from lms.djangoapps.courseware.courses import course_image_url
from xmodule.course_metadata_u... | agpl-3.0 |
AndreyKedo/My_project_blog | node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | gpl-3.0 |
StephenWeber/ansible | lib/ansible/plugins/lookup/nested.py | 157 | 2100 | # (c) 2012, 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) any lat... | gpl-3.0 |
rsvip/Django | django/contrib/gis/management/commands/inspectdb.py | 190 | 1499 | from django.core.management.commands.inspectdb import \
Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self).get_fiel... | bsd-3-clause |
piquadrat/django | tests/forms_tests/widget_tests/test_checkboxselectmultiple.py | 30 | 8182 | import datetime
from django import forms
from django.forms import CheckboxSelectMultiple
from django.test import override_settings
from .base import WidgetTest
class CheckboxSelectMultipleTest(WidgetTest):
widget = CheckboxSelectMultiple
def test_render_value(self):
self.check_html(self.widget(choi... | bsd-3-clause |
NL66278/odoo | addons/account_bank_statement_extensions/res_partner_bank.py | 381 | 1582 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
albertomurillo/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_alert_profiles.py | 17 | 11301 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat 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',
... | gpl-3.0 |
pebble/spacel-provision | src/test/provision/orbit/test_provider.py | 1 | 1145 | from mock import MagicMock
from spacel.provision.orbit.provider import ProviderOrbitFactory
from test import BaseSpaceAppTest, ORBIT_REGION
TEST_PROVIDER = 'test'
class TestProviderOrbitFactory(BaseSpaceAppTest):
def setUp(self):
super(TestProviderOrbitFactory, self).setUp()
self.provider = Mag... | mit |
volkhin/ycmd | ycmd/tests/javascript/debug_info_test.py | 3 | 1798 | # Copyright (C) 2016-2017 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
#... | gpl-3.0 |
CYBAI/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-registration-with-type.py | 20 | 1077 | def classic_script():
return b"""
importScripts('./imported-classic-script.js');
self.onmessage = e => {
e.source.postMessage(imported);
};
"""
def module_script():
return b"""
import * as module from './imported-module-script.js';
self.onmessage = e => {
e.s... | mpl-2.0 |
crpalmer/android_kernel_samsung_mondrianwifi | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
gavrieltal/opencog | opencog/python/web/api/apiatomcollection.py | 6 | 21530 | __author__ = 'Cosmo Harrigan'
from flask import abort, json, current_app, jsonify
from flask.ext.restful import Resource, reqparse, marshal
from opencog.atomspace import Handle, Atom
from mappers import *
from flask.ext.restful.utils import cors
from flask_restful_swagger import swagger
# If the system doesn't have t... | agpl-3.0 |
Evervolv/android_external_chromium_org | third_party/closure_linter/closure_linter/requireprovidesorter.py | 137 | 9826 | #!/usr/bin/env python
#
# Copyright 2011 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | bsd-3-clause |
rdeheele/odoo | addons/email_template/email_template.py | 26 | 30293 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
thebenwaters/openclickio | core/urls.py | 1 | 1643 | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import StudentListLectureView, InstructorListLectureView, RegisteredLectureCreateView, CreateLectureView, \
LectureDetailView, LectureListView, UserRegisteredLectureView, UserRegisteredLectureApproveView, \
CreateAtte... | mit |
brchiu/tensorflow | tensorflow/python/autograph/core/converter_test.py | 8 | 3762 | # 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 |
plq/spyne | spyne/util/attrdict.py | 2 | 2918 |
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 libra... | lgpl-2.1 |
kennethgillen/ansible | lib/ansible/modules/network/panos/panos_nat_policy.py | 72 | 10533 | #!/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 |
benoitsteiner/tensorflow-opencl | tensorflow/python/kernel_tests/decode_png_op_test.py | 134 | 2081 | # 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 |
mancoast/CPythonPyc_test | cpython/262_test_zipimport.py | 55 | 17378 | import sys
import os
import marshal
import imp
import struct
import time
import unittest
import zlib # implied prerequisite
from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
from test import test_support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
import zipimport
import ... | gpl-3.0 |
tensorflow/addons | tensorflow_addons/image/dense_image_warp.py | 1 | 10213 | # Copyright 2019 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 |
salguarnieri/intellij-community | python/helpers/py3only/docutils/parsers/rst/directives/admonitions.py | 44 | 2404 | # $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.par... | apache-2.0 |
realgam3/service.subtitles.hebsubs | ptvsd/attach_server.py | 24 | 13354 | # ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
... | gpl-2.0 |
CapOM/ChromiumGStreamerBackend | tools/resources/find_unused_resources.py | 105 | 6465 | #!/usr/bin/env python
# Copyright 2013 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.
"""This script searches for unused art assets listed in a .grd file.
It uses git grep to look for references to the IDR resource id or... | bsd-3-clause |
Deepakkothandan/ansible | lib/ansible/plugins/lookup/sequence.py | 57 | 8759 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
# (c) 2012-17 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
DOCUMENTATION = """
lookup: sequence
author: Jayso... | gpl-3.0 |
bigswitch/horizon | openstack_dashboard/dashboards/admin/instances/tables.py | 2 | 7711 | # Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, 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
#
# Unle... | apache-2.0 |
mKeRix/home-assistant | homeassistant/components/mikrotik/hub.py | 5 | 13579 | """The Mikrotik router class."""
from datetime import timedelta
import logging
import socket
import ssl
import librouteros
from librouteros.login import plain as login_plain, token as login_token
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_VERIFY_SSL
from homeassistant.exceptions imp... | mit |
Lana-B/Pheno4T | madanalysis/layout/histogram_core.py | 1 | 2479 | ################################################################################
#
# Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
# The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
#
# This file is part of MadAnalysis 5.
# Official website: <https://launchpad.net/madanalysis5>
#
# MadAnal... | gpl-3.0 |
Pointedstick/ReplicatorG | skein_engines/skeinforge-31/fabmetheus_utilities/geometry/statements/_print.py | 2 | 2114 | """
Polygon path.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.geometry_utilities import evaluate
__author__... | gpl-2.0 |
devs1991/test_edx_docmode | lms/djangoapps/commerce/tests/__init__.py | 3 | 4257 | # -*- coding: utf-8 -*-
""" Commerce app tests package. """
import datetime
import json
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from freezegun import freeze_time
import httpretty
import jwt
import mock... | agpl-3.0 |
huobaowangxi/scikit-learn | sklearn/covariance/outlier_detection.py | 208 | 6917 | """
Class for outlier detection.
This class provides a framework for outlier detection. It consists in
several methods that can be added to a covariance estimator in order to
assess the outlying-ness of the observations of a data set.
Such a "outlier detector" object is proposed constructed from a robust
covariance es... | bsd-3-clause |
Pandaaaa906/ChemErpSystem | ERP/templatetags/erp_extras.py | 1 | 1616 | # -*- coding: utf-8 -*-
from django import template
from django.db.models.query import QuerySet
import datetime
from django import template
from django.contrib.auth.models import Group
from django.contrib.auth.models import User
from django.db.models import Q
register = template.Library()
@register.inclusion_tag('side... | apache-2.0 |
B-MOOC/edx-platform | openedx/core/djangoapps/content/course_structures/api/v0/serializers.py | 65 | 1313 | """
API Serializers
"""
from rest_framework import serializers
class GradingPolicySerializer(serializers.Serializer):
""" Serializer for course grading policy. """
assignment_type = serializers.CharField(source='type')
count = serializers.IntegerField(source='min_count')
dropped = serializers.IntegerF... | agpl-3.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.5/django/contrib/flatpages/templatetags/flatpages.py | 227 | 3631 | from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import get_current_site
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.... | mit |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/scipy/integrate/__init__.py | 35 | 2256 | """
=============================================
Integration and ODEs (:mod:`scipy.integrate`)
=============================================
.. currentmodule:: scipy.integrate
Integrating functions, given function object
============================================
.. autosummary::
:toctree: generated/
quad ... | mit |
rplevka/robottelo | tests/upgrades/test_repository.py | 1 | 9545 | """Test for Repository related Upgrade Scenarios
:Requirement: Upgraded Satellite
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:Assignee: tpapaioa
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import os
from fabric.api import execute
from fabric.api import run
... | gpl-3.0 |
geopython/QGIS | tests/src/python/test_provider_memory.py | 1 | 27965 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the memory layer provider.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later vers... | gpl-2.0 |
HonzaKral/django | tests/select_related_onetoone/models.py | 166 | 2386 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=100)
email = models.EmailField()
def __str__(self):
return self.username
@python_2_unicode_compatible
class Us... | bsd-3-clause |
gusai-francelabs/datafari | windows/python/Lib/multiprocessing/pool.py | 29 | 24000 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# 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. Redist... | apache-2.0 |
longqinsi/zerorpc-python | zerorpc/version.py | 79 | 1373 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
anirudhSK/chromium | build/win/install-build-deps.py | 153 | 1463 | #!/usr/bin/env python
# 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.
import shutil
import sys
import os
def patch_msbuild():
"""VS2010 MSBuild has a ULDI bug that we patch here. See http://goo.gl/P... | bsd-3-clause |
DavidNorman/tensorflow | tensorflow/python/data/experimental/ops/map_defun.py | 29 | 2981 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
arifsetiawan/edx-platform | 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 |
kazemakase/scikit-learn | sklearn/cluster/tests/test_k_means.py | 132 | 25860 | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | bsd-3-clause |
cdondrup/strands_social | image_branding/scripts/image_branding_server.py | 3 | 2693 | #! /usr/bin/env python
import rospy
import actionlib
import image_branding.msg
from sensor_msgs.msg import Image
import cv2
from cv_bridge import CvBridge
class brandingServer(object):
_feedback = image_branding.msg.ImageBrandingFeedback()
_result = image_branding.msg.ImageBrandingResult()
def __ini... | mit |
n0trax/ansible | lib/ansible/plugins/connection/netconf.py | 18 | 7707 | # (c) 2016 Red Hat Inc.
# (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
DOCUMENTATION = """
author: Ansible Networking Team
connection: netconf
sh... | gpl-3.0 |
atwoz/vimeko | sources_non_forked/ultisnips/pythonx/UltiSnips/text_objects/_shell_code.py | 28 | 2280 | #!/usr/bin/env python
# encoding: utf-8
"""Implements `echo hi` shell code interpolation."""
import os
import platform
from subprocess import Popen, PIPE
import stat
import tempfile
from UltiSnips.compatibility import as_unicode
from UltiSnips.text_objects._base import NoneditableTextObject
def _chomp(string):
... | mit |
mancoast/CPythonPyc_test | cpython/230_test_pyexpat.py | 9 | 10414 | # Very simple test - Parse a file and print what happens
# XXX TypeErrors on calling handlers, or on bad return values from a
# handler, are obscure and unhelpful.
import pyexpat
from xml.parsers import expat
from test.test_support import sortdict, TestFailed
class Outputter:
def StartElementHandler(self, name,... | gpl-3.0 |
n0trax/ansible | lib/ansible/modules/packaging/os/openbsd_pkg.py | 25 | 25762 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrik Lundin <patrik@sigterm.se>
#
# 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 |
YevgeniyaK/python_training | fixture/group.py | 1 | 4957 | from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_group_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()
... | apache-2.0 |
patcorwin/fossil | pdil/tool/fossil/rigging/splineTwist.py | 1 | 24347 | from __future__ import absolute_import, division, print_function
from collections import OrderedDict
import math
from pymel.core import curve, cluster, delete, dt, duplicate, expression, group, hide, ikHandle, insertKnotCurve, joint, move, orientConstraint, parent, parentConstraint, pointConstraint, xform
from ....a... | bsd-3-clause |
Osmose/trephub | vendor-local/lib/python/south/tests/autodetection.py | 49 | 11803 | from south.tests import unittest
from south.creator.changes import AutoChanges, InitialChanges
from south.migration.base import Migrations
from south.tests import Monkeypatcher
from south.creator import freezer
from south.orm import FakeORM
from south.v2 import SchemaMigration
class TestComparison(unittest.TestCase):... | bsd-3-clause |
fredericlepied/ansible | lib/ansible/modules/system/solaris_zone.py | 9 | 16485 | #!/usr/bin/python
# (c) 2015, Paul Markham <pmarkham@netrefinery.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.0',
... | gpl-3.0 |
KitKatXperience/platform_external_chromium_org | third_party/tlslite/tlslite/utils/ASN1Parser.py | 80 | 1038 | """Class for parsing ASN.1"""
from compat import *
from codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser:
def __init__(self, bytes):
p = Parser(bytes)
p.get(1) #skip Type
#Get Length
self.length = self._getASN1Length(p)
#Get Value
... | bsd-3-clause |
TimothyZhang/ccc_helper | test.py | 1 | 5100 | # coding=utf-8
# Copyright 2014 Timothy Zhang(zt@live.cn).
#
# This file is part of Structer.
#
# Structer 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)... | gpl-3.0 |
ThomasSweijen/TPF | doc/sphinx/tutorial/peri-triax.py | 8 | 1172 | from yade import pack,plot
sp=pack.SpherePack()
rMean=.05
sp.makeCloud((0,0,0),(1,1,1),rMean=rMean,periodic=True)
sp.toSimulation()
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()],verletDist=.05*rMean),
InteractionLoop([Ig2_Sphere_Sphere_L3Geom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_L3Ge... | gpl-2.0 |
cristian69/KernotekV3 | venv/lib/python2.7/site-packages/pip/_vendor/requests/api.py | 361 | 4344 | # -*- 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... | gpl-3.0 |
sffjunkie/home-assistant | homeassistant/components/device_tracker/snmp.py | 6 | 3587 | """
Support for fetching WiFi associations through SNMP.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.snmp/
"""
import binascii
import logging
import threading
from datetime import timedelta
from homeassistant.components.device_tracker ... | mit |
ypkang/Dato-Core | src/unity/python/graphlab/connect/aws/_ec2.py | 13 | 24476 | """@package graphlab.connect.aws.ec2
This module makes it easy to have a GraphLab server running on an EC2 instance.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
import C... | agpl-3.0 |
derekjchow/models | research/slim/nets/mobilenet_v1_eval.py | 4 | 4826 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
t00mas/datascience-python | classification/knearest.py | 1 | 1554 | import matplotlib
import matplotlib.pyplot as pyplot
import numpy
from matplotlib.colors import ListedColormap
from sklearn import neighbors, datasets
def get_iris_dataset():
iris = datasets.load_iris()
return iris.data[:, :2], iris.target
def get_knn_classifier(X, y, n_neighbors=None):
if not n_neighbo... | mit |
dcamposliz/youtube-dl | youtube_dl/extractor/pornhub.py | 3 | 5641 | from __future__ import unicode_literals
import os
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
compat_urllib_parse_urlparse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
str_to_int,
)
from ..... | unlicense |
jart/tensorflow | tensorflow/contrib/proto/__init__.py | 37 | 1120 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
erdincay/gmvault | src/sandbox/oauth2_tests.py | 3 | 1284 | __author__ = 'Aubert'
import httplib2
from six.moves import input
from oauth2client.client import OAuth2WebServerFlow
CLIENT_ID = "some-ids"
CLIENT_SECRET = "secret"
SCOPES = ['https://mail.google.com/', # IMAP/SMTP client access
'https://www.googleapis.com/auth/email'] # Email address access (... | agpl-3.0 |
transi/kernel_amazon_bowser-common | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
marklee77/fail2ban | fail2ban/server/server.py | 4 | 16650 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | gpl-2.0 |
soldag/home-assistant | homeassistant/components/homekit_controller/__init__.py | 5 | 7784 | """Support for Homekit device discovery."""
from typing import Any, Dict
import aiohomekit
from aiohomekit.model import Accessory
from aiohomekit.model.characteristics import (
Characteristic,
CharacteristicPermissions,
CharacteristicsTypes,
)
from aiohomekit.model.services import Service, ServicesTypes
f... | apache-2.0 |
jmwright/cadquery-freecad-module | Libs/future/backports/socket.py | 68 | 15663 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | lgpl-3.0 |
ToontownUprising/src | toontown/ai/NewsManagerAI.py | 1 | 2153 | from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class NewsManagerAI(DistributedObjectAI):
notify = directNotify.newCategory('NewsManagerAI')
def announceGenerate(self):
DistributedObjectAI.announceGenerate(self)
... | mit |
wd5/jangr | _django/contrib/gis/db/backends/oracle/creation.py | 620 | 2283 | from django.db.backends.oracle.creation import DatabaseCreation
from django.db.backends.util import truncate_name
class OracleCreation(DatabaseCreation):
def sql_indexes_for_field(self, model, f, style):
"Return any spatial index creation SQL for the field."
from django.contrib.gis.db.models.field... | bsd-3-clause |
hynekcer/django | django/contrib/messages/storage/session.py | 478 | 1714 | import json
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import (
MessageDecoder, MessageEncoder,
)
from django.utils import six
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
... | bsd-3-clause |
UBERMALLOW/kernel_htc_flounder | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
Mercador/python-keystoneclient | keystoneclient/tests/unit/v3/test_policies.py | 6 | 1131 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
arduino-org/s4t-iotronic | lib/test_pub.py | 1 | 2229 |
wampAddress = 'ws://172.17.3.139:8181/ws'
wampRealm = 's4t'
#from threading import Thread
from autobahn.twisted.wamp import ApplicationRunner
from autobahn.twisted.wamp import ApplicationSession
from twisted.internet.defer import inlineCallbacks
#import per test
from twisted.internet.defer import DeferredQueue
from... | apache-2.0 |
galaxy001/GoAgentX | Resources/west-chamber-proxy/westchamberproxy.py | 17 | 43361 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
westchamberproxy by liruqi@gmail.com
Based on:
PyGProxy by gdxxhg@gmail.com
GoAgent by {phus.lu,hewigovens}@gmail.com (Phus Lu and Hewig Xu)
'''
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
from... | bsd-2-clause |
paulsoh/moxie | moxie/social/tests/backends/test_angel.py | 92 | 1105 | import json
from social.tests.backends.oauth import OAuth2Test
class AngelOAuth2Test(OAuth2Test):
backend_path = 'social.backends.angel.AngelOAuth2'
user_data_url = 'https://api.angel.co/1/me/'
access_token_body = json.dumps({
'access_token': 'foobar',
'token_type': 'bearer'
})
us... | mit |
aifil/odoo | addons/website/models/ir_http.py | 10 | 15609 | # -*- coding: utf-8 -*-
import logging
import os
import re
import time
import traceback
import werkzeug
import werkzeug.routing
import werkzeug.utils
import openerp
from openerp.addons.base import ir
from openerp.addons.base.ir import ir_qweb
from openerp.addons.website.models.website import slug, url_for, _UNSLUG_RE... | gpl-3.0 |
pitunti/alfaPitunti | plugin.video.alfa/channels/tupornotv.py | 1 | 10715 | # -*- coding: utf-8 -*-
import re
import urlparse
from core import scrapertools
from core.item import Item
from platformcode import logger
def mainlist(item):
logger.info()
itemlist = []
itemlist.append(Item(channel=item.channel, title="Pendientes de Votación", action="novedades",
... | gpl-3.0 |
tlatzko/spmcluster | .tox/2.7-cover/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 436 | 5992 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isinstance(s, text_type):
... | bsd-2-clause |
kovach/piksi_tools | piksi_tools/console/output_stream.py | 8 | 4133 | #!/usr/bin/env python
# Copyright (C) 2011-2014 Swift Navigation Inc.
# Contact: Fergus Noble <fergus@swift-nav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS... | lgpl-3.0 |
designcc/django-ccbasket | ccbasket_testproject/shop/views.py | 1 | 1061 | # -*- coding: utf-8 -*-
import logging
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.response import TemplateResponse
from models import SimpleProduct, ComplexProduct
logger = logging.getLogger('ccbasket')
def home(request):
return render_to_respon... | bsd-3-clause |
xxxIsaacPeralxxx/anim-studio-tools | grenade/sources/grenade/common/error.py | 5 | 2307 | #
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its
# affiliates and/or its licensors.
#
class GrenadeError(Exception):
"""
Base error used when things go wrong in Grenade, all other Grenade exceptions
should derive from this.
.. versionadded:: v00_01_00
"""
... | gpl-3.0 |
refuge-attic/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/MSCommon/__init__.py | 61 | 2101 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | apache-2.0 |
cea-hpc/shine | lib/Shine/Configuration/Configuration.py | 1 | 8263 | # Configuration.py -- Configuration container
# Copyright (C) 2007-2014 CEA
#
# This file is part of shine
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or... | gpl-2.0 |
david-abel/simple_rl | simple_rl/tasks/maze_1d/Maze1DPOMDPClass.py | 1 | 2420 | # Python imports.
from collections import defaultdict
import random
# Other imports.
from simple_rl.pomdp.POMDPClass import POMDP
from simple_rl.tasks.maze_1d.Maze1DStateClass import Maze1DState
class Maze1DPOMDP(POMDP):
''' Class for a 1D Maze POMDP '''
ACTIONS = ['west', 'east']
OBSERVATIONS = ['nothin... | apache-2.0 |
asrie/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py | 124 | 6044 | # Copyright (C) 2010, 2012 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 an... | bsd-3-clause |
trueblue2704/AskMeAnything | lib/python2.7/site-packages/werkzeug/contrib/fixers.py | 148 | 10197 | # -*- 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 |
alesdotio/motorway | motorway/tests/sample_pipeline.py | 2 | 1984 | from collections import defaultdict
from motorway.messages import Message
from motorway.pipeline import Pipeline
from motorway.ramp import Ramp
from motorway.intersection import Intersection
class WordRamp(Ramp):
sentences = [
"Oak is strong and also gives shade.",
"Cats and dogs each hate the oth... | apache-2.0 |
aitoralmeida/networkx | networkx/generators/tests/test_threshold.py | 36 | 6649 | #!/usr/bin/env python
"""Threshold Graphs
================
"""
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx as nx
import networkx.generators.threshold as nxt
from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
cnlti = nx.convert_no... | bsd-3-clause |
vismartltd/edx-platform | lms/djangoapps/mobile_api/users/serializers.py | 9 | 3514 | """
Serializer for user API
"""
from rest_framework import serializers
from rest_framework.reverse import reverse
from courseware.courses import course_image_url
from student.models import CourseEnrollment, User
from certificates.models import certificate_status_for_student, CertificateStatuses
class CourseField(ser... | agpl-3.0 |
xfournet/intellij-community | python/lib/Lib/pprint.py | 92 | 10878 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | apache-2.0 |
tenable/Tenable.io-SDK-for-Python | tenable_io/api/plugins.py | 1 | 1572 | from tenable_io.api.base import BaseApi
from tenable_io.api.models import PluginDetails, PluginFamilyDetails, PluginFamilyList
class PluginsApi(BaseApi):
def families(self, include_all=None):
"""Return list of plugin families.
:param include_all: Whether or not to include all plugins. Defaults t... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.