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 numpy as np
from .base import AnalyticalPropagator
from ..constants import Earth
from ..dates import timedelta
class J2(AnalyticalPropagator):
"""Analytical propagator taking only the Earth-J2 effect into account"""
@property
def orbit(self):
return self._orbit if hasattr(self, "_orbit") ... | galactics/space-api | beyond/propagators/j2.py | Python | gpl-3.0 | 1,215 |
import os
import shutil
from setuptools import find_packages, setup
directory = os.path.abspath(os.path.dirname(__file__))
readme = os.path.join(directory, 'docs', 'source', 'index.rst')
# FIXME: catch exact exception instead of base exception class
# NOTE: this fixes error found when running `python setup.py develo... | benhoff/simpleyapsy | setup.py | Python | gpl-3.0 | 1,757 |
#
# $Id$
#
# Python version of Sphinx searchd client (Python API)
#
# Copyright (c) 2006, Mike Osadnik
# Copyright (c) 2006-2013, Andrew Aksyonoff
# Copyright (c) 2008-2013, Sphinx Technologies Inc
# All rights reserved
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | darky83/E.F.A.-2.x.x.x | build/Sphinx/sphinxapi.py | Python | gpl-3.0 | 34,597 |
# -*- coding: iso-8859-1 -*-
# __init__.py: Top level .py file for python solution analysis tools.
#
# Copyright (C) 2010
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: y... | kernsuite-debian/lofar | CEP/Calibration/ExpIon/src/__init__.py | Python | gpl-3.0 | 1,065 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | sscreation/eXTendDB | pyextenddb/extenddbint/extenddbint.py | Python | gpl-3.0 | 6,323 |
#!/usr/bin/env python
import pickle
import argparse
from pprint import pprint
description = """
print out run status from pickled Location object
"""
parser = argparse.ArgumentParser(description=description)
parser.add_argument('pickle', type=argparse.FileType('r'), help='path to location pickle')
args = parser.p... | sostenibilidad-unam/sleuth_automation | bin/status.py | Python | gpl-3.0 | 373 |
"""
Filenames of the tests
"""
import os
from os.path import join as pjoin
from .. import LiF_g4
# This is a 2x2x2 q-point grid. The weights can be obtained from abinit.
nqpt = 3
wtq = [0.125, 0.5, 0.375]
# Indices of the q-points in the 4x4x4 grid.
iqpt_subset = [0, 2, 6]
dirname = os.path.dirname(__file__)
fna... | jmbeuken/abinit | scripts/post_processing/ElectronPhononCoupling/ElectronPhononCoupling/data/LiF_g2_2/__init__.py | Python | gpl-3.0 | 668 |
#!/usr/bin/env python
'''
PySQM configuration File.
____________________________
Copyright (c) Mireia Nievas <mnievas[at]ucm[dot]es>
This file is part of PySQM.
PySQM 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 Founda... | migueln/PySQM | config.py | Python | gpl-3.0 | 3,526 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditi... | tkaitchuck/nupic | lang/py/engine/__init__.py | Python | gpl-3.0 | 23,539 |
import sklearn.neural_network
class NeuralNet:
def __init__(self):
self.regression = sklearn.neural_network.MLPRegressor(hidden_layer_sizes=100)
def train(self, X, Y):
self.regression.fit(X, Y)
def score(self, X):
return self.regression.predict(X)
def set_param(self, param):
... | m5w/matxin-lineariser | matxin_lineariser/statistical_linearisation/Linearisation/NeuralNet.py | Python | gpl-3.0 | 431 |
#!/usr/bin/env python
# Copyright (C) 2013 Johannes Ring
#
# This file is part of DOLFIN.
#
# DOLFIN 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 optio... | maciekswat/dolfin_1.3.0 | site-packages/dolfin_utils/pjobs/slurm.py | Python | gpl-3.0 | 1,881 |
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
'''
Blocks and utilities for digital modulation and demodulation.
'''
from __future__ import absolute_import
from __future__ import unicode_literals
# The presence of this file tu... | TheWylieStCoyote/gnuradio | gr-digital/python/digital/__init__.py | Python | gpl-3.0 | 1,013 |
########################################################################################################################
# VECNet CI - Prototype
# Date: 03/21/2014
# Institution: University of Notre Dame
# Primary Authors:
# Robert Jones <Robert.Jones.428@nd.edu>
######################################################... | vecnet/vnetsource | ts_emod/views/DownloadView.py | Python | mpl-2.0 | 1,812 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | klahnakoski/ActiveData | vendor/jx_python/expressions/not_right_op.py | Python | mpl-2.0 | 885 |
from shortuuid.main import (
encode,
decode,
uuid,
random,
get_alphabet,
set_alphabet,
ShortUUID,
)
| devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/shortuuid/__init__.py | Python | agpl-3.0 | 128 |
# This file is a part of github2fedmsg, a pubsubhubbub to zeromq bridge.
# Copyright (C) 2014, Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Li... | fedora-infra/github2fedmsg | tools/fake-github-post.py | Python | agpl-3.0 | 5,286 |
# -*- coding: utf-8 -*-
"""
Miscellaneous tests for the student app.
"""
from datetime import datetime, timedelta
import json
import logging
import unittest
from urlparse import urljoin
import ddt
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.core.urlresolvers ... | louyihua/edx-platform | common/djangoapps/student/tests/tests.py | Python | agpl-3.0 | 43,770 |
# coding: utf-8
# ###########################################################################
#
# Author: Luis Felipe Mileo
# Fernando Marcato Rodrigues
# Daniel Sadamo Hirayama
# Copyright 2015 KMEE - www.kmee.com.br
#
# This program is free software: you can redistribute it and/or modif... | kmee/odoo-brazil-banking | l10n_br_financial_payment_order/febraban/cnab_240/bancos/itau.py | Python | agpl-3.0 | 2,473 |
""" API v0 views. """
import datetime
import json
import logging
import pytz
from django.contrib.auth.models import User
from django.db import transaction
from django.http import Http404
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.generics impo... | devs1991/test_edx_docmode | lms/djangoapps/ccx/api/v0/views.py | Python | agpl-3.0 | 30,649 |
"""Tests for items views."""
import json
import re
from datetime import datetime, timedelta
from unittest.mock import Mock, PropertyMock, patch
import ddt
from django.conf import settings
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.urls i... | edx/edx-platform | cms/djangoapps/contentstore/views/tests/test_item.py | Python | agpl-3.0 | 160,015 |
import sci_inst_byname
| karim-omran/openerp-addons | scientific_institutions/wizard/__init__.py | Python | agpl-3.0 | 23 |
from sqlalchemy.schema import Column
from sqlalchemy.types import Integer
from sqlalchemy.sql.expression import select, func
from openspending.core import db
from openspending.model.attribute import Attribute
from openspending.model.common import TableHandler, ALIAS_PLACEHOLDER
from openspending.model.constants import... | USStateDept/FPA_Core | openspending/model/dimension.py | Python | agpl-3.0 | 20,686 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Project.project_type'
db.delete_column('expert_project', 'project_type')
def backwar... | ProvincalInovationManagement/provinceManagement | expert/migrations/0002_auto__del_field_project_project_type.py | Python | agpl-3.0 | 872 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon, Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | yannrouillard/weboob | weboob/capabilities/bill.py | Python | agpl-3.0 | 5,143 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AppraisalRateScoreCard(Document):
pass | gangadhar-kadam/hrerp | erpnext/hr/doctype/appraisal_rate_score_card/appraisal_rate_score_card.py | Python | agpl-3.0 | 266 |
from dependencies.dependency import base_hasattr, safe_callable, isIDAutoGenerated, \
getEmptyTitle, safe_unicode
from lims.utils import t
from dependencies.dependency import MessageFactory
_marker = []
def _pretty_title_or_id(context, obj, empty_value=_marker):
"""Return the best possible title or id of an i... | yasir1brahim/OLiMS | lims/monkey/utils.py | Python | agpl-3.0 | 1,303 |
"""
This module contains signals / handlers related to programs.
"""
import logging
from django.dispatch import receiver
from openedx.core.djangoapps.signals.signals import COURSE_CERT_AWARDED
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
LOGGER = logging.getLogger(__name__)
@receiver(COUR... | franosincic/edx-platform | openedx/core/djangoapps/programs/signals.py | Python | agpl-3.0 | 1,604 |
import csv
import errno
import hashlib
import magic
import mimetypes
import os
from os.path import dirname, join, exists
import requests
from django.core.management.base import BaseCommand
from django.core.files.storage import FileSystemStorage
from candidates.election_specific import MAPIT_DATA
from official_docume... | YoQuieroSaber/yournextrepresentative | candidates/management/commands/candidates_import_statements_of_persons_nominated.py | Python | agpl-3.0 | 3,359 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
f... | suyashphadtare/vestasi-erp-jan-end | erpnext/stock/doctype/material_request/material_request.py | Python | agpl-3.0 | 13,650 |
# -*- coding: utf-8 -*-
{
'name': 'Time Tracking',
'version': '1.0',
'category': 'Human Resources',
'sequence': 23,
'description': """
This module implements a timesheet system.
==========================================
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
... | syci/ingadhoc-odoo-addons | hr_timesheet_project/__openerp__.py | Python | agpl-3.0 | 591 |
from hearthstone.enums import CardType, GameTag, Rarity
import utils
CARDS = utils.fireplace.cards.db
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rariti... | beheh/fireplace | tests/test_carddb.py | Python | agpl-3.0 | 1,192 |
"""
Mixins classes being used by all test classes within this folder
"""
from datetime import datetime
from pytz import UTC
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from student.tests.fac... | philanthropy-u/edx-platform | lms/djangoapps/grades/api/v1/tests/mixins.py | Python | agpl-3.0 | 4,459 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xfsprogs(AutotoolsPackage):
"""XFS User Tools."""
homepage = "http://oss.sgi.com/proj... | iulian787/spack | var/spack/repos/builtin/packages/xfsprogs/package.py | Python | lgpl-2.1 | 1,290 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | var/spack/repos/builtin.mock/packages/extendee/package.py | Python | lgpl-2.1 | 1,547 |
# Copyright 2009-2014 Justin Riley
#
# This file is part of TethysCluster.
#
# TethysCluster 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) any
# la... | tethysplatform/TethysCluster | tethyscluster/volume.py | Python | lgpl-3.0 | 15,688 |
#!/usr/bin/python
#
# This file is part of django-ship project.
#
# Copyright (C) 2011-2020 William Oliveira de Lagos <william.lagos@icloud.com>
#
# Shipping is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as published by
# the Free Software ... | efforia/django-shipping | shipping/providers/default.py | Python | lgpl-3.0 | 5,966 |
import urllib
import urllib2
import threading
BaseProp = 361995
EndProp = 362044
proxies = {'http': 'http://localhost:8080'}
# handles getting the owner pdf listing of the home
class DoNothingRedirectHandler(urllib2.HTTPRedirectHandler):
def http_error_302(self, req, fp, code, msg, headers):
... | deeso/python_scrirpts | tax stuff.py | Python | apache-2.0 | 15,594 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the compressed stream file system implementation."""
import os
import unittest
from dfvfs.lib import definitions
from dfvfs.path import compressed_stream_path_spec
from dfvfs.path import os_path_spec
from dfvfs.resolver import context
from dfvfs.vfs import compre... | manashmndl/dfvfs | tests/vfs/compressed_stream_file_system.py | Python | apache-2.0 | 2,758 |
"""Support for the Hive switches."""
from datetime import timedelta
from homeassistant.components.switch import SwitchEntity
from . import ATTR_AVAILABLE, ATTR_MODE, DATA_HIVE, DOMAIN, HiveEntity, refresh_system
PARALLEL_UPDATES = 0
SCAN_INTERVAL = timedelta(seconds=15)
async def async_setup_platform(hass, config,... | partofthething/home-assistant | homeassistant/components/hive/switch.py | Python | apache-2.0 | 2,449 |
import hashlib
def hash_all(strs):
"""Returns a hash of the concatenation of all the strings in strs."""
sha = hashlib.sha1()
for s in strs:
sha.update(s)
return sha.hexdigest()
| foursquare/commons-old | src/python/twitter/pants/base/hash_utils.py | Python | apache-2.0 | 192 |
from multiprocessing import Pool
from time import time
# Import the same addNumbers function we use for the serial example.
from serie import addNumbers
# map requires a function to handle a single argument
def addNumConverter((low, high)):
return addNumbers(low, high)
def splitRange(low, high):
# take sub-... | javierip/parallel-code-examples | 03-multi-core-processors/02-python-multiprocessing/multiprocessing-example.py | Python | apache-2.0 | 892 |
# ===============================================================================
# Copyright 2013 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/licens... | USGSDenverPychron/pychron | pychron/mv/degas/degasser.py | Python | apache-2.0 | 12,798 |
# Copyright Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | hglkrijger/WALinuxAgent | tests/ga/test_remoteaccess.py | Python | apache-2.0 | 5,846 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | UnrememberMe/pants | src/python/pants/backend/jvm/targets/scala_library.py | Python | apache-2.0 | 3,472 |
#!/usr/bin/env python3
# Copyright 2019 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... | kubeflow/kfp-tekton-backend | samples/core/condition/condition.py | Python | apache-2.0 | 2,572 |
# Copyright 2019 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... | alsrgv/tensorflow | tensorflow/python/ops/linalg/linear_operator_householder.py | Python | apache-2.0 | 9,623 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-21 00:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.AddField(
... | Neitsch/ASE4156 | authentication/migrations/0002_profile_has_bank_linked.py | Python | apache-2.0 | 462 |
# Copyright (c) 2009 Canonical Ltd.
# Copyright (c) 2009 Mikeal Rogers <mikeal.rogers@gmail.com>
# Copyright (c) 2009 Domen Kozar <domen@dev.si>
#
# 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 t... | ept/windmill | windmill/server/https.py | Python | apache-2.0 | 17,211 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
"""Basic rdfvalue tests."""
import time
from grr.lib import rdfvalue
from grr.lib.rdfvalues import test_base
class RDFBytesTest(test_base.RDFValueTestCase):
rdfvalue_class = rdfvalue.RDFBytes
def GenerateSample(se... | spnow/grr | lib/rdfvalues/basic_test.py | Python | apache-2.0 | 6,320 |
# -*- coding: utf-8 -*-
"""
If you know error code, use `get_for_code(code)` to retrieve exception instance.
"""
__all__ = ['Success', 'InvalidOperation', 'HostNotFound', 'ConnectionRefused',
'SendError', 'ReceiveError', 'RecordExists', 'RecordNotFound',
'MiscellaneousError', 'get_for_code']
c... | neithere/pyrant | pyrant/exceptions.py | Python | apache-2.0 | 1,671 |
import functools
import warnings
import sqlalchemy
from common.config import config
def new_engine_and_metadata():
"""
Create new SQLAlchemy engine and metadata.
NOTE: Every process should have AT MOST one engine.
"""
engine = sqlalchemy.create_engine(config["postgres"], echo=config["debugsql"], execution_opti... | andreasots/lrrbot | common/postgres.py | Python | apache-2.0 | 1,730 |
# Copyright 2015 Cloudwatt
#
# 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... | Tesora/tesora-horizon | openstack_dashboard/contrib/trove/content/database_datastores/tabs.py | Python | apache-2.0 | 2,343 |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except jin compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | chengduoZH/Paddle | python/paddle/fluid/dygraph/parallel_helper.py | Python | apache-2.0 | 1,499 |
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | redhat-cip/horizon | openstack_dashboard/dashboards/admin/networks/views.py | Python | apache-2.0 | 7,648 |
# 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... | sxjscience/tvm | python/tvm/relay/op/contrib/arm_compute_lib.py | Python | apache-2.0 | 12,300 |
#!/usr/bin/env python
#
# 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 ... | izadorozhna/tempest | tempest/tests/cmd/test_javelin.py | Python | apache-2.0 | 18,257 |
# Copyright (c) 2021 PaddlePaddle 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 ap... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/elastic_demo.py | Python | apache-2.0 | 927 |
## @file
# process compress section generation
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text o... | google/google-ctf | third_party/edk2/BaseTools/Source/Python/GenFds/CompressSection.py | Python | apache-2.0 | 3,896 |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import glob
import os
import subprocess
import sys
from contextlib import contextmanager
from dataclasses import dataclass
from typing import Any, Itera... | benjyw/pants | src/python/pants/testutil/pants_integration_test.py | Python | apache-2.0 | 11,626 |
#!/usr/bin/env python
import json
import argparse
latencys = [
{ 'osd':[
'op_latency',
'op_process_latency',
'op_r_latency',
'op_r_process_latency',
'op_w_rlat',
'op_w_latency',
'op_w_process_latency',
'op_rw_rlat',
'op_rw_process_latency',
'subop_latency',
'subop_w_latency',
'subop_pull_late... | eoncloud-dev/eontools | latency_dump.py | Python | apache-2.0 | 1,467 |
import os
from gevent.pywsgi import WSGIServer
from gevent import monkey
monkey.patch_all()
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from app import app
def push_to_server():
# just use git hooks already
pass
def background_task(instance):
# gunicorn -... | ianjuma/octopus | manage.py | Python | apache-2.0 | 789 |
# Copyright (c) 2018 PaddlePaddle 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 app... | Canpio/Paddle | python/paddle/fluid/tests/book/high-level-api/recognize_digits/test_recognize_digits_mlp.py | Python | apache-2.0 | 3,760 |
# Copyright (c) 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | projectcalico/calico-nova | nova/tests/unit/api/openstack/compute/contrib/test_server_groups.py | Python | apache-2.0 | 14,004 |
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.utils.dates import MONTHS
from calendar import monthrange
from datetime import date, timedelta
from sampledatahelper.helper import SampleDataHelper
from intranet.models import *
class Command(BaseCommand):
args = ''
he... | kaleidos/intranet | backend/intranet/management/commands/sample_data.py | Python | apache-2.0 | 6,529 |
# Copyright 2016 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... | rabipanda/tensorflow | tensorflow/python/estimator/estimator.py | Python | apache-2.0 | 47,094 |
# Copyright 2018 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... | chemelnucfin/tensorflow | tensorflow/python/data/kernel_tests/multi_device_iterator_test.py | Python | apache-2.0 | 19,062 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | dhermes/google-cloud-python | vision/google/cloud/vision_v1/types.py | Python | apache-2.0 | 2,315 |
import pytest
from dvc.env import DVC_PAGER
from dvc.ui.pager import (
DEFAULT_PAGER,
LESS,
PAGER_ENV,
find_pager,
make_pager,
pager,
)
@pytest.fixture(autouse=True)
def clear_envs(monkeypatch):
monkeypatch.delenv(DVC_PAGER, raising=False)
monkeypatch.delenv(PAGER_ENV, raising=False)
... | efiop/dvc | tests/unit/ui/test_pager.py | Python | apache-2.0 | 2,747 |
"""The tests for numeric state automation."""
from datetime import timedelta
import pytest
import voluptuous as vol
import homeassistant.components.automation as automation
from homeassistant.components.homeassistant.triggers import (
numeric_state as numeric_state_trigger,
)
from homeassistant.core import Contex... | tchellomello/home-assistant | tests/components/homeassistant/triggers/test_numeric_state.py | Python | apache-2.0 | 41,794 |
# Copyright 2015 Internap.
#
# 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, so... | mlecours/fake-switches | fake_switches/netconf/netconf_protocol.py | Python | apache-2.0 | 4,337 |
# encoding=utf-8
#
# Copyright 2012 Nebula, Inc.
# 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
#
#... | melon-li/openstack-dashboard | horizon/test/tests/tables.py | Python | apache-2.0 | 65,049 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('invitations', '0004_auto_20160629_1610'),
]
operations = [
migrations.RenameField(
model_name='invitation',
old_name='expire_date',
... | miurahr/seahub | seahub/invitations/migrations/0005_auto_20160629_1614.py | Python | apache-2.0 | 366 |
# -*- coding: utf-8 -*-
"""The NTFS directory implementation."""
from dfvfs.lib import errors
from dfvfs.path import ntfs_path_spec
from dfvfs.vfs import directory
class NTFSDirectory(directory.Directory):
"""File system directory that uses pyfsntfs."""
_FILE_REFERENCE_MFT_ENTRY_BITMASK = 0xffffffffffff
def ... | joachimmetz/dfvfs | dfvfs/vfs/ntfs_directory.py | Python | apache-2.0 | 1,709 |
# vim: set ts=4 sw=4 expandtab:
class Notification(object):
STARTUP = "startup"
SHOW_DIALOG = "showDialog"
HELLO = "hello"
# Menu
MENU_FILE_OPEN = "menuFileOpen"
MENU_FILE_SAVEAS = "menuFileSaveAs"
MENU_FILE_PREFS = "menuFilePreferences"
MENU_V... | lovelysystems/pyjamas | examples/timesheet/ApplicationConstants.py | Python | apache-2.0 | 951 |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
# SockBoatServer created on 15/8/30 下午3:49
# Copyright 2014 offbye@gmail.com
"""
"""
__author__ = ['"Xitao":<offbye@gmail.com>']
from SocketServer import ThreadingTCPServer, StreamRequestHandler
import traceback
import threading
import os,sys
from pi_pwm import PiPWM
... | offbye/PiBoat | pyboat/piboat.py | Python | apache-2.0 | 2,413 |
# 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... | tbachman/group-based-policy | gbpservice/neutron/db/grouppolicy/extensions/group_proxy_db.py | Python | apache-2.0 | 2,177 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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/l... | ruijie/quantum | quantum/tests/unit/test_linux_dhcp.py | Python | apache-2.0 | 23,666 |
from random import random
from banti.linegraph import LineGraph
class Weight():
def __init__(self, val):
self.val = val
def combine(self, other):
return random() < .3, Weight(int(100*random())+(self.val+other.val)//2)
def strength(self):
return self.val
def __repr__(self):
... | TeluguOCR/banti_telugu_ocr | tests/linegraph_test.py | Python | apache-2.0 | 691 |
import os
from collections import OrderedDict
import pytest
from waterbutler.providers.s3.metadata import (S3Revision,
S3FileMetadata,
S3FolderMetadata,
S3FolderKeyMetadata,
... | felliott/waterbutler | tests/providers/s3/fixtures.py | Python | apache-2.0 | 5,588 |
#!/usr/bin/env python
# Copyright (C) 2015 OpenStack, 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... | phinexus/jenkins-job-builder | jenkins_jobs/registry.py | Python | apache-2.0 | 18,370 |
"""
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 ... | alexryndin/ambari | ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/setup_infra_solr.py | Python | apache-2.0 | 5,041 |
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# 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 with... | arokem/PyEMMA | pyemma/_ext/six.py | Python | bsd-2-clause | 20,765 |
#!/usr/bin/env python
# coding=utf-8
"""
@package mi.instrument.wetlabs.fluorometer.flort_d.driver
@file marine-integrations/mi/instrument/wetlabs/fluorometer/flort_d/driver.py
@author Art Teranishi
@brief Driver for the flort_d
Release notes:
Initial development
"""
import datetime
import time
import re
from mi.c... | janeen666/mi-instrument | mi/instrument/wetlabs/fluorometer/flort_d/driver.py | Python | bsd-2-clause | 78,456 |
from __future__ import absolute_import, unicode_literals
from .views import ContactCRUDL
urlpatterns = ContactCRUDL().as_urlpatterns()
| xkmato/tracpro | tracpro/contacts/urls.py | Python | bsd-3-clause | 137 |
#!/bin/python
import sqlite3
import climquery
if __name__ == "__main__":
# RCPS = ['rcp45', 'rcp60', 'rcp85']
RCPS = ['rcp45', 'rcp85']
# CLIMATES = ['CCSM4', 'Ensemble', 'GFDLCM3', 'HadGEM2ES']
CLIMATES = ['Ensemble']
# YEARS = ['1990', '2030', '2060', '2090']
YEARS = ['1990', '2060']
... | jgcobb3/growth-yield-batch | scripts/blm/climate_suitability/get_species_climate_combos.py | Python | bsd-3-clause | 1,011 |
# -*- coding: utf-8 -*-
"""Tests of dataset utility functions."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os.path as op
from itertools import product
import numpy as np
from numpy... | nsteinme/phy | phy/utils/tests/test_datasets.py | Python | bsd-3-clause | 5,446 |
import numpy as np
import pandas as pd
from scipy import stats
class PredictionResults(object):
"""
Prediction results
Parameters
----------
predicted_mean : {ndarray, Series, DataFrame}
The predicted mean values
var_pred_mean : {ndarray, Series, DataFrame}
The variance of the... | bashtage/statsmodels | statsmodels/tsa/base/prediction.py | Python | bsd-3-clause | 6,163 |
from ogcserver.cgiserver import Handler
from jon import fcgi
class OGCServerHandler(Handler):
configpath = '/path/to/ogcserver.conf'
fcgi.Server({fcgi.FCGI_RESPONDER: OGCServerHandler}).run()
| pbabik/OGCServer | conf/fcgi_app.py | Python | bsd-3-clause | 198 |
'''Test query.get_field method for obtaining a single field from a query.'''
from stdnet.utils import test, zip, is_string
from examples.models import Instrument, ObjectAnalytics,\
AnalyticData, Group, Fund
from examples.data import FinanceTest, INSTS_TYPES, CCYS_TYPES
class Test... | lsbardel/python-stdnet | tests/all/query/get_field.py | Python | bsd-3-clause | 5,457 |
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2010-2011 Yung-Yu Chen <yyc@solvcon.net>.
#
# 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 l... | yungyuc/solvcon | examples/misc/elas3d/elastic.py | Python | bsd-3-clause | 26,514 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains tools to generate kernels for matching point
spread functions.
"""
from .fourier import * # noqa
from .windows import * # noqa
| astropy/photutils | photutils/psf/matching/__init__.py | Python | bsd-3-clause | 223 |
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
register_host_test("ec_app")
| coreboot/chrome-ec | zephyr/test/ec_app/BUILD.py | Python | bsd-3-clause | 195 |
import logging
from django.urls import reverse
from django.db import models
from django.db.models import F, Max, Sum
from django.utils import timezone
from django.utils.functional import cached_property
from pontoon.base.models import Project, ProjectLocale, Repository, TranslatedResource
from pontoon.base.utils impo... | mathjazz/pontoon | pontoon/sync/models.py | Python | bsd-3-clause | 5,954 |
from io import StringIO
import pytest
import pandas as pd
from pandas import DataFrame, read_json
import pandas.util.testing as tm
from pandas.util.testing import assert_frame_equal, assert_series_equal, ensure_clean
from pandas.io.json._json import JsonReader
@pytest.fixture
def lines_json_df():
df = pd.DataF... | toobaz/pandas | pandas/tests/io/json/test_readlines.py | Python | bsd-3-clause | 5,700 |
import xml.dom.minidom
import sys
sys.path.append('py')
import ColladaScene
import ColladaAnim
import os
import shutil
import re
#matchThis = '.'
matchThis = 'space-station'
outFolder = './json/'
#if os.path.exists(outFolder[:-1]):
# shutil.rmtree(outFolder[:-1])
#os.makedirs(outFolder[:-1])
fileHandle = open(outFo... | operasoftware/Odin | ColladaExport.py | Python | bsd-3-clause | 2,086 |
""" Manage the TVTK scenes. """
# Enthought library imports.
from tvtk.pyface.tvtk_scene import TVTKScene
from pyface.workbench.api import WorkbenchWindow
from traits.api import HasTraits, List, Instance, Property
from traits.api import implements, on_trait_change
from tvtk.plugins.scene.scene_editor import SceneEdito... | liulion/mayavi | tvtk/plugins/scene/scene_manager.py | Python | bsd-3-clause | 2,756 |
from datetime import timedelta
import functools
import inspect
import os
import shutil
import sys
import tempfile
import re
from errno import ENOENT
from collections.abc import Iterator
from contextlib import contextmanager
from importlib import import_module
from numbers import Integral, Number
from threading import L... | ContinuumIO/dask | dask/utils.py | Python | bsd-3-clause | 34,443 |
"""Run the migrator tool through its CLI."""
from pathlib import Path
import sys
from migrator import cli
if __name__ == '__main__':
config_path = Path(Path(__file__).parent.resolve(), '..', '..', '..', 'config')
config_path = config_path.resolve() if config_path.exists() else None
cli.run(sys.argv[1:], co... | RCOS-Grading-Server/HWserver | migration/run_migrator.py | Python | bsd-3-clause | 331 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'RssFeed'
db.create_table(u'rsssync_rssfeed', (
(u'id', self.gf('django.db.models... | ebrelsford/django-rsssync | rsssync/migrations/0001_initial.py | Python | bsd-3-clause | 2,776 |
import logging
logging.warn('DEPRECATED: pyface.grid, '
'use pyface.ui.wx.grid instead.')
from pyface.ui.wx.grid.api import *
| pankajp/pyface | pyface/grid/api.py | Python | bsd-3-clause | 140 |