code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import sys
from PyQt4 import QtCore
import pyaaf
class DummyItem(object):
def __init__(self,item, name):
self.item = item
self.name = name
def GetName(self):
return self.name
def GetClassName(self):
return ""
class TreeItem(object):
def __init__(self, ite... | markreidvfx/pyaaf_old | examples/qt_aafmodel.py | Python | mit | 10,046 |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | eustislab/horton | horton/meanfield/scf_ediis.py | Python | gpl-3.0 | 6,201 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2018 Harrison Feng <feng.harrison@gmail.com>
#
# 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/... | harrisonfeng/py-algorithms | algorithms/py/adt/queues/queue.py | Python | apache-2.0 | 1,730 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | alexis-via/xivo-provd-plugins | plugins/xivo-polycom/3.2.4B/entry.py | Python | gpl-3.0 | 1,483 |
#!/bin/env python2
"""
Support functions for multibyte mnemonic encodings of
unicode characters.
$Id$
"""
def index(str): return str[0]
class Trie:
'''Represents r: string ++> value'''
def __init__(self):
'''ensures r := {}'''
self.subtries = {}
sel... | RBornat/jape | dev/Unicode/trie.py | Python | gpl-2.0 | 4,401 |
# app.py or app/__init__.py
from flask import Flask
app = Flask(__name__, instance_relative_config=True)
# Load the default configuration
app.config.from_object('config.default')
# Load the configuration from the instance folder
app.config.from_pyfile('config.py')
# Load the file specified by the APP_CONFIG_FILE e... | noll-scpls/hybrid | __init__.py | Python | gpl-3.0 | 533 |
import logging
import urllib
from os.path import isfile
import numpy as np
import pandas as pd
from tqdm import tqdm
from blessings import Terminal
from organiser import tm_utils
TERM = Terminal()
log = logging.getLogger(__name__)
def extract_record(record, fields):
extracted = dict()
for field in fields:... | alexvicegrab/tango_master | itunes/itunes_songs.py | Python | gpl-3.0 | 3,869 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016, 2017, 2018 Guenter Bartsch
#
# 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... | gooofy/voxforge | zamiaai/skills/sports/__init__.py | Python | lgpl-3.0 | 735 |
# 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... | nathanbjenx/cairis | cairis/gui/ExceptionPanel.py | Python | apache-2.0 | 3,544 |
from __future__ import division, print_function, absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linalg',parent_package,top_path)
config.add_subpackage(('isolve'))
config.add_subpackage(('dsolve'))
co... | lhilt/scipy | scipy/sparse/linalg/setup.py | Python | bsd-3-clause | 525 |
import json
import os
import os.path
import types
from django.conf import settings
from models import FSExpirations
if settings.DJFS['type'] == 'osfs':
from fs.osfs import OSFS
elif settings.DJFS['type'] == 's3fs':
from fs.s3fs import S3FS
from boto.s3.connection import S3Connection
from boto.s3.key ... | edx/insights | src/edinsights/modulefs/modulefs.py | Python | agpl-3.0 | 3,765 |
# -*- coding: utf-8 -*-
import unittest
import mock
import os
import lxml.html
from nikola.post import get_meta
from nikola.utils import (
demote_headers, TranslatableSetting, get_crumbs, TemplateHookRegistry,
get_asset_path, get_theme_chain, get_translation_candidate)
from nikola.plugins.task.sitemap import ge... | gwax/nikola | tests/test_utils.py | Python | mit | 13,389 |
#!/usr/bin/python2.6
# This file is a part of Metagam project.
#
# Metagam is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# Metagam is distributed ... | JoyTeam/metagam | mg/constructor/admin.py | Python | gpl-3.0 | 42,144 |
"""
#;+
#; NAME:
#; galaxy.core
#; Version 1.0
#;
#; PURPOSE:
#; Core routines for galaxy analysis
#; 29-Nov-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import os, copy,... | astronomeara/xastropy-old | xastropy/galaxy/core.py | Python | bsd-3-clause | 1,859 |
class SummonList:
def __init__(self, my_summons, helper_summons):
self.my_summons = my_summons
self.helper_summons = helper_summons
# Pair your summon with each friend list summon
# @return List of summon pairs
@property
def summon_pairs(self):
summon_pair_list = []
... | adangtran87/gbf-weap | summon_list.py | Python | mit | 484 |
#
# 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
# ... | jasondunsmore/heat | heat/api/openstack/v1/__init__.py | Python | apache-2.0 | 18,979 |
"""The L{StackTransaction} class makes it possible to make complex
updates to an StGit stack in a safe and convenient way."""
import atexit
import itertools as it
from stgit import exception, utils
from stgit.utils import any, all
from stgit.out import *
from stgit.lib import git, log
from stgit.config import config
... | miracle2k/stgit | stgit/lib/transaction.py | Python | gpl-2.0 | 17,358 |
from __future__ import with_statement
import os
import re
import urllib
from django.conf import settings
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models im... | disqus/django-old | django/contrib/auth/tests/views.py | Python | bsd-3-clause | 18,537 |
# -*- coding: utf-8 -*-
"""
Defines views.
"""
import calendar
from flask import redirect, abort
from flask.ext.mako import render_template
from mako.exceptions import TopLevelLookupException
from presence_analyzer.main import app
from presence_analyzer.utils import (
jsonify,
get_data,
mean,
group_by... | stxnext-kindergarten/presence-analyzer-mjelonek | src/presence_analyzer/views.py | Python | mit | 2,812 |
#! /usr/bin/env python
import os
import sys
import subprocess
def runTests():
commands = ['./analyticTest.pl CosineHillRotateBC.xml -optionsFile np-1.dat', \
'./analyticTest.pl CosineHillRotateBC.xml -optionsFile np-2.dat', \
'./analyticTest.pl CosineHillRotateBC.xml -optionsFile ... | geodynamics/gale | StgFEM/SysTest/RegressionTests/testAll.py | Python | gpl-2.0 | 4,003 |
from unittest import mock
from django.contrib.auth.models import Permission
from django.test import TestCase
from django.urls import reverse
from wagtail.core.models import Page
from wagtail.core.signals import page_unpublished
from wagtail.tests.testapp.models import SimplePage
from wagtail.tests.utils import Wagtai... | timorieber/wagtail | wagtail/admin/tests/pages/test_unpublish_page.py | Python | bsd-3-clause | 7,589 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .base import BaseElasticsearchQuery
class AllElasticsearchQuery(BaseElasticsearchQuery):
"""
This is an Elasticsearch query class that is meant to query all of the document types in
a given index.
"""
# Class Members
# Inst... | lavalamp-/ws-backend-community | wselasticsearch/query/all.py | Python | gpl-3.0 | 754 |
'''
The MIT License (MIT)
Copyright (c) 2016-2018, Hong-She Liang <starofrainnight@gmail.com>.
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 th... | starofrainnight/rabird.auto | pydgutils_bootstrap.py | Python | mit | 4,995 |
import numpy as np
import os
import commands
import itertools
import multiprocessing as mp
import scipy.sparse
import math
import sys
import getopt
try:
opts, args = getopt.getopt(sys.argv[1:],"i:o:r:k:n:",["idir=","odir=","sampling-rate=","sampling-key=","njobs="])
except getopt.GetoptError:
print ("getopterr... | govinda-kamath/clustering_on_transcript_compatibility_counts | Zeisel_pipeline/sample_reads.py | Python | mit | 1,955 |
import json
import pytz
from datetime import datetime
from django.conf import settings
from basecrowd.interface import CrowdInterface
from connection import create_hit, disable_hit, reject_assignment, bonus_worker, expire_hit
from connection import AMT_NO_ASSIGNMENT_ID
from models import Request
class AMTCrowdInter... | amplab/ampcrowd | ampcrowd/amt/interface.py | Python | apache-2.0 | 2,871 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import atexit
import config
import logging
from web.wsgi import application as web_application
from service import getService
from shadowsocks import eventloop, daemon
main_loop = None
opts = {
# 'daemon' : 'restart... | laobubu/ssland | ssland.py | Python | mit | 2,660 |
# Generated by Django 2.2.16 on 2021-03-10 12:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("parties", "0012_add_party_docs"),
("popolo", "0035_attach_memberships_to_posts"),
]
operations = [
... | DemocracyClub/yournextrepresentative | ynr/apps/popolo/migrations/0036_add_party_name_and_description.py | Python | agpl-3.0 | 1,497 |
# -*- Mode: Python; test-case-name: flumotion.test.test_ui_fgtk -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public ... | ylatuya/Flumotion | flumotion/ui/fgtk.py | Python | gpl-2.0 | 2,667 |
from django.contrib import admin
from django.contrib.sites.models import RequestSite, Site
from django.utils.translation import ugettext_lazy as _
from registration.models import RegistrationProfile
@admin.register(RegistrationProfile)
class RegistrationAdmin(admin.ModelAdmin):
actions = ['activate_users', 'rese... | awakeup/django-registration | registration/admin.py | Python | bsd-3-clause | 1,544 |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
from t... | chaincoin/chaincoin | test/functional/rpc_deprecated.py | Python | mit | 1,464 |
import pytest
import psi4
from forte.solvers import solver_factory, HF, ActiveSpaceSolver, SpinAnalysis
def test_aci_3():
"""Test FCI on H4/STO-3G. Reproduces the test aci-1"""
ref_hf_energy = -2.0310813811962456
ref_aci_energy = -2.115455548674
ref_acipt2_energy = -2.116454734743
spin_val = 1.0... | evangelistalab/forte | tests/pytest-methods/aci/test_aci-3.py | Python | lgpl-3.0 | 1,464 |
__author__ = 'aloriga'
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
#import pickle
from utils import SerializableObject
def plot_result(data, output=None):
plt.subplot(2, 1, 2)
plt.plot(data, 'b-', label='data')
if not output is None:
plt.plot(output, 'g-', linewidth... | neural22/scipy-audio-interface | digital_filter.py | Python | gpl-2.0 | 9,987 |
"""
Test that we work properly with classes with the trivial_abi attribute
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestTrivialABI(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = Tru... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/lang/cpp/trivial_abi/TestTrivialABI.py | Python | bsd-3-clause | 2,923 |
"""Test hassbian config."""
import pytest
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.const import CONF_UNIT_SYSTEM, CONF_UNIT_SYSTEM_IMPERIAL
from homeassistant.util import... | nkgilley/home-assistant | tests/components/config/test_core.py | Python | apache-2.0 | 5,282 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | rjschwei/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/models/azure_async_operation_result.py | Python | mit | 1,759 |
import sys
import gevent
from gevent import socket
import greentest
class Test(greentest.TestCase):
def start(self):
self.server = socket.socket()
self.server.bind(('127.0.0.1', 0))
self.server.listen(1)
self.server_port = self.server.getsockname()[1]
self.acceptor = geven... | mgadi/naemonbox | sources/psdash/gevent-1.0.1/greentest/test__socket_timeout.py | Python | gpl-2.0 | 1,258 |
from .generic import *
from .auth import *
| st4lk/django-relish | relish/decorators/__init__.py | Python | bsd-3-clause | 43 |
"""Commands related to networks are in this module"""
import click
import sys
from hil.cli.client_setup import client
@click.group()
def network():
"""Commands related to network"""
@network.command(name='create', short_help='Create a new network')
@click.argument('network')
@click.argument('owner')
@click.opti... | SahilTikale/haas | hil/cli/network.py | Python | apache-2.0 | 2,277 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for testing the logging system (metrics, common logs)."""
import fcntl
import os
import sys
from queue import Queue
from threading import Thread
class Fifo:
"""Facility for creating and w... | firecracker-microvm/firecracker | tests/host_tools/logging.py | Python | apache-2.0 | 3,071 |
#!/usr/bin/python
"""
This file is part of the 'Elements' Project
Elements is a 2D Physics API for Python (supporting pybox2d)
Copyright (C) 2008, The Elements Team, <elements@linuxuser.at>
Home: http://elements.linuxuser.at
IRC: #elements on irc.freenode.org
Code: http://www.assembla.com/wiki/show/elements
... | samdroid-apps/physics | myelements/elements.py | Python | gpl-3.0 | 22,869 |
"""Middleware that prints all database queries
Use for fast database inspections.
Taken from https://djangosnippets.org/snippets/264/
"""
from django.db import connection
class TerminalLoggingMiddleware:
@staticmethod
def process_response(request, response):
"""Reads the query data and prints it"""... | AmatanHead/collective-blog | collective_blog/middleware/sql_logger.py | Python | mit | 584 |
"""
Some useful tools and utilities for wxPython.
"""
# XRCed is purposfully left out so epydoc won't document it
__all__ = [
'dbg',
'genaxmodule',
'helpviewer',
'img2img',
'img2png',
'img2py',
'img2xpm',
]
| garrettcap/Bulletproof-Backup | wx/tools/__init__.py | Python | gpl-2.0 | 244 |
import pytest
from ..test_sequences import reference_values
from .primes import is_prime, largest_prime_factor,\
prime_sieve, smallest_prime_factor, generate_prime_factors_multiplicity
primes_list = reference_values['primes']
@pytest.mark.parametrize('n', range(-1, max(primes_list) + 1))
def test_is_prime(n: in... | cryvate/project-euler | project_euler/library/number_theory/test_primes.py | Python | mit | 1,630 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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) a... | lnielsen/invenio | invenio/modules/webhooks/restful.py | Python | gpl-2.0 | 3,119 |
"""
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
"""
class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
... | dichen001/Go4Jobs | JackChen/array/118. Pascal's Triangle.py | Python | gpl-3.0 | 910 |
#Brian Stamm
#CSC 110
#11.21.14
#Lab 9 - Advanced Strings
import os
def main():
instructions()
file_name = input("What is the name of the file we are using? ")
file = open(file_name, 'r')
line = file.readline()
upper_count = 0
total_count = 0
lower_count = 0
digit_cou... | bkstamm67/python | pastHW/fileStringCounter.py | Python | mit | 1,774 |
from test import *
import tensorflow as tf
ABS_PATH = "/home/elvis/work/ML/tensorflow/separa/"
SIZE = 4746
# SIZE = 828
LABEL = 5
# LABEL = 6
TRAIN_SIZE = 768
# ACCELERATION_FACTOR = 256
ACCELERATION_FACTOR = 2048
BASE_DIVIDE = 2048
# TRAIN_SIZE = 3200
BATCH_SIZE = 128
GLOBAL_STEP = 200000000
DECAY_STEPS = 100
EVAL_... | ElvisLouis/code | work/ML/tensorflow/separa/scatter_alexnet.py | Python | gpl-2.0 | 17,960 |
import threading
import time
def print_i(num):
time.sleep(1)
for i in range(0, num):
print("thread #: ", threading.active_count())
print(num)
for i in range(0, 100):
thread = threading.Thread(target=print_i(i))
thread.setDaemon(True)
thread.start()
| billlai95/bilimining | biligrab/ThreadingTest.py | Python | apache-2.0 | 288 |
#!/usr/bin/env python3
# Author: LukeBob
#
# Requires: argparse, shodan, requests pip install them if needed.
# Run with: python3 synPwn.py --key <Shodan API Key> --cmd "<Command to try and execute>"
#
# python3 script for testing the (Synology StorageManager 5.2 - Root Remote Command Execution) exploit found by, (Weib... | LukeBob/bobstools-py | synpwn.py | Python | mit | 3,694 |
#!/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
"License");... | alexryndin/ambari | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_service.py | Python | apache-2.0 | 1,796 |
from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self... | KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/django/templatetags/static.py | Python | gpl-3.0 | 4,391 |
from google.appengine.ext import db
from datetime import datetime
class People(db.Model):
first_name = db.StringProperty()
last_name = db.StringProperty()
email_addr = db.StringProperty()
acq_source = db.StringProperty()
fb_uid = db.StringProperty()
ss_uid = db.StringProperty()
dob = db.S... | mathurakshay/gae-social-login | models/people.py | Python | unlicense | 975 |
#See also: http://www.doughellmann.com/PyMOTW/csv/
import sys
import csv
UNKNOWN_TEXT_IMT = 'text/unknown'
def readcsv(text):
sniffer = csv.Sniffer()
data = []
#Heuristic: is this really a CSV? Sniffer is pretty lax
sanity_check_length = None
try:
dialect = csv.Sniffer().sniff(text[:2048... | zepheira/zenpub | lib/csvhelper.py | Python | apache-2.0 | 2,836 |
import frappe
import apt
| StrellaGroup/strella-devops | fabric/fabfile/__init__.py | Python | mit | 25 |
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
import tensorflow.contrib.rnn as rnn
import scipy.signal
import ucv_utils
from command import Commander
from schedule import Schedule
def normalized_columns_initializer(std=1.0):
def _initializer(shape, dtype=None, partition_info=No... | mkisantal/ucv-control | network.py | Python | mit | 26,027 |
# 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 Li... | pypa/warehouse | tests/unit/test_aws.py | Python | apache-2.0 | 1,734 |
# -*- coding: utf-8 -*-
'''
Created on 27 Jan 2015 (based on tmcm_test.py)
@author: Éric Piel
Copyright © 2014-2015 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free So... | gstiebler/odemis | src/odemis/driver/test/nfpm_test.py | Python | gpl-2.0 | 10,237 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the python-chess library.
# Copyright (C) 2012-2016 Niklas Fiekas <niklas.fiekas@backscattering.de>
#
# 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... | BradleyConn/brickhack | setup.py | Python | gpl-3.0 | 3,922 |
# -*- 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-monitoring-metrics-scopes | google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc_asyncio.py | Python | apache-2.0 | 17,038 |
# Copyright (C) 2013-2014 The python-bitcoinlib developers
# Copyright (C) 2015 The python-altcoinlib developers
#
# This file is part of python-altcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-altcoinlib, including thi... | rnicoll/python-altcoinlib | altcoin/tests/__init__.py | Python | lgpl-3.0 | 529 |
''' Classes for read / write of matlab (TM) 5 files
The matfile specification last found here:
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
(as of December 5 2008)
'''
from __future__ import division, print_function, absolute_import
'''
=================================
Note on f... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/io/matlab/mio5.py | Python | gpl-3.0 | 31,895 |
# -*- coding: utf-8 -*-
#
# Copyright 2008 - 2019 Brian R. D'Urso
#
# This file is part of Python Instrument Control System, also known as Pythics.
#
# Pythics 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 Foundati... | dursobr/Pythics | pythics/__init__.py | Python | gpl-3.0 | 802 |
#hw 1/ task8/ Sergei Shybkoi
t = (1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 'a', 'b', 'c')
print "Set:",t
print "Each third element:"
print t[2::3]
print t[-1*len(t)+2:-1:3] | pybursa/homeworks | s_shybkoy/hw1/hw1_task8_ShybkoiSergei.py | Python | gpl-2.0 | 162 |
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... | neo4j/neo4j-python-driver | tests/integration/test_autocommit.py | Python | apache-2.0 | 951 |
# Copyright:
# Copyright (c) 2010, Benjamin Reitzammer <http://github.com/nureineide>,
# All rights reserved.
#
# License:
# This program is free software. You can distribute/modify this program under
# the terms of the Apache License Version 2.0 available at
# http://www.apache.org/license... | jmoz/posterous-python-wp_fork | posterous/parsers.py | Python | mit | 7,146 |
from __future__ import absolute_import
from __future__ import with_statement
from functools import partial
import celery
class AsyncResult(celery.result.AsyncResult):
def __init__(self, task_id, status=None, traceback=None,
result=None, producer=None, **kwargs):
super(AsyncResult, self)... | qudos-com/tornado-celery | tcelery/result.py | Python | bsd-3-clause | 1,841 |
# -*- coding: utf-8 -*-
"""Transport forms."""
from __future__ import unicode_literals
from django import forms
from . import backends, models
TYPE_TO_FIELD_MAP = {
"int": forms.IntegerField,
"boolean": forms.BooleanField,
"string": forms.CharField
}
class BackendSettingsMixin(object):
"""A mixin... | tonioo/modoboa | modoboa/transport/forms.py | Python | isc | 3,543 |
"""Support for Balboa Spa Wifi adaptor."""
from __future__ import annotations
import asyncio
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
FAN_OFF,
HVAC_MO... | home-assistant/home-assistant | homeassistant/components/balboa/climate.py | Python | apache-2.0 | 5,803 |
from girder_worker import GirderWorkerPluginABC
class DockerPlugin(GirderWorkerPluginABC):
def __init__(self, app, *args, **kwargs):
self.app = app
def task_imports(self):
return ['girder_worker.docker.tasks']
| girder/girder_worker | girder_worker/docker/__init__.py | Python | apache-2.0 | 238 |
# coding: utf-8
from __future__ import absolute_import
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
try:
from .compat import utf8
except (ImportError, ValueError): # for Jython
from ruamel.yaml.compat import utf8
class Mark(object):
def __init__(self, name, index, line, column, buffer, pointer):... | naparuba/opsbro | opsbro/misc/internalyaml/ruamel/yaml/error.py | Python | mit | 2,752 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | thaim/ansible | lib/ansible/modules/network/fortios/fortios_switch_controller_stp_settings.py | Python | mit | 10,652 |
__all__ = ["read"]
| khachik/ghugh | data/__init__.py | Python | bsd-2-clause | 19 |
import json
import re
from urllib.parse import urlparse
import lxml
import scrapy
from inline_requests import inline_requests
from scrapy.selector import Selector
from feeds.loaders import FeedEntryItemLoader
from feeds.spiders import FeedsXMLFeedSpider
from feeds.utils import generate_feed_header
class OrfAtSpider... | nblock/feeds | feeds/spiders/orf_at.py | Python | agpl-3.0 | 11,972 |
##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | ULHPC/modules | easybuild/easybuild-easyblocks/easybuild/easyblocks/m/metis.py | Python | mit | 5,585 |
"""Ops for graph construction.
Large amounts of code borrowed from Keras. Will try to incorporate into
DeepChem properly.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import sys
import traceback
import numpy as np
import tensorflow as tf
f... | joegomes/deepchem | deepchem/nn/model_ops.py | Python | mit | 27,568 |
from target import *
<error descr="Unresolved reference 'xyzzy'">x<caret>yzzy</error>
shazam()
| asedunov/intellij-community | python/testData/inspections/importFromModuleStar/source.py | Python | apache-2.0 | 96 |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# 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 appl... | tensorflow/datasets | tensorflow_datasets/core/logging/base_logger.py | Python | apache-2.0 | 2,385 |
# Copyright 2012 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... | danielmellado/tempest | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | Python | apache-2.0 | 1,698 |
#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
print ' [*] Waiting for messages. To exit press CTRL+C'
def callback(ch, method, properties, body):
print " [x] Receiv... | obulpathi/rabbitmq | receive.py | Python | gpl-2.0 | 469 |
from OpenGL.GL import *
from OpenGL.GLU import *
import pygame
import os.path
class Material(object):
def __init__(self):
self.name = ""
self.texture_fname = None
self.texture_id = None
class FaceGroup(object):
def __init__(self):
self.tri_indices = []
self.mater... | MaxWayne/Beginning-Game-Development-with-Python-and-Pygame | Chapter 12/model3d.py | Python | mit | 5,468 |
#
# FileLogger
#
# Copyright (c) Ryan Kadwell <ryan@riaka.ca>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# Logs time based on what file is active in sublime. Logs are stored in:
# ${HOME}/.worklogs/[DATE]
#
# Author: Ryan Kadwell <rya... | ryakad/sublime-filelogger | FileLogger.py | Python | mit | 1,599 |
# -*- coding: utf-8 -*-
"""UiObject finder
:copyright: (c) 2015 by tksn
:license: MIT
"""
from __future__ import unicode_literals
import math
import sys
from phoneauto.scriptgenerator.exception import UiObjectNotFound
class UiObjectLocator(object):
"""Locator for locating a UI object on the screen"""
def _... | tksn/phoneauto | phoneauto/scriptgenerator/uiobjectfinder.py | Python | mit | 5,775 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Spaghetti: Web Server Security Scanner
#
# @url: https://github.com/m4ll0k/Spaghetti
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'doc/LICENSE'
import AdminInterfaces
import AllowMethod
import ApacheUsers
import ApacheXss
import Backdoor
import Backup
imp... | Yukinoshita47/Yuki-Chan-The-Auto-Pentest | Module/Spaghetti/modules/discovery/All.py | Python | mit | 2,310 |
from local import *
DEBUG = True
OFFLINE_MODE = True
INTERNAL_IPS = ('127.0.0.1',)
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/tola-messages'
| open-build/TolaActivity | tola/settings/dev.py | Python | gpl-2.0 | 192 |
import numpy as np
import scipy as sp
import nibabel as nib
from numpy.testing import (assert_array_equal,
assert_array_almost_equal,
assert_almost_equal,
assert_equal)
from dipy.core import geometry as geometry
from dipy.data import get_d... | jyeatman/dipy | dipy/align/tests/test_imaffine.py | Python | bsd-3-clause | 14,486 |
# -*- 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
#... | sid88in/incubator-airflow | airflow/migrations/versions/947454bf1dff_add_ti_job_id_index.py | Python | apache-2.0 | 1,261 |
#! /usr/bin/python
# Created by Kirk Hayes (l0gan) @kirkphayes
# Part of myBFF
from core.webModule import webModule
from requests import session
import requests
import re
from argparse import ArgumentParser
import random
class JuniperBrute(webModule):
def __init__(self, config, display, lock):
super(Junip... | MooseDojo/myBFF | modules/JuniperBrute.py | Python | mit | 6,490 |
"""Add Brief.is_a_copy boolean, default False, nullable False
Revision ID: 890
Revises: 880
Create Date: 2017-06-01 11:24:53.346954
"""
# revision identifiers, used by Alembic.
revision = '900'
down_revision = '890'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('briefs', sa.Colum... | alphagov/digitalmarketplace-api | migrations/versions/900_add_brief_is_a_copy.py | Python | mit | 461 |
import logging
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session
import random
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger("flask_ask").setLevel(logging.DEBUG)
@ask.launch
def welcome():
animals = ['cat','dog','cammel','bird','horse']
session.attr... | horefice/alexa_matching_game | matching_game.py | Python | mit | 1,766 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | lucienfostier/gaffer | python/GafferImageUI/ImageViewUI.py | Python | bsd-3-clause | 15,737 |
# External Attribute Skeleton
#
# Input: Single trace, single attribute
# Output: Single attribute
#
import sys,os
import numpy as np
#
# Import the module with the I/O scaffolding of the External Attribute
#
sys.path.insert(0, os.path.join(sys.path[0], '..'))
import extattrib as xa
#
# The attribute parameters - keep... | waynegm/OpendTect-Plugins | bin/python/wmpy/Skeletons/ex_single_trace_single_attribute_input_single_output.py | Python | gpl-3.0 | 2,026 |
import sys
import tensorflow as tf
def oracle_model(x, y):
return y, 0.0, tf.no_op()
def user_input_fn(filename_queue):
x = filename_queue.dequeue()
return {"x": x}, {"y": x}
def append_argv(*args):
command = "THIS_SHOULD_NEVER_MATCH"
if sys.argv[0] != command:
sys.argv = [command]
... | raviqqe/tensorflow-qnd | qnd/test.py | Python | unlicense | 344 |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | foursquare/commons-old | src/python/twitter/pants/targets/exclude.py | Python | apache-2.0 | 1,720 |
from __future__ import division
import numpy as np
import math
from utils import *
from geom import *
from mcmc import *
def make_exp_test_disk(xmax, ymax, modelParams):
vmax, c, pa, incl = modelParams
x = []
y = []
for i, yi in enumerate(np.linspace(-ymax, ymax, 2*ymax+1)):
for j, xi in enumerate(np.linspace(-... | astrolitterbox/SAMI | test_disk.py | Python | gpl-2.0 | 2,454 |
import pytest
import os
import typing
import contextlib
import mitmproxy.exceptions
import mitmproxy.types
from mitmproxy.test import taddons
from mitmproxy.test import tflow
from mitmproxy import command
from mitmproxy import flow
from . import test_command
@contextlib.contextmanager
def chdir(path: str):
old_... | vhaupert/mitmproxy | test/mitmproxy/test_types.py | Python | mit | 10,575 |
import logging
import threading
from concurrent import futures
from .monitor import ConfigFileMonitor
from lighthouse.events import wait_on_event
MAX_WORKERS = 8
logger = logging.getLogger(__name__)
class ConfigWatcher(object):
"""
Base class for watchers that monitor and maintain `Configurable` instanc... | wglass/lighthouse | lighthouse/configs/watcher.py | Python | apache-2.0 | 8,582 |
# encoding: 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 'BudgetLine'
db.create_table('budget_lines_budgetline', (
('id', self.gf('djang... | daonb/obudget | src/server/budget_lines/migrations/0001_initial.py | Python | bsd-3-clause | 2,111 |
import unittest
from ieml.dictionary.dictionary import Dictionary
import numpy as np
from ieml.dictionary.script import Script
from ieml.ieml_database import IEMLDatabase, GitInterface
class DictionaryTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.d = IEMLDatabase(folder... | IEMLdev/propositions-restful-server | ieml/test/dictionary/test_dictionary.py | Python | gpl-3.0 | 1,134 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_desktops_operations.py | Python | mit | 12,575 |
"""
Copyright 2007-2011, 2016q Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import ast
import functools
import random
from distutils.spawn import find_executable
from itertools import count
from gi.repository import GLib, Gtk
from . import colors
from... | mrjacobagilbert/gnuradio | grc/gui/canvas/flowgraph.py | Python | gpl-3.0 | 30,369 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.