code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
"""
Utilities for checking generated code
"""
import os.path
current_neuroml_version = "v2beta3"
def validate_neuroml2(file_name):
from lxml import etree
try:
from urllib2 import urlopen # Python 2
except:
from urllib.request import urlopen # Python 3
xsd_file = os.path.jo... | rgerkin/libNeuroML | neuroml/utils.py | Python | bsd-3-clause | 634 |
# -*- coding: utf-8 -*-
# Copyright 2016 Antiun Ingeniería S.L. - Jairo Llopis
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Smooth Scroll for Website Anchors',
'summary': 'Replace default behavior for internal links (anchor only) with'
... | RoelAdriaans-B-informed/website | website_anchor_smooth_scroll/__manifest__.py | Python | agpl-3.0 | 848 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Clear Groups for Odoo
# Copyright (C) 2016 Bytebrand GmbH (<http://www.bytebrand.net>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser ... | mohamedhagag/community-addons | hr_employee_time_clock/models/hr_employee.py | Python | agpl-3.0 | 1,731 |
# Copyright 2013-2016 MongoDB, 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 writin... | BriData/DBus | dbus-mongo-extractor/tests/test_rollbacks.py | Python | apache-2.0 | 12,580 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Make sure all of the per-file *_messages.h OWNERS are consistent"""
from __future__ import print_function
import os
import re
impo... | chromium/chromium | tools/security/check_message_owners.py | Python | bsd-3-clause | 1,547 |
"""A setup module for the GRPC packager-unittest service.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
import setuptools
from setuptools import setup, find_packages
install_requires = [
'oauth2client>=0.4.1',
'grpc>=0.9.0a0'
]
setuptools.setup(
name=... | sidrakesh93/grpc-tools | test/fixtures/setup.py | Python | bsd-3-clause | 819 |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | hjanime/VisTrails | vistrails/gui/query_view.py | Python | bsd-3-clause | 26,178 |
import os
import sys
import contextlib
import importlib.util
import inspect
import pydoc
import py_compile
import keyword
import _pickle
import pkgutil
import re
import stat
import string
import tempfile
import test.support
import time
import types
import typing
import unittest
import urllib.parse
import xml.etree
impo... | brython-dev/brython | www/src/Lib/test/test_pydoc.py | Python | bsd-3-clause | 58,949 |
"""
Distance computations (:mod:`scipy.spatial.distance`)
=====================================================
.. sectionauthor:: Damian Eads
Function reference
------------------
Distance matrix computation from a collection of raw observation vectors
stored in a rectangular array.
.. autosummary::
:toctree: g... | jamestwebber/scipy | scipy/spatial/distance.py | Python | bsd-3-clause | 86,279 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Sorsly/subtle | google-cloud-sdk/lib/surface/compute/instances/create_from_container.py | Python | mit | 9,727 |
#!/usr/bin/python
import csv
import sys
import dotag.KJVTagger as KJVTagger
kjvTagger = KJVTagger.KJVTagger(datafile = "./data/kurmanji.verbs.csv")
kjvTagger.dotag()
| halilagin/linguistics | kurjmorph/src/python/kurdish/build/lib/kurmanji/verb/test.py | Python | mit | 172 |
# SConsBuildFramework - Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, Nicolas Papier.
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation.
# Author Nicolas Papier
import atexit, fnmatch, glob, re, sys
# pysvn must be install... | npapier/sbf | src/sbfSubversion.py | Python | gpl-3.0 | 63,047 |
#!/usr/bin/env python
import vtk
def main():
InputFilename = get_program_parameters()
colors = vtk.vtkNamedColors()
# vtkSLCReader to read.
reader = vtk.vtkSLCReader()
reader.SetFileName(InputFilename)
reader.Update()
# Create a mapper.
mapper = vtk.vtkPolyDataMapper()
mapper.S... | lorensen/VTKExamples | src/Python/IO/ReadSLC.py | Python | apache-2.0 | 2,369 |
# Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a boolean
def isSymmetric(self, root):
if root is None:
return True
... | JiaminXuan/leetcode-python | symmetric_tree/solution.py | Python | bsd-2-clause | 891 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pordb_darstellerneu.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.... | hwmay/pordb3 | pordb_darstellerneu.py | Python | gpl-3.0 | 10,416 |
import _plotly_utils.basevalidators
class ZerolinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="zerolinecolor", parent_name="layout.scene.xaxis", **kwargs
):
super(ZerolinecolorValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/layout/scene/xaxis/_zerolinecolor.py | Python | mit | 484 |
from banco import *
itens = ["Esfiha", "Coxinha", "Pastel", "Pão de Queijo"]
preços = [1.50, 2.20, 1.80, 1.20]
rodando = True
while rodando:
opção = 1
for escolha in itens:
print(str(opção) + ". " + escolha)
opção = opção + 1
print(str(opção) + ". Finalizar")
escolha = int(... | renebentes/Python4Zumbis | Materiais/Modulos/registra_preЗo_tarde_noite_com_mвdulo.py | Python | mit | 620 |
# Copyright 2012 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | stefan-caraiman/cloudbase-init | cloudbaseinit/shell.py | Python | apache-2.0 | 1,433 |
"""
Tests METADATA features.
<http://ircv3.net/specs/core/metadata-3.2.html>
"""
from irctest import cases
class MetadataTestCase(cases.BaseServerTestCase):
valid_metadata_keys = {"valid_key1", "valid_key2"}
invalid_metadata_keys = {"invalid_key1", "invalid_key2"}
@cases.mark_specifications("IRCv3", dep... | ProgVal/irctest | irctest/server_tests/metadata.py | Python | mit | 9,485 |
#!/usr/bin/env python
import os
import sys
fn_read_keys = None
dn_sstable_keys = None
read_keys = []
key_sstgen = {}
def LoadReadKeys():
global read_keys
print "loading read keys from %s ..." % fn_read_keys
with open(fn_read_keys) as fo:
for line in fo.readlines():
read_keys.append(line.strip().lower())
... | hobinyoon/apache-cassandra-2.2.3-src | mtdb/misc/count-sstable-reads/count-sstable-reads.py | Python | apache-2.0 | 2,467 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_items_operations.py | Python | mit | 17,083 |
"""This module contains the Step class."""
from server.models.db import db
class Step(db.Model):
"""SQLAlchemy model definition for the event class."""
__tablename__ = 'steps'
id = db.Column(db.Integer, primary_key=True)
number = db.Column(db.Integer)
title = db.Column(db.Text)
description =... | Synergize-Southwest-Detroit/api | server/models/step.py | Python | mit | 371 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
# Copyright (c) 2011-2013 by Appcelerator, Inc. All Rights Reserved.
# Licensed under the terms of the Apache Public License
# Please see the LICENSE included with this distribution for details.
#
# Android Application Script
#
import os, s... | gianina-ingenuity/titanium-branch-deep-linking | testbed/x/mobilesdk/osx/5.5.1.GA/android/android.py | Python | mit | 15,397 |
import os
from setuptools import setup
__version__ = None
exec(open("ripe/atlas/sagan/version.py").read())
name = "ripe.atlas.sagan"
install_requires = [
"python-dateutil",
"pytz",
]
tests_require = ["nose"]
# pyOpenSSL support is flaky on some systems (I'm looking at you Apple)
if "SAGAN_WITHOUT_SSL" not i... | danielquinn/ripe.atlas.sagan | setup.py | Python | gpl-3.0 | 2,387 |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import hashlib
from base64 import b64encode
from unittest.mock import MagicMock
import pytest
from authli... | indico/indico | indico/core/oauth/oauth2_test.py | Python | mit | 24,123 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 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.or... | hagleitn/Openstack-Devstack2 | devstack/image/uploader.py | Python | apache-2.0 | 12,646 |
# Copyright (c) Mathias Kaerlev 2012.
# This file is part of Anaconda.
# Anaconda 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.
# ... | joaormatos/anaconda | mmfparser/data/chunkloaders/extdata.py | Python | gpl-3.0 | 1,201 |
from __future__ import unicode_literals
import os
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from django.utils.safestring import mark_safe
from d... | 1tush/reviewboard | reviewboard/reviews/models/screenshot.py | Python | mit | 3,417 |
import hashlib
import re
import os
from six import binary_type
from six.moves.urllib.parse import urljoin
from fnmatch import fnmatch
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
import html5lib
from . import XMLParser
from .item import Stub, Man... | canaltinova/servo | tests/wpt/web-platform-tests/tools/manifest/sourcefile.py | Python | mpl-2.0 | 22,025 |
"""Some simple symmetric array classes
This module defines two symmetric array classes, SymmetricArray (NxN) and SymmetricArray3d (NxNxN),
which are meant to be used in place of numpy arrays where the arrays they
represent have symmetric elements (i.e. they have the same value in array). These
symmetric arrays class... | blakeaw/Python-Symmetric-Arrays | SymmetricArray.py | Python | mit | 25,281 |
#!/usr/bin/env python3.4
"""Untyped Lambda Calculus"""
# "Understanding Computation: Impossible Code and the Meaning of Programs"
# Chapter 6.1 's Code. Use Python3.
# Authors: Chai Fei
# Python中没有类似Ruby的proc功能的函数,只能直接用lambda来实现
# 6.1.3 实现数字
ZERO = lambda p: lambda x: x
ONE = lambda p: lambda x: p(x)
TWO = lambda p... | cforth/toys | LambdaCalculus/lambda6.1.py | Python | gpl-2.0 | 8,198 |
# -*- coding: utf-8 -*-
import django_filters
from seafood.models import Fish
class FishFilter(django_filters.FilterSet):
class Meta:
model = Fish
fields = ['xreflsid']
order_by = ['xreflsid']
| hdzierz/Kaka | web/filters.py | Python | gpl-2.0 | 224 |
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
from decimal import Decimal
from amaascore.core.amaas_model import AMaaSModel
class Position(AMaaSModel):
def __init__(self, asset_manager_id, book_id, account_id, accounting_type,
asset_id, quan... | amaas-fintech/amaas-core-sdk-python | amaascore/transactions/position.py | Python | apache-2.0 | 1,405 |
"""
Support for Canary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.canary/
"""
from homeassistant.components.canary import DATA_CANARY
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
from h... | HydrelioxGitHub/home-assistant | homeassistant/components/sensor/canary.py | Python | apache-2.0 | 4,418 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/tom/Work/Eric4/BioPARKIN/src/aboutdialog.ui'
#
# Created: Mon Sep 9 14:28:40 2013
# by: pyside-uic 0.2.13 running on PySide 1.1.0
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class U... | CSB-at-ZIB/BioPARKIN | src/Ui_aboutdialog.py | Python | lgpl-3.0 | 7,329 |
# Copyright 2020 the gRPC authors.
#
# 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 wri... | grpc/grpc-ios | native_src/bazel/test/python_test_repo/namespaced/upper/example/import_no_strip_test.py | Python | apache-2.0 | 1,266 |
from __future__ import unicode_literals
import hashlib
from django import forms
NO_MORE_CONFIRMATION = 0
NEW = 1
ACCEPTED = 2
REJECTED = 3
CANCELED = 4
STATUS_CHOICES = map(lambda c: (c, c), (
NO_MORE_CONFIRMATION,
NEW,
ACCEPTED,
REJECTED,
CANCELED
))
class ProcessPaymentForm(forms.Form):
... | illing2005/django-payments | payments/dotpay/forms.py | Python | bsd-3-clause | 2,368 |
############################################################################
#
# (C) Copyright 2011 The OpenSAF Foundation
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. This file... | helioloureiro/opensaf-fork | python/pyosaf/saLck.py | Python | lgpl-2.1 | 6,894 |
#
# node.py
# Common code for configurable objects--interfaces and notify-ees
#
class Node(object):
# Add second-level configuration to an item (most likely
# a "notify" section).
def config2(self, cfg, legal):
# Put in default None for each config value possible
for ivar in legal:
setattr(self, i... | vandys/tis | server/node.py | Python | unlicense | 901 |
#!/usr/bin/env python3
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contrac... | CSD-Public/stonix | src/tests/rules/unit_tests/zzzTestRuleDisableSIRIandContinuityFeatures.py | Python | gpl-2.0 | 4,453 |
"""gazette_files
Revision ID: 1986f3e16316
Revises: 4c8a62ba844a
Create Date: 2015-03-18 09:05:57.232651
"""
# revision identifiers, used by Alembic.
revision = '1986f3e16316'
down_revision = '4c8a62ba844a'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
##... | Code4SA/pmg-cms-2 | migrations/versions/1986f3e16316_gazette_files.py | Python | apache-2.0 | 1,527 |
# Copyright 2009-2011, Peter A. Bigot
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain a
# copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | jonfoster/pyxb1 | pyxb/binding/content.py | Python | apache-2.0 | 55,713 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 6 21:41:09 2011
@author: steven
"""
# project euler problem ID 3
# The prime factors of 13195 are 5, 7, 13 and 29.
# What is the largest prime factor of the number 600851475143 ?
# http://basildoncoder.com/blog/2008/04/07/project-euler-problem-3/
def primeFactors(n, fa... | epequeno/project-euler | id03.py | Python | gpl-3.0 | 618 |
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_l10n_es_aeat_mod349
| factorlibre/l10n-spain | l10n_es_aeat_mod349/tests/__init__.py | Python | agpl-3.0 | 105 |
import OpenGL
OpenGL.USE_ACCELERATOR = True
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import numpy as np
from time import time
light_diffuse_values = np.array([[0.0, 0.0, 1.0, 1.0]])
light_ambient_values = np.array([[0.0, 0.0, 1.0, 1.0]])
light_positions = np.array([[1.0, 1.0, 1.0, 0.0... | vluzko/test | python/old/pyopengl/Test.py | Python | mit | 1,729 |
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# Copyright 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import Tr... | factorlibre/stock-logistics-warehouse | stock_available_unreserved/tests/test_stock_available_unreserved.py | Python | agpl-3.0 | 5,162 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from acefind_exe.boot.arg_reader import CmdArgReader
| lowZoom/acefind | test/tests/boot/__init__.py | Python | apache-2.0 | 143 |
#coding:utf-8
from django.contrib.sitemaps import Sitemap
from blog.models import Post
class PostSitemap(Sitemap):
changefreq = "weekly"
priority = 0.2
print '&'*90
def items(self):
return Post.objects.filter(status=0)
def lastmod(self, obj):
return obj.update_time
def loca... | btyh17mxy/django-blog | sitemap.py | Python | gpl-3.0 | 375 |
#!/usr/bin/env python3
# ---------------------------------------------------------------------
# ------------------------- Plight Rising -----------------------------
# -----------------------------txtsd-----------------------------------
# ---------------------------------------------------------------------
"""Runs ... | txtsd/Plight-Rising | gatherbond_client.py | Python | gpl-3.0 | 2,661 |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Red Hat, Inc.
# This file is part of the Infinity Note Compiler.
#
# The Infinity Note Compiler 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
... | gbenson/i8c | tests/test_parse_wordsize.py | Python | lgpl-2.1 | 2,348 |
import gc
class QuerySetIterator(object):
def __init__(self, queryset):
self.__queryset = queryset
def queryset_iterator(self, chunksize=1000):
'''
Iterate over a Django Queryset ordered by the primary key
This method loads a maximum of chunksize (default: 1000) rows in it's... | Raul-diffindo/Django-Matcher | matcher/queryset_iterator.py | Python | mit | 896 |
from setuptools import setup, find_packages
import numpy
import os
import subprocess
# http://stackoverflow.com/questions/4505747/how-should-i-structure-a-python-package-that-contains-cython-code
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k i... | chiffa/Colonyzer | setup.py | Python | gpl-3.0 | 2,175 |
from .simpledataset import SimpleDataset
__all__ = ['simpledataset']
| get9/ml-test | simpleml/containers/__init__.py | Python | apache-2.0 | 70 |
#!/usr/bin/env python
import sys
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Prevent .pyc files being created.
# Stops the vtk source being polluted
# by .pyc files.
sys.dont_write_bytecode = True
import backdrop
# Contour every quadratic cell t... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Common/DataModel/Testing/Python/LineIntersectQuadraticCells.py | Python | gpl-3.0 | 17,068 |
"""Skeleton for 'math' stdlib module."""
import sys
import math
def ceil(x):
"""Return the ceiling of x as a float, the smallest integer value greater
than or equal to x.
:type x: numbers.Real
:rtype: float
"""
return 0.0
if sys.version_info >= (2, 6):
def copysign(x, y):
"""R... | asedunov/intellij-community | python/helpers/python-skeletons/math.py | Python | apache-2.0 | 6,499 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | dhermes/gcloud-python | vision/google/cloud/vision_v1p2beta1/gapic/enums.py | Python | apache-2.0 | 8,578 |
from django.views.generic import View
import logging
from braces.views import CsrfExemptMixin, JsonRequestResponseMixin
from .models import Article
logger = logging.getLogger('django.request')
class OmniArticlesView(CsrfExemptMixin, JsonRequestResponseMixin, View):
http_method_names = ['post']
require_json... | archie/hackaway | hackaway/hackaway/article/views.py | Python | mit | 1,379 |
from messagebird.base import Base
from messagebird.base_list import BaseList
class CustomDetails(Base):
def __init__(self):
self.custom1 = None
self.custom2 = None
self.custom3 = None
self.custom4 = None
class GroupReference(Base):
def __init__(self):
self.href = No... | messagebird/python-rest-api | messagebird/contact.py | Python | bsd-2-clause | 1,959 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2018 KuraLabs S.R.L
#
# 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 appl... | kuralabs/flowbber | lib/flowbber/plugins/sources/valgrind/memcheck.py | Python | apache-2.0 | 4,889 |
# (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... | shlomozippel/ansible | lib/ansible/runner/action_plugins/async.py | Python | gpl-3.0 | 1,565 |
from socket import socket, AF_PACKET, SOCK_RAW
from impacket import ImpactPacket
from impacket import ImpactDecoder
from impacket.ImpactPacket import TCPOption
from time import sleep
import random
#
def randomMAC():
mac = (
random.randint(0x00, 0xff),
random.randint(0x00, 0xff),
random.ra... | TheArbiter/Networks | lab5/lab5exercise2/attack.py | Python | gpl-3.0 | 930 |
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import json
import os
import re
import time
import urllib2
from common import utils
_THIS_DIR = os.path.abspath(os.path.dirname(__file__... | guorendong/iridium-browser-ubuntu | tools/findit/chromium_deps.py | Python | bsd-3-clause | 7,796 |
from unittest.mock import ANY, Mock
import pytest
from flask import make_response, url_for
from requests import RequestException
from app.formatters import normalize_spaces
from app.s3_client.s3_letter_upload_client import (
LetterMetadata,
LetterNotFoundError,
)
from tests.conftest import SERVICE_ONE_ID
de... | alphagov/notifications-admin | tests/app/main/views/uploads/test_upload_letter.py | Python | mit | 26,059 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
def solve_it(input_data):
# return a positive integer, as a string
return '10'
if __name__ == '__main__':
print('This script submits the integer: %s\n' % solve_it(''))
| kastnerkyle/discrete-opt | week1/solver.py | Python | bsd-3-clause | 225 |
from livesettings import config_value
from satchmo_utils import load_module
import decimal
TWOPLACES = decimal.Decimal('0.01')
def get_tax_processor(order=None, user=None):
modulename = config_value('TAX', 'MODULE')
mod = load_module(u'%s.processor' % modulename)
return mod.Processor(order=order, user=use... | jordotech/sherri_satchmo | satchmo/apps/tax/utils.py | Python | bsd-3-clause | 398 |
# -*- coding: utf-8 -*-
# Copyright 2010 Google Inc. All Rights Reserved.
#
# 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 to u... | catapult-project/catapult | third_party/gsutil/gslib/tests/test_wildcard_iterator.py | Python | bsd-3-clause | 21,560 |
from scipy.interpolate import RectBivariateSpline as rbs
from itertools import islice
import numpy as np
class eos:
def __init__(self, path_to_data=None):
if not path_to_data:
import os
path_to_data = os.environ['ongp_data_path']
npts_t = 121
npts_t -= 60 # skip lo... | chkvch/on_GP | v1/chabrier.py | Python | gpl-2.0 | 9,776 |
import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="z", parent_name="layout.scene.camera.eye", **kwargs
):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | plotly/python-api | packages/python/plotly/plotly/validators/layout/scene/camera/eye/_z.py | Python | mit | 455 |
# python
# This file is generated by a program (mib2py).
import HPR_IP_MIB
OIDMAP = {
'1.3.6.1.2.1.34.6.1.5': HPR_IP_MIB.hprIp,
'1.3.6.1.2.1.34.6.1.5.1.1.1': HPR_IP_MIB.hprIpActiveLsLsName,
'1.3.6.1.2.1.34.6.1.5.1.1.2': HPR_IP_MIB.hprIpActiveLsAppnTrafficType,
'1.3.6.1.2.1.34.6.1.5.1.1.3': HPR_IP_MIB.hprIpActiveLsUd... | xiangke/pycopia | mibs/pycopia/mibs/HPR_IP_MIB_OID.py | Python | lgpl-2.1 | 1,140 |
#!/usr/bin/python
import unittest, os, shutil, logging
import common
from virttest import xml_utils, virsh, utils_misc, data_dir
from autotest.client import utils
from autotest.client.shared import error
from virttest.libvirt_xml import accessors, vm_xml, xcepts, network_xml, base
from virttest.libvirt_xml import node... | sathnaga/virt-test | virttest/libvirt_xml_unittest.py | Python | gpl-2.0 | 27,403 |
"""
Test cases for the template loaders
Note: This test requires setuptools!
"""
from django.conf import settings
if __name__ == '__main__':
settings.configure()
import sys
import pkg_resources
import imp
import os.path
from django.template import TemplateDoesNotExist, Context
from django.template.loaders.eggs... | openhatch/new-mini-tasks | vendor/packages/Django/tests/regressiontests/templates/loaders.py | Python | apache-2.0 | 5,627 |
# Twisted Imports
from twisted.internet import reactor, task, defer
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
from twisted.python import log, failure
# System Imports
from collections import deque
from time import time as now
from math import floor
import logging
#... | richardingham/octopus | octopus/protocol/gsioc.py | Python | mit | 19,427 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import os, subprocess, glob
base = os.path.dirname(os.path.abspath(__file__))
os.chdir(base)
repl_dir = os.path.join(base, 'rapydscript', 'repl')
rapyd_path = os.path.join(os.path.dirname(base), 'rap... | kovidgoyal/kovidgoyal.github.io | update-rapyd-repl.py | Python | gpl-3.0 | 724 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
import os
import sys
sys.path.insert(0, os.path.abspath('../tools'))
sys.path.insert(0, os.path.abspath(... | aldebaran/qibuild | doc/source/conf.in.py | Python | bsd-3-clause | 1,300 |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'musiclibrary.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(... | netomo/musiclibrary | musiclibrary/urls.py | Python | gpl-2.0 | 509 |
from codepage import (
OrdinalLookup, Codepage, rCommand, InCodepage, ReverseLookup
)
from string import ascii_lowercase, ascii_uppercase, digits
import re
import lzma
try:
import brotli
except:
print("Please install the 'brotli' module: 'sudo -H pip3 install brotli'")
__import__("sys").exit()
symbols ... | somebody1234/Charcoal | compression.py | Python | mit | 13,507 |
#!/usr/bin/env python
import re
import sys
import SELinuxNeverallowTestFrame
usage = "Usage: ./gen_SELinux_CTS_neverallows.py <input policy file> <output cts java source>"
# extract_neverallow_rules - takes an intermediate policy file and pulls out the
# neverallow rules by taking all of the non-commented text betwe... | wiki2014/Learning-Summary | alps/cts/tools/selinux/SELinuxNeverallowTestGen.py | Python | gpl-3.0 | 2,066 |
import common
def display_settings():
common.addon.show_settings()
display_settings()
| noba3/KoTos | addons/plugin.video.KinoLeak/resources/meta.py | Python | gpl-2.0 | 95 |
# -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.multi
def _compute_student_course(self):
course_obj = self.env[... | alfredoavanzosc/odoo-addons | partner_student_course/models/partner.py | Python | agpl-3.0 | 1,523 |
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: UHD FFT Qt
# Author: Johannes Demel
# Generated: Wed Jan 29 13:51:16 2014
##################################################
from PyQt4 import Qt
from gnuradio import eng_notation
from gnuradio import gr
from... | jdemel/gr-misc | examples/uhd_fft_qt.py | Python | gpl-3.0 | 16,000 |
""" HTTP-related entities. """
from rest_framework.status import HTTP_200_OK, HTTP_500_INTERNAL_SERVER_ERROR
from common.djangoapps.util.json_request import JsonResponse
class DetailResponse(JsonResponse):
""" JSON response that simply contains a detail field. """
def __init__(self, message, status=HTTP_2... | eduNEXT/edx-platform | lms/djangoapps/commerce/http.py | Python | agpl-3.0 | 843 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Pradeep Jairamani , github.com/pradeepjairamani
import socket
import socks
import time
import json
import threading
import string
import random
import sys
import struct
import re
import os
from OpenSSL import crypto
import ssl
from core.alert import *
from core.t... | viraintel/OWASP-Nettacker | lib/vuln/ProFTPd_bypass_sqli_protection/engine.py | Python | apache-2.0 | 7,617 |
"""
:mod:`zsl.resource.model_resource` -- REST for a DB model.
----------------------------------------------------------
Resources provide a way how to directly access DB tables (raw models) and
perform CRUD operations upon them. The default classes of the models should be
overridden to provide more logic or restrict... | AtteqCom/zsl | src/zsl/resource/model_resource.py | Python | mit | 19,715 |
from pytest import fixture
from stubilous.config import Config
@fixture
def config_file():
return """
---
server:
port: 80
host: localhost
routes:
- desc: A test route
method: GET
path: /test
body: Hello!
status: 200
- desc: Advanced route
method: GET
... | CodersOfTheNight/stubilous | tests/test_config.py | Python | mit | 1,054 |
r"""Tool to validate all submission and copy them to proper location.
Usage:
python validate_and_copy_submissions.py \
--source_dir=SOURCE \
--target_dir=TARGET \
[--containers_file=CONTAINER_FILE] \
[--log_file=LOG_FILE] \
[--nouse_gpu] \
[--nocopy]
Where:
SOURCE - Google Cloud Storage di... | carlini/cleverhans | examples/nips17_adversarial_competition/eval_infra/validation_tool/validate_and_copy_submissions.py | Python | mit | 10,468 |
from django.conf.urls import *
from scanning.views import PendingScans, Scans, Documents, ScanSplits, ScanCodes
scan_id = '(?P<scan_id>\d+)'
user_id = '(?P<user_id>\d+)'
document_id = '(?P<document_id>\d+)'
urlpatterns = patterns('scanning.views',
(r'^pendingscans.json(/(?P<obj_id>\d+))?$', PendingScans... | yourcelf/btb | scanblog/scanning/urls.py | Python | agpl-3.0 | 1,705 |
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo.tests.common import SavepointCase
class TestSaleDescription(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner_1 = cls.env.ref("base.res_partner_1")
... | OCA/account-invoicing | account_move_line_accounting_description_sale/tests/test_sale_description.py | Python | agpl-3.0 | 3,996 |
from direct.directnotify import DirectNotifyGlobal
import random
MAX_PLAYERS_PER_HOLE = 4
GOLF_BALL_RADIUS = 0.25
GOLF_BALL_VOLUME = 4.0 / 3.0 * 3.14159 * GOLF_BALL_RADIUS ** 3
GOLF_BALL_MASS = 0.5
GOLF_BALL_DENSITY = GOLF_BALL_MASS / GOLF_BALL_VOLUME
GRASS_SURFACE = 0
BALL_SURFACE = 1
HARD_SURFACE = 2
HOLE_SURFACE = 3... | ToontownUprising/src | toontown/golf/GolfGlobals.py | Python | mit | 12,858 |
import os
from samantha import app, config
import samantha.views
if __name__ == "__main__":
app.run(
host=config.get('FLASK_HOST'),
debug=config.get('FLASK_IS_DEBUG')
)
| mvcs-guide/python-mvcs | run.py | Python | mit | 196 |
# -*- coding: utf-8 -*-
u"""
This script is to parse SRW Python scripts and to produce JSON-file with the parsed data.
It's highly dependent on the external Sirepo/SRW libraries and is written to allow parsing of the .py files using
SRW objects.
:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.
:lice... | mkeilman/sirepo | sirepo/template/srw_importer.py | Python | apache-2.0 | 29,795 |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it unde... | numenta/nupic.research | projects/whydense/cifar/cifar_tune.py | Python | agpl-3.0 | 9,256 |
# -*- 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 model 'ImageChartTestCaseAttribute'
db.create_table('dashboard_app_imagecharttestcaseattribute', (
... | OSSystems/lava-server | dashboard_app/migrations/0043_auto__add_imagecharttestattribute__add_imagecharttestcaseattribute.py | Python | agpl-3.0 | 28,510 |
"""
Tests for the BTrees.
"""
import logging
import unittest
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
from . import BTree, MultiBTree, MultiBTree2
import internal
class BTreeTestBase(unittest.TestCase):
def setUp(sel... | firi/appengine-btree | btree/btree_test.py | Python | mit | 26,756 |
#
# Copyright (c) 2001 - 2016 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 limitation the rights to use, copy, modify, merge... | EmanueleCannizzaro/scons | timings/JTimer/TimeSCons-run.py | Python | mit | 2,607 |
#
# Solution to Project Euler problem 425
# Philippe Legault
#
# https://github.com/Bathlamos/Project-Euler-Solutions
from lib import primes_up_to
import heapq
# Use Dijkstra's algorithm to identify
# the path with smallest maximum number,
# based on the undirected graph of connected
# primes
def compute():
limit... | Bathlamos/Project-Euler-Solutions | solutions/p425.py | Python | mit | 1,249 |
#!/usr/bin/env python
# DummyMP - Multiprocessing Library for Dummies!
# Copyright 2014 Albert Huang.
#
# 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/LI... | josegonzalez/dummymp | dummymp/process.py | Python | apache-2.0 | 3,944 |
# -*- encoding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014-2015 Haltu Oy, http://haltu.fi
#
# 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 witho... | educloudalliance/eca-auth-data | project/wsgi.py | Python | mit | 1,620 |
import json
class MapReduce:
def __init__(self):
self.intermediate = {}
self.result = []
def emit_intermediate(self, key, value):
self.intermediate.setdefault(key, [])
self.intermediate[key].append(value)
def emit(self, value):
self.result.append(value)
def e... | iluoyi/data-science-coursera | src/assignment3/MapReduce.py | Python | apache-2.0 | 693 |
# ROOTaaS sample configuration file for nbconvert
c = get_config()
# Custom C++ highlighter
c.Exporter.preprocessors = [ 'ROOTaaS.html.export.cpphighlighter.CppHighlighter' ]
# Custom Jinja template
c.HTMLExporter.template_path = [ '/path/to/ROOTaaS/html/static/templates' ]
| dpiparo/ROOTaaS | config/nbconvert/sample_config.py | Python | lgpl-3.0 | 279 |
#!/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... | noroutine/ansible | lib/ansible/modules/network/panos/panos_security_policy.py | Python | gpl-3.0 | 17,532 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.