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 |
|---|---|---|---|---|---|
"""Restricted resources
Revision ID: 35a6ffd7a079
Revises: 3b3583fcbaea
Create Date: 2014-03-19 04:55:01.382718
"""
# revision identifiers, used by Alembic.
revision = '35a6ffd7a079'
down_revision = '3b3583fcbaea'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.alter_column('resource', 'trust... | sindhus/lastuser | alembic/versions/35a6ffd7a079_restricted_resources.py | Python | bsd-2-clause | 447 |
import unittest
from katas.beta.strange_strings_parser import parser
class ParserTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(parser('12:56C:144:1000:1200'),
['12', '56C', '144', '1000', '1200'])
def test_equal_2(self):
self.assertEqual(parse... | the-zebulan/CodeWars | tests/beta_tests/test_strange_strings_parser.py | Python | mit | 622 |
# -*- coding: utf-8
#------------------------------------------------------------------#
__author__ = "Xavier MARCELET <xavier@marcelet.com>"
#------------------------------------------------------------------#
import sys
import logging
import termcolor
#----------------------------------------------------------... | psycofdj/xtdpy | xtd/core/logger/formatter.py | Python | gpl-3.0 | 1,884 |
# Copyright (c) 2013 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 ... | bswartz/cinder | cinder/tests/unit/api/contrib/test_availability_zones.py | Python | apache-2.0 | 1,945 |
#
# 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... | tabish121/quiver | python/quiver/server.py | Python | apache-2.0 | 6,188 |
"""Unsupervised nearest neighbors learner"""
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import RadiusNeighborsMixin
from .base import UnsupervisedMixin
class NearestNeighbors(NeighborsBase, KNeighborsMixin,
RadiusNeighborsMixin, UnsupervisedMixin):
"""Unsu... | florian-f/sklearn | sklearn/neighbors/unsupervised.py | Python | bsd-3-clause | 2,953 |
#!/usr/bin/python
#
# 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 b... | dietrichc/streamline-ppc-reports | examples/adwords/v201406/basic_operations/add_text_ads.py | Python | apache-2.0 | 3,105 |
#
# 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... | bOOm-X/spark | python/pyspark/sql/session.py | Python | apache-2.0 | 25,557 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | nightjean/Deep-Learning | tensorflow/tools/pip_package/pip_smoke_test.py | Python | apache-2.0 | 5,367 |
#!/usr/bin/env python
# encoding: utf-8
"""
knockouts.py
Created by Nikolaus Sonnenschein on 2008-02-25.
Copyright (c) 2008 Jacobs University of Bremen. All rights reserved.
"""
from metabolism import Metabolism
from util import ImportCplex
from ifba.glpki.glpki import *
class KnockOut(object):
"""A class putti... | phantomas1234/fbaproject | ifba/GlpkWrap/knockouts.py | Python | mit | 1,226 |
from yanntricks import *
def SenoTopologo():
pspict,fig = SinglePicture("SenoTopologo")
pspict.dilatation(5)
a=-0.5
b=0.5
x=var('x')
f=phyFunction(x*sin(1/x))
G=f.graph(a,b)
G.linear_plotpoints=2000
pspict.DrawGraphs(G)
pspict.axes.Dx=0.3
pspict.axes.Dy=0.3
pspict.DrawDe... | LaurentClaessens/mazhe | src_yanntricks/yanntricksSenoTopologo.py | Python | gpl-3.0 | 380 |
"""
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
"""
import fnmatch
import time
def reg(name):
"""
Activate this register to turn on a minion status tracking register, this
register keeps the current status beacon... | saltstack/salt | salt/thorium/status.py | Python | apache-2.0 | 1,056 |
from __future__ import absolute_import, print_function, unicode_literals
import json
from io import StringIO as IO
import yaml
from adr import config
from adr import query
from adr.query import format_query
class RunQuery(object):
def __init__(self, query_test):
self.query_test = query_test
def __... | ahal/active-data-recipes | test/test_queries.py | Python | mpl-2.0 | 2,301 |
import winsound #Import winsound library for winsound.Beep() function
import time #Import time library for time.sleep() function
morse_code = { #Dictionary containing each letter and their respective morse code
"a" : [0,1],
"b" : [1,0,0,0],
"c" : [1,0,1,0],
"d" : [1,0,0],
"e" : [0],
"f" : [0,0,1,0],
"g" : [1,1,0... | MorseDecoder/Morse-Code-Project | Input/User Input.py | Python | gpl-3.0 | 1,443 |
# analysis profile data
from .base import *
class FDPSProfile(DictNpArrayMix):
""" FDPS time profile for tree for one tree step
Keys: (class members)
collect_sam_ptcl (1D): collect sample
decompose_domain (1D): decompose domains
exchange_ptcl (1D): exchange particles
*set_parti... | P3T-ARC/P3TARC | tools/analysis/profile.py | Python | gpl-3.0 | 9,230 |
from utool.experimental import file_organizer
import utool as ut
SourceDir = file_organizer.SourceDir
d1 = self = SourceDir('/media/joncrall/store/Videos')
d2 = SourceDir('/media/joncrall/media/TV')
self, other = d1, d2
# TODO: NEED TO PURGE EVERY FILE NAMED Thumbs.db
comp = d1.isect_info(d2)
# Cascading duplic... | Erotemic/local | misc/ooo_script.py | Python | gpl-3.0 | 2,513 |
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
# See the COPYRIGHT file for more information
from kippo.core.honeypot import HoneyPotCommand
from twisted.internet import reactor
import time, re, hashlib, getopt
commands = {}
class command_ssh(HoneyPotCommand):
def start(self):
try:
op... | jullrich/dshieldhoneypot | kippo/kippo-0.8/kippo/commands/ssh.py | Python | gpl-2.0 | 3,350 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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... | rajathkumarmp/robocomp | tools/rcdns/src/rcdns.py | Python | gpl-3.0 | 3,535 |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | genodeftest/exaile | xl/common.py | Python | gpl-2.0 | 32,749 |
#!/usr/local/bin/python
"""
Grid graph nodes objective evolution with increasing k
"""
from __future__ import division
import sys
sys.path.insert(1, '..')
import __builtin__
import os
from MarkovChain import *
from MarkovChain.edge_objectives import *
import networkx as nx
import pandas as pd
PLOTS_DATA_DIR = "/hom... | chdhr-harshal/MCMonitor | src/python/experiments/grid_edges.py | Python | mit | 2,102 |
# Generated by YCM Generator at 2019-06-16 12:38:36.545120
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publis... | PysKa-Ratzinger/personal_project_euler_solutions | solutions/051-075/74/.ycm_extra_conf.py | Python | mit | 4,675 |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from bpy.props import B... | nortikin/sverchok | nodes/solid/validate.py | Python | gpl-3.0 | 2,513 |
# -*- coding: utf-8 -*-
"""
tests.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests regressions.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import gc
import sys
import flask
import threading
from werkzeug.exceptions import NotFound
... | nwags/flask | tests/test_regression.py | Python | bsd-3-clause | 2,467 |
with open("file.txt") as f:
print("a<caret>bc") | asedunov/intellij-community | python/testData/breadcrumbs/withAs.py | Python | apache-2.0 | 51 |
from const import *
import widget
import pguglobals
class ProgressBar(widget.Widget):
"""A progress bar widget.
Example:
w = gui.ProgressBar(0,0,100)
w.value = 25
"""
def __init__(self,value,min,max,**params):
params.setdefault('cls','progressbar')
widget.Widget._... | Southpaw-TACTIC/Team | src/python/Lib/site-packages/pgu/gui/misc.py | Python | epl-1.0 | 952 |
# Import required modules
from assets.modules.game import *
from assets.modules.screens.title_screen import *
from assets.modules.screens.win_screen import *
from assets.modules.mechanics2.background_music import *
pygame.init()
def main():
background_music("On")
while True:
title_screen()
ga... | Pimorez/INFPRJ02 | main.py | Python | gpl-3.0 | 449 |
#!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that release executables only contain certain symbols
and are only linked against allowed li... | jamesob/bitcoin | contrib/devtools/symbol-check.py | Python | mit | 9,709 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import sys, os, logging, socket, time, struct, select
import ctypes, errno, signal, threading, multiprocessing
import cPickle as pickle
import cpylmnl.linux.netlinkh as netlink
import cpylmnl.linux.netfilter.nfnetlin... | chamaken/cpylmnfct | examples/nfct-mnl-graphite-mmap.py | Python | gpl-2.0 | 14,893 |
# -*- coding: utf-8 -*-
from collections import namedtuple
SQLStatement = namedtuple('SQLStatement',
'sql_template, default_joins, default_where')
overview_running_runs_count = '''
SELECT IF(stop_date is null, 'running', 'finished') AS stop_status, COUNT(*) AS total_count
FROM test_runs
IN... | ShaolongHu/Nitrate | tcms/report/sqls.py | Python | gpl-2.0 | 19,100 |
from __future__ import absolute_import, unicode_literals
import email
import logging
from email.utils import formataddr
from collections import defaultdict
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import rev... | beol/reviewboard | reviewboard/notifications/email.py | Python | mit | 32,206 |
### / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / ###
### SCRIPT TO ANALYZE A TWEET CORPUS
###
### THIS SCRIPT READS DATA FROM A JSON FILE AND OFFERS THE USER
### THE FOLLOWING FOUR FUNCTIONS:
### - baseFreq() RETURNS UNIQUE WORDS IN THE CORPUS AS A
### DICTIONARY WITH THE WORD... | albertomh/py-tokentweet | corpusAnalyzer.py | Python | mit | 6,613 |
# -*- coding: utf-8 -*-
# Asymmetric Base Framework - A collection of utilities for django frameworks
# Copyright (C) 2013 Asymmetric Ventures Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | AsymmetricVentures/asym-displaymanager | asymmetricbase/displaymanager/field_position.py | Python | gpl-2.0 | 1,365 |
# Copyright (C) 2014 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... | pichuang/ryu | ryu/services/protocols/bgp/api/rpc_log_handler.py | Python | apache-2.0 | 1,161 |
#!/usr/bin/python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
#
# main.py
# Copyright (C) 2014 Rigo Macario <rigomacario@localhost.localdomain>
#
# GradienteDescendente is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Publi... | rigomac/P1IA1 | src/gradientedescendente.py | Python | gpl-3.0 | 5,997 |
# Copyright 2020 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/fedjax | fedjax/training/logging_test.py | Python | apache-2.0 | 1,360 |
#!/usr/bin/env python # -*- coding: utf-8 -*-
import telebot
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
bot = telebot.TeleBot("YOUR TOKEN HERE") # It's something like 123456789:ABCd1eFg2HijklmnOpqrstUvWXyz12A345
@bot.message_handler(commands=['start']) # This will react to the /start command
de... | danjol/telegram-chatbot | launch.py | Python | gpl-3.0 | 1,910 |
# coding=utf-8
# Copyright 2021 The vMF Embeddings 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 applicabl... | google-research/vmf_embeddings | vmf_embeddings/third_party/pytorch_metric_learning/compute_vmf_performance_metrics.py | Python | apache-2.0 | 7,548 |
# -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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... | clarkperkins/stackdio | stackdio/api/stacks/workflows.py | Python | apache-2.0 | 9,270 |
from vsg import parser
class assignment(parser.item):
'''
unique_id = association_element : assignment
'''
def __init__(self, sString):
parser.item.__init__(self, sString)
class formal_part(parser.item):
'''
unique_id = association_element : formal_part
'''
def __init__(se... | jeremiah-c-leary/vhdl-style-guide | vsg/token/association_element.py | Python | gpl-3.0 | 556 |
class IdentifiableElement():
def __init__(self):
self.id = None
self.label = None
| Somae/mdsd-factory-project | resources/de.mdelab.languages.resources/code-gen/factory/IdentifiableElement.py | Python | gpl-3.0 | 88 |
try:
graph = ximport("graph")
except ImportError:
graph = ximport("__init__")
reload(graph)
size(600, 600)
# A graph object.
g = graph.create(iterations=500, distance=1.0)
# Add nodes with a random id,
# connected to other random nodes.
for i in range(50):
node1 = g.add_node(random(500))
if rando... | gt-ros-pkg/rcommander-core | nodebox_qt/src/graph/graph_example2.py | Python | bsd-3-clause | 887 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
#
# This program is free software: y... | Elico-Corp/odoo-addons | website_recaptcha/__init__.py | Python | agpl-3.0 | 1,093 |
import unittest
import uuid
from unittest import mock
from tinydb import TinyDB, Query
from motey.repositories import service_repository
class TestServiceRepository(unittest.TestCase):
@classmethod
def setUp(self):
self.text_service_id = uuid.uuid4().hex
self.test_service = {'id': self.text_... | Neoklosch/Motey | tests/repositories/test_service_repository.py | Python | apache-2.0 | 2,546 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "shotcrete_selector"
PROJECT_SPACE_DIR... | mikewrock/phd_backup_full | build/shotcrete_points/catkin_generated/pkg.develspace.context.pc.py | Python | apache-2.0 | 378 |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 26 14:42:10 2017
@author: ksagilop
Use requests modules to retrieve info from website and download files
A nice tutorial:
https://gist.github.com/phillipsm/0ed98b2585f0ada5a769
TODO: List of books available
TODO: Merge this function with Gender Detection script
TODO: A... | pandastrail/InfoEng | scripting/exercises/p06_requests_web_files.py | Python | gpl-3.0 | 1,645 |
import sys
from unittest.mock import patch
import pytest
from importlib import reload
import pynamodb.settings
@pytest.mark.parametrize('settings_str', [
"session_cls = object()",
"request_timeout_seconds = 5",
])
def test_override_old_attributes(settings_str, tmpdir):
custom_settings = tmpdir.join("pyn... | jlafon/PynamoDB | tests/test_settings.py | Python | mit | 643 |
# -*- coding: utf-8 -*-
# Authors: See README.RST for Contributors
# Copyright 2015-2016 See __openerp__.py for Authors
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Report qweb auto generation",
"version": "9.0.1.0.0",
"depends": [
"report",
],
"external_d... | be-cloud-be/horizon-addons | server-tools/base_report_auto_create_qweb/__openerp__.py | Python | agpl-3.0 | 987 |
#
# colors.py -- color definitions
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import re
color_dict = {
'aliceblue': (0.9411764705882353, 0.9725490196078431, 1.0... | eteq/ginga | ginga/colors.py | Python | bsd-3-clause | 48,361 |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | Donkyhotay/MoonPy | zope/publisher/tests/basetestipublicationrequest.py | Python | gpl-3.0 | 2,904 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2019 atrain_match developers
#
# This file is part of atrain_match.
#
# atrain_match 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 versio... | foua-pps/atrain_match | atrain_match/process_atrain_match.py | Python | gpl-3.0 | 6,827 |
"""This module is part of Swampy, a suite of programs available from
allendowney.com/swampy.
Copyright 2010 Allen B. Downey
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
"""
import unittest
import TurmiteWorld
class Tests(unittest.TestCase):
def test_turmite_world(self):
... | DoWhatILove/turtle | programming/python/design/swampy/TurmiteWorld_test.py | Python | mit | 769 |
# Example of low-level Python wrapper for rpi_ws281x library.
# Author: Tony DiCola (tony@tonydicola.com), Jeremy Garff (jer@jers.net)
#
# This is an example of how to use the SWIG-generated _rpi_ws281x module.
# You probably don't want to use this unless you are building your own library,
# because the SWIG generated ... | bitoffdev/perkins-blues | src/controller_model.py | Python | mit | 5,788 |
# Django settings for Town_Country project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/... | khawley/Town_Country | Town_Country/settings.py | Python | mit | 5,665 |
# -*- coding: utf-8 -*-
import sys
import pip.download
from pip.req import parse_requirements
from setuptools import setup, find_packages
exec(open('steenzout/barcode/metadata.py').read())
PREFIX = 'py%s%s' % (sys.version_info.major, sys.version_info.minor)
def requirements(requirements_file):
"""Return pac... | steenzout/python-barcode | setup.py | Python | mit | 1,606 |
##
# Copyright 2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http://w... | geimer/easybuild-easyblocks | easybuild/easyblocks/e/esmf.py | Python | gpl-2.0 | 4,100 |
from dbdownload import *
__version__ = VERSION
| rcarmo/DBdownload | dbdownload/__init__.py | Python | mit | 48 |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for ``flocker.node.agents.ebs``.
"""
from twisted.python.filepath import FilePath
from twisted.trial.unittest import SynchronousTestCase
from ..ebs import AttachedUnexpectedDevice, _expected_device
class AttachedUnexpectedDeviceTests(Synchronou... | agonzalezro/flocker | flocker/node/agents/test/test_ebs.py | Python | apache-2.0 | 1,829 |
from __future__ import absolute_import
import logging
import os.path
import re
from pip._vendor.packaging.version import parse as parse_version
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip._internal.exceptions import BadCom... | gnmiller/craig-bot | craig-bot/lib/python3.6/site-packages/pip/_internal/vcs/git.py | Python | mit | 12,960 |
"""Tests for the Config Entry Flow helper."""
from unittest.mock import patch, Mock
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.helpers import config_entry_flow
from tests.common import (
MockConfigEntry, MockModule, mock_coro, mock_integration)
@pytest.fixt... | MartinHjelmare/home-assistant | tests/helpers/test_config_entry_flow.py | Python | apache-2.0 | 8,659 |
from common_fixtures import * # NOQA
def test_snapshot_with_root_on_longhorn_1(super_client, client):
port = 6091
snapshot_count = 5
snapshot_revert_index = 3
env, service, con, snapshots = revert_to_snapshot(
super_client, client,
"root-snap5-revert3", port, snapshot_count, snapshot_... | jimengliu/longhorn-tests | validation-test/storagetest/core/test_longhorn_vmsnapshot.py | Python | apache-2.0 | 26,670 |
"""===========================
Geneset analysis
===========================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Overview
========
This pipeline performs gene set analysis of one or more
genesets.
Input data are two collections of files, genelists and pathways.
Genelists are tabular d... | CGATOxford/CGATPipelines | obsolete/pipeline_genesets.py | Python | mit | 12,292 |
from django import forms
from django.contrib.auth.models import User
from UserManagement.models import Attendent
from django.core.exceptions import ValidationError
# --- Entitiy Management Forms ------
class UserModelForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
confirm_passwo... | SkillSmart/ConferenceManagementSystem | Authentication/forms.py | Python | mit | 1,565 |
# -*- coding: utf-8 -*-
from django.conf import settings as django_settings
from . import defaults
__all__ = ['settings']
class Settings:
"""
Get a setting from django settings or\
Spirit's defaults. In that order
"""
def __getattr__(self, item):
try:
return getattr(django_... | nitely/Spirit | spirit/core/conf/settings.py | Python | mit | 434 |
from urlparse import urlparse
from django.core.paginator import Paginator
from django.http import QueryDict
from nose.tools import eq_
from test_utils import RequestFactory
from amo.tests import ESTestCase, TestCase
from mkt.api.paginator import MetaSerializer, ESPaginator
from mkt.webapps.indexers import WebappInd... | andymckay/zamboni | mkt/api/tests/test_paginator.py | Python | bsd-3-clause | 4,864 |
from math import exp
class Contagion():
def __init__(self, network, canBeInfected, tryToInfect, infect):
self.network = network
self.canBeInfected = canBeInfected
self.tryToInfect = tryToInfect
self.infect = infect
def aggrSpread(self, alreadyChecked, nodesLeft, conditions, rec... | jfarid27/CFP-Simplified | simulation/Contagion/__init__.py | Python | gpl-3.0 | 2,868 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_configuration.py | Python | mit | 3,261 |
#8.4 Open the file romeo.txt and read it line by line. For each line, split the line into a
#list of words using the split() function.
#The program should build a list of words.
#For each word on each line check to see if the word is already in the list and if not append it to the list.
# When the program completes, so... | missulmer/Pythonstudy | coursera_python_specialization/8_4.py | Python | cc0-1.0 | 1,047 |
import requests
from collections import defaultdict
from requests.exceptions import RequestException
from django.conf import settings
from django.utils.dateparse import parse_datetime
import sal.plugin
import server.utils as utils
class CryptStatus(sal.plugin.DetailPlugin):
description = 'FileVault Escrow Stat... | salopensource/sal | server/plugins/cryptstatus/cryptstatus.py | Python | apache-2.0 | 1,772 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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
# (at your option) any later version.
#
# wger W... | DeveloperMal/wger | wger/gym/tests/test_user.py | Python | agpl-3.0 | 9,229 |
#
# 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... | ptkool/spark | python/pyspark/sql/tests/test_dataframe.py | Python | apache-2.0 | 38,168 |
# Software selection text spoke
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distrib... | vathpela/anaconda | pyanaconda/ui/tui/spokes/software_selection.py | Python | gpl-2.0 | 13,495 |
# coding: utf-8
# In[ ]:
import numpy as np
import numexpr as ne
def sym_decorrelation_ne(W):
""" Symmetric decorrelation """
K = np.dot(W, W.T)
s, u = np.linalg.eigh(K)
return (u @ np.diag(1.0/np.sqrt(s)) @ u.T) @ W
# logcosh
def g_logcosh_ne(wx,alpha):
"""derivatives of logcosh"""
return n... | 663project/fastica_lz | fastica_lz/fastica_lz.py | Python | mit | 2,082 |
#!/usr/bin/env python3
from modules.pastafari.models import servers
from paramecio.cromosoma.webmodel import WebModel
from paramecio.cromosoma import corefields
from paramecio.cromosoma.extrafields.dictfield import DictField
from paramecio.cromosoma.extrafields.arrayfield import ArrayField
from paramecio.cromosoma.ext... | paramecio/pastafari | models/tasks.py | Python | gpl-2.0 | 4,555 |
# Copyright 2013 VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | gkotton/vmware-nsx | vmware-nsx/neutron/tests/unit/vmware/test_dhcpmeta.py | Python | apache-2.0 | 62,619 |
#!/usr/bin/python
# To add two numbers
var1 = input("Enter the first number : ")
var2 = input("Enter the second number : ")
var1, var2 = var2, var1
print "Swapped numbers are {0} and {1}".format(var1, var2)
| ramesharpu/python | basic-coding/swap-two-variables.py | Python | gpl-2.0 | 211 |
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
BASE_DIR = os.path.abspath(__file__)
for _ in range(3):
BASE_DIR = os.path.dirname(BASE_DIR)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'weaverbird',
'USER': 'pos... | weaverbird/weaverbird-backend | src/weaverbird/settings/base.py | Python | mit | 3,046 |
#!/usr/bin/env python3
#
# PyQt5Template. Created on 21.04.2015
# Copyright (c) 2015 Andreas Schulz
#
# The MIT License (MIT)
#
# 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 restric... | dev-platypus/templates | PyQt5Template/main.py | Python | gpl-3.0 | 1,689 |
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# Don't load autoconfig.yml (this is required as of v2.0.0)
config.load_autoconfig(False)
# Name of the session to load by default
c.session.default_name = "default"
# Automatically save the current session
c.auto_save.session = True
# ... | bddenhartog/dotfiles | qutebrowser/.config/qutebrowser/config.py | Python | mit | 7,171 |
from __future__ import unicode_literals
from hashlib import md5
class KnowledgeMiddleware(object):
def process_request(self, request):
request._secret_token = self.generate_token(request)
def generate_token(self, request):
if request.user.is_authenticated():
return request.user.... | eliostvs/django-kb | kb/middleware.py | Python | bsd-3-clause | 472 |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from enum import Enum
from io import BytesIO
import logging
import optp... | Mrs-X/PIVX | test/functional/test_framework/test_framework.py | Python | mit | 49,063 |
# Some useful functions to extract data out of emails
# Copyright (C) 2002-2012 John Goerzen & contributors
#
# 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 Lic... | styk-tv/offlineimap | offlineimap/emailutil.py | Python | gpl-2.0 | 1,573 |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | aam-at/tensorflow | tensorflow/python/keras/mixed_precision/autocast_variable.py | Python | apache-2.0 | 19,643 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import inspect
import logging
import hashlib
import re
import unicodedata
from werkzeug import urls
from werkzeug.exceptions import NotFound
from odoo import api, fields, models, tools
from odoo.addons.http_routing.mod... | richard-willowit/odoo | addons/website/models/website.py | Python | gpl-3.0 | 30,818 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from nose.plugins.attrib import attr
from nose.tools import * # PEP8 asserts
from textblob.translate import Translator
from textblob.compat import unicode
@attr('requires_internet')
class TestTranslator(unittest.TestCase):
def setUp... | bbengfort/TextBlob | tests/test_translate.py | Python | mit | 1,627 |
# -*- coding: utf-8 -*-
'''
Copyright (c) 2015 Jacob Mendt
Created on 05.08.15
@author: mendt
'''
import uuid
import os
from georeference.settings import ELASTICSEARCH_INDEX
from georeference.settings import GEOREFERENCE_PERSITENT_TARGETDIR
from georeference.settings import OAI_ID_PATTERN
from georeference.settings ... | slub/vk2-georeference | georeference/persistent/jobs/genericjobs.py | Python | gpl-3.0 | 3,721 |
#!/usr/bin/python
#
# Copyright 2011 Ytai Ben-Tsvi. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
#... | ytai/ioio | tools/hex_communicator.py | Python | apache-2.0 | 2,547 |
# -*- coding: utf-8 -*-
# Copyright 2017 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 ... | google/turbinia | turbinia/processors/mount_local.py | Python | apache-2.0 | 15,621 |
import re
import os.path
import datetime
import base64
import aql
# ==============================================================================
info = aql.get_aql_info()
HEADER = """#!/usr/bin/env python
#
# THIS FILE WAS AUTO-GENERATED. DO NOT EDIT!
#
# Copyright (c) 2011-{year} of the {name} project, site: {ur... | aqualid/aqualid | make/aql_linker.py | Python | mit | 11,736 |
# -- coding: utf-8 --
"""
pysteps.verification.lifetime
=============================
Estimation of precipitation lifetime from
a decaying verification score function
(e.g. autocorrelation function).
.. autosummary::
:toctree: ../generated/
lifetime
lifetime_init
lifetime_accum
lif... | pySTEPS/pysteps | pysteps/verification/lifetime.py | Python | bsd-3-clause | 4,985 |
import ir_report
import py3o_report
import py3o_template
import py3o_server
import py3o_fusion_filetype
| xcgd/report_py3o | __init__.py | Python | agpl-3.0 | 104 |
#!/usr/bin/python3
from ABE_ExpanderPi import IO
import time
"""
# ================================================
# ABElectronics Expander Pi | - IO Interrupts Demo
# Version 1.0 Created 21/08/2014
# Version 1.1 Updated 11/06/2017 updated to include changes to Expander Pi library
#
# Requires python smbus to be ins... | abelectronicsuk/ABElectronics_Python3_Libraries | ExpanderPi/demo-iointerrupts.py | Python | mit | 1,862 |
# -*- coding: utf-8 -*-
from django.db import models
from django_orm.postgresql.fields.arrays import ArrayField
from django_orm.postgresql.fields.interval import IntervalField
from django_orm.postgresql.fields.bytea import ByteaField
from django_orm.manager import Manager
class IntModel(models.Model):
lista = Arr... | cr8ivecodesmith/django-orm-extensions-save22 | tests/old_test_apps/old_pg_complex/models.py | Python | bsd-3-clause | 1,710 |
# -*- coding: utf-8 -*-
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0010_migrate_domain_data'),
]
operations = [
migrations.RemoveField(
model_name='domain',
name='url',
),
]
| rtfd/readthedocs.org | readthedocs/projects/migrations/0011_delete-url.py | Python | mit | 302 |
#################################################################
# MET v2 Metadate Explorer Tool
#
# This Software is Open Source. See License: https://github.com/TERENA/met/blob/master/LICENSE.md
# Copyright (c) 2012, TERENA All rights reserved.
#
# This Software is based on MET v1 developed for TERENA by Yaco Sistem... | TERENA/met | met/metadataparser/query_export.py | Python | bsd-2-clause | 4,096 |
import pygame
import screens.sound as sound
class Mine:
def __init__(self, session, tile):
self.tile = tile
self.x = tile.x
self.y = tile.y
self.session = session
self.image = pygame.image.load('resources/templates/Sea_mine.png')
self.rect = pygame.rect.Rect(self.x *... | sinoz/boat-wars | src/play/mine.py | Python | apache-2.0 | 1,469 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['RelativeDifference'] , ['MovingMedian'] , ['BestCycle'] , ['AR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_MovingMedian_BestCycle_AR.py | Python | bsd-3-clause | 163 |
#!/usr/bin/python
# Nathan Harmon
# https://github.com/nharmon/bogie-five
#
# Turn program
#
from Motion import *
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
exit("Must specify target image file")
try:
drive = Drive()
drive.turn(float(sys.argv[1]))
except:
... | nharmon/bogie-five | src/turn.py | Python | gpl-3.0 | 356 |
import os
import tempfile
from findex_gui.main import python_env
class CronController:
@staticmethod
def has_cronjob():
crontab = os.popen("crontab -l").read()
cronjob = CronController.generate_cronjob()
if cronjob in crontab:
return True
return
@staticmethod
... | skftn/findex-gui | findex_gui/controllers/admin/scheduler/cron.py | Python | mit | 1,807 |
# -*- coding: utf-8 -*-
"""
This Python module is part of the mataraclari package, which provides
some mathematical shortcuts for Python.
Copyright (C) 2011 Yaşar Arabacı
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... | yasar11732/PyMathGerec | mataraclari/_carpanlar.py | Python | gpl-3.0 | 2,114 |
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | dpendl00/headphones | lib/beets/ui/migrate.py | Python | gpl-3.0 | 13,453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.