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 |
|---|---|---|---|---|---|
#! /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... | edespino/gpdb | gpAux/gpdemo/gpsegwalrep.py | Python | apache-2.0 | 24,714 |
from cbagent.collectors.libstats.remotestats import RemoteStats, parallel_task
class TPStats(RemoteStats):
METRICS = (
("rss", 1), # already in bytes
)
def __init__(self, hosts, workers, user, password):
super().__init__(hosts, workers, user, password)
self.typeperf_cmd = "typ... | pavel-paulau/perfrunner | cbagent/collectors/libstats/typeperfstats.py | Python | apache-2.0 | 1,192 |
import random
from xworld_env import XWorldEnv
from py_util import overrides
class XWorldDialogMap(XWorldEnv):
def __init__(self, item_path, start_level=0):
super(XWorldDialogMap, self).__init__(
item_path=item_path,
max_height=1,
max_width=1,
start_level=sta... | skylian/XWorld | games/xworld/maps/XWorldDialogMap.py | Python | apache-2.0 | 3,644 |
import logging
import os
import sys
import time
from typing import TYPE_CHECKING, Optional
from packaging import version
from dvc import __version__
from dvc.utils.pkg import PKG
if TYPE_CHECKING:
from dvc.ui import RichText
logger = logging.getLogger(__name__)
class Updater:
URL = "https://updater.dvc.or... | dmpetrov/dataversioncontrol | dvc/updater.py | Python | apache-2.0 | 5,458 |
'''
New Integration Test for vip qos.
@author: Legion
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
qos = test_stub.VIPQOS()
port = te... | zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/vip_qos/test_flat_vip_qos_multi_crt.py | Python | apache-2.0 | 1,140 |
# -*- coding: utf-8 -*-
from openprocurement.tender.core.utils import optendersresource
from openprocurement.tender.openeu.views.complaint import (
TenderEUComplaintResource
)
from openprocurement.tender.competitivedialogue.constants import (
CD_EU_TYPE, CD_UA_TYPE
)
@optendersresource(name='{}:Tender Complai... | gorserg/openprocurement.tender.competitivedialogue | openprocurement/tender/competitivedialogue/views/stage1/complaint.py | Python | apache-2.0 | 1,110 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/apps_v1beta1_deployment_status.py | Python | apache-2.0 | 10,171 |
"""Funcionality for representing a physical variable in aospy."""
import numpy as np
class Var(object):
"""An object representing a physical quantity to be computed.
Attributes
----------
name : str
The variable's name
alt_names : tuple of strings
All other names that the variable... | spencerkclark/aospy | aospy/var.py | Python | apache-2.0 | 5,451 |
# coding=utf-8
from django.db import models
class User(models.Model):
name = models.CharField(max_length=32)
mail = models.EmailField()
class Meta:
db_table = 'user'
class Article(models.Model):
STATUS_SET = (
(0, "草稿"),
(1, "公开"),
)
title = models.CharField(... | sniperyen/MyDjango | restfulapi/models.py | Python | apache-2.0 | 654 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | rayrrr/luigi | test/range_test.py | Python | apache-2.0 | 65,208 |
#!/bin/sh -
# Copyright 2011-2012 James McCauley
#
# 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 ... | voidcc/POXPOF | pox.py | Python | apache-2.0 | 1,289 |
"""
$url play.mrt.com.mk
$type live, vod
$region North Macedonia
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
log = logging.getLogger(__name__)
@pluginmatcher(re.compile(
r"https?://play\.... | streamlink/streamlink | src/streamlink/plugins/mrtmk.py | Python | bsd-2-clause | 1,423 |
def get_package_data():
return {
_ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc', 'data/*']}
| mwcraig/reproject | reproject/tests/setup_package.py | Python | bsd-2-clause | 106 |
## @file
# This file is used to define checkpoints used by ECC tool
#
# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. T... | bitcrystal/buildtools-BaseTools | Source/Python/Ecc/Check.py | Python | bsd-2-clause | 71,517 |
#! /usr/bin/env python
#This is just a test program
#It calculates an age at days from input and prints it
#SMN
from datetime import date
import sys
try:
if (sys.argv[1] == "-h"):
print """
First Python program of SMN
Usage: year month date
-h Display this usage message
... | sniemi/SamPy | sandbox/src2/bdaycalculator.py | Python | bsd-2-clause | 1,045 |
"""
Estimation of the total magnetization vector of homogeneous bodies.
It estimates parameters related to the magnetization vector of homogeneous
bodies.
**Algorithms**
* :class:`~fatiando.gravmag.magdir.DipoleMagDir`: This class estimates
the Cartesian components of the magnetization vector of homogeneous
dipo... | eusoubrasileiro/fatiando | fatiando/gravmag/magdir.py | Python | bsd-3-clause | 7,336 |
# Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class KeyHitTestCasesPage(page_module.Page):
def _... | mou4e/zirconium | tools/perf/page_sets/key_hit_test_cases.py | Python | bsd-3-clause | 1,778 |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
# Training settings
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')... | chuckbasstan123/pyTorch_project | mnist/main.py | Python | bsd-3-clause | 4,528 |
import unittest
from mock import Mock
from cartodb_services.tomtom.isolines import TomTomIsolines, DEFAULT_PROFILE
from cartodb_services.tools import Coordinate
from credentials import tomtom_api_key
VALID_ORIGIN = Coordinate(-73.989, 40.733)
class TomTomIsolinesTestCase(unittest.TestCase):
def setUp(self):
... | CartoDB/geocoder-api | server/lib/python/cartodb_services/test/test_tomtomisoline.py | Python | bsd-3-clause | 992 |
from rest_framework import serializers
from olympia.addons.models import Addon
from olympia.addons.serializers import AddonSerializer, VersionSerializer
from olympia.discovery.models import DiscoveryItem
from olympia.versions.models import Version
class DiscoveryEditorialContentSerializer(serializers.ModelSerializer... | kumar303/olympia | src/olympia/discovery/serializers.py | Python | bsd-3-clause | 2,792 |
from __future__ import absolute_import
from .base import Filter
from six.moves.urllib.parse import urlparse
from sentry.utils.data_filters import FilterStatKeys
LOCAL_IPS = frozenset(['127.0.0.1', '::1'])
LOCAL_DOMAINS = frozenset(['127.0.0.1', 'localhost'])
class LocalhostFilter(Filter):
id = FilterStatKeys.LO... | ifduyue/sentry | src/sentry/filters/localhost.py | Python | bsd-3-clause | 996 |
__all__ = ['berry_curvature', 'plot_berry_curvature']
from qutip import (Qobj, tensor, basis, qeye, isherm, sigmax, sigmay, sigmaz)
import numpy as np
try:
import matplotlib.pyplot as plt
except:
pass
def berry_curvature(eigfs):
"""Computes the discretized Berry curvature on the two dimensional grid
... | qutip/qutip | qutip/topology.py | Python | bsd-3-clause | 2,853 |
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
try:
set
except NameError:
from sets import Set as set # For Python 2.3
def compile_messages(locale=None):
basedirs = (os.path.join('conf', 'local... | diofeher/django-nfa | django/core/management/commands/compilemessages.py | Python | bsd-3-clause | 2,462 |
# -*- coding: utf-8 -*-
"""
forms.render_wtform_without_syntaxerr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Render WTForm fields with html attributes that cause TemplateSyntaxErrors
http://flask.pocoo.org/snippets/107/
"""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dir... | fengsp/flask-snippets | forms/render_wtform_without_syntaxerr.py | Python | bsd-3-clause | 1,222 |
#!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences import format_fastq_record
from skbio.format.sequences.fastq import _phred_to_ascii33, _phred_to_ascii64
class FASTQFormatTests(TestCase):
def setUp(self):
self.qual_scores = np.array([38, 39, 40], d... | Kleptobismol/scikit-bio | skbio/format/sequences/tests/test_fastq.py | Python | bsd-3-clause | 1,232 |
import re, sys
from common import default_movie, plain_exercise, bibliography, \
cite_with_multiple_args2multiple_cites
from misc import option
def plain_author(authors_and_institutions, auth2index,
inst2index, index2inst, auth2email):
text = '\n'
for author in auth2index:
email... | sjsrey/doconce | lib/doconce/plaintext.py | Python | bsd-3-clause | 10,664 |
# -*- coding: utf-8 -*-
import functools
import hashlib
import json
import os
import tempfile
import unittest
import uuid
import zipfile
from contextlib import nested
from datetime import datetime, timedelta
from decimal import Decimal
from django import forms
from django.conf import settings
from django.contrib.auth.... | tsl143/zamboni | mkt/webapps/tests/test_models.py | Python | bsd-3-clause | 97,405 |
"""django_embed URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | bokeh/bokeh | examples/howto/server_embed/django_embed/django_embed/urls.py | Python | bsd-3-clause | 1,707 |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Routines and classes for working with Portage overlays and ebuilds."""
import collections
import filecmp
import fileinput
import glob
import loggi... | espadrine/opera | chromium/src/third_party/chromite/buildbot/portage_utilities.py | Python | bsd-3-clause | 30,932 |
###
#
# WEIO Web Of Things Platform
# Copyright (C) 2013 Nodesign.net, Uros PETREVSKI, Drasko DRASKOVIC
# All rights reserved
#
# ## ## ######## #### #######
# ## ## ## ## ## ## ##
# ## ## ## ## ## ## ##
# ## ## ## ###### ... | nodesign/weioMinima | things/input/distance/sharp_proximity.py | Python | bsd-3-clause | 2,595 |
from django.conf import settings
# these 3 should be provided by your app
FACEBOOK_APP_ID = getattr(settings, 'FACEBOOK_APP_ID', None)
FACEBOOK_APP_SECRET = getattr(settings, 'FACEBOOK_APP_SECRET', None)
FACEBOOK_DEFAULT_SCOPE = getattr(settings, 'FACEBOOK_DEFAULT_SCOPE', [
'email', 'user_about_me', 'user_... | fogcitymarathoner/djfb | facebook_example/django_facebook/settings.py | Python | bsd-3-clause | 3,806 |
# Copyright (c) 2008-2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
GINI Water Vapor Imagery
========================
Use MetPy's support for GINI files to read in a water vapor satellite image and plot the
data using CartoPy.
"""
import ca... | metpy/MetPy | v0.5/_downloads/GINI_Water_Vapor.py | Python | bsd-3-clause | 1,923 |
class SassConfigurationError(Exception):
"""
This ERROR should be used when there is a problem with the
configuration settings in the settings.py file.
"""
pass
class SassCommandArgumentError(Exception):
"""
This ERROR should be used when there is a problem with the
arguments being p... | umitproject/tease-o-matic | sass/exceptions.py | Python | bsd-3-clause | 673 |
import hashlib
import itertools
import logging
import time
from datetime import datetime, timedelta
from urlparse import urlparse
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from ... | feer56/Kitsune2 | kitsune/wiki/models.py | Python | bsd-3-clause | 51,285 |
from pyoperant import hwio, components, panels, utils
from pyoperant.interfaces import comedi_, pyaudio_
from pyoperant import InterfaceError
import time
_ZOG_MAP = {
1: ('/dev/comedi0', 2, 0, 2, 8), # box_id:(subdevice,in_dev,in_chan,out_dev,out_chan)
2: ('/dev/comedi0', 2, 4, 2, 16),
3: ('/dev/comedi0', ... | gentnerlab/pyoperant | pyoperant/local_zog.py | Python | bsd-3-clause | 7,782 |
"""
==============================================
Read and visualize projections (SSP and other)
==============================================
This example shows how to read and visualize Signal Subspace Projectors (SSP)
vector. Such projections are sometimes referred to as PCA projections.
"""
# Author: Joan Mass... | adykstra/mne-python | examples/io/plot_read_proj.py | Python | bsd-3-clause | 3,434 |
#!/usr/bin/python
import sys
if len(sys.argv) < 3:
print 'Usage: <csv> <libsvm>'
print 'convert a all numerical csv to libsvm'
fo = open(sys.argv[2], 'w')
for l in open(sys.argv[1]):
arr = l.split(',')
fo.write('%s' % arr[0])
for i in xrange(len(arr) - 1):
fo.write(' %d:%s' % (i, arr[i+1])... | RPGOne/Skynet | xgboost-master/demo/yearpredMSD/csv2libsvm.py | Python | bsd-3-clause | 333 |
# by Greg Hazel
import xml
import xmlrpclib
from connection_cache import PyCURL_Cache, cache_set
import pycurllib
pycurllib.set_use_compression(True)
class PyCurlTransport(xmlrpclib.Transport):
def __init__(self, cache, max_connects=None, timeout=None):
self.host = None
self.cache = cache
... | rabimba/p2pScrapper | BitTorrent-5.2.2/BTL/xmlrpclib2.py | Python | mit | 2,795 |
# Time: O(n)
# Space: O(n)
# Given a string, find the first non-repeating character in it and
# return it's index. If it doesn't exist, return -1.
#
# Examples:
#
# s = "leetcode"
# return 0.
#
# s = "loveleetcode",
# return 2.
# Note: You may assume the string contain only lowercase letters.
from collections impor... | yiwen-luo/LeetCode | Python/first-unique-character-in-a-string.py | Python | mit | 770 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Script to plot density of states (DOS) generated by an FEFF run
either by site, element, or orbital
"""
from __future__ import division
__author__ = "Alan Dozier"
__credits__= "Anub... | Bismarrck/pymatgen | scripts/feff_plot_dos.py | Python | mit | 2,040 |
#!/usr/bin/env python
"""
Tests job_stories()
@author avinash sajjanshetty
@email hi@avi.im
"""
import unittest
from hackernews import HackerNews
class TestjobStories(unittest.TestCase):
def setUp(self):
self.hn = HackerNews()
def test_job_stories(self):
job_stories = self.hn.job_stories... | TheSriram/haxor | tests/test_job_stories.py | Python | mit | 463 |
"""
CRISPR_db_parser
Madeleine Bonsma
March 7, 2015
Updated May 3, 2016
This script takes a list of spacers downloaded from the CRISPRdb
website and splits them into individual files, one file per organism.
Result files are saved in "data/spacers".
"""
import linecache
import os
# CRISPR db parser
# MB Mar 07 2015
... | goyalsid/phageParser | parserscripts/crispr_db_parser.py | Python | mit | 3,791 |
from sanic import Sanic
from sanic.views import CompositionView
from sanic.views import HTTPMethodView
from sanic.views import stream as stream_decorator
from sanic.blueprints import Blueprint
from sanic.response import stream, text
bp = Blueprint('blueprint_request_stream')
app = Sanic('request_stream')
class Simpl... | yunstanford/sanic | examples/request_stream/server.py | Python | mit | 1,683 |
class Vendor(object):
def __init__(self):
self._vendor = None # altera, lattice, xilinx
self._model = None # vendor model
@property
def vendor(self):
return self._vendor
@vendor.setter
def vendor(self, v):
assert v.lower() in ('altera', 'lattice', 'xilinx')
... | cfelton/rhea | rhea/vendor/vendor.py | Python | mit | 351 |
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import function_node
from chainer.utils import type_check
def _check_indices(indices):
if len(indices) == 0:
return
# TODO(unno): Check indices without cpu
indices = cuda.to_cpu(indices)
for i in indices:
... | aonotas/chainer | chainer/functions/array/permutate.py | Python | mit | 4,024 |
#
# Copyright (C) 2013 Andrian Nord. See Copyright Notice in main.py
#
import ljd.ast.nodes as nodes
import ljd.ast.traverse as traverse
class TypeRestriction():
def __init__(self, default, specific):
if isinstance(default, dict) and specific == {}:
specific = default
default = None
self.default = defaul... | jjdredd/ljd | ljd/ast/validator.py | Python | mit | 8,322 |
#!/usr/bin/python
#======================================================================
#
# Project : hpp_IOStressTest
# File : IOST_WRun_CTRL.py
# Date : Oct 25, 2016
# Author : HuuHoang Nguyen
# Contact : hhnguyen@apm.com
# : hoangnh.hpp@gmail.com
# License : MIT License
# Copyright : 2016
# ... | HPPTECH/hpp_IOSTressTest | Refer/IOST_OLD_SRC/IOST_0.17/Libs/IOST_WRun_CTRL.py | Python | mit | 2,555 |
# -*- coding: utf-8 -*-
"""
@title: El Coladero
@description: Aplicación web para detectar y corregir vulnerabilidades
@author: Enrique Martín Martín
@email: emartinm@ucm.es
"""
from bottle import run, template, get, post, request
import sqlite3
@get('/show_all_questions')
def show_all_questions():
conn = sqlite... | ferreiro/Python-NoSQL-Security | assignment6/El_Coladero/coladero.py | Python | mit | 2,952 |
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 option) any later ve... | miurahr/translate | translate/convert/ical2po.py | Python | gpl-2.0 | 4,527 |
from django.template import Context, Template
from ganeti_webmgr.muddle.shots import register, TemplateMixer
from ganeti_webmgr.muddle.shots.tests.registration import ShotsTestsBase
__all__ = ['ShotTagTests']
TEMPLATE = "<b>{% load shots %}{% shot foo %}{% endshot %}</b>"
TEMPLATE_INNER = (
"<ul>{% load shots %... | dmS0Zq/ganeti_webmgr | ganeti_webmgr/muddle/shots/tests/templatetags.py | Python | gpl-2.0 | 1,527 |
# coding: utf-8
"""
Git commits
Config example::
[tools]
type = git
apps = /home/psss/git/apps
[tests]
type = git
tests = /home/psss/git/tests/*
Note that using ``*`` you can enable multiple git repositories.
"""
import os
import re
import subprocess
from did.base import Config, ReportErro... | xersin/did | did/plugins/git.py | Python | gpl-2.0 | 4,714 |
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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
# ... | bks/veusz | veusz/utils/formatting.py | Python | gpl-2.0 | 7,914 |
keyBindings = { }
from keyids import KEYIDS
from Components.config import config
from Components.RcModel import rc_model
keyDescriptions = [{
KEYIDS["BTN_0"]: ("UP", "fp"),
KEYIDS["BTN_1"]: ("DOWN", "fp"),
KEYIDS["KEY_OK"]: ("OK", ""),
KEYIDS["KEY_UP"]: ("UP",),
KEYIDS["KEY_DOWN"]: ("DOWN",),
KEYIDS["KEY_... | opendroid-Team/enigma2-4.1 | lib/python/Tools/KeyBindings.py | Python | gpl-2.0 | 4,901 |
#! /usr/bin/python
""" Runs an OpenFOAM solver and captures the output. Extracts information
about the linear solvers (initial residual) and outputs it in a "Fluentish"
way (one line per timestep).Called:
compactOutput.py interFoam . damBreak
"""
import re,sys
from PyFoam.LogAnalysis.LogLineAnalyzer import LogLineA... | mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | examples/compactOutput.py | Python | gpl-2.0 | 1,329 |
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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 option) any later versi... | tomprince/gemrb | gemrb/GUIScripts/bg1/GUICG22.py | Python | gpl-2.0 | 3,963 |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 14:35:28 2016
@author: uwe
"""
import matplotlib.pyplot as plt
import logging
import time
import pandas as pd
import geoplot
import oemof.db
from oemof.tools import logger
plt.style.use('ggplot')
def fetch_geometries(**kwargs):
"""Reads the geometry and the id of... | oemof/reegis-hp | reegis_hp/tools/postgis2geocsv.py | Python | gpl-3.0 | 1,291 |
# coding=utf-8
"""
cmd2 table creation API
This API is built upon two core classes: Column and TableCreator
The general use case is to inherit from TableCreator to create a table class with custom formatting options.
There are already implemented and ready-to-use examples of this below TableCreator's code.
"""
import c... | etherkit/OpenBeacon2 | macos/venv/lib/python3.8/site-packages/cmd2/table_creator.py | Python | gpl-3.0 | 39,315 |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
def _makeunicodes(f):
import re
lines = iter(f.readlines())
unicodes = {}
for line in lines:
if not line: continue
num, name = line.split(';')[:2]
if name[0] == '<': continue # "<control>", etc.
num = int(num... | MitchTalmadge/Emoji-Tools | src/main/resources/PythonScripts/fontTools/unicode.py | Python | gpl-3.0 | 1,057 |
# 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 t... | ctrlaltdel/neutrinator | vendor/openstack/tests/functional/cloud/test_volume_backup.py | Python | gpl-3.0 | 3,281 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 option) any later version.
#
# This program is distrib... | taxpon/sverchok | old_nodes/matrix_in.py | Python | gpl-3.0 | 2,720 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'boardOptions.ui'
#
# Created: Fri Oct 4 12:27:03 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from commons.i18n import *
try:
_fromUtf8 = QtCore... | mateoqac/unqTip | gui/views/boardOption.py | Python | gpl-3.0 | 3,726 |
#
# Copyright (C) 2007-2008 by Async Open Source
#
# 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
# of the License, or (at your option) any later version.
#
# This progr... | fboender/miniorganizer | src/lib/kiwi/ui/listdialog.py | Python | gpl-3.0 | 14,071 |
import newrelic.agent
from treeherder.etl.classification_mirroring import ElasticsearchDocRequest
from treeherder.workers.task import retryable_task
@retryable_task(name="submit-elasticsearch-doc", max_retries=10, soft_time_limit=30)
def submit_elasticsearch_doc(project, job_id, bug_id, classification_timestamp, who... | tojonmz/treeherder | treeherder/etl/tasks/classification_mirroring_tasks.py | Python | mpl-2.0 | 809 |
from . import mis_spn_event_info
| eicher31/compassion-switzerland | mis_builder_spn_event_info/models/__init__.py | Python | agpl-3.0 | 33 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2015 Eezee-It, MONK Software, Vauxoo
# Copyright 2013 Camptocamp
# Copyright 2009-2013 Akretion,
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau,
# Benoît Guillot, Joel Gra... | ddico/rma | crm_claim_rma/models/account_invoice.py | Python | agpl-3.0 | 3,786 |
#!/usr/bin/python2.7
# -*- encoding=utf-8 -*-
from argparse import ArgumentParser, RawTextHelpFormatter
import codecs
import gevent
from gevent import monkey
import json
from types import UnicodeType
from crawlers import Crawler
from crawlers.local.static import get_election_type_name
from utils import check_dir
def... | teampopong/crawlers | election_commission/main.py | Python | agpl-3.0 | 4,602 |
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Student'),
'fieldname': 'student',
'non_standard_fieldnames': {
'Bank Account': 'party'
},
'transactions': [
{
'label': _('Admissio... | gsnbng/erpnext | erpnext/education/doctype/student/student_dashboard.py | Python | agpl-3.0 | 845 |
"""
Order module has been split for its complexity.
Proposed clean hierarchy for GASSupplierOrder that
can be used in many contexts such as:
DES: ChooseSupplier ChooseGAS ChooseReferrer
GAS: ChooseSupplier OneGAS ChooseReferrer
Supplier: OneSupplier ChooseGAS ChooseR... | befair/gasistafelice | gasistafelice/gf/gas/forms/order/__init__.py | Python | agpl-3.0 | 5,005 |
"""
URLs for LMS
"""
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.views.generic.base import RedirectView
from ratelimitbackend import admin
from django.conf.urls.static import static
import django.contrib.auth.views
from microsite_configuration import microsite
impo... | ovnicraft/edx-platform | lms/urls.py | Python | agpl-3.0 | 33,307 |
""":mod:`earthreader.web.exceptions` --- Exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from flask import jsonify
from werkzeug.exceptions import HTTPException
class IteratorNotFound(ValueError):
"""Raised when the iterator does not exist"""
class JsonException(HTTPException):
"""Base e... | earthreader/web | earthreader/web/exceptions.py | Python | agpl-3.0 | 1,387 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import os
im... | sivakuna-aap/superdesk-core | superdesk/celery_task_utils.py | Python | agpl-3.0 | 3,230 |
import unittest
from PySide2.QtCore import QObject, Signal
o = QObject()
class MyObject(QObject):
s = Signal(int)
class CheckSignalType(unittest.TestCase):
def testSignal(self):
self.assertTrue(isinstance(QObject.destroyed, Signal))
self.assertEqual(type(QObject.destroyed), Signal)
se... | BadSingleton/pyside2 | tests/QtCore/bug_931.py | Python | lgpl-2.1 | 648 |
# 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 Xrefresh(AutotoolsPackage, XorgPackage):
"""xrefresh - refresh all or part of an X screen.... | rspavel/spack | var/spack/repos/builtin/packages/xrefresh/package.py | Python | lgpl-2.1 | 696 |
# 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 PyTapPy(PythonPackage):
"""Python TAP interface module for unit tests"""
homepage = "... | iulian787/spack | var/spack/repos/builtin/packages/py-tap-py/package.py | Python | lgpl-2.1 | 1,128 |
# 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... | Laurawly/tvm-1 | python/tvm/topi/gpu/conv2d_nhwc.py | Python | apache-2.0 | 5,436 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice... | AlexCatarino/Lean | Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py | Python | apache-2.0 | 3,291 |
# Lint as: python2, python3
# 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
#
... | mlperf/training_results_v0.7 | Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-16/lingvo/tasks/mt/model.py | Python | apache-2.0 | 16,381 |
from flask import render_template, g, request, abort
from flask import Blueprint
from sparkprs.models import User
admin = Blueprint('admin', __name__)
@admin.route("/add-role", methods=['POST'])
def add_role():
if not g.user or "admin" not in g.user.roles:
return abort(403)
user = User.query(User.g... | d3borah/spark-pr-dashboard | sparkprs/controllers/admin.py | Python | apache-2.0 | 798 |
# Copyright 2014-2018 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 applicable law or agreed to in w... | setrofim/workload-automation | wa/workloads/pcmark/__init__.py | Python | apache-2.0 | 4,433 |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright 2016, Marcos Salomão.
#
# 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... | salomax/livremarketplace | app_test/supplier_test.py | Python | apache-2.0 | 5,758 |
# 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
# not use this file except in compliance with the... | CiscoSystems/avos | openstack_dashboard/dashboards/identity/users/tests.py | Python | apache-2.0 | 26,197 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-----------------------------------------------------------------------------
"""IETF RFC 2046 Language Tag Specification unit test suite."""
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0'
__copyright__ = """Copyright 2011 Lance Finn Helsten (helsten@acm.org)"""
... | sietse/pyietflib | TestSuite/rfc2045TestSuite/__init__.py | Python | apache-2.0 | 1,363 |
# 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... | mavenlin/tensorflow | tensorflow/python/layers/base.py | Python | apache-2.0 | 79,316 |
# Copyright 2011 Justin Santa Barbara
# 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 requ... | tmenjo/cinder-2015.1.0 | cinder/tests/integrated/integrated_helpers.py | Python | apache-2.0 | 4,453 |
""" Exit Status 1 is already used in the script.
Zdd returns with exit status 1 when app is not force
deleted either through argument or through prompt.
Exit Status 2 is used for Unknown Exceptions.
"""
class InvalidArgException(Exception):
""" This exception indicates invalid combination of arguments... | matt-deboer/marathon-lb | zdd_exceptions.py | Python | apache-2.0 | 2,721 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for Keychain password database parser."""
import unittest
from plaso.formatters import mac_keychain as _ # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import mac_keychain
from tests.parsers import t... | ostree/plaso | tests/parsers/mac_keychain.py | Python | apache-2.0 | 3,604 |
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.
#
# Author: Kiall Mac Innes <kiall@hp.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.... | richm/designate | designate/tests/test_agent/__init__.py | Python | apache-2.0 | 749 |
#
# Brian Tanner took this agent from the rl-competition code at http://rl-competition.googlecode.com/
#
# Copyright (C) 2007, Mark Lee
#
# 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... | chaostrigger/rl-library | projects/agents/randomAgentPython/src/RandomAgent.py | Python | apache-2.0 | 2,498 |
# Copyright 2019 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... | davidzchen/tensorflow | tensorflow/compiler/tests/tridiagonal_solve_ops_test.py | Python | apache-2.0 | 18,238 |
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
import os
import sys
tests_require = []
if sys.version < '2.7':
tests_require.append('unittest2')
uclmodule = Extension(
'ucl',
libraries = ['ucl'],
sources = ['src/uclmodule.c'],
... | fichtner/libucl | python/setup.py | Python | bsd-2-clause | 1,142 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | georgecpr/openthread | tests/scripts/thread-cert/Cert_9_2_13_EnergyScan.py | Python | bsd-3-clause | 4,676 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | LeZhang2016/openthread | tests/scripts/thread-cert/Cert_9_2_18_RollBackActiveTimestamp.py | Python | bsd-3-clause | 6,936 |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: January 14, 2004
# Author: Francesc Alted - faltet@pytables.com
#
# $Id$
#
########################################################################
"""Here is defined the UnImplemented class."... | dotsdl/PyTables | tables/unimplemented.py | Python | bsd-3-clause | 5,459 |
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.storage import default_storage as default_messages_storage
from django.db import connection
from django.test import RequestFactory
from django.test.utils import CaptureQuer... | mozilla/addons-server | src/olympia/users/tests/test_admin.py | Python | bsd-3-clause | 38,889 |
# Copyright (c) 2014 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.
import unittest
import StringIO
from tvcm import generate
from tvcm import fake_fs
from tvcm import project as project_module
from tvcm import resource_l... | sgraham/nope | third_party/trace-viewer/third_party/tvcm/tvcm/generate_unittest.py | Python | bsd-3-clause | 1,841 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for c in orm['issues.IssueComment'].objects.all():
if c.issue.is_closed:
c.meeting = c.issue... | nonZero/OpenCommunity | src/issues/south_migrations/0008_upgrade_issue_comments.py | Python | bsd-3-clause | 16,348 |
'''functions to work with contrasts for multiple tests
contrast matrices for comparing all pairs, all levels to reference level, ...
extension to 2-way groups in progress
TwoWay: class for bringing two-way analysis together and try out
various helper functions
Idea for second part
- get all transformation matrices ... | yarikoptic/pystatsmodels | statsmodels/sandbox/stats/contrast_tools.py | Python | bsd-3-clause | 28,737 |
import re
import zlib
from django.conf import settings
from django.core import exceptions
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.six.moves import filter
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import pge... | sonofatailor/django-oscar | src/oscar/apps/address/abstract_models.py | Python | bsd-3-clause | 21,058 |
from datetime import datetime, timedelta
from celery.schedules import crontab
from celery.task.base import periodic_task
from django.core.mail import mail_admins
from django.core.urlresolvers import reverse
from django.db.models.aggregates import Count
from django.template.loader import render_to_string
from dimagi.uti... | puttarajubr/commcare-hq | corehq/apps/hqpillow_retry/tasks.py | Python | bsd-3-clause | 1,845 |
##########################################################################
#
# Copyright (c) 2012-2014, Image Engine Design 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:
#
# * Redi... | GafferHQ/gaffer | python/GafferUI/MenuButton.py | Python | bsd-3-clause | 3,944 |