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 |
|---|---|---|---|---|---|
try:
from django.utils.encoding import force_text # noqa
except ImportError:
from django.utils.encoding import force_unicode as force_text # noqa
try:
from urllib2 import urlopen # noqa
except ImportError:
from urllib.request import urlopen # noqa
| blueyed/pytest_django | tests/compat.py | Python | bsd-3-clause | 270 |
r"""
Modeling and inversion of temperature residuals measured in wells due to
temperature perturbations in the surface.
Perturbations can be of two kinds: **abrupt** or **linear**.
Forward modeling of these types of changes is done with functions:
* :func:`~fatiando.geothermal.climsig.abrupt`
* :func:`~fatiando.geot... | eusoubrasileiro/fatiando_seismic | fatiando/geothermal/climsig.py | Python | bsd-3-clause | 7,793 |
from paths import rpath,mpath,opath
from make_apex_cubes import all_apexfiles,get_source_tel_line,_is_sci, hdr_to_freq
from pyspeckit.spectrum.readers import read_class
from astropy.table import Table
from astropy import log
from astropy.utils.console import ProgressBar
import numpy as np
import os
import pylab as pl
... | adamginsburg/APEX_CMZ_H2CO | observing/noise_stats.py | Python | bsd-3-clause | 2,860 |
from .pandas_vb_common import *
class SetOperations(object):
goal_time = 0.2
def setup(self):
self.rng = date_range('1/1/2000', periods=10000, freq='T')
self.rng2 = self.rng[:(-1)]
# object index with datetime values
if (self.rng.dtype == object):
self.idx_rng = s... | jmmease/pandas | asv_bench/benchmarks/index_object.py | Python | bsd-3-clause | 5,886 |
import numpy as np
import pandas as pd
import pytest
from dask.dataframe.hashing import hash_pandas_object
from dask.dataframe.utils import assert_eq
@pytest.mark.parametrize('obj', [
pd.Series([1, 2, 3]),
pd.Series([1.0, 1.5, 3.2]),
pd.Series([1.0, 1.5, 3.2], index=[1.5, 1.1, 3.3]),
pd.Series(['a',... | chrisbarber/dask | dask/dataframe/tests/test_hashing.py | Python | bsd-3-clause | 899 |
#! /usr/bin/python
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# gen_overlay_widgets.py:
# Code generation for overlay widgets. Should be run when the widgets declaration file,
# overlay_widg... | endlessm/chromium-browser | third_party/angle/src/libANGLE/gen_overlay_widgets.py | Python | bsd-3-clause | 11,216 |
import json
from unittest.mock import patch
from federation.hostmeta.parsers import (
parse_nodeinfo_document, parse_nodeinfo2_document, parse_statisticsjson_document, int_or_none,
parse_mastodon_document, parse_matrix_document)
from federation.tests.fixtures.hostmeta import (
NODEINFO2_10_DOC, NODEINFO_10... | jaywink/federation | federation/tests/hostmeta/test_parsers.py | Python | bsd-3-clause | 14,602 |
try:
import urlparse
except ImportError:
#py3k
from urllib import parse as urlparse
import json
from .firebase_token_generator import FirebaseTokenGenerator
from .decorators import http_connection
from .multiprocess_pool import process_pool
from .jsonutil import JSONEncoder
__all__ = ['FirebaseAuthentic... | neversun/sailfish-hackernews | pyPackages/python_firebase-noarch/firebase/firebase.py | Python | mit | 16,320 |
# -*- coding: utf-8 -*-
from django.forms import fields
from django.forms import widgets
from djng.forms import field_mixins
from . import widgets as bs3widgets
class BooleanFieldMixin(field_mixins.BooleanFieldMixin):
def get_converted_widget(self):
assert(isinstance(self, fields.BooleanField))
if... | dpetzold/django-angular | djng/styling/bootstrap3/field_mixins.py | Python | mit | 1,771 |
from democracy.enums import InitialSectionType
INITIAL_SECTION_TYPE_DATA = [
{
'identifier': InitialSectionType.MAIN,
'name_singular': 'pääosio',
'name_plural': 'pääosiot',
},
{
'identifier': InitialSectionType.CLOSURE_INFO,
'name_singular': 'sulkeutumistiedote',
... | City-of-Helsinki/kerrokantasi | democracy/models/initial_data.py | Python | mit | 860 |
#!/usr/bin/env python
import sys, os, os.path, signal
import jsshellhelper
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
# Uses jsshell https://developer.mozilla.org/en/Introduction_to_the_JavaScript_shell
class Packer(object):
toolsdir = os.path.dirname(os.path.abspath(__file__))
... | edsfault/Edsfault-processing.js | tools/packer.py | Python | mit | 1,163 |
# Python test set -- part 6, built-in types
from test_support import *
print '6. Built-in types'
print '6.1 Truth value testing'
if None: raise TestFailed, 'None is true instead of false'
if 0: raise TestFailed, '0 is true instead of false'
if 0L: raise TestFailed, '0L is true instead of false'
if 0.0: raise TestFai... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.2/Lib/test/test_types.py | Python | mit | 14,942 |
import pytest
from mitmproxy.test import taddons
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy.addons import save
from mitmproxy.addons import view
def test_configure(tmpdir):
sa = save.Save()
with taddons.context(sa) as tctx:
with pytest.r... | Kriechi/mitmproxy | test/mitmproxy/addons/test_save.py | Python | mit | 3,060 |
from __future__ import absolute_import
from __future__ import print_function
import sys, os, yaml, glob
import subprocess
import pandas as pd
import re
import shutil
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from nougat import common, align
from itertools import groupby
from collections im... | senthil10/NouGAT | nougat/evaluete.py | Python | mit | 18,678 |
"""
Django settings for huts project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
im... | nikolaystanishev/hut | huts/settings.py | Python | mit | 4,118 |
# Copyright (c) 2013 Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
"""
.. module:: decorators
:platform: Unix, Windows
:synopsis: Decorators for SublimePython plugin
.. moduleauthor:: Oscar Campos <oscar.campos@member.fsf.org>
"""
import os
import functools
def debug(f):
... | leonth/private-configs | sublime-text-3/Packages/SublimePythonIDE/server/decorators.py | Python | mit | 598 |
import unittest
from programy.processors.post.denormalize import DenormalizePostProcessor
from programy.bot import Bot
from programy.brain import Brain
from programy.config.brain import BrainConfiguration
from programy.config.bot import BotConfiguration
class DenormalizeTests(unittest.TestCase):
def setUp(self):... | dkamotsky/program-y | src/test/processors/post/test_denormalize.py | Python | mit | 851 |
# Generated by Django 2.2.15 on 2020-11-24 06:44
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("assignments", "0015_assignmentvote_delegated_user"),
]
operations = [
migrations... | FinnStutzenstein/OpenSlides | server/openslides/assignments/migrations/0016_negative_votes.py | Python | mit | 2,395 |
import frappe
from frappe.utils import cstr
def execute():
# Update Social Logins in User
run_patch()
# Create Social Login Key(s) from Social Login Keys
frappe.reload_doc("integrations", "doctype", "social_login_key", force=True)
if not frappe.db.exists('DocType', 'Social Login Keys'):
return
social_login_... | frappe/frappe | frappe/patches/v10_0/refactor_social_login_keys.py | Python | mit | 4,935 |
from .extensions import db, resizer
class Upload(db.Model):
__tablename__ = 'upload'
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
name = db.Column(db.Unicode(255), nullable=False)
url = db.Column(db.Unicode(255), nullable=False)
if resizer:
for size in resizer.sizes.iterkeys(... | FelixLoether/flask-uploads | flask_uploads/models.py | Python | mit | 458 |
# coding: utf8
# OeQ autogenerated lookup function for 'Non Residential Building Base U-Value of Buildings in correlation to year of construction, based on GEMOD
import math
import numpy as np
import oeqLookuptable as oeq
def get(*xin):
l_lookup = oeq.lookuptable(
[0,1.2,
1849,1.2,
1850,1.2,
1851,1.2,
1852,1.2,
... | UdK-VPT/Open_eQuarter | mole/stat_corr/nrb_contemporary_base_uvalue_by_building_age_lookup.py | Python | gpl-2.0 | 2,378 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
FileSelectionPanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | alexbruy/QGIS | python/plugins/processing/gui/FileSelectionPanel.py | Python | gpl-2.0 | 3,127 |
#!/usr/bin/env python
# -*- noplot -*-
"""
N Classic Base renderer Ext renderer
20 0.22 0.14 0.14
100 0.16 0.14 0.13
1000 0.45 0.26 0.17
10000 3.30 1.31 0.53
50000 19.30 6.53 1.98
""... | ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/lib/mpl_examples/pylab_examples/scatter_profile.py | Python | gpl-2.0 | 556 |
#!/bin/env python
""" Showing last hour history of FTS transfers. """
import sys
import DIRAC
from DIRAC import gLogger, gConfig, S_OK
from DIRAC.Core.Base import Script
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.ConfigurationSystem.Client import PathFinder
__RCSID__ = "$Id$"
colors = { "yellow" : ... | sposs/DIRAC | DataManagementSystem/scripts/dirac-dms-show-fts-status.py | Python | gpl-3.0 | 5,027 |
from couchpotato import get_session
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import simplifyString, toUnicode
from couchpotato.core.helpers.request import jsonified, getParam
from couchpotato.core.helpers.variabl... | mozvip/CouchPotatoServer | couchpotato/core/plugins/searcher/main.py | Python | gpl-3.0 | 25,667 |
'''
SASSIE Copyright (C) 2011 Joseph E. Curtis
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it under certain
conditions; see http://www.gnu.org/licenses/gpl-3.0.html for details.
'''
# System imports
from distutils.core import *
from distut... | StevenCHowell/zazmol | src/python/extensions/matrix_math/setup_matrix_multiply.py | Python | gpl-3.0 | 1,074 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from PIL import Image
from treemap.images import save_uploaded_image
from treemap.tests import LocalMediaTestCase, media_dir
class SaveImageTest(LocalMediaTestCase):
@media_dir
... | ctaylo37/OTM2 | opentreemap/treemap/tests/test_images.py | Python | gpl-3.0 | 735 |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | QuantumElephant/horton | horton/io/test/test_wfn.py | Python | gpl-3.0 | 19,258 |
def is_perfect_number(n):
sum = 0
for x in range(1, n):
if n % x == 0:
sum += x
return sum == n
num = int(input("Please enter a number to check if it is perfect or not"))
print(is_perfect_number(num))
| OpenGenus/cosmos | code/mathematical_algorithms/src/perfect_number/perfect_number.py | Python | gpl-3.0 | 235 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | habibmasuro/django-wiki | wiki/migrations/0009_auto__add_field_imagerevision_width__add_field_imagerevision_height.py | Python | gpl-3.0 | 18,186 |
PROJECT_DEFAULTS = 'Project Defaults'
PATHS = 'Paths'
_from_config = {
'author': None,
'email': None,
'license': None,
'language': None,
'type': None,
'parent': None,
'vcs': None,
'footprints': None
}
_from_args = {
'name': None,
'author': None,
'email': None,
'license'... | shaggytwodope/progeny | validators.py | Python | gpl-3.0 | 3,149 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
import sys
if sys.version_info[0] >= 3:
basestr = str
else:
basestr = basestring
from .converters import (Lang... | clinton-hall/nzbToMedia | libs/common/babelfish/__init__.py | Python | gpl-3.0 | 761 |
# Lookup Bitcoin value from exchanges
from exchanges.bitfinex import Bitfinex
import re
def bitcoinValue(msg):
val = Bitfinex().get_current_price()
formattedVal = "$" + "{:,.2f}".format(val)
if re.search(r"(?i)moon", msg):
return "To the moon! " + formattedVal
else:
return "Bitcoin: "... | bhipple/brobot | currency.py | Python | gpl-3.0 | 336 |
def caught(pyn, fpyn):
fx, fy = fpyn.xy()
return pyn.distance(fx, fy) <= 1
| aresnick/pynguin | doc/examples_src/threaded_pynd/00015.py | Python | gpl-3.0 | 83 |
#!/usr/pkg/bin/python
import os, sys, time
from reportlab.graphics.barcode.common import *
from reportlab.graphics.barcode.code39 import *
from reportlab.graphics.barcode.code93 import *
from reportlab.graphics.barcode.code128 import *
from reportlab.graphics.barcode.usps import *
from reportlab.graphics.barcode.usps... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/src/reportlab/graphics/barcode/test.py | Python | gpl-3.0 | 9,268 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('libreosteoweb', '0021_therapeutsettings_siret'),
]
operations = [
migrations.AddField(
model_name='therapeutsett... | littlejo/Libreosteo | libreosteoweb/migrations/0022_therapeutsettings_invoice_footer.py | Python | gpl-3.0 | 504 |
#! /usr/bin/env python3
"""
poller-wrapper A small tool which wraps around the poller and tries to
guide the polling process with a more modern approach with a
Queue and workers
Authors: Job Snijders <job.snijders@atrato.com>
Orsiris de Jong <contact@netpower.fr>... | crcro/librenms | poller-wrapper.py | Python | gpl-3.0 | 14,267 |
import copy
import secrets
races = {}
colors = {
'🐶': 0xccd6dd,
'🐱': 0xffcb4e,
'🐭': 0x99aab5,
'🐰': 0x99aab5,
'🐙': 0x9266cc,
'🐠': 0xffcc4d,
'🦊': 0xf4900c,
'🦀': 0xbe1931,
'🐸': 0x77b255,
'🐧': 0xf5f8fa
}
names = {
'🐶': 'dog',
'🐱': 'cat',
'🐭': 'mouse',
... | AXAz0r/apex-sigma-core | sigma/modules/minigames/racing/nodes/race_storage.py | Python | gpl-3.0 | 1,238 |
# $File: _ext_type.py
# $Date: Wed Feb 22 15:04:06 2012 +0800
#
# Copyright (C) 2012 the pynojo development team <see AUTHORS file>
#
# Contributors to this file:
# Kai Jia <jia.kai66@gmail.com>
#
# This file is part of pynojo
#
# pynojo is free software: you can redistribute it and/or modify
# it under the terms ... | zxytim/pynojo | pynojo/model/_ext_type.py | Python | gpl-3.0 | 2,330 |
"""An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest log... | deanhiller/databus | webapp/play1.3.x/python/Lib/ftplib.py | Python | mpl-2.0 | 29,449 |
# Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 __future__ import division
import numpy... | kohr-h/odl | odl/test/trafos/backends/pyfftw_bindings_test.py | Python | mpl-2.0 | 13,174 |
from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/django/utils/http.py | Python | agpl-3.0 | 10,279 |
from datetime import date, timedelta
from django.conf import settings
date_in_near_future = date.today() + timedelta(days=14)
FOUR_YEARS_IN_DAYS = 1462
election_date_before = lambda r: {
'DATE_TODAY': date.today()
}
election_date_on_election_day = lambda r: {
'DATE_TODAY': date_in_near_future
}
election_dat... | mysociety/yournextmp-popit | candidates/tests/dates.py | Python | agpl-3.0 | 728 |
"""
XBlock runtime services for LibraryContentModule
"""
from django.core.exceptions import PermissionDenied
from opaque_keys.edx.locator import LibraryLocator
from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.capa_module import Capa... | eestay/edx-platform | common/lib/xmodule/xmodule/library_tools.py | Python | agpl-3.0 | 6,493 |
from PyQt4 import QtCore, QtGui
import os
class ConfigPage(QtGui.QWizardPage):
def __init__(self, templates, parent=None):
super(ConfigPage, self).__init__(parent)
#self.setTitle("Configuration")
#self.setSubTitle("Alter configuration and build your own platform.")
#self.setPixmap(... | hoangt/core | core/tools/generator/wizard/config.py | Python | agpl-3.0 | 2,087 |
##############################################################################
# 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/namd/package.py | Python | lgpl-2.1 | 5,455 |
# -*- Mode: Python; test-case-name:flumotion.test.test_worker_worker -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modifi... | timvideos/flumotion | flumotion/test/test_worker_medium.py | Python | lgpl-2.1 | 2,617 |
# Copyright 2013-2020 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 PyLocalcider(PythonPackage):
"""Tools for calculating sequence properties of disordered pr... | rspavel/spack | var/spack/repos/builtin/packages/py-localcider/package.py | Python | lgpl-2.1 | 788 |
"""distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
*... | Orav/kbengine | kbe/src/lib/python/Lib/distutils/unixccompiler.py | Python | lgpl-3.0 | 13,419 |
# -*- coding: utf-8 -*-
from __future__ import division
# -*- coding: utf-8 -*-
#
# Sphinx documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 8 21:47:50 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, ... | zetaops/SpiffWorkflow | doc/conf.py | Python | lgpl-3.0 | 5,907 |
# Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl
# 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/... | petrutlucian94/nova_dev | nova/virt/hyperv/vmops.py | Python | apache-2.0 | 17,820 |
from foam.sfa.util.xrn import urn_to_hrn
from foam.sfa.trust.credential import Credential
from foam.sfa.trust.auth import Auth
class Start:
def __init__(self, xrn, creds, **kwargs):
hrn, type = urn_to_hrn(xrn)
valid_creds = Auth().checkCredentials(creds, 'startslice', hrn)
origin_hrn =... | dana-i2cat/felix | ofam/src/src/foam/sfa/methods/Start.py | Python | apache-2.0 | 402 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... | kshimo69/IkaLog | ikalog/outputs/alive_squids_csv.py | Python | apache-2.0 | 3,445 |
#!/usr/bin/env python
#
# 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 (th... | Kami/libcloud | contrib/generate_provider_logos_collage_image.py | Python | apache-2.0 | 4,224 |
# 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 Lice... | AnshulYADAV007/Lean | Algorithm.Python/CoarseFundamentalTop3Algorithm.py | Python | apache-2.0 | 3,479 |
# -*- coding: utf-8 -*-
import json
import os
import re
import cherrypy
import mako
from girder import constants
from girder.models.setting import Setting
from girder.settings import SettingKey
from girder.utility import config
class WebrootBase:
"""
Serves a template file in response to GET requests.
... | RafaelPalomar/girder | girder/utility/webroot.py | Python | apache-2.0 | 4,603 |
# Copyright (c) 2014 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... | tellesnobrega/sahara | sahara/plugins/fake/edp_engine.py | Python | apache-2.0 | 1,219 |
#
# 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/engine/resources/openstack/neutron/net.py | Python | apache-2.0 | 7,583 |
input = """
% Guess colours.
chosenColour(N,C) | notChosenColour(N,C) :- node(N), colour(C).
% At least one color per node.
:- #count{ C : chosenColour(X,C) } > 1, node(X).
:- #count{ C : chosenColour(X,C) } < 1, node(X).
% No two adjacent nodes have the same colour.
:- link(X,Y), X<Y, chosenColour(X,C), ch... | Yarrick13/hwasp | tests/wasp1/AllAnswerSets/3col_aggregates_1_5_enc2.test.py | Python | apache-2.0 | 14,386 |
# Copyright (c) Frederick Dean
# See LICENSE for details.
"""
Unit tests for :py:obj:`OpenSSL.rand`.
"""
from unittest import main
import os
import stat
from OpenSSL.test.util import TestCase, b
from OpenSSL import rand
class RandTests(TestCase):
def test_bytes_wrong_args(self):
"""
:py:obj:`Op... | msabramo/pyOpenSSL | OpenSSL/test/test_rand.py | Python | apache-2.0 | 6,054 |
# Copyright 2016 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 requir... | Tehsmash/networking-cisco | networking_cisco/tests/unit/cisco/cpnr/test_dns_relay.py | Python | apache-2.0 | 8,534 |
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | FlyLu/rt-thread | bsp/stm32/stm32l475-st-discovery/rtconfig.py | Python | apache-2.0 | 3,831 |
# 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... | Laurawly/tvm-1 | python/tvm/topi/unique.py | Python | apache-2.0 | 12,249 |
def this_is_the_outer_lib():
print 'For imports test'
| fingeronthebutton/RIDE | utest/resources/robotdata/imports/outer_lib.py | Python | apache-2.0 | 58 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | eltonkevani/tempest_el_env | tempest/api/orchestration/stacks/test_stacks.py | Python | apache-2.0 | 2,542 |
#
# 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... | airbnb/airflow | airflow/contrib/operators/emr_terminate_job_flow_operator.py | Python | apache-2.0 | 1,226 |
"""
WSGI config for mdotproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | uw-it-aca/mdot-rest | docker/wsgi.py | Python | apache-2.0 | 395 |
#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-
# 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... | sebbASF/infrastructure-puppet | modules/git_self_serve/files/githubcron.py | Python | apache-2.0 | 4,335 |
#!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# mockredis
#
# This module helps start and stop redis instances for unit-testing
# redis must be pre-installed for this to work
#
import os
import signal
import subprocess
import logging
import socket
import time
import red... | facetothefate/contrail-controller | src/analytics/test/utils/mockredis/mockredis/mockredis.py | Python | apache-2.0 | 5,634 |
# Copyright 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 ... | prmtl/fuel-web | shotgun/shotgun/logger.py | Python | apache-2.0 | 1,285 |
# Copyright 2016 Huawei Technologies India Pvt. 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... | wolverineav/neutron | neutron/tests/unit/services/bgp/driver/ryu/test_driver.py | Python | apache-2.0 | 12,381 |
# 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 ... | indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py | Python | apache-2.0 | 6,145 |
#
# 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/engine/resources/scheduler_hints.py | Python | apache-2.0 | 1,805 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | nikesh-mahalka/cinder | cinder/utils.py | Python | apache-2.0 | 34,822 |
# 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... | charlescearl/VirtualMesos | src/webui/master/webui.py | Python | apache-2.0 | 2,037 |
# Copyright 2009-2015 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 ... | vasiliykochergin/euca2ools | euca2ools/commands/iam/listaccountpolicies.py | Python | bsd-2-clause | 3,688 |
# Copyright (c) 2017, MD2K Center of Excellence
# 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... | nasirali1/CerebralCortex | cerebralcortex/data_processor/signalprocessing/ecg.py | Python | bsd-2-clause | 16,830 |
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# 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... | madcowfred/evething | thing/tasks/reftypes.py | Python | bsd-2-clause | 2,946 |
# -*- coding: UTF-8 -*-
from django.conf import settings as dsettings
from django.contrib.auth import models as authModels
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.http import HttpResponse, Http404
from django.shortcuts import render, render_to_response, get_object_or_404
from dja... | barrachri/epcon | microblog/views.py | Python | bsd-2-clause | 7,631 |
#!/usr/bin/env python
import sys
from collections import namedtuple
import poppler
import cairo
from os.path import abspath
Point = namedtuple('Point', ['x', 'y'])
Line = namedtuple('Line', ['start', 'end'])
Polygon = namedtuple('Polygon', 'points')
Rectangle = namedtuple('Rectangle', ['top_left', 'bottom_right'])
A... | drj11/pdftables | pdftables/diagnostics.py | Python | bsd-2-clause | 11,691 |
"""
Maximum likelihood covariance estimator.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
# avoid division truncation
import warnings
import numpy as np
from scipy... | chrsrds/scikit-learn | sklearn/covariance/empirical_covariance_.py | Python | bsd-3-clause | 9,848 |
#!/usr/bin/env python
import sys
bsd = '''
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 following disclai... | drmateo/ecto | test/compile/check_new_bsd_license.py | Python | bsd-3-clause | 2,820 |
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Makes sure that files include headers from allowed directories.
Checks DEPS files in the source tree for rules, and applies tho... | rogerwang/chromium | tools/checkdeps/checkdeps.py | Python | bsd-3-clause | 17,591 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | joshzarrabi/e-mission-server | emission/net/api/bottle.py | Python | bsd-3-clause | 141,855 |
#
# Copyright (C) 2003-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" lazy generator of 2D pharm... | rvianello/rdkit | rdkit/Chem/Pharm2D/LazyGenerator.py | Python | bsd-3-clause | 4,307 |
import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | Tong-Chen/scikit-learn | sklearn/linear_model/tests/test_sgd.py | Python | bsd-3-clause | 30,538 |
from w3lib.url import parse_data_uri
from scrapy.http import TextResponse
from scrapy.responsetypes import responsetypes
from scrapy.utils.decorators import defers
class DataURIDownloadHandler(object):
lazy = False
def __init__(self, settings):
super(DataURIDownloadHandler, self).__init__()
@de... | kmike/scrapy | scrapy/core/downloader/handlers/datauri.py | Python | bsd-3-clause | 791 |
from functools import partial
from .primitives import EMPTY
__all__ = ['identity', 'constantly', 'caller',
'partial', 'rpartial', 'func_partial',
'curry', 'rcurry', 'autocurry',
'iffy']
def identity(x):
return x
def constantly(x):
return lambda *a, **kw: x
# an operator.m... | musicpax/funcy | funcy/simple_funcs.py | Python | bsd-3-clause | 1,941 |
"""Tools for solving inequalities and systems of inequalities. """
from __future__ import print_function, division
from sympy.core import Symbol
from sympy.sets import Interval
from sympy.core.relational import Relational, Eq, Ge, Lt
from sympy.sets.sets import FiniteSet, Union
from sympy.core.singleton import S
fro... | wdv4758h/ZipPy | edu.uci.python.benchmark/src/benchmarks/sympy/sympy/solvers/inequalities.py | Python | bsd-3-clause | 14,915 |
import Tkinter as tk
root = tk.Tk()
def noop(): pass
menubar = tk.Menu(root)
# create a pulldown menu, and add it to the menu bar
filemenu = tk.Menu(menubar)
filemenu.add_command(label="Open", command=noop)
filemenu.add_command(label="Save", command=noop)
filemenu.add_separator()
filemenu.add_command(label="Exit", ... | ynonp/python-examples-verint-2016-07 | 30_gui_widgets/05_menus.py | Python | mit | 833 |
"""Test interact and interactive."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
from collections import OrderedDict
import nose.tools as nt
import IPython.testing.tools as tt
from IPython.kernel.comm import Comm
from IP... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/html/widgets/tests/test_interaction.py | Python | mit | 19,299 |
##
# Copyright 2009-2021 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... | boegel/easybuild-easyblocks | easybuild/easyblocks/m/mymedialite.py | Python | gpl-2.0 | 2,788 |
#
# Written by Luke Kenneth Casson Leighton <lkcl@lkcl.net>
# This theme is demonstrates how to
#this import statement allows access to the karamba functions
import karamba
drop_txt = None
#this is called when you widget is initialized
def initWidget(widget):
# this resets the text to "" so we know we've nev... | serghei/kde3-kdeutils | superkaramba/examples/setIncomingData/2.py | Python | gpl-2.0 | 2,246 |
import sys
import os
print "-------------------------"
print "StegHide Options"
print "-------------------------"
print "Usage Example :"
print ""
print"To embed emb.txt in cvr.jpg: steghide embed -cf cvr.jpg -ef emb.txt"
print ""
print "To extract embedded data from stg.jpg: steghide extract -sf stg.jpg"
cmd1 = os.... | krintoxi/NoobSec-Toolkit | NoobSecToolkit /scripts/pySteg/pysteg.py | Python | gpl-2.0 | 340 |
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 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 your option) any l... | ludmilamarian/invenio | invenio/legacy/bibdocfile/plugins/bom_textdoc.py | Python | gpl-2.0 | 5,427 |
#
# Copyright 2014 eNovance
#
# 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, ... | ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/alarm/notifier/trust.py | Python | gpl-2.0 | 2,433 |
# vim: set fileencoding=utf-8 :
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Insecure.Com LLC. ... | markofu/scripts | nmap/nmap/zenmap/radialnet/gui/NodeNotebook.py | Python | gpl-2.0 | 34,656 |
from robottelo.decorators.func_shared.shared import ( # noqa
shared,
SharedFunctionError,
SharedFunctionException,
)
| ldjebran/robottelo | robottelo/decorators/func_shared/__init__.py | Python | gpl-3.0 | 130 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | nomaro/SickBeard_Backup | sickbeard/webserve.py | Python | gpl-3.0 | 155,575 |
import codecs
from ConfigParser import ConfigParser
import os
import subprocess
import sys
import six
import twiggy
from twiggy import log
from twiggy.levels import name2level
from xdg import BaseDirectory
def asbool(some_value):
""" Cast config values to boolean. """
return six.text_type(some_value).lower()... | zackp30/bugwarrior | bugwarrior/config.py | Python | gpl-3.0 | 5,298 |