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 |
|---|---|---|---|---|---|
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | avanzosc/cost_simulator | cost_simulator/models/simulation_template.py | Python | agpl-3.0 | 4,268 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Task.sequence'
db.delete_column(u'damis_task', 'sequenc... | InScience/DAMIS-old | src/damis/migrations/0025_auto__del_field_task_sequence__del_field_task_stderr__del_field_task_s.py | Python | agpl-3.0 | 11,099 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce 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.
"""
Patched version of Django's Makemessages that works with Jinja2.
Works by monkey patch... | suutari/shoop | shuup/core/management/commands/makemessages.py | Python | agpl-3.0 | 5,247 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2018 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,... | ndp-systemes/odoo-addons | base_res_config_improved/__openerp__.py | Python | agpl-3.0 | 1,290 |
# -*- coding: utf-8 -*-
from datetime import date
from django import forms
from django.forms.util import ErrorList
from openedx.core.djangoapps.ga_operation.ga_operation_base_form import (GaOperationEmailField,
FIELD_NOT_INPUT, INVALID_EMAIL)
... | nttks/edx-platform | lms/djangoapps/ga_operation/forms/search_by_email_and_period_date_form.py | Python | agpl-3.0 | 1,730 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_guideseq
----------------------------------
Tests for `guideseq` module.
"""
import yaml
import unittest
import os
import shutil
import utils
from guideseq import guideseq
TEST_SAMPLE_BARCODES = {'AGGCATGAGATCGC': 'mysample', 'GACTCCTGCGATAT': 'sample2'}
TEST_U... | aryeelab/guideseq | test/test_guideseq.py | Python | agpl-3.0 | 4,288 |
# Generated by Django 3.2.12 on 2022-02-23 08:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import opaque_keys.edx.django.models
import simple_history.models
class Migration(migrations.Migration):
... | eduNEXT/edx-platform | openedx/core/djangoapps/course_live/migrations/0001_initial.py | Python | agpl-3.0 | 3,720 |
#!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Access module - Models
# © Copyright 2013-2015 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General P... | nikitos/npui | netprofile_access/netprofile_access/models.py | Python | agpl-3.0 | 23,665 |
"""
simpleSetup2: runs POST the JS setup
NOTE: for 1.2 USERS (and their signatures) still done here. Next jsSetup will take this over and the User setup part
will be removed from here.
"""
import os
import sys
import logging
import time
sys.path = ['rasUtilities'] + sys.path
import OSEHRASetup
from OSEHRAHelper impo... | vistadataproject/nodeVISTA | setupDocker/pySetup/simpleSetup2.py | Python | agpl-3.0 | 5,139 |
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo.exceptions import ValidationError
from .common import Common
class TestPackagingTypeCanBeSold(Common):
@classmethod
def setUpClassSaleOrder(cls):
super().setUpClassSaleOrder()
cls.order_li... | OCA/sale-workflow | sale_by_packaging/tests/test_packaging_type_can_be_sold.py | Python | agpl-3.0 | 2,140 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import bs4
import json
import re
def xml2json(s):
global timestamp
timestamp = 0
s = s.replace(u'\xa0', u' ')
soup = bs4.BeautifulSoup(s, features="lxml")
intervention_vierge = {"intervenant": "", "contexte": ""}
intervention_vierge["sourc... | regardscitoyens/nosdeputes.fr | batch/hemicycle/parse_hemicycle.py | Python | agpl-3.0 | 4,977 |
# coding=utf-8
"""
Implements PowerManagement functions using /sys/class/power_supply/*
See doc/linux for platform-specific details.
"""
__author__ = 'kulakov.ilya@gmail.com'
import os
import warnings
from power import common
POWER_SUPPLY_PATH = '/sys/class/power_supply'
if not os.access(POWER_SUPPLY_PATH, os.R_OK... | tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/power/linux.py | Python | agpl-3.0 | 8,180 |
"""
WSGI config for repomaker 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | fdroidtravis/repomaker | repomaker/wsgi.py | Python | agpl-3.0 | 396 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/... | staute/shinken_deb | shinken/util.py | Python | agpl-3.0 | 24,533 |
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
class RegistrationForm(forms.Form):
username = forms.RegexField(regex=r'^\w+$', widget=forms.TextInput(attrs=dict(required=True, max_length=30)), label=_("Username"), error_mess... | edx/edx-notifications | testserver/forms.py | Python | agpl-3.0 | 1,437 |
# -*- coding: utf-8 -*-
# © 2016 Sunflower IT (http://sunflowerweb.nl)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Message Edit",
"summary": "Adds an option to edit mail to different partners",
"version": "8.0.1.0.0",
"category": "Social Network",
"website": "https://... | acsone/social | mail_edit/__openerp__.py | Python | agpl-3.0 | 764 |
#flake8: noqa
#
import notifications
import base
import setting
| buguelos/odoo | addons/web_notification/__init__.py | Python | agpl-3.0 | 64 |
# -*- coding: utf-8 -*-
from openerp.tests import common
from openerp.osv.orm import except_orm
from datetime import datetime
from . import test_util
class TestPlanning(common.TransactionCase):
def setUp(self):
super(TestPlanning, self).setUp()
# Cursor and user initialization
cr, uid =... | jeacaveo/planning_70 | tests/test_planning.py | Python | agpl-3.0 | 19,305 |
from django.core.management.base import BaseCommand
from candidates.models import OrganizationExtra
class Command(BaseCommand):
def handle(self, *args, **options):
for party_extra in OrganizationExtra.objects \
.filter(base__classification='Party') \
.select_related('bas... | datamade/yournextmp-popit | candidates/management/commands/candidates_parties_with_multiple_emblems.py | Python | agpl-3.0 | 834 |
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Payment Order Email",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"maintainers": [],
"website"... | OCA/bank-payment | account_payment_order_vendor_email/__manifest__.py | Python | agpl-3.0 | 634 |
"""
A command to notify non active users
"""
from datetime import datetime, timedelta
from logging import getLogger
from django.core.management.base import BaseCommand
from pytz import utc
from common.lib.mandrill_client.client import MandrillClient
from courseware.models import StudentModule
from lms.djangoapps.bran... | philanthropy-u/edx-platform | common/djangoapps/philu_commands/management/commands/notify_non_active_users.py | Python | agpl-3.0 | 3,635 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | mallconnectionorg/openerp | rrhh/l10n_cl_banks/__openerp__.py | Python | agpl-3.0 | 1,624 |
from radar.auth.passwords import (
check_password_hash,
generate_password,
generate_password_hash,
get_password_length,
is_strong_password,
password_to_nato_str,
)
from radar.models.users import User
def test_password_to_nato_str():
password = 'aAzZ123'
assert password_to_nato_str(pass... | renalreg/radar | tests/auth/test_passwords.py | Python | agpl-3.0 | 1,704 |
#=======================================================================
# Screen-scraping framework
#=======================================================================
import logging
try:
import bs4 as soup
except ImportError:
import BeautifulSoup as soup
import urllib2
from urllib import urlencode
... | pythontech/ptscrape | ptscrape.py | Python | lgpl-2.1 | 2,668 |
#!/usr/bin/env python
''' Python DB API 2.0 driver compliance unit test suite.
This software is Public Domain and may be used without restrictions.
"Now we have booze and barflies entering the discussion, plus rumours of
DBAs on drugs... and I won't tell you what flashes through my mind each
time I read... | d33tah/bpgsql | tests/dbapi20.py | Python | lgpl-2.1 | 31,413 |
import Event
def reset_fake():
g_messengerEvents.users.onUsersListReceived.clear()
g_messengerEvents.voip.onPlayerSpeaking.clear()
class Events(object):
def __init__(self):
self.users = Users()
self.voip = VOIPSharedEvents()
class Users(object):
def __init__(self):
self.onUsersListReceived... | jhakonen/wot-teamspeak-mod | test/fakes/messenger/proto/events.py | Python | lgpl-2.1 | 486 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Rocblas(CMakePackage):
"""Radeon Open Compute BLAS library"""
homepage = "https://gi... | iulian787/spack | var/spack/repos/builtin/packages/rocblas/package.py | Python | lgpl-2.1 | 4,299 |
##############################################################################
# adaptiveMD: A Python Framework to Run Adaptive Molecular Dynamics (MD)
# Simulations on HPC Resources
# Copyright 2017 FU Berlin and the Authors
#
# Authors: Jan-Hendrik Prinz
# Contributors:
#
# `adaptiveMD` is free software: ... | thempel/adaptivemd | adaptivemd/misc/archive.py | Python | lgpl-2.1 | 2,560 |
##############################################################################
# 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... | lgarren/spack | var/spack/repos/builtin/packages/r-limma/package.py | Python | lgpl-2.1 | 1,754 |
# PyUI
# Copyright (C) 2001-2002 Sean C. Riley
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but... | burito/PyUI | pyui/themeBase.py | Python | lgpl-2.1 | 7,045 |
from random import randint
import gobject
import clutter
import mxpy as mx
sort_set = False
filter_set = False
def sort_func(model, a, b, data):
return int(a.to_hls()[0] - b.to_hls()[0])
def filter_func(model, iter, data):
color = iter.get(0)[0]
h = color.to_hls()[0]
return (h > 90 and h < 180)
def ... | buztard/mxpy | examples/test-item-view.py | Python | lgpl-2.1 | 1,682 |
import os
from nose.tools import assert_almost_equal, eq_, raises
import mapnik
from .utilities import execution_path, run_all
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'shape' in mapnik.Datasourc... | mapycz/python-mapnik | test/python_tests/shapefile_test.py | Python | lgpl-2.1 | 5,190 |
# Copyright (C)2016 D. Plaindoux.
#
# 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 2, or (at your option) any
# later version.
import unittest
import path_parse_test
impo... | d-plaindoux/fluent-rest | tests/runall.py | Python | lgpl-2.1 | 828 |
#
# Copyright 2009 Andrei <vish@gravitysoft.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 version 2 of the License, or
# (at your opti... | barmalei/primus | lib/primus/fileartifact.py | Python | lgpl-3.0 | 6,594 |
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# This file is part of the E-Cell System
#
# Copyright (C) 1996-2016 Keio University
# Copyright (C) 2008-2016 RIKEN
# Copyright (C) 2005-2009 The Molecular Sciences Institute
#
#:::::::::::::::::::::::::::::::::::::::... | ecell/ecell3 | ecell/frontend/model-editor/ecell/ui/model_editor/ClassEditorWindow.py | Python | lgpl-3.0 | 4,556 |
from __future__ import unicode_literals
from django.apps import AppConfig
class HostelConfig(AppConfig):
name = 'hostel'
| django-school-management/ssms | ssms/common/facilities/hostel/apps.py | Python | lgpl-3.0 | 128 |
# coding: utf-8
"""
This module defines a containers that hold transcripts excluded from further consideration.
It is invoked when all transcripts in a locus have a score of 0 and the "purge"
option has been enabled.
"""
from .abstractlocus import Abstractlocus
from ..transcripts import Transcript
class Excluded(Ab... | lucventurini/mikado | Mikado/loci/excluded.py | Python | lgpl-3.0 | 3,468 |
import numpy
try:
print(numpy.get_include())
except AttributeError:
# depricated, but used in old numpy versions
print(numpy.get_numpy_include())
| nextgen-astrodata/DAL | cmake/FindNumpy.py | Python | lgpl-3.0 | 154 |
MODULES = ['main', 'config']
DEPS = []
NAME = 'Notepad'
PLATFORMS = ['any']
DESCRIPTION = 'Configuration files editor'
VERSION = '0.1'
AUTHOR = 'Ajenti team'
HOMEPAGE = 'http://ajenti.org'
| DmZ/ajenti | plugins/notepad/__init__.py | Python | lgpl-3.0 | 192 |
#This example is meant to be used from within the CadQuery module of FreeCAD.
import cadquery
from cadquery import Vector
import Part
#Create a rotated workplane and put holes in each corner of a rectangle on that workplane, producing angled holes
#in the face
result = cadquery.Workplane("front").box(4.0, 4.0, 0.25).f... | dcowden/cadquery-freecad-module | CadQuery/Examples/Ex015_Rotated_Workplanes.py | Python | lgpl-3.0 | 570 |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | ghorn/debian-casadi | docs/examples/python/simulation.py | Python | lgpl-3.0 | 4,875 |
# Copyright 2020 by Kurt Rathjen. 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 3 of the License, or
# (at your option) any later version. This ... | krathjen/studiolibrary | src/mutils/tests/test_attribute.py | Python | lgpl-3.0 | 5,307 |
# -*- coding: utf-8 -*-
#
# IBEX documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 21 11:59:19 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | ibex-team/ibex-lib | doc/conf.py | Python | lgpl-3.0 | 7,943 |
#!/usr/bin/env python
import numpy as np
import pandas as pd
def build_allele_dict():
""" Take a sheet and build a dictionary with:
[gene][allele] = count
"""
fname = '/home/jfear/mclab/cegs_sem_sd_paper/from_matt/DSRP_and_CEGS_haps_1-6-15.xlsx'
data = pd.ExcelFile(fname)
dspr = data.parse('DSRP_hap... | McIntyre-Lab/papers | fear_sem_sd_2015/scripts/haplotype_freqs.py | Python | lgpl-3.0 | 358 |
from pyblish import api
from pyblish_bumpybox import inventory
class ValidateDatatype(api.InstancePlugin):
"""Validate output datatype matches with input."""
order = inventory.get_order(__file__, "ValidateDatatype")
families = ["write"]
label = "Datatype"
optional = True
targets = ["default",... | Bumpybox/pyblish-bumpybox | pyblish_bumpybox/plugins/nuke/validate_datatype.py | Python | lgpl-3.0 | 1,133 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from distutils.core import setup, Command # pylint: disable=no-name-in-module
import dtree
class TestCommand(Command):
description = "Runs unittests."
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
... | chrisspen/dtree | setup.py | Python | lgpl-3.0 | 1,398 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import traceback
from lazagne.config.module_info import ModuleInfo
from xml.etree.cElementTree import ElementTree
from lazagne.config import homes
class Pidgin(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'pidgin', 'chats')
# If... | AlessandroZ/LaZagne | Linux/lazagne/softwares/chats/pidgin.py | Python | lgpl-3.0 | 2,313 |
#!/usr/bin/env python
import argparse
import ConfigParser
import os.path
import digitaloceanmanager
import getpass
from passlib.hash import sha512_crypt
token = None
user = None
passwd = None
ssh_port = None
if __name__ == "__main__":
config = ConfigParser.RawConfigParser()
if (os.path.isfile('doma.cfg')):
... | Elhodred/python-digitaloceanmanager | doma.py | Python | lgpl-3.0 | 4,258 |
import sys
import json
import importlib
import http.client
import traceback
from netrackclient import broker
from netrackclient import errors
class HTTPClient(object):
def __init__(self, *args, **kwargs):
super(HTTPClient, self).__init__()
self._broker = broker.RequestBroker()
self.serv... | netrack/python-netrackclient | netrackclient/client.py | Python | lgpl-3.0 | 2,454 |
def alternate_sort(l):
neg = sorted([x for x in l if x < 0], reverse = True)
pos = sorted([x for x in l if x >= 0])
combo = [None]*(len(l))
alter_len = min(len(neg),len(pos))
combo[:2*alter_len:2] = neg[:alter_len]
combo[1:2*alter_len+1:2] = pos[:alter_len]
combo[2*alter_len:] = neg[alter_le... | SelvorWhim/competitive | Codewars/AlternatingSort.py | Python | unlicense | 385 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
APRI和FIB4推测肝纤维化或肝硬化情况
This is a temporary script file.
"""
import math
#APRI缩写:AST to Platelet Ratio Index
#AST单位iu/l
#PRI单位10**9/L
#如果APRI>2,可能有肝硬化
def APRI(AST,upper_AST,PRI):
apri=((AST*1.0/upper_AST)*100)/PRI
return apri
#FIB-4缩写Fibrosis-4
#age单位:年
#AST和ALT单... | kyokyos/bioinform | HBV_APRI_FIB4.py | Python | unlicense | 1,993 |
'''
Created on 03.05.2015
@author: vvladych
'''
from gi.repository import Gtk
from forecastmgmt.model.organisation import Organisation
from masterdata_abstract_window import AbstractAddMask
class OrganisationAddMask(AbstractAddMask):
def __init__(self, main_window, reset_callback):
super(OrganisationAd... | vvladych/forecastmgmt | src/forecastmgmt/ui/masterdata/organisation_add_mask.py | Python | unlicense | 1,939 |
"""
Consider adding prime numbers to the hashing function.
Although there is no evidence whatsoever that using prime numbers increases bit entropy (or is there?), it seems that
this is a too widespread practice for an amateur such as myself not to follow.
There is no one-size-fits-all hashing methodology, what can be... | mafagafogigante/algorithms-and-data-structures | python/other/shash.py | Python | unlicense | 1,412 |
from PyQt5 import Qt
from bs4 import BeautifulSoup
import urllib.parse
from urllib.request import build_opener, HTTPCookieProcessor, HTTPError
from http import cookiejar
import zipfile
import defines
import os
import re
import time
from _thread import start_new_thread
from threading import Lock
from subprocess import c... | shinnova/lcurse | modules/waitdlg.py | Python | unlicense | 13,439 |
import sys
import os
from PySide.QtCore import *
from PySide.QtGui import *
__appname__ = "Qifswap"
def swap_outflows_and_inflows(qif_filename):
qif = open(qif_filename, 'r+')
data = qif.read()
data = data.replace('\nT','\nTemp')
data = data.replace('\nTemp-','\nT')
data = data.replace('\nTemp', '... | furlow/QifSwap | QifSwap.py | Python | unlicense | 1,496 |
import sys
import collections
class PipeGrid(object):
def __init__(self):
self.laid_pipes = collections.defaultdict(set)
@staticmethod
def _int_to_xy(i):
return (i-1)//5, (i-1)%5
def connect(self, i1, i2):
i1 = PipeGrid._int_to_xy(i1)
i2 = PipeGrid._int_to_xy(i2)
... | mpillar/codeeval | 1-moderate/builders-team/main.py | Python | unlicense | 1,846 |
from PerfectHash import PerfectHash
__all__ = ['PerfectHash']
| jacekfh/PerfectHash | __init__.py | Python | unlicense | 63 |
# Copyright 2018 Databricks, Inc.
#
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-instance-attributes
# pylint: disable=logging-format-interpolation
# pylint: disable=invalid-name
import time
from tensorflow import keras
from sparkdl.horovod import log_to_driver
__all__ = ["LogCallback"]
clas... | databricks/spark-deep-learning | sparkdl/horovod/tensorflow/keras.py | Python | apache-2.0 | 903 |
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or a... | ryantierney513/capirca | tests/lib/cisco_test.py | Python | apache-2.0 | 23,978 |
# Copyright (c) 2013 Qubell Inc., http://qubell.com
#
# 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 agr... | ysarbaev/contrib-python-qubell-client | qubell/api/public/application.py | Python | apache-2.0 | 5,682 |
# -*- 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-game-servers | google/cloud/gaming_v1beta/services/game_server_clusters_service/pagers.py | Python | apache-2.0 | 6,239 |
"""This module contains the general information for BiosVfOSBootWatchdogTimer ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfOSBootWatchdogTimerConsts:
VP_OSBOOT_WATCHDOG_TIMER_DISABLED = "Disabled"
VP_OSBO... | ragupta-git/ImcSdk | imcsdk/mometa/bios/BiosVfOSBootWatchdogTimer.py | Python | apache-2.0 | 3,929 |
'''
笔记
for i in range(10):
#3次机会问一次
'''
age=22
c=0
while True:
if c<3:
cai=input("请输入要猜的年龄:")
if cai.isdigit(): #判断是否为整数
print("格式正确")
cai1=int(cai) #判断为整数把输入的变量变成int型
if cai1==age and c<3:
print("猜对了")
break
eli... | xiaoyongaa/ALL | python基础2周/17猜年龄游戏.py | Python | apache-2.0 | 1,545 |
""" Bid Model """
from penelophant.database import db
from .Model import Model
from .User import User
class Bid(Model):
""" Bid data representation """
__mapper_args__ = {
'order_by': 'price DESC, bid_time ASC'
}
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer,
db.Forei... | kevinoconnor7/penelophant | penelophant/models/Bid.py | Python | apache-2.0 | 744 |
import globus_sdk
CLIENT_ID = 'f7cfb4d6-8f20-4983-a9c0-be3f0e2681fd'
client = globus_sdk.NativeAppAuthClient(CLIENT_ID)
#client.oauth2_start_flow(requested_scopes="https://auth.globus.org/scopes/0fb084ec-401d-41f4-990e-e236f325010a/deriva_all")
client.oauth2_start_flow(requested_scopes="https://auth.globus.org/scopes... | informatics-isi-edu/webauthn | webauthn2/scripts/globus_oauth_client.py | Python | apache-2.0 | 1,011 |
import uuid
import json
import requests
import argparse
parser = argparse.ArgumentParser(
description="Upload a series of test submissions with randomized ids")
parser.add_argument('host', nargs='?', default="http://localhost:5000",
help="URL of server to upload to")
args = parser.parse_args()
... | ga4gh/CGT | tests/populate.py | Python | apache-2.0 | 1,290 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2017-01-10 08:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Documen... | SJIT-Hackerspace/SJIT-CodingPortal | QuestionDumps/migrations/0001_initial.py | Python | apache-2.0 | 823 |
# 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 the Li... | alex/warehouse | tests/unit/i18n/test_init.py | Python | apache-2.0 | 1,717 |
"""Test cli"""
import asyncio
import contextlib
import io
import json
import sys
import traceback
from unittest import mock
import pytest
from egtaonline import __main__ as main
from egtaonline import api
from egtaonline import mockserver
# TODO async fixtures may be possible with python 3.6, but it's not possible
... | egtaonline/egtaonline-api | test/test_eo.py | Python | apache-2.0 | 14,077 |
import inspect
import requests
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponseRedirect, FileResponse, Http404, HttpResponse
from django.shortcuts import render
from django.template i... | mesemus/fedoralink | fedoralink/views.py | Python | apache-2.0 | 15,936 |
""" Cloud API asynchronous "PDF To Text" job example.
Allows to avoid timeout errors when processing huge or scanned PDF documents.
"""
import os
import requests # pip install requests
import time
import datetime
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If ... | bytescout/ByteScout-SDK-SourceCode | Cloud API Server/PDF To JSON API/Python/Convert PDF To JSON From Uploaded File Asynchronously/ConvertPdfToJsonFromUploadedFileAsynchronously.py | Python | apache-2.0 | 4,742 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | android/android-test | tools/android/emulator/resources.py | Python | apache-2.0 | 2,873 |
from django.contrib import admin
from .models import SimpleModel, InlineModel
class SimpleInline(admin.TabularInline):
model = InlineModel
class SimpleModelAdmin(admin.ModelAdmin):
list_display = ('name', )
prepopulated_fields = {'slug': ('name',)}
search_fields = ('name',)
inlines = [SimpleInl... | callowayproject/django-tinymcewrapper | example/simpleapp/admin.py | Python | apache-2.0 | 377 |
#!/usr/bin/python
__author__ = 'anson'
import optparse
import re
import sys
from utils.utils_cmd import execute_sys_cmd
from lib_monitor.monitor_default_format import nagios_state_to_id
class messages_check():
def __init__(self, rex, config, type):
self.rex = rex
self.config = config
self.t... | AnsonShie/system_monitor | messages_monitor.py | Python | apache-2.0 | 2,645 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache/incubator-airflow | tests/models/test_param.py | Python | apache-2.0 | 8,248 |
"""Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... | mr-ping/tornado | tornado/httpclient.py | Python | apache-2.0 | 27,522 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-03 05:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('content', '0003_post_docfile'),
]
operations = [
migrations.RemoveField(
... | Nikita1710/ANUFifty50-Online-Mentoring-Platform | project/fifty_fifty/content/migrations/0004_auto_20170803_0535.py | Python | apache-2.0 | 700 |
#!/usr/bin/env python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | googleads/googleads-python-lib | examples/ad_manager/v202111/publisher_query_language_service/get_all_browsers.py | Python | apache-2.0 | 1,900 |
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
if with_limits and self.query.low_mark == self.query.high_mark:
return '', ()
raw_sql, fields = super(SQLCompiler, self).as_sql... | leowa/django_informixdb | django_informixdb/compiler.py | Python | apache-2.0 | 1,808 |
""" Cisco_IOS_XR_patch_panel_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR patch\-panel package configuration.
This module contains definitions
for the following management objects\:
patch\-panel\: patch\-panel service submode
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All right... | 111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_patch_panel_cfg.py | Python | apache-2.0 | 2,513 |
# Initialization for oemicroservices.common
__all__ = ('functor', 'util')
| OpenEye-Contrib/OEMicroservices | oemicroservices/common/__init__.py | Python | apache-2.0 | 74 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | dsiddharth/access-keys | keystone/common/base64utils.py | Python | apache-2.0 | 13,091 |
#-------------------------------------------------------------------------------
# Copyright 2017 Cognizant Technology Solutions
#
# 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:... | CognizantOneDevOps/Insights | PlatformAgents/com/cognizant/devops/platformagents/agents/deployment/rundeck/RundeckAgent.py | Python | apache-2.0 | 2,690 |
# Lint as: python3
# Copyright 2019 DeepMind Technologies Limited. 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
#
# ... | deepmind/optax | setup.py | Python | apache-2.0 | 2,830 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | polyaxon/polyaxon | hypertune/hypertune/search_managers/random_search/manager.py | Python | apache-2.0 | 2,436 |
"""Support for functionality to interact with Android TV / Fire TV devices."""
from datetime import datetime
import functools
import logging
import os
from adb_shell.auth.keygen import keygen
from adb_shell.exceptions import (
AdbTimeoutError,
InvalidChecksumError,
InvalidCommandError,
InvalidResponseE... | tchellomello/home-assistant | homeassistant/components/androidtv/media_player.py | Python | apache-2.0 | 24,075 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | jacquesqiao/Paddle | python/paddle/fluid/tests/unittests/test_fake_quantize_op.py | Python | apache-2.0 | 1,823 |
# -*- 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-monitoring | google/cloud/monitoring_v3/services/service_monitoring_service/transports/grpc.py | Python | apache-2.0 | 22,884 |
# Generated by Django 2.2.16 on 2020-10-05 20:11
import ckeditor.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ebooks', '0120_auto_20201005_1453'),
]
operations = [
migrations.AlterField(
model_name='book',
name... | flavoi/diventi | diventi/ebooks/migrations/0121_auto_20201005_2211.py | Python | apache-2.0 | 834 |
#!/usr/bin/env python
"""
This script is mainly for running autotests on the build server, however, it
can also be used by engineers to run the tests locally on their machines.
It takes as optional parameters the path to the folder containing the test
executables (which must have names ending in _tests), and a list... | stangls/omim | tools/run_desktop_tests.py | Python | apache-2.0 | 9,109 |
#!/usr/bin/env python
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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
#
# ... | ipa-led/airbus_coop | airbus_ssm_core/src/airbus_ssm_core/ssm_on.py | Python | apache-2.0 | 2,669 |
#!/usr/bin/env python
"""
"""
# Python 2.6 and newer support
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future.builtins import (
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
... | sfinucane/deviceutils | deviceutils/action/query.py | Python | apache-2.0 | 2,510 |
# Copyright 2014 Rackspace Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | eshijia/magnum | magnum/conductor/template_definition.py | Python | apache-2.0 | 21,199 |
# -*- coding:utf-8-*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from time import *
import sys
class Windows(QDialog):
def __init__(self, parent=None):
super(Windows, self).__init__(parent)
self.startButton = QPushButton("Start")
self.stopButton = QPushButton("Stop")
... | ptphp/PyLib | src/dev/case/timethread.py | Python | apache-2.0 | 2,356 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | manipopopo/tensorflow | tensorflow/contrib/distribute/python/step_fn.py | Python | apache-2.0 | 4,263 |
#coding: utf-8
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# Allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-dbmessages',
version='0.2.0a',
pack... | strogonoff/django-dbmessages | setup.py | Python | apache-2.0 | 1,218 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0019_auto_20170521_1332'),
]
... | google/mirandum | alerts/main/migrations/0020_recentactivity.py | Python | apache-2.0 | 895 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a cop... | salamb/girder | girder/api/v1/file.py | Python | apache-2.0 | 17,532 |
"""
Backend for fetching OEmbed data.
This module can also be used by other external apps.
"""
import threading
from django.core.exceptions import ImproperlyConfigured
from micawber import Provider, ProviderRegistry, bootstrap_basic, bootstrap_embedly
from micawber.providers import bootstrap_noembed # Export was mis... | django-fluent/django-fluent-contents | fluent_contents/plugins/oembeditem/backend.py | Python | apache-2.0 | 2,959 |
# coding: utf-8
from django.shortcuts import render
from django.db.models.query import Prefetch
from django.db.models import Q
from django.db.models.aggregates import Count
from ref.models.instances import Environment, ComponentInstance, \
ComponentInstanceField
from ref.models.description import ImplementationFi... | digitalfox/MAGE | ref/views/display.py | Python | apache-2.0 | 3,914 |