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 |
|---|---|---|---|---|---|
from __future__ import unicode_literals
import contextlib
import io
import logging
import os
import os.path
import sqlite3
import tempfile
from cached_property import cached_property
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
from pre_commit.util import clean_path_on_failure
from pre_commit... | barrysteyn/pre-commit | pre_commit/store.py | Python | mit | 4,474 |
import numpy
from scipy import ndimage
def hysteresis_threshold(array, low_threshold, high_threshold, structure=None):
"""Create a mask that is True for regions in the input array which are
entirely larger than low_threshold and which contain at least one element
larger than high_threshold."""
high_mas... | zplab/zplib | zplib/image/mask.py | Python | mit | 4,746 |
# -*- coding: utf-8 -*-
from __future__ import division
from __builtin__ import enumerate
from django.db import models
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
import datetime
impo... | hamdigdoura/django-survey-formset | django_questionnaire/questionnaire/models.py | Python | mit | 14,473 |
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox()
elif browser == "ch... | Lenchik13/Testing | fixture/application.py | Python | apache-2.0 | 1,000 |
# -*- coding: utf-8 -*-
#
# Openlava Web Interface documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 5 15:40:43 2014.
#
# 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
# autogenerate... | irvined1982/openlava-web | doc/conf.py | Python | gpl-3.0 | 9,907 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import functools
import spack.cmd.common.arguments
import spack.cmd.modules
import spack.config
import spack.modules.lmod... | LLNL/spack | lib/spack/spack/cmd/modules/lmod.py | Python | lgpl-2.1 | 1,885 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.md'... | rostock/ckanext-hro_theme | setup.py | Python | agpl-3.0 | 3,742 |
# Copyright 2009-2013 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""SeqFeature related tests for SeqRecord objects from Bio.SeqIO.
Initially this takes matc... | updownlife/multipleK | dependencies/biopython-1.65/Tests/test_SeqIO_features.py | Python | gpl-2.0 | 56,721 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.db.models import ForeignKey
from django.urls import Resolver404, resolve
from django.utils.translation import get_language_from_request, override
from cms.apphook_pool import apphook_pool
from app_data import... | aldryn/aldryn-apphooks-config | aldryn_apphooks_config/utils.py | Python | bsd-3-clause | 3,443 |
"""NAV web common package."""
import os
from django.db.models import Count
from django.http import Http404
from nav.config import find_configfile
from nav.models.profiles import AccountDashboard
WELCOME_ANONYMOUS_PATH = find_configfile(
os.path.join("webfront", "welcome-anonymous.txt"))
WELCOME_REGISTERED_PATH =... | UNINETT/nav | python/nav/web/webfront/__init__.py | Python | gpl-2.0 | 1,782 |
"""Base class for sparse matrix formats using compressed storage."""
from __future__ import division, print_function, absolute_import
__all__ = []
from warnings import warn
import operator
import numpy as np
from scipy._lib.six import xrange, zip as izip
from .base import spmatrix, isspmatrix, SparseEfficiencyWarni... | larsmans/scipy | scipy/sparse/compressed.py | Python | bsd-3-clause | 40,901 |
from gitflow.const import VersioningScheme
from gitflow.procedures.scheme import scheme_procedures
from gitflow.version import VersionConfig
config = VersionConfig()
config.versioning_scheme = VersioningScheme.SEMVER
config.qualifiers = ['alpha', 'beta']
def test_major_increment():
assert scheme_procedures.versi... | abacusresearch/gitflow | test/unit/test_semver.py | Python | mit | 2,570 |
# -*- coding: utf-8 -*-
print '<!DOCTYPE html><html>'
incluir(data,"head")
print '<body class="AsenZor-admin ff"><div class="container-fluid"> <div class="row"> <div class="col-md-12"> '
incluir(data,"header")
print ' </div> </div class="container"> <div class="row"> <div> <div class="col-md-6"> <h1><b>Aplic... | ZerpaTechnology/AsenZor | apps/votSys2/admin/vistas/templates/editor.py | Python | lgpl-3.0 | 956 |
"""
couch.controllers
~~~~~~~~~~~~~~~~~
"""
from time import time
from flask import redirect, render_template, request, session
from slothpal.exceptions import StatusCodeError
from slothpal.oauth import make_consent_url
from couch.cookie import make_secure_oauth_cookie
from couch.thirdparty import get_button_config, ... | hahnicity/couch | couch/controllers.py | Python | unlicense | 2,620 |
# -*- coding: utf-8 -*-
from ast import literal_eval
from odoo import models, fields, api
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
config_ok = fields.Boolean(
related='product_id.config_ok',
string="Configurable",
readonly=True
)
@api.multi
def re... | microcom/odoo-product-configurator | product_configurator_wizard/models/sale.py | Python | agpl-3.0 | 1,538 |
#! /usr/bin/env python
# Convert a SAM file output by HISAT to one that Boiler can use
# Input file should be sorted by read name
import argparse
import sys
def oneToOne(readsA, readsB):
if not len(readsA) == len(readsB):
return False
rA = [(int(r[3]), int(r[7])) for r in readsA]
rB = [(int(r[7]... | jpritt/boiler | enumeratePairs.py | Python | mit | 6,192 |
# -*- 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
#... | Tagar/incubator-airflow | airflow/sensors/external_task_sensor.py | Python | apache-2.0 | 4,172 |
#!/usr/bin/env python
"""axis_crosspoint_64
Generates an AXI Stream crosspoint switch with the specified number of ports
Usage: axis_crosspoint_64 [OPTION]...
-?, --help display this help and exit
-p, --ports specify number of ports
-n, --name specify module name
-o, --output specify output file ... | alexforencich/hdg2000 | fpga/lib/axis/rtl/axis_crosspoint_64.py | Python | mit | 6,930 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | jianajavier/pnc-cli | pnc_cli/swagger_client/models/build_record_set_singleton.py | Python | apache-2.0 | 2,941 |
##########################################################
#07:10 PM
#Thursday, June 11, 2016 (GMT+5:30)
#@ author : VAIBHAV GUPTA(15454)
#########################################################
# Rock-paper-scissors-lizard-Spock template
import simplegui
# helper functions
def name_to_number(name):
# de... | vaibhavg2896/PythonSimpleGUI | Rock-paper-scissor-lizard-Spock.py | Python | gpl-3.0 | 2,546 |
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | bdang2012/taiga-back-casting | taiga/export_import/serializers.py | Python | agpl-3.0 | 25,409 |
# -*- coding: utf-8 -*-
# See LICENSE file for full copyright and licensing details.
from . import report_hotel_reservation
| JayVora-SerpentCS/vertical-hotel | report_hotel_reservation/models/__init__.py | Python | agpl-3.0 | 125 |
#
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
from ipalib import api, errors
from ipapython.dn import DN
import six
from ipatests.util import assert_deepequal, get_group_dn
from ipatests.test_xmlrpc import objectclasses
from ipatests.test_xmlrpc.xmlrpc_test import (
fuzzy_digits, fuzzy_u... | ofayans/freeipa | ipatests/test_xmlrpc/tracker/user_plugin.py | Python | gpl-3.0 | 19,387 |
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.api import tools
from onadata.apps.api.models.organization_profile import OrganizationProfile
from onadata.apps.api.models.team import Team
from django.core.exceptions import ValidationError
class TestOrganizationProfile(TestBase):
def test... | mainakibui/kobocat | onadata/apps/api/tests/models/test_organization_profile.py | Python | bsd-2-clause | 1,399 |
# coding: utf-8
from __future__ import unicode_literals
import os
import datetime
from django.utils.translation import activate
from .lib.manager import Manager
from .models import Settings
from .settings import SETTINGS
class SyncTestMixin(object):
MODEL = None
RELATED_MODEL = None
RELATED_MANY = Non... | mtrgroup/django-mtr-sync | mtr/sync/tests.py | Python | mit | 9,114 |
# Copyright 2022 Google LLC. 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 applicable law o... | GoogleCloudPlatform/declarative-resource-client-library | python/services/dlp/stored_info_type.py | Python | apache-2.0 | 22,936 |
import boto3
import time
from botocore.client import ClientError
class CloudWatch:
def __init__(self):
self.cloudWatch = boto3.client('cloudwatch')
def getAlarms(self, metricName, namespace):
return self._getAlarms(metricName, namespace, 1)
def _getAlarms(self, metricName, namespace, slee... | mikhailadvani/cis-aws-automation | aws/api/CloudWatch.py | Python | apache-2.0 | 730 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPamela(PythonPackage):
"""Python wrapper for PAM"""
pypi = "pamela/pamela-1.0.0.tar... | LLNL/spack | var/spack/repos/builtin/packages/py-pamela/package.py | Python | lgpl-2.1 | 469 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2012 Rob Guttman <guttman@alum.mit.edu>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from setuptools import setup, find_packages
PACKAGE = 'TracQu... | kzhamaji/TracQuietPlugin | setup.py | Python | bsd-3-clause | 1,298 |
import regex
import unicodedata
import logging
import langcodes
from .language_info import (
get_language_info,
SPACELESS_SCRIPTS,
EXTRA_JAPANESE_CHARACTERS,
)
from .preprocess import preprocess_text, smash_numbers
# Placeholders for CJK functions that we'll import on demand
_mecab_tokenize = None
_jieba_... | LuminosoInsight/wordfreq | wordfreq/tokens.py | Python | mit | 13,160 |
from gettext import gettext as _
import os
import logging
from typing import Optional, Tuple
from blueman.bluez.Adapter import Adapter
from blueman.gui.DeviceSelectorList import DeviceSelectorList
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class DeviceSelectorWidget(Gtk.Box):
def _... | blueman-project/blueman | blueman/gui/DeviceSelectorWidget.py | Python | gpl-3.0 | 4,986 |
import _plotly_utils.basevalidators
class LocationsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="locations", parent_name="isosurface.slices.z", **kwargs
):
super(LocationsValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/isosurface/slices/z/_locations.py | Python | mit | 476 |
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'collator.users'
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
pass
| StuJ/collator | collator/users/apps.py | Python | mit | 274 |
"""Define tests for the Freedompro config flow."""
from unittest.mock import patch
from homeassistant import data_entry_flow
from homeassistant.components.freedompro.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY
from tests.components.freedompro.c... | sander76/home-assistant | tests/components/freedompro/test_config_flow.py | Python | apache-2.0 | 2,354 |
'''
Created on Dec 18, 2014
@author: markus
'''
from base.FileHandler import LegoTrainFileReader
from ROOT import TFile, TList, TObject, TH1F
class DataSpectra(object):
class TriggerData(object):
def __init__(self, triggername, events, spec):
self.__triggername = triggername
... | mfasDa/raadev | analysis/write/DataWriter.py | Python | gpl-3.0 | 7,249 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-03 19:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('songs', '0001_initial'),
]
operations = [
migrations.RenameField(
model... | davejlin/treehouse | python/django/karaoke_challenge/songs/migrations/0002_auto_20170103_1930.py | Python | unlicense | 415 |
# -*- coding: utf-8 -*-
"""
Project name: Open Methodology for Security Tool Developers
Project URL: https://github.com/cr0hn/OMSTD
Copyright (c) 2014, cr0hn<-AT->cr0hn.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ... | cr0hn/OMSTD | examples/develop/lp/002/lp-002-s1.py | Python | bsd-2-clause | 2,001 |
from setuptools import setup, find_packages
__version__ = '0.1.2'
setup(name='seafileapi',
version=__version__,
license='BSD',
description='Client interface for Seafile Web API',
author='AshotS',
platforms=['Any'],
packages=find_packages(),
install_requires=['requests'],
... | AshotS/python-seafile-api | setup.py | Python | apache-2.0 | 550 |
from sympy import Add, Basic, symbols, Mul, And, Symbol
from sympy.unify.core import Compound, Variable
from sympy.unify.usympy import (deconstruct, construct, unify, is_associative,
is_commutative)
from sympy.abc import w, x, y, z, n, m, k
from sympy.utilities.pytest import XFAIL
from sympy.core.compatibility ... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/unify/tests/test_sympy.py | Python | gpl-3.0 | 5,514 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programs', '0008_programsapiconfig_program_details_enabled'),
]
operations = [
migrations.AddField(
... | ESOedX/edx-platform | openedx/core/djangoapps/programs/migrations/0009_programsapiconfig_marketing_path.py | Python | agpl-3.0 | 558 |
from tornado import ioloop, websocket
if __name__ == '__main__':
conn = websocket.websocket_connect('ws://localhost:5000/foo')
ioloop.IOLoop.instance().start()
| rmoorman/qotr | qotr/client.py | Python | agpl-3.0 | 169 |
from TASSELpy.utils.helper import make_sig
from TASSELpy.utils.Overloading import javaConstructorOverload, javaStaticOverload, javaOverload
from TASSELpy.net.maizegenetics.trait.AbstractPhenotype import AbstractPhenotype
from TASSELpy.net.maizegenetics.trait.Phenotype import Phenotype
from TASSELpy.net.maizegenetics.tr... | er432/TASSELpy | TASSELpy/net/maizegenetics/trait/FilterPhenotype.py | Python | bsd-3-clause | 5,518 |
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-dab
#
# 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 Softwar... | andrmuel/gr-dab | docs/doxygen/doxyxml/__init__.py | Python | gpl-3.0 | 2,591 |
#!/usr/bin/env python
################################################################
#
# Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the Licens... | rizard/bigcode | tools/infra.py | Python | epl-1.0 | 1,316 |
"""Get node data
node data from configs/node.json
It is a combination of cell data and node data
"""
import io
import json
import logging
import os
_LOGGER = logging.getLogger(__name__)
FILE = 'node.json'
def get(config_dir):
"""Get node data
"""
node_file = os.path.join(config_dir, FILE)
try:
... | Morgan-Stanley/treadmill | lib/python/treadmill/nodedata.py | Python | apache-2.0 | 519 |
#
#
# Copyright (C) 2006, 2007, 2008, 2012 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | mbakke/ganeti | lib/rapi/baserlib.py | Python | bsd-2-clause | 23,151 |
# Lint as: python3
# Copyright 2020 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 ... | tensorflow/docs | tools/tensorflow_docs/tools/nbfmt/notebook_utils.py | Python | apache-2.0 | 3,513 |
import testvibe.core.utils as utils
class TestUtils(object):
def test_is_int(self):
m = utils.is_int
assert m(9)
assert not m('asdf')
assert not m(None)
| Niklas9/testvibe | tests/test_utils.py | Python | lgpl-3.0 | 193 |
# Copyright (c) 2011 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 ... | citrix-openstack-build/trove | trove/tests/config.py | Python | apache-2.0 | 5,945 |
#!/usr/bin/env python3
# encoding: utf-8
"""
pyQms
-----
Python module for fast and accurate mass spectrometry data quantification
:license: MIT, see LICENSE.txt for more details
Authors:
* Leufken, J.
* Niehues, A.
* Sarin, L.P.
* Hippler, M.
* Leidel, S.... | pyQms/pyqms | example_scripts/view_result_pkl_stats.py | Python | mit | 1,091 |
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "WYE"
addresses_name = "2021-03-29T13:16:10.236797/Democracy_Club__06May2021.tsv"
stations_name = "2021-03-29T13:16:10.236797/Democracy_Club__06May2021.tsv"
... | DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_importers/management/commands/import_wyre_forest.py | Python | bsd-3-clause | 949 |
# -*- coding: utf-8 -*-
""" This module returns stats about the DynamoDB table """
import math
from datetime import datetime, timedelta
from boto.exception import JSONResponseError, BotoServerError
from retrying import retry
from dynamic_dynamodb.aws import dynamodb
from dynamic_dynamodb.log_handler import LOGGER as ... | tellybug/dynamic-dynamodb | dynamic_dynamodb/statistics/table.py | Python | apache-2.0 | 5,895 |
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2014, OVH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | runabove/python-runabove | runabove/client.py | Python | mit | 4,030 |
#! /usr/bin/env python
"""
Routines to analysis execution time of virtual screening
These routines were developed by:
Rodrigo Antonio Faccioli - rodrigo.faccioli@usp.br / rodrigo.faccioli@gmail.com
Leandro Oliveira Bortot - leandro.bortot@usp.br / leandro.obt@gmail.com
"""
import os
import operato... | rodrigofaccioli/drugdesign | virtualscreening/vina/python/analysis/docking_time.py | Python | apache-2.0 | 1,981 |
# https://deeplearningcourses.com/c/deep-reinforcement-learning-in-python
# https://www.udemy.com/deep-reinforcement-learning-in-python
from __future__ import print_function, division
from builtins import range
# Note: you may need to update your version of future
# sudo pip install -U future
import copy
import gym
im... | balazssimon/ml-playground | udemy/lazyprogrammer/deep-reinforcement-learning-python/atari/dqn_tf_alt.py | Python | apache-2.0 | 11,056 |
#!/usr/bin/env python
from sys import argv
class Brainfuck(object):
def __init__(self, code='', text=''):
self.data = [0]
self.i = 0
self.code = code
self.ci = 0
self.text = text
self.ti = 0
self.result = ''
def right(self):
self.i += 1
... | tysonzero/brainfuck | brainfuck.py | Python | gpl-2.0 | 2,447 |
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# ... | ask/kamqp | kamqp/client_0_8/abstract_channel.py | Python | lgpl-2.1 | 3,161 |
#!/usr/bin/python3
'''
这个文件的主要作用是统计relation的数据
'''
import sys
sys.path.append("..")
import insummer
from insummer.read_conf import config
from insummer.knowledge_base import concept_tool
from insummer.knowledge_base.relation import relation_tool
#others
import csv
conf = config("../../conf/cn_data.conf")
data_pos ... | lavizhao/insummer | code/script/relation_statistics.py | Python | mit | 2,661 |
from .stop_words import STOP_WORDS
from ...language import Language
class IcelandicDefaults(Language.Defaults):
stop_words = STOP_WORDS
class Icelandic(Language):
lang = "is"
Defaults = IcelandicDefaults
__all__ = ["Icelandic"]
| spacy-io/spaCy | spacy/lang/is/__init__.py | Python | mit | 246 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import contextlib
import cStringIO
import datetime
import gzip
import json
import logging
import multiprocessing
import... | nicko96/Chrome-Infra | infra/services/builder_alerts/__main__.py | Python | bsd-3-clause | 12,085 |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... | wavefrontHQ/python-client | test/test_sortable_search_request.py | Python | apache-2.0 | 1,340 |
# Copyright 2011 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 requ... | tmenjo/cinder-2015.1.0 | cinder/tests/api/contrib/test_types_manage.py | Python | apache-2.0 | 14,935 |
from .base import *
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
'0.0.0.0'
]
DEBUG = True
# If debug is enabled, Compressor is turned off; # this will manually activate
# it. This is important to provide Django tags (like 'static') to JS files
# COMPRESS_ENABLED = False
# However, in development, we ha... | allanberry/arcfire | arcfire/core/settings/dev.py | Python | mit | 1,388 |
# -*- test-case-name: twisted.web2.test.test_stream -*-
"""
The stream module provides a simple abstraction of streaming
data. While Twisted already has some provisions for handling this in
its Producer/Consumer model, the rather complex interactions between
producer and consumer makes it difficult to implement someth... | Donkyhotay/MoonPy | twisted/web2/stream.py | Python | gpl-3.0 | 34,745 |
## cpluginsvc is a ctypes-based wrapper for the C-exposed API of GaudiPluginService
__doc__ = '''
cpluginsvc is a ctypes-based wrapper for the C-API of the GaudiPluginService.
e.g.:
>>> from GaudiPluginService import cpluginsvc
>>> for _,f in cpluginsvc.factories().items():
... try:
... f.load()
... e... | vvolkl/DD4hep | GaudiPluginService/python/GaudiPluginService/cpluginsvc.py | Python | gpl-3.0 | 5,530 |
# -*- coding: utf-8 -*-
#
# This file is part of Linux Show Player
#
# Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com>
#
# Linux Show Player 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 ... | FrancescoCeruti/linux-show-player | lisp/modules/gst_backend/elements/db_meter.py | Python | gpl-3.0 | 2,843 |
from .core import FaceDetector | 1adrianb/face-alignment | face_alignment/detection/__init__.py | Python | bsd-3-clause | 30 |
import numpy as np
import nengo
import ctn_benchmark
# define the inputs when doing number comparison task
class NumberExperiment:
def __init__(self, p):
self.p = p
self.pairs = []
self.order = []
rng = np.random.RandomState(seed=p.seed)
for i in range(1, 10):
fo... | tcstewar/finger_gnosis | pointer.py | Python | gpl-2.0 | 16,229 |
# 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
from cryptography import utils
from cryptography.exceptions import (
... | CoderBotOrg/coderbotsrv | server/lib/cryptography/hazmat/primitives/hashes.py | Python | gpl-3.0 | 3,022 |
import time
import requests
TEMPORARY_ERROR_CODES = (400, 500, 502, 503, 504)
def main():
"""
main process
"""
response = fetch('http://httpbin.org/status/200,404,503')
if 200 <= response.status_code < 300:
print('Success!')
else:
print("Error!")
def fetch(url):
"""
... | mmakmo/python | crawling_scraping/chapter04/error_handling.py | Python | mit | 1,037 |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | casadi/optoy | optoy/simple_syntax.py | Python | lgpl-3.0 | 1,693 |
# TODO:
#
# make pagination list part of framework
#
# 1) create class iterator for:
# 1.1) iterate DB (like we have right now)
# 1.2) iterate third party endpoints
# so we will get class-strategy and its state passed and stored in ctx
#
# Props:
# - subtitle_renderer - gets callback with param item and which retur... | botstory/todo-bot | todo/pagination_list.py | Python | mit | 5,412 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.add_user_page, name='adduser'),
]
| Vvucinic/Wander | adduser/urls.py | Python | artistic-2.0 | 138 |
import Gaffer
import GafferUI
import GafferOSL
GafferUI.Examples.registerExample(
"Compositing/OSL Image Processing",
"$GAFFER_ROOT/resources/examples/compositing/OSLImageProcessing.gfr",
description = "Demonstrates the use of OSL networks and the OSLImage node for image processing and pattern generation.",
notabl... | lucienfostier/gaffer | startup/GafferOSLUI/oslExamples.py | Python | bsd-3-clause | 658 |
class Joueur(object):
def __init__(self,nom, representation, humain=True):
"""
Représentation d'un joueur.
Choix du dictionnaire
:param nom: string. Nom du joueur
:param representation: string. Soit un caractère, soit un chemin vers un fichier image
:param humain: boo... | KelenFenrisson/riviereIUTO | versionObjet/joueursOO.py | Python | gpl-3.0 | 3,047 |
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
import os
from filecmp import dircmp
from tempfile import mkdtemp
from shutil import rmtree
import locale
import logging
from mock import patch
from pelican import Pelican
from pelican.settings import read_settings
from .support im... | teleyinex/pelican-blogs | tests/test_pelican.py | Python | agpl-3.0 | 3,587 |
"""
WSGI config for production project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.wsgi i... | cleberar38/wbl-dev | sites/production/wsgi.py | Python | mit | 384 |
from mitra.api import account
from mitra.api import entry
from mitra.api import category
| Nukesor/mitra | mitra/api/__init__.py | Python | mit | 89 |
import itertools
from collections import defaultdict
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Index
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import relationship, backref, validates, object_session
from inbox.log import get_logger
log = get_logger()... | PriviPK/privipk-sync-engine | inbox/models/thread.py | Python | agpl-3.0 | 10,628 |
from bokeh.charts import Histogram, output_file, show
from bokeh.sampledata.autompg import autompg as df
df.sort('cyl', inplace=True)
hist = Histogram(df, values='hp', color='cyl',
title="HP Distribution by Cylinder Count", legend='top_right')
output_file("histogram_single.html")
show(hist)
| gpfreitas/bokeh | examples/charts/file/histogram_single.py | Python | bsd-3-clause | 313 |
import os
import os.path
import ConfigParser
class Config(object):
def __init__(self, config_path=""):
self.cp = ConfigParser.ConfigParser()
self.section_default = 'docfu'
self.config_path = config_path
def read(self):
self.cp.read(self.config_path)
def __getattr__(self,... | feltnerm/docfu | docfu/config.py | Python | mit | 461 |
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_email, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_email is free software:
# you can redistribute it and/or
# modify it under... | acsone/mozaik | mozaik_email/__openerp__.py | Python | agpl-3.0 | 1,950 |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.m.Y.'
SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'
FIRST_DAY_OF... | hunch/hunch-gift-app | django/conf/locale/sr_Latn/formats.py | Python | mit | 1,746 |
# Exercise 7: List Comprehensions
# http://www.practicepython.org
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
b = [number for number in a if number % 2 == 0]
print b
| dadavidson/Python_Lab | Practice Python/ex07-list_comprehensions.py | Python | mit | 168 |
import numpy
import afnumpy
import arrayfire
from .. import private_utils as pu
from ..decorators import *
def all(a, axis=None, out=None, keepdims=False):
try:
return a.all(axis, out, keepdims)
except AttributeError:
return numpy.all(a, axis, out, keepdims)
def any(a, axis=None, out=None, kee... | daurer/afnumpy | afnumpy/core/fromnumeric.py | Python | bsd-2-clause | 6,587 |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import sys
from mixbox.binding_utils import *
from . import cybox_common
class LinuxPackageObjectType(cybox_common.ObjectPropertiesType):
"""The LinuxPackageObjectType type is intended to characterize Linux
... | CybOXProject/python-cybox | cybox/bindings/linux_package_object.py | Python | bsd-3-clause | 15,748 |
from src import app
from flask import request, render_template, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from src.models import db, Practice, add_session
from config import SECRET_KEY
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///practice.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
a... | bradysalz/Stick-Control | src/views.py | Python | mit | 1,714 |
__author__ = 'bea'
| beatorizu/tekton | backend/appengine/routes/cards/__init__.py | Python | mit | 19 |
# This file is part of Radicale - CalDAV and CardDAV server
# Copyright © 2014 Jean-Marc Martins
# Copyright © 2012-2017 Guillaume Ayoub
# Copyright © 2017-2018 Unrud <unrud@outlook.com>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | Kozea/Radicale | radicale/storage/multifilesystem/move.py | Python | gpl-3.0 | 2,926 |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _
from rest_framework import serializers
from . import models, utils
SOURCE_OR_DEST_REQUIRED_ERROR = \
_('You cannot transfer money from the bank to the bank.')
DUPLICATE_SOURCE_OR_DEST_ERROR = ... | XeryusTC/18xx-accountant | accountant/core/serializers.py | Python | mit | 8,703 |
#!/bin/python
from __future__ import print_function
import os
import sys
#
# Complete the simpleArraySum function below.
#
def simpleArraySum(ar):
sumArr = 0
for i in ar:
sumArr = sumArr + i
return sumArr
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
ar_count =... | MithileshCParab/HackerRank-10DaysOfStatistics | Problem Solving/Algorithms/Warmup/simple_array_sum.py | Python | apache-2.0 | 474 |
from core.config.settings import MY_ACCOUNTS, PEOPLE
from core.utils.network.email import send
def report_bug(message):
"""docstring for report"""
send(MY_ACCOUNTS['gmail']['email'], PEOPLE['admin']['email'], 'Smarty-bot bug report', message)
| vsilent/smarty-bot | core/utils/sys/report.py | Python | mit | 253 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1006230031.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/MODEL1006230031 | MODEL1006230031/model.py | Python | cc0-1.0 | 427 |
# -*- coding: utf-8 -*-
#
# privacyIDEA is a fork of LinOTP
# May 08, 2014 Cornelius Kölbel
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# Copyright (C) 2010 - 2014 LSE Leading Security Experts GmbH
# License: AGPLv3
# contact: http://www.linotp.org
# http://www.lsexperts.de
# ... | privacyidea/privacyidea | privacyidea/lib/log.py | Python | agpl-3.0 | 8,178 |
from gensim.corpora import MalletCorpus, Dictionary
import sys
def read_project_data(mtc,csc, fname):
d1 = Dictionary.load(mtc + ".dict")
d2 = Dictionary.load(csc + ".dict")
#d3 = Dictionary.load('data/postgresql-d4f8dde3-CommitLogCorpus.mallet.dict')
MultiTextCorpus = MalletCorpus(mtc, d1)
... | cscorley/mud2014-modeling-changeset-topics | comparison.py | Python | bsd-3-clause | 1,456 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-14 06:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tests', '0002_remove_allfield_comma_separated_integer'),
]
operations = [
m... | s1s5/django_busybody | tests/migrations/0003_encrypttest.py | Python | mit | 839 |
#!/usr/local/bin/python3.6
# --------------------------------------
# ___ ___ _ ____
# / _ \/ _ \(_) __/__ __ __
# / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/ /_/___/ .__/\_, /
# /_/ /___/
#
# bme280.py
# Read data from a digital pressure sensor.
#
# Official datasheet available from :... | airmonitor/home_air_monitor | ansible/roles/airmonitor/files/bme280.py | Python | gpl-3.0 | 7,288 |
import re, warnings
import lookml.lib.language_data.config
import lookml.lib.language_data._allowed_children
class ws:
#basic whitespace paramters
s = ' '
nl = '\n'
#size of a list type object before it breaks onto multiple lines. Int for number of items, not string length
list_multiline_threshold... | looker-open-source/pylookml | lookml/lib/lang.py | Python | mit | 4,820 |
#!/usr/bin/env python3
import os
import re
import subprocess
import time
from collections import namedtuple
from urllib.parse import urlsplit
from urllib.parse import urlunsplit
import click
import diaper
import jenkins
import py
import requests
from requests.auth import HTTPBasicAuth
from cfme.test_framework.sprout.... | ManageIQ/integration_tests | scripts/coverage_report_jenkins.py | Python | gpl-2.0 | 34,435 |
# -*- coding: utf-8 -*-
import threading
import logging
import unittest
import gc
from stockviderApp.utils import retryLogger
from stockviderApp.sourceDA.symbols.referenceSymbolsDA import ReferenceSymbolsDA
from stockviderApp.localDA.symbols.dbReferenceSymbolsDA import DbReferenceSymbolsDA
from stockviderApp.sourc... | aberdah/Stockvider | stockvider/stockviderApp/dbManager.py | Python | mit | 33,602 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.