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 |
|---|---|---|---|---|---|
#
# 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 us... | goldmedal/spark | python/pyspark/taskcontext.py | Python | apache-2.0 | 9,096 |
"""Common utilities for Numba operations with groupby ops"""
from __future__ import annotations
import inspect
from typing import (
Any,
Callable,
)
import numpy as np
from pandas._typing import Scalar
from pandas.compat._optional import import_optional_dependency
from pandas.core.util.numba_ import (
N... | rs2/pandas | pandas/core/groupby/numba_.py | Python | bsd-3-clause | 5,041 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################
#
# ChriCar Beteiligungs- und Beratungs- GmbH
# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH
# all rights reserved
# created 2009-07-11 14:55:52+02
#
# WARNING: This program as such is intended t... | VitalPet/c2c-rd-addons | chricar_invoice/invoice.py | Python | agpl-3.0 | 2,957 |
from raptiformica.shell.cjdns import get_public_key
from tests.testcase import TestCase
class TestGetPublicKey(TestCase):
def setUp(self):
self.log = self.set_up_patch('raptiformica.shell.cjdns.log')
self.get_cjdns_config_item = self.set_up_patch(
'raptiformica.shell.cjdns.get_cjdns_co... | vdloo/raptiformica | tests/unit/raptiformica/shell/cjdns/test_get_public_key.py | Python | mit | 914 |
import unittest
from datetime import date
from binder.col import *
from binder.table import Table, SqlCondition, SqlSort, AND, OR
from bindertest.tabledefs import Foo, Bar
class TableTest(unittest.TestCase):
def test_init_2_AutoIdCols(self):
# Table can have only 1 AutoIdCol
try:
T... | divtxt/binder | bindertest/test_table.py | Python | mit | 9,815 |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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
# to use, copy, modify, merge, publ... | sidzan/netforce | netforce_hr/netforce_hr/models/hr_leave.py | Python | mit | 14,654 |
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
# to know the os
import platform
import os
from ui_dialogBase import Ui_GdalToolsDialog as Ui_Dialog
import GdalTools_utils as Utils
import os, platform
class GdalToolsBaseDialog(QDialog, Ui_D... | sourcepole/qgis | qgis/python/plugins/GdalTools/tools/dialogBase.py | Python | gpl-2.0 | 7,068 |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Fix missing context
Revision ID: e81da7a55e7
Revises: 1a4241cfd4cd
Create Date: 2015-09-15 13:41:34.878664
"""
# revision identifiers, used by Alembic.
revision = 'e81da7a55e7'
down_revision = '1a4241... | kr41/ggrc-core | src/ggrc_workflows/migrations/versions/20150915134134_e81da7a55e7_fix_missing_context.py | Python | apache-2.0 | 933 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from abc import ABCMeta
from collections import MutableMapping
import sys
try:
from collections import UserDict
except ... | noam09/kodi | script.module.israeliveresolver/lib/livestreamer/plugin/api/singledispatch_helpers.py | Python | gpl-3.0 | 5,404 |
from __future__ import print_function
import sys
import os
import IMP
import IMP.em
import IMP.test
import IMP.core
import IMP.atom
class Tests(IMP.test.TestCase):
"""Class to test EM correlation restraint"""
def sample_density_map(self):
self.scene = IMP.em.particles2density(IMP.core.get_leaves(sel... | shanot/imp | modules/em/test/test_spacing.py | Python | gpl-3.0 | 2,079 |
# -*- coding: utf-8 -*-
import sys
import os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
sys.path.append(os.path.join(os.pardir, "tests"))
import kombu
# General configuration
# -----... | mzdaniel/oh-mainline | vendor/packages/kombu/docs/conf.py | Python | agpl-3.0 | 2,038 |
#
# Copyright (c) 2016 SnappyData, 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... | vjr/snappydata | python/pyspark/sql/snappy/context.py | Python | apache-2.0 | 6,651 |
import abc
from .resource import Resource
class AbstractNameDescriptionResource(Resource):
__metaclass__ = abc.ABCMeta
def __init__(self, name=None, description=None, **kwargs):
self.name = name
self.description = description
super().__init__(**kwargs)
def parse_from_json_object(... | bitmovin/bitmovin-python | bitmovin/resources/abstract_name_description_resource.py | Python | unlicense | 376 |
from django.contrib import admin
from django.utils.translation import ugettext as _
from reversion.admin import VersionAdmin
from django_project.models import Component
from django_project.models import Membership
from django_project.models import Milestone
from django_project.models import Priority
from django_proje... | peragro/django-project | django_project/admin.py | Python | bsd-3-clause | 3,243 |
from django.contrib import admin
from django.http import HttpResponse
from adminsortable.admin import SortableTabularInline, NonSortableParentAdmin
from cmsplugin_contact_plus.models import ExtraField, ContactPlus, ContactRecord
from .actions import export_as_csv_action
class ExtraFieldInline(SortableTabularInline):... | arteria/cmsplugin-contact-plus | cmsplugin_contact_plus/admin.py | Python | bsd-3-clause | 1,077 |
# -*- coding: utf-8 -*-
import hashlib
import json
import os
import shutil
import tempfile
import zipfile
from datetime import datetime
from django import forms
from django.core.files.storage import default_storage as storage
from django.conf import settings
from django.test.utils import override_settings
import mock... | mdaif/olympia | apps/files/tests/test_models.py | Python | bsd-3-clause | 46,740 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA 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 versi... | markovmodel/PyEMMA | pyemma/coordinates/tests/test_fragmented_trajectory.py | Python | lgpl-3.0 | 10,158 |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... | twitter/heron | heron/tools/tracker/src/python/constants.py | Python | apache-2.0 | 2,717 |
import io
from pathod import log
from mitmproxy import exceptions
class DummyIO(io.StringIO):
def start_log(self, *args, **kwargs):
pass
def get_log(self, *args, **kwargs):
return ""
def test_disconnect():
outf = DummyIO()
rw = DummyIO()
l = log.ConnectionLogger(outf, False, T... | mosajjal/mitmproxy | test/pathod/test_log.py | Python | mit | 480 |
# coding:utf-8
from base import TestBase
class TestMarkdownPreview(TestBase):
"""Test for attributes \'markdown_preview\'"""
# for debug
# def tearDown(self):
# pass
markdown_preview_text = """
<!-- MarkdownTOC autolink=true uri_encoding=false {0} -->
<!-- /MarkdownTOC -->
# Hello 世界 Worl... | naokazuterada/MarkdownTOC | tests/markdown_preview.py | Python | mit | 4,416 |
# -*- coding: utf-8 -*-
'''
This module provides a collection of concurrency related
object generators. These generators will create either
native threading based or greenlet based objects depending
on which threading_model is selected.
'''
from bsonrpc.options import ThreadingModel
__license__ = 'http://mozilla.org/M... | seprich/py-bson-rpc | bsonrpc/concurrent.py | Python | mpl-2.0 | 2,990 |
# -*- coding: utf-8 -*-
#
# 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
#... | owlabs/incubator-airflow | tests/contrib/hooks/test_aws_sns_hook.py | Python | apache-2.0 | 2,636 |
# Compare integers using if structures, relational operators
print("Enter two integers, and I will tell you")
print("the relationschips they satisfy.")
number1 = input("Please enter first integer: ")
number1 = int(number1)
number2 = input("Please enter second integer: ")
number2 = int(number2)
if number1 == number2... | r-castro/Python | fig_02_22.py | Python | gpl-3.0 | 790 |
#~ BSD 3-Clause License (Revised)
#~
#~ Copyright 2015 Timothy C Eichler (c) , 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 co... | timeyyy/tttt | tttt/demo.py | Python | bsd-3-clause | 12,737 |
import io
import os
import sys
import pickle
import subprocess
import unittest
from unittest.case import _Outcome
from unittest.test.support import (LoggingResult,
ResultWithNoStartTestRunStopTestRun)
class TestCleanUp(unittest.TestCase):
def testCleanUp(self):
class ... | michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/unittest/test/test_runner.py | Python | gpl-2.0 | 11,704 |
import urllib2
import json
url = 'http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json'
if __name__ == "__main__":
pullUrl = urllib2.Request(url)
openIt = urllib2.build_opener()
f = openIt.open(pullUrl)
jsong = json.load(f)
topVidList = []
for item in jsong['feed']['entry'... | gravyboat/json_youtube | json_youtube27.py | Python | mit | 403 |
# Generated by Django 3.2.4 on 2021-08-12 07:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("georegion", "0009_auto_20190325_2040"),
]
operations = [
migrations.AddField(
model_name="georegion",
name="data",
... | fin/froide | froide/georegion/migrations/0010_georegion_data.py | Python | mit | 386 |
# Copyright (C) 2020 FUJITSU
# 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 a... | openstack/tacker | tacker/tests/functional/sol_kubernetes/vnflcm/test_kubernetes.py | Python | apache-2.0 | 14,203 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
extract_attributes,
ExtractorError,
urlencode_postdata,
urljoin,
)
class AnimeOnDemandIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?... | oskar456/youtube-dl | youtube_dl/extractor/animeondemand.py | Python | unlicense | 12,225 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.education.doctype.student.test_student import create_student
from erpnext.education.doctype.student.test_student import get_student
from erpnext.ed... | Zlash65/erpnext | erpnext/education/doctype/program_enrollment/test_program_enrollment.py | Python | gpl-3.0 | 1,137 |
#!/usr/bin/python
import sys, os
class LibraryBuilder:
rules = "'canvas : texbuilder SRC_FOLDER OUTPUT_FILENAME'"
def __init__(self,dir):
self.dir = dir + "/"
self.content = ""
def assemble(self, out):
self.content = self.concat()
self.write_result(out)
def concat(self):
buffer = ""
for f i... | aureooms-ulb-2010-2015/2013-2014-infof403-project | 2/doc/report/texbuilder.py | Python | agpl-3.0 | 1,474 |
from django.contrib.auth.models import User
from django.db import models
from django.utils.timesince import timeuntil
class DNSProvider(models.Model):
name = models.CharField(max_length=50)
url = models.URLField('URL', blank=True, \
help_text="Web address of the provider's DNS control panel")
comme... | joncombe/django-webmaster | webmaster/models.py | Python | bsd-3-clause | 6,089 |
"""Define the :class:`~geographiclib.geodesicline.GeodesicLine` class
The constructor defines the starting point of the line. Points on the
line are given by
* :meth:`~geographiclib.geodesicline.GeodesicLine.Position` position
given in terms of distance
* :meth:`~geographiclib.geodesicline.GeodesicLine.ArcPo... | planetmarshall/GeographicLib | python/geographiclib/geodesicline.py | Python | mit | 18,422 |
# Copyright 2012 OpenStack Foundation
# 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... | huntxu/neutron | neutron/tests/unit/agent/linux/test_dhcp.py | Python | apache-2.0 | 126,880 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | SeleniumHQ/selenium | py/selenium/webdriver/common/actions/wheel_actions.py | Python | apache-2.0 | 1,320 |
#!/usr/bin/env python3
from typediff.server import app
if __name__ == "__main__":
app.run(port=5050, host='0.0.0.0')
| ned2/typediff | bin/dev.py | Python | mit | 124 |
"""Python interface to GenoLogics LIMS via its REST API.
LIMS interface.
Per Kraulis, Science for Life Laboratory, Stockholm, Sweden.
Copyright (C) 2012 Per Kraulis
"""
__all__ = ['Lab', 'Researcher', 'Project', 'Sample',
'Containertype', 'Container', 'Processtype', 'Process',
'Artifact', 'Lims... | SciLifeLab/genologics | genologics/lims.py | Python | mit | 29,765 |
#!/usr/bin/env python
"""A performance example comparing the BER encoding and decoding
performance of five ASN.1 Python packages.
This file is based on
https://gist.github.com/philmayers/67b9300d8fb7282481a1a6af5ed45818.
Example execution:
$ ./ber.py
Starting encoding and decoding of a message 3000 times. This may ... | eerimoq/asn1tools | examples/benchmarks/packages/ber.py | Python | mit | 11,687 |
from ._abstract import AbstractScraper
class NourishedByNutrition(AbstractScraper):
@classmethod
def host(cls):
return "nourishedbynutrition.com"
def title(self):
return self.schema.title()
def total_time(self):
return self.schema.total_time()
def yields(self):
r... | hhursev/recipe-scraper | recipe_scrapers/nourishedbynutrition.py | Python | mit | 605 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | areitz/pants | src/python/pants/base/build_file.py | Python | apache-2.0 | 11,256 |
###############################################################################
# #
# 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 #
... | Ecogenomics/GtdbTk | gtdbtk/external/hmm_aligner.py | Python | gpl-3.0 | 13,858 |
# Yum plugin to re-patch container rootfs after a yum update is done
#
# Copyright (C) 2012 Oracle
#
# Authors:
# Dwight Engen <dwight.engen@oracle.com>
#
# 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 Fou... | czchen/debian-lxc | config/yum/lxc-patch.py | Python | lgpl-2.1 | 1,850 |
# coding=utf-8
# Copyright 2017 Christopher Bartz <bartz@dkrz.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | cbartz/git-lfs-swift-server | git_lfs_swift_server/__init__.py | Python | apache-2.0 | 637 |
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Example using MouseMan protocol with the SerialPort transport.
"""
# TODO set tty modes, etc.
# This works for me:
# speed 1200 baud; rows 0; columns 0; line = 0;
# intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D... | EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/docs/core/examples/mouse.py | Python | mit | 2,435 |
# This file is distributed under the terms of the GNU General Public license.
# Copyright (C) 2011 Jekin Trivedi <jekintrivedi@gmail.com> (See the file COPYING for details).
from atlas import *
from physics import *
#
# class Destroying(server.Task):
# """A very simple Destroy system for destroying structures."""... | worldforge/cyphesis | data/rulesets/deeds/scripts/world/tasks/Destroying.py | Python | gpl-2.0 | 3,442 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version'... | Tatsh-ansible/ansible | lib/ansible/modules/messaging/rabbitmq_parameter.py | Python | gpl-3.0 | 4,458 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='songs',... | msluis/stage-assistant | server/src/api/migrations/0002_auto_20150427_0820.py | Python | mit | 523 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | luotao1/Paddle | python/paddle/text/datasets/imdb.py | Python | apache-2.0 | 4,903 |
""":mod:`GiantOmelette` -- Contains the GiantOmelette class
.. module:: GiantOmelette
:synopsis: Contains the GiantOmelette class
.. moduleauthor:: Joshua Gilman <joshuagilman@gmail.com>
"""
from neolib.daily.Daily import Daily
from neolib.exceptions import dailyAlreadyDone
from neolib.exceptions import parseExcep... | jmgilman/Neolib | neolib/daily/GiantOmelette.py | Python | mit | 1,657 |
from flask import url_for
def test_home(client):
assert client.get(url_for('home')).status_code == 200
def test_payg(client):
assert client.get(url_for('payg')).status_code == 200
def test_links(client):
assert client.get(url_for('links')).status_code == 200
def test_shopping(client):
assert cli... | petef4/payg | test_flask_app.py | Python | mit | 536 |
"""
Testing PLN inference on socrates-r2l.scm input
"""
from opencog.cogserver import MindAgent
from opencog.atomspace import types
from pln.chainers import Chainer
from pln.rules import *
__author__ = 'Cosmo Harrigan'
class SocratesAgent(MindAgent):
def __init__(self):
self.chainer = None
def cre... | printedheart/opencog | opencog/python/pln_old/examples/socrates_demo/socrates_agent.py | Python | agpl-3.0 | 1,285 |
import unittest2
from google.appengine.api import taskqueue
from google.appengine.ext import testbed
from models.notifications.requests.request import Request
from tests.mocks.notifications.mock_notification import MockNotification
class TestRequest(unittest2.TestCase):
def setUp(self):
self.testbed =... | fangeugene/the-blue-alliance | tests/models_tests/notifications/requests/test_request.py | Python | mit | 1,196 |
import unittest
from flask.ext.testing import TestCase # , Twill
from quokka import create_app
from quokka.core.admin import create_admin
class BasicTestCase(TestCase):
def setUp(self):
self.db = self.app.extensions.get('mongoengine')
from quokka.utils.populate import Populate
Populate(s... | laborautonomo/quokka | quokka/tests/test_basic.py | Python | mit | 2,449 |
# Ceres Solver - A fast non-linear least squares minimizer
# Copyright 2010, 2011, 2012, 2013 Google Inc. All rights reserved.
# http://code.google.com/p/ceres-solver/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#... | Nazg-Gul/libmv | src/third_party/ceres/internal/ceres/generate_eliminator_specialization.py | Python | mit | 8,224 |
import sys
import os
import networkx
import nose.tools
import angr
from angr.analyses.cdg import TemporaryNode
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
def test_graph_0():
# This graph comes from Fig.1 of paper An Efficient Method of Computing Stat... | haylesr/angr | tests/test_cdg.py | Python | bsd-2-clause | 4,455 |
import time
import subprocess
import threading
import os
import signal
import shutil
import sys
class Command(object):
status = None
output = stderr = ''
def __init__(self, cmdline):
self.cmd = cmdline
self.process = None
def run(self, timeout):
def target():
# Th... | lamthientruc/vac | old_scripts/singletest.py | Python | bsd-2-clause | 7,241 |
# File name: comiccreator.py
import kivy
kivy.require('1.9.0')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager
Builder.load_file('toolbox.kv')
Builder.load_file('comicwidgets.kv')
Builder.load_file('drawingspace.kv')
Builder.load_file('generaloptions.kv')
Builder... | pimier15/PyGUI | Kivy/Kivy/Bk_Interractive/sample/Chapter_04_code/python3/08 - Behaviours - enhancing widget functionality/comiccreator.py | Python | mit | 587 |
from util.args import ms_argparser
import re
def ms_main(args):
parser = ms_argparser(description = 'hex transform.')
parser.add_argument('file', help = 'file with hex string to process.')
args = parser.parse_args(args)
if args['file'] == None:
print('No file specifed!')
return
fp = open(args['file'])
fb = fp... | Viclis/misc-solve | scripts/crypto/hex.py | Python | gpl-3.0 | 603 |
# coding=utf-8
"""Smoke tests for the ``UI`` end-to-end scenario.
:Requirement: Ui endtoend
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string, gen_ipaddr
from robottelo import manifests
from robot... | elyezer/robottelo | tests/foreman/endtoend/test_ui_endtoend.py | Python | gpl-3.0 | 17,638 |
from cx_Freeze import setup, Executable
setup(
name='DigitalOceanCLI',
version="0.1",
author="Yusuf Tuğrul Kocaman",
author_email="ytugrultr@gmail.com",
description="DigitalOcean Command Line Interface",
executables= [Executable(base="Console", script="digitaloceancli.py"
... | TheLady/digitaloceancli.py | setup.py | Python | gpl-3.0 | 444 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PGW
~~~~~~
Payment gateways VNF with RESTful API.
:copyright: (c) 2015 by Anton K. Komarov.
:license: MIT, see LICENSE for more details.
"""
import os
import sqlite3
from flask import Flask, g, abort, jsonify
from flask.ext.restful import Api, Resource, reqparse, fi... | ramelito/pgw | pgw.py | Python | mit | 6,070 |
# -*- coding: utf-8 -*-
'''
Created on Mar 12, 2012
@author: moloch
Copyright 2012 Root the Box
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/licen... | Richard-West/RootTheBox | tests/HTTPClient.py | Python | apache-2.0 | 3,515 |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^$', 'blog.views.home_view', name='home'),
url(r'^post/(?P<pk>[0-9]+)/$', 'blog.views.post_view', name='post'),
... | riklaunim/django-examples | pozytywnie_facebook/facebook_project/urls.py | Python | mit | 671 |
# -*- coding: utf-8 -*-
# TODO: this is just stuff from utils.py - should be splitted / moved
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.utils.functional import LazyObject
from cms import constants
from cms.utils.conf import get_cms_setting
from cms.utils.conf i... | DylannCordel/django-cms | cms/utils/__init__.py | Python | bsd-3-clause | 2,947 |
# coding: UTF-8
import unittest
from usig_normalizador_amba.Callejero import Callejero
from usig_normalizador_amba.Partido import Partido
from usig_normalizador_amba.Calle import Calle
from tests.test_commons import cargarCallejeroEstatico
class CallejeroTestCase(unittest.TestCase):
p = Partido('jose_c_paz', '... | usig/normalizador-amba | tests/CallejeroTestCase.py | Python | mit | 7,895 |
from tests import BaseTestCase
import mock
import time
from redash.models import User
from redash.authentication.account import invite_token
from tests.handlers import get_request, post_request
class TestInvite(BaseTestCase):
def test_expired_invite_token(self):
with mock.patch('time.time') as patched_ti... | easytaxibr/redash | tests/handlers/test_authentication.py | Python | bsd-2-clause | 2,187 |
from .get_ob import *
| anselmobd/fo2 | src/lotes/queries/ob/__init__.py | Python | mit | 22 |
#!/usr/bin/python
from numpy import *
import pylab as pl
import scipy.misc
dt = 0.05
img = scipy.misc.imread("auryn_logo_small.png")
jitter = random.rand(*img.shape)/3*dt
n = img.shape[0]
grid = dt*img.shape[1]
print("# neurons %i, temporal resolution %fs, time grid %fs"%(n, dt, grid))
pl.imshow(img)
pl.show()
... | fzenke/ssbm | benchmarks/precise_timing/auryn/mkras.py | Python | mit | 495 |
import pytest
from django.test import TestCase
from ..utils import InvalidODKGeometryError, odk_geom_to_wkt
class TestODKGeomToWKT(TestCase):
def setUp(self):
self.geoshape = ('45.56342779158167 -122.67650283873081 0.0 0.0;'
'45.56176327330353 -122.67669159919024 0.0 0.0;'
... | Cadasta/cadasta-platform | cadasta/xforms/tests/test_utils.py | Python | agpl-3.0 | 3,134 |
from colored import fg,bg,attr
def color(i,m):
return '%s%s%s'%(fg(i),m,attr(0))
def bcolor(i,m):
return '%s%s%s'%(bg(i),m,attr(0))
C={ 'CURRCOLOR':0,
'CURRCOLORFUN':0,
'BGCURRCOLOR':127,
'COUNT':0,
'FN':3,
'FFG':1000,
'FBG':2000}
def cycling_color(c,bg=True):
if C['COUNT']%C["FFG"] == 0:... | e7dal/hexy | hexy/util/colors.py | Python | gpl-3.0 | 792 |
#!/usr/bin/python
# This file is part of pulseaudio-dlna.
# pulseaudio-dlna is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# pulsea... | caio2k/pulseaudio-dlna | pulseaudio_dlna/plugins/chromecast/pycastv2/__init__.py | Python | gpl-3.0 | 9,973 |
import pytest
pytestmark = pytest.mark.checks
info_1 = [[u'[[[site:heute:test]]]'],
[u'{'],
[u'"bytes_per_second":', u'1578215.4167199447,'],
[u'"finished":', u'1511788263.410466,'],
[u'"next_schedule":', u'1511874660.0,'],
[u'"output":',
u'"2017-11-27',
u'14:11:02',
u'---',
u'... | huiyiqun/check_mk | tests/unit/checks/test_mkbackup_check.py | Python | gpl-2.0 | 3,554 |
# -*- encoding: utf8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2017 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Li... | marmarek/qubes-core-mgmt-client | qubesadmin/tests/tools/qvm_create.py | Python | lgpl-2.1 | 16,808 |
"""
Babilonia project: Utility library and framework for C11/Python3
Copyright (C) 2014 Alfredo Mungo
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 3 of the License,... | AlBabilonia/foundry | foundry/expansion.py | Python | gpl-3.0 | 4,779 |
"""
Test that the breakpoint auto-continue flag works correctly.
"""
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class BreakpointAutoContinue(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
def test_breakpoint_auto_co... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py | Python | bsd-3-clause | 3,752 |
# Faça um Programa que peça um número e então mostre a
# mensagem O número informado foi [número].
print("O numero informado foi %d" %(int(input("Informe um numero: "))))
| GlauberGoncalves/Python | Lista PythonBrasil/exer02.py | Python | mit | 178 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import unittest
import warnings
import pandas as pd
from monty.os.path import which
import pymatgen.command_line.vampire_caller as vampirecaller
from pymatgen.core.structure import Structure
from py... | gmatteo/pymatgen | pymatgen/command_line/tests/test_vampire_caller.py | Python | mit | 2,353 |
# -*- coding: utf-8 -*-
# quiz-orm/views.py
from flask import render_template, request, redirect, url_for, flash
from app import app, baza
from models import Pytanie, Odpowiedz
from forms import *
@app.route('/')
def index():
"""Strona główna"""
return render_template('index.html')
@app.route('/lista')
def... | koduj-z-klasa/python101 | docs/webflask/quiz_orm/quiz2_sa/views.py | Python | mit | 3,943 |
#!/usr/bin/env python2
'''A one dimensional reactive pollution model. '''
from __future__ import print_function
import csv
import sys
import math
import argparse
DEFAULT_INPUT = {
'reaction_time': [3.0], # reaction time (inverse of rate) in seconds
'time': [0.0, 1.0, 10.0] # [t_start, dt, t_end]
}
d... | OpenDA-Association/OpenDA | course/exercise_black_box_calibration_polution_NOT_WORKING/stochModel/bin/reactive_pollution_model.py | Python | lgpl-3.0 | 15,823 |
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialaccount.providers.oauth2.views import (
OAuth2CallbackView,
OAuth2LoginView,
)
from grandchallenge.profiles.providers.gmail.provider import GmailProvider
class GmailOAuth2Adapter(GoogleOAuth2Adapter):
provider... | comic/comic-django | app/grandchallenge/profiles/providers/gmail/views.py | Python | apache-2.0 | 479 |
"""Functions for TML layout that are used in the grammar to construct DOM-like
node objects used in the 164 layout engine.
"""
def createNode(name, attributes=None, children=None):
"""Creates a DOM-like node object, using the 164 representation so that
the node can be processed by the 164 layout engine.
"... | michelle/sink | 164/tml.py | Python | mit | 733 |
import io
import string
import sys
import pytest
from flexmock import flexmock
from borgmatic.config import validate as module
def test_schema_filename_returns_plausable_path():
schema_path = module.schema_filename()
assert schema_path.endswith('/schema.yaml')
def mock_config_and_schema(config_yaml, sche... | witten/borgmatic | tests/integration/config/test_validate.py | Python | gpl-3.0 | 6,931 |
# -*- encoding: utf-8 -*-
from . import db
class ActivitySkill(db.Model):
item_id = db.Column(db.Integer, db.ForeignKey('item.id'), primary_key=True)
activity = db.Column(db.Integer, primary_key=True, autoincrement=False)
skill_id = db.Column(db.Integer, db.ForeignKey('item.id'), primary_key=True)
le... | Kyria/LazyBlacksmith | lazyblacksmith/models/sde/activityskill.py | Python | bsd-3-clause | 363 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 1ukash/horizon | horizon/views/base.py | Python | apache-2.0 | 2,548 |
# 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... | mrunge/horizon | openstack_dashboard/dashboards/project/access_and_security/keypairs/tests.py | Python | apache-2.0 | 9,541 |
# !/usr/bin/dev python
# -*- coding:utf-8 -*-
agentList = [
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",\
"Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11",\
"Mozilla... | Evelca1N/K-Spider | libs/urllibs/randomAgent.py | Python | mit | 2,278 |
import fudge
from oedipus import S
from oedipus.tests import no_results, Biscuit, BaseSphinxMeta
import sphinxapi
class BiscuitWithGroupBy(object):
"""Biscuit with default groupby"""
class SphinxMeta(BaseSphinxMeta):
group_by = ('a', '@group')
@fudge.patch('sphinxapi.SphinxClient')
def test_group... | erikrose/oedipus | oedipus/tests/test_groupby.py | Python | bsd-3-clause | 2,566 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
import os
import sys
import glob... | cstipkovic/spidermonkey-research | testing/mozharness/scripts/gaia_unit.py | Python | mpl-2.0 | 4,408 |
#!/usr/bin/python
# coding=utf-8
from setuptools import setup, find_packages
setup(
name = "HEIGVD_TimetableParser",
version = "0.1",
packages = find_packages(),
install_requires = ['icalendar>=3.5', 'xlrd>=0.9.2'],
# metadata for upload to PyPI
author = "Leeroy Brun",
author_email = "lee... | leeroybrun/heigvd-timetable-parser | setup.py | Python | mit | 604 |
#-------------------
# Abstract types
#-------------------
class OMError(Exception):
"""Root of exceptions generated by the oldman package expected HTTP ones."""
pass
class ModelGenerationError(OMError):
"""Error when generating a new model."""
pass
class OMRuntimeError(OMError):
"""Error at r... | oldm/OldMan | oldman/exception.py | Python | bsd-3-clause | 5,501 |
from google.cloud.vision import types, enums
import pprint
class Face(object):
face_types = vars(enums.FaceAnnotation.Landmark.Type);
def __init__(self, google_face):
self.fd_bounding_poly = google_face.fd_bounding_poly
self.bounding_poly = google_face.bounding_poly
self.landmarks... | yacomink/inyourface | inyourface/Face.py | Python | mit | 1,779 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | vlegoff/tsunami | src/secondaires/familier/commandes/familier/nom.py | Python | bsd-3-clause | 2,994 |
#!/usr/bin/python
"""
Module to test RO manager minim access functions
See: http://www.wf4ever-project.org/wiki/display/docs/RO+management+tool
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
... | wf4ever/ro-manager | src/iaeval/test/TestMinimAccess2.py | Python | mit | 14,199 |
from __future__ import unicode_literals
from copy import copy
import difflib
import errno
from functools import wraps
import json
import os
import posixpath
import re
import socket
import sys
import threading
import unittest
import warnings
from unittest import skipIf # NOQA: Imported here for backward compati... | liavkoren/djangoDev | django/test/testcases.py | Python | bsd-3-clause | 49,352 |
## Automatically adapted for scipy Oct 21, 2005 by
"""
Integration routines
====================
Methods for Integrating Functions given function object.
quad -- General purpose integration.
dblquad -- General purpose double integration.
tplquad -- General purpose triple integration.
... | stefanv/scipy3 | scipy/integrate/info.py | Python | bsd-3-clause | 1,311 |
"""Animation easing functions using cubic bezier curves."""
def _cubic_bezier_parametric(t, p0, p1, p2, p3):
"""Return (x, y) on cubic bezier curve for t in [0, 1]."""
return tuple([
pow(1 - t, 3) * p0[i] +
3 * pow(1 - t, 2) * t * p1[i] +
3 * (1 - t) * pow(t, 2) * p2[i] +
pow(t,... | tdryer/netscramble | netscramble/easing.py | Python | bsd-3-clause | 1,458 |
"""
WSGI config for segtest 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "segtest.settings")
from django.core.w... | aldryn/aldryn-segmentation | test_project/segtest/wsgi.py | Python | bsd-3-clause | 389 |
##########################################################################
##
## Copyright (c) 2017 Carel Combrink
##
## This file is part of the Hamster QML GUI, a QML GUI for the hamster-lib.
##
## The Hamster QML GUI is free software: you can redistribute it and/or
## modify it under the terms of the GNU Lesser Gene... | CJCombrink/hamster-qml | source/sort_filter_model.py | Python | lgpl-3.0 | 4,187 |
"""Messages for AMQP
"""
from . import spec
from amqpy.serialization import AMQPReader, AMQPWriter
__all__ = ['Message']
class GenericContent:
"""Base class for AMQP content
Subclasses should override :attr:`PROPERTIES`.
"""
PROPERTIES = []
def __init__(self, properties):
"""Save the pr... | gst/amqpy | amqpy/message.py | Python | mit | 6,804 |
#!/usr/bin/env python
"""Centralized import point for server plugins in grr/server directory.
This acts as a centralized point for modules that need to be loaded for
the server components so that the server_startup.Init() function will find and
register them.
This also acts as a sensible single place to add deploymen... | dunkhong/grr | grr/server/grr_response_server/server_plugins.py | Python | apache-2.0 | 1,215 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.