text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
"""
Copyright (C) <2010> Autin L. TSRI
This file git_upy/blender/v271/__init__.py is part of upy.
upy 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... | corredD/upy | blender/v280/__init__.py | Python | gpl-3.0 | 755 | 0.001325 |
"""
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 | 0.000725 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | liukaijv/XlsxWriter | xlsxwriter/test/comparison/test_chart_data_labels23.py | Python | bsd-2-clause | 1,849 | 0.000541 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Includes the HRV stitcher data source class
"""
import pandas as pd
import numpy as np
from scipy.io import loadmat
from scipy.interpolate import UnivariateSpline
from data_source import DataSource
from schema import Schema, Or, Optional
def _val(x, pos, label_bin):
... | janmtl/pypsych | pypsych/data_sources/hrvstitcher.py | Python | bsd-3-clause | 10,502 | 0.000286 |
#!/usr/bin/env python
from setuptools import setup
setup(
name='nodenet',
version='0.1.0',
description='an asynchronous node-based UDP networking library',
author='Ajay MT',
author_email='ajaymt@icloud.com',
url='http://github.com/AjayMT/nodenet',
download_url='https://github.com/AjayMT/no... | AjayMT/nodenet | setup.py | Python | mit | 787 | 0 |
#!/usr/bin/env python
class RoundFloatManual(object):
def __init__(self, val):
assert isinstance(val, float), \
"Value must be a float!"
self.value = round(val, 2)
def __str__(self):
return '%.2f' % self.value
__repr__ = __str__
| opensvn/test | src/study/python/cpp/ch13/roundFloat2.py | Python | gpl-2.0 | 280 | 0 |
#!/usr/bin/env python
import turtle
import random
def bloom(radius):
turtle.colormode(255)
for rad in range(40, 10, -5):
for looper in range(360//rad):
turtle.up()
turtle.circle(radius+rad, rad)
turtle.begin_fill()
turtle.fillcolor((200+random.randint(0,... | mpclemens/python-explore | turtle/bloom.py | Python | gpl-3.0 | 728 | 0.002747 |
#!/usr/bin/env python
# ======================================================================
# Copyright (C) 2007-2014 Giampaolo Rodola' <g.rodola@gmail.com>
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and assoc... | satyamz/Tests | pyftpdlib/log.py | Python | gpl-2.0 | 6,094 | 0.000164 |
# GBRT for Luroeykalven case study site
# Training data: manually digitized training areas, including water pixels
# Predictors: results of FCLS spectral unmixing
# Authors: Stefan Blumentrath
import numpy as np
import matplotlib.pyplot as plt
from sklearn import ensemble
from sklearn import datasets
from sklearn.uti... | NINAnor/sentinel4nature | Tree canopy cover/regression/GBRT_Luroeykalven_manual_FCLS.py | Python | gpl-2.0 | 8,821 | 0.006122 |
from gittle import Gittle
repo = Gittle('.')
lastest = [
info['sha']
for info in repo.commit_info()[1:3]
]
print(repo.diff(*lastest, diff_type='classic'))
print("""
Last Diff
""")
print(list(repo.diff('HEAD')))
| 0asa/gittle | examples/diff.py | Python | apache-2.0 | 227 | 0 |
##########################################################################
#
# Copyright (c) 2012-2014, John Haddon. All rights reserved.
# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | chippey/gaffer | python/GafferSceneTest/__init__.py | Python | bsd-3-clause | 5,457 | 0.00055 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/reporters/http.py | Python | gpl-2.0 | 4,489 | 0.001337 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansTamil-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uni0000 ????
chars.append(0x200B) #uniFEFF ZERO WIDTH SPACE
chars.append(0x200C) #uni200C ZERO WIDTH NON-JOINER
... | davelab6/pyfontaine | fontaine/charsets/noto_chars/notosanstamil_regular.py | Python | gpl-3.0 | 7,479 | 0.017917 |
from nbodykit.base.catalog import CatalogSource
from nbodykit.io.stack import FileStack
from nbodykit import CurrentMPIComm
from nbodykit import io
from nbodykit.extern import docrep
from six import string_types
import textwrap
import os
__all__ = ['FileCatalogFactory', 'FileCatalogBase',
'CSVCatalog', 'Bi... | nickhand/nbodykit | nbodykit/source/catalog/file.py | Python | gpl-3.0 | 7,330 | 0.004093 |
import unittest
from algoliasearch.configs import InsightsConfig
from algoliasearch.exceptions import AlgoliaException
from algoliasearch.insights_client import InsightsClient
class TestInsightsClient(unittest.TestCase):
def test_create(self):
client = InsightsClient.create("foo", "bar")
self.as... | algolia/algoliasearch-client-python | tests/unit/test_insights_client.py | Python | mit | 883 | 0.001133 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/library_materials/material/extra/technique_sid_target/technique_sid_target.py | Python | mit | 4,063 | 0.007384 |
from django.conf.urls import include, url
from article import views
urlpatterns = [
url(r'^$', views.articles, name='articles'),
url(r'^add/?$', views.add_articles, name='add-articles'),
] | anush7/django-article-project | article/urls.py | Python | mit | 197 | 0.005076 |
from fabric.api import *
from fabric.decorators import task
import os, sys
sys.path[0:0] = [os.path.join(os.path.realpath('.'), '..'), ]
try:
from d51.django.virtualenv.test_runner import run_tests
except ImportError, e:
import sys
sys.stderr.write("This project requires d51.django.virtualenv.test_runner\... | texastribune/armstrong.base | fabfile/_utils.py | Python | bsd-3-clause | 342 | 0.008772 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
IRC bot...
"""
import threading
import src.utilities as util
import src.settings
import src.irc.botObject
class BotDispatcher(threading.Thread):
"""
The BotDispatcher object handles the delegation of the various bots on
the various specified servers.
... | Tehnix/PyIRCb | src/irc/botDispatcher.py | Python | bsd-3-clause | 2,303 | 0.005211 |
import os
import argparse
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
parser = argparse.ArgumentParser('ODE demo')
parser.add_argument('--method', type=str, choices=['dopri5', 'adams'], default='dopri5')
parser.add_argument('--data_size', type=int, default=1000)
parse... | rtqichen/torchdiffeq | examples/ode_demo.py | Python | mit | 5,643 | 0.002304 |
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import get_object_or_404, render
from .models import Comment
from .forms import UpdateCommentForm
from django.http.response import JsonResponse
from django.views.decorators.http import require_http_methods
def update_comment(request, cid):
... | Resmin/Resmin | resmin/apps/comment/views.py | Python | gpl-3.0 | 1,460 | 0 |
# -*- coding: UTF-8 -*-
# bp_v1
from .api_v1 import bp_v1
# bp_v2
from .api_v2 import bp_v2
__author__ = 'lpe234'
"""
Controller
"""
| lpe234/sanicDemo | controller/__init__.py | Python | gpl-3.0 | 137 | 0 |
import logging
import re
from pathlib import Path
def find_by_name(path, name):
if type(path) is str:
path = Path(path)
for child in path.iterdir():
if child.name == name:
return child
elif child.is_dir():
ret = find_by_name(child, name)
if ret:
... | zydiig/CKAN.py | libckan/fs.py | Python | gpl-3.0 | 1,487 | 0 |
from Bio import SeqIO
from Bio.Alphabet import IUPAC, ProteinAlphabet
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from optparse import OptionParser
def translate_to_six_frame(dnaRecord, translationTable):
'''
translate a Bio.SeqRecord of a DNA sequence via the given translation table in... | aerval/de.rki.proteomic_virus_detection | plugin_source/SixFrameTranslation.py | Python | gpl-2.0 | 2,361 | 0.011012 |
#!/usr/bin/env python
from optparse import OptionParser, SUPPRESS_HELP
import os, glob, subprocess, sys, math, shutil
import imm_cluster, util
############################################################
# scimm.py
#
# Sequence Clustering with Interpolated Markov Models
#
# Author: David Kelley
#######################... | davek44/Scimm | bin/scimm.py | Python | artistic-2.0 | 9,432 | 0.004983 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''CMU dict file parser
Copyright (C) 2010
Yosuke Matsusaka
Intelligent Systems Research Institute,
National Institute of Advanced Industrial Science and Technology (AIST),
Japan
All rights reserved.
Licensed under the Eclipse Public License -v 1.0 (EP... | yosuke/OpenHRIVoice | openhrivoice/parsecmudict.py | Python | epl-1.0 | 1,210 | 0.004959 |
# -*- coding: utf-8 -*-
# © 2015 Roberto Lizana (Trey)
# © 2016 Pedro M. Baeza
# © 2017 Rosen Vladimirov
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
cr.execute("""
INSERT INTO res_partner_id_number
(partner_id... | rosenvladimirov/addons | l10n_bg_uic/hooks.py | Python | agpl-3.0 | 521 | 0.001931 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | vlegoff/tsunami | src/secondaires/navigation/commandes/debarquer/__init__.py | Python | bsd-3-clause | 4,221 | 0.000951 |
# -*- Mode: python; coding:utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2012 David Strauss <david@davidstrauss.net>
# Copyright 2012 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
# Copyright 2012 Marti Raudsepp <marti@juffo.org>
#
# systemd is free software; you can redist... | pragmatux/systemd | src/python-systemd/journal.py | Python | gpl-2.0 | 20,273 | 0.002318 |
from distutils.core import setup
setup(
name='jerboa',
packages=['jerboa'], # this must be the same as the name above
version='0.2.1-alpha',
description='',
author='Matt Badger',
author_email='foss@lighthouseuk.net',
url='https://github.com/LighthouseUK/jerboa', # use the URL to the githu... | LighthouseUK/jerboa | setup.py | Python | lgpl-3.0 | 659 | 0.004552 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
def ge... | elysiumd/windows-wallet-13.2 | qa/rpc-tests/fundrawtransaction.py | Python | mit | 28,411 | 0.010137 |
import unittest
import click
from tests.test_app import TestApp
from tests.test_models import TestModels
from tests.test_utils import TestUtils
@click.group(name='tests', invoke_without_command=False)
def test():
pass
@test.command(name='test_models')
def test_models():
"""Tests implemented models"""
... | lycantropos/VKApp | manage.py | Python | gpl-3.0 | 882 | 0 |
# VMware vSphere Python SDK
# Copyright (c) 2008-2016 VMware, 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
#
# ... | Infinidat/pyvmomi | pyVim/connect.py | Python | apache-2.0 | 29,885 | 0.012682 |
import glob
import math
import os
import sys
import warnings
from decimal import Decimal
import numpy as np
import pandas as pd
import pytest
from packaging.version import parse as parse_version
import dask
import dask.dataframe as dd
import dask.multiprocessing
from dask.blockwise import Blockwise, optimize_blockwis... | jakirkham/dask | dask/dataframe/io/tests/test_parquet.py | Python | bsd-3-clause | 129,660 | 0.001057 |
# Copyright (c) 2010-2013 OpenStack Foundation
#
# 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 agree... | smerritt/swift | swift/common/ring/utils.py | Python | apache-2.0 | 26,082 | 0.000038 |
"""
__author__ = 'Christopher Fagiani'
"""
import sys, argparse, json, string, collections
from datetime import datetime
SummaryData = collections.namedtuple('SummaryData', 'wordCounts articles commentCount authors anonCount')
def main(args):
"""This program will output a word cloud as html based on the freque... | cfagiani/crowdcloud | build_cloud.py | Python | apache-2.0 | 7,232 | 0.013689 |
""" Failover Transfer
The failover transfer client exposes the following methods:
- transferAndRegisterFile()
- transferAndRegisterFileFailover()
Initially these methods were developed inside workflow modules but
have evolved to a generic 'transfer file with failover' client.
The transferAndR... | coberger/DIRAC | DataManagementSystem/Client/FailoverTransfer.py | Python | gpl-3.0 | 11,229 | 0.027518 |
"""
#header
"""
import base64
import datetime
import logging
from joj.crowd.models import UserRequest
import urllib2
import simplejson
from simplejson import JSONDecodeError
log = logging.getLogger(__name__)
class ClientException(Exception):
""" Base exception for Crowd-based errors """
def __init__(self):
... | NERC-CEH/jules-jasmin | majic/joj/crowd/client.py | Python | gpl-2.0 | 12,041 | 0.00108 |
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import flask.ext.restless
app = Flask(__name__)
app.config.from_object('config')
#flask-sqlalchemy
db = SQLAlchemy(app)
from app import models, views
from app.models import Fact, Log
#API
manager = flask.ext.restless.APIManager(app, flask... | chelnak/BotStats | app/__init__.py | Python | mit | 466 | 0.01073 |
# Copyright 2017 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... | alsrgv/tensorflow | tensorflow/python/keras/layers/recurrent_test.py | Python | apache-2.0 | 54,154 | 0.003638 |
#####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... | w1z2g3/crossbar | crossbar/controller/test/test_cli.py | Python | agpl-3.0 | 10,540 | 0.001328 |
import logging.handlers
import os
_pabotlog = logging.getLogger('PABot')
_pabotlog.setLevel(logging.DEBUG)
_logPath = os.path.abspath("./logging/pabot.log")
_formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s')
_consoleStreamHandler = logging.StreamHandler()
_consoleStreamHandler.s... | KevinJMcGrath/Symphony-Ares | modules/plugins/PABot/logging.py | Python | mit | 796 | 0.002513 |
"""
This module defines serializers for the main API data objects:
.. autosummary::
:nosignatures:
DimensionSerializer
FilterSerializer
MessageSerializer
QuestionSerializer
"""
from django.core.paginator import Paginator
from rest_framework import serializers, pagination
import emoticonvis.apps... | nanchenchen/emoticon-analysis | emoticonvis/apps/api/serializers.py | Python | mit | 4,406 | 0.004766 |
#
# Copyright 2019 The FATE 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... | FederatedAI/FATE | examples/pipeline/data_transform/pipeline-data-transform-dense.py | Python | apache-2.0 | 2,334 | 0.003428 |
# -*- coding: utf-8 -*-
"""
Test cases related to XPath evaluation and the XPath class
"""
import unittest, sys, os.path
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, HelperTestCase, _bytes, BytesIO
from common_i... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/lxml/src/lxml/tests/test_xpathevaluator.py | Python | gpl-2.0 | 23,244 | 0.00271 |
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | keepkey/python-keepkey | tests/test_msg_verifymessage_segwit_native.py | Python | lgpl-3.0 | 4,324 | 0.002313 |
class JWTValidationError(Exception):
pass
class JWTAudienceError(JWTValidationError):
pass
| uc-cdis/cdis-python-utils | cdispyutils/auth/errors.py | Python | apache-2.0 | 101 | 0 |
# 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, software
# distributed under the... | Lukasa/cryptography | tests/utils.py | Python | apache-2.0 | 14,122 | 0 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_dzenlog.models import GeneralPost
class TextPost(GeneralPost):
body_detail_template = 'blog/text_post.html'
feed_description_template = 'blog/text_feed_detail.html'
body = models.TextField(_('Post\'s body'))
... | svetlyak40wt/django-dzenlog | example/blog/models.py | Python | bsd-3-clause | 621 | 0.004831 |
def subtrees_equal(expected_schema_node, actual_node):
if expected_schema_node[0] != actual_node.get_name():
return False
if expected_schema_node[1] != actual_node.get_state():
return False
expected_children = expected_schema_node[2]
actual_children = actual_node.get_children()
actual_children_names = [child.g... | mkobos/tree_crawler | concurrent_tree_crawler/test/subtrees_comparer.py | Python | mit | 650 | 0.026154 |
import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
@pytest.mark.parametrize('ordered', [True, False])
@pytest.mark.parametrize('categories', [
['b', 'a', 'c'],
['a', 'b', 'c', 'd'],
])
def test_factorize(categories, ordered):
cat = pd.Categorical(['b', 'b', 'a', 'c', No... | amolkahat/pandas | pandas/tests/arrays/categorical/test_algos.py | Python | bsd-3-clause | 5,452 | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | nathanielvarona/airflow | tests/providers/apache/cassandra/hooks/test_cassandra.py | Python | apache-2.0 | 8,538 | 0.00164 |
from datapackage_pipelines.wrapper import ingest, spew
def get_votes(resource, data, stats):
data['session_voters'] = {}
stats['num_votes'] = 0
stats['num_vote_mks'] = 0
for vote in resource:
voters = data['session_voters'].setdefault(vote['session_id'], set())
for attr in ['mk_ids_pro... | hasadna/knesset-data-pipelines | people/plenum_session_voters.py | Python | mit | 2,135 | 0.000468 |
#!/usr/bin/env python
"""
A module that provides functionalities for calculating error metrics
and evaluates the given recommender.
"""
import numpy
from util.top_recommendations import TopRecommendations
class Evaluator(object):
"""
A class for computing evaluation metrics and splitting the input data.
"... | mostafa-mahmoud/sahwaka | lib/evaluator.py | Python | apache-2.0 | 13,538 | 0.002955 |
# -*- coding: utf-8 -*-
"""Provides concept object."""
from __future__ import absolute_import
from .. import t1types
from ..entity import Entity
class Concept(Entity):
"""Concept entity."""
collection = 'concepts'
resource = 'concept'
_relations = {
'advertiser',
}
_pull = {
'... | MediaMath/t1-python | terminalone/models/concept.py | Python | apache-2.0 | 729 | 0 |
"""
Hack to get scripts to run from source checkout without having to set
PYTHONPATH.
"""
import sys
from os.path import dirname, join, abspath
db_path = dirname(__file__)
project_path = abspath(join(db_path, ".."))
sys.path.insert(0, project_path)
| bd4/monster-hunter-scripts | db/_pathfix.py | Python | mit | 251 | 0 |
import calendar
from datetime import date
from django.conf import settings
from django.core.mail import send_mail
from django.core.management import BaseCommand
from django.template.loader import get_template
from compta.bank import get_bank_class
from compta.models import Compte
def generate_mail():
# Dernier ... | mfalaize/homelab | compta/management/commands/check_operations.py | Python | gpl-3.0 | 3,142 | 0.003196 |
"""Leave one out coding"""
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator
import category_encoders.utils as util
from sklearn.utils.random import check_random_state
__author__ = 'hbghhy'
class LeaveOneOutEncoder(BaseEstimator, util.TransformerWithTargetMixin):
"""Leave one out codi... | scikit-learn-contrib/categorical-encoding | category_encoders/leave_one_out.py | Python | bsd-3-clause | 11,063 | 0.002983 |
import zlib
from test_support import TestFailed
import sys
import imp
try:
t = imp.find_module('test_zlib')
file = t[0]
except ImportError:
file = open(__file__)
buf = file.read() * 8
file.close()
# test the checksums (hex so the test doesn't break on 64-bit machines)
print hex(zlib.crc32('penguin')), hex... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.2/Lib/test/test_zlib.py | Python | mit | 6,045 | 0.00397 |
import csv
import collections
import json
import numpy
from smqtk.utils.bin_utils import logging, initialize_logging
from smqtk.representation.data_set.memory_set import DataMemorySet
from smqtk.algorithms.descriptor_generator.caffe_descriptor import CaffeDescriptorGenerator
from smqtk.algorithms.classifier.index_labe... | Purg/SMQTK | bin/memex/hackathon_2016_07/cp1/ad_image_classification/cnn_finetuning/score_eval_data.py | Python | bsd-3-clause | 5,443 | 0.003858 |
# -*- coding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
import report
import wizard
| Elico-Corp/openerp-7.0 | balance_sheet_extended/__init__.py | Python | agpl-3.0 | 170 | 0 |
# -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | googleapis/python-bigquery-storage | samples/snippets/__init__.py | Python | apache-2.0 | 601 | 0 |
import uuid
import asyncio
from appdaemon.appdaemon import AppDaemon
class Sequences:
def __init__(self, ad: AppDaemon):
self.AD = ad
self.logger = ad.logging.get_child("_sequences")
async def run_sequence_service(self, namespace, domain, service, kwargs):
if "entity_id" not in kwar... | acockburn/appdaemon | appdaemon/sequences.py | Python | mit | 4,617 | 0.002816 |
# gcp xml backend
# Copyright (C) 2012 Jesse van den Kieboom <jessevdk@gnome.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 the License, or
# (at your option) any la... | jonocodes/gedit-code-assistance | backends/xml/gcpbackendxml/backend.py | Python | gpl-3.0 | 1,683 | 0.001783 |
default_app_config = 'users.apps.UserConfig' | emoitzi/django-excel-viewer | users/__init__.py | Python | gpl-3.0 | 44 | 0.022727 |
from imap_tools import MailBox
with MailBox('imap.mail.com').login('test@mail.com', 'pwd', 'INBOX') as mailbox:
criteria = 'ALL'
found_nums = mailbox.numbers(criteria)
page_len = 3
pages = int(len(found_nums) // page_len) + 1 if len(found_nums) % page_len else int(len(found_nums) // page_len)
for p... | ikvk/imap_tools | examples/fetch_by_pages.py | Python | apache-2.0 | 605 | 0.003306 |
from marshmallow_jsonapi import Schema, fields
from marshmallow import validate
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.exc import SQLAlchemyError
db = SQLAlchemy(session_options={"autoflush": False})
class CRUD():
def add(self, resource):
db.session.add(resource)
return db... | konstantinKim/vd-backend | app/materials/models.py | Python | mit | 2,427 | 0.021426 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import super... | marwoodandrew/superdesk-aap | server/aap/data_consistency/compare_repositories.py | Python | agpl-3.0 | 9,289 | 0.002153 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2021-11-10 19:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('osf', '0238_abstractprovider_allow_updates'),
]
operations = [
migrations.... | Johnetordoff/osf.io | osf/migrations/0239_auto_20211110_1921.py | Python | apache-2.0 | 497 | 0.002012 |
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('applications', '0028_auto__chg_field_applicant_username'),
)
def forwards(self, orm):
if not db.dry_run:
orm['co... | Karaage-Cluster/karaage-applications | kgapplications/south_migrations/0001_initial.py | Python | gpl-3.0 | 21,468 | 0.007965 |
# -*- coding: utf-8 -*-
from werkzeug.contrib import wrappers
from werkzeug import routing
from werkzeug.wrappers import Request, Response
def test_reverse_slash_behavior():
"""Test ReverseSlashBehaviorRequestMixin"""
class MyRequest(wrappers.ReverseSlashBehaviorRequestMixin, Request):
pass
req =... | r-kitaev/lucid-python-werkzeug | tests/contrib/test_wrappers.py | Python | bsd-3-clause | 2,682 | 0 |
# -*- coding: utf-8 -*-
import datetime as dt
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.inser... | jcalbert/TextBlob | docs/conf.py | Python | mit | 2,936 | 0.003406 |
#!/usr/bin/env python
""":mod:`Redirection <testbed.resources._redirect>` tests."""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
import json as _json
import unittest as _unittest
from urllib import quote as _percent_encode
import napper as _napper
import spruce.logging as _lo... | nisavid/testbed | testbed/tests/redirect.py | Python | lgpl-3.0 | 4,763 | 0 |
# coding: utf-8
"""
tests.schema.test_mappings
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2013 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
import pytest
from relief import (
Dict, OrderedDict, Unicode, Integer, NotUnserializable, Form, Element,
_compat
)
from tests.conftest... | DasIch/relief | tests/schema/test_mappings.py | Python | bsd-3-clause | 12,224 | 0.000736 |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 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 limitation the rights to us... | EmanueleCannizzaro/scons | test/CC/SHCC.py | Python | mit | 2,436 | 0.002463 |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# 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 copyri... | kblin/supybot-gsoc | src/commands.py | Python | bsd-3-clause | 30,909 | 0.0033 |
__author__ = 'Maximilian Bisani'
__version__ = '$LastChangedRevision: 1691 $'
__date__ = '$LastChangedDate: 2011-08-03 15:38:08 +0200 (Wed, 03 Aug 2011) $'
__copyright__ = 'Copyright (c) 2004-2005 RWTH Aachen University'
__license__ = """
This program is free software; you can redistribute it and/or modify... | KaranKamath/SequiturG2P | symbols.py | Python | gpl-2.0 | 2,130 | 0.018779 |
#
# 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, software
# ... | nttcom/eclcli | eclcli/bare/bareclient/ecl/common/apiclient/utils.py | Python | apache-2.0 | 2,975 | 0 |
# 0 = open space, 1=boundary , 2= the robot, 3= finish
def maze_vision():
path= ''
maze=[]
maze.append(list('000000002000000'))
maze.append(list('000000003001100'))
maze.append(list('000000000000000'))
maze.append(list('000000000000000'))
maze.append(list('000000000000000'))
maze.append(list('000... | jpschnel/maze-vision | maze_vision.py | Python | apache-2.0 | 2,411 | 0.072999 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | eharney/nova | nova/db/sqlalchemy/migration.py | Python | apache-2.0 | 2,918 | 0 |
class PowerDNSRouter(object):
"""Route all operations on powerdns models to the powerdns database."""
db_name = 'powerdns'
app_name = 'powerdns'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_name:
return self.db_name
return None
def db_for... | dominikkowalski/django-powerdns-dnssec | powerdns/routers.py | Python | bsd-2-clause | 959 | 0 |
# -*- coding: utf-8
"""
Tests related to the Cuttle class.
"""
import os
import unittest
import warnings
import time
from cuttle.reef import Cuttle, Column
from cuttlepool import CuttlePool
from cuttlepool.cuttlepool import PoolConnection
DB = '_cuttle_test_db'
DB2 = '_cuttle_test_db2'
HOST = 'localhost'
class Bas... | smitchell556/cuttle | tests/test_cuttle_class.py | Python | mit | 6,111 | 0.000327 |
# coding: utf-8
from unittest import TestCase
from yased import EventsDispatcher, Event
class AnyEvent(Event):
"""Represents any event."""
class EventsDispatcherTestCase(TestCase):
def setUp(self):
self.ed = EventsDispatcher()
def test_send(self):
calls = []
def handler(*args... | pavelpat/yased | src/tests/__init__.py | Python | apache-2.0 | 1,664 | 0.000601 |
# django-offline-messages Test Settings
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3'}}
INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'offline_messages',
'tests'
)
ROOT_URLCONF = ''
COVERAGE_AD... | themotleyfool/django-offline-messages | tests/settings.py | Python | bsd-3-clause | 361 | 0 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | vitaly-krugl/nupic | examples/opf/experiments/multistep/hotgym_best_sp/description.py | Python | agpl-3.0 | 2,842 | 0.007389 |
"""Subpackage for the Archiver server."""
from ..envars import SRVURL_ARCHIVER as SERVER_URL
from .client import ClientArchiver
from .pvarch import PVDetails, PVData, PVDataSet
from .devices import Orbit, Correctors, TrimQuads
from .time import Time
from . import exceptions
del client, pvarch, devices
| lnls-sirius/dev-packages | siriuspy/siriuspy/clientarch/__init__.py | Python | gpl-3.0 | 306 | 0 |
# coding=utf-8
import unittest
"""754. Reach a Number
https://leetcode.com/problems/reach-a-number/description/
You are standing at position `0` on an infinite number line. There is a goal
at position `target`.
On each move, you can either go left or right. During the _n_ -th move
(starting from 1), you take _n_ ste... | openqt/algorithms | leetcode/python/lc754-reach-a-number.py | Python | gpl-3.0 | 1,163 | 0.009458 |
# -*- coding: utf-8 -*-
from kivy.uix.listview import ListView
from kivy.uix.floatlayout import FloatLayout
from kivy.clock import Clock
from kivy.adapters.listadapter import ListAdapter
from kivy.adapters.models import SelectableDataItem
from kivy.uix.listview import ListItemButton
from random import choice
from str... | danstoner/python_experiments | playing_with_kivy/kivi-examples/widgets/lists/list_reset_data.py | Python | gpl-2.0 | 2,398 | 0.000834 |
"""
Benchmarking and performance tests.
"""
import pytest
from pluggy import HookspecMarker, HookimplMarker, PluginManager
from pluggy._hooks import HookImpl
from pluggy._callers import _multicall
hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")
@hookimpl
def hook(arg1, arg2, arg3):
ret... | hpk42/pluggy | testing/benchmark.py | Python | mit | 2,435 | 0 |
__author__ = 'ariel'
"""
Python Population Simulator
Copyright (C) 2015 Ariel Young
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at yo... | DarthGeek01/PopulationSimulator | Genetics/Allele.py | Python | gpl-2.0 | 6,542 | 0.003363 |
import numpy as np
import scipy
from scipy import linalg
from scipy import sparse
from scipy import ndimage
import scipy.sparse.linalg.eigen.arpack
from scipy.sparse.linalg.eigen.arpack import eigen, eigen_symmetric
#from pyamg.graph import lloyd_cluster
import pyamg
from pyamg import smoothed_aggregation_solver
from s... | GaelVaroquaux/diffusion-segmentation | spectral_embedding.py | Python | bsd-3-clause | 11,610 | 0.006202 |
# -*- coding: utf-8 -*-
# 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... | googleapis/python-retail | google/cloud/retail_v2/services/search_service/__init__.py | Python | apache-2.0 | 765 | 0 |
# Copyright 2015 - StackStorm, 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 ... | StackStorm/mistral | mistral/tests/unit/engine/test_action_defaults.py | Python | apache-2.0 | 6,915 | 0 |
from datetime import datetime, timedelta
from django.db import models
from django.db.models import Max, Min
from tinymce.models import HTMLField
class Company(models.Model):
name = models.CharField(max_length=75, blank=True, null=True)
symbol = models.CharField(max_length=10, blank=True, null=True)
descr... | rodxavier/open-pse-initiative | django_project/companies/models.py | Python | mit | 2,705 | 0.004806 |
from draftjs_exporter.constants import BLOCK_TYPES, INLINE_STYLES
from draftjs_exporter.dom import DOM
from draftjs_exporter.types import Element, Props
def render_children(props: Props) -> Element:
"""
Renders the children of a component without any specific
markup for the component itself.
"""
r... | springload/draftjs_exporter | draftjs_exporter/defaults.py | Python | mit | 1,811 | 0 |
import os
import io
import time
import base64
import hashlib
import aiohttpretty
from http import client
from urllib import parse
from unittest import mock
import pytest
from waterbutler.core import (streams,
metadata,
exceptions)
from waterbutler.providers.... | rdhyee/waterbutler | tests/providers/s3/test_provider.py | Python | apache-2.0 | 33,061 | 0.001936 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bankaccounts', '0001_initial'),
('banktransactiontags', '0001_initial'),
]
... | ychab/mymoney | mymoney/apps/banktransactions/migrations/0001_initial.py | Python | bsd-3-clause | 2,559 | 0.004689 |
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2016 Intel 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 License at
#
# http://www.apache.org/licenses/LICENSE-... | intelxed/mbuild | mbuild/doxygen.py | Python | apache-2.0 | 12,057 | 0.015012 |
# systemOverloadHardening
#
# Used by:
# Celestials named like: Red Giant Beacon Class (6 of 6)
runTime = "early"
type = ("projected", "passive")
def handler(fit, module, context):
fit.modules.filteredItemMultiply(lambda mod: "overloadHardeningBonus" in mod.itemModifiedAttributes,
... | Ebag333/Pyfa | eos/effects/systemoverloadhardening.py | Python | gpl-3.0 | 406 | 0.004926 |
# Django settings for celery_http_gateway project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
CARROT_BACKEND = "amqp"
CELERY_RESULT_BACKEND = "database"
BROKER_HOST = "localhost"
BROKER_VHOST = "/"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
... | frac/celery | examples/celery_http_gateway/settings.py | Python | bsd-3-clause | 2,931 | 0.000341 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.