code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import pytest
import shutil
import os
from django.conf import settings
from buckets.utils import ensure_dirs
@pytest.fixture(scope='function')
def make_dirs(request):
ensure_dirs('uploads', 'downloads', 'uploads/files')
def teardown():
shutil.rmtree(os.path.join(settings.MEDIA_ROOT, 's3'))
requ... | Cadasta/django-buckets | buckets/test/mocks.py | Python | agpl-3.0 | 622 |
import threading
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import glutSolidTeapot
import glLibOBJLoad
import glLibOBJLoad_threading
from glLibLocals import *
from glLibTexturing import *
from math import *
class glLibObj():
def draw(self,pos=[0,0,0],rotations=[],scalar=1.0):
glPushMa... | nicoboss/Floatmotion | OpenGLLibrary/glLibObjects.py | Python | agpl-3.0 | 12,798 |
"""
test_find_vivo_uri.py -- return the first VIVO URI that staisfies a
match on predicate and value
Version 0.1 MC 2014-03-25
-- Initial version.
Version 0.2 MC 2014-07-22
-- Updated for tools 2.0
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2014, University of Florida"
__l... | mconlon17/vivo-1.6-upgrade | tools/test_find_vivo_uri.py | Python | bsd-3-clause | 1,168 |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing Libs
from salt.exceptions import CommandExecutionError
from salttesting import TestCase, skipIf
from salttesting.helpers import ens... | stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/modules/systemd_test.py | Python | apache-2.0 | 7,785 |
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test coinstatsindex across nodes.
Test that the values returned by gettxoutsetinfo are consistent
between a... | domob1812/bitcoin | test/functional/feature_coinstatsindex.py | Python | mit | 12,309 |
"""
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 use this ... | zouzhberk/ambaridemo | demo-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/webhcat_server.py | Python | apache-2.0 | 1,523 |
# 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 calendar
import ipaddress
import six
from cryptography import ut... | ctrlaltdel/neutrinator | vendor/cryptography/hazmat/backends/openssl/encode_asn1.py | Python | gpl-3.0 | 23,412 |
from django.db.models import ObjectDoesNotExist
from django.db.models.fields.related import ForeignKey, ReverseSingleRelatedObjectDescriptor
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.contrib.sites.models import SITE_CACHE, Si... | WhiskeyMedia/ella | ella/core/cache/fields.py | Python | bsd-3-clause | 3,839 |
"""Mapper and Sub-Mapper"""
import re
import sys
import threading
import pkg_resources
from repoze.lru import LRUCache
from routes import request_config
from routes.util import controller_scan, MatchException, RoutesException, as_unicode
from routes.route import Route
COLLECTION_ACTIONS = ['index', 'create', 'new']... | grepme/CMPUT410Lab01 | virt_env/virt1/lib/python2.7/site-packages/Routes-2.0-py2.7.egg/routes/mapper.py | Python | apache-2.0 | 47,579 |
import unittest
from contextlib import contextmanager
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.test import TestCase, override_settings
@contextmanager
def get_connection():
new_connection = connection.copy()
yield new_connection
new_connection.c... | Beauhurst/django | tests/backends/test_mysql.py | Python | bsd-3-clause | 3,531 |
##############################################################################
# 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... | mfherbst/spack | var/spack/repos/builtin/packages/cares/package.py | Python | lgpl-2.1 | 1,778 |
# -*- encoding: utf-8 -*-
#
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
#
# Coded by: Jorge Angel Naranjo (jorge_nr@vauxoo.com)
#
#
# This program is free software: you can red... | 3dfxsoftware/cbss-addons | account_advance_payment/model/account_voucher.py | Python | gpl-2.0 | 1,549 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | cmelange/ansible | lib/ansible/parsing/dataloader.py | Python | gpl-3.0 | 17,412 |
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from itertools import cycle
from odoo import _, models
class VerticalLiftOperationPick(models.Model):
_name = "vertical.lift.operation.pick"
_inherit = "vertical.lift.operation.transfer"
_description = "Vertic... | OCA/stock-logistics-warehouse | stock_vertical_lift/models/vertical_lift_operation_pick.py | Python | agpl-3.0 | 5,375 |
'''
This file contains classes and functions that implement the PyPXE DHCP service
'''
import socket
import struct
import os
import logging
from collections import defaultdict
from time import time
class OutOfLeasesError(Exception):
pass
class DHCPD:
'''
This class implements a DHCP Server, limite... | MarloweW/PyPXE | pypxe/dhcp.py | Python | mit | 15,067 |
import os
from traceback import format_exc
from ansible import constants as C
from ansible.plugins.action import ActionBase
try:
from __main__ import display
except ImportError:
from ansible.utils.display import Display
display = Display()
class StrError(RuntimeError):
pass
# sample colors (default... | ReanGD/py-pacman-manager | action_plugins/show.py | Python | apache-2.0 | 2,305 |
import codecs
import json
import os
import pipes
import re
import sys
from itertools import chain
import py
import tox
from tox import reporter
from tox.action import Action
from tox.config.parallel import ENV_VAR_KEY_PRIVATE as PARALLEL_ENV_VAR_KEY_PRIVATE
from tox.constants import INFO, PARALLEL_RESULT_JSON_PREFIX,... | tox-dev/tox | src/tox/venv.py | Python | mit | 30,643 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import pytest
from sfm import winzip
def teardown_module(module):
""" teardown any state that was previously setup with a setup_module
method.
"""
import time
# temp file will be removed soon
time.sleep(1.0)
for p in ["1.zip", "2.zi... | MacHu-GWU/single_file_module-project | tests/test_winzip.py | Python | mit | 716 |
import socket
import os
import struct
import threading
from netaddr import IPNetwork,IPAddress
from ctypes import *
# host to listen on
host = "192.168.0.187"
# subnet to target
subnet = "192.168.0.0/24"
# magic we'll check ICMP responses for
magic_message = "PYTHONRULES!"
def udp_sender(subnet,... | yangtze736/Snake | BHP-Code/Chapter3/scanner.py | Python | mit | 4,424 |
# C1 = (0,0) C2 = (ROOM_WIDTH, 0)
# +------------------+
# | WALL1 |
# | |
# | |
# | WALL4 WALL2 |
# | |
# | |
# | WALL3 |
# +------------------+
# C4 = (0... | TheZoq2/VRHack | python/constants.py | Python | apache-2.0 | 2,089 |
from ..language.ast import Node
def ast_to_dict(node, include_loc=False):
if isinstance(node, Node):
d = {
'kind': node.__class__.__name__
}
if hasattr(node, '_fields'):
for field in node._fields:
d[field] = ast_to_dict(getattr(node, field), include_... | wandb/client | wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_to_dict.py | Python | mit | 638 |
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from math import * # Needed if we're going to exclude pylab :)
PIl = 3.1415926535897932384626433832795029
def rad2deg(r): return 180.0*r/PIl
def deg2rad(d): return d*PIl/180.0
def rad2arcmin(r): return ... | olebole/astrometry.net | util/starutil2.py | Python | bsd-3-clause | 3,918 |
# -*- coding: utf-8 -*-
"""
End-to-end tests for the Account Settings page.
"""
from datetime import datetime
from unittest import skip
import pytest
from bok_choy.page_object import XSS_INJECTION
from pytz import timezone, utc
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage, FULL_NAME
from com... | philanthropy-u/edx-platform | common/test/acceptance/tests/lms/test_account_settings.py | Python | agpl-3.0 | 21,442 |
#!/usr/bin/env python
'''code description'''
# pylint: disable = I0011, E0401, C0103, C0321
class Solution(object):
'''Solution description'''
def func(self, iNums):
'''func description'''
nums = [1] + [i for i in iNums if i > 0] + [1]
n = len(nums)
dp = [[0]*n for _ in range(n)... | cerebrumaize/leetcode | 312.burst.balloons/2.py | Python | mit | 752 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-18 18:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.forms.widgets
class Migration(migrations.Migration):
dependencies = [
('sshcomm', '0002_auto_20170118_1702'),
]
operations = [
... | t-mertz/slurmCompanion | django-web/sshcomm/migrations/0003_auto_20170118_1901.py | Python | mit | 697 |
# coding=utf-8
#
# Copyright 2016 F5 Networks 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 a... | F5Networks/f5-common-python | f5/bigiq/tm/__init__.py | Python | apache-2.0 | 921 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get('MAIL_USE... | zarinfar/Social-Network | config.py | Python | mit | 1,306 |
# For python 3 compatible
from __future__ import division, absolute_import, print_function
try: input = raw_input
except: pass
from getch import getch
import game_structure as gs
from musictools import (play_progression, random_progression,
random_key, isvalidnote, resolve_with_chords, chordname,
random_chor... | mathandy/EarThoseChords | game_modes.py | Python | apache-2.0 | 22,934 |
#!/usr/bin/python
'''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators'''
import unittest
from PySide2.QtCore import QBitArray
def bool_list_from_qbitarray(qbitarray):
'''This function is used instead of a list comprehension because
the QBitArray is being tested also to ... | BadSingleton/pyside2 | tests/QtCore/qbitarray_test.py | Python | lgpl-2.1 | 4,643 |
"""
==================================================================================
Code for plot dlm results
==================================================================================
This module provide the plotting functionality for dlm
"""
import matplotlib.pyplot as plt
from pydlm.base.tools import ... | wwrechard/pydlm | pydlm/plot/dlmPlot.py | Python | bsd-3-clause | 19,334 |
import uuid
from path_helpers import path
import numpy as np
try:
from base_node_rpc.proxy import ConfigMixinBase, StateMixinBase
import arduino_helpers.hardware.teensy as teensy
from .node import (Proxy as _Proxy, I2cProxy as _I2cProxy,
SerialProxy as _SerialProxy)
class Prox... | ryanfobel/multispeq1.py | multispeq1/proxy.py | Python | gpl-3.0 | 996 |
# Copyright 2014 IBM Corp.
#
# 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 t... | klmitch/nova | nova/tests/unit/api/openstack/test_api_version_request.py | Python | apache-2.0 | 7,199 |
from __future__ import print_function
import os
import re
import csv
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dhhd.settings')
import django
django.setup()
from django.utils import timezone
from plan.models import Plan, SpecialFeature, Customer
def populate(file_name):
open_floor_plan = add_feature('bonus', ... | smhilde/dhhd_project | dhhd/populate_dhhd.py | Python | apache-2.0 | 4,107 |
weight = 30
for year in range(1, 16):
weight = weight + 0.25
moon_weight = weight * 0.165
print('Year %s is %s' % (year, moon_weight)) | amosnier/python_for_kids | book_code/appendixb/ch6-moon-weight.py | Python | gpl-3.0 | 146 |
from pele.amber.amberSystem import AMBERSystem
from pele.gui import run as gr
sysAmb = AMBERSystem('coords.prmtop', 'coords.inpcrd')
gr.run_gui(sysAmb, db="optimdb.sqlite")
| kjs73/pele | playground/amber/aladipep/optim2pele/run_gui.py | Python | gpl-3.0 | 182 |
#!/usr/bin python
# -*- coding: utf-8 -*-
import os
from PyQt5 import QtWidgets, uic, QtCore, QtGui
from PyQt5.QtCore import Qt
from pyqtgraph.flowchart.Node import Node
from pyqtgraph import BusyCursor
from pyqtgraph import functions as fn
import traceback
import pandas as pd
import matplotlib.pyplot as plt
import l... | cdd1969/pygwa | lib/flowchart/nodes/n01_quickview/node_quickview.py | Python | gpl-2.0 | 9,080 |
# **************************************************************************************
# * *
# * BOLTS - Open Library of Technical Specifications *
# * ... | berndhahnebach/BOLTS | freecad/batteries/batteries.py | Python | gpl-3.0 | 2,218 |
#!/usr/bin/env python
# Copyright (c) 2015 IBM. 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 b... | cloudant/python-cloudant | tests/integration/replicator_test.py | Python | apache-2.0 | 9,897 |
#
# Copyright (c) 2008-2015 Citrix 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/audit/auditsyslogpolicy_aaagroup_binding.py | Python | apache-2.0 | 5,173 |
# -*- coding: utf-8 -*-
# gtkui.py
#
# Copyright (C) 2013-2019 Ștefan Talpalaru <stefantalpalaru@yahoo.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.c... | stefantalpalaru/deluge-default-trackers | defaulttrackers/gtkui.py | Python | gpl-3.0 | 11,664 |
"""
========================================
========================================
"""
import os
import sys
import re
import string
import numpy as np
import matplotlib.pyplot as plt
def DrawFig ( alleleCount ) :
fig = plt.figure()
if len( alleleCount ) > 0 :
plt.title('AC Number', fontsize=12)
... | ShujiaHuang/AsmVar | src/AsmvarGenotype/Validate.py | Python | mit | 2,087 |
"""
This file is part of ALTcointip.
ALTcointip is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ALTcointip is distr... | Healdb/altcointip | src/ctb/ctb_coin.py | Python | gpl-2.0 | 8,785 |
APPS = [
"schremote",
"_schtools.schsimplescripts",
"_schtools.schtools",
"_schwiki.schwiki",
"_schtools.schcommander",
"_schtools.schtasks",
]
APPS_EXT = []
PUBLIC = False
MAIN_PRJ = False
| Splawik/pytigon | pytigon/prj/_schremote/apps.py | Python | lgpl-3.0 | 214 |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | roadmapper/ansible | test/units/modules/network/vyos/test_vyos_firewall_rules.py | Python | gpl-3.0 | 39,919 |
from .unsorted import * | florian-wagner/gimli | python/pygimli/misc/__init__.py | Python | gpl-3.0 | 23 |
# Copyright (c) 2016, NECST Laboratory, Politecnico di Milano
# 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 not... | Xilinx/PYNQ | pynq/lib/pmod/pmod_grove_ear_hr.py | Python | bsd-3-clause | 3,981 |
#!/usr/bin/env python
from __future__ import print_function
import re
import io
with open('Duplicati.sln', 'r') as f:
c = f.read()
p = re.compile(r"\{[0-9a-fA-F\-]*\}")
tags = p.findall(c)
d = {}
for n in tags:
d[n] = 0
for n in tags:
d[n] = d[n] + 1
for n in d:
if d[n] > 7:
print(n)
| duplicati/duplicati | fix-sln.py | Python | lgpl-2.1 | 316 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-29 08:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0002_auto_20170720_2335'),
]
operations = [
migrations.AddField... | emrehayirci/deps | profiles/migrations/0003_user_name.py | Python | gpl-3.0 | 458 |
from .requests_test import RequestsTest
import copy
import sys
class XSSTest(RequestsTest):
def test(self):
if self.DEBUG: print("Run the XSS Tests")
passed = 0
failed = 0
messages = []
url = self.domain['protocol'] + self.domain['host'] + self.config['path']
print(... | sethlaw/sputr | tests/xss_test.py | Python | gpl-3.0 | 3,768 |
"""General shared utilities."""
import logging
from typing import Iterable, Any, Tuple
from itertools import tee, zip_longest
# Do not update the version manually - it is managed by `bumpversion`.
__version__ = '4.0.1'
log = logging.getLogger(__name__)
def is_blank(string: str) -> bool:
"""Return True iff the s... | farmersez/pydocstyle | src/pydocstyle/utils.py | Python | mit | 1,024 |
# -*- coding: utf-8 -*-
#para construir la ruta a los archivos
import os
# para sacar los resultados en una sola linea
import yaml
import json
# interpreta un string como codigo python, usado para obtener el diccionario de variables que se convierte a string automaticamente
import ast
# Para analizar expresiones
i... | urrego093/proyecto_mv | applications/datos/models/playbook_files.py | Python | gpl-3.0 | 14,146 |
a = {2, 1, 3, 4}
b = set([1, 2, 3, 3])
c = {1, 2, 3, 5}
d = {1, 2, 3, 4}
print len(a)
print 4 in b
print len(b)
print b < a
print b < c
print a < c
print c < a
print a == c
print d < a
print d <= a
print a | c
print a & c | amiraliakbari/sharif-mabani-python | by-session/class-921/week6/python_set.py | Python | mit | 221 |
from setuptools import setup, find_packages
setup(
name='praekelt.recipe.backup',
version='0.0.3',
description='Filesystem and database backup Buildout recipe.',
long_description = open('README.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(),
author='Praekelt Foundation',
author_email='de... | praekelt/praekelt.recipe.backup | setup.py | Python | bsd-3-clause | 1,001 |
from numba import jit, jitclass, float64
@jit(nopython=True)
def _Radiance_LOW(x):
# Radiance.LOW: inv_ramp(x1=0, x2=50)
if x < 0.0:
return 1.0
if x > 50.0:
return 0.0
return 1.0 - (x - 0.0) / (50.0 - 0.0)
@jit(nopython=True)
def _Radiance_MIDDLE(x):
# Radiance.MIDDLE: triangle(... | forman/dectree | dectree_test.py | Python | mit | 4,879 |
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: keep the secret key used in... | Starbow/StarbowWebSite | starbowmodweb/example.config.py | Python | mit | 2,461 |
# proxy module
from __future__ import absolute_import
from apptools.permissions.default.i_user_database import *
| enthought/etsproxy | enthought/permissions/default/i_user_database.py | Python | bsd-3-clause | 113 |
# flashcube.console.color
# Sets up a terminal color scheme-- learned from Django.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Fri Oct 16 20:55:26 2015 -0400
#
# Copyright (C) 2015 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: __init__.py [] benjamin@bengfort.com $
"""
Sets up... | bbengfort/flashcube | flashcube/console/color/__init__.py | Python | apache-2.0 | 1,580 |
# coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/storage/azure-storage-file-datalake/samples/datalake_samples_access_control_recursive_async.py | Python | mit | 5,962 |
"""
Shim to maintain backwards compatibility with old frontend imports.
We have moved all contents of the old `frontend` subpackage into top-level
subpackages (`html`, `qt` and `terminal`), and flattened the notebook into
just `IPython.html`, formerly `IPython.frontend.html.notebook`.
This will let code that was maki... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/frontend.py | Python | bsd-2-clause | 1,123 |
from .blender_utils import *
from .blender_controllers import *
from .blender_joint_state_publisher import *
from .blender_target_listener import *
from .blender_joint_trajectory_server import *
| geni-lab/ros_blender_bridge | src/ros_blender_bridge/__init__.py | Python | bsd-3-clause | 195 |
# coding: utf-8
# SciELO journals.csv (from reports analytics)
scielo_columns_names = [
'extraction_date',
'study_unit',
'collection',
'issn_scielo',
'issns',
'title',
'title_thematic_areas',
'title_is_agricultural_sciences',
'title_is_applied_social_sciences',
'title_is_biological_sciences',
'title_is_engi... | ednilson/journals-catalog | jcatalog/keycorrection.py | Python | bsd-2-clause | 7,184 |
# Copyright 2017 Janos Czentye
#
# 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, s... | hsnlab/escape | escape/escape/api/rest_API.py | Python | apache-2.0 | 19,904 |
__author__ = 'chenzheng'
def addself(x,y):
return x+y | czhengsci/nano266 | Chen_Script/sef_define_function.py | Python | bsd-3-clause | 58 |
from lxml import etree
from moai.utils import XPath
class ExampleContent(object):
def __init__(self, provider):
self.provider = provider
self.id = None
self.modified = None
self.deleted = None
self.sets = None
self.metadata = None
def update(self, path):
... | infrae/moai | moai/example.py | Python | bsd-3-clause | 2,205 |
from __future__ import (absolute_import, division, print_function)
import unittest
from mantid import logger
# noinspection PyUnresolvedReferences
from mantid.simpleapi import mtd, Abins, Scale, CompareWorkspaces, Load, DeleteWorkspace
from AbinsModules import AbinsConstants, AbinsTestHelpers
import numpy as np
def o... | wdzhou/mantid | Framework/PythonInterface/test/python/plugins/algorithms/AbinsBasicTest.py | Python | gpl-3.0 | 10,223 |
# (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... | tux-00/ansible | lib/ansible/cli/vault.py | Python | gpl-3.0 | 16,104 |
from __future__ import unicode_literals
__version__ = "0.3"
| buddylindsey/dj-blog | djblog/__init__.py | Python | bsd-3-clause | 61 |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import ListedColormap
def plot_decision_regions(X,y,classifier,resolution = 0.02):
#setup marker generator and color map
markers = ('s','x','o','^','v')
colors = ('red','blue','lightgreen','gray','cyan')
cmap = ListedColormap(co... | PhenixI/machine-learning | 1_supervised_classification/6-Perceptron and Neural Networks/Perceptron_python/DecisionBoundary.py | Python | gpl-2.0 | 970 |
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# Copyright (c) 2013 Masami HIRATA <msmhrt@gmail.com>
from unittest import TestCase
class TestPy3venv(TestCase):
def test_sys_attrs(self):
from itertools import product
import os
import sys
plugin_dir = os.path.dirname(os.path.dirn... | msmhrt/py3venv.vim | tests/test_py3venv.py | Python | bsd-2-clause | 5,795 |
# -*- coding: utf-8 -*-
"""
This package allows you to add information to your Ipython notebook,
if you're working in a git repository.
It is usefull if you want to verify the notebook version.
This package is collecting all information by its own,
so you don't need to set any repository path.
You also can check the in... | ktakagaki/kt-2015-DSPHandsOn | MedianFilter/Python/gitInformation.py | Python | gpl-2.0 | 4,393 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-03 09:41
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('fdi', '0008_investments_company_country'),
('fdi', '0009_auto_20170929_0956'),
]
op... | UKTradeInvestment/export-wins-data | fdi/migrations/0010_merge_20171003_0941.py | Python | gpl-3.0 | 339 |
# -*- encoding: 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, Version 2.0
# (the ... | MLnick/spark | python/pyspark/sql/tests.py | Python | apache-2.0 | 110,593 |
import requests
from dbaas_credentials.models import CredentialType
from util import get_credentials_for, get_credentials_in_any_env
from slugify import slugify
class TeamNotFoundError(Exception):
pass
class TeamAPIError(Exception):
pass
class Teams(object):
def __init__(self, env=None):
self.... | globocom/database-as-a-service | dbaas/util/teams.py | Python | bsd-3-clause | 1,468 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-16 06:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0035_imagestore'),
]
operations = [
migrations.AddField(
... | semitki/semitki | api/sonetworks/migrations/0036_post_publish_id.py | Python | mit | 483 |
#!/usr/bin/python -tt
# 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) any later version.
#
# This program is distributed in the hope that ... | pnasrat/yum-utils | yum-builddep.py | Python | gpl-2.0 | 9,873 |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import pytest
from osbs.build.spec import BuildIDParam
from osbs.exceptions import OsbsValidationException
class TestBuildIDParam(object):
... | pombredanne/osbs-client | tests/build/test_spec.py | Python | bsd-3-clause | 638 |
# -*- 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, Version 2.0 (the
#... | akosel/incubator-airflow | airflow/www_rbac/views.py | Python | apache-2.0 | 90,437 |
# See http://cens.ioc.ee/projects/f2py2e/
from __future__ import division, print_function
from numpy.f2py.f2py2e import main
main()
| ryfeus/lambda-packs | pytorch/source/numpy/f2py/__main__.py | Python | mit | 134 |
../../../../../../../share/pyshared/orca/scripts/toolkits/CALLY/script.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/orca/scripts/toolkits/CALLY/script.py | Python | gpl-3.0 | 73 |
from structure import Structure
import math, numpy, gzip
# Reformatting of lines in structure file
pdbAtomLine = "ATOM %5d %4s%4s %1s%4d%1s %8.3f%8.3f%8.3f%6.2f%6.2f\n"
pdbBoxLine = "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f P 1 1\n"
# Conversion from ... | Tsjerk/MartiniTools | gmx/conf/pdb.py | Python | gpl-2.0 | 3,484 |
"""
livereload
~~~~~~~~~~
A python version of livereload.
:copyright: (c) 2013 by Hsiaoming Yang
"""
__version__ = '2.4'
__author__ = 'Hsiaoming Yang <me@lepture.com>'
__homepage__ = 'https://github.com/lepture/python-livereload'
from .server import Server, shell
__all__ = ('Server', 'shell')
| mgedmin/python-livereload | livereload/__init__.py | Python | bsd-3-clause | 315 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Bin Tan
# This file is distributed under the BSD Licence. See python-epub-builder-license.txt for details.
import itertools
import mimetypes
import os
import shutil
import subprocess
import uuid
import zipfile
from genshi.template import TemplateLoader
from l... | ChrisCinelli/pgessays | epub.py | Python | bsd-2-clause | 12,318 |
import numpy as np
import matplotlib.pyplot as plt
from binmap_manipulation import read_binmap
from xcm import grab_data
from collections import OrderedDict
from bokeh.plotting import figure, show, output_file, ColumnDataSource
from bokeh.models import HoverTool
def plot_patches(root, binmap, xcm_id,
out='bok... | gogrean/BokehAstroMaps | idv_plot.py | Python | gpl-3.0 | 2,661 |
from django.http import Http404, HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from .urls import url
from django.shortcuts import render
# from .forms import UploadFileForm
from .models import User, Music, Tra... | bdeloeste/unnamed-sxsw-hack | musicstreaming/views.py | Python | mit | 2,895 |
from functools import wraps
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cache import CacheMiddleware
def cache_page(*args, **kwargs):
"""
Decorator for views that tri... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/views/decorators/cache.py | Python | bsd-3-clause | 3,975 |
#!/usr/bin/python3
import logging
import json
import os
import sys
def post_results (gl_trigger):
msg = "CentOS Testing Summary\n\n"
msg+="Aborted by the new run"
gl_trigger.post_commit_comment(msg)
def set_gitlab (trigger_data, gl_token):
with open("/etc/python-gitlab.cfg", "w") as cfg:
cfg.... | NetworkManager/NetworkManager-ci | run/centos-ci/pipeline_cancel.py | Python | gpl-3.0 | 1,792 |
"""
# Notes:
- This simulation seeks to emulate the COBAHH benchmark simulations of (Brette
et al. 2007) using the Brian2 simulator for speed benchmark comparison to
DynaSim. However, this simulation includes CLOCK-DRIVEN synapses, for direct
comparison to DynaSim's clock-driven architecture. The synaptic connec... | asoplata/dynasim-benchmark-brette-2007 | Brian2/brian2_benchmark_COBAHH_clocksyn_hidens_compiled_16000.py | Python | gpl-3.0 | 3,915 |
from __future__ import unicode_literals
from django.core.cache import caches, InvalidCacheBackendError
from django.core.cache.utils import make_template_fragment_key
from django.template import Library, Node, TemplateSyntaxError, VariableDoesNotExist
register = Library()
class CacheNode(Node):
def __init__(self... | 912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/templatetags/cache.py | Python | gpl-2.0 | 3,380 |
"""Adhocracy frontend customization package."""
import os
import version
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
requires = ['adhocracy_frontend',
... | liqd/adhocracy3.mercator | src/demo/setup.py | Python | agpl-3.0 | 1,580 |
"""
Audio elements with beats
"""
import time
from audio import bpms, pause
from thread import start_new_thread as snt
def play(channel, song, beat_id):
"""
Play the given element.
Open this in threads.
"""
while True:
if pause[beat_id] == 0:
snt(_play, (channel, song))
... | axay/eigen | server/elements.py | Python | artistic-2.0 | 592 |
# Copyright (c) 2010, Mats Kindahl, Charles Bell, and Lars Thalmann
# All rights reserved.
#
# Use of this source code is goverened by a BSD licence that can be
# found in the LICENCE file.
"""Module for browsing and parsing binary logs.
"""
UNKNOWN_EVENT = 0
START_EVENT = 1
QUERY_EVENT = 2
STOP_EVENT = 3
ROTATE_EVEN... | lyremelody/mysql-replicant-python | lib/mysql/replicant/binary_log.py | Python | bsd-3-clause | 16,462 |
# Copyright 2015 Carnegie Mellon University
#
# 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 i... | litong01/python-monasca | kiloeyes/microservice/threshold_processor.py | Python | apache-2.0 | 13,560 |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
... | HomeRad/TorCleaner | wc/dns/rdtypes/ANY/RT.py | Python | gpl-2.0 | 934 |
# -*- coding: utf-8 -*-
__all__ = [
'catalogmodels',
'dbconnect',
'init_models',
'mixins',
'non_relation_data',
'pagemodels',
'usermodels',
'utilmodels',
'migrate'
]
| unclechu/avto-lux161 | avto-lux/app/models/__init__.py | Python | agpl-3.0 | 176 |
import os
from os.path import join, isfile
from distutils.core import setup
setup(name="tlspect",
version="0.1",
description="TLS scanner",
long_description="""A SSL/TLS configuration scanner, determines TLS versions, ciphersuites used and x509 certificate information.""",
lic... | su-vikas/pytlspect | setup.py | Python | mit | 518 |
"""The tests for the time automation."""
from datetime import timedelta
import pytest
import voluptuous as vol
from homeassistant.components import automation, sensor
from homeassistant.components.homeassistant.triggers import time
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, SERVICE_TURN_OFF
fr... | tboyce021/home-assistant | tests/components/homeassistant/triggers/test_time.py | Python | apache-2.0 | 17,984 |
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
from b2.build import type
def register ():
type.register_type ('EXE', ['exe'], None, ['NT', 'CYGWIN'])
type.register_type ('EX... | NixaSoftware/CVis | venv/bin/tools/build/v2/tools/types/exe.py | Python | apache-2.0 | 351 |
#!/usr/bin/python3
import re,sys, getopt
###################
# 01/03/2014 [JM] #
###################
def usage():
print ("""
#####################################################
# rmSubSetsFromGrp.py -g groups.grp -o new.grp -r #
#####################################################
options... | janinamass/gardening | Scythe/src/deprecated/rmSubsetsFromGrp.py | Python | gpl-3.0 | 13,791 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
#
# A Jira shell (using the Jira XML-RPC API).
#
# <https://confluence.atlassian.com/display/JIRA042/Creating+a+XML-RPC+Client>
# <http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/xmlrpc/XmlRpcService.html>
#
__version__ = "1.6.... | m42e/jirash | lib/jirashell.py | Python | mit | 48,170 |
# snapshot_enable.py
"""Create a block storage snapshot [ENABLE]."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
@click.command()
@click.argument('volume_id')
@click.option('--schedule-type',
help='Snapshot schedule [HOURLY|DAILY|WEEKLY]',
... | skraghu/softlayer-python | SoftLayer/CLI/block/snapshot/enable.py | Python | mit | 2,162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.