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 |
|---|---|---|---|---|---|
from django import template
register = template.Library()
@register.simple_tag
def url_replace(request, field, value):
dict_ = request.GET.copy()
dict_[field] = value
return dict_.urlencode()
| quijot/gea | templatetags/tags.py | Python | bsd-2-clause | 208 |
from dataactcore.models.stagingModels import ObjectClassProgramActivity
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'b19_object_class_program_activity'
def test_column_headers(database):
expected_subset = {'row_number', 'beginning_period_of_availa', 'ending_period_of_av... | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | tests/unit/dataactvalidator/test_b19_object_class_program_activity.py | Python | cc0-1.0 | 8,694 |
# -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import unittest
import sys
import os
import optparse
import re
import signal
import gevent
import pdb
import time
SP = 10
SP = 15
SP = 20... | tiagocoutinho/bliss | tests/temperature/TestTempCustomCmdAttr.py | Python | lgpl-3.0 | 2,182 |
#!/usr/bin/python2
import cv
import cv2
capture = cv2.VideoCapture(0)
frame = None
edges = None
hand = None
while True:
retval, frame = capture.read()
# if not retval:
# break
# cv2.imshow("window1", frame)
edges = cv2.cvtColor(frame, cv.CV_BGR2GRAY)
edges = cv2.GaussianBlur(edges, (... | fredmorcos/attic | projects/hand-tracking/main.py | Python | isc | 943 |
#!/usr/bin/python
# known_nodes.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (known_nodes.py) is part of BitDust Software.
#
# BitDust 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 Softwa... | vesellov/bitdust.devel | dht/known_nodes.py | Python | agpl-3.0 | 3,630 |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# django-test-plus documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 4 19:30:39 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | grahamu/django-test-plus | docs/conf.py | Python | bsd-3-clause | 11,591 |
""" Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... | huran2014/huran.github.io | wot_gateway/usr/lib/python2.7/encodings/aliases.py | Python | gpl-2.0 | 14,848 |
import pytest
import numpy as np
import itertools
from typing import List, Text, Optional, Dict
from rasa.engine.graph import ExecutionContext
from rasa.engine.storage.resource import Resource
from rasa.engine.storage.storage import ModelStorage
from rasa.core.featurizers.precomputation import (
CoreFeaturization... | RasaHQ/rasa_nlu | tests/core/featurizers/test_precomputation.py | Python | apache-2.0 | 19,983 |
"""
Visualisation of maximum/minimum magnitude for GCVS stars.
"""
import sys
import matplotlib.pyplot as plot
from pygcvs import read_gcvs
if __name__ == '__main__':
try:
gcvs_file = sys.argv[1]
except IndexError:
print('Usage: python plot_magnitudes.py <path to iii.dat>')
else:
... | zsiciarz/pygcvs | examples/plot_magnitudes.py | Python | mit | 961 |
#! /usr/bin/python
#
# Qt example for VLC Python bindings
# Copyright (C) 2009-2010 the VideoLAN team
#
# 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... | saadqc/Sub-Merge | VideoPlayer.py | Python | gpl-3.0 | 7,603 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Unity Autopilot Test Suite
# Copyright (C) 2015 Canonical
#
# 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 ... | jonjahren/unity8 | tests/autopilot/unity8/greeter/tests/__init__.py | Python | gpl-3.0 | 1,054 |
import sys
import os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib'))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'py'))
| kyungkoo/gae-ota-plist-maker | appengine_config.py | Python | mit | 160 |
# This file is part of django-xmpp-server-list
# (https://github.com/mathiasertl/django-xmpp-server-list)
#
# django-xmpp-server-list 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 Lic... | mathiasertl/django-xmpp-server-list | account/views.py | Python | gpl-3.0 | 5,397 |
"""Admin Configuration for Improved User"""
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext_lazy as _
from .forms import UserChangeForm, UserCreationForm
class UserAdmin(BaseUserAdmin):
"""Admin panel for Improved User, mimics Django's default"""
... | jambonsw/django-improved-user | src/improved_user/admin.py | Python | bsd-2-clause | 1,256 |
"""SCons.Tool.ipkg
Tool-specific initialization for ipkg.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
The ipkg tool calls the ipkg-build. Its only argument should be the
packages fake_root.
"""
#
# Copyright... | fluxer/spm | nuitka/nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/ipkg.py | Python | gpl-2.0 | 2,444 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Error Log model
import logging
logger = logging.getLogger('con_science_bot')
hdlr = logging.FileHandler('logs/error.log')
formatter = logging.Formatter('\n%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.IN... | hsadler/con-science-twitter-bot | models/error_log.py | Python | mit | 1,068 |
#!/usr/bin/env python
import rospy
from measurement_system.msg import measurement_msg
from communication.msg import target_positions_msg
from strategy.msg import KeyboardMessage
from strategy.msg import strategy_output_msg
from Players.player import *
from team import *
from std_msgs.msg import String
from std_msgs.msg... | unball/strategy | new_arch/arch_strategy.py | Python | mit | 2,634 |
# Copyright 2013-2021 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 RA4classif(RPackage):
"""Automated Affymetrix Array Analysis Classification Package
F... | LLNL/spack | var/spack/repos/builtin/packages/r-a4classif/package.py | Python | lgpl-2.1 | 1,485 |
"Generic Crawler object to read from a url"
# coding: utf8
import re
from BeautifulSoup import BeautifulSoup
import urllib2
MAXTRIES = 4
def removewhitespaces(string):
"Removes whitespaces, newlines and carriage returns from string"
return re.sub('\s', '', string)
def removewhitespacesstartandend(string):
... | SuperNovaPOLIUSP/supernova | aeSupernova/crawler/Crawler.py | Python | agpl-3.0 | 2,029 |
from datamodel import DataModel
from experimenter import Experimenter
import argparse
import sys
def main(args):
dm = DataModel(args.data_file)
dm.read_data(to_read_count=args.data_rows_to_read,
normalize_data=True)
#dm.write_data('../data/data_norm.csv')
exp = Experimenter(dm)
exp.pe... | narendergupta/mooc | mooc/src/main.py | Python | gpl-2.0 | 703 |
from .main import Searcher
def start():
return Searcher()
config = [{
'name': 'searcher',
'order': 20,
'groups': [
{
'tab': 'searcher',
'name': 'searcher',
'label': 'Basics',
'description': 'General search options',
'options': [
... | rooi/CouchPotatoServer | couchpotato/core/media/_base/searcher/__init__.py | Python | gpl-3.0 | 2,597 |
#########################################################################
#
# Copyright (c) 2012 Daniel Berenguer <dberenguer@usapiens.com>
#
# This file is part of the lagarto project.
#
# lagarto is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | oriolrius/lagarto-swap | lagarto/lagartoauth.py | Python | gpl-2.0 | 6,684 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import argparse
REGISTER_LAYOUT = {
... | SymbiFlow/prjxray | fuzzers/032-cmt-pll/write_pll_reg.py | Python | isc | 8,174 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare, float_round, float_is_zero, pycompat
import logging
_logger = logg... | maxive/erp | addons/stock_account/models/stock.py | Python | agpl-3.0 | 37,701 |
#
# 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
# ... | steveb/heat | heat/engine/properties.py | Python | apache-2.0 | 23,564 |
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.template.context_processors import csrf
from django.http import HttpResponseRedirect
from django.template ... | Weavebytesipl/FutureERP | dashboard/views.py | Python | gpl-3.0 | 2,920 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------------------------------------------------
# INFO:
# -----------------------------------------------------------------------------------------------------------------------
"""
Authors: Evan Hu... | evhub/coconut | coconut/command/util.py | Python | apache-2.0 | 20,011 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, sathishpy@gmail.com and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CMPaymentInvoiceItem(Document):
pass
| sathishpy/corrugation | corrugation/corrugation/doctype/cm_payment_invoice_item/cm_payment_invoice_item.py | Python | gpl-3.0 | 276 |
from gevent import monkey
monkey.patch_all()
import pytest
import gevent
import marshmallow
from channelstream.server_state import get_state
from channelstream.channel import Channel
@pytest.mark.usefixtures("cleanup_globals", "pyramid_config")
class TestConnectViews(object):
def test_bad_json(self, dummy_reque... | AppEnlight/channelstream | tests/tests_views.py | Python | bsd-3-clause | 21,292 |
#http://zacharydenton.com/project-euler-solutions/58/
#!/usr/bin/env python
import math
from collections import defaultdict
def factorize(n):
if n < 1:
raise ValueError('fact() argument should be >= 1')
if n == 1:
return [] # special case
res = []
# iterate over all even numbers first.... | paulmcquad/projecteuler | 0-100/problem58.py | Python | gpl-3.0 | 1,888 |
import py
from rpython.jit.backend.arm.test.support import JitARMMixin
from rpython.jit.metainterp.test.test_float import FloatTests
class TestFloat(JitARMMixin, FloatTests):
# for the individual tests see
# ====> ../../../metainterp/test/test_float.py
pass
| jptomo/rpython-lang-scheme | rpython/jit/backend/arm/test/test_float.py | Python | mit | 272 |
# -*- coding: utf-8 -*-
# *********************************************************************
# lewis - a library for creating hardware device simulators
# Copyright (C) 2016-2021 European Spallation Source ERIC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | DMSC-Instrument-Data/plankton | tests/test_approaches.py | Python | gpl-3.0 | 2,117 |
from django import template
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from media_manager.views import MediaUploadForm
from media_manager.models import MediaFile
register = template.Library()
@register.inclusion_tag('media_manager/upload.html', takes_conte... | Alaxe/judgeSystem | media_manager/templatetags/media_manager.py | Python | gpl-2.0 | 1,039 |
from urlparse import urlparse
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from website.util import permissions
from tests.base import ApiTestCase
from osf_tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
)
from api.registrations.s... | mluo613/osf.io | api_tests/registrations/views/test_registration_detail.py | Python | apache-2.0 | 12,488 |
import random
def run(data, settings):
if data['payload'] == 'goat thrower':
if random.randint(0, 110) == 0:
outcome = random.randint(0, 2)
if outcome == 0:
return "{nick}: The goat thrower engulfs you in a billowing wave of goat. Goats swim over your body as they re... | kyleterry/tenyks-contrib | src/tenyksscripts/scripts/goatthrower.py | Python | mit | 1,487 |
"""
Encapsulate some of the commands to communicate with a Digital Multimeter.
"""
import re
_curly = re.compile(r'{.*}')
class _DMM1(object):
models = ('34465A',)
commands = {
'voltage': 'MEASURE:VOLTAGE:{ACDC}? [{RANGE}[,{RESOLUTION}]]',
}
class _DMM2(object):
models = ('3458A',)
comm... | MSLNZ/msl-equipment | msl/equipment/resources/dmm.py | Python | mit | 3,605 |
# flake8: noqa
"""
This is pure Python implementation of tree traversal algorithms
"""
from __future__ import annotations
import queue
class TreeNode:
def __init__(self, data):
self.data = data
self.right = None
self.left = None
def build_tree():
print("\n********Press N to stop en... | TheAlgorithms/Python | searches/binary_tree_traversal.py | Python | mit | 9,012 |
import numpy as np
import pandas as pd
from pyFTS.models.seasonal import common
class SeasonalIndexer(object):
"""
Seasonal Indexer. Responsible to find the seasonal index of a data point inside its data set
"""
def __init__(self,num_seasons, **kwargs):
self.num_seasons = num_seasons
s... | petroniocandido/pyFTS | pyFTS/models/seasonal/SeasonalIndexer.py | Python | gpl-3.0 | 6,810 |
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | programa-stic/barf-project | barf/arch/arm/parser.py | Python | bsd-2-clause | 13,135 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Created by xixijun
# Date: 15-5-14
# Blog: morningchen.com
from os import getcwd
from os.path import join
class FileObject:
'''给文件对象进行包装从而确认在删除时文件流关闭'''
def __init__(self, filepath=getcwd(), filename='sample.txt'):
# 读写模式打开一个文件
self.file = open... | chen2aaron/SnirteneCodes | Fragment/magic-del.py | Python | gpl-2.0 | 507 |
from __main__ import vtk, qt, ctk, slicer
import Resources
import PythonQt
#
# CMRToolkitWizard
#
class CMRToolkitWizard:
def __init__(self, parent):
parent.title = "CMR Toolkit Wizard"
parent.categories = ["Cardiac MRI Toolkit"]
parent.dependencies = []
parent.contributors = ["Salma Bengali (CARMA)... | carma-center/carma_slicer_extension | CMRToolkitWizard/CMRToolkitWizard.py | Python | bsd-2-clause | 6,887 |
# -*- coding: utf-8 -*-
import os
import sys
import os.path
import click
import six
import io
import tempfile
import pathlib
import glob
import shutil
import fnmatch
import yaml
import zipfile
import gzip
import stat
import copy
from .pathutils import (
get_path_owner,
get_path_group,
chown,
compute_re... | starofrainnight/abhealer | abhealer/__main__.py | Python | apache-2.0 | 15,279 |
# (C) Copyright 2016-2017, 2020 by Rocky Bernstein
"""
CPython 3.2 bytecode opcodes
This is a like Python 3.2's opcode.py with some classification
of stack usage.
"""
import xdis.opcodes.opcode_3x as opcode_3x
from xdis.opcodes.base import (
extended_format_ATTR,
extended_format_CALL_FUNCTION,
extended_fo... | rocky/python-xdis | xdis/opcodes/opcode_32.py | Python | gpl-2.0 | 1,464 |
import logging
import re
from pathlib import Path
from pdfminer.converter import TextConverter
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFPageInterpreter
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from... | tiffanyjaya/kai | kai/pdf-parser/parser.py | Python | mit | 1,707 |
# Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""mmCIF parser (partly implemented in C)."""
from string import letters
import numpy
f... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/PDB/MMCIFParser.py | Python | gpl-2.0 | 5,724 |
__author__ = 'digao'
def search_diamond(graph):
for i in xrange(len(graph)):
inherits = list(graph[i])
visited = set()
while inherits:
el = inherits.pop()
if el in visited:
return True
visited.add(el)
inherits.extend(graph[el]... | digaobarbosa/algorithms | diamond.py | Python | mit | 801 |
import sys
sys.path.append("../")
from legendre import *
import numpy as np
print PlmSchmidt(8, np.sin(np.pi/4))
| dchandan/PySHTOOLS | tests/test_legendre.py | Python | bsd-3-clause | 115 |
import socket
import struct
from Trafficker.layer.layer import layer
class VLAN(layer):
IPv4 = 0x0800
IPv6 = 0x86dd
ARP = 0x0806
def __init__(self):
pass
def pack(self):
pass
@staticmethod
def unpack(packet):
v = VLAN()
data = struct.unpack('!BBH', pack... | LyleMi/Trafficker | Trafficker/layer/vlan.py | Python | mit | 733 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='triton',
version='3.4.1',
description='Extended tryton daemon helpful for debugging',
long_description=open('README.rst').read(),
author="Prakash Pandey",
author_email="prakashpp.pandey@gmail.com",
url="... | prakashpp/triton | setup.py | Python | bsd-3-clause | 985 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import wagtail.contrib.wagtailroutablepage.models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0013_update_golive_expire_help_text'),
('routablepagetests', '0001_i... | mephizzle/wagtail | wagtail/tests/routablepage/migrations/0002_auto_20150407_1121.py | Python | bsd-3-clause | 940 |
# coding: utf-8
from __future__ import unicode_literals
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
from ..utils import (
determine_ext,
dict_get,
ExtractorError,
int_or_none,
float_or_none,
parse_duration,
... | oskar456/youtube-dl | youtube_dl/extractor/niconico.py | Python | unlicense | 18,635 |
#coding:utf-8
"""
-------------------------------------------------------------------------------
Name: split_featureclass.py
Purpose: フィーチャクラスを属性値で分割
Author: horui
Created: 30/09/2015
-------------------------------------------------------------------------------
"""
import arcpy
... | EsriJapan/arcgis-samples-py | ArcMap/data_source/split_featureclass/Script/split_featureclass.py | Python | apache-2.0 | 3,715 |
# PondALGAE - A simulated networked life simulation
# Copyright (C) 2013 Jack Edge
#
# 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 ... | coiax/pondalgae | display.py | Python | gpl-3.0 | 3,399 |
import logging
from pajbot.managers.handler import HandlerManager
from pajbot.managers.redis import RedisManager
from pajbot.modules.base import ModuleSetting
from pajbot.modules.quest import QuestModule
from pajbot.modules.quests import BaseQuest
log = logging.getLogger(__name__)
class TypeMeMessageQuestModule(Bas... | pajlada/tyggbot | pajbot/modules/quests/typememessage.py | Python | mit | 2,350 |
from dejavu.database import get_database, Database
import dejavu.decoder as decoder
import fingerprint
import multiprocessing
import os
import traceback
import sys
class Dejavu(object):
SONG_ID = "song_id"
SONG_NAME = 'song_name'
CONFIDENCE = 'confidence'
MATCH_TIME = 'match_time'
OFFSET = 'offse... | pierater/dejavu | dejavu/__init__.py | Python | mit | 7,117 |
#Python
import socket
from threading import *
# display board in console
def formatboard(gb):
print ("{}|{}|{}\n-----\n{}|{}|{}\n-----\n{}|{}|{}".format(gb[0],gb[1],gb[2],gb[3],gb[4],gb[5],gb[6],gb[7],gb[8]))
# setup and connect socket, to server running on same machine
clientsocket = socket.socket(socket.AF_INE... | jacobzeransky/python-multiplayerserver | client.py | Python | mit | 2,572 |
# <pep8-80 compliant>
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# ... | Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons_contrib/uv_magic_uv/muv_common.py | Python | gpl-3.0 | 1,988 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
"""New view_power permission for systems
Revision ID: 42c18b6580e0
Rev... | jtoppins/beaker | Server/bkr/server/alembic/versions/42c18b6580e0_view_power_permission.py | Python | gpl-2.0 | 940 |
"""Mission Clock event model."""
from access_log import AccessLog
from time_period import TimePeriod
from django.db import models
from django.utils import timezone
class MissionClockEvent(AccessLog):
"""Marker for a team going on/off mission clock."""
# Whether the team is now on the mission clock.
team_... | justineaster/interop | server/auvsi_suas/models/mission_clock_event.py | Python | apache-2.0 | 2,219 |
import cntk
from cntk import Trainer
from cntk.learners import sgd
from cntk.ops import *
from cntk.io import *
from cntk.initializer import *
from cntk.layers import *
import cntk.logging.graph as pg
from cntk.device import *
import pylab
from DATA import fakedata
from sklearn.preprocessing import StandardScaler, Min... | BEugen/AI | CNTK/cntk-7.py | Python | gpl-3.0 | 4,310 |
import boto
from amslib.core.manager import BaseManager
from amslib.instance.instance import InstanceManager
import argparse
from errors import *
import pprint
import time
pp = pprint.PrettyPrinter(indent=4)
# Custom HealthCheck object to add support for failure threshold...seems to have been missed in boto
class He... | ThisLife/aws-management-suite | amslib/network/route53.py | Python | mit | 46,031 |
# Copyright 2012 Nebula, 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 ... | angdraug/nova | nova/tests/api/openstack/compute/plugins/v3/test_server_password.py | Python | apache-2.0 | 2,668 |
from django.db import models
class BTCSellOrderManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(type='SELLBTC')
class BTCBuyOrderManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(type='BUYBTC')
| CryptTrader/CryptTrader | trader/core/managers.py | Python | mit | 295 |
"""
Page object for Bitcoin price Page.
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import conf.locators_conf as locators
from utils.Wrapit import Wrapit
from .Mobile_Base_Page import Mobile_Base_Page
class Bitcoin_Price_Page(Mobile_Base_Page):
"Page objec... | qxf2/qxf2-page-object-model | page_objects/bitcoin_price_page.py | Python | mit | 1,457 |
import unittest
from conans.model.conan_file import ConanFile
from conans.model.env_info import EnvValues
from conans.model.settings import Settings
from conans.test.utils.tools import TestClient
class ConanFileTest(unittest.TestCase):
def test_conanfile_naming(self):
for member in vars(ConanFile):
... | luckielordie/conan | conans/test/model/conanfile_test.py | Python | mit | 1,747 |
# -*- coding: utf-8 -*-
# Taboot - Client utility for performing deployments with Func.
# Copyright © 2009,2010, Red Hat, 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 ... | abutcher/Taboot | taboot-func/modjk.py | Python | gpl-3.0 | 5,644 |
'''
Window Pygame: windowing provider based on Pygame
.. warning::
Pygame has been deprecated and will be removed in the release after Kivy
1.11.0.
'''
__all__ = ('WindowPygame', )
# fail early if possible
import pygame
from kivy.compat import PY2
from kivy.core.window import WindowBase
from kivy.core impo... | akshayaurora/kivy | kivy/core/window/window_pygame.py | Python | mit | 17,119 |
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.files import File
from .models import Papermail
from django.conf import settings
import magic
from wand.image import Image
from os import remove
from uuid import uuid4
media_root = getattr(settings, 'ME... | Humch/django-paperworks | paperworks/signals.py | Python | mit | 2,027 |
# Copyright 2015 Lukas Lalinsky
#
# 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
#... | cloudera/hue | desktop/core/ext-py/phoenixdb-1.1.0/phoenixdb/avatica/client.py | Python | apache-2.0 | 22,784 |
# Fall 2015 6.034 Lab 5: k-Nearest Neighbors and Identification Trees
import xmlrpclib
import traceback
import sys
import os
import tarfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
"""
try:
from key import USERNAME as username, PASSWORD as password, XMLRPC_URL ... | jasonleaster/MIT_6.034_2015 | lab5/tester.py | Python | gpl-2.0 | 10,769 |
from geojson import Point
print('''
{
"type": "FeatureCollection",
"features": [
''')
for i in range(10):
if i == range(10)[-1]:
print('''
{
"type": "Feature",
"properties": {},
"geometry": ''')
print("\t\t\t",Point((i,0)))
... | peterhogan/GeoJSON | geojson_gen.py | Python | gpl-3.0 | 589 |
#!/usr/bin/env python
# coding: utf-8
from rosalind import binom
def pbinom(n, p, r):
return binom(n, r) * pow(p, r) * pow(1 - p, n - r)
def dbinom(n, p, r):
return sum(pbinom(n, p, i) for i in range(r + 1))
def lia(k, N):
t = 1 << k
return 1 - dbinom(t, .25, N - 1)
if __name__ == "__main__":
... | genos/online_problems | rosalind/lia.py | Python | mit | 431 |
#!/usr/bin/env python
######################################################################################
# DATE: 2016/August/10
#
# MODULE: anova_fixed.py
#
# VERSION: 1.0
#
# AUTHOR: Miguel Ibarra (miguelib@ufl.edu) ed. Matt Thoburn (mthoburn@ufl.edu)
#
# DESCRIPTION: This tool runs a fixed effects multiway ANO... | secimTools/SECIMTools | src/scripts/anova_fixed.py | Python | mit | 7,058 |
#
# ImageViewAgg.py -- classes for the display of FITS files on AGG surfaces
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import numpy
from io import BytesIO
import... | eteq/ginga | ginga/aggw/ImageViewAgg.py | Python | bsd-3-clause | 6,004 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import operator
from django.db.models import Q
from django.http import Http404, HttpResponse
from django.views.generic import CreateView, View
from django.views.generic.list import MultipleObjectMixin
from django.core.urlresolvers import reve... | dinoperovic/django-shop-catalog | catalog/views.py | Python | bsd-3-clause | 9,295 |
#!/bin/sh
"""": # -*-python-*-
bup_python="$(dirname "$0")/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
import sys, stat, time, os, errno, re
from bup import metadata, options, git, index, drecurse, hlinkdb
from bup.drecurse import recursive_dirlist
from bup.hashsplit import GIT_... | gevaerts/bup | cmd/index-cmd.py | Python | lgpl-2.1 | 11,069 |
import argparse
# Parameters
parser = argparse.ArgumentParser(description='Catcher')
parser.add_argument('--grid', dest='grid', type=int, default=11, help='Game grid size.')
parser.add_argument('--memory', dest='memory', type=int, default=500, help='Experience replay memory length')
parser.add_argument('--epoch', dest... | EderSantana/X | examples/catcher_cnn.py | Python | bsd-3-clause | 2,385 |
# auto-register file for django_xmlrpc
# from .views import wp
# import metaWeblog
"""
This file defines XMLRPC methods for use
by XBlog. Works with django-xmlrpc
"""
XMLRPC_METHODS = (
('xblog.views.blogger.deletePost', 'blogger.deletePost'),
('xblog.views.blogger.getRecentPosts', 'blogger.getRecentPosts'),... | rubeon/django-xblog | xblog/xmlrpc_settings.py | Python | bsd-2-clause | 2,067 |
# -*- coding: utf-8 -*-
import inspect
import logging
import requests
import xmltodict
from xml.parsers.expat import ExpatError
from optionaldict import optionaldict
from wechatpy.crypto import WeChatRefundCrypto
from wechatpy.utils import random_string
from wechatpy.exceptions import WeChatPayException, InvalidSign... | messense/wechatpy | wechatpy/pay/__init__.py | Python | mit | 9,326 |
"""
Django settings for ExtremeArchives project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR,... | sagnew/ExtremeArchives | ExtremeArchives/ExtremeArchives/settings.py | Python | mit | 2,166 |
# Copyright (c) 2013 Hortonworks, 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 ... | henaras/sahara | sahara/tests/unit/plugins/hdp/test_clusterspec_hdp2.py | Python | apache-2.0 | 93,193 |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... | cloudnull/rpc-maas | playbooks/files/rax-maas/plugins/maas_common.py | Python | apache-2.0 | 32,214 |
import sys
if sys.version_info[0] >= 3:
num=int(input("Please enter a number: "))
check=int(input("Please enter another number: "))
else:
num=int(raw_input("Please enter a number: "))
check=int(raw_input("Please enter another number: "))
if num % 4 == 0:
print("\n"+str(num)+"is a multiple of 4")
else:
if num%2 ... | RadoslavGYordanov/hackerschool | PracticePython/exercise2.py | Python | mit | 534 |
"""
"""
from Tkinter import *
from areavi import AreaVi
from ttk import Notebook
class PanedHorizontalWindow(PanedWindow):
"""
"""
def __init__(self, *args, **kwargs):
"""
"""
PanedWindow.__init__(self, orient=HORIZONTAL, *args, **kwargs)
def create_area(self):
""... | kk9599/vy | vyapp/notevi.py | Python | mit | 2,502 |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1BIOS(o... | kubevirt/client-python | kubevirt/models/v1_bios.py | Python | apache-2.0 | 3,101 |
"""
Fabfile lets us run a script to deploy our Django app onto AWS EC2 server
For now these are just reminders of what commands are mostly used
Run on server like so:
$fab -H localhost,linuxbox host_type
"""
import boto, boto.ec2
from fabric.api import run, cd, env, prompt, put, sudo, local
from fabri... | WilliamQLiu/job-waffle | fabfile.py | Python | apache-2.0 | 2,770 |
"""
Python script send_audit_reports
Created by Anne Pajon under user 'pajon01' on 26/07/2016
"""
import argparse
import os
import pandas as pd
import smtplib
from email import Encoders
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
# import site ... | pajanne/ngsreports | legacy/send_audit_reports.py | Python | mit | 4,524 |
import random, math, copy
import numpy as np
class BinaryNode(object):
def __init__(self, value = None, arity = 2, children = []):
self.value = value
self.arity = arity
self.children = children
def __repr__(self, level=0):
ret = "\t"*level+repr(self.value)+"\n"
for chil... | alceubissoto/gp-tcc | treep3.py | Python | mit | 16,477 |
## Copyright 2003-2007 Luc Saffre
## This file is part of the Lino project.
## Lino is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version... | MaxTyutyunnikov/lino | obsolete/src/lino/adamo/schema.py | Python | gpl-3.0 | 22,142 |
# -*- coding: utf-8 -*-
"""
Django settings for wazers.pl project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.p... | wazerspl/backend | wazerspl/config/common.py | Python | agpl-3.0 | 12,690 |
import requests
class HttpClient():
def get_response(url, url_components):
return requests.get(url, **url_components)
| nicole-a-tesla/meetup.pizza | meetup/services/http_client.py | Python | mit | 126 |
from healing.handler_plugins import base
from healing import exceptions
from healing.openstack.common import log as logging
from healing import utils
LOG = logging.getLogger(__name__)
class Mistral(base.HandlerPluginBase):
"""Trigger mistral workflow.
Data format in action_meta is:
{"workflow": "name",... | lcostantino/healing-os | healing/handler_plugins/mistral.py | Python | apache-2.0 | 2,460 |
from flask import render_template, request, redirect, abort, jsonify, url_for, session
from CTFd.utils import sha512, is_safe_url, authed, mailserver, sendmail, can_register
from CTFd.models import db, Teams
from itsdangerous import TimedSerializer, BadTimeSignature
from passlib.hash import bcrypt_sha256
from flask im... | sigma-random/CTFd | CTFd/auth.py | Python | apache-2.0 | 5,769 |
#!/usr/bin/python2.5
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License')
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | rekbun/browserscope | categories/network/test_set.py | Python | apache-2.0 | 14,143 |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | garyjyao1/ansible | lib/ansible/modules/extras/cloud/amazon/ecs_task.py | Python | gpl-3.0 | 9,498 |
import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="side", parent_name="contourcarpet.colorbar.title", **kwargs
):
super(SideValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotly/plotly.py | packages/python/plotly/plotly/validators/contourcarpet/colorbar/title/_side.py | Python | mit | 500 |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from gpu_test_expectations import GpuTestExpectations
# See the GpuTestExpectations class for documentation.
class WebGLConformanceExpectatio... | SaschaMester/delicium | content/test/gpu/gpu_tests/webgl_conformance_expectations.py | Python | bsd-3-clause | 33,515 |
# Copyright (c) 2010 Guilherme Gondim and contributors
#
# This file is part of Django Admin Help.
#
# Django Admin Help is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README for copying conditions.
"""
**Django Ad... | semente/django-adminhelp | adminhelp/__init__.py | Python | lgpl-3.0 | 963 |
import pytest
from screener.helpers import init_loggers
from screener.settings import MAX_VERBOSITY
from tests.helpers import get_resource
@pytest.fixture()
def example_site_source():
return get_resource('example_com.html')
@pytest.fixture(autouse=True)
def enable_loggers():
init_loggers(verbose_level=MAX_... | netanelravid/screener | tests/conftest.py | Python | apache-2.0 | 331 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with an equivalent malleability clone
#
from test_framework.test_framework im... | OneCoin-development/OneCoin | qa/rpc-tests/txn_clone.py | Python | mit | 7,986 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.