code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.5.60'
| SerpentAI/SerpentAI | serpent/dashboard/cefbrowser/version.py | Python | mit | 213 |
# Class for management payload threading.
#
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program ... | atodorov/anaconda | pyanaconda/payload/manager.py | Python | gpl-2.0 | 9,106 |
import django.db.models as models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.db.models.signals import post_save
class Profile(models.Model):
"""
parameters we can get from gigya:
birthMonth,isLoggedIn,city,UID,zip,birthYear,state,pro... | MediaSapiens/wavesf | apps/externals/gigyauth/models.py | Python | bsd-3-clause | 1,844 |
# Copyright 2014 Dan Kilman
#
# 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, softw... | dankilman/pysource | pysource/tests/resources/pipes.py | Python | apache-2.0 | 921 |
import time
import os
from ds18b20 import DS18B20
z=0
i = 0
dev=list()
ID=list()
#get file path and make new folder for measurements
filepath=os.path.abspath("/home/pi/temperatureSensorDS18B20/")
#filepath=os.getcwd()
newpath = filepath+"/measurements/"
if not os.path.exists(newpath):
os.makedirs(newpath)
prin... | chararchter/temperatureSensorDS18B20 | temp2.py | Python | gpl-3.0 | 1,412 |
import graphene
import graphql_geojson
from graphene_django.types import DjangoObjectType
from taxonomy import models as tax_models
# ----------------------------------------------------------------------------#
# Types
# ----------------------------------------------------------------------------#
class CommunityT... | parksandwildlife/wastd | taxonomy/schema.py | Python | mit | 2,390 |
"""
This file is part of Giswater 3
The 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.
"""
# -*- coding: utf-8 -*-
from functools im... | Giswater/giswater_qgis_plugin | core/shared/psector_duplicate.py | Python | gpl-3.0 | 3,262 |
# -*- coding: utf-8 -*-
from tornado.web import HTTPError
from doodle.config import CONFIG
from doodle.core.models.article import ArticleHitCount
from doodle.core.models.category import Category, CategoryArticles
from doodle.core.models.comment import ArticleComments
from ..base_handler import BaseHandler
class Ca... | keakon/Doodle | doodle/views/web/category.py | Python | mit | 1,308 |
import sys
import coincurve
import json
import random
from crankycoin import logger
from crankycoin.node import NodeMixin
from crankycoin.models.transaction import Transaction
_PY3 = sys.version_info[0] > 2
if _PY3:
import codecs
class Client(NodeMixin):
__private_key__ = None
__public_key__ = None
... | cranklin/crankycoin | crankycoin/wallet.py | Python | mit | 2,582 |
from django.conf import settings
from django.conf.urls import include, url
from django.views.generic import TemplateView,RedirectView
from django.contrib import admin
from django.views.static import serve
from wbc.process.views import PlaceCreate,PlaceUpdate,PlaceDelete,process,places,place
from wbc.process.views impo... | BuergerbautStadt/bbs | bbs/urls.py | Python | gpl-3.0 | 2,715 |
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
import sys
BeepPin = 11 # pin11
dummy = 0
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(BeepPin, GPIO.OUT) # Set BeepPin's mode is output
GPIO.output(BeepPin, GPIO.HIGH) # Set BeepPin high(+3.3V) to off ... | gugarutz/pidiculous | beepoler/beep.py | Python | mit | 1,157 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | amenonsen/ansible | lib/ansible/modules/windows/win_find.py | Python | gpl-3.0 | 9,685 |
from numbers import Number
import numpy as np
from ._c99_config import _have_c99_complex
from ._extensions._pywt import Wavelet, Modes, _check_dtype, wavelist
from ._extensions._dwt import (dwt_single, dwt_axis, idwt_single, idwt_axis,
upcoef as _upcoef, downcoef as _downcoef,
... | rgommers/pywt | pywt/_dwt.py | Python | mit | 17,223 |
from django.conf import settings
HIDE_TRANSLATABLE_APPS = getattr(settings, "MULTILANG_HIDE_TRANSLATABLE_APPS", False)
LANGUAGE_DOMAINS = getattr(settings, "MULTILANG_LANGUAGE_DOMAINS", {})
| trapeze/transurlvania | transurlvania/settings.py | Python | bsd-3-clause | 194 |
from edc_lab.lab_profile.classes import site_lab_profiles
from edc_lab.lab_profile.classes import LabProfile
from .models import (Aliquot, AliquotType, Receive, MaternalRequisition, InfantRequisition,
AliquotProfile, AliquotProfileItem, Panel)
class BaseTshiloDikotlaProfile(LabProfile):
ali... | botswana-harvard/tshilo-dikotla | td_lab/lab_profiles.py | Python | gpl-2.0 | 877 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-mantis-core
------------
Tests for `django-mantis-core` modules module.
"""
import os
import shutil
import unittest
from mantis_core import models
class TestMantis_core(unittest.TestCase):
def setUp(self):
pass
def test_something(self... | siemens/django-mantis-core | tests/test_models.py | Python | gpl-2.0 | 373 |
{
'name': 'Purchase Quotation Online Proposals',
'category': 'Website',
'version': '1.1',
'description': """
GURBA
=========================
""",
'depends': ['website', 'mail', 'purchase', 'purchase_requisition','product','bc_supplier_certification'],
'data': [
'wizards/request_... | ctmil/bc_website_purchase | __openerp__.py | Python | agpl-3.0 | 690 |
#!/usr/bin/python
from utils import mathfont
import fontforge
verticalArrowCodePoint = 0x21A8
v1 = 5 * mathfont.em
v2 = 14 * mathfont.em
f = mathfont.create("axisheight%d-verticalarrow%d" % (v1, v2))
f.math.AxisHeight = v1
mathfont.createSquareGlyph(f, verticalArrowCodePoint)
g = f.createChar(-1, "size1")
mathfont.dr... | shinglyu/servo | tests/wpt/web-platform-tests/mathml/tools/axisheight.py | Python | mpl-2.0 | 823 |
"""Module which publish all automation-tools tasks"""
from automation_tools import ( # noqa: F401
add_repo,
cdn_install,
clean_rhsm,
cleanup_idm,
client_registration_test,
configure_osp,
configure_ad_external_auth,
configure_idm_external_auth,
configure_realm,
configure_sonarqub... | JacobCallahan/automation-tools | fabfile.py | Python | gpl-3.0 | 2,419 |
import re
a="2+1+3+3123123"
r=re.findall(r"\d{0,}[\+\-]{0,}",a)
print(r)
with open("re.txt","w") as re:
for i in r:
re.write(i)
with open("re.txt","r") as r:
r=r.read()
print(r) | xiaoyongaa/ALL | 函数和常用模块/cash3.py | Python | apache-2.0 | 193 |
"""
Tagging related views.
"""
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.list_detail import object_list
from tagging.models import Tag, TaggedItem
from tagging.utils import get_tag, get_queryset_and_model
def tagged_object_list(request, queryset_or_mo... | hzlf/openbroadcast | website/tagging_ng/views.py | Python | gpl-3.0 | 2,118 |
#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 your option) any later ve... | plq/spyne | spyne/test/protocol/test_html_table.py | Python | lgpl-2.1 | 17,601 |
from .base import *
from .plot import *
from .kernerls import *
| qianlv/MachineLearningAlgorithm | mla/base/__init__.py | Python | mit | 64 |
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_project_task
| VitalPet/addons-onestein | project_task_programmed/tests/__init__.py | Python | agpl-3.0 | 179 |
#!/usr/bin/python
from subprocess import Popen, PIPE
from os import remove, path, readlink
PATH = path.abspath(__file__)
if path.islink(PATH):
PATH = path.dirname(readlink(PATH))
else:
PATH = path.dirname(path.abspath(__file__))
BINARY_PATH = PATH + '/opt/RNA_PredictionSignificance.app'
def get_p_value(rmsd... | mmagnus/rna-pdb-tools | rna_tools/tools/rna_prediction_significance/rna_prediction_significance.py | Python | gpl-3.0 | 1,088 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 opti... | frankrousseau/weboob | weboob/browser/filters/standard.py | Python | agpl-3.0 | 23,209 |
from direct.directnotify import DirectNotifyGlobal
from toontown.fishing import FishGlobals
from toontown.fishing import BingoGlobals
from direct.showbase import RandomNumGen
from math import ceil, pow
class BingoCardBase:
notify = DirectNotifyGlobal.directNotify.newCategory('BingoCardBase')
def __init__(self... | ksmit799/Toontown-Source | toontown/fishing/BingoCardBase.py | Python | mit | 4,254 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Ben Spiers
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
#... | unpairedbracket/xbmc-python-remote | xbmcremote/frontends/SoundMenuFrontend/__init__.py | Python | gpl-3.0 | 2,330 |
#!/usr/bin/env python
import csv
import os
from osgeo import ogr
import osgeo.osr as osr
from db import Occurrence
from db import create_session
def export_data(target_dir, output_format="csv", country_list=None, output_type=None):
session = create_session()
species_list = session.query(Occurrence.species_na... | howl-anderson/SDMdata | sdmdata/sdmdata/export_data_main.py | Python | agpl-3.0 | 4,841 |
# Copyright 2016 The Meson development team
# 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 ... | mesonbuild/meson | mesonbuild/scripts/scanbuild.py | Python | apache-2.0 | 2,432 |
class ProdMonDBRouter(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'prodtask':
return 'deft'
if model._meta.app_label == 'panda':
return 'panda'
if model._meta.app_label == 'grisli':
return 'grisli'
if model._meta.app... | tkorchug/panda-bigmon-core | core/dbrouter.py | Python | apache-2.0 | 664 |
# Copyright 2014 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 ... | GirlsCodePy/girlscode-coursebuilder | tests/functional/common_crypto.py | Python | gpl-3.0 | 6,528 |
n = int(input())
print(180 * (n - 2))
| koluku/atcoder-beginner-contest | other/m-solutions2019/A.py | Python | mit | 38 |
# Copyright 2018 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, ... | googleapis/gapic-generator-python | gapic/utils/lines.py | Python | apache-2.0 | 4,526 |
"""
Django settings for amadaa project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | borderitsolutions/amadaa | amadaa/settings.py | Python | mit | 3,905 |
#
# Copyright (C) 2007, 2010, 2011, 2013, 2014 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is... | UNINETT/nav | python/nav/web/l2trace/views.py | Python | gpl-2.0 | 1,242 |
#!/usr/bin/env python
# vim: sw=4 ts=4 et
import argparse, click, fileinput, iptools, os, six, sys, yaml, textwrap
from argparse import RawTextHelpFormatter
from collections import defaultdict
from six.moves import configparser
from time import time
from shutil import copyfile
try:
import json
except ImportError:... | pschiffe/openshift-ansible-contrib | reference-architecture/vmware-ansible/add-node.py | Python | apache-2.0 | 22,950 |
Experiment(description='Re-analysis of GEFCOM data for purposes of thesis',
data_dir='../data/gefcom_temp',
max_depth=10,
random_order=True,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
... | ekamioka/gpss-research | experiments/2014-11-10-gefcom-revisited.py | Python | mit | 1,536 |
from builtins import str
from builtins import range
from builtins import object
import json
import os
import solnlib.utils as utils
from splunktaucclib.global_config import GlobalConfig, GlobalConfigSchema
'''
Usage Examples:
setup_util = Setup_Util(uri, session_key)
setup_util.get_log_level()
setup_util.get_proxy_... | PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/splunk_aoblib/setup_util.py | Python | isc | 13,234 |
{
'name':'Gestion de compte',
'version': '0.0.1',
'category': 'Generic Modules/Others',
'description': """Interface Ressource Humaine""",
'author':'SMILE',
'depends':['base'],
'data':['view/cmpView.xml'],
'installable':True,
'auto_install':False,
} | Ouleur/RH_PFE | __openerp__.py | Python | gpl-2.0 | 284 |
"""
couch.cookie
~~~~~~~~~~~~
"""
from flask import session
from slothpal.oauth import get_expiry_time
def make_secure_oauth_cookie(response):
"""
Make a secure cookie for the user to validate that they currently are
validated for PayPal transactions
"""
return {
"paypal_session": response... | hahnicity/couch | couch/cookie.py | Python | unlicense | 373 |
#!/usr/bin/python
import dbus
bus = dbus.SystemBus()
snapper = dbus.Interface(bus.get_object('org.opensuse.Snapper', '/org/opensuse/Snapper'),
dbus_interface='org.opensuse.Snapper')
print snapper.CreateSingleSnapshot("root", "test", "", { "id" : "123" })
| jmaggard10/snapper | examples/python/create.py | Python | gpl-2.0 | 286 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name,len-as-condition
from functools import partial
from rebulk.pattern import StringPattern
from ..validators import chars_before, chars_after, chars_surround, validators
chars = ' _.'
left ... | Toilal/rebulk | rebulk/test/test_validators.py | Python | mit | 2,170 |
# ############################################################
# IMPORT TOOLS
# ############################################################
from tquakes import *
from matplotlib import use
use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap as map,shiftgrid
import matplotlib.pat... | seap-udea/tQuakes | plots/papers/lunaranomaly-histogram_old.py | Python | gpl-2.0 | 7,441 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import sys
imp... | veger/ansible | test/units/module_utils/test_vmware.py | Python | gpl-3.0 | 4,238 |
#use for local development
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
project = lambda: os.path.dirname(os.path.realpath(__file__))
location = lambda x: os.path.join(str(project()), str(x))
DEBUG = True
INSTALLED_APPS = (
'django.con... | ArabellaTech/contactBox | conf/dev_local_settings.py | Python | mit | 1,930 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2010 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | jralls/gramps | gramps/gui/views/treemodels/flatbasemodel.py | Python | gpl-2.0 | 32,063 |
import pygame
import pygame.joystick
from pygame.locals import *
def main():
pygame.init()
clock = pygame.time.Clock()
ue = pygame.event.Event(USEREVENT, {'code':'drop'})
pygame.time.set_timer(USEREVENT+3, player="2", 500)
pygame.time.set_timer(USEREVENT+3, player="1", 500)
while(True):
events ... | joel-wright/DDRPi | experiments/python/pygame_recurring_events.py | Python | mit | 440 |
#!/usr/bin/python3
import tornado.ioloop
import tornado.options
import tornado.httpserver
from routes import routes_setup
import settings
clients = []
if __name__ == '__main__':
tornado.options.parse_command_line()
tornado.options.define('log_file_max_size', default=str(10*1024*1024))
tornado.options.de... | andrewisakov/taximaster_x | router/main.py | Python | unlicense | 572 |
import seaborn as sns
from pudzu.charts import *
FONT, fg, bg = sans, "white", "black"
countries = pd.read_csv("datasets/countries.csv").split_columns(('nationality', 'tld', 'country'), "|").explode('country').set_index('country')
flags = countries.flag
flags["Czechoslovakia"] = flags["Czech Republic"]
flags["USSR"] ... | Udzu/pudzu | dataviz/eustampspeople.py | Python | mit | 3,477 |
import sys
if sys.version_info < (3, 7):
from ._y import YValidator
from ._x import XValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._y.YValidator", "._x.XValidator"]
)
| plotly/python-api | packages/python/plotly/plotly/validators/layout/grid/domain/__init__.py | Python | mit | 285 |
import unittest
try:
from flask_discoverer import advertise
except ImportError:
import sys
sys.path.append('..')
from flask_discoverer import advertise
class TestDecorator(unittest.TestCase):
def setUp(self):
def testfunction(a, b, c):
'''docstring of testfunction'''
... | adsabs/flask-discoverer | tests/test_decorator.py | Python | mit | 2,683 |
# -*- coding: utf-8 -*-
#
# Jiffle documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 20 13:52:49 2011.
#
# 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 ... | geosolutions-it/jai-ext | jt-jiffle/jt-jiffle-docs/userguide/conf.py | Python | apache-2.0 | 7,598 |
# Copyright (c) 2014-2021, Manfred Moitzi
# License: MIT License
import pathlib
import ezdxf
DIR = pathlib.Path("~/Desktop/Outbox").expanduser()
def custom_header_vars():
doc = ezdxf.new("R2000")
msp = doc.modelspace()
points = [(0, 0), (3, 0), (6, 3), (6, 6)]
msp.add_polyline2d(points)
doc.head... | mozman/ezdxf | examples/custom_header_vars.py | Python | mit | 496 |
# -*- coding: utf-8 -*-
"""
babel.core
~~~~~~~~~~
Core locale representation and locale data access.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import os
from babel import localedata
from babel._compat import pickle, string_types
from babel.plural im... | vicky2135/lucious | oscar/lib/python2.7/site-packages/babel/core.py | Python | bsd-3-clause | 36,827 |
'''
Common functions dealing with the library configuration.
'''
import platform
import os
import uuid
from configparser import ConfigParser, RawConfigParser
from urllib.request import urlopen
from . import CONFIG_FILE_DEFAULT
import logging
logger = logging.getLogger('opensubmitexec')
DEFAULT_SETTINGS = {
... | troeger/opensubmit | executor/opensubmitexec/config.py | Python | agpl-3.0 | 6,004 |
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | weolar/miniblink49 | third_party/WebKit/Source/bindings/scripts/code_generator_v8.py | Python | apache-2.0 | 21,053 |
"""
Useful helper methods related to the XBlock runtime
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import hashlib
import hmac
import math
import time
from django.conf import settings
from six import text_type
def get_secure_token_for_xblock_handler(user_id, block_key_str, ... | ESOedX/edx-platform | openedx/core/djangoapps/xblock/utils.py | Python | agpl-3.0 | 3,464 |
"""This module contains a collection of unit tests which
validate the ..config module.
"""
import unittest
import uuid
from cloudfeaster_services.tests import TempConfigFile
from ..config import Config
class ConfigTestCase(unittest.TestCase):
def test_ctr(self):
options_and_values = {}
with Tem... | simonsdave/cloudfeaster_infrastructure | cloudfeaster_services/spider_metadata_cache/tests/config_unit_testing.py | Python | mit | 1,359 |
"""Helper functions
Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to templates as 'h'.
"""
# Import helpers as desired, or define your own, ie:
from webhelpers.html import escape, HTML, literal, url_escape
from webhelpers.html.tags import *
fro... | seryl/Nodetraq | nodetraq/lib/helpers.py | Python | mit | 699 |
from media_tree import settings as app_settings
from media_tree.utils import get_module_attr
from django.conf import settings
from django.db.models.fields.files import FieldFile
from django.core.files.storage import FileSystemStorage
from django.core.files.base import File
from django.utils.translation import ugettext_... | samluescher/django-media-tree | media_tree/utils/staticfiles.py | Python | bsd-3-clause | 4,996 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
---
module: keystone_service
short_description: Manage OpenStack Identity (keystone) service endpoints
options:
name:
description:
- name of service (e.g., keystone)
required: yes
type:
description:
- type of service (e.g., i... | zen/solar | library/keystone_service.py | Python | apache-2.0 | 9,899 |
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | ii0/python-goose | tests/parsers.py | Python | apache-2.0 | 10,416 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** BEGIN LICENSE BLOCK *****
"""firefox_media_tests_taskclus... | Yukarumya/Yukarum-Redfoxes | testing/mozharness/scripts/firefox_media_tests_taskcluster.py | Python | mpl-2.0 | 4,009 |
#
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanyi... | alexeblee/s2n | tests/integration/s2n_test_constants.py | Python | apache-2.0 | 22,336 |
# -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
"""
Trans-board view of user's cards
"""
from itertools import groupby
from... | Reigel/kansha | kansha/user/user_cards.py | Python | bsd-3-clause | 4,260 |
#!/usr/bin/env python
# coding: utf-8
#copyRight by heibanke
# 打印[10-0]之间的偶数
x = 10
while x:
if x % 2 == 0: # Even?
print x
x = x-1
# 判断是否素数(质数):大于1的自然数,除1和它本身外没有整数能够整除
y=input()
x = y // 2
while x > 1:
if y % x == 0:
print y, 'has factor', x
break
x -= 1... | heibanke/python_do_something | Code/Chapter3/loop_ex.py | Python | apache-2.0 | 1,411 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 15:45
from __future__ import unicode_literals
from django.db import migrations
import share.robot
class Migration(migrations.Migration):
dependencies = [
('share', '0001_initial'),
('djcelery', '0001_initial'),
]
operatio... | zamattiac/SHARE | providers/org/mla/migrations/0001_initial.py | Python | apache-2.0 | 646 |
r"""
Create MapServer class diagrams
Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html
https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph
For DOT languge see http://www.graphviz.org/doc/info/attrs.html
cd C:\Program Files (x86)\Graphviz2.38\bin
dot -Tpng D:\Git... | geographika/mappyfile | docs/scripts/class_diagrams.py | Python | mit | 3,102 |
#!/usr/bin/env python3
"""
This module contains a quadratic equation solver,
but uses an optional parameter so multiple root functions
do not need to be defined.
"""
import numpy as np
a = 2.1
b = 5.4
c = 1.2
# The following shows how to define optional parameters.
# The last input has a default value of True.
# If... | solter/pyTutorial | src/quadratic_eqn/single_root_function.py | Python | mit | 2,329 |
# -*- coding: utf-8 -*-
import os
import ntpath
import glob
from pyhammer.tasks.taskbase import TaskBase
from pyhammer.utils import execProg
class MakeNugetPackageTask(TaskBase):
"""Make Nuget Package Task"""
def __init__( self, csProjectPath, solutionDir, tempDir, publishDir, visualStudioVersion = "12.0" ):
... | webbers/pyhammer | pyhammer/tasks/helpers/makenugetpackagetask.py | Python | mit | 1,540 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.datasets.dataset_factory import DatasetFactory
#a simple script for creating a view on an indicator table
#and the dataset spatial table f... | apdjustino/DRCOG_Urbansim | src/opus_core/tools/create_view.py | Python | agpl-3.0 | 3,118 |
from bottle import request, get, post, run, response
from os.path import isfile
from json import loads, dumps
from re import match
from uuid import uuid4
def isValidEmail(email):
return len(email) <= 128 and bool(match(r"[^@]+@[^@]+\.[^@]+", email))
if not isfile("db.json"):
print("Database doesn't exist, cre... | CookieEaters/SimpleMailTracker | app.py | Python | unlicense | 1,056 |
# Copyright 2018 Beijing Lenovo Software Ltd.
#
# 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 agre... | openstack/nomad | cyborg/conf/agent.py | Python | apache-2.0 | 1,193 |
"""
WSGI config for base springstertestapp.
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.6/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(
"D... | Mitso/springstertestapp | springstertestapp/wsgi.py | Python | bsd-2-clause | 423 |
# Copyright 2013, Big Switch Networks, 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 applic... | ging/horizon | openstack_dashboard/test/api_tests/fwaas_tests.py | Python | apache-2.0 | 15,563 |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
from aaf2.auid import AUID
from uuid import UUID
import uuid
import unittest
class MobIDTests(unittest.TestCase):
def test_basic(self):
s = "0d010101-0101-2100-060e-2b3402060101"
v = AUID(s... | markreidvfx/pyaaf2 | tests/test_auid.py | Python | mit | 1,210 |
# 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 Libksba(AutotoolsPackage):
"""Libksba is a library to make the tasks of working with X.509... | rspavel/spack | var/spack/repos/builtin/packages/libksba/package.py | Python | lgpl-2.1 | 790 |
class Error(Exception): pass
class MissingRequiredFields(Error): pass
class NotEditable(Error): pass
class TooMany(Error): pass | iffy/crudset | crudset/error.py | Python | apache-2.0 | 130 |
# Generated by Django 2.0.5 on 2018-05-24 19:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0137_auto_20180524_1228'),
]
operations = [
migrations.AlterField(
model_name='person',
name='publish_p... | vahtras/amy | workshops/migrations/0138_auto_20180524_1400.py | Python | mit | 963 |
"""
Tests for the service classes in verify_student.
"""
from datetime import datetime, timedelta, timezone
import itertools
from random import randint
from unittest.mock import patch
import ddt
from django.conf import settings
from django.test import TestCase
from django.utils.timezone import now
from django.utils.t... | eduNEXT/edx-platform | lms/djangoapps/verify_student/tests/test_services.py | Python | agpl-3.0 | 17,963 |
import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Runoff import AvCN
class TestAvCN(VariableUnitTest):
def test_AvCN(self):
z = self.z
np.testing.assert_array_almost_equal(
AvCN.AvCN_f(z.NRur, z.NUrb, z.CNI_0, z.CNP_0, z.CN, z.Imper, z.Area),
... | WikiWatershed/gwlf-e | test/unittests/test_AvCN.py | Python | apache-2.0 | 411 |
from distutils.core import setup
from distutils.extension import Extension
import os
SUBPACKAGES=["AttNotification", "AttNotification_skel",
"CosEventChannelAdmin", "CosEventChannelAdmin_skel",
"CosEventComm", "CosEventComm_skel",
"CosNotification", "CosNotification_skel",
... | mguijarr/hapPyTango | setup.py | Python | mit | 752 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: whoami
@license: Apache Licence 2.0
@contact: skynet199@foxmail.com
@site: http://www.itweet.cn
@software: PyCharm
@file: HostInfo.py
@time: 2016-09-15 07:07
"""
import socket
import platform
from SkynetLog import SkynetLog
log = SkynetLog(object_name=__file_... | skynetera/skynet | skynet-agent/core/HostInfo.py | Python | apache-2.0 | 1,954 |
__version__ = (0, 14, 3)
| tomv564/LSP | plugin/core/version.py | Python | mit | 25 |
"""
YARA rules Scanner class definitions
[mjdorma@gmail.com]
"""
from __future__ import print_function
import sys
import os
import traceback
from glob import glob
from threading import Thread
from threading import Lock as ThreadLock
from threading import Event as ThreadEvent
if sys.version_info[0] < 3: #major
fr... | mjdorma/yara-ctypes | yara/scan.py | Python | mit | 15,862 |
# -*- coding: utf-8 -*-
"""
Internal module, provides HTTP access to API
"""
import re
import requests
import platform
import logging
from ..errors import Route4MeNetworkError
from ..errors import Route4MeApiError
from ..version import VERSION_STRING
from ..version import RELEASE_STRING
from ..version import BUILD
... | maxkoryukov/route4me-python-sdk | route4me/sdk/_internals/net.py | Python | isc | 7,427 |
#!/usr/bin/env python
'''review.py
Alberto Gomez-Casado (c) 2010 University of Twente
'''
from libhooke import WX_GOOD
import wxversion
wxversion.select(WX_GOOD)
from wx import PostEvent
import numpy as np
import shutil
import libinput as linp
import copy
import os.path
import warnings
warnings.simplefilter('ignore'... | Alwnikrotikz/hooke | review.py | Python | lgpl-3.0 | 4,377 |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""LayoutTests/ presubmit script for Blink.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presu... | axinging/chromium-crosswalk | third_party/WebKit/LayoutTests/PRESUBMIT.py | Python | bsd-3-clause | 2,808 |
import itertools
from datetime import date, datetime
from typing import TYPE_CHECKING
from pyuploadcare.api.base import ListCountMixin
if TYPE_CHECKING:
from pyuploadcare.client import Uploadcare
class BaseApiList:
# ordering fields names which must be handled as datetime
datetime_ordering_fields = ()
... | uploadcare/pyuploadcare | pyuploadcare/resources/base.py | Python | mit | 2,816 |
# -*- coding: utf-8 -*-
from fcsite import models
def find_all():
return models.db().execute("""
SELECT *
FROM Rule
ORDER BY id""").fetchall()
def delete(id):
models.db().execute("""
DELETE FROM Rule WHERE id = ?""", (id, ))
models.db().commit()
def insert(body):
m... | kzkn/fc | fcsite/models/rules.py | Python | apache-2.0 | 425 |
# encoding: utf-8
"""Implementations for various useful completers.
These are all loaded by default by IPython.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full ... | boompieman/iim_project | project_python2/lib/python2.7/site-packages/IPython/core/completerlib.py | Python | gpl-3.0 | 11,779 |
"""Create figures for visualization purposes.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
import os
from os.path import join
import h5py
import cPickle as pickle
import numpy as np
from moviepy.editor import ImageSequenceClip
import cv2
import matplotlib
import matplotlib.pylab as plt
from spikefuel import d... | duguyue100/spikefuel | scripts/create_figures.py | Python | mit | 37,068 |
from cgi import parse_qs, escape
from UserDict import UserDict
import shutil
import os
class Request(UserDict):
def __init__(self, environ):
self.data = parse_qs(environ['QUERY_STRING'])
if environ['REQUEST_METHOD'].upper() == 'POST':
try:
request_body_size = int(envi... | dvor85/kmotion | core/utils.py | Python | gpl-3.0 | 1,834 |
# coding=utf-8
# Author: Idan Gutman
# Modified by jkaberg, https://github.com/jkaberg for SceneAccess
# URL: https://sick-rage.github.io
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | Arcanemagus/SickRage | sickbeard/providers/scc.py | Python | gpl-3.0 | 7,234 |
import _plotly_utils.basevalidators
class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="ticktextsrc",
parent_name="scatterpolargl.marker.colorbar",
**kwargs
):
super(TicktextsrcValidator, self).__init__(
pl... | plotly/plotly.py | packages/python/plotly/plotly/validators/scatterpolargl/marker/colorbar/_ticktextsrc.py | Python | mit | 466 |
# Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | rjschwei/WALinuxAgent | tests/common/test_cgroups.py | Python | apache-2.0 | 10,717 |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING: keep th... | nowackie/leaven | leavenproject/leavenproject/settings.py | Python | mit | 2,938 |
import numpy as np
import json
import matplotlib
#matplotlib.use('Agg')
import pylab as pl
# Plot the different figures for the merged spikes and voltages recordings.
# This file, as the MergeSpikefiles.py should be one level up than Test/..., the output of a simulation.
fparam = 'Test/Parameters/simulation_parameter... | pierreberthet/local-scripts | voltplot_str.py | Python | gpl-2.0 | 4,429 |
# This file contains some section data extracted from the CRM (Common Research
# Model) wing geometry. This is used to build the transonic wing geometry example.
import numpy as np
def CRMlinear(Epsilon):
XRoot = np.array([1,
0.9497,
0.8992,
0.8487,
0.798,
0.7474,
0.6967,
... | p-chambers/occ_airconics | airconics/CRMfoil.py | Python | bsd-3-clause | 2,597 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.