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 |
|---|---|---|---|---|---|
"""
This is a procedural interface to the matplotlib object-oriented
plotting library.
The following plotting commands are provided; the majority have
MATLAB |reg| [*]_ analogs and similar arguments.
.. |reg| unicode:: 0xAE
_Plotting commands
acorr - plot the autocorrelation function
annotate - annotate som... | jonyroda97/redbot-amigosprovaveis | lib/matplotlib/pylab.py | Python | gpl-3.0 | 10,766 |
import os
import inspect
import sys
from kivy.clock import Clock
from kivy.properties import (StringProperty,
BooleanProperty,
DictProperty,
ObjectProperty,
BoundedNumericProperty)
from kivy.uix.accordio... | araczkowski/RPi-InfoScreen-Kivy | screens/squeezeplayer/screen.py | Python | gpl-3.0 | 29,370 |
import datetime
import os
import uuid
from django.db import models
from django.utils import timezone
from django.conf import settings
from model_utils import Choices
from velo.velo.mixins.models import StatusMixin
def get_banner_upload(instance, filename):
ext = os.path.splitext(filename)[1]
filename = str(... | eeriks/velo.lv | velo/advert/models.py | Python | gpl-3.0 | 2,270 |
""" GGUSTicketsCommand
The GGUSTickets_Command class is a command class to know about
the number of active present opened tickets.
"""
from urllib.error import URLError
from DIRAC import S_ERROR, S_OK
from DIRAC.ConfigurationSystem.Client.Helpers.Resources import getGOCSiteName, getGOCSites
from DIRAC.Core.LCG.G... | DIRACGrid/DIRAC | src/DIRAC/ResourceStatusSystem/Command/GGUSTicketsCommand.py | Python | gpl-3.0 | 5,251 |
# coding=utf-8
from votai_utils.celery import app
from votai_utils.send_mails import send_mails_to_staff
@app.task
def send_suggestions_tasks(incremental_candidate_filter):
candidates = incremental_candidate_filter.get_candidates()
send_mails_to_staff({'candidates': candidates,
'filter... | lfalvarez/votai | suggestions_for_candidates/tasks.py | Python | gpl-3.0 | 594 |
#!python
from globals import *
def get_ontology():
from biana.biana_commands import available_sessions, create_new_session
# Create a new BIANA session
create_new_session(sessionID="biana_session",dbname=DB_NAME, dbhost=DB_HOST, dbuser=DB_USER, dbpassword=DB_PASS, unification_protocol=DEFAULT_UNIFICATION... | emreg00/biana | scripts/examples/get_ontology.py | Python | gpl-3.0 | 965 |
from .infant_birth_admin import InfantBirthAdmin
from .infant_visit_admin import InfantVisitAdmin
| botswana-harvard/eit | eit/apps/eit_infant/admin/__init__.py | Python | gpl-3.0 | 98 |
#!/usr/bin/python
import cgi
import psycopg2
import json
import cgitb
cgitb.enable()
def getAggregate():
cur.execute( """SELECT
incidentdescription.description as description, COUNT(incidentdescription.incidentdescriptionid) as total
FROM blotter.incidentdescription
JOIN blotter.incident on incide... | arm5077/pgh-crime-blotter | py/process.py | Python | gpl-3.0 | 2,777 |
import numpy
from LOTlib.Miscellaneous import attrmem, Infinity
class PowerLawDecayed(object):
"""
This implements a likelihood decay such that more recent data
is weighted more strongly, via the parameter ll_decay
By default, we store the likelihoods for each data point (as we... | joshrule/LOTlib | LOTlib/Hypotheses/Likelihoods/PowerLawDecayed.py | Python | gpl-3.0 | 2,722 |
#!/usr/bin/env python
import base
import vault
import sys
import requests
import cfscrape
from termcolor import colored
import json
class style:
BOLD = '\033[1m'
END = '\033[0m'
# Control whether the module is enabled or not
ENABLED = False
def banner():
print colored(style.BOLD + '\n---> Searching Em... | DataSploit/datasploit | emails/email_hacked_emails.py | Python | gpl-3.0 | 1,956 |
# -*- coding: utf-8 -*-
#
# Autopilot documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 21 07:42:51 2013.
#
# 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.
#
# A... | rogerlindberg/autopilot | documentation/conf.py | Python | gpl-3.0 | 8,885 |
def main(bot):
count = 100
while True:
scan_result = bot.scan(18, 10, True, True, False)
if scan_result[0] == 0 and scan_result[1] == 0:
bot.move()
if count == 0:
count = 100
for i in range(0, 10):
bot.fire()
... | Zer0Zer0Huit/PythonBot | Bots/moveShoot.py | Python | gpl-3.0 | 373 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('persons', '0002_auto'),
]
operations = [
migrations.CreateModel(
name='IgnoredSimilarNames',
fields=... | morelab/labman_ud | labman_ud/management/migrations/0001_initial.py | Python | gpl-3.0 | 784 |
# pyWebGraph, a bridge between WebGraph an {J,P}ython
# Copyright (C) 2009 Massimo Santini
#
# This file is part of pyWebGraph.
#
# pyWebGraph 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... | aftab90/py-web-graph | pywebgraph/webgraph/__init__.py | Python | gpl-3.0 | 1,353 |
# This is generated by cbind and should not be edited.
from ctypes import *
class timeval(Structure):
pass
timeval._fields_ = [('tv_sec', c_long),
('tv_usec', c_long)]
class input_event(Structure):
pass
input_event._fields_ = [('time', timeval),
('type', c_ushort),
... | clchiou/ctypes-binding-generator | demo/linux_input.py | Python | gpl-3.0 | 18,753 |
"""Quote system"""
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.sql.functions import random as sqlrandom
import dave.module
import dave.config
import uuid
import random
import os
from dave.models import Quote
from twisted.words.protocols.irc import assembleFormattedText, attributes as A
random.seed(os.ur... | w4/belle | dave/modules/quote.py | Python | gpl-3.0 | 2,924 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.test_runner import make_test_records
from erpnext.controllers.item_variant import (create_variant, ItemVarian... | emmuchira/kps_erp | erpnext/stock/doctype/item/test_item.py | Python | gpl-3.0 | 9,468 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file analyze_teleports.py
@author Jakob Erdmann
@date 2012-11-20
@version $Id: analyze_teleports.py 14425 2013-08-16 20:11:47Z behrisch $
Extract statistics from the warning outputs of a simulation run for plotting.
SUMO, Simulation of Urban MObility; see http... | cathyyul/sumo-0.18 | tools/output/analyze_teleports.py | Python | gpl-3.0 | 2,656 |
# encoding: utf-8
from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
migrate_engine.execute('''
ALTER TABLE "related"
ADD COLUMN view_count INT NOT NULL DEFAULT 0;
ALTER TABLE "related"
ADD COLUMN featured INT NOT NULL DEFAULT 0;
UPDATE re... | NicoVarg99/daf-recipes | ckan/ckan/ckan/ckan/migration/versions/059_add_related_count_and_flag.py | Python | gpl-3.0 | 395 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Damien Churchill 2008-2009 <damoxc@gmail.com>
# Copyright (C) Andrew Resch 2009 <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with ... | rkokkelk/Gulliver | deluge/ui/common.py | Python | gpl-3.0 | 13,658 |
# -*- coding: utf-8 -*-
# Copyright 2007-2022 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 y... | jat255/hyperspy | hyperspy/tests/component/test_pes_core_line_shape.py | Python | gpl-3.0 | 4,135 |
"""
ISO639-2 standart: the module only contains the dictionary ISO639_2
which maps a language code in three letters (eg. "fre") to a language
name in english (eg. "French").
"""
# ISO-639, the list comes from:
# http://www.loc.gov/standards/iso639-2/php/English_list.php
_ISO639 = (
("Abkhazian", "abk", "ab"),
... | SickGear/SickGear | lib/hachoir_py3/core/iso639.py | Python | gpl-3.0 | 17,974 |
import time
from trst.navigation.navigator import PIDNavigator
from trst.navigation.boatstate import BoatState
from trst.serial.pyserial_driver import SerialConnection
from trst.server.data import *
WAIT_TIME = 0.5
def pull_data():
boat_data = data.get_request('').json()
if boat_data == {}:
print "NO... | tuftsrobotics/trst | v2/navigate.py | Python | gpl-3.0 | 1,663 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import matplotlib
from matplotlib.testing.decorators import image_comparison
from matplotlib.compat.subprocess import check_output
import matplotlib.pyplot as plt
@pytest.mark.skipif(not matplo... | jonyroda97/redbot-amigosprovaveis | lib/matplotlib/tests/test_usetex.py | Python | gpl-3.0 | 1,082 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bar_management.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| irin4eto/Bar-Management | manage.py | Python | gpl-3.0 | 257 |
import errno
import os
import shutil
import socket
import subprocess
import sys
import tempfile
import time
import urllib2
import pytest
from tools.wpt import wpt
here = os.path.abspath(os.path.dirname(__file__))
def is_port_8000_in_use():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
... | peterjoel/servo | tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py | Python | mpl-2.0 | 16,606 |
import matplotlib.pyplot as plt
import numpy as np
plt.figure(1)
ax1=plt.subplot(2, 1, 1)
A = .8
f0 = 2
phi = np.pi/2
fs = 100
t = np.arange(-1, 1, 1.0/fs)
x = A * np.cos(2*np.pi*f0*t+phi)
ax1.plot(t, x, 'b',lw=2)
plt.axis([-1,1,-0.8,0.8])
ax1.set_title('analog')
ax1.set_xlabel('time (sec)')
ax1.set_ylabel('amplitude'... | acmaheri/sms-tools | lectures/1-Introduction/plots-code/analog-digital.py | Python | agpl-3.0 | 503 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime as dt
from datetime import timedelta as td
from odoo import SUPERUSER_ID
from odoo.tests import Form
from odoo.tests.common import SavepointCase
class TestReorderingRule(SavepointCase):
... | ygol/odoo | addons/purchase_stock/tests/test_reordering_rule.py | Python | agpl-3.0 | 21,924 |
##############################################################################
#
# 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 ... | uclouvain/OSIS-Louvain | learning_unit/tests/ddd/factories/learning_unit_year_identity.py | Python | agpl-3.0 | 1,764 |
# -*- coding: utf-8 -*-
"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>
This file is part of the 1flow project.
1flow 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 versio... | EliotBerriot/1flow | oneflow/core/models/nonrel/read.py | Python | agpl-3.0 | 42,501 |
# -*- coding: utf-8 -*-
import csv
import os
from datetime import datetime
from re import match
import time
import logging
import tempfile
import requests
from lxml import etree
import pandas
from dlstats.fetchers._commons import Fetcher, Datasets, Providers
VERSION = 1
logger = logging.getLogger(__name__)
DATASE... | MichelJuillard/dlstats | dlstats/fetchers/imf.py | Python | agpl-3.0 | 10,415 |
# -*- coding: utf-8 -*-
import migrations
| suvitorg/suvit-odoo | suvit_migration/models/__init__.py | Python | agpl-3.0 | 42 |
"""
Unit tests for masquerade.
"""
import json
import pickle
from mock import patch
from nose.plugins.attrib import attr
from datetime import datetime
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.timezone import UTC
from capa.tests.response_xml_factory import OptionR... | fintech-circle/edx-platform | lms/djangoapps/courseware/tests/test_masquerade.py | Python | agpl-3.0 | 19,822 |
#####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... | NinjaMSP/crossbar | crossbar/router/auth/cryptosign.py | Python | agpl-3.0 | 10,168 |
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
from collections import namedtuple
import newrelic.core.trace_node
from newrelic.core.metric import TimeMetric
_ExternalNode = namedtuple('_ExternalNode',
['library', 'url', 'method', 'children', 'start_time', 'end_time',
... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/core/external_node.py | Python | agpl-3.0 | 4,584 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from controllers.trends import get_columns,get_data
def execute(filters=None):
if not filters: filters ={}
data = []
conditions = get_columns(filt... | Yellowen/Owrang | stock/report/delivery_note_trends/delivery_note_trends.py | Python | agpl-3.0 | 418 |
import re
import bson
from flask import current_app as app
from .user_mentions import notify_mentioned_users
# client is using @[display name](type:id)
USER_MENTIONS_REGEX = re.compile(r"@\[([^]]+)\]\(user:([a-f0-9]{24})\)")
def handle_inline_mentions(sender, updates, original):
"""Listen to item_update signa... | superdesk/superdesk-core | apps/comments/inline_comments.py | Python | agpl-3.0 | 1,888 |
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import mock
from odoo.modules import get_module_path
from odoo.modules.registry import Registry
from odoo.tests.common import TransactionCase
from ..models.module_deprecated import PARAM_DEPRECATED
class TestModuleUpgrade... | brain-tec/server-tools | module_auto_update/tests/test_module_upgrade_deprecated.py | Python | agpl-3.0 | 1,729 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | nirbheek/cerbero | cerbero/utils/svn.py | Python | lgpl-2.1 | 2,137 |
# fMBT, free Model Based Testing tool
# Copyright (c) 2013-2015, Intel Corporation.
#
# Author: antti.kervinen@intel.com
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software... | yoonkiss/fMBT | pythonshare/pythonshare/server.py | Python | lgpl-2.1 | 25,551 |
import sys
def setup(core, object):
return
def equip(core, actor, target):
core.skillModService.addSkillMod(actor, 'agility_modified', 21)
return
def unequip(core, actor, target):
core.skillModService.deductSkillMod(actor, 'agility_modified', 21)
return
| ProjectSWGCore/NGECore2 | scripts/object/tangible/wearables/robe/robe_jedi_padawan.py | Python | lgpl-3.0 | 268 |
"""
The purpose of this code is to automatically generate
the moment of inertia equations. only the locations of
The nodes of the elements are required, as well as the
triangular sections that are generated.
For example, [1,a,b] means a positive triangular section (+1)
with the 3 nodes at a, b, and <0,0>.
This ... | saullocastro/pyNastran | pyNastran/bdf/cards/bars/inertia_formulas.py | Python | lgpl-3.0 | 8,994 |
import sys
import time
def setup(core, actor, target, command):
return
def run(core, actor, target, commandstring):
stcSvc = core.staticService
objSvc = core.objectService
object = objSvc.createObject('object/tangible/terminal/shared_terminal_travel_instant_snowspeeder.iff', actor.getPlanet(), (actor.getWorldPo... | agry/NGECore2 | scripts/commands/callforsnowspeeder.py | Python | lgpl-3.0 | 1,395 |
""" client for gisgraphy fulltext search """
from pprint import pprint
import urllib
import urllib2
GISGRAPHY_PARAMETERS_NAMES = ("q", "style",
"indent", "from", "to", "lang", "placetype")
GISGRAPHY_BASE_URL = "http://services.gisgraphy.com/fulltext/fulltextsearch?"
PYTHON_PARAMETER_VAL... | delphiprogramming/gisgraphy | src/main/python/client/gisgraphy_python_client.py | Python | lgpl-3.0 | 3,742 |
from lxml import etree
from openerp import api, models, fields, SUPERUSER_ID
from openerp.tools import email_split
from openerp.tools.translate import _
class wizard(models.TransientModel):
_name = 'mail_move_message.wizard'
def _model_selection(self):
selection = []
config_parameters = self.e... | Endika/addons-yelizariev | mail_move_message/mail_move_message_models.py | Python | lgpl-3.0 | 14,758 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | agry/NGECore2 | scripts/mobiles/tatooine/rock_beetle_cave.py | Python | lgpl-3.0 | 1,586 |
# RUN: %python -m artiq.compiler.testbench.embedding +diag %s 2>%t
# RUN: OutputCheck %s --file-to-check=%t
from artiq.language.core import *
from artiq.language.types import *
@kernel
def f(self):
core_log(self.x)
class c:
a = f
x = 1
class d:
b = f
x = 2
xa = c().a
xb = d().b
@kernel
def entryp... | JQIamo/artiq | artiq/test/lit/embedding/error_kernel_method_self_unify.py | Python | lgpl-3.0 | 500 |
from flask import render_template,flash,redirect,request
from app import app
from .forms import InputForm,LoginForm
from .publisher import Publisher
@app.route('/')
def simple_index():
return "Hello World Flask Webservice"
@app.route('/index')
def index():
user = {'nickname': 'Miguel'} # fake user
posts ... | UWPCE-PythonCert/IntroPython2016 | students/liverpoolforever/project/app/views.py | Python | unlicense | 1,412 |
from rspecs.commons import DEFAULT_XMLNS, DEFAULT_XS, DEFAULT_SCHEMA_LOCATION,\
DSL_PREFIX
from rspecs.commons_tn import DEFAULT_SHARED_VLAN
from rspecs.commons_com import EMULAB_XMLNS
from rspecs.formatter_base import FormatterBase
from lxml import etree
DEFAULT_REQ_SCHEMA_LOCATION = DEFAULT_SCHEMA_LOCATION
DEFAU... | dana-i2cat/felix | modules/resource/utilities/rspecs/crm/request_formatter.py | Python | apache-2.0 | 2,657 |
#!/usr/bin/env python3
###############################################################################
# Copyright 2020 The Apollo 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... | ApolloAuto/apollo | scripts/command_checker.py | Python | apache-2.0 | 3,773 |
#! /usr/bin/env python
# $Header$
'''Compound typecodes.
'''
from ZSI import _copyright, _children, _child_elements, \
_inttypes, _stringtypes, _seqtypes, _find_arraytype, _find_href, \
_find_type, _find_xmlns_prefix, _get_idstr, EvaluateException, \
ParseException
from TC import _get_element_nsuri_na... | sassoftware/catalog-service | catalogService/libs/viclient_vendor/ZSI/TCcompound.py | Python | apache-2.0 | 26,848 |
#!/usr/bin/env python
import logging
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.options import define, options, parse_command_line
from tornado.websocket import WebSocketConnect
define('url', default='ws://localhost:9001')
define('name', default='Tornado')
@gen.engine
def run_tests():
... | bufferx/tornado | maint/test/websocket/client.py | Python | apache-2.0 | 1,359 |
# -*- coding: utf-8 -*-
'''
Return salt data via pushover (http://www.pushover.net)
.. versionadded:: 2016.3.0
The following fields can be set in the minion conf file::
pushover.user (required)
pushover.token (required)
pushover.title (optional)
pushover.device (optional)
pushover.priority (optio... | stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/returners/pushover_returner.py | Python | apache-2.0 | 7,806 |
#
# Copyright (c) SAS Institute 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 law or agreed to in w... | sassoftware/conary | conary/lib/__init__.py | Python | apache-2.0 | 1,010 |
# 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 agreed ... | yebrahim/pydatalab | google/datalab/ml/_tensorboard.py | Python | apache-2.0 | 2,946 |
# 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 use ... | apache/libcloud | libcloud/loadbalancer/base.py | Python | apache-2.0 | 10,340 |
#!/usr/bin/env python2.7
# Copyright 2017 Janos Czentye
#
# 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 o... | 5GExchange/escape | escape.py | Python | apache-2.0 | 10,908 |
# Copyright (c) 2017 Huawei Technologies India Pvt.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-... | openstack/python-neutronclient | neutronclient/osc/v2/sfc/sfc_port_chain.py | Python | apache-2.0 | 14,731 |
'''
@author: frank
'''
import os
from zstacklib.utils import shell
from zstacklib.utils import linux
from zstacklib.utils import log
from zstacklib.utils import ordered_set
from zstacklib.utils.bash import *
from pyparsing import *
logger = log.get_logger(__name__)
_iptablesUseLock = None
_ip6tablesUseLock = None
d... | zstackorg/zstack-utility | zstacklib/zstacklib/utils/iptables.py | Python | apache-2.0 | 34,202 |
# Copyright 2015 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... | TakayukiSakai/tensorflow | tensorflow/python/training/momentum.py | Python | apache-2.0 | 2,927 |
# 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
# distrib... | JioCloud/python-openstackclient | openstackclient/identity/v2_0/catalog.py | Python | apache-2.0 | 3,148 |
from views.user import UserView
urls_map = [
# ("/user", UserView),
("/user", "views.user.UserView"),
] | zoufou/rima | examples/api/urls.py | Python | apache-2.0 | 113 |
#!/usr/bin/env python
import sys
from optparse import OptionParser
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'bitfield_test',
... | alex/django-bitfield | runtests.py | Python | apache-2.0 | 1,245 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""Generate secrets for test purposes.
You will need to get real values for:
* github_client_id
* github_client_secret
* admin_user
The rest can be generated this way for production::
admin_users=xyz github_client_secret=x github_client_id=x python secr... | radiasoft/salt-conf | scripts/jupyterhub-secret.py | Python | apache-2.0 | 1,713 |
"""
Support for Ecobee.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ecobee/
"""
import logging
import os
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import ... | JshWright/home-assistant | homeassistant/components/ecobee.py | Python | apache-2.0 | 3,845 |
# -*- coding: utf-8 -*-
#
# 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... | dhermes/google-cloud-python | tasks/tests/unit/gapic/v2beta3/test_cloud_tasks_client_v2beta3.py | Python | apache-2.0 | 26,103 |
"""
Kconfig Extension
#################
Copyright (c) 2022 Nordic Semiconductor ASA
SPDX-License-Identifier: Apache-2.0
Introduction
============
This extension adds a new domain (``kconfig``) for the Kconfig language. Unlike
many other domains, the Kconfig options are not rendered by Sphinx directly but
on the clie... | zephyrproject-rtos/zephyr | doc/_extensions/zephyr/kconfig/__init__.py | Python | apache-2.0 | 13,423 |
#! /usr/bin/env python
"""
Initialize, start, stop, or destroy WAL replication mirror segments.
============================= DISCLAIMER =============================
This is a developer tool to assist with development of WAL replication
for mirror segments. This tool is not meant to be used in production.
It is sug... | cjcjameson/gpdb | gpAux/gpdemo/gpsegwalrep.py | Python | apache-2.0 | 9,056 |
#! /usr/bin/env python2
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicabl... | c1728p9/mbed-os | tools/make.py | Python | apache-2.0 | 13,143 |
# ====================================================================
# 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 re... | romanchyla/pylucene-trunk | samples/LuceneInAction/lia/analysis/positional/PositionalStopFilter.py | Python | apache-2.0 | 1,343 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
file: qweibo2.py
author:darkbull(http://darkbull.net)
date: 2013-01-03
desc:
QQ微博 api的python封装.(基于oauth2.0)
QQ微博 OAuth2.0 参考:http://wiki.open.t.qq.com/index.php/OAuth2.0%E9%89%B4%E6%9D%83
QQ微博 微博在线api文档参考:http://wiki.o... | origingod/bitc_weibo | weibo-uni/qweibo2.py | Python | apache-2.0 | 10,438 |
# Copyright (C) 2021 Nippon Telegraph and Telephone Corporation
# 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/LICE... | openstack/tacker | tacker/sol_refactored/objects/v2/external_artifacts_access_config.py | Python | apache-2.0 | 2,430 |
# Copyright (c) 2013 Red Hat, 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 require... | blueboxgroup/cinder | cinder/tests/test_glusterfs.py | Python | apache-2.0 | 76,072 |
# Webhooks for external integrations.
from typing import Any, Mapping, Optional, Tuple
import orjson
from django.http import HttpRequest, HttpResponse
from zerver.decorator import return_success_on_head_request, webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import ... | zulip/zulip | zerver/webhooks/trello/view/__init__.py | Python | apache-2.0 | 1,682 |
# -*- coding: utf-8 -*-
#
# 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... | dhermes/gcloud-python | pubsub/google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py | Python | apache-2.0 | 8,650 |
# Copyright (C) 2011 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py | Python | apache-2.0 | 5,646 |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# filetop file reads and writes by process.
# For Linux, uses BCC, eBPF.
#
# USAGE: filetop.py [-h] [-C] [-r MAXROWS] [interval] [count]
#
# This uses in-kernel eBPF maps to store per process summaries for efficiency.
#
# Copyright 2016 Netflix,... | shodoco/bcc | tools/filetop.py | Python | apache-2.0 | 5,845 |
# Copyright 2015 Planet Labs, 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 law or agreed to in wr... | planetlabs/datalake | client/datalake/translator.py | Python | apache-2.0 | 3,329 |
# Copyright 2017 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... | jwlawson/tensorflow | tensorflow/contrib/eager/python/examples/mnist/mnist.py | Python | apache-2.0 | 9,218 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | neumerance/deploy | openstack_dashboard/dashboards/admin/models.py | Python | apache-2.0 | 1,104 |
"""
Example service that prints out http context.
"""
import time
import requests
from ray.experimental import serve
from ray.experimental.serve.utils import pformat_color_json
def echo(flask_request):
return "hello " + flask_request.args.get("name", "serve!")
serve.init(blocking=True)
serve.create_endpoint... | ujvl/ray-ng | python/ray/experimental/serve/examples/echo.py | Python | apache-2.0 | 606 |
import pytest
import pymongo
from next.database_client.DatabaseAPI import to_db_fmt, from_db_fmt, DatabaseAPI, DatabaseException
# IMPORTANT NOTE: only uses the `test_data` database; it gets cleared after each test session
MONGO_HOST, MONGO_PORT = 'localhost', 27017
MONGO_DB = 'test_data'
# === fixtures ===
@pytest... | kgjamieson/NEXT | next/database_client/test_databaseapi.py | Python | apache-2.0 | 7,833 |
'''
Test IPsec creation when ikeDhGroup is 5
@author: Glody
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.ipsec_operations as ipsec_ops
import zstackwoodpecker.operations.re... | zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/ipsec/test_create_ipsec_ike_dh_group_5.py | Python | apache-2.0 | 4,792 |
from .explorer import Explorer
import simuvex, claripy
class Callable(object):
'''
Callable is a representation of a function in the binary that can be
interacted with like a native python function.
'''
def __init__(self, project, addr, prototype, base_state=None, toc=None):
'''
Cr... | lowks/angr | angr/surveyors/caller.py | Python | bsd-2-clause | 8,501 |
# Generated by Django 1.11.14 on 2019-09-25 10:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0009_auto_20190306_1417'),
]
operations = [
migrations.AlterField(
model_name='path',
name='name',
... | GeotrekCE/Geotrek-admin | geotrek/core/migrations/0010_auto_20190925_1243.py | Python | bsd-2-clause | 470 |
class NotImplementedException(BaseException):
pass
class TimeRuleException(BaseException):
pass
class LimitRuleException(BaseException):
pass
class ActionRuleException(BaseException):
pass
class IPException(BaseException):
pass
class SubnetException(BaseException):
pass
class NSRecEx... | dip-proto/eris | eris/app_exceptions.py | Python | bsd-2-clause | 787 |
from sp_segmenter.SemanticSegmentationPy import *
segmenter = SemanticSegmentation()
print "Setting up the segmenter parameters."
use_additional_parameter = True
use_table = True
have_objrecransac = True
compute_pose = True and have_objrecransac
ObjRecRANSAC_mode_dict = {"STANDARD_BEST":0, "STANDARD_RECOGNIZE":1, "GR... | jhu-lcsr/sp_segmenter | python_binding/sample_segmentation.py | Python | bsd-2-clause | 4,268 |
# -*- coding:utf-8 -*-
import calendar
from django_extensions.management.jobs import DailyJob
from django.utils.timezone import now
from ...tasks import SendPeriodicAutomatchesEmailTask
from ... import constants
class Job(DailyJob):
help = '''
Sends periodic email notifications to users notifying the total ... | hellhovnd/dentexchange | dentexchange/apps/matches/jobs/daily/periodic_automatches_email.py | Python | bsd-3-clause | 619 |
"""
bughispster.user.admin
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2013-2014 by Xavier Ordoquy, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.forms import AdminP... | pombredanne/django-bug-hipster | bughipster/user/admin.py | Python | bsd-3-clause | 7,324 |
class MongoRestException(Exception):
def __init__(self, message):
self._message = message
def _get_message(self):
return self._message
def _set_message(self, message):
self._message = message
message = property(_get_message, _set_message)
class OperatorNotAllowed(MongoRestExc... | DropD/flask-mongorest | flask_mongorest/exceptions.py | Python | bsd-3-clause | 651 |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import gettext
import json
from os import path
from django.conf import settings
from django.test import (
SimpleTestCase, TestCase, modify_settings, override_settings,
)
from django.test.selenium import SeleniumTestCase
from django.test.utils import i... | dfunckt/django | tests/view_tests/tests/test_i18n.py | Python | bsd-3-clause | 21,652 |
# Copyright 2015, 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 f... | w4-sjcho/grpc | src/python/grpcio/grpc/_adapter/_intermediary_low.py | Python | bsd-3-clause | 10,036 |
__author__ = 'administrator'
| ICT4H/dcs-mangrove | mangrove/transport/repository/__init__.py | Python | bsd-3-clause | 29 |
"""Undocumented Module"""
__all__ = ['ClassicFSM']
"""Finite State Machine module: contains the ClassicFSM class.
This module and class exist only for backward compatibility with
existing code. New code should use the FSM module instead.
"""
from direct.directnotify.DirectNotifyGlobal import directNotify
from dire... | tobspr/panda3d | direct/src/fsm/ClassicFSM.py | Python | bsd-3-clause | 14,101 |
__author__ = 'Robert Meyer'
import numpy as np
from pypet.parameter import Parameter
from pypet.utils.explore import cartesian_product
from pypet.environment import Environment
from pypet import pypetconstants
import logging
import os
import time
from scipy.stats import pearsonr
from pypet.tests.testutils.ioutils im... | SmokinCaterpillar/pypet | pypet/tests/integration/merge_test.py | Python | bsd-3-clause | 30,562 |
# -*- coding: utf-8 -*-
"""
jinja2.testsuite.tests
~~~~~~~~~~~~~~~~~~~~~~
Who tests the tests?
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import pytest
from jinja2 import Markup, Environment
@pytest.mark.test_tests
class TestTestsCase(object):
... | ThiefMaster/jinja2 | tests/test_tests.py | Python | bsd-3-clause | 5,216 |
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Tests C{ext2int} and C{int2ext}.
"""
from numpy import ones, delete, c_, r_
from pypower.loadcase import loadcase
from pypower.e2i_data import e2i_data
from p... | praba230890/PYPOWER | pypower/t/t_ext2int2ext.py | Python | bsd-3-clause | 13,032 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import types
import warnings
import numpy as np
from astropy.units.core import Unit, UnitsError
from astropy.units.quantity import Quantity
from astropy.utils import lazyproperty
from astropy.utils.exceptions import AstropyUserWarning
_... | StuartLittlefair/astropy | astropy/constants/constant.py | Python | bsd-3-clause | 8,574 |
from __future__ import division, absolute_import, print_function
import os
import sys
import warnings
import collections
from numpy.core import multiarray
from . import umath
from .umath import (invert, sin, UFUNC_BUFSIZE_DEFAULT, ERR_IGNORE,
ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LOG,
... | brandon-rhodes/numpy | numpy/core/numeric.py | Python | bsd-3-clause | 86,192 |
"""
Restore media files.
"""
import tarfile
from django.core.files.storage import get_storage_class
from ._base import BaseDbBackupCommand, make_option
from ...storage import get_storage
from ... import utils
class Command(BaseDbBackupCommand):
help = """Restore a media backup from storage, encrypted and/or
... | django-dbbackup/django-dbbackup | dbbackup/management/commands/mediarestore.py | Python | bsd-3-clause | 3,632 |