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 |
|---|---|---|---|---|---|
"""
incisive: Tiny library for handling csv
=======================================
"""
from .core import read_csv, write_csv, format_to_csv
__version__ = '0.1.0'
__title__ = 'incisive'
__author__ = 'Taurus Olson'
__license__ = 'MIT'
| TaurusOlson/incisive | incisive/__init__.py | Python | mit | 238 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyTraceback2(PythonPackage):
"""Backports of the traceback module"""
homepage = "http... | iulian787/spack | var/spack/repos/builtin/packages/py-traceback2/package.py | Python | lgpl-2.1 | 836 |
# Copyright 2016 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... | googlefonts/nototools | nototools/hb_input.py | Python | apache-2.0 | 13,368 |
# Copyright 2017 Rice University
#
# 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 writin... | capergroup/bayou | src/main/python/bayou/models/low_level_evidences/architecture.py | Python | apache-2.0 | 5,511 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Midokura Europe SARL, All Rights Reserved.
# 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://w... | celebdor/python-midonetclient | src/midonetclient/neutron/chain_rule.py | Python | apache-2.0 | 3,528 |
from growler_guys import scrape_growler_guys
| ryanpitts/growlerbot | scrapers/__init__.py | Python | mit | 45 |
import matplotlib.pyplot as plt
import numpy as np
import pdb
if __name__ == "__main__":
fig, ax = plt.subplots(figsize=(10,5))
for clients in (10, 50, 100, 200):
median_data = np.zeros(5)
for k in (1, 2, 3, 4, 5):
data = np.loadtxt("loss_" + str(clients) + "_" + str(k) + ".csv... | DistributedML/TorML | eurosys-eval/results_tor_no_tor/makeplot.py | Python | mit | 1,404 |
from django.db import models
class Report(models.Model):
id = models.IntegerField(primary_key = True)
name = models.CharField(max_length = 200)
url = models.CharField(max_length = 10)
def __unicode__(self):
return self.url
| fedorahungary/fedinv | fedinv/swag_reports/models.py | Python | gpl-2.0 | 233 |
###
# Copyright (c) 2013, Frumious Bandersnatch
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | kg-bot/SupyBot | plugins/Goo/config.py | Python | gpl-3.0 | 2,348 |
#!/usr/bin/env python
""":mod:`Redirection <testbed.resources._redirect>` tests."""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
import json as _json
import unittest as _unittest
from urllib import quote as _percent_encode
import napper as _napper
import spruce.logging as _lo... | nisavid/testbed | testbed/tests/redirect.py | Python | lgpl-3.0 | 4,763 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | joshmoore/zeroc-ice | cs/test/Ice/operations/run.py | Python | gpl-2.0 | 1,339 |
from direct.directnotify import DirectNotifyGlobal
from toontown.classicchars.DistributedDaisyAI import DistributedDaisyAI
class DistributedSockHopDaisyAI(DistributedDaisyAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedSockHopDaisyAI")
| silly-wacky-3-town-toon/SOURCE-COD | toontown/classicchars/DistributedSockHopDaisyAI.py | Python | apache-2.0 | 263 |
"""
"""
from neoteric.util.compat import unittest
from neoteric.resource.tracker import ResourceTracker, DuplicateResourceError
class ResourceTrackerTests(unittest.TestCase):
def test_all(self):
r = ResourceTracker()
r['test'] = 'abc123'
self.assertEqual(r['test'], 'abc123')
with ... | j3ffhubb/neoteric | tests/neoteric/resource/test_tracker.py | Python | gpl-3.0 | 482 |
from __future__ import annotations
import copy
from typing import Dict, List
from bson import ObjectId
from mongoengine import DoesNotExist
from monkey_island.cc.models.edge import Edge
RIGHT_ARROW = "\u2192"
class EdgeService(Edge):
@staticmethod
def get_all_edges() -> List[EdgeService]:
return E... | guardicore/monkey | monkey/monkey_island/cc/services/edge/edge.py | Python | gpl-3.0 | 3,128 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Author: Aldo Sotolongo
# @Date: 2017-01-13 15:17:37
# @Last Modified by: Aldo Sotolongo
# @Last Modified time: 2017-01-15 21:04:43
# Description: Small program to get some info about shares in ZFS Storage Appliance.
from __future__ import print_function
import json
impo... | aldenso/tools | ZFS/zfssainfo.py | Python | gpl-2.0 | 4,422 |
from flask import Blueprint
from flask import session
second = Blueprint('schedule', __name__)
@second.route('/')
def home():
names = session['names']
return str(names) | tacksoo/excel2pdf | schedule.py | Python | mit | 178 |
#!/usr/bin/env python
# Copyright (C) 2005, 2018 by INRIA
import numpy as np
# import siconos.numerics * fails with py.test!
import siconos.numerics as SN
def mcp_function(n, z, F):
M = np.array([[2., 1.],
[1., 2.]])
q = np.array([-5., -6.])
F[:] = np.dot(M,z) + q
pass
def mcp_Nablaf... | fperignon/siconos | numerics/swig/tests/test_mcp2.py | Python | apache-2.0 | 1,437 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = os.environ['DEBUG']
ALLOWED_HOSTS = os.environ['ALLOWED_HOSTS']
ROOT_URLCONF = 'mywebsite.urls'
WSGI_APPLICATION = 'mywebsite.wsgi.application'
INSTALLED_APPS = (
'django.contrib.adm... | tpeek/Personal-Website | mywebsite/mywebsite/settings.py | Python | mit | 1,864 |
# Django settings for demo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if usin... | qingfeng/django-ajax-tag | demo/settings.py | Python | bsd-2-clause | 2,844 |
import test
s = """<entry>
<id>tag:search.twitter.com,2005,1142881099</id>
<published>2009-01-23T20:04:53Z</published>
</entry> """
print s.find(">")
print len(s.split(':'))
print len(s.split('>')[2].split(':'))
def h(x=1, y=3, z=4):
return[x, y, z]
print h(1,2)
print h(1,z=5)
# test.testEqual(... | mgooel/106-Extra-Credit | practice.py | Python | mit | 6,103 |
from pygame.locals import *
import pygame
from util import save_yaml
from dialog import FloatDialog
from util import gamedir
import json
import os
from tempsprites import Tempsprites
from button import render_text
class Journal(list):
"""
>>> from journal import Journal
>>> j = Journal()
>>> j.autosave... | ajventer/mirthless | src/lib/journal.py | Python | mit | 3,165 |
# if k is even, return True
# else return False
def even(k):
return str(k)[-1] in ('0', '2', '4', '6', '8')
if __name__ == '__main__':
#test1
print('k = 4')
print(even(4))
#test2
print('k = 5')
print(even(5))
| maxiee/DataStructuresAlgorithmsPythonExercises | chapter1/r_1_2.py | Python | gpl-2.0 | 239 |
# Copyright (c) 2012 Adi Roiban.
# See LICENSE for details.
from __future__ import (
absolute_import,
print_function,
with_statement,
unicode_literals,
)
import os
class ProjectPaths(object):
"""
Container for common path used by the build system.
"""
def __init__(self, os_name, b... | chevah/brink | brink/paths.py | Python | bsd-3-clause | 1,656 |
# this progrma will implement the merge sort
# keep care of using python 3.5
def arraycopy(to, start, end, source):
"copy the array"
for index in range(start, end):
to[index] = source[index]
def mergeparts(v, start, middle, end, work):
"merge the two part into one in array v"
ipart1 = start;
... | smileboywtu/Algorithms-Python3 | sort/merge-sort/merge-sort.py | Python | gpl-2.0 | 1,401 |
#!/usr/bin/env python
# encoding: utf-8
"""
generateSequences.py
Created by Brant Faircloth on 2009-03-28.
Copyright (c) 2009 Brant Faircloth. All rights reserved.
"""
import pdb
import motif
import numpy
def generateSequence(motifs, outfile, max_rep = 14):
for m in motifs:
motif_length = m[0]
fo... | brantfaircloth/msatcommander | msat/helper/generateSequences.py | Python | gpl-2.0 | 1,336 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the 4n6time SQLite database output module CLI arguments helper."""
import argparse
import unittest
from plaso.cli.helpers import sqlite_4n6time_output
from plaso.lib import errors
from plaso.output import sqlite_4n6time
from tests.cli import test_lib as cli_test... | dc3-plaso/plaso | tests/cli/helpers/sqlite_4n6time_output.py | Python | apache-2.0 | 2,905 |
# Copyright 2022 The Brax 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 to in wri... | google/brax | brax/math.py | Python | apache-2.0 | 4,570 |
"""
Infrastructure code for testing Gabble by pretending to be a Jabber server.
"""
import base64
import os
import hashlib
import sys
import random
import re
import traceback
import ns
import constants as cs
import servicetest
from servicetest import (
assertEquals, assertLength, assertContains, wrap_channel,
... | mlundblad/telepathy-gabble | tests/twisted/gabbletest.py | Python | lgpl-2.1 | 27,467 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio Demosite 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
# Li... | hachreak/invenio-demosite | invenio_demosite/modules/deposit/workflows/article.py | Python | gpl-2.0 | 9,880 |
from attest import Tests, assert_hook
from attest.hook import ExpressionEvaluator
suite = Tests()
@suite.test
def eval():
value = 1 + 1
samples = {
'isinstance(value, int)': 'True',
'value == int("2")': "(2 == 2)",
'type(value).__name__': "'int'",
'value == 5 - 3': '(2 == 2)... | dag/attest | attest/tests/hook.py | Python | bsd-2-clause | 829 |
# Copyright 2012 Knowledge Economy Developments Ltd
#
# Henry Gomersall
# heng@kedevelopments.co.uk
#
# 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 y... | fredRos/pyFFTW | test/test_pyfftw_base.py | Python | gpl-3.0 | 6,478 |
#! /usr/bin/env python3
"""Iterator for BLAST M8 (BLAST+ output format 6) files
Copyright:
b6.py monitor iterate over and return entries of a B6/M8 file
Copyright (C) 2015 William Brazelton, Alex Hyer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU... | Brazelton-Lab/bio_utils | bio_utils/iterators/b6.py | Python | gpl-3.0 | 12,735 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space 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 t... | mozts2005/OuterSpace | server/res/rules/standard/rules.py | Python | gpl-2.0 | 10,205 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
video decoding for the AR.Drone.
parts of code from Bastian Venthur, Jean-Baptiste Passot, Florian Lacrampe.
"""
# < imports >--------------------------------------------------------------------------------------
import array
import cProfile
import datetime
import lo... | projeto-si-lansab/si-lansab | ARDrone/arVideo.py | Python | gpl-2.0 | 27,307 |
import logging
from abc import (ABCMeta,
abstractmethod)
from treeherder.model.models import MatcherManager
logger = logging.getLogger(__name__)
class Detector(object):
__metaclass__ = ABCMeta
name = None
"""Class that is called with a list of lines that correspond to
unmatched, in... | MikeLing/treeherder | treeherder/autoclassify/detectors.py | Python | mpl-2.0 | 1,557 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "python-gitlab",
version = "0.1",
packages = find_packages(),
install_requires = ['requests', 'markdown'],
# metadata for upload to PyPI
author = "Itxaka Serrano Garcia",
author_email = "itxakaserrano@gmail.co... | erikjwaxx/python-gitlab-1 | setup.py | Python | gpl-3.0 | 502 |
#!/usr/bin/python3
from gi.repository import Gtk, GObject
from util import trackers
import singletons
import constants as c
import status
class PowerWidget(Gtk.Frame):
"""
PowerWidget is a child of InfoPanel, and is only shown if we're on
a system that can run on battery power. It is usually only visibl... | leigh123linux/cinnamon-screensaver | src/widgets/powerWidget.py | Python | gpl-2.0 | 3,343 |
#!/usr/bin/env python
# Copyright 2017 The Kubernetes 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 appli... | mikedanese/test-infra | scenarios/canarypush.py | Python | apache-2.0 | 2,752 |
# Copyright 2017 The Oppia 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 applicable ... | prasanna08/oppia-ml | main.py | Python | apache-2.0 | 1,996 |
#!/usr/bin/env python
"""Spout tests"""
import time
import pytest
import python_pachyderm
from python_pachyderm.service import pps_proto, pfs_proto
def test_create_spout():
client = python_pachyderm.Client()
client.delete_all()
client.create_pipeline(
pipeline_name="pipeline-create-spout",
... | kalugny/pypachy | tests/test_spout.py | Python | mit | 1,279 |
from django.db import models
from django.core.urlresolvers import reverse
class TextBit(models.Model):
name = models.CharField(max_length=100, primary_key=True)
content = models.TextField()
def get_update_url(self):
return reverse('textbits:update', args=[self.pk])
def __unicode__(self):
... | DArtagan/teetimer | extra/models.py | Python | mit | 674 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
================================================================================
mingus - Music theory Python package, midi package
Copyright (C) 2008-2009, Bart Spaans
This program is free software: you can redistribute it and/or modify
it under the term... | spiderbit/canta-ng | mingus/midi/__init__.py | Python | gpl-3.0 | 1,177 |
# Copyright (C) 2012 David Morton
#
# 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 later version.
#
# This program is distribut... | davidlmorton/spikepy | spikepy/builtins/methods/clustering_k_means/__init__.py | Python | gpl-3.0 | 3,719 |
from __future__ import unicode_literals
import sys
import io
from contextlib import contextmanager
import unittest
from mcinfo import cli
@contextmanager
def redirect_stdout_stdin(new_stdout, new_stdin):
old_stdout, sys.stdout = sys.stdout, new_stdout
old_stdin, sys.stdin = sys.stdin, new_stdin
try:
... | randomdude999/mcinfo | tests/test_cli.py | Python | mit | 2,303 |
import soundcloud
class Player(object):
def __init__(self):
self.client = soundcloud.Client(client_id="REMOVED FOR SECURITY PURPOSES")
self.user_id = "REMOVED"
def get_url(self, resource):
"""Grabs the permalink for whatever SoundCloud resource you'd like.
For example,... | Acour83/ashflashtheorig | media.py | Python | mit | 964 |
# -*- coding: utf-8 -*-
try:
import BaseHTTPServer as server
except ImportError:
import http.server as server
try:
from urlparse impor... | Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/pyfttt/server.py | Python | gpl-2.0 | 4,646 |
# -*- coding: utf-8 -*-
# YAFF is yet another force-field code.
# Copyright (C) 2011 Toon Verstraelen <Toon.Verstraelen@UGent.be>,
# Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>, Center for Molecular Modeling
# (CMM), Ghent University, Ghent, Belgium; all rights reserved unless otherwise
# stated.
#
# This file is pa... | molmod/yaff | yaff/conversion/test/test_gaussian.py | Python | gpl-3.0 | 5,408 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'This is a DMARC report parser that accepts either an XML or zipped file as input at an attachment via email',
'author': 'Elmer Thomas',
'url': '',
'download_url': '',
'author_email': 'elmer.thoma... | thinkingserious/sendgrid-python-dmarc-parser | setup.py | Python | mit | 608 |
__all__ = ('ForwardRefPolicy', 'TypeHintWarning', 'typechecked', 'check_return_type',
'check_argument_types', 'check_type', 'TypeWarning', 'TypeChecker',
'typeguard_ignore')
import collections.abc
import gc
import inspect
import sys
import threading
from collections import OrderedDict
from enum i... | glenngillen/dotfiles | .vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/typeguard/__init__.py | Python | mit | 46,364 |
#!/usr/bin/env python
# Calculate a table of dihedral angle interactions used in the alpha-helix
# and beta-sheet regions of the frustrated protein model described in
# provided in figure 8 of the supplemental materials section of:
# AI Jewett, A Baumketner and J-E Shea, PNAS, 101 (36), 13192-13197, (2004)
# Note tha... | crtrott/lammps | tools/moltemplate/examples/coarse_grained_examples/protein_folding_examples/1bead+chaperone/frustrated/moltemplate_files/generate_tables/calc_dihedral_table.py | Python | gpl-2.0 | 2,713 |
# -*- coding: utf-8 -*-
# 213. House Robber II
# Note: This is an extension of House Robber.
#
# After robbing those houses on that street, the thief has found himself a new place for his thievery
# so that he will not get too much attention. This time, all houses at this place are arranged in a circle.
# That means th... | gengwg/leetcode | 213_house_robber_ii.py | Python | apache-2.0 | 1,670 |
# Copyright (c) 2019, CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribu... | lucalianas/ProMort | promort/clinical_annotations_manager/views.py | Python | mit | 14,550 |
from changes.models import User
from changes.testutils import APITestCase
class UserDetailsTest(APITestCase):
def test_simple(self):
user = self.create_user(email='foobar@example.com')
path = '/api/0/users/{0}/'.format(user.id)
resp = self.client.get(path)
assert resp.status_code... | alex/changes | tests/changes/api/test_user_details.py | Python | apache-2.0 | 1,350 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2016-01-18
git sha ... | lcoandrade/DsgTools | core/Misc/QGIS_Scripts/virtual_raster_inloco.py | Python | gpl-2.0 | 3,081 |
"""
Django settings for chatbot_website project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
imp... | Catherine-Chu/DeepQA | chatbot_website/chatbot_website/settings.py | Python | apache-2.0 | 4,300 |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import fs_uae_launcher.fsui as fsui
from .IRCPanel import IRCPanel
from .Netplay import Netplay
class LobbyPanel(IRCPanel):
def __init__(self, parent):
IRCPanel.__init__(self, paren... | lunixbochs/fs-uae-gles | launcher/fs_uae_launcher/LobbyPanel.py | Python | gpl-2.0 | 2,483 |
# txt2sif.py -- Convert .txt into a .sif format
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .txt to .sif')
parser.add_argument('txt', help="""txt file to convert. Fields are :
<gene 1 name in ACSN> <name of relationship> <gene 2 name in ACSN> <semi-colon sepa... | chagaz/sfan | code/txt2sif.py | Python | mit | 857 |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "f 10 0.033, s, f 20 0.033, s, f 30 0.033, s, f 30 0.033, s, q"
tags = "particles, Flower"
import pyglet
import summa
from summa.director import ... | shackra/thomas-aquinas | tests/test_particle_flower.py | Python | bsd-3-clause | 911 |
import wx
import sys
import os
for item in ("libsrvr", "../server/lib"):
if os.path.exists(item):
sys.path.insert(0, item)
break
import sequip
from FinishConstrHandlers import FinishConstrHandlers
from DependencyPanel import DependencyPanel
from config import Config
from ige.ospace import Rules... | Lukc/ospace-lukc | client-TechViewer/TechViewer.py | Python | gpl-2.0 | 24,696 |
from xssnotifier.main import main
main()
| mattiaslundberg/xssnotifier-server | run.py | Python | bsd-2-clause | 42 |
import os
import sys
import unittest
sys.path.append(os.getcwd())
from parsing.file_parser import *
class FileParserTest(unittest.TestCase):
def test_parse_tape(self):
self.assertEqual(parse_tape_from_file('tape: (asd,a,asd)', 0),
['asd', 'a', 'asd'])
self.assertEqual(pars... | ytsvetkov/TuringMachine | unittests/test_file_parser.py | Python | gpl-3.0 | 5,658 |
from django.contrib import admin
from admin_views.admin import AdminViews
from django.shortcuts import redirect
from example_project.example_app.models import TestModel
class TestAdmin(AdminViews):
admin_views = (
('Process This', 'process'), # Admin view
('Go to LJW', 'http:/... | frankwiles/django-admin-views | example_project/example_project/example_app/admin.py | Python | bsd-3-clause | 490 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013- Yan Shoshitaishvili aka. zardus
# Ruoyu Wang aka. fish
# Andrew Dutcher aka. rhelmot
# Kevin Borgolte aka. cao
#
# This program is free software; you can redistribute it and/or modify
# it un... | chubbymaggie/idalink | idalink/idalink.py | Python | gpl-3.0 | 8,058 |
# Copyright 2022 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 writ... | googleapis/python-compute | samples/recipes/instances/custom_machine_types/extra_mem_no_helper.py | Python | apache-2.0 | 895 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | runt18/nupic | tests/unit/nupic/support/custom_configuration_test.py | Python | agpl-3.0 | 42,200 |
from . version import __version__
| ksomemo/ciserviceex | ciserviceex/__init__.py | Python | mit | 35 |
# coding: utf-8
from typing import Union, Callable
from .path import Path
class Protection(Path):
"""Useful to protect samples from being pulled apart when setting up a test.
"""
def __init__(self,
time: float,
cmd: float,
condition1: Union[str, bool, Callable],
... | LaboratoireMecaniqueLille/crappy | crappy/blocks/generator_path/protection.py | Python | gpl-2.0 | 2,204 |
import argparse
import pandas as pd
from data_utils import clean_tweet
def main():
from data_utils import RUBTSOVA_HEADER
parser = argparse.ArgumentParser()
parser.add_argument('files', metavar='F',
nargs='+',
help='CSV files to process',
... | tech-team/sentiment | preprocess/rubtsova_csv_to_corpus.py | Python | mit | 839 |
from __future__ import print_function
from gocd_cli.command import BaseCommand
from gocd_cli.utils import get_settings
__all__ = ['Decrypt', 'Encrypt']
class BaseEncryptionCommand(object):
_encryption_module = None
_settings = None
@property
def settings(self):
if self._settings is None:
... | gaqzi/py-gocd-cli | gocd_cli/commands/settings.py | Python | mit | 2,834 |
#!/usr/bin/env python
# Standard packages
import sys
import cyvcf2
import argparse
import geneimpacts
from cyvcf2 import VCF
def get_effects(variant, annotation_keys):
effects = []
effects += [geneimpacts.SnpEff(e, annotation_keys) for e in variant.INFO.get("ANN").split(",")]
return effects
def get_t... | GastonLab/ddb-scripts | specialist/scan_multi-gene_annotated_snpEff.py | Python | mit | 1,956 |
from moksha.api.streams import PollingDataStream
from jqplotdemo.controllers.plots import get_plot_data, make_data, get_pie_data
class JQPlotDemoStream(PollingDataStream):
frequency = 1.0
def poll(self):
self.send_message('jqplot.demo.plot', get_plot_data())
self.send_message('jqplot.demo.pie'... | ralphbean/moksha | moksha/apps/demo/MokshaJQPlotDemo/jqplotdemo/streams.py | Python | apache-2.0 | 338 |
#!/usr/bin/env python
"""Web authentication classes for the GUI."""
import collections
from django import http
import logging
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import log
from grr.lib import registry
class BaseWebAuthManager(object):
"""A class managing web authentic... | MiniSEC/GRR_clone | gui/webauth.py | Python | apache-2.0 | 4,111 |
#! /usr/bin/env python
"""
Created on Thu Jun 29 11:02:28 2017
@author: njlyons
"""
from matplotlib.backend_bases import Event
from matplotlib.pyplot import gcf
from numpy.testing import assert_equal
from landlab import RasterModelGrid, imshow_grid
from landlab.plot.event_handler import query_grid_on_button_press
d... | landlab/landlab | tests/plot/test_event_handler.py | Python | mit | 1,165 |
# -*- 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 'WikiPage.rating_sum'
db.add_column(u'mezzanine_wiki_wikip... | dfalk/mezzanine-wiki | mezzanine_wiki/migrations/0006_auto__add_field_wikipage_rating_sum__add_field_wikipage_created__add_f.py | Python | bsd-2-clause | 9,474 |
# Lesson 1
def iterative_factorial(n):
result = 1
for i in range(1, n + 1):
result *= i
return result
print(iterative_factorial(5))
# "Recursion" is the act of calling a function from within itself. Some functions naturally work better recursively.
# Recursion is easier to work out if you write... | JonTheBurger/python_class | chapter 4/lessons/recursion.py | Python | mit | 609 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from winsys._compat import unittest
import uuid
import winerror
import win32api
import win32con
import win32evtlog
import win32security
import pywintypes
from winsys.tests import utils as testutils
from winsys import event_logs, registry, uti... | operepo/ope | laptop_credential/winsys/tests/test_event_logs.py | Python | mit | 6,794 |
DEBUG = True
TOKEN_SECRET = 'keyboard cat'
FACEBOOK_SECRET = 'Facebook Client Secret'
FOURSQUARE_SECRET = 'Foursquare Client Secret'
GOOGLE_SECRET = 'Google Client Secret'
LINKEDIN_SECRET = 'LinkedIn Client Secret'
TWITTER_CONSUMER_KEY = 'Twitter Consumer Secret'
TWITTER_CONSUMER_SECRET = 'Twitter Consumer Secret'
TWIT... | timsvoice/satellizer | examples/server/python/config.py | Python | mit | 407 |
# Copyright (c) 2012 OpenStack Foundation
#
# 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 t... | tianweizhang/nova | nova/tests/fake_policy.py | Python | apache-2.0 | 16,571 |
"""
This is the test suite for space.py.
"""
from unittest import TestCase, main, skip
from indra.agent import Agent, X, Y
from indra.space import DEF_HEIGHT, DEF_WIDTH
from indra.space import Space, distance
from indra.tests.test_agent import create_newton, create_hardy, create_leibniz
from indra.tests.test_agent im... | gcallah/Indra | indra/tests/test_space.py | Python | gpl-3.0 | 8,912 |
"""
===================
Label image regions
===================
This example shows how to segment an image with image labelling. The following
steps are applied:
1. Thresholding with automatic Otsu method
2. Close small holes with binary closing
3. Remove artifacts touching image border
4. Measure image regions to fi... | Hiyorimi/scikit-image | doc/examples/segmentation/plot_label.py | Python | bsd-3-clause | 1,493 |
# Copyright (c) 2014 Red Hat, 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 require... | thomasem/nova | nova/scheduler/client/__init__.py | Python | apache-2.0 | 2,731 |
my_file = open("/tmp/my_file", "w")
my_file.write("Test string")
my_file.close()
my_file = open("/tmp/my_file", "r")
content = my_file.read()
my_file.close()
if (content == "Test string"):
print("OK")
else:
print("KO")
| Nakrez/RePy | tests/parser/good/file.py | Python | mit | 229 |
# xlreg_py/xlreg/regCred.py
""" Registry credentials as seen by client. """
import binascii
from xlutil import parse_decimal_version
SHA1_BYTES = 20
SHA2_BYTES = 32
class RegCredError(RuntimeError):
""" xlReg-related exception. """
class RegCred(object):
""" Registry credentials as seen by client. """
... | jddixon/xlreg_py | src/xlreg/reg_cred.py | Python | mit | 6,142 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | FNST-OpenStack/cloudkitty-dashboard | cloudkittydashboard/dashboards/admin/pricing/tabs.py | Python | apache-2.0 | 2,562 |
class BaseDabbaException(Exception):
@property
def message(self):
return self.args[0]
class ProcessingException(BaseDabbaException):
def __init__(self, message, slug=None, info=None):
super(ProcessingException, self).__init__(message)
self.slug = slug
self.info = info
... | voidfiles/dabba | dabba/exceptions.py | Python | mit | 799 |
#!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | hujiajie/chromium-crosswalk | tools/valgrind/asan/third_party/asan_symbolize.py | Python | bsd-3-clause | 16,609 |
#!/usr/bin/pythonTest
# -*- coding: utf-8 -*-
#
# String Names
#
# 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.
#
# Thi... | netvigator/myPyPacks | pyPacks/String/Names.py | Python | gpl-2.0 | 56,111 |
from model_mommy import mommy
from django.test import TestCase
from ..models import Department, Employee
class DepartmentTestMommy(TestCase):
"""Department's modle test case."""
def test_department_creation_mommy(self):
"""Test create department's model."""
new_department = mommy.make('employ... | maurobaraldi/ll_interview_application | luizalabs/employees/tests/tests_models.py | Python | gpl-3.0 | 866 |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='django-cms-bootstrap-templates',
version='0.0.1',
author=u'Arne Schauf',
author_email='python.asmaps.de',
packages=['cms_bootstrap_templates'],
url='https://github.com/asmaps/django-cms-bootstrap-templates',
license='MIT ... | asmaps/django-cms-bootstrap-templates | setup.py | Python | mit | 520 |
import os
from setuptools import setup, find_packages
__VERSION__ = "18.01.0"
with open('README.md') as f:
long_description = f.read()
setup(
name='dice_tools',
version=__VERSION__,
author='DICEhub',
author_email='info@dicehub.com',
description='DICE application tools',
long_description=l... | dicehub/dice_tools | setup.py | Python | mit | 493 |
# encoding: utf-8
from django.urls import reverse
from rest_framework import serializers
from entity.serializers import DetailSerializerV2
from externaltools.models import ExternalTool
from mainsite.serializers import StripTagsCharField
from mainsite.utils import OriginSetting
class ExternalToolSerializerV2(Detail... | concentricsky/badgr-server | apps/externaltools/serializers_v2.py | Python | agpl-3.0 | 1,423 |
'''
Created on 21.07.2013
@author: bronikkk
'''
import re
from ti.sema import *
def findReModule():
import config
importer = config.data.importer
return importer.importedFiles['re']
def findReName(name):
module = findReModule()
var = module.getScope().findName(name)
assert len(var.nodeType)... | bronikkk/tirpan | std/re_.py | Python | gpl-3.0 | 2,038 |
__RCSID__ = "$Id$"
import socket
import select
import time
import os
from DIRAC.Core.DISET.private.Transports.BaseTransport import BaseTransport
from DIRAC.FrameworkSystem.Client.Logger import gLogger
from DIRAC.Core.Utilities.ReturnValues import S_ERROR, S_OK
class PlainTransport( BaseTransport ):
def initAsClien... | arrabito/DIRAC | Core/DISET/private/Transports/PlainTransport.py | Python | gpl-3.0 | 4,193 |
""" configuration module for awsu, contains two objects """
import boto3
import sqlite3
import logging
import getpass
import datetime
import configparser
import uuid
import requests
import json
from dateutil.tz import tzutc
from urllib.parse import urlencode, quote_plus
from os import environ
from bs4 import BeautifulS... | rizkidoank/awsu | awsu/config.py | Python | gpl-3.0 | 11,653 |
import unittest
from test import support
from _testcapi import getargs_keywords
import warnings
warnings.filterwarnings("ignore",
category=DeprecationWarning,
message=".*integer argument expected, got float",
module=__name__)
warnings.filterwarnin... | mancoast/CPythonPyc_test | fail/314_test_getargs2.py | Python | gpl-3.0 | 11,329 |
from datetime import datetime, timedelta
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']
DATE_FORMAT = '%Y-%m-%d %H:%M:%S GMT'
schema = {
'name': {
'type': 'string',
'minlength': 3,
'maxlength': 50,
'required': True,
},
'occurre... | waoliveros/historia | settings.py | Python | mit | 1,196 |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2021] EMBL-European Bioinformatics Institute
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... | RNAcentral/rnacentral-import-pipeline | tests/databases/psicquic/parser_test.py | Python | apache-2.0 | 5,789 |
#!/usr/bin/env python
#
# restrict_long_contigs.py
#
# USAGE: restrict_long_contigs.py [options] <input_directory> \
# <output_directory>
#
# Options:
# -h, --help show this help message and exit
# -l MINLEN, --minlen=MINLEN
# Minimum length o... | widdowquinn/scripts | bioinformatics/restrict_long_contigs.py | Python | mit | 7,563 |
../../../share/pyshared/FSM.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/FSM.py | Python | gpl-3.0 | 30 |
#!/usr/bin/env python
"""Toy Parser Generator is a lexical and syntactic parser generator
for Python. This generator was born from a simple statement: YACC
is too complex to use in simple cases (calculators, configuration
files, small programming languages, ...).
TPG can very simply write parsers that are usefull for... | alanqthomas/seawolf-lang | tpg.py | Python | gpl-3.0 | 81,869 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.