repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
migasfree/migasfree-backend | migasfree/app_catalog/migrations/0001_initial.py | from django.db import migrations, models
import django.db.models.deletion
import markdownx.models
import migasfree.app_catalog.models
import migasfree.core.models.migas_link
class Migration(migrations.Migration):
initial = True
dependencies = [
('core', '0001_initial'),
]
operations = [
... |
jeremiahyan/odoo | addons/sale_management/models/sale_order.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from odoo import SUPERUSER_ID, api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools import is_html_empty
class SaleOrder(models.Model):
_inhe... |
WesternOKState/CampusClaxon | AlertSubscriber/views.py | import re
from braces.views import GroupRequiredMixin
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import View
from django.contrib.auth.models import User
from AlertAdmin.models import Subscriber, Topic, TopicSubscription, Setting, MessageLog
from CampusClaxon.SMSManag... |
migasfree/migasfree-backend | migasfree/app_catalog/admin.py | # -*- coding: utf-8 -*-
# Copyright (c) 2017-2021 Jose Antonio Chavarría <jachavar@gmail.com>
# Copyright (c) 2017-2021 Alberto Gacías <alberto@migasfree.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 Softw... |
daeyun/vim-matlab | rplugin/python/vim_matlab/__init__.py | import hashlib
import os
import datetime
import errno
import re
import time
import collections
import neovim
from matlab_cli_controller import MatlabCliController
from python_vim_utils import PythonVimUtils as vim_helper
import python_vim_utils
__created__ = 'Mar 01, 2015'
__license__ = 'MPL 2.0'
__author__ = 'Daey... |
ansp-2015/arquea | outorga/tests.py | # -*- coding: utf-8 -*-
# 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 date, timedelta, datetime
from decimal import Decimal
from django.ht... |
DatapuntAmsterdam/handelsregister | web/handelsregister/datasets/sbicodes/load_sbi_codes.py | """
Om Handelsregister vestigingen te kunnen
selecteren en sorteren op verschillende categorien
en activiteiten maken we gebruik van de sbi codes.
SBI codes zitten in een hiërarchie(n):
- De vraag antwoord hiërarchie (QA)
- officiele indeling.
De vraag antwoord hiërarchie (QA) is wat makkelijker
in gebruik. We wi... |
VWApplications/VWCourses | forum/migrations/0002_reply_topic.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 22:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('forum', '0001_initial'),
]
operations = [
... |
chrisnorman7/pyrts | tests/options_test.py | from pytest import raises
from server.db import Option
from server.options import options
def test_add_option():
o = options.add_option('name', 'value')
assert isinstance(o, Option)
assert o.name == 'name'
assert o.value == 'value'
assert o.id is not None
def test_get():
options.add_option(... |
kerel-fs/ogn-python | ogn/collect/database.py | from celery.utils.log import get_task_logger
from ogn.model import Device, AddressOrigin
from ogn.utils import get_ddb
from ogn.collect.celery import app
logger = get_task_logger(__name__)
def update_devices(session, origin, devices):
session.query(Device) \
.filter(Device.address_origin == origin) \
... |
Bluelytics/bluenews | bluecrawler/bluecrawler/spiders/lanacion_spider.py | from scrapy.spider import Spider
from scrapy.selector import Selector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders.crawl import CrawlSpider, Rule
from bluecrawler.items import NewsItem
import re
def process_onclick(value):
m = re.search("canonical\('(.+?)'", value... |
tom-heimbrodt/oeplatform | dataedit/migrations/0005_tag_color.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-08-03 10:49
from __future__ import unicode_literals
import colorfield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dataedit', '0004_auto_20160803_1157'),
]
operations = [
mig... |
jeffdasilva/astroblast | fpga/quartus.py | import os
import unittest
from fpga.intel import IntelFpgaProject, IntelFpgaFile
class QuartusProject(IntelFpgaProject):
UNKNOWN_DEVICE = "Unknown"
def __init__(self, project_name, project_dir=None):
super(QuartusProject, self).__init__(output_dir=project_dir)
self.project_name = project_n... |
simonyiszk/openwebrx | openwebrx.py | #!/usr/bin/python2
print "" # python2.7 is required to run OpenWebRX instead of python3. Please run me by: python2 openwebrx.py
"""
This file is part of OpenWebRX,
an open-source SDR receiver software with a web UI.
Copyright (c) 2013-2015 by Andras Retzler <randras@sdr.hu>
This program is free softwa... |
faustedition/faust-app | faust-utils/faust.py | #!/usr/bin/env python
#
# Helper functions and routines common to Faust related tasks
#
import ConfigParser
import StringIO
import email.mime.text
import os
import os.path
import smtplib
import lxml.etree
config = ConfigParser.ConfigParser()
config.read(['faust.ini', "local.ini"])
xml_dir = config.get("xml", "dir")... |
SysTheron/adhocracy | src/adhocracy/lib/helpers/badge_helper.py | from base64 import b64encode
from hashlib import sha1
from io import BytesIO
from PIL import Image, ImageDraw
from pylons import config
from adhocracy.lib import cache
def make_key(iden, args, kwargs):
conf = config.get
instance = args[0].instance
instance_w = instance and instance.thumbnailbadges_width... |
PriviPK/privipk-sync-engine | inbox/mailsync/backends/imap/condstore.py | """
-----------------
GENERIC IMAP SYNC ENGINE (~WITH~ COND STORE)
-----------------
Generic IMAP backend with CONDSTORE support.
No support for server-side threading, so we have to thread messages ourselves.
"""
from gevent import sleep
from inbox.crispin import retry_crispin
from inbox.mailsync.backends.base impor... |
HelloLily/hellolily | lily/messaging/email/migrations/0034_auto_20170929_1222.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-09-29 12:22
from __future__ import unicode_literals
from django.db import migrations
def integer_to_charfield(apps, schema_editor):
EmailOutboxMessage = apps.get_model('email', 'EmailOutboxMessage')
for email_outbox_message in EmailOutboxMessage.o... |
lafranceinsoumise/api-django | agir/people/management/commands/mailtrain_update.py | from datetime import datetime
import string
from uuid import UUID
from django.core.management import BaseCommand
from django.utils import timezone
from agir.lib.mailtrain import update_person
from agir.people.models import Person
PADDING = "0000000-0000-0000-0000-000000000000"
class Command(BaseCommand):
help ... |
chrrrles/c3px | fabfile/slic3r.py | # Copyright (c) 2013 - The C3PX authors.
#
# This file is part of C3PX.
#
# C3PX 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 versio... |
alantygel/ckanext-featurednumber | ckanext/featurednumbers/db.py | import ckan.model as model
from sqlalchemy import Table
from sqlalchemy import Column
from sqlalchemy import types
from ckan.model.meta import metadata, mapper, Session
from ckan.model.types import make_uuid
featurednumbers_table = Table('featurednumbers', metadata,
Column('id_fn', types.Integer, primary_key=Tru... |
rohitdatta/pepper | migrations/versions/013b5c571b68_.py | """empty message
Revision ID: 013b5c571b68
Revises: 2db13dc62333
Create Date: 2016-09-10 02:26:04.344347
"""
# revision identifiers, used by Alembic.
revision = '013b5c571b68'
down_revision = '2db13dc62333'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... |
uclouvain/OSIS-Louvain | base/views/teaching_material.py | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
VitalPet/addons-onestein | account_cost_spread_all/tests/test_code_spread.py | # -*- coding: utf-8 -*-
# Copyright 2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.addons.account_cost_spread.tests.test_code_spread \
import TestAccountCostSpread
class TestAccountCostSpreadAll(TestAccountCostSpread):
def test_01_crea... |
fiduswriter/fiduswriter | fiduswriter/base/tests/test_admin.py | from urllib.parse import urljoin
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from testing.testcases import LiveTornadoTestCase
from testing.selenium_helper import SeleniumHelper
class AdminTest(LiveTorna... |
ieb/Shahnama | src/ShahnamaDJ/settings.py | # Django settings for ShahnamaDJ project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Ian Boston', 'ieb@tfd.co.uk'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': ... |
cloudbase/maas | src/maasserver/testing/tests/test_rabbit.py | # Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for `maastesting.rabbit`."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__... |
laslabs/geospatial | geoengine_stock_quant/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley
# Copyright: 2015 LasLabs
#
# 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... |
edx/credentials | credentials/apps/catalog/migrations/0012_courserun_copy_column_values.py | # Generated by Django 1.11.25 on 2019-11-01 17:04
from django.db import migrations
def copy_column_values_forwards(apps, schema_editor):
"""
Copy the start and end fields into the start_date and end_date fields respectively.
This table should have a few thousand rows at most, so I'm not so concerned ab... |
taigaio/taiga-back | tests/unit/test_base_api_permissions.py | # -*- 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... |
iw3hxn/LibrERP | sale_order_requirement_project/models/order_requirement_line.py | # -*- coding: utf-8 -*-
# © 2019 Didotech srl (www.didotech.com)
import re
from openerp.osv import orm, fields
class OrderRequirementLine(orm.Model):
_inherit = 'order.requirement.line'
def _product_type_small(self, cr, uid, ids, field_name, arg, context=None):
context = context or self.pool['res.... |
ndp-systemes/odoo-addons | stock_split_picking/tests/__init__.py | # -*- coding: utf8 -*-
#
# Copyright (C) 2014 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
# License,... |
2015fallhw/cdw2 | users/s2b/g7/task0.py | # 各組分別在各自的 .py 程式中建立應用程式 (第1步/總共3步)
from flask import Blueprint, render_template
# 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄
bg9 = Blueprint('bg9', __name__, url_prefix='/bg9', template_folder='templates')
@bg9.route('/task0')
def task0():
return "bg9 task0"
@bg9.route('/task1')
def task1():
... |
ivoire/DataTag | DataTag/management/commands/addtags.py | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2015 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag 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
#... |
ShashaQin/erpnext | erpnext/crm/doctype/newsletter/newsletter.py | # Copyright (c) 2015, Frappe 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 import throw, _
from frappe.model.document import Document
from frappe.email.bulk import check_bulk_limit... |
factorlibre/l10n-spain | l10n_es_aeat_sii_cash_basis/models/account_partial_reconcile.py | # Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
from odoo.tools import config
class AccountPartialReconcile(models.Model):
_inherit = 'account.partial.reconcile'
def create_tax_cash_basis_entry(self, value_before_reconc... |
DemocracyClub/yournextrepresentative | ynr/apps/candidates/migrations/0016_migrate_data_to_extra_fields.py | from django.conf import settings
from django.db import migrations
def from_person_extra_to_generic_fields(apps, schema_editor):
ExtraField = apps.get_model("candidates", "ExtraField")
PersonExtraFieldValue = apps.get_model(
"candidates", "PersonExtraFieldValue"
)
PersonExtra = apps.get_model("... |
Micronaet/micronaet-migration | report_purchase_custom/report/company/__needed_or_remove__/purchase_view.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008-2010 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
# General contacts <info@kndati.lv>
#
# WARNING: This program as such is intended to be used by professional
# pr... |
stvstnfrd/edx-platform | common/lib/xmodule/xmodule/course_metadata_utils.py | """
Simple utility functions that operate on course metadata.
This is a place to put simple functions that operate on course metadata. It
allows us to share code between the CourseDescriptor and CourseOverview
classes, which both need these type of functions.
"""
from base64 import b32encode
from datetime import dat... |
gem/oq-engine | openquake/hazardlib/gsim/vanhoutte_2018.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2022 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
gam-phon/taiga-back | taiga/projects/issues/api.py | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... |
zxyqwe/hls-server | h3.py | #!/usr/bin/env python
import datetime
import pdb
class sWin:
def IsDecreasing(self):
return self.m_currentSlope < 0
def IsFastDecreasing(self):
return self.m_currentSlope < -self.m_slopeThreshold
def IsFastIncreasing(self):
return self.m_currentSlope > self.m_slopeThreshold
... |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/registry/model/distributionmirror.py | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Module docstring goes here."""
__metaclass__ = type
__all__ = [
'DistributionMirror',
'MirrorDistroArchSeries',
'MirrorDistroSeriesSource',
'MirrorProbeRec... |
laslabs/vertical-medical | sale_medical_prescription/models/medical_prescription_order_line.py | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
class MedicalPrescriptionOrderLine(models.Model):
_inherit = 'medical.prescription.order.line'
sale_order_line_ids = fields.One2many(
string=... |
xpansa/pmis | purchase_request_to_requisition/models/product.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Eficent (<http://www.eficent.com/>)
# <contact@eficent.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero ... |
SKIRT/PTS | modeling/config/analyse_projected_heating.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# ... |
hilgroth/fiware-IoTAgent-Cplusplus | tests/e2e_tests/component/iot_manager_api/manager_devices/delete/setup.py | from lettuce import step, world
from iotqautils.gtwRest import Rest_Utils_SBC
from common.user_steps import UserSteps, URLTypes, ProtocolTypes
from common.gw_configuration import IOT_SERVER_ROOT,CBROKER_HEADER,CBROKER_PATH_HEADER,MANAGER_SERVER_ROOT
api = Rest_Utils_SBC(server_root=IOT_SERVER_ROOT+'/iot')
api2 = Rest... |
acsone/mozaik | mozaik_membership/migrations/1.0.2/post-migration.py | # -*- encoding: utf-8 -*-
from openerp.modules.registry import RegistryManager
from openerp.tools import SUPERUSER_ID
__name__ = '''
* Re-Active workflow.instance for dead-end membership' state
* Find membership notification for coordinate and replace it with the right
coordinate bounce notification.
* Find inconsiste... |
CompassionCH/l10n-switzerland | l10n_ch_hr_payroll/tests/test_max_lpp.py | # -*- coding: utf-8 -*-
# Copyright 2017 Open Net Sàrl
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
import odoo.tests.common as common
from datetime import datetime, timedelta
from odoo.fields import Date
_logger = logging.getLogger(__name__)
class TestMaxLPP(common.TransactionCase... |
acsone/mozaik | mozaik_membership/membership.py | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_membership, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_membership is free software:
# you can redistribute it and/or
# modif... |
d120/pyophase | ophasebase/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Building',
fields=[
('id', models.AutoField(ver... |
CulturePlex/pybossa | setup.py | from setuptools import setup, find_packages
requirements = [
"alembic>=0.6.4, <1.0",
"beautifulsoup4>=4.3.2, <5.0",
"blinker>=1.3, <2.0",
"Flask-Babel>=0.9, <1.0",
"Flask-Cache>=0.12, <1.0",
"Flask-Gravatar>=0.4.1, <1.0",
"flask-heroku>=0.1.8, <1.0",
"Flask-Login>=0.2.3, <0.2.4", ... |
ESOedX/edx-platform | lms/djangoapps/survey/tests/test_utils.py | """
Python tests for the Survey models
"""
from __future__ import absolute_import
from collections import OrderedDict
from django.contrib.auth.models import User
from django.test.client import Client
from survey.models import SurveyForm
from survey.utils import is_survey_required_and_unanswered, is_survey_required_... |
h2g2bob/ynmp-wikipedia-sync | mapping.py | import csv
class MappingDatabase(object):
def __init__(self, entries):
self.entries = entries
def save(self, f):
w = csv.writer(f, dialect="excel-tab")
for ((source, alias), canonical) in sorted(self.entries.items()):
w.writerow((source, alias.encode("utf8"), canonical.encode("utf8")))
@classmethod
def ... |
znegva/pelican-plugins | thumbnailer/thumbnailer.py | import os
import os.path as path
import re
from pelican import signals
import logging
logger = logging.getLogger(__name__)
try:
from PIL import Image, ImageOps
enabled = True
except ImportError:
logging.warning("Unable to load PIL, disabling thumbnailer")
enabled = False
DEFAULT_IMAGE_DIR = "pictures... |
thomasahle/numberlink | gen/test.py | import gen
from mitm import Mitm
import time
def test_all_sizes():
for low in range(4, 15):
t = time.time()
for _ in range(10):
for w in range(4, 15):
for h in range(4, 15):
if abs(w - h) > 5:
continue
mitm... |
ssdi-drive/nuxeo-drive | nuxeo-drive-client/nxdrive/engine/watcher/remote_watcher.py | # coding: utf-8
import os
import socket
from datetime import datetime
from httplib import BadStatusLine
from time import sleep
from urllib2 import HTTPError, URLError
from PyQt4.QtCore import pyqtSignal, pyqtSlot
from nxdrive.client import NotFound
from nxdrive.client.base_automation_client import Unauthorized
from n... |
altai/altai-api | tests/test_utils_mail.py |
# vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab autoindent
# Altai API Service
# Copyright (C) 2012-2013 Grid Dynamics Consulting Services, Inc
# All Rights Reserved
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License ... |
JVO80/xtcli | setup.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Copyright (c) 2014 eXtensive Testing Organization
#
# author : Jean-Vianney OBLIN
# mail :
# description : install script for xtcli
#
# This file is part of the XTC Project
# ---------------------------... |
SixTrack/SixTrack | test/chebythin6d_ions/cheby_plot_kick.py | '''
color code of points:
- black: outside R2 or inside R1 (check);
- colored: inside R2 and outside R1 (check);
- magenta: outside R2 or inside R1 (check) but wronlgy assigned a non-NULL kick;
- white: inside R2 and outside R1 (check) but wronlgy assigned a NULL kick;
'''
import matplotlib.pyplot as plt
import numpy ... |
phuang/ibus | setup/icon.py | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# 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 Sof... |
bogdanvuk/sydpy | sydpy/extens/profiler.py | '''
Created on Oct 17, 2014
@author: bvukobratovic
'''
import GreenletProfiler
import os
from sydpy.component import Component, compinit, sydsys
class Profiler(Component):
def coverage_done(self, sim):
GreenletProfiler.stop()
stats = GreenletProfiler.get_func_stats()
stats.print_all(filt... |
whosaysni/template2pdf | template2pdf/dj/__init__.py | # coding: utf-8
# Copyright (c) 2010, 2011 Accense Technology, Inc. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at y... |
xiangke/pycopia | SMI/pycopia/SMI/CONSTANTS.py | #!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# 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... |
skosukhin/spack | var/spack/repos/builtin/packages/perl-package-deprecationmanager/package.py | ##############################################################################
# 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... |
qtproject/pyside-pyside | tests/QtUiTools/bug_913.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial Licen... |
BhallaLab/moose-thalamocortical | pymoose/tests/MooseTestCase.py | #!/usr/bin/env python
# Author: Subhasis Ray
# Created: 2008-09-18 17:44:39 IST
from math import *
import unittest
from moose import *
class MooseTestCase(unittest.TestCase):
__testId = 0
def __init__(self, *args):
unittest.TestCase.__init__(self, *args)
self.testContainer = Neutral("/test")
... |
flan/media-storage | clients/python/media_storage/storage_proxy.py | """
media_storage.storage_proxy
===========================
Provides an implementation for a client that works with a local deferred
storage proxy.
Usage
-----
This module is not meant to be used externally; relevant objects are exported
to the package level.
Legal
-----
This file is part of the LGPLed Python clie... |
myd7349/Ongoing-Study | python/selenium/weiyun_helper.py | #!/usr/bin/env python3
# coding: utf-8
import json
import os.path
import random
import re
import sys
import time
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as Expect
from selenium.webdriver.common.by import By
from ... |
zigama/rapidsms-rwanda | apps/logger/views.py |
from rapidsms.webui.utils import render_to_response
from models import *
from datetime import datetime, timedelta
from django.views.decorators.http import require_GET, require_POST, require_http_methods
from django.contrib.auth.decorators import permission_required
@permission_required('reports.can_view')
@require_ht... |
hydraplatform/hydra-base | hydra_base/db/alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from hydra_base.db import DeclarativeBase
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.conf... |
OptimalDesignLab/Kona | src/kona/examples/constrained_2by2.py | import numpy as np
from kona.user import UserSolver
class Constrained2x2(UserSolver):
def __init__(self):
super(Constrained2x2, self).__init__(
num_design=2,
num_state=2,
num_eq=1,
num_ineq=0)
self.dRdX = -1*np.eye(2)
self.dRdU = np.array([... |
pytroll/pyresample | pyresample/resampler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019-2021 Pyresample developers
#
# This program 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 y... |
lablup/backend.ai-manager | src/ai/backend/manager/models/alembic/versions/57e717103287_rename_clone_allowed_to_cloneable.py | """rename-clone_allowed-to-cloneable
Revision ID: 57e717103287
Revises: eec98e65902a
Create Date: 2020-10-04 14:14:55.167654
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '57e717103287'
down_revision = 'eec98e65902a'
branch_labels = None
depends_on = None
def upgrade():
op.alte... |
cbclab/MOT | tests/library_functions/normal.py | import unittest
from scipy.special._ufuncs import ndtri
from scipy.stats import norm
import numpy as np
from numpy.testing import assert_allclose
from mot.library_functions import normal_pdf, normal_cdf, normal_ppf
from mot.library_functions.continuous_distributions.normal import _ndtri, normal_logpdf
from mot.lib.uti... |
fluxid/pyhaa | pyhaa/__init__.py | # -*- coding: utf-8 -*-
# Pyhaa - Templating system for Python 3
# Copyright (c) 2011 Tomasz Kowalczyk
# Contact e-mail: code@fluxid.pl
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, ... |
smart-solution/icy | icy_purchase_webkit/report/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
qstokkink/py-ipv8 | ipv8/test/mocking/ipv8.py | from .discovery import MockWalk
from .endpoint import AutoMockEndpoint
from ...attestation.trustchain.community import TrustChainCommunity
from ...dht.discovery import DHTDiscoveryCommunity
from ...keyvault.crypto import default_eccrypto
from ...messaging.interfaces.statistics_endpoint import StatisticsEndpoint
from ..... |
inouire/climage | climage/cat-climage.py | # Copyright 2010-2012 Edouard Garnier de Labareyre
#
# This file is part of climage.
#
# Climage 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... |
zejacobi/ProjectEuler | Solutions/0017.py | """
# PROBLEM 17
If the numbers 1 to 5 are written out in words: one, two, three, four, five,
then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words,
how many letters would be used?
NOTE: Do not count spaces or hyphens. For e... |
google/report2bq | application/classes/ga360_report_manager_test.py | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
STLInspector/STLInspector | tests/core/test_mutation.py | import unittest
import operator
from STLInspector.core.temporallogic import *
class TestSTO(unittest.TestCase):
def test_simple_one(self):
self.assertEqual(AP("a").sto(1), [ap_true])
self.assertEqual(NOT(AP("a")).sto(1), [NOT(ap_true)])
self.assertEqual(NEXT(AP("a")).sto(1), [NEXT(ap_true)... |
lowRISC/opentitan | util/dashboard/gen_dashboard_entry.py | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""
Generate HTML documentation from validated dashboard Hjson tree
"""
import html
import logging as log
import os.path
import re
import sys
from pathlib import Path
impo... |
kayhayen/Nuitka | nuitka/utils/Yaml.py | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
sirca/bdkd_datastore | datastore/lib/bdkd/datastore/datastore.py | # Copyright 2015 Nicta
#
# 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, softwa... |
grantdelozier/TopoCluster | experimental/TestResolverV3_NER.py | import sys
import os
import psycopg2
import xml.etree.ElementTree as ET
from lxml import etree
import math
import io
from collections import Counter
from operator import itemgetter
import datetime
import collections
#For use with Tr-ConLL
def block(ch):
'''
Return the Unicode block name for ch, or None if ch... |
stored/sigepy | sigep/correios_client.py | # coding: utf-8
from suds.client import Client
class CorreiosSROClient(object):
"""
Tipo:
L - O servidor fara a consulta individual objeto por objeto
F - O servidor fara a consulta sequencial do primeiro ultimo objeto
Resultado:
T - O servidor fara a consulta retornando todas as
... |
mezz64/home-assistant | homeassistant/components/mazda/sensor.py | """Platform for Mazda sensor integration."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
LENGTH_KILOMETERS,
LENGTH_MILES,
PERCENTAGE,
PRESSURE_PSI,
)
from . import MazdaEntity
from .const import DATA_CLIENT, DATA_COORDINATOR, DOMAIN
async def async_setup... |
aipescience/django-daiquiri | daiquiri/query/migrations/0016_rename_database_to_schema.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-16 16:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('daiquiri_query', '0015_queryarchivejob'),
]
operations = [
migrations.RenameField(... |
jecr/tesis-caja | recovering/search/splittin_by_date.py | # -*- coding: UTF-8 -*-
import os
import sys
import json
from dateutil import parser
archivo_tweets = sys.argv[1]
directorio = sys.argv[2]
# Comprueba la existencia del directorio
if not os.path.exists(directorio):
print directorio+' no existe, creando...'
os.makedirs(directorio)
print directorio+' creado... |
kgiusti/pyngus | pyngus/endpoint.py | # 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.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use thi... |
google-research/google-research | bnn_hmc/utils/precision_utils.py | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... |
johnmuth81/cloud-compare | pricing/view_main.py | from django.http import HttpResponse, Http404
from django.shortcuts import render
from django.db.models import Q
from django.db.models import Count
from django.db import connection
from pprint import pprint
from models import UIMain, UIVMSummary
from view_gcp import get_gcp_vmimage
from view_aws import get_aws_comp... |
lindycoder/netman | netman/core/objects/switch_base.py | # Copyright 2015 Internap.
#
# 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, so... |
kubeflow/pipelines | components/PyTorch/pytorch-kfp-components/pytorch_kfp_components/components/trainer/generic_executor.py | #!/usr/bin/env/python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
# 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... |
edu1910/simplews | books/migrations/0002_auto_20150710_0324.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('books', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='book',
old_name='publi... |
protwis/protwis | protwis/settings_local_production.py | # local settings
# override these settings by copying and editing this file to protwis/settings_local.py
# Site specific constants
SITE_NAME = 'gpcr' # used for site specific files
SITE_TITLE = 'GPCRdb' # for display in templates
DATA_DIR = '/protwis/data/protwis/' + SITE_NAME
BUILD_CACHE_DIR = DATA_DIR + '/ca... |
google/makani | avionics/network/generate_cvt.py | # Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
bensondaled/pseyepy | pseyepy/io.py | import threading
import queue
import multiprocessing as mp
import subprocess as sp
import numpy as np
import time
import os
import queue
import h5py
try:
import cv2
except ImportError:
cv2 = None
from .asynchronous import CamDump
from .ui import Display
class OpencvWriter():
"""Pipes to a video file using ... |
google-research/google-research | cnn_quantization/tf_cnn_benchmarks/models/trivial_model.py | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.