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 # # Copyright (C) 2013-2015 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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 a...
andyshinn/dx-toolkit
src/python/dxpy/scripts/dx_bed_to_spans.py
Python
apache-2.0
31,038
import os import sys class Widget(object): """ Widget is a User Interface (UI) component object. A widget object claims a rectagular region of its content, is responsible for all drawing within that region. """ def __init__(self, name, width=50, height=50): self.name = name sel...
ishikawa/modipyd
examples/widget/002/widget.py
Python
mit
491
#!/usr/bin/env python # -*- coding:utf-8 -*- __version__ = '0.2.1'
josegonzalez/docker-travis-php
docker_travis_php/__init__.py
Python
mit
68
from __future__ import absolute_import from django.conf import settings from django.db import IntegrityError, models, transaction from django.db.models import Q from django.utils import timezone from sentry.db.models import ( BaseManager, BoundedPositiveIntegerField, FlexibleForeignKey, Model, sane_repr ) class...
jean/sentry
src/sentry/models/groupsubscription.py
Python
bsd-3-clause
5,262
#! /usr/bin/env python3 import sys import os import collections import gdb_helper programs = {} def ocl_prepare_program(uid, lines): progr_lines = [] for line in lines: progr_lines += line.split("\n") programs[uid] = progr_lines def ocl_parse(program_uid, kernel_name): def get_lines(): ...
mpbl/specfem3d_globe
utils/BOAST_framework_to_develop_the_CUDA_and_OpenCL_routines_of_SPECFEM/gpuTrace/parse_gpu_program.py
Python
gpl-3.0
2,849
#!/usr/bin/python # snakeoil.py # Chris X Edwards <snakeoil@xed.ch> # Snake Oil is a Python library for interfacing with a TORCS # race car simulator which has been patched with the server # extentions used in the Simulated Car Racing competitions. # http://scr.geccocompetitions.com/ # # To use it, you must import it a...
babraham123/deepdriving
gym/snakeoil3_gym.py
Python
mit
23,725
from yowsup.layers.interface import YowInterfaceLayer, ProtocolEntityCallback from yowsup.layers.protocol_messages.protocolentities import TextMessageProtocolEntity from yowsup.layers.protocol_media.protocolentities import ImageDownloadableMediaMessageProtocolEntity from yowsup.layers.protoc...
felix-dumit/campusbot
yowsup2/yowsup/demos/echoclient/layer.py
Python
mit
4,454
# -*- coding: utf-8 -*- # # mazi-guides documentation build configuration file, created by # sphinx-quickstart on Wed Mar 9 17:33:10 2016. # # 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. #...
mazi-project/guides
tech/source/conf.py
Python
mit
9,625
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
with-git/tensorflow
tensorflow/examples/tutorials/word2vec/word2vec_basic.py
Python
apache-2.0
9,909
# Copyright (c) 2014 EMC Corporation. # 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...
NetApp/manila
manila/tests/share/drivers/emc/test_driver.py
Python
apache-2.0
4,948
# -*- coding: cp1252 -*- ## # <p> Portions copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd</p> # <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p> ## # 2009-05-31 SJM Fixed problem with no CODEPAGE record on extremely minimal BIFF2.x 3rd-party file # 2009-0...
ev1l0rd/yalnpv
quickfort/src/qfconvert/xlrd/sheet.py
Python
mit
79,267
from __future__ import absolute_import, division, print_function, unicode_literals import json from base64 import b64encode import mock from gratipay.elsewhere import UserInfo from gratipay.models.account_elsewhere import AccountElsewhere from gratipay.testing import Harness, P import gratipay.testing.elsewhere as u...
gratipay/gratipay.com
tests/py/test_elsewhere.py
Python
mit
8,165
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
google/personfinder
tools/sample_queries/count_all_persons.py
Python
apache-2.0
1,108
# -*- coding: utf-8 -*- # Copyright (c) 2002 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the listspace viewmanager class. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSignal, QFileInfo, QEvent, Qt from PyQt5.QtWidgets import QStackedWidget, QSp...
paulmadore/Eric-IDE
6-6.0.9/eric/Plugins/ViewManagerPlugins/Listspace/Listspace.py
Python
gpl-3.0
28,425
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os, glob """ Runs process_logdata_ekf.py on the .ulg files in the supplied directory. ulog files are skipped from the analysis, if a corresponding .pdf file already exists (unless the overwrite flag was set). """ parser = argparse.ArgumentParser(...
mcgill-robotics/Firmware
Tools/ecl_ekf/batch_process_logdata_ekf.py
Python
bsd-3-clause
1,794
conf_nova_compute_conf = """[DEFAULT] compute_driver = libvirt.LibvirtDriver glance_api_version = 2 [libvirt] virt_type = kvm inject_password = False inject_key = False inject_partition = -2 images_type = rbd images_rbd_pool = vms images_rbd_ceph_conf = /etc/ceph/ceph.conf rbd_user = cinder rbd_secret_uuid = {{ rbd_sec...
jiasir/playback
playback/templates/nova_compute_conf.py
Python
mit
672
''' Created on 24.08.2017 @author: Peer ''' from setuptools import setup setup(name='gitexplorer', version='0.1', description='Git repository analyzer', author='Peer Wagner', author_email='wagnerpeer@gmail.com', url='http://gitexplorer.readthedocs.io', packages=['gitexplorer'], ...
wagnerpeer/gitexplorer
setup.py
Python
mit
534
#!/usr/bin/env python # Dumps results to a CSV file import sys, os sys.path.append('..') import cPickle import pandas as pd from misc.config import c results_dir = c['RESULTS_DIR'] all_results = {} datasets = ['segment', 'satimage', 'pendigits'] models = ['test_r2svm', 'test_r2elm', 'random_r2svm', 'fixed_r2svm'] ...
kudkudak/r2-learner
scripts/to_csv.py
Python
mit
1,129
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
google-research/google-research
generalization_representations_rl_aistats22/minigrid/rl_basics.py
Python
apache-2.0
3,853
# -*- flake8: noqa -*- from metrology.reporter.graphite import GraphiteReporter from metrology.reporter.librato import LibratoReporter from metrology.reporter.logger import LoggerReporter
zenoss/metrology
metrology/reporter/__init__.py
Python
mit
188
import os import sys import json import subprocess __author__ = 'Agostino Sturaro' def run_batches(batches): # check that all configuration files exist and are valid json # for batch_no in range(concurrent_procs): for batch_no in batches: batch_conf_fpath = os.path.normpath('../Simulations/test_m...
TiedNets/TiedNets
multi_proc_runner.py
Python
gpl-3.0
1,452
# -*- coding: utf-8 -*- """Tests the features of xblock/runtime""" # Allow tests to access private members of classes # pylint: disable=W0212 from collections import namedtuple from datetime import datetime from mock import Mock, patch from unittest import TestCase from xblock.core import XBlock, XBlockMixin from xbl...
nagyistoce/edx-XBlock
xblock/test/test_runtime.py
Python
apache-2.0
27,041
from django.contrib.gis.db import models import datetime class Area(models.Model): name = models.CharField(max_length=255) email = models.CharField(max_length=255) poly = models.PolygonField() objects = models.GeoManager()
mariohmol/django-google-polygon
dgpolygon/gmappolygons/models.py
Python
mit
245
# # Copyright 2012 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
edwardbadboy/vdsm-ubuntu
vdsm/gluster/__init__.py
Python
gpl-2.0
1,832
# -*- coding: utf-8 -*- # # Author: François Rossigneux <francois.rossigneux@inria.fr> # # 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 # # Unles...
openstack/blazar
blazar/db/utils.py
Python
apache-2.0
4,552
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
MalkIPP/openfisca-france-data
openfisca_france_data/input_data_builders/__init__.py
Python
agpl-3.0
1,803
# -*- 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): # Deleting model 'Participant' db.delete_table(u'pa_participant') # Removing M2M table for field us...
Mathew/psychoanalysis
psychoanalysis/apps/pa/migrations/0002_auto__del_participant.py
Python
mit
7,476
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/__init__.py
Python
mit
3,596
import re from datetime import datetime from marshmallow import Schema, fields from theatrics.scoring import get_default_score_functions from theatrics.utils.handlers import with_params, json_response from theatrics.utils.collections import get_all from ..helpers import get_list from .events import EXPANDABLE_RELAT...
despawnerer/theatrics
api/theatrics/handlers/v1/search.py
Python
mit
3,519
from django.contrib.syndication.feeds import Feed, FeedDoesNotExist from brainstorm.models import Subsite class SubsiteFeed(Feed): title_template = 'brainstorm/feed_title.html' description_template = 'brainstorm/feed_description.html' def get_object(self, bits): return Subsite.objects.get(slug__e...
gandalfar/django-brainstorm
brainstorm/feeds.py
Python
bsd-3-clause
914
# coding: utf8 # Copyright 2012-2015 Vincent Jacques <vincent@vincent-jacques.net> import unittest import textwrap import MockMockMock from InteractiveCommandLine import Program, Command, Option class CommandGrouping(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) ...
jacquev6/InteractiveCommandLine
InteractiveCommandLine/tests/Grouping.py
Python
mit
4,252
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
iw3hxn/server
openerp/modules/loading.py
Python
agpl-3.0
19,023
from __future__ import absolute_import from __future__ import division from __future__ import print_function from ray.core.src.local_scheduler.liblocal_scheduler_library import ( Task, LocalSchedulerClient, ObjectID, check_simple_value, task_from_string, task_to_string) from .local_scheduler_services import st...
alanamarzoev/ray
python/ray/local_scheduler/__init__.py
Python
apache-2.0
492
#!/usr/bin/env python # Author: # Contact: grubert@users.sf.net # Copyright: This module has been placed in the public domain. """ man.py ====== This module provides a simple command line interface that uses the man page writer to output from ReStructuredText source. """ import locale try: locale.setlocale(loc...
leigh123linux/nemo-dropbox
rst2man.py
Python
gpl-3.0
34,803
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid import numpy as np def get_demo_image(): from matplotlib.cbook import get_sample_data f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) z = np.load(f) # z is a numpy array of 15x15 return z, (-3, 4, ...
bundgus/python-playground
matplotlib-playground/examples/axes_grid/demo_axes_grid2.py
Python
mit
3,488
from django_filters import ModelMultipleChoiceFilter, FilterSet from django_filters.fields import ModelChoiceField from geotrek.authent.models import Structure from geotrek.common.models import TargetPortal from geotrek.trekking.models import POI, Trek from django.forms import ValidationError class ComaSeparatedMulti...
GeotrekCE/Geotrek-admin
geotrek/cirkwi/filters.py
Python
bsd-2-clause
1,662
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
mdhaman/superdesk-core
superdesk/io/feeding_services/__init__.py
Python
agpl-3.0
11,417
import os import tempfile import numpy as np import xarray as xr from typhon.files import NetCDF4 class TestNetCDF4: def test_dimension_mapping(self): """ If a subgroup has not defined a dimension, but its parent group has one with the same size and name, the subgroup should use that one...
atmtools/typhon
typhon/tests/files/handlers/test_netcdf4.py
Python
mit
4,163
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_github_stats import __version__ REQUIREMENTS = [ 'Django', 'django-cms', 'PyGithub', ] CLASSIFIERS = [ 'Development Status :: 2 - Pre-Alpha', 'Environment :: Web Environment', 'Framework :: Django', 'Intended A...
aldryn/aldryn-github-stats
setup.py
Python
bsd-3-clause
1,139
import py, pytest import sys, os import execnet import xdist.remote from _pytest import runner # XXX load dynamically class NodeManager(object): EXIT_TIMEOUT = 10 def __init__(self, config, specs=None, defaultchdir="pyexecnetcache"): self.config = config self._nodesready = py.std.threading.Eve...
curzona/pytest-xdist
xdist/slavemanage.py
Python
mit
11,298
# Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistributions of source ...
nephomaniac/nephoria
nephoria/euca/taggedresource.py
Python
bsd-2-clause
4,215
#1strand Bushing Tool #Standalone program for minimized cruft import math print "This program is for printing the best possible circular bushings" print "Printer config values are hardcoded for ease of use (for me)" xpath = [] #These are initialized and default values ypath = [] zpath = [] step = [] epath = [] xstart...
kanethemediocre/1strand
1strandbushinga001.py
Python
gpl-2.0
6,501
#!/usr/bin/env python from tincanradar.fwdmodel import friis from argparse import ArgumentParser def main(): p = ArgumentParser() p.add_argument("freq_Hz", help="frequency [Hz]", type=float) p.add_argument("dist_m", help="distance (one-way) [meters]", type=float) p = p.parse_args() print(f"{frii...
scivision/tincanradar
Friis.py
Python
gpl-3.0
392
from django.urls import path from .views import ProfileView app_name = "dashboard" urlpatterns = [ path("", ProfileView.as_view(), name="dashboard"), ]
nmunro/azathoth
dashboard/urls.py
Python
agpl-3.0
158
#!/usr/bin/env python3 import sys import logging from argparse import ArgumentParser, RawTextHelpFormatter import requests import socket import boto3 DNS_RR_TYPE = 'A' URL_META = 'http://169.254.169.254/latest/meta-data/public-ipv4' URL_TMOUT = 5 def main(): try: logging.basicConfig(filename='route53_...
nenni/aws_playground
aws_route53_rr_update.py
Python
mit
4,752
from django.core.management.base import BaseCommand from dimagi.utils.couch.database import iter_docs from corehq.apps.domain.models import Domain from corehq.apps.users.models import CouchUser, CommCareUser class Command(BaseCommand): help = '' def handle(self, *args, **options): self.stdout.write("...
puttarajubr/commcare-hq
corehq/apps/locations/management/commands/set_location_id.py
Python
bsd-3-clause
1,867
# -*- coding: utf-8 -*- # $Id: testboxstatus.py $ """ Test Manager - TestBoxStatus. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or m...
miguelinux/vbox
src/VBox/ValidationKit/testmanager/core/testboxstatus.py
Python
gpl-2.0
12,082
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Presidentielcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import p...
presidentielcoin/presidentielcoin
contrib/linearize/linearize-data.py
Python
mit
8,836
#!/usr/bin/env python # -*- coding: utf-8 -*- import math import vtk import vtk.test.Testing # ------------------------------------------------------------ # Purpose: Test more parametric functions. # ------------------------------------------------------------ class TestMoreParametricFunctions(vtk.test...
hlzz/dotfiles
graphics/VTK-7.0.0/Common/ComputationalGeometry/Testing/Python/TestMoreParametricFunctions.py
Python
bsd-3-clause
11,232
grid = [['.', '.', '.', '.', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['O', 'O', 'O', 'O', '.', '.'], ['O', 'O', 'O', 'O', 'O', '.'], ['.', 'O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O', '.'], ['O', 'O', 'O', 'O', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['.', '.', '.', '.', '.', '.']] def print_grid(some_gr...
sallyyoo/ced2
py/practice/print_grid.py
Python
mit
541
#!/usr/bin/env python #encoding: utf-8 import chardataeffect, inkex, string convert_table = {\ 'a': unicode("⠁", "utf-8"),\ 'b': unicode("⠃", "utf-8"),\ 'c': unicode("⠉", "utf-8"),\ 'd': unicode("⠙", "utf-8"),\ 'e': unicode("⠑", "utf-8"),\ 'f': unicode("⠋", "utf-8"),\ 'g': unicode("⠛", "utf-8"),\ 'h': unicode("⠓", "ut...
piksels-and-lines-orchestra/inkscape
share/extensions/text_braille.py
Python
gpl-2.0
1,169
from django.core.urlresolvers import reverse from django.db import models from .base import BaseDatedModel from .staff import Staff class BaseItem(BaseDatedModel): authorized = models.BooleanField(default=False) deleted = models.BooleanField(default=False) author = models.ForeignKey(Staff) title = mo...
Lasanha/revuo
revuo/models/item.py
Python
bsd-3-clause
1,425
#!/usr/bin/env python # 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...
nathanbjenx/cairis
quick_setup.py
Python
apache-2.0
4,394
"Django admin support for treebeard" from django.contrib import admin, messages from django.contrib.admin.views.main import ChangeList from django.conf.urls.defaults import url, patterns from django.http import HttpResponseBadRequest, HttpResponse from treebeard.forms import MoveNodeForm from treebeard.templatetags.a...
Ernsting/django-treebeard
treebeard/admin.py
Python
apache-2.0
4,728
# encoding: utf-8 # module gtk.gdk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports from exceptions import Warning import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject import pango as __pango import pangocairo as __pangocairo ...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/gdk/DisplayManager.py
Python
gpl-2.0
1,176
# Copyright 2011 Colin Scott # Copyright 2011 James McCauley # # 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...
twood02/adv-net-samples
sdn/pox/pox/lib/recoco/examples.py
Python
mit
2,636
""" Utilities for writing plugins. This is different from bokeh.pluginutils because these are ways of patching routes and objects directly into the bokeh server. You would run this type of code using the --script option """ import uuid from flask import abort, render_template from bokeh.exceptions import DataInteg...
jakevdp/bokeh
bokeh/server/utils/plugins.py
Python
bsd-3-clause
2,634
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import re, thr...
sss/calibre-at-bzr
src/calibre/ebooks/metadata/sources/base.py
Python
gpl-3.0
21,218
from app import Handler from handlers.auth import Auth class SignUpHandler(Handler): def get(self): self.render("signup.html") def post(self): username = self.request.get("username") password = self.request.get("password") password_verify = self.request.get("password_verify")...
diegopettengill/multiuserblog
handlers/signup.py
Python
mit
830
# Generated by Django 1.11.28 on 2020-02-27 16:38 from django.db import migrations import django.db.models.manager class Migration(migrations.Migration): dependencies = [ ('course_metadata', '0236_add_program_type_uuid_and_coaching'), ] operations = [ migrations.CreateModel( ...
edx/course-discovery
course_discovery/apps/course_metadata/migrations/0237_algoliaproxycourse_algoliaproxyprogram.py
Python
agpl-3.0
920
#!/usr/bin/env python import os from app import create_app, db from app.models import User, Role, Permission from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) migrate = Migrate(app, db) def make_she...
onekeeper/okp-analysis-web
manage.py
Python
mit
754
# The Craftr build system # Copyright (C) 2016 Niklas Rosenstein # # 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. # # ...
winksaville/craftr
craftr/defaults.py
Python
gpl-3.0
10,759
"""The tests for the hassio component.""" from homeassistant.const import HTTP_INTERNAL_SERVER_ERROR from homeassistant.exceptions import HomeAssistantError from tests.async_mock import Mock, patch async def test_auth_success(hass, hassio_client_supervisor): """Test no auth needed for .""" with patch( ...
pschmitt/home-assistant
tests/components/hassio/test_auth.py
Python
apache-2.0
6,090
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
benfinke/ns_python
nssrc/com/citrix/netscaler/nitro/resource/config/snmp/snmpoid.py
Python
apache-2.0
6,179
# -*- coding: utf-8 -*- """ MPR Missing Person Registry - Controllers @author: nursix """ module = request.controller if module not in deployment_settings.modules: session.error = T("Module disabled!") redirect(URL(r=request, c="default", f="index")) module = request.controller # --------------------...
luisibanez/SahanaEden
controllers/mpr.py
Python
mit
5,474
""" @date: 27/Nov/2014 @author: Haridas N<haridas.nss@gmail.com> Active Testcases on this files are - 1. Test authentication API. 2. Test Upload API 3. Test the Core data structure and Image Model's methods. 4. AWS S3 behavior 5. Full Integration Test All these test will run without Http Server or Celery. """ import...
haridas/image_uploader_py
uploader/tests.py
Python
mit
10,460
#!/usr/bin/env python import os from setuptools import setup, find_packages ROOT = os.path.dirname(__file__) def read(fname): return open(os.path.join(ROOT, fname)).read() setup( name="django-soundcheck", version="0.9", url="https://github.com/bsvetchine/django-soundcheck", license="MIT", d...
bsvetchine/django-soundcheck
setup.py
Python
mit
841
# -*- coding: utf-8 -*- import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore import numpy as np import csv, gzip, os from pyqtgraph import Point class GlassDB: """ Database of dispersion coefficients for Schott glasses + Corning 7980 """ def __init__(self, fileName='schott_glasses.csv'): ...
pmaunz/pyqtgraph
examples/optics/pyoptic.py
Python
mit
18,598
#!/usr/bin/env python3 import requests import sys from optparse import OptionParser, BadOptionError, AmbiguousOptionError from orjson import dump from time import sleep import six class PhiloLogicRequest(object): """ Process a PhiloLogic request and save the full result set in a text file in JSON or tab...
ARTFL-Project/PhiloLogic4
extras/exportResults.py
Python
gpl-3.0
11,018
# -*- coding: utf-8 -*- from demo_app import controller import actions def register_actions(): controller.action_controller.packs.extend([ actions.GaragePack(), actions.ToolPack(), actions.StaffPack(), ])
barsgroup/objectpack
tests/objectpack_demo/demo_app/slaves/app_meta.py
Python
mit
241
import os import time from unittest import TestCase from mwscan import scan, settings from mwscan.ruleset import Files from collections import namedtuple try: from unittest import mock except ImportError: import mock class TestWebMalwareScanner(TestCase): def _load_file_rules(self, path): args =...
davidalger/magento-malware-scanner
mwscan/tests/test_mwscan.py
Python
gpl-3.0
2,739
""" Explicit mapping of NumPy array operations to Chapel array operations. """ from pych.extern import Chapel import numpy as np # pylint: disable=no-member # The ndarray member is added dynamically and therefore not visible to pylint. # pylint: disable=unused-argument # The interoperability interface exploits argument...
chapel-lang/pychapel
module/pych/array_ops.py
Python
apache-2.0
1,111
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para uploadable # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core im...
conejoninja/pelisalacarta
python/main-classic/servers/uploadable.py
Python
gpl-3.0
1,505
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flexget import plugin from flexget.event import event from flexget.components.archives import utils log = logging.getLogger('archives') class Filter...
gazpachoking/Flexget
flexget/components/archives/archives.py
Python
mit
1,819
import re from hqm_helpers import load_legacy_chapters, dump_chapters from migration_map import load_remap_as_dict class IdRules(object): def __init__(self, sub_rules=[]): uncompiled = sub_rules self.sub_rules = [] for regex, sub in uncompiled: self.sub_rules.append((re.compile...
rockobonaparte/bfsr
scripts/patch_quest_book.py
Python
cc0-1.0
12,219
# # 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...
iemejia/incubator-beam
sdks/python/apache_beam/io/gcp/bigquery_file_loads_test.py
Python
apache-2.0
30,663
""" Acceptance tests for the Import and Export pages """ from nose.plugins.attrib import attr from datetime import datetime from flaky import flaky from abc import abstractmethod from common.test.acceptance.tests.studio.base_studio_test import StudioLibraryTest, StudioCourseTest from common.test.acceptance.pages.stu...
synergeticsedx/deployment-wipro
common/test/acceptance/tests/studio/test_import_export.py
Python
agpl-3.0
14,174
import demistomock as demisto from CommonServerPython import * import base64 import json import os import re import urllib.parse import requests import traceback from typing import Dict, Any, Tuple, Pattern # Disable insecure warnings requests.packages.urllib3.disable_warnings() # pylint: disable=no-member ''' CO...
demisto/content
Packs/FireEyeHX/Integrations/FireEyeHXv2/FireEyeHXv2.py
Python
mit
87,756
# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4: # conveyor/src/main/python/conveyor/platform/linux.py # # conveyor - Printing dispatch engine for 3D objects and their friends. # Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@makerbot.com> # # This program is free software: you can redistribute it and/or mod...
makerbot/conveyor
src/main/python/conveyor/platform/linux.py
Python
agpl-3.0
1,881
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
jj0hns0n/geonode
geonode/maps/tests.py
Python
gpl-3.0
30,184
########################################################### # # Copyright (c) 2009, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
diegocortassa/TACTIC
src/tactic/active_directory/ad_search_wdg.py
Python
epl-1.0
13,954
from openpyxl.writer.charts import PieChartWriter from openpyxl.xml.constants import CHART_NS from openpyxl.xml.functions import safe_iterator, fromstring import pytest from openpyxl.tests.helper import compare_xml from openpyxl.tests.schema import chart_schema class TestPieChart: def test_ctor(self, PieChart...
Hitachi-Data-Systems/org-chart-builder
openpyxl/charts/tests/test_pie.py
Python
apache-2.0
1,630
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import string import re import datetime import pyperclip # Edit Me! # Remember, this is during signup, so current month is not March, it'...
foobarbazblarg/stayclean
stayclean-2020-march/display-during-signup.py
Python
mit
6,945
import discord from discord.ext import commands import asyncio import requests from bs4 import BeautifulSoup from urllib import parse from urllib.parse import parse_qs, quote_plus from .utils.chat_formatting import pagify, box from urllib.request import Request, urlopen import traceback import inspect import textwrap f...
Dino0631/RedRain-Bot
cogs/cogs/utils2.py
Python
gpl-3.0
44,691
__author__ = 'stephen' # =============================================================================== # GLOBAL IMPORTS: import os,sys import numpy as np import argparse import time # =============================================================================== # LOCAL IMPORTS: HK_DataMiner_Path = os.path.relpath(o...
stephenliu1989/HK_DataMiner
hkdataminer/scripts/test_kcenter_tica.py
Python
apache-2.0
5,371
#!/usr/bin/env python # encoding: utf-8 from itertools import permutations from math import sqrt, pow class AssertRouteError(Exception): pass class AssertTaskDataError(Exception): pass class Node(object): def __init__(self, name, x, y): self.name = name self.x = x self.y = y ...
Cosiek/KombiVojager
base_task.py
Python
mit
6,203
import locale import os import re from posixpath import join as posix_join from pelican.settings import DEFAULT_CONFIG from pelican.tests.support import (mute, skipIfNoExecutable, temporary_folder, unittest) from pelican.tools.pelican_import import (blogger2fields, build_header, ...
getpelican/pelican
pelican/tests/test_importer.py
Python
agpl-3.0
18,963
from rest_framework.views import APIView from rest_framework.response import Response from jwt import token_factory from authtoken.serializers import AuthTokenSerializer from authtoken.settings import api_settings, secret_key from authtoken.authentication import get_token_instance class ObtainAuthToken(APIView): ...
MenloAthertonCoding/cruzebase
authtoken/views.py
Python
apache-2.0
771
from polyphony import testbench from polyphony.typing import List, bit, int8 def typing03_a(xs:List[bit][8], i:int8) -> bit: return xs[i] def typing03_b(xs:List[int][8], i:int8) -> bit: return xs[i] @testbench def test(): data = [0, 1, 1, 0, 1, 0, 1, 0] # type: List[bit][8] for i in r...
ktok07b6/polyphony
tests/typing/typing03.py
Python
mit
446
# -*- 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): pass def backwards(self, orm): pass models = { } complete_apps = ['f1']
sar009/formula-1
f1/migrations/0001_initial.py
Python
mit
311
# -*- coding: utf-8 -*- import sys import socket import intelmq.lib.harmonization from intelmq.lib.bot import Bot class GethostbynameExpertBot(Bot): def process(self): event = self.receive_message() for key in ["source.", "destination."]: key_fqdn = key + "fqdn" key_ip =...
robcza/intelmq
intelmq/bots/experts/gethostbyname/expert.py
Python
agpl-3.0
818
from django.views.generic import FormView from sample.forms import SampleForm class SampleFormView(FormView): form_class = SampleForm template_name = "sample/index.html"
madisona/django-google-maps
sample/views.py
Python
bsd-2-clause
181
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>, Alexander Bulimov <lazywolf0@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ =...
mheap/ansible
lib/ansible/modules/system/lvol.py
Python
gpl-3.0
19,498
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.conf import settings from django.db.models import F # For each instance, cache "adjunct" objects -- frequently-accessed objects # which change rarely -- by storing them in ...
jwalgran/otm-core
opentreemap/treemap/lib/object_caches.py
Python
gpl-3.0
5,896
# -*- coding: utf-8 -*- # # HDF5 Tutorial documentation build configuration file, created by # sphinx-quickstart on Mon Sep 1 12:33:46 2014. # # 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....
akrause2014/HDF5-Basics
c/conf.py
Python
apache-2.0
8,225
from psrd.stat_block.utils import colon_filter, default_closure, collapse_text from psrd.universal import StatBlockSection, StatBlockHeading, filter_name def is_animal_companion(sb, book): fields = dict(sb.keys) if fields.has_key('AC') or fields.has_key("Ability Scores"): for detail in sb.details: if detail.__c...
devonjones/PSRD-Parser
src/psrd/stat_block/animal_companion.py
Python
gpl-3.0
1,966
from django_google_charts.utils import OptionsDict from django_google_charts.charts import Chart KEY, VALUE, OVERRIDE = 'key', 'value', 'override' class SuperChart(Chart): options = {KEY: VALUE} class SubChart1(SuperChart): options = {'other_key': 'other_value'} class SubChart2(SuperChart): options =...
danpalmer/django-google-charts
tests/test_chart_options.py
Python
mit
675
import time class SizedDict(dict): ''' Sized dictionary without timeout. ''' def __init__(self, size=1000): dict.__init__(self) self._maxsize = size self._stack = [] def __setitem__(self, name, value): if len(self._stack) >= self._maxsize: self.__delitem__(self...
ActiveState/code
recipes/Python/496842_Sized_Dictionary/recipe-496842.py
Python
mit
1,920
import logging import logging.config from vFense import VFENSE_LOGGING_CONFIG from vFense.core.queue.queue import AgentQueue from vFense.settings import Default from vFense.operations.agent_operations import AgentOperation from vFense.errorz.error_messages import AgentOperationCodes from vFense.plugins import ra fro...
dtklein/vFense
tp/src/plugins/ra/raoperation.py
Python
lgpl-3.0
4,192
import pytest from dateutil import tz import arrow from unifispot.core.models import Wifisite,Device,Guesttrack,Guest from unifispot.core.guestutils import init_track,validate_track,redirect_guest from tests.helpers import randomMAC @pytest.fixture(scope='function') def populate_analytics_tracks(request,session): ...
Spotipo/spotipo
tests/modules/analytics/conftest.py
Python
agpl-3.0
4,078