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
# encoding: utf-8
"""
forms.py
Created by Darcy Liu on 2012-03-01.
Copyright (c) 2012 Close To U. All rights reserved.
"""
from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from models import *
class ThreadForm(ModelForm):
ti... | darcyliu/storyboard | board/forms.py | Python | mit | 881 |
from lucy.models import LucyObject
class Config(LucyObject):
_type = 'metadata'
def __init__(self, _id, incoming, pool, **kwargs):
super(Config, self).__init__(_id=_id,
incoming=incoming,
pool=pool,
... | paultag/lucy | lucy/models/config.py | Python | mit | 339 |
#! usr/bin/python
from __future__ import print_function, division, absolute_import
from os import remove
from os.path import join, abspath
from sys import stdout, exit
from time import time
import multiprocessing as mp
from argparse import ArgumentParser
import logging
import numpy as np
from disvis import DisVis, PD... | haddocking/disvis | disvis/main.py | Python | apache-2.0 | 23,344 |
# -*- coding:utf-8 -*-
# Author: Kei Choi(hanul93@gmail.com)
import re
import os
import kernel
import kavutil
# -------------------------------------------------------------------------
# KavMain ํด๋์ค
# -------------------------------------------------------------------------
class KavMain:
# ------------------... | hanul93/kicomav | Engine/plugins/eps.py | Python | gpl-2.0 | 7,004 |
from __future__ import print_function, division, absolute_import
import matplotlib
matplotlib.use('Agg')
import os
os.environ['ODIN'] = 'float32,gpu'
import sys
import time
from collections import defaultdict
import numpy as np
from odin import visual as V, nnet as N
from odin.utils import (ctext, unique_labels, Uni... | imito/odin | examples/nist_sre/speech_features_extraction.py | Python | mit | 4,811 |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | sestrella/ansible | test/units/modules/network/ios/test_ios_ping.py | Python | gpl-3.0 | 2,838 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains math helper functions.
"""
from __future__ import with_statement
import logging
import math
import utils
im... | junjiemao/pynlpini | pynlpini/lib/gensim/matutils.py | Python | gpl-2.0 | 26,204 |
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("", include("budget.urls")),
path("admin/", admin.site.urls),
path("users/", include("users.urls")),
]
| ltowarek/budget-supervisor | budgetsupervisor/budgetsupervisor/urls.py | Python | mit | 208 |
from syned.beamline.optical_element import OpticalElement
from syned.beamline.shape import BoundaryShape
class Absorber(OpticalElement):
def __init__(self, name="Undefined", boundary_shape=None):
if boundary_shape is None:
boundary_shape = BoundaryShape()
OpticalElement.__init__(self, ... | srio/minishadow | shadow4/syned/absorbers/absorber.py | Python | mit | 361 |
# -*- coding: utf-8 -*-
import os
import re
from nose.tools import nottest
from blockdiag.tests.utils import capture_stderr, TemporaryDirectory
from blockdiag.tests.utils import supported_pil, supported_pdf
import blockdiag
import blockdiag.command
def get_fontpath(testdir=None):
if testdir is None:
tes... | aboyett/blockdiag | src/blockdiag/tests/test_generate_diagram.py | Python | apache-2.0 | 3,345 |
"""This file includes the Worker class which sits on the client side.
It implements the Ray API functions that are forwarded through grpc calls
to the server.
"""
import inspect
from typing import List
from typing import Tuple
import ray.cloudpickle as cloudpickle
from ray.util.inspect import is_cython
import grpc
im... | richardliaw/ray | python/ray/experimental/client/worker.py | Python | apache-2.0 | 6,769 |
"""
Copyright 2009 55 Minutes (http://www.55minutes.com)
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... | calvinchengx/django-coverage | django_coverage/coverage_runner.py | Python | apache-2.0 | 4,391 |
from __future__ import absolute_import
from .afterqc import MultiqcModule
| ewels/MultiQC | multiqc/modules/afterqc/__init__.py | Python | gpl-3.0 | 75 |
# -*- coding: utf-8 -*-
"""Utility classes and values used for marshalling and unmarshalling objects to
and from primitive types.
.. warning::
This module is treated as private API.
Users should not need to use this module directly.
"""
from __future__ import unicode_literals
from marshmallow.utils import i... | xLegoz/marshmallow | marshmallow/marshalling.py | Python | mit | 12,698 |
# -*- coding=utf-8 -*-
class callByRef:
def __init__(self, **args):
for (k, v) in args.items():
setattr(self, k,v)
def func(args):
args.a = 'new-value'
args.b = args.b + 1
args = callByRef(a = 'old-value', b = 99)
func(args)
print(args.a, args.b) | CodyGuo/Python-Cody | python/examples/pythonUpdate/3.5/callbyreference.py | Python | apache-2.0 | 282 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | cvandeplas/plaso | plaso/lib/queue.py | Python | apache-2.0 | 11,097 |
# Lint as: python3
# Copyright 2021 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 requ... | keras-team/keras | keras/distribute/dataset_creator_model_fit_test.py | Python | apache-2.0 | 10,240 |
import re
from ..http_parameters import Parameters, ParamSet, Param
from ..exceptions import InvalidTransmuteDefinition
def get_parameters(signature, transmute_attrs, arguments_to_ignore=None):
"""given a function, categorize which arguments should be passed by
what types of parameters. The choices are:
... | toumorokoshi/web-transmute | transmute_core/function/parameters.py | Python | mit | 3,982 |
import pandas as pd
import plotly.plotly as py
import plotly
df2 = pd.read_csv('input.csv', header=0)
df2['promo_dep15'].astype(float)
color = pd.Series(['rgb(100,100,100)', 'rgb(38,17,235)', 'rgb(17,93,235)', 'rgb(17,235,220)',
'rgb(49,235,17)', 'rgb(188,235,17)', 'rgb(235,202,17)', 'rgb(235,115,17... | luoshao23/ML_algorithm | Clustering/store_cluster.py | Python | mit | 2,454 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-03-22 20:10
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('oauth', '0007_org_slug_nonunique'),
]
operations = [
migrations.AddField(
... | rtfd/readthedocs.org | readthedocs/oauth/migrations/0008_add-project-relation.py | Python | mit | 565 |
from __future__ import absolute_import, print_function
# still needed
# tests for MingW32Compiler
# don't know how to test gcc_exists() and msvc_exists()...
import os
import sys
import tempfile
import warnings
from numpy.testing import TestCase, assert_
from scipy.weave import build_tools
# filter w... | beiko-lab/gengis | bin/Lib/site-packages/scipy/weave/tests/test_build_tools.py | Python | gpl-3.0 | 2,579 |
from otree.api import Currency as c, currency_range
from ._builtin import Page, WaitPage
from .models import Constants
class BetPage(Page):
form_model = 'player'
form_fields = ['nb_revelations']
page_sequence = [
BetPage,
]
| anthropo-lab/XP | bayer_project/betting/pages.py | Python | gpl-3.0 | 240 |
#
# Copyright (c) 2014, Arista Networks, Inc.
# 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 condit... | arista-eosplus/pyeapi | pyeapi/api/acl.py | Python | bsd-3-clause | 11,123 |
from autotest_lib.client.virt import virt_utils
def run_migration_with_reboot(test, params, env):
"""
KVM migration test:
1) Get a live VM and clone it.
2) Verify that the source VM supports migration. If it does, proceed with
the test.
3) Reboot the VM
4) Send a migration command... | clebergnu/autotest | client/tests/kvm/tests/migration_with_reboot.py | Python | gpl-2.0 | 1,503 |
def wait_net_service(server, port, timeout=None):
""" Wait for network service to appear
@param timeout: in seconds, if None or 0 wait forever
@return: True of False, if timeout is None may return only True or
throw unhandled network exception
"""
import socket
import e... | ActiveState/code | recipes/Python/576655_Wait_network_service/recipe-576655.py | Python | mit | 1,270 |
# -*- coding: UTF-8 -*-
"""
Python Build Info Tool
Timer
"""
import time
import logging
def log(func):
def test(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
stop = time.time()
logging.info("function {} execution time is {:0.4F}s".format(str(func), stop-start... | PtaxLaine/PyBuildInfo | pybuildinfo/timer.py | Python | bsd-3-clause | 361 |
from django import forms
class FiltroForm(forms.Form):
busca = forms.CharField(
label='Filtro', required=False,
help_text='Busca vรกrios valores separados por espaรงo.',
widget=forms.TextInput(attrs={'type': 'string',
'autofocus': 'autofocus'}))
def clean_... | anselmobd/fo2 | src/utils/forms.py | Python | mit | 494 |
#!/usr/bin/env python
# encoding: utf-8
import hashlib
import json
import os
import re
from datetime import datetime
from flask import Flask, request, render_template, redirect
from flask_pymongo import PyMongo
from toolz import keyfilter
from wtforms import (
Form, StringField, BooleanField, validators, Validatio... | SteemData/notify.steemdata.com | src/app.py | Python | mit | 3,958 |
#!/usr/bin/env python
import rospy
import importlib
import actionlib
from BaseActionInterface import BaseActionInterface
from rosplan_dispatch_msgs.msg import ActionFeedback
class ActionlibActionInterface(BaseActionInterface):
def __init__(self, action_config):
BaseActionInterface.__init__(self, action_c... | KCL-Planning/ROSPlan | rosplan_action_interface/src/ActionlibActionInterface.py | Python | bsd-2-clause | 6,410 |
# -*- coding: utf-8 -*-
'''
Remote package support using ``pkg_add(1)``
.. warning::
This module has been completely rewritten. Up to and including version
0.17.0, it supported ``pkg_add(1)``, but checked for the existence of a
pkgng local database and, if found, would provide some of pkgng's
functio... | victorywang80/Maintenance | saltstack/src/salt/modules/freebsdpkg.py | Python | apache-2.0 | 14,127 |
import re
# Using readlines()
file1 = open('sql_raw.txt', 'r')
Lines = file1.readlines()
for line in Lines:
split_id = line.split("'")
id_db = split_id[1]
split = line.split(",")
check_id = split[9]
project_id = split[10]
sprint_id = split[11]
kb_id = split[13]
check_type = split[14... | blabla1337/skf-flask | external_resources/PATTERNS/tool_sql_patterns.py | Python | agpl-3.0 | 655 |
# PartDesign gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@... | YuanYouYuan/FreeCAD | src/Mod/PartDesign/InitGui.py | Python | lgpl-2.1 | 3,817 |
from django.shortcuts import render
from rest_framework import mixins, viewsets
from waffle.decorators import waffle_switch
import amo
from amo.utils import paginate
from mkt.api.base import CORSMixin
from mkt.api.authentication import RestOAuthAuthentication
from mkt.developers.models import PreloadTestPlan
from mkt... | ngokevin/zamboni | mkt/operators/views.py | Python | bsd-3-clause | 1,397 |
#!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Bhaskar Mookerji <mookerji@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS... | paparazzi/libsbp | generator/sbpg/targets/python.py | Python | lgpl-3.0 | 3,444 |
#!/usr/bin/env python
class DocumentResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute typ... | sohail-aspose/Aspose_Words_Cloud | SDKs/Aspose.Words_Cloud_SDK_for_Python/asposewordscloud/models/DocumentResponse.py | Python | mit | 787 |
"""hug/_empty.py
Defines a set of empty types for use within hug, to ensure extra memory / processing isn't taken creating empty types
as default values.
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentati... | MuhammadAlkarouri/hug | hug/_empty.py | Python | mit | 1,368 |
#! /usr/bin/env python
#
# Copyright (c) 2016-2022, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... | sissaschool/xmlschema | setup.py | Python | mit | 2,541 |
import unittest
from hastur.bandits import Bandit
from hastur.bandits import GreedyBandit
from hastur.bandits import EpsilonGreedyBandit
from hastur.bandits import BayesianBandit
from hastur.bandits import EpsilonBayesianBandit
from hastur.bandits import UpperConfidenceBoundBandit
from hastur.observations import Observ... | julbright/hastur | tests/test_bandits.py | Python | mit | 5,223 |
# -*- coding: utf-8 -*-
import sys, os
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'ssp'
copyright = u'2013, Yury Konovalov'
version = '0.0.1'
release = '0.0.1'
exclude_patterns = []
pygments_style = 'sphinx'
html_theme ... | mdcic/ssp | docs/source/conf.py | Python | gpl-3.0 | 752 |
import logging
from shlex import quote
from findd.cli.widgets import hr
from findd.cli.widgets import ProgressBarManager
__LOG__ = logging.getLogger(__name__)
class BaseView(object):
def __init__(self, show_progressbars):
self.pbm = ProgressBarManager() if show_progressbars else None
def __enter__... | schnittstabil/findd | findd/cli/views.py | Python | mit | 1,481 |
# Copyright 2012-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | boto/botocore | tests/functional/test_modeled_exceptions.py | Python | apache-2.0 | 6,795 |
# 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/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_operations.py | Python | mit | 4,847 |
import pytest
from mock import Mock, patch
from datadog_checks.aws_pricing import AwsPricingCheck
from datadog_checks.base.errors import CheckException
def test_check_ok(aggregator, pricing_client_stubber):
# Mock client responses
pricing_client_stubber.stub_describe_services_response(['AmazonEC2'])
pric... | DataDog/integrations-extras | aws_pricing/tests/test_aws_pricing.py | Python | bsd-3-clause | 5,064 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-06 11:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NewsIt... | nmunro/azathoth | news/migrations/0001_initial.py | Python | agpl-3.0 | 603 |
"""
WSGI config for simpleqa project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "simpleqa.settings")
from django.core... | swappsco/django-qa | test_project/simpleqa/wsgi.py | Python | mit | 391 |
"""
Django settings for tutorial project.
Generated by 'django-admin startproject' using Django 1.10.3.
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/
"""
import o... | versionzero/factory | factory/settings.py | Python | gpl-3.0 | 3,372 |
# Loop refinement of an existing model
from modeller import *
from modeller.automodel import *
log.verbose()
env = environ()
# directories for input atom files
env.io.atom_files_directory = ['.', '../atom_files']
# Create a new class based on 'loopmodel' so that we can redefine
# select_loop_atoms (necessary)
class ... | bjornwallner/proq2-server | apps/modeller9v8/examples/automodel/loop.py | Python | gpl-3.0 | 910 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.tasks.task_list... | calee88/ParlAI | docs/source/generate_task_list.py | Python | bsd-3-clause | 1,334 |
# -*- coding: utf-8 -*-
#
# async documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 30 21:58:33 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | gitpython-developers/async | doc/source/conf.py | Python | bsd-3-clause | 6,358 |
# -*- coding: utf-8 -*-
"""
Standalone script to upload a project docs on PyPI
Hacked together from the following distutils extension, avaliable from
https://bitbucket.org/jezdez/sphinx-pypi-upload/overview (ver. 0.2.1)
sphinx_pypi_upload
~~~~~~~~~~~~~~~~~~
setuptools command for uploading Sp... | mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/psycopg2-2.6.1/doc/src/tools/pypi_docs_upload.py | Python | mit | 5,894 |
# -*- coding: utf-8 -*-
"""This module contains the functions that main window needed."""
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2019"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from typing import cast, Tuple, Sequence, Set, FrozenSet, Dict, Union, Optional
from abc import ABC
from it... | KmolYuan/Pyslvs-PyQt5 | pyslvs_ui/main_window/entities.py | Python | agpl-3.0 | 25,971 |
"""
streamcloud urlresolver plugin
Copyright (C) 2012 Lynx187
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 ... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.module.urlresolver/lib/urlresolver/plugins/streamcloud.py | Python | gpl-2.0 | 3,401 |
# An absurd workaround for the lack of arithmetic in MS's resource compiler.
# After building Python, run this, then paste the output into the appropriate
# part of PC\python_nt.rc.
# Example output:
#
# * For 2.3a0,
# * PY_MICRO_VERSION = 0
# * PY_RELEASE_LEVEL = 'alpha' = 0xA
# * PY_RELEASE_SERIAL = 1
# *
# * and 0*1... | xbmc/atv2 | xbmc/lib/libPython/Python/PCbuild/field3.py | Python | gpl-2.0 | 966 |
"""
Add and create new modes for running courses on this particular LMS
"""
import pytz
from datetime import datetime
from django.db import models
from collections import namedtuple, defaultdict
from django.utils.translation import ugettext_lazy as _
from django.db.models import Q
from xmodule_django.models import Co... | jswope00/griffinx | common/djangoapps/course_modes/models.py | Python | agpl-3.0 | 14,953 |
from statsmodels.compat.python import lrange
import numpy as np
#from numpy import linalg as npla
from scipy import stats, optimize
'''
Working with categorical data
=============================
use of dummy variables, group statistics, within and between statistics
examples for efficient matrix algebra
dummy versi... | DonBeo/statsmodels | statsmodels/sandbox/regression/try_catdata.py | Python | bsd-3-clause | 4,785 |
from django.conf import settings
from django.test.testcases import SimpleTestCase
from django.test.utils import override_settings
from django.utils.module_loading import import_string
class SettingsTestCase(SimpleTestCase):
@override_settings(DJOSER=dict())
def test_settings_should_be_default_if_djoser_not_in... | sunscrapers/djoser | testproject/testapp/tests/test_settings.py | Python | mit | 1,473 |
# Copyright 2015 The Shaderc 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... | drewet/shaderc | glslc/test/working_directory.py | Python | apache-2.0 | 8,169 |
#-*- coding: utf-8 -*-
import os
import json
from django.template.loader import render_to_string
from django.http import HttpResponse
def render_form_errors(form):
return render_to_string('spirit/utils/_form_errors.html', {'form': form, })
def json_response(data=None, status=200):
# TODO: Use JsonResponse... | Si-elegans/Web-based_GUI_Tools | spirit/utils/__init__.py | Python | apache-2.0 | 576 |
class A:
def foo(self):
pass
<caret>
def abc(self):
pass | asedunov/intellij-community | python/testData/breadcrumbs/functionNewLineSpaceCaretNewLineFunction.py | Python | apache-2.0 | 69 |
tabby_cat = "\tI'm tabbed in."
persian_cat = "I'm split\non a line."
backslash_cat = "I'm \\ a \\ cat."
fat_cat = '''
I'll do list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
'''
print (tabby_cat)
print (persian_cat)
print (backslash_cat)
print (fat_cat) | ismk/Python-Examples | learn python the hard way/ex1.py | Python | mit | 276 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('questions', '0011_auto_20150331_1557'),
]
operations = [
migrations.AddField(
model_name='surveyquestion',
... | prathapsridharan/health_project | health_project/questions/migrations/0012_surveyquestion_skipped.py | Python | bsd-3-clause | 449 |
import pytest
from lucid.modelzoo.aligned_activations import NUMBER_OF_AVAILABLE_SAMPLES
from lucid.modelzoo.vision_models import AlexNet, InceptionV1
from lucid.recipes.activation_atlas import activation_atlas, aligned_activation_atlas
from lucid.misc.io import save
# Run test with just 1/10th of available samples
s... | tensorflow/lucid | tests/recipes/activation_atlas.py | Python | apache-2.0 | 1,157 |
from math import sin, cos, tan, asin, atan, acos, log, exp
from autocode.interpreter.ast import Element
def fun(function, value):
fundict = {'MOD':Mod,'INT':Int,'FRAC':Frac,'SQRT':Sqrt,
'SIN':Sin,'COS':Cos,'TAN':Tan,'CSC':Cosec,'SEC':Sec,'COT':Cot,
'ARCSIN':Arcsin,'ARCCOS':Arccos,'AR... | romilly/pegasus-autocode | autocode/interpreter/functions.py | Python | mit | 1,781 |
#!/usr/bin/env python
import logging, os, time
import math, numpy as np, matplotlib.pyplot as plt
import rospy, tf
import pdb
import test_controller as tc
class RosNode(tc.Trajectory):
def __init__(self):
rospy.init_node('TestController')
stages = (tc.Line(lin=0.1), tc.Line(lin=0.), tc.Line(an... | poine/rosmip | rosmip/rosmip_navigation/scripts/test_odometry.py | Python | gpl-3.0 | 4,092 |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from .views import FarmIndexView, RegisterNewAnimalSeparation, DeleteDeath, EditAnimalSeparation, DeleteSeparation, \
DeleteAnimalEntry, DeleteExit, RegisterFeedTransition, FeedEntryView
from .wizards import RegisterNewAnim... | forcaeluz/easy-fat | farm/urls.py | Python | gpl-3.0 | 2,443 |
#!/usr/bin/env python3
"""Exporter of snippets for snippet crawler"""
from BaseLogger import BaseLogger
from DatabaseAccessor import DatabaseAccessor
from contextlib import closing
from csv import DictWriter
from json import dump
from os import remove
from platform import node
from time import strftime
from zipfile im... | vejuhust/snippet-crawler | Exporter.py | Python | mit | 4,560 |
import unittest
from .wizard import *
class InterviewTest(unittest.TestCase):
def test_interview_seq(self):
'''
The wizards job is to define the sequence of views and
associated arguments used to record information about
an interview
'''
mock_session = {}
o... | kern3020/opportunity | opportunity/tracker/wizard_test.py | Python | mit | 3,982 |
import json
import logging
from decimal import Decimal
from google.appengine.ext import webapp
from google.appengine.api import memcache
from google.appengine.ext import ndb
from google.appengine.ext.webapp.util import run_wsgi_app
from m.fn import get_quremo
# Web application with primitive arithmetical calculations
... | 0--key/lib | portfolio/Python/GAE/server_test/main.py | Python | apache-2.0 | 1,074 |
import os
import re
from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse, NoReverseMatch
fr... | nuodb/nuodb-django | test/auth/tests/views.py | Python | bsd-3-clause | 22,169 |
#! /usr/bin/env python
#
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... | nmc-probe/emulab-nome | protogeni/test/whoami.py | Python | agpl-3.0 | 1,424 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | kaarolch/ansible | lib/ansible/modules/network/nxos/nxos_portchannel.py | Python | gpl-3.0 | 23,422 |
import numpy as np
import os
try:
import netCDF4 as netCDF
except:
import netCDF3 as netCDF
import matplotlib.pyplot as plt
import time
from datetime import datetime
from matplotlib.dates import date2num, num2date
import pyroms
import pyroms_toolbox
import _remapping
class nctime(object):
pass
def remap_bio(... | kshedstrom/pyroms | examples/cobalt-preproc/Clim_bio/remap_bio.py | Python | bsd-3-clause | 3,866 |
"""
AUTHOR: Peter Collins, 2005.
This software is Copyright (C) 2004-2008 Bristol University
and is released under the GNU General Public License version 2.
MODULE: RunHill
PURPOSE:
A sample setup and configuration for the normalization algorithms.
NOTES:
See RunConfig.py for configuration options
"""
import sy... | Peter-Collins/NormalForm | src/config-run/RunHill.py | Python | gpl-2.0 | 1,029 |
# -*- coding: utf-8 -*-
import os
import os.path
import lxml.etree
import StringIO
import pipeline_item
import core.docvert_exception
import core.docvert
import core.docvert_xml
class Test(pipeline_item.pipeline_stage):
def stage(self, pipeline_value):
if not self.attributes.has_key("withFile"):
... | Br3nda/docvert | core/pipeline_type/test.py | Python | gpl-3.0 | 3,027 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests all Python files of the project with flake8. This ensure PEP8 conformance
and some other sanity checks as well.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2015-2016
:license:
GNU General Public License, Version 3
(http://www.gnu.o... | krischer/mtspec | mtspec/tests/test_code_formatting.py | Python | gpl-3.0 | 2,657 |
from shared.base_component import BaseComponent
class BaseFilter(BaseComponent):
def __init__(self, conf):
BaseComponent.__init__(self, conf)
def filter(self, message):
pass
def __call__(self, message):
return self.filter(message)
| weapp/miner | filters/base_filter.py | Python | mit | 270 |
"""
===========
Scheme Node
===========
"""
from AnyQt.QtCore import QObject
from AnyQt.QtCore import pyqtSignal as Signal, pyqtProperty as Property
class UserMessage(object):
"""
A user message that should be displayed in a scheme view.
Paramaters
----------
contents : str
Message text... | cheral/orange3 | Orange/canvas/scheme/node.py | Python | bsd-2-clause | 6,489 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,invalid-name
"""For details on this module see DOCUMENTATION (below)"""
import datetime
import os
import subprocess
from six.moves import configparser
import yaml
import OpenSSL.crypto
DOCUMENTATION = '''
---
module: openshift_cert_expiry
sh... | tiwillia/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.5/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py | Python | apache-2.0 | 27,743 |
# flake8: noqa
import numpy
import pyximport
pyximport.install(setup_args={"include_dirs": numpy.get_include()})
from .cython_simple import simple_func, fib, fib_int, fib_cpdef, fib_cdef, simple_class
from .masked_log import masked_log
from .cython_blas import (
compute_self_corr_for_voxel_sel,
compute_kerne... | ray-project/ray | doc/source/ray-core/_examples/cython/cython_examples/__init__.py | Python | apache-2.0 | 815 |
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | Polarcraft/KbveBot | commands/help.py | Python | gpl-2.0 | 1,867 |
from __future__ import absolute_import, print_function
import os
import os.path as osp
import re
from string import Template
class ConfmanException(Exception):
pass
class ActionException(ConfmanException):
def __init__(self, action, value, resolve=None):
self.action = action
self.resolve = ... | laurentb/confman | confman.py | Python | mit | 13,071 |
# Copyright (C) 2010 Google Inc. 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 conditions and the ... | mogoweb/webkit_for_android5.1 | webkit/Tools/TestResultServer/model/testfile.py | Python | apache-2.0 | 4,323 |
# Copyright 2004 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
template instantiation parser
This module implements all functionality necessary to parse C++ template
instantiations.In other... | jgresula/jagpdf | code/tools/external/python/pygccxml/declarations/templates.py | Python | mit | 1,844 |
###############################################################################
# #
# 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 ... | dparks1134/biolib | biolib/plots/abstract_plot.py | Python | gpl-3.0 | 10,172 |
import sys
from SALib.analyze.ff import analyze
from SALib.sample.ff import sample
from SALib.util import read_param_file
sys.path.append('../..')
# Read the parameter range file and generate samples
problem = read_param_file('../../src/SALib/test_functions/params/Ishigami.txt')
# or define manually withou... | willu47/SALib | examples/ff/ff.py | Python | mit | 1,150 |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | hamish/SmeltCMS | packages/botocore/model.py | Python | gpl-3.0 | 23,734 |
from __future__ import absolute_import
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from .views import AuthorizationView, TokenView, ErrorView
urlpatterns = patterns('',
url(r'^oauth/2/authorize/$', login_required(AuthorizationView.as_view()), name='oauth2_... | ib-lundgren/django-oauthlib | django_oauthlib/urls.py | Python | bsd-3-clause | 479 |
import json
from rest_framework import status
from guardian.shortcuts import assign_perm, remove_perm
from django.contrib.auth.models import User, Group
from django.conf import settings
from main.api.test import APITestCase
from regions.models import Region, BannedFromRegion
from pages.models import Page
from .. mo... | evangeline97/localwiki-backend-server | localwiki/redirects/tests/test_api.py | Python | gpl-2.0 | 9,442 |
#!/usr/bin/env python
import warnings
# Dropping a table inexplicably produces a warning despite
# the "IF EXISTS" clause. Squelch these warnings.
warnings.simplefilter("ignore")
import os
import logging
import unittest
import environment
import utils
import tablet
master_tablet = tablet.Tablet()
replica_tablet = t... | ngaut/vitess | test/mysqlctl.py | Python | bsd-3-clause | 2,608 |
#!/usr/bin/env python3
import socket
from util import ip4_range
import unittest
from config import config
from framework import VppTestCase, VppTestRunner
from template_bd import BridgeDomain
from scapy.layers.l2 import Ether
from scapy.packet import Raw, bind_layers
from scapy.layers.inet import IP, UDP
from scapy.l... | FDio/vpp | test/test_vxlan_gpe.py | Python | apache-2.0 | 12,668 |
import sys
from minecraft_data.v1_8 import blocks_list
from spockbot.mcdata import constants as const, materials
from spockbot.mcdata.utils import BoundingBox
from spockbot.mcdata.utils import camel_case, find_by
blocks = {}
blocks_name = {}
# Used for extra logic outside of minecraft_data
_block_exts = {}
def g... | luken/SpockBot | spockbot/mcdata/blocks.py | Python | mit | 4,831 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | elopezga/ErrorRate | ivi/ivi.py | Python | mit | 100,202 |
# -*- encoding: utf-8 -*-
from abjad.tools import indicatortools
from abjad.tools import durationtools
from abjad.tools.quantizationtools.QSchemaItem import QSchemaItem
class MeasurewiseQSchemaItem(QSchemaItem):
'''`MeasurewiseQSchemaItem` represents a change of state in the
timeline of a metered quantization... | andrewyoung1991/abjad | abjad/tools/quantizationtools/MeasurewiseQSchemaItem.py | Python | gpl-3.0 | 3,330 |
"""
Low level *Skype for Mac OS X* interface implemented using *Carbon
distributed notifications*. Uses direct *Carbon*/*CoreFoundation*
calls through the *ctypes* module.
This module handles the options that you can pass to
`Skype.__init__` for *Mac OS X* machines.
- ``RunMainLoop`` (bool) - If set to False, Skype4P... | gastounage/skype4py3 | Skype4Py3/api/darwin.py | Python | bsd-3-clause | 17,800 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | kaday/rose | lib/python/rose/macros/duplicate.py | Python | gpl-3.0 | 3,415 |
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="newsletter2go.urls",
INSTALLED_APPS=[
... | productgang/django-newsletter2go | runtests.py | Python | bsd-3-clause | 1,254 |
"""new action model
Revision ID: 36c91aa9b3b5
Revises: fe0f77ef3f46
Create Date: 2019-10-20 21:23:05.959617
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '36c91aa9b3b5'
down_revision = 'fe0f77ef3f46'
branch_labels = None
depends_on = None
def upgrade():
... | evereux/flicket | migrations/versions/36c91aa9b3b5_new_action_model.py | Python | mit | 6,211 |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import copy as cp
from warnings import warn
import numpy as np
from .. import Epochs, compute_proj_evoked, co... | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/mne/preprocessing/ssp.py | Python | bsd-3-clause | 15,146 |
"""Sidebar item management for datagrids."""
from __future__ import unicode_literals
from django.utils import six
from django.utils.six.moves.urllib.parse import urlencode
from djblets.util.compat.django.template.loader import render_to_string
from reviewboard.site.urlresolvers import local_site_reverse
class Base... | chipx86/reviewboard | reviewboard/datagrids/sidebar.py | Python | mit | 13,527 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#pairDetailDialogWindow.py
from PyQt4 import QtGui, QtCore, uic
import mlpCanvas
class QPairDetailDialogWindow(QtGui.QDialog):
def __init__(self, QMain):
super(QPairDetailDialogWindow,self).__init__(parent = QMain)
self.QMain = QMain
self.initUI()
self.initEventConnec... | sharmaking/CoIntegrationAnalysis | pairDetailDialogWindow.py | Python | mit | 943 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.