code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Copyright (C) 2012 Google Inc. 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 f... | Debian/openjfx | modules/web/src/main/native/Tools/Scripts/webkitpy/tool/steps/commit_unittest.py | Python | gpl-2.0 | 3,257 |
#
# idepi :: (IDentify EPItope) python libraries containing some useful machine
# learning interfaces for regression and discrete analysis (including
# cross-validation, grid-search, and maximum-relevance/mRMR feature selection)
# and utilities to help identify neutralizing antibody epitopes via machine
# learning.
#
#... | nlhepler/idepi | idepi/util/__init__.py | Python | gpl-3.0 | 13,422 |
from abc import ABC
from typing import Final
from base64 import b64decode
from io import BytesIO
import struct
from redbot import VersionInfo
from redbot.core import commands
from ..converters import get_lazy_converter, get_playlist_converter
__version__ = VersionInfo.from_json({"major": 2, "minor": 4, "micro": 0, "... | palmtree5/Red-DiscordBot | redbot/cogs/audio/core/cog_utils.py | Python | gpl-3.0 | 4,323 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from bedrock.redirects.util import no_redirect, platform_redirector, redirect
def firefox_mobile_faq(request, *args, ... | alexgibson/bedrock | bedrock/firefox/redirects.py | Python | mpl-2.0 | 32,590 |
# -*- 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):
# Removing unique constraint on 'VideoUrl', fields ['url', 'type']
db.delete_unique('videos_videourl', ['url... | ofer43211/unisubs | apps/videos/migrations/0169_auto__chg_field_videourl_url__del_unique_videourl_url_type.py | Python | agpl-3.0 | 36,444 |
# encoding: utf-8
from . import AppRemoveMigration
class Migration(AppRemoveMigration):
app_name = 'social_auth'
tables = [
'social_auth_association',
'social_auth_nonce',
'social_auth_usersocialauth',
]
| patricmutwiri/pombola | pombola/core/migrations/0050_del_social_auth.py | Python | agpl-3.0 | 243 |
"""
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
... | codeforeurope/Change-By-Us | giveaminute/migrations/versions/004_Add_a_city_leader_model.py | Python | agpl-3.0 | 875 |
from dogapi.stats.dog_stats_api import DogStatsApi
| GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/dogapi/stats/__init__.py | Python | agpl-3.0 | 51 |
#!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
# Usage: ./launch_nightly_test.py
# --test-host <hostname>[:<port>]
# (--email <name>@<address>)*
# [--title "<Title>"]
# [-- <flags for full_test_driver.py>]
import sys, subprocess, os, optparse
i... | jfriedly/rethinkdb | scripts/nightly-test/launch_nightly_test.py | Python | agpl-3.0 | 1,755 |
#--CORBA STUBS-----------------------------------------------------------------
import ACSCOURSE_MOUNT__POA
#--ACS Imports-----------------------------------------------------------------
from Acspy.Servants.ContainerServices import ContainerServices
from Acspy.Servants.ComponentLifecycle import ComponentLifecycle
fro... | jbarriosc/ACSUFRO | LGPL/CommonSoftware/acscourse/ws/src/ACSCOURSE_MOUNTImpl/Mount1.py | Python | lgpl-2.1 | 2,155 |
__author__ = 'Elmira'
| popovsn777/new_training | test/__init__.py | Python | apache-2.0 | 22 |
# Copyright (C) 2013-2015 Computer Sciences 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-2.0
#
# Unless required by a... | b-long/ezbake-platform-services | efe/frontend_app/modules/ezRPStaticFileStore.py | Python | apache-2.0 | 9,011 |
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def parquet_parse_simple():
"""
Tests Parquet parser by comparing the summary of the original csv frame with the h2o parsed Parquet frame.
Basic use case of importing files with auto-dete... | mathemage/h2o-3 | h2o-py/tests/testdir_parser/pyunit_parquet_parser_simple.py | Python | apache-2.0 | 999 |
#!/usr/bin/env python
"""This is the manager for the various queues."""
import os
import random
import socket
import time
import logging
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import stats
from grr.lib import utils
clas... | ksmaheshkumar/grr | lib/queue_manager.py | Python | apache-2.0 | 30,636 |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
import math
import logging
from time import sleep
from ctypes import c_uint16, POINTER, cast, c_uint8, c_uint64
from lib.driver import Register
import lib.registers as regs_def
import lib.platforms as plat_def
cla... | galak/zephyr | boards/xtensa/intel_adsp_cavs15/tools/lib/stream_desc.py | Python | apache-2.0 | 8,094 |
#
# 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
# ... | miguelgrinberg/heat | heat/common/grouputils.py | Python | apache-2.0 | 3,141 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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... | prometheanfire/openstack-guest-agents-unix | tests/test_kms.py | Python | apache-2.0 | 3,525 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Context Free Grammars
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@seas.upenn.edu>
# Jason Narad <jason.narad@gmail.com>
# Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# URL: ... | tadgh/ArgoRevisit | third_party/nltk/grammar.py | Python | apache-2.0 | 53,776 |
"""Test Group config panel."""
import asyncio
import json
from unittest.mock import patch, MagicMock
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
VIEW_NAME = "api:config:group:config"
@asyncio.coroutine
def test_get_device_config(hass, hass_client):
"""T... | fbradyirl/home-assistant | tests/components/config/test_group.py | Python | apache-2.0 | 3,516 |
import logging
from django.conf import settings
from django.db import models
from mkt.site.mail import send_mail
from mkt.site.models import ModelBase
from mkt.users.models import UserProfile
from mkt.webapps.models import Webapp
from mkt.websites.models import Website
log = logging.getLogger('z.abuse')
class Abu... | tsl143/zamboni | mkt/abuse/models.py | Python | bsd-3-clause | 3,973 |
"""
Low-level LAPACK functions (:mod:`scipy.linalg.lapack`)
=======================================================
This module contains low-level functions from the LAPACK library.
.. versionadded:: 0.12.0
.. warning::
These functions do little to no error checking.
It is possible to cause crashes by mis-usi... | andim/scipy | scipy/linalg/lapack.py | Python | bsd-3-clause | 6,884 |
#!/usr/bin/env python
# Copyright (C) 2016 The ANGLE Project Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | endlessm/chromium-browser | third_party/angle/third_party/vulkan-validation-layers/src/build-gn/generate_vulkan_layers_json.py | Python | bsd-3-clause | 4,768 |
import sys
import traceback
# ------------------------------------------------------------------------------
#
class MyEx (Exception) :
# --------------------------------------------------------------------------
#
# the exception constructor always needs a message (no need complaining if
# there is ... | luis-rr/saga-python | docs/concepts/exceptions.py | Python | mit | 5,931 |
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | rays/ipodderx-core | khashmir/unet.py | Python | mit | 2,756 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, David Kainz <dkainz@mgit.at> <dave.jokain@gmx.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadat... | thaim/ansible | lib/ansible/modules/crypto/openssh_cert.py | Python | mit | 22,137 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate.py | Python | mit | 2,185 |
import django
if django.VERSION > (1, 8,):
from collections import OrderedDict
else:
from django.utils.datastructures import SortedDict as OrderedDict # noqa
try:
from urllib.parse import parse_qsl, urlparse, urlunparse
except ImportError:
from urlparse import parse_qsl, urlparse, urlunparse # noqa
... | bjorand/django-allauth | allauth/compat.py | Python | mit | 414 |
import unittest2
from models.event import Event
from models.match import Match
from models.team import Team
class TestKeyNameValidators(unittest2.TestCase):
def setUp(self):
self.valid_team_key = "frc177"
self.valid_team_key2 = "frc1"
self.invalid_team_key = "bcr077"
self.invalid_... | bdaroz/the-blue-alliance | tests/test_key_name_validators.py | Python | mit | 2,185 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2017, Tigran Kostandyan.
#
# 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 limitatio... | shamangeorge/beets | beetsplug/gmusic.py | Python | mit | 5,347 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... | Distrotech/scons | test/Fortran/F95COMSTR.py | Python | mit | 2,501 |
# -*- coding: utf-8 -*-
from i3pystatus import Module
from threading import Thread
import i3ipc
class WindowTitle(Module):
"""
Display the current window title with async update.
Uses asynchronous update via i3 IPC events.
Provides instant title update only when it required.
fork from window_tile... | drwahl/i3pystatus | i3pystatus/window_title.py | Python | mit | 3,544 |
# NEEDS FIXING
# -*- coding: utf-8 -*-
'''
Exodus Add-on
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.
... | mrquim/repository.mrquim | script.module.exodus/lib/resources/lib/sources/en/dizigold.py | Python | gpl-2.0 | 4,468 |
"""
Contains profile management classes
"""
from celery import task
from pulp.plugins.loader import api as plugin_api, exceptions as plugin_exceptions
from pulp.plugins.profiler import Profiler
from pulp.server.async.tasks import Task
from pulp.server.db.model.consumer import UnitProfile
from pulp.server.exceptions im... | ulif/pulp | server/pulp/server/managers/consumer/profile.py | Python | gpl-2.0 | 5,469 |
# coding: utf-8
""" Tests for the command line script """
from __future__ import unicode_literals, absolute_import
import os
import re
import did.cli
import did.utils
# Prepare path and config examples
PATH = os.path.dirname(os.path.realpath(__file__))
MINIMAL = did.base.Config.example()
EXAMPLE = "".join(open(PATH ... | TomasHofman/did | tests/test_did.py | Python | gpl-2.0 | 1,194 |
# -*- coding: utf-8 -*-
# Copyright 2009-2013 Jaap Karssenberg <jaap.karssenberg@gmail.com>
# The Error class needed to be put in a separate file to avoid recursive
# imports.
'''This module contains the base class for all errors in zim'''
import sys
import logging
logger = logging.getLogger('zim')
use_gtk_error... | hjq300/zim-wiki | zim/errors.py | Python | gpl-2.0 | 4,949 |
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-accounting-report-cli
# Author : Adria Casajus
########################################################################
"""
Command line interface to DIRAC Accounting ReportGenerator Service.
""... | Andrew-McNab-UK/DIRAC | AccountingSystem/scripts/dirac-accounting-report-cli.py | Python | gpl-3.0 | 788 |
#!/usr/bin/env python
#
# Copyright 2005,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | GREO/GNU-Radio | gr-audio-alsa/src/qa_alsa.py | Python | gpl-3.0 | 1,240 |
import logging
from stubo.ext.xmlutils import XPathValue
from stubo.ext.xmlexit import XMLManglerExit
log = logging.getLogger(__name__)
elements = dict(year=XPathValue('//dispatchTime/dateTime/year'),
month=XPathValue('//dispatchTime/dateTime/month'),
day=XPathValue('//dispatchTime/dat... | rusenask/stubo-app | stubo/static/cmds/tests/ext/auto_mangle/skip_xml/ignore.py | Python | gpl-3.0 | 867 |
#!/usr/bin/env python
# encoding: utf-8
# Scott Newton, 2005 (scottn)
# Thomas Nagy, 2006-2010 (ita)
"""
Support for waf command-line options
Provides default command-line options,
as well as custom ones, used by the ``options`` wscript function.
"""
import os, tempfile, optparse, sys, re
from waflib import Logs, U... | labero/kupfer | waflib/Options.py | Python | gpl-3.0 | 7,752 |
OK = 0
UNKNOWN_ERROR = 1
EVAL_FALSE = 2
OP_RETURN = 3
# Max sizes
SCRIPT_SIZE = 4
PUSH_SIZE = 5
OP_COUNT = 6
STACK_SIZE = 7
SIG_COUNT = 8
PUBKEY_COUNT = 9
# Failed verify operations
VERIFY = 10
EQUALVERIFY = 11
CHECKMULTISIGVERIFY = 12
CHECKSIGVERIFY = 13
NUMEQUALVERIFY = 14
# Logical/Format/Canonical errors
BAD_OPC... | cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/pycoin/tx/script/errno.py | Python | gpl-3.0 | 1,047 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | obimod/taiga-back | taiga/timeline/signals.py | Python | agpl-3.0 | 6,716 |
"""
These are tests for disabling and enabling student accounts, and for making sure
that students with disabled accounts are unable to access the courseware.
"""
import unittest
from django.conf import settings
from django.test import Client, TestCase
from django.urls import reverse
from common.djangoapps.student.... | edx/edx-platform | common/djangoapps/student/tests/test_userstanding.py | Python | agpl-3.0 | 4,098 |
#!/usr/bin/env python
# Copyright 2015, 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 or ... | sharbison3/python-docs-samples | bigquery/api/getting_started.py | Python | apache-2.0 | 2,344 |
var_in_resource2 = "Foo"
| caio2k/RIDE | utest/resources/robotdata/resources/more_resources/even_more_varz.py | Python | apache-2.0 | 25 |
"""Tests for tensorflow.ops.tf.gather."""
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
class GatherTest(tf.test.TestCase):
def testScalar1D(self):
with self.test_session():
params = tf.constant([0, 1, 2, 3, 7, 5])
indices = tf.constant(4)
gather_t = tf.gather(... | rickyHong/Tensorflow_modi | tensorflow/python/kernel_tests/gather_op_test.py | Python | apache-2.0 | 2,641 |
#
# 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... | spektom/incubator-airflow | airflow/contrib/hooks/slack_webhook_hook.py | Python | apache-2.0 | 1,156 |
"""Test the config manager."""
import asyncio
from datetime import timedelta
from unittest.mock import MagicMock, patch
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.setup impo... | MartinHjelmare/home-assistant | tests/test_config_entries.py | Python | apache-2.0 | 29,755 |
#!/usr/bin/env python
# Licensed to Rackspace under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Rackspace licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use thi... | tilogaat/blueflood | demo/ingest.py | Python | apache-2.0 | 3,541 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 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
#
# ... | maheshp/novatest | nova/virt/xenapi/volumeops.py | Python | apache-2.0 | 7,332 |
# Copyright (c) 2015 Mellanox Technologies, Ltd
#
# 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... | javaos74/neutron | neutron/tests/unit/api/rpc/handlers/test_resources_rpc.py | Python | apache-2.0 | 8,869 |
import pytest
from api.base.settings.defaults import API_BASE
from osf.models import MetaSchema
from osf_tests.factories import (
AuthUserFactory,
)
from website.project.metadata.schemas import LATEST_SCHEMA_VERSION
@pytest.mark.django_db
class TestMetaSchemaDetail:
def test_metaschemas_detail_visibility(se... | aaxelb/osf.io | api_tests/metaschemas/views/test_metaschemas_detail.py | Python | apache-2.0 | 2,170 |
import sys, os
sys.path.append(os.sep.join(("..","..","..","src")))
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import traceback
import MySQLdb as dbi
import weblab.db.model as Model
########################################################
#
# Abstract class. All classes implementi... | zstars/weblabdeusto | server/admin/cli/migrate_db_40m1_to_50/migrationlib.py | Python | bsd-2-clause | 4,717 |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | sameera2004/xray-vision | xray_vision/messenger/mpl/__init__.py | Python | bsd-3-clause | 5,498 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.convert import AnalyzeHeader
def test_AnalyzeHeader_inputs():
input_map = dict(args=dict(argstr='%s',
),
centre=dict(argstr='-centre %s',
units='mm',
),
data_dims=dict(arg... | mick-d/nipype_source | nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py | Python | bsd-3-clause | 2,420 |
#-*- coding: utf-8 -*-
from django.contrib import admin
from django.core.urlresolvers import reverse
from filer.utils.compatibility import DJANGO_1_7
class PrimitivePermissionAwareModelAdmin(admin.ModelAdmin):
def has_add_permission(self, request):
# we don't have a "add" permission... but all adding is ... | o-zander/django-filer | filer/admin/permissions.py | Python | bsd-3-clause | 1,441 |
#coding:utf-8
import functools
from cactus.utils.internal import getargspec
from cactus.plugin import defaults
class PluginManager(object):
def __init__(self, site, loaders):
self.site = site
self.loaders = loaders
self.reload()
for plugin_method in defaults.DEFAULTS:
... | ibarria0/Cactus | cactus/plugin/manager.py | Python | bsd-3-clause | 2,122 |
from django_nose.tools import assert_equal
from pontoon.base.tests import TestCase
from pontoon.base.utils import NewlineEscapePlaceable, mark_placeables
class PlaceablesTests(TestCase):
def test_newline_escape_placeable(self):
"""Test detecting newline escape sequences"""
placeable = NewlineEsca... | Osmose/pontoon | pontoon/base/tests/test_placeables.py | Python | bsd-3-clause | 1,460 |
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | nesi/easybuild-framework | easybuild/tools/toolchain/linalg.py | Python | gpl-2.0 | 13,669 |
#!/usr/bin/env python
# encoding: utf-8
from yade import utils, plot
o = Omega()
fr = 0.5;rho=2000
tc = 0.001; en = 0.7; et = 0.7; o.dt = 0.0002*tc
r = 0.002
mat1 = O.materials.append(ViscElMat(frictionAngle=fr,mR = 0.05, mRtype = 1, density=rho,tc=tc,en=en,et=et))
mat2 = O.materials.append(ViscElMat(frictionAngle=fr... | anna-effeindzourou/trunk | examples/rotationalResistance.py | Python | gpl-2.0 | 1,465 |
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | epsylon3/torrentflux | html/bin/clients/mainline/BitTorrent/Storage_IOCP.py | Python | gpl-2.0 | 16,006 |
from django.conf import settings
if 'nodeshot.community.profiles' in settings.INSTALLED_APPS:
user_fixtures = 'test_profiles.json'
else:
user_fixtures = 'test_users.json'
| ninuxorg/nodeshot | nodeshot/core/base/tests.py | Python | gpl-3.0 | 180 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | nabsboss/CouchPotatoServer | libs/guessit/language.py | Python | gpl-3.0 | 13,102 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | crmccreary/openerp_server | openerp/addons/account/report/account_central_journal.py | Python | agpl-3.0 | 5,320 |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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
# License, or (at your ... | norayr/unisubs | utils/management/commands/get_memcached.py | Python | agpl-3.0 | 1,043 |
# Copyright 2008-2015 Canonical
#
# 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
# License, or (at your option) any later version.
#
# This program is distributed... | zhsso/ubunto-one | lib/config.py | Python | agpl-3.0 | 1,777 |
"""
Tests for class dashboard (Metrics tab in instructor dashboard)
"""
import json
from django.test.client import RequestFactory
from mock import patch
from nose.plugins.attrib import attr
from class_dashboard import views
from student.tests.factories import AdminFactory
from xmodule.modulestore.tests.django_utils i... | miptliot/edx-platform | lms/djangoapps/class_dashboard/tests/test_views.py | Python | agpl-3.0 | 4,059 |
# encoding: utf-8
"""
The :mod:`ast` module contains the classes comprising the Python abstract syntax tree.
All attributes ending with ``loc`` contain instances of :class:`.source.Range`
or None. All attributes ending with ``_locs`` contain lists of instances of
:class:`.source.Range` or [].
The attribute ``loc``, ... | google/grumpy | third_party/pythonparser/ast.py | Python | apache-2.0 | 26,727 |
# Copyright (c) 2014 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... | suneeth51/neutron | neutron/notifiers/nova.py | Python | apache-2.0 | 11,323 |
import sys
import logging
codec_options = ['utf-8', 'latin_1']
logger = logging.getLogger(__name__)
def try_decode(byte_string, codec):
try:
s = byte_string.decode(codec)
return s
except:
return None
def shortest_string(strings):
best_string = None
best_length = None
... | sorgerlab/indra | indra/sources/medscan/fix_csxml_character_encoding.py | Python | bsd-2-clause | 1,680 |
# Copyright 2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 t... | vasiliykochergin/euca2ools | euca2ools/commands/autoscaling/describemetriccollectiontypes.py | Python | bsd-2-clause | 1,989 |
from django.conf import settings
from django.contrib import messages
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_POST
from django.db import transaction
from django.db.models import Max
from jsonview.decorators import json_view
from airmozilla.main.... | Nolski/airmozilla | airmozilla/manage/views/url_transforms.py | Python | bsd-3-clause | 3,948 |
"""
sentry.options.store
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
from collections import namedtuple
from time import time
from ran... | alexm92/sentry | src/sentry/options/store.py | Python | bsd-3-clause | 10,280 |
from unittest import skipIf
from django.test import TestCase
from django.test.utils import override_settings
from django.db import connection
from django.db.migrations.loader import MigrationLoader, AmbiguityError
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
class Recorder... | rogerhu/django | tests/migrations/test_loader.py | Python | bsd-3-clause | 4,238 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ExtractSpecificVertices.py
--------------------
Date : October 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
******... | mhugo/QGIS | python/plugins/processing/algs/qgis/ExtractSpecificVertices.py | Python | gpl-2.0 | 6,483 |
from Screens.InfoBar import InfoBar
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap
from Components.ConfigList import ConfigListScreen
from Components.Label import Label
from Components.Sources.StaticText import StaticText
from Components.config imp... | openNSS/enigma2 | lib/python/Screens/SleepTimerEdit.py | Python | gpl-2.0 | 10,279 |
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | riveridea/gnuradio | gr-digital/python/digital/psk_constellations.py | Python | gpl-3.0 | 6,937 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Discussion')
class TestDiscussion(unittest.TestCase):
pass
| bhupennewalkar1337/erpnext | erpnext/schools/doctype/discussion/test_discussion.py | Python | gpl-3.0 | 263 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
os.environ['DJANGO_SETTINGS_MODUL... | ta2-1/pootle | pootle/apps/pootle_app/management/commands/set_filetype.py | Python | gpl-3.0 | 2,012 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 opti... | sputnick-dev/weboob | modules/carrefourbanque/__init__.py | Python | agpl-3.0 | 810 |
# Copyright 2014 NEC Corporation. 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 ... | HybridF5/tempest_debug | tempest/api/orchestration/stacks/test_templates_negative.py | Python | apache-2.0 | 1,954 |
"""Tests related to retraction of public registrations"""
import datetime
from rest_framework import status as http_status
import mock
import pytest
from django.utils import timezone
from django.db import DataError
from nose.tools import * # noqa
from framework.auth import Auth
from framework.exceptions import Perm... | mfraezz/osf.io | tests/test_registrations/test_retractions.py | Python | apache-2.0 | 43,805 |
import sys
import unittest
from test import test_support, list_tests
class ListTest(list_tests.CommonTest):
type2test = list
def test_basic(self):
self.assertEqual(list([]), [])
l0_3 = [0, 1, 2, 3]
l0_3_bis = list(l0_3)
self.assertEqual(l0_3, l0_3_bis)
self.assertTrue(l... | google/grumpy | third_party/stdlib/test/test_list.py | Python | apache-2.0 | 2,707 |
"""Check that scans journalctl for messages caused as a symptom of increased etcd traffic."""
from openshift_checks import OpenShiftCheck
class EtcdTraffic(OpenShiftCheck):
"""Check if host is being affected by an increase in etcd traffic."""
name = "etcd_traffic"
tags = ["health", "etcd"]
def is_a... | mmahut/openshift-ansible | roles/openshift_health_checker/openshift_checks/etcd_traffic.py | Python | apache-2.0 | 1,743 |
"""
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
from __future__ import division
# pylint: disable=E1101,E1103,W0231,E0202
from numpy import nan
from pandas.compat import lmap
from pandas import compat
import numpy as np
from pandas.types.missing import isnull, not... | andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/sparse/frame.py | Python | apache-2.0 | 30,372 |
#!/usr/bin/env python
"""
@package mi.dataset.driver.wc_wm.cspp
@file mi/dataset/driver/wc_wm/cspp/wc_wm_cspp_telemetered_driver.py
@author Jeff Roy
@brief Driver for the wc_wm_cspp instrument
Release notes:
Initial Release
"""
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.dataset_dr... | janeen666/mi-instrument | mi/dataset/driver/wc_wm/cspp/wc_wm_cspp_telemetered_driver.py | Python | bsd-2-clause | 1,972 |
import datetime
import os
from django.conf import settings
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon
from olympia.devhub.cron import update_blog_posts
from olympia.devhub.tasks import convert_purified
from olympia.devhub.models import BlogPost
class TestRSS(TestCase):
def t... | harikishen/addons-server | src/olympia/devhub/tests/test_cron.py | Python | bsd-3-clause | 1,566 |
#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import sys
dirpath = sys.argv[1]
regex = re.compile(sys.argv[2])
print sorted(filter(regex.match, os.listdir(dirpath)))[-1]
| youtube/cobalt | third_party/skia/gn/highest_version_dir.py | Python | bsd-3-clause | 304 |
include("manifest.py")
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
| bvernoux/micropython | ports/esp32/boards/manifest_release.py | Python | mit | 283 |
#! /usr/bin/env python
import os
import os.path
import sys
import string
import getopt
import re
import socket
import time
import threading
import traceback
import types
import exceptions
import linecache
from code import InteractiveInterpreter
try:
from Tkinter import *
except ImportError:
print>>sys.__stde... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/idlelib/PyShell.py | Python | gpl-2.0 | 48,715 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | grnet/synnefo | snf-admin-app/synnefo_admin/admin/tests/projects.py | Python | gpl-3.0 | 1,582 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
... | tszym/ansible | lib/ansible/modules/network/illumos/flowadm.py | Python | gpl-3.0 | 14,817 |
from __future__ import absolute_import, division
import copy
import time
class Heartbeat(object):
DEFAULT_CONFIG = {
'group_id': None,
'heartbeat_interval_ms': 3000,
'session_timeout_ms': 10000,
'max_poll_interval_ms': 300000,
'retry_backoff_ms': 100,
}
def __init... | Yelp/kafka-python | kafka/coordinator/heartbeat.py | Python | apache-2.0 | 2,304 |
#ckwg +28
# Copyright 2012 by Kitware, Inc.
# 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 conditio... | mathstuf/sprokit | tests/bindings/python/modules/sprokit/schedulers/__init__.py | Python | bsd-3-clause | 1,615 |
#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | catapult-project/catapult | third_party/gsutil/third_party/apitools/apitools/base/protorpclite/messages.py | Python | bsd-3-clause | 67,559 |
import hashlib
from django.conf import settings
from django.utils.http import urlencode
from wagtail.core.compat import AUTH_USER_APP_LABEL, AUTH_USER_MODEL_NAME
delete_user_perm = "{0}.delete_{1}".format(AUTH_USER_APP_LABEL, AUTH_USER_MODEL_NAME.lower())
def user_can_delete_user(current_user, user_to_delete):
... | zerolab/wagtail | wagtail/users/utils.py | Python | bsd-3-clause | 1,289 |
##########################################################################
#
# Copyright (c) 2012, John Haddon. 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 so... | lucienfostier/gaffer | python/GafferTest/StringInOutNode.py | Python | bsd-3-clause | 2,820 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the base (auto)updater for the Native Client SDK"""
import py_compile
import optparse
import os
import shutil
import sys... | aYukiSekiguchi/ACCESS-Chromium | native_client_sdk/src/build_tools/make_sdk_tools.py | Python | bsd-3-clause | 4,613 |
# unpack sequences
a, = 1, ; print(a)
a, b = 2, 3 ; print(a, b)
a, b, c = 1, 2, 3; print(a, b, c)
a, = range(1); print(a)
a, b = range(2); print(a, b)
a, b, c = range(3); print(a, b, c)
(a) = range(1); print(a)
(a,) = range(1); print(a)
(a, b) = range(2); print(a, b)
(a, b, c) = range(3); print(a, b, c)
(a, (b, ... | mhoffma/micropython | tests/basics/unpack1.py | Python | mit | 1,794 |
"""Tests the challenge_mgr module."""
import datetime
from django.contrib.auth.models import User
from django.test import TransactionTestCase
from django.core.urlresolvers import reverse
from apps.managers.challenge_mgr import challenge_mgr
from apps.managers.challenge_mgr.models import RoundSetting
from apps.utils ... | yongwen/makahiki | makahiki/apps/managers/challenge_mgr/tests.py | Python | mit | 2,099 |
# Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""Unit tests for registry.py."""
import unittest
from registry import Registry, machine_registry, NoSuchMachineException
class RegistryClassTestCase(unittest.TestCase):
def test_lookup(self):
registry = Registry()
registry.register... | earney/asetniop | src/machine/test_registry.py | Python | gpl-2.0 | 1,430 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.