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 flask import Flask
from flask import render_template, request
app = Flask(__name__)
@app.route("/")
def main():
room = request.args.get('room', '')
if room:
return render_template('watch.html')
return render_template('index.html')
if __name__ == "__main__":
app.run(host='0.0.0.0', debug=True)
| victorpoluceno/webrtc-sample-client | app/__init__.py | Python | mit | 314 |
# -*- coding: utf-8 -*-
from nose.plugins.attrib import attr
from filetest import TestTemplates
@attr('templates')
class TestmoinArgs(TestTemplates):
__test__ = True
_xml_file = 'moin.xml'
_expected_source_name = 'moin-clojure'
_expected_package_name = 'libmoin2-clojure'
_commandline_args = '-p ... | jamiepg1/clojurehelper | tests/test_debian_files/test_moin_args.py | Python | mit | 381 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from yosaipy2.core import (
SessionSettings,
InvalidSessionException,
)
from session import session_tuple, SimpleSession, SessionKey
from session import NativeSessionHandler
from yosaipy2.core.utils.utils import get_logger
from typing import Dict
import abcs as sess... | jellybean4/yosaipy2 | yosaipy2/core/session/manager.py | Python | apache-2.0 | 16,674 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-08 06:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('registrazioni', '0004_auto_20151208_0706'),
]
operati... | Byx69/SMes | registrazioni/migrations/0005_auto_20151208_0712.py | Python | gpl-2.0 | 568 |
# permute_data.py
# ---------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to
# http://i... | naderm/cs188 | p5/classification/permute_data.py | Python | bsd-3-clause | 2,650 |
import unittest
import os
from dotenv import load_dotenv
import nlpaug.augmenter.word as naw
class TestSpelling(unittest.TestCase):
@classmethod
def setUpClass(cls):
env_config_path = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..', '.env'))
load_dotenv(e... | makcedward/nlpaug | test/augmenter/word/test_spelling.py | Python | mit | 2,267 |
"""Module for helpers to work with the Job Offers dataset."""
import codecs
import collections
import csv
import logging
import sys
from typing import AbstractSet, Iterator, Optional, Tuple
import pandas as pd
def double_property_frequency(job_offers: pd.DataFrame, column: str, req_column: str) \
-> pd.Data... | bayesimpact/bob-emploi | data_analysis/lib/job_offers.py | Python | gpl-3.0 | 4,345 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/r-rpostgresql/package.py | Python | lgpl-2.1 | 2,292 |
#-----------------------------------------------------------------------------
#remove duplicates v1.3
#best way to remove duplicates, just select the objects you want the duplicates removed, then run this scrpit
import bpy
for obj in bpy.context.selected_objects:
if obj.type == 'MESH':
bpy.data.scenes[0]... | infobeisel/polyvr | extras/blender_scripts/remove_double_vertices_and_faces.py | Python | gpl-3.0 | 2,067 |
# -*- coding: utf-8 -*-
"""
Local settings
- Run in Debug mode
- Use mailhog for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
import socket
import os
from django.conf.global_settings import ALLOWED_HOSTS
from .base import * # noqa
# DEBUG
# -----------------------------------------------... | nectR-Tutoring/nectr | config/settings/local.py | Python | mit | 2,592 |
#!/usr/bin/python
import hid
import time
import sys
import getopt
import os
import platform
import re
# Global Variables #
VENDOR_ID = 0x0801
PRODUCT_ID = 0x0003
DATA_SIZE = 338
enc_formats = ('ISO/ABA', 'AAMVA', 'CADL', 'Blank', 'Other', 'Undetermined', 'None')
vervose = False
output_file = False
last_status = ''
d... | devalfrz/magtek-reader | magtek-reader.py | Python | gpl-2.0 | 4,458 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | adobdin/timmy | timmy/modules/local.py | Python | apache-2.0 | 1,157 |
import json
import re
from collections import defaultdict
from django.conf import settings
from django.db.models import Count
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.template import Context, loader
from django.contrib.contenttypes.models import ContentType
from... | aschampion/CATMAID | django/applications/catmaid/control/data_view.py | Python | gpl-3.0 | 5,209 |
#!/usr/bin/env python
# coding=utf-8
"""
task 任务定制
__created__ = '6/9/15'
__author__ = 'deling.ma'
"""
from django.conf import settings
from django.db import models
# from django.utils.translation import ugettext_lazy as _
JOB_TYPE_CHOICES = []
STATUS_CHOICES = (
(0, "待加入"),
(1, "执行中"),
(-1, "下线"),
)
cl... | madre/devops | task/models.py | Python | mit | 2,182 |
from charms.reactive import Endpoint, when
class TestAltProvides(Endpoint):
invocations = []
@when('endpoint.{endpoint_name}.joined')
def handle_joined(self):
self.invocations.append('joined: {}'.format(self.endpoint_name))
@when('endpoint.{endpoint_name}.changed')
def handle_changed(sel... | juju-solutions/charms.reactive | tests/data/reactive/relations/test-alt/provides.py | Python | apache-2.0 | 561 |
import urwid
from clisnips._types import AnyPath
from clisnips.tui.urwid_types import TextMarkup
from clisnips.tui.widgets.edit import EmacsEdit
from clisnips.tui.widgets.menu import PopupMenu
from clisnips.utils.path_completion import FileSystemPathCompletionProvider, PathCompletion, PathCompletionEntry
from .field i... | ju1ius/clisnips | clisnips/tui/widgets/field/path.py | Python | gpl-3.0 | 3,414 |
"""
Demonstrate how to make instances callable.
"""
class funclike:
def __call__(self, *args, **kwargs):
print("Args are:", args)
print("Kwargs are:", kwargs)
f = funclike()
f(1, 2, 3, this="one", that="the other")
| ceeblet/OST_PythonCertificationTrack | Python3/Python3_Lesson09/src/callmagic.py | Python | mit | 246 |
from django.conf.urls.defaults import patterns, url
from .views import JobDetailView
from ganeti_webmgr.clusters.urls import cluster
job = '%s/job/(?P<job_id>\d+)' % cluster
urlpatterns = patterns(
'ganeti_webmgr.jobs.views',
url(r'^%s/status/?' % job, 'status', name='job-status'),
url(r'^%s/clear/?' % ... | dannyman/ganeti_webmgr | ganeti_webmgr/jobs/urls.py | Python | gpl-2.0 | 425 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | googleapis/python-speech | owlbot.py | Python | apache-2.0 | 2,575 |
#
# This is minimal MicroPython variant of run-tests script, which uses
# .exp files as generated by run-tests --write-exp. It is useful to run
# testsuite on systems which have neither CPython3 nor unix shell.
# This script is intended to be run by the same interpreter executable
# which is to be tested, so should use... | kerneltask/micropython | tests/run-tests-exp.py | Python | mit | 2,691 |
#! /usr/bin/python
from WN_exp import *
from WN_evaluation import *
if theano.config.floatX == 'float32':
sys.stderr.write("""WARNING: Detected floatX=float32 in the configuration.
This might result in NaN in embeddings after several epochs.
""")
launch(op='TransE', dataset='WN', simfn='L1', ndim=20, nhid=20, mar... | while519/SME | WN/WN_TransE.py | Python | bsd-3-clause | 604 |
# -*- coding: utf-8 -*-
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import mock
from contextlib import contextmanager
from odoo import _
from odoo.addons.connector_carepoint import related_action
from .common import SetUpCarepointBase
mk_file = 'odoo.add... | laslabs/odoo-connector-carepoint | connector_carepoint/tests/test_related_action.py | Python | agpl-3.0 | 4,249 |
from django.db import models
class Licensor(models.Model):
name = models.CharField(max_length=255, unique=True)
def __unicode__(self):
return self.name
class Meta:
ordering = ['name']
| jampueroc/scrapper_anime | visualizacion/models/licensor.py | Python | gpl-3.0 | 216 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.contrib.auth import authenticate, login, logout
from django.http import JsonResponse,HttpResponseRedirect,HttpResponse
from django.urls import reverse
from models import *
from django.views.generic import... | 1032231418/python | lesson4/zhangbaocheng/opsweb/accounts/views.py | Python | apache-2.0 | 1,124 |
#!/usr/bin/env python3
import os
import sys
if len(sys.argv) == 2:
assert(os.path.exists(sys.argv[1]))
elif len(sys.argv) == 3:
f1 = sys.argv[1]
f2 = sys.argv[2]
m1 = os.stat(f1).st_mtime_ns
m2 = os.stat(f2).st_mtime_ns
# Compare only os.stat()
if m1 != m2:
raise RuntimeError(f'mti... | pexip/meson | test cases/common/14 configure file/check_file.py | Python | apache-2.0 | 490 |
import logging
import sys
import warnings
from threading import Thread
from time import sleep
from errbot.backends.base import Message, MUCRoom, Presence, RoomNotJoinedError
from errbot.backends.base import ONLINE, OFFLINE, AWAY, DND
from errbot.errBot import ErrBot
from errbot.rendering import text, xhtml
from errbot... | nanorepublica/err | errbot/backends/xmpp.py | Python | gpl-3.0 | 21,380 |
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARRANTY, without impl... | CalthorpeAnalytics/urbanfootprint | footprint/main/resources/presentation_resources.py | Python | gpl-3.0 | 2,697 |
class Solution:
# @param {integer[]} nums1
# @param {integer[]} nums2
# @return {float}
def findMedianSortedArrays(self, nums1, nums2):
num = nums1 + nums2
num.sort()
if len(num) % 2 == 1:
return num[(len(num)-1)/2]
else:
return (float(num[len(num)/2]) + float(num[len(num)/2-1]))/2
print Solution().... | quantumlaser/code2016 | LeetCode/python/sitao/4_median_of_two_sorted_arrays.py | Python | mit | 365 |
import time
import track
import unittest
class TrackTestCase(unittest.TestCase):
def test_version(self):
#def purchase(self, profile_id, currency, gross_amount, net_amount, payment_provider, product):
t = track.Track('EU')
t.purchase(1, 'USD', 10, 10, 'PayPal', 'Gold')
time.sleep(0.1)
| simonz05/track-python | tests/test_track.py | Python | mit | 319 |
import os
import pytest
import parsl
from parsl.app.app import bash_app
from parsl.data_provider.files import File
from parsl.tests.configs.local_threads import config
@bash_app
def cat(inputs=[], outputs=[], stdout=None, stderr=None):
infiles = ' '.join([i.filepath for i in inputs])
return """echo {i}
... | Parsl/parsl | parsl/tests/test_data/test_file_apps.py | Python | apache-2.0 | 2,298 |
#!/usr/bin/env python
"""
Copyright 2016 Alex Cortelyou
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | acortelyou/drone-tools | dji2papywizard.py | Python | apache-2.0 | 5,866 |
# -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
try:
_dist = get_distribution('pyethapp')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.n... | kustomzone/pyethapp | pyethapp/__init__.py | Python | mit | 1,259 |
# vim: set ts=2 expandtab:
# -*- coding: utf-8 -*-
'''
Module: ass.py
Desc: Advanced SubStation Alpha subtitle file formatter
Author: John O'Neil
Email: oneil.john@gmail.com
DATE: Thursday, March 6th 2014
This module provides a formatter class that can be used
to turn arib package subtitle objects into a .ass
file.
... | johnoneil/arib | arib/ass.py | Python | apache-2.0 | 13,594 |
import sublime
import sublime_plugin
import json
import os
from .gotools_util import Buffers
from .gotools_util import GoBuffers
from .gotools_util import Logger
from .gotools_util import ToolRunner
from .gotools_settings import GoToolsSettings
class GotoolsSuggestions(sublime_plugin.EventListener):
CLASS_SYMBOLS =... | Mistobaan/GoTools | gotools_suggestions.py | Python | mit | 1,949 |
import base64
from ..Helpers import get_xml_as_string
from ..Object import Data
class Document(object):
def __init__(self, client):
self.client = client
def add(self, file_path, folder_id, author_first_name, author_last_name, title):
"""
Submit a new document to your iThenticate acco... | JorrandeWit/ithenticate-api-python | iThenticate/API/Treasure/documents.py | Python | bsd-2-clause | 2,880 |
# Documented in https://zulip.readthedocs.io/en/latest/subsystems/queuing.html
import base64
import copy
import datetime
import email
import email.policy
import functools
import logging
import os
import signal
import smtplib
import socket
import tempfile
import time
import urllib
from abc import ABC, abstractmethod
fro... | showell/zulip | zerver/worker/queue_processors.py | Python | apache-2.0 | 39,248 |
#! /usr/bin/env python
from PyFoam.Applications.ChangePython import changePython
changePython("pvpython","PVSnapshot",options=["--native"])
| Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam | bin/pyFoamPVSnapshotNative.py | Python | gpl-2.0 | 142 |
# Copyright (C) 2014 Linaro Limited
#
# Author: Milosz Wasilewski <milosz.wasilewski@linaro.org>
#
# This file is part of Testmanager.
#
# Testmanager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software Found... | mwasilew/testmanager | testmanager/testplanner/views.py | Python | agpl-3.0 | 3,452 |
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | etherkit/OpenBeacon2 | macos/venv/lib/python3.8/site-packages/PyInstaller/utils/win32/icon.py | Python | gpl-3.0 | 9,501 |
from lis.labeling.classes import ZplTemplateTuple
from lis.labeling.classes import AliquotLabel
"""Added here to override the default in app_configuration."""
aliquot_label = ZplTemplateTuple(
'aliquot_label', (
('^XA\n'
'^FO325,18^A0N,20,20^FD${protocol} Site ${site} ${clinician_initials} ${aliq... | botswana-harvard/eit | eit/config/labels/aliquot_label.py | Python | gpl-3.0 | 782 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | pypa/warehouse | warehouse/migrations/versions/d0c22553b338_sponsor_model.py | Python | apache-2.0 | 2,811 |
import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
newline = ""
for char in test:
if char.isalpha() == True:
if char.islower() == True:
char = char.upper()
newline += char
else:
char = char.lower()
... | theabraxas/Coding-Challenges | Py2-CodeEval/Easy/Swap_Case-1.py | Python | gpl-2.0 | 435 |
# Copyright 2008, 2009 CAMd
# (see accompanying license files for details).
"""Definition of the Atoms class.
This module defines the central object in the ASE package: the Atoms
object.
"""
import warnings
from math import cos, sin
import numpy as np
from ase.atom import Atom
from ase.data import atomic_numbers, ... | askhl/ase | ase/atoms.py | Python | gpl-2.0 | 56,652 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Special functions
"""
from __future__ import unicode_literals
from __future__ import absolute_import
import mpmath
from mathics.builtin.base import Builtin
from mathics.builtin.arithmetic import _MPMathFunction
from mathics.core.expression import Integer
from mathic... | bnjones/Mathics | mathics/builtin/specialfunctions.py | Python | gpl-3.0 | 18,125 |
def chmsg(event, server, view):
""" Everytime someone types on a channel this method is called
It gets the channel name and the win(that one which we have added in the ujoin event.
It gets the window with the same method server.getName.
"""
ch = event['channel'].lower()
win = view.get_... | iogf/nerdirc | nerdlib/plugins/wake/wake.py | Python | gpl-2.0 | 445 |
# -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import login_required, credential_required
from apps.seguridad.models import Ambito, Rol
from apps.registro.models import Estableci... | MERegistro/meregistro | meregistro/apps/validez_nacional/views/solicitud.py | Python | bsd-3-clause | 26,125 |
import datetime
import os
import jira_cache
import pytest
import jira_history
import jira_history.history
TEST_DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'issues.json')
@pytest.fixture
def testdata():
data = jira_cache.CachedIssues.load(open(TEST_DATA))
return {item.key: item for item ... | redtoad/jira-history | tests/test_history.py | Python | mit | 1,053 |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="size", parent_name="scatter3d.textfont", **kwargs):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/scatter3d/textfont/_size.py | Python | mit | 487 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import Form
from odoo.addons.mrp_subcontracting.tests.common import TestMrpSubcontractingCommon
class TestSubcontractingDropshippingFlows(TestMrpSubcontractingCommon):
def test_mrp_subcontracting_d... | ddico/odoo | addons/mrp_subcontracting_dropshipping/tests/test_purchase_subcontracting.py | Python | agpl-3.0 | 3,466 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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 later... | egabancho/invenio-sse | invenio_sse/version.py | Python | gpl-2.0 | 1,177 |
#!/usr/bin/env python
# encoding=utf8
# https://www.codeeval.com/open_challenges/14/
import sys
import math
def perm(arr):
arr = sorted(arr)
length = len(arr) - 1
all = math.factorial(length + 1)
index = length
sys.stdout.write(''.join(arr) + ',')
now = 1
while index > 0:
pre = in... | guozengxin/codeeval | hard/stringPermutations.py | Python | mit | 999 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para cineonlineeu
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core... | mariianna/kodi | pelisalacarta/channels/cineonlineeu.py | Python | gpl-3.0 | 8,372 |
import os
import sys
import re
import argparse # Requires Python 2.7 or above
import tarfile
def main():
parser = argparse.ArgumentParser(description='Extract a folder of Landsat images into a folder tree organized by image date.')
parser.add_argument("in_folder", metavar="in", type=str, default=None,
... | azvoleff/teampy | src/extract_landsat.py | Python | gpl-3.0 | 2,258 |
# -*- coding: utf-8 -*-
#
# Payette documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 23 22:53:54 2012.
#
# 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.
#
# All... | matmodlab/matmodlab2 | docs/source/conf.py | Python | bsd-3-clause | 8,405 |
"""The ohmconnect component."""
| fbradyirl/home-assistant | homeassistant/components/ohmconnect/__init__.py | Python | apache-2.0 | 32 |
from django.db import models
from django.db import IntegrityError
from django.template.defaultfilters import slugify
class AutoSlugField(models.SlugField):
"""
A SlugField that automatically populates itself at save-time from
the value of another field.
Accepts argument populate_from, which should be ... | itavor/itavor_lib | itavor_lib/fields.py | Python | bsd-3-clause | 3,041 |
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | M4rtinK/anaconda | tests/unit_tests/pyanaconda_tests/modules/boss/test_set_file_contexts_task.py | Python | gpl-2.0 | 2,587 |
import csv
import os
import sys,re
homedir = os.path.expanduser("~")
csvfile = os.path.join(homedir, "2013-03-25_write.csv")
print csvfile
#pathtocsv = os.path.join(os.path.expanduser('~'), csvfile)
#with open(csvfile, 'rb') as f:
# readfile = csv.reader(f, delimiter=",")
# for row in readfile:
# pr... | relic7/prodimages | python/drafts/untitled_scraps/scrap2.py | Python | mit | 5,912 |
# -*- coding: utf-8 -*-
#
# rootpy documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 14 23:01:54 2011.
#
# 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.
#
# All ... | brynmathias/rootpy | docs/conf.py | Python | gpl-3.0 | 9,457 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | hryamzik/ansible | lib/ansible/modules/remote_management/ucs/ucs_storage_profile.py | Python | gpl-3.0 | 9,409 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
letra = input("Informe uma letra: ")
letra = letra.upper()
if(letra == 'A' or letra == 'E' or letra == 'I' or letra == 'O' or letra == 'U'):
print("Vogal")
else:
print("Consoante")
| Fernando-Learning/Python | python/exercicios/ED/respostasED/4ED.py | Python | gpl-3.0 | 228 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-21 07:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('laboratory', '0035_auto_20180621_0020'),
]
operations = [
migrations.DeleteModel(
... | solvo/organilab | src/laboratory/migrations/0036_delete_feedbackentry.py | Python | gpl-3.0 | 371 |
import argparse
import inspect
import re
def parse_docstring(docstring):
"""
Parse docstring and return tuple of description string and list of params dicts.
`:param` are supported only.
For `:param str foo: help` this will generate dict `{'type': 'str', 'name': 'foo', 'description': 'help'}`
:rt... | sashgorokhov/argparse-autogen | argparse_autogen.py | Python | mit | 9,382 |
import numpy as np
import pytest
from pandas.compat import u, zip
from pandas import DataFrame, Index, MultiIndex, Series
from pandas.core.indexing import IndexingError
from pandas.util import testing as tm
# ----------------------------------------------------------------------------
# test indexing of Series with ... | MJuddBooth/pandas | pandas/tests/indexing/multiindex/test_getitem.py | Python | bsd-3-clause | 8,778 |
import unittest
from unittest import TestCase
from notakto_exceptions import InvalidMove
from game import Game
class GameInitTest(TestCase):
def starts_with_n_boards_test(self):
game = Game(2)
self.assertEquals(2, len(game.boards))
def fails_with_illegal_arguments_test(self):
with self... | ashrestha91/notakto | tests/game_test.py | Python | mit | 1,683 |
"""Remove EASFolderSyncStatus + Folder rows for folders we never sync
Revision ID: 2a748760ac63
Revises: 4af5952e8a5b
Create Date: 2014-07-19 00:28:08.258857
"""
# revision identifiers, used by Alembic.
revision = 'bb4f204f192'
down_revision = '2a748760ac63'
from inbox.ignition import engine
from inbox.models.sessi... | rmasters/inbox | migrations/versions/061_remove_easfoldersyncstatus_folder_rows_.py | Python | agpl-3.0 | 1,547 |
# Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disclaimer.... | yugang/crosswalk-test-suite | tools/atip/atip/web/steps.py | Python | bsd-3-clause | 5,354 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | jcsp/manila-ui | manila_ui/dashboards/admin/shares/tables.py | Python | apache-2.0 | 16,100 |
from django.db.models.aggregates import StdDev
from django.db.utils import ProgrammingError
from django.utils.functional import cached_property
class BaseDatabaseFeatures:
gis_enabled = False
allows_group_by_pk = False
allows_group_by_selected_pks = False
empty_fetchmany_value = []
update_can_self... | savoirfairelinux/django | django/db/backends/base/features.py | Python | bsd-3-clause | 10,235 |
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
| drosboro/pitouch | pitouch/colors.py | Python | mit | 42 |
import csv
import json
from app.database import db_session, Base, engine
from app.models import App, AppBundle, Target, AppType, Organization, Department, Tag, Connection, Header, DNS
from app.serializer import \
TagSerializer, ConnectionSerializer, HeaderSerializer,\
AppTypeSerializer, OrganizationSer... | dorneanu/crudappify | apps/orgapp/utils/db.py | Python | mit | 5,360 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from celery import Celery
RABBIT_URL = os.getenv('RABBIT_URL')
BACKEND_URL = RABBIT_URL # Share existing RabbitMQ? Use .. elasticsearch?!?!?! omg
app = Celery('tasks',
broker='pyamqp://{}'.format(RABBIT_URL),
backend... | davemcphee/sensu-pager-handler | sensu_slackbot/sensu_slackbot_server.py | Python | mit | 505 |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "License"); you may not use ... | oleg-alexandrov/StereoPipeline | src/asp/IceBridge/generate_fake_camera_models.py | Python | apache-2.0 | 5,401 |
#!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'supported_by': 'community... | kustodian/ansible | lib/ansible/modules/cloud/amazon/aws_az_info.py | Python | gpl-3.0 | 4,351 |
import MySQLdb, sys, os, re, time, string
def describe_db(c,db=['illumination_db']):
if type(db) != type([]):
db = [db]
keys = []
for d in db:
command = "DESCRIBE " + d... | deapplegate/wtgpipeline | run_slr.py | Python | mit | 2,121 |
import logging
import socket
from functools import wraps
from django.conf import settings
from django.http import (
Http404,
HttpResponse,
HttpResponseForbidden,
HttpResponseRedirect
)
from django.shortcuts import render
from django.utils.http import is_safe_url
from django.views.decorators.cache impor... | DESHRAJ/fjord | fjord/base/views.py | Python | bsd-3-clause | 6,831 |
import graphene
from . import types
from . import models
class MoveEvent(graphene.Mutation):
class Arguments:
event_id = graphene.Int()
destination_event_id = graphene.Int()
ok = graphene.Boolean()
event = graphene.Field(types.Event)
def mutate(self, info, event_id, destination_event... | sussexstudent/falmer | falmer/events/mutations.py | Python | mit | 1,398 |
# Copyright (C) 2016 Swift Navigation Inc.
# Contact: Valeri Atamaniouk <valeri@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF A... | swift-nav/peregrine | peregrine/iqgen/bits/message_const.py | Python | gpl-3.0 | 1,631 |
#!/usr/bin/env python
__author__ = 'greghines'
import numpy as np
import os
import pymongo
import sys
import cPickle as pickle
import bisect
import random
import csv
import matplotlib.pyplot as plt
if os.path.exists("/home/ggdhines"):
base_directory = "/home/ggdhines"
else:
base_directory = "/home/greg"
def i... | camallen/aggregation | experimental/condor/presentation/condor_IBCC.py | Python | apache-2.0 | 9,662 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | spandanb/horizon | openstack_dashboard/settings.py | Python | apache-2.0 | 8,660 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2015, GEM Foundation
# OpenQuake 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 version 3 of the Licen... | vup1120/oq-risklib | openquake/commonlib/datastore.py | Python | agpl-3.0 | 9,696 |
"""
Test helper functions and base classes.
"""
import inspect
import json
import unittest
import functools
import operator
import pprint
import requests
import os
import urlparse
from contextlib import contextmanager
from datetime import datetime
from path import Path as path
from bok_choy.javascript import js_defined... | adoosii/edx-platform | common/test/acceptance/tests/helpers.py | Python | agpl-3.0 | 26,092 |
#!/usr/bin/python
#
# Copyright 2011 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 b... | nearlyfreeapps/python-googleadwords | examples/adspygoogle/adwords/v201109/basic_operations/update_campaign.py | Python | apache-2.0 | 1,970 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | kawamon/hue | apps/impala/src/impala/impala_flags.py | Python | apache-2.0 | 4,575 |
""" Mapnik UTFGrid Provider.
Takes the first layer from the given mapnik xml file and renders it as UTFGrid
https://github.com/mapbox/utfgrid-spec/blob/master/1.2/utfgrid.md
It can then be used for this:
http://mapbox.github.com/wax/interaction-leaf.html
Only works with mapnik>=2.0 (Where the Grid functionality was in... | kartta-labs/mapwarper | lib/tilestache/TileStache-1.51.5/TileStache/Goodies/Providers/MapnikGrid.py | Python | mit | 4,878 |
from twitter.checkstyle.common import Nit, PythonFile
from twitter.checkstyle.plugins.variable_names import (
allow_underscores,
is_builtin_name,
is_lower_snake,
is_reserved_name,
is_reserved_with_trailing_underscore,
is_upper_camel,
PEP8VariableNames,
)
def test_allow_underscores():
@allow_underscore... | abel-von/commons | tests/python/twitter/checkstyle/plugins/test_variable_names.py | Python | apache-2.0 | 4,679 |
if 0:
import astropy.io.fits as pyfits, os
#catalog = '/u/ki/dapple/nfs12/cosmos/cosmos30.slr.matched.cat'
catalog = '/u/ki/dapple/nfs12/cosmos/cosmos30.slr.cat'
p = pyfits.open(catalog)['OBJECTS']
print p.columns
#print p.data.field('z_spec')[4000:5000]
filters = ['MEGAPRIME-0-1-u','S... | deapplegate/wtgpipeline | cosmos_all.py | Python | mit | 2,099 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerParametersDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... | wbyne/QGIS | python/plugins/processing/modeler/ModelerParametersDialog.py | Python | gpl-2.0 | 35,070 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | chengdh/openerp-ktv | openerp/addons/project/project.py | Python | agpl-3.0 | 61,497 |
#! /usr/bin/env python
import gspread
import argparse
from format import *
import sys
from stats import getMean
import pdb
import json
from oauth2client.client import SignedJwtAssertionCredentials
from gsheets import openSS, Table, putRawTable
p = argparse.ArgumentParser(description=\
"Given a set of runs for severa... | d1m0/browser_bench | build_worksheet.py | Python | mit | 4,846 |
# -*- coding: utf-8 -*-
################################################################################
# Copyright (C) 2012 Travis Shirk <travis@pobox.com>
#
# 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 So... | gaetano-guerriero/eyeD3-debian | src/eyed3/plugins/genres.py | Python | gpl-3.0 | 2,734 |
'''
Copyright 2010 Vitaly Volkov
Created on 11.10.2010
Database schema of Reggata repository entities.
'''
import sqlalchemy as sqa
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import ForeignKey, orm
import datetime
import os
import hashlib
import regg... | vlkv/reggata | reggata/data/db_schema.py | Python | gpl-3.0 | 21,426 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import warnings
import matplotlib.cbook as mcb
import matplotlib.animation as animation
try:
import mplstereonet
except ImportError:
... | mauroalberti/geocouche | apsg/plotting.py | Python | gpl-2.0 | 29,529 |
from pyxb.bundles.opengis.gml_3_3.raw.lrtr import *
| CantemoInternal/pyxb | pyxb/bundles/opengis/gml_3_3/lrtr.py | Python | apache-2.0 | 52 |
from datetime import datetime
def parse_soap_date(soap_date):
data = {}
for field in ['year', 'day', 'hour', 'minute', 'month']:
data[field] = int(getattr(soap_date, field)[0])
return datetime(**data) | bhitov/boston_events_scraper | lib/utils.py | Python | gpl-3.0 | 222 |
#!/usr/bin/env python
from setuptools import find_packages, setup
def readme():
with open('README.rst') as f:
return f.read()
def requirements():
req_path = 'requirements.txt'
with open(req_path) as f:
reqs = f.read().splitlines()
return reqs
setup(name='factor_analyzer',
ve... | EducationalTestingService/factor_analyzer | setup.py | Python | gpl-2.0 | 1,399 |
from __future__ import with_statement, print_function
import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')... | mindriot101/k2catalogue | testing/models/test_proposal.py | Python | mit | 2,350 |
import unittest
import numpy as np
from scipy.ndimage import binary_dilation, binary_erosion
import skimage.filter as F
class TestCanny(unittest.TestCase):
def test_00_00_zeros(self):
'''Test that the Canny filter finds no points for a blank field'''
result = F.canny(np.zeros((20, 20)), 4, 0, 0, n... | chintak/scikit-image | skimage/filter/tests/test_canny.py | Python | bsd-3-clause | 2,875 |
from setuptools import find_packages
from os import path, environ
import io
import os
import re
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy as np
def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__file__... | toinsson/pyrealsense | setup.py | Python | apache-2.0 | 2,524 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='clustercheck',
use_scm_version=True,
setup_requires=['setuptools_scm'],
install_requires=[
'Twisted>=12.2',
'PyMySQL'
],
description='Standalone service for reporting of Perco... | Oneiroi/clustercheck | setup.py | Python | agpl-3.0 | 707 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.