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 |
|---|---|---|---|---|---|
# Copyright (c) 2010-2012 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... | kalrey/swift | test/unit/container/test_updater.py | Python | apache-2.0 | 8,358 |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | vanant/googleads-dfa-reporting-samples | python/v2.0/patch_report.py | Python | apache-2.0 | 2,205 |
import unittest
from django.core.exceptions import ValidationError
from ..models import Reward
from .factories import ProjectFactory, RewardFactory, PledgeFactory
class BasicRewardTest(unittest.TestCase):
def setUp(self):
self.project = ProjectFactory.create()
self.reward = RewardFactory.crea... | kelfish/zipfelchappe | zipfelchappe/tests/rewards.py | Python | mit | 1,794 |
# -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
"""
Contains a feature selection method that evaluates the importance of the different extracted features. To do so,
for ev... | blue-yonder/tsfresh | tsfresh/feature_selection/relevance.py | Python | mit | 15,975 |
data = 'spam8:bacon'
| tsdmgz/ansible | test/integration/targets/module_utils/module_utils/spam8/ham/bacon.py | Python | gpl-3.0 | 21 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import recurrent, workspace
from caffe2.python.model_helper import ModelHelper
from hypothesis import given
import caffe2.python.hypothesis_test_util a... | ryfeus/lambda-packs | pytorch/source/caffe2/python/operator_test/recurrent_network_test.py | Python | mit | 14,157 |
"""Tests for the object departures module."""
import responses
# initialize package, and does not mix up names
import test as _test
import navitia_client
import requests
class DeparturesTest(_test.TestCase):
def setUp(self):
self.user = 'leo'
self.core_url = "https://api.navitia.io/v1/"
... | leonardbinet/navitia_client | test/test_departures.py | Python | mit | 529 |
#!/usr/bin/env python
"""Start the application."""
import celery
import os
from f8a_worker.setup_celery import init_celery, init_selinon
import raven
from raven.contrib.celery import register_signal, register_logger_signal
class SentryCelery(celery.Celery):
"""Celery class to configure sentry."""
def on_co... | jpopelka/fabric8-analytics-worker | f8a_worker/start.py | Python | gpl-3.0 | 792 |
import sys
try:
from django.conf import settings
from django.test.utils import get_runner
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="test_ap... | thecut/thecut-emailform | runtests.py | Python | apache-2.0 | 1,852 |
# coding=utf-8
from django.test import TestCase
from openfonacide.models import Establecimiento
from openfonacide.utils import conversion
from openfonacide.matcher import token_compare, mismo_nivel_educativo, same_tipo_institucion, tiene_nombre_santo, \
match_nombre_santo
class EstablecimientoTest(TestCase):
... | nemesiscodex/openfonacide | openfonacide/tests.py | Python | lgpl-3.0 | 5,401 |
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2019 Dontnod Entertainment
# 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,... | dontnod/nimp | nimp/command.py | Python | mit | 8,386 |
import os
import re
from setuptools import setup, find_packages
version = None
for line in open('./funfactory/__init__.py'):
m = re.search('__version__\s*=\s*(.*)', line)
if m:
version = m.group(1).strip()[1:-1] # quotes
break
assert version
setup(
name='funfactory',
version=versio... | mozilla/funfactory | setup.py | Python | bsd-3-clause | 1,313 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# gingerprawn / packaging / py2exe debug config
# debug version executable (w/ a console attached) py2exe script
#
# Copyright (C) 2011 Wang Xuerui <idontknw.wang@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | xen0n/gingerprawn | gingerprawn/launcher/setup_dbg.py | Python | gpl-3.0 | 1,355 |
import pytest # noqa
from django.test import TestCase
import common.blocks.people as common
class PeopleBlockTest(TestCase):
def setUp(self):
""" Establishes necessary variables """
super(PeopleBlockTest, self).setUp()
self.block = common.PeopleBlock()
def test_render_template(self)... | baylee-d/cos.io | cos_tests/block_tests/test_blocks_people.py | Python | apache-2.0 | 887 |
# -*- coding: utf-8 -*-
# Copyright 2015-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
Boolean,
String,
)
class FdbPemMoe(... | laslabs/Python-Carepoint | carepoint/models/cph/fdb_pem_moe.py | Python | mit | 782 |
# Copyright (c) 2016, 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
# list of conditions and th... | vlegoff/cocomud | src/sharp/functions/say.py | Python | bsd-3-clause | 4,125 |
from numpy import zeros
from sklearn.base import BaseEstimator, TransformerMixin
from idepi.filters import null_filter
from idepi.labeledmsa import LabeledMSA
__all__ = ['MSAVectorizer']
class MSAVectorizer(BaseEstimator, TransformerMixin):
def __init__(self, encoder, filter=null_filter):
self.__ali... | veg/idepi | idepi/feature_extraction/_msavectorizer.py | Python | gpl-3.0 | 2,212 |
""" Tests the Point class """
from exhaustive_search.point import Point
def test_equality_is_based_on_value():
""" equality between two Points should be based off value, not address """
# ~1000 runs
maximum = 34
universe_1, universe_a = [], []
for x in range(maximum):
for y in range(maxim... | ciarand/exhausting-search-homework | test/test_point.py | Python | isc | 660 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import create_engine, pool
from logging.config import fileConfig
from os import environ
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the conf... | sheeley/Safe-Passages-Event-Tracker | alembic/env.py | Python | mit | 2,155 |
#!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors.
#
# 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... | matthewrmshin/cylc | lib/cylc/task_message.py | Python | gpl-3.0 | 5,625 |
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from src.python.baselines import *
from src.python.preprocess2 import *
from pymongo import MongoClient
from tqdm import tqdm
import tensorflow as tf
### Keras
from keras import optimizers
from keras.models impor... | yotamfr/prot2vec | src/python/deepprofile1.py | Python | mit | 8,560 |
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from pyxb.utils import six
from xml.dom import Node
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="ht... | CantemoInternal/pyxb | tests/trac/test-trac-0153.py | Python | apache-2.0 | 6,656 |
# 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 use ... | supertom/libcloud | libcloud/compute/drivers/dimensiondata.py | Python | apache-2.0 | 107,477 |
"""SCons.Scanner.RC
This module implements the depenency scanner for RC (Interface
Definition Language) files.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of ... | aubreyrjones/libesp | scons_local/scons-local-2.3.0/SCons/Scanner/RC.py | Python | mit | 2,081 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | Micronaet/micronaet-analytic | timesheet_partner_analytic_report/wizard/__init__.py | Python | agpl-3.0 | 1,045 |
try:
import pytest
except ImportError:
raise ImportError('Tests require pytest >= 2.2.')
from ... import tableau
def test_print_maps(capsys):
# just make sure there are no errors
tableau.print_maps()
out, err = capsys.readouterr()
assert out
def test_get_map_bad_name():
with pytest.rai... | chebee7i/palettable | palettable/tableau/test/test_tableau.py | Python | mit | 981 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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 ... | robocomp/robocomp-robolab | components/detection/PoseBasedGestureRecognition/src/genericworker.py | Python | gpl-3.0 | 1,669 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2015 Kitware 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 cop... | cjh1/cumulus | setup.py | Python | apache-2.0 | 1,333 |
# SPDX-License-Identifier: Apache-2.0
# Copyright 2016 Eotvos Lorand University, Budapest, Hungary
from compiler_log_warnings_errors import addError, addWarning
from utils.codegen import format_expr, format_type, format_statement, format_declaration
from compiler_common import statement_buffer_value, generate_var_name... | P4ELTE/t4p4s | src/hardware_indep/parser.c.py | Python | apache-2.0 | 15,005 |
#################################################################
##
## Modification of soil_moisture_field.py to accomodate
## multiple Plant Functional Types (PFTs)
##
## Sai Nudurupati and Erkan Istanbulluoglu - 31Oct2014
#################################################################
GRASS = 0
SHRUB = 1
TREE =... | decvalts/landlab | landlab/components/soil_moisture/soil_moisture_multi_pft_nmpy.py | Python | mit | 14,966 |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem009.py
#
# Special Pythagorean triplet
# ===========================
# Published on Friday, 25th January 2002, 06:00 pm
#
# A Pythagorean triplet is a set of three natural numbers, a b c, for which,
# a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There... | olduvaihand/ProjectEuler | src/python/problem009.py | Python | mit | 501 |
from django.conf.urls import patterns, url
from password_reset.views import password_change_view, password_reset_view, password_reset_request_view, password_reset_instructions_view
urlpatterns = patterns('',
url(r'^change-password/$', password_change_view, name='password-change'),
url(r'^reset-password/$', pas... | chrooter/planbox | src/password_reset/urls.py | Python | gpl-3.0 | 584 |
from distutils.core import setup
setup(
name = "ipfs_db",
packages = ["ipfs_db"],
version = "0.1.2",
description = "IPFS file tagger. Program and library",
author = "Patryk 'pat36' Tabiś",
author_email = "pat36@onet.pl",
url = "https://github.com/Efdecjanie/ipfs-... | Efdecjanie/ipfs-db | setup.py | Python | mit | 354 |
# -*- coding: utf-8 -*-
#
# Copyright 2012 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# W... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/ubuntu-sso-client/ubuntu_sso/qt/setup_account_page.py | Python | mit | 22,337 |
# -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | jonparrott/google-cloud-python | spanner/google/cloud/spanner_admin_database_v1/__init__.py | Python | apache-2.0 | 1,064 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserSocialAuth'
db.create_table(u'social_auth_usersocialauth', (
(u'id', self.gf... | oinopion/pipeye | pipeye/utils/migrations/social_auth/0001_initial.py | Python | bsd-2-clause | 6,132 |
#
# 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
# ... | NeCTAR-RC/heat | heat/common/context.py | Python | apache-2.0 | 6,156 |
# coding:utf-8
#IBM Watson API のNLCを呼び出す
#python のバージョン指定:python 3.5.0
from watson_developer_cloud import NaturalLanguageClassifierV1
from watson_developer_cloud import NaturalLanguageClassifierV1 as NaturalLanguageClassifier
#5w1h1i1c_v.5:ff18a8x156-nlc-1275
#5w1h1i1c_v.5:ff18c7x157-nlc-2812
#5w1h1i1c_v.7:ff1c34x1... | BlueHoleUEC/BlueHoleUEC | get_nlc.py | Python | mit | 923 |
import os
from synapseclient.dict_object import DictObject
def setup():
print('\n')
print('~' * 60)
print(os.path.basename(__file__))
print('~' * 60)
def test_DictObject():
"""Test creation and property access on DictObjects"""
d = DictObject({'args_working?':'yes'}, a=123, b='foobar', nerds=... | kkdang/synapsePythonClient | tests/unit/unit_test_DictObject.py | Python | apache-2.0 | 784 |
from astropy.modeling.models import custom_model
#TODO: Add Jacobian
@custom_model
def GeneralizedLorentz1D(x, x_0=1., fwhm=1., value=1., power_coeff=1.):
"""
Generalized Lorentzian function,
implemented using astropy.modeling.models custom model
Parameters
----------
x: numpy.ndarray
... | StingraySoftware/stingray | stingray/simulator/models.py | Python | mit | 2,692 |
from rest_framework import serializers
from .models import User, Activity, Period
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email')
extra_kwargs = {
'url': {'view_name': 'timeperiod:user-detail'},
... | maurob/timeperiod | serializers.py | Python | mit | 1,063 |
import time
from django.http import HttpResponseRedirect
from django.test import TestCase
from restlib2.http import codes
from avocado.async import utils
from .base import JobTestCaseMixin
class AsyncExporterResourceTestCase(TestCase, JobTestCaseMixin):
def setUp(self):
super(AsyncExporterResourceTestCas... | chop-dbhi/serrano | tests/cases/resources/tests/async/exporter.py | Python | bsd-2-clause | 2,821 |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
class QGraphicsTransform(__PyQt4_QtCore.QObject):
""" QGraphicsTransform(QObject parent=None) """
def applyTo(... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QGraphicsTransform.py | Python | gpl-2.0 | 692 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import os.path
path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
sys.path.insert(0, path)
| boriel/zxbasic | tests/cmdline/__init__.py | Python | gpl-3.0 | 196 |
from scrapy.utils.reqser import request_to_dict, request_from_dict
try:
import cPickle as pickle
except ImportError:
import pickle
class Base(object):
"""Per-spider queue/stack base class"""
def __init__(self, server, spider, key, queue_name):
"""Initialize per-spider redis queue.
P... | qiyeboy/SpiderBook | ch17/yunqiCrawl/yunqiCrawl/scrapy_redis/queue.py | Python | mit | 3,450 |
import os
import shutil
def remove_if_exists(path):
if os.path.exists(path):
os.remove(path)
def remove_folder_if_exists(path):
if os.path.exists(path):
shutil.rmtree(path)
def makedirs_if_not_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def force_chdir(path):... | hmrc/service-manager | servicemanager/smfile.py | Python | apache-2.0 | 373 |
import json
from django import forms
from django.template.loader import render_to_string
from django.utils import translation
from django.utils.functional import cached_property
from wagtail.core.blocks import FieldBlock
DEFAULT_TABLE_OPTIONS = {
'minSpareRows': 0,
'startRows': 3,
'startCols': 3,
'co... | nealtodd/wagtail | wagtail/contrib/table_block/blocks.py | Python | bsd-3-clause | 5,142 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | Micronaet/micronaet-log | log_media_telegram/__init__.py | Python | agpl-3.0 | 1,038 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2016-2099 Ailemon.net
#
# This file is part of ASRT Speech Recognition Tool.
#
# ASRT 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... | nl8590687/ASRT_SpeechRecognition | predict_speech_file.py | Python | gpl-3.0 | 1,822 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/LevelUpRewardsMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _me... | favll/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/LevelUpRewardsMessage_pb2.py | Python | mit | 2,351 |
import re
import os
BEGIN_EMAIL_HEADERS = '-----BEGIN EMAIL HEADERS-----'
END_EMAIL_HEADERS = '-----BEGIN EMAIL HEADERS-----'
BEGIN_ATTACHMENTS = '-----BEGIN ATTACHMENTS-----'
END_ATTACHMENTS = '-----END ATTACHMENTS-----'
BEGIN_EMAIL_HEADERS = '-----BEGIN EMAIL HEADERS-----'
END_EMAIL_HEADERS = '-----END EMAIL HEADE... | deeso/python_scrirpts | pm_msg_parser.py | Python | apache-2.0 | 6,050 |
# Copyright (c) 2018-2021 Micro Focus or one of its affiliates.
# Copyright (c) 2018 Uber Technologies, 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/licen... | uber/vertica-python | vertica_python/vertica/messages/__init__.py | Python | apache-2.0 | 2,061 |
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2, or (at your option) any later
# version. This program is distributed in t... | fedora-infra/pkgdb2 | tests/test_flask_api_admin.py | Python | gpl-2.0 | 15,764 |
import socket
import struct
import select
import sys
from socket import IPPROTO_IPV6
PORT = 26000
ADDR = 'ff01::1' #IPV6 Multicast Address
addrInfo = socket.getaddrinfo(ADDR, None)[0]
sock = socket.socket(addrInfo[0], socket.SOCK_DGRAM)
sock.setsockopt(IPPROTO_IPV6, socket.IPV6_MULTICAST_HOPS, 1)
sock.setsockopt(so... | MickMack1983/multicastclient | tiipbusclient/minimal.py | Python | mit | 823 |
"""Settings for the DropTheBeat."""
import logging
# Logging settings
DEFAULT_LOGGING_FORMAT = "%(message)s"
VERBOSE_LOGGING_FORMAT = "%(levelname)s: %(message)s"
VERBOSE2_LOGGING_FORMAT = "%(levelname)s: %(module)s:%(lineno)d: %(message)s"
DEFAULT_LOGGING_LEVEL = logging.WARNING
VERBOSE_LOGGING_LEVEL = logging.INFO
... | jacebrowning/dropthebeat | dtb/settings.py | Python | lgpl-3.0 | 359 |
# Copyright (C) 2011-2012 by Barry A. Warsaw
#
# This file is part of flufl.bounce
#
# flufl.bounce 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, version 3 of the License.
#
# flufl.bounce is distribu... | wRAR/flufl.bounce | flufl/bounce/_scan.py | Python | lgpl-3.0 | 3,136 |
from django.contrib.auth import models as auth
from django.db import models
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
class SelfRefer(models.Model):
name = models.CharField(max_length=10)
references = models.ManyToManyField('self')
related = models.Many... | wkschwartz/django | tests/m2m_regress/models.py | Python | bsd-3-clause | 2,619 |
from utils import *
def test_avenge():
game = prepare_game()
avenge = game.player1.give("FP1_020")
wisp1 = game.player1.give(WISP)
avenge.play()
wisp1.play()
assert avenge.exhausted
game.end_turn()
assert not avenge.exhausted
stonetusk1 = game.player2.give("CS2_171")
stonetusk1.play()
stonetusk1.attack(wi... | jleclanche/fireplace | tests/test_secrets.py | Python | agpl-3.0 | 19,345 |
# -*- coding: utf-8 -*-
"""
.. module:: common
"""
from django.contrib.auth.models import User
from apps.volontulo.models import Offer
from apps.volontulo.models import Organization
from apps.volontulo.models import UserProfile
COMMON_OFFER_DATA = {
'organization': None,
'description': u'',
'requirement... | mlipa/volontulo | backend/apps/volontulo/tests/common.py | Python | mit | 5,596 |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | googleads/google-ads-python | google/ads/googleads/v9/errors/types/size_limit_error.py | Python | apache-2.0 | 1,174 |
from django import test
from dingos.models import *
from dingos.core.datastructures import DingoObjDict
from dingos.import_handling import DingoImportHandling \
, EXIST_PLACEHOLDER \
, EXIST_ID_AND_EXACT_TIMESTAMP \
, EXIST_ID_AND_NEWER_TIMESTAMP \
, EXIST_ID_AND_OLDER_TIMESTAMP
import dingos.core.dat... | siemens/django-mantis-openioc-importer | tests/utils.py | Python | gpl-2.0 | 1,934 |
#!/usr/bin/env python
# Interrogate a sequence by finding out what features are present within a specified range
from __future__ import print_function
import sys
import argparse
from Bio import SeqIO
__author__ = "Joe R. J. Healey"
__version__ = "1.0"
__title__ = ""
__license__ = "GPLv3"
__doc__ = "A parser for the ... | jrjhealey/bioinfo-tools | get_spans.py | Python | gpl-3.0 | 3,272 |
# -*- coding: UTF-8 -*-
from urllib.parse import urlencode
from django import template
from django.utils.encoding import force_str
register = template.Library()
@register.simple_tag(takes_context=True)
def append_to_query(context, no_path=False, **kwargs):
# django.core.context_processors.request should be enabled i... | melkisedek/sen_project | src/utils/templatetags/utility_tags.py | Python | mit | 752 |
import os
from PyQt4 import QtGui, QtCore
from . import workspaces
class Plugin(object):
title = ''
location = 'left' # left, bottom, right, app
widget = None # The widget for the plugin (set at loadWidget)
def __init__(self,parent=None):
self.parent = parent
def load(self):
... | lucidlylogicole/scope | plugins/workspaces/scope_plugin.py | Python | gpl-3.0 | 954 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from input_functions import get_input_fn
import tensorflow as tf
from tensorflow.contrib.keras.python.keras.datasets import imdb
from tensorflow.contrib.learn.python.learn import learn_runner
f... | mari-linhares/tensorflow-workshop | code_samples/RNN/sentiment_analysis/samples/canned_sentiment_analysis.py | Python | apache-2.0 | 4,929 |
# -*- coding: utf-8 -*-
from scrapy_sci.features import DictVectWrapper
class DataFeatures(DictVectWrapper):
def __init__(self):
super(DataFeatures, self).__init__()
def dimension_features(self, datum):
features = {}
x = float(datum["x_resolution"])
y = float(datum["... | dangra/scrapy-sci | wallpaper_demo/wallpaper/data/category/DataFeatures.py | Python | bsd-3-clause | 1,045 |
from __future__ import unicode_literals
import base64
from collections import defaultdict
import copy
import datetime
import docker
import docker.errors
import hashlib
import io
import logging
import os
import json
import re
import zipfile
import uuid
import functools
import tarfile
import calendar
import threading
im... | whummer/moto | moto/awslambda/models.py | Python | apache-2.0 | 25,476 |
import datetime
import unittest
from django.test import TestCase
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone, utc
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... | denys-duchier/django | tests/utils_tests/test_feedgenerator.py | Python | bsd-3-clause | 4,940 |
import os
class PathLike:
def __fspath__(self):
return 'NO_DIRECTORY'
path_like = PathLike()
print(os.stat(path_like))
| TakesxiSximada/TIL | python/python3.6/err.py | Python | apache-2.0 | 134 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | chipaca/snapcraft | tests/unit/cache/test_snap.py | Python | gpl-3.0 | 5,730 |
# 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 unde... | openstack/python-senlinclient | senlinclient/tests/unit/v1/test_event.py | Python | apache-2.0 | 6,406 |
# Copyright (C) 2006-2007 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... | nemesiscodex/JukyOS-sugar | src/jarabe/frame/frame.py | Python | gpl-2.0 | 10,714 |
#!/usr/bin/python
# Copyright (c) 2003-2013 CORE Security Technologies)
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# $Id: registry-read.py 1113 2014-01-21 20:58:34Z bethus@gmail.com $
#
# Author: Alb... | hecchi777/S3-SlaacSecuritySolution | impacket-0.9.11/examples/registry-read.py | Python | apache-2.0 | 4,928 |
###############################################################################
# Name: util.py #
# Purpose: Misc utility functions used through out Editra #
# Author: Cody Precord <cprecord@editra.org> #
... | beiko-lab/gengis | bin/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/util.py | Python | gpl-3.0 | 26,678 |
"""
Diverging color scales are appropriate for continuous data that has a natural midpoint \
other otherwise informative special value, such as 0 altitude, or the boiling point
of a liquid. The color scales in this module are \
mostly meant to be passed in as the `color_continuous_scale` argument to various \
functions... | plotly/python-api | packages/python/plotly/_plotly_utils/colors/diverging.py | Python | mit | 1,151 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from nose.tools import *
from utilities import execution_path, run_all
import tempfile
import mapnik
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
de... | kapouer/mapnik | tests/python_tests/object_test.py | Python | lgpl-2.1 | 16,766 |
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "Employee",
"description": _("Employee records."),
},
{
"type": "doctype",
"name": "Leave Application",
"description": _("Applicati... | rohitwaghchaure/New_Theme_Erp | erpnext/config/hr.py | Python | agpl-3.0 | 5,045 |
from os import listdir
array_of_files = listdir('.')[3:]
print(array_of_files)
with open('_file_list.txt', 'w') as f:
for i, val in enumerate(array_of_files):
f.write(array_of_files[i] + '\n')
| jeffchang5/Ambient | src/public/samples/_readdir.py | Python | mit | 207 |
#
# Copyright (c) 2015 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | rdoh/pixelated-user-agent | service/pixelated/adapter/mailstore/leap_mailstore.py | Python | agpl-3.0 | 16,152 |
#!/usr/bin/env python
"""This script is given "Positive integers n≤100 and m≤20" and returns "The
total number of pairs of rabbits that will remain after the n-th month if all
rabbits live for m months".
"""
import argparse
from functools import lru_cache
def main(args):
"""Mortal Fibonacci Rabbits"""
(n, ... | iansealy/rosalind | fibd/fibd.py | Python | gpl-3.0 | 1,079 |
#!/usr/bin/env python
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | googleapis/python-storage | samples/snippets/storage_remove_bucket_label.py | Python | apache-2.0 | 1,340 |
default_app_config = 'charcoallog.investments.apps.InvestmentsConfig'
| hpfn/charcoallog | charcoallog/investments/__init__.py | Python | gpl-3.0 | 70 |
# 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 | large_margin/margin_loss.py | Python | apache-2.0 | 7,219 |
from haystack import indexes
class GeoHashMultiValueField(indexes.MultiValueField):
field_type = 'geohash'
class TextSpellField(indexes.CharField):
field_type = 'textSpell'
| denverfoundation/storybase | apps/storybase/search/fields.py | Python | mit | 183 |
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 720
GROUND_HEIGHT = SCREEN_HEIGHT - 130
| Sveder/pyweek24 | gamelib/config.py | Python | apache-2.0 | 77 |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# new_year_plugin.py
# Coded by: WitcherGeralt (WitcherGeralt@jabber.ru)
# http://witcher-team.ucoz.ru/
def handler_new_year(type, source, body):
list = [u"До нового года (по GMT) осталось:"]
Time = time.gmtime()
t0 = (365 if (Time.tm_year%4) else 366)
t... | Manazius/blacksmith-bot | extensions/new_year.py | Python | apache-2.0 | 760 |
#!/usr/bin/python
import os
import json
import urllib
import subprocess
import sys
url_base = "http://admin.ci.centos.org:8080"
api_key = os.environ['API_KEY']
count = os.environ['MACHINE_COUNT'] if os.environ.get('MACHINE_COUNT') != None else "1"
ver = "7"
arch = "x86_64"
req_url = "%s/Node/get?key=%s&ver=%s&arch=%s... | budhrg/vagrant-service-manager | .ci/jenkins-execute-script.py | Python | gpl-2.0 | 3,174 |
from flask import Flask
from flask import request
from flask.ext.sqlalchemy import SQLAlchemy
import datetime
import uuid as uid
import sys
import requests
import urllib2
GOIP_SERVER_IP = '127.0.0.1' #'172.248.114.178'
TELEPHONY_SERVER_IP = '127.0.0.1:5000/sms/in'
sys.path.append('/home/csik/public_python/sms_... | rootio/rootio_telephony | sms_utils/sms_server.py | Python | agpl-3.0 | 3,873 |
from . import static
from . import root
from . import templates
from . import links
from . import image
from . import overview
from . import generator
from . import latest
from . import aliases
| joshfriend/memegen | memegen/routes/__init__.py | Python | mit | 194 |
################################### LICENSE ####################################
# Copyright 2016 Morphux #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... | Morphux/installer | pkgs/xmlparser_p2/xmlparser_p2.py | Python | apache-2.0 | 2,566 |
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 2013 Bitcraze AB
#
# Cr... | manojngb/Crazyfly_simple_lift | src/cfheadless.py | Python | gpl-2.0 | 6,684 |
import inspect
import traceback
import warnings
import functools
from shyft.api._api import *
import numpy as np
from math import sqrt
def deprecated(message: str = ''):
"""
This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the funct... | felixmatt/shyft | shyft/api/__init__.py | Python | lgpl-3.0 | 15,456 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from htmlmin import minify
import sys
def main():
if len(sys.argv)<2:
raise ValueError("Input File Path")
input_str=str()
with open(sys.argv[1]) as fin:
input_str=fin.read()
minified_str=("\"{0}\"").format(minify(input_str,remove_optio... | hiroaki-yamamoto/angular-bswrapper | convert2jsresource.py | Python | gpl-3.0 | 464 |
from pyblish import api
from pyblish_bumpybox import inventory
class UpdateFtrackStatus(api.ContextPlugin):
""" Updates ftrack status """
order = inventory.get_order(__file__, "UpdateFtrackStatus")
def process(self, context):
import os
import json
import ftrack
job = co... | Bumpybox/pyblish-bumpybox | pyblish_bumpybox/plugins/deadline/bait/update_ftrack_status.py | Python | lgpl-3.0 | 2,003 |
import sys
from pylibs.log import Session
from pylibs.plot import plotCompareSessions
def algo_key(algo):
if algo == 'classic':
return 0
if algo == 'bba0':
return 1
return 10
if __name__ == "__main__":
filenames = sys.argv[1:]
assert len(filenames)
export = False
if filenames[0] == 'export':
filenames = ... | serl/hls-bba-testbed | compare_sessions.py | Python | mit | 801 |
"""
Contains classes and utilities that help publishing a hyde website to
the documentation hosting on http://packages.python.org/.
"""
import os
import getpass
import zipfile
import tempfile
import httplib
import urlparse
from base64 import standard_b64encode
import ConfigParser
from hyde.publisher import Publisher... | 0111001101111010/hyde | hyde/ext/publishers/pypi.py | Python | mit | 5,297 |
import asyncio
import os
import time
import sys
import logging
import logging.handlers
import shutil
import traceback
import datetime
try:
assert sys.version_info >= (3, 5)
from discord.ext import commands
import discord
except ImportError:
print("Discord.py is not installed.\n"
... | abacorodney/red-abaco | red.py | Python | gpl-3.0 | 19,244 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.contrib.auth.models import AnonymousUser
__all__ = ["A... | suutari/shoop | shuup_tests/utils/faux_users.py | Python | agpl-3.0 | 814 |
# -*- coding: utf-8 -*-
##code-section init-module-header #fill in your manual code here
##/code-section init-module-header
# Subpackages
# Additional
# Classes
import Zorionagurra
##code-section init-module-footer #fill in your manual code here
##/code-section init-module-footer
| codesyntax/Products.zorionagurra | Products/zorionagurra/content/__init__.py | Python | gpl-2.0 | 287 |
import unittest
import pysal.lib as ps
import numpy as np
import pysal.viz.mapclassify as mc
from ..markov import Markov
from ..mobility import markov_mobility
class test_shorrock(unittest.TestCase):
def test___init__(self):
import numpy as np
f = ps.io.open(ps.examples.get_path('usjoin.csv'))
... | lixun910/pysal | pysal/explore/giddy/tests/test_mobility.py | Python | bsd-3-clause | 1,689 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.