code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 Jonathan Schultz
#
# 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 lat... | jschultz/nvivotools | NormaliseOpenQDA.py | Python | gpl-3.0 | 16,527 |
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as... | ttm/gmaneLegacy | setup.py | Python | unlicense | 4,479 |
import base64
import os
from hashlib import sha1 as sha
import pytest
from twisted.internet import reactor
from twisted.internet.error import CannotListenError
from twisted.python.failure import Failure
from twisted.web.http import FORBIDDEN
from twisted.web.resource import Resource
from twisted.web.server import Site... | Arzie/deluge | deluge/tests/test_core.py | Python | gpl-3.0 | 9,650 |
"""Test code for LRN"""
import numpy as np
import tvm
import topi
import logging
from topi.util import get_const_tuple
import topi.testing
def verify_lrn(shape, size, axis, bias, alpha, beta):
'''Verify Local response normalization operator by comparing outputs from tvm and numpy implementation'''
A = tvm.plac... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/topi/tests/python_cpp/test_topi_lrn.py | Python | apache-2.0 | 1,599 |
#https://www.codechef.com/SNCKQL17/problems/TEMPLELA
def checkeven(m):
if m%2==0:
return 1
else:
return 0
def cmp(a, b):
return (a > b) - (a < b)
def main():
n=int(input())
for i in range(n):
m=int(input())
j=list(map(int, input().split()))
if checkeven(m):
... | saisankargochhayat/algo_quest | Misc/mirror_num.py | Python | apache-2.0 | 721 |
# -*- coding: utf-8 -*-
import unittest
from nose.tools import ok_, eq_, assert_equal, assert_false, assert_true
# noinspection PyUnresolvedReferences
from .._tins import EthernetII, HWAddress, PDU, IP, TCP, RAW, PDUNotFound, UDP, ICMP, IPv4Address, ARP, PPI, Dot11Data
import platform
IS_MACOSX = platform.system().lo... | stephane-martin/cycapture | cycapture/libtins/tests/test_ppi.py | Python | lgpl-3.0 | 1,441 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import base64
import re
import pycurl
from module.network.RequestFactory import getRequest as get_request
from ..internal.Addon import Addon
from ..internal.misc import threaded
class ImageTyperzException(Exception):
def __init__(self, err):
... | igel-kun/pyload | module/plugins/hooks/ImageTyperz.py | Python | gpl-3.0 | 4,900 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Autor: Alexey V. Polurotov
# e-mail: niimailtah@gmail.com
# Common nick: Niimailtah
# ----------------------------------------------------------------------------
# https://projecteuler.net/problem=4
# Largest palindrome product
# Problem 4
#
# A palindromic number rea... | niimailtah/projecteuler.net | sources/problem004.py | Python | gpl-2.0 | 982 |
from __future__ import unicode_literals
from django.apps import AppConfig
class SequencerConfig(AppConfig):
name = 'sequencer'
| CARPEM/GalaxyDocker | data-manager-hegp/analysisManager/analysismanager/sequencer/apps.py | Python | mit | 134 |
'''
filecache -- http://code.google.com/p/filecache/
filecache is a decorator which saves the return value of functions even
after the interpreter dies. For example this is useful on functions that download
and parse webpages. All you need to do is specify how long
the return values should be cached (use seconds, like... | fish2000/django-signalqueue | distributors/cache.py | Python | bsd-3-clause | 5,942 |
../../../../../share/pyshared/twisted/names/dns.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/names/dns.py | Python | gpl-3.0 | 50 |
# -*- coding: utf-8 -*-
__version_info__ = ('0', '1', '0')
__version__ = '.'.join(__version_info__)
| martez81/pyDbWrapper | pydbwrapper/__init__.py | Python | bsd-3-clause | 101 |
from django.shortcuts import render, get_object_or_404
from django.utils import timezone
from .models import Post
from .forms import PostForm
from django.shortcuts import redirect
def post_list(request):
posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
return render(r... | xualex/DjangoTutorial | alex/blog/views.py | Python | mit | 1,458 |
# -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2013 Guake authors
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.
This progra... | joabelucena/guake | src/guake/common.py | Python | gpl-2.0 | 2,558 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
narralyzer.utils
~~~~~~~~~~~~~~~~
Misc utilities to support Narralyzer.
:copyright: (c) 2016 Koninklijke Bibliotheek, by Willem-Jan Faber.
:license: GPLv3, see licence.txt for more details.
"""
import codecs
import cPickle
import gzip
import jso... | WillemJan/Narralyzer | narralyzer/utils.py | Python | gpl-3.0 | 2,989 |
from rest_framework.pagination import LimitOffsetPagination, PageNumberPagination
class AthleteLimitOffsetPagination(LimitOffsetPagination):
max_limit = 10
default_limit = 2
class AthletePageNumberPagination(PageNumberPagination):
page_size = 5
| asmltd/gosports | webapp/athlete/achievements/pagination.py | Python | gpl-3.0 | 260 |
# settings.py
# Global settings of Elizabeth library.
SUPPORTED_LOCALES = {
"cs": {
'name': 'Czech',
'name_local': 'česky',
},
"da": {
"name": "Danish",
"name_local": "Dansk"
},
"de": {
"name": "German",
"name_local": "Deutsch"
},
"de-at": {
... | wikkiewikkie/elizabeth | elizabeth/settings.py | Python | mit | 2,067 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | flexVDI/cerbero | cerbero/bootstrap/build_tools.py | Python | lgpl-2.1 | 4,747 |
userId = 12330085
password = 'fy940705'
| chenzeyuczy/keba | src/api/config.py | Python | gpl-2.0 | 40 |
"""Tests for the HTTP component."""
from ipaddress import ip_address
from aiohttp import web
from homeassistant.components.http.const import KEY_REAL_IP
def mock_real_ip(app):
"""Inject middleware to mock real IP.
Returns a function to set the real IP.
"""
ip_to_mock = None
def set_ip_to_mock(... | PetePriority/home-assistant | tests/components/http/__init__.py | Python | apache-2.0 | 803 |
"""
Test breakpoint names.
"""
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class BreakpointNames(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi']... | google/llvm-propeller | lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py | Python | apache-2.0 | 18,412 |
#!/usr/bin/env python
# like the testsprite.c that comes with sdl, this pygame version shows
# lots of sprites moving around.
import pygame, sys, os
from pygame.locals import *
from random import randint
#import pygame.joystick
from pygame.compat import xrange_
##import FastRenderGroup as FRG
import pygame.sprite... | GertBurger/pygame_cffi | benchmarks/testsprite.py | Python | lgpl-2.1 | 5,259 |
from datetime import date, datetime, timedelta
from django.utils import timezone
from django.urls import reverse
from workshops.models import Person
from workshops.tests.base import TestBase
class TestEmptyDuplicates(TestBase):
"""Tests to return empty context variables when no matches found."""
def setUp(s... | swcarpentry/amy | amy/reports/tests/test_finding_duplicates.py | Python | mit | 10,423 |
"""Unit tests of resource managers."""
import pytest
from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only
from dlkit.abstract_osid.osid import errors
from dlkit.abstract_osid.type.objects import TypeList as abc_type_list
from dlkit.primordium.id.primitives import Id
fro... | mitsei/dlkit | tests/resource/test_managers.py | Python | mit | 26,397 |
import math
import unittest
from travelleruniverse.hexgrid import grid
from travelleruniverse.hexgrid import hex
class TestGrid(unittest.TestCase):
def setUp(self):
self.g = grid.Grid()
def test_hexByAxial(self):
"""Test returning a hex by index."""
for q in range(... | sjholden/traveller-universe | test/hexgrid/test_grid.py | Python | gpl-3.0 | 4,422 |
from __future__ import absolute_import
input_name = '../examples/diffusion/poisson_iga.py'
output_name = 'test_poisson_iga.vtk'
from tests_basic import TestInput
class Test(TestInput):
pass
| lokik/sfepy | tests/test_input_poisson_iga.py | Python | bsd-3-clause | 195 |
"""
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from itertools import chain
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
fro... | rds0751/colinkers | env/Lib/site-packages/django/forms/models.py | Python | agpl-3.0 | 56,541 |
import pytest
from firefly.validator import *
def add(a, b):
return a + b
def test_equal_args():
try:
validate_args(add, {"a": 1, "b":2})
except ValidationError:
pytest.fail("Did not expect a ValidationError")
def test_less_args():
with pytest.raises(ValidationError, message="Expected... | rorodata/firefly | tests/test_validator.py | Python | apache-2.0 | 531 |
#!/usr/bin/env python
import sys
from Bio import SeqIO
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-o','--output', dest = "outputFile", help = "Name of the output file")
parser.add_option('-k','--klength', dest = "kmerLength", help = "Length of kmer")
parser.add_option('-f','--readsfil... | updownlife/multipleK | data/case0814_paper/scripts/fasta_kmer.py | Python | gpl-2.0 | 1,429 |
from django.conf.urls import patterns, include, url
import views
urlpatterns = patterns('',
url(r'^logout', views.logout, name='logout'),
url(r'^newUser', views.newUser, name='newUser'),
url(r'^appHandler', views.appHandler, name='appHandler'),
url(r'^passToLogin', views.loginByPassword, name='passToL... | odeke-em/restAssured | auth/urls.py | Python | mit | 477 |
from django.contrib import admin
from . models import TeamMembers, Teams, CciGroups
admin.site.register(TeamMembers)
admin.site.register(Teams)
admin.site.register(CciGroups)
| aamod0611/Playground | Django/cci(team and teammembers done, 70%)/main/admin.py | Python | gpl-3.0 | 177 |
# Hidden Markov Model Implementation
import pylab as pyl
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy as scp
import scipy.ndimage as ni
import scipy.io
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
#import hrl_lib.mayavi2_util as mu
imp... | tapomayukh/projects_in_python | sandbox_tapo/src/skin_related/AI_Surface_Recognition/src/hmm_crossvalidation_force_5_states.py | Python | mit | 14,979 |
from io import StringIO
from unittest.mock import patch, Mock
from django.core.management import call_command
from django.utils import timezone
from axes.models import AccessAttempt, AccessLog
from axes.tests.base import AxesTestCase
class ResetAccessLogsManagementCommandTestCase(AxesTestCase):
def setUp(self):... | django-pci/django-axes | axes/tests/test_management.py | Python | mit | 3,765 |
import unittest
from collections import OrderedDict
from base64 import b64encode
from antigate import AntiGate
API_KEY = "2e9651d71c10def49389f40f9feb8794"
IMAGE1 = "captcha/123.jpg"
IMAGE2 = "captcha/456.jpg"
class TestAnigateCase(unittest.TestCase):
def test_balance(self):
balance = AntiGate(API_KEY).... | gotlium/antigate | test_cases.py | Python | gpl-3.0 | 3,949 |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... | rackerlabs/ironic | ironic/drivers/modules/pxe.py | Python | apache-2.0 | 18,755 |
# 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 u... | chhsia0/mesos | src/python/interface/src/mesos/interface/__init__.py | Python | apache-2.0 | 17,293 |
from lily.deals.api.serializers import DealWhyCustomerSerializer
from lily.deals.factories import DealWhyCustomerFactory
from lily.deals.models import DealWhyCustomer
from lily.tests.utils import GenericAPITestCase
class DealWhyCustomerTests(GenericAPITestCase):
"""
Class containing tests for the deal why cus... | HelloLily/hellolily | lily/deals/api/tests/test_why_customers.py | Python | agpl-3.0 | 1,188 |
# Copyright 2019 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 applicable law or agreed to ... | kubernetes-client/python | kubernetes/base/dynamic/resource.py | Python | apache-2.0 | 14,061 |
"""
Test Library Functions
As of Plex version 0.9.11 I noticed that you must be logged in
to browse even the plex server locatewd at localhost. You can
run this test suite with the following command:
>> python tests.py -u <USERNAME> -p <PASSWORD> -s <SERVERNAME>
"""
import argparse, sys, time
from os.path import dirn... | adrienbrault/python-plexapi | examples/tests.py | Python | bsd-3-clause | 9,783 |
#
# 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... | brandon-edwards/incubator-spot | spot-oa/oa/proxy/proxy_oa.py | Python | apache-2.0 | 14,945 |
#
# The Python Imaging Library.
# $Id$
#
# package placeholder
#
# Copyright (c) 1999 by Secret Labs AB.
#
# See the README file for information on usage and redistribution.
#
# ;-)
| zhaochl/python-utils | verify_code/Imaging-1.1.7/build/lib.linux-x86_64-2.7/__init__.py | Python | apache-2.0 | 183 |
#!/usr/bin/env python
""" MultiQC functions to plot a heatmap """
from __future__ import print_function
import logging
import random
from multiqc.utils import config, report
logger = logging.getLogger(__name__)
letters = "abcdefghijklmnopqrstuvwxyz"
def plot(data, xcats, ycats=None, pconfig=None):
"""Plot a ... | ewels/MultiQC | multiqc/plots/heatmap.py | Python | gpl-3.0 | 3,937 |
def extractVodkatranslationsCom(item):
'''
Parser for 'vodkatranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Ordinary I and Extraordinary Them', 'Ordinary I and Extraordin... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractVodkatranslationsCom.py | Python | bsd-3-clause | 671 |
#!/usr/bin/python
import os
import sys
LWAPTK_ROOT = '../../../../'
def main() :
# 1. Copy FD python parsing files
os.system( 'rm -rf fd' )
rv = os.system( 'cp -ra %(LWAPTK_ROOT)s/external/fd .'%globals() )
if rv != 0 :
print >> sys.stderr, "Could not copy FD parser files!"
sys.exit(1)
# 2. Call scons to ... | miquelramirez/LAPKT-public | 2.0/examples/fodet/parsing/build.py | Python | gpl-3.0 | 460 |
from mock import patch
from conf.appconfig import LEVEL_FAILED, LEVEL_FAILED_WARN, LEVEL_SUCCESS
from deployer.tasks import notification
@patch('deployer.tasks.notification.notify_hipchat')
def test_notify_when_disabled(m_notify_hipchat):
# Given: Disabled notifications
notifications = {
'hipchat': {... | totem/cluster-deployer | tests/unit/tasks/test_notification.py | Python | mit | 9,080 |
PA=80000
PB=200000
tca=0.03
tcb=0.015
a=0
while PA<PB:
PA+=PA*tca
PB+=PB*tcb
a+=1
print("o tempo necessario para que a população se iguale é %d anos" % a)
| andersonsilvade/python_C | Python32/lista 3/l3e3.py | Python | mit | 175 |
import os.path
from click.testing import CliRunner
import pytest
import geobuf
from geobuf.scripts.cli import cli
@pytest.fixture
def props_json():
return open(
os.path.join(os.path.dirname(__file__), "fixtures/props.json")).read()
def test_cli_version():
runner = CliRunner()
result = runner.i... | mapbox/pygeobuf | test/test_cli.py | Python | isc | 1,023 |
from __future__ import unicode_literals
import json
from django.core.exceptions import ValidationError
from django.conf import settings
from django.db import models, DatabaseError, transaction
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.core.cache import cache
from... | Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/jsonfield/fields.py | Python | mit | 6,268 |
from distutils.core import setup
setup(name='hamster2ac',
version='1.0',
scripts = [
'hamster2ac'
]
)
| komsas/hamster2ac | setup.py | Python | gpl-3.0 | 128 |
# 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 u... | mufaddalq/cloudstack-datera-driver | test/integration/component/test_security_groups.py | Python | apache-2.0 | 67,770 |
#!/usr/bin/python
"""
process_file(filename)
takes templated file .xxx.src and produces .xxx file where .xxx
is .pyf .f90 or .f using the following template rules:
'<..>' denotes a template.
All function and subroutine blocks in a source file with names that
contain '<..>' will be replicated according to ... | DailyActie/Surrogate-Model | 01-codes/numpy-master/numpy/distutils/from_template.py | Python | mit | 7,805 |
# This file is a small demo for the planner/python integration. Copy
# it under ~/.gnome2/planner/python/ and restart planner. You'll
# notice a new entry in the file->import menu.
#
ui_string = """
<ui>
<menubar name='MenuBar'>
<menu action='File'>
<menu action='Import'>
<placeholder name='Import... | bmillemathias/planner | python/python-demo.py | Python | gpl-2.0 | 1,008 |
#! /usr/bin/python3
import sys
import argparse
import itertools
from PIL import Image
if __name__ == '__main__':
argparser = argparse.ArgumentParser()
argparser.add_argument('input')
argparser.add_argument('palette',type=argparse.FileType('wb'))
argparser.add_argument('pattern',type=argparse.FileType(... | DrKylstein/gfxtools | nesimage.py | Python | mit | 5,828 |
from Sire.Base import *
import Sire
import shutil
import sys
import time
import os
import tempfile
import glob
from os.path import getsize, join
siredir = os.path.abspath( getInstallDir() )
print("\n#################################################################")
print( "# This script will create a sire.run i... | chryswoods/Sire | wrapper/python/scripts/package_sire.py | Python | gpl-2.0 | 2,504 |
# coding: utf-8
import os
import json
import glob
# import dataset
# from normality import slugify
# from datetime import datetime
from pprint import pprint # noqa
from common import DATA_PATH
from layers import LAYERS
SOURCE_PATH = os.path.join(DATA_PATH, 'flexicadastre', 'raw')
try:
os.makedirs(SOURCE_PATH)
exc... | ANCIR/mozambique | src/flexicadastre_geo.py | Python | mit | 1,922 |
import cv2
from os import path
import maproom.constants as c
def markerPath(fname):
return path.join('markers', fname)
print('wrote image with dims', c.charucoImgDims, 'maps to size', (c.charucoSqSizeM * c.charucoNSqHoriz, c.charucoSqSizeM * c.charucoNSqVert), 'meters')
print('or', (c.charucoSqSizeM * c.charucoNSq... | O-C-R/maproom-robots | skycam/generate_markers.py | Python | apache-2.0 | 1,469 |
from collections import OrderedDict
from frontera.exceptions import NotConfigured
from frontera.utils.misc import load_object
from frontera.settings import Settings, BaseSettings
from frontera.core.components import Backend, Middleware
from frontera.logger import FrontierLogger
from frontera.core import models
class... | sibiryakov/frontera | frontera/core/manager.py | Python | bsd-3-clause | 20,191 |
# coding: utf-8
"""
Provides logic for non-api routes related to user
"""
from google.appengine.api import images
from google.appengine.ext import blobstore
import flask
from main import app
import auth
import model
import util
from config import BUCKET
@app.route('/resource/<string:collection>/<string:category>/<... | wodore/wodore-ng | main/control/resource.py | Python | mit | 893 |
import os, os.path
import shutil
import time
from play.utils import *
COMMANDS = ['netbeansify', 'nb']
HELP = {
'netbeansify': 'Create all NetBeans configuration files'
}
def execute(**kargs):
command = kargs.get("command")
app = kargs.get("app")
args = kargs.get("args")
play_env = kargs.get("en... | chvrga/outdoor-explorer | java/play-1.4.4/framework/pym/play/commands/netbeans.py | Python | mit | 2,386 |
import builtins
from unittest import TestCase
from unittest.mock import Mock, patch
from .game import Game
class TestSolvable(TestCase):
"""
Tests around the recursive walk down the tree to ensure that solvableness
works.
"""
# --- Tests of is_solvable -------------------------------------------... | jamescooke/water-pouring-python | water/test.py | Python | gpl-2.0 | 3,356 |
#!/usr/bin/env python
from re import compile, findall, escape
__author__ = "Yoshiki Vazquez Baeza"
__copyright__ = "Copyright 2013, The American Gut Project"
__credits__ = ["Yoshiki Vazquez Baeza", "Adam Robbins-Pianka"]
__license__ = "BSD"
__version__ = "unversioned"
__maintainer__ = "Yoshiki Vazquez Baeza"
__email_... | wasade/American-Gut | americangut/format.py | Python | bsd-3-clause | 3,184 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# Copyright 2014 Steve Huang
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this... | stevehuang/TimeLapse | common/config.py | Python | apache-2.0 | 11,883 |
import bpy
from . import utils
from .config import CONFIG
from mathutils import Matrix
class Bone(object):
"""
Helper class to store Bone hierarhy data, animations and generate
Leadwerks compatible indexes for them
"""
def __init__(self, blender_data=None):
self.index = 0
self.name... | alrusdi/leadwerks-blender-exporter | io_scene_leadwerks/leadwerks/armature.py | Python | gpl-3.0 | 5,547 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from copy import deepcopy
from file_system import FileSystem, StatInfo, FileNotFoundError
from future import Gettable, Future
class _AsyncFetchFuture(objec... | cvsuser-chromium/chromium | chrome/common/extensions/docs/server2/patched_file_system.py | Python | bsd-3-clause | 6,057 |
from itertools import count
from operator import getitem
from toolz import identity
from .compatibility import zip_longest
from .core import (istask, get_dependencies, subs, toposort, flatten,
reverse_dict, add, inc, ishashable, preorder_traversal)
from .rewrite import END
def cull(dsk, keys):
... | wiso/dask | dask/optimize.py | Python | bsd-3-clause | 14,586 |
from __future__ import annotations
import logging
logger = logging.getLogger(__name__)
from libtbx.phil import parse
from dials.util import Sorry
# The phil parameters
phil_scope = parse(
"""
prediction {
d_min = None
.type = float
.help = "The maximum resolution limit"
d_max = None
... | dials/dials | algorithms/spot_prediction/reflection_predictor.py | Python | bsd-3-clause | 6,552 |
import os
import pickle
from astropy.extern import six
import numpy as np
from numpy.testing import assert_allclose
from scipy.interpolate import RectBivariateSpline
import sncosmo
from sncosmo.salt2utils import BicubicInterpolator, SALT2ColorLaw
# On Python 2 highest protocol is 2.
# Protocols 0 and 1 don't work o... | dannygoldstein/sncosmo | sncosmo/tests/test_salt2utils.py | Python | bsd-3-clause | 3,927 |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2018 Steve Kowalik <steven@wedontsleep.org> #
# ... | pymedusa/Medusa | ext/github/RequiredPullRequestReviews.py | Python | gpl-3.0 | 5,378 |
class System:
def __init__(self, name, urn, os, address, reboot_required):
self.name = name
self.urn = urn
self.os = os
self.address = address
self.rebootRequired = reboot_required
self.updCount = 0
self.packageUpdates = list()
def increment(self):
... | upd89/agent | upd89/classes/system_notify.py | Python | mit | 444 |
# File: supervisorTrajectory.py
# Date: 12/18/2013
# Description: A simple controller for the supervisor
# to record a robot's trajectory to file
# Author: Stefano Franchi
# Modifications:
from controller import Supervisor, Receiver, Node, Field
import time
import os
cla... | cleinias/Homeo | src/Tests/controllers/supervisorTrajectory/supervisorTrajectory.py | Python | gpl-3.0 | 7,543 |
import maya.OpenMaya as OpenMaya #@UnresolvedImport
import maya.cmds as cmds #@UnresolvedImport
'''
========================================================================
----> DAG Node Utilities <----
========================================================================
'''
class DAG_Node():
"""
*Argument... | nicholas-silveira/art_pipeline | maya/packages/oop_maya/core/maya_dag.py | Python | bsd-3-clause | 3,562 |
import os
import unittest
from vsg.rules import port
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_605_test_input.vhd'))
class test_port_rule(unittest.TestCase):
def setUp(self):
self.... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/port/test_rule_605.py | Python | gpl-3.0 | 743 |
# Model Type : Function / Constant / TABLE / ZEUS
ModelType = 'Function'
# Molecule
molec = '13co@xpol'
# inner Boundary condition
T_in = 1000.
# CMB temperature (Kelvin, outer B.C.)
T_cmb = 2.73
from sparx_xl.pre_unit import Msun2kg, mH2, yr2sec, AU2pc, m2pc, pc2m
# Mass Loss Rate (Msun yr-1 to H2 number per se... | itahsieh/sparx-alpha | preprocessor/presparx/AGB_sph1d/model.py | Python | gpl-3.0 | 1,971 |
import yobotproto
import gui
| mnunberg/yobot | py/__init__.py | Python | gpl-3.0 | 29 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | owlabs/incubator-airflow | tests/sensors/test_named_hive_partition_sensor.py | Python | apache-2.0 | 5,554 |
#!/bin/python
import ConfigParser
import logging
import time
import os
import signal
import sys
import RPi.GPIO as GPIO
from boxup_types import Colorcodes
# load visualization
from boxup_bicolormatrix import BicolorMatrixVisualization
from boxup_weatherradar import WeatherMatrixData
from boxup_gmailunread import Gmai... | noppelmax/boxup_core | boxup_core/boxup_core.py | Python | gpl-2.0 | 3,630 |
'''varscan.py
Usage:
varscan.py <sampledata> <indir> <outdir> <reference> <paths>
'''
# Import modules
import os
from general_python import moab, docopt, toolbox
from ngs_python.variant import varscan
from ngs_python.bam import samtools
from general_python import slurm
# Extract arguments
args = ... | adam-rabinowitz/ngs_analysis | scripts/Variants/varscanCamp.py | Python | gpl-2.0 | 6,147 |
#!/usr/bin/env python2
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, ... | eckardm/archivematica | src/MCPClient/lib/clientScripts/emailFailReport.py | Python | agpl-3.0 | 6,690 |
import sys
import os.path
import json
import requests
def load_json(filepath, logger):
# check if file exists
if not os.path.isfile(filepath):
logger.error('config file not found. exiting program...')
sys.exit(1)
with open(filepath, 'r') as conf_file:
try:
conf_json = json.loads(conf_file.re... | jakubtuchol/HNTracker | src/helper.py | Python | mit | 1,084 |
# 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... | eadgarchen/tensorflow | tensorflow/contrib/estimator/python/estimator/extenders_test.py | Python | apache-2.0 | 10,770 |
import sys
from django.conf import settings
import requests
import waffle
from nameparser import HumanName
def absolutify(url):
"""Takes a URL and prepends the SITE_URL"""
site_url = getattr(settings, 'SITE_URL', False)
# If we don't define it explicitly
if not site_url:
protocol = settings... | johngian/mozillians | mozillians/common/utils.py | Python | bsd-3-clause | 3,547 |
"""Add theme to config
Revision ID: 58ee75910929
Revises: 1c22ceb384a7
Create Date: 2015-08-28 15:15:47.971807
"""
# revision identifiers, used by Alembic.
revision = '58ee75910929'
down_revision = '1c22ceb384a7'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("INSERT INTO config (cat... | iseppi/zookeepr | alembic/versions/20_58ee75910929_add_theme_to_config_.py | Python | gpl-2.0 | 603 |
# Trains a classifier for paraphrase detection using sentence embeddings.
# First step is the construction of sentence embeddings.
# Second step is the classification, done with an SVM (simple for now, no parameter tuning).
import datetime
import math
import nltk.parse.bllip as bllip
import bllipparser
from nltk.parse... | Kelina/SentenceEmbeddings | TestClassifier.py | Python | apache-2.0 | 3,450 |
from django.conf.urls.defaults import *
urlpatterns = patterns('profiles.views',
# url(r'^$', 'profiles', {'template_name': 'profiles.html'}, name='profile_list'),
# url(r'^(?P<username>[\w\-]+)/$', 'profile', {'template_name': 'profile.html'}, name='profile_detail'),
)
| thoas/i386 | src/milkshape/application/internals/profiles/urls.py | Python | mit | 280 |
# Generated by Django 2.0 on 2018-06-27 14:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inscriptions', '0039_facture'),
]
operations = [
migrations.AddField(
model_name='challenge',
name='mode',
... | Puyb/inscriptions_roller | inscriptions/migrations/0040_challenge_mode.py | Python | gpl-3.0 | 559 |
#! /usr/bin/env python
import mock
import errno
import socket
import ssl
from collections import deque
from nsq import connection
from nsq import constants
from nsq import exceptions
from nsq import response
from nsq import util
from nsq import json
from common import MockedSocketTest, HttpClientIntegrationTest
cl... | dlecocq/nsq-py | test/test_connection.py | Python | mit | 24,133 |
from app import create_app
import os
default_config = 'development'
app = create_app(os.getenv('FLASK_CONFIG', default_config))
if __name__ == '__main__':
app.run() | jacobsky/shopping-aggregator | shopping-aggregator/run.py | Python | apache-2.0 | 168 |
#!/home/david/miniconda/envs/klusta/bin/python
import psutil
import time
import subprocess
import os
import glob
import fnmatch
import socket
import shutil
import argparse
import xml.etree.ElementTree as ET
# import resample
# TODO
# - add behavior tracking extraction
# - add LFP extraction
ssdDirectory = '/home/davi... | DavidTingley/ephys-processing-pipeline | processRecordings_phoenix.py | Python | gpl-3.0 | 11,566 |
#!/usr/bin/env python
from __future__ import print_function
from pytest import PLATFORM, skip, fixture
if PLATFORM == 'win32':
skip('Broken on Windows')
from circuits import Event, Component
from circuits.net.events import close
from circuits.net.sockets import UDPServer
from circuits.node import Node
class... | nizox/circuits | tests/node/test_server.py | Python | mit | 4,061 |
#!/usr/bin/env python
import freenect
import signal
import matplotlib.pyplot as mp
from misc.demo import frame_convert
mp.ion()
image_rgb = None
image_depth = None
keep_running = True
def display_depth(dev, data, timestamp):
global image_depth
data = frame_convert.pretty_depth(data)
mp.gray()
mp.f... | Dining-Engineers/left-luggage-detection | misc/demo/demo_mp_async.py | Python | gpl-2.0 | 1,051 |
#!/usr/bin/env python
# Helps to remember how to use something like perl's diamond operator
# in python
import fileinput
for line in fileinput.input():
print(line)
| aebm/tools | diamond.py | Python | bsd-2-clause | 170 |
import femagtools
import femagtools.airgap
import femagtools.plot
import os
import matplotlib.pyplot as plt
import logging
machine = dict(
name="PM 130 L4",
lfe=0.1,
poles=4,
outer_diam=0.13,
bore_diam=0.07,
inner_diam=0.015,
airgap=0.001,
stator=dict(
num_slots=12,
... | SEMAFORInformatik/femagtools | examples/calculation/fieldcalc.py | Python | bsd-2-clause | 1,723 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/convert/djvu_input.ui'
#
# Created: Thu Jul 19 23:32:30 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_... | Eksmo/calibre | src/calibre/gui2/convert/djvu_input_ui.py | Python | gpl-3.0 | 1,101 |
# -*- coding: utf-8 -*-
import 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 'Glossary.slug'
db.add_column(u'core_glossary', 'slug',
self.gf('django... | shh-dlce/pulotu | website/apps/core/migrations/0031_auto__add_field_glossary_slug.py | Python | apache-2.0 | 9,362 |
# -*- coding: utf-8 -*-
# (c) 2017 Andreas Motl, Elmyra UG <andreas.motl@elmyra.de>
import logging
from ConfigParser import NoOptionError
from pyramid.httpexceptions import HTTPBadGateway
from zope.interface.declarations import implements
from zope.interface.interface import Interface
from patzilla.access.depatech.clie... | ip-tools/ip-navigator | patzilla/access/depatech/clientpool.py | Python | agpl-3.0 | 3,563 |
from panda3d.core import *
from panda3d.direct import *
from direct.gui.DirectGui import *
from direct.directnotify import DirectNotifyGlobal
from otp.otpbase import OTPLocalizer
from toontown.toonbase import TTLocalizer
from otp.friends.FriendSecret import AccountSecret
from otp.friends.FriendSecret import AvatarSecre... | silly-wacky-3-town-toon/SOURCE-COD | toontown/friends/ToontownFriendSecret.py | Python | apache-2.0 | 3,157 |
import numpy as np
def leapyear(year):
if year%4 != 0:
return False
elif year%400 == 0:
return True
elif year%100 == 0:
return False
else:
return True
def leapyearcount(years):
a = np.where(years%4==0, 1, 0)
b = np.where(years%100==0, -1, 0)
c = np.where(yea... | djpine/pyman | Book/chap7/Supporting Materials/daysBtwnDates.py | Python | cc0-1.0 | 740 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
from gui import gui_charts
from gui import gui_data_objects
from gui import gui_options
class right_tab_widget:
def __init__(self,window):
self.win=window
frm=tk.Frame(window.frm_right)
self.sel_data=tk.StringVar(frm)
... | espensirnes/paneltime | paneltime/gui/gui_right_tabs.py | Python | gpl-3.0 | 1,335 |
"""Shared class to maintain Plex server instances."""
import logging
import ssl
import time
from urllib.parse import urlparse
from plexapi.client import PlexClient
from plexapi.exceptions import BadRequest, NotFound, Unauthorized
import plexapi.myplex
import plexapi.playqueue
import plexapi.server
from requests import... | sdague/home-assistant | homeassistant/components/plex/server.py | Python | apache-2.0 | 21,450 |
from collections import OrderedDict
from ..attr_dict import AttrDict
def test_attr_dict():
d1 = AttrDict([("foo", AttrDict([("bar", 1)]))])
d2 = AttrDict([("foo", AttrDict([("bar", 1)]))])
assert d1 == d2
def test_ordered_dict():
d1 = OrderedDict([("foo", OrderedDict([("bar", 1)]))])
d2 = Orde... | mediawiki-utilities/python-mwbase | mwbase/tests/test_attr_dict.py | Python | mit | 387 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.