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 |
|---|---|---|---|---|---|
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Li... | devalkeralia/Lean | Algorithm.Python/CustomBrokerageErrorHandlerAlgorithm.py | Python | apache-2.0 | 2,901 |
import datetime
from ecl.util.util import BoolVector
from ecl.util.test import TestAreaContext
from tests import ResTest
from res.enkf import ObsBlock
class ObsBlockTest(ResTest):
def test_create(self):
block = ObsBlock("OBS" , 1000)
self.assertTrue( isinstance( block , ObsBlock ))
sel... | andreabrambilla/libres | python/tests/res/enkf/test_obs_block.py | Python | gpl-3.0 | 1,177 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Test case for pyparser."""
from __future__ import division, print_function
import os
import re
import textwrap
import tokenize
from future.builtins import open
import pyparser
def _make_tuple(op):
return lambda x: (op, x)
NL = tokenize.NL
NEWLINE = tokenize.NE... | h2oai/h2o-3 | h2o-bindings/bin/pyunit_parser_test.py | Python | apache-2.0 | 15,752 |
from pyston.order.sorters import BaseSorter
from pyston.order.managers import BaseParserModelOrderManager
from pyston.order.utils import DIRECTION
class DynamoSorter(BaseSorter):
def get_order_term(self):
return self.direction == DIRECTION.ASC
class DynamoOrderManager(BaseParserModelOrderManager):
... | druids/django-pyston | pyston/contrib/dynamo/order.py | Python | bsd-3-clause | 893 |
from datetime import timedelta
import pytz
from dateutil.relativedelta import relativedelta
from dateutil.rrule import rrulestr
from django.conf import settings
from django.core.validators import MinValueValidator, MaxValueValidator
from django.utils.translation import gettext as _
from django.db import models
from dj... | yunity/foodsaving-backend | karrot/activities/models.py | Python | agpl-3.0 | 16,263 |
# -*- coding: utf-8 -*-
#
# Cheroke-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free So... | cherokee/webserver | admin/plugins/rehost.py | Python | gpl-2.0 | 3,388 |
# -*- coding: utf-8 -*-
"""Formulaires de l'application."""
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Station
from .models import Passenger
from django.core.exceptions import ValidationError
def validate_station(valu... | DjangoChained/TchouTchouGo | main/forms.py | Python | agpl-3.0 | 3,957 |
from __future__ import division, absolute_import, print_function
import sys
from setuptools.command.egg_info import egg_info as _egg_info
class egg_info(_egg_info):
def run(self):
if 'sdist' in sys.argv:
import warnings
warnings.warn("`build_src` is being run, this may lead to mis... | JFriel/honours_project | venv/lib/python2.7/site-packages/numpy/distutils/command/egg_info.py | Python | gpl-3.0 | 708 |
from mitmproxy.contentviews import query
from mitmproxy.coretypes import multidict
from . import full_eval
def test_view_query():
d = ""
v = full_eval(query.ViewQuery())
f = v(d, query=multidict.MultiDict([("foo", "bar"), ("foo", "baz")]))
assert f[0] == "Query"
assert f[1] == [[("header", "foo: "... | vhaupert/mitmproxy | test/mitmproxy/contentviews/test_query.py | Python | mit | 415 |
import datetime
import decimal
from django.test import TestCase
from django.core.cache import cache
from httmock import HTTMock
from django_dynamic_fixture import G, N
from postnl_checkout.contrib.django_postnl_checkout.models import Order
from .base import PostNLTestMixin
class OrderTests(PostNLTestMixin, TestC... | dokterbob/python-postnl-checkout | tests/test_django.py | Python | agpl-3.0 | 13,320 |
import numpy as np
import geopy
from map import Map
class Greengraph(object):
def __init__(self, start, end):
self.start=start
self.end=end
self.geocoder=geopy.geocoders.GoogleV3(domain="maps.google.co.uk")
def geolocate(self, place):
return self.geocoder.geocode(place,... | simonschaal/greengraph | greengraph/graph.py | Python | mit | 813 |
"""
"""
import Orange.data
import Orange.regression.knn as knn
import Orange.classification
from Orange.preprocess.preprocess import Preprocess
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
class OWKNNRegression(widget.OWWidget):
name = "k Nearest Neighbors Regression"
d... | qusp/orange3 | Orange/widgets/regression/owknnregression.py | Python | bsd-2-clause | 2,723 |
from math import *
from PyQt4 import QtCore
def mySquare (val) :
return (sqrt(val))
"""Function will take the name of an image file and then get
the range of images that associate with that image name. """
def getImageRange (imageDir, imstring) :
# get the index of the start of the .txt suffix then
# find... | kirillzhuravlev/atrex | Software/atrex_utils.py | Python | lgpl-3.0 | 1,538 |
from Foundation import NSBundle
import halfcaff.util
APPDIR = None
if not halfcaff.util.is_dev_mode():
APPDIR = NSBundle.mainBundle().bundlePath()
def is_login_enabled():
if not APPDIR:
return False
return APPDIR in list_login_items()
def enable_startup_at_login():
add_login_item(APPDIR)
def... | dougn/HalfCaff | halfcaff/login.py | Python | mit | 9,234 |
# -*- coding: utf-8 -*-
'''
The networking module for RHEL/Fedora based distros
'''
from __future__ import absolute_import
# Import python libs
import logging
import os.path
import os
# Import third party libs
import jinja2
import jinja2.exceptions
# Import salt libs
import salt.utils
import salt.utils.templates
imp... | smallyear/linuxLearn | salt/salt/modules/rh_ip.py | Python | apache-2.0 | 36,314 |
import argparse
import unittest
import os
from api.api import Resource
#argument parsing
parser = argparse.ArgumentParser(description='MOO Technical Test - Code Test Two.',
epilog="Support Contact: justin.albertyn@gmail.com")
parser.add_argument('-v, --verbose', dest='verbose', action... | justin-albertyn/moo | api_tester.py | Python | mit | 5,745 |
#!/usr/bin/env python
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
""" Utility for moving ... | mganeva/mantid | buildconfig/move_class.py | Python | gpl-3.0 | 7,196 |
import pymongo
from pymongo import MongoClient
import datetime
import pytz
import math
import time
import datetime
from pubnub import Pubnub
import threading
import logging
pub_key ='pub-c-f2fc0469-ad0f-4756-be0c-e003d1392d43'
sub_key ='sub-c-4d48a9d8-1c1b-11e6-9327-02ee2ddab7fe'
LOG_FILENAME = 'TTO_serverlogs.... | shyampurk/tto-bluemix | ttoServer/ttoServer.py | Python | mit | 37,445 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-12 15:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import picklefield.fields
import src.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
... | andytwoods/zappa-call-later | zappa-call-later/migrations/0001_initial.py | Python | mit | 1,577 |
import os
from decouple import config
sudoPassword = config('SUDOPASSWORD')
def update():
"""
Automatisches Update des Reservierungssystems über Github
"""
try:
command_stop = 'sudo supervisorctl stop abwreservierung && sudo supervisorctl start abwreservierung && sudo chmod +x startup'
... | holytortoise/abwreservierung | auto_process.py | Python | mit | 1,255 |
# -*- coding: utf-8 -*-
""" Sahana Eden Assets Model
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
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 withou... | flavour/iscram | modules/eden/asset.py | Python | mit | 41,981 |
from typing import KeysView
from baby_steps import given, then, when
from district42 import optional, schema
def test_dict_empty_keys():
with given:
sch = schema.dict
with when:
res = sch.keys()
with then:
assert res == KeysView([])
def test_dict_keys():
with given:
... | nikitanovosibirsk/district42 | tests/dict/test_dict_keys.py | Python | mit | 572 |
"""
Certificate end-points used by the student support UI.
See lms/djangoapps/support for more details.
"""
import logging
import urllib
from functools import wraps
import bleach
from django.db import transaction
from django.db.models import Q
from django.http import HttpResponse, HttpResponseBadRequest, HttpRespo... | eduNEXT/edx-platform | lms/djangoapps/certificates/views/support.py | Python | agpl-3.0 | 9,360 |
from __future__ import absolute_import
from __future__ import unicode_literals
from compose.config.config import ConfigDetails
from compose.config.config import ConfigFile
from compose.config.config import load
def build_config(contents, **kwargs):
return load(build_config_details(contents, **kwargs))
def buil... | andrewgee/compose | tests/helpers.py | Python | apache-2.0 | 495 |
"""
Copyright (c) 2013, Dave Mankoff
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the fol... | mankyd/htmlmin | htmlmin/decorator.py | Python | bsd-3-clause | 2,502 |
from __future__ import print_function
from neo4j.v1 import GraphDatabase, basic_auth
import os, sys
import json
import pickle
import ipdb
from tqdm import tqdm
from infer_effects_go import Graph, GOgraph
clear_string = '''
MATCH (n)
DETACH DELETE n
'''[1:-1]
# DOMAIN MODEL
# (:Annotation {go_id})-[:
with open('go... | JDRomano2/VenomKB | venomkb/archive/scripts/build_neo4j_go_database.py | Python | gpl-2.0 | 2,593 |
import discord
async def donate(cmd, message, args):
if args:
if args[0] == 'mini':
mini = True
else:
mini = False
else:
mini = False
sigma_image = 'https://i.imgur.com/mGyqMe1.png'
sigma_title = 'Sigma Donation Information'
patreon_url = 'https://ww... | AXAz0r/apex-sigma-core | sigma/modules/help/donate.py | Python | gpl-3.0 | 1,698 |
#!/usr/bin/env python
#
# $Id: get_code_stats.py 9318 2011-06-10 02:37:10Z nathan_george $
#
# Proprietary and confidential.
# Copyright $Date:: 2011#$ Perfect Search Corporation.
# All rights reserved.
#
import sys
import os
import re
import optparse
import math
buildscriptDir = os.path.dirname(__file__)
buildscriptDi... | perfectsearch/sandman | code/buildscripts/codescan/get_code_stats.py | Python | mit | 12,831 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('reformedacademy', '0006_auto_20140915_0251'),
]
operations = [
migrations.CreateModel(
... | reformedforum/reformedacademy | reformedacademy/migrations/0007_betatoken.py | Python | gpl-3.0 | 979 |
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2014 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | kgao/MediaDrop | mediadrop/forms/admin/storage/remoteurls.py | Python | gpl-3.0 | 4,730 |
"""
Django settings for dron project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
#... | bladekp/DroniadaDjangoDronekitAPP | app/dron/settings.py | Python | mit | 3,284 |
#Encoding:utf-8
from QUANTAXIS.QAUtil import QA_util_log_info,QA_Setting
import datetime,time
"""
标准化输出结果,并且给QAAnalysis喂食QAQ
首先接受QASignal打包出来的标准协议
"""
def QA_backtest_standard_record_market(message,client):
#client=QA_backtest_get_client(QA_Backtest)
coll=client.quantaxis.market_history
"""
bid':{
... | lijiabogithub/QUANTAXIS | QUANTAXIS/QABacktest/QABacktest_standard.py | Python | mit | 2,816 |
# -*- coding: utf-8 -*-
"""
Acceptance tests for CMS Video Editor.
"""
from nose.plugins.attrib import attr
from .test_studio_video_module import CMSVideoBaseTest
@attr('shard_6')
class VideoEditorTest(CMSVideoBaseTest):
"""
CMS Video Editor Test Class
"""
def setUp(self):
super(VideoEditorT... | IONISx/edx-platform | common/test/acceptance/tests/video/test_studio_video_editor.py | Python | agpl-3.0 | 24,711 |
"""
Tests for configuration file parsers, ...
"""
from ConfigParser import RawConfigParser
import io
import os
import textwrap
import pytest
from ardomino.conf import (process_conf_files,
find_configuration_files,
create_conf_parser)
@pytest.fixture
def conf_di... | rshk/ardomino-api | ardomino/tests/test_configuration.py | Python | bsd-3-clause | 3,008 |
#!/usr/bin/env python
"""A simple program for using pylastfp to fingerprint and look up
metadata for MP3 files. Usage:
$ python lastmatch.py [-m] mysterious_music.mp3
By default, the script uses Gstreamer to decode audio. The -m flag
makes it use MAD instead (which, of course, only works on MPEG audio
such as... | sampsyo/pylastfp | lastmatch.py | Python | lgpl-3.0 | 2,040 |
"""
This module contains the definition of a model trainable in **cxflow** framework.
"""
from abc import abstractmethod, ABCMeta
from typing import Iterable, Optional
from ..datasets import AbstractDataset, StreamWrapper
from ..types import Batch
class AbstractModel(metaclass=ABCMeta):
"""
Abstract machine ... | Cognexa/cxflow | cxflow/models/abstract_model.py | Python | mit | 2,738 |
from flask_marshmallow import Marshmallow
from models import Feature, Client, Area
ma = Marshmallow()
class ClientSchema(ma.ModelSchema):
class Meta:
model = Client
class AreaSchema(ma.ModelSchema):
class Meta:
model = Area
class FeatureSchema(ma.ModelSchema):
class Meta:
mode... | yuriyarhipov/FeatureRequestApp | schemas.py | Python | mit | 546 |
from pluggy._tracing import TagTracer
import pytest
from typing import List
@pytest.fixture
def rootlogger() -> TagTracer:
return TagTracer()
def test_simple(rootlogger: TagTracer) -> None:
log = rootlogger.get("pytest")
log("hello")
out: List[str] = []
rootlogger.setwriter(out.append)
log... | pytest-dev/pluggy | testing/test_tracer.py | Python | mit | 1,900 |
"""Treadmill commaand line helpers.
"""
import codecs
import copy
import functools
import importlib
import json
import logging
import os
import pkgutil
import pkg_resources
import re
import sys
import tempfile
import traceback
import click
import prettytable
import yaml
from six.moves import configparser
from tread... | ThoughtWorksInc/treadmill | treadmill/cli/__init__.py | Python | apache-2.0 | 26,172 |
#!/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'
from functools... | pra85/calibre | src/calibre/gui2/tag_browser/ui.py | Python | gpl-3.0 | 21,727 |
"""
$Id: Opcode.py,v 1.6.2.1 2011/03/16 20:06:39 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License. See LICENSE for details.
Opcode values in message header. RFC 1035, 1996, 2136.
"""
QUERY = 0
IQUERY = 1
ST... | g-fleischer/wtfy | trackingserver/thirdparty/pydns/DNS/Opcode.py | Python | gpl-3.0 | 1,174 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 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 ... | EricssonResearch/calvin-base | calvinextras/calvinsys/media/audio/play/BasePlay.py | Python | apache-2.0 | 1,328 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-26 21:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0006_auto_20160123_0430'),
]
operations = [
migrations.AddField(
... | fwilk/paperless | src/documents/migrations/0007_auto_20160126_2114.py | Python | gpl-3.0 | 1,579 |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import re
import os
import ast
import _ast
import textwrap
import CommonMark
from collections import OrderedDict
cur_dir = os.path.dirname(__file__)
project_dir = os.path.abspath(os.path.join(cur_dir, '..'))
docs_dir ... | kak-bo-che/certvalidator | dev/api_docs.py | Python | mit | 14,979 |
import asyncio
from concurrent.futures import ProcessPoolExecutor
print('running async test')
def say_boo():
i = 0
while True:
print('...boo {0}'.format(i))
i += 1
def say_baa():
i = 0
while True:
print('...baa {0}'.format(i))
i += 1
if __name__ == "__main__":
ex... | fs714/ipyexample | asynchronous/py36/asyncio/example02.py | Python | apache-2.0 | 557 |
# Copyright 2009-2014 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster 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 3 of the License, or (at your option) any
# later ... | cjh1/StarCluster | starcluster/commands/get.py | Python | gpl-3.0 | 2,628 |
#!/usr/bin/env python3
import sys
import os
import path_utils
import fsquery
import mvtools_exception
def puaq():
print("Usage: %s folder" % path_utils.basename_filtered(__file__))
sys.exit(1)
def insert_pragma(path):
exts = ["h"]
v, r = fsquery.makecontentlist(path, True, False, True, False, False... | mvendra/mvtools | insert_pragma.py | Python | mit | 1,020 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
with codecs.open(
os.path.join(os.path.dirname(__file__), 'README.rst'), 'r', 'utf8',
) as ld_file:
long_description = ld_file.read()
setup (
name = 'doit-cmd',
version = '0.1.0',
author = 'Eduardo Nau... | pydoit/doit-cmd | setup.py | Python | mit | 1,238 |
# -*- coding: utf-8 -*-
from openprocurement.api.utils import (
json_view,
context_unpack,
APIResource,
get_now,
raise_operation_error
)
from openprocurement.tender.core.utils import (
save_tender, optendersresource, apply_patch,
)
from openprocurement.tender.belowthreshold.utils import (
... | openprocurement/openprocurement.tender.belowthreshold | openprocurement/tender/belowthreshold/views/cancellation.py | Python | apache-2.0 | 5,411 |
# ~*~ coding: utf-8 ~*~
from django import forms
from datetimewidget.widgets import DateTimeWidget
from django.utils.translation import ugettext_lazy as _
from django.forms import formset_factory
from django.forms.models import modelformset_factory, inlineformset_factory
from virtenviro.content.models import *
import ... | Haikson/virtenviro | virtenviro/content/admin_forms.py | Python | apache-2.0 | 4,786 |
from random import randint
from sys import argv
if __name__ == '__main__':
components_count = int(argv[1])
max_vectors_count = int(argv[2])
high_bound = int(argv[3])
file_name = argv[4]
result = set()
for i in range(max_vectors_count):
result.add(tuple(randint(0, high_bound) for i in r... | vanashimko/k-means | generator.py | Python | mit | 526 |
"""Plugin system for cloud providers and environments for use in integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import atexit
import datetime
import json
import time
import os
import platform
import random
import re
import tempfile
from .. impo... | aperigault/ansible | test/lib/ansible_test/_internal/cloud/__init__.py | Python | gpl-3.0 | 13,034 |
# Copyright 2018 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 applicab... | tombstone/models | research/efficient-hrl/train_utils.py | Python | apache-2.0 | 7,027 |
import json
import pika
import time
import threading
from flask import current_app
from listenbrainz.webserver import create_app
from listenbrainz.webserver.views.api_tools import LISTEN_TYPE_PLAYING_NOW
from listenbrainz.mbid_mapping_writer.job_queue import MappingJobQueue
class MBIDMappingWriter(threading.Thread):... | metabrainz/listenbrainz-server | listenbrainz/mbid_mapping_writer/mbid_mapping_writer.py | Python | gpl-2.0 | 3,503 |
# -*- coding: 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... | smartforceplus/SmartForceplus | .local/share/Odoo/addons/8.0/ConvertSelectionToFilter/__openerp__.py | Python | agpl-3.0 | 1,506 |
from MaudeMiner.core.database import db
from MaudeMiner.core.models import Narrative
from MaudeMiner.utils import update_progress
from MaudeMiner.core.loader.utils import *
from MaudeMiner.settings import LINES_PER_DB_COMMIT
EXPECTED_NUMBER_OF_FIELDS = 6
def load(limit_commits=None):
# ensure tables exists
db.cre... | tklovett/MaudeMiner | MaudeMiner/core/loader/narratives.py | Python | mit | 1,218 |
#Copyright (C) 2013-2014 by Clearcode <http://clearcode.cc>
#and associates (see AUTHORS).
#
#This file is part of migopy.
#
#Migopy 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 3 of the... | ClearcodeHQ/migopy | tests/test_integrations.py | Python | lgpl-3.0 | 5,392 |
# Copyright 2012 OpenStack Foundation
# 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... | vmturbo/nova | nova/tests/unit/api/openstack/compute/test_flavor_access.py | Python | apache-2.0 | 19,273 |
# -*- coding: utf-8 -*-
import json
import random
import re
import os
from django.conf import settings
from django.core import mail
from django.core.cache import cache
from django.test.utils import override_settings
from django.test.client import Client
from django.utils.http import urlunquote
import mock
import pyte... | lavish205/olympia | src/olympia/addons/tests/test_views.py | Python | bsd-3-clause | 160,052 |
# coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# 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.
# ... | OpenPathView/batchPanoMaker | opv_import/helpers/bit_utils.py | Python | gpl-3.0 | 1,156 |
from django.views.generic import ListView, DetailView, CreateView, \
DeleteView, UpdateView, \
ArchiveIndexView, DateDetailView, \
DayArchiveView, MonthArchiveView, \
TodayArchiveView, Wee... | tnemis/staging-server | baseapp/views/class_studying_views.py | Python | mit | 3,912 |
from authenticated import AuthenticatedHandler
import models
import logging
class EditPage(AuthenticatedHandler):
def auth_get(self, page_path):
self.render_form(page_path)
def auth_post(self, page_path):
page_id = self.request.get('v')
page_content = self.request.get('content')
... | zxul767/Wikipages | edit.py | Python | gpl-2.0 | 1,154 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script to separate genes from MiSeq run fastQ files (NEXTERA style)
AFTER the reads have been trimmed for the tail and adapter (see trim_adaptors.py)
Trim forward and reverse primers.
It will produce one file for each gene (4 here - 16S, 18S, UPA, tufA)
Created on Mon ... | vrmarcelino/Shape-4-Qiime | separate_genes.py | Python | mit | 5,655 |
from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an a... | ericholscher/django | django/contrib/messages/storage/base.py | Python | bsd-3-clause | 6,265 |
# The main entrance for the optimization framework of energy router
T = 24
| Matrixeigs/Optimization | main.py | Python | mit | 76 |
#python
import testing
testing.bitmap_modifier_benchmark("CUDABitmapMultiply")
| barche/k3d | tests/bitmap/bitmap.modifier.CUDABitmapMultiply.benchmark.py | Python | gpl-2.0 | 81 |
#!/usr/bin/env python3
import json
import psycopg2
def drop_tables(db, user):
print('droping tables')
sql_drop_repos_table = 'DROP TABLE IF EXISTS repos'
sql_drop_issues_table = 'DROP TABLE IF EXISTS issues'
sql_drop_labels_table = 'DROP TABLE IF EXISTS labels'
try:
conn = psycopg2.con... | JmeHsieh/issue_aggregator | j2jb.py | Python | mit | 3,496 |
# encoding: utf-8
from lxml.etree import LIBXML_VERSION
import pytest
from libweasyl.text import markdown, markdown_excerpt, markdown_link
libxml_xfail = pytest.mark.xfail(LIBXML_VERSION < (2, 9), reason='libxml2 too old to preserve whitespace')
user_linking_markdown_tests = [
('<~spam>', '<a href="/~spam">spam... | Weasyl/weasyl | libweasyl/libweasyl/test/test_text.py | Python | apache-2.0 | 8,802 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018-2021 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... | forkbong/qutebrowser | qutebrowser/api/config.py | Python | gpl-3.0 | 1,462 |
"""
Loads editquality config, mainly used as template parameters.
The responsibility of this process is to simplify the template's work and other
consumers, as much as possible.
"""
import glob
import os
import deep_merge
import yaml
def load_config(config_dir=None):
model_defaults = yaml.safe_load(
ope... | wiki-ai/editquality | editquality/config.py | Python | mit | 1,884 |
#!/usr/bin/env python
import io
import os
import os.path
import re
from setuptools import setup, find_packages
# FIXME: this information should come from the script itself...
__projectname__ = "suse-doc-style-checker"
__programname__ = "SUSE Documentation Style Checker"
# __version__ will be read from sdsc/__init__.... | tomschr/sdsc | setup.py | Python | lgpl-2.1 | 4,642 |
# Copyright (c) 2017 Huawei, 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 a... | Hybrid-Cloud/conveyor-dashboard | conveyordashboard/overview_project/panel.py | Python | apache-2.0 | 878 |
#!/usr/bin/python2.5
# Copyright (C) 2007 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... | Censio/transitfeed | location_editor.py | Python | apache-2.0 | 1,943 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-msg=C0103
# pylint: disable-msg=C0301
"""
View the status of a given xengine.
Created on Fri Jan 3 10:40:53 2014
@author: paulp
"""
import argparse
from casperfpga import utils
from casperfpga.casperfpga import CasperFpga
try:
import corr2
impo... | ska-sa/casperfpga | scripts/casperfpga_tengbe_coreinfo.py | Python | gpl-2.0 | 2,880 |
# Copyright 2022 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, ... | google/gazoo-device | gazoo_device/tests/functional_tests/file_transfer_test_suite.py | Python | apache-2.0 | 4,139 |
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = []
from numpy import asanyarray, asarray, asmatrix, array, matrix, zeros
from scipy.sparse.linalg.interface import aslinearoperator, LinearOperator, \
IdentityOperator
_coerce_rules = {('f','f'):'... | Eric89GXL/scipy | scipy/sparse/linalg/isolve/utils.py | Python | bsd-3-clause | 3,337 |
"""
Django settings for paypal_demo project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | pizzapanther/Getting-Paid-With-Python | paypal_demo/paypal_demo/settings.py | Python | mit | 2,758 |
# 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... | rajalokan/nova | nova/tests/unit/fake_notifier.py | Python | apache-2.0 | 4,395 |
#!/usr/bin/env python
from pyfi.calendar.calendar.object import Calendar
__all__ = ['Calendar']
| rlinguri/pyfi | pyfi/calendar/calendar/__init__.py | Python | mit | 98 |
from django import forms
from connect.accounts.models import Role, Skill
class FilterMemberForm(forms.Form):
"""
Form for searching for members by their skills and roles.
"""
skills = forms.ModelMultipleChoiceField(
queryset=Skill.objects.all(),
widget=forms.CheckboxSelectMultiple(),
... | nlhkabu/connect | connect/discover/forms.py | Python | bsd-3-clause | 497 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.coghq.CashbotMintGearRoom_Battle01_Cogs
from panda3d.core import Point3
from SpecImports import *
from toontown.toonbase import ToontownGlobals
CogParent = 10000
BattleCellId = 0
BattleCells = {BattleCellId: {'parentEntId': CogParent,
... | DedMemez/ODS-August-2017 | coghq/CashbotMintGearRoom_Battle01_Cogs.py | Python | apache-2.0 | 1,288 |
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# 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, copy... | keen99/SickRage | lib/unrar2/unix.py | Python | gpl-3.0 | 11,433 |
"""Localizations for meas_date extraction."""
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
# This file was generated on 2021/01/31 on an Ubuntu system.
# When getting "unsupported locale setting" on Ubuntu (e.g., with localepurge),
# use "sudo locale-gen de_DE" etc. then "sudo update-loca... | wmvanvliet/mne-python | mne/io/nirx/_localized_abbr.py | Python | bsd-3-clause | 2,966 |
# Copyright (c) 2008, 2009, 2010, 2011 Andrey Golovizin
#
# 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, copy, modify... | rybesh/pybtex | pybtex/backends/html.py | Python | mit | 2,255 |
"""!
@brief Examples of usage and demonstration of abilities of BSAS algorithm in cluster analysis.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster import cluster_visualizer;
from pyclustering.cluster.bsas import bsas, bsas_visualizer;
from pyc... | annoviko/pyclustering | pyclustering/cluster/examples/bsas_examples.py | Python | gpl-3.0 | 1,836 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-11 18:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ipam', '0001_initial'),
('dcim', '0005_auto_20160706_1722'),
]
operations = [
... | digitalocean/netbox | netbox/dcim/migrations/0006_add_device_primary_ip4_ip6.py | Python | apache-2.0 | 914 |
# coding: utf-8
from __future__ import absolute_import
import hashlib
from flask.ext.babel import lazy_gettext as _
from google.appengine.ext import ndb
from api import fields
import model
import util
import config
class User(model.Base):
name = ndb.StringProperty(required=True, verbose_name=_('Name'))
userna... | mdxs/gae-init-babel | main/model/user.py | Python | mit | 2,779 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... | sileht/deb-openstack-nova | nova/tests/integrated/test_extensions.py | Python | apache-2.0 | 1,560 |
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.ticker import FuncFormatter
cdict = {'red': [(0.0, 0.0, 0.0),
(0.33, 0.0, 0.0),
(0.66, 1.0, 1.0),
(1.0, 1.0, 1.0)],
'blue': [(0.0, 0.0, 0.0),
... | Evolving-AI-Lab/innovation-engine | sferes/modules/map_elite/plot_map.py | Python | mit | 1,994 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-12 08:58
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | drxos/kuiqblog | weblog/migrations/0006_author_editor.py | Python | bsd-3-clause | 1,641 |
import unittest
import threading
import tempfile
import shutil
import electrum_mona
import electrum_mona.logging
from electrum_mona import constants
# Set this locally to make the test suite run faster.
# If set, unit tests that would normally test functions with multiple implementations,
# will only be run once, us... | wakiyamap/electrum-mona | electrum_mona/tests/__init__.py | Python | mit | 1,307 |
# -*- coding: utf-8 -*-
# The tables below are taken from
# https://github.com/adobe-type-tools/agl-aglfn/raw/4036a9ca80a62f64f9de4f7321a9a045ad0ecfd6/glyphlist.txt
# and
# https://github.com/adobe-type-tools/agl-aglfn/raw/4036a9ca80a62f64f9de4f7321a9a045ad0ecfd6/aglfn.txt
"""
Interface to the Adobe Glyph List
This mo... | google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/agl.py | Python | apache-2.0 | 112,519 |
from django.test import TestCase
from groups import models as group_model
class SimpleTest(TestCase):
def test_create_group(self):
"""
Test group creation
"""
group = group_model.create_group('ateam@mechmooc.com', 'The A team', 1)
self.assertTrue('address' in group)
... | p2pu/mechanical-mooc | groups/tests.py | Python | mit | 2,657 |
#!vpy/bin/python
import pymongo
import sys
prod_config='/opt/slick/prodserver.cfg'
config = {}
with open(prod_config) as f:
for line in f:
if line.startswith("MONGODB_HOSTNAME"):
config['MONGODB_HOSTNAME'] = line.split('=')[1].strip().strip('"')
if line.startswith("MONGODB_DBNAME"):
... | slickqa/slickqaweb | add-indexes.py | Python | apache-2.0 | 4,149 |
#!/usr/bin/env python3
# implementation of queue messaging system
from collections import deque
import pygame
from wargame.message import Message
from wargame.events import MessageType
class MessageQueue:
def __init__(self):
self.queue = deque()
self.listener = None
def set_listener(self, ... | maximinus/wargame | wargame/wargame/scheduler.py | Python | gpl-3.0 | 1,834 |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.utils.translation import ugettext_lazy as _
from openbudgets.commons.mixins import models as m... | openbudgets/openbudgets | openbudgets/apps/interactions/models.py | Python | bsd-3-clause | 1,902 |
# We don't know enough about neural network.
# In ind_datagen.py, I will construct some extremely simplified neural network
# and data sets to explore the properties of NN.
#
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import TensorDataset, DataLoader
from torch.autograd im... | Fuchai/Philosophy-Machine | analysis/ind_datagen.py | Python | apache-2.0 | 2,328 |
"""
Contains various helpers for use by the Flask application.\n
Created by Abigail Franz on 3/13/2018\.n
Last modified by Abigail Franz on 5/5/2018.
"""
import logging, sys
import json, requests
from datetime import datetime, timedelta, MAXYEAR
#from background import db
#from app.models import Activity
logging.basic... | jazzij/powertoken | powertoken/api_util.py | Python | mit | 4,691 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011, 2012 Carlos Jenkins <cjenkins@softwarelibrecr.org>
#
# 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 t... | carlos-jenkins/nested | nested/modules/locales/__init__.py | Python | gpl-2.0 | 822 |
from frappe import _
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
'fieldname': 'customer',
'transactions': [
{
'label': _('Pre Sales'),
'items': ['Opportunity', 'Quotation']
},
{
'lab... | patilsangram/erpnext | erpnext/selling/doctype/customer/customer_dashboard.py | Python | gpl-3.0 | 679 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.