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 |
|---|---|---|---|---|---|
"""This module cooks up a docstring when imported. Its only purpose is to
be displayed in the sphinx documentation.
"""
from collections import defaultdict
from ..core import Add, Eq, Symbol
from ..core.compatibility import default_sort_key
from ..printing import latex
from .meijerint import _create_lookup_table
t ... | skirpichev/omg | diofant/integrals/meijerint_doc.py | Python | bsd-3-clause | 1,056 |
__import__('pkg_resources').declare_namespace(__name__) # pragma NO COVERAGE
| dairiki/humpty | tests/dist2/dist2/plugins/__init__.py | Python | bsd-3-clause | 78 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | nburn42/tensorflow | tensorflow/python/kernel_tests/scatter_ops_test.py | Python | apache-2.0 | 11,250 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Seperate titles, French -> english, others to rare.
def engTitle(title):
if title in ["Miss", "Mrs", "Mr", "Dr", "Master"]:
return title
elif title in ["Mme", "Ms"]:
return "Mrs"
elif title == "Mlle":
return "Miss"
else:
return "Rare"... | cybercomgroup/Big_Data | Cloudera/Code/Titanic_Dataset/title_surv.py | Python | gpl-3.0 | 1,344 |
#!/usr/bin/env python
# Pretty print 9p simpletrace log
# Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid>
#
# Author: Harsh Prateek Bora
import simpletrace
class VirtFSRequestTracker(simpletrace.Analyzer):
def begin(self):
print "Pretty printing 9p simpletrace log ..."
def ... | KernelAnalysisPlatform/KlareDbg | tracers/qemu/decaf/scripts/analyse-9p-simpletrace.py | Python | gpl-3.0 | 7,579 |
# Past examples are programmatically insecure
# You require arguments to be passed in but what if the wrong arguments are provided?
# Look at the timestable solution which changes numbers to text - what happens if you provide the number 30?
#
# One way of controlling these things uses conditions
# These enable specific... | Chris35Wills/Chris35Wills.github.io | courses/examples/Beginners_python/conditions.py | Python | mit | 826 |
# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer, QProcess
import gr3
from gui.gl_widget import GLWidget
from core import file
import os.path
import shutil
import sys
import tempfile
class ImageVideoTabDock(QtWidgets.QDockWidget):
"""
DockWidget for the 'image/video'-ta... | sciapp/pyMolDyn | src/gui/tabs/image_video_tab.py | Python | mit | 8,054 |
from django.test import TestCase
from .models import ImportTask, generate_file_path
class ImportTest(TestCase):
def test_csv_import(self):
pass
def test_generate_file_path(self):
self.assertEquals(generate_file_path(ImportTask(), 'allo.csv'), 'csv_imports/allo.csv')
self.assertEquals... | nyaruka/smartmin | smartmin/csv_imports/tests.py | Python | bsd-3-clause | 1,036 |
#
# Copyright 2013-2015 BloomReach, 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 ... | bloomreach/briefly | tests/briefly/test_core.py | Python | apache-2.0 | 3,993 |
class Animal:
"""Abstract class to be implemented by all animals."""
def __init__(self, name) -> None:
self.name = name
def make_sound(self) -> str:
raise NotImplementedError
class Cat(Animal): # Error: Method 'make_sound' is not overridden
"""A worthy companion."""
pass
| RyanDJLee/pyta | examples/pylint/W0223_abstract_method.py | Python | gpl-3.0 | 313 |
from __future__ import unicode_literals
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_auth_token(sender, instance=None, created=Fal... | KSG-IT/ksg-nett | api/models.py | Python | gpl-3.0 | 395 |
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it w... | dscho/hg | mercurial/keepalive.py | Python | gpl-2.0 | 25,789 |
# -*- coding:utf-8 -*-
'''
Author: Bu Kun
E-mail: bukun@osgeo.cn
CopyRight: http://www.yunsuan.org
'''
import tornado.web
import tornado.escape
import json
from torlite.core import tools
from torlite.core.base_handler import BaseHandler
from torlite.model.mwiki import MWiki
from torlite.model.mcatalog import MCatalog
... | Geoion/TorCMS | torlite/handlers/reply_handler.py | Python | mit | 3,236 |
"""
WSGI config for istari project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "istari.settings")
from django.core.wsg... | gilsondev/istari | istari/wsgi.py | Python | mit | 387 |
# Copyright 2019 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from odoo.exceptions import AccessError
class SacTicket(models.Model):
_name = 'sac.ticket'
_description = 'Sac Ticket'
_inherit = ['mail.thread', 'mail.activity.mixin', 'base.ka... | kmee/kmee_odoo_addons | sac/models/sac_ticket.py | Python | agpl-3.0 | 2,925 |
#!/usr/bin/env python
import sys
import argparse
from Bio import SeqIO
from Bio.SeqFeature import SeqFeature
from Bio.SeqFeature import FeatureLocation
from cpt_gffParser import gffParse, gffWrite, gffSeqFeature
import logging
logging.basicConfig(level=logging.INFO)
def mga_to_gff3(mga_output, genome):
seq_dict ... | TAMU-CPT/galaxy-tools | tools/phage/cpt_convert_mga_to_gff3.py | Python | gpl-3.0 | 3,886 |
import platform
import sys
import os
THIS_DIR = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(os.path.abspath(THIS_DIR), "../ciscoconfparse/"))
sys.path.insert(0, os.path.abspath(THIS_DIR))
import pytest
from ciscoconfparse import CiscoConfParse
c01 = """policy-map QOS_1
class GOLD
priority percent 1... | SivagnanamCiena/ciscoconfparse | tests/conftest.py | Python | gpl-3.0 | 31,317 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py | Python | mit | 24,443 |
import datetime
from django.http import HttpResponse
ZERO = datetime.timedelta(0)
HOUR = datetime.timedelta(hours=1)
class UTC(datetime.tzinfo):
"""UTC
Optimized UTC implementation. It unpickles using the single module global
instance defined beneath this class declaration.
"""
zone = "UTC"
... | HackUCF/collabCTF | tools/misc.py | Python | mit | 1,711 |
from jedi._compatibility import u
from jedi import parser
from ..helpers import unittest
class TokenTest(unittest.TestCase):
def test_end_pos_one_line(self):
parsed = parser.Parser(u('''
def testit():
a = "huhu"
'''))
tok = parsed.module.subscopes[0].statements[0]._token_list[2]
self.... | Eddy0402/Environment | vim/ycmd/third_party/jedi/test/test_parser/test_token.py | Python | gpl-3.0 | 602 |
#!/usr/bin/env python3
#
# Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019 Axel Gembe <derago@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,... | wakiyamap/electrum-mona | electrum_mona/gui/qt/qrreader/qtmultimedia/validator.py | Python | mit | 6,051 |
# flake8: noqa
"""
Django settings split into different files for better maintenance and
visibility.
"""
from settings.base_settings import *
from settings.installed_apps import *
from settings.staticfiles_settings import *
from settings.middleware_settings import *
from settings.django_settings import *
from settings.... | bitmazk/webfaction-django-boilerplate | website/webapps/django/project/settings/__init__.py | Python | mit | 392 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | Forage/Gramps | gramps/gen/filters/rules/note/_allnotes.py | Python | gpl-2.0 | 1,602 |
#
# Copyright 2009-2010 Goran Sterjov
# This file is part of Myelin.
#
# Myelin is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... | gsterjov/Myelin | bindings/python/myelin/introspection/value.py | Python | gpl-3.0 | 11,453 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Roboterclub Aachen e.V.
# All Rights Reserved.
#
# The file is part of the xpcc library and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
class ParameterDB:
""" Parameter Data Base
Manages Parameters
"""
... | dergraaf/xpcc | tools/device_files/parameters.py | Python | bsd-3-clause | 3,905 |
# -*- coding: utf-8 -*-
"""
This module calculates a linear system by Gaussian elimination with pivoting.
Almost a copy of on Mike Zingale's code, spring 2013.
"""
import numpy as npy
import os
def gaussElim(A, b):
""" perform gaussian elimination with pivoting, solving A x = b A
is an NxN matri... | NicovincX2/Python-3.5 | Analyse (mathématiques)/Analyse numérique/Conditionnement/gaussElimination.py | Python | gpl-3.0 | 2,193 |
import numpy as np
from pystella.rf import Band
from pystella.rf.rad_func import Flux2MagAB
from pystella.util.phys_var import phys
__author__ = 'bakl'
class Star:
def __init__(self, name, spec=None, is_flux_eq_luminosity=False):
"""Creates a Star with Spectrum instance. Required parameters: name."""
... | baklanovp/pystella | pystella/rf/star.py | Python | mit | 7,789 |
#!/usr/bin/python
#
# Copyright 2015 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... | falbassini/googleads-dfa-reporting-samples | python/v2.2/download_placement_tags.py | Python | apache-2.0 | 2,591 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | mjbradburn/masters_project | node_modules/neo4j-driver/neokit/neorun.py | Python | apache-2.0 | 6,800 |
# tempfile.py unit tests.
import tempfile
import os
import sys
import re
import warnings
import unittest
from test import test_support
warnings.filterwarnings("ignore",
category=RuntimeWarning,
message="mktemp", module=__name__)
if hasattr(os, 'stat'):
import stat
... | duducosmos/pgs4a | python-install/lib/python2.7/test/test_tempfile.py | Python | lgpl-2.1 | 26,716 |
"""Functions that transform a Context object to a different representation."""
import json
import six
from http_prompt.utils import smart_quote
def _noop(s):
return s
def _extract_httpie_options(context, quote=False, join_key_value=False,
excluded_keys=None):
if quote:
... | eliangcs/http-prompt | http_prompt/context/transform.py | Python | mit | 3,546 |
# Strine!/usr/bn/env python
import re
from collections import OrderedDict
from funcparserlib.lexer import make_tokenizer
tokval = lambda tok: tok.value
Spec = lambda name, value: (name, (value,))
operators = OrderedDict([
("**", 1), ("++", 1), ("--", 1), ("+=",
1), ("-="... | prologic/mio | mio/lexer.py | Python | mit | 2,010 |
import housing_price.housing_price as hp
import yaml
hp.collect()
with open('config.yml', 'r') as f:
config = yaml.load(f)
| ftan84/housing_price | main.py | Python | mit | 128 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | azatoth/scons | test/packaging/tar/gz.py | Python | mit | 2,021 |
import util.func
import util.data
import pytest
import tornado.concurrent
from unittest import mock
def test_future():
f = tornado.concurrent.Future()
f2 = util.data.freeze(f)
val = [1, 2]
f.set_result(val)
val.append(3)
assert f2.result() == [1, 2]
def test_unicode_synonymous_with_str():
... | nathants/s | tests/test_data.py | Python | mit | 2,143 |
import sys
try:
# Our match_hostname function is the same as 3.5's, so we only want to
# import the match_hostname function if it's at least that good.
if sys.version_info < (3, 5):
raise ImportError("Fallback to vendored code")
from ssl import CertificateError, match_hostname
except ... | zer0yu/ZEROScan | thirdparty/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | Python | mit | 707 |
from crianza.errors import CompileError
from crianza.interpreter import Machine, isconstant, isstring, isbool, isnumber
from crianza import instructions
from crianza import optimizer
EMBEDDED_PUSH_TAG = "embedded_push"
def make_embedded_push(value):
"""Returns a closure that pushed the given value onto a Machine'... | cslarsen/crianza | crianza/compiler.py | Python | bsd-3-clause | 7,198 |
from flask_restful import reqparse
from huginn.cli import argtypes
# the waypoint request parser is used to parse the waypoint data from a web
# request
waypoint = reqparse.RequestParser()
waypoint.add_argument("latitude", required=True,
location="json", type=argtypes.latitude)
waypoint.add_argu... | pmatigakis/Huginn | huginn/request_parsers.py | Python | bsd-3-clause | 529 |
import unittest, random, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_util
print "have to add leading/trailing whitespace and single/double quotes?"
# A time token is built up from the definition of the time subtokens
# A time token can have single ... | h2oai/h2o | py/testdir_multi_jvm/test_parse_time_fvec.py | Python | apache-2.0 | 11,031 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This bot replicates all pages (from specific namespaces) in a wiki to a second wiki within one family.
Example:
python replicate_wiki.py [-r] -ns 10 -f wikipedia -o nl li fy
to copy all templates from an nlwiki to liwiki and fywiki. It will show which pages have to b... | races1986/SafeLanguage | CEM/replicate_wiki.py | Python | epl-1.0 | 7,898 |
"""Settings for logging within Connect"""
# pylint: disable=line-too-long,invalid-name
import environ
env = environ.Env(
LOG_LEVEL=(str, 'WARNING')
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDe... | lpatmo/actionify_the_news | connect/settings/logging.py | Python | mit | 2,029 |
"""Support for KNX/IP climate devices."""
from __future__ import annotations
from typing import Any
from xknx import XKNX
from xknx.devices import Climate as XknxClimate, ClimateMode as XknxClimateMode
from xknx.dpt.dpt_hvac_mode import HVACControllerMode, HVACOperationMode
from xknx.telegram.address import parse_dev... | sander76/home-assistant | homeassistant/components/knx/climate.py | Python | apache-2.0 | 13,659 |
'''
Created on Dec 24, 2014
@author: dave
'''
import re
import dragonfly
from dragonfly.actions.action_focuswindow import FocusWindow
from dragonfly.actions.action_key import Key
from dragonfly.actions.action_waitwindow import WaitWindow
from caster.asynch.hmc import squeue
from caster.asynch.hmc import h_launch, ho... | j127/caster | caster/asynch/hmc/vocabulary_processing.py | Python | lgpl-3.0 | 2,241 |
import os
c = get_config()
# Notebook config
# user_path = os.path.expanduser(u'~')
# c.NotebookApp.certfile = os.path.join(user_path, u'.ipython/profile_default/mycert.pem')
# c.NotebookApp.certfile = u'~/.ipython/profile_default/mycert.pem'
# c.NotebookApp.ip = '*'
# c.NotebookApp.open_browser = False
# c.Noteboo... | wd15/env | roles/common/files/ipython_notebook_config.py | Python | mit | 5,522 |
# Contributed by Seva Alekseyev <sevaa@nih.gov> with National Institutes of Health, 2016
# Cura is released under the terms of the LGPLv3 or higher.
from math import pi, sin, cos, sqrt
from typing import Dict
import numpy
from UM.Job import Job
from UM.Logger import Logger
from UM.Math.Matrix import Matrix
from UM.M... | Ultimaker/Cura | plugins/X3DReader/X3DReader.py | Python | lgpl-3.0 | 35,800 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0057_update_triggers'),
('flows', '0053_auto_20160414_0642'),
]
operations = [
migrations.AddField(
... | ewheeler/rapidpro | temba/flows/migrations/0054_flowstep_broadcasts.py | Python | agpl-3.0 | 555 |
from django.contrib.auth.models import User
from django.test import TestCase
from hc.api.models import Check
class AddCheckTestCase(TestCase):
def setUp(self):
self.alice = User(username="alice")
self.alice.set_password("password")
self.alice.save()
def test_it_works(self):
... | avoinsystems/healthchecks | hc/front/tests/test_add_check.py | Python | bsd-3-clause | 518 |
#!/usr/bin/python3
#
# from:
# https://stackoverflow.com/questions/19457227/how-to-print-like-printf-in-python3
#
import sys
def printf(format, *args):
sys.stdout.write(format % args)
# Example output:
i = 7
pi = 3.14159265359
printf("hi there, i=%d, pi=%.2f\n", i, pi)
# hi there, i=7, pi=3.14
s = 'aaa'
try... | ombt/analytics | apex/python/ofc_online_python_tutorial/misc/printf.py | Python | mit | 552 |
#!/usr/bin/env python
# Copyright (C) 2010 Sebastian Bittl
# This file is part of Relaying Schemes Implementation.
# Relaying Schemes Implementation 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 ve... | UpYou/relay | gui.py | Python | gpl-3.0 | 20,915 |
# -*- coding: utf-8 -*-
import socket
import fcntl
import struct
import time
import os
from bartendro import app
from flask import Flask, request, render_template, Response
from werkzeug.exceptions import Unauthorized
from flask.ext.login import login_required
from bartendro.model.version import DatabaseVersion
def ge... | wyolum/bartendro | ui/bartendro/view/admin/options.py | Python | gpl-2.0 | 1,689 |
# Copyright 2015 Metaswitch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | alexhersh/calico-docker | tests/st/test_status.py | Python | apache-2.0 | 1,054 |
#!/usr/bin/env python
__usage__ = """
A simple script to automatically produce sitemaps for a webserver,
in the Google Sitemap Protocol (GSP).
Usage: python sitemap_gen.py --config=config.xml [--help] [--testing]
--config=config.xml, specifies config file location
--help, displays usage messag... | pagefreezer/SitemapGenerator | sitemap_gen.py | Python | bsd-3-clause | 79,973 |
# Twisted imports
from twisted.protocols import msn, loopback
from twisted.internet.defer import Deferred
from twisted.trial import unittest
# System imports
import StringIO
class StringIOWithoutClosing(StringIO.StringIO):
def close(self): pass
class DummySwitchboardClient(msn.MSNSwitchboardClient):
def user... | fxia22/ASM_xf | PythonD/site_python/twisted/test/test_msn.py | Python | gpl-2.0 | 6,590 |
# -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | wildchildyn/autism-website | yanni_env/lib/python3.6/site-packages/flask/views.py | Python | gpl-3.0 | 5,630 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | gkc1000/pyscf | pyscf/x2c/__init__.py | Python | apache-2.0 | 611 |
# -*- encoding: utf-8 -*-
from plone.server.addons import Addon
from zope.interface import Interface
from plone.server import configure
from plone.server.api.service import Service
from plone.server.interfaces import ISite
from plone.server.testing import PloneFunctionalTestCase
from plone.server.content import Item
i... | plone/plone.server | src/plone.server/plone/server/tests/test_configure.py | Python | bsd-2-clause | 4,868 |
import bpy, platform
from single_track.panels import Panel as SingleTrackPanel
from functions import *
class ListPanel(bpy.types.Panel):
'''class of the panel who contains addon multi track control'''
bl_space_type = "CLIP_EDITOR"
bl_region_type = "TOOLS"
bl_label = "Multi track: Tracks list"
bl_category = "Curve... | CaptainDesAstres/Frames-Animated-By-Curve | multi_track/panels.py | Python | gpl-3.0 | 10,702 |
######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | nipunreddevil/bayespy | bayespy/inference/vmp/nodes/poisson.py | Python | gpl-3.0 | 4,417 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Communique.surfase'
db.delete_column('lizard_area_communique', 'surfase')
# Add... | lizardsystem/lizard-area | lizard_area/migrations/0012_auto__del_field_communique_surfase__add_field_communique_surface.py | Python | gpl-3.0 | 12,275 |
# -*- coding: utf-8 -*-
# ##########################################################
# ## make sure administrator is on localhost
# ###########################################################
import os
import socket
import datetime
import copy
import gluon.contenttype
import gluon.fileutils
try:
import pygraphvi... | allthroughthenight/aces | web2py/applications/welcome/controllers/appadmin.py | Python | gpl-3.0 | 25,689 |
# Macros
#
CODING_BUG = """It looks like you've hit a bug in the server. Please, \
do not hesitate to report it at http://bugs.cherokee-project.com/ so \
the developer team can fix it."""
UNKNOWN_CAUSE = """An unexpected error has just occurred in the \
server. The cause of the issue is unknown. Please, do not hesita... | cherokee/webserver | cherokee/error_list.py | Python | gpl-2.0 | 43,677 |
#
# This code is part of Ansible, but is an independent component.
#
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complet... | rmfitzpatrick/ansible | lib/ansible/module_utils/nxos.py | Python | gpl-3.0 | 13,537 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SIZE = 8
with open("../benchmarks/many-images.yaml", "w") as text_file:
text_file.write("root:\n")
text_file.wr... | servo/webrender | wrench/script/gen-many-images.py | Python | mpl-2.0 | 634 |
"""
Module contains tools for processing files into DataFrames or other objects
"""
from __future__ import print_function
from collections import defaultdict
import re
import csv
import sys
import warnings
import datetime
from textwrap import fill
import numpy as np
from pandas import compat
from pandas.compat import... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/io/parsers.py | Python | apache-2.0 | 121,901 |
from honeybee.hbsurface import HBSurface as AnalysisSurface
import geometryoperation as go
import config
class HBSurface(AnalysisSurface):
"""Honeybee surface.
Args:
name: A unique string for surface name
sortedPoints: A list of 3 points or more as tuple or list with three items
(x... | antonszilasi/honeybeex | honeybeex/hbsurface.py | Python | gpl-3.0 | 3,372 |
# -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | SmartInfrastructures/fuel-web-dev | nailgun/nailgun/orchestrator/plugins_serializers.py | Python | apache-2.0 | 8,920 |
# -*- coding: utf-8 -*-
#
# 2021-02-04 Timo Sturm <timo.sturm@netknights.it>
# Fix import of yubikeys from yubico
# 2020-11-11 Timo Sturm <timo.sturm@netknights.it>
# Select how to validate PSKC imports
# 2018-05-10 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Add filevers... | privacyidea/privacyidea | privacyidea/lib/importotp.py | Python | agpl-3.0 | 30,394 |
import chinese
| yueranyuan/vector_edu | learntools/kt/__init__.py | Python | mit | 15 |
"""Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | dq922/PerfKitExplorer | server/perfkit/common/big_query_client_test.py | Python | apache-2.0 | 20,931 |
import struct, os, tempfile, time
from subprocess import check_call
from bup import git
from bup.helpers import *
from wvtest import *
top_dir = os.path.realpath('../../..')
bup_exe = top_dir + '/bup'
bup_tmp = top_dir + '/t/tmp'
def exc(*cmd):
cmd_str = ' '.join(cmd)
print >> sys.stderr, cmd_str
check_... | tjanez/bup | lib/bup/t/tgit.py | Python | lgpl-2.1 | 13,004 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | redhat-cip/dci-control-server | dci/api/v1/identity.py | Python | apache-2.0 | 3,559 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | goddardl/gaffer | python/GafferTest/ArrayPlugTest.py | Python | bsd-3-clause | 11,868 |
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | panagiotisl/bigtop | bigtop-packages/src/charm/giraph/layer-giraph/tests/01-basic-deployment.py | Python | apache-2.0 | 1,194 |
#!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | ganeshgore/myremolab | server/src/weblab/core/comm/user_server.py | Python | bsd-2-clause | 4,389 |
# Django
from django import template
# Django-DataTables
from core.datatables.utils import lookupattr
register = template.Library()
register.filter('lookupattr', lookupattr)
| stavrik/test | core/datatables/templatetags/lookupattr.py | Python | apache-2.0 | 176 |
# -*- coding: utf-8 -*-
'''
Pupil Player Third Party Plugins by cpicanco
Copyright (C) 2016 Rafael Picanço.
The present file is distributed under the terms of the GNU General Public License (GPL v3.0).
You should have received a copy of the GNU General Public License
along with this program. If not, see <ht... | cpicanco/player_plugins | segmentation.py | Python | gpl-3.0 | 23,777 |
"""Models for WLED."""
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import WLEDDataUpdateCoordinator
class WLEDEntity(CoordinatorEntity):
"""Defines a base WLED entity."""
coordinator: W... | jawilson/home-assistant | homeassistant/components/wled/models.py | Python | apache-2.0 | 875 |
import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="x", parent_name="contour", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... | plotly/python-api | packages/python/plotly/plotly/validators/contour/_x.py | Python | mit | 516 |
x = bool(input("Digite alguma coisa ou deixe em branco...? "))
if x: #não precisa usar True porque é isto que o if espera
print("Você digitou algo")
else:
print("Você não digiyou algo")
#https://pt.stackoverflow.com/q/170784/101
| bigown/SOpt | Python/Algorithm/TrueFalse4.py | Python | mit | 247 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | marionleborgne/nupic | examples/opf/experiments/anomaly/temporal/simple/description.py | Python | agpl-3.0 | 14,436 |
#! /usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | relateiq/avro | lang/py/setup.py | Python | apache-2.0 | 1,729 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import urlparse
def encode_unicode_dict(unicodedict, encoding="utf-8"):
bytedict = {}
for key in unicodedict:
if isinstance(unicodedict[key], unicode):
bytedict[key] = unicodedict[key].encode(encoding)
elif isinstance(unic... | ThomasJunk/ringo | ringo/lib/request/helpers.py | Python | gpl-2.0 | 2,171 |
import unittest, os
from nose.plugins import PluginTester, Plugin
from nose.tools import eq_
from cStringIO import StringIO
class StubPlugin(Plugin):
def options(self, parser, env=os.environ):
super(StubPlugin, self).options(parser, env=env)
def configure(self, options, conf):
pass
class ... | DESHRAJ/fjord | vendor/packages/nose/functional_tests/test_plugintest.py | Python | bsd-3-clause | 1,678 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | tsdgeos/snapcraft | snapcraft/tests/test_plugin_make.py | Python | gpl-3.0 | 7,789 |
# Slicing code
# Courtesy: Stackoverflow and many other sites
from glob import iglob
import shutil
import os
import sys
print "\nHere we go"
print "*************\n"
""" FUNCTION DEFINITIONS """
############################
"""Find a string between two strings"""
def find_between(s, first, last):
try:
... | vineeshvs/research | slice_backup_00_13_26_05_15_Functions_to_get_the_modulesAndInputQueueAreDefined_NeedToRemoveDuplicates .py | Python | gpl-3.0 | 4,581 |
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... | muraliselva10/designate | designate/api/v1/domains.py | Python | apache-2.0 | 3,421 |
"""Default Update.suggestion to unspecified
Revision ID: 18cad09c8ab6
Revises: 387fda7a1ff0
Create Date: 2013-10-15 17:44:04.526374
"""
# revision identifiers, used by Alembic.
revision = '18cad09c8ab6'
down_revision = '387fda7a1ff0'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.orm import scoped_s... | farhaanbukhsh/bodhi | alembic/versions/18cad09c8ab6_default_update_sugge.py | Python | gpl-2.0 | 941 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-27 19:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('studies', '0029_auto_20170825_1505'),
('studies', '0024_merge_20170823_1352'),
]
op... | pattisdr/lookit-api | studies/migrations/0030_merge_20170827_1539.py | Python | mit | 339 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-29 13:51
from __future__ import unicode_literals
from django.db import migrations
from multiselectfield import MultiSelectField
class CommaSeparatedCharField(MultiSelectField):
pass
class Migration(migrations.Migration):
dependencies = [
... | ideascube/ideascube | ideascube/migrations/0014_user_disabilities.py | Python | agpl-3.0 | 737 |
"""Provide the functionality to group entities."""
import asyncio
import logging
from typing import Any, Iterable, List, Optional, cast
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ASSUMED_STATE,
ATTR_ENTITY_ID,
ATTR_ICON,
ATTR_NAME,
CONF_ICO... | mKeRix/home-assistant | homeassistant/components/group/__init__.py | Python | mit | 17,952 |
class FailedAssumption(Exception):
'''an assume failed'''
class MissingStrategyError(Exception):
pass
class InvalidPartials(AssertionError):
def __init__(self, s, e):
super().__init__('{{{}}}: {}'.format(s, e))
| BenSimner/speccer | speccer/_errors.py | Python | mit | 233 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_gateways_operations.py | Python | mit | 32,520 |
#!/usr/bin/env python3
"""unit tests for landlab.io.obj module"""
import pathlib
import pytest
from landlab import HexModelGrid, RasterModelGrid
from landlab.io import write_obj
LITTLE_HEX_OBJ = """# landlabgrid
#
g landlabgrid
v 1.0 0.0 0.0
v 3.0 0.0 0.0
v 0.0 1.732051 0.0
v 2.0 1.732051 1.0
v 4.0 1.732051 0.0
v 1... | cmshobe/landlab | tests/io/test_write_obj.py | Python | mit | 2,651 |
# Copyright 2014 Tom SF Haines
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the ho... | thaines/rfam | bin/project.py | Python | gpl-3.0 | 3,105 |
#!/usr/bin/env cctools_python
# CCTOOLS_PYTHON_VERSION 2.7 2.6
import os
import sys
import math
import tempfile
import warnings
import subprocess
def make_path(path):
try:
os.makedirs(path)
except:
pass
def find_gnuplot_version():
return float(os.popen("gnuplot --version | awk '{print $2}'").read())
d... | isanwong/cctools | resource_monitor/src/resource_monitor_visualizer.py | Python | gpl-2.0 | 20,770 |
default_app_config = 'rds.apps.RdsConfig'
| hyperwd/hwcram | rds/__init__.py | Python | mit | 42 |
"""
Backports the ``register.assignment_tag`` functionality from Django 1.4 to
Django 1.3.
This code is almost entirely reproduced from
https://code.djangoproject.com/browser/django/trunk/django/template/base.py
and is the work of Django's authors:
https://code.djangoproject.com/browser/django/trunk/AUTHORS
It is lic... | rcbops/horizon-buildpackage | horizon/utils/assignment_tag.py | Python | apache-2.0 | 8,684 |
from __future__ import nested_scopes
import sys, string, os, glob, re, math
from types import *
graph_counter = 1
# returns a list of lines in the file that matches the pattern
def grep(filename, pattern):
result = [];
file = open(filename,'r')
for line in file.readlines():
if re.match(pattern, li... | dberc/tpzsimul.gems | jgraph/mfgraph.py | Python | gpl-2.0 | 28,880 |
from django.conf.urls.defaults import *
from lifeflow.feeds import *
from lifeflow.models import *
from lifeflow.sitemaps import ProjectSitemap
from django.contrib.sitemaps import GenericSitemap
from django.views.decorators.cache import cache_page
from django.contrib.syndication.views import feed
# Cache
def cache(typ... | lethain/lifeflow | urls.py | Python | mit | 3,487 |
#!/usr/bin/python
# *
# * Copyright (C) 2012-2013 Garrett Brown
# * Copyright (C) 2010 j48antialias
# *
# * 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, or (at y... | dknlght/dkodi | src/addons_xml_generator3.py | Python | gpl-2.0 | 8,998 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.