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 |
|---|---|---|---|---|---|
# Copyright 2012 VMware, 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 a... | aristanetworks/neutron | neutron/agent/l3/agent.py | Python | apache-2.0 | 26,208 |
#
# 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
# ... | openstack/heat | heat/tests/openstack/neutron/test_quota.py | Python | apache-2.0 | 5,301 |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2015 Tom Barron. 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.a... | saeki-masaki/cinder | cinder/tests/unit/test_netapp_ssc.py | Python | apache-2.0 | 24,767 |
"""
Initialization script for restapi for the application.
"""
from flask import Blueprint
from app.common.logging import setup_logging
api = Blueprint('api', __name__)
# Setup logger
# api_log = setup_logging(__name__, 'logs/api.log', maxFilesize=1000000,
# backup_count=5)
from . import vie... | ibbad/dna-lceb-web | app/api_v1_0/__init__.py | Python | apache-2.0 | 331 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | rajul/tvb-framework | tvb/tests/framework/interfaces/web/controllers/surface_model_parameters_controller_test.py | Python | gpl-2.0 | 4,108 |
import os
import re
import sys
import imp
import pwiz
import peewee
import inspect
import logging
import pkgutil
import datetime
import importlib
import playhouse
from peewee import *
from peewee import Node
from playhouse.migrate import *
from types import ModuleType
from io import StringIO
__version__ = '0.2.1'
... | Checksum/landfill | landfill.py | Python | mit | 14,954 |
try:
from airstream.client import InputClientFactory
except Exception, e:
import traceback
traceback.print_exc()
print "Unable to import airstream"
raise e
from inputProfile import InputProfile
from genericInputMapper import GenericInputMapper
from airstream.asTypes import *
from tileMote import Ti... | rpwagner/tiled-display | flTile/input/airstreamInputAndEventProcessor.py | Python | apache-2.0 | 6,619 |
from __init__ import main
main()
| translate-smil/translate-smil | translate-smil/__main__.py | Python | apache-2.0 | 34 |
"""
https://gist.github.com/mindlace/3918300
Add user created_by and modified_by foreign key refs to any model automatically.
Almost entirely taken from https://github.com/Atomidata/django-audit-log/blob/master/audit_log/middleware.py
"""
from django.db.models import signals
from django.utils.functional import curry
... | PanuWeb/greco_socios | greco_socios/middleware.py | Python | gpl-3.0 | 1,505 |
from typing import Tuple, Callable, Sequence, Any, List, TypeVar
from ..model import Model
from ..config import registry
from ..types import Array2d, List2d
ItemT = TypeVar("ItemT")
InT = Sequence[Sequence[ItemT]]
OutT = List2d
@registry.layers("with_flatten.v1")
def with_flatten(layer: Model) -> Model[InT, OutT]:... | explosion/thinc | thinc/layers/with_flatten.py | Python | mit | 1,496 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from datetime import datetime, timedelta
fro... | claudep/pootle | pootle/apps/pootle_misc/util.py | Python | gpl-3.0 | 2,906 |
#Declaração de variaveis
nome = 'Glauber'
idade = '28'
sexo = 'marculino'
#escrevendo no arquivo
arquivo = open('encrevendo-em-arquivo.txt','w')
arquivo.write(nome)
arquivo.write('\n')
arquivo.write(idade)
arquivo.write('\n')
arquivo.write(sexo)
arquivo.close()
| GlauberGoncalves/Python | Basic/escrevendo-em -arquivo.py | Python | mit | 282 |
"""
Class for reading data from from Tucker Davis TTank format.
Terminology:
TDT hold data with tanks (actually a directory). And tanks hold sub block
(sub directories).
Tanks correspond to neo.Block and tdt block correspond to neo.Segment.
Note the name Block is ambiguous because it does not refer to same thing in TD... | JuliaSprenger/python-neo | neo/rawio/tdtrawio.py | Python | bsd-3-clause | 21,529 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | houshengbo/nova_vmware_compute_driver | nova/config.py | Python | apache-2.0 | 7,536 |
"""Plugin system for cloud providers and environments for use in integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import atexit
import datetime
import time
import os
import platform
import random
import re
import tempfile
from .. import types as ... | ilpianista/ansible | test/lib/ansible_test/_internal/cloud/__init__.py | Python | gpl-3.0 | 12,707 |
from django.conf.urls import patterns, url
from Browser import views
from CELLAR import settings
urlpatterns = patterns('',
url(r'^copyright$' , views.cellar.copyrightPage),
url(r'^administrator$' , views.administrator.general, name="administrator"),
url(r'^administrator/us... | SonienTaegi/CELLAR | Browser/urls.py | Python | gpl-2.0 | 3,058 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | kaffeel/oppia | extensions/gadgets/TestGadget/TestGadget.py | Python | apache-2.0 | 2,953 |
from xml.dom.minidom import parse, parseString
import pickle
import os, sys
import time
class OwlIndividual:
def __init__(self, domIndividual):
self.domIndividual = domIndividual
def name(self, bSplitNamespace = True):
strName = self.domIndividual.getAttribute("rdf:about")
if bSplitNa... | code-iai/semrec | scripts/bstools/Beliefstate Tools/OwlReader.py | Python | bsd-2-clause | 7,617 |
client_id = 'ENTER YOUR CLIENT_ID HERE, KEEPING THE QUOTE MARKS'
# e.g. client_id = '01234567890123456789'
def get_client_id():
return client_id | ValuingElectronicMusic/network-analysis | client_settingsDEMO.py | Python | gpl-2.0 | 151 |
# Copyright 2011 Tsutomu Uchino
#
# 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 ... | hanya/MRI | pythonpath/mytools_Mri/web.py | Python | apache-2.0 | 12,480 |
from montepython.likelihood_class import Likelihood
import numpy as np
class Planck_compressed(Likelihood):
# initialisation of the class is done within the parent Likelihood_prior. For
# this case, it does not differ, actually, from the __init__ method in
# Likelihood class.
def loglkl(self, cosmo,... | miguelzuma/montepython_zuma | montepython/likelihoods/Planck_compressed/__init__.py | Python | mit | 1,671 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... | SCSSoftware/BlenderTools | addon/io_scs_tools/ui/mesh.py | Python | gpl-2.0 | 2,693 |
# Copyright 2018 Camptocamp SA
# Copyright 2016 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
| Vauxoo/stock-logistics-warehouse | stock_warehouse_orderpoint_stock_info_unreserved/__init__.py | Python | agpl-3.0 | 184 |
from django.conf.urls.defaults import *
from jamsession.views.admin import (DashboardView,
AdminCreateView,
edit_object,
changelist
)
urlpatterns = patterns('',
url(r'^ad... | cmheisel/django-jamsession | jamsession/urls.py | Python | mit | 677 |
# PyIPCalc
#
# Copyright (c) 2017, Christiaan Frans Rademan.
# All rights reserved.
#
# LICENSE: (BSD3-Clause)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above ... | vision1983/pyipcalc | tests/test.py | Python | bsd-3-clause | 1,818 |
# syft absolute
from syft.lib.python.primitive_factory import PrimitiveFactory
from syft.lib.python.util import downcast_args_and_kwargs
def test_downcast():
assert downcast_args_and_kwargs(args=[1, 2, 3], kwargs={}) == ([1, 2, 3], {})
assert downcast_args_and_kwargs(args=["test", True], kwargs={1: 2}) == (
... | OpenMined/PySyft | packages/syft/tests/syft/lib/python/util_test.py | Python | apache-2.0 | 507 |
import unittest
from troposphere import Tags
from troposphere.autoscaling import Tags as ASTags
class TestTags(unittest.TestCase):
def test_TagAddition(self):
tags = Tags(foo='foo')
tags += Tags(bar='bar')
tags = tags + Tags(baz='baz')
result = [
{'Value': 'foo', 'Key':... | Yipit/troposphere | tests/test_tags.py | Python | bsd-2-clause | 1,001 |
# -*- coding: utf-8 -*-
import tornado.ioloop
import tornado.web
import os
"""
一个简单的文件下载服务器,用来下载生成的报告,默认监听9000端口
"""
class MainHandler(tornado.web.RequestHandler):
def get(self):
filename = self.get_argument("filename", None)
if not filename:
self.write("file name not empty")
... | CreditEaseDBA/Themis | task_export/file_download.py | Python | apache-2.0 | 1,214 |
from invoke import task
from tasks.lint import flake8
@task(post=[flake8])
def all(ctx):
""" Run all tests and check linting """
ctx.run("python -m unittest discover")
@task
def unit(ctx):
""" Run all unit tests """
ctx.run("python -m unittest discover -s tests.unit")
@task
def integration(ctx):
... | marcus-crane/pkgparse | tasks/test.py | Python | mit | 420 |
# -*- coding: utf-8 -*-
import os
import configparser
import pickle
import dateutil.parser
from PySide import QtGui, QtCore
from .ui_main import Ui_Main
from .login import Login
from .new_ticket import NewTicket
from .close_ticket import CloseTicket
from mango.api import API
class Main(QtGui.QMainWindow):
def __ini... | elshaka/Romano | romano/ui/main.py | Python | gpl-3.0 | 5,819 |
def main(j,jp):
#start the application (only relevant for server apps)
jp.log("start $(jp.name)")
j.tools.startupmanager.startJPackage(jp)
jp.waitUp(timeout=20)
####THIS IS ONLY EXAMPLE CODE FOR SPECIAL USECASES
##IF USAGE OF TMUX
#cwd is working dir
#j.system.platform.scree... | Jumpscale/jumpscale6_core | lib/JumpScale/baselib/jpackages/templates/actions/process.start.py | Python | bsd-2-clause | 540 |
# Copyright (C) 2007, 2008, 2009, 2011 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program ... | stewartsmith/bzr | bzrlib/timestamp.py | Python | gpl-2.0 | 6,012 |
from django.db import models
from django.template.defaultfilters import slugify
from .utils import base_concrete_model, unique_slug
class Slugged(models.Model):
#Copied from mezzanine
name = models.CharField(max_length=500)
slug = models.CharField(
max_length=600, null=True, blank=True, unique=Tru... | cowhite/pinterest_clone_django | util/models.py | Python | mit | 838 |
#!/usr/bin/env python
#
#-----------------------------------------------------------------------
# A test suite for the table interface built on bsddb.db
#-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Sm... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7/Lib/bsddb/test/test_dbtables.py | Python | mit | 15,416 |
from .process import Process
__alll__ = [
'Process',
] | hatchery/Genepool2 | genes/process/__init__.py | Python | mit | 59 |
from federal_spending.usaspending.models import Contract
from federal_spending.usaspending.scripts.usaspending.contracts_loader import Loader
from django.core.management.base import BaseCommand
from django.db import transaction
class Command(BaseCommand):
@transaction.commit_on_success
def handle(self, contr... | unitedstates/federal_spending | federal_spending/usaspending/management/commands/loadcontracts.py | Python | cc0-1.0 | 622 |
import os
from itertools import groupby, imap
from functools import partial
from operator import attrgetter
import gzip
from jbio.alignment import *
from jbio.io.file import iterator_over_file_from_extension as ioffe
from jbio.io.blast import record_iterator as blast_record_iterator
from jbio.functional import com... | jgurtowski/jbio | jbio/test/alignment.py | Python | gpl-2.0 | 900 |
from ..Qt import QtGui, QtCore
import os, weakref, re
from ..pgcollections import OrderedDict
from ..python2_3 import asUnicode
from .ParameterItem import ParameterItem
PARAM_TYPES = {}
PARAM_NAMES = {}
def registerParameterType(name, cls, override=False):
global PARAM_TYPES
if name in PARAM_TYPES and not ove... | jensengrouppsu/rapid | rapid/pyqtgraph/parametertree/Parameter.py | Python | mit | 32,309 |
# -*- coding: utf-8 -*-
# © 2016 AvanzOsc (http://www.avanzosc.es)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
class StockInventoryLine(models.Model):
_inherit = 'stock.inventory.line'
@api.model
def _resolve_inventory_line(self, inventory_line):... | akretion/stock-logistics-workflow | stock_lock_lot/models/stock_inventory_line.py | Python | agpl-3.0 | 743 |
"""
Routes and views for the bottle application.
"""
from datetime import datetime
from bottle import route, view, request, redirect, template, HTTPError
from models import PollNotFound
from models.factory import create_repository
from settings import REPOSITORY_NAME, REPOSITORY_SETTINGS
repository = create_reposit... | Microsoft/PTVS | Python/Templates/Web/ProjectTemplates/Python/Web/PollsBottle/routes.py | Python | apache-2.0 | 2,456 |
from django.utils.translation import gettext_lazy as _
ModuleTitle = _("Authorization")
Title = _("Authorization")
Perms = True
Index = "None"
Urls = (
(
"table/UrlWithAuth/-/form/list/?schtml=desktop",
_("Urls with auth"),
None,
"""png://apps/system-users.png""",
),
)
UserParam... | Splawik/pytigon | pytigon/prj/_schtools/schauth/__init__.py | Python | lgpl-3.0 | 326 |
import decimal
from threading import local
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.utils import datetime_safe
from django.utils.importlib import import_module
class BaseDatabaseWrapper(local):
"""
Represents a database connection.
"""
ops = None
vendo... | tjsavage/sfcsdatabase | sfcs/django/db/backends/__init__.py | Python | bsd-3-clause | 24,975 |
"""
* Copyright (c) 2008 Zivios, LLC.
*
* This file is part of Zivios.
*
* Zivios 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 versio... | Emergen/zivios-agent | modules/ntp.py | Python | gpl-3.0 | 2,447 |
#encoding: utf-8
'Support subclassing c++ objects in python, with some limitations. Useful primarily for pure-python preprocessors.'
from woo.core import *
from minieigen import *
class PyAttrTrait(object):
'''
Class mimicking the `AttrTrait` template in c++, to be used when deriving from :obj:`PyWooObject`,... | sjl767/woo | py/pyderived.py | Python | gpl-2.0 | 25,602 |
#---------------------------------------------------------------#
# Project: Recognizing hand-written digits
# Author: Kelly Chan
# Date: Apr 23 2014
#---------------------------------------------------------------#
print(__doc__)
import pylab as pl
from sklearn import datasets, svm, metrics
def loadData():
digi... | kwailamchan/programming-languages | python/sklearn/examples/general/recognizing_hand-written_digits.py | Python | mit | 1,991 |
"""
Django settings for polifeelstat project.
Generated by 'django-admin startproject' using Django 1.9.
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... | ignaoya/PoliFeelStat | polifeelstat/settings.py | Python | gpl-3.0 | 3,339 |
# ~*~ coding: utf-8 ~*~
"""
fleaker.marshmallow
~~~~~~~~~~~~~~~~~~~
Module that defines basic Marshmallow_ schema helpers and everything needed to
propery intialize Marshmallow.
Marshmallow_ is a lightweight serialization and deserialization library that
makes transforming submitted data very easy. It is quite useful... | croscon/fleaker | fleaker/marshmallow/__init__.py | Python | bsd-3-clause | 1,790 |
from dem_sim.objects.walls import AAWall
def generate_open_cube_box(length, center):
c_x = center[0]
c_y = center[1]
c_z = center[2]
walls = [AAWall([c_x - length / 2, c_y - length / 2, c_z - length / 2],
[c_x - length / 2, c_y + length / 2, c_z + length / 2]),
AAWall... | Xorgon/DEMApples | dem_sim/generators/box.py | Python | gpl-3.0 | 2,153 |
##############################################################################
# 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... | wscullin/spack | var/spack/repos/builtin/packages/lwm2/package.py | Python | lgpl-2.1 | 1,666 |
#!/usr/bin/env python
'''
Created on
@author:
'''
from __future__ import absolute_import
import sys
import os
import logging
import glob
import re
from osgeo import gdal
from os.path import basename
from EOtools.execute import execute
class VRTCreater:
def get_NetCDF_list(self, directory):
result = []... | ama-jharrison/agdc | agdc/agdc/modis_ingester/create_rbq1000_vrt.py | Python | apache-2.0 | 1,369 |
from haystack import indexes
from elasticstack.fields import EdgeNgramField, MultiValueField
from cjdata.models import Dataset, Category
from django.utils import timezone
class DatasetIndex(indexes.ModelSearchIndex, indexes.Indexable):
title = indexes.CharField(model_attr='title', boost=1.25)
description = in... | sunlightlabs/hall-of-justice | search/search_indexes.py | Python | bsd-3-clause | 2,413 |
class BasePacketProcessor(object):
"""
Abstract packet processor, handles the packet
handlers = {OPCODE: func}
"""
handlers = {} # {OPCODE: function}
ignored_opcodes = set()
counter = 0
@classmethod
def handle_packet(cls, packet, client):
if packet.opcode in cls.handlers:
... | martolini/pythonstory | pythonstory/common/processor.py | Python | mit | 763 |
import json
import unittest
TABLE_NAME1 = 'Table-1'
TABLE_RT = 45
TABLE_WT = 123
TABLE_NAME = 'Table-HR'
TABLE_RT = 45
TABLE_WT = 123
TABLE_RT2 = 10
TABLE_WT2 = 10
TABLE_HK_NAME = u'hash_key'
TABLE_HK_TYPE = u'N'
TABLE_RK_NAME = u'range_key'
TABLE_RK_TYPE = u'S'
HK_VALUE1 = u'123'
HK_VALUE2 = u'456'
HK_VALUE3 = u'7... | sendgridlabs/ddbmock | tests/functional/pyramid/test_scan.py | Python | lgpl-3.0 | 4,332 |
# -*- coding: utf-8 -*-
from openerp import models, fields
class BankPaymentLine(models.Model):
_inherit = 'bank.payment.line'
payslip_id = fields.Many2one(
string="Holerite",
comodel_name="hr.payslip"
)
| kmee/odoo-brazil-hr | l10n_br_hr_payment_order/models/bank_payment_line.py | Python | agpl-3.0 | 235 |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 François-Xavier Bourlet (bombela@gmail.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "S... | bombela/gevent_subprocess | setup.py | Python | mit | 1,738 |
from django.db import models
from .mixins import TimeStampedMixin
from django.contrib.auth.models import User
class Category(TimeStampedMixin):
description = models.CharField(max_length=255)
icon = models.CharField(max_length=255)
def __str__(self):
return self.description
class Site(TimeStampe... | Mobytes/1erHackaton | Server/digitalizame/digitalizame/apps/api/models.py | Python | mit | 1,298 |
#!/usr/bin/env python
"""
Example of different ways to check if supplied string starts with list of values
Supporting blog entry:
https://fabianlee.org/2021/02/20/python-various-implementations-of-startswith-against-list/
implementations:
* tuple support of str.startswith
* regex
* list comprehension w... | fabianlee/blogcode | python/experiment_startswith_list.py | Python | mit | 2,227 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | eltonkevani/tempest_el_env | tempest/scenario/orchestration/test_autoscaling.py | Python | apache-2.0 | 4,636 |
__version__ = "0.1"
default_app_config = 'djenealogy.apps.DjenealogyConfig' | mheppner/djenealogy | djenealogy/__init__.py | Python | mit | 76 |
import setuptools
setuptools.setup(
name="itermate",
packages = ["itermate"],
version="1.0.2",
description="Iterator-tools for functional programming.",
author = 'Henry Weickert',
author_email = 'henryweickert@gmail.com',
url = 'https://github.com/hweickert/itermate',
keyw... | hweickert/itermate | setup.py | Python | mit | 380 |
from ipaddress import IPv6Network, ip_network
from django.core.exceptions import ValidationError
def ipv6_network_validator(value):
try:
network = ip_network(value)
except Exception as e:
raise ValidationError('Invalid ipv6 prefix: {}'.format(e))
if not isinstance(network, IPv6Network):
... | openwisp/django-freeradius | django_freeradius/base/validators.py | Python | gpl-3.0 | 391 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | a13m/ansible | v2/ansible/executor/task_executor.py | Python | gpl-3.0 | 16,471 |
"""Notification models."""
from django.db import models
from happening import db
from django.template.loader import render_to_string
import json
from cached_property import threaded_cached_property
from bs4 import BeautifulSoup
from django.utils import timezone
from markdown import markdown
from happening.utils import ... | jscott1989/happening | src/notifications/models.py | Python | mit | 8,823 |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | googleapis/python-pubsublite | samples/generated_samples/pubsublite_generated_pubsublite_v1_admin_service_update_reservation_async.py | Python | apache-2.0 | 1,493 |
"""
Common tests shared by test_str, test_unicode, test_userstring and test_string.
"""
import unittest, string, sys, struct
from test import support
from collections import UserList
class Sequence:
def __init__(self, seq='wxyz'): self.seq = seq
def __len__(self): return len(self.seq)
def __getitem__(self... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/test/string_tests.py | Python | mit | 57,888 |
import scratchdir
with scratchdir.ScratchDir() as sd:
print(sd.wd)
| ahawker/scratchdir | examples/readme/context-manager.py | Python | apache-2.0 | 72 |
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2011-2012 Johan Dahlin <johan@gnome.org>
#
# 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 Founda... | ceibal-tatu/pygobject | gi/pygtkcompat.py | Python | lgpl-2.1 | 14,279 |
# -*- coding: utf8 -*-
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
"""
This module represent the Proposal management process definition
powered by the dace engine.
"""
import datetime
from persistent.list import... | ecreall/nova-ideo | novaideo/content/processes/proposal_management/definition.py | Python | agpl-3.0 | 26,191 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pages', '0002_auto_20141126_1955'),
]
operations = [
migrations.AlterField(
model_name='page',
name=... | publica-io/django-publica-pages | pages/migrations/0003_auto_20141126_2213.py | Python | bsd-3-clause | 445 |
# Copyright (c) 2009 NHN 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the follow... | DLR-SC/tigl | thirdparty/nsiqcppstyle/nsiqcppstyle_rulemanager.py | Python | apache-2.0 | 10,903 |
"""
Tests for SettingsService
"""
import unittest
from unittest import mock
import pytest
from django.test import TestCase
import ddt
from config_models.models import ConfigurationModel
from django.conf import settings
from django.test.utils import override_settings
from xblock.runtime import Mixologist
from opaque_... | edx/edx-platform | common/lib/xmodule/xmodule/tests/test_services.py | Python | agpl-3.0 | 6,196 |
"""
@author: J.W. Spaak
This program contains fucntions for plotting
"""
import matplotlib.pyplot as plt
import numpy as np
def bars(datas,keys, fig = None, ax = None, col = ['green', 'red'],
leg = 'upper right'):
""" plots boxplots for all data sets in datas
datas is a dictionary with the keys :... | juergspaak/EF-at-invariant-richness | plot_functions.py | Python | mit | 6,379 |
# 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/.
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import User, UserManager... | akatsoulas/oneanddone | oneanddone/users/models.py | Python | mpl-2.0 | 4,685 |
import datetime
import urllib
import os
from django.utils import timezone
from django.utils.timezone import utc
from django.contrib.auth.models import User
from funfactory.urlresolvers import reverse
from nose.tools import eq_, ok_
from airmozilla.search.models import LoggedSearch
from airmozilla.main.models import ... | bugzPDX/airmozilla | airmozilla/search/tests/test_views.py | Python | bsd-3-clause | 24,403 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2014 Lukáš Lalinský
# Copyright (C) 2015 Sophist-UK
# Copyright (C) 2015 Wieland Hoffmann
# Copyright (C) 2015, 2018 Philipp Wolfer
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2017 Frederik “Freso” S. Olesen
# Cop... | Sophist-UK/Sophist_picard | picard/oauth.py | Python | gpl-2.0 | 9,381 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... | msreis/SigNetSim | signetsim/tests/test_units.py | Python | agpl-3.0 | 5,462 |
"""
Classes representing analytical solutions of differential and partial differential equations.
.. inheritance-diagram:: proteus.AnalyticalSolutions
:parts: 1
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import range
from past.utils... | erdc/proteus | proteus/AnalyticalSolutions.py | Python | mit | 29,954 |
"""
WSGI config for tutorial 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | jcbalmeida/drf-tutorial | tutorial/wsgi.py | Python | mit | 393 |
# -*- coding: utf-8 -*-
#
# Read the Docs Template documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 26 14:19:49 2014.
#
# 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
# autogenera... | voicebase/voicebase-docs | docs/conf.py | Python | apache-2.0 | 8,482 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is expected to be used under another directory to use,
# so we disable checking import path of GAE tools from this directory.
# pylint: disable=F... | dednal/chromium.src | tools/deep_memory_profiler/visualizer/app.py | Python | bsd-3-clause | 3,094 |
# 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
# d... | DavidPurcell/murano_temp | murano/tests/unit/dsl/test_attribute_store.py | Python | apache-2.0 | 5,404 |
from rpython.rtyper.llannotation import (
SomePtr, SomeInteriorPtr, SomeLLADTMeth, lltype_to_annotation)
from rpython.flowspace import model as flowmodel
from rpython.rlib.rarithmetic import r_uint
from rpython.rtyper.error import TyperError
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.rmodel ... | oblique-labs/pyVM | rpython/rtyper/rptr.py | Python | mit | 13,576 |
from P_3 import *
print("Shape of cancer data: {}".format(cancer.data.shape))
input()
| TNT-Samuel/Coding-Projects | Machine Learning with Python/Chapter 2/P_4.py | Python | gpl-3.0 | 87 |
#!/usr/bin/env python
#color setting
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
#import public module
import csv
import os
name = raw_input(YELLOW+'Input dir name : '+ENDC)
if os.path.exists(name):
os.chdir(os.getcwd()+'/'+name)
os.system('open *.png')
else:pri... | WataruTakahagi/whole-ecoli-replication | summary.py | Python | gpl-2.0 | 1,518 |
from MAdmin import db
class Device(db.Model):
__tablename__ = 'Devices'
id = db.Column('id', db.Integer, primary_key=True)
hostname = db.Column('hostname', db.String(100))
ram = db.Column('ram', db.String(100))
os = db.Column('os', db.String(100))
box_online = db.Column(db.Boolean)
pending... | MattTuri/M-Admin | MAdmin/sql/ORM/devices.py | Python | mit | 678 |
"""
Test cases for the repr module
Nick Mathewson
"""
import sys
import os
import shutil
import importlib
import importlib.util
import unittest
from test.support import create_empty_file, verbose
from reprlib import repr as r # Don't shadow builtin repr
from reprlib import Repr
from reprlib import recursive_repr
... | yotchang4s/cafebabepy | src/main/python/test/test_reprlib.py | Python | bsd-3-clause | 15,798 |
# -*- coding: UTF-8 -*-
import re
import os
import urllib2
from xbmcaddon import Addon
# Return Game search list
def _get_games_list(search):
display=[]
results=[]
try:
req = urllib2.Request('http://www.gamefaqs.com/search/index.html?platform=0&game='+search.replace(' ','+')+'')
req.add_u... | edwtjo/advanced-launcher | resources/scrapers/datas/GameFAQs/datas_scraper.py | Python | gpl-2.0 | 4,436 |
# This file is part of VoltDB.
# Copyright (C) 2008-2017 VoltDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ver... | migue/voltdb | lib/python/voltcli/verbs.py | Python | agpl-3.0 | 28,759 |
#!/usr/bin/env python
experiment_dir = '/Users/eija/Desktop/prostate_MR/pipelinedata'
param_rigid = 'Par0001translation.txt'
param_BSpline = 'Par0001bspline08.txt'
outputASCIIdir = '/Users/eija/Desktop/prostate_MR/ASCII_prostatemask'
#
# Print all DICOM data
#
# input_dir - DICOM directory that is printed
#
def pr... | haanme/DWIProstateMotionCorrection | motioncorrection_3rd_DICOM2ASCII_prostatemask.py | Python | mit | 7,312 |
#!/usr/bin/python
# Automagical C/C++ project builder.
# Copyright (C) 2009-2012 Ryan J. Lothian
#-----------------------------------------------------------------------
# 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 F... | ryanl/plotgraph | build.py | Python | gpl-2.0 | 2,563 |
#!/usr/bin/env python3
import logging
import zmq
# import time
class Interchange(object):
""" TODO: docstring """
def __init__(self,
client_address="127.0.0.1",
client_ports=(50055, 50056),
worker_port=None,
worker_port_range=(54000, 55000)... | Parsl/parsl | parsl/executors/low_latency/interchange.py | Python | apache-2.0 | 4,514 |
from application import db
class EMSRooms(db.Model):
__tablename__ = 'EMSRooms'
id = db.Column(db.Integer, primary_key=True)
room = db.Column(db.String(100))
location_id = db.Column(db.Integer, db.ForeignKey('Locations.id'))
location = db.relationship('Locations', backref=db.backref('EMSRooms', u... | umnsuaweb/touch-directory-software | models.py | Python | mit | 1,135 |
"""Assorted Tk-related subroutines used in Grail."""
import string
from types import *
from Tkinter import *
def _clear_entry_widget(event):
try:
widget = event.widget
widget.delete(0, INSERT)
except: pass
def install_keybindings(root):
root.bind_class('Entry', '<Control-u>', _clear_entry... | atmark-techno/atmark-dist | user/python/Tools/webchecker/tktools.py | Python | gpl-2.0 | 11,209 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBiocinstaller(RPackage):
"""Install/Update Bioconductor, CRAN, and github Packages.
... | iulian787/spack | var/spack/repos/builtin/packages/r-biocinstaller/package.py | Python | lgpl-2.1 | 1,067 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and
from frappe import _
from frappe.model.mapper import get_map... | indictranstech/vestasi-erpnext | erpnext/selling/doctype/sales_order/sales_order.py | Python | agpl-3.0 | 14,316 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | amenonsen/ansible | lib/ansible/modules/network/junos/junos_lldp_global.py | Python | gpl-3.0 | 5,400 |
'''
test_rrsig_time - Tests rrsig_time validator.
.. Copyright (c) 2015 Neustar, Inc. All rights reserved.
.. See COPYRIGHT.txt for full notice. See LICENSE.txt for terms and conditions.
'''
# pylint: skip-file
import dns_sprockets_lib.validators.tests.harness as harness
def test_rrsig_time():
(tests, errs) ... | ultradns/dns_sprockets | dns_sprockets_lib/validators/tests/test_rrsig_time.py | Python | apache-2.0 | 1,084 |
"""
WSGI config for Admin_Customizado project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... | LEDS/Exemplos-Python-Django | Admin_Customizado/Admin_Customizado/wsgi.py | Python | gpl-3.0 | 411 |
import json
from django.forms import Widget, MultipleChoiceField
from django.forms.utils import flatatt
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.translation... | anushbmx/kitsune | kitsune/tags/forms.py | Python | bsd-3-clause | 6,291 |
"""CallableDelegate provider tests."""
from dependency_injector import providers, errors
from pytest import raises
from .common import example
def test_is_delegate():
provider = providers.Callable(example)
delegate = providers.CallableDelegate(provider)
assert isinstance(delegate, providers.Delegate)
... | rmk135/dependency_injector | tests/unit/providers/callables/test_callable_delegate_py2_py3.py | Python | bsd-3-clause | 449 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.