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 -*-
from clip2zeus.common import Clip2ZeusApp, Clip2ZeusCtl, DEFAULT_PORT
def main():
from optparse import OptionParser
import sys
parser = OptionParser()
parser.add_option('-p', '--port', dest='port', default=DEFAULT_PORT, help='The port for the daemon to li... | codekoala/clip2zeus | clip2zeus/clip2zeus_ctl.py | Python | mit | 632 |
"""A module for handle .ndata files for Swift."""
from __future__ import annotations
# standard libraries
import binascii
import calendar
import datetime
import io
import logging
import json
import numpy
import numpy.typing
import os
import pathlib
import struct
import threading
import time
import typing
# local lib... | nion-software/nionswift | nion/swift/model/NDataHandler.py | Python | gpl-3.0 | 23,221 |
"""
Copyright (C) 2014, Jaguar Land Rover
This program is licensed under the terms and conditions of the
Mozilla Public License, version 2.0. The full text of the
Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
Maintainer: Rudolf Streif (rstreif@jaguarlandrover.com)
"""
"""
Backend daemon that conne... | rstreif/rvi_backend | server/rviserver.py | Python | mpl-2.0 | 9,882 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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 lat... | tbielawa/ansible | lib/ansible/playbook/task.py | Python | gpl-3.0 | 2,376 |
# Copyright 2013 Pawel Daniluk, Bartek Wilczynski
#
# This file is part of WeBIAS.
#
# WeBIAS is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any l... | pawelld/webias | webias/query.py | Python | agpl-3.0 | 3,961 |
# Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | kaste/mockito-python | mockito/spying.py | Python | mit | 3,217 |
"""Decorators marks that a doctest should be skipped, for both python 2 and 3.
The IPython.testing.decorators module triggers various extra imports, including
numpy and sympy if they're present. Since this decorator is used in core parts
of IPython, it's in a separate module so that running IPython doesn't trigger
tho... | Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/IPython/testing/skipdoctest.py | Python | artistic-2.0 | 1,484 |
import numpy as np
import pickle
import os
dim = {}
dim['xyz'] = [0,1,2]
dim['xy' ] = [0,1]
dim['xz' ] = [0,2]
dim['yz' ] = [1,2]
dim['x' ] = [0]
dim['y' ] = [1]
dim['z' ] = [2]
def user_material():
pass
class Material(object):
def save(self):
print(self._outdir)
"""save class as self.nam... | MaxwellGEMS/emclaw | emclaw/utils/materials.py | Python | lgpl-3.0 | 37,566 |
import sqlalchemy as sa
from sqlalchemy_utils import batch_fetch, with_backrefs
from tests import TestCase
class TestBatchFetchDeepRelationships(TestCase):
def create_models(self):
class User(self.Base):
__tablename__ = 'user'
id = sa.Column(sa.Integer, autoincrement=True, primary_... | tonyseek/sqlalchemy-utils | tests/batch_fetch/test_deep_relationships.py | Python | bsd-3-clause | 4,368 |
html = """
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gallery</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha... | btnpushnmunky/pygallerycreator | pygallerycreator/bootstrap_html.py | Python | mit | 3,883 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 ... | pmverdugo/fiware-validator | validator/tests/api/middleware/test_ssl.py | Python | apache-2.0 | 1,568 |
from datetime import datetime, timedelta
import json
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.datastructures import SortedDict
from django.utils.safestring import mark_safe
from django.... | SEL-Columbia/commcare-hq | corehq/apps/hqwebapp/templatetags/hq_shared_tags.py | Python | bsd-3-clause | 6,328 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (c) 2010-Today Elico Corp. All Rights Reserved.
# Author: LIN Yu <lin.yu@elico-corp.com>... | PierreFaniel/openerp-7.0 | l10n_cn_report_invoice/__init__.py | Python | agpl-3.0 | 1,191 |
import numpy as np
import tensorflow as tf
import connect_data
from neural_network_decision_tree import nn_decision_tree
import time
from sklearn.model_selection import train_test_split
from NNDT_RF import random_forest
x = connect_data.feature
y = connect_data.label
seed = 1990
X_train, X_test, y_train, y_test = t... | Knight13/Exploring-Deep-Neural-Decision-Trees | Connect-4/RF.py | Python | unlicense | 651 |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-5 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 G... | ScottWales/rose | lib/python/rose/macros/duplicate.py | Python | gpl-3.0 | 3,446 |
from django.shortcuts import render
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth import get_user_model
from .forms import SignUpForm
MyUser = get_user_model()
def home(request):
if request.user.is_authenticated():
return render(request, 'home/feed.html', {})
else:... | TheRedLady/codebook | codebook/home/views.py | Python | gpl-3.0 | 720 |
import argparse
import json
import logging
import os
import sys
from tools import localpaths # noqa: flake8
from six import iteritems
from . import virtualenv
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
def load_commands():
rv = {}
with open(os.pa... | dati91/servo | tests/wpt/web-platform-tests/tools/wpt/wpt.py | Python | mpl-2.0 | 4,243 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This is the command line interface to py-obfsproxy.
It is designed to be a drop-in replacement for the obfsproxy executable.
Currently, not all of the obfsproxy command line options have been implemented.
"""
import sys
import obfsproxy.network.launch_transport as launch... | NullHypothesis/obfsproxy | obfsproxy/pyobfsproxy.py | Python | bsd-3-clause | 6,365 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
#URL de listado de clientes
url(r'^$', 'customers.views.index', name='home'),
# TALLER agregar la url para la vista de c... | davoshack/crm | simplecrm/urls.py | Python | gpl-2.0 | 466 |
# -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | erh3cq/hyperspy | hyperspy/utils/markers.py | Python | gpl-3.0 | 1,653 |
from argparse import SUPPRESS
from time import time
from loguru import logger
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.orm.query import Query
from sqlalchemy.sql.expression import ClauseElement, Executable
from flexget import manager, options
from flexget.event import event
logger = logger.bind(n... | crawln45/Flexget | flexget/plugins/cli/explain_sql.py | Python | mit | 1,577 |
"""mBuild recipe for a silica interface."""
import math
import random
import numpy as np
from mbuild import Compound, Port
from mbuild.lib.recipes.tiled_compound import TiledCompound
class SilicaInterface(Compound):
"""A recipe for creating an interface from bulk silica.
Carves silica interface from bulk, ... | iModels/mbuild | mbuild/lib/recipes/silica_interface.py | Python | mit | 6,819 |
import abc
import re
class Formatter:
@abc.abstractmethod
def format(self, query):
''' Should return a human-readable version of the query string
'''
pass
class BasicFormatter(Formatter):
''' Provides a basic default formatting for query strings
This formatter provides only in... | ALSchwalm/sparqllib | sparqllib/formatter.py | Python | mit | 1,625 |
#!/usr/bin/python3.5
# -*- coding: utf-8 -*-
"""
# FriendBot, a Telegram bot that emulates friend's phrases.
# Copyright (C) 2016 Quantum Code
# 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 Softwa... | Quantum-Code/friendbot | friendbot/bot.py | Python | gpl-3.0 | 4,194 |
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | Yelp/kafka-utils | kafka_utils/util/serialization.py | Python | apache-2.0 | 930 |
import asyncio
from datetime import datetime
from random import choice
import pytz
import common
from cogs.drinkingcog import consume_drink
from cogs.duelcog import item_chance_roll
from discord.ext import commands
from objs.duel_item import get_name, get_slot
from objs.weekend_games import pretty_date
class Gameti... | nluedtke/brochat-bot | cogs/gametimecog.py | Python | mit | 9,841 |
import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="parcoords", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_... | plotly/plotly.py | packages/python/plotly/plotly/validators/parcoords/_ids.py | Python | mit | 389 |
import bleach
from django import forms
from django.contrib.auth.models import Group
from osf.models import PreprintProvider, Subject
from admin.base.utils import (get_subject_rules, get_toplevel_subjects,
get_nodelicense_choices, get_defaultlicense_choices, validate_slug)
class PreprintProviderForm(forms.ModelF... | mfraezz/osf.io | admin/preprint_providers/forms.py | Python | apache-2.0 | 4,770 |
"""Test the JuiceNet config flow."""
import aiohttp
from pyjuicenet import TokenError
from homeassistant import config_entries, setup
from homeassistant.components.juicenet.const import DOMAIN
from homeassistant.const import CONF_ACCESS_TOKEN
from tests.async_mock import MagicMock, patch
def _mock_juicenet_return_v... | tchellomello/home-assistant | tests/components/juicenet/test_config_flow.py | Python | apache-2.0 | 4,247 |
from django.utils import timezone
import datetime
from polls.models import Question
def create_question(question_text, days):
"""
Creates a question with the given `question_text` published the given
number of `days` offset to now (negative for questions published
in the past, positive for questions th... | leifos/tango_with_tests | django_tutorial/polls/test_utils.py | Python | mit | 529 |
from rest_framework import permissions
class IsStaffOrReadOnly(permissions.BasePermission):
"""
Custom permission to only allow staff members to edit object.
"""
def has_permission(self, request, view):
# Read permissions are allowed to any request,
# so we'll always allow GET, HEAD o... | Fenykepy/phiroom | src/api/phiroom/permissions.py | Python | agpl-3.0 | 2,652 |
import psutil
def is_up(ps_name):
return True in [psutil.Process(pid).name() == ps_name for pid in psutil.get_pid_list()]
| knmkr/perGENIE | pergenie/lib/utils/service.py | Python | agpl-3.0 | 127 |
#!/usr/bin/env python
# -*- coding: utf-8 -*
#
# @author XU Kai(xukai.ken@gmail.com)
# @date 2016-12-04 星期日
#
#
# #fileOverview PMW 调试测试
#
#
#
import RPi.GPIO as GPIO
import time
import atexit
atexit.register(GPIO.cleanup)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT, initial=False)
p = GPIO.PWM(7, 50) #50HZ
... | EchoFUN/raspi | tests/camera_pwm_1.py | Python | mit | 1,072 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | googleapis/python-dialogflow | samples/snippets/answer_record_management_test.py | Python | apache-2.0 | 3,690 |
from . import Block
class BlockRunwayView(Block):
validation = '^R\d{2}/(\d{4}|[M,P]\d{4}|\d{4}V\d{4})([U,D,N]$|$)'
name = 'runway_view'
patterns = {
'qnh': [('\d{3,4}', '_qnh')],
}
def _qnh(self, q):
return int(q) | tspycher/python-aviationdata | aviationdata/blocks/blockrunwayview.py | Python | mit | 253 |
from numpy import exp, array, random, dot
class NeuronLayer():
def __init__(self, number_of_neurons, number_of_inputs_per_neuron):
self.synaptic_weights = 2 * random.random((number_of_inputs_per_neuron, number_of_neurons)) - 1
class NeuralNetwork():
def __init__(self, layer1, layer2):
self.l... | miloharper/multi-layer-neural-network | main.py | Python | mit | 4,053 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/export_jobs_operation_results_operations.py | Python | mit | 4,728 |
# -*- 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 model 'GigType'
db.create_table('gig_registry_gigtype', (
('id', self.gf('django.db.mod... | shaunokeefe/gigs | gigs/gig_registry/migrations/0013_auto__add_gigtype__add_field_gig_gig_type.py | Python | bsd-3-clause | 9,596 |
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import dab
class qa_complex_to_interleaved_float_vcf(gr_unittest.TestCase):
"""
@brief QA for the complex to interleaved float block
This class implements a test bench to verify the corresponding C++ class.
"""
def setUp(sel... | kit-cel/gr-dab | python/qa/qa_complex_to_interleaved_float_vcf.py | Python | gpl-3.0 | 1,038 |
__copyright__ = """
Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be... | vincele/stgit | stgit/commands/diff.py | Python | gpl-2.0 | 2,738 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#modulo para traducir datos
import zdb
class ZT:
def __init__(self,idioma):
self.idioma=idioma
def t(self,oracion):
pass
def t2(self,oracion,contexto):
pass
def agregar_exp(self,idioma_t,idioma_t2,exp1,exp2):
pass
def agregar_p(self,idioma_t,idi... | ZerpaTechnology/AsenZor | modulos/ztec/zt.py | Python | lgpl-3.0 | 385 |
from functools import wraps
from tornado.options import options
import test.base
import models
def twittertest(fn):
# This would be a "skip" if unittest v1 supported skipping.
@wraps(fn)
def test(self):
if options.twitter_consumer_key:
return fn(self)
return test
class ToolsFin... | spaceninja/mltshp | test/functional/tools_find_people_tests.py | Python | mpl-2.0 | 2,623 |
#!/usr/bin/python
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 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... | leighpauls/k2cro4 | third_party/webdriver/pylib/test/selenium/webdriver/common/element_attribute_tests.py | Python | bsd-3-clause | 8,580 |
from __future__ import print_function
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import sys
def plot_image_patches(x, ksize_rows=299, ksize_cols=299):
nr = x.shape[1]
nc = x.shape[2]
# figsize: width and height in inches. can be changed to make
#+output figur... | lixiangchun/mynotebook | machine_learning/extract_image_patches.py | Python | gpl-3.0 | 3,071 |
from flask.sessions import SessionInterface, SessionMixin
import os, binascii
class SessionData(dict, SessionMixin): pass
class Session(SessionInterface):
session_class = SessionData
def open_session(self, app, request):
self.cookie_session_id = request.cookies.get(app.session_cookie_name, None)
... | isucon/isucon3 | qualifier/webapp/python/flask_memcache_session/session.py | Python | mit | 1,635 |
##############################################################################
#
# Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>)
# and Therp BV (<http://therp.nl>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# ... | rschnapka/bank-payment | account_banking_nl_triodos/__openerp__.py | Python | agpl-3.0 | 2,042 |
from gi.repository import GLib
import sys
import softwarecenter.plugin
class ExamplePlugin(softwarecenter.plugin.Plugin):
""" example plugin that will hide the exhibits banner """
def _try_to_hide_banner(self):
if not self.app.available_pane.view_initialized:
# wait for the pane to full... | sti-lyneos/shop | doc/example_plugin.py | Python | lgpl-3.0 | 576 |
from astrodata.adutils.testutil import eq_, AstroData, sci123, scivardq123
def test7():
"""
ASTRODATA-insert TEST 7: AUTO NUMBER, Incremnt XVER & latter indx if XNAME exists
"""
ad1 = AstroData(sci123)
ad4 = AstroData(scivardq123)
print "\n >>>>>>> AD <<<<<<<<"
ad1.inf... | pyrrho314/recipesystem | trunk/astrodata/scripts/test/testinsert/test7/testinsert_test7.py | Python | mpl-2.0 | 753 |
# Copyright 2016 Tesora, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | openstack/trove | trove/common/db/models.py | Python | apache-2.0 | 14,376 |
# -*- coding: UTF-8 -*-
# Copyright 2013-2015 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at y... | khchine5/lino-welfare | lino_welfare/modlib/xcourses/__init__.py | Python | agpl-3.0 | 1,678 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import model_utils.fields
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('contributions', '0008_auto_20150219_1555'),
('promotions', '0005_auto_20150302... | mayapurmedia/tovp | tovp/promotions/migrations/0006_generaldonation.py | Python | mit | 1,102 |
import python_building
import python_control
import time
# Scale the clock
def scale_time(seconds):
# 1 second real time = 1 hours simulated time
# return 30.0*seconds/3600.0
# Run in real time
return seconds
# This is a cludge. It should return the same value
# as the control period from the control object.
PERI... | afisher1/volttron-applications | contrib/MpcAgent/src/MPC.py | Python | bsd-3-clause | 1,310 |
# -*- coding: utf-8 -*-
"""
babel.core
~~~~~~~~~~
Core locale representation and locale data access.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import os
from babel import localedata
from babel._compat import pickle, string_types
from babel.plural im... | srisankethu/babel | babel/core.py | Python | bsd-3-clause | 35,002 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Lukas Kemmer
#
# 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
#
# Unl... | lukas-ke/faint-graphics-editor | build-sys/build_sys/opts.py | Python | apache-2.0 | 4,671 |
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 28 08:34:11 2018
@author: trieu,butenko
"""
import numpy as np
d = {
'refinement_frequency': [0],
'num_ref_freqs': 1,
'rel_div_CSF': -1,
'Adaptive_frac_div': 1.0,
'Min_Scaling': 1.0,
'CSF_ref_reg': 0.0,
'rel_div': 10.0,
'rel_div_current': ... | andreashorn/lead_dbs | ext_libs/OSS-DBS/OSS_platform/GUI_tree_files/pop_up_control/dictionaries/dict_mesh_refinement.py | Python | gpl-3.0 | 331 |
from utils.donations.tests import *
| jumoconnect/openjumo | jumodjango/utils/tests/__init__.py | Python | mit | 37 |
from __future__ import annotations
from abc import ABCMeta, abstractmethod
import enum
from typing import (
Any,
Mapping,
Union,
)
from . import AbstractPlugin, BasePluginContext
__all__ = (
'AbstractStatReporterPlugin',
'AbstractErrorReporterPlugin',
'StatsPluginContext',
'ErrorPluginCon... | lablup/sorna-common | src/ai/backend/common/plugin/monitor.py | Python | lgpl-3.0 | 2,344 |
# -*- coding: utf-8 -*-
"""UnitTests for cactidbadapter."""
import unittest
from cactidbadapter import CactiDBAdapter
class UnitTests(unittest.TestCase):
"""Class UnitTests.
Unit test for cactidbadapter.
"""
def setUp(self):
"""Setup."""
self.obj = CactiDBAdapter(user='root',
... | mtoshi/cactidbadapter | tests/test_cactidbadapter.py | Python | mit | 7,545 |
# Copyright (c) 2013 Martin Abente Lahaye. - tch@sugarlabs.org
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version... | tchx84/social-sugar | extensions/web/journalx/journalx/object.py | Python | gpl-2.0 | 3,760 |
#!/usr/bin/env python3
"""{PIPELINE_NAME} pipeline (version: {PIPELINE_VERSION}): creates
pipeline-specific config files to given output directory and runs the
pipeline (unless otherwise requested).
"""
# generic usage {PIPELINE_NAME} and {PIPELINE_VERSION} replaced while
# printing usage
#--- standard library imports... | gis-rpd/pipelines | somatic/mutect/mutect.py | Python | mit | 8,727 |
# Copyright (C) 2016 Collin Capano
# 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 distributed in t... | ahnitz/pycbc | pycbc/distributions/uniform.py | Python | gpl-3.0 | 6,688 |
# 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-datalake-analytics/azure/mgmt/datalake/analytics/job/models/create_scope_job_parameters.py | Python | mit | 3,232 |
from django.test import TestCase
from dolphin.middleware import LocalStoreMiddleware
class RequestStoreMiddlewareTest(TestCase):
def test_middleware(self):
req = "Test fake request"
m = LocalStoreMiddleware()
m.process_request(req)
self.assertEquals(m.request(), req)
| coxmediagroup/dolphin | dolphin/tests/middleware.py | Python | mit | 306 |
#requirements: selenium wget python2.7 Geckodriver
import time
import sys
import wget
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys ... | daverstephens/The-SOC-Shop | Threat_Intel/GScraper.py | Python | gpl-2.0 | 1,824 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Spotify AB
#
# 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 ... | spotify/mlockexec | mlockexec/util.py | Python | apache-2.0 | 1,664 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('staff', '0006_auto_20180411_1233'),
]
operations = [
migrations.AddField(
model_name='staff',
name='... | awemulya/fieldsight-kobocat | onadata/apps/staff/migrations/0007_staff_email.py | Python | bsd-2-clause | 420 |
import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
import sys
sys.path.append("/arxiv/source_tree/cosmo-codes/spicy")
import spice_cl as scl
def write_pcl(output_file,S_l,S_l_error=None):
ell=np.arange(0,np.shape(S_l)[0])
if S_l_error==None :
np.savetxt(output_file,np.asarray([e... | tbs1980/cosmo-codes | mock_des_cls/source/make_cl_estimates.py | Python | mpl-2.0 | 2,749 |
#!/usr/bin/env python
#
# 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 ... | dprince/tripleo-heat-templates | docker/container-puppet.py | Python | apache-2.0 | 23,955 |
#!/usr/bin/env python3
# This file is part of textland.
#
# Copyright 2014 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Textland is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free ... | zyga/textland | demo6.py | Python | gpl-3.0 | 2,579 |
#!/usr/bin/env python
"""
"""
__author__ = "David Nolden<david.kde@art-master.de>, Ka-Ping Yee <ping@lfw.org>"
__version__ = "6 April 2006"
import sys, imp, os, stat, re, types, cgi
from repr import Repr
from string import expandtabs, find, join, lower, split, strip, rstrip
import pydoc
def cleanlinks(string):
... | iegor/kdevelop | languages/python/kde_pydoc.py | Python | gpl-2.0 | 4,348 |
#!/usr/bin/env python
"""Unit tests for M2Crypto.Engine."""
from M2Crypto import Engine
from tests import unittest
class EngineTestCase(unittest.TestCase):
privkey = 'tests/rsa.priv.pem'
bad_id = '1bea1edfeb97'
def tearDown(self):
Engine.cleanup()
def test_by_id_junk(self):
with s... | Edzvu/Edzvu.github.io | M2Crypto-0.35.2/tests/test_engine.py | Python | mit | 1,518 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
from django.utils.html import format_html
# Représente un type de liste : BDE, BDA, BDS...
# nom : nom du type
# deux_tours : booléen qui indique s'il y aura deux tours pour ce type de liste
class TypeListe(models.Mode... | mbahri/vote_ensimag | votes/models.py | Python | mit | 4,084 |
import cProfile
import json
from darglint.docstring.docstring import Docstring
if __name__ == '__main__':
with open('integration_tests/max_golden.json', 'r') as fin:
data = json.load(fin)
assert len(data) == 1
golden = data[0]
print(golden['docstring'])
print()
assert isinstance(golden[... | terrencepreilly/darglint | integration_tests/max_golden_profile.py | Python | mit | 402 |
# Copyright 2013 Red Hat, 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 agre... | wolverineav/neutron | neutron/agent/linux/ovsdb_monitor.py | Python | apache-2.0 | 4,444 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | jtomasek/tuskar-ui-1 | tuskar_ui/infrastructure/resource_management/tests.py | Python | apache-2.0 | 2,961 |
# subSystemBonusMinmatarElectronicScanProbeStrength
#
# Used by:
# Subsystem: Loki Electronics - Emergent Locus Analyzer
type = "passive"
def handler(fit, module, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.group.name == "Scanner Probe",
"baseSensorStrength... | Ebag333/Pyfa | eos/effects/subsystembonusminmatarelectronicscanprobestrength.py | Python | gpl-3.0 | 496 |
from languages import languages
from client import Client
def main():
return
if __name__ == '__main__':
main() | scruwys/easy_translate | easy_translate/__init__.py | Python | mit | 116 |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | barnone/EigenD | tools/packages/SCons/compat/_scons_hashlib.py | Python | gpl-3.0 | 2,950 |
# -*- coding: utf-8 -*-
"""
GIS_TOOLS
==================
This module contains tools to help project between coordinate systems. The
module will first use GDAL if installed. If GDAL is not installed then
pyproj is used. A test has been made for new versions of GDAL which swap the
input lat and lon when using transf... | MTgeophysics/mtpy | mtpy/utils/gis_tools.py | Python | gpl-3.0 | 26,855 |
# import resource
import resource
import numpy as np
import helpers.Time as t
import helpers.load_data as data
import helpers.SplitMatrix as splitmatrix
from sklearn import linear_model
import pandas as pd
import helpers.NumbersRounder as rounder
ratings = data.load_ratings()
nfolds = 5
np.random.seed(17)
seqs = [x % ... | Kyziridis/recommender_system | recommender.py | Python | gpl-3.0 | 11,740 |
from ..utils import type_from_ast, is_valid_literal_value
from ..error import GraphQLError
from ..type.definition import is_composite_type, is_input_type, is_leaf_type, GraphQLNonNull
from ..language import ast
from ..language.visitor import Visitor, visit
from ..language.printer import print_ast
class ValidationRule... | elastic-coders/graphqllib | graphql/core/validation/rules.py | Python | mit | 22,135 |
import os
import unittest
from os.path import abspath
from coalib.results.Diff import Diff
from coalib.results.Result import RESULT_SEVERITY, Result
from coalib.results.ResultFilter import (
ensure_files_present,
filter_results,
remove_range,
remove_result_ranges_diffs)
from coalib.results.SourceRange ... | svsn2117/coala | tests/results/ResultFilterTest.py | Python | agpl-3.0 | 28,171 |
"""
sentry.web.urls
~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
from django.conf.urls import *
from django.views.defaults import page_not_found
from sentry.conf.settings import KEY
from sentry.web import views, fee... | primepix/django-sentry | sentry/web/urls.py | Python | bsd-3-clause | 1,832 |
from pageobjects.base import PageObject
from pageobjects.settings import SettingsFooter
class DisksSettings(PageObject, SettingsFooter):
@property
def disks(self):
elements = self.parent.\
find_elements_by_css_selector('div.node-disks > div')
return [Disk(el) for el in elements]
... | ddepaoli3/fuel-main-dev | fuelweb_ui_test/pageobjects/node_disks_settings.py | Python | apache-2.0 | 3,464 |
# Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | google/pigweed | pw_system/py/pw_system/device.py | Python | apache-2.0 | 7,016 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bheemboy.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| s-gv/bheemboy | manage.py | Python | mit | 252 |
from js_helper import _do_test_raw
def test_pref_innocuous_branch():
"""
Tests that innocuous preferences created outside of the "extensions." branch
from defaults/preferences/*.js files throw warnings, and that ones created
in proper branches don't.
"""
assert _do_test_raw("""
pref("foo.b... | kmaglione/amo-validator | tests/test_js_prefs.py | Python | bsd-3-clause | 1,581 |
'''
Created on Jun 22, 2012
@author: eric
'''
import unittest
from testbundle.bundle import Bundle
from databundles.identity import * #@UnusedWildImport
from test_base import TestBase
class Test(TestBase):
def setUp(self):
self.copy_or_build_bundle()
self.bundle = Bundle()
self.b... | treyhunner/databundles | test/test_bundle.py | Python | bsd-3-clause | 14,223 |
try:
from pylibdmtx import pylibdmtx
except ImportError:
pylibdmtx = None
__all__ = ()
else:
__all__=('DataMatrix',)
from reportlab.graphics.barcode.common import Barcode
from reportlab.lib.utils import asBytes
from reportlab.platypus.paraparser import _num as paraparser_num
from reportlab.graphics.wid... | piMoll/SEILAPLAN | lib/reportlab/graphics/barcode/dmtx.py | Python | gpl-2.0 | 7,880 |
#! /usr/bin/python
DEBUG=False
import sys
import os.path
if len(sys.argv) != 2:
sys.exit("Z3 directory required as single command-line argument.")
HEADER = '''// THIS FILE IS BUILD AUTOMATICALLY, DO NOT CHANGE!!!
#include<jni.h>
#include<stdlib.h>
#include"z3.h"
// include CPAchecker-specific parts
#include"in... | nishanttotla/predator | cpachecker/lib/native/source/libz3j/buildZ3wrapper.py | Python | gpl-3.0 | 10,950 |
#!/bin/python3.5
# Programa obtenido de hacker run, se le pasa lista con 0 y 1, que simbolizan puertas, 0 la puerta abierta 1 la puerta cerrada.
# Nuestro objetivo es abrir todas las puertas
# si se abre y las subyacentes se abrirán si no están abiertas
# el programa devuelve para una lista de 0 y 1 le mínimo de puert... | BlancaCC/cultutrilla | python_aprendizaje/ejemplos_básicos/puertas.py | Python | gpl-3.0 | 1,203 |
# coding=utf-8
#########################################
# kNN: k Nearest Neighbors
# Input: newInput: vector to compare to existing dataset (1xN)
# dataSet: size m data set of known vectors (NxM)
# labels: data set labels (1xM vector)
# k: number of neighbors to use... | gatieme/AderXCoding | technology/machine_learning/K-Nearest-Neighbor/simple/knn.py | Python | gpl-2.0 | 2,062 |
"""Settings for AutoShare"""
# Youtube url and api settings
Youtube_playlistId = ""
Youtube_api_key = ""
Youtube_base_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=1&playlistId="+Youtube_playlistId+"&key="+Youtube_api_key
Youtube_watch_url = "https://www.youtube.com/watch?v="
# ... | trishnaguha/AutoShare | settings.py | Python | mit | 429 |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from rpc_thrift.cython.cyframed_transport_ex import TCyFramedTransportEx
from rpc_thrift.cython.cymemory_transport import TCyMemoryBuffer
from rpc_thrift.cython.cyframed_transport import TCyFramedTransport
from rpc_thrift.transport import TMemoryBuffer
... | wfxiang08/rpc_proxy_python | test/test_framed_buffer.py | Python | mit | 1,516 |
# Generated by Django 2.2.14 on 2020-08-28 18:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("utils", "0021_auto_20180826_1616"),
]
operations = [
migrations.AlterModelOptions(
name="alert",
options={"get_latest_by": ... | ChantyTaguan/zds-site | zds/utils/migrations/0022_set_default_latest_by_for_alerts.py | Python | gpl-3.0 | 409 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import comma_and
from frappe.model.doc... | RandyLowery/erpnext | erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py | Python | gpl-3.0 | 3,791 |
from django.core.management import call_command
import pytest
import septentrion
def test_showmigrations_command_override(mocker):
mock_django_handle = mocker.patch(
'django.core.management.commands.showmigrations.Command.handle')
mock_show_migrations = mocker.patch(
'septentrion.show_migrati... | novafloss/django-north | tests/test_showmigrations_command.py | Python | mit | 2,400 |
#!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
setup(name='french_dates_to_ical',
version='0.0.1',
author='Michaël Launay',
author_email='michaellaunay@ecreall.com',
url='http://www.ecreall.com/ressources/french_dates_to_ical',
download_url='https://git... | michaellaunay/french_dates_to_ical | setup.py | Python | agpl-3.0 | 1,696 |
import json
import unittest
from ldap3 import (
Server,
Connection,
MOCK_SYNC,
LEVEL,
SUBTREE,
ALL_ATTRIBUTES
)
from setexpression.ldap import LDAPFilterSetExpression
def p(uid, quoted=False):
'''Very simple constructor for person dns.'''
dn = 'uid={},ou=people,ou=top'.format(uid)
... | colinhiggs/setexpression | tests.py | Python | agpl-3.0 | 4,184 |
# -*- coding: utf-8 -*-
"""
This file contains the Qudi hardware file to control the microwave dummy.
Qudi 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... | childresslab/MicrocavityExp1 | hardware/microwave/mw_source_dummy.py | Python | gpl-3.0 | 9,607 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.