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 |
|---|---|---|---|---|---|
from datetime import timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils import timezone
from normandy.recipes.models import Recipe
class Command(BaseCommand):
"""
Update signatures for enabled Recipes that have no s... | Osmose/normandy | recipe-server/normandy/recipes/management/commands/update_recipe_signatures.py | Python | mpl-2.0 | 2,045 |
#!/usr/bin/env python
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
scripts=['bin/arbotix_gui', 'bin/arbotix_terminal'],
packages=['arbotix_python'],
package_dir={'': 'src'},
)
setup(**d)
| 4ndreas/ROSCoffeButler | src/arbotix_python/setup.py | Python | mit | 285 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Interfaces for creating a dependency for a given specification. The
dependency is a second specification, so this is really a way of storing the
order in which specs must be imp... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/blueprints/interfaces/specificationdependency.py | Python | agpl-3.0 | 1,862 |
# 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... | shakamunyi/neutron-vrrp | neutron/tests/unit/test_dhcp_agent.py | Python | apache-2.0 | 63,987 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from Bio import SeqIO
from shutil import copyfile
import os, argparse, sys, re, subprocess
def main():
parser = argparse.ArgumentParser(description="The Program will call variants given Illumina Data and a reference")
parser.add_argument('-1', action="store", help="The p... | nate422/VarCaller | VarCaller.py | Python | mit | 4,904 |
# -*- 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
#... | r39132/airflow | tests/core.py | Python | apache-2.0 | 94,499 |
from django.views.generic.edit import FormView
from django.views.generic import ListView
from .forms import ImageForm
from .models import Image
class UploadView(FormView):
template_name = 'imageview/upload.html'
form_class = ImageForm
success_url = '/'
def form_valid(self, form):
form.save()
... | w00tw00tw00tw00t/imageview | imageview/views.py | Python | gpl-2.0 | 465 |
from __future__ import absolute_import
import urwid
import urwid.util
import os
from netlib.http import CONTENT_MISSING
import netlib.utils
from .. import utils
from ..models import decoded
from . import signals
try:
import pyperclip
except:
pyperclip = False
VIEW_FLOW_REQUEST = 0
VIEW_FLOW_RESPONSE = 1
... | tekii/mitmproxy | libmproxy/console/common.py | Python | mit | 11,726 |
import os
import shutil
import tempfile
from django.test import TestCase
from django.urls import reverse
from ..models import RegistrationCenter, Office, Constituency, SubConstituency
from .. import utils
from .factories import OfficeFactory, ConstituencyFactory, SubConstituencyFactory, \
RegistrationCenterFactor... | SmartElect/SmartElect | register/tests/test_center_csv.py | Python | apache-2.0 | 28,774 |
from mock import patch
from django.test import TestCase
from colab.management.commands.celery import Command
class CeleryCommandTest(TestCase):
@patch.object(Command, 'validate')
@patch('colab.management.commands.celery.base.execute_from_commandline')
def test_run_from_argv(self, execute_from_commandli... | colab/colab | colab/management/tests/test_celery_command.py | Python | gpl-2.0 | 573 |
# © 2018 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
class Project(models.Model):
_name = 'project.project'
_inherit = ['project.project', 'mail.thread']
code = fields.Char(
string='Number',
track_visibility='... | savoirfairelinux/project-addons | project_event/models/project_project.py | Python | lgpl-3.0 | 9,412 |
# -*- coding: utf-8 -*-
# Copyright 2013 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 requir... | catapult-project/catapult | third_party/gsutil/gslib/tests/test_acl.py | Python | bsd-3-clause | 33,748 |
import numpy as np
from bokeh.layouts import layout
from bokeh.models import CustomJS, Slider, ColumnDataSource, WidgetBox
from bokeh.plotting import figure, output_file, show
output_file('dashboard.html')
tools = 'pan'
def bollinger():
# Define Bollinger Bands.
upperband = np.random.random_integers(100, 1... | percyfal/bokeh | examples/howto/layouts/dashboard.py | Python | bsd-3-clause | 2,812 |
#!/usr/bin/env python
from __future__ import unicode_literals
import warnings
from django.core.management.base import BaseCommand, CommandError
from djangoseo.base import registry, populate_metadata
class Command(BaseCommand):
help = "Populate the database with metadata instances for all models " \
... | romansalin/django-seo | djangoseo/management/commands/populate_metadata.py | Python | mit | 1,392 |
import rospkg
from python_qt_binding.QtCore import Qt, QMetaType, QDataStream, QVariant, pyqtSignal, QLineF, QPointF
from python_qt_binding import loadUi
from rqt_gui_py.plugin import Plugin
from python_qt_binding.QtWidgets import QWidget, QTreeWidget, QTreeWidgetItem,QListWidgetItem, \
QSlider, QGroupBox, QVBoxLay... | bit-bots/bitbots_misc | bitbots_live_tool_rqt/scripts/label_pool.py | Python | mit | 15,588 |
# 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... | jiaphuan/models | research/object_detection/models/ssd_inception_v2_feature_extractor.py | Python | apache-2.0 | 4,579 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
X = tf.random_normal(shape=[3, 5, 6], dtype=tf.float32)
X = tf.reshape(X, [-1, 5, 6])
cell = tf.nn.rnn_cell.BasicLSTMCell(10) # 也可以换成别的,比如GRUCell,BasicRNNCell等等
lstm_multi = tf.nn.rnn_cell.MultiRNNCell([cell] * 2, state_is_tuple... | iABC2XYZ/abc | Epics/rnn/testDynamicRNN5.py | Python | gpl-3.0 | 624 |
# Driver to talk to the Teensy and read all of the packets it sends into a queue.
# Packet streaming is done in a separate thread.
# Written for Python 2.7, but may be possible to update to a newer version.
import gnc_packet
import serial
import threading
import Queue
class MemCardDriver:
def __init__(self, port =... | aalberg/hem-teensy | python/memcard_driver.py | Python | gpl-2.0 | 2,219 |
import logging
import signal
import sys
import unittest
from os.path import abspath, dirname, join
from robot.running import TestSuite, TestSuiteBuilder
from robot.utils import StringIO
from robot.utils.asserts import assert_equals
from resources.runningtestcase import RunningTestCase
from resources.Listener import L... | moto-timo/robotframework | utest/running/test_running.py | Python | apache-2.0 | 12,074 |
"""
Django settings for Mantenimiento project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, .... | timh52280/GestorDeMantenimiento | Mantenimiento/settings.py | Python | gpl-2.0 | 3,134 |
from pook import interceptors
class CustomInterceptor(interceptors.BaseInterceptor):
pass
def test_add_custom_interceptor():
interceptors.add(CustomInterceptor)
assert CustomInterceptor in interceptors.interceptors
| h2non/pook | tests/unit/interceptors/module_test.py | Python | mit | 232 |
# Copyright (C) 2011-2012 CRS4.
#
# This file is part of Seal.
#
# Seal 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.
#
# Seal is dis... | ilveroluca/seal | seal/lib/mr/filter_link.py | Python | gpl-3.0 | 3,069 |
from xii import definition, command
class ResumeCommand(command.Command):
name = "resume"
help = "resume all paused domains"
def run(self):
self.each_component("resume")
| xii/xii | src/xii/builtin/commands/resume/command_resume.py | Python | apache-2.0 | 193 |
#!/usr/bin/env python
'''
object tracking
==================
Example of using tracking to decide if a moving object passed a line
Usage
-----
main_tracker.py [<video source>]
Keys:
p - pause video
s - toggle single step mode
'''
# Python 2/3 compatibility
from __future__ import print_function
imp... | barney-NG/pyCAMTracker | src/main_tracker.py | Python | mit | 14,947 |
import liclient
def show_methods():
obj = liclient.client
methods = [x for x in dir(obj) if x[0:1] != '_' if callable(getattr(obj, x))]
print 'Load Impact client methods:'
print '\n'.join(methods)
def run_method(name, args):
obj = liclient.client
method = getattr(obj, name)
output = method... | schibsted/overloadimpact | overloadimpact/cli_tool/api_method.py | Python | mit | 346 |
# -*- coding: utf-8 -*-
import pytest
from distutils.version import LooseVersion
from freezegun import freeze_time
MARKER_NAME = 'freeze_time'
FIXTURE_NAME = 'freezer'
def get_closest_marker(node, name):
"""
Get our marker, regardless of pytest version
"""
if LooseVersion(pytest.__version__) < Loo... | ktosiek/pytest-freezegun | pytest_freezegun.py | Python | mit | 1,579 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
==========================
Metabolic Components Tests
==========================
:Authors:
Moritz Emanuel Beber
Alexandra Mirela Grigore
Nikolaus Sonnenschein
:Date:
2011-04-08
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights ... | Midnighter/pymetabolism | pymetabolism/metabolism/tests/test_metabolism.py | Python | bsd-3-clause | 13,210 |
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
baseUrl = "https://forum-testing.herokuapp.com/v1.0/demo"
driver = webdriver.Firefox()
driver.maximize_window()
driver.get(baseUrl)
# Find parent handle -> Main Window
parentHandle = driver.current_window_handle
print("Parent Hand... | twiindan/selenium_lessons | 04_Selenium/05_switch_window_iframe/switch_to_window.py | Python | apache-2.0 | 1,087 |
# Copyright 2015 Cisco Systems, 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 writ... | tbarrongh/cosc-learning-labs | test/test_device_mount.py | Python | apache-2.0 | 1,963 |
# Copyright 2009-2015 MongoDB, 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... | macdiesel/mongo-python-driver | pymongo/mongo_client.py | Python | apache-2.0 | 44,468 |
"""Defines a sync module for Blink."""
import logging
from requests.structures import CaseInsensitiveDict
from blinkpy import api
from blinkpy.camera import BlinkCamera, BlinkCameraMini, BlinkDoorbell
from blinkpy.helpers.util import time_to_seconds
from blinkpy.helpers.constants import ONLINE
_LOGGER = logging.getL... | fronzbot/blinkpy | blinkpy/sync_module.py | Python | mit | 12,603 |
#! /usr/bin/env python
#
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2015. It is licensed under
# the three-clause BSD license; see LICENSE.
# Contact: khmer-project@idyll.org
#
from __future__ import print_function
import sys
import khmer
impo... | Winterflower/khmer | sandbox/stoptag-abundance-hist.py | Python | bsd-3-clause | 1,222 |
from automlk.dataset import get_dataset_list, create_graph_data
from automlk.store import set_key_store
"""
module specifically designed to update feature graphs after new version
"""
for dt in get_dataset_list():
print('-'*60)
print(dt.name)
create_graph_data(dt.dataset_id)
| pierre-chaville/automlk | scripts/update_graphs.py | Python | mit | 290 |
import random
from unittest import TestCase
from hamcrest import *
from chapter14.textbook14_3 import interval_search, overlap, interval_insert, interval_delete
from datastructures.interval import Interval
from datastructures.red_black_tree import RedBlackTree, IntervalNode
from tree_util import assert_parent_pointer... | wojtask/CormenPy | test/test_chapter14/test_textbook14_3.py | Python | gpl-3.0 | 2,117 |
##
# Copyright (c) 2005 Apple Computer, Inc. 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
# to use, copy... | msfrank/Higgins | higgins/http/dav/element/parser.py | Python | lgpl-2.1 | 7,425 |
from __future__ import absolute_import
import errno
import select
import sys
from mock import Mock, patch
from time import time
from celery.worker import autoreload
from celery.worker.autoreload import (
WorkerComponent,
file_hash,
BaseMonitor,
StatMonitor,
KQueueMonitor,
InotifyMonitor,
... | sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/celery/tests/worker/test_autoreload.py | Python | bsd-3-clause | 9,595 |
import os
from os import path
from . import getClient
from docker.errors import APIError
from tsdesktop import config
class ImageInfo(object):
"""docker image information and status"""
name = None
status = None
def __init__(self, name, info=None, missing=False, error=False):
self.name = name
... | tsadm/desktop | lib/tsdesktop/dockman/services.py | Python | bsd-3-clause | 7,130 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
os.environ[... | electrolinux/pootle | pootle/apps/pootle_app/management/commands/revision.py | Python | gpl-3.0 | 1,022 |
from nose.tools import *
from RoboTableProject.wiimote import Wiimote
from RoboTableProject.robot import Robot
import math
class SensorTest(Wiimote):
"""Simple SensorTest class"""
def __init__(self):
Wiimote.__init__(self, test=True)
def get_leds(self):
front_led = {"X": 3, "Y": 10}
... | arnaudchenyensu/RoboTableProject | tests/robot_tests.py | Python | gpl-2.0 | 1,167 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Deepin, Inc.
# 2011 Wang Yong
#
# Author: Wang Yong <lazycat.manatee@gmail.com>
# Maintainer: Wang Yong <lazycat.manatee@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | manateelazycat/deepin-software-center | src/commandProxy.py | Python | gpl-3.0 | 2,004 |
# -*- 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 GNU... | addition-it-solutions/project-all | addons/account_voucher/account_voucher.py | Python | agpl-3.0 | 84,758 |
# -*- coding: utf-8 -*-
from willow.willow import *
from wifunc_v2 import *
def session(me):
# 0 : The First Price Auction
# 1 : Vickrey Auction
# 2 : The Reference Rule Auction
auction = 1
Round = 3
if me == 0:
# 変数のセット
plnum = 0
i1list = []
i2list = []
... | ogaway/WillowProject | AuctionForComplements/AuctionForComplements.py | Python | gpl-3.0 | 14,693 |
from twisted.web.resource import Resource
import sqlite3
import string
import cgi
import sys
from libs.templates import template_html
class snippets(Resource):
isLeaf = True
def __init__(self):
Resource.__init__(self)
self.m_conn = sqlite3.connect("./dbs/snippets.db")
self.m_cursor ... | bradfordelliott/snippets | libs/snippets.py | Python | lgpl-2.1 | 14,478 |
# -*- coding: utf-8 -*-
"""
glashammer.bundles.i18n.request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds i18n functionality to the request objects.
:copyright: 2010, The Glashammer Authors
:license: MIT
"""
from glashammer.bundles.i18n import select_locale, load_translations, \
has_section, Locale
from werkzeug.util... | passy/glashammer-rdrei | glashammer/bundles/i18n/request.py | Python | mit | 1,675 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-05 02:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secnews', '0002_auto_20170830_1310'),
]
operations = [
migrations.AlterFiel... | skiyer/xuanwu | secnews/migrations/0003_auto_20170905_1031.py | Python | mit | 488 |
from six.moves.urllib.parse import unquote
from wptserve.utils import isomorphic_decode, isomorphic_encode
def redirect_response(request, response, visited_count):
# |visited_count| is used as a unique id to differentiate responses
# every time.
location = b'empty.js'
if b'Redirect' in request.GET:
loca... | asajeffrey/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker.py | Python | mpl-2.0 | 2,267 |
from errbot import BotPlugin, botcmd
from errbot.version import VERSION
from errbot.utils import get_class_that_defined_method
class Help(BotPlugin):
min_err_version = VERSION # don't copy paste that for your plugin, it is just because it is a bundled plugin !
max_err_version = VERSION
MSG_HELP_TAIL = '... | javierwilson/err | errbot/core_plugins/help.py | Python | gpl-3.0 | 5,846 |
from modules.front_motor import FrontMotor
from modules.back_motor import BackMotor
from services.temperature_sensor import TemperatureSensor
modules = {}
def get_module(module_name, **data):
return modules[module_name](**data)
def register_module(module_name, cls):
modules[module_name] = cls
register_modul... | astagi/chickenfoot | chickenfoot/modules_register.py | Python | mit | 443 |
# -*- encoding: utf-8 -*-
from cliff.interactive import InteractiveApp
class FakeApp(object):
NAME = 'Fake'
def make_interactive_app(*command_names):
fake_command_manager = [(x, None) for x in command_names]
return InteractiveApp(FakeApp, fake_command_manager,
stdin=None, stdo... | sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/cliff/tests/test_interactive.py | Python | mit | 1,743 |
"""
Module containing error objects we return to clients
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import flask.ext.api as api
class FrontendException(Exception):
def __init__(self):
super(FrontendException, self).__init__()
... | jeromekelleher/server | ga4gh/frontend_exceptions.py | Python | apache-2.0 | 2,392 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Martin Raspaud
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# 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, eit... | mraspaud/mpop | mpop/satin/hrpt_hmf.py | Python | gpl-3.0 | 18,933 |
# Copyright 2014 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 ... | JPO1/python-docs-samples | appengine/ndb/modeling/relation_model_models_test.py | Python | apache-2.0 | 2,299 |
# Copyright 2017-2019 The FIAAS Authors
#
# 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... | fiaas/k8s | k8s/models/configmap.py | Python | apache-2.0 | 928 |
#!/usr/bin/python
import re, nltk, random, tweepy, time
from words import wordpos
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
trumpismsbegin = ['Frankly, ', 'To be honest, ', 'You know what? ', 'Listen, ', "I'm the best. ", "I have a great brain and ", "Let's be honest, ... | jac0bbennett/Trump-Quote-Bot | trumpbot/gentweet.py | Python | mit | 1,972 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# LORZE erasandcad, a 2D CAD with an intuitive user interface,
# simple and easy. <http://erasand.jimdo.com/projekte/lorze/>
# (C) 2013, Andreas Ulrich
#
# This file is part of "LORZE erasandcad"
# "LORZE erasandcad" is free software: you can redistribute it and/or
# modify it... | ulrich3110/LORZE | Modules/lrzwxtest.py | Python | gpl-3.0 | 21,386 |
__author__ = 'haukurk'
from components.emailserver.server import email_watcher
from components.smsinterpreter import sms
import asyncore
from utils.logger import logger
def component_proxy(message):
"""
Proxy between email component and sms interpreter.
Email component event returns an email.Message obje... | haukurk/email-to-smsapi | run.py | Python | mit | 1,123 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
from pymatgen.core import Structure
from pymatgen.util.string import (
disordered_formula,
formula_double_format,
htmlify,
latexify,
latexify_spacegroup,
transformation... | gmatteo/pymatgen | pymatgen/util/tests/test_string.py | Python | mit | 4,104 |
#!/usr/bin/env python
__author__ = 'waroquiers'
import unittest
import os
import json
import numpy as np
import shutil
from monty.tempfile import ScratchDir
from pymatgen.util.testing import PymatgenTest
from pymatgen.analysis.chemenv.coordination_environments.structure_environments import StructureEnvironments
fr... | dongsenfo/pymatgen | pymatgen/analysis/chemenv/coordination_environments/tests/test_structure_environments.py | Python | mit | 12,696 |
import math
import pyglet
import resources.indices as ind
#######################################
# Core Classes.
class Vector:
"""Basic 2D vectors"""
def __init__(self, x=0, y=0):
"""Initialization.
Args:
x: x position
y: y position
"""
self.x = x
... | MWRuszczycky/SimpleMoonSimulator | moonsim/model/engine.py | Python | bsd-3-clause | 5,361 |
import discord
from sigma.core.utilities.data_processing import user_avatar
def count_all_commands(db, user):
cmd_items = db[db.db_cfg.database]['CommandStats'].aggregate(
[
{'$match': {
'author': user.id
}},
{"$group": {
"_id": {
... | AngryBork/apex-sigma-plugins | statistics/internals/profile.py | Python | gpl-3.0 | 1,746 |
#!/usr/bin/python
# coding=utf-8
# This file is part of the MLizard library published under the GPL3 license.
# Copyright (C) 2012 Klaus Greff
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import division, uni... | Qwlouse/MLizard | mlizard/test/helpers.py | Python | gpl-3.0 | 928 |
#!/usr/bin/python3
# template.py by Bill Weinman [http://bw.org/]
# created for Python 3 Essential Training on lynda.com
# Copyright 2010 The BearHeart Gorup, LLC
from xml.dom.minidom import parse
from urllib.request import urlopen
from html.parser import HTMLParser
DEFAULT_NAMESPACES = (
None, # RSS 09.1, 0.92, ... | hckrtst/learnpython | py3_essential_training/19 Projects/Extras/RSS/rss.py | Python | mit | 3,843 |
"""
dyn_pages/publish_targets/flickr.py
Author: Josh Williams
Date Added: Sun Feb 25 14:55:23 CST 2007
Flickr. Bleh.
"""
## STD LIBS
import md5
from xml.dom import minidom
## OUR LIBS
## 3RD PARTY LIBS
from nevow import rend, inevow, url
from twisted.web.client import HTTPClientFactory
from twisted.internet impor... | kordless/zoto-server | aztk/web/publish_targets/flickr.py | Python | bsd-3-clause | 3,849 |
#!/usr/bin/env python3
# Copyright 2016 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 o... | GoogleCloudPlatform/training-data-analyst | quests/data-science-on-gcp-edition1_tf2/04_streaming/simulate/df02.py | Python | apache-2.0 | 1,395 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
class ConfigError(Exception):
pass
| weberwang/WeRoBot | werobot/exceptions.py | Python | mit | 122 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0003_auto_20150113_1629'),
]
operations = [
migrations.AlterModelOptions(
name='line',
opti... | michaelkuty/django-oscar | src/oscar/apps/order/migrations/0004_auto_20160111_1108.py | Python | bsd-3-clause | 431 |
#
# Solution to Project Euler problem 74
# Philippe Legault
#
# https://github.com/Bathlamos/Project-Euler-Solutions
def compute():
triangle = frozenset(map(str, [n * (n + 1) / 2 for n in range(45, 141)]))
square = frozenset(map(str, [n ** 2 for n in range(32, 100)]))
pentagonal = frozenset(map(str, [n * (3 * n ... | Bathlamos/Project-Euler-Solutions | solutions/p061.py | Python | mit | 1,103 |
from django.forms.widgets import HiddenInput
from django.urls import reverse
from django.utils.http import urlencode
from consents.forms import RequiredConsentsForm
from consents.models import Term
from consents.tests.base import ConsentTestBase
from consents.util import person_has_consented_to_required_terms
from wor... | pbanaszkiewicz/amy | amy/consents/tests/test_action_required_view.py | Python | mit | 8,809 |
"""Helper module for gui test suite
"""
import os
import sys
import hashlib
import logging
from PyQt4 import QtGui, QtCore
from qgis.core import (QgsApplication,
QgsVectorLayer,
QgsRasterLayer,
QgsRectangle,
QgsCoordinateReferenc... | gvallarelli/inasafe | safe_qgis/utilities_test.py | Python | gpl-3.0 | 13,793 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Michael Davidsaver
License is GPL3+, see file LICENSE for details
"""
import unittest
import os.path
from .. import io
from ..util import TempDir
# test data directory
_dir = os.path.dirname(__file__)
class TestSpice(unittest.TestCase):
def test_read(self):
... | mdavidsaver/spicetools | spicetools/test/test_io.py | Python | gpl-3.0 | 541 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sublime
from glob import glob
from ..api import deviot
from ..platformio.project_recognition import ProjectRecognition
from .quick_panel import quick_panel
from .tools import get_setting, save_setting, save_sysetting
from .preferences_bridge import Prefer... | gepd/Deviot | libraries/quick_menu.py | Python | apache-2.0 | 17,317 |
#
# 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... | apache/incubator-airflow | airflow/migrations/versions/d2ae31099d61_increase_text_size_for_mysql.py | Python | apache-2.0 | 1,488 |
from openerp.osv import fields, osv
from mako.template import Template
from mako.lookup import TemplateLookup
import os, inspect, subprocess, shutil, signal
# add permissions sudo with visudo
# visudo
# add this 2 lines in the file
# openerp ALL = NOPASSWD : /usr/bin/service openerp-* *
# openerp ALL = NOPASSWD : /usr... | jmesteve/saas3 | openerp/addons_extra/server_manager/server_manager.py | Python | agpl-3.0 | 10,953 |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Herald HTTP beans definition
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.3
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you... | librallu/cohorte-herald | python/herald/transports/http/beans.py | Python | apache-2.0 | 3,526 |
# -*- coding: utf-8 -*-
import random
# Animal data from Wikipedia circa Dec 2014.
animals = [
'Abditomys',
'Abeomelomys',
'Abrawayaomys',
'Abrocoma',
'Abrothrix',
'Acerodon',
'Acinonyx',
'Acomys',
'Aconaemys',
'Acrobates',
'Addax',
'Aegialomys',
'Aepeomys',
'A... | jachin/randomium | randomium/__init__.py | Python | mit | 37,956 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import MagicMock
from django.conf import settings
from draalcore.auth.templatetags.tags import social_auth
from draalcore.test_utils.basetest import BaseTest
class TemplateTagsTestCase(BaseTest):
def test_social_auth(self):
"""Test user's social au... | jojanper/draalcore | draalcore/auth/tests/test_templatetags.py | Python | mit | 582 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | ashutoshvt/psi4 | psi4/share/psi4/databases/A24alt.py | Python | lgpl-3.0 | 29,758 |
import gobject
import libqtile.hook
from libqtile.manager import Key
from libqtile.command import lazy
class Match(object):
''' Match for dynamic groups
it can match by title, class or role '''
def __init__(self, title=[], wm_class=[], role=[], wm_type=[]):
self._rules = [('title', t) for t i... | andrelaszlo/qtile | examples/config/dgroups.py | Python | mit | 5,538 |
"""
Contains the ClientManager class that can be used to manage a set of
clients.
"""
"""
Copyright 2011-2013 Gregory Holt
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/... | gholt/swiftly | swiftly/client/manager.py | Python | apache-2.0 | 2,442 |
# GA hello world
# Selection using ranking with ellitism
import sys
import random
import array
import copy
"""
Parameters to be tweaked
"""
elitePercent=5 # Percentage copied to next generation
selectPercent=50 # Top 50% available for selection
POPSIZE = 100 # population siz... | pauljohnleonard/pod-world | CI_2015/CI_examples/GAHelloWorld/02_gaHelloWorldElite.py | Python | gpl-2.0 | 3,403 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request.py | Python | mit | 2,817 |
# coding: utf-8
"""
插入所有需要的库,和函数
"""
import pandas as pd
#----------------------------------------------------------------------
def klLoad(self,bars=None):
"""载入合约数据"""
bars = pd.DataFrame.from_csv('datasig.csv')
kTool = self.canvas
for sig in kTool.sigPlots:
kTool.pwKL.removeItem(kTool.sig... | moonnejs/uiKLine | func-button/klLoad.py | Python | mit | 583 |
#!/usr/bin/env python
# coding=utf-8
# Copyright [2017] [B2W Digital]
#
# 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... | marvin-ai/marvin-python-toolbox | tests/engine_base/test_engine_base_data_handler.py | Python | apache-2.0 | 1,298 |
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import os,shutil,sys,re,random,datetime
from Utils import md5
import Build,Runner,Utils,Node,Logs,Options
from Logs import debug,warn,error
from Constants import*
algotype=NORMAL
COMPILE_TEMPLATE_SHELL='''
de... | micove/libdesktop-agnostic | wafadmin/Task.py | Python | lgpl-2.1 | 19,543 |
#
# 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... | tgroh/incubator-beam | sdks/python/apache_beam/coders/coders.py | Python | apache-2.0 | 29,611 |
# Copyright (C) 2012 Nippon Telegraph and Telephone 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 09zwcbupt/ryu | ryu/lib/packet/ipv4.py | Python | apache-2.0 | 3,105 |
#!/usr/bin/env python3
# vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79
"""
papatcher.py: simple python PA patcher
Copyright (c) 2014 Pyrus <pyrus@coffee-break.at>
See the file LICENSE for copying permission.
"""
from argparse import ArgumentParser
from concurrent import futures
from contextlib import contextmanage... | pa-pyrus/papatcher | papatcher.py | Python | mit | 17,605 |
import sys
import argparse
from svtools.external_cmd import ExternalCmd
class BedpeSort(ExternalCmd):
def __init__(self):
super(BedpeSort, self).__init__('bedpesort', 'bin/bedpesort')
def description():
return 'sort a BEDPE file'
def epilog():
return 'To read in stdin and output to a file, use /d... | hall-lab/svtools | svtools/bedpesort.py | Python | mit | 1,152 |
#! /usr/bin/env python
"""
Copyright 2010-2019 University Of Southern California
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 appl... | SCECcode/BBP | bbp/tests/test_gensrf.py | Python | apache-2.0 | 3,101 |
#!/usr/bin/env python
# Author: Alex Li
import multiprocessing
import sys, os, time
import db_connector, logger, MultiRunCounter
# ----------------Use Django Mysql model-------------
cur_dir = os.path.dirname(os.path.abspath(__file__))
script = 'python %s/run_command4.py' % cur_dir
try:
if sys.argv[1] == '-h':
... | Hpower96/Power | backend/multiprocessing_runCMD2.py | Python | gpl-3.0 | 1,849 |
from django.db.models import Manager
from django.contrib.contenttypes.models import ContentType
from .models import Attachment
class ResourceManager(Manager):
def __init__(self, resource_type):
super().__init__(self)
self.resource_type = resource_type
def get_queryset(self):
ct = Cont... | vladimiroff/humble-media | humblemedia/resources/managers.py | Python | mit | 604 |
"""
Support for MQTT JSON lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mqtt_json/
"""
import logging
import json
import voluptuous as vol
import homeassistant.components.mqtt as mqtt
from homeassistant.components.light import (
ATTR... | srcLurker/home-assistant | homeassistant/components/light/mqtt_json.py | Python | mit | 7,405 |
"""
WSGI config for news_site 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | maistrovas/News_app | news_site/wsgi.py | Python | mit | 395 |
# fr5969 model parameters
reg_size = 16
reg_bits = 20
mem_bits = 8
word_bits = 2 * mem_bits
ram_size = 2048
ram_start = 0x1c00
fram_size = 64512
fram_start = 0x4400
ivec_start = 0xff90
ivec_count = 56
lower_start = fram_start
lower_size = 0xbb80
upper_start = 0x10000
upper_size = 0x4000
resetvec = 0xfffe
reg_bitmask... | billzorn/msp-pymodel | lib/msp_fr5969_model.py | Python | mit | 7,045 |
"""
mediatum - a multimedia content repository
Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de>
Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de>
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 Foun... | mediatum/mediatum | web/admin/modules/default.py | Python | gpl-3.0 | 983 |
from __future__ import print_function
from pprint import pprint as pp
from yamicache import Cache
c = Cache(hashing=False)
@c.cached()
def function1(argument, power=4, addition=0, division=2):
return argument ** power + addition / division
def test_main():
"""use default args"""
# `function1` uses de... | mtik00/yamicache | tests/test_default_args.py | Python | mit | 638 |
import sys
import glob
import pkgutil
import os
import fnmatch
from setuptools import setup
from pycmm.settings import DNASEQ_SLURM_MONITOR_PIPELINE_BIN
from pycmm.settings import DUMMY_TABLE_ANNOVAR_BIN
from pycmm.settings import MUTREP_SLURM_MONITOR_PIPELINE_BIN
from pycmm.settings import MUTREP_FAMILY_REPORT_BIN
fro... | jessada/pyCMM | setup.py | Python | gpl-2.0 | 4,017 |
""" Fixtures for pyCurrentCost project """ | linkdd/phase-currentcost | tests/fixtures/__init__.py | Python | mit | 42 |
# Copyright 2015 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... | jonparrott/google-cloud-python | resource_manager/google/cloud/resource_manager/client.py | Python | apache-2.0 | 7,343 |
import os
import psutil
COEFFICIENT = 2 ** 20
def get_other_ram() -> int:
"""Ram used by other processes"""
return get_ram_used() - get_process_ram()
def get_total_ram() -> int:
mem = psutil.virtual_memory()
return mem[0] / COEFFICIENT
def get_process_ram() -> int:
process = psutil.Process(os.getpid())
re... | timlyo/personalWebsite | website/system.py | Python | apache-2.0 | 595 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.