code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # 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 t...
mahak/neutron
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_tun.py
Python
apache-2.0
20,139
#!/usr/bin/python from . import exposition from . import gc_collector from . import metrics from . import metrics_core from . import platform_collector from . import process_collector from . import registry __all__ = ['Counter', 'Gauge', 'Summary', 'Histogram', 'Info', 'Enum'] CollectorRegistry = registry.CollectorR...
kawamon/hue
desktop/core/ext-py/prometheus_client-0.7.1/prometheus_client/__init__.py
Python
apache-2.0
1,727
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import from contextlib import contextmanager # Import Salt Testing libs from salttesting import skipIf, TestCase from salttesting.mock import NO_MOCK, NO_MOCK_REASON, MagicMock @contextmanager def provision_state(module, fixture): prev...
stephane-martin/salt-debian-packaging
salt-2016.3.3/tests/unit/states/dockerio.py
Python
apache-2.0
4,749
# -*- coding: utf-8 -*- import os import urllib import uuid from pymongo import MongoClient import requests from framework.mongo.utils import to_mongo_key from website.models import Node from addons.wiki import settings as wiki_settings from addons.wiki.exceptions import InvalidVersionError def generate_private_uu...
mluo613/osf.io
addons/wiki/utils.py
Python
apache-2.0
6,398
from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from manage import models as mmod from account import models as amod from . import templater from django.contrib.auth.decorators import user_passes_test from django.core.mail import send_mail fr...
brayden2544/Mystuff-final
static_files/manage/views/edit_repair_status.py
Python
apache-2.0
1,794
"""The tests for NEW_NAME device triggers.""" import pytest from homeassistant.components.NEW_DOMAIN import DOMAIN from homeassistant.const import STATE_ON, STATE_OFF from homeassistant.setup import async_setup_component import homeassistant.components.automation as automation from homeassistant.helpers import device_...
joopert/home-assistant
script/scaffold/templates/device_trigger/tests/test_device_trigger.py
Python
apache-2.0
4,490
# Copyright (c) 2011-2016 Rackspace US, 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 agreed ...
rackerlabs/lunr
lunr/db/helpers.py
Python
apache-2.0
1,124
"""SQLAlchemy util functions.""" from contextlib import contextmanager import logging import os import time from sqlalchemy.exc import OperationalError, SQLAlchemyError import homeassistant.util.dt as dt_util from .const import DATA_INSTANCE, SQLITE_URL_PREFIX _LOGGER = logging.getLogger(__name__) RETRIES = 3 QUER...
pschmitt/home-assistant
homeassistant/components/recorder/util.py
Python
apache-2.0
4,353
#!/usr/bin/env python # pylint: disable=too-many-arguments, too-many-locals, too-many-branches, too-many-lines, line-too-long, too-many-nested-blocks, too-many-public-methods, too-many-instance-attributes # pylint: disable=invalid-name, missing-docstring # Memory Map File Analyser for ARM mbed OS import sys import os...
ARM-software/mbed-beetle
tools/memap.py
Python
apache-2.0
18,734
from typing import NamedTuple, List from src.independent.util import chcast from src.independent.SExpr import SExpr, sexpr_subst_mult_string, SExprOrStr class L4Macro(NamedTuple): macroparams: List[str] macrobody: SExpr def subst(self, paramvals:List[SExprOrStr]) -> SExpr: return chcast(SExpr, s...
legalese-io/legalese-compiler
L4/pyL4/src/model/L4Macro.py
Python
apache-2.0
654
"""Tests for the Somfy config flow.""" import asyncio import logging import time from unittest.mock import patch import pytest from homeassistant import config_entries, data_entry_flow, setup from homeassistant.helpers import config_entry_oauth2_flow from tests.common import MockConfigEntry, mock_platform TEST_DOMA...
Teagan42/home-assistant
tests/helpers/test_config_entry_oauth2_flow.py
Python
apache-2.0
11,942
from django.conf.urls.defaults import patterns, include from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), ) urlpatterns += staticfiles_urlpatterns()
geeknam/django-import-export
tests/urls.py
Python
bsd-2-clause
301
from django.shortcuts import render from kitsune.access.decorators import login_required, permission_required @login_required @permission_required('karma.view_dashboard') def questions_dashboard(request): """Karma dashboard for the support forum.""" return render(request, 'karma/dashboards/questions.html')
dbbhattacharya/kitsune
kitsune/karma/views.py
Python
bsd-3-clause
319
from setuptools import setup, find_packages setup( name='remotecontrol', version='1.0.0-dev', description='A remote REPL and command socket.', url='http://github.com/westernx/remotecontrol', packages=find_packages(exclude=['build*', 'tests*']), author='Mike Boers', author_ema...
westernx/remotecontrol
setup.py
Python
bsd-3-clause
1,278
# -*- coding: utf-8 -*- """ pygments.lexers.modeling ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for modeling languages. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, d...
wakatime/wakatime
wakatime/packages/py27/pygments/lexers/modeling.py
Python
bsd-3-clause
13,409
from .. ndtypes import ScalarT, ArrayT from .. analysis.collect_vars import collect_var_names from .. analysis import escape_analysis from .. analysis.find_local_arrays import FindLocalArrays from .. analysis.usedef import UseDefAnalysis from .. syntax import AllocArray, ArrayView, Index, Struct, Var from .. syntax i...
pombredanne/parakeet
parakeet/transforms/copy_elimination.py
Python
bsd-3-clause
3,359
# Copyright (C) 2011 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
xin3liang/platform_external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/bindings/main.py
Python
bsd-3-clause
9,418
""" =============================== NumPy memmap in joblib.Parallel =============================== This example illustrates some features enabled by using a memory map (:class:`numpy.memmap`) within :class:`joblib.Parallel`. First, we show that dumping a huge data array ahead of passing it to :class:`joblib.Parallel`...
joblib/joblib
examples/parallel_memmap.py
Python
bsd-3-clause
5,591
""" Test numerical accuracy of some implementations """ import unittest import numpy as np from lsh_hdc.metrics import ClusteringMetrics from lsh_hdc.fent import emi_from_margins as emi_fortran from lsh_hdc.entropy import emi_from_margins as emi_cython class TestAccuracy(unittest.TestCase): def test_emi_matlab(...
pombredanne/lsh-hdc
tests/test_accuracy.py
Python
bsd-3-clause
1,559
import os import re from django.contrib.auth import get_user_model from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from django.utils import six _ from sh import git, ErrorReturnCode, Command from collections import namedtuple from waliki.signals import page_saved, page_pre...
santiavenda2/waliki
waliki/git/models.py
Python
bsd-3-clause
7,461
import tests import agile def test_function(cmd): return 'OK' class TestPython(tests.AgileTest): config_file = 'tests/configs/python.json' async def test_task(self): app = await self.executor(["tasks:test"]) self.assertEqual(app.cfg.tasks, ["tasks:test"]) self.assertFalse(await...
quantmind/pulsar-agile
tests/test_python.py
Python
bsd-3-clause
587
from __future__ import absolute_import from mock import patch from datadog.util.hostname import get_hostname from sentry.metrics.datadog import DatadogMetricsBackend from sentry.testutils import TestCase class DatadogMetricsBackendTest(TestCase): def setUp(self): self.backend = DatadogMetricsBackend(pr...
mvaled/sentry
tests/sentry/metrics/test_datadog.py
Python
bsd-3-clause
932
from bento.compat.api.moves \ import \ unittest from bento.backends.utils \ import \ load_backend class TestLoadBackend(unittest.TestCase): def test_simple(self): for backend in ("Distutils", "Yaku"): load_backend(backend)
esc/Bento
bento/backends/tests/test_utils.py
Python
bsd-3-clause
273
# coding=utf-8 """Test cases for Zinnia's quick entry""" from django.test import TestCase from django.contrib.auth.models import User from django.test.utils import restore_template_loaders from django.test.utils import setup_test_template_loader from zinnia import settings from zinnia.models import Entry from zinnia.m...
westinedu/similarinterest
zinnia/tests/quick_entry.py
Python
bsd-3-clause
4,124
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this file. # # All configurati...
crawfordsm/pyspectrograph
docs/conf.py
Python
bsd-3-clause
6,849
################################# LICENSE ################################## # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. # # # # Redistribu...
saltastro/pysalt
slottools/PhotometryConfigWidget.py
Python
bsd-3-clause
22,957
from __future__ import unicode_literals import os import pickle import time from datetime import datetime from django.test import RequestFactory, TestCase from django.conf import settings from django.template import Template, Context from django.template.response import (TemplateResponse, SimpleTemplateResponse, ...
Proggie02/TestRepo
tests/regressiontests/templates/response.py
Python
bsd-3-clause
13,284
# Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved. # Use of this source code is governed by a BSD License (see LICENSE). from huxley.api.tests import (CreateAPITestCase, DestroyAPITestCase, ListAPITestCase, PartialUpdateAPITestCase, ...
ctmunwebmaster/huxley
huxley/api/tests/test_committee.py
Python
bsd-3-clause
6,347
IFRAME_TEXT = '''<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script> document.domain = document.domain; _sockjs_onload = function(){SockJS.bootstrap_iframe();}; </script> <script src="%s"...
tazo90/lux
lux/extensions/sockjs/utils.py
Python
bsd-3-clause
472
# https://github.com/mihu/python3-rados __VERSION__ = '1.0'
datalogistics/dlt-misc
libdlt/protocol/ceph/rados/__init__.py
Python
bsd-3-clause
61
# Copyright 2013 Google Inc. All Rights Reserved. """The auth command gets tokens via oauth2.""" from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions as c_exc from googlecloudsdk.core import log from googlecloudsdk.core import properties from googlecloudsdk.core.credentials import ...
ychen820/microblog
y/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/auth/activate_refresh_token.py
Python
bsd-3-clause
1,813
# -*- coding: utf-8 -*- """ Function inlining. """ from pykit.error import CompileError from pykit.analysis import loop_detection from pykit.ir import Function, Builder, findallops, copy_function, verify from pykit.transform import ret as ret_normalization def rewrite_return(func): """Rewrite ret ops to assign t...
ContinuumIO/pykit
pykit/transform/inline.py
Python
bsd-3-clause
2,424
from django.db.models.signals import post_delete, post_save from django.test import TestCase from contentstore.models import Schedule from contentstore.signals import schedule_deleted, schedule_saved from .utils import normalise_metric_name class NormaliseMetricNameTest(TestCase): def test_normalise_metric_name...
praekelt/seed-stage-based-messaging
seed_stage_based_messaging/test_utils.py
Python
bsd-3-clause
1,220
# django-constance documentation build configuration file, created by # sphinx-quickstart on Tue Nov 25 19:38:51 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration ...
jezdez/django-constance
docs/conf.py
Python
bsd-3-clause
8,600
# Generated by Django 3.1.4 on 2020-12-13 15:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('visitors', '0022_auto_20201212_1645'), ] operations = [ migrations.AlterField( model_name='statistic', name='updated...
aniversarioperu/django-manolo
visitors/migrations/0023_auto_20201213_1005.py
Python
bsd-3-clause
412
#! /usr/bin/env python """Map values from one grid element to another. Grid mapping functions +++++++++++++++++++++++ .. autosummary:: ~landlab.grid.mappers.map_link_head_node_to_link ~landlab.grid.mappers.map_link_tail_node_to_link ~landlab.grid.mappers.map_min_of_link_nodes_to_link ~landlab.grid.ma...
cmshobe/landlab
landlab/grid/mappers.py
Python
mit
51,051
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from math import log import numpy as np try: from numba import jit except ImportError: print("numba is not available! Entropy calculation will be *slow*.") jit = lambda *a, **k: lambda f: f from binglide.utils import * class identity(object): ...
wujf/binglide
binglide/calcs.py
Python
mit
6,479
import os import dj_database_url def extract_dj_database_urls(databases_as_string, DATABASES): ''' Expects a string comma separated by dj_database_urls. Returns an object which contains details of all the databases entered by the user before deployment ''' if databases_as_string: datab...
dakshgautam/squealy
squealyproj/utils.py
Python
mit
1,135
# -*- coding: utf-8 -*- from __future__ import print_function # Form implementation generated from reading ui file './acq4/analysis/scripts/builder/builderTemplate.ui' # # Created: Tue Dec 24 01:49:15 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 impo...
pbmanis/acq4
acq4/analysis/scripts/builder/builderTemplate.py
Python
mit
8,390
#! /usr/bin/env python ''' Este es un script que busca el punto de interseccion entre seno y coseno usando el metodo de la biseccion. ''' import matplotlib.pyplot as plt import numpy as np plt.figure(1) plt.clf() x_values = np.linspace(0, np.pi, 100) plt.plot(x_values, np.sin(x_values), label='sin(x)') plt.plot(x_v...
uchileFI3104B-2015B/busca_cero_demo
busca_cero.py
Python
mit
1,330
# Cartoon Filter # # This example shows off a simple cartoon filter on images. The cartoon # filter works by joining similar pixel areas of an image and replacing # the pixels in those areas with the area mean. import sensor, image, time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.s...
kwagyeman/openmv
scripts/examples/Arduino/Portenta-H7/04-Image-Filters/cartoon_filter.py
Python
mit
958
import numpy import chainer from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn _cudnn_version = libcudnn.getVersion() _mode = libcudnn.CUDNN_ACTIVATION_TANH class Tanh(f...
kiyukuta/chainer
chainer/functions/activation/tanh.py
Python
mit
2,510
"""Module providing an API for creating data simulators. """ import math, datetime from pyvol.est.CovUtils import Mean class SimAPI: """Provides an interface for data simulators to follow. This is a simple application programming interface (API) that data simulators should follow. Having a cons...
aavanian/pyvol
pyvol/sims/SimAPI.py
Python
mit
6,223
from datetime import datetime, timedelta, tzinfo from django.conf import settings from django.contrib.gis.db import models from django.contrib.gis.geos import Point from django.contrib.postgres import fields, indexes from django.core.validators import MinValueValidator from django.dispatch import receiver from django....
codeforboston/cornerwise
server/proposal/models.py
Python
mit
28,773
import time import typing # noqa import uuid from mitmproxy import connections from mitmproxy import controller, exceptions # noqa from mitmproxy import stateobject from mitmproxy import version class Error(stateobject.StateObject): """ An Error. This is distinct from an protocol error respon...
zlorb/mitmproxy
mitmproxy/flow.py
Python
mit
4,895
import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED class SessionTests: def test_basic_testitem_events(self, testdir): tfile = testdir.makepyfile(""" def test_one(): pass def test_one_one(): assert 0 def test_other(): ...
malinoff/pytest
testing/test_session.py
Python
mit
8,587
""" Lightweight schema migrations. NOTE: Currently tested with SQLite and Postgresql. MySQL may be missing some features. Example Usage ------------- Instantiate a migrator: # Postgres example: my_db = PostgresqlDatabase(...) migrator = PostgresqlMigrator(my_db) # SQLite example: my_db = Sqlite...
ghukill/peewee
playhouse/migrate.py
Python
mit
19,129
def mergeSort(x): if len(x) == 1: return x else: return merge(mergeSort(x[0:(len(x) // 2)]), mergeSort(x[(n // 2 + 1):len(x)])) def merge(l, r): res = [] while isSorted: i, j = 0, 0 if i < len(l): pass if l[i] <= j: res.append(l[i]) ...
chandps/CodingChallenges
intcake/Burger.py
Python
mit
396
import random def gen_bottle_cluster(): for i in range(10): yield random.randint(-5, 35) def log(print_arg): """totally fake logging function""" print(print_arg) #check to see how many bottles we've received in the cluster #raise ZeroDivisionError if we receive any value of zero or less then fak...
razzius/PyClassLessons
instructors/need-rework/5_control_statements_and_exceptions_hierarchy/beer_machine_algo.py
Python
mit
938
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
nwiizo/workspace_2017
ryu/example/wsgi.py
Python
mit
9,953
from panda3d.core import BamFile, NodePath, StringStream, decompressString import DNANode class DNASignBaseline(DNANode.DNANode): COMPONENT_CODE = 6 def __init__(self): DNANode.DNANode.__init__(self, '') self.data = '' def makeFromDGI(self, dgi): DNANode.DNANode.makeFromDGI(self, ...
Spiderlover/Toontown
toontown/dna/DNASignBaseline.py
Python
mit
962
""" Example sentences to test spaCy and its language models. >>> from spacy.lang.fr.examples import sentences >>> docs = nlp.pipe(sentences) """ sentences = [ "Apple cherche à acheter une start-up anglaise pour 1 milliard de dollars", "Les voitures autonomes déplacent la responsabilité de l'assurance vers le...
spacy-io/spaCy
spacy/lang/fr/examples.py
Python
mit
938
""" Implements sum_nth_power_deviations(x, n), which gives the sum of each value in x (from the mean) to the Nth power. """ from .mean import mean from .sum import sum # pylint: disable=redefined-builtin def sum_nth_power_deviations(x, n): """ The sum of the deviations of each value (from the mean) to the Nth...
sheriferson/simplestatistics
simplestatistics/statistics/sum_nth_power_deviations.py
Python
mit
1,115
# Script to find component (<c0x> level) elements that do not have ArchivesSpace-acceptable titles import lxml from lxml import etree import os from os.path import join # Enter the path to the folder containing your EADs path = 'path/to/EADs' # Check each file in the EAD folder for filename in os.listdir(path): ...
djpillen/migration-tools
ead/missingtitles.py
Python
cc0-1.0
1,019
# -*- coding: utf-8 -*- # ## This file is part of Invenio. ## Copyright (C) 2011, 2012, 2014 CERN. ## ## Invenio 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 you...
MSusik/invenio
invenio/modules/uploader/models.py
Python
gpl-2.0
1,789
# Generated by Django 1.9.6 on 2016-05-06 08:48 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('auth', '0007_alter_validators_add_error_messages'), ('appliances', '0030_merge'), ] operations = [ ...
nachandr/cfme_tests
sprout/appliances/migrations/0031_auto_20160506_0848.py
Python
gpl-2.0
1,841
#!/usr/bin/env python """ Copyright (c) 2008 Dustin Sallings <dustin@spy.net> """ import sys from twisted.internet import reactor from twittytwister import twitter def cb(answer): def f(x): print answer return f twitter.Twitter(sys.argv[1], sys.argv[2]).follow(sys.argv[3]).addCallback( cb("wo...
erikdejonge/newsrivr
libs/twitty-twister/example/follow.py
Python
gpl-2.0
412
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tasks.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
jryu/tasks
tasks/manage.py
Python
gpl-2.0
248
def SimpleSymbols(str): alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] temp = list(str) if temp[0] != "+" and temp[0] != "=": print "false" return for c in range(0, len(temp)): ...
ohgodscience/Python
Exercises/SimpleSymbols.py
Python
gpl-2.0
597
#! /usr/bin/python2 # # pactest : run automated testing on the pacman binary # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # # 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; ei...
alexchamberlain/pacman
test/pacman/pactest.py
Python
gpl-2.0
4,509
########################################################################### # # This program is part of Zenoss Core, an open source monitoring platform. # Copyright (C) 2007, Zenoss Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License versi...
zenoss/ZenPacks.community.CelerraFileSystem
ZenPacks/community/CelerraFileSystem/modeler/plugins/CelerraDf.py
Python
gpl-2.0
2,254
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 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 program is distribute...
SMALLplayer/smallplayer-image-creator
storage/.xbmc/addons/script.module.urlresolver/lib/urlresolver/plugins/sharefiles.py
Python
gpl-2.0
3,415
# Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 ...
thomasaarholt/hyperspy
hyperspy/tests/signals/test_eds_sem.py
Python
gpl-3.0
15,337
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
filipenf/ansible-modules-extras
system/cronvar.py
Python
gpl-3.0
14,068
# Copyright (c) 2012, 2015, 2017 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the fu...
vineodd/PIMSim
GEM5Simulation/gem5/src/mem/XBar.py
Python
gpl-3.0
8,231
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2014-2020) # # This file is part of GWpy. # # GWpy 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,...
areeda/gwpy
examples/timeseries/blrms.py
Python
gpl-3.0
2,644
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Applicant.last_name' db.delete_column('applications_applicant', 'last_name') # Deleting field 'Applicant.first_name' d...
monash-merc/karaage
karaage/legacy/applications/south_migrations/0021_auto__del_field_applicant_last_name__del_field_applicant_first_name__c.py
Python
gpl-3.0
16,208
# -*- coding: utf-8 -*- ##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne] ##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 versio...
CuonDeveloper/cuon
cuon_client/cuon/bin/cuon/Articles/SingleArticleParts.py
Python
gpl-3.0
2,032
# -*- coding: utf-8 -*- from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FreeWayMe(MultiHoster): __name__ = "FreeWayMe" __type__ = "hoster" __version__ = "0.20" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?free-way\.(bz|me)/.+' __config__...
joberreiter/pyload
module/plugins/hoster/FreeWayMe.py
Python
gpl-3.0
1,957
import robot.parsedemo as p; import sys if __name__ == '__main__': s = ''' # Jacobian and differential motion demonstration # # A differential motion can be represented by a 6-element vector with elements # [dx dy dz drx dry drz] # # where the first 3 elements are a differential translation, and the last 3 # a...
MediffRobotics/DeepRobotics
rpiRobotArm/InverseKine/robotics-toolbox-python1/trunk/robotics-toolbox-python/demo/jacobian.py
Python
gpl-3.0
5,243
''' Script to fix database after users have been given badges multiple times for the same course see: https://github.com/DigitalCampus/django-oppia/issues/316 ''' def run(): from django.db.models import Q, Count, Min from django.contrib.auth.models import User from oppia.models import Course, Award, AwardCourse ...
DigitalCampus/django-instrat-oppia
oppia/utils/db-hotfixes/issue-316-hotfix.py
Python
gpl-3.0
1,074
__all__ = ('AutocompleteList',) class AutocompleteList(object): limit_choices = 20 order_by = lambda cls, choice: unicode(choice).lower() def choices_for_values(self): values_choices = [] for choice in self.choices: if choice in self.values: values_choices.app...
hzlf/openbroadcast
website/tools/autocomplete_light/autocomplete/list.py
Python
gpl-3.0
865
""" Copyright 2013 Steven Diamond 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...
SteveDiamond/cvxpy
cvxpy/lin_ops/lin_constraints.py
Python
gpl-3.0
1,126
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (c) 2015 Odoo S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affe...
tvtsoft/odoo8
addons/delivery/models/__init__.py
Python
agpl-3.0
1,037
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
TheTimmy/spack
var/spack/repos/builtin/packages/proxymngr/package.py
Python
lgpl-2.1
2,074
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
EmreAtes/spack
var/spack/repos/builtin/packages/everytrace-example/package.py
Python
lgpl-2.1
1,786
# -*- coding: utf-8 -*- """Parser for the Microsoft File History ESE database.""" import logging from plaso.events import time_events from plaso.lib import eventdata from plaso.parsers import esedb from plaso.parsers.esedb_plugins import interface class FileHistoryNamespaceEventObject(time_events.FiletimeEvent): ...
ostree/plaso
plaso/parsers/esedb_plugins/file_history.py
Python
apache-2.0
3,959
# 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...
benoitsteiner/tensorflow-opencl
tensorflow/python/eager/custom_gradient.py
Python
apache-2.0
3,155
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
rcbops/horizon-buildpackage
horizon/tests/api_tests/glance.py
Python
apache-2.0
5,668
# # Autogenerated by Thrift Compiler (0.7.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * import fb303.FacebookService from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TPr...
BigData-Lab-Frankfurt/HiBench-DSE
common/hive-0.9.0-bin/lib/py/hive_metastore/ThriftHiveMetastore.py
Python
apache-2.0
459,937
#!/usr/bin/python2.7 # Copyright 2011 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 requi...
ivannaranjo/google-api-dotnet-client
ClientGenerator/src/googleapis/codegen/csharp_generator.py
Python
apache-2.0
11,507
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static from django.contrib import admin ### #FIXME admin.autodiscover() #from core import views as core_views #from topology import views as topology_views #from htcondor import views as htcondor_vi...
kiae-grid/panda-bigmon-core
core/api/htcondorapi/urls.py
Python
apache-2.0
1,615
#-*- coding:utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
kalrey/swift
test/unit/common/middleware/test_dlo.py
Python
apache-2.0
42,590
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from typing import Any, Callable, Optional, Sequence, TypeVar, Iterable, Tuple, Text from six import binary_type import base64 import errno import hashlib import heapq import itertools import os import sys from time import s...
sonali0901/zulip
zerver/lib/utils.py
Python
apache-2.0
7,190
# -*- coding: utf-8 -*- import botocore import httmock import inspect import io import json import moto import os import time import unittest.mock import zipfile from .. import base, mock_s3 from girder import events from girder.constants import AssetstoreType, ROOT_DIR from girder.models.assetstore import Assetstore ...
girder/girder
tests/cases/assetstore_test.py
Python
apache-2.0
42,886
# Copyright 2015 IBM Corp. # Copyright 2015, Hewlett-Packard Development Company, L.P. # # 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 # # Un...
xuweiliang/Codelibrary
openstack_dashboard/api/rest/config.py
Python
apache-2.0
2,060
# -*- coding: utf-8 -*- import uuid from django.utils import timezone from framework import bcrypt from framework.auth import signals from framework.auth.core import User, Auth from framework.auth.core import get_user, generate_verification_key from framework.auth.exceptions import DuplicateEmailError from framework....
monikagrabowska/osf.io
framework/auth/__init__.py
Python
apache-2.0
4,181
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-15 18:08 from __future__ import unicode_literals import logging from django.db import migrations from osf.models import PreprintProvider logger = logging.getLogger(__file__) PREPRINT_DOI_NAMESPACE = { 'ecsarxiv': '10.1149' } def add_doi_prefix(*...
erinspace/osf.io
osf/migrations/0113_auto_20180615_1308.py
Python
apache-2.0
1,302
"""Support to interact with Remember The Milk.""" import json import logging import os from rtmapi import Rtm, RtmRequestFailedException import voluptuous as vol from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_NAME, CONF_TOKEN, STATE_OK import homeassistant.helpers.config_validation as cv from homeassista...
leppa/home-assistant
homeassistant/components/remember_the_milk/__init__.py
Python
apache-2.0
12,661
from time import time from nose.tools import eq_, ok_ from selenium.webdriver import Firefox from tests.simple_page import SimplePage class TestCustomDriver(object): def setUp(self): self.driver = Firefox() self.driver.implicitly_wait(1) self.page = SimplePage(self.driver) self.pag...
DashkevichBy/Advisors.stratiFi.frontend
tests/simple_page/finds/test_custom_driver.py
Python
apache-2.0
1,027
#!/usr/bin/python # -*- coding: UTF-8 -*- # # Copyright 2011 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...
caioserra/apiAdwords
tests/adspygoogle/dfa/v1_18/network_service_unittest.py
Python
apache-2.0
4,817
# Copyright (c) 2012 Citrix Systems, 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 ...
viggates/nova
nova/api/openstack/compute/plugins/v3/aggregates.py
Python
apache-2.0
8,850
# 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 u...
DinoCow/airflow
tests/test_utils/perf/dags/sql_perf_dag.py
Python
apache-2.0
2,295
import re import urllib2 from urlparse import urlparse from django import forms from django.contrib.auth.models import User from django.core.files.base import ContentFile from django.core.files.storage import default_storage from django.core.validators import URLValidator from django.forms import ModelForm from django...
GeoODK/onadata
onadata/apps/main/forms.py
Python
bsd-2-clause
13,003
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individual...
weblabdeusto/weblabdeusto
server/src/weblab/core/coordinator/sql/externals/ilab_batch_scheduler.py
Python
bsd-2-clause
7,769
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'pyramid', 'pyramid_chameleon', 'pyramid_de...
OpenTreeOfLife/ottreeindex
setup.py
Python
bsd-2-clause
1,214
# -*- coding: utf-8 -*- # This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2014 and later, Alexander J G Pitchford # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # ...
anubhavvardhan/qutip
qutip/control/loadparams.py
Python
bsd-3-clause
8,908
# -*- coding: utf-8 -*- from django.db import models from sortedm2m.fields import SortedManyToManyField class Photo(models.Model): name = models.CharField(max_length=30) def __unicode__(self): return self.name class Gallery(models.Model): name = models.CharField(max_length=30) photos = Sort...
fabrique/django-sortedm2m
test_south_support/models.py
Python
bsd-3-clause
589
# Copyright 2015 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. from __future__ import print_function from __future__ import division from __future__ import absolute_import import json import unittest import webapp2 imp...
catapult-project/catapult
dashboard/dashboard/report_test.py
Python
bsd-3-clause
6,896
import pytest import sqlalchemy as sa from sqlalchemy_utils import get_fk_constraint_for_columns, has_index class TestHasIndex(object): @pytest.fixture def table(self, Base): class ArticleTranslation(Base): __tablename__ = 'article_translation' id = sa.Column(sa.Integer, prim...
konstantinoskostis/sqlalchemy-utils
tests/functions/test_has_index.py
Python
bsd-3-clause
4,700