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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# Copyright 2015-2016 Yelp 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 ... | gstarnberger/paasta | paasta_tools/cli/cli.py | Python | apache-2.0 | 4,195 |
# Generated by Django 2.2.10 on 2020-04-24 14:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('base', '0512_cte_manager'),
]
operations = [
migrations.AlterField(
model_name='prerequisite',... | uclouvain/OSIS-Louvain | base/migrations/0513_auto_20200424_1417.py | Python | agpl-3.0 | 502 |
### Regular buildings
from lacuna.buildings.boring.algae import algae
from lacuna.buildings.boring.apple import apple
from lacuna.buildings.boring.atmosphericevaporator import atmosphericevaporator
from lacuna.buildings.boring.bean import bean
from lacuna.buildings.boring.beeldeban import beeldeban
from lacuna.buildin... | tmtowtdi/MontyLacuna | lib/lacuna/buildings/__init__.py | Python | mit | 9,268 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | tkaitchuck/nupic | tests/unit/py/nupic/support/configuration_test.py | Python | gpl-3.0 | 29,442 |
from .config import Config, setup_logging # noqa
from .event_bus import bus, Event # noqa
| cliixtech/bigorna | bigorna/commons/__init__.py | Python | gpl-3.0 | 92 |
# Copyright 2021 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, ... | google-research/pyreach | pyreach/mock/client_annotation_mock_test.py | Python | apache-2.0 | 1,275 |
import sublime
import sublime_plugin
from .WebOS import WebosCommand
class WebosPackageCommand(sublime_plugin.WindowCommand, WebosCommand):
def run(self, mode):
appinfo_path = self.get_appinfo_path()
if not appinfo_path:
sublime.error_message('ERROR: "appinfo.json" could not be found.... | Tenzer/WebOS | WebOSPackage.py | Python | mit | 404 |
"""Tests for Tibber config flow."""
import pytest
from homeassistant.components.tibber.const import DOMAIN
from homeassistant.const import CONF_ACCESS_TOKEN
from tests.async_mock import AsyncMock, MagicMock, PropertyMock, patch
from tests.common import MockConfigEntry
@pytest.fixture(name="tibber_setup", autouse=Tr... | nkgilley/home-assistant | tests/components/tibber/test_config_flow.py | Python | apache-2.0 | 2,116 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import models, migrations
def update_site_forward(apps, schema_editor):
"""Set site domain and name."""
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings... | hotsyk/uapython | uapython/contrib/sites/migrations/0002_set_site_domain_and_name.py | Python | mit | 954 |
from datetime import datetime
from hashlib import sha1
from slugify import slugify
def make_key(*a):
parts = []
for part in a:
if isinstance(part, datetime):
part = part.isoformat()
elif part is None:
part = '**'
else:
part = unicode(part)
par... | pudo/regenesis | regenesis/util.py | Python | mit | 627 |
"""
WSGI config for myapp project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | allanlei/django-oauthentication | sample/myapp/wsgi.py | Python | bsd-3-clause | 1,132 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .binary import TBinaryProtocol, TBinaryProtocolFactory
from .json import TJSONProtocol, TJSONProtocolFactory
from .multiplex import TMultiplexedProtocol, TMultiplexedProtocolFactory
from thriftpy._compat import PYPY, CYTHON
if not PYPY:
# enable... | mariusvniekerk/thriftpy | thriftpy/protocol/__init__.py | Python | mit | 963 |
import itertools
import operator
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
def removeStop():
emptyList=[]
tokenizer = RegexpTokenizer("[\w']+")
#Open Doc with stop words and twitter words to remove
word_list = open("Stop.txt", "r")
with... | carlosA-A/TwitterProject | TwitterProject/Stop checker.py | Python | gpl-2.0 | 2,352 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible 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 Lice... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/cloudstack/cs_zone_facts.py | Python | bsd-3-clause | 5,543 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | AnishShah/tensorflow | tensorflow/python/ops/lookup_ops.py | Python | apache-2.0 | 49,417 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | Petr-Kovalev/nupic-win32 | examples/opf/experiments/classification/base_scalar/description.py | Python | gpl-3.0 | 16,262 |
"""
Settings for the Karma app.
"""
import os
import re
HIPCHAT_API_URL = 'https://api.hipchat.com/v2'
ADDON_NAME = os.environ.get('ADDON_NAME', 'Karma')
ADDON_CHAT_NAME = os.environ.get('ADDON_CHAT_NAME', 'karma')
ADDON_KEY = os.environ.get('ADDON_KEY', 'com.johnfrench.hipchat.karma')
NOTIFICATION_COLOR = 'green'
... | frenchie16/HipKarma | karma/settings.py | Python | unlicense | 1,472 |
##
# Copyright (C) 2018 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | Inboxen/Inboxen | inboxen/utils/flags.py | Python | agpl-3.0 | 2,261 |
__author__ = 'tauren'
from app import create_app
app = create_app('../testing.cfg')
app.run(debug=True)
| taurenk/Flask-Angular-TaskList | backend/run.py | Python | mit | 106 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | mfherbst/spack | lib/spack/spack/test/versions.py | Python | lgpl-2.1 | 15,188 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | alexlo03/ansible | lib/ansible/modules/cloud/ovirt/ovirt_cluster.py | Python | gpl-3.0 | 31,464 |
# -*- test-case-name: twisted.trial.test.test_util -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
A collection of utility functions and classes, used internally by Trial.
This code is for Trial's internal use. Do NOT use this code if you are writing
tests. It is subject ... | GetSomeBlocks/Score_Soccer | resources/lib/twisted/twisted/trial/util.py | Python | mit | 11,500 |
""" A basic Bayes Filter example.
A mobile robot estimates the state of a door.
First coding attempt, linear code.
"""
__author__ = "Mike McFarlane mike@mikemcfarlane.co.uk"
__version__ = "Revision: ??"
__date__ = "Date: 18-04-14"
__copyright__ = "Copyright (c)Mike McFarlane 2014"
__license__ = "TBC"
# Pro... | mikemcfarlane/Code_sprints | Probabalistic_robotics_1/basic_bayes_filter_example.py | Python | gpl-2.0 | 4,356 |
#!/usr/bin/python
#
# A interactive shell for inspecting the SkyLines data model.
#
import sys
import os
from paste.deploy.loadwsgi import appconfig
from IPython.config.loader import Config
from IPython.frontend.terminal.embed import InteractiveShellEmbed
from skylines.config.environment import load_environment
from s... | dkm/skylines | shell.py | Python | agpl-3.0 | 703 |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from functools import partial
from django.conf import settings
from django.forms import SelectMultiple
from django.core.exceptions import FieldError
import django_filters
from pdc.apps.common.filters import (... | pombredanne/product-definition-center | pdc/apps/package/filters.py | Python | mit | 8,022 |
'''
The renderer module defines classes that render tournament info to the screen and printer. These
objects are used to do all rendering operations.
'''
import wx
from wnEvents import *
from wnControls import *
from wnTempData import wnMatchData
import wnSettings
# TODO: switch to renderer providing setting informati... | parente/wnerd | wnRenderer.py | Python | mit | 7,624 |
# -*- coding: utf-8 -*-
"""
Helper functions used in views.
"""
import calendar
import csv
import logging
import time
import locale
from datetime import datetime
from flask import Response
from functools import wraps
from json import dumps
from threading import Lock
from presence_analyzer.main import APP
locale.set... | stxnext-kindergarten/presence-analyzer-gderdak | src/presence_analyzer/utils.py | Python | mit | 5,980 |
from argparse import Namespace
import pycurl
import unittest
from mica.core import MicaClient
class MicaClientTestSSLConnection(unittest.TestCase):
@classmethod
def setUpClass(cls):
setattr(cls, 'PORT', '8080')
setattr(cls, 'SERVER', 'http://localhost')
setattr(cls, 'SSL_PORT', '8443')... | Rima-B/mica2 | mica-python-client/src/test/python/mica/testRestCall.py | Python | gpl-3.0 | 3,833 |
"""This simple demo calculates the total energy of CO molecules
using once LDA and once PBE as xc-functional. Obviously
some parts in this scripts are longer than necessary, but are shown
to demonstrate some more features."""
import ase
import ase.calculators.castep
import ase.io.castep
calc = ase.calculators.castep.... | misdoro/python-ase | doc/ase/calculators/ase_castep_demo.py | Python | gpl-2.0 | 1,965 |
"""
This file is part of Freeermind.
Freeermind 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.
... | tectronics/freeermind | src/gui/dialog.py | Python | gpl-3.0 | 3,910 |
from flask import Flask
from flask import render_template
from pymongo import Connection
import json
from bson import json_util
from bson.json_util import dumps
app = Flask(__name__)
MONGODB_HOST = 'localhost'
MONGODB_PORT = 27017
DBS_NAME = 'donorschoose'
COLLECTION_NAME = 'projects'
FIELDS = {'school_state': True, ... | futuresystems/465-rahulbindra | VisualizationProject/app.py | Python | apache-2.0 | 1,018 |
class device:
def __init__(self, mac_addr, ip_addr=None):
self.mac_address = mac_addr
self.ip_address = ip_addr
self.last_conn_time = 0
self.total_packet_set = 0
self.bandwidth = 0
def __str__(self):
return 'MAC address:%s BW sofar is %s' %(self.mac_address, self... | swathimatsa123/wifimonitor | Device.py | Python | apache-2.0 | 812 |
# internal
import phial.tasks
# external
import pytest
Task = phial.tasks.Task
VALID_TASK_LISTS = {
"no_dependencies": [
Task(id=1),
Task(id=2),
Task(id=3),
],
"simple_dependencies": [
Task(id=3, depends_on=2),
Task(id=1),
Task(id=2, depends_on=1),
],
}... | brownhead/phial | phial/tests/test_tasks.py | Python | bsd-2-clause | 969 |
from __future__ import print_function
###################################################################
# Copyright 2013-2017 All Rights Reserved
# Authors: The Paradrop Team
###################################################################
import sys
from paradrop.base import settings
from paradrop.lib.utils.pd_... | ParadropLabs/Paradrop | paradrop/daemon/paradrop/core/chute/chute_storage.py | Python | apache-2.0 | 3,342 |
'''
__init__.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org>
This program can be distributed under the terms of the GNU GPLv3.
'''
from __future__ import division, print_function
__all__ = [ 'backends', 'cli', 'parse_args', 'block_cache', "common... | drewlu/ossql | src/s3ql/__init__.py | Python | gpl-3.0 | 473 |
from gi.repository import Gdk, GObject, Gtk
from lutris.database.games import get_game_for_service
from lutris.game import Game
from lutris.game_actions import GameActions
from lutris.gui.views import COL_ID
class GameView:
# pylint: disable=no-member
__gsignals__ = {
"game-selected": (GObject.SIGNAL... | lutris/lutris | lutris/gui/views/base.py | Python | gpl-3.0 | 2,256 |
import argparse
import importlib
import math
import os
import pickle as pkl
from functools import reduce
from queue import Queue
from threading import Thread
from core.detection_module import DetModule
from core.detection_input import Loader
from utils.load_model import load_checkpoint
from utils.patch_config import p... | TuSimple/simpledet | rpn_test.py | Python | apache-2.0 | 8,374 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
def sig... | xzturn/caffe2 | caffe2/python/operator_test/cross_entropy_ops_test.py | Python | apache-2.0 | 5,678 |
################################################################################
# #
# Nanomod is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by ... | scottgigante/nanomod | nanomod/call_nanomod.py | Python | gpl-3.0 | 5,441 |
from . import hr_bulk_period
| silvau/Addons_Odoo | hr_bulk_period/wizard/__init__.py | Python | gpl-2.0 | 29 |
# ===============================================================================
# Copyright 2016 ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | UManPychron/pychron | pychron/media_storage/ftp_storage.py | Python | apache-2.0 | 2,366 |
# 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... | 4Quant/tensorflow | tensorflow/python/__init__.py | Python | apache-2.0 | 6,026 |
# Copyright 2016 Pinterest, 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 writi... | lilida/teletraan | deploy-board/deploy_board/webapp/util_views.py | Python | apache-2.0 | 7,827 |
#! /usr/bin/env python
# -----------------------------------------------------------------------
# rc_send.py - a small standalone program to send remote events to Freevo
# -----------------------------------------------------------------------
# $Id$
#
# Notes: need ENABLE_NETWORK_REMOTE = 1 in you local_conf.py
#
# T... | freevo/freevo1 | contrib/examples/rc_send.py | Python | gpl-2.0 | 2,937 |
import tensorflow as tf
def gmatmul(tensor_a, tensor_b, transpose_a=False, transpose_b=False, reduce_dim=None):
"""
Do a matrix multiplication with tensor 'a' and 'b', even when their shape do not match
:param tensor_a: (TensorFlow Tensor)
:param tensor_b: (TensorFlow Tensor)
:param transpose_a: ... | hill-a/stable-baselines | stable_baselines/acktr/kfac_utils.py | Python | mit | 5,216 |
#
# 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
# ... | anythingrandom/eclcli | eclcli/bare/bareclient/ecl/common/apiclient/utils.py | Python | apache-2.0 | 2,907 |
"""
Django settings for sample_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | ebertti/django-admin-easy | test_project/settings.py | Python | mit | 2,792 |
#!/usr/bin/env python
import cv2
import numpy as np
import rospy
from matplotlib import pyplot as plt
from std_msgs.msg import String
from time import sleep
cap = cv2.VideoCapture(0)
pub = rospy.Publisher('test1', String, queue_size=10)
rospy.init_node('test2')
while not rospy.is_shutdown():
sleep(0.08)
# Tak... | GaugeAnomaly/Robotex-Grupp-9 | src/ROSPackage/src/coins.py | Python | gpl-3.0 | 1,146 |
from pytest_factoryboy import register
from wapps.gallery import factories
register(factories.GalleryFactory)
register(factories.AlbumFactory)
register(factories.ManualAlbumFactory)
| apihackers/wapps | tests/gallery/conftest.py | Python | mit | 183 |
# Copyright 2013-2020 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Fiscal Position VAT Check",
"version": "14.0.1.0.0",
"category": "Invoices & Payments",
"license": ... | OCA/account-financial-tools | account_fiscal_position_vat_check/__manifest__.py | Python | agpl-3.0 | 637 |
#!/usr/bin/env python
# Copyright 2017-present Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | LegNeato/buck | tools/build/modules/find_duplicate_classes_in_jars.py | Python | apache-2.0 | 6,309 |
# browsershots.org - Test your web design in different browsers
# Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org>
#
# Browsershots 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 ... | foligny/browsershots-psycopg2 | shotserver/shotserver04/common/__init__.py | Python | gpl-3.0 | 4,710 |
from setuptools import setup, find_packages
from codecs import open
from os import path
__version__ = '0.6.2'
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# get the depende... | openbermuda/karmapi | setup.py | Python | gpl-3.0 | 1,700 |
#!/usr/bin/env python
"""
This is an example of creating your own resource to be used with the 'with'
python syntax. This is called a 'Context Manager'.
NOTES:
- the retrun value of __exit__ is whether or not to suppress an exception
if such has happened.
TODO:
- show how to use the return value of __enter__
"""
c... | veltzer/demos-python | src/examples/short/context_managers/suppress_exceptions.py | Python | gpl-3.0 | 2,075 |
import re
from collections import namedtuple
import sqlparse
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo,
)
from django.db.models.indexes import Index
FieldInfo = namedtuple('FieldInfo', BaseFieldInfo._fields + ('pk',))
field_size_re = re.... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/db/backends/sqlite3/introspection.py | Python | mit | 18,775 |
import urllib
import urllib2
import json
from error import TwocheckoutError
class Api:
username = None
password = None
private_key = None
seller_id = None
version = '1'
@classmethod
def credentials(cls, credentials):
Api.username = credentials['username']
Api.password = c... | 2Checkout/2checkout-python | twocheckout/api_request.py | Python | mit | 3,090 |
import os
import metricbeat
import unittest
from nose.plugins.attrib import attr
class Test(metricbeat.BaseTest):
@unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test")
def test_jmx(self):
"""
jolokia jmx metricset test
"""
additional_content = """
jmx.mapp... | christiangalsterer/httpbeat | vendor/github.com/elastic/beats/metricbeat/tests/system/test_jolokia.py | Python | apache-2.0 | 1,217 |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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, or
(at your option) any ... | azumimuo/family-xbmc-addon | script.module.liveresolver/lib/liveresolver/resolvers/mybeststream.py | Python | gpl-2.0 | 1,597 |
ELECTRUM_VERSION = '3.0' # version of the client package
PROTOCOL_VERSION = '1.1' # protocol version requested
# The hash of the mnemonic seed must begin with this
SEED_PREFIX = '01' # Standard wallet
SEED_PREFIX_2FA = '101' # Two-factor authentication
SEED_PREFIX_SW = '100' # Segwit walle... | dabura667/electrum | lib/version.py | Python | mit | 533 |
from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from django.utils.six.moves import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObject... | havard024/prego | venv/lib/python2.7/site-packages/django/db/models/base.py | Python | mit | 44,041 |
# The MIT License (MIT)
#
# Copyright (c) 2015 Menno Nijboer
#
# 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, mod... | MennoNij/DrivePy | drive.py | Python | mit | 13,928 |
"""
Create/Close an alert in OpsGenie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 2018.3.0
This state is useful for creating or closing alerts in OpsGenie
during state runs.
.. code-block:: yaml
used_space:
disk.status:
- name: /
- maximum: 79%
- minimum: 20%
opsgenie_... | saltstack/salt | salt/states/opsgenie.py | Python | apache-2.0 | 4,164 |
import os
# py path
PWD = os.path.abspath('.')
# root path for web site
WWW = os.path.join(PWD,'www')
# web site port
PORT = 8888
# True=enable/False=disable
PUSHOVER_ENABLE = False
# pushover app token
PUSHOVER_APPTOKEN="xxxx"
# pushover user key
PUSHOVER_USERKEY="xxxx"
| y12studio/pi | testonly/mpush1/m_settings.py | Python | apache-2.0 | 273 |
#!/usr/bin/env python
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner
##
## 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 Softwar... | graik/biskit | archive_biskit2/scripts/Mod/modelling_example.py | Python | gpl-3.0 | 10,123 |
import csv
from os import sys, path
# add one directory up to sys.path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from multiline_parser import multiline_parser
from capture_formats import line_captures
# where the data on the files is
manifest_file = "../../manifest_files/KWWL.csv"
infile =... | jsfenfen/freefcc | scraper/parsers/KWWL/read_KWWL_contracts.py | Python | bsd-3-clause | 2,598 |
import configparser
import os
import shutil
import traceback
class Conf:
def __init__(self, conf):
self.options = conf
config = configparser.ConfigParser(interpolation=None)
if not config.read(conf, encoding='utf-8'):
print("I had to remake the config file from default.... | poco0317/BarinadeBot-Rewrite | BB/conf.py | Python | mit | 1,765 |
""" ProfileManager manages web user profiles
in the DISET framework
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__RCSID__ = "$Id$"
import six
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC import S_OK
from DIRAC.Framewor... | yujikato/DIRAC | src/DIRAC/FrameworkSystem/Service/UserProfileManagerHandler.py | Python | gpl-3.0 | 5,925 |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from catmaid.control.authentication import requires_user_role, can_edit_or_fail
from catmaid.models import Point, UserRole
from catmaid.serializers import PointSerializer
from rest_framework.re... | tomka/CATMAID | django/applications/catmaid/control/point.py | Python | gpl-3.0 | 6,638 |
from django.http import HttpResponse
from django.db import connection
def save_ajax(request):
cursor = connection.cursor()
cursor.execute("INSERT INTO codings_values (coding_id,field_id,intval) VALUES (34,"+request.POST.get("fieldID", "")+","+request.POST.get("fieldValueID", "")+")")
''' cursor.execut... | aemal/westcat | annotator/save.py | Python | agpl-3.0 | 616 |
import time
import random
from util import hook, http, web, text
## CONSTANTS
base_url = "http://api.bukget.org/3/"
search_url = base_url + "search/plugin_name/like/{}"
random_url = base_url + "plugins/bukkit/?start={}&size=1"
details_url = base_url + "plugins/bukkit/{}"
categories = http.get_json("http://api.buk... | Red-M/CloudBot-legacy | plugins/minecraft_bukget.py | Python | gpl-3.0 | 4,355 |
import numpy as np
import nifty as ny
from shearstress import shearstress
def erosion(ws, tau_order, data, method='Chernetsky', submodule=None, friction='Roughness'):
jmax = data.v('grid', 'maxIndex', 'x')
kmax = data.v('grid', 'maxIndex', 'z')
fmax = data.v('grid', 'maxIndex', 'f')
rho0 = data.v('RHO0... | YoeriDijkstra/iFlow | packages/numerical2DV/sediment/erosion.py | Python | lgpl-3.0 | 1,245 |
# vim: set ts=2 expandtab:
# -*- coding: utf-8 -*-
"""
Module: ytdl.py
Desc: fetch and videos piped from youtube-dl
Author: on_three
Email: on.three.email@gmail.com
DATE: Wed, June 25th 2015
"""
import string
import re
import os
import psutil
from twisted.python import log
from twisted.internet.task import LoopingC... | on-three/weeabot | weeabot/ytdl.py | Python | mit | 9,335 |
# Copyright 2012 Red Hat, Inc.
# Copyright 2015 Intel Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | phenoxim/cinder | cinder/api/v2/views/types.py | Python | apache-2.0 | 2,078 |
# coding=utf-8
"""Dialog test.
.. note:: 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.
"""
__author__ = 'ric... | Geolicious/relocator | test/test_relocator_dialog.py | Python | gpl-2.0 | 1,541 |
"""
WSGI config for tchelper 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.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tchelper.settings")
from django.core... | shanzi/tchelper | tchelper/wsgi.py | Python | bsd-2-clause | 426 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TtTrip.date'
db.add_column(u'timetable_tttrip', 'date',
... | hasadna/OpenTrain | webserver/opentrain/timetable/migrations/0006_auto__add_field_tttrip_date.py | Python | bsd-3-clause | 2,370 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio 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... | Lilykos/invenio | invenio/modules/jsonalchemy/jsonext/engines/cache.py | Python | gpl-2.0 | 4,277 |
# Copyright (C) 2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 opt... | khushboo9293/mailman | src/mailman/bin/tests/test_mailman.py | Python | gpl-3.0 | 1,381 |
#!/usr/bin/env python
import numpy as np
import numexpr as ne
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from sklearn.linear_model import LogisticRegression
# Parameters
params = { 'N': 200,
'edge_precision': 1.0,
'prior_precision': 0.01,
'alpha_sd': 2.0,
... | othercriteria/StochasticBlockmodel | old/rasch_normal_bayes.py | Python | mit | 7,147 |
"""
PlyData Options
"""
# Names of all the options
OPTIONS = {'modify_input_data'}
#: For actions where it may be more efficient, if ``True``
#: the verb modifies the input data. This may be worth it
#: for very large datasets.
#:
#: Examples
#: --------
#: ::
#:
#: import pandas a pd
#: from plydata.options i... | has2k1/plydata | plydata/options.py | Python | bsd-3-clause | 2,747 |
# This is a helper for the win32trace module
# If imported from a normal Python program, it sets up sys.stdout and sys.stderr
# so output goes to the collector.
# If run from the command line, it creates a collector loop.
# Eg:
# C:>start win32traceutil.py (or python.exe win32traceutil.py)
# will start a process wit... | leighpauls/k2cro4 | third_party/python_26/Lib/site-packages/win32/lib/win32traceutil.py | Python | bsd-3-clause | 1,423 |
import time
from temperatureReadingFactory import TemperatureReadingFactory
from configurationFile import ConfigurationFile
from googleSpreadsheetWorksheet import GoogleSpreadsheetWorksheet
def main():
while True:
temperature = TemperatureReadingFactory().create().acquire()
GoogleSpreadsheetWorksh... | bobjects/google-spreadsheet-temperature-logger | __main__.py | Python | mit | 472 |
import csv
import io
import logging
import warnings
from urllib.parse import quote as urlquote
import dateutil.parser
import msgpack
log = logging.getLogger(__name__)
def create_url(tmpl, **values):
"""Create url with values
Args:
tmpl (str): url template
values (dict): values for url
"... | treasure-data/td-client-python | tdclient/util.py | Python | apache-2.0 | 12,694 |
# -*- coding: utf-8 -*-
from cfgio.base import ReadConfig, WriteConfig, ConfigValueBase
class KeyOnlyValue(ConfigValueBase):
pass
class SimpleConfig(WriteConfig):
"""Simple configuration file format. This file format contains one key or "statement" per line."""
def parse(self, s):
return KeyOnlyValue(s.strip... | ercpe/cfgio | src/cfgio/simple.py | Python | gpl-2.0 | 369 |
"""
@author Stephen Jackson <scj7t4@mst.edu>
This loads a configuration file
"""
from datetime import timedelta
import ConfigParser
class Settings(object):
"""
Configuration Options:
stream/streamurl : The location of the stream that will be recorded. In
theory this can be a .pls or .m3u stre... | KMNR/Webstream | webstreamd/webstreamd/settings.py | Python | mit | 1,527 |
'''
New Test For cpu bill Operations
1.test vm stop
2.test vm destory
3.test vm live migration
4.test vm clean
@author Antony WeiJiang
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.b... | zstackorg/zstack-woodpecker | integrationtest/vm/simulator/public_billing/test_check_vm_lifecycle_with_cpu_billing.py | Python | apache-2.0 | 3,329 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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, or (at your option) any later
# version.
#
# This program is distributed in the... | Splawik/pytigon | pytigon/schserw/schsys/views.py | Python | lgpl-3.0 | 13,417 |
import datetime
def calculate_result(request_dict):
savings_targets = request_dict.get('savings_targets', [])
if len(savings_targets) == 0:
return []
savings_day_of_month = 1
# Put savings targets in order so we can create an accumulated target to hit
sorted_targets = sorted((target['date'... | GonePostal/groat | calculation.py | Python | mit | 1,392 |
# -*- coding: utf-8 -*-
"""proyectoP4 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.h... | jesmorc/Workinout | proyectoP4/urls.py | Python | gpl-3.0 | 1,273 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/options_cover.ui'
#
# Created: Tue Jan 22 12:56:46 2013
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
excep... | kepstin/picard | picard/ui/ui_options_cover.py | Python | gpl-2.0 | 10,179 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 cagayakemiracl All Rights Reserved.
# $Mail: <cagayakemiracl@gmail.com>
from abc import ABCMeta, abstractmethod
class GA:
__metaclass__ = ABCMeta
def __init__(self, bits, pc, pm, weights, m):
self.bits = bits
self.pc = pc
self.pm = pm
... | cagayakemiracl/ec | ec/spec/ga.py | Python | gpl-3.0 | 796 |
import seldon.pipeline.pipelines as pl
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_selection import SelectKBest, chi2
import logging
class Tfidf_transform(pl.Feature_transform):
"""create TF-IDF (term frequency - inv... | michaelshing/seldon-server | external/predictor/python/seldon/pipeline/tfidf_transform.py | Python | apache-2.0 | 4,316 |
# Copyright (C) 2015 Richard Klees <richard.klees@rwth-aachen.de>
"""
# Rationales
A streaming pipeline is build from three different kind of objects:
* Producers send data downstream
* Consumers receive data from upstream
* Pipes receive data from upstream, transform it and send it downstream.
Depending on their t... | lechimp-p/streamr | streamr/core.py | Python | mit | 11,744 |
import sys
while True:
print ('type exit to exit')
response = input()
if response == 'exit':
sys.exit()
print ('You typed ' + '"' + response + '".') | senthil1186/pyprojects | test.py | Python | gpl-3.0 | 180 |
import pandas as pd
from featuretools.primitives.base.transform_primitive_base import (
make_trans_primitive
)
from featuretools.variable_types import Datetime, DatetimeTimeIndex, Timedelta
# Check the custom trans primitives description
def test_description_make_trans_primitives():
def pd_time_since(array, ... | Featuretools/featuretools | featuretools/tests/primitive_tests/test_make_trans_primitives.py | Python | bsd-3-clause | 1,642 |
import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core import mail
from django.core.exceptions import ImproperlyConfigured
from django.core.handlers.wsgi import WSGIRequest
from django.t... | saukrIppl/seahub | thirdpart/registration/tests/backends.py | Python | apache-2.0 | 13,820 |
import sys
if __name__ == '__main__':
if sys.version_info[0] >= 3:
import http.server
import socketserver
PORT = int(sys.argv[1])
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
httpd.serve_forever()
else:
... | noroutine/ansible | test/integration/targets/wait_for/files/testserver.py | Python | gpl-3.0 | 484 |
from django import template
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django.utils.encoding import smart_str
from django.utils.safestring import mark_safe
from hashlib import md5 as md5_constructor
import urllib
GRAVATAR_MAX_RATING = getattr(settings, 'GRAVATAR_MAX_R... | fgirault/smeuhsocial | apps/threadedcomments/templatetags/gravatar.py | Python | mit | 4,591 |
try:
import pygments
from rcs.wiki.lib import pygments_rest
except ImportError:
pass
# don't import the pygments rest directive if pygments is not installed.
from django import template
from django.conf import settings
register = template.Library()
def restructuredtext(value):
try:
fr... | ShuffleBox/django-rcsfield | rcs/wiki/templatetags/wiki_tags.py | Python | bsd-3-clause | 840 |
""" Functions for processing visibility. These operate on one or both of BlockVisibility and Visibility.
"""
__all__ = ['base', 'coalesce', 'gather_scatter', 'iterators', 'operations', 'vis_select', 'visibility_fitting'] | SKA-ScienceDataProcessor/algorithm-reference-library | wrappers/serial/visibility/__init__.py | Python | apache-2.0 | 221 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.