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 |
|---|---|---|---|---|---|
import pytest
from django.test import RequestFactory
from iati.factory import iati_factory
from api.sector import serializers
class TestSectorSerializers:
request_dummy = RequestFactory().get('/')
def test_SectorSerializer(self):
sector = iati_factory.SectorFactory.build(
code=10,
... | tokatikato/OIPA | OIPA/api/sector/tests/test_serializers.py | Python | agpl-3.0 | 1,865 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.db.models imp... | shoopio/shoop | shuup/admin/modules/product_types/views/list.py | Python | agpl-3.0 | 1,214 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from udata.api import api, fields, API
from udata.auth import current_user
from .actions import get_notifications
notifs = api.namespace('notifications', 'Notifications API')
notifications_fields = api.model('Notification', {
'type': fields.String(... | jphnoel/udata | udata/features/notifications/api.py | Python | agpl-3.0 | 951 |
# Copyright 2015-2016 Matthieu Dietrich (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
import datetime
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class FetchmailServer(models.Model):
... | brain-tec/server-tools | mail_cleanup/models/fetchmail_server.py | Python | agpl-3.0 | 4,725 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NoC TBM simulation support - Utilities
# This module declares additional helper functions
#
# Author: Oscar Diaz
# Version: 0.2
# Date: 17-03-2011
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | dargor0/nocmodel | nocmodel/noc_tbm_utils.py | Python | lgpl-2.1 | 2,287 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module implements the concept of Dictionary -- a mapping between words and
their integer ids.
Dictionaries can be created fro... | nvoron23/gensim | gensim/corpora/dictionary.py | Python | lgpl-3.0 | 16,434 |
#!/usr/bin/env python
from pymt import *
class DoubleTapIndicator(MTWidget):
def __init__(self, **kwargs):
self.red = True
w = getWindow()
self.diameter = max(min(*w.size)/8., 20)
kwargs["size"] = (self.diameter, ) * 2
super(DoubleTapIndicator, self).__init__(**kwargs)
... | nuigroup/pymt-widgets | pymt/tools/calibration/doubletap.py | Python | lgpl-3.0 | 4,053 |
import os
from setuptools import setup, find_packages
base_dir = os.path.dirname(__file__)
about = {}
with open(os.path.join(base_dir, "flake8_import_order", "__about__.py")) as f:
exec(f.read(), about)
with open(os.path.join(base_dir, "README.rst")) as f:
long_description = f.read()
setup(
name=about... | PyCQA/flake8-import-order | setup.py | Python | lgpl-3.0 | 2,353 |
###############################################################
# Copyright 2020 Lawrence Livermore National Security, LLC
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
#
# This file is part of the Flux resource manager framework.
# For details, see https://github.com/flux-framework.
#
# SPDX-License-Identifier: LGPL-3.0
####... | grondo/flux-core | src/bindings/python/flux/job/event.py | Python | lgpl-3.0 | 7,000 |
__author__ = 'sunnyday'
| synnyday/test_ss | test_ss/management/commands/__init__.py | Python | unlicense | 24 |
"""myproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | thinkAmi-sandbox/Django_separate_model_file-sample | myproject/urls.py | Python | unlicense | 765 |
# a head script for InMoov
inMoov = Runtime.createAndStart("inMoov", "InMoov")
# variables to adjust
leftSerialPort = "COM7"
cameraIndex = 1
# attach an arduino to InMoov
# possible board types include uno atmega168 atmega328p atmega2560 atmega1280 atmega32u4
# the MRLComm.ino sketch must be loaded into the ... | sujitbehera27/MyRoboticsProjects-Arduino | src/resource/Python/examples/InMoov.head.py | Python | apache-2.0 | 1,449 |
# Copyright 2017 Red Hat, 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 required by... | jiazichenzhan/Server_Manage_Plugin | ironic-plugin-pike/ironic/drivers/modules/bmc_redfish/power.py | Python | apache-2.0 | 5,932 |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | blueboxgroup/keystone | keystone/token/providers/common.py | Python | apache-2.0 | 26,928 |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/startup_test/results_view.py | Python | apache-2.0 | 6,045 |
import os
import shutil
import json
import tempfile
import logging
from avatar.util.ostools import get_random_free_port
from collections import OrderedDict
log = logging.getLogger(__name__)
class S2EConfiguration():
def __init__(self, config):
assert("s2e" in config) #S2E configuration must be present
... | jmatthed/avatar-python | avatar/emulators/s2e/configuration.py | Python | apache-2.0 | 16,144 |
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/l... | Juniper/nova | nova/virt/libvirt/storage/dmcrypt.py | Python | apache-2.0 | 3,393 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... | googleapis/python-language | google/cloud/language_v1beta2/services/language_service/__init__.py | Python | apache-2.0 | 773 |
#!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | daydayuplo/gee | earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py | Python | apache-2.0 | 61,989 |
"""Certbot constants."""
import os
import logging
from acme import challenges
SETUPTOOLS_PLUGINS_ENTRY_POINT = "certbot.plugins"
"""Setuptools entry point group name for plugins."""
OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
"""Plugins Setuptools entry point before rename."""
CLI_DEFAULTS = dict(
... | bsmr-misc-forks/letsencrypt | certbot/constants.py | Python | apache-2.0 | 2,789 |
"""
Support for AlarmDecoder-based alarm control panels (Honeywell/DSC).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdecoder/
"""
import asyncio
import logging
from homeassistant.core import callback
from homeassistant.helper... | JshWright/home-assistant | homeassistant/components/alarm_control_panel/alarmdecoder.py | Python | apache-2.0 | 3,884 |
# -*- coding: utf-8 -*-
import json
import time
import copy
import math
import subprocess
import re
from requests_toolbelt import MultipartEncoder
from . import config
def getVideoInfo(filename):
res = {}
try:
terminalResult = subprocess.Popen(["ffprobe", filename],
... | Diapostrofo/instabot | instabot/api/api_video.py | Python | apache-2.0 | 5,431 |
from past.builtins import basestring
import os
import itertools
import builtins
import json
import logging
import warnings
from math import ceil
from contextlib import contextmanager
from django.apps import apps
from django.db import connection
from django.db.migrations.operations.base import Operation
from osf.mode... | adlius/osf.io | osf/utils/migrations.py | Python | apache-2.0 | 22,296 |
from pydruid.db.api import connect
from pydruid.db.exceptions import (
DataError,
DatabaseError,
Error,
IntegrityError,
InterfaceError,
InternalError,
NotSupportedError,
OperationalError,
ProgrammingError,
Warning,
)
__all__ = [
"connect",
"apilevel",
"threadsafety"... | kawamon/hue | desktop/core/ext-py/pydruid-0.5.11/pydruid/db/__init__.py | Python | apache-2.0 | 653 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/v2alpha1_pods_metric_source.py | Python | apache-2.0 | 4,518 |
# -*- coding: utf-8 -*-
"""The FileVault Drive Encryption (FVDE) file-like object."""
import pyfvde
from dfvfs.file_io import file_object_io
from dfvfs.lib import errors
from dfvfs.lib import fvde_helper
from dfvfs.resolver import resolver
class FVDEFile(file_object_io.FileObjectIO):
"""File input/output (IO) obj... | joachimmetz/dfvfs | dfvfs/file_io/fvde_file_io.py | Python | apache-2.0 | 1,458 |
# Import the bemio.mesh_utilities module
from bemio.mesh_utilities import mesh
import numpy as np
# Read WAMIT mesh
sphere = mesh.read(file_name='sphere.gdf')
# Save to a NEMOH mesh
sphere.write(mesh_format='NEMOH')
| bradling/WEC-Sim | tutorials/BEMIO/NEMOH/Sphere/Mesh/run.py | Python | apache-2.0 | 218 |
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | opencord/xos | lib/xos-genx/xosgenx/jinja2_extensions/checklib.py | Python | apache-2.0 | 2,894 |
from django.contrib import admin
from import_export import resources, fields
from import_export.widgets import ForeignKeyWidget, ManyToManyWidget
from import_export.admin import ImportExportModelAdmin
from simple_history.admin import SimpleHistoryAdmin
from .models import *
from workflow.models import Sector, Workflow... | toladata/TolaActivity | indicators/admin.py | Python | apache-2.0 | 4,660 |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | foursquare/commons-old | src/python/twitter/pants/commands/filemap.py | Python | apache-2.0 | 1,912 |
# Copyright 2014 Koert van der Veer
# 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... | ondergetekende/logshipper | logshipper/test/test_command.py | Python | apache-2.0 | 3,240 |
'''
Copyright 2017 Roy E. Lowrance
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
d... | rlowrance/python_lib | applied_data_science3/pickle_utilities.py | Python | apache-2.0 | 1,681 |
#!/usr/bin/python
#
# Hosts artifacts via a local HTTP service.
# Produces a universe, and puts it in a host dir, then runs an HTTP server against that dir.
#
# Env:
# HTTP_DIR (default: /tmp/dcos-http-<pkgname>/)
# HTTP_HOST (default: 172.17.0.1, which is the ip of the VM when running dcos-docker)
# HTTP_PORT (d... | adragomir/dcos-commons | tools/publish_http.py | Python | apache-2.0 | 10,036 |
# Copyright (c) 2013 OpenStack Foundation
# 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 ... | projectcalico/calico-neutron | neutron/plugins/ml2/drivers/type_gre.py | Python | apache-2.0 | 5,810 |
"""Fast Shared Response Model (FastSRM)
The implementation is based on the following publications:
.. [Richard2019] "Fast Shared Response Model for fMRI data"
H. Richard, L. Martin, A. Pinho, J. Pillow, B. Thirion, 2019
https://arxiv.org/pdf/1909.12537.pdf
"""
# Author: Hugo Richard
import hashlib
import lo... | brainiak/brainiak | brainiak/funcalign/fastsrm.py | Python | apache-2.0 | 65,510 |
# -*- coding: utf-8 -*-
from couchdb.design import ViewDefinition
from openprocurement.api import design
FIELDS = [
'planID',
]
CHANGES_FIELDS = FIELDS + [
'dateModified',
]
def add_design():
for i, j in globals().items():
if "_view" in i:
setattr(design, i, j)
plans_all_view = Vie... | gorserg/openprocurement.planning.api | openprocurement/planning/api/design.py | Python | apache-2.0 | 2,854 |
# -*- coding: utf-8 -*-
'''
Module for managing logrotate.
'''
from __future__ import absolute_import
# Import python libs
import os
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
default_conf = '/etc/logrotate.conf'
# Define a function alias in order not to shadow built-in's... | stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/modules/logrotate.py | Python | apache-2.0 | 5,730 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012 Red Hat, 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... | sacharya/nova | nova/tests/virt/test_virt_disk_vfs_localfs.py | Python | apache-2.0 | 15,688 |
from setuptools import setup
install_requires = [
'psycopg2',
]
setup(
name='cockroachdb',
version='0.2.1',
author='Cockroach Labs',
author_email='cockroach-db@googlegroups.com',
url='https://github.com/cockroachdb/cockroachdb-python',
description='CockroachDB adapter for SQLAlchemy',
... | bdarnell/cockroachdb-python | setup.py | Python | apache-2.0 | 806 |
# Copyright 2014 Red Hat, 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... | apporc/nova | nova/tests/unit/test_hacking.py | Python | apache-2.0 | 26,493 |
# Copyright 2014 Mellanox Technologies, 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 agreed t... | sebrandon1/neutron | neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py | Python | apache-2.0 | 16,900 |
# Copyright 2016 Mirantis 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 required by... | openstack/osprofiler | osprofiler/drivers/mongodb.py | Python | apache-2.0 | 4,425 |
# -*- coding: utf-8 -*-
#
# google-cloud-storage documentation build configuration file
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values t... | dhermes/gcloud-python | storage/docs/conf.py | Python | apache-2.0 | 10,612 |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | openstack/keystone | keystone/resource/backends/base.py | Python | apache-2.0 | 8,923 |
"""
Support for Dovado router.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.dovado/
"""
import logging
import re
from datetime import timedelta
import voluptuous as vol
from homeassistant.helpers.entity import Entity
from homeassistant.util im... | tinloaf/home-assistant | homeassistant/components/sensor/dovado.py | Python | apache-2.0 | 5,408 |
# 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
# d... | bswartz/manila | manila/tests/api/v2/test_share_group_type_specs.py | Python | apache-2.0 | 14,031 |
# Copyright 2014, Jeff Buttars, A10 Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | mdurrant-b3/acos-client | acos_client/v30/overlay/options.py | Python | apache-2.0 | 1,933 |
"""
Preliminary code for submissions on the
Microsoft Malware Classification challenge.
"""
__authors__ = 'Aaron Gonzales, Andres Ruiz'
__licence__ = 'Apache'
__email__ = 'afruizc@cs.unm.edu'
import sys, os, argparse
import numpy as np
from sklearn import linear_model
from sklearn.feature_extraction import DictVector... | afruizc/microsoft_malware_challenge | src/models/svm_bytecode/svm_bytecode.py | Python | apache-2.0 | 6,432 |
#
# Copyright (c) 2010-2014, MIT Probabilistic Computing Project
#
# Lead Developers: Jay Baxter and Dan Lovell
# Authors: Jay Baxter, Dan Lovell, Baxter Eaves, Vikash Mansinghka
# Research Leads: Vikash Mansinghka, Patrick Shafto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... | JDReutt/BayesDB | bayesdb/tests/test_client.py | Python | apache-2.0 | 36,133 |
# 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... | cshallue/models | research/object_detection/models/faster_rcnn_pnas_feature_extractor.py | Python | apache-2.0 | 12,248 |
"""
Load tables/views
"""
import yaml
import re
from jnpr.junos.factory import FactoryLoader
from os.path import splitext
def _preprocess_yml(path):
"""Dynamically create PY3 version of the file by re-writing 'unicode' to 'str'."""
with open(path) as f:
tmp_yaml = f.read()
return re.sub(r"unicode"... | spotify/napalm | napalm/junos/utils/junos_views.py | Python | apache-2.0 | 621 |
# 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... | Huyuwei/tvm | topi/python/topi/cuda/reduction.py | Python | apache-2.0 | 6,024 |
'''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... | barry-scott/git-workbench | Source/Common/wb_main_window.py | Python | apache-2.0 | 6,870 |
#!/usr/bin/python
import json
import os.path
import re
import subprocess
zs_api_config_file = '/.zsapi.ini'
zs_api_target = 'localadmin'
if os.path.isfile("/usr/local/zend/bin/zs-client.sh"):
directives_details = subprocess.check_output(["/usr/local/zend/bin/zs-client.sh", "configurationDirectivesList", "--target... | ubellavance/ZendServerPuppet | facts.d/get_directives_details.py | Python | apache-2.0 | 967 |
# Out of order to fix circular import
from .term_reordering import (
chemist_ordered,
normal_ordered,
normal_ordered_ladder_term,
normal_ordered_quad_term,
reorder,
)
from .binary_codes import (
linearize_decoder,
checksum_code,
bravyi_kitaev_code,
jordan_wigner_code,
parity_cod... | quantumlib/OpenFermion | src/openfermion/transforms/opconversions/__init__.py | Python | apache-2.0 | 1,702 |
"""Provides tools for parsing and writing to a csv file.
"""
import collections
from typing import List, OrderedDict, Tuple, Union
import xlsxwriter
import pyexcel
from xlsxwriter.format import Format
from outputresult import OutputResult, ColumnStyle
Workbook = OrderedDict[str, List[List[str]]]
# The name for the r... | rcordovano/autopsy | release_scripts/localization_scripts/excelutil.py | Python | apache-2.0 | 2,871 |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | quattor/aquilon | tests/broker/test_del_dns_environment.py | Python | apache-2.0 | 2,135 |
#!/usr/bin/env python
import re
import sys
MINTEDOPS = r""" [
framesep=2mm,
baselinestretch=1.2,
fontsize=\footnotesize,
breaklines,
linenos
]
"""
MINTLANGMAPS={r'F\#': 'ocaml',
'Fsharp': 'ocaml',
'Scala': 'javascript',
'Go': 'go'}
def main():
... | adrian17/ColossalOpera | book/process.py | Python | artistic-2.0 | 2,667 |
from __future__ import unicode_literals
try:
from django.urls import re_path, include
except ImportError:
# For Django 1.8 compatibility
from django.conf.urls import url as re_path, include
from django.contrib import admin
from django.shortcuts import render
from forms_builder.forms.models import Form
fro... | nimbis/django-forms-builder | forms_builder/example_project/urls.py | Python | bsd-2-clause | 632 |
# subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""Subprocesses with ... | xyuanmu/XX-Net | python3.8.2/Lib/subprocess.py | Python | bsd-2-clause | 77,289 |
#!/usr/bin/env python3
import cmd
import sqlite3
import sys
import os
import requests
from time import sleep
from terminaltables import AsciiTable
from cme.msfrpc import Msfrpc, MsfAuthError
import configparser
from cme.loaders.protocol_loader import protocol_loader
from requests import ConnectionError
# The following... | jorik041/CrackMapExec | cme/cmedb.py | Python | bsd-2-clause | 10,376 |
import numpy
import glob
import double_hitfinder
from os import listdir
filepath = '/home/toli/Python/Test_and_Learning/data/'
image_names = listdir(filepath)
print 'found data:'
print image_names
#image_names = glob.glob('r0074*.dat')
print 'load first image'
img = numpy.loadtxt(filepath + image_names[0], delimiter =... | SPIhub/hummingbird | examples/in-flight-holography/calc_hitscores.py | Python | bsd-2-clause | 732 |
# coding: utf-8
from __future__ import unicode_literals
import inspect
import pickle
import re
import unittest
from collections import Mapping
import pytest
from django.db import models
from rest_framework import fields, relations, serializers
from rest_framework.compat import unicode_repr
from rest_framework.fields... | kgeorgy/django-rest-framework | tests/test_serializer.py | Python | bsd-2-clause | 21,976 |
from django.db.models import get_model
from django.conf import settings
from cms.models import Placeholder
from cms.models.pluginmodel import CMSPlugin
from cms.plugins.text.models import Text
from cms.api import add_plugin
def convert(action = "dryrun"):
# this dictionary store the information for the co... | evildmp/Arkestra | housekeeping/convert_to_placeholders.py | Python | bsd-2-clause | 9,889 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2012, Yung-Yu Chen <yyc@solvcon.net>
#
# 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 copyrigh... | yungyuc/solvcon | solvcon/parcel/linear/solver.py | Python | bsd-3-clause | 8,514 |
import sys
import os.path
import numpy as np
from numpy.testing import *
from numpy.testing.decorators import skipif
from skimage import data_dir
from skimage.io import ImageCollection, MultiImage
from skimage.io.collection import alphanumeric_key
from skimage.io import Image as ioImage
try:
from PIL import Ima... | emmanuelle/scikits.image | skimage/io/tests/test_collection.py | Python | bsd-3-clause | 5,053 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2018-07-14
# @Filename: aperture.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu)
# @Last modified time: 2018-07-27 13:02:... | sdss/marvin | python/marvin/tools/mixins/aperture.py | Python | bsd-3-clause | 9,499 |
import unittest
from graphserver.core import *
from random import randint
class TestTripBoard(unittest.TestCase):
def test_basic(self):
sc = ServiceCalendar()
sc.add_period( 0, 1*3600*24, ['WKDY','SAT'] )
tz = Timezone()
tz.add_period( TimezonePeriod(0, 1*3600*24, 0) )
... | graphserver/graphserver | pygs/test/unit_test/test_tripboard.py | Python | bsd-3-clause | 17,728 |
from __future__ import unicode_literals
import datetime
import re
from datetime import date
from decimal import Decimal
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.forms.models import (_get_foreign_key, inlineformset_factory,
modelforms... | liavkoren/djangoDev | tests/model_formsets/tests.py | Python | bsd-3-clause | 70,571 |
import socket, cPickle
import Config, PickleSocket, Gps
def makeClient( host = "localhost" , port = Config.PORT , direct = False , dummy = False , ignoreLostPackets = False ) :
if dummy : #just simulate the resources
return DummyResources()
elif direct : #skip the server, directly connect to the r... | fresskarma/tinyos-1.x | contrib/ucb/apps/Monstro/lib/Robot/Client.py | Python | bsd-3-clause | 2,663 |
from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
Plot, DataRange1d, LinearAxis, ColumnDataSource, PanTool, WheelZoomTool
)
from bokeh.resources import INLIN... | maxalbert/bokeh | examples/glyphs/colorspec.py | Python | bsd-3-clause | 2,151 |
# -*- coding:utf-8 -*-
from django.views.generic.base import RedirectView
from django.core.urlresolvers import reverse
from registration.models import UserRegistration
class HomeView(RedirectView):
def get_user_registration(self):
return self.request.user.userregistration
def get_redirect_url(self):... | hellhovnd/dentexchange | dentexchange/apps/home/views.py | Python | bsd-3-clause | 625 |
"""
Copyright (C) 2012 Raniere Silva <ra092767@ime.unicamp.br>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is... | r-gaia-cs/dotfiles | .newsbeuter/newsbeuter-fb.py | Python | bsd-3-clause | 2,527 |
from django.apps import AppConfig
class TextImageConfig(AppConfig):
name = 'glitter.blocks.text_image'
label = 'glitter_text_image'
| developersociety/django-glitter | glitter/blocks/text_image/apps.py | Python | bsd-3-clause | 142 |
from base.utils import get_model_object
from challenges.models import Challenge
from .models import ChallengeHost, ChallengeHostTeam
def get_challenge_host_teams_for_user(user):
"""Returns challenge host team ids for a particular user"""
return ChallengeHost.objects.filter(user=user).values_list('team_name',... | taranjeet/EvalAI | apps/hosts/utils.py | Python | bsd-3-clause | 685 |
# -*- coding: utf-8 -*-
"""Mayavi/traits GUI visualization elements."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD-3-Clause
import numpy as np
from mayavi.mlab import pipeline, text3d
from mayavi.modules.glyph import Glyph
from mayavi.modules.surface import Surface
from mayavi.sources... | bloyl/mne-python | mne/gui/_viewer.py | Python | bsd-3-clause | 22,230 |
#!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script for generating the Android framework's version of Skia from gyp
files.
"""
import os
import shutil
import sys
import tempfile
# Find the top of trunk
SCRI... | DiamondLovesYou/skia-sys | platform_tools/android/bin/gyp_to_android.py | Python | bsd-3-clause | 9,176 |
'''
Write the sequence of each exon to a seperate text file.
'''
from seq_generator import *
import os
g = Genome()
for gene, exon_count in g.genes_exons():
for exon in range(int(exon_count)):
seq = g.sequence(gene, exon)
filename = "{0}_{1}".format(gene, exon)
path = os.path.join('static/data/GRCh37_exons/', ... | sanjanalab/GUIDES | seperate_exons.py | Python | bsd-3-clause | 426 |
#!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (c) 2001-2004, MetaSlash Inc. All rights reserved.
# Portions Copyright (c) 2005, Google, Inc. All rights reserved.
"""
Check python source code files for possible errors and print warnings
Contact Info:
http://pychecker.sourcefo... | smspillaz/pychecker | pychecker/checker.py | Python | bsd-3-clause | 7,420 |
from django.test import TestCase, RequestFactory
from unittest import skip
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Permission
from django.contrib.sessions.middleware import SessionMiddleware
from collections import OrderedDict
from urllib import urlencode
from django.ut... | grovesr/django-ims | ims_tests/tests.py | Python | bsd-3-clause | 252,503 |
# -*- coding: utf-8 -*-
"""
logbook.queues
~~~~~~~~~~~~~~
This module implements queue backends.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import json
import threading
from threading import Thread, Lock
import platform
from logbook.base ... | alonho/logbook | logbook/queues.py | Python | bsd-3-clause | 21,606 |
"""
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.
"""
from __future__ import print_function, absolute_import, unicode_literals
import json
import logging
from osbs.utils import graceful_chain_ge... | pombredanne/osbs-client | osbs/build/pod_response.py | Python | bsd-3-clause | 1,266 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Spectrogram decomposition
=========================
.. autosummary::
:toctree: generated/
decompose
hpss
"""
import numpy as np
from scipy.ndimage import median_filter
import sklearn.decomposition
from . import core
from . import cache
from . import uti... | decebel/librosa | librosa/decompose.py | Python | isc | 10,427 |
#!/usr/bin/env python
from __future__ import print_function
from random import randint
from time import sleep
from progress.bar import (Bar, ChargingBar, FillingSquaresBar,
FillingCirclesBar, IncrementalBar, ShadyBar)
from progress.spinner import Spinner, PieSpinner, MoonSpinner, LineSpinne... | RazerM/progress | test_progress.py | Python | isc | 1,259 |
from django import template
register = template.Library()
def get_seconds_ts(timestamp):
return timestamp.strftime("%S")
def get_miliseconds_ts(timestamp):
return timestamp.strftime("%f")
register.filter(get_seconds_ts)
register.filter(get_miliseconds_ts)
| MGautier/security-sensor | trunk/version-1-0/webapp/secproject/secapp/templatetags/handlers.py | Python | mit | 273 |
import sqlite3
import time
import urllib
import zlib
import string
conn = sqlite3.connect('index.sqlite')
conn.text_factory = str
cur = conn.cursor()
cur.execute('''SELECT subject_id,subject FROM Messages
JOIN Subjects ON Messages.subject_id = Subjects.id''')
counts = dict()
for message_row in cur :
text = m... | johanfrisk/Python_at_web | notebooks/code/gmane/gword.py | Python | mit | 1,440 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains some math utils that are used in the chemenv package.
"""
__author__ = "David Waroquiers"
__copyright__ = "Copyright 2012, The Materials Project"
__credits__ = "Geoffroy Hautier"
__ve... | gmatteo/pymatgen | pymatgen/analysis/chemenv/utils/math_utils.py | Python | mit | 11,244 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli-core/azure/cli/core/tests/test_output.py | Python | mit | 1,859 |
#!/usr/bin/env python
# @(#) $Jeannot: test2.py,v 1.16 2004/03/20 17:06:54 js Exp $
# This example is a PuLP rendition of the todd.mod problem included in the GLPK
# 4.4 distribution. It's a hard knapsack problem.
# Import PuLP modeler functions
from pulp import *
# Import math functions
from math import *
# A new ... | talitaof/pulp | examples/test2.py | Python | mit | 1,067 |
import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import type_check
@testing.parameterize(*[
{... | AlpacaDB/chainer | tests/chainer_tests/functions_tests/math_tests/test_det.py | Python | mit | 7,745 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS (Oracle)
Date : Aug 27, 2014
copyright : (C) 2014 by Médéric RIBREUX
email : meder... | AsgerPetersen/QGIS | python/plugins/db_manager/db_plugins/oracle/data_model.py | Python | gpl-2.0 | 5,139 |
import os
import logging
import time
from autotest.client.shared import utils_memory
from autotest.client.shared import error
from autotest.client.shared import ssh_key
from virttest import libvirt_vm
from virttest import utils_test
from virttest import remote
from virttest import data_dir
from virttest.utils_test im... | waynesun09/tp-libvirt | libvirt/tests/src/virsh_cmd/domain/virsh_migrate_stress.py | Python | gpl-2.0 | 6,495 |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under th... | benfitzpatrick/rose | metomi/rose/apps/rose_arch.py | Python | gpl-3.0 | 22,301 |
import asyncio
from datetime import datetime
from Core.Util import UtilBot
import traceback
''' To use this, either add on to the ExtraCommands.py file or create your own Python file. Import the DispatcherSingleton
and annotate any function that you wish to be a command with the @DispatcherSingleton.register annotatio... | johnwiseheart/HangoutsBot | Core/Commands/Dispatcher.py | Python | gpl-3.0 | 4,632 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import operator, os, json, re, time
from binascii import hexlify, unhexlify
from collections import OrderedDict
import che... | sss/calibre-at-bzr | src/calibre/library/server/browse.py | Python | gpl-3.0 | 37,993 |
# -*- test-case-name: twisted.words.test.test_xishutil -*-
#
# Copyright (c) 2001-2005 Twisted Matrix Laboratories.
# See LICENSE for details.
def _isStr(s):
""" Internal method to determine if an object is a string """
return isinstance(s, type('')) or isinstance(s, type(u''))
class _MethodWrapper(object):
... | kenorb-contrib/BitTorrent | twisted/words/xish/utility.py | Python | gpl-3.0 | 10,134 |
from .main import PublicHD
def start():
return PublicHD()
config = [{
'name': 'publichd',
'groups': [
{
'tab': 'searcher',
'subtab': 'providers',
'list': 'torrent_providers',
'name': 'PublicHD',
'description': 'Public Torrent site with on... | nabsboss/CouchPotatoServer | couchpotato/core/providers/torrent/publichd/__init__.py | Python | gpl-3.0 | 952 |
# (C) British Crown Copyright 2015 - 2016, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | belteshassar/cartopy | lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py | Python | gpl-3.0 | 2,873 |
HOST = "wfSciwoncGW:enw1989@172.31.25.253:27001,172.31.25.251:27001,172.31.2.76:27001/?authSource=admin"
PORT = ""
USER = ""
PASSWORD = ""
DATABASE = "googlew"
READ_PREFERENCE = "secondary"
COLLECTION_INPUT = "task_events_info"
PREFIX_COLUMN = "g_"
ATTRIBUTES = ["event type", "standard deviation memory", "standard dev... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/8_1_workflow_full_10files_secondary_w1_1sh_3rs_with_annot_with_proj_3s/calculateratio_2/ConfigDB_Calc_TEInfo_2.py | Python | gpl-3.0 | 588 |
#!/usr/bin/env python
"""Make sure the data in BOTMETA.yml is valid"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import glob
import os
import re
import sys
import yaml
from voluptuous import All, Any, Match, MultipleInvalid, Required, Schema
from voluptuous.humanize impor... | tumbl3w33d/ansible | test/sanity/code-smell/botmeta.py | Python | gpl-3.0 | 3,657 |