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 |
|---|---|---|---|---|---|
import os
import re
from robot import utils
from robot.utils.asserts import assert_equal
from robot.result import (ExecutionResultBuilder, Keyword, TestCase, TestSuite,
Result)
from robot.libraries.BuiltIn import BuiltIn
class NoSlotsKeyword(Keyword):
pass
class NoSlotsTestCase(TestCas... | alexandrul-ci/robotframework | atest/resources/TestCheckerLibrary.py | Python | apache-2.0 | 10,951 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
# Flask Application Key (optional)
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
# MySQL Database Settings
MYSQL_DATABASE_HOST = 'localhost'
MYSQL_DATABASE_USER = os.environ.get('MYSQL_DATABASE_USER... | hongsups/insightfl_shin | config.py | Python | mit | 985 |
# -*- coding: utf-8 -*-
from openerp.tests import common
from openerp.osv.orm import except_orm
from datetime import datetime
from . import test_util
class TestPlanning(common.TransactionCase):
def setUp(self):
super(TestPlanning, self).setUp()
# Cursor and user initialization
cr, uid =... | jeacaveo/planning_70 | tests/test_planning.py | Python | agpl-3.0 | 19,305 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
from os.path import join
import os.path
import shutil
import sys
from distutils.core import Extension
from distutils.dep_util import newer_group
from astropy_helpers.utils import import_file
from astropy_helpers import setup_helpers
from astr... | MSeifert04/astropy | astropy/wcs/setup_package.py | Python | bsd-3-clause | 9,784 |
from distutils.core import setup
setup (
name = 'gfmviewer',
version = '0.1.0',
description = 'View a Github Formatted Markdown file as formatted HTML',
scripts = [ 'gfmviewer' ],
author = 'Vrai Stacey',
author_email = 'vrai.stacey@gmail.com',
url = 'http://github.com/vrai/gfmviewer-wx',
... | vrai/gfmviewer-wx | setup.py | Python | gpl-2.0 | 953 |
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.views.decorators.csrf import csrf_exempt
from fetcher import api
import requests
import json
def index(request):
return render(request, 'fetc... | zyphrus/fetch-django | fetcher/views.py | Python | mit | 1,510 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
#
# This tool helps you to rebase package to the latest version
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# 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
# he Free Software Foundat... | hhorak/rebase-helper | rebase-helper-fedmsg-tester.py | Python | gpl-2.0 | 2,965 |
# -*- coding: utf-8 -*-
# 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... | internap/arsenal | cellar/adapters/memory_datastore.py | Python | apache-2.0 | 991 |
#!/usr/bin/env python
import codecs
from itertools import islice
from types import NoneType
from csvkit import CSVKitReader
from csvkit.sniffer import sniff_dialect as csvkit_sniff
from csvkit.typeinference import normalize_table
from django.conf import settings
from django.utils.translation import ugettext as _
fro... | datadesk/panda | panda/utils/csvdata.py | Python | mit | 3,249 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Xgbfir is a XGBoost model dump parser, which ranks features as well as
# feature interactions by different metrics.
# Copyright (c) 2016 Boris Kostenko
# https://github.com/limexp/xgbfir/
#
# Originally based on implementation by Far0n
# https://github.com/Far0n/xgbfi
fr... | limexp/xgbfir | xgbfir/main.py | Python | mit | 24,729 |
import os
from django import forms
from pontoon.base.models import (
Locale,
ProjectLocale,
User,
UserProfile
)
from pontoon.sync.formats import SUPPORTED_FORMAT_PARSERS
class NoTabStopCharField(forms.CharField):
widget = forms.TextInput(attrs={'tabindex': '-1'})
class NoTabStopFileField(forms... | participedia/pontoon | pontoon/base/forms.py | Python | bsd-3-clause | 4,967 |
import matplotlib.pyplot as plt
import cv2
def ultimate_ans(max, min):
if (max < min):
return False
else:
return True
def color_histogram(original_image_path, list):
original_image = cv2.imread(original_image_path)
color = ('b', 'g', 'r')
box_height = list[3]
box_width = list[... | NehaTelhan/CompVisionFinalProj | Submission/color_histogram.py | Python | mit | 3,376 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
BarPlot.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | drnextgis/QGIS | python/plugins/processing/algs/qgis/BarPlot.py | Python | gpl-2.0 | 3,271 |
import util
import numpy as np
import pytest
import tensorflow as tf
def test_acorr():
x = np.random.normal(0, 1, 1000)
y = util.acorr(x)
assert x.size - 1 == y.size, "unexpected autocorrelation size"
@pytest.mark.parametrize('value, desired', [
('Hello World!', False),
([1, 2, 3], True),
((... | tillahoffmann/util | tests/test_util.py | Python | mit | 757 |
import json
import os
from unittest import mock
from divvy import handle
def _api_response(api_type='api'):
fname = os.path.join(os.path.dirname(__file__),
'samples',
'sample_divvy_' + api_type + '.json')
with open(fname, 'r') as _fin:
return json.l... | stephen-hoover/alexa-chicago-bikeshare | divvy/test_handle.py | Python | mit | 4,188 |
#!/usr/bin/env python3
"""
This script searches in a mailbox directory for emails with .eml-attachments and save these attachments as new
files into another directory so sa-learn can use it for learning.
"""
import os
import sys
import email
import logging
import argparse
from uuid import uuid4
logger = logging.getLog... | sighalt/emlcollect | emlcollect.py | Python | mit | 2,969 |
'''
@name: coopReplaceMayaEnvironment.py
@repository: https://github.com/studiocoop/maya
@version: 1.0
@license: UNLICENCE
@author: Santiago Montesdeoca [artineering.io]
@summary: replaces the existing Maya.env with a template which has to
be in the same directory a... | studiocoop/maya-coop | scripts/coopReplaceMayaEnvironment.py | Python | unlicense | 2,170 |
"""Generate random sentences with an LCFRS.
Reads grammar from a text file."""
import sys
import gzip
import codecs
from collections import namedtuple, defaultdict
from array import array
from random import random
SHORTUSAGE = '''Generate random sentences with a PLCFRS or PCFG.
Reads grammar from a text file in PLCFR... | andreasvc/disco-dop | discodop/gen.py | Python | gpl-2.0 | 9,156 |
"""
WSGI config for python_blogs_bot project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJA... | drgarcia1986/pbb | pbb/wsgi.py | Python | mit | 404 |
"""
Single point Euclid Simulations (the namespaces are not well-defined, this is old code)
Aim: Single point observations for N_SN (set by the redshift distribution) supernovae from the Euclid satellite to constrain the cosmology
the errors on the photometry are taken as a normal distribution centered at the mean an... | sdhawan21/euclidIR | euclidIR/sing_pt.py | Python | mit | 4,176 |
#!/usr/bin/env python
"""
SCL; 5 July 2012.
"""
import numpy as np
from tulip.spec import GRSpec
import tulip.gridworld as gw
def specs_equal(s1, s2):
"""Return True if s1 and s2 are *roughly* syntactically equal.
This function seems to be of little or no use outside this test
module because of its frag... | pombredanne/nTLP | tests/spec_test.py | Python | bsd-3-clause | 1,411 |
# -*- coding: utf-8 -*-
'''
Created on 13.08.2015
@author: derChris
'''
import os
import re
from collections import OrderedDict
### CONSTs
_INITIAL_FILE_SCAN_DEPTH = 2
_DEFAULT_WORKPATH = 'C:\etec\classification_environment'
### REs
_NUMBER_RE = re.compile('[+-]?[0-9]+(\.[0-9]+)?([eE][+-][0-9]+)?')... | ChrisCuts/fnode | src/FileFunctions.py | Python | gpl-2.0 | 5,589 |
# ******************************************************************************
# Copyright 2019-2020 Intel 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.apa... | tensorflow/ngraph-bridge | diagnostics/remove_protobuf_class_attribute.py | Python | apache-2.0 | 4,453 |
"""Definition of factories.
NormalizerFactory
used to create magnet normalizers
"""
from ..search import PSSearch as _PSSearch
from ..search import MASearch as _MASearch
from . import util as _mutil
from . import normalizer as _norm
class NormalizerFactory:
"""Factory class for normalizer objects."""
... | lnls-sirius/dev-packages | siriuspy/siriuspy/magnet/factory.py | Python | gpl-3.0 | 1,187 |
# Copyright 2019 PerfKitBenchmarker 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 appli... | GoogleCloudPlatform/PerfKitBenchmarker | tests/providers/aws/aws_vpc_endpoint_test.py | Python | apache-2.0 | 4,139 |
"""Discovers Chromecasts on the network using mDNS/zeroconf."""
import time
from uuid import UUID
import six
from zeroconf import ServiceBrowser, Zeroconf
DISCOVER_TIMEOUT = 5
class CastListener(object):
"""Zeroconf Cast Services collection."""
def __init__(self):
self.services = {}
@property
... | am0s/pychromecast | pychromecast/discovery.py | Python | mit | 2,578 |
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | campenberger/boto | boto/rds2/exceptions.py | Python | mit | 4,507 |
#!/usr/bin/env python
# Lint as: python3
"""Tests for Notifications."""
from absl import app
from grr_response_server import cronjobs
from grr_response_server import data_store
from grr_response_server import notification
from grr_response_server.rdfvalues import objects as rdf_objects
from grr.test_lib import test_... | google/grr | grr/server/grr_response_server/notification_test.py | Python | apache-2.0 | 909 |
#!/usr/bin/env python
import SAcutout
from LCScommon import *
print clusternames
#clusternames=['Coma']
for prefix in clusternames:
xstar=[]
ystar=[]
ra=[]
dec=[]
infile='/Users/rfinn/research/LocalClusters/Images/'+prefix+'/24umWCS/'+prefix+'-WCS-mosaic_extract.tbl'
mosaic='/Users/rfinn/rese... | rfinn/LCS | paper1code/LCSmakemodelPRFs.py | Python | gpl-3.0 | 1,500 |
"""Teams view."""
import json
from auvsi_suas.models import MissionClockEvent
from auvsi_suas.models import UasTelemetry
from auvsi_suas.models import TakeoffOrLandingEvent
from auvsi_suas.views import logger
from auvsi_suas.views.decorators import require_superuser
from django.contrib.auth.models import User
from djan... | justineaster/interop | server/auvsi_suas/views/teams.py | Python | apache-2.0 | 4,320 |
def coreOptions():
options = [["testvar1", "testvar1 description", ""], ["testvar2", "testvar2 description", "testvar2 pre-set value"], ["var3", "var3 description", ""]]
return options
def core(moduleOptions):
testvar1value = moduleOptions[0][2]
testvar2value = moduleOptions[1][2]
var3value = modu... | xdavidhu/portSpider | modules/template.py | Python | mit | 490 |
import tdl
import instances
from scenes import scene
class StartLevelEvent(object):
def __init__(self):
self.type = 'StartLevel'
class IntermissionScene(scene.Scene):
def __init__(self, x=0, y=0, width=54, height=30):
super().__init__(x, y, width, height)
self.timer = 5
if... | JoshuaSkelly/lunch-break-rl | scenes/intermissionscene.py | Python | mit | 1,255 |
# -*- coding: utf-8 -*-
import httplib as http
import logging
from bs4 import BeautifulSoup
from flask import request
from framework.mongo.utils import to_mongo_key
from framework.exceptions import HTTPError
from framework.auth.utils import privacy_info_handle
from framework.auth.decorators import must_be_logged_in
... | monikagrabowska/osf.io | addons/wiki/views.py | Python | apache-2.0 | 20,751 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | ctrlaltdel/neutrinator | vendor/openstack/tests/unit/cloud/test_role_assignment.py | Python | gpl-3.0 | 143,037 |
# -*- coding: utf-8 -*-
# vim: expandtab shiftwidth=4 softtabstop=4
#
import unittest
from unittest_data_provider import data_provider
import os
import shutil
import owncloud
import datetime
import time
import tempfile
import random
import six
from config import Config
def getSupportedDavVersion():
# connect just... | blizzz/pyocclient | owncloud/test/test.py | Python | mit | 48,130 |
import sys
import os
import argparse
import misc
import folderParser
import kitutil
import pprint
def main(args):
parser = argparse.ArgumentParser(description='ScrappyDoo')
# parser.add_argument('path', nargs='?', type="string")
# parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'),defaul... | joewashear007/ScrappyDoo | scrappydoo/__main__.py | Python | mit | 1,879 |
# -*- coding: utf-8 -*-
"""
SQLpie License (MIT License)
Copyright (c) 2011-2016 André Lessa, http://sqlpie.com
See LICENSE file.
"""
import json
import sqlpie
class ServiceIndexerTests(object):
#
# Service Indexer Tests
#
def run_before_service_indexer_tests(self):
response = self.app.post... | lessaworld/SQLpie | tests/service_indexer_tests.py | Python | mit | 1,578 |
from . import generic
arch = 'S390X'
class R_390_GLOB_DAT(generic.GenericJumpslotReloc):
pass
class R_390_JMP_SLOT(generic.GenericJumpslotReloc):
pass
class R_390_RELATIVE(generic.GenericRelativeReloc):
pass
class R_390_64(generic.GenericAbsoluteAddendReloc):
pass
class R_390_TLS_TPOFF(generi... | angr/cle | cle/backends/elf/relocation/s390x.py | Python | bsd-2-clause | 475 |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import toolz
import numpy as np
import theano
import theano.tensor as T
from .. import utils
from .inits import ZeroInit
ENABLE_TEST_VALUE = theano.config.compute_test_value != "off"
VALID_TAGS = set("""
input
o... | diogo149/treeano | treeano/core/variable.py | Python | apache-2.0 | 7,794 |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | cp16net/trove | trove/tests/api/limits.py | Python | apache-2.0 | 5,509 |
#!/usr/bin/env python
print(" _\n|_|")
| ccampo133/daily-programmer | 203-easy/square.py | Python | mit | 40 |
#!/usr/bin/env python
from __future__ import print_function
import sys
import math
import cPickle
from os.path import split
from xml.sax.saxutils import escape
import svgwrite
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name
from coverage i... | meejah/cuvner | svg-histogram-coverage.py | Python | mit | 9,635 |
from random import randint
from conf_site.core.tests.test_csv_view import StaffOnlyCsvViewTestCase
from conf_site.proposals.tests.factories import ProposalFactory
from conf_site.proposals.views import ExportSubmissionsView
class ExportSubmissionsViewTestCase(StaffOnlyCsvViewTestCase):
view_class = ExportSubmissi... | pydata/conf_site | conf_site/proposals/tests/test_exporting_submissions.py | Python | mit | 875 |
__version__ = "3.2"
| stormsherpa/django-oauth2-provider | provider/__init__.py | Python | mit | 20 |
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import array
import itertools
import logging
import struct
import sys
import fontTools.ttLib.tables.TupleVariation as tv
log = logging.getLogger(__name__)
TupleVariation = tv.TupleVariation
# https://www.micr... | google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/ttLib/tables/_g_v_a_r.py | Python | apache-2.0 | 7,809 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import
import frappe
from frappe import _
import json
from frappe.core.doctype.user.user import extract_mentions
from frappe.utils import get_fullname, get_link_to_form
... | rohitwaghchaure/frappe | frappe/core/doctype/communication/comment.py | Python | mit | 4,914 |
"""Models for database"""
from datetime import datetime
from elixir import Field
from elixir import Float
from elixir import Entity
from elixir import String
from elixir import Integer
from elixir import Boolean
from elixir import DateTime
from elixir import metadata
from elixir import setup_all
from elixir import cre... | Fantomas42/veliberator | veliberator/models.py | Python | bsd-3-clause | 1,382 |
# project/tests/utils.py
import datetime
from project import db
from project.api.models import User
def add_user(username, email, password, created_at=datetime.datetime.now()):
user = User(
username=username,
email=email,
password=password,
created_at=created_at)
db.session... | MichaelE919/flask-microservices-users | project/tests/utils.py | Python | mit | 371 |
from backdoor import *
import os
import time
class Keylogger(Backdoor):
prompt = Fore.RED + "(keylogger) " + Fore.BLUE + ">> " + Fore.RESET
def __init__(self, core):
cmd.Cmd.__init__(self)
self.intro = GOOD + "Using keylogger auxiliary module"
self.core = core
self.options = {
... | krintoxi/NoobSec-Toolkit | NoobSecToolkit /scripts/sshbackdoors/backdoors/auxiliary/keylogger.py | Python | gpl-2.0 | 2,651 |
"""Internal module for Python 2 backwards compatibility."""
import errno
import sys
try:
InterruptedError = InterruptedError
except:
InterruptedError = OSError
# For Python older than 3.5, retry EINTR.
if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and
sys.version_info[... | Kazanz/redis-py | redis/_compat.py | Python | mit | 5,651 |
import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
if not test == '\n':
#Split by space, reverse and print with a space
print ' '.join(reversed(test.split()))
test_cases.close() | mailpraveens/Python-Experiments | CodeEval Challenges/reverseStringArray.py | Python | mit | 212 |
from kibitzr.transformer.plain_text import (
python_transform,
bash_transform,
)
def test_bash_transform_sample():
ok, content = bash_transform(
code="sed 's/A/B/g'",
content="ACTGA",
)
assert ok is True
assert content.strip() == "BCTGB"
def test_python_transform_sample():
... | kibitzr/kibitzr | tests/unit/transforms/test_script.py | Python | mit | 1,217 |
import unittest
import invoiced
from invoiced.test.objects.operations import (
TestEndpoint,
CreatableObject,
RetrievableObject,
UpdatableObject,
DeletableObject,
ListAll
)
class TestGlAccount(TestEndpoint, CreatableObject, RetrievableObject,
UpdatableObject, DeletableObjec... | Invoiced/invoiced-python | invoiced/test/objects/test_gl_account.py | Python | mit | 439 |
import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX='fea503dd'.decode('hex')
P2P_PORT=19994
ADDRESS_VERSION=58
RPC_PORT=9994
RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'quarkcoinaddress' in (yield bitcoind.rpc_h... | ptcrypto/p2pool-adaptive | p2pool/bitcoin/networks/quarkcoin.py | Python | gpl-3.0 | 1,231 |
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
from app.utils.user_permissions import (
all_ui_permissions,
translate_permissions_from_ui_to_db,
)
class InviteApiClient(NotifyAdminAPIClient):
def init_app(self, app):
super().init_app(app)
self.admin_url =... | alphagov/notifications-admin | app/notify_client/invite_api_client.py | Python | mit | 2,710 |
import weibull
# the current run time of the test or the
# time that the test was suspended completely
current_run_time = 4200.0
fail_times = [current_run_time] * 10
fail_times[7] = 1034.5
fail_times[8] = 2550.9
fail_times[6] = 3043.4
suspended = [True, True, True, True, True,
False, False, False, True,... | slightlynybbled/weibull | examples/weibull_fit_jog.py | Python | mit | 845 |
#!/usr/bin/python
# Copyright 2011 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 appli... | pombredanne/catawampus | tr/persist.py | Python | apache-2.0 | 3,382 |
"""The syncthru component."""
from __future__ import annotations
from datetime import timedelta
import logging
import async_timeout
from pysyncthru import SyncThru
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
fro... | kennedyshead/home-assistant | homeassistant/components/syncthru/__init__.py | Python | apache-2.0 | 3,276 |
# Copyright 2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import os
import logging
import re
# validate, , validate things, internal
from yotta.lib import validate
# Target, , represents an installed target, internal
from yotta.lib ... | ARMmbed/yotta | yotta/test_subcommand.py | Python | apache-2.0 | 7,333 |
# This script demonstrates some basic functionality of eqtools, giving basic
# inputs and the expected outputs. For a more detailed demo, refer to the online
# documentation at eqtools.readthedocs.org. For a more detailed set of tests,
# run the files test.py and unittests.py in this directory.
import eqtools
# Load ... | PSFCPlasmaTools/eqtools | tests/demo.py | Python | gpl-3.0 | 1,230 |
"""
Implementation of the directional function to construct a
directional wave spectrum, following Elfouhaily et al.
Elfouhaily T., Chapron B., and Katsaros K. (1997). "A unified
directional spectrum for long and short wind driven waves"
J. Geophys. Res. 102 15.781-96
LOG:
2011-08-26 Gordon Farquharson: Removed an ex... | pakodekker/oceansar | oceansar/spread/elfouhaily.py | Python | gpl-3.0 | 1,523 |
from gruffy.accumulator_bar import AccumulatorBar
from gruffy.area import Area
from gruffy.bar import Bar
from gruffy.bezier import Bezier
from gruffy.dot import Dot
from gruffy.line import Line
from gruffy.pie import Pie
from gruffy.sidebar import SideBar
from gruffy.stacked_area import StackedArea
from gruffy.stacked... | hhatto/gruffy | gruffy/__init__.py | Python | mit | 539 |
# 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/python/data/experimental/ops/snapshot.py | Python | apache-2.0 | 15,260 |
"""Implements basics of Capa, including class CapaModule."""
import cgi
import copy
import datetime
import hashlib
import json
import logging
import os
import traceback
import struct
import sys
import re
# We don't want to force a dependency on datadog, so make the import conditional
try:
import dogstats_wrapper a... | jamiefolsom/edx-platform | common/lib/xmodule/xmodule/capa_base.py | Python | agpl-3.0 | 62,110 |
from .order import *
from pspecs import Context
class DescribeOrder(Context):
def let_quantity(self): return 10
def let_money(self):
return Money(10, self.type)
def let_type(self):
return 'USD'
def let_order(self):
return Order(self.quantity, self.money)
class DescribeOr... | catacgc/python-specs | examples/order_spec.py | Python | mit | 1,019 |
#!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | stdweird/aquilon | tests/broker/test_update_metacluster.py | Python | apache-2.0 | 6,059 |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Optional
from pants.backend.python.goals.coverage_py import (
CoverageConfig,
... | pantsbuild/pants | src/python/pants/backend/python/goals/pytest_runner.py | Python | apache-2.0 | 14,076 |
#!/usr/bin/python3
#
# Copyright 2012 Sonya Huang
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | sonya/eea | py/wiod/parsers/un.py | Python | apache-2.0 | 2,035 |
from django.contrib.auth.models import User
from django.db import models
from core.cooggerapp.choices import REPORTS, make_choices
from .content import Content
# TODO use content_type
class ReportModel(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="reporter")
content =... | hakancelik96/coogger | core/cooggerapp/models/report.py | Python | mit | 752 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import sys
import pytest
import units.compat.unittest as unittest
from units.compat.mock import MagicMock
from units.compat.unittest import TestCase
from units.modules.utils import set_module_args
# Exoscale's cs doesn't support ... | simonwydooghe/ansible | test/units/modules/cloud/cloudstack/test_cs_traffic_type.py | Python | gpl-3.0 | 4,697 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import urllib
import xbmcgui
import xbmcplugin
import xbmcaddon
import liblrt as lrt
settings = xbmcaddon.Addon(id='plugin.video.lrt.lt')
def mediaPath(mfile):
return os.path.join( settings.getAddonInfo( 'path' ), 'resources', 'media', mfile )
thumb... | Vytax/plugin.video.lrt.lt | default.py | Python | gpl-2.0 | 11,407 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
__author__ = 'Alexei Evdokimov'
class BasicMonster:
def take_turn(self, target, game_map, entities):
results = []
monster = self.owner
if game_map.fov[monster.x, monster.y]:
if monster.distance_to(target) >= 2:
monste... | uncle-arthy/mfrl | components/ai.py | Python | mit | 551 |
# Copyright 2019 Google 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 writing,... | google/personfinder | tests/views/test_admin_create_repo.py | Python | apache-2.0 | 2,837 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2013-11-25
@author: Martin H. Bramwell
'''
import oerplib
import sys
import socket
from models.OErpModel import OErpModel
class OpenERP(object):
def __init__(self, credentials):
db = credentials['db_name']
user_id = credentials['user... | martinhbramwell/GData_OpenERP_Data_Pump | openerp_utils.py | Python | agpl-3.0 | 1,342 |
# 87. Scramble String QuestionEditorial Solution My Submissions
# Total Accepted: 53331
# Total Submissions: 192543
# Difficulty: Hard
# Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
#
# Below is one possible representation of s1 = "great":
#
# ... | shawncaojob/LC | PY/87_scramble_string.py | Python | gpl-3.0 | 4,999 |
# -*- coding: utf-8 -*-
r"""
see crl_stack.py
"""
__author__ = "Konstantin Klementiev, Roman Chernikov"
__date__ = "08 Mar 2016"
import os, sys; sys.path.append(os.path.join('..', '..', '..')) # analysis:ignore
import numpy as np
import xrt.backends.raycing as raycing
import xrt.backends.raycing.sources as rs
import... | kklmn/xrt | examples/withRaycing/04_Lenses/crl_individual_3D.py | Python | mit | 2,881 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | awni/tensorflow | tensorflow/python/summary/impl/directory_watcher_test.py | Python | apache-2.0 | 3,942 |
from django.db import models
from south.db import DEFAULT_DB_ALIAS
class MigrationHistory(models.Model):
app_name = models.CharField(max_length=255)
migration = models.CharField(max_length=255)
applied = models.DateTimeField(blank=True)
@classmethod
def for_migration(cls, migration, database):
... | esplinr/foodcheck | wsgi/foodcheck_proj/south/models.py | Python | agpl-3.0 | 1,190 |
import os
import re
import textwrap
import gzip
import bz2
import epub
from django.conf import settings
from HTMLParser import HTMLParser
from htmlentitydefs import name2codepoint
class HTMLToParagraphs(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.content = []
self._pa... | pv/mediasnake | mediasnakebooks/epubtools.py | Python | bsd-3-clause | 7,505 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provides a dummy backend."""
# Copyright (C) 2008-2010 Sebastian Heinlein <devel@glatzor.de>
#
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/sessioninstaller/backends/dummy.py | Python | mit | 2,303 |
# Copyright: (c) 2019, Ansible Project
# 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
from ansible.module_utils.six import string_types
from ansible.playbook.attribute import FieldAttr... | tonk/ansible | lib/ansible/playbook/collectionsearch.py | Python | gpl-3.0 | 2,597 |
import json
import requests
import os
from settings import global_settings
_amino_acids_json_path = os.path.join(global_settings['package_path'], 'tools', 'amino_acids.json')
with open(_amino_acids_json_path, 'r') as inf:
amino_acids_dict = json.loads(inf.read())
water_mass = 18.01528
ideal_backbone_bond_length... | woolfson-group/isambard | isambard/tools/amino_acids.py | Python | mit | 15,990 |
# ##### 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... | Microvellum/Fluid-Designer | win64-vc/2.78/scripts/modules/console_shell.py | Python | gpl-3.0 | 1,990 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
classe per la gestione dei cerchi
-------------------
begin : 2013-05-22
copyright : iiiii
... | gam17/QAD | qad_circle.py | Python | gpl-3.0 | 17,063 |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
import sys, time
from astropy.table import Table
from . import loki
def prob(sub1 = None, sub2 = None, RAs1 = None, DECs1 = None, RAs2 = None, DECs2 = None,
dists1 = None, dists2 = ... | ctheissen/LoKi | loki/binary_probability.py | Python | mit | 14,320 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | ksrajkumar/openerp-6.1 | openerp/addons/itara_multi_payment/wizard/__init__.py | Python | agpl-3.0 | 1,076 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | nishad89/newfies-dialer | newfies/dnc/admin.py | Python | mpl-2.0 | 1,320 |
#! /usr/bin/python
# This file is part of tcollector.
# Copyright (C) 2013 The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (... | weiwangblog/tcollector | collectors/0/g1gc.py | Python | lgpl-3.0 | 21,652 |
import logging
import voluptuous as v
import yaml
log = logging.getLogger(__name__)
class ConfigValidator(object):
def __init__(self, config_file):
self.config_file = config_file
def validate(self):
cron = {
'check': str,
}
emails = {
'mail': str,
... | arxcruz/tempest-tool | tempestmail/cmd/config_validator.py | Python | gpl-3.0 | 1,016 |
# Copyright 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.
import unittest
from telemetry import test
from telemetry.core.platform import android_platform_backend
from telemetry.unittest import system_stub
class M... | boundarydevices/android_external_chromium_org | tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py | Python | bsd-3-clause | 2,291 |
from redwind.plugins import wm_receiver
from redwind import util
import pytest
from testutil import FakeResponse, FakeUrlOpen
from flask.ext.login import current_user
from flask import current_app
HEADERS = {'User-Agent': util.USER_AGENT}
TIMEOUT = 30
@pytest.fixture
def target_url(client, auth, mocker):
mocke... | Lancey6/redwind | tests/wm_receiver_test.py | Python | bsd-2-clause | 3,523 |
# Copyright 2013-2021 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 PerlInline(PerlPackage):
"""Write Perl Subroutines in Other Programming Languages"""
... | LLNL/spack | var/spack/repos/builtin/packages/perl-inline/package.py | Python | lgpl-2.1 | 603 |
"""line chart visualization."""
from apps.managers.team_mgr.models import Team
def supply(request, page_name):
""" Handle the request for viz_chart widget."""
_ = page_name
_ = request
all_lounges = Team.objects.order_by('name').all()
return {
"all_lounges": all_lounges,
}
| justintweaver/mtchi-cert-game | makahiki/apps/widgets/viz_chart/views.py | Python | gpl-3.0 | 317 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import urlparse
import random
import calendar
import datetime
import textwrap
import cgi
from py31compat.functools import lru_cache
import cherrypy
import pkg_resources
import jinja2.loaders
import pytz
from jaraco.util.numbers import ordinalth as th_i... | jamwt/diesel-pmxbot | pmxbot/web/viewer.py | Python | bsd-3-clause | 8,851 |
#
# Copyright 2015 LinkedIn Corp. 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 ... | sarathsreedharan/simoorg | src/simoorg/plugins/healthcheck/__init__.py | Python | apache-2.0 | 542 |
from typing import Callable, Type
import astroid
import nose
from hypothesis import settings, HealthCheck
import tests.custom_hypothesis_support as cs
settings.load_profile("pyta")
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_builtin_function_name():
"""Test looking up the builtin function `bi... | RyanDJLee/pyta | tests/test_type_inference/test_name.py | Python | gpl-3.0 | 811 |
"""
Django settings for django_ecommerce2 project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
im... | loafbaker/django_ecommerce2 | django_ecommerce2/settings.py | Python | mit | 5,333 |
#Voltage_and_current_limits
VOLTAGE = 210
CURRENT = 0.1050
| benalcazardiego/RFCV | v_2.0/lib/util/limits.py | Python | mit | 59 |
"""Train information for departures and delays, provided by Trafikverket."""
from datetime import date, datetime, timedelta
import logging
from pytrafikverket import TrafikverketTrain
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity,
... | home-assistant/home-assistant | homeassistant/components/trafikverket_train/sensor.py | Python | apache-2.0 | 7,567 |
# Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | martbhell/wasthereannhlgamelastnight | src/lib/google/api_core/datetime_helpers.py | Python | mit | 8,995 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.