code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import logging
# version, , represent versions and specifications, internal
from yotta.lib import version
# access_common, , things shared between different component access ... | ARMmbed/yotta | yotta/lib/git_access.py | Python | apache-2.0 | 4,662 |
# Copyright 2016 Nexenta 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
#
# U... | NetApp/manila | manila/share/drivers/nexenta/ns5/nexenta_nas.py | Python | apache-2.0 | 17,739 |
""" urls.py
URL dispatch, route mappings
"""
from flask.ext import restful
from mail_safe_test import app
from mail_safe_test.resources.oauth import login, oauth_callback, logout, verify
from mail_safe_test.resources.user import UserAPI, AdminUserAPI, AdminUserListAPI
from mail_safe_test.resources.contact import Con... | gdbelvin/mail-safe-test | mail_safe_test/urls.py | Python | apache-2.0 | 2,217 |
# Copyright 2011 OpenStack LLC.
# Copyright 2012-2013 STACKOPS TECHNOLOGIES S.L.
# 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 re... | StackOps/python-automationclient | automationclient/tests/test_shell.py | Python | apache-2.0 | 2,750 |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-19 03:24
from typing import List
import tensorflow as tf
import numpy as np
from hanlp.components.rnn_language_model_tf import RNNLanguageModel
from hanlp_common.constant import PAD
from hanlp.utils.io_util import get_resource
from hanlp.utils.tf_util import copy... | hankcs/HanLP | hanlp/layers/embeddings/contextual_string_embedding_tf.py | Python | apache-2.0 | 4,988 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mortada/tensorflow | tensorflow/python/ops/rnn.py | Python | apache-2.0 | 44,560 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# function: 剪切更改图片尺寸大小
import os
import os.path
import sys
import argparse
from PIL import Image
def CutImage(filein, fileout, width, height, type):
'''
# 从左上角开始 剪切 width*height的图片
filein: 输入图片
fileout: 输出图片
width: 输出图片宽度
height:输出图片高度
type:输... | congminghaoxue/learn_python | change_pic_size_by_cut.py | Python | apache-2.0 | 1,474 |
#!/usr/bin/env python
#
# 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
# "... | merlimat/pulsar | docker/pulsar/scripts/apply-config-from-env.py | Python | apache-2.0 | 2,339 |
# 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... | Mirantis/mos-horizon | openstack_dashboard/test/integration_tests/pages/project/network/routerspage.py | Python | apache-2.0 | 5,775 |
# -*- coding:utf-8 -*-
'''
Created on 24 mars 2014
@author: guillaume
'''
import os,sys
from unittest import TestCase
from tests.utils.utils import utils
s = sys.path.append(utils().buildPath(os.getcwd())+"/vagrant/optraj.istic.univ-rennes1.fr/src/")
from interfacebdd.ShuttleDAO import ShuttleDAO
from interfacebdd.C... | gpierre42/optraj | vagrant/optraj.istic.univ-rennes1.fr/src/tests/interfacebdd/test_carDAO.py | Python | apache-2.0 | 3,420 |
from django.db import models
class PageContent(models.Model):
id = models.AutoField(primary_key=True)
class Meta:
verbose_name='Page Content'
verbose_name_plural='Page Content'
def __unicode__(self):
return u'PageContent'
| MarconiMediaGroup/JobTrak | web/code/mmg/jobtrak/public/models.py | Python | apache-2.0 | 267 |
# Copyright (c) 2014 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 ... | HybridF5/jacket | jacket/compute/scheduler/filters/exact_disk_filter.py | Python | apache-2.0 | 1,856 |
#
# 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... | adel-boutros/qpid-dispatch | tests/system_tests_multi_tenancy.py | Python | apache-2.0 | 35,894 |
from epumgmt.api.actions import ACTIONS
from epumgmt.main import ControlArg
import optparse
a = []
ALL_EC_ARGS_LIST = a
################################################################################
# EM ARGUMENTS
#
# The following cmdline arguments may be queried via Parameters, using either
# the 'name' as the ar... | nimbusproject/epumgmt | src/python/epumgmt/main/em_args.py | Python | apache-2.0 | 3,947 |
# 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... | jart/tensorflow | tensorflow/contrib/autograph/core/errors.py | Python | apache-2.0 | 10,511 |
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | cc1-cloud/cc1 | src/cm/views/user/template.py | Python | apache-2.0 | 1,727 |
# Copyright 2020 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 agreed to in writing, s... | PAIR-code/lit | lit_nlp/api/dataset.py | Python | apache-2.0 | 11,296 |
# encoding: utf-8
# --------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# ULISSES ANTONIO ANTONINO DA COSTA - 1515090555
# TIAGO FERREIRA ARANHA - 1715310047
# VÍTOR SIMÕES AZEVEDO - 171... | jucimarjr/IPC_2017-1 | lista05/lista05_lista02_questao55.py | Python | apache-2.0 | 1,372 |
# Copyright (c) 2018 Intel 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 la... | openstack/neutron-lib | neutron_lib/api/definitions/network_segment_range.py | Python | apache-2.0 | 5,876 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'Architect.views.home'),
# Include an application:
# url(r'^app_name/', include('app_name.urls', namespace="app_name")),
url(r'^admin/', include(admin.s... | joshvillbrandt/ArchitectClient | Architect/urls.py | Python | apache-2.0 | 334 |
# Copyright 2017 Google 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 applicable law or... | google/tmppy | _py2tmp/unification/__init__.py | Python | apache-2.0 | 920 |
# 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
# distributed under the... | noironetworks/group-based-policy | gbpservice/neutron/tests/unit/nfp/orchestrator/db/test_nfp_db.py | Python | apache-2.0 | 26,780 |
import os
import json
import shlex
import pprint
import asyncio
import tempfile
import functools
import subprocess
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cmd as s_cmd
import synapse.lib.cli as s_cli
ListHelp = '''
Lists all the keys underneath a particular key in the hive.
... | vertexproject/synapse | synapse/cmds/hive.py | Python | apache-2.0 | 8,362 |
#
# test shuffle_batch - 6b
#
# generates a pair of files (color+bn)
# pending: make the tuple match
#
print("Loading tensorflow...")
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import os
from libs import utils
import datetime
tf.set_random_seed(1)
def create_input_pipeline_yida(f... | dariox2/CADL | test/testyida6b.py | Python | apache-2.0 | 4,901 |
# -*- 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-resource-manager | google/cloud/resourcemanager_v3/services/projects/async_client.py | Python | apache-2.0 | 70,063 |
"""Agent foundation for conversation integration."""
from abc import ABC, abstractmethod
from typing import Optional
from homeassistant.helpers import intent
class AbstractConversationAgent(ABC):
"""Abstract conversation agent."""
@property
def attribution(self):
"""Return the attribution."""
... | qedi-r/home-assistant | homeassistant/components/conversation/agent.py | Python | apache-2.0 | 714 |
import collections
import copy
import inspect
import json
import re
# Python LDAP
import ldap
import awx
# Django
from django.utils import six
from django.utils.translation import ugettext_lazy as _
# Django Auth LDAP
import django_auth_ldap.config
from django_auth_ldap.config import (
LDAPSearch,
LDAPSearch... | GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awx/sso/fields.py | Python | apache-2.0 | 26,270 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | GoogleCloudPlatform/python-docs-samples | composer/workflows/quickstart.py | Python | apache-2.0 | 1,528 |
# Lint as: python3
# 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 ... | frreiss/tensorflow-fred | tensorflow/python/distribute/multi_process_runner.py | Python | apache-2.0 | 57,381 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global_/graceful_restart/state/__init__.py | Python | apache-2.0 | 26,895 |
# -*- coding: utf-8 -*-
# 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... | openstack/tripleo-common | releasenotes/source/conf.py | Python | apache-2.0 | 8,655 |
#
# Copyright (c) 2015 Intel 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 t... | inteldcie/PtasHorizon | horizon/openstack_dashboard/dashboards/admin/alarmhistory/urls.py | Python | apache-2.0 | 891 |
import os, sys
import time, datetime
import PIL
from PIL import Image
proj_path = "/srv/spaceweather/git/spaceweather/src/spaceweather/"
output_path = "/srv/spaceweather/git/spaceweather/misc/scripts/output/"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "spaceweather.settings")
sys.path.append(proj_path)
newwid... | diacritica/spaceweather | misc/scripts/loadimagechannels.py | Python | apache-2.0 | 2,749 |
import autocomplete_light
from .models import WishlistItem
class WishlistForm(autocomplete_light.ModelForm):
class Meta:
model = WishlistItem
exclude = ['owner',]
| jmickela/stalkexchange | wishlist/forms.py | Python | apache-2.0 | 193 |
# -*- test-case-name: twisted.python.test.test_runtime -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import
import os
import sys
import time
import imp
import warnings
from twisted.python import compat
if compat._PY3:
_threadModule = "_thre... | normanmaurer/autobahntestsuite-maven-plugin | src/main/resources/twisted/python/runtime.py | Python | apache-2.0 | 4,513 |
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | openstack/trove | trove/tests/unittests/api/common/test_extensions.py | Python | apache-2.0 | 3,517 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | quattor/aquilon | lib/aquilon/aqdb/model/address_assignment.py | Python | apache-2.0 | 6,715 |
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | johnwallace123/dx-toolkit | src/python/dxpy/bindings/dxapp.py | Python | apache-2.0 | 15,467 |
__author__ = 'dalewesa'
import flask
from flask import Flask
from flask import render_template
import json
from werkzeug.serving import run_simple
app = Flask(__name__)
@app.route("/")
def home():
return render_template('index.html')
@app.route("/new")
def sendembed():
embedHTML = {'embed': '<iframe width="1... | dwesa/muhw | app.py | Python | artistic-2.0 | 729 |
"""Add rtp_task_multiple_process_event table
Revision ID: 5feda4ca9935
Revises: 9d9af47e64c8
Create Date: 2021-09-30 16:22:30.118641+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "5feda4ca9935"
down_revision = "... | HERA-Team/hera_mc | alembic/versions/5feda4ca9935_add_rtp_task_multiple_process_event_table.py | Python | bsd-2-clause | 1,093 |
import six
import json
import unittest
from unittest import TestCase
from rejson import Client, Path
rj = None
port = 6379
class ReJSONTestCase(TestCase):
def setUp(self):
global rj
rj = Client(port=port, decode_responses=True)
rj.flushdb()
def testJSONSetGetDelShouldSucceed(self):... | RedisLabs/rejson-py | tests/test_rejson.py | Python | bsd-2-clause | 8,746 |
from palm.base.model_factory import ModelFactory
from palm.base.model import Model
class CutoffModelFactory(ModelFactory):
"""CutoffModelFactory"""
def __init__(self):
pass
def create_model(self, parameter_set):
return CutoffModel(parameter_set)
class CutoffModel(Model):
"""CutoffMode... | milapour/palm | palm/cutoff_model.py | Python | bsd-2-clause | 562 |
#!/usr/bin/env python
#
# Copyright 2016, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
# Builds and runs all tutorial solutions, comparing output with expected... | sighingnow/sel4-tutorials | tests/tutorial-tests.py | Python | bsd-2-clause | 6,071 |
#!/usr/bin/python
import StringIO
import urllib
import urllib2
from lxml import etree
class NcaaGrabber:
def __init__(self):
self.ncaaUrl = 'http://web1.ncaa.org'
self.ncaaStatsSite = self.ncaaUrl+'/football/exec/rankingSummary'
# self.ncaaTeamList2008 = self.ncaaUrl+'/mfb/%d/Interne... | cbuntain/ncaa_football_predictor | Grabber/StatsClass.py | Python | bsd-2-clause | 7,312 |
from xform_instance_parser import parse_xform_instance
class SurveyInstance(object):
def __init__(self, survey_object, **kwargs):
self._survey = survey_object
self.kwargs = kwargs #not sure what might be passed to this
#does the survey object provide a way to get the key dicts?
s... | dorey/pyxform | pyxform/instance.py | Python | bsd-2-clause | 3,121 |
"""
Script to fetch historical data (since 2011) for matches (global, public).
Gives results in a chronological order (ascending), as they happened.
"""
from __future__ import print_function
from dota2py import api
from time import sleep as wait_for_next_fetch
def public_match_history(start_at_match_seq_num=None, mat... | ashishnitinpatil/dota2api_scripts | dota2api_scripts/historical_data.py | Python | bsd-2-clause | 2,542 |
from llvmlite import binding as ll
from llvmlite import ir
from warnings import warn
from numba.core import config, serialize
from numba.core.codegen import Codegen, CodeLibrary
from numba.core.errors import NumbaInvalidConfigWarning
from .cudadrv import devices, driver, nvvm
import ctypes
import numpy as np
import o... | cpcloud/numba | numba/cuda/codegen.py | Python | bsd-2-clause | 12,947 |
# Copyright (c) 2010 Carnegie Mellon University and Intel Corporation
# Author: Dmitry Berenson <dberenso@cs.cmu.edu>
#
# 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 r... | yzxsunshine/SoCBirrt | examples/python/cbirrt_benchmark.py | Python | bsd-2-clause | 5,542 |
# Copyright 2014-2015 Rumma & Ko Ltd
#
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""Defines "parency links" between two "persons", and a user interface
to manage them.
This module is probably useful in combination with
:mod:`lino_xl.lib.households`.
.. autosummary::
:toctree:
... | lino-framework/xl | lino_xl/lib/humanlinks/__init__.py | Python | bsd-2-clause | 1,211 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-26 15:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('generic', '0003_auto_20170... | BQLQ/BQLQ | drum-0.4.0/drum/links/migrations/0003_auto_20171126_2314.py | Python | bsd-2-clause | 1,322 |
# Copyright (c) 2015, Djaodjin 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 of conditions and t... | smirolo/djaodjin-signup | signup/urls/accounts.py | Python | bsd-2-clause | 2,655 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('servo', '0013_auto_20150204_1113'),
]
operations = [
migrations.AddField(
model_name='orderstatus',
... | filipp/Servo | servo/migrations/0014_orderstatus_duration.py | Python | bsd-2-clause | 439 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('simsoexp', '0005_schedulingpolicy_class_name'),
]
operations = [
migrations.RemoveField(
model_name='results',
... | Scriptopathe/simso-exp | simsoexp/migrations/0006_auto_20150721_1432.py | Python | bsd-2-clause | 2,084 |
#!/usr/bin/env python
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
readme = path.join(here, 'README.md')
try:... | damiendr/callipy | setup.py | Python | bsd-2-clause | 1,056 |
import json
class Cache(object):
def __init__(self, backend):
self.backend = backend
def set(self, key, data):
if type(data) is not str:
data = ('json', json.dumps(data))
self.backend.store(key, data)
def get(self, key):
data = self.backend.retrieve(key)
... | trb/Multicache | backends/__init__.py | Python | bsd-2-clause | 827 |
import os
import shutil
import time
from xlog import getLogger
xlog = getLogger("gae_proxy")
from .config import config
class Scan_ip_log():
max_lines_per_log_file = 3000
def __init__(self):
self.log_path = os.path.join(config.DATA_PATH, "scan_ip.log")
self.open_log()
def get_log_conte... | Suwmlee/XX-Net | gae_proxy/local/scan_ip_log.py | Python | bsd-2-clause | 1,921 |
from __future__ import absolute_import
from .notedown import *
from .main import convert, markdown_template, __version__
# avoid having to require the notebook to install notedown
try:
from .contentsmanager import NotedownContentsManager
except ImportError:
NotedownContentsManager = 'You need to install the j... | michhar/notedown | notedown/__init__.py | Python | bsd-2-clause | 338 |
# The Nexus software is licensed under the BSD 2-Clause license.
#
# You should have recieved a copy of this license with the software.
# If you did not, you can find one at the following link.
#
# http://opensource.org/licenses/bsd-license.php
from core.plugins import ProtocolPlugin
from ConfigParser import RawConfi... | TheArchives/Nexus | core/plugins/fetch.py | Python | bsd-2-clause | 5,886 |
import simuvex
from itertools import count
fastpath_data_counter = count()
class receive(simuvex.SimProcedure):
#pylint:disable=arguments-differ,attribute-defined-outside-init,redefined-outer-name
IS_SYSCALL = True
def run(self, fd, buf, count, rx_bytes):
if simuvex.options.CGC_ENFORCE_FD in se... | chubbymaggie/simuvex | simuvex/procedures/cgc/receive.py | Python | bsd-2-clause | 3,563 |
"""
Copyright (c) 2012, Daniel Skinner <daniel@dasa.cc>
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 of conditio... | dskinner/SublimeCheckstyle | checkstyle.py | Python | bsd-2-clause | 4,474 |
from __future__ import division
import sys
import pytest
from gmpy_cffi import mpz, MAX_UI
PY3 = sys.version.startswith('3')
if PY3:
long = int
invalids = [(), [], set(), dict(), lambda x: x**2]
class TestInit(object):
small_ints = [-1, 0, 1, 123, -9876, sys.maxsize, -sys.maxsize - 1]
big_ints = [s... | sn6uv/gmpy_cffi | tests/test_mpz.py | Python | bsd-3-clause | 13,559 |
import numpy as np
import pytest
from pandas._libs import join as _join
from pandas import Categorical, DataFrame, Index, merge
import pandas._testing as tm
class TestIndexer:
@pytest.mark.parametrize(
"dtype", ["int32", "int64", "float32", "float64", "object"]
)
def test_outer_join_indexer(self... | TomAugspurger/pandas | pandas/tests/test_join.py | Python | bsd-3-clause | 9,296 |
#!/usr/bin/python
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#|R|a|s|p|b|e|r|r|y|P|i|.|c|o|m|.|t|w|
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# Copyright (c) 2017, raspberrypi.com.tw
# All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Author : sosorr... | raspberrypi-tw/camera-python | 05_picamera/picamera_more.py | Python | bsd-3-clause | 709 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from hashsync.connection import connect
from hashsync.transfer import upload_directory
import logging
log = logging.getLogger(__name__)
def main():
import argparse
import sys
import gzip
parser = argparse.ArgumentParser()
# TODO: These aren't require... | catlee/hashsync | upload.py | Python | bsd-3-clause | 2,595 |
# Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
import os
import pytest
import shutil
import tempfile
import coremltools
from coreml... | apple/coremltools | coremltools/test/modelpackage/test_modelpackage.py | Python | bsd-3-clause | 20,269 |
'''
A password is considered strong if below conditions are all met:
1. It has at least 6 characters and at most 20 characters.
2. It must contain at least one lowercase letter, at least one uppercase letter, and at least one digit.
3. It must NOT contain three repeating characters in a row ("...aaa..." is weak, but "... | shub0/algorithm-data-structure | python/strong_password_checker.py | Python | bsd-3-clause | 2,441 |
import unittest
from mock import patch
from exporters.exporter_config import ExporterConfig
from exporters.persistence.base_persistence import BasePersistence
from exporters.persistence.pickle_persistence import PicklePersistence
from exporters.utils import remove_if_exists
from .utils import valid_config_with_updates... | scrapinghub/exporters | tests/test_persistence.py | Python | bsd-3-clause | 3,967 |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 1.1, s, q"
tags = "CallFunc, visible"
import cocos
from cocos.director import director
from cocos.actions import CallFunc, Delay
from cocos... | eevee/cocos2d-mirror | test/test_callfunc.py | Python | bsd-3-clause | 1,086 |
from django.conf.urls import url
from ..views import collections as views
urlpatterns = [
url('^create/$', views.Create.as_view(), name='create'),
url('^c:(?P<slug>[-\w]+)/$', views.Detail.as_view(), name='detail'),
url('^$', views.List.as_view(), name='list'),
]
| kennethlove/django_bookmarks | dj_bookmarks/bookmarks/urls/collections.py | Python | bsd-3-clause | 278 |
#!/bin/env python
# Automatically translated python version of
# OpenSceneGraph example program "osgwidgetprogress"
# !!! This program will need manual tuning before it will work. !!!
import sys
from osgpypp import osgDB
from osgpypp import osgWidget
# Translated from file 'osgwidgetprogress.cpp'
# -*-c++-*- osg... | JaneliaSciComp/osgpyplusplus | examples/rough_translated1/osgwidgetprogress.py | Python | bsd-3-clause | 2,695 |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | hjanime/VisTrails | vistrails/db/versions/v1_0_0/domain/log.py | Python | bsd-3-clause | 3,203 |
from nagm.engine.attack import Attack
from .types import *
from .defs import precision, stat, heal, offensive, faux_chage_effect
prec = precision(prec=0.9)
mimi_queue = Attack(name='Mimi-queue', type=normal, effects=(prec, stat(stat='dfse', value=-1),))
charge = Attack(name='Charge', type=normal, effects=(prec, offens... | entwanne/NAGM | games/test_game/attacks.py | Python | bsd-3-clause | 1,048 |
from __future__ import unicode_literals
from prompt_toolkit.completion import Completer, Completion
from prompt_toolkit.completion import WordCompleter, PathCompleter
from prompt_toolkit.contrib.completers.system import SystemCompleter
from prompt_toolkit.contrib.regular_languages.completion import GrammarCompleter
f... | jonathanslenders/pyvim | pyvim/commands/completer.py | Python | bsd-3-clause | 1,985 |
import json
from functools import wraps
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils import translation
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from django.views.decorators.http import... | rlr/fjord | fjord/feedback/views.py | Python | bsd-3-clause | 17,044 |
#!/bin/env python
# Automatically translated python version of
# OpenSceneGraph example program "osglight"
# !!! This program will need manual tuning before it will work. !!!
import sys
from osgpypp import osg
from osgpypp import osgDB
from osgpypp import osgUtil
from osgpypp import osgViewer
# Translated from fi... | JaneliaSciComp/osgpyplusplus | examples/rough_translated1/osglight.py | Python | bsd-3-clause | 10,059 |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from .kern import CombinationKernel
from paramz.caching import Cache_this
import itertools
from functools import reduce
def numpy_invalid_op_as_exception(func):
"""
A decorator ... | SheffieldML/GPy | GPy/kern/src/prod.py | Python | bsd-3-clause | 8,449 |
"""
sentry.plugins.base.v2
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
__all__ = ('Plugin2', )
import logging
import six
from django.http import HttpResponse... | gencer/sentry | src/sentry/plugins/base/v2.py | Python | bsd-3-clause | 13,753 |
#!/usr/bin/env python
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
from argparse import ArgumentParser
import django
from django.apps import apps
from django.conf import settings
from django.db import connection
from django.test import TestCase, TransactionTestCas... | 52ai/django-ccsds | tests/runtests.py | Python | bsd-3-clause | 17,419 |
import os
SITE_ID = 1
STATIC_URL = '/static/'
SECRET_KEY =';pkj;lkj;lkjh;lkj;oi'
db = os.environ.get('DBENGINE', None)
if db == 'pg':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django_uuid_pk',
'HOST': '127.0.0.1',
... | saxix/django-uuid-pk | django_uuid_pk/tests/settings.py | Python | bsd-3-clause | 1,626 |
#!/usr/bin/env python3
from collections import defaultdict
prompt = "> "
cart = defaultdict(int)
product_tpl = "%d) %-15s [ $%d ]"
products = {
1: ("Yoda", 10),
2: ("DVD", 20),
3: ("Lego Set", 200)
}
def product_menu():
while True:
print("Sel... | pythonbyexample/PBE | clp/shopcart.py | Python | bsd-3-clause | 1,054 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bokeh/bokeh | bokeh/sampledata/degrees.py | Python | bsd-3-clause | 2,054 |
'''
Created on 18.12.2012
@author: mhoefli
'''
from __future__ import division
import unittest
from FRETUtils.TransferMatrices import TransferMatrix, GlobalAVGKappaTransferMatrix, DistanceAVGKappaTransferMatrix, DistanceKappaTransferMatrix, genEffIndex, generateBinMid, modifyR0
from FRETUtils.Helpers import rToEff, ... | martinhoefling/fretutils | lib/FRETUtilsTests/TransferMatrixTests.py | Python | bsd-3-clause | 12,953 |
"""
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from .concept import Concept, Relationship, RelationshipCategory
from .device import Device
from .encounter import Encounter
from .events import Event
from .instruction import Instruction
f... | dekatzenel/team-k | mds/core/models/__init__.py | Python | bsd-3-clause | 948 |
from bitcoin import network
from bitcoin import messages
from io import BytesIO
from mock import patch
from gevent import socket
import mock
import os
import unittest
__author__ = 'cdecker'
BASENAME = os.path.dirname(__file__)
class TestNetworkClient(unittest.TestCase):
def test_parser(self):
"""Test ... | cdecker/pycoin | tests/test_network.py | Python | bsd-3-clause | 8,572 |
# -*- coding: utf-8 -*-
import sys
from warnings import warn
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if hasattr(settings, 'MODELTRANSLATION_TRANSLATION_REGISTRY'):
TRANSLATION_REGISTRY =\
getattr(settings, 'MODELTRANSLATION_TRANSLATION_REGISTRY', None)
elif ha... | ilblackdragon/django-modeltranslation | modeltranslation/settings.py | Python | bsd-3-clause | 1,569 |
#!/usr/bin/env python
# Time-stamp: <2019-09-25 14:16:56 taoliu>
import unittest
from MACS2.IO.BedGraph import *
class Test_bedGraphTrackI_add_loc(unittest.TestCase):
def setUp(self):
self.test_regions1 = [(b"chrY",0,10593155,0.0),
(b"chrY",10593155,10597655,0.0066254580149... | taoliu/MACS | test/test_BedGraph.py | Python | bsd-3-clause | 4,869 |
# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | ledatelescope/bifrost | test/test_serialize.py | Python | bsd-3-clause | 9,648 |
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import glob
from copy import deepcopy
import warnings
import itertools as itt
import numpy as np
... | Odingod/mne-python | mne/io/fiff/tests/test_raw.py | Python | bsd-3-clause | 38,869 |
# -*- coding: utf-8 -*-
REPO_BACKENDS = {}
REPO_TYPES = []
class RepositoryTypeNotAvailable(Exception):
pass
try:
from brigitte.backends import libgit
REPO_BACKENDS['git'] = libgit.Repo
REPO_TYPES.append(('git', 'GIT'))
except ImportError:
from brigitte.backends import git
REPO_BACKENDS['git... | stephrdev/brigitte | brigitte/backends/__init__.py | Python | bsd-3-clause | 680 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013, 2014, Pyhrol, pyhrol@rambler.ru
# GEO: N55.703431,E37.623324 .. N48.742359,E44.536997
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistri... | dyomas/pyhrol | examples/example_0050.py | Python | bsd-3-clause | 1,983 |
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = patterns('',
(r'^accounts/', include('registration.urls')),
url(r'^admin_tools/', include('admin_tools.urls')),
(r'^ad... | lukaszb/django-richtemplates | example_project/urls.py | Python | bsd-3-clause | 705 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test the various population analyses (MPA, LPA, CSPA) in cclib"""
from __future__ import print_function
im... | Schamnad/cclib | test/method/testpopulation.py | Python | bsd-3-clause | 3,489 |
"""
baserawio
======
Classes
-------
BaseRawIO
abstract class which should be overridden to write a RawIO.
RawIO is a new API in neo that is supposed to acces as fast as possible
raw data. All IO with theses characteristics should/could be rewritten:
* internally use of memmap (or hdf5)
* reading header is quite... | JuliaSprenger/python-neo | neo/rawio/baserawio.py | Python | bsd-3-clause | 26,231 |
"""
The IRAF plugin implements a remote control interface for the Ginga FITS
viewer from an IRAF session. In particular it supports the use of the
IRAF 'display' and 'imexamine' commands.
Instructions for use:
Set the environment variable IMTDEV appropriately, e.g.
$ export IMTDEV=inet:45005 (or)
$ ... | stscieisenhamer/ginga | ginga/rv/plugins/IRAF.py | Python | bsd-3-clause | 31,951 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Integration/trend_ConstantTrend/cycle_12/ar_12/test_artificial_128_Integration_ConstantTrend_12_12_0.py | Python | bsd-3-clause | 271 |
import asyncio
import gc
import os
import signal
import sys
import threading
import weakref
from datetime import timedelta
from time import sleep
import psutil
import pytest
from tornado import gen
from tornado.locks import Event
from distributed.compatibility import WINDOWS
from distributed.metrics import time
from ... | dask/distributed | distributed/tests/test_asyncprocess.py | Python | bsd-3-clause | 11,851 |
"""An exporter that converts scenes / animations to shareable HTML files.
"""
from klampt import *
from klampt.model import trajectory
from klampt import robotsim
import json
import pkg_resources
_title_id = '__TITLE__'
_scene_id = '__SCENE_JSON__'
_path_id = '__PATH_JSON__'
_rpc_id = '__RPC_JSON__'
_compressed_id = ... | krishauser/Klampt | Python/klampt/io/html.py | Python | bsd-3-clause | 7,673 |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | CMUSV-VisTrails/WorkflowRecommendation | vistrails/db/versions/v0_3_1/__init__.py | Python | bsd-3-clause | 1,861 |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | CMUSV-VisTrails/WorkflowRecommendation | vistrails/packages/controlflow/list_module.py | Python | bsd-3-clause | 2,364 |
import os
import random
import datetime
from django.db import models
from django.conf import settings
from django.utils.http import int_to_base36
from django.utils.hashcompat import sha_constructor
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User,Group
from django.core... | zdanozdan/django-invitation | invitation/models.py | Python | bsd-3-clause | 4,529 |