code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""Document management blueprint."""
from __future__ import annotations
from flask import g
from abilian.i18n import _l
from abilian.sbe.apps.communities.blueprint import Blueprint
from abilian.sbe.apps.communities.security import is_manager
from abilian.sbe.apps.documents.actions import register_actions
from abilian... | abilian/abilian-sbe | src/abilian/sbe/apps/documents/views/views.py | Python | lgpl-2.1 | 926 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
import re
import shutil
import llnl.util.tty as tty
import llnl.util.lang
import spack.compiler
import spac... | rspavel/spack | lib/spack/spack/compilers/apple_clang.py | Python | lgpl-2.1 | 7,173 |
# Copyright (C) Collabora Limited 2017,2019
# Author: Guillaume Tucker <guillaume.tucker@collabora.com>
# Author: dcz-collabora <dorota.czaplejewicz@collabora.co.uk>
#
# Copyright (C) Linaro Limited 2015,2016,2017,2018,2019
# Author: Matt Hart <matthew.hart@linaro.org>
# Author: Milo Casagrande <milo.casagrande@linaro.... | kernelci/kernelci-backend | app/utils/build/__init__.py | Python | lgpl-2.1 | 12,705 |
# coding: utf-8
# Copyright (C) 2014 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
# Copyright (C) 2015 by Markus Rosjat <markus.rosjat@gmail.com>
# SPDX-FileCopyrightText: 2014 The python-scsi Authors
#
# SPDX-License-Identifier: LGPL-2.1-or-later
import unittest
from pyscsi.pyscsi import scsi_enum_inquiry as INQUI... | rosjat/python-scsi | tests/test_unmarshall_inquiry.py | Python | lgpl-2.1 | 11,441 |
# -*- coding: utf-8 -*-
"""
irc/server.py
Copyright © 2009 Ferry Boender
Copyright © 2012 Jason R. Coombs
This server has basic support for:
* Connecting
* Channels
* Nicknames
* Public/private messages
It is MISSING support for notably:
* Server linking
* Modes (user and channel)
* Proper error reporting
* Basic... | sim0629/irc | irc/server.py | Python | lgpl-2.1 | 17,734 |
########################################################################
#
# University of Southampton IT Innovation Centre, 2011
#
# Copyright in this library belongs to the University of Southampton
# University Road, Highfield, Southampton, UK, SO17 1BJ
#
# This software may not be used, sold, licensed, transferred,... | mmcardle/MServe | django-mserve/jobservice/tasks.py | Python | lgpl-2.1 | 4,498 |
#!/usr/bin/env python
"""
setup.py file for augeas
"""
import os
prefix = os.environ.get("prefix", "/usr")
from distutils.core import setup
setup (name = 'python-augeas',
version = '0.3.0',
author = "Harald Hoyer",
author_email = "augeas-devel@redhat.com",
description = """Python bi... | giraldeau/python-augeas | setup.py | Python | lgpl-2.1 | 420 |
# -*- python -*-
# Copyright (C) 2009-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 later versio... | toddtreece/esp8266-Arduino | tools/macosx/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/libstdc++.a-gdb.py | Python | lgpl-2.1 | 2,463 |
from configparser import RawConfigParser
import os
import re
from subprocess import call, check_call, Popen, PIPE, STDOUT
import sys
from errors import Errors
from general import (
exists_and_is_directory, shellquote, print_stderr
)
from githelpers import has_objects_and_refs
class OptionFrom:
'''enum-like va... | mhl/gib | gitsetup.py | Python | lgpl-2.1 | 10,749 |
#!/usr/bin/python3
#
# examples/xfixes-selection-notify.py -- demonstrate the XFIXES extension
# SelectionNotify event.
#
# Copyright (C) 2019
# Tony Crisci <tony@dubstepdish.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public Licen... | python-xlib/python-xlib | examples/xfixes-selection-notify.py | Python | lgpl-2.1 | 2,764 |
from sys import argv
import logging
from MonkeyScraper import MonkeyScraper
LOG_FILENAME = 'MonkeyScraper.log'
logging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG)
def main(username, password, survey_url):
"""
Creates a MonkeyScraper, logs in, and scrapes the survey at the provided url
:param ... | cacampbell/MonkeyScraper | monkey_scraper.py | Python | lgpl-3.0 | 850 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test suite for language_check."""
from __future__ import unicode_literals
import unittest
import warnings
from collections import namedtuple
import language_check
class TestLanguageTool(unittest.TestCase):
CheckTest = namedtuple('CheckTest', ('text', 'matches'))... | myint/language-check | test.py | Python | lgpl-3.0 | 5,483 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Web Editor Utils
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Le... | muk-it/muk_web | muk_web_editor_utils/__init__.py | Python | lgpl-3.0 | 979 |
# -*- coding: utf-8 -*-
# 2016-10-20T16:00+08:00
import fnmatch
import glob
import itertools
import os
import re
import subprocess
import sys
import fileutil
# Match version numbers of these formats:
# 1.2.3
# 1.2.3.4
version_number_re = r'([0-9]+(?:.[0-9]+){2,3})'
# Match version numbers of this format:
incompl... | myd7349/Ongoing-Study | python/SetPEVersion.py | Python | lgpl-3.0 | 6,242 |
import sys
import os
default_variant = 'PySide'
env_api = os.environ.get('QT_API', 'pyqt')
if '--pyside' in sys.argv:
variant = 'PySide'
elif '--pyqt4' in sys.argv:
variant = 'PyQt4'
elif env_api == 'pyside':
variant = 'PySide'
elif env_api == 'pyqt':
variant = 'PyQt4'
else:
variant = default_vari... | s910324/Sloth | Untitled Folder/QtVariant.py | Python | lgpl-3.0 | 1,292 |
import _metagam3d
from _metagam3d import AxisAlignment, AlignmentType
from metagam3d.channels import blocking
from metagam3d.scripts import m3d_expr
from concurrence import Tasklet
class LoadError(Exception):
pass
class Object(_metagam3d.Object):
def __init__(self, objid):
_metagam3d.Object.__init__(s... | JoyTeam/metagam3d | python/metagam3d/objects.py | Python | lgpl-3.0 | 3,360 |
#
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import (Coefficient, TestFunction, TrialFunction, VectorElement, dot,
dx, grad, triangle)
element = VectorElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
w = Coefficient(element)
a = dot(dot(w, grad(u... | FEniCS/ufl | demo/ExplicitConvection.py | Python | lgpl-3.0 | 332 |
#!/usr/bin/python
import sys, signal, logging, time, RPi.GPIO as GPIO
FLOATSW_HIGH_WL = 26 # high water level float switch
WATER_VALVE = 10 # GPIO port for the Water Electo valve, High by default after boot
VALVE_CHGSTATE_TIMER = 25 ... | aquamonitor/Aquamonitor | rodi.py | Python | lgpl-3.0 | 4,109 |
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# This file is part of the E-Cell System
#
# Copyright (C) 1996-2016 Keio University
# Copyright (C) 2008-2016 RIKEN
# Copyright (C) 2005-2009 The Molecular Sciences Institute
#
#:::::::::::::::::::::::::::::::::::::::... | ecell/ecell3 | ecell/frontend/model-editor/ecell/ui/model_editor/ComplexLine.py | Python | lgpl-3.0 | 13,350 |
#!/usr/bin/env python
# Copyright (C) 2011-2014 Swift Navigation Inc.
# Contact: Fergus Noble <fergus@swiftnav.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"... | fnoble/libsbp | python/sbp/__init__.py | Python | lgpl-3.0 | 4,591 |
#Initialisation
from time import sleep
from NaoCommunication import *
nao=NaoControle(Nao())
# 1 - Decrire le resultat de ce morceau de code
# ...
for a in range(16):
if a%2==0:
nao.reglerCouleur(a,a*15,50,50)
else :
nao.reglerCouleur(a,255,0,0)
sleep(0.1)
for a in range(15,-1,-1):
nao.eteind... | AdrienVR/NaoSimulator | TPINFO/Partie3/exercice1.py | Python | lgpl-3.0 | 659 |
#!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Ian Horn <ian@swiftnav.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" WITHOUT WAR... | imh/gnss-analysis | gnss_analysis/agg_run.py | Python | lgpl-3.0 | 2,348 |
#!/usr/bin/env python3
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab :
# kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-... | DevynCJohnson/Pybooster | pylib/neuralnet.py | Python | lgpl-3.0 | 13,720 |
'''
Created on 05.11.2013
@author: gena
'''
from __future__ import print_function
from PyQt4 import QtCore
from escore.plate import Plate
from escore.approximations import indexByName
class PlateRecord(object):
def __init__(self, plate, name,path):
self.plate=plate
self.name=name
self.pat... | GennadiyZakharov/elisasolver | src/escore/platemanager.py | Python | lgpl-3.0 | 4,677 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#
"""\
# Modifies the pydoc contained in Python to use the member function filelink
# for filelink generation, so it can be later overridden.
# See also http://bugs.python.org/issue902061
"""
#
# Copyright (C) 2009 Rene Liebscher
#
# This program is free software; you... | arruda/pyfuzzy | doc/mypydoc.py | Python | lgpl-3.0 | 7,131 |
# -*- coding: utf-8 -*-
from django.contrib.sites.models import Site
from django.conf import settings
def get_site_url(request, slash=False):
domain = Site.objects.get_current().domain
protocol = 'https' if request.is_secure() else 'http'
root = "%s://%s" % (protocol, domain)
if slash:
root +=... | noirbizarre/django-absolute | absolute/context_processors.py | Python | lgpl-3.0 | 703 |
#!/usr/bin/env python
# Copyright (c) 2014 CNRS
# Author: Steve Tonneau
#
# This file is part of hpp-rbprm-corba.
# hpp-rbprm-corba is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of ... | rlefevre1/hpp-rbprm-corba | src/hpp/corbaserver/rbprm/rbprmbuilder.py | Python | lgpl-3.0 | 12,303 |
import os
import numpy as np
import flopy
ml = flopy.modflow.Modflow.load('l2a_2k.nam', version='mf2005', verbose=True)
delx = ml.dis.delr.array
dely = ml.dis.delc.array
# get data from the lst file
f = open('l2a_2k.lst', 'r')
for line in f:
if 'LAYER # ROW # COLUMN # LAKE # INTERFACE TYPE LAKEBED LEA... | jdhughes-usgs/river-eel | examples/mf6/test045_lake2tr_dev/mf2005/mf6lakeconn.py | Python | lgpl-3.0 | 3,316 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.problems.base import NonlinearProblem
from rbnics.problems.elliptic import EllipticProblem
from rbnics.backends import product, sum, transpose
NonlinearEllipticProblem_Base = Non... | mathLab/RBniCS | rbnics/problems/nonlinear_elliptic/nonlinear_elliptic_problem.py | Python | lgpl-3.0 | 1,932 |
from __future__ import division
from __future__ import print_function
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageEnhance
import nwcsaf
import numpy as np
from satpy import Scene, find_files_and_readers
from datetime import datetime, timedelta
from copy import deepc... | meteoswiss-mdr/monti-pytroll | scripts/demo_satpy_fog.py | Python | lgpl-3.0 | 13,803 |
# IfcOpenShell - IFC toolkit and geometry engine
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of IfcOpenShell.
#
# IfcOpenShell 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 Foundat... | IfcOpenShell/IfcOpenShell | src/ifcopenshell-python/ifcopenshell/api/profile/add_parameterized_profile.py | Python | lgpl-3.0 | 1,101 |
import tornado.testing
from testexample import ExampleApp
class TestExampleApp(tornado.testing.AsyncHTTPTestCase,
tornado.testing.LogTrapTestCase):
def get_app(self):
return ExampleApp()
def test_home(self):
response = self.fetch('/')
self.assertEqual(response.cod... | wmalinowski/test-example | testexample/test/test_example_app.py | Python | unlicense | 442 |
low_primes = {1,3,5,7,11,13}
low_primes.add(17) # It will be {1,3,5,7,11,13,17}
low_primes.update({19,23},{2,29}) # It will be {1,2,3,5,7,11,13,17,19,23,29}, sorted order
while low_primes:
print(low_primes.pop()/3) #It will pop the first one (1) out, but because it is within a whil... | joshavenue/python_notebook | notebook2/set_1.py | Python | unlicense | 366 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: utf_8.py
""" Python 'utf-8' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
impo... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/encodings/utf_8.py | Python | unlicense | 1,084 |
#!/usr/bin/env python
#encoding=utf-8
import os
try:
f = file('blah','r')
except IOError,e:
print 'could not open file:',e
def safe_float(obj):
try:
return float(obj)
except ValueError:
pass
ccfile = None
log = file('log.txt','w+')
try:
ccfile = file('card.txt','r')
txns = cc... | licongyu95/learning_python | core_python_programming/cap10/cap10.py | Python | unlicense | 487 |
"""
Copyright 2017-present Airbnb, 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 writing, sof... | airbnb/streamalert | streamalert_cli/terraform/alert_processor.py | Python | apache-2.0 | 2,636 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-22 22:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('socialnet', '0029_auto_20161121_0543'),
]
operations = [
migrations.AddFiel... | CMPUT404F16T06/CMPUT404Project | mysite/socialnet/migrations/0030_author_displayname.py | Python | apache-2.0 | 480 |
class Coordinates:
""" WhiteSource model for artifact's coordinates. """
def __init__(self, group_id, artifact_id, version_id):
self.groupId = group_id
self.artifactId = artifact_id
self.versionId = version_id
def create_project_coordinates(distribution):
""" Creates a 'Coordinat... | whitesource/python-plugin | agent/api/model/Coordinates.py | Python | apache-2.0 | 559 |
# Класс-помощник для работы с сессией
class SessionHelper:
def __init__(self, app):
self.app = app
# Функция входа на сайт
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name... | kochetov-a/python_training | fixture/session.py | Python | apache-2.0 | 2,654 |
"""This test checks that Nevergrad is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.nevergrad import NevergradSearch
def easy_objective(config, reporter):
import time
... | stephanie-wang/ray | python/ray/tune/examples/nevergrad_example.py | Python | apache-2.0 | 1,858 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cxxgtxy/tensorflow | tensorflow/python/lib/core/bfloat16_test.py | Python | apache-2.0 | 17,140 |
# Copyright 2022 The DDSP 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... | magenta/ddsp | ddsp/training/train_util.py | Python | apache-2.0 | 12,295 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jiaphuan/models | tutorials/image/cifar10/cifar10_train.py | Python | apache-2.0 | 4,491 |
# -*- coding: utf-8 -*-
"""The parsers and plugins interface classes."""
import abc
import os
from plaso.lib import errors
class BaseFileEntryFilter(object):
"""File entry filter interface."""
# pylint: disable=redundant-returns-doc
@abc.abstractmethod
def Match(self, file_entry):
"""Determines if a fi... | Onager/plaso | plaso/parsers/interface.py | Python | apache-2.0 | 8,018 |
#
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 ... | isb-cgc/ISB-CGC-Webapp | scripts/isb_auth.py | Python | apache-2.0 | 4,266 |
#!/usr/bin/env python
import rospy
from basics.msg import Complex
from random import random
rospy.init_node('message_publisher')
pub = rospy.Publisher('complex', Complex)
rate = rospy.Rate(2)
while not rospy.is_shutdown():
msg = Complex()
msg.real = random()
msg.imaginary = random()
pub.publish... | osrf/rosbook | code/basics/src/message_publisher.py | Python | apache-2.0 | 344 |
# -*- coding: utf-8 -*-
import mock
import pytest
from urlparse import urlparse
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import NodeLog
from osf.models.licenses import NodeLicense
from osf.utils.sanitize import strip_html
from osf.utils import permissions
fr... | chennan47/osf.io | api_tests/nodes/views/test_node_detail.py | Python | apache-2.0 | 75,427 |
example_template = Template({
'A': RsrcDef({}, []),
'B': RsrcDef({}, []),
'C': RsrcDef({'a': '4alpha'}, ['A', 'B']),
'D': RsrcDef({'c': GetRes('C')}, []),
'E': RsrcDef({'ca': GetAtt('C', 'a')}, []),
})
engine.create_stack('foo', example_template)
engine.noop(3)
engine.rollback_stack('foo')
engine.no... | zaneb/heat-convergence-prototype | scenarios/basic_create_rollback.py | Python | apache-2.0 | 358 |
"""
Helper classes for creating frontend metadata
"""
class ContactPersonDesc(object):
"""
Description class for a contact person
"""
def __init__(self):
self.contact_type = None
self._email_address = []
self.given_name = None
self.sur_name = None
def add_email_ad... | irtnog/SATOSA | src/satosa/metadata_creation/description.py | Python | apache-2.0 | 6,948 |
# Webhooks for external integrations.
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
fr... | SmartPeople/zulip | zerver/webhooks/crashlytics/view.py | Python | apache-2.0 | 1,910 |
# 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... | cmin764/cloudbase-init | cloudbaseinit/osutils/windows.py | Python | apache-2.0 | 42,295 |
# Copyright 2012 Kevin Ormbrek
#
# 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... | ombre42/robotframework-sudslibrary | src/SudsLibrary/factory.py | Python | apache-2.0 | 2,975 |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-datacatalog | samples/generated_samples/datacatalog_v1_generated_data_catalog_list_tags_sync.py | Python | apache-2.0 | 1,472 |
# -*- coding: utf-8 -*-
# Scrapy settings for DynamicItemsScrapy project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.or... | WilliamKinaan/ScrapyDynamicItems | DynamicItemsScrapy/DynamicItemsScrapy/settings.py | Python | apache-2.0 | 3,084 |
# Copyright 2013 NEC Corporation. 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 ... | rahulunair/nova | nova/tests/unit/test_api_validation.py | Python | apache-2.0 | 47,979 |
import unittest
import subprocess
import os
import platform
import shutil
from os.path import join, normpath, abspath, split
import sys
env_path = "/".join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1])
sys.path.insert(0, env_path)
import littlechef
# Set some convenience variables
test_path = split(no... | tobami/littlechef | tests/test_command.py | Python | apache-2.0 | 10,393 |
"""Compose ACLs on ports."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2018 The Contributors
#
# Licensed under the Apache Lic... | wackerly/faucet | faucet/valve_acl.py | Python | apache-2.0 | 6,809 |
from resolwe.flow.models import Data
from resolwe.test import tag_process, with_resolwe_host
from resolwe_bio.utils.test import KBBioProcessTestCase
class MicroRNATestCase(KBBioProcessTestCase):
@with_resolwe_host
@tag_process("workflow-mirna")
def test_mirna_workflow(self):
# Prepare data for al... | genialis/resolwe-bio | resolwe_bio/tests/workflows/test_mirna.py | Python | apache-2.0 | 2,406 |
# Copyright (c) 2014 Mirantis, 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 w... | telefonicaid/murano | murano/tests/functional/engine/base.py | Python | apache-2.0 | 12,267 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-18 19:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('coursedashboards', '0005_auto_20170915_2036'),
]
operations = [
migrations.Create... | uw-it-aca/course-dashboards | coursedashboards/migrations/0006_auto_20170918_1954.py | Python | apache-2.0 | 2,064 |
from __future__ import print_function
###################################################################
# Copyright 2013-2017 All Rights Reserved
# Authors: The Paradrop Team
###################################################################
import sys
from paradrop.base import settings
from paradrop.lib.utils.pd_... | ParadropLabs/Paradrop | paradrop/daemon/paradrop/core/chute/chute_storage.py | Python | apache-2.0 | 3,342 |
import envi.archs.h8.emu as h8_emu
import envi.archs.h8.regs as h8_regs
import vivisect.impemu.emulator as v_i_emulator
class H8WorkspaceEmulator(v_i_emulator.WorkspaceEmulator, h8_emu.H8Emulator):
taintregs = [h8_regs.REG_ER0, h8_regs.REG_ER1, h8_regs.REG_ER2]
def __init__(self, vw, logwrite=False, logread... | bat-serjo/vivisect | vivisect/impemu/platarch/h8.py | Python | apache-2.0 | 464 |
from django.conf import settings
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.PDB import *
from Bio.PDB.PDBIO import Select
from common.definitions import *
from protein.models import Protein, ProteinSegment
from residue.models import Residue
from structure.functions import BlastSearch... | cmunk/protwis | structure/assign_generic_numbers_gpcr.py | Python | apache-2.0 | 11,967 |
# Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD
# Copyright (C) 2017 Dell Inc. or its subsidiaries.
# 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 Lice... | openstack/tempest | tempest/api/volume/admin/test_group_snapshots.py | Python | apache-2.0 | 12,992 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | bbcarchdev/qpid-proton | proton-j/proton-api/src/main/resources/proton.py | Python | apache-2.0 | 48,151 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jhseu/tensorflow | tensorflow/python/keras/losses.py | Python | apache-2.0 | 45,944 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("form_designer", "__first__"), ("fluent_contents", "0001_initial")]
operations = [
migrations.CreateModel(
name="FormDesignerLink",
fields=[
(
... | django-fluent/django-fluent-contents | fluent_contents/plugins/formdesignerlink/migrations/0001_initial.py | Python | apache-2.0 | 1,286 |
########################################################################################################################
#
# cookie_reader.py
#
# Purpose: read cookies from the web browser (currently only Chrome supported) and make them into Python objects
#
# Author: Braxton J. Schafer (bjschafer) [bjs]
#
# Creation d... | bjschafer/showdown-sync | cookie_reader.py | Python | apache-2.0 | 2,178 |
# Python bindings to oDesk API
# python-odesk version 0.5
# (C) 2010-2015 oDesk
# Updated by the script
"""Main package of the python bindings for oDesk API.
For convenience some most commonly used functionalities are imported here,
so you can use::
from odesk import Client
from odesk import raise_http_error... | odesk/python-odesk | odesk/__init__.py | Python | apache-2.0 | 516 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | iwm911/plaso | plaso/parsers/olecf_plugins/summary.py | Python | apache-2.0 | 14,885 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'TwitterRecentEntriesItem'
db.create_table(u'contentitem_f... | bashu/fluentcms-twitterfeed | fluentcms_twitterfeed/south_migrations/0001_initial.py | Python | apache-2.0 | 7,116 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
'''-------------------------------------------------------------------------
Copyright IBM Corp. 2015, 2015 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 obta... | os-cloud-storage/openstack-workload-disaster-recovery | dragon/workload_policy/actions/plugins/instance_image_action.py | Python | apache-2.0 | 6,714 |
# Copyright (c) 2014 Mirantis, 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... | sajuptpm/murano | murano/dsl/exceptions.py | Python | apache-2.0 | 3,632 |
# 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... | rew4332/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/graph_io_test.py | Python | apache-2.0 | 14,145 |
import asyncio
from aio_pika import connect, IncomingMessage, ExchangeType
loop = asyncio.get_event_loop()
async def on_message(message: IncomingMessage):
async with message.process():
print("[x] %r" % message.body)
async def main():
# Perform connection
connection = await connect(
"amq... | mosquito/aio-pika | docs/source/rabbitmq-tutorial/examples/3-publish-subscribe/receive_logs.py | Python | apache-2.0 | 1,094 |
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect
from .models import SupportProject
# Create your views here.
def index( request ):
sp = SupportProject.objects.all()
if sp.count() == 1:
return HttpResponseRedirect( sp.first().project.get_absolute_url() )... | postpdm/ich_bau | support/views.py | Python | apache-2.0 | 440 |
# Still some problems...
import time
import shutil
from configobj import ConfigObj
NOVA_API_CONF = "/etc/nova/api-paste.ini"
OS_API_SEC = "composite:openstack_compute_api_v2"
DR_FILTER_TARGET_KEY = "keystone_nolimit"
DR_FILTER_TARGET_KEY_VALUE = "compute_req_id faultwrap sizelimit " \
"au... | fs714/drfilter | tools/novasetup.py | Python | apache-2.0 | 995 |
#!/usr/bin/env python
from absl import app
from absl.testing import absltest
from grr_response_server.databases import db_time_test
from grr_response_server.databases import mysql_test
from grr.test_lib import test_lib
class MysqlClientsTest(db_time_test.DatabaseTimeTestMixin,
mysql_test.Mysql... | google/grr | grr/server/grr_response_server/databases/mysql_time_test.py | Python | apache-2.0 | 411 |
from __future__ import absolute_import, division, print_function, unicode_literals
import time
import logging
import ujson as json
from elasticsearch import Elasticsearch
from elasticsearch.client import IndicesClient
from elasticsearch.exceptions import ConnectionTimeout
from .config import config
from .es_mappings... | commonsearch/cosr-back | cosrlib/es.py | Python | apache-2.0 | 4,391 |
# 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... | stackforge/python-openstacksdk | openstack/dns/v2/_base.py | Python | apache-2.0 | 4,338 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | iwm911/plaso | plaso/lib/text_parser_test.py | Python | apache-2.0 | 7,313 |
# Copyright 2015 Mirantis 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... | sniperganso/python-manilaclient | manilaclient/v2/share_instances.py | Python | apache-2.0 | 3,686 |
# 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... | lucemia/gcloud-python | gcloud/datastore/batch.py | Python | apache-2.0 | 10,313 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
import unittest
from meridian.acupoints import zhimai44
class TestZhimai44Functions(unittest.TestCase):
def setUp(self):
pass
def test_xxx(self):
pass
if __name__ == '__main__':
unittest.main()
| sinotradition/meridian | meridian/tst/acupoints/test_zhimai44.py | Python | apache-2.0 | 297 |
# Copyright (C) 2012 Red Hat, 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 ... | HybridF5/jacket | jacket/tests/compute/unit/virt/disk/test_inject.py | Python | apache-2.0 | 11,880 |
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='Hosts',
icon='sitemap',
dependencies=[
PluginDependency('main'),
],
)
def init():
import main
| lupyuen/RaspberryPiImage | usr/share/pyshared/ajenti/plugins/hosts/__init__.py | Python | apache-2.0 | 206 |
import json
import numpy as np
import cPickle as pickle
with open('../validation/v_xgboost_word_tfidf.csv') as train_file:
content = train_file.readlines()
testData = []
scores = []
element = content[1].strip("\r\n").split(",")
for i in range(1, len(content)):
element = content[i].strip("\r\n").split(",")... | jashwanth9/Expert-recommendation-system | code/labels_range.py | Python | apache-2.0 | 806 |
# 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 in... | group-policy/rally | tests/ci/osresources.py | Python | apache-2.0 | 8,981 |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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
#
# ... | ARM-software/lisa | lisa/tests/base.py | Python | apache-2.0 | 77,167 |
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.tasks import dashboard
class History(horizon.Panel):
name = _("History")
slug = "history"
dashboard.Tasks.register(History)
| icloudrnd/automation_tools | openstack_dashboard/dashboards/tasks/history/panel.py | Python | apache-2.0 | 243 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Contains common test fixtures used to run unit tests.
"""
import sys
# This is needed so Python can find test_tools on the path.
sys.path.append('../../..')
from test_tools.fixtures.common import *
| awsdocs/aws-doc-sdk-examples | python/example_code/apigateway/aws_service/test/conftest.py | Python | apache-2.0 | 311 |
# Copyright 2017 Erik Tollerud
#
# 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 ... | eteq/catterplotpy | catterplot/core.py | Python | apache-2.0 | 4,056 |
from typing import Any, List, Tuple, Dict #cast
from sphinx.application import Sphinx
# from sphinx.ext.autodoc import Documenter
from sphinx.ext.autodoc import ModuleLevelDocumenter
from sphinx.pycode import ModuleAnalyzer, PycodeError
#from sphinx.domains.python import PythonDomain
from sphinx.locale import __
from ... | googlefonts/fontbakery | Lib/fontbakery/sphinx_extensions/profile.py | Python | apache-2.0 | 24,923 |
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/osv | gcp/appengine/monorail.py | Python | apache-2.0 | 1,791 |
# Copyright 2016-2021 The Matrix.org Foundation C.I.C.
#
# 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... | matrix-org/synapse | synapse/handlers/room.py | Python | apache-2.0 | 64,472 |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... | our-city-app/oca-backend | src/rogerthat/bizz/jobs/__init__.py | Python | apache-2.0 | 17,649 |
#!/usr/bin/env python3
import argparse
import ipaddress
import gevent
import gevent.wsgi
import hashlib
import json
import traceback
from gevent import monkey
from werkzeug.exceptions import (BadRequest, HTTPException,
InternalServerError, NotFound)
from werkzeug.routing import Map, R... | algorithm-ninja/pixie | src/pixied.py | Python | apache-2.0 | 4,785 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | bswartz/manila | manila/api/middleware/fault.py | Python | apache-2.0 | 3,089 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import constants
from construct import Byte, Struct, Enum, Bytes, Const, Array, Renamed, Int16ul
Short = Int16ul
RobotInfo = "robot_info" / Struct(
"penalty" / Enum(Byte, constants.SPLPenalty),
"secs_till_unpenalised" / Byte,
"number_of_yellow_cards" / Byte,
... | remvo/zstt-ros | src/gamecontroller_msgs/src/gamestate.py | Python | apache-2.0 | 1,560 |
# Copyright 2012-2015 The Meson development team
# 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... | centricular/meson | mesonbuild/mesonlib.py | Python | apache-2.0 | 11,768 |