code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from .observablebase import ObservableBase
class AnonymousObservable(ObservableBase):
"""Class to create an Observable instance from a delegate-based
implementation of the Subscribe method."""
def __init__(self, subscribe):
"""Creates an observable sequence object from the specified
subsc... | ChemiKhazi/Sprytile | rx/core/anonymousobservable.py | Python | mit | 628 |
#!/usr/bin/env python
"""Perform object finding and association."""
import os, glob
from os.path import exists, join
import time
import fitsio
import numpy as np
from ugali.analysis.pipeline import Pipeline
from ugali.analysis.search import CandidateSearch
import ugali.candidate.associate
from ugali.utils.logger imp... | DarkEnergySurvey/ugali | ugali/pipeline/run_04.0_peak_finder.py | Python | mit | 4,508 |
"""added hide option to uploads table
Revision ID: 5750db1d643
Revises: 4c34ca870e0
Create Date: 2015-06-19 18:16:07.073631
"""
# revision identifiers, used by Alembic.
revision = '5750db1d643'
down_revision = '4c34ca870e0'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto genera... | Debetux/sr.ht | alembic/versions/5750db1d643_added_hide_option_to_uploads_table.py | Python | mit | 647 |
import random
from subprocess import call
import yaml
with open('./venues.yml') as f:
venues = yaml.load(f)
venue = random.choice(venues)
print(venue['name'])
print(venue['url'])
call(['open', venue['url']])
| miiila/hungry-in-karlin | decide.py | Python | mit | 218 |
class Binding(object):
def __init__(self, table, ref):
self.table = table
self.ref = ref
def __unicode__(self):
return u"<Binding(%r, %r)>" % (self.table.name, self.ref)
def __repr__(self):
return self.__unicode__()
| openspending/babbage | babbage/model/binding.py | Python | mit | 262 |
from . import RepoChecker
class CheckReadme(RepoChecker):
def check(self):
readme = self.repo.readme()
if not readme:
self.fail("Missing a README file")
| packagecontrol/st_package_reviewer | st_package_reviewer/check/repo/check_readme.py | Python | mit | 188 |
from chainer.functions.activation import relu
from chainer import link
from chainer.links.connection import convolution_2d
class MLPConvolution2D(link.ChainList):
"""Two-dimensional MLP convolution layer of Network in Network.
This is an "mlpconv" layer from the Network in Network paper. This layer
is a... | benob/chainer | chainer/links/connection/mlp_convolution_2d.py | Python | mit | 3,009 |
from chainer import function
from chainer.utils import type_check
class Cast(function.Function):
"""Cast function."""
def __init__(self, typ):
self.type = typ
def check_type_forward(self, in_types):
type_check.expect(in_types.size() == 1)
x_type = in_types[0]
type_check... | benob/chainer | chainer/functions/array/cast.py | Python | mit | 787 |
# -*- coding: utf-8 -*-
'''
Copyright 2015 by Tobias Houska
This file is part of Statistical Parameter Estimation Tool (SPOTPY).
:author: Tobias Houska
This class holds the example code from the getting_started web-documention.
'''
from __future__ import print_function, division, absolute_import, unicode_literals
# G... | thouska/spotpy | spotpy/examples/getting_started.py | Python | mit | 1,975 |
#write one example for simplify by projecting;
#write a different example for simplifying in DD (0.00001)
#working off of downloaded uauc table
#create working table of state
#simplify polygon (perhaps project to GM, then try multiple distances)
#check vertex count, visual polygon coarseness etc
#use ogr2ogr to export ... | awolfe76/rural-with-mapbox | src/geojson/mk_geojson.py | Python | cc0-1.0 | 2,410 |
'''
@file : testFile5.py
@author (A) : Madhu Kumar Dadi.
@project : Social List
@function :
numbercount(postags) : checks for the presence of numbers(eg. five, 5) in the hashtag
@postags : a list containing pos tags for a hashtag
return : 1 if it contains number(s) else 0
@function :
prepositioncount(postags... | SummerProject16/project | CMUTweetTagger/testFile5.py | Python | cc0-1.0 | 1,676 |
# Copyright © 2018 Red Hat, Inc.
#
# This file is part of Bodhi.
#
# 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.
#
# T... | Conan-Kudo/bodhi | bodhi/tests/server/views/__init__.py | Python | gpl-2.0 | 817 |
# coding: utf-8
"""
HDL Testing Platform
REST API for HDL TP # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.models.pin import Pin # ... | andipla/autosub | src/plugins/vels_ob/test/test_pin.py | Python | gpl-2.0 | 768 |
# pack.py -- For dealing with packed git objects.
# Copyright (C) 2007 James Westby <jw+debian@jameswestby.net>
# Copyright (C) 2008-2013 Jelmer Vernooij <jelmer@jelmer.uk>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; ... | muhkuh-sys/org.muhkuh.tools-flasher | jonchki/dulwich/pack.py | Python | gpl-2.0 | 68,723 |
import abc
import numpy as np
import tensorflow as tf
from swl.machine_learning.tensorflow_model import SimpleSequentialTensorFlowModel
import swl.machine_learning.util as swl_ml_util
#--------------------------------------------------------------------
class Synth90kCrnn(SimpleSequentialTensorFlowModel):
def __init... | sangwook236/sangwook-library | python/test/language_processing/synth90k_crnn.py | Python | gpl-2.0 | 29,148 |
# Copyright (c) 2008-2012, Neotion
# 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 an... | CospanDesign/nysa-dionysus-platform | dionysus/misc.py | Python | gpl-2.0 | 8,094 |
import json
import time
from cStringIO import StringIO
import pytest
from Crypt import CryptBitcoin
from Content.ContentManager import VerifyError, SignError
from util.SafeRe import UnsafePatternError
@pytest.mark.usefixtures("resetSettings")
class TestContent:
privatekey = "5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q... | OliverCole/ZeroNet | src/Test/TestContent.py | Python | gpl-2.0 | 12,511 |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2009 Jonathan Matthew <jonathan@d14n.org>
#
# 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 ve... | DylanMcCall/rhythmbox-songinfo-context-menu | plugins/artsearch/musicbrainz.py | Python | gpl-2.0 | 4,454 |
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2013 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) an... | lnielsen/invenio | invenio/modules/ranker/fixtures.py | Python | gpl-2.0 | 1,274 |
# This file is part of the dionaea honeypot
#
# SPDX-FileCopyrightText: 2009 Paul Baecher & Markus Koetter & Mark Schloesser
#
# SPDX-License-Identifier: GPL-2.0-or-later
from dionaea.core import connection
class echo(connection):
def __init__ (self, proto=None):
print("echo init")
connection.__ini... | dionaea-honeypot/dionaea | modules/python/dionaea/echo.py | Python | gpl-2.0 | 1,366 |
from arza.types.root import W_Root
from arza.types import space
from arza.types import api
from arza.runtime import error
class W_PList(W_Root):
def __init__(self, head, tail):
self.head = head
self.tail = tail
def __iter__(self):
cur = self
while not is_empty(cur):
... | gloryofrobots/obin | arza/types/plist.py | Python | gpl-2.0 | 11,988 |
from django.shortcuts import render, get_object_or_404
from page.models import Post
def index(request):
#get the blog posts that are published
posts = Post.objects.filter(published=True)
#now return the rendered template
return render(request, 'page/index.html', {'posts': posts})
def post(request, slug):
#get th... | tridvaodin/Assignments-Valya-Maskaliova | project/page/views.py | Python | gpl-2.0 | 469 |
# Copyright (C) 2007-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 is distribute... | stewartsmith/bzr | bzrlib/repofmt/knitpack_repo.py | Python | gpl-2.0 | 46,938 |
import time
import sys,os
#from subprocess import call
while True:
#call (["sudo php /var/www/fabui/script/notifications.php > /var/www/temp/log.txt"], shell=True)
os.system('sudo php /var/www/fabui/script/notifications.php > /var/www/temp/log.txt')
time.sleep(5)
| tohara/FAB-UI | recovery/python/notification.py | Python | gpl-2.0 | 279 |
# -*- coding: utf-8 -*-
# ###########################################################################
#
# Author: Luis Felipe Mileo
# Fernando Marcato Rodrigues
# Daniel Sadamo Hirayama
# Copyright 2015 KMEE - www.kmee.com.br
#
# This program is free software: you can redistribute it and/... | fernandomr/odoo-brazil-banking | l10n_br_account_banking_payment_cnab/wizard/payment_order_create.py | Python | gpl-3.0 | 5,746 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the PyNeurActiv project, which aims at providing tools
# to study and model the activity of neuronal cultures.
# Copyright (C) 2017 SENeC Initiative
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | Silmathoron/PyNeurActiv | analysis/__init__.py | Python | gpl-3.0 | 1,164 |
r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m simplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m simplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
import sys
import lib.simplejson as json
def main():... | jimyx17/jimh | lib/simplejson/tool.py | Python | gpl-3.0 | 1,025 |
# coding=utf-8
#
# This file is part of SickGear.
#
# SickGear 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.
#
# SickGear is distribu... | SickGear/SickGear | sickbeard/providers/torrentday.py | Python | gpl-3.0 | 7,671 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2015-2016 Zhuyifei1999
#
# 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) a... | Toollabs/video2commons | video2commons/frontend/app.py | Python | gpl-3.0 | 7,166 |
# Very rudimentary test of threading module
import test.test_support
from test.test_support import verbose, cpython_only
from test.script_helper import assert_python_ok
import random
import re
import sys
thread = test.test_support.import_module('thread')
threading = test.test_support.import_module('threading')
import... | mancoast/CPythonPyc_test | cpython/278_test_threading.py | Python | gpl-3.0 | 33,816 |
import pickle
if __name__ == '__main__':
with open('id_generator.bin', 'rb') as f:
_id = pickle.load(f)
print(_id)
with open('id_generator.bin', 'wb') as f:
_id += 1
pickle.dump(_id, f) | sagnik17/Movie-Recommendation-System | site/id_generator.py | Python | gpl-3.0 | 204 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.Account import Account
from module.plugins.internal.Plugin import set_cookie
class ShareonlineBiz(Account):
__name__ = "ShareonlineBiz"
__type__ = "account"
__version__ = "0.41"
__status__ = "testing"
__description__ = """Sha... | jansohn/pyload | module/plugins/accounts/ShareonlineBiz.py | Python | gpl-3.0 | 2,110 |
"""
apps.py: apps menu item
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
from . import MenuItem
from bottle_utils.i18n import lazy_gettext as _
... | karanisverma/feature_langpop | librarian/menu/apps.py | Python | gpl-3.0 | 422 |
# -*- encoding: utf-8 -*-
from abjad import *
import pytest
def test_selectiontools_Parentage_logical_voice_01():
r'''An anonymous staff and its contained unvoiced leaves share
the same signature.
'''
staff = Staff("c'8 d'8 e'8 f'8")
containment = inspect_(staff).get_parentage().logical_voice
... | mscuthbert/abjad | abjad/tools/selectiontools/test/test_selectiontools_Parentage_logical_voice.py | Python | gpl-3.0 | 10,702 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
# 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',
... | jimi-c/ansible | lib/ansible/modules/utilities/logic/wait_for.py | Python | gpl-3.0 | 24,145 |
# Copyright (C) 2016 The BET Development Team
# -*- coding: utf-8 -*-
import numpy as np
import math as m
'''
Suggested changes for user:
Try setting QoI_num = 2.
Play around with the x1, y1, and/or, x2, y2 values to try and
"optimize" the QoI to give the highest probability region
on the reference parameter above.... | eecsu/BET | examples/nonlinearMap/myModel.py | Python | gpl-3.0 | 1,989 |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import numpy as np
import bpy
fro... | DolphinDream/sverchok | nodes/solid/sweep_face.py | Python | gpl-3.0 | 4,476 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.backends.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains BaseCache class which can be used as in-memory cache backend or
extended to support persistence.
"""
from datetime import datetime
import hashlib
from copy import copy
from alp.request ... | gm2211/vpnAlfredWorkflow | src/alp/request/requests_cache/backends/base.py | Python | gpl-3.0 | 5,357 |
from gtrackcore.track.core.GenomeRegion import GenomeRegion
from gtrackcore.util.CommonConstants import BINARY_MISSING_VAL
from gtrackcore.util.CommonFunctions import isNan
from gtrackcore.util.CustomExceptions import NotSupportedError
class GenomeElement(GenomeRegion):
@staticmethod
def createGeFromTrackEl(tr... | sveinugu/gtrackcore | gtrackcore/input/core/GenomeElement.py | Python | gpl-3.0 | 7,445 |
# -*- coding: utf-8 -*-
#
# This file is part of Panucci.
# Copyright (c) 2008-2011 The Panucci Project
#
# Panucci 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 you... | gpodder/panucci | src/panucci/gtkui/gtkplaylist.py | Python | gpl-3.0 | 15,781 |
# coding=utf-8
"""
Impact Layer Merge Dialog.
.. note:: 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.
"""
__... | dynaryu/inasafe | safe/gui/tools/minimum_needs/needs_manager_dialog.py | Python | gpl-3.0 | 33,744 |
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux specific tests."""
from __future__ import division
import collections
import contextlib
import errno
import io
import os
i... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/psutil/tests/test_linux.py | Python | gpl-3.0 | 58,553 |
from __future__ import print_function, division
import os
import math
import numpy as np
import config
from expr import FunctionExpr
from utils import (LabeledArray, aslabeledarray, ExceptionOnGetAttr, ndim,
Axis, FileProducer)
try:
import matplotlib
matplotlib.use('Qt4Agg')
del matpl... | cbenz/liam2 | src/charts.py | Python | gpl-3.0 | 11,202 |
# coding: utf-8
#
# Copyright 2012 NAMD-EMAP-FGV
#
# This file is part of PyPLN. You can get more information at: http://pypln.org/.
#
# PyPLN 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 o... | NAMD/pypln.backend | pypln/backend/workers/tokenizer.py | Python | gpl-3.0 | 1,108 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | nop33/indico | indico/modules/events/timetable/controllers/manage.py | Python | gpl-3.0 | 7,777 |
"""Wrapper around yamllint that supports YAML embedded in Ansible modules."""
from __future__ import annotations
import ast
import json
import os
import re
import sys
import typing as t
import yaml
from yaml.resolver import Resolver
from yaml.constructor import SafeConstructor
from yaml.error import MarkedYAMLError
f... | bcoca/ansible | test/lib/ansible_test/_util/controller/sanity/yamllint/yamllinter.py | Python | gpl-3.0 | 8,386 |
# vim:sw=4 ts=4 et:
# Copyright (c) 2015 Torchbox Ltd.
# felicity@torchbox.com 2015-09-14
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely. This software is provided 'as-is', without any express or implied
# warra... | wilkerwma/codeschool | src/wagtailmarkdown/utils.py | Python | gpl-3.0 | 2,352 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016, 2018, 2020 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 distribu... | chipaca/snapcraft | snapcraft/plugins/v1/waf.py | Python | gpl-3.0 | 3,034 |
##Copyright 2008-2015 Thomas Paviot (tpaviot@gmail.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 Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program... | sven-hm/pythonocc-generator | src/Modules.py | Python | gpl-3.0 | 30,110 |
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | mheap/ansible | test/units/modules/net_tools/nios/test_nios_network_view.py | Python | gpl-3.0 | 5,534 |
"""Unit tests for IDTxl I/O functions."""
import os
import tempfile
import pickle
import pytest
import numpy as np
from pkg_resources import resource_filename
from idtxl import idtxl_io as io
from idtxl import idtxl_utils as utils
from idtxl.data import Data
from idtxl.network_comparison import NetworkComparison
from i... | pwollstadt/IDTxl | test/test_idtxl_io.py | Python | gpl-3.0 | 12,888 |
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import math, sys, re
from calibre.ebooks.lrf.fonts import get_font
from calibre.ebooks.lrf.pylrs.pylrs import TextBlock, Text, CR, Span, \
CharButton, Plot, Paragraph, \
... | jelly/calibre | src/calibre/ebooks/lrf/html/table.py | Python | gpl-3.0 | 13,980 |
"""IdGenerator
A simple class to provide a sequence of integers that can be used
for identification purposes
generator = IdGenerator()
generator() -> returns 0
generator() -> returns 1
...
generator = IdGenerator(1000)
generator() -> returns 1000
generator() -> returns 1001
"""
class IdGenerator:
def __init__(se... | tuffery/Frog2 | frowns/build/lib/frowns/IdGenerator.py | Python | gpl-3.0 | 715 |
import unittest
from requests.exceptions import HTTPError
import lodstats
from lodstats import RDFStats
from requests import HTTPError
from . import helpers
http_base = helpers.webserver(helpers.resources_path)
testfile_path = helpers.resources_path
class LodstatsTest(unittest.TestCase):
def setUp(self):
... | AKSW/LODStats | test/test_lodstats.py | Python | gpl-3.0 | 1,647 |
#!/usr/bin/env python
import sys
from imp import load_source
from os import path
src_path = path.abspath(path.dirname(__file__))
oj_path = path.join(src_path, 'dependencies', 'oj')
sys.path.append(oj_path)
oj = load_source('oj', path.join(oj_path, 'utils', 'run.py'))
oj.run(src_path)
| NuAge-Solutions/NW | oj.py | Python | gpl-3.0 | 292 |
"""
profiles - Django application for managing users, mosques, and their membership.
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/.
"""
| hayalasalah/hayalasalah | web/cloud/cloud/profiles/__init__.py | Python | mpl-2.0 | 283 |
#!/usr/bin/env python
"""
Alphasense ADC Driver for Apolline
"""
import argparse
import serial
import time
from influxdb import InfluxDBClient
from influxdb import SeriesHelper
class ADCSensor:
"""
? Alphasense ADC
"""
def __init__(self,database='apolline'):
self.dbname = database
self... | Spirals-Team/apolline-python | apolline/Alphasense_ADC/AlphasenseADC.py | Python | agpl-3.0 | 3,147 |
#!/usr/bin/python
# Copyright 2013, 2014 Joshua Charles Campbell, Alex Wilson, Eddie Santos
#
# This file is part of UnnaturalCode.
#
# UnnaturalCode is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... | naturalness/unnaturalcode | unnaturalcode/pythonSource.py | Python | agpl-3.0 | 4,032 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "docfield")
webnotes.reload_doc("support", "doctype", "support_ticket")
# customer issue resolved_by should be Profile
if webnote... | gangadhar-kadam/sapphire_app | patches/january_2013/update_closed_on.py | Python | agpl-3.0 | 1,386 |
"""
Module that provides a connection to the ModuleStore specified in the django settings.
Passes settings.MODULESTORE as kwargs to MongoModuleStore
"""
from __future__ import absolute_import
from importlib import import_module
import re
from django.conf import settings
from django.core.cache import get_cache, Inval... | altsen/diandiyun-platform | common/lib/xmodule/xmodule/modulestore/django.py | Python | agpl-3.0 | 7,244 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import with_statement
from django.db import models
from dja... | drayanaindra/shoop | shoop/core/models/product_media.py | Python | agpl-3.0 | 3,018 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Taiga Agile LLC <support@taiga.io>
# 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)... | xdevelsistemas/taiga-back-community | taiga/stats/services.py | Python | agpl-3.0 | 6,986 |
# -*- coding: utf-8 -*-
from south.db import db
from django.db import models
from adm.application.models import *
class Migration:
def forwards(self, orm):
# Adding field 'SubmissionInfo.doc_reviewed_at'
db.add_column('application_submissioninfo', 'doc_reviewed_at', orm['application.... | jittat/ku-eng-direct-admission | application/migrations/0030_add_doc_reviewed_at_to_submission_info.py | Python | agpl-3.0 | 9,283 |
# -*- coding: utf-8 -*-
"""Tests for the teams API at the HTTP request level."""
import json
import ddt
from django.core.urlresolvers import reverse
from django.conf import settings
from nose.plugins.attrib import attr
from rest_framework.test import APITestCase, APIClient
from courseware.tests.factories import Staf... | SravanthiSinha/edx-platform | lms/djangoapps/teams/tests/test_views.py | Python | agpl-3.0 | 40,384 |
# © 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
from odoo.exceptions import UserError
from odoo.tests import common
class TestRecursion(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestRecursion, cls).setUpClass()
cls.d... | OCA/partner-contact | partner_contact_department/tests/test_recursion.py | Python | agpl-3.0 | 915 |
from django.conf import settings
from django.contrib.auth.views import (
LoginView, LogoutView, redirect_to_login as redirect_to_intercept,
)
from django.core.exceptions import PermissionDenied, ValidationError
from django.template.response import TemplateResponse
from django.urls import Resolver404, resolve, rever... | tejo-esperanto/pasportaservo | core/middleware.py | Python | agpl-3.0 | 6,047 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | eicher31/compassion-modules | partner_communication/models/__init__.py | Python | agpl-3.0 | 706 |
from . import check_academic_calendar
from celery.schedules import crontab
from backoffice.celery import app as celery_app
celery_app.conf.beat_schedule.update({
'|Education group| Check academic calendar': {
'task': 'education_group.tasks.check_academic_calendar.run',
'schedule': crontab(minute=0,... | uclouvain/osis | education_group/tasks/__init__.py | Python | agpl-3.0 | 391 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""Superdesk... | mdhaman/superdesk-core | superdesk/__init__.py | Python | agpl-3.0 | 5,286 |
# ***************************************************************************
# * *
# * Copyright (c) 2013-2015 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * Th... | bblacey/FreeCAD-MacOS-CI | src/Mod/Fem/PyGui/_CommandFemMeshNetgenFromShape.py | Python | lgpl-2.1 | 3,519 |
# 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)
class PyTerminado(PythonPackage):
"""Terminals served to term.js using Tornado websockets"""
homepage = "https:/... | iulian787/spack | var/spack/repos/builtin/packages/py-terminado/package.py | Python | lgpl-2.1 | 1,010 |
#!/usr/bin/env python3
import fluidity.diagnostics.annulus_mesh as annulus_mesh
import fluidity.diagnostics.triangletools as triangletools
coordsY = annulus_mesh.SliceCoordsLinear(0.0, 1.0, 0.01, 20)
coordsX = annulus_mesh.SliceCoordsLinear(0.0, 1.0, 0.01, 20)
mesh = annulus_mesh.GenerateRectangleMesh(coordsX, coords... | FluidityStokes/fluidity | tests/Stokes_square_convection_1e4_p2p1/src/generate_mesh.py | Python | lgpl-2.1 | 386 |
from mock import patch, sentinel, call
from arctic.scripts.arctic_fsck import main
from ...util import run_as_main
import sys
import pytest
def test_main():
with patch('arctic.scripts.arctic_fsck.Arctic') as Arctic, \
patch('arctic.scripts.arctic_fsck.get_mongodb_uri') as get_mongodb_uri, \
pa... | Frankkkkk/arctic | tests/unit/scripts/test_arctic_fsck.py | Python | lgpl-2.1 | 2,098 |
#!/usr/bin/python
import commons
from espeak import espeak
import mosquitto
import subprocess
from os import listdir
import random
from os.path import join
from twython import Twython
import ConfigParser
#import time
import moc
import math
from datetime import *
from pytz import timezone
import calendar
from dateutil.r... | irzaip/cipi | cp_speak.py | Python | lgpl-3.0 | 7,663 |
#! /usr/bin/env python3
"""Tool for measuring execution time of small code snippets.
This module avoids a number of common traps for measuring execution
times. See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Co... | theheros/kbengine | kbe/res/scripts/common/Lib/timeit.py | Python | lgpl-3.0 | 12,744 |
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Any, Dict, TYPE_CHECKING
from . import VersionUpgrade34to35
if TYPE_CHECKING:
from UM.Application import Application
upgrade = VersionUpgrade34to35.VersionUpgrade34to35()
def getMetaData() -> Dict... | Patola/Cura | plugins/VersionUpgrade/VersionUpgrade34to35/__init__.py | Python | lgpl-3.0 | 2,372 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | agry/NGECore2 | scripts/mobiles/yavin4/geonosian_bunker/enhanced_kliknik.py | Python | lgpl-3.0 | 1,688 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | agry/NGECore2 | scripts/mobiles/generic/static/tatooine/chadrafanfemale.py | Python | lgpl-3.0 | 1,120 |
import json
import os
import tempfile
from lint import Linter
from lint.util import find
class Eclim(Linter):
language = 'java'
cmd = ('eclim', '-command', 'java_src_update')
regex = r'.'
defaults = {
'disable': True,
}
def run(self, cmd, code):
project = find(os.path.dirname... | michael-ball/sublime-text | sublime-text-3/Packages/User/linters/eclim.py | Python | unlicense | 2,139 |
#!/usr/bin/env python
# documentation publication on http://siconos.gforge.inria.fr
# ./publish [-r <sha>] [-u <gforge_user>] [-s <src dir ] [-b <build dir>] \
# [-w workdir] [-m]
# -r followed by some git sha
# -u followed by gforge login
# -s followed by src directory
# -b followed by build directory
# -... | bremond/siconos | Build/tools/publish.py | Python | apache-2.0 | 6,107 |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | affo/nova | nova/virt/vmwareapi/driver.py | Python | apache-2.0 | 27,905 |
import logging
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.naive_bayes import MultinomialNB
from brain4k.transforms import PipelineStage
class NaiveBayes(PipelineStage):
name = "org.scikit-learn.naive_bayes.MultinomialNB"
def train(self):
logging.debug(
... | wkal/brain4k | brain4k/transforms/sklearn/__init__.py | Python | apache-2.0 | 4,927 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the file entry implementation using pyfsapfs."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
from dfvfs.resolver import resolver
from dfvfs.vfs import apfs_attribute
... | joachimmetz/dfvfs | tests/vfs/apfs_file_entry.py | Python | apache-2.0 | 30,722 |
import logging
import socket
import re
from os import path, remove, makedirs, rename, environ
from . import docker_client, pull_image
from . import DockerConfig
from . import DockerPool
from cattle import Config
from cattle.compute import BaseComputeDriver
from cattle.agent.handler import KindBasedMixin
from cattle.ty... | rancherio/python-agent | cattle/plugins/docker/compute.py | Python | apache-2.0 | 33,197 |
from string import Template
import subprocess
import logging
log = logging.getLogger( __name__ )
COMMAND_LINE_TEMPLATE = Template(
"$collectl_path $destination_arg $mode_arg $subsystems_arg $interval_arg $procfilt_arg $flush_arg $sep_arg"
)
MODE_RECORD = "record"
MODE_PLAYBACK = "playback"
class CollectlCli( ob... | jmchilton/lwr | galaxy/jobs/metrics/collectl/cli.py | Python | apache-2.0 | 5,442 |
# Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | openstack/cloudbase-init | cloudbaseinit/metadata/services/base.py | Python | apache-2.0 | 8,089 |
import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.txn_util import reqToTxn
from plenum.test.helper import sdk_signed_random_requests
NUM_BATCHES = 3
TXNS_IN_BATCH = 5
def create_txns(looper, sdk_wallet_client, count=TXNS_IN_BATCH):
reqs = sdk_signed_random_requests(looper, sd... | evernym/plenum | plenum/test/ledger/conftest.py | Python | apache-2.0 | 1,170 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from builtins import range
from past.utils import old_div
import argparse
import time
import matplotlib
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.dates as mdates
imp... | russel/pychapel | docs/source/examples/test_finance_python_numpy.py | Python | apache-2.0 | 2,939 |
# Copyright 2019 Microsoft Corporation
#
# 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 wri... | Sutto/cloud-custodian | tools/c7n_azure/tests_azure/test_filters_marked_for_op.py | Python | apache-2.0 | 3,258 |
# Copyright 2013-2015 ARM Limited
#
# 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... | chase-qi/workload-automation | wlauto/workloads/geekbench/__init__.py | Python | apache-2.0 | 15,690 |
# Copyright (c) 2011 OpenStack Foundation
# 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 ... | orbitfp7/nova | nova/scheduler/filter_scheduler.py | Python | apache-2.0 | 7,412 |
# ===============================================================================
# Copyright 2019 ross
#
# 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/LICE... | USGSDenverPychron/pychron | pychron/hardware/actuators/u3_actuator.py | Python | apache-2.0 | 1,297 |
"""Helper to help store data."""
import asyncio
from json import JSONEncoder
import logging
import os
from typing import Any, Callable, Dict, List, Optional, Type, Union
from homeassistant.const import EVENT_HOMEASSISTANT_FINAL_WRITE
from homeassistant.core import CALLBACK_TYPE, CoreState, HomeAssistant, callback
from... | GenericStudent/home-assistant | homeassistant/helpers/storage.py | Python | apache-2.0 | 8,036 |
# -*- coding: utf-8 -*-
#
# 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 (... | apache/bloodhound | bloodhound_multiproduct/tests/__init__.py | Python | apache-2.0 | 4,522 |
from typing import Any, Dict, List, MutableMapping
from django.conf import settings
from django.db.models import Count
from django.utils.translation import ugettext as _
from zerver.lib.actions import (
create_users,
do_add_reaction,
do_send_messages,
internal_prep_stream_message_by_name,
internal... | showell/zulip | zerver/lib/onboarding.py | Python | apache-2.0 | 7,591 |
a = 1224
while a:
temp = a%10
print temp
a = a//10
| saurabhkumar1989/programming_question_python | questions/integer_number.py | Python | apache-2.0 | 58 |
# Copyright 2017, Google LLC 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 a... | jonparrott/gcloud-python | dlp/noxfile.py | Python | apache-2.0 | 3,018 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-15 21:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateM... | learric/rivals_api | questions/migrations/0001_initial.py | Python | apache-2.0 | 1,423 |
# -------------------------------------------------------------
#
# 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 unde... | apache/incubator-systemml | src/main/python/systemds/operator/algorithm/builtin/scale.py | Python | apache-2.0 | 1,766 |
# 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 law or agreed ... | dsiddharth/access-keys | keystone/tests/contrib/kds/paths.py | Python | apache-2.0 | 915 |