text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
import os
import shakedown
DEFAULT_NODE_COUNT = 3
PACKAGE_NAME = 'mds-cassandra'
TASK_RUNNING_STATE = 'TASK_RUNNING'
DCOS_URL = shakedown.run_dcos_command('config show core.dcos_url')[0].strip()
# expected SECURITY values: 'permissive', 'strict', 'disabled'
if os.environ.get('SECURITY', '') == 'strict':
print('... | akshitjain/dcos-cassandra-service | integration/tests/defaults.py | Python | apache-2.0 | 678 | 0 |
import warnings
warnings.simplefilter('ignore', Warning)
from elasticsearch_tests.tests.inputs import *
from elasticsearch_tests.tests.elasticsearch_query import *
from elasticsearch_tests.tests.elasticsearch_backend import *
| manelore/django-haystack | tests/elasticsearch_tests/tests/__init__.py | Python | bsd-3-clause | 227 | 0.013216 |
# -*- 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 'Category'
db.create_table(u'djangofeeds_category', (
(u'id', self.gf('django.db.... | chrisspen/django-feeds | djangofeeds/migrations/0001_initial.py | Python | bsd-2-clause | 10,467 | 0.006879 |
#!/usr/bin/python3
from mymodule import *
sayhi()
# __version__ 不会导入
# print('Version: ', __version__)
| louistin/thinkstation | a_byte_of_python/unit_9_module/mymodule_demo3.py | Python | mit | 114 | 0.009434 |
#!/bin/sh
"""": # -*-python-*-
bup_python="$(dirname "$0")/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
import sys, getopt, socket, subprocess, fcntl
from bup import options, path
from bup.helpers import *
optspec = """
bup daemon [options...] -- [bup-server options...]
--
l,liste... | tjanez/bup | cmd/daemon-cmd.py | Python | lgpl-2.1 | 2,128 | 0.003289 |
# Copyright 2015 IBM Corp.
# 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... | eharney/cinder | cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py | Python | apache-2.0 | 179,526 | 0.000045 |
#!/usr/bin/python3
#
# Copyright (C) 2011 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list o... | ganeti/ganeti | test/py/ganeti.utils.log_unittest.py | Python | bsd-2-clause | 9,296 | 0.005271 |
# Copyright 2016, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | GoogleCloudPlatform/python-docs-samples | compute/encryption/generate_wrapped_rsa_key_test.py | Python | apache-2.0 | 1,721 | 0 |
#
# Copyright 2015 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | jaryn/virt-deploy | virtdeploy/test_driverbase.py | Python | gpl-2.0 | 2,986 | 0 |
import os
import logging
from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import \
QWidget, QSplitter, QTreeWidget, QTreeWidgetItem, QMenu, \
QTableWidgetItem
from sheetwidget import SheetWidget
from commonwidgets import *
class SourcesWidget(QSplitter):
updateReque... | takumak/tuna | src/sourceswidget.py | Python | mit | 4,761 | 0.010292 |
# projectParams.py
# ----------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkel... | jpszerzp/sample_AI | projectParams.py | Python | apache-2.0 | 818 | 0.002445 |
"""
This module holds models related to benefits features and configurations
"""
from django import forms
from django.db import models
from django.db.models import UniqueConstraint
from django.urls import reverse
from polymorphic.models import PolymorphicModel
from sponsors.models.assets import ImgAsset, TextAsset, Fi... | manhhomienbienthuy/pythondotorg | sponsors/models/benefits.py | Python | apache-2.0 | 20,095 | 0.002787 |
""" EPYNET Classes """
from . import epanet2
from .objectcollection import ObjectCollection
from .baseobject import BaseObject, lazy_property
from .pattern import Pattern
class Node(BaseObject):
""" Base EPANET Node class """
static_properties = {'elevation': epanet2.EN_ELEVATION}
properties = {'head': ep... | VitensTC/epynet | epynet/node.py | Python | apache-2.0 | 4,030 | 0.00397 |
# (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.modules.storage.netapp.netapp_e_auditlog import AuditLog
from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args
__metaclass__ = type
from units.compat import mock... | alxgu/ansible | test/units/modules/storage/netapp/test_netapp_e_auditlog.py | Python | gpl-3.0 | 10,758 | 0.003346 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with ... | bendykst/deluge | deluge/ui/gtkui/preferences.py | Python | gpl-3.0 | 58,154 | 0.002167 |
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
from django.views.generic.base import View, TemplateView
from django.views import generic
from django.shortcuts import render_to_response
from django.template import RequestContext, load... | awalin/rwis | views.py | Python | lgpl-3.0 | 4,395 | 0.020023 |
#
# 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... | airbnb/airflow | tests/dags/test_heartbeat_failed_fast.py | Python | apache-2.0 | 1,163 | 0.00086 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread 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:
# 1. Redistributions of source code must retain the above copyright
# ... | gandreello/openthread | tests/scripts/thread-cert/Cert_7_1_04_BorderRouterAsRouter.py | Python | bsd-3-clause | 4,738 | 0.000633 |
# -*- coding: utf-8 -*-
from rest_framework.routers import (Route,
DynamicDetailRoute,
SimpleRouter,
DynamicListRoute)
from app.api.account.views import AccountViewSet
from app.api.podcast.views import PodcastV... | Podcastor/podcastor-backend | src/app/api/urls.py | Python | gpl-2.0 | 1,923 | 0 |
from ..trezor.qt_generic import QtPlugin
from keepkey import KeepKeyPlugin
class Plugin(KeepKeyPlugin, QtPlugin):
icon_paired = ":icons/keepkey.png"
icon_unpaired = ":icons/keepkey_unpaired.png"
@classmethod
def pin_matrix_widget_class(self):
from keepkeylib.qt.pinmatrix import PinMatrixWidge... | pknight007/electrum-vtc | plugins/keepkey/vtc.py | Python | mit | 353 | 0 |
__author__ = 'Jason Grundstad'
from django.conf import settings
from pyvirtualdisplay import Display
from selenium import webdriver
from bs4 import BeautifulSoup
import json
MD_ANDERSON_URL = 'https://pct.mdanderson.org/#/home'
MD_ANDERSON_OUTFILE = settings.LINKS_OUT + 'mdanderson.json'
def scrape_mdanderson():
... | djf604/viewer | util/link_out_scraper.py | Python | apache-2.0 | 1,060 | 0.003774 |
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import pymongo
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)
# put your mongodb username and password
# "mongodb://username:password@staff.mongohq.com:someport... | avinassh/learning-tornado | tornado-book/databases/definitions_readwrite.py | Python | mit | 1,628 | 0.023956 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
import numpy as np
from .rnn_base import RNNBase
from .utils import SymbolTable
class TextRNN(RNNBase):
"""TextRNN for strings of text."""
... | HazyResearch/snorkel | snorkel/learning/tensorflow/rnn/text_rnn.py | Python | apache-2.0 | 1,044 | 0.001916 |
"""
WSGI config for ngs project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` sett... | eco32i/ngs | ngs/wsgi.py | Python | mit | 1,410 | 0.000709 |
from setuptools import setup
setup(
name='pymail365',
version='0.1',
description='A python client for sending mail using Microsoft Office 365 rest service.',
long_description=open('README.rst').read(),
author='Mikko Hellsing',
author_email='mikko@aino.se',
license='BSD',
url='https://g... | aino/pymail365 | setup.py | Python | bsd-3-clause | 688 | 0.001453 |
# -*- coding: utf-8 -*-
from i3pystatus import Module
from threading import Thread
import i3ipc
class WindowTitle(Module):
"""
Display the current window title with async update.
Uses asynchronous update via i3 IPC events.
Provides instant title update only when it required.
fork from window_tile... | drwahl/i3pystatus | i3pystatus/window_title.py | Python | mit | 3,544 | 0.000847 |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/pdfimages.py
__version__=''' $Id$ '''
__doc__="""
Image functionality sliced out of canvas.py for generalization
"""
import os
import string
fr... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/src/reportlab/pdfgen/pdfimages.py | Python | gpl-3.0 | 8,517 | 0.009041 |
# Copyright 2021 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, ... | google-research/falken | service/api/stop_session_handler.py | Python | apache-2.0 | 9,830 | 0.005086 |
"""Defines ``Group`` and ``UserPartition`` models for partitioning"""
from collections import namedtuple
from stevedore.extension import ExtensionManager
# We use ``id`` in this file as the IDs of our Groups and UserPartitions,
# which Pylint disapproves of.
# pylint: disable=redefined-builtin
# UserPartition IDs... | msegado/edx-platform | common/lib/xmodule/xmodule/partitions/partitions.py | Python | agpl-3.0 | 10,492 | 0.002669 |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 03 09:38:19 2014
"""
from .PulseBase import Pulse
from .beam import OneDBeam
from . import beam
from . import DerivedPulses
from . import PulseBase
from .high_V_waveguide import OneDBeam_highV_WG | ycasg/PyNLO | src/pynlo/light/__init__.py | Python | gpl-3.0 | 245 | 0.004082 |
# -*- coding: utf8 -*-
###########################################################################
# This is the package latexparser
#
# 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, ei... | LaurentClaessens/LaTeXparser | Occurrence.py | Python | gpl-3.0 | 7,331 | 0.015278 |
#!/usr/bin/python
'''
nctu_cs_wired_topo.gy
'''
from mininet.cluster.net import MininetCluster
from mininet.cluster.placer import DFSPlacer
from mininet.log import setLogLevel
from mininet.cluster.cli import ClusterCLI as CLI
from mininet.node import Controller, RemoteController
from mininet.topo import Topo
from iter... | pichuang/OpenNet | mininet-patch/examples/cluster/nctu_ec_wired_topo.py | Python | gpl-2.0 | 3,067 | 0.011412 |
import io
from setuptools import (
setup,
find_packages,
) # pylint: disable=no-name-in-module,import-error
def dependencies(file):
with open(file) as f:
return f.read().splitlines()
with io.open("README.md", encoding="utf-8") as infile:
long_description = infile.read()
setup(
name="sm... | VictorAlessander/Smith | setup.py | Python | gpl-3.0 | 1,730 | 0.000578 |
# -*- 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-datalabeling | samples/generated_samples/datalabeling_v1beta1_generated_data_labeling_service_get_evaluation_sync.py | Python | apache-2.0 | 1,513 | 0.000661 |
import datetime
import decimal
import inspect
import itertools
import re
import socket
import time
import uuid
from io import BytesIO
from operator import itemgetter
import gridfs
import pymongo
from bson import SON, Binary, DBRef, ObjectId
from bson.int64 import Int64
from pymongo import ReturnDocument
try:
impo... | MongoEngine/mongoengine | mongoengine/fields.py | Python | mit | 90,689 | 0.001301 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-21 14:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carts', '0007_auto_20161221_1337'),
]
operations = [
migrations.AddField(
... | michel-rodrigues/ecommerce2 | source/carts/migrations/0008_cart_tax_percentage.py | Python | gpl-3.0 | 489 | 0.002045 |
from .downloader_base import DownloaderBase
from ... import logger
log = logger.get(__name__)
import traceback
import json
from urllib import request, error
try:
import ssl
SSL = True
except ImportError:
SSL = False
def is_available():
return SSL
class UrllibDownloader(DownloaderBase):
"""Down... | blopker/Color-Switch | colorswitch/http/downloaders/urllib.py | Python | mit | 1,149 | 0.002611 |
import gpi
class ExternalNode(gpi.NodeAPI):
"""This Node provides allows the user to make a DelaySequence for Jemris."""
def initUI(self):
# Widgets
self.delay_labels = ['Name', 'Observe', 'ADCs', 'Aux1', 'Aux2', 'Aux3', 'Delay', 'DelayType', 'HardwareMode',
'Phas... | sravan953/pulseq-gpi | pulseq2jemris/jemris_nodes/JMakeDelaySequence_GPI.py | Python | gpl-3.0 | 990 | 0.00404 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
import csv
from dateutil.parser import parse
def write_problem(steps, problem_views, kc_ops, row_count, kc_model_names,
out):
# variable to store ... | cmaclell/pyAFM | pyafm/roll_up.py | Python | mit | 7,059 | 0 |
#!/usr/bin/env python
from util import nodeenv_delegate
from setup import setup
if __name__ == "__main__":
setup(skip_dependencies=True)
nodeenv_delegate("npx")
| outoftime/learnpad | tools/npx.py | Python | mit | 171 | 0 |
class Solution(object):
def generateMatrix(self, n):
"""
:type n: int
:rtype: List[List[int]]
"""
if n <= 0:
return []
if n == 1:
return [[1]]
matrix = [[None] * n for _ in range(n)]
x = y = 0
direction = [(0,1),(1,0),(0... | tedye/leetcode | Python/leetcode.059.spiral-matrix-ii.py | Python | mit | 1,134 | 0.013228 |
# -*- coding: utf-8 -*-
#
# Yade documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 16 21:49:34 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | hbenniou/trunk | doc/sphinx/book/confReference.py | Python | gpl-2.0 | 26,536 | 0.030762 |
#!/usr/bin/python2.5
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | zarnold/transitfeed | extensions/googletransit/pybcp47/__init__.py | Python | apache-2.0 | 637 | 0 |
""" You've recently read "The Gold-Bug" by Edgar Allan Poe, and was so impressed by the cryptogram in it that
decided to try and decipher an encrypted text yourself. You asked your friend to encode a piece of text using
a substitution cipher, and now have an encryptedText that you'd like to decipher.
The encryption ... | ntthuy11/CodeFights | Arcade/04_Python/07_CaravanOfCollections/frequencyAnalysis.py | Python | mit | 1,131 | 0.000884 |
import json
with open('medalofhonor-old.json') as input:
data = json.load(input)
months = {
'January': 1,
'February': 2,
'March': 3,
'April': 4,
'May': 5,
'June': 6,
'July': 7,
'August': 8,
'September': 9,
'October': 10,
'November': 11,
'December': 12,
}
d... | RealTimeWeb/datasets | preprocess/medal_of_honor/fix.py | Python | gpl-2.0 | 3,268 | 0.004896 |
#!/usr/bin/env python
import sys
import re
import subprocess
import os
import optparse
import datetime
import inspect
import threading
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
VERSION = '1.0.0'
ALL_TESTS = []
LOGFILE = None
CURRENT_SUITE = 'default'
DEFAULT_TEST_TIMEOUT = ... | noselasd/testrunner | testrunner.py | Python | mit | 21,002 | 0.005142 |
from ipctest import IpcTest
from gi.repository import i3ipc
import pytest
@pytest.mark.skip(reason='TODO')
class TestGetConfig(IpcTest):
def test_get_config(self, i3):
config = i3.get_config()
assert isinstance(config, i3ipc.ConfigReply)
with open('test/i3.config') as f:
assert... | acrisci/i3ipc-glib | test/test_get_config.py | Python | gpl-3.0 | 347 | 0 |
from twisted.trial import unittest
class TestTwisted(unittest.TestCase):
def test(self):
pass
def test_fail(self):
self.fail("I failed")
def test_error(self):
raise TypeError("oops, wrong type")
def test_skip(self):
raise unittest.SkipTest('skip me')
| DESHRAJ/fjord | vendor/packages/nose/functional_tests/support/twist/test_twisted.py | Python | bsd-3-clause | 304 | 0.003289 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-04 12:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AddField(
mod... | CSchool/SchoolSite | CSchoolSite/main/migrations/0002_notification_queued.py | Python | apache-2.0 | 457 | 0 |
"""
Renderers are used to serialize a response into specific media types.
They give us a generic way of being able to handle various media types
on the response, such as JSON encoded data or HTML output.
REST framework also provides an HTML renderer the renders the browsable API.
"""
from __future__ import unicode_li... | chirilo/remo | vendor-local/lib/python/rest_framework/renderers.py | Python | bsd-3-clause | 24,971 | 0.000921 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# import json
# replace with simplejson
import simplejson as json
import os
import time
import logging
import traceback
import sys
from oslo_config import cfg
from yabgp.common import constants as bgp_cons
from yabgp.handler import BaseHandler
CONF = cfg.CONF
LOG = loggin... | meidli/yabgp | yabgp/handler/default_handler.py | Python | apache-2.0 | 7,759 | 0.000516 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
import os, os.path
import re
import sys
from pprint import pprint, pformat
| msztolcman/ff | test/mocks/__init__.py | Python | mit | 190 | 0.005263 |
# Natural Language Toolkit: Parsers
#
# Copyright (C) 2001 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@ldc.upenn.edu>
# Scott Currie <sccurrie@seas.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: __init__... | ronaldahmed/robot-navigation | neural-navigation-with-lstm/MARCO/nltk/parser/__init__.py | Python | mit | 52,728 | 0.002731 |
from .gaussian_process import RandomFeatureGaussianProcess, mean_field_logits
from .spectral_normalization import SpectralNormalization
| gagnonlg/explore-ml | sngp/tf_import/__init__.py | Python | gpl-3.0 | 136 | 0 |
__author__ = 'alexander'
def fibonacci(n):
voorlaatste_cijfer = 1
laatste_cijfer = 1
print(voorlaatste_cijfer)
print(laatste_cijfer)
for i in range(n-2):# n – 2, omdat we de eerste twee cijfers al weten
nieuw_cijfer = laatste_cijfer + voorlaatste_cijfer
print(nieuw_cijfer)
v... | Alexanderkorn/Automatisation | oude scripts/les 5/fibonacci-reeks.py | Python | gpl-3.0 | 415 | 0.007264 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 7, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_RelativeDifference/trend_MovingAverage/cycle_7/ar_/test_artificial_32_RelativeDifference_MovingAverage_7__20.py | Python | bsd-3-clause | 276 | 0.083333 |
from __future__ import print_function
import configparser as cp
import fileOps as f
import err
import logging
#EXAMPLE_LIST_FN = 'example_list'
example_list_str = \
'''0_vanDerPol = ./examples/vanderpol_python/
1_vanDerPol = ./examples/vanderpol_m_file/
2_dc = ./examples/dc_controller_hand_coded/
3_dci = ./examples... | zutshi/S3CAMX | src/example_list.py | Python | bsd-2-clause | 2,248 | 0.003114 |
# -*- coding: utf-8 -*-
"""
werkzeug.contrib.kickstart
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides some simple shortcuts to make using Werkzeug simpler
for small scripts.
These improvements include predefined `Request` and `Response` objects as
well as a predefined `Application` object whi... | AntonioMtn/NZBMegaSearch | werkzeug/contrib/kickstart.py | Python | gpl-2.0 | 11,308 | 0.000354 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2008-2014 AvanzOSC (Daniel). All Rights Reserved
# Date: 20/02/2014
#
# This program is free software: you can redistribute it and/o... | avanzosc/avanzosc6.1 | avanzosc_stpick_expectdate/__init__.py | Python | agpl-3.0 | 1,019 | 0.003925 |
def itemTemplate():
return ['object/tangible/loot/npc_loot/shared_software_module_orange_generic.iff']
def customItemName():
return 'Mark V Vocab Module'
def lootDescriptor():
return 'customattributes'
def customizationAttributes():
return ['/private/index_color_1']
def customizationValues():
return [0... | ProjectSWGCore/NGECore2 | scripts/loot/lootItems/re_junk/mark_v_vocab_module.py | Python | lgpl-3.0 | 418 | 0.064593 |
#!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2012,2013 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 obtain a... | stdweird/aquilon | upgrade/1.8.18/add_sandbox_startpoint.py | Python | apache-2.0 | 4,924 | 0.002437 |
import pytest
from canon.seq.seqreader import SeqReader
from .. import resource
def test_read_seq():
reader = SeqReader(resource('seq/Quartz_500Mpa_.SEQ'))
reader.get_Om()
Z, _, N = reader.get_Zmap('orsnr___')
def test_merge_Zmap():
reader = SeqReader()
reader.read_seq(resource('seq/au30_a1_.SE... | structrans/Canon | test/seq/test_seqreader.py | Python | mit | 560 | 0 |
# -*- coding: utf-8 -*-
"""
blohg.vcs_backends.git.changectx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Model with classes to represent Git change context.
:copyright: (c) 2010-2013 by Rafael Goncalves Martins
:license: GPL-2, see LICENSE for more details.
"""
import time
from flask.helpers import locked_c... | rafaelmartins/blohg | blohg/vcs_backends/git/changectx.py | Python | gpl-2.0 | 4,270 | 0 |
from __future__ import unicode_literals
from django.apps import AppConfig
class GooglemapstweetConfig(AppConfig):
name = 'googleMapsTweet'
| anshulsharmanyu/twitter_plot | Twitter Map Cloud Assignment/googleMapsTweet/apps.py | Python | gpl-3.0 | 145 | 0.006897 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jbedorf/tensorflow | tensorflow/compiler/tests/variable_ops_test.py | Python | apache-2.0 | 21,657 | 0.008635 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Inmarsat Playback
# Generated: Mon Aug 21 21:42:34 2017
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.plat... | Eclipse-2017/waveforms | playback/inmarsat_playback.py | Python | gpl-3.0 | 26,718 | 0.010517 |
from django.contrib.auth.models import User
from django.test import TestCase
import autofixture
autofixture.autodiscover()
class AutodiscoverTestCase(TestCase):
def test_builtin_fixtures(self):
from autofixture.autofixtures import UserFixture
self.assertEqual(autofixture.REGISTRY[User], UserFixt... | gregmuellegger/django-autofixture | autofixture_tests/tests/test_autodiscover.py | Python | bsd-3-clause | 325 | 0 |
from __future__ import print_function, division, absolute_import
import unittest
from cu2qu.pens import Cu2QuPen, Cu2QuPointPen
from . import CUBIC_GLYPHS, QUAD_GLYPHS
from .utils import DummyGlyph, DummyPointGlyph
from .utils import DummyPen, DummyPointPen
from fontTools.misc.loggingTools import CapturingLogHandler
f... | googlefonts/cu2qu | tests/pens_test.py | Python | apache-2.0 | 13,027 | 0.000077 |
# See http://zulip.readthedocs.io/en/latest/events-system.html for
# high-level documentation on how this system works.
from __future__ import absolute_import
from typing import cast, AbstractSet, Any, Callable, Dict, List, \
Mapping, MutableMapping, Optional, Iterable, Sequence, Set, Text, Union
from django.utils... | jrowan/zulip | zerver/tornado/event_queue.py | Python | apache-2.0 | 37,008 | 0.002972 |
# Directives using the toolchain
# documentation.
import docutils
def setup(app):
app.add_object_type("asmdirective", "asmdir");
app.add_object_type("asminstruction", "asminst");
app.add_object_type("ppexpressionop", "ppexprop");
app.add_object_type("ppdirective", "ppdir");
app.add_object_type("li... | DCPUTeam/DCPUToolchain | docs/sphinxext/toolchain.py | Python | mit | 335 | 0.020896 |
import os
from ruamel import yaml
import great_expectations as ge
from great_expectations.core.batch import BatchRequest, RuntimeBatchRequest
redshift_username = os.environ.get("REDSHIFT_USERNAME")
redshift_password = os.environ.get("REDSHIFT_PASSWORD")
redshift_host = os.environ.get("REDSHIFT_HOST")
redshift_port =... | great-expectations/great_expectations | tests/integration/docusaurus/connecting_to_your_data/database/redshift_yaml_example.py | Python | apache-2.0 | 3,566 | 0.001963 |
from django.conf.urls import patterns, url
from django.views.decorators.csrf import csrf_exempt
from getpaid.backends.eservice.views import PendingView, SuccessView, FailureView
urlpatterns = patterns('',
url(r'^pending/$', csrf_exempt(PendingView.as_view()), name='getpaid-eservice-pending'),
url(r'^success/$... | mionch/django-getpaid | getpaid/backends/eservice/urls.py | Python | mit | 488 | 0.010246 |
# Copyright 2010-2021 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | rembo10/headphones | lib/feedparser/util.py | Python | gpl-3.0 | 6,490 | 0.000308 |
"""
/***************************************************************************
Name : GdalTools
Description : Integrate gdal tools into qgis
Date : 17/Sep/09
copyright : (C) 2009 by Lorenzo Masini and Giuseppe Sucameli (Faunalia)
email : lorenxo86@gma... | sebastic/QGIS | python/plugins/GdalTools/__init__.py | Python | gpl-2.0 | 1,251 | 0.000799 |
import numpy as np
import pandas as pd
def decay_mean(ol, half_life=5):
years = np.array([2012, 2013, 2014, 2016, 2017])
ratings = np.array([9, 11, 14, 11, 4])
today = 2016 + 1
print(ratings.mean())
elapsed_time = years - today
half_life = 2
weights = np.e ** -(elapsed_time ... | noelevans/sandpit | decay_fns/decay_weightings.py | Python | mit | 574 | 0.020906 |
import os
os.environ['DJANGO_SETTINGS_MODULE']='settings'
import webapp2 as webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
import numpy as np
import cgi
import cgitb
cgitb.enable()
class genericBatchInputPage(webapp.RequestHandler):
def get(self):
... | puruckertom/poptox | poptox/generic/generic_batchinput.py | Python | unlicense | 1,372 | 0.019679 |
from django.conf.urls import patterns, url
from django.utils.translation import ugettext_lazy as _
from . import category_views
from . import feed
urlpatterns = patterns('',
url(r'(\d+)$', category_views.main_view, name='category'),
url(r'(\d+)/%s$' % _('contracts'), cate... | jorgecarleitao/public-contracts | contracts/category_urls.py | Python | bsd-3-clause | 977 | 0.007165 |
from __future__ import division, print_function, absolute_import
from os import path
import warnings
DATA_PATH = path.join(path.dirname(__file__), 'data')
import numpy as np
from numpy.testing import (assert_equal, assert_array_equal, run_module_suite,
assert_)
from scipy.io.idl import readsav
def object_arra... | yuanagain/seniorthesis | venv/lib/python2.7/site-packages/scipy/io/tests/test_idl.py | Python | mit | 19,614 | 0.005302 |
from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from importlib import import_module
from io import BytesIO
from django.conf import settings
from django.contrib.auth import authenticate, login, logout, get_user_model
from django.core.handlers.base import Ba... | ericholscher/django | django/test/client.py | Python | bsd-3-clause | 22,448 | 0.000757 |
# Copyright (c) 2015, Intel Corporation
# 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 condit... | ii0/bits | python/einj.py | Python | bsd-3-clause | 23,447 | 0.004478 |
# 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... | mikalstill/nova | nova/api/openstack/placement/exception.py | Python | apache-2.0 | 6,885 | 0.000436 |
# -*- coding: utf-8 -*-
"""Assorted base data structures.
Assorted base data structures provide a generic communicator with V-REP
simulator.
"""
from vrepsim.simulator import get_default_simulator
class Communicator(object):
"""Generic communicator with V-REP simulator."""
def __init__(self, vrep_sim):
... | macknowak/vrepsim | vrepsim/base.py | Python | gpl-3.0 | 699 | 0 |
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | Asana/boto | boto/rds2/layer1.py | Python | mit | 159,859 | 0.00015 |
# (c) 2012-2015, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | Shaps/ansible | test/units/plugins/cache/test_cache.py | Python | gpl-3.0 | 5,922 | 0.001013 |
#!/usr/bin/env python2.7
import feedparser
import sys
import string
# holds the feeds
feeds = []
Feed_list = []
kill = 'g'
tags = 'g'
# multiple feed list ... | pdm126/rss-crawler | dev.py | Python | mit | 4,063 | 0.03618 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
APRI和FIB4推测肝纤维化或肝硬化情况
This is a temporary script file.
"""
import math
#APRI缩写:AST to Platelet Ratio Index
#AST单位iu/l
#PRI单位10**9/L
#如果APRI>2,可能有肝硬化
def APRI(AST,upper_AST,PRI):
apri=((AST*1.0/upper_AST)*100)/PRI
return apri
#FIB-4缩写Fibrosis-4
#age单位:年
#AST和ALT单... | kyokyos/bioinform | HBV_APRI_FIB4.py | Python | unlicense | 1,993 | 0.038821 |
#!/usr/bin/env python
'''calibration command handling'''
import time, os
from pymavlink import mavutil
from MAVProxy.modules.lib import mp_module
class CalibrationModule(mp_module.MPModule):
def __init__(self, mpstate):
super(CalibrationModule, self).__init__(mpstate, "calibration")
self.add_comm... | dshyshov/MAVProxy | MAVProxy/modules/mavproxy_calibration.py | Python | gpl-3.0 | 3,874 | 0.003872 |
from openstates.utils import LXMLMixin
import datetime as dt
from pupa.scrape import Scraper, Event
from .utils import get_short_codes
from requests import HTTPError
import pytz
URL = "http://www.capitol.hawaii.gov/upcominghearings.aspx"
class HIEventScraper(Scraper, LXMLMixin):
def get_related_bills(self, hre... | cliftonmcintosh/openstates | openstates/hi/events.py | Python | gpl-3.0 | 3,151 | 0.001269 |
# 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... | sarvex/tensorflow | tensorflow/python/keras/tests/add_loss_correctness_test.py | Python | apache-2.0 | 16,393 | 0.007137 |
import unittest
import config_test
from backupcmd.commands import backupCommands
class BackupCommandsTestCase(unittest.TestCase):
"""Test commands passed to main script"""
def test_hyphen_r_option(self):
print 'Pending BackupCommandsTestCase'
self.assertEqual(1,1)
| ChinaNetCloud/nc-backup-py | nc-backup-py/tests/backup_main_commands_test.py | Python | apache-2.0 | 293 | 0.010239 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import gdb
import pwndbg.chain
import pwndbg.commands
import pwndbg.enhance
import pwndbg.file
import pwndbg.which
import pwndbg.wrappers.checksec
import pwndbg.wrappers.readelf
from pwndbg.color import message
parser = argparse.ArgumentParser(descriptio... | anthraxx/pwndbg | pwndbg/commands/mprotect.py | Python | mit | 2,402 | 0.000833 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VirtualHardwareOption(vim, *args, **kwargs):
'''The VirtualHardwareOption data object... | xuru/pyvisdk | pyvisdk/do/virtual_hardware_option.py | Python | mit | 1,413 | 0.012031 |
###############################################################################
##
## Copyright (C) 2014-2016, 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.
##
## ... | VisTrails/VisTrails | vistrails/packages/pipelineEdit/__init__.py | Python | bsd-3-clause | 2,254 | 0.011979 |
# -*- coding: utf-8 -*-
import warnings
from statsmodels.compat.pandas import PD_LT_1_4
import os
import numpy as np
import pandas as pd
from statsmodels.multivariate.factor import Factor
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_raises, assert_arr... | statsmodels/statsmodels | statsmodels/multivariate/tests/test_factor.py | Python | bsd-3-clause | 11,521 | 0.000868 |
# -*- coding: utf-8 -*-
"""
This serialiser will output an RDF Graph as a JSON-LD formatted document. See:
http://json-ld.org/
Example usage::
>>> from rdflib.plugin import register, Serializer
>>> register('json-ld', Serializer, 'rdflib_jsonld.serializer', 'JsonLDSerializer')
>>> from rdflib import... | twamarc/schemaorg | lib/rdflib_jsonld/serializer.py | Python | apache-2.0 | 12,215 | 0.001555 |
# ICE Revision: $Id$
"""Read a STL file and do simple manipulations"""
from os import path
from PyFoam.Error import error
from PyFoam.ThirdParty.six import next as iterNext
class STLFile(object):
"""Store a complete STL-file and do simple manipulations with it"""
noName="<no name given>"
def __init__(... | mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | PyFoam/Basics/STLFile.py | Python | gpl-2.0 | 6,542 | 0.024152 |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem074.py
#
# Digit factorial chains
# ======================
# Published on Friday, 16th July 2004, 06:00 pm
#
# The number 145 is well known for the property that the sum of the factorial
# of its digits is equal to 145: 1! + 4! + 5! = 1 + 24 + 120 = 145 Perhaps ... | olduvaihand/ProjectEuler | src/python/problem074.py | Python | mit | 1,088 | 0.001842 |
from Queue import Queue
import elliptics
class SecondaryIndex(object):
def __init__(self, idx, key_tpl, meta_session):
self.idx = idx
self.key_tpl = key_tpl
self.meta_session = meta_session
def __iter__(self):
for idx in self.meta_session.find_all_indexes([self.idx]):
... | yandex/mastermind | src/cocaine-app/indexes.py | Python | gpl-2.0 | 3,478 | 0.001438 |
import warnings
import os
import unittest
from test import test_support
# The warnings module isn't easily tested, because it relies on module
# globals to store configuration information. setUp() and tearDown()
# preserve the current settings to avoid bashing them while running tests.
# To capture the warning messa... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_warnings.py | Python | gpl-2.0 | 3,221 | 0.003105 |
#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# 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; version 2 dated June... | rwl/openpowersystem | cpsm/load_model/season.py | Python | agpl-3.0 | 1,789 | 0.00559 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.