code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | doduytrung/odoo-8.0 | openerp/addons/base/ir/ir_model.py | Python | agpl-3.0 | 61,894 |
# -*- coding: utf-8 -*-
# Etalage -- Open Data POIs portal
# By: Emmanuel Raviart <eraviart@easter-eggs.com>
#
# Copyright (C) 2011, 2012 Easter-eggs
# http://gitorious.org/infos-pratiques/etalage
#
# This file is part of Etalage.
#
# Etalage is free software; you can redistribute it and/or modify
# it under the term... | Gentux/etalage | etalage/__init__.py | Python | agpl-3.0 | 990 |
# -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi
# Copyright 2013-2014 Camptocamp SA
#
# 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
# Licen... | Endika/account-invoice-reporting | base_comment_template/__openerp__.py | Python | agpl-3.0 | 1,121 |
import uuid
import ddt
import httpretty
from django.conf import settings
from django.http.response import HttpResponse
from django.test import RequestFactory
from edx_django_utils.cache import TieredCache
from mock import patch
from oscar.core.loading import get_class
from oscar.test.factories import BasketFactory, ... | eduNEXT/edunext-ecommerce | ecommerce/enterprise/tests/test_utils.py | Python | agpl-3.0 | 16,925 |
"""Warn about binary operations used as exceptions."""
try:
pass
except Exception or BaseException: # [binary-op-exception]
print("caught1")
except Exception and BaseException: # [binary-op-exception]
print("caught2")
except Exception or BaseException: # [binary-op-exception]
print("caught3... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/pylint/test/functional/exception_is_binary_op.py | Python | agpl-3.0 | 416 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = "naruhodo-ryuichi"
###############GLOBAL CONFIGURATION
# name of xpl host
localVendor = "naruhodo-ryuichi"
# size of receiving buffer in bytes
bufferSize = 1500
| naruhodo-ryuichi/python-xPLpy | xPLpy/xPLConfig.py | Python | agpl-3.0 | 242 |
"""
Admin views for the log watcher app.
"""
from django.contrib import admin
from .models import LogEvent
class LogEventAdmin(admin.ModelAdmin):
"""
Admin form for the ``LogEvent`` data model.
"""
list_display = ('event_date',
'type',
'username',
... | TamiaLab/carnetdumaker | apps/loginwatcher/admin.py | Python | agpl-3.0 | 520 |
#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# 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; version 2 dated June... | rwl/openpowersystem | cpsm/load_model/season.py | Python | agpl-3.0 | 1,789 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Piotrek Wasilewski <wasilewski.piotrek@gmail.com>
#
# 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 Sof... | umitproject/network-admin | netadmin/reportmeta/urls.py | Python | agpl-3.0 | 1,723 |
#
# This file is part of nmgr.
# Copyright (C) 2015 Leo Gaspard
#
# nmgr 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.
#
# nmgr is di... | Ekleog/nmgr | src/nmgr/route.py | Python | agpl-3.0 | 1,239 |
"""
Tests for the bulk_user_activate command.
"""
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import TestCase
from openedx.stanford.djangoapps.student_utils.helpers import get_users_by_email
class BulkUserActivateTests(TestCase):
"""
Test the ... | Stanford-Online/edx-platform | openedx/stanford/djangoapps/student_utils/tests/test_bulk_user_activate.py | Python | agpl-3.0 | 2,256 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, 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 unicode_literals
import pytest
from django.conf impo... | akx/shoop | shoop_tests/front/test_customer_information.py | Python | agpl-3.0 | 2,322 |
# Generated by Django 1.11.3 on 2017-12-07 19:07
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20171004_1133'),
('course_metadata', '0071_auto_20171128_1945'),
]
operations = [
... | edx/course-discovery | course_discovery/apps/course_metadata/migrations/0072_courseentitlement_partner.py | Python | agpl-3.0 | 548 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
# class demo(models.Model):
# _name = 'demo.demo'
# name = fields.Char() | MarcosCommunity/odoo | marcos_addons/demo/models.py | Python | agpl-3.0 | 147 |
#!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, e... | michal-ruzicka/archivematica | src/MCPServer/lib/RPCServer.py | Python | agpl-3.0 | 4,756 |
# coding: utf-8
from bernard import (
layers as lyr,
)
from bernard.analytics import (
page_view,
)
from bernard.engine import (
BaseState,
)
from bernard.i18n import (
translate as t,
)
class __project_name_camel__State(BaseState):
"""
Root class for __project_name_readable__.
Here you m... | BernardFW/bernard | src/bernard/misc/start_project/files/src/__project_name_snake__/states.py | Python | agpl-3.0 | 1,539 |
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, models
class AgedPartnerBalanceXslx(models.AbstractModel):
_name = 'report.a_f_r.report_aged_partner_balance_xlsx'
_inherit = 'report.account_financial_report.abstrac... | BT-astauder/account-financial-reporting | account_financial_report/report/aged_partner_balance_xlsx.py | Python | agpl-3.0 | 10,980 |
# -*- coding: utf-8 -*-
# privacyIDEA is a fork of LinOTP
#
# 2014-12-07 Cornelius Kölbel <cornelius@privacyidea.org>
#
# Copyright (C) 2014 Cornelius Kölbel
# License: AGPLv3
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# Licen... | privacyidea/privacyidea | privacyidea/lib/challenge.py | Python | agpl-3.0 | 5,837 |
import sales_order_notes
| OpusVL/odoo_line_notes_field | line_notes_field/__init__.py | Python | agpl-3.0 | 25 |
# This file is part of VoltDB.
# Copyright (C) 2008-2014 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... | zheguang/voltdb | lib/python/voltcli/cli.py | Python | agpl-3.0 | 28,839 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | runt18/nupic | tests/unit/nupic/support/custom_configuration_test.py | Python | agpl-3.0 | 42,200 |
# Copyright 2020 Cloudbase Solutions Srl
# All Rights Reserved.
import time
from oslo_log import log as logging
from coriolis import utils
LOG = logging.getLogger(__name__)
def check_create_registration_for_service(
conductor_rpc, request_context, host, binary, topic, enabled=False,
mapped_region... | cloudbase/coriolis | coriolis/conductor/rpc/utils.py | Python | agpl-3.0 | 2,235 |
"""
WSGI config for trilhasp 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", "trilhasp.settings")
from django.core... | diraol/trilhasp | trilhasp/trilhasp/wsgi.py | Python | agpl-3.0 | 391 |
# -*- coding: UTF-8 -*-
from __future__ import print_function
import csv
import os
ignored_views = set(["HHB", "FFO", "FFOI"])
seen_views = set([])
seen_aliases = set([])
seen_groups = set([])
tpl = "check_journal(u'{1}', u'{4}', u'{11}', u'{10}')"
print("""# -*- coding: UTF-8 -*-
from __future__ import print_functio... | lsaffre/blog | docs/blog/2016/0305.py | Python | agpl-3.0 | 1,941 |
# -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2016 Trustcode - www.trustcode.com.br #
# Danimar Ribeiro <danimaribeiro@gmail.co... | Trust-Code/trust-addons | trust_crm/models/crm_lead.py | Python | agpl-3.0 | 2,232 |
"""
Tests for Discussion API views
"""
from datetime import datetime
import json
from urlparse import urlparse
import ddt
import httpretty
import mock
from pytz import UTC
from django.core.urlresolvers import reverse
from rest_framework.test import APIClient
from common.test.utils import disable_signal
from discuss... | adoosii/edx-platform | lms/djangoapps/discussion_api/tests/test_views.py | Python | agpl-3.0 | 38,334 |
# -*- coding: 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):
# Adding field 'Order.purchaser_email'
db.add_column(u'spawnsong_order', 'purchaser_email',
... | asm-products/spawnsong | apps/spawnsong/migrations/0010_auto__add_field_order_purchaser_email__chg_field_order_purchaser.py | Python | agpl-3.0 | 9,105 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# 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... | taigaio/taiga-back | taiga/projects/milestones/utils.py | Python | agpl-3.0 | 3,464 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Organization',
... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/organizations/migrations/0001_initial.py | Python | agpl-3.0 | 2,363 |
# 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... | deerwalk/voltdb | lib/python/voltcli/checkstats.py | Python | agpl-3.0 | 18,888 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | adrianpaesani/odoo-argentina | portal_sale_l10n_ar_aeroo_sale/__openerp__.py | Python | agpl-3.0 | 1,846 |
"""
AuthenticatedDictionary.py: Contains an authenticated dictionary data structure.
Supports O(log n) insert, find, and delete, and maintains a hash authenticating
the contents.
The data structure is set-unique; if the same data is in it, it always produces
the same hash, no matter what order it was inserted in.
The... | vesellov/bitdust.devel | blockchain/pybc/AuthenticatedDictionary.py | Python | agpl-3.0 | 57,165 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# 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
# Licen... | odoousers2014/odoo-addons-supplier_price | stock_scrap_resupply/stock_scrap_resupply.py | Python | agpl-3.0 | 1,818 |
"""
SynLogistics AJAX JSON server interaction for common search boxes and
generic interactive components.
"""
#
# Copyright (C) by Wilco Baan Hofman <wilco@baanhofman.nl> 2011
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... | bitlair/synlogistics | ajax/views.py | Python | agpl-3.0 | 2,831 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-10-01 07:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cornerstone', '0005_auto_20190925_0730'),
]
operations = [
migrations.AddField(
model_name='cornersto... | edx/edx-enterprise | integrated_channels/cornerstone/migrations/0006_auto_20191001_0742.py | Python | agpl-3.0 | 824 |
from .vcs import Git
from .tar import Tar
from .manual import Manual
| vstconsulting/polemarch | polemarch/main/repo/__init__.py | Python | agpl-3.0 | 69 |
import re
from django.core.exceptions import ValidationError
def colorValidator(value):
"""
Validates if the given value is a string representing an hexadecimal color
value (starts with a #, then RGB composants in hex).
>>> colorValidator('#0a1b2C')
>>> colorValidator('#AAAAAA')
>>> colorVa... | gordon-/yolo | learning/validators.py | Python | agpl-3.0 | 555 |
# Copyright (C) 2015-2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from datetime import datetime
from hypothesis import given
... | SoftwareHeritage/swh-web-ui | swh/web/tests/api/views/test_release.py | Python | agpl-3.0 | 3,819 |
import json
import datetime
import urllib
from django.utils.translation import ugettext_lazy as _
from django.views.generic import TemplateView, View
from django.views.generic.edit import UpdateView, CreateView
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from django.cor... | catalpainternational/MohingaV1 | profiles/views.py | Python | agpl-3.0 | 15,410 |
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import IntegrityError
from django.utils.encoding import DjangoUnicodeDecodeError
from naturebank.models import (
AbandonmentOption,
Biotope,
BiotopeCategoryOption,
ClimateOption,
Condition... | ellak-monades-aristeias/naturebank | naturebank/management/commands/migrate_legacy_data.py | Python | agpl-3.0 | 42,355 |
# -*- coding: utf-8 -*-
##############################################################################
#
# jasper_server module for OpenERP
# Copyright (c) 2008-2009 EVERLIBRE (http://everlibre.fr) Eric VERNICHON
# Copyright (C) 2009-2011 SYLEAM ([http://www.syleam.fr]) Christophe CHAUVET
#
# This file is a... | Jgarcia-IAS/Fidelizacion_odoo | openerp/extras/jasper_server/__openerp__.py | Python | agpl-3.0 | 2,744 |
import sys
import time
import traceback
import javascript
from browser import document as doc, window, alert
has_ace = True
try:
editor = window.ace.edit("editor")
session = editor.getSession()
session.setMode("ace/mode/python")
editor.setOptions({
'enableLiveAutocompletion': True,
'enableS... | kmolab/kmolab.github.io | data/py/script1.py | Python | agpl-3.0 | 2,826 |
# -*- coding: utf8 -*-
"""Simple auth functions with access to the databases for use in the views.
:license: AGPL v3, see LICENSE for more details
:copyright: 2014-2021 Joe Doherty
"""
# Stdlib imports
from datetime import datetime
import re
# 3rd party imports
from flask import session
from pymongo.errors import D... | pjuu/pjuu | pjuu/auth/backend.py | Python | agpl-3.0 | 14,374 |
# -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under th... | bakhtout/odoo-educ | addons/openeducat_erp/op_exam_attendees/op_exam_attendees.py | Python | agpl-3.0 | 1,616 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 OpenERP - Team de Localización Argentina.
# https://launchpad.net/~openerp-l10n-ar-localization
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | pronexo-odoo/odoo-argentina | l10n_ar_account_check_duo/account.py | Python | agpl-3.0 | 1,557 |
import logging
from unicodedata import category
from unidecode import unidecode
from fnl.nlp.dictionary import Dictionary
from fnl.nlp.strtok import Category
from fnl.text.symbols import LATIN
from fnl.text.token import Token
class TextAnalytics:
"""
A toolset to annotate text with multiple entity taggers and... | fnl/libfnl | src/fnl/nlp/analysis.py | Python | agpl-3.0 | 10,878 |
# -*- coding: utf-8 -*-
from ..base import * # noqa
build_column('idmen', IntCol(is_permanent = True, label = u"Identifiant du ménage"))
build_column('idfoy', IntCol(is_permanent = True, label = u"Identifiant du foyer"))
build_column('idfam', IntCol(is_permanent = True, label = u"Identifiant de la famille"))
build... | adrienpacifico/openfisca-france | openfisca_france/model/caracteristiques_socio_demographiques/demographie.py | Python | agpl-3.0 | 9,098 |
import os
class Config(object):
DEBUG = False
TESTING = False
SECRET_KEY = 'A0Zr18h/3yX R~XHH!jmN]LWX/,?RT'
DATABASE = {
'engine': 'playhouse.pool.PooledPostgresqlExtDatabase',
'name': 'middleware',
'user': 'comunitea',
'port': '5434',
... | jgmanzanas/CMNT_004_15 | project-addons/vt_flask_middleware/config.py | Python | agpl-3.0 | 705 |
#!/usr/bin/python
# Copyright IBM Corp. 2007
#
# indication_tester.py - Tool for testing indication subscription and
# delivery against a CIMOM
# Author: Dan Smith <danms@us.ibm.com>
import sys
from optparse import OptionParser
import BaseHTTPServer
import httplib
import base64
from xml.dom.mini... | libvirt/libcmpiutil | tools/indication_tester.py | Python | lgpl-2.1 | 17,061 |
import dbus
from saluttest import exec_test
from file_transfer_helper import ReceiveFileTest
import constants as cs
class ReceiveFileAndSenderDisconnectWhilePendingTest(ReceiveFileTest):
def accept_file(self):
# The sender of the file disconnects
self.outbound.transport.loseConnection()
s... | freedesktop-unofficial-mirror/telepathy__telepathy-salut | tests/twisted/avahi/file-transfer/receive-file-and-sender-disconnect-while-pending.py | Python | lgpl-2.1 | 979 |
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Public License version 2.1... | osiloke/Flumotion-Transcoder | flumotion/transcoder/admin/adminconsts.py | Python | lgpl-2.1 | 5,673 |
"""Hierarchical Networks Package.
This package makes it possible to construct graph-like Node structures,
especially hierarchical networks.
The most important building block is the new Layer node, which works as an
horizontal version of flow. It encapsulates a list of Nodes, which are trained
and executed in parallel... | ME-ICA/me-ica | meica.libs/mdp/hinet/__init__.py | Python | lgpl-2.1 | 2,949 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/libemos/package.py | Python | lgpl-2.1 | 2,991 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2019 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU ... | fifengine/fifengine | tests/fife_test/tests/MapLoadTest.py | Python | lgpl-2.1 | 5,731 |
from django.conf.urls.defaults import patterns, url
from django.views.generic import DetailView, ListView
from tacc_stats.models import Job
from tacc_stats.views import index, job_memused_hist, job_timespent_hist, create_heatmap, search, JobListView, render_json, get_job, data, list_hosts
urlpatterns = patterns('',
... | TACCProjects/tacc_stats | tacc_stats_web/apps/tacc_stats/urls.py | Python | lgpl-2.1 | 1,061 |
from lcapy import *
import numpy as np
import unittest
class LcapyTester(unittest.TestCase):
"""Unit tests for lcapy state space analysis
"""
def assertEqual2(self, ans1, ans2, comment):
ans1 = ans1.canonical()
ans2 = ans2.canonical()
try:
self.assertEqual(ans1,... | mph-/lcapy | lcapy/tests/test_statespace.py | Python | lgpl-2.1 | 4,517 |
# -*- coding: utf-8 -*-
import py.test
import attr
from hypothesis import given, assume
from hypothesis.strategies import binary
import zope
import zope.interface
from sphinxmixcrypto import IKeyState, SphinxPacket, sphinx_packet_unwrap, PacketReplayCacheDict, SphinxParams
from sphinxmixcrypto import SphinxBodySizeMi... | david415/sphinxmixcrypto | hypothesis/test_hypothesis.py | Python | lgpl-3.0 | 3,010 |
#-*- coding:utf-8 -*-
""" :mod:`reliure.pipeline`
=========================
inheritance diagrams
--------------------
.. inheritance-diagram:: reliure.pipeline
Class
-----
"""
import logging
from collections import OrderedDict
from functools import wraps, update_wrapper
from reliure.options import ValueOption
cla... | kodexlab/reliure | reliure/pipeline.py | Python | lgpl-3.0 | 20,560 |
#!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Ian Horn <ian@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WAR... | imh/gnss-analysis | gnss_analysis/abstract_analysis/report.py | Python | lgpl-3.0 | 1,655 |
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import MOUSEMOTION, MOUSEBUTTONDOWN
import client
import utility
import user_input
class new_local_player():
def __init__(self, ip, port):
global goal_pos
self.client = client.new_client(ip, port)
used_id_pool = self.client.get_id_pool()
self.id = ... | Pixdigit/MultiUserPython | player.py | Python | lgpl-3.0 | 2,249 |
#!/usr/bin/env python
import re
from setuptools import setup, find_packages
from $PROJECT$.constants import __PROJECT__, __DESCRIPTION__, __VERSION__
def _get_requirements(path):
try:
with open(path) as f:
packages = f.read().splitlines()
except (IOError, OSError) as ex:
raise Run... | vpavlin/python-project | setup.py | Python | lgpl-3.0 | 1,022 |
"""
Wrapper functions for printing to a log. The log may be the console, or a
text file, or the screen.
NOTE: Logger does not yet write to a file.
"""
# TODO: Investigate how we can put loggers into 'AssetInstance' objects, to
# collect information per-instance - rather than some global log that all
# methods write i... | david-cattermole/assetQC | python/assetQC/api/logger.py | Python | lgpl-3.0 | 2,078 |
from pycp2k.inputsection import InputSection
from ._external_potential1 import _external_potential1
from ._rescale_forces1 import _rescale_forces1
from ._mixed1 import _mixed1
from ._dft1 import _dft1
from ._mm1 import _mm1
from ._qmmm1 import _qmmm1
from ._eip1 import _eip1
from ._bsse1 import _bsse1
from ._subsys1 im... | SINGROUP/pycp2k | pycp2k/classes/_force_eval2.py | Python | lgpl-3.0 | 1,808 |
from guineapig import *
import sys
import math
import logging
def tokens(line):
for tok in line.split(): yield tok.lower()
class WordProb(Planner):
wc = ReadLines('corpus.txt') | Flatten(by=tokens) | Group(by=lambda x:x, reducingTo=ReduceToCount())
total = Group(wc, by=lambda x:'ANY', retaining=lambda (... | TeamCohen/GuineaPig | tutorial/wordprob.py | Python | lgpl-3.0 | 667 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# 2017-01-12T12:23:35+08:00
# C Interfaces and Implementations
# Exercise 3.1
import os
import os.path
import sys
import cppimport
import matplotlib.pyplot as plt
same_dir = lambda entry: os.path.join(os.path.dirname(__file__), entry)
sys.path.append(os.getcwd())
... | myd7349/Ongoing-Study | python/cppimport/cii_atom_hashing_distribution/cii_atom_hashing_distribution.py | Python | lgpl-3.0 | 1,624 |
#!/usr/bin/env python
#
# =========================================================================
# This file is part of six.sicd-python
# =========================================================================
#
# (C) Copyright 2004 - 2016, MDA Information Systems LLC
#
# six.sicd-python is free software; you can... | ngageoint/six-library | six/modules/python/six/tests/runUnitTests.py | Python | lgpl-3.0 | 1,737 |
#
# DESCRIPTION: This script parses the given input bowtie and/or LAST files and creates a csv row of their data in the given output csv.
#
# AUTHOR: Chelsea Tymms
import sys, os.path
import argparse
def getOptions():
"""Function to pull in arguments from the command line"""
description="""This script takes an i... | McIntyre-Lab/papers | lehmann_2015/mapping_and_overall_expression/scripts/logParser.py | Python | lgpl-3.0 | 5,162 |
r"""
Functions that make it easier to deal with Matlab data.
Notes
-----
#. Written by David C. Stauffer in December 2018.
"""
#%% Imports
from __future__ import annotations
import doctest
from pathlib import Path
from typing import Any, Dict, List, Optional, Set, Tuple, Union
import unittest
from dstauffman.consta... | DStauffman/dstauffman | dstauffman/matlab.py | Python | lgpl-3.0 | 4,465 |
"""
02-read-from-disk-2.py - Catching the `end-of-file` signal from the SfPlayer object.
This example demonstrates how to use the `end-of-file` signal
of the SfPlayer object to trigger another playback (possibly
with another sound, another speed, etc.).
When a SfPlayer reaches the end of the file, it sends a trigger
... | belangeo/pyo | pyo/examples/04-soundfiles/02-read-from-disk-2.py | Python | lgpl-3.0 | 1,308 |
from .resources import (
AuthorResource, BookPrefixResource, ArticleResource, SomeOtherResource,
CustomResource, CSVResource)
from adrest.api import Api
from adrest.utils.auth import AnonimousAuthenticator, AccessKeyAuthenticator, \
UserAuthenticator
from adrest.utils.emitter import XMLTemplateEmitter, JSON... | klen/adrest | tests/main/api.py | Python | lgpl-3.0 | 929 |
# -*- coding: utf-8 -*-
"""This file is part of the TPOT library.
TPOT was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Weixuan Fu (weixuanf@upenn.edu)
- Daniel Angell (dpa34@drexel.edu)
- and many more generous open source contributors
TPOT is f... | PG-TUe/tpot | tpot/config/regressor.py | Python | lgpl-3.0 | 5,754 |
#!/usr/bin/env python
# -*-coding:utf-8 -*
"""
Script to do CTI with 3CX and Freshdesk on macOS
"""
import sys
import logging
import configparser
import getopt
import os
import atexit
from alkivi.logger import Logger
from scriptlock import Lock
from freshdesk.api import API
from models import Phonebook, IPBXBinder
f... | alkivi-sas/freshdesk-to-3cx | sync-contacts.py | Python | lgpl-3.0 | 5,304 |
# -*- coding: utf-8 -*-
# wasp_backup/file_archiver.py
#
# Copyright (C) 2017 the wasp-backup authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-backup.
#
# wasp-backup is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | a1ezzz/wasp-backup | wasp_backup/file_archiver.py | Python | lgpl-3.0 | 2,627 |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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) any later ve... | Jozhogg/iris | lib/iris/tests/unit/fileformats/grib/test_GribWrapper.py | Python | lgpl-3.0 | 6,115 |
"""
Handle the term annotations.
"""
from pprint import pprint
from combine.metadata.webservices import json_providers_for_uri, json_term_for_uri
ICON_WARNING = "<span class=\"fa fa-exclamation-circle fa-lg\" title=\"true\" style=\"color:red\"> </span>"
ICON_TRUE = "<span class=\"fa fa-check-circle fa-lg\" title=\"tr... | matthiaskoenig/tellurium-web | teweb/combine/metadata/annotation.py | Python | lgpl-3.0 | 6,591 |
# Copyright (C) 2009, Brad Beattie
#
# 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 ... | R-daneel-olivaw/mutation-tolerance-voting | pyvotecore/schulze_helper.py | Python | lgpl-3.0 | 8,939 |
from django import forms
from open-ehr.labs.models import PatientInfo
from open-ehr.registration.forms import *
from open-ehr.report_manager.models import *
from django.forms.widgets import CheckboxSelectMultiple
class PatientInfoForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
self.created_by = ... | saketkc/open-ehr-django | open-ehr-django-src/labs/forms.py | Python | lgpl-3.0 | 4,518 |
import numpy as np
import hcn
from IPython import embed, get_ipython
import vtk_visualizer as vv
if __name__ == "__main__":
m = hcn.Model3D.from_file("b4.obj", "m")
m = m.select_x(0, 1)
m = m.select_y(0, 1)
m = m.select_z(0.01, 1)
vv.plotxyz(m.to_array(), block=True)
sm = m.smoothed(knn=160, o... | SintefRaufossManufacturing/python-hcn | demo.py | Python | lgpl-3.0 | 842 |
# encoding: utf-8
# Copyright (C) 2017 John Törnblom
#
# This file is part of pyxtuml.
#
# pyxtuml 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) ... | john-tornblom/pyxtuml | tests/test_xtuml/test_tools.py | Python | lgpl-3.0 | 4,149 |
# This file is part of puppet-panel.
#
# puppet-panel 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.
#
# puppet-panel is distributed i... | ybulach/puppet-panel | panel/urls.py | Python | lgpl-3.0 | 2,430 |
import unittest
import nest
from nix4nest.nest_api.models.multimeter import NestMultimeter
class TestNode(unittest.TestCase):
def setUp(self):
nest.ResetKernel()
self.neuron_id = nest.Create('iaf_neuron')[0]
rec_params = {'record_from': ['V_m'], 'withtime': True}
self.mm_id = n... | asobolev/nix4nest | nix4nest/test/test_nest_api/test_multimeter.py | Python | lgpl-3.0 | 967 |
import unittest
import os
import shelve
import time
from tests_common import CommonTests, add_server_methods
from tests_xml import XmlTests
from tests_subscriptions import SubscriptionTests
from datetime import timedelta, datetime
from tempfile import NamedTemporaryFile
import opcua
from opcua import Server
from opcu... | bitkeeper/python-opcua | tests/tests_server.py | Python | lgpl-3.0 | 27,210 |
import cubed
print(cubed.cub(2,106))
| Frikeer/LearnPython | exc8/exc8.py | Python | unlicense | 38 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: tasking_dsz.py
import mcl.framework
import mcl.tasking
class dsz:
INTERFACE = 16842801
PFAM = 4169
PROVIDER_ANY = 4169
PROVIDER = 16... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/security/cmd/permissions/tasking_dsz.py | Python | unlicense | 507 |
# Network Security Spring 2015 Assignment 1
# Programming problem
# Roberto Amorim - rja2139
import argparse
import socket
import os.path
# Here I take care of the command line arguments
parser = argparse.ArgumentParser(description='Server that holds encrypted data until client requests it.', add_help=True)
parser.a... | rjamorim/netsec-hw1 | server.py | Python | unlicense | 3,585 |
def matrix_multiply(A, B):
"""returns the product (matrix) of matrices A and B
or number A and vector B"""
if isinstance(A, (tuple, list)) and isinstance(B, (tuple, list)):
return _mm_multiply(A, B)
elif isinstance(A, (int, float)) and isinstance(B, (tuple, list)):
return _nm_multiply(A,... | hellux/3d-projection | legacy/renderer_py/lib/matrix.py | Python | unlicense | 2,040 |
from __future__ import unicode_literals
import subprocess
from .common import PostProcessor
from ..utils import (
shlex_quote,
PostProcessingError,
)
class ExecAfterDownloadPP(PostProcessor):
def __init__(self, downloader=None, verboseOutput=None, exec_cmd=None):
self.verboseOutput = verboseOutp... | xu-cheng/youtube-dl | youtube_dl/postprocessor/execafterdownload.py | Python | unlicense | 865 |
from abstract_builder import AbstractBuilder
from product import Product
class ConcreteBuilder(AbstractBuilder):
"""
Concrete implementation for AbstractBuilder. Please notice that this class
also offers a method for returning the whole, newly-created product
"""
_product = None
def _... | csparpa/gof-design-patterns | python/builder/concrete_builder.py | Python | unlicense | 760 |
#!/usr/bin/env python
# This program is designed to send a single email to me once a day if it doesn't see a commit
# in the last 24 hours to gist_a_day.
from gistapi import Gist, Gists
import gmail
import pprint
config = {
'sender' : 'davidelmets4peace@gmail.com',
'senderpw' : 'yuslohaw',
'recipient' : ... | manchicken/gist_per_day | gist_reminder.py | Python | unlicense | 554 |
import logging
from copper.core.op.op_network import OP_Network
from copper.core.parameter.parm_template import *
from copper.core.data.geometry_data import GeometryData
class SOPCookException(Exception):
pass
class SOP_Node(OP_Network):
__base__ = True
def __init__(self, engine, parent):
super(SOP_Node, ... | cinepost/Copperfield_FX | copper/sop/sop_node.py | Python | unlicense | 744 |
from pyox.webhdfs import WebHDFS
from pyox.client import ServiceError
from datetime import datetime
import argparse
import sys
import os
from os.path import isfile
from glob import glob
from math import ceil
class tracker:
def __init__(self):
self.values = set()
def add(self,value):
self.values.add... | alexmilowski/python-hadoop-rest-api | pyox/hdfs_command.py | Python | apache-2.0 | 9,739 |
# -*- encoding: utf-8 -*-
from django.views.generic import TemplateView
from base.view_utils import BaseMixin
from compose.models import CodeSnippet
class DashView(BaseMixin, TemplateView):
template_name = 'example/dash.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(... | pkimber/compose | example_compose/views.py | Python | apache-2.0 | 665 |
"""
Tools for visualizing dependencies between Terms.
"""
from __future__ import unicode_literals
from contextlib import contextmanager
import errno
from functools import partial
from io import BytesIO
from subprocess import Popen, PIPE
from networkx import topological_sort
from six import iteritems
from zipline.pip... | quantopian/zipline | zipline/pipeline/visualize.py | Python | apache-2.0 | 5,975 |
import vcr
@vcr.use_cassette
def test_einfo_dblist(client):
dblist_result = client.einfo()
assert 'protein' in dblist_result.databases
assert 48 == len(dblist_result.databases)
@vcr.use_cassette
def test_einfo_dbinfo(client):
dbinfo_result = client.einfo(db="protein")
assert "370927433" == dbi... | biocommons/eutils | tests/test_eutils_xmlfacades_einforesult.py | Python | apache-2.0 | 495 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import A... | kinow-io/kinow-python-sdk | test/test_subtitle_file.py | Python | apache-2.0 | 747 |
"""
Support for Advanced Policy Firewall (APF)
==========================================
:maintainer: Mostafa Hussein <mostafa.hussein91@gmail.com>
:maturity: new
:depends: python-iptables
:platform: Linux
"""
import salt.utils.path
from salt.exceptions import CommandExecutionError
try:
import iptc
IPTC_IMP... | saltstack/salt | salt/modules/apf.py | Python | apache-2.0 | 3,165 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... | HewlettPackard/oneview-ansible | library/oneview_server_hardware.py | Python | apache-2.0 | 13,959 |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | kidaa/aurora | src/main/python/apache/aurora/config/schema/base.py | Python | apache-2.0 | 4,442 |
# -*- coding: utf-8 -*-
# Copyright 2022 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-dialogflow-cx | google/cloud/dialogflowcx_v3/services/deployments/transports/grpc.py | Python | apache-2.0 | 12,804 |
# -*- coding: utf-8 -*-
from aniracetam import Application
app = Application('poll.settings')
| tokyo-jesus/aniracetam | example/polls/wsgi.py | Python | apache-2.0 | 96 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.