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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
""" Sahana Eden Common Alerting Protocol (CAP) Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to dea... | michaelhowden/eden | modules/s3db/cap.py | Python | mit | 86,498 |
from django.shortcuts import render, render_to_response, get_object_or_404
from django.template import RequestContext
# Create your views here.
from django.views.generic import ListView, DetailView
from .models import Category, Product
from cart.forms import CartAddProductForm
def category_list(request):
return... | sunlaiqi/fundiy | src/shop/views.py | Python | mit | 1,636 |
# 005_cleaner.py
#####################################################################
##################################
# Import des modules et ajout du path de travail pour import relatif
import sys
sys.path.insert(0 , 'C:/Users/WILLROS/Perso/Shade/scripts/LocalWC-Shade-App/apis/')
from voca import AddLog , ... | sighill/shade_app | apis/raw/005_raw/005_cleaner.py | Python | mit | 1,625 |
#!/usr/bin/python
"""
title : testtermopi.py
description : This program runs the termopi.py
: Displays the status of the resources (cpu load and memory usage) consumed by a Raspberry Pi
computer and the resources consumed by one or more containers instantiated in the Pi... | AdL1398/PiCasso | source/modules/tester/testtermopi.py | Python | mit | 1,603 |
from . import packet
class Packet5(packet.Packet):
def __init__(self, player, slot):
super(Packet5, self).__init__(0x5)
self.add_data(player.playerID)
self.add_data(slot)
self.add_structured_data("<h", 0) # Stack
self.add_data(0) # Prefix
self.add_structured_data... | flammified/terrabot | terrabot/packets/packet5.py | Python | mit | 340 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('managers', '0011_auto_20150422_2018'),
]
operations = [
migrations.AlterField(
model_name='managerprofile',
... | ritashugisha/ASUEvents | ASUEvents/managers/migrations/0012_auto_20150422_2019.py | Python | mit | 511 |
from distutils.core import setup
version = '1.1.1'
setup(name='CacheGenerator',
version=version,
description="CacheGenerator for Django",
author="Ricardo Santos",
author_email="ricardo@getgears.com",
url="http://github.com/ricardovice/CacheGenerator/",
packages = ['cachegenerator']... | ricardovice/CacheGenerator | setup.py | Python | mit | 329 |
"""Shared pytest fixtures and test data."""
import copy
import uuid
import pytest
from django.contrib.auth import get_user_model
from onfido.models import Applicant, Check, Event, Report
APPLICANT_ID = str(uuid.uuid4())
CHECK_ID = str(uuid.uuid4())
IDENTITY_REPORT_ID = str(uuid.uuid4())
DOCUMENT_REPORT_ID = str(uuid... | yunojuno/django-onfido | tests/conftest.py | Python | mit | 8,575 |
#!/usr/bin/env python3
# JN 2015-07-29
"""
Log file parser for Cheetah by Johannes Niediek
This script reads out the reference settings
by sequentially following all crs, rbs, and gbd commands.
Please keep in mind that the following scenario is possible with Cheetah:
Start the recording
Stop the recording
Change the... | jniediek/combinato | tools/parse_cheetah_logfile.py | Python | mit | 19,113 |
# Simple plotter for Gut books.
# All this does is draw a sqare for every stat in the input
# and color it based on the score.
#
# Another fine example of how Viz lies to you. You will
# need to fudge the range by adjusting the clipping.
import numpy as np
import matplotlib.pyplot as plt
import sys as sys
if len(s... | craigulmer/gut-buster | squareplot.py | Python | mit | 1,320 |
from verbs.baseforms import forms
class SuspendForm(forms.VerbForm):
name = "Suspend"
slug = "suspend"
duration_min_time = forms.IntegerField() | Bionetbook/bionetbook | bnbapp/bionetbook/_old/verbs/forms/suspend.py | Python | mit | 159 |
from __future__ import absolute_import
import json
from twisted.internet import defer, error
from twisted.python import failure
from twisted.test import proto_helpers
from twisted.trial import unittest
from txjsonrpc import jsonrpc, jsonrpclib
class TestJSONRPC(unittest.TestCase):
def setUp(self):
self.... | Julian/txjsonrpc-tcp | txjsonrpc/tests/test_jsonrpc.py | Python | mit | 8,101 |
import pytest
from canon.seq.seqreader import SeqReader
from .. import resource
def test_read_seq():
reader = SeqReader(resource('seq/Quartz_500Mpa_.SEQ'))
reader.get_Om()
Z, _, N = reader.get_Zmap('orsnr___')
def test_merge_Zmap():
reader = SeqReader()
reader.read_seq(resource('seq/au30_a1_.SE... | structrans/Canon | test/seq/test_seqreader.py | Python | mit | 560 |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 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 the importmulti RPC.
Test importmulti by generating keys on node0, importing the scriptPubKeys an... | Bitcoin-ABC/bitcoin-abc | test/functional/wallet_importmulti.py | Python | mit | 37,468 |
import os
import json
from base import BaseController
from nqueens.models import Piece, Panel, Meta
class NQueensController(BaseController):
def __init__(self, view):
super(NQueensController, self)
self._piece_data = None
self._piece_cache = None
self.view = view
@classmethod... | PereBal/advanced-algorithms | nqueens/controller.py | Python | mit | 2,927 |
#!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""
Organizaţia Internaţională a Aviaţiei Civile propune un alfabet în care
fiecărei litere îi este asignat un cuvânt pentru a evita problemele în
înțelegerea mesajelor critice.
Pentru a se păstra un istoric al conversațiilor s-a decis transcrierea lor
conform următoarelo... | iulianbute/labs | python/solutii/iulian_andrei/icao/from_icao.py | Python | mit | 1,888 |
#!/usr/bin/env python3
import os
import random
import unittest
import warnings
from math import exp, pi
import gpytorch
import torch
from gpytorch.distributions import MultivariateNormal
from gpytorch.kernels import InducingPointKernel, RBFKernel, ScaleKernel
from gpytorch.likelihoods import GaussianLikelihood
from g... | jrg365/gpytorch | test/examples/test_sgpr_regression.py | Python | mit | 6,354 |
"""
Django settings for apps project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
from... | pattu777/LearningDjango | apps/apps/settings.py | Python | mit | 3,307 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Sorsly/subtle | google-cloud-sdk/lib/surface/spanner/databases/create.py | Python | mit | 2,377 |
# -*- coding: utf-8 -*-
#
# M2Crypto documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 20 11:15:12 2017.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | Edzvu/Edzvu.github.io | M2Crypto-0.35.2/doc/conf.py | Python | mit | 9,150 |
#!/usr/local/bin/python3
from zeroconf import Zeroconf, ServiceInfo
import socket
import configparser
from . import hazc_cmd
# import pdb
class hazc_device:
#Forward constants
NO_PARAM = hazc_cmd.NO_PARAM
BOOL = hazc_cmd.BOOL
FLOAT = hazc_cmd.FLOAT
STRING = hazc_cmd.STRING
INT = hazc_cmd.... | ArcAwe/hazc | hazc_device.py | Python | mit | 6,518 |
from victor.exceptions import (
FieldValidationException,
FieldTypeConversionError,
FieldRequiredError,
VectorInputTypeError
)
class Field(object):
required = True
"""Field is required and an exception will be raised if missing"""
missing_value = None
"""Value to use when field is mis... | alexph/victor | victor/vector.py | Python | mit | 4,717 |
#!/usr/bin/env python
#
# Copyright (c) 2014 Hamilton Kibbe <ham@hamiltonkib.be>
#
# 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 ... | hamiltonkibbe/PyAbleton | pyableton/__init__.py | Python | mit | 1,356 |
"""
Django settings for figexample 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, ...)... | arbiterofcool/fig-seed | template/fig-django/figexample/settings.py | Python | mit | 2,114 |
# -*- coding:utf-8 -*-
import abc
import platform
from UserList import UserList
class Monitor(object):
@abc.abstractmethod
def current(self):
pass
@abc.abstractmethod
def percent(self, range):
pass
@abc.abstractmethod
def reset(self):
pass
@abc.abstractmethod
... | x007007007/pyScreenBrightness | src/pyScreenBrightness/base.py | Python | mit | 1,127 |
# -*- coding: utf-8 -*-
"""
Forms for day forms
"""
from django.conf import settings
from django import forms
from django.utils.translation import ugettext as _
from arrow import Arrow
from datebook.models import DayEntry
from datebook.forms import CrispyFormMixin
from datebook.utils.imports import safe_import_module... | sveetch/django-datebook | datebook/forms/day.py | Python | mit | 6,638 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/core/tools/special.py | Python | mit | 24,211 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Provides:
- List; like list but returns None instead of IndexOutOfBounds
- Storage; like dictionary ... | shashisp/blumix-webpy | app/gluon/storage.py | Python | mit | 8,573 |
#!/usr/bin/env python
from ..debugging import bacpypes_debugging, ModuleLogger
from ..capability import Capability
from ..basetypes import ErrorType, PropertyIdentifier
from ..primitivedata import Atomic, Null, Unsigned
from ..constructeddata import Any, Array, ArrayOf, List
from ..apdu import \
SimpleAckPDU, Re... | JoelBender/bacpypes | py27/bacpypes/service/object.py | Python | mit | 15,660 |
# Copyright (C) 2012-2020 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | earwig/mwparserfromhell | src/mwparserfromhell/definitions.py | Python | mit | 3,915 |
from __future__ import print_function
from __future__ import division
# python bpzchisq2run.py ACS-Subaru
# PRODUCES ACS-Subaru_bpz.cat
# ADDS A FEW THINGS TO THE BPZ CATALOG
# INCLUDING chisq2 AND LABEL HEADERS
# ~/p/bpzchisq2run.py NOW INCLUDED!
# ~/Tonetti/colorpro/bpzfinalize7a.py
# ~/UDF/Elmegreen/phot8/bpzfinal... | boada/planckClusters | MOSAICpipe/bpz-1.99.3/bpzfinalize.py | Python | mit | 4,563 |
#==============================================================================
#description : Solves travelling salesman problem by using Hill Climbing.
#author : Yakup Cengiz
#date : 20151121
#version : 0.1
#notes :
#python_version : 3.5.0
#Reference : http://www.psy... | yakupc/Artificial-Intelligence | Algorithms/SolveTSPSimulatedAnnealing/SolveTSPSimulatedAnnealing.py | Python | mit | 4,196 |
"""django_todo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | GunnerJnr/_CodeInstitute | Stream-3/Full-Stack-Development/21.Django REST Framework/4.User-Authentication/django_todo/django_todo/urls.py | Python | mit | 869 |
"""
Example
-------
class SystemSetting(KVModel):
pass
setting = SystemSetting.create(key='foo', value=100)
loaded_setting = SystemSetting.get_by_key('foo')
"""
from django.db import models
from .fields import SerializableField
class KVModel(models.Model):
"""
An Abstract model that has key and value... | amdorra/django-kvmodel | kvmodel/models.py | Python | mit | 1,100 |
import re
from datetime import datetime
from flask import current_app as app
from flask_jwt import current_identity
from flask_restplus import Namespace, Resource, fields, reqparse
from sqlalchemy.exc import IntegrityError
from packr.models import Message
api = Namespace('contact',
description='Opera... | KnightHawk3/packr | packr/api/contact.py | Python | mit | 4,011 |
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | ansible/ansible-lint | src/ansiblelint/rules/MercurialHasRevisionRule.py | Python | mit | 1,951 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup
setup(
name='libipa',
version='0.0.6',
author='Andrew Udvare',
author_email='audvare@gmail.com',
packages=['ipa'],
scripts=['bin/ipa-unzip-bin', 'bin/ipa-dump-info'],
url='https://github.com/Tatsh/libipa',
licens... | Tatsh/libipa | setup.py | Python | mit | 555 |
"""
Support to interface with Sonos players (via SoCo).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.sonos/
"""
import datetime
import logging
from os import path
import socket
import urllib
import voluptuous as vol
from homeassistant.com... | betrisey/home-assistant | homeassistant/components/media_player/sonos.py | Python | mit | 20,355 |
"""
"""
import logging
import time
import hiro
import mock
from flask import Flask, request
from werkzeug.exceptions import BadRequest
from flask_limiter.extension import C, Limiter
from flask_limiter.util import get_remote_address
def test_reset(extension_factory):
app, limiter = extension_factory({C.DEFAULT_... | alisaifee/flask-limiter | tests/test_flask_ext.py | Python | mit | 20,218 |
#!/usr/bin/env python
##############################################
#
# This module contains some utilities
#
##############################################
class argpasser(object):
"""
ComEst use the arguments that are almost repeatedly. Therefore, it will be useful to create a customized arguemnt passer ... | inonchiu/ComEst | comest/utils.py | Python | mit | 4,398 |
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-email-subscription',
url='https://github.com/MagicSolutions/django-email-subscrip... | MagicSolutions/django-email-subscription | setup.py | Python | mit | 888 |
# ~*~ encoding: utf-8 ~*~
from pymongo import MongoClient
from pandas import read_csv
from datetime import date
mongodb = MongoClient('192.168.178.82', 9999)
db = mongodb['dev']
drug_collection = db['drug']
drugs = read_csv('~/Dokumente/bfarm_lieferenpass_meldung.csv', delimiter=';', encoding='iso8859_2').to_dict()
... | schenkd/webdev-project | data_import.py | Python | mit | 1,815 |
"""Molt Web API with Interface."""
import re
import redis
import docker
import subprocess
import os
import shlex
import requests
import sys
import argparse
from flask import Flask, Response, render_template, abort, request
from molt import Molt, MoltError
app = Flask(__name__)
# コマンドライン引数のパース
parser = argparse.Argum... | swkoubou/molt | molt_app.py | Python | mit | 5,850 |
from django.contrib import admin
try:
from django.contrib.auth import get_permission_codename
except ImportError: # pragma: no cover
# Django < 1.6
def get_permission_codename(action, opts):
return '%s_%s' % (action, opts.object_name.lower())
class ObjectPermissionsModelAdminMixin(object):
d... | smcoll/django-rules | rules/contrib/admin.py | Python | mit | 1,879 |
# -*- coding: utf-8 -*-
"""
Production Configurations
- Use Redis for cache
"""
from __future__ import absolute_import, unicode_literals
from boto.s3.connection import OrdinaryCallingFormat
from django.utils import six
from .common import * # noqa
# SECRET CONFIGURATION
# ---------------------------------------... | Patrick-and-Michael/trumptweets | config/settings/production.py | Python | mit | 4,984 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
getname
~~~~~~~
Get popular cat/dog/superhero/supervillain names.
:copyright: (c) 2015 by lord63.
:license: MIT, see LICENSE for more details.
"""
from getname.main import random_name
__title__ = "getname"
__version__ = '0.1.1'
__author__ = "lor... | lord63/getname | getname/__init__.py | Python | mit | 385 |
from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleton(url, assetId)
data["comments"] = self.__iterate... | CodeLionX/CommentSearchEngine | cse/WpApiParser.py | Python | mit | 1,919 |
#!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 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 framework for syscoin utils.
Runs automatically during `make check`.
Ca... | syscoin/syscoin2 | test/util/syscoin-util-test.py | Python | mit | 6,594 |
# pre_NAMD.py
# Creates the files used for NAMD based on the .pdb file dowloaded from PDB bank
#
# Usage:
# python pre_NAMD.py $PDBID
#
# $PDBID=the 4 characters identification code of the .pdb file
#
# Input:
# $PDBID.pdb: .pdb file downloaded from PDB bank
#
# Output:
# $PDBID_p.pdb: .pdb file with water mole... | Xiaofei-Zhang/NAMD_Docking_pipeline | pre_NAMD/pre_NAMD.py | Python | mit | 2,553 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-12-03 13:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('busshaming', '0013_auto_20170917_0502'),
]
operati... | katharosada/bus-shaming | busshaming/migrations/0014_auto_20171203_1316.py | Python | mit | 1,559 |
"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class NonLatticeOneShot:
"""
the simplest devic... | danmackinlay/branching_process | branching_process/nonlattice/fit.py | Python | mit | 6,351 |
"""useful context managers"""
from contextlib import suppress
with suppress(ModuleNotFoundError):
from lag import *
import os
import contextlib
def clog(*args, condition=True, log_func=print, **kwargs):
if condition:
return log_func(*args, **kwargs)
@contextlib.contextmanager
def cd(newdir, verbos... | thorwhalen/ut | util/context_managers.py | Python | mit | 908 |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import warnings
from pymatgen.core.structure import Structure
from pymatgen.core.units import Ha_to_eV, bohr_to_ang
from pymatgen.io.abinit.abiobjects import *
from pymatgen.util.testing import PymatgenTest
class ... | vorwerkc/pymatgen | pymatgen/io/abinit/tests/test_abiobjects.py | Python | mit | 7,463 |
import _plotly_utils.basevalidators
class ArrowcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="arrowcolor", parent_name="layout.annotation", **kwargs
):
super(ArrowcolorValidator, self).__init__(
plotly_name=plotly_name,
par... | plotly/python-api | packages/python/plotly/plotly/validators/layout/annotation/_arrowcolor.py | Python | mit | 479 |
# Copyright (c) 2015 SnapDisco Pty Ltd, Australia.
# All rights reserved.
#
# This source code is licensed under the terms of the MIT license
# found in the "LICENSE" file in the root directory of this source tree.
import sys
if sys.version_info.major >= 3:
from configparser import RawConfigParser
else:
from ... | jboy/nim-pymod | libpy/UsefulConfigParser.py | Python | mit | 5,807 |
#!/usr/bin/python -*- coding:utf-8 -*-
__Author__ = "Riyaz Ahmad Bhat"
__Email__ = "riyaz.ah.bhat@gmail.com"
import re
from collections import namedtuple
from sanity_checker import SanityChecker
class DefaultList(list):
"""Equivalent of Default dictionaries for Indexing Errors."""
def __init__(self, defaul... | darshan95/Shift-Reduce-Chunk-Expander | src/ssf_reader.py | Python | mit | 4,608 |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.md')) as f:
CHANGES = f.read()
requires = [
'pyramid',
'pyramid_jinja2',
'pyramid_debugt... | necaris/embedded-js-in-python-example | setup.py | Python | mit | 1,216 |
"""
atomorder/parse_args.py
Parses command line arguments and overwrites setting defaults
"""
from . import settings
import argparse
import sys
description = ""
epilog = ""
parser = argparse.ArgumentParser(
description = description,
formatter_class = argparse.RawDescriptionHelpFormatter,
ep... | larsbratholm/atomorder | atomorder/parse_args.py | Python | mit | 2,393 |
#!/usr/bin/python
import glob
import os
import shutil
import subprocess
import sys
import yaml
def create_role(role):
ret = subprocess.check_output(
'ansible-galaxy init {}'.format(role).split())
if not ret.strip().endswith('created successfully'):
raise Exception('could not create role "{}"... | waltermoreira/dockeransible | app_builder/app_builder_image/concat_roles.py | Python | mit | 3,259 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Make use of synaptic as backend."""
# Copyright (C) 2008-2010 Sebastian Heinlein <devel@glatzor.de>
# Copyright (C) 2005-2007 Canonical
#
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
# ... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/sessioninstaller/backends/synaptic.py | Python | mit | 3,567 |
from django.test import TestCase
from medicine.models import Medicine
from medicine.views import ListAllMedicines
from user.models import HealthProfessional
class TestListAllMedicines(TestCase):
def setUp(self):
# Making a HealthProfessional
self.view = ListAllMedicines
# Making medica... | fga-gpp-mds/2017.2-Receituario-Medico | medical_prescription/medicine/test/test_view_list_all_medications.py | Python | mit | 676 |
import _plotly_utils.basevalidators
class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bgcolor", parent_name="sankey.node.hoverlabel", **kwargs
):
super(BgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotly/python-api | packages/python/plotly/plotly/validators/sankey/node/hoverlabel/_bgcolor.py | Python | mit | 521 |
from pyperator.decorators import inport, outport, component, run_once
from pyperator.nodes import Component
from pyperator.DAG import Multigraph
from pyperator.utils import InputPort, OutputPort
import pyperator.components | baffelli/pyperator | pyperator/__init__.py | Python | mit | 222 |
import itertools
import os.path
import sys
import time
from . import core
from . import file_io
from . import geometry
from . import stringconv
from . import version
#
# Functions
#
def save_output(profileli, opt):
""" Save a summary of results of evaluated profiles
"""
def m(x, pixelwidth):
retu... | maxdl/Synapse.py | synapse/main.py | Python | mit | 24,280 |
import os
import re
import subprocess
from six.moves.urllib.parse import urlparse, quote_plus
from subprocess import CalledProcessError, PIPE, STDOUT
from conans.client.tools.env import no_op, environment_append
from conans.client.tools.files import chdir
from conans.errors import ConanException
from conans.util.file... | luckielordie/conan | conans/client/tools/scm.py | Python | mit | 5,881 |
### import ####################################################################
import pycmds.project.classes as pc
import pycmds.hardware.hardware as hw
import pathlib
import appdirs
import toml
import yaqc
### driver ####################################################################
class Driver(hw.Driver):
... | wright-group/PyCMDS | pycmds/hardware/spectrometers.py | Python | mit | 2,840 |
u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token, String, Newline, Comma, Name
from libfuturize.fixer_uti... | thonkify/thonkify | src/lib/libpasteurize/fixes/fix_kwargs.py | Python | mit | 6,066 |
#!/usr/bin/env python
__author__ = 'Radoslaw Matusiak'
__copyright__ = 'Copyright (c) 2016 Radoslaw Matusiak'
__license__ = 'MIT'
__version__ = '0.5'
import cmd
import functools
import os
import sys
from polar import Device
from polar.pb import device_pb2 as pb_device
__INTRO = """
_| ... | rsc-dev/loophole | loophole/__main__.py | Python | mit | 9,572 |
import json
import sublime
import sublime_plugin
from .edit import Edit
class PawnBuildPathCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().show_input_panel(
"Working directory that contains pawncc.exe",
"C:\\Pawno\\",
self.onPawnPathDone,
... | Southclaw/pawn-sublime-language | PawnBuildPath.py | Python | mit | 1,010 |
class node:
def __init__(self):
self.outputs=[]
def set(self):
for out in self.outputs:
out.set()
def clear(self):
for out in self.outputs:
out.clear()
class switch:
def __init__(self):
self.outputs=[]
self.state=False
self.input=False
def set(self):
self.input=True
if(self.state):
... | mikadam/LadderiLogical | tests/node.py | Python | mit | 1,030 |
from math import sqrt
def is_prime(x):
for i in xrange(2, int(sqrt(x) + 1)):
if x % i == 0:
return False
return True
def rotate(v):
res = []
u = str(v)
while True:
u = u[1:] + u[0]
w = int(u)
if w == v:
break
res.append(w)
ret... | neutronest/eulerproject-douby | e35/35.py | Python | mit | 586 |
"""
Copyright (c) 2016 Genome Research Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distr... | jeremymcrae/denovoFilter | denovoFilter/missing_symbols.py | Python | mit | 5,967 |
import mock
from tests.compat import unittest
from tests.utils import APITestCase
import evelink.eve as evelink_eve
class EVETestCase(APITestCase):
def setUp(self):
super(EVETestCase, self).setUp()
self.eve = evelink_eve.EVE(api=self.api)
def test_character_names_from_ids(self):
sel... | Morloth1274/EVE-Online-POCO-manager | tests/test_eve.py | Python | mit | 20,398 |
try:
from calais import Calais
except ImportError: # pragma: no cover
Calais = None # NOQA
if Calais is not None:
def process_calais(content, key):
calais = Calais(key)
response = calais.analyze(content)
people = [entity["name"] for entity in getattr(response, "entities", []) if... | prologic/spyda | spyda/processors.py | Python | mit | 385 |
import datetime
day = datetime.datetime.now().weekday()
def get_sunday():
return "Today it's Sunday"
def get_monday():
return "Today it's Monday"
def get_tuesday():
return "Today it's Tuesday"
def get_wednesday():
return "Today it's Wednesday"
def get_thursday():
return "Today it's Thursday"
def g... | vickyi/scoala | pachong/pythonClass/switch.py | Python | mit | 685 |
from django.conf.urls import url
from timeline import views
urlpatterns = [
url(r'^$', views.timelines, name='timelines'),
] | fredwulei/fredsneverland | fredsneverland/timeline/urls.py | Python | mit | 130 |
from contextlib import contextmanager
from functools import wraps
from werkzeug.local import LocalProxy, LocalStack
_additional_ctx_stack = LocalStack()
__all__ = ("current_additions", "Additional", "AdditionalManager")
@LocalProxy
def current_additions():
"""
Proxy to the currently added requirements
... | justanr/flask-allows | src/flask_allows/additional.py | Python | mit | 5,469 |
import unittest
"""
Given a binary tree, we need to find maximum value we can get by subtracting
value of node B from value of node A, where A and B are two nodes of the binary tree
and A is ancestor of B. Expected time complexity is O(n).
"""
class Node:
def __init__(self, data, left=None, right=None):
s... | prathamtandon/g4gproblems | Graphs/max_difference.py | Python | mit | 1,915 |
# https://www.w3resource.com/python-exercises/
# 3. Write a Python program to display the current date and time.
# Sample Output :
# Current date and time :
# 2014-07-05 14:34:14
import datetime
now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S")
| dadavidson/Python_Lab | Python-w3resource/Python_Basic/ex03.py | Python | mit | 269 |
# #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2018> Gabriel Falcão <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to ... | andresriancho/HTTPretty | tests/functional/test_passthrough.py | Python | mit | 2,551 |
#!/usr/bin/env python3
from SPARQLWrapper import SPARQLWrapper, JSON
import requests
import re
import os
import os.path
import time
import sys
FINTO_ENDPOINT='http://api.dev.finto.fi/sparql'
FINNA_API_SEARCH='https://api.finna.fi/v1/search'
lang = sys.argv[1]
# map ISO 639-1 language codes into the ISO 639-2 codes ... | osma/annif | create_corpus_yso_finna.py | Python | cc0-1.0 | 4,644 |
from django.db import models
# Create your models here.
class Profil(models.Model):
awal = ''
PILIHAN_JENJANG = (
(awal, '----'),
('Pertama', 'Perekayasa Pertama'),
('Muda', 'Perekayasa Muda'),
('Madya', 'Perekayasa Madya'),
('Utama', 'Perekayasa Utama'),
)
nip... | akbarpn136/perek-dj | utiliti/models.py | Python | cc0-1.0 | 1,225 |
#!/usr/bin/python3
#
# Checks that the upstream DNS has been set correctly and that
# TLS certificates have been signed, etc., and if not tells the user
# what to do next.
import sys, os, os.path, re, subprocess, datetime, multiprocessing.pool
import dns.reversename, dns.resolver
import dateutil.parser, dateutil.tz
i... | nstanke/mailinabox | management/status_checks.py | Python | cc0-1.0 | 41,760 |
from colab.plugins.utils.proxy_data_api import ProxyDataAPI
class JenkinsDataAPI(ProxyDataAPI):
def fetch_data(self):
pass
| rafamanzo/colab | colab/plugins/jenkins/data_api.py | Python | gpl-2.0 | 138 |
"""Library for performing speech recognition with the Google Speech Recognition API."""
__author__ = 'Anthony Zhang (Uberi)'
__version__ = '1.0.4'
__license__ = 'BSD'
import io, subprocess, wave, shutil
import math, audioop, collections
import json, urllib.request
#wip: filter out clicks and other too short parts
c... | bizalu/sImulAcre | core/lib/speech_recognition/__init__.py | Python | gpl-2.0 | 10,485 |
from ftw.upgrade import UpgradeStep
from plone import api
class AddLanguageIndex(UpgradeStep):
"""Add Language index."""
def __call__(self):
self.install_upgrade_profile()
ct = api.portal.get_tool("portal_catalog")
survey_results = ct(portal_type="euphorie.survey")
for brain i... | euphorie/Euphorie | src/euphorie/upgrade/deployment/v1/20210720143221_add_language_index/upgrade.py | Python | gpl-2.0 | 429 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | lnielsen/zenodo | tests/unit/github/test_api.py | Python | gpl-2.0 | 10,739 |
# -*- coding: utf-8 -*-
"""sdist tests"""
import os
import shutil
import sys
import tempfile
import unittest
import urllib
import unicodedata
import posixpath
from StringIO import StringIO
from setuptools.command.sdist import sdist
from setuptools.command.egg_info import manifest_maker
from setuptools.dist import D... | xbianonpi/xbian-package-development | content/usr/local/lib/python2.7/dist-packages/distribute-0.6.30-py2.7.egg/setuptools/tests/test_sdist.py | Python | gpl-2.0 | 9,701 |
#!/usr/bin/env python
import os
from setuptools import setup
from subprocess import call
from sys import platform, argv
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
SCRIPTS = ["src/bg_daemon/background_daemon.py"]
# only compile quack when none of these options are chosen... | echenran/bg_daemon | setup.py | Python | gpl-2.0 | 1,862 |
"""
Stateful module base class and interface description.
All stateful Python modules
- Get Skype4Py Skype instance on init - have full control over Skype and
thus are not limited to !command handlers
- Reside in the some modules/ folder as UNIX script modules
- Have .py extension and be ... | mikemike/SkypeBot | unused-modules/stateful.py | Python | gpl-2.0 | 2,755 |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
)
from zope.sqlalchemy import ZopeTransactionExtension
import tornado.web
from handlers.index import IndexHandler
from handlers.sensors import SensorsHandler
import logging
logging.getLogger(... | nextgis/entels_front_demo | entels_demo_tornado/__init__.py | Python | gpl-2.0 | 548 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
v_univar.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... | bstroebl/QGIS | python/plugins/sextante/grass/ext/v_univar.py | Python | gpl-2.0 | 1,499 |
#
#LiloConf.py
#
import sys, re, os
import logging
import GrubConf
class LiloImage(object):
def __init__(self, lines, path):
self.reset(lines, path)
def __repr__(self):
return ("title: %s\n"
" root: %s\n"
" kernel: %s\n"
" args: %s\n"
... | mikesun/xen-cow-checkpointing | tools/pygrub/src/LiloConf.py | Python | gpl-2.0 | 4,887 |
#!/usr/bin/env python2.7
import os
import sys
this_dir = os.path.dirname(os.path.abspath(__file__))
trunk_dir = os.path.split(this_dir)[0]
sys.path.insert(0,trunk_dir)
from ikol.dbregister import DataBase
from ikol import var
if os.path.exists(var.DB_PATH):
os.remove(var.DB_PATH)
DB = DataBase(var.DB_PATH)
... | lokiteitor/ikol | test/DBtest.py | Python | gpl-2.0 | 589 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# TrinityX documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 25 14:04:29 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | clustervision/trinityX | doc/conf.py | Python | gpl-2.0 | 9,991 |
TESTS = {
"Level_1": [
{
"input": [1, 2, 3],
"answer": 2,
"explanation": "3-1=2"
},
{
"input": [5, -5],
"answer": 10,
"explanation": "5-(-5)=10"
},
{
"input": [10.2, -2.2, 0, 1.1, 0.5],
... | Empire-of-Code-Puzzles/checkio-empire-most-numbers | verification/src/tests.py | Python | gpl-2.0 | 2,790 |
# _*_ coding:utf-8 _*_
# Filename:ClientUI.py
# Python在线聊天客户端
from socket import *
from ftplib import FTP
import ftplib
import socket
import thread
import time
import sys
import codecs
import os
reload(sys)
sys.setdefaultencoding( "utf-8" )
class ClientMessage():
#设置用户名密码
def setUsrANDPwd(self,usr,pwd):
... | gzxultra/IM_programming | class_ClientMessage.py | Python | gpl-2.0 | 6,373 |
# pygopherd -- Gopher-based protocol server in Python
# module: serve up gopherspace via http
# $Id: http.py,v 1.21 2002/04/26 15:18:10 jgoerzen Exp $
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | mas90/pygopherd | pygopherd/protocols/http.py | Python | gpl-2.0 | 12,731 |
#
# Copyright 2019-2022 Ghent University
#
# This file is part of vsc-mympirun,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# the Flemish Research Foundat... | hpcugent/vsc-mympirun | test/mytaskprolog.py | Python | gpl-2.0 | 1,831 |
from fabric.api import local
def html():
local('hovercraft -t ./sixfeetup_hovercraft formation_flask.rst ./build/')
| domofwk/domofwk-docs | source/formations/flask/fabfile.py | Python | gpl-2.0 | 122 |