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
"""Stomp Protocol Connectivity
This provides basic connectivity to a message broker supporting the 'stomp' protocol.
At the moment ACK, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, ABORT, COMMIT, CONNECT and DISCONNECT operations
are supported.
This changes the previous version whic... | jjgod/confbot | stomp.py | Python | gpl-2.0 | 34,366 |
import sys
class gene:
# Initialize the gene with the correct types from a list of fields
def __init__(self, fields):
# Read in fields
self.fields = fields # Store for printing original gene later
self.start = int(fields[0])
self.end = int(fields[1])
self.score = float... | COMBINE-lab/matryoshka_work | coredomains-import/python-src/choosegenes.py | Python | gpl-3.0 | 2,956 |
"""
Test Utility Helper
Function to help unit tests
"""
import os
import yaml
from rest_framework import status
from ozpcenter import model_access as generic_model_access
TEST_BASE_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', 'ozpcenter', 'scripts'))
TEST_DATA_PATH = os.path.join(TEST... | aml-development/ozp-backend | tests/ozpcenter/helper.py | Python | apache-2.0 | 12,254 |
from django.conf.urls.defaults import patterns, url
from feeds import LatestPostFeed, TagFeed, CatFeed
from feeds import LatestPostFeedAtom, TagFeedAtom, CatFeedAtom
from sitemaps import PostSitemap
from commons.sitemaps import StaticSitemap
from commons.urls import live_edit_url
post_r = '(?P<year>\d{4})/(?P<month>\d... | Nivl/www.melvin.re | nivls_website/blog/urls.py | Python | gpl-3.0 | 2,578 |
"""API of mode Grueneisen parameter calculation."""
# Copyright (C) 2015 Atsushi Togo
# All rights reserved.
#
# This file is part of phonopy.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of s... | atztogo/phonopy | phonopy/api_gruneisen.py | Python | bsd-3-clause | 6,461 |
# uncomment the import statements for debugging in PyCharm, VS Code or other IDEs.
# import demistomock as demisto
# from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
# from CommonServerUserPython import * # noqa
TRANSLATE_OUTPUT_PREFIX = 'Phrase'
# Disable insecure warnings
requests.... | demisto/content | docs/tutorial-integration/YodaSpeak/Integrations/YodaSpeak/YodaSpeak.py | Python | mit | 3,719 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer GetFeatureInfo WMS.
From build dir, run: ctest -R PyQgsServerWMSGetFeatureInfo -V
.. note:: 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; ... | dgoedkoop/QGIS | tests/src/python/test_qgsserver_wms_getfeatureinfo.py | Python | gpl-2.0 | 17,936 |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
This is a module to check the filesystem for the presence and
permissions of certain files. It can also be used to correct the
permissions (but no... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/paste/script/checkperms.py | Python | bsd-3-clause | 13,295 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
i_landsat_toar.py
-----------------
Date : March 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
***************************... | gioman/QGIS | python/plugins/processing/algs/grass7/ext/i_landsat_toar.py | Python | gpl-2.0 | 2,317 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"""
Azimuthal Equal A... | duyuan11/glumpy | glumpy/transforms/azimuthal_equal_area.py | Python | bsd-3-clause | 944 |
# Copyright 2020 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... | petewarden/tensorflow | tensorflow/python/keras/engine/keras_tensor.py | Python | apache-2.0 | 25,155 |
#!/usr/bin/python
import sys, os, os.path, subprocess
import re
class Settings:
def bin(self):
return self._bin
class LinuxSettings(Settings):
def __init__(self, dump_syms_dir):
self._bin = os.path.join(dump_syms_dir, 'dump_syms')
def offset(self, path):
return path
def run_... | atiti/crashcollector | symbolstore.py | Python | gpl-2.0 | 2,873 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | lahwaacz/qutebrowser | qutebrowser/misc/sessions.py | Python | gpl-3.0 | 19,672 |
# 逆ポーランド記法とは、演算子をオペランドの後に記述するプログラムを記述する記法のこと。
# 1 2 + 5 4 + * は(1 + 2) * (5 + 4)となる。
# 1 2 + 3 4 - *
#input_line = input()
RPN_list = []
while True:
n = input()
if n == '+':
print('enter "+" to the stack')
a = RPN_list.pop(len(RPN_list) - 1)
b = RPN_list.pop(len(RPN_list) - 1)
... | shofujimoto/examples | until_201803/python/src/algorithm/sort/stack.py | Python | mit | 1,220 |
# Copyright (c) 2018 PaddlePaddle 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 appli... | luotao1/Paddle | python/paddle/fluid/tests/unittests/sequence/test_sequence_mask.py | Python | apache-2.0 | 5,203 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Lector: lector.py
Copyright (C) 2011-2014 Davide Setti, Zdenko Podobný
Website: http://code.google.com/p/lector
This program is released under the GNU GPLv2
"""
#pylint: disable-msg=C0103
# System
import sys
import os
from PyQt5.QtGui import QIcon
from ... | zdenop/lector | lector/lector.py | Python | gpl-2.0 | 14,955 |
# 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 | drfact/link_questions.py | Python | apache-2.0 | 6,579 |
# -*- encoding: utf-8 -*-
from abjad.tools import indicatortools
from abjad.tools import markuptools
from abjad.tools import pitchtools
from abjad.tools.instrumenttools.Instrument import Instrument
class Marimba(Instrument):
r'''A marimba.
::
>>> staff = Staff("c'4 d'4 e'4 fs'4")
>>> marimba... | mscuthbert/abjad | abjad/tools/instrumenttools/Marimba.py | Python | gpl-3.0 | 4,520 |
from django.template.defaulttags import register
from survey.models import Record
def display_violation(value):
try:
return dict(Record.VIOLATIONS_CHOICES)[value]
except KeyError:
return settings.TEMPLATE_STRING_IF_INVALID
register.filter('display_violation', display_violation)
| simonspa/django-datacollect | datacollect/questionnaire/templatetags/custom_tags.py | Python | gpl-3.0 | 304 |
# coding: utf-8
from __future__ import unicode_literals
import re
import json
import base64
import zlib
from hashlib import sha1
from math import pow, sqrt, floor
from .common import InfoExtractor
from ..compat import (
compat_etree_fromstring,
compat_urllib_parse_urlencode,
compat_urllib_request,
com... | Tithen-Firion/youtube-dl | youtube_dl/extractor/crunchyroll.py | Python | unlicense | 25,083 |
"""
AsyncWith astroid node
Subclass of With astroid node, which is used to simplify set up/tear down
actions for a block of code. Asynchronous code doesn't wait for an operation
to complete, rather the code executes all operations in one go. Only valid in
body of an AsyncFunctionDef astroid node.
Attributes:
- # ... | pyta-uoft/pyta | nodes/async_with.py | Python | gpl-3.0 | 756 |
# -*- coding: utf-8 -*-
#
# bcbio_nextgen documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 1 13:33:31 2013.
#
# 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.
#... | hjanime/bcbio-nextgen | docs/conf.py | Python | mit | 7,875 |
"""
On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east.
Here, the north-west corner of the grid is at the first row and column, and the south-east corner of the grid is at the last row and column.
Now, we walk in a clockwise spiral shape to visit every position in this grid.
Whenever... | franklingu/leetcode-solutions | questions/spiral-matrix-iii/Solution.py | Python | mit | 2,400 |
klein = raw_input()
gross = raw_input()
zahl = []
if gross[0] == '0':
zahl.append((1,0))
else:
zahl.append((0,1))
for i in range(1,len(gross)):
if gross[i] == '0':
zahl.append((zahl[i - 1][0] + 1, zahl[i - 1][1]))
else:
zahl.append((zahl[i - 1][0], zahl[i - 1][1] + 1))
plus = 0
for i in range(len(klein)):... | clarammdantas/Online-Jugde-Problems | online_judge_solutions/python.py | Python | mit | 531 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cmsplugins.baseplugin.models import BasePlugin
from filer.fields.image import FilerImageField
class Gallery(BasePlugin):
# TODO add more layouts
layout = models.CharField(
max_length=20,
blank=True,
... | rouxcode/django-cms-plugins | cmsplugins/pictures/models.py | Python | mit | 1,669 |
#!/usr/bin/python
"""
Copyright 2015 Ericsson 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 by applicable law or agreed to in writi... | EricssonResearch/monad | TravelRecommendation/TravelRecommendation_faster.py | Python | apache-2.0 | 14,541 |
class Solution:
# 定义一个函数计算括号里的式子
def helper(self,s):
length=len(s)
# 检查时候含有'--','+-'
s=''.join(s)
s=s.replace('--','+')
s=s.replace('+-','-')
s=[x for x in s if x!='#']
s=['+']+s[1:-1]+['+']
tmp=0
lastsign=0
for i in range(1... | Hehwang/Leetcode-Python | code/224 Basic Calculator.py | Python | mit | 1,162 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-03 18:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('assettypes', '0002_auto_20151223_1125'),
]
operations... | nocarryr/AV-Asset-Manager | avam/assettypes/migrations/0003_auto_20160203_1203.py | Python | gpl-3.0 | 1,097 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | morelab/weblabdeusto | server/src/weblab/data/experiments.py | Python | bsd-2-clause | 10,874 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-12 01:48
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import jsonfield.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | superfluidity/RDCL3D | code/webhookhandler/migrations/0001_initial.py | Python | apache-2.0 | 983 |
"""The tests for the Switch component."""
# pylint: disable=too-many-public-methods,protected-access
import unittest
from homeassistant.bootstrap import setup_component
from homeassistant import loader
from homeassistant.components import switch
from homeassistant.const import STATE_ON, STATE_OFF, CONF_PLATFORM
from ... | hexxter/home-assistant | tests/components/switch/test_init.py | Python | mit | 3,433 |
from django.db.backends.postgresql.schema import DatabaseSchemaEditor as PostgresDatabaseSchemaEditor
from db import deletion
class DatabaseSchemaEditor(PostgresDatabaseSchemaEditor):
ON_DELETE_DEFAULT = 'NO ACTION'
ON_UPDATE_DEFAULT = 'NO ACTION'
sql_create_fk = (
'ALTER TABLE {table} ADD CONS... | laurenbarker/SHARE | db/backends/postgresql/schema.py | Python | apache-2.0 | 1,613 |
from py2neo.ext.spatial.util import parse_lat_long
from .basetest import TestBase
class TestBasic(TestBase):
def test_create_and_fetch_point(self, spatial):
geometry_name = 'basic_test'
layer_name = 'basic_layer'
spatial.create_layer(layer_name)
point = (5.5, -4.5)
shape... | fpieper/py2neo | test/ext/spatial/test_basic.py | Python | apache-2.0 | 2,162 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program 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... | alhashash/odoomrp-wip | mrp_operations_extension/models/mrp_workcenter.py | Python | agpl-3.0 | 2,159 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='App',
fields=[
('id', models.AutoField(auto_cre... | Amaranthos/jhcom | home/migrations/0001_initial.py | Python | mit | 6,580 |
#!/usr/bin/env python
import os
import sys
from setuptools import setup
if sys.argv[-1] == "publish":
os.system("python setup.py sdist bdist_wheel upload")
sys.exit()
# Hackishly inject a constant into builtins to enable importing of the
# package before the dependencies are installed.
if sys.version_info[0]... | mattpitkin/corner.py | setup.py | Python | bsd-2-clause | 1,203 |
# Copyright 2018 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... | conversationai/conversationai-moderator-reddit | perspective_reddit_bot/moderate_subreddit_test.py | Python | apache-2.0 | 4,897 |
"""General tests for the web interface."""
from __future__ import print_function
from django.core import mail
from django.test import TransactionTestCase
from django.test.utils import override_settings
from django.urls import reverse
from pykeg.backend import get_kegbot_backend
from pykeg.core import models
from pyke... | Kegbot/kegbot-server | pykeg/web/kegweb/kegweb_test.py | Python | gpl-2.0 | 10,527 |
# Copyright (C) 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
#
# This file is part of Kitty.
#
# Kitty 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, o... | cisco-sas/kitty | kitty/fuzzers/test_list.py | Python | gpl-2.0 | 6,045 |
import pickle
import os
new_man = []
try:
with open('../File/sketch.txt', 'rb') as man_file:
new_man = pickle.load(man_file)
except IOError as err:
print("File error:" + str(err))
except pickle.PickleError as perr:
print("PickleError error:" + str(perr))
| wxmylife/Python-Study-Tour | HeadPython/chapter4/Demo/Demo5.py | Python | apache-2.0 | 280 |
# (c) 2012-2014, 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) an... | youprofit/ansible | lib/ansible/executor/play_iterator.py | Python | gpl-3.0 | 17,898 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from collections import namedtuple
from pkg_resources import resource_stream # ... | Hellowlol/PyTunes | libs/babelfish/script.py | Python | gpl-3.0 | 1,773 |
# Copyright (c) by it's authors.
# Some rights reserved. See LICENSE, AUTHORS.
from peer import *
from viewer import Viewer
class Observer(Peer):
from editor import Editor
from documentChanger import DocumentChanger
Sending = [
Viewer.In.Document
]
Routings = [
(Editor.Out.Fiel... | FreshXOpenSource/wallaby-base | wallaby/pf/peer/observer.py | Python | bsd-2-clause | 1,235 |
from __future__ import absolute_import
from scipy import sparse
from scipy.sparse.linalg import spsolve
import numpy as np
from ._utils import _maybe_get_pandas_wrapper
def hpfilter(X, lamb=1600):
"""
Hodrick-Prescott filter
Parameters
----------
X : array-like
The 1d ndarray timeseries ... | bert9bert/statsmodels | statsmodels/tsa/filters/hp_filter.py | Python | bsd-3-clause | 3,157 |
# -*- coding: utf-8 -*-
"""
======================================
Show noise levels from empty room data
======================================
This shows how to use :meth:`mne.io.Raw.plot_psd` to examine noise levels
of systems. See [1]_ for an example.
References
----------
.. [1] Khan S, Cohen D (2013). Note: Mag... | Teekuningas/mne-python | examples/visualization/plot_sensor_noise_level.py | Python | bsd-3-clause | 991 |
#!/usr/bin/python
# Copyright 2014 BitPay, Inc.
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import os
import bctest
import buildenv
if __name__ == '__main__':
bc... | navcoindev/navcoin-core | src/test/navcoin-util-test.py | Python | mit | 410 |
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of BeRTOS.
#
# Bertos 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.
#
#... | dereks/bertos | wizard/BFinalPage.py | Python | gpl-2.0 | 4,486 |
#! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... | cherrishes/weilai | xingxing/protobuf/python/lib/Python3.4/google/protobuf/pyext/descriptor_cpp2_test.py | Python | apache-2.0 | 2,506 |
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000)
def longest_common_subsequence_recursive(seq1, seq2):
strings_not_lists = None
if isinstance(seq1, str) and isinstance(seq2, str):
strings_not_lists = True
elif isinstance(seq1, list) and isinstance(seq2, list):
strings_not_lists = False
assert str... | Daerdemandt/Learning-bioinformatics | SCSP/Solution.py | Python | apache-2.0 | 2,256 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://www... | stuart-knock/tvb-library | tvb/tests/library/simulator/models_test.py | Python | gpl-2.0 | 6,216 |
# Generated by Django 2.0.1 on 2018-01-17 13:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crypsis_tests', '0010_auto_20180117_1242'),
]
operations = [
migrations.AlterModelOptions(
name='item',
options={'ordering':... | sdolemelipone/django-crypsis | crypsis_tests/migrations/0011_auto_20180117_1330.py | Python | gpl-3.0 | 607 |
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
#
# Devicetree Specification documentation build configuration file, created by
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ---... | devicetree-org/devicetree-specification | source/conf.py | Python | apache-2.0 | 7,522 |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 opt... | hexpl0it/plugin.video.genesi-ita | resources/lib/resolvers/novamov.py | Python | gpl-3.0 | 1,500 |
import itertools
import numpy as np
import pandas as pd
import pytest
from vivarium.interpolation import (
Interpolation,
Order0Interp,
check_data_complete,
validate_parameters,
)
def make_bin_edges(data: pd.DataFrame, col: str) -> pd.DataFrame:
"""Given a dataframe and a column containing midpo... | ihmeuw/vivarium | tests/test_interpolation.py | Python | bsd-3-clause | 18,136 |
import bpy
from ..common import *
from .widgets import *
from .. import tools
class RevoltLightPanel(bpy.types.Panel):
bl_label = "Light and Shadow"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
bl_context = "objectmode"
bl_category = "Re-Volt"
bl_options = {"DEFAULT_CLOSED"}
@classme... | Yethiel/re-volt-addon | io_revolt/ui/light.py | Python | gpl-3.0 | 3,842 |
#!/usr/bin/python2.6
import sys, string, os, time, fnmatch, imgFG, markup, re
from markup import oneliner as o
from numpy import *
rootDir = 'html/'
pngDir = 'png/'
pathwayNameDict = {}
entityDict = {}
entityFile = {}
imgFG.printPDF = True
def getPathwayName(pid):
pid = pid.split('_')
if len(pid) != 2:
... | UCSC-MedBook/MedBook_ | tools/old-external-tools/shazam/old.htmlFG.py | Python | bsd-3-clause | 12,143 |
# Generated by Django 2.0 on 2018-03-23 11:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0054_auto_20180322_1027'),
]
operations = [
migrations.CreateModel(
name='WeizhanItemV... | ourbest/sns_app | backend/migrations/0055_articledailyinfo_runtimedata_weizhanitemview.py | Python | lgpl-3.0 | 2,389 |
import logging
from mxcube3 import socketio
from mxcube3 import app as mxcube
from mxcube3.routes import Utils
from mxcube3.routes import qutils
from mxcube3.remote_access import safe_emit
from sample_changer.GenericSampleChanger import SampleChangerState
def last_queue_node():
node = mxcube.queue.queue_hwobj._c... | amilan/mxcube3 | mxcube3/routes/signals.py | Python | gpl-2.0 | 12,584 |
"""test_models.py"""
import json
from mongoengine.errors import NotUniqueError
from models import Dashboard, Job, Event, ApiKey
from .base_testcase import ApiTestCase
class TestApiKey(ApiTestCase):
"""Test ApiKey related stuff"""
def test_api_key_default(self):
"""test key defaulting works"""
... | swilcox/badash | badash-api/tests/test_models.py | Python | mit | 6,841 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
#
#... | dsiddharth/access-keys | keystone/tests/test_pemutils.py | Python | apache-2.0 | 11,150 |
import pickle
import pylab as pl
from operator import itemgetter
import scipy.io as io
import numpy as np
import sys
# next:
# implement function passing
# implement multiple variables
# implement multiple variable arrays
# implement wildcard at the end
# implement warning messages:
# - the rwchunksize
def nctypecod... | hendrikwout/pynacolada | trash/pynacolada-20130925-1.py | Python | gpl-3.0 | 25,078 |
# This script showcases lines and parked runnables
#
# The script creates a line object between the positions of the Earth and the Moon. Then,
# it parks a runnable which updates the line points with the new positions of the
# objects, so that the line is always up to date, even when the objects move. Finally,
# time i... | ari-zah/gaiasky | assets/scripts/showcases/line-objects-update.py | Python | lgpl-3.0 | 2,126 |
from datetime import datetime, timedelta
from django import template
from package.models import Commit
from package.context_processors import used_packages_list
register = template.Library()
class ParticipantURLNode(template.Node):
def __init__(self, repo, participant):
self.repo = template.Variable(... | audreyr/opencomparison | package/templatetags/package_tags.py | Python | mit | 1,974 |
# encoding: UTF-8
"""
包含一些CTA因子挖掘中常用的函数
"""
from __future__ import division
from visFunction import *
from calcFunction import *
| moonnejs/uiKLine | ctaFunction/__init__.py | Python | mit | 159 |
import sys
sys.path.insert(1, "../../../")
import h2o
######################################################
#
# Sample Running GBM on prostate.csv
def prostateGBM(ip,port):
# Connect to a pre-existing cluster
# connect to localhost:54321
df = h2o.import_file(path=h2o.locate("smalldata/logreg/prostate.csv"))... | PawarPawan/h2o-v3 | h2o-py/tests/testdir_algos/gbm/pyunit_prostateGBM.py | Python | apache-2.0 | 1,224 |
from qxpacker.Container import Container , ContainerFileType
from qxpacker.DdContainer import DdContainer
from qxpacker.EchoContainer import EchoContainer
import os , tempfile
import tarfile
# OPTIONS:
# name : possible values : description
#------------------------------------------------------------
# ... | TODOTomorrow/qxpacker | qxpacker/TarContainer.py | Python | mit | 2,442 |
"""
Copyright 2010 Rusty Klophaus <rusty@basho.com>
Copyright 2010 Justin Sheehy <justin@basho.com>
Copyright 2009 Jay Baird <jay@mochimedia.com>
This file is provided to you 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 o... | richleland/riak-python-client | riak/metadata.py | Python | apache-2.0 | 930 |
from itertools import count
def main(j, args, params, tags, tasklet):
page = args.page
page.addCSS(cssContent='''
.comparison-block{
border: 1px solid #CCE4E2;
margin-bottom: 10px;
}
.comparison-block:hover{
border: 1px solid #B0D7D5;
}
.comparison-block:hover .title{
background-color: #62a29e;
color: #f... | Jumpscale/jumpscale_portal8 | apps/portalbase/macros/page/Comparison/1_comparison.py | Python | apache-2.0 | 4,616 |
"""
This file contains general functions for swiftbrowser that don't merit their
own file.
"""
# -*- coding: utf-8 -*-
#pylint:disable=E1101
import os
import logging
from swiftclient import client
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.contrib i... | bkawula/django-swiftbrowser | swiftbrowser/views/main.py | Python | apache-2.0 | 8,929 |
import json
try:
from django.contrib.gis.geos import GEOSGeometry
except Exception as e:
pass
from django.db.models import F, Q
class Query():
def __init__(self, json_query):
"""
Initializes the sub_tree of this query starting from the json_query parameter
:param json_query: dict... | nicfix/django-remote-queryset | django_remote_queryset/queries.py | Python | mit | 6,270 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'NouabookItem'
db.create_table(u'elections_nouabookitem', ... | lfalvarez/nouabook | elections/migrations/0015_auto__add_nouabookitem__add_attachment__add_nouabookcategory__add_fiel.py | Python | gpl-3.0 | 21,570 |
"""create countries table with data
Revision ID: da93beb77564
Revises:
Create Date: 2017-03-16 09:15:50.966604
"""
from alembic import op
import sqlalchemy as sa
from radar.models.patient_addresses import COUNTRIES
from radar.models.countries import Country
# revision identifiers, used by Alembic.
revision = 'da9... | renalreg/radar | migrations/versions/da93beb77564_create_countries_table_with_data.py | Python | agpl-3.0 | 1,122 |
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.utils.migrations import ensure_schemas, remove_schemas
logger = logging.getLogger(__file__)
class Migration(migrations.Migration):
dependencies = [
('osf', '0111_auto_20180605_1240'),
]
operation... | erinspace/osf.io | osf/migrations/0112_ensure_schemas.py | Python | apache-2.0 | 394 |
# keywords define the Python language
keywordList = [
'False', 'class', 'finally', 'is', 'return',
'None', 'continue', 'for', 'lambda', 'try',
'True', 'def', 'from', 'nonlocal', 'while',
'and', 'del', 'global', 'not', 'with',
'as', ... | SoftwareLiteracyFoundation/Python-Programs | program_7_Find_Keywords.py | Python | lgpl-3.0 | 1,350 |
from taskplus.core.shared.action import Action
from taskplus.core.shared.response import ResponseSuccess
from collections import Mapping
from taskplus.core.shared.request import Request
class ListTaskStatusesAction(Action):
def __init__(self, repo):
super().__init__()
self.statuses_repo = repo
... | Himon-SYNCRAFT/taskplus | taskplus/core/actions/list_task_statuses.py | Python | bsd-3-clause | 1,131 |
from setuptools import setup, Extension
skein_hash_module = Extension('skein_hash',
sources = ['skeinmodule.c',
'skein.c',
'../../sph/skein.c',
'../../sph/sha2.c'... | bitbandi/all-hash-python | algorithm/skein-hash/setup.py | Python | mit | 656 |
# Copyright 2021 Binovo IT Human Project SL
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "TicketBAI (API) - Batuz - "
"declaración de todas las operaciones de venta realizadas por las personas "
" y entidades que desarrollan actividades económicas en Bizkaia",
... | factorlibre/l10n-spain | l10n_es_ticketbai_api_batuz/__manifest__.py | Python | agpl-3.0 | 1,085 |
#
# This FLIP example combines narrow band flip, 2nd order wall boundary conditions, and
# adaptive time stepping.
#
from manta import *
dim = 3
res = 64
#res = 124
gs = vec3(res,res,res)
if (dim==2):
gs.z=1
s = Solver(name='main', gridSize = gs, dim=dim)
narrowBand = 3
minParticles = pow(2,dim)
s... | CoderDuan/mantaflow | scenes/flip06_obstacle.py | Python | gpl-3.0 | 5,213 |
#
# pyquaero - a Python library for Aquaero fan controllers
#
# Copyright (C) 2014 Richard "Shred" Körber
# https://github.com/shred/pyquaero
#
# This program 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 Found... | shred/pyquaero | pyquaero/usb.py | Python | lgpl-3.0 | 3,381 |
# coding: utf-8
from setuptools import setup
setup(
name="declarative-fsm",
version="",
py_modules=["fsm"],
author="Thomas Quintana",
author_email="quintana.thomas@gmail.com",
description='',
license="PROPRIETARY",
url="",
)
| thomasquintana/declarative-fsm | setup.py | Python | apache-2.0 | 259 |
from setuptools import setup
from setuptools import find_packages
setup(name='mazeexp',
version='0.0.10',
author='Mr-Yellow',
author_email='mr-yellow@mr-yellow.com',
description='A maze exploration game engine',
packages=find_packages(),
url='https://github.com/mryellow/maze_explorer',
lice... | mryellow/maze_explorer | setup.py | Python | mit | 1,331 |
import os
from datetime import datetime
from django.forms.models import model_to_dict
from django.db.models.fields import DateTimeField
from django.db.models.fields.related import ManyToManyField, ForeignKey
from django.contrib.contenttypes.fields import GenericRelation
from celery.task import Task
from tendenci.apps.... | alirizakeles/tendenci | tendenci/apps/invoices/tasks.py | Python | gpl-3.0 | 4,238 |
#
# (c) 2018 Extreme Networks 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.
#
# Ans... | roadmapper/ansible | test/units/plugins/terminal/test_slxos.py | Python | gpl-3.0 | 1,830 |
from .base import ProgressBar, ProgressBarCounter
from .formatters import (
Bar,
Formatter,
IterationsPerSecond,
Label,
Percentage,
Progress,
Rainbow,
SpinningWheel,
Text,
TimeElapsed,
TimeLeft,
)
__all__ = [
"ProgressBar",
"ProgressBarCounter",
# Formatters.
... | jonathanslenders/python-prompt-toolkit | prompt_toolkit/shortcuts/progress_bar/__init__.py | Python | bsd-3-clause | 504 |
# encoding: utf8
from GhastlyLion import Ui_GhastlyLion | Ingener74/White-Albatross | GhastlyLion/__init__.py | Python | lgpl-3.0 | 56 |
# vim: expandtab ts=4 sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (C) 2007-2010 GNS3 Development Team (http://www.gns3.net/team).
#
# 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;
#
#... | dlintott/gns3 | src/GNS3/IDLEPCDialog.py | Python | gpl-2.0 | 4,564 |
import factory
from mozillians.api.models import APIApp
from mozillians.users.tests import UserFactory
class APIAppFactory(factory.DjangoModelFactory):
FACTORY_FOR = APIApp
name = factory.Sequence(lambda n: 'App {0}'.format(n))
description = factory.Sequence(lambda n: 'Description for App {0}'.format(n))... | glogiotatidis/mozillians-new | mozillians/api/tests/__init__.py | Python | bsd-3-clause | 386 |
""" Classifier mixin offering functionality including:
- grid search
- named labels
- validation sets
- accuracy scores
- cross validation
"""
import numpy as np
import itertools
from random import shuffle
class ClassifierMixin:
""" Mixin for classifiers adding grid search functionality, as wel... | alexisVallet/dpm-identification | classifier.py | Python | gpl-2.0 | 5,173 |
from __future__ import absolute_import
import rules
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import reverse
from rest_framework.test import APITestCase
from testapp.models import Book
from testapp import views
class PermissionRequiredMi... | escodebar/django-rest-framework-rules | tests/testsuite/test_views/test_mixin.py | Python | mit | 5,668 |
"""
Galaxy web controllers.
"""
| mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/galaxy/webapps/galaxy/controllers/__init__.py | Python | gpl-3.0 | 32 |
import logging
from flexmock import flexmock
from should_dsl import should, matcher
from should_dsl.matchers import equal_to
@matcher
class LogMatcher(object):
# pylint: disable=R0903
"""A should-dsl matcher that checks whether a log
entry is being made at a certain log level.
Additional Dependency:
... | rodrigomanhaes/matcher_crowd | matcher_crowd/matcher_logger.py | Python | mit | 2,609 |
from __future__ import absolute_import, division, print_function
import sys
import itertools
import os
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
ON_TRAVIS_CI = 'TRAVIS_PYTHON_VERSION' in os.environ
if sys.version_info[0] >= 3:
unicode = str
map = map
range = range
else:
unicode = ... | cowlicks/odo | odo/compatibility.py | Python | bsd-3-clause | 706 |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Copyright (c) 2019 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing."""
import copy
import struct
import ... | Bitcoin-ABC/bitcoin-abc | test/functional/feature_block.py | Python | mit | 54,112 |
r"""
Harvey is a command line legal expert who manages license for you.
Usage:
harvey (ls | list)
harvey <NAME> --tldr
harvey <NAME>
harvey <NAME> --export
harvey (-h | --help)
harvey --version
Options:
-h --help Show this screen.
--version Show version.
"""
import json
import os
import re
... | architv/harvey | harvey/harvey.py | Python | mit | 4,390 |
# Copyright 2000 by Katharine Lindner. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
This module provides code to work with files from Rebase.
http://rebase.neb.com/rebase... | dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/Rebase/__init__.py | Python | apache-2.0 | 13,770 |
# -*- coding: utf-8 -*-
"""
Display NVIDIA properties currently exhibiting in the NVIDIA GPUs.
nvidia-smi, short for NVIDIA System Management Interface program, is a cross
platform tool that supports all standard NVIDIA driver-supported Linux distros.
Configuration parameters:
cache_timeout: refresh interval for ... | tobes/py3status | py3status/modules/nvidia_smi.py | Python | bsd-3-clause | 6,729 |
#!/usr/bin/env python
##############################################################################
#
# diffpy.pyfullprof by DANSE Diffraction group
# Simon J. L. Billinge
# (c) 2010 Trustees of the Columbia University
# in the City of New York. All rights reserve... | xpclove/autofp | diffpy/pyfullprof/fit.py | Python | gpl-3.0 | 22,179 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import abs, cos, exp, log, arange, pi, roll, sin, sqrt, sum
from .go_benchmark import Benchmark
class BartelsConn(Benchmark):
r"""
Bartels-Conn objective function.
The BartelsConn [1]_ global optimizatio... | chatcannon/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_B.py | Python | bsd-3-clause | 21,639 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2013 Rocky Bernstein
#
# 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... | kamawanu/pydbgr | trepan/processor/command/disable.py | Python | gpl-3.0 | 2,184 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/relay/custom.py | Python | mit | 4,737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.