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 |
|---|---|---|---|---|---|
#
# -*- coding: utf-8 -*-#
# Copyright (c) 2010 Red Hat, Inc.
#
# Authors: Jeff Ortel <jortel@redhat.com>
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or F... | alikins/subscription-manager | src/subscription_manager/repolib.py | Python | gpl-2.0 | 27,398 |
from ..core import Eq, Ge, Gt, Integer, Le, Lt, Ne, diff, nan, oo, sympify
from ..core.compatibility import is_sequence, ordered
from ..functions import Min
from ..matrices import eye, zeros
from ..series import limit
from ..sets import Interval
from ..solvers import reduce_inequalities, solve
from .singularities impor... | skirpichev/omg | diofant/calculus/optimization.py | Python | bsd-3-clause | 7,844 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 GNS3 Technologies 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 version.
... | noplay/gns3-gui | gns3/modules/module.py | Python | gpl-3.0 | 1,482 |
# Generated by Creer at 08:40PM on November 07, 2015 UTC, git hash: '1b69e788060071d644dd7b8745dca107577844e1'
# This is a simple class to represent the Building object in the game. You can extend it by adding utility functions here in this file.
from games.anarchy.game_object import GameObject
# <<-- Creer-Merge: im... | brhoades/megaminer16-anarchy | games/anarchy/building.py | Python | mit | 5,438 |
# -*- coding: utf-8 -*-
#import the app and the login manager
from app import app
from flask import g, request, render_template, redirect, url_for, flash, send_file, abort
from flask import jsonify
from flask.ext.login import login_user, logout_user, current_user, login_required
from app.structures.models.user impor... | CSGreater-Developers/HMC-Grader | app/userViews/student/viewGrades.py | Python | mit | 3,237 |
# 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)
from spack import *
class BashCompletion(AutotoolsPackage):
"""Programmable completion functions for bash."""
h... | iulian787/spack | var/spack/repos/builtin/packages/bash-completion/package.py | Python | lgpl-2.1 | 1,869 |
from imports import *
from textures import *
class Obstaculo:
def __init__(self,posx,posy,rad):
self.posx = posx
self.posy = posy
self.rad = 5
self.escalax = 30
self.escalay = 30
self.renderlist = []
self.texture = generarTex("cono.png", True)
self.dib... | bsubercaseaux/dcc | Modelación y Computación Gráfica/graficaAutos/obstaculo.py | Python | mit | 2,245 |
#
# Electric Brain is an easy to use platform for machine learning.
# Copyright (C) 2016 Electric Brain Software Corporation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versi... | electricbrainio/electric-brain | lib/python/utils.py | Python | agpl-3.0 | 1,219 |
#!/usr/bin/env python
#coding: utf-8
from collections import deque
def yanghui(k):
#0 -> 1 -> 2-> ...-> k
q = deque([1])
for i in xrange(k):
for _ in xrange(i):
q.append(q.popleft() + q[0])
q.append(1)
return list(q)
print yanghui(4) | libchaos/algorithm-python | 05/code/queue_yanghui.py | Python | mit | 249 |
class HelpMixin:
@property
def help(self):
from .Help import HelpCell
if self._path[:1] == ("HELP",):
raise AttributeError("Help cells can't have help")
return HelpCell(self)
@help.setter
def help(self, value):
from .Help import HelpCell
wrapper = Hel... | sjdv1982/seamless | seamless/highlevel/HelpMixin.py | Python | mit | 688 |
"""
WSGI config for discover project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | martinskou/training | discover/discover/wsgi.py | Python | apache-2.0 | 393 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site domain and name."""
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID... | jvosk/repork | repork_project/contrib/sites/migrations/0002_set_site_domain_and_name.py | Python | bsd-3-clause | 937 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | jakereps/qiime-workshops | payments/migrations/0002_helptext.py | Python | bsd-3-clause | 1,971 |
from django.db.models.query import QuerySet
class PublisherQuerySet(QuerySet):
"""Added publisher specific filters to queryset.
"""
def drafts(self):
return self.filter(publisher_is_draft=True)
def public(self):
return self.filter(publisher_is_draft=False) | emiquelito/django-cms-2.0 | publisher/query.py | Python | bsd-3-clause | 294 |
import asyncio
from .log import internal_logger
class BaseProtocol(asyncio.Protocol):
__slots__ = ('_loop', '_paused', '_drain_waiter',
'_connection_lost', 'transport')
def __init__(self, loop=None):
if loop is None:
self._loop = asyncio.get_event_loop()
else:
... | rutsky/aiohttp | aiohttp/base_protocol.py | Python | apache-2.0 | 1,948 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio 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... | dset0x/invenio | invenio/modules/oaiharvester/tasks/postprocess.py | Python | gpl-2.0 | 18,387 |
"""
Virtstrap
=========
A bootstrapping mechanism for virtualenv, buildout, and shell scripts.
"""
from setuptools import setup, find_packages
import sys
# Installation requirements
REQUIREMENTS = [
'virtualenv',
'pyyaml',
]
if sys.version_info < (2, 7):
REQUIREMENTS.append('argparse>=1.2.1')
setup(
... | ravenac95/testvirtstrapdocs | setup.py | Python | mit | 1,125 |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... | NordicSemiconductor/mbed | workspace_tools/targets.py | Python | apache-2.0 | 17,540 |
__version__ = '0.1.43'
| hexgis/authldap | authldap/__init__.py | Python | agpl-3.0 | 23 |
# Copyright 2011 Jamie Norrish (jamie@artefact.org.nz)
#
# 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... | ajenhl/django-tmapi | tmapi/tests/models/test_typed.py | Python | apache-2.0 | 1,944 |
#! /usr/bin/env python
import rospy, math
import numpy as np
import sys, termios, tty, select, os
from geometry_msgs.msg import Twist
from std_msgs.msg import Bool
class KeyTeleop(object):
cmd_bindings = {'q':np.array([1,1]),
'w':np.array([1,0]),
'e':np.array([1,-1]),
... | jajberni/pi2go_ros | pi2go_control/scripts/key_teleop.py | Python | mit | 4,261 |
from selenium import webdriver
from time import sleep
class Login():
def user_login(self,driver):
driver.find_element_by_name("username").clear()
driver.find_element_by_name("username").send_keys("yidishui")
driver.find_element_by_name("password").clear()
driver.find_element_by_name... | 1065865483/0python_script | Five/Test_Module/Login_Class.py | Python | mit | 813 |
from django.test import RequestFactory
from mock import patch
from nose.tools import ok_, eq_
from mozillians.common.tests import TestCase
from mozillians.groups.models import Group
from mozillians.groups.tests import GroupFactory
from mozillians.groups.views import _list_groups
from mozillians.users.tests import Use... | ChristineLaMuse/mozillians | mozillians/groups/tests/test_views/test_list.py | Python | bsd-3-clause | 3,419 |
#!/usr/bin/env python
'''
CADET_00001 is one of the challenge released by DARPA for the Cyber Grand Challenge:
https://github.com/CyberGrandChallenge/samples/tree/master/examples/CADET_00001
The binary can run in the DECREE VM (http://repo.cybergrandchallenge.com/boxes/)
CADET_00001.adapted (by Jacopo Corbetta) is t... | Ruide/angr-dev | angr-doc/examples/CADET_00001/solve.py | Python | bsd-2-clause | 3,534 |
# -*- coding: utf-8 -*-
"""
Liquid is a form management tool for web frameworks.
Copyright (C) 2014, Bence Faludi (b.faludi@mito.hu)
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... | bfaludi/liquid4m | liquid4m/exceptions.py | Python | gpl-3.0 | 1,990 |
# Generated by Django 3.2.8 on 2021-12-03 09:58
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
("account", "0031_auto_20210517_1421"),
]
operations = [
migrations.AddField(
model_name="user",
... | fin/froide | froide/account/migrations/0032_auto_20211203_1058.py | Python | mit | 1,087 |
import os
import arrow
import tarfile
import xml.etree.ElementTree as ET
from dateutil import tz
from common import Event
class MoodleActivity(Event):
"""Describes an XML Moodle event with key based access"""
event_keys = [
'timeopen',
'timeclose'
]
# for preview
event_pretty_nam... | fuhrmanator/course-activity-planner | python/moodle.py | Python | gpl-3.0 | 9,456 |
""" The layer module contains a Layer class to help when working with layers."""
class Layer(object):
def __init__(self, definition):
# Name -- Required
try:
self.name = definition['name']
except KeyError:
raise KeyError('The "name" key is required for the ... | rustprooflabs/MapBuilder | mapbuilder/layer.py | Python | mit | 1,152 |
#!/usr/bin/env python
# coding: utf-8
"""A python bulk editor class to apply the same code to many files."""
# Copyright (c) 2012, 2013 Jérôme Lecomte
#
# 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 t... | imoldman/AdditionalLogger | third_party/massedit.py | Python | mit | 18,540 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
=====================================================================================
Copyright (c) 2016-2018 Université de Lorraine & Luleå tekniska universitet
Author: Luca Di Stasio <luca.distasio@gmail.com>
<luca.distasio@ingpec.eu>
This progra... | LucaDiStasio/thinPlyMechanics | python/templateAnalyzeABQoutputData.py | Python | apache-2.0 | 109,123 |
# Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Mozaik Mass Mailing Access Rights",
"summary": """
New group: Mass Mailing Manager. Managers can edit
and unlink mass mailings.""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
... | mozaik-association/mozaik | mozaik_mass_mailing_access_rights/__manifest__.py | Python | agpl-3.0 | 625 |
#!/usr/bin/env
"""
GOA_Winds_NARR_3hr.py
Compare NARR Winds with NCEP V2 (with Mooring Winds)
Using Anaconda packaged Python
"""
#System Stack
import datetime
#Science Stack
import numpy as np
# User Stack
import general_utilities.date2doy as date2doy
import general_utilities.haversine as sphered
from utiliti... | shaunwbell/FOCI_Analysis | ReanalysisRetreival_orig/GOA_Winds/depricated/GOA_Winds_NARR_3hr.py | Python | mit | 10,276 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE.TXT file)
from django.dispatch import Signal
team_created = Signal(providing_args=["team", "creator"])
join_request_created = Signal(providing_args=["join_request"])
join_request_pro... | F483/bikesurf.org | apps/team/signals.py | Python | mit | 507 |
from common.forms import ModelFormWithHelper
from common.helpers import SubmitCancelFormHelper
from blog.models import News, Resource, Tag
from users.models import SystersUser
class AddNewsForm(ModelFormWithHelper):
"""Form to add new Community News. The author and the community of the
news should be provide... | willingc/portal | systers_portal/blog/forms.py | Python | gpl-2.0 | 3,574 |
import os
import unittest
import vtk, qt, ctk, slicer
import math
import sys
#
# AstroMomentMapsSelfTest
#
class AstroMomentMapsSelfTest:
def __init__(self, parent):
parent.title = "Astro MomentMaps SelfTest"
parent.categories = ["Testing.TestCases"]
parent.dependencies = ["AstroVolume"]
parent.cont... | Punzo/SlicerAstro | AstroMomentMaps/Testing/Python/AstroMomentMapsSelfTest.py | Python | bsd-3-clause | 6,817 |
# Copyright 2015 CloudFounders 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 applicable law or agreed to in writ... | tcpcloud/openvstorage | ovs/extensions/os/__init__.py | Python | apache-2.0 | 644 |
##
# Copyright (c) 2008-2017 Apple 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 l... | macosforge/ccs-calendarserver | twistedcaldav/directorybackedaddressbook.py | Python | apache-2.0 | 30,423 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-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.... | cloudbau/glance | glance/common/client.py | Python | apache-2.0 | 23,522 |
#!/usr/bin/python
# Matt's MYUW Mobile test
# What these tests will check for:
# Landing page:
# * Correct number of critical notices
# * Correct number of unread notices
# * Correct email link, or lack thereof
# * Presense of registration card, if expected
# * Correct link names and URLs of registration resource l... | mattventura/myuw-selenium | myuw_selenium/test/muwm_testing.py | Python | apache-2.0 | 16,214 |
#!/usr/bin/env python
#
# 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 us... | EmanueleCannizzaro/scons | test/TEX/newglossary.py | Python | mit | 5,563 |
#!/usr/bin/python
from transient import api
if __name__ == "__main__":
api.run()
| smilledge/transient | runserver.py | Python | mit | 86 |
import time
from openstates.utils import LXMLMixin
from billy.scrape.legislators import LegislatorScraper, Legislator
from .util import get_client, get_url, backoff
import lxml
HOMEPAGE_URLS = {
"lower": ("http://www.house.ga.gov/Representatives/en-US/"
"member.aspx?Member={code}&Session={sid}"),
... | cliftonmcintosh/openstates | openstates/ga/legislators.py | Python | gpl-3.0 | 7,273 |
import pipy
packpath = "pipy"
pipy.define_upload(packpath,
author="Karim Bahgat",
author_email="karim.bahgat.norway@gmail.com",
license="MIT",
name="Pipy",
description="Blabla",
url="http://github.com/kari... | karimbahgat/PyPi | upload.py | Python | mit | 964 |
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Dungeons & Denizens'
language = 'en'
url = 'http://dungeond.com/'
start_date = '2005-08-23'
end_date = '2014-03-05'
active = False
rights... | datagutten/comics | comics/comics/dungeond.py | Python | agpl-3.0 | 443 |
"""Tests for RH Cloud - Inventory, also known as Insights Inventory Upload
:Requirement: RH Cloud - Inventory
:CaseAutomation: Automated
:CaseLevel: System
:CaseComponent: RHCloud-Inventory
:Assignee: jpathan
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from datetime import datetime
from dateti... | rplevka/robottelo | tests/foreman/ui/test_rhcloud_inventory.py | Python | gpl-3.0 | 18,489 |
import os.path, re, simplejson
from util import *
from extract_strings import load_strings_file, untranslated_count_for_lang
from extract_strings import extract_strings_from_c_files, get_missing_for_language
from extract_strings import dump_missing_per_language, write_out_strings_files
from extract_strings import key_s... | Erls-Corporation/SumatraPDF-2.2.1 | scripts/update_translations.py | Python | gpl-3.0 | 7,537 |
# 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/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | Python | mit | 7,097 |
# *-* coding: utf-8 *-*
import urllib
import pandas as pd
import re
import time
from nltk.corpus import stopwords
from nltk import WordNetLemmatizer, word_tokenize
from nltk.stem.porter import PorterStemmer
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics import class... | topotech/AID_tarea3 | Parte2/parte2.py | Python | unlicense | 11,260 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def swpreds_gbm():
# Training set has two predictor columns
# X1: 10 categorical levels, 100 observations per level; X2: Unif(0,1) noise
# Ratio of y = 1 per Level: cat0... | YzPaul3/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_swpreds_gbm.py | Python | apache-2.0 | 1,295 |
import os, sys, gevent, json, pickle, traceback, ctypes, numpy as np
import itertools, re
from time import time
from pathlib import Path
from gevent.queue import Queue
from gevent.subprocess import run, PIPE, STDOUT
from sakura.common.errors import IOReadException, IOWriteException
from base64 import b64encode, b64deco... | eduble/panteda | sakura/common/tools.py | Python | gpl-3.0 | 14,228 |
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/botocore/client.py | Python | gpl-3.0 | 33,345 |
# -*- coding: utf-8 -*-
'''
Copyright (c) 2015 Heidelberg University Library
Distributed under the GNU GPL v3. For full terms see the file
LICENSE.md
'''
from omptables import define_omp_tables
#########################################################################
# This scaffolding model makes your app work on Go... | UB-Heidelberg/UBHD-OMPArthistorikum | models/db.py | Python | gpl-3.0 | 4,966 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... | clearcare/salesforce-python-toolkit | sforce/enterprise.py | Python | lgpl-3.0 | 3,804 |
import errors
def validate_num_arguments_eq(num_args):
"""Validate that the number of supplied args is equal to some number"""
def decorator(func):
def wrapped_func(*args, **kwargs):
if len(args[1]) != num_args:
raise errors.InvalidArgumentError
else:
... | dansackett/Todooo | todooo/validators.py | Python | mit | 1,462 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from models import Estudiante
# Define an inline admin descriptor for Estudiante model
# which acts a bit like a singleton
class EstudianteInline(admin.StackedInline):
model = Estudiante
... | prengifo/GuardabosquesUSB | GuardabosquesUSB/login/admin.py | Python | mit | 560 |
# -*- coding:utf-8 -*-
__author__ = 'Qian'
import tornado.web
import os
from MyRedisSession.RedisSession import SessionManager
setting = dict(
template_path=os.path.join(os.path.dirname(__file__), "MyTemplate"),
static_path=os.path.join(os.path.dirname(__file__), "Static"),
debug = True,
cookie_secret = "... | kakashi1016/MakeAppointment4TZMH | application.py | Python | gpl-2.0 | 1,012 |
from rest_auth.registration.serializers import (
RegisterSerializer as RARegisterSerializer
)
from rest_auth.serializers import (
LoginSerializer as RALoginSerializer,
PasswordResetSerializer as RAPasswordResetSerializer
)
from rest_framework import serializers
from .fields import TimezoneField
class Lo... | item4/item4.net | api/auth/serializers.py | Python | agpl-3.0 | 1,576 |
from collections import OrderedDict
from django.conf import settings
from django.http import JsonResponse
from django.utils.datastructures import MultiValueDictKeyError
from rest_framework.viewsets import ViewSet
from rest_framework.decorators import list_route
from rest_api.tools import set_ikeys, split_cols
from r... | jookies/jasmin-api | jasmin_api/rest_api/views/morouter.py | Python | apache-2.0 | 6,695 |
#!/usr/bin/python
from os import walk
from pathFind import *
from pathDraw import *
testingPath = './Assets/Mappings/Testing'
mappingsPath = './Assets/Mappings'
workingDirectory = mappingsPath
maps = []
for (dirpath, dirnames, filenames) in walk(workingDirectory):
maps.extend(filenames)
break
for mappingName in... | alexandermueller/PathfindEmAll | pathFindEmAll.py | Python | mit | 3,093 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira Networks, 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.apac... | ykaneko/neutron | neutron/tests/unit/test_extension_ext_gw_mode.py | Python | apache-2.0 | 16,524 |
#!/usr/bin/env python
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | endlessm/chromium-browser | third_party/webrtc/audio/test/low_bandwidth_audio_test.py | Python | bsd-3-clause | 11,840 |
import blue_yellow_app.infrastructure.static_cache as static_cache
import pyramid.renderers
import pyramid.httpexceptions as exc
from blue_yellow_app.infrastructure.supressor import suppress
import blue_yellow_app.infrastructure.cookie_auth as cookie_auth
from blue_yellow_app.services.account_service import AccountSer... | mikeckennedy/python-for-entrepreneurs-course-demos | 15-deployment/blue_yellow_app_deployment/blue_yellow_app/controllers/base_controller.py | Python | mit | 1,592 |
#!/usr/bin/env python3
###############################################################
# Copyright 2019 Lawrence Livermore National Security, LLC
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
#
# This file is part of the Flux resource manager framework.
# For details, see https://github.com/flux-framework.
#
# SPDX-License-I... | chu11/flux-core | t/python/t0012-futures.py | Python | lgpl-3.0 | 8,826 |
__author__ = 'Amy'
| ptphp/PtServer | library/AppVersion.py | Python | bsd-3-clause | 19 |
from __future__ import print_function
import pprint
import traceback
import sys
print("Starting plugin CircularZone")
try:
from .CircularZone import *
CircularZone().register()
except Exception as e:
traceback.print_exc(file=sys.stdout)
pprint.pprint(e)
| jsreynaud/kicad-action-scripts | CircularZone/__init__.py | Python | gpl-3.0 | 271 |
#!/home/neale/.virtualenvs/aws_ssh_config/bin/python2
'''
@author Bommarito Consulting, LLC
@date 2012-12-23
Generate .ssh/config lines from EC2 instance information.
'''
# Imports
import boto.ec2
import os
import ConfigParser
from os.path import expanduser
import re
# Default user
defaultUser = 'ec2-user'
defaultRe... | sw1nn/dotfiles | bin/generate_aws_ssh_config.py | Python | epl-1.0 | 3,419 |
from os import mkdir, stat
from os.path import join, exists
import tempfile
import shutil
import sys
import hashlib
import bz2
from zipfile import ZipFile
from nose.tools import *
from pixiepatch import *
from pixiepatch.bz2compressor import BZ2Compressor
from pixiepatch.ziphandler import ZIPHandler
class Base(objec... | dgym/pixiepatch | tests/test_distribution.py | Python | mit | 6,437 |
import os
import re
import sys
from coalib.misc import Constants
from coalib.output.ConfWriter import ConfWriter
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
from coalib.parsing.CliParsing import parse_cli, check_conflicts
from coalib.parsing.ConfParser import ConfParser
from coalib.settings.Section import S... | MattAllmendinger/coala | coalib/settings/ConfigurationGathering.py | Python | agpl-3.0 | 10,084 |
#!/usr/bin/env python
import argparse
import sys
import time
class MemoryInfo2Comments:
def __init__(self, rom_info_file):
self.mem_info = self._get_rom_info(rom_info_file)
def eval_addr(self, addr):
addr = addr.strip("$")
return int(addr, 16)
def _get_rom_info(self, rom_info_fi... | jedie/DragonPy | dragonpy/Dragon64/6809dasm_comments.py | Python | gpl-3.0 | 2,755 |
import re, sys, time, os
import functools as fu
import sublime, sublime_plugin
from copy import copy
from .lib.misc import *
from .lib import kill_ring
from .lib import isearch
import Default.paragraph as paragraph
from . import sbp_layout as ll
# repeatable commands
repeatable_cmds = set(['move', 'left_delete', 'ri... | grundprinzip/sublemacspro | jove.py | Python | bsd-3-clause | 60,708 |
#########################################################################
# Host.py
# 4.11.2014
# Author: A.T.
#########################################################################
""" Host - class for managing jobs on a host. Host objects are invoked
with LocalComputingElement or SSHComputingElement object... | arrabito/DIRAC | Resources/Computing/BatchSystems/Host.py | Python | gpl-3.0 | 8,010 |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Benjamin Kampmann <ben.kampmann@googlemail.com>
"""
Another simple rss based Media Server, this time for TED.com content
"""
# I can reuse stuff. cool. But that also means we might want to ref... | sreichholf/python-coherence | coherence/backends/ted_storage.py | Python | mit | 3,722 |
from foam.sfa.util.enumeration import Enum
# recognized top level rspec elements
RSpecElements = Enum(
AVAILABLE='AVAILABLE',
BWLIMIT='BWLIMIT',
EXECUTE='EXECUTE',
NETWORK='NETWORK',
COMPONENT_MANAGER='COMPONENT_MANAGER',
HARDWARE_TYPE='HARDWARE_TYPE',
INSTALL='INSTALL',
INTERFACE='I... | dana-i2cat/felix | ofam/src/src/foam/sfa/rspecs/rspec_elements.py | Python | apache-2.0 | 935 |
# Copyright 2004 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import types
import pprint
import warnings
from Synopsis import AST
from pygccxml import utils
from pygccxml.declarations ... | jgresula/jagpdf | code/tools/external/python/pygccxml/parser/synopsis_scanner.py | Python | mit | 1,649 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from django.db import connection
from django.test import override_settings
from sqlalchemy.sql import (
and_, select, column, table,
)
from sqlalchemy.sql import compiler # type: ignore
from zerver.models import ... | samatdav/zulip | zerver/tests/test_narrow.py | Python | apache-2.0 | 65,887 |
# ex40.py
class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print line
happy_bday = Song (["Happy birthday to you",
"I don't want to get sued",
"So I'll stop right there"])
bulls_on_parade = Song (["They rally around the family"... | CodeSheng/LPLHW | ex40.py | Python | apache-2.0 | 421 |
import craftbuildtools.app
from craftbuildtools.app import cli
cli()
| TechnicalBro/CraftBuildTools | craftbuildtools/__main__.py | Python | mit | 70 |
from contentbase.json_renderer import json_renderer
from contentbase.util import get_root_request
from elasticsearch import Elasticsearch
from elasticsearch.connection import Urllib3HttpConnection
from elasticsearch.serializer import SerializationError
from pyramid.settings import (
asbool,
aslist,
)
from .inte... | kidaa/encoded | src/contentbase/elasticsearch/__init__.py | Python | mit | 3,267 |
default_app_config = 'wagtail.contrib.modeladmin.apps.WagtailModelAdminAppConfig'
| kaedroho/wagtail | wagtail/contrib/modeladmin/__init__.py | Python | bsd-3-clause | 82 |
import math
from quaternion import *
__doc__ = '''A module which implements a trackball class.'''
class Trackball:
'''A trackball object. This is deformed trackball which is a hyperbolic
sheet of rotation away from the center. This particular function was chosen
after trying out several variations... | MDAnalysis/pyQuteMol | python/trackball.py | Python | gpl-2.0 | 2,898 |
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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 y... | odahoda/noisicaa | noisicaa/builtin_nodes/oscilloscope/node_ui.py | Python | gpl-2.0 | 25,830 |
"""
Tests of completion xblock runtime services
"""
import ddt
from completion.models import BlockCompletion
from completion.services import CompletionService
from completion.test_utils import CompletionWaffleTestMixin
from opaque_keys.edx.keys import CourseKey
from xmodule.library_tools import LibraryToolsService
fr... | eduNEXT/edx-platform | openedx/tests/completion_integration/test_services.py | Python | agpl-3.0 | 11,712 |
"""
GOCDBSyncCommand module
This command updates the downtime dates from the DowntimeCache table in case they changed
after being fetched from GOCDB. In other words, it ensures that all the downtime dates in
the database are current.
"""
import errno
import xml.dom.minidom as minidom
from DIRAC import S_OK, S... | DIRACGrid/DIRAC | src/DIRAC/ResourceStatusSystem/Command/GOCDBSyncCommand.py | Python | gpl-3.0 | 4,607 |
import sys
import decimal
import math
from importlib import import_module
from time import time
sys.path.append("..")
decmath = import_module("decmath")
decimal.getcontext().prec = 70
def tts(tuple):
return '(%s)' % ', '.join(map(repr, tuple))
def Bench(func, *args):
t0 = time()
print("Standard Math:"... | ElecProg/decmath | util/Benchmarking.py | Python | mit | 663 |
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | bastibl/gnuradio | gr-blocks/python/blocks/qa_pdu.py | Python | gpl-3.0 | 4,605 |
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Compassion CH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
class HrAttendanceRules(models.Model):
_name = 'hr.attendance.rules'
_description = "HR attendance break time rule"
###########################... | eicher31/compassion-modules | hr_attendance_management/models/hr_attendance_rules.py | Python | agpl-3.0 | 1,311 |
import game2
import othello
class benchPlayer(object):
"""
Reinforcement Learning in The Game Of Othello - By Michiel Van Der Ree and Marco Wiering(IEEE member)
http://www.ai.rug.nl/~mwiering/GROUP/ARTICLES/paper-othello.pdf
A better evaluation function which gives more preference to squares
on the... | shubhamjain0594/OthelloReinforcementLearning | bench.py | Python | gpl-2.0 | 2,751 |
#!/usr/bin/env python3
# coding=utf-8
# The arrow library is used to handle datetimes
import arrow
# The request library is used to fetch content through HTTP
import requests
# The BeautifulSoup library is used to parse HTML
from bs4 import BeautifulSoup
def fetch_production(zone_key='PA', session=None, target_datet... | tmrowco/electricitymap | parsers/PA.py | Python | gpl-3.0 | 2,533 |
class VigenereCracker:
def __init__(self, language, minLen, maxLen):
self.LANGUAGE = language
#Key length could be from 1 to 13 bytes
self.KEYLENBOUNDS = range(minLen,maxLen)
self.SUMQPSQUARE = 0.065
self.KEYLENGTHFOUND = -1
self.KEY = []
... | JohnJakeChambers/break-the-vigenere | VigenereCracker.py | Python | gpl-3.0 | 3,920 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | stgraber/snapcraft | snapcraft/tests/test_repo.py | Python | gpl-3.0 | 11,643 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/kinetic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | pranaypratyush/buoy_detect | resources/build/catkin_generated/generate_cached_setup.py | Python | mit | 1,316 |
# 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... | leezu/mxnet | contrib/tvmop/utils.py | Python | apache-2.0 | 2,129 |
from paddle.trainer_config_helpers import *
settings(learning_rate=1e-4, batch_size=1000)
a = data_layer(name='a', size=10)
b = data_layer(name='b', size=10)
result = addto_layer(input=[a, b])
concat1 = concat_layer(input=[a, b])
concat2 = concat_layer(input=[
identity_projection(input=a),
identity_projectio... | zuowang/Paddle | python/paddle/trainer_config_helpers/tests/configs/util_layers.py | Python | apache-2.0 | 368 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from os import path
from .tools import accepted_extensions, get_setting
from ..libraries.readconfig import ReadConfig
from ... | gepd/Deviot | libraries/project_check.py | Python | apache-2.0 | 13,120 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "huntnet.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| srohatgi/cloud | huntnet/manage.py | Python | apache-2.0 | 250 |
""" This module handles everything that is floor-related"""
from game_objects.serializable import Serializable
import logging
from error_stuff import log_error
class Curse(object):
"""Curse enumaration"""
No_Curse, Blind, Darkness, Lost, Maze, Unknown, Labyrinth, Cursed = range(8)
class Floor(Serializable):... | Hyphen-ated/RebirthItemTrackerTest | src/game_objects/floor.py | Python | bsd-2-clause | 2,595 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2016 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | crisely09/horton | doc/update_install_doc.py | Python | gpl-3.0 | 5,435 |
"""Tests for Infoblox Plugin
:Requirement: Infoblox
:CaseLevel: System
:CaseComponent: Infobloxintegration
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from robottelo.decorators import stubbed, tier3, upgrade
from robottelo.test import TestCase
class InfobloxTestCase(TestCase):
@stubbed()... | pgagne/robottelo | tests/foreman/installer/test_infoblox.py | Python | gpl-3.0 | 5,003 |
def test_add_contact(app, db, json_contacts, check_ui):
a_contact = json_contacts
old_contacts = db.get_contact_list()
contact = app.contact.create(a_contact)
assert len(old_contacts) + 1 == app.contact.count()
new_contacts = db.get_contact_list()
old_contacts.append(contact)
assert sorted... | evgeniy-shorgin/python_training | test/test_add_contact.py | Python | apache-2.0 | 454 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import os
import random
def milsong_checkpoint():
milsong_train = h2o.upload_file(pyunit_utils.locate("bigdata/laptop/milsongs/milsongs-train.csv.gz"))
milsong_valid = h2o.upload_file(pyunit_utils.locate("bigdata/laptop/milsongs/... | pchmieli/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_milsongs_large_gbm.py | Python | apache-2.0 | 2,318 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.