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 2013 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | abel-von/commons | tests/python/twitter/common/zookeeper/serverset/test_serverset_unit.py | Python | apache-2.0 | 2,836 |
from __future__ import absolute_import
import logging
from collections import OrderedDict
from pip._internal.exceptions import InstallationError
from pip._internal.utils.logging import indent_log
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
from pip._internal.wheel import Wheel
if MYPY_CHECK_RUNNING:
... | xyuanmu/XX-Net | python3.8.2/Lib/site-packages/pip/_internal/req/req_set.py | Python | bsd-2-clause | 7,860 |
from base64 import decodestring
import json
from unittest import TestCase
from ipython_genutils.py3compat import unicode_type
from ..nbjson import reads, writes
from .. import nbjson
from .nbexamples import nb0
from . import formattest
class TestJSON(formattest.NBFormatTest, TestCase):
nb0_ref = None
ext =... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/nbformat/v4/tests/test_json.py | Python | bsd-2-clause | 3,764 |
from unittest import skipUnless
from django.db import models
from django.template import Context, Template
from django.test import SimpleTestCase, TestCase, override_settings
from django.test.utils import isolate_apps
from django.utils.version import PY37
from .models import (
AbstractBase1, AbstractBase2, Abstra... | theo-l/django | tests/managers_regress/tests.py | Python | bsd-3-clause | 11,168 |
from __future__ import print_function, division
from sympy.concrete.expr_with_limits import AddWithLimits
from sympy.concrete.expr_with_intlimits import ExprWithIntLimits
from sympy.core.function import Derivative
from sympy.core.relational import Eq
from sympy.core.singleton import S
from sympy.core.symbol import (Du... | grevutiu-gabriel/sympy | sympy/concrete/summations.py | Python | bsd-3-clause | 24,412 |
# sql/util.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from sqlalchemy import exc, schema, util, sql, types as sqltypes
from sqlalchemy.util impo... | eunchong/build | third_party/sqlalchemy_0_7_1/sqlalchemy/sql/util.py | Python | bsd-3-clause | 24,702 |
from django.apps import AppConfig
class PlayersConfig(AppConfig):
name = 'players'
| kevinharvey/django-tourney | tourney/players/apps.py | Python | gpl-3.0 | 89 |
# 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... | theflofly/tensorflow | tensorflow/python/ops/rnn.py | Python | apache-2.0 | 66,326 |
"""
Repository of polls that stores data in Azure Table Storage.
"""
from azure import WindowsAzureMissingResourceError
from azure.storage import TableService
from . import Poll, Choice, PollNotFound
from . import _load_samples_json
def _partition_and_row_to_key(partition, row):
"""Builds a poll/choice key out o... | DEVSENSE/PTVS | Python/Templates/Web/ProjectTemplates/Python/Web/PollsFlaskJade/PollsFlaskJade/models/azuretablestorage.py | Python | apache-2.0 | 4,285 |
"""Tests for the Modern Forms integration."""
from unittest.mock import MagicMock, patch
from aiomodernforms import ModernFormsConnectionError
from homeassistant.components.modern_forms.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from home... | aronsky/home-assistant | tests/components/modern_forms/test_init.py | Python | apache-2.0 | 1,806 |
# 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 with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | mmnelemane/nova | nova/tests/functional/test_extensions.py | Python | apache-2.0 | 1,588 |
"""Tests for the USB Discovery integration."""
from homeassistant.components.usb.models import USBDevice
conbee_device = USBDevice(
device="/dev/cu.usbmodemDE24338801",
vid="1CF1",
pid="0030",
serial_number="DE2433880",
manufacturer="dresden elektronik ingenieurtechnik GmbH",
description="Con... | jawilson/home-assistant | tests/components/usb/__init__.py | Python | apache-2.0 | 753 |
"""Provides device automations for Tasmota."""
from hatasmota.const import AUTOMATION_TYPE_TRIGGER
from hatasmota.models import DiscoveryHashType
from hatasmota.trigger import TasmotaTrigger
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Event, HomeAssistant
from homeassistant.hel... | aronsky/home-assistant | homeassistant/components/tasmota/device_automation.py | Python | apache-2.0 | 1,937 |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
UA_TYPE_MAPPING = {
'desktop':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) '
'AppleWebKit/537.22 (KHTML, like Gecko) '
'Chrome/27.0.1... | TeamEOS/external_chromium_org | tools/telemetry/telemetry/core/user_agent.py | Python | bsd-3-clause | 1,017 |
#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# 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
# notic... | lanyuwen/openthread | tools/harness-automation/cases/router_5_7_3.py | Python | bsd-3-clause | 1,877 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defer to run_test_cases.py."""
import os
import optparse
import sys
ROOT_DIR = os.path.dirname(
os.path.dirname(os.path.di... | codenote/chromium-test | tools/sharding_supervisor/sharding_supervisor.py | Python | bsd-3-clause | 2,601 |
import numpy as np
from numpy.testing import (run_module_suite,
assert_,
assert_equal,
assert_almost_equal,
assert_array_equal,
assert_array_almost_equal,
ass... | StongeEtienne/dipy | dipy/align/tests/test_streamlinear.py | Python | bsd-3-clause | 15,316 |
import struct
from plumbum.lib import six
LFANEW_OFFSET = 30 * 2
FILE_HEADER_SIZE = 5 * 4
SUBSYSTEM_OFFSET = 17 * 4
IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
def get_pe_subsystem(filename):
with open(filename, "rb") as f:
if f.read(2) != six.b("MZ"):
return None
f... | Hellrungj/CSC-412-Networking | rpc-project/venv/lib/python2.7/site-packages/plumbum/machines/_windows.py | Python | gpl-3.0 | 798 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | shaggytwodope/qutebrowser | qutebrowser/misc/__init__.py | Python | gpl-3.0 | 820 |
# Makes Sphinx create a <link> to feedparser.css in the HTML output
def setup(app):
app.add_stylesheet('feedparser.css')
| mastizada/kuma | vendor/packages/feedparser/docs/add_custom_css.py | Python | mpl-2.0 | 125 |
#!/usr/bin/env python
from __future__ import print_function
import sys
import glob
import subprocess
import sys
import logging
import dateutil.parser
import pytz
from datetime import datetime, timedelta
if False:
from typing import Dict, List
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s")
l... | dawran6/zulip | puppet/zulip/files/postgresql/pg_backup_and_purge.py | Python | apache-2.0 | 1,945 |
""" This module removes all objects/arrays from JS source code and replace them with LVALS.
Also it has s function translating removed object/array to python code.
Use this module just after removing constants. Later move on to removing functions"""
OBJECT_LVAL = 'PyJsLvalObject%d_'
ARRAY_LVAL = 'PyJsLvalArray%d_'
fro... | repotvsupertuga/tvsupertuga.repository | script.module.universalscrapers/lib/universalscrapers/modules/js2py/legecy_translators/objects.py | Python | gpl-2.0 | 11,176 |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2003, Mathieu Fenniak
# 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 abov... | wb253/goapp | app/pingback.py | Python | gpl-3.0 | 5,006 |
"""Fixtures for Hass.io."""
import os
from unittest.mock import Mock, patch
import pytest
from homeassistant.components.hassio.handler import HassIO, HassioAPIError
from homeassistant.core import CoreState
from homeassistant.setup import async_setup_component
from . import HASSIO_TOKEN
@pytest.fixture
def hassio_e... | jawilson/home-assistant | tests/components/hassio/conftest.py | Python | apache-2.0 | 2,490 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import sys
from cryptography import utils
from cryptography.exceptions i... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py | Python | bsd-3-clause | 2,252 |
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("core", "doctype", "sms_parameter")
sms_sender_name = frappe.db.get_single_value("SMS Settings", "sms_sender_name")
if sms_s... | vjFaLk/frappe | frappe/patches/v9_1/add_sms_sender_name_as_parameters.py | Python | mit | 651 |
from collections import defaultdict
# Regresar similitudes de un objeto index en un diccionario
def index2dict(index, file_list, num_sims=5):
file_list = [i.replace('.txt','') for i in file_list]
sims = {} #defaultdict(dict)
for i, idx in enumerate(index):
s = []
for j in range(len(file_list)):
s.append({
... | felipegerard/arte_mexicano_antiguo | felipegerard/entregable/itm/itm/similarity_functions.py | Python | agpl-3.0 | 629 |
# test builtin property
# create a property object explicitly
property()
property(1, 2, 3)
# use its accessor methods
p = property()
p.getter(1)
p.setter(2)
p.deleter(3)
# basic use as a decorator
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
print("x get")
r... | ceramos/micropython | tests/basics/builtin_property.py | Python | mit | 1,132 |
# Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | Cisco-Talos/pyrebox | volatility/volatility/plugins/overlays/windows/vista_sp12_x86_syscalls.py | Python | gpl-2.0 | 43,170 |
from askbot.tests.cache_tests import *
from askbot.tests.email_alert_tests import *
from askbot.tests.on_screen_notification_tests import *
from askbot.tests.page_load_tests import *
from askbot.tests.permission_assertion_tests import *
from askbot.tests.db_api_tests import *
from askbot.tests.skin_tests import *
from ... | divio/askbot-devel | askbot/tests/__init__.py | Python | gpl-3.0 | 1,266 |
# 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... | eadgarchen/tensorflow | tensorflow/python/grappler/model_analyzer.py | Python | apache-2.0 | 1,476 |
[uTidylib]: http://utidylib.berlios.de/
[options]: http://tidy.sourceforge.net/docs/quickref.html
Copyright (c)2008 [Waylan Limberg](http://achinghead.com)
License: [BSD](http://www.opensource.org/licenses/bsd-license.php) | retrography/scancode-toolkit | tests/cluecode/data/ics/markdown-markdown-extensions/html_tidy.py | Python | apache-2.0 | 225 |
from os.path import join, dirname
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_equal
import pytest
from pytest import raises as assert_raises
from scipy.fftpack._realtransforms import (
dct, idct, dst, idst, dctn, idctn, dstn, idstn)
# Matlab reference data
MDATA = np.load(join(... | mdhaber/scipy | scipy/fftpack/tests/test_real_transforms.py | Python | bsd-3-clause | 23,941 |
#!/usr/bin/env python
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
# $CJKCodecs: test_codecmaps_cn.py,v 1.3 2004/06/19 06:09:55 perky Exp $
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mappin... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_codecmaps_cn.py | Python | gpl-2.0 | 1,062 |
# -*- coding: utf-8 -*-
import click
from ..models import Post
@click.command()
@click.option('--title', default=None, help='Title of the Post')
def cli(title):
"Prints a list of posts"
posts = Post.objects
if title:
posts = posts(title=title)
for post in posts:
click.echo(post)
| seraphln/wheel | wheel/modules/posts/commands/listposts.py | Python | gpl-3.0 | 316 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | amoya-dx/account-financial-tools | currency_rate_update/__openerp__.py | Python | agpl-3.0 | 1,576 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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 the
## ... | Panos512/invenio | modules/bibformat/lib/elements/bfe_video_platform_suggestions.py | Python | gpl-2.0 | 5,845 |
#!/usr/bin/env python
#
# Copyright 2007 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... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/request_state.py | Python | bsd-3-clause | 2,810 |
"""Tests for HTMLParser.py."""
import HTMLParser
import pprint
import sys
import unittest
from test import test_support
class EventCollector(HTMLParser.HTMLParser):
def __init__(self):
self.events = []
self.append = self.events.append
HTMLParser.HTMLParser.__init__(self)
def get_eve... | zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_htmlparser.py | Python | epl-1.0 | 10,454 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | jj0hns0n/geonode | geonode/upload/urls.py | Python | gpl-3.0 | 1,501 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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/LICEN... | Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/openstack/common/rpc/impl_fake.py | Python | apache-2.0 | 5,854 |
"""Provides a Hue API to control Home Assistant."""
import asyncio
import logging
from aiohttp import web
from homeassistant import core
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_SET,
SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, STATE_ON, STATE_OFF,
HT... | kyvinh/home-assistant | homeassistant/components/emulated_hue/hue_api.py | Python | apache-2.0 | 13,038 |
#### PATTERN | COMMONSENSE #########################################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
####################################... | krishna11888/ai | third_party/pattern/pattern/graph/commonsense.py | Python | gpl-2.0 | 11,504 |
#!/usr/bin/python
# Copyright (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/lambda_policy.py | Python | bsd-3-clause | 13,776 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Michael Tipton <mike () ibeta.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version'... | thaim/ansible | lib/ansible/modules/cloud/vmware/vcenter_extension.py | Python | mit | 7,306 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from datetime import datetime
import glob
import optparse
import os
import re
from telemetry import test
from telemetry.core import bitmap
from telemetry... | qtekfun/htcDesire820Kernel | external/chromium_org/content/test/gpu/gpu_tests/pixel.py | Python | gpl-2.0 | 5,592 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Utilidades para detectar vídeos de los diferentes conectores
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
#LvX Edited Patched
i... | jose36/plugin.video.live.ProyectoLuzDigital- | servers/servertools.py | Python | gpl-2.0 | 17,227 |
#!/usr/bin/env python3
import fnmatch
import os
import re
import ntpath
import sys
import argparse
def get_private_declare(content):
priv_declared = []
srch = re.compile('private.*')
priv_srch_declared = srch.findall(content)
priv_srch_declared = sorted(set(priv_srch_declared))
priv_dec... | kerckasha/ACE3 | tools/search_privates.py | Python | gpl-2.0 | 4,384 |
from . import audio
import pytest
import re
@pytest.mark.parametrize('input,expected', [
('http://foo.bar https://bar.foo',
('http://foo.bar', 'https://bar.foo', None)),
('http://test.foo',
('http://test.foo', None, None)),
('https://test.foo',
('https://test.foo', None, None)),
... | 2015fallhw/cdw11 | static/plugin/liquid_tags/test_audio.py | Python | agpl-3.0 | 1,494 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | freedesktop-unofficial-mirror/gstreamer-sdk__cerbero | test/test_cerbero_packages_linux.py | Python | lgpl-2.1 | 7,324 |
"""Helpers for HomeKit data stored in HA storage."""
from homeassistant.core import callback
from homeassistant.helpers.storage import Store
from .const import DOMAIN
ENTITY_MAP_STORAGE_KEY = f"{DOMAIN}-entity-map"
ENTITY_MAP_STORAGE_VERSION = 1
ENTITY_MAP_SAVE_DELAY = 10
class EntityMapStorage:
"""
Holds ... | nkgilley/home-assistant | homeassistant/components/homekit_controller/storage.py | Python | apache-2.0 | 2,471 |
# $Id$
#
# pjsua Python GUI Demo
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.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; either version 2 of the License, or
# (at your option) ... | xiejianying/pjsip_trunk | pjsip-apps/src/pygui/log.py | Python | gpl-2.0 | 3,628 |
"""
Members info plugin for Pelican
===============================
This plugin looks for a ``members`` metadata header containing key/value pairs
and makes them available for use in templates
The first line of the members metadata defines each key, and the following
lines contain corresponding values for each member... | tijptjik/thegodsproject | plugins/members/members.py | Python | mit | 1,249 |
from django.dispatch import receiver
from django.dispatch import Signal
from django.utils.timezone import now
from django.contrib.auth.signals import user_logged_out
from django.core.exceptions import ObjectDoesNotExist
from axes.models import AccessLog
user_locked_out = Signal(providing_args=['request', 'username',... | todaychi/hue | desktop/core/ext-py/django-axes-1.5.0/axes/signals.py | Python | apache-2.0 | 919 |
from django import forms
from django.test import TestCase
from django.core.exceptions import NON_FIELD_ERRORS
from modeltests.validation import ValidationTestCase
from modeltests.validation.models import Author, Article, ModelToValidate
# Import other tests for this package.
from modeltests.validation.validators impor... | bufferapp/buffer-django-nonrel | tests/modeltests/validation/tests.py | Python | bsd-3-clause | 5,944 |
import haystack
haystack.autodiscover() | zorna/zorna | zorna/search/search_sites.py | Python | bsd-3-clause | 39 |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | ravibhure/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py | Python | gpl-3.0 | 3,846 |
# -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2009,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... | gianina-ingenuity/titanium-branch-deep-linking | testbed/x/mobilesdk/osx/5.5.1.GA/common/css/ply/lex.py | Python | mit | 40,747 |
# Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... | ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/cells/weights/ram_by_instance_type.py | Python | gpl-2.0 | 1,971 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import hmac
import urllib
from frappe import _
import frappe
import frappe.utils
def get_signed_params(params):
"""Sign a url by appending `&_signature=xxxxx` to given params (... | mbauskar/tele-frappe | frappe/utils/verified_command.py | Python | mit | 2,109 |
import types, sys
import weakref
from .lock import allocate_lock
# type qualifiers
Q_CONST = 0x01
Q_RESTRICT = 0x02
Q_VOLATILE = 0x04
def qualify(quals, replace_with):
if quals & Q_CONST:
replace_with = ' const ' + replace_with.lstrip()
if quals & Q_VOLATILE:
replace_with = ' volatile ' +... | aESeguridad/GERE | venv/lib/python2.7/site-packages/cffi/model.py | Python | gpl-3.0 | 21,110 |
"""
Tests for Django's bundled context processors.
"""
from django.test import SimpleTestCase, TestCase, override_settings
@override_settings(
ROOT_URLCONF='context_processors.urls',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS':... | DONIKAN/django | tests/context_processors/tests.py | Python | bsd-3-clause | 3,031 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Widiot/simpleblog | venv/lib/python3.5/site-packages/selenium/webdriver/common/actions/key_input.py | Python | mit | 1,782 |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | kidaa/kythe | third_party/grpc/src/python/src/grpc/framework/foundation/_timer_future.py | Python | apache-2.0 | 6,903 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import math
def _float_check_precision(precision_digits=None, precision_rounding=None):
assert (precision_digits is not None or precision_rounding is not None) and \
not (precision_digits and precision_round... | vileopratama/vitech | src/openerp/tools/float_utils.py | Python | mit | 9,416 |
import main
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| diogocs1/comps | web/addons/edi/controllers/__init__.py | Python | apache-2.0 | 79 |
#!/usr/bin/env python
#
# Copyright 2004,2005,2007,2012 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 ... | jarn0ld/gnuradio | gr-audio/examples/python/dial_tone.py | Python | gpl-3.0 | 2,150 |
# mssql/mxodbc.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql+mxodbc
:name: mxODBC
:dbapi: mxodbc
:connectstring:... | jessekl/flixr | venv/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/mxodbc.py | Python | mit | 3,902 |
# markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/third_party/markdown/odict.py | Python | mit | 7,934 |
# 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 ... | qorio/maestro | zookeeper/src/contrib/huebrowser/zkui/src/zkui/settings.py | Python | apache-2.0 | 1,103 |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | Chilledheart/chromium | tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/s3/test_website.py | Python | bsd-3-clause | 9,219 |
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.db import models
class IntegerUsernameUserManager(BaseUserManager):
def create_user(self, username, password):
user = self.model(username=username)
user.set_password(password)
user.save(using=self._db)
... | nesdis/djongo | tests/django_tests/tests/v22/tests/auth_tests/models/with_integer_username.py | Python | agpl-3.0 | 681 |
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
student_number = models.PositiveIntegerField(blank=True, null=True,
verbose_name=_("Student number"))
phone = models.CharField(blank=True, max_length=100,
verbose_name=_("Phone"))
mobile_phone = models.CharField... | westphahl/verleihsystem | doc/code/server_accounts_models.py | Python | isc | 492 |
#!/usr/bin/env python
# vim: set expandtab tabstop=4 shiftwidth=4:
#
# Copyright (c) 2012, Christopher J. Kucera
# 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 c... | apocalyptech/pyinvedit | pyinveditlib/util.py | Python | isc | 5,398 |
"""Low-Level GSSAPI Bindings
The low-level API presents a series of methods designed
to closely mimic the C API presented in RFC 2744 and
associated RFCs.
In this API, classes are simply thin wrappers around C
constructs, and generally lack instance methods. However,
classes will automatically free associated memory... | frozencemetery/python-gssapi | gssapi/raw/__init__.py | Python | isc | 2,895 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
#
# Pryvate documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 21 11:31:08 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note... | Dinoshauer/pryvate | docs/source/conf.py | Python | mit | 8,998 |
"""
WSGI config for selenium_intro project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICA... | lincolnloop/django-selenium-intro | selenium_intro/wsgi.py | Python | mit | 1,150 |
#!/usr/bin/env python
# import csv
# import titlecase
from elasticsearch import Elasticsearch
from app import app
# PATH_FILE = 'data/dict_financial_accounting.csv'
# PATH_FILE = 'data/dict_economics.csv'
# PATH_FILE = 'data/dict_accounting.csv'
# PATH_FILE = 'data/dict_digital-marketing-terms.csv'
# PATH_FILE = 'da... | tranhuucuong91/simple-notebooks | app/routes/load_data.py | Python | mit | 4,200 |
from prophyc import model
def test_typedef_repr():
typedef = model.Typedef("my_typedef", "u8")
assert str(typedef) == "u8 my_typedef"
def test_struct_repr():
struct = model.Struct("MyStruct", [
model.StructMember("a", "u8"),
model.StructMember("b", "u16", bound = 'xlen'),
model.Str... | cislaa/prophy | prophyc/tests/test_model.py | Python | mit | 29,060 |
"""
Django settings for myproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | eamuntz/Django-Tut | myproject/myproject/settings.py | Python | mit | 2,048 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='Flask-LoginManager',
version='1.1.6',
keywords=('flask', 'login', 'multiple roles', 'permissions'),
description='Flask-Loginmanager supports multiple roles and permissions for Flask, inspired by Flask-Login',
li... | AristotleJunior/flask-loginmanager | app/setup.py | Python | mit | 1,060 |
# tpye hints
from typing import Dict,Any
# libs
import numpy as np # type: ignore
import matplotlib.pyplot as plt # type: ignore
import argparse
import json
""" returns (arithmetic, geometric) combinations of input distribution list """
def combine_dists(dist_list, entropy_bias):
dists = np.array(dist_list)
sums ... | alexcoplan/p2proj | src/script/dist_comb.py | Python | mit | 4,527 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from insertion_sort import insertion_sort
def bucket_sort(a):
"""
0.0 <= a[i] <= 1
"""
b = [[] for _ in a]
n = len(a)
for v in a:
b[int(n*v)].append(v)
a = []
for i in range(len(b)):
a.extend(insertion_sort(b[i]))
... | hongta/practice-python | sorting/bucket_sort.py | Python | mit | 416 |
import pytest
import floto.specs.task
@pytest.fixture
def child_workflow():
retry_strategy = floto.specs.retry_strategy.Strategy()
cw = floto.specs.task.ChildWorkflow(workflow_type_name='wft_name',
workflow_type_version='wft_version',
... | babbel/floto | tests/unit/specs/task/test_child_workflow.py | Python | mit | 2,677 |
# -*- coding: utf-8 -*-
import unittest
from cwr.parser.decoder.dictionary import GroupTrailerDictionaryDecoder
"""
Dictionary to Message decoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class TestGroupTrailerDictionaryEnc... | weso/CWR-DataApi | tests/parser/dictionary/decoder/control/test_group_trailer.py | Python | mit | 903 |
'''
# Gabe Gaster, 2013
#
# about every minute, eta will report how many iterations
# have been performed and the Expected Time to Completion (the E.T.C.)
#
#####################################################################
#
# Examples:
#
import timer
for stuff in timer.show_progress(range(100)):
# .... a... | gabegaster/python-timer | timer/timer.py | Python | mit | 3,254 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from user.decorators import user_is_logged
@user_is_logged
def home(request):
return render(request, 'landing.html')
def team_page(request):
return render(request, 'team.html')
| fga-gpp-mds/2017.2-Receituario-Medico | medical_prescription/landing/views.py | Python | mit | 291 |
# combine_all_summaries
# this fuses the summary files from pre23_hathi,
# post22_hathi, and chicago, to create a file
# where there is only one entry for each
# char, auth, date tuple
import csv
from collections import Counter
counts = dict()
columns = ['characters', 'speaking', 'agent', 'mod', 'patient', 'poss', ... | tedunderwood/character | oldcode/combine_hathi_summaries.py | Python | mit | 1,368 |
# -*- coding:utf-8 -*-
import unittest
from datetime import datetime
from datetime import timedelta
from SQLRelay import PySQLRClient
SQLRELAY_HOST = 'localhost'
SQLRELAY_PORT = 9002
SQLRELAY_USER = 'sqlruser'
SQLRELAY_PASS = 'sqlrpass'
SQLRELAY_DEBUG = False
class SQLRelayTestCase(unittest.TestCase):
"""Base ... | zzragida/PythonExamples | MemberShip/db/base.py | Python | mit | 2,027 |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9678")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| Cataloniacoin/CataloniacoinS | contrib/wallettools/walletunlock.py | Python | mit | 158 |
# Copyright (c) 2021, Manfred Moitzi
# License: MIT License
import sys
from typing import Iterable
import pathlib
import random
import ezdxf
from ezdxf import zoom, print_config
from ezdxf.math import Matrix44
from ezdxf.tools import fonts
from ezdxf.tools import text_layout as tl
"""
This example shows the usage o... | mozman/ezdxf | examples/text_layout_engine_usage.py | Python | mit | 12,087 |
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'fbstats.users'
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
pass
| bhanduroshan/fbstats-docker | fbstats/users/apps.py | Python | mit | 273 |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 1 17:14:20 2016
@author: stephaniekwan
Plot prominent emission lines of IC 10 X-2 from TripleSpec chop-subtracted
data. He I and Pa-Gamma lines fit on one plot, Pa-Beta line goes in a separate
plot (comment/uncomment blocks to plot each set).
"""
import numpy as np
im... | skkwan/IC10X2 | palomar/TSpec_reductions/TSpec basic plot.py | Python | mit | 2,508 |
import sys
from math import sqrt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
#from numpy.random import random
import matplotlib.pyplot as plt
from folders import fields
import nanopores.geometries.pughpore as pughpore
import nanopores
from sobol.sobol_seq import i4_sobol_generate as sobol
up = nanopores... | mitschabaude/nanopores | scripts/pughpore/new_sobol_points.py | Python | mit | 6,272 |
from __future__ import print_function
from django.test import TestCase
from django.contrib.auth.models import User
from imager_images.models import Photo, Album
from django.test import Client
import factory
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User
django_get_... | joelstanner/django-imager | imager/imager/tests.py | Python | mit | 2,457 |
from . import null
from . import fid
from . import dd
from . import ir
from . import abstract_detection_method
from . import helper_functions
| EAOgroup/FEAST | DetectionModules/__init__.py | Python | mit | 148 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-31 11:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('redirects', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='redirect',
... | rtfd/readthedocs.org | readthedocs/redirects/migrations/0002_add_missing_model_change_migrations.py | Python | mit | 963 |
"""
"""
import logging
import unittest
import bolt._btoptions as btoptions
class TestOptions(unittest.TestCase):
def setUp(self):
# If we don't initialize it from an empty options list, it parses
# the arguments to nosetests and the test fail. The actual code using
# it doesn't need t... | abantos/bolt | test/test_btoptions.py | Python | mit | 3,939 |
SETUP = 1
SIGN_UP = 2
TOKEN_GENERATION = 3
SOCIAL_LOGIN = 4 | lvercelli/pytsbp | tsbp/consts/operations.py | Python | mit | 59 |
from buildercore.bvars import encode_bvars, read_from_current_host
from buildercore.command import remote_sudo, upload
from io import StringIO
from decorators import requires_aws_stack
from buildercore.config import BOOTSTRAP_USER
from buildercore.core import stack_all_ec2_nodes, current_node_id
from buildercore.contex... | elifesciences/builder | src/buildvars.py | Python | mit | 6,259 |