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
""" Tests that the stem.version functions can handle the tor instance we're running with. """ import unittest import stem.prereq import stem.version import test.runner class TestVersion(unittest.TestCase): def test_get_system_tor_version(self): """ Basic verification checks for the get_system_tor_version(...
lokeshh/lokeshh-stem
test/integ/version.py
Python
lgpl-3.0
2,040
#!/usr/bin/env python3 # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in...
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/http/cookies.py
Python
lgpl-3.0
20,359
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, try_get, unified_strdate, ) class WatIE(InfoExtractor): _VALID_URL = r'(?:wat:|https?://(?:www\.)?wat\.tv/video/.*-)(?P<id>[...
rg3/youtube-dl
youtube_dl/extractor/wat.py
Python
unlicense
4,111
import os from collections import OrderedDict from dtest import CASSANDRA_VERSION_FROM_BUILD, Tester, debug from pycassa.pool import ConnectionPool from pycassa.columnfamily import ColumnFamily from tools.assertions import assert_all # Use static supercolumn data to reduce total test time and avoid driver issues co...
krummas/cassandra-dtest
upgrade_tests/upgrade_supercolumns_test.py
Python
apache-2.0
6,839
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
davidzchen/tensorflow
tensorflow/python/compiler/xla/xla.py
Python
apache-2.0
23,501
"""Renewable certificates storage.""" import datetime import os import re import time import configobj import OpenSSL import parsedatetime import pytz import pyrfc3339 from letsencrypt import constants from letsencrypt import le_util ALL_FOUR = ("cert", "privkey", "chain", "fullchain") def config_with_defaults(con...
tdfischer/lets-encrypt-preview
letsencrypt/storage.py
Python
apache-2.0
28,063
# 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...
mlperf/training_results_v0.7
NVIDIA/benchmarks/resnet/implementations/mxnet/symbols/resnet-v1b-dbar2-fl.py
Python
apache-2.0
28,857
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from include import IncludeManager from osf.models.base import BaseModel, ObjectIDMixin from osf.utils.workflows import RequestTypes from osf.models.mixins import NodeRequestableMixin, PreprintRequestableMixin class Abstrac...
erinspace/osf.io
osf/models/request.py
Python
apache-2.0
993
import os def createFSTab(rootPath, root, boot, swap): filename = os.path.join(rootPath, "etc", "fstab") with open(filename, "w") as f: f.write(_TEMPLATE % dict(root=root, boot=boot, swap=swap)) _TEMPLATE = """ LABEL=ROOT / ext4 defaults 1 1 LABEL=SWAP swap ...
shlomimatichin/inaugurator
inaugurator/fstab.py
Python
apache-2.0
424
"""Test suite for abdt_compositenaming.""" # ============================================================================= # TEST PLAN # ----------------------------------------------------------------------------- # Here we detail the things we are concerned to test and specify which ...
kjedruczyk/phabricator-tools
py/abd/abdt_compositenaming__t.py
Python
apache-2.0
3,813
# (c) Copyright 2014 Cisco 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 re...
shakamunyi/neutron-vrrp
neutron/api/v2/resource_helper.py
Python
apache-2.0
3,985
# Copyright 2015 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...
gunan/tensorflow
tensorflow/python/util/all_util.py
Python
apache-2.0
4,693
"""Test the Network UPS Tools (NUT) config flow.""" from unittest.mock import patch from homeassistant import config_entries, data_entry_flow, setup from homeassistant.components.nut.const import DOMAIN from homeassistant.const import CONF_RESOURCES, CONF_SCAN_INTERVAL from .util import _get_mock_pynutclient from t...
sander76/home-assistant
tests/components/nut/test_config_flow.py
Python
apache-2.0
11,140
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
krousey/test-infra
jenkins/check_projects.py
Python
apache-2.0
14,426
"""Config flow to configure esphome component.""" from __future__ import annotations from collections import OrderedDict from typing import Any from aioesphomeapi import ( APIClient, APIConnectionError, DeviceInfo, InvalidAuthAPIError, InvalidEncryptionKeyAPIError, RequiresEncryptionAPIError, ...
mezz64/home-assistant
homeassistant/components/esphome/config_flow.py
Python
apache-2.0
11,138
input = """ 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 1 10 7 6 11 12 13 14 15 16 17 1 11 7 6 10 12 13 14 15 16 17 1 12 7 6 10 11 13 14 15 16 17 1 13 7 6 10 11 12 14 15 16 17 1 14 7 6 10 11 12 13 15 16 17 1 15 7 6 10 11 12 13 14 16 17 1 16 7 6 10 11 12 13 14 15 17 1 17 0 0 1 18 7 6 19 20 21 22 23 2...
Yarrick13/hwasp
tests/asp/AllAnswerSets/tight/7-queens.asp.test.py
Python
apache-2.0
11,082
import re import zlib import string from django.db import models from django.utils.translation import ugettext_lazy as _, pgettext_lazy from django.core import exceptions from oscar.core.compat import AUTH_USER_MODEL from oscar.models.fields import UppercaseCharField, PhoneNumberField class AbstractAddress(models.M...
Giftingnation/GN-Oscar-Custom
oscar/apps/address/abstract_models.py
Python
bsd-3-clause
19,189
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
eunchong/build
third_party/buildbot_8_4p1/buildbot/db/connector.py
Python
bsd-3-clause
2,805
# -*- coding: utf-8 -*- from __future__ import absolute_import import json from datetime import timedelta from django.core.urlresolvers import reverse from django.utils import timezone from exam import fixture from sentry.models import GroupSeen, Group from sentry.testutils import TestCase class GroupDetailsTest(...
jokey2k/sentry
tests/sentry/web/frontend/groups/tests.py
Python
bsd-3-clause
6,622
import os import threading import time import traceback FATAL = 100 ALERT = 200 ERROR = 300 WARNING = 400 INFO = 500 TRACE = 600 DEBUG = 700 __outputSections = ["*"] __outputLevel = TRACE __logs = [] __logCurrentDate = None __includeThreadName = False def addOutputSection(sectionName): __outputSections.append(se...
ijzer/cwbot-ndy
kol/util/Report.py
Python
bsd-3-clause
3,787
import datetime import md5 import os import pickle import socket import unittest import warnings import testlib from testlib import testutil, SkipTest, PygrTestProgram from pygr import seqdb, cnestedlist, mapping from pygr.downloader import SourceURL, GenericBuilder warnings.simplefilter("ignore") import pygr.Data w...
cjlee112/pygr
tests/pygrdata_test.py
Python
bsd-3-clause
13,488
from abc import ABCMeta, abstractmethod import zmq from six import add_metaclass from fuel.iterator import DataIterator from fuel.server import recv_arrays @add_metaclass(ABCMeta) class AbstractDataStream(object): """A stream of data separated into epochs. A data stream is an iterable stream of examples/mi...
nke001/attention-lvcsr
libs/fuel/fuel/streams.py
Python
mit
6,858
# -*- coding: utf-8 -*- # Copyright (c) 2011-2014 - Simon Conseil # 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...
jdn06/sigal
sigal/utils.py
Python
mit
4,076
# -*- coding: utf-8 -*- # Copyright (C) 2010 Holoscopio Tecnologia # Author: Marcelo Jorge Vieira <metal@holoscopio.com> # Author: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
offlinehacker-playground/sltv
sltv/input/fileinput.py
Python
gpl-2.0
1,834
#!/usr/bin/python # -*- coding: utf-8 -*- """ ================================================================================ mingus - Music theory Python package, container exceptions Copyright (C) 2008-2009, Bart Spaans This program is free software: you can redistribute it and/or modify it under ...
artdent/mingus-python3
mingus/containers/mt_exceptions.py
Python
gpl-3.0
1,170
"""Test class for Domain CLI :Requirement: Domain :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: Hosts :Assignee: tstrych :TestType: Functional :CaseImportance: High :Upstream: No """ import pytest from fauxfactory import gen_string from robottelo.cli.base import CLIReturnCodeError from rob...
rplevka/robottelo
tests/foreman/cli/test_domain.py
Python
gpl-3.0
8,204
"""Tests of comprehensive theming.""" from django.conf import settings from django.contrib import staticfiles from django.test import TestCase from path import path # pylint: disable=no-name-in-module import edxmako from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme from openedx.cor...
lduarte1991/edx-platform
lms/djangoapps/courseware/tests/test_comprehensive_theming.py
Python
agpl-3.0
3,386
""" Tests for course dates fragment. """ from datetime import timedelta, datetime from django.core.urlresolvers import reverse from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore....
lduarte1991/edx-platform
openedx/features/course_experience/tests/views/test_course_dates.py
Python
agpl-3.0
1,610
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RDeseq(RPackage): """Differential gene expression analysis based on the negative binomial ...
LLNL/spack
var/spack/repos/builtin/packages/r-deseq/package.py
Python
lgpl-2.1
1,546
############################################################################## # 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/rstart/package.py
Python
lgpl-2.1
1,935
# -*- encoding: utf-8 -*- # pilas engine: un motor para hacer videojuegos # # Copyright 2010-2014 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar from pilasengine import habilidades class EliminarseSiSaleDePantalla(habilidades.Habilidad): ...
fsalamero/pilas
pilasengine/habilidades/eliminarse_si_sale_de_pantalla.py
Python
lgpl-3.0
1,336
# 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...
lukecwik/incubator-beam
learning/katas/python/IO/TextIO/ReadFromText/task.py
Python
apache-2.0
1,034
"""Managers of Zinnia""" from django.db import models from django.utils import timezone from django.contrib.sites.models import Site DRAFT = 0 HIDDEN = 1 PUBLISHED = 2 def tags_published(): """ Return the published tags. """ from tagging.models import Tag from zinnia.models.entry import Entry ...
pczhaoyun/obtainfo
zinnia/managers.py
Python
apache-2.0
3,068
# # 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 # ...
dims/heat
heat/engine/resources/openstack/heat/ha_restarter.py
Python
apache-2.0
3,608
# coding: utf-8 """ Copyright 2015 SmartBear Software 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...
eshijia/magnum
magnum/common/pythonk8sclient/swagger_client/models/v1_pod_condition.py
Python
apache-2.0
3,582
from restclients.models.r25 import Space from restclients.r25 import nsmap, get_resource from urllib import urlencode def get_space_by_id(space_id): url = "/r25ws/servlet/wrd/run/space.xml?space_id=%s" % space_id return spaces_from_xml(get_resource(url))[0] def get_spaces(**kwargs): """ Return a lis...
jeffFranklin/uw-restclients
restclients/r25/spaces.py
Python
apache-2.0
1,468
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licen...
StefanoRaggi/Lean
Algorithm.Python/LimitFillRegressionAlgorithm.py
Python
apache-2.0
2,191
# Copyright 2022 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...
tensorflow/tensorflow
tensorflow/python/util/compat_test.py
Python
apache-2.0
1,249
import sys sys.path.insert(1, "../../../") import h2o, tests import pandas as pd import zipfile import statsmodels.api as sm def link_functions_poisson(): print("Read in prostate data.") h2o_data = h2o.import_file(path=h2o.locate("smalldata/prostate/prostate_complete.csv.zip")) sm_data = pd.rea...
brightchen/h2o-3
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_poissonGLM.py
Python
apache-2.0
2,254
import unittest from streamlink.plugins.webcast_india_gov import WebcastIndiaGov class TestPluginWebcastIndiaGov(unittest.TestCase): def test_can_handle_url(self): # should match self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/ddpunjabi/")) self.assertTrue(W...
javiercantero/streamlink
tests/test_webcast_india_gov.py
Python
bsd-2-clause
765
from datetime import datetime from recurrence import Recurrence, Rule import recurrence def test_exclusion_date(): rule = Rule( recurrence.DAILY ) pattern = Recurrence( dtstart=datetime(2014, 1, 2, 0, 0, 0), dtend=datetime(2014, 1, 4, 0, 0, 0), rrules=[rule], exdat...
Nikola-K/django-recurrence
tests/test_exclusions.py
Python
bsd-3-clause
1,680
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import shutil import requests from splash.tests.utils import TestServers, SplashServer from splash.tests.test_render import BaseRenderTest class BaseFiltersTest(BaseRenderTest): def assertFiltersWork(self, resp, noscript, noscript2): ...
kod3r/splash
splash/tests/test_request_filters.py
Python
bsd-3-clause
4,914
from __future__ import absolute_import input_name = '../examples/linear_elasticity/elastic_contact_sphere.py' output_name = 'test_elastic_contact_sphere.vtk' from tests_basic import TestInput class Test(TestInput): pass
rc/sfepy
tests/test_input_elastic_contact_sphere.py
Python
bsd-3-clause
225
# -*- coding: utf-8 -*- """ Unit tests for reverse URL lookups. """ from __future__ import unicode_literals import sys import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.conf.urls import include from django.contrib.auth.models import User from django.core...
memtoko/django
tests/urlpatterns_reverse/tests.py
Python
bsd-3-clause
38,465
from kivy.lang import Builder from kivy.app import App from kivy.network.urlrequest import UrlRequest from kivy.properties import NumericProperty, StringProperty, DictProperty import json KV = ''' #:import json json #:import C kivy.utils.get_color_from_hex BoxLayout: orientation: 'vertical' Label: t...
rnixx/kivy
examples/miscellaneous/urlrequest.py
Python
mit
3,337
"""In this series of tests, we are looking at time to load a large number of very small and simple rows. A special test here illustrates the difference between fetching the rows from the raw DBAPI and throwing them away, vs. assembling each row into a completely basic Python object and appending to a list. The time sp...
zzzeek/sqlalchemy
examples/performance/large_resultsets.py
Python
mit
5,505
# Check that a string does not contain unnecessary Pango markup # # Copyright (C) 2015 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 Lesser General Public License v.2, or (at your option) any l...
jkonecny12/anaconda
translation-canary/translation_canary/translatable/test_markup.py
Python
gpl-2.0
1,817
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 t...
NikolaYolov/invenio_backup
modules/bibedit/lib/refextract.py
Python
gpl-2.0
312,176
#a = 1 # [int] #a = 1 # [int] b = 1 # [int] a = 'hoi' # [str] print a # [int, str] print b # [int]
shedskin/shedskin
tests/33.py
Python
gpl-3.0
304
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import json import sys from nose.plugins.skip import SkipTest i...
kbrebanov/ansible
test/units/modules/network/f5/test_bigip_virtual_address.py
Python
gpl-3.0
7,335
# -*- coding: utf-8 -*- ############################################################################## # # This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
NL66278/stock-logistics-warehouse
__unported__/stock_available_sale/product.py
Python
agpl-3.0
10,213
from collections import OrderedDict from itertools import chain from operator import attrgetter from django.db import IntegrityError, connections, transaction from django.db.models import signals, sql from django.utils import six class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): ...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/django/db/models/deletion.py
Python
agpl-3.0
13,771
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Cosbench(Package): """ COSBench is a benchmarking tool to measure the performance of ...
LLNL/spack
var/spack/repos/builtin/packages/cosbench/package.py
Python
lgpl-2.1
1,187
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libepoxy(AutotoolsPackage): """Epoxy is a library for handling OpenGL function pointer man...
LLNL/spack
var/spack/repos/builtin/packages/libepoxy/package.py
Python
lgpl-2.1
1,409
# -*- coding: utf-8 -*- ''' Created on Mar 12, 2012 @author: moloch Copyright 2012 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...
Richard-West/RootTheBox
models/BaseModels.py
Python
apache-2.0
1,496
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Tests for ``admin.packaging``. """ from glob import glob from subprocess import check_output from textwrap import dedent from unittest import skipIf from StringIO import StringIO from twisted.python.filepath import FilePath from twisted.python.procutil...
AndyHuu/flocker
admin/test/test_packaging.py
Python
apache-2.0
53,798
# -*- coding: utf-8 -*- # # 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 ...
ronfung/incubator-airflow
airflow/contrib/hooks/bigquery_hook.py
Python
apache-2.0
39,980
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import math import os import sys import errno import re import shutil import tempfile import codecs import atexit import weakref import warnings import numpy as np import matplotlib as mpl from ma...
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/matplotlib/backends/backend_pgf.py
Python
apache-2.0
37,335
# 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...
tensorflow/tensorflow
tensorflow/python/distribute/v1/all_reduce_test.py
Python
apache-2.0
10,503
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework 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 ...
alexandrul-ci/robotframework
src/robot/writer/filewriters.py
Python
apache-2.0
5,215
from django.test import TestCase from oscar.apps.dashboard.ranges import forms from oscar.test.factories import create_product from oscar.apps.offer.models import Range class RangeProductFormTests(TestCase): def setUp(self): self.range = Range.objects.create(name='dummy') def tearDown(self): ...
Giftingnation/GN-Oscar-Custom
tests/functional/dashboard/range_tests.py
Python
bsd-3-clause
2,118
# -*- coding: utf-8 -*- from boltons.tableutils import Table def test_table_lists(): data_lists = [['id', 'name'], [1, 'John Doe'], [2, 'Dale Simmons']] t1 = Table(data_lists) assert set(t1.headers) == set(['id', 'name']) assert len(t1) == 2 assert 'John Doe' i...
neuropil/boltons
tests/test_tableutils.py
Python
bsd-3-clause
1,475
#!/usr/bin/env python # scripted demo for https://asciinema.org/ # to use: # 1. create virtualenv with autobahn, ansicolors and asciinema installed: # pip install autobahn asciinema ansicolors # 2. change to root of fresh AutobahnPython checkout # 3. a) to record and upload, run: # # asciinema -c ./examples/asci...
ttimon7/AutobahnPython
examples/asciinema-autobahn-demo.py
Python
mit
2,651
from BaseController import BaseController import tornado.ioloop import tornado.web import dateutil.parser from datetime import datetime, timedelta class CommandsController(BaseController): def get(self): """Serves a GET request. """ return_data = dict(data=[], timestamp=datetime.now().iso...
udomsak/RedisLive
src/api/controller/CommandsController.py
Python
mit
1,787
#!/usr/bin/env python # ****************************************************** # Copyright 2004: Commonwealth of Australia. # # Developed by the Computer Network Vulnerability Team, # Information Security Group. # Department of Defence. # # David Collett <daveco@users.sourceforge.net> # # ******************************...
naototty/pyflag
src/pyflag/LogFile.py
Python
gpl-2.0
17,118
# # This library is free software, distributed under the terms of # the GNU Lesser General Public License Version 2. # See the COPYING file included in this archive # # The docstrings in this module contain epytext markup; API documentation # may be created by processing this file with epydoc: http://epydoc.sf.net """...
anarchivist/pyflag
src/plugins/NetworkForensics/ProtocolHandlers/mms/iterator.py
Python
gpl-2.0
2,509
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright (C) 2010 Jonathan Matthew # # 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, or (at your ...
mssurajkaiga/rhythmbox
plugins/replaygain/replaygain.py
Python
gpl-2.0
1,840
# -*- coding: utf-8 -*- # Natural Language Toolkit: ASCII visualization of NLTK trees # # Copyright (C) 2001-2015 NLTK Project # Author: Andreas van Cranenburgh <A.W.vanCranenburgh@uva.nl> # Peter Ljunglöf <peter.ljunglof@gu.se> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Pretty-pr...
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/nltk/treeprettyprinter.py
Python
gpl-2.0
24,441
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import import difflib import logging from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db.models import Q from django.db import transaction from django.shortcuts impor...
thomastu/django-wiki
wiki/views/article.py
Python
gpl-3.0
33,585
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2013 Acysos S.L. (http://acysos.com) # Ignacio Ibeas Izquierdo <ignacio@acysos.com> # # This program is free software: you can redistribute it and/or modify # it under ...
topecz/l10n-spain
l10n_es_aeat_mod340/models/account.py
Python
agpl-3.0
1,348
# -*- coding: utf-8 -*- # © 2015 Ainara Galdona - AvanzOSC # © 2015 Oihane Crucelaegui - AvanzOSC # © 2015 Esther Martín <esthermartin@avanzosc.es> - Avanzosc S.L. # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, models, fields class StockPicking(models.Model): _inherit =...
ddico/sale-workflow
sale_comment_propagation/models/stock.py
Python
agpl-3.0
2,817
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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.o...
vseledkin/neon
neon/backends/backend.py
Python
apache-2.0
70,703
#!/usr/bin/env python '''Generate a KML document of a tour based on rotating around locations. ''' from pykml.factory import nsmap from pykml.factory import KML_ElementMaker as KML from pykml.factory import GX_ElementMaker as GX from pykml.parser import Schema from lxml import etree # define a variable for the Google...
m12i/pykml
src/examples/Tours/circle_around_landmarks.py
Python
bsd-3-clause
5,777
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercise 11.3 from Kane 1985.""" from __future__ import division from sympy import Matrix, symbols from sympy.physics.mechanics import ReferenceFrame, Point R_SQ, R_QE, R_EM, R_Ee, R_Mm = symbols('R_SQ R_QE R_EM R_Ee R_Mm', positive=True) omega_E, omega_M, omega_e, om...
Shekharrajak/pydy
examples/Kane1985/Chapter6/Ex11.3.py
Python
bsd-3-clause
3,379
from __future__ import absolute_import, unicode_literals import re import unicodedata from django.apps import apps from django.conf import settings from django.db.models import Model from django.utils.encoding import force_text from django.utils.six import string_types from django.utils.text import slugify WAGTAIL_...
chrxr/wagtail
wagtail/wagtailcore/utils.py
Python
bsd-3-clause
3,727
# Copyright 2013 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. """Generates test runner factory and tests for instrumentation tests.""" import logging import os from devil.android import device_utils from pylib import ...
hujiajie/chromium-crosswalk
build/android/pylib/instrumentation/setup.py
Python
bsd-3-clause
4,036
""" Test std::weak_ptr functionality with a decl from debug info as content. """ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestDbgInfoContentWeakPtr(TestBase): mydir = TestBase.compute_mydir(__file__) @add_test_categories(["libc++...
endlessm/chromium-browser
third_party/llvm/lldb/test/API/commands/expression/import-std-module/weak_ptr-dbg-info-content/TestDbgInfoContentWeakPtrFromStdModule.py
Python
bsd-3-clause
995
# # The Python Imaging Library. # $Id$ # # Binary input/output support routines. # # Copyright (c) 1997-2003 by Secret Labs AB # Copyright (c) 1995-2003 by Fredrik Lundh # Copyright (c) 2012 by Brian Crowell # # See the README file for information on usage and redistribution. # if bytes is str: def i8(c): ...
havard024/prego
venv/lib/python2.7/site-packages/PIL/_binary.py
Python
mit
1,488
# ----------------------------------------------------------------------- # Copyright (C) 2010 Equinox Software, Inc. # Bill Erickson <berick@esilibrary.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 Softwa...
JuliaLima/Evergreen
Open-ILS/src/python/oils/srfsh.py
Python
gpl-2.0
3,866
#!/bin/env python import os from distutils.core import setup, Extension if hasattr(os, 'uname'): OSNAME = os.uname()[0] else: OSNAME = 'Windows' define_macros = [] libraries = [] extra_link_args = [] extra_compile_args = ['-I../../../'] sources = ['rtaudiomodule.cpp', '../../../RtAudio.cpp'] if OSNAME == ...
Define-break-continue/raspoznavayka
src/lib/rtaudio-4.1.2/contrib/python/pyrtaudio/setup.py
Python
gpl-3.0
1,601
from thunder.extraction.block.base import BlockMerger from thunder.extraction.source import SourceModel class BasicBlockMerger(BlockMerger): """ Simple merger that combines sources directly without any merging or modification """ def __init__(self, **extra): pass def merge(self, block...
oliverhuangchao/thunder
thunder/extraction/block/mergers.py
Python
apache-2.0
3,937
# Copyright (c) 2013 Mirantis 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 to in writ...
ekasitk/sahara
sahara/swift/swift_helper.py
Python
apache-2.0
2,070
from django import forms from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import ugettext as _ from django.conf import settings from django.contrib.auth.models import User, SiteProfileNotAvailable fro...
tectronics/django-profile
userprofile/forms.py
Python
bsd-2-clause
5,911
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercise 9.13 from Kane 1985.""" from __future__ import division from sympy import expand, symbols from sympy.physics.mechanics import ReferenceFrame, Point from sympy.physics.mechanics import dynamicsymbols from util import msprint, partial_velocities from util import ...
nouiz/pydy
examples/Kane1985/Chapter5/Ex9.13.py
Python
bsd-3-clause
2,054
"""Module containing a preprocessor that converts outputs in the notebook from one format to another. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license ...
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/IPython/nbconvert/preprocessors/svg2pdf.py
Python
bsd-3-clause
3,527
# Copyright 2016 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 agreed to in writing,...
catapult-project/catapult
third_party/gae_ts_mon/gae_ts_mon/protobuf/google/auth/credentials.py
Python
bsd-3-clause
9,121
#!/usr/bin/env vpython # Copyright (c) 2013 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. import os import unittest import shutil import sys import tempfile SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARENT_...
chromium/chromium
native_client_sdk/src/tools/tests/create_html_test.py
Python
bsd-3-clause
1,722
#!/usr/bin/env /usr/bin/python # # Copyright 2004,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...
GREO/GNU-Radio
gr-atsc/src/python/interp.py
Python
gpl-3.0
2,088
# Copyright 2015 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...
memo/tensorflow
tensorflow/contrib/layers/python/layers/feature_column.py
Python
apache-2.0
104,596
import re import logging from collections import defaultdict from archinfo import all_arches from ..analysis import Analysis l = logging.getLogger("angr.analyses.boyscout") class BoyScout(Analysis): ''' Try to determine the architecture and endieness of a binary blob ''' def __init__(self, cookiesiz...
GuardianRG/angr
angr/analyses/boyscout.py
Python
bsd-2-clause
2,060
# Copyright 2014 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. import random import time import mojo_unittest # pylint: disable=E0611 import mojo_system as system DATA_SIZE = 1024 def _GetRandomBuffer(size): rando...
takaaptech/sky_engine
mojo/python/tests/system_unittest.py
Python
bsd-3-clause
13,152
# import run_examples # def test(*args, **kwargs): # run_examples.test_everything()
vlas-sokolov/pyspeckit
examples/__init__.py
Python
mit
88
# This file is part of the PySide project. # # Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). # Copyright (C) 2010 Riverbank Computing Limited. # # Contact: PySide team <pyside@openbossa.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Gene...
Southpaw-TACTIC/Team
src/python/Lib/site-packages/pysideuic/port_v2/as_string.py
Python
epl-1.0
1,307
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/socket.py
Python
gpl-2.0
27,363
# # Dr. D Studios # --------------------------------------------------- class Greeter(object): """ A greeter """ def __init__(self): pass def greet(self, who="World"): """ Greet the entity identified by who. :param who: the entity to greet ...
xxxIsaacPeralxxx/anim-studio-tools
miki/tests/unit/fixtures/test_project/sources/python/hello_world_2/greeter.py
Python
gpl-3.0
1,178
#!/usr/bin/python2.4 # # Copyright 2008 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...
angel511wong/nixysa
nixysa/npapi_utils.py
Python
apache-2.0
4,814
from website.addons.base.serializer import StorageAddonSerializer from website.util import api_url_for from box.client import BoxClient, BoxClientException class BoxSerializer(StorageAddonSerializer): addon_short_name = 'box' def credentials_are_valid(self, user_settings, client): from website.addo...
rdhyee/osf.io
website/addons/box/serializer.py
Python
apache-2.0
1,625
from __future__ import unicode_literals import django from django import forms from django.conf import settings from guardian.compat import url, patterns from django.contrib import admin from django.contrib import messages from django.contrib.admin.widgets import FilteredSelectMultiple from django.core.urlresolvers im...
vovanbo/django-guardian
guardian/admin.py
Python
bsd-2-clause
17,283
# Copyright (C) 2012-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 the hope that it will...
atodorov/dnf
tests/test_reinstall.py
Python
gpl-2.0
7,089
# # Analysis Config dialog # # Authors: # Justin Engler # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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 th...
mfazliazran/raft
dialogs/AnalysisConfigDialog.py
Python
gpl-3.0
6,973