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 |
|---|---|---|---|---|---|---|
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | hanlind/nova | nova/tests/unit/volume/encryptors/test_luks.py | Python | apache-2.0 | 10,988 | 0.000091 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutSandwichCode in the Ruby Koans
#
from runner.koan import *
import re # For regular expression string comparisons
class AboutWithStatements(Koan):
def count_lines(self, file_name):
try:
file = open(file_name)
try:
... | kimegitee/python-koans | python3/koans/about_with_statements.py | Python | mit | 3,602 | 0.004997 |
'''
Copyright 2015 University of Auckland
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 agre... | alan-wu/neon | src/opencmiss/neon/ui/editors/spectrumeditorwidget.py | Python | apache-2.0 | 26,338 | 0.002202 |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General ... | whiterabbitengine/fifeplusplus | tools/editor/scripts/mapcontroller.py | Python | lgpl-2.1 | 18,203 | 0.02983 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import slopos
class TestTagger(unittest.TestCase):
def setUp(self):
slopos.load_from_path("slopos/sl-tagger.pickle")
def testSentenceTagging(self):
tagged = slopos.tag("To je test.")
self.assertEqual(tagge... | izacus/slo_pos | tests.py | Python | lgpl-2.1 | 987 | 0.007136 |
# Copyright 2015 Huawei Technologies Co., Ltd.
# 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
#
# Unl... | stackforge/tricircle | tricircle/tests/unit/network/test_central_trunk_plugin.py | Python | apache-2.0 | 24,196 | 0 |
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Read content from txt file.
'''
import os, re
from calibre import prepare_string_for_xml, isbytestring
from calibre.ebooks.metadata.opf2 import OPFCreator
from cal... | yeyanchao/calibre | src/calibre/ebooks/txt/processor.py | Python | gpl-3.0 | 8,709 | 0.006889 |
from binsearch import BinSearch
from nzbclub import NZBClub
from nzbindex import NZBIndex
from bs4 import BeautifulSoup
from couchpotato.core.helpers.variable import getTitle, splitString, tryInt
from couchpotato.core.helpers.encoding import simplifyString
from couchpotato.environment import Env
from couchpotato.core.... | thedep2/CouchPotatoServer | couchpotato/core/media/_base/providers/nzb/binnewz/main.py | Python | gpl-3.0 | 18,081 | 0.008683 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import tensorflow as tf
from niftynet.layer.downsample import DownSampleLayer
from tests.niftynet_testcase import NiftyNetTestCase
class DownSampleTest(NiftyNetTestCase):
def get_3d_input(self):
input_shape = (2, 16, 16, 16, 8... | NifTK/NiftyNet | tests/downsample_test.py | Python | apache-2.0 | 3,371 | 0.000297 |
#!/usr/bin/env python
# Kai Yu
# github.com/readline
# mafSignature2plot.py
# 150410
from __future__ import division
import os,sys,math
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
matplotlib.use('Agg')
import os,sys,matplotlib,pylab
import matplotlib.pyplot as plt
import numpy as np
def font(size):
... | readline/btb | cancer/integrate/coMut/mafSignature2plot.py | Python | gpl-2.0 | 3,469 | 0.036322 |
# Copyright (C) 2012-2016 Julie Marchant <onpon4@riseup.net>
#
# This file is part of the Pygame SGE.
#
# The Pygame SGE is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | iirlas/OpenJam-2017 | sge/gfx.py | Python | gpl-3.0 | 106,231 | 0.000028 |
"""
Created by Emille Ishida in May, 2015.
Class to implement calculations on data matrix.
"""
import os
import sys
import matplotlib.pylab as plt
import numpy as np
from multiprocessing import Pool
from snclass.treat_lc import LC
from snclass.util import read_user_input, read_snana_lc, translate_snid
from snclass.... | emilleishida/snclass | snclass/matrix.py | Python | gpl-3.0 | 10,669 | 0.001312 |
"""
The mean of three integers A, B and C is (A + B + C)/3. The median of three integers is the one that would be in the
middle if they are sorted in non-decreasing order. Given two integers A and B, return the minimum possible integer C
such that the mean and the median of A, B and C are equal.
Input
Each test case ... | deyvedvm/cederj | urionlinejudge/python/1379.py | Python | gpl-3.0 | 781 | 0.006452 |
# -*- coding: utf-8 -*-
# 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... | googleads/google-ads-python | google/ads/googleads/v10/enums/types/asset_set_asset_status.py | Python | apache-2.0 | 1,168 | 0.000856 |
# 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 pytest
from coremltools.converters.mil.mil import Builder as mb
from coreml... | apple/coremltools | coremltools/converters/mil/mil/passes/test_layernorm_instancenorm_fusion.py | Python | bsd-3-clause | 15,619 | 0.002753 |
#! /usr/bin/env python3
#############################################################
# Title: Python Debug Class #
# Description: Wrapper around Debugging and Logging for any #
# python class #
# Version: ... | Got-iT-Services-Inc/pyDebugger | Debug.py | Python | gpl-3.0 | 2,272 | 0.007482 |
# -*- coding: utf-8 -*-
"""The top-level package for ``django-mysqlpool``."""
# These imports make 2 act like 3, making it easier on us to switch to PyPy or
# some other VM if we need to for performance reasons.
from __future__ import (absolute_import, print_function, unicode_literals,
division)... | smartfile/django-mysqlpool | django_mysqlpool/backends/mysqlpool/base.py | Python | mit | 3,693 | 0 |
from datetime import datetime
from ... search import get_results, phone_hits, both_hits
from ... run_cli import Arguments
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(16)
def unique_features(feature, data):
features = set()
for v in data.values():
try:
if isins... | qadium-memex/linkalytics | linkalytics/factor_validator/coincidence/coincidence.py | Python | apache-2.0 | 1,870 | 0.01123 |
"""Implementations of authorization abstract base class managers."""
# pylint: disable=invalid-name
# Method names comply with OSID specification.
# pylint: disable=no-init
# Abstract classes do not define __init__.
# pylint: disable=too-few-public-methods
# Some interfaces are specified as 'markers' and in... | mitsei/dlkit | dlkit/abstract_osid/authorization/managers.py | Python | mit | 119,516 | 0.002083 |
# -*- coding: utf-8 -*-
"""
Tests that the request came from a crawler or not.
"""
from __future__ import absolute_import
import ddt
from django.test import TestCase
from django.http import HttpRequest
from ..models import CrawlersConfig
@ddt.ddt
class CrawlersConfigTest(TestCase):
def setUp(self):
supe... | ESOedX/edx-platform | openedx/core/djangoapps/crawlers/tests/test_models.py | Python | agpl-3.0 | 1,412 | 0.002126 |
# Copyright (c) 2013 Mirantis 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 writ... | citrix-openstack-build/sahara | sahara/conductor/manager.py | Python | apache-2.0 | 14,758 | 0 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Handling of the <message> element.
'''
import re
import types
from grit.node import base
import grit.format.rc_header
import ... | JoKaWare/WTL-DUI | tools/grit/grit/node/message.py | Python | bsd-3-clause | 10,287 | 0.009138 |
from django.contrib import admin
from tasks import models
admin.site.register(models.Project)
admin.site.register(models.Priority)
admin.site.register(models.TaskStatus)
admin.site.register(models.Phase)
admin.site.register(models.Task)
| jarnoln/mitasny | tasks/admin.py | Python | mit | 238 | 0 |
# Copyright 2015 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 ag... | KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/core/resource/resource_exceptions.py | Python | apache-2.0 | 1,244 | 0.008039 |
# Copyright (c) 2013 Red Hat, Inc.
# Author: William Benton (willb@redhat.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/licenses/LICENSE-2.0
#
# Unless r... | willb/wallaroo | clients/python-wallaroo/wallaroo/client/node.py | Python | apache-2.0 | 5,705 | 0.009465 |
#
# Copyright 2013 Red Hat, Inc
#
# Author: Eoghan Glynn <eglynn@redhat.com>
# Author: Mehdi Abaakouk <mehdi.abaakouk@enovance.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
#
# ht... | MisterPup/Ceilometer-Juno-Extension | ceilometer/alarm/evaluator/threshold.py | Python | apache-2.0 | 8,086 | 0 |
from toee import *
import tpactions
def GetActionName():
return "Divine Spell Power"
def GetActionDefinitionFlags():
return D20ADF_None
def GetTargetingClassification():
return D20TC_Target0
def GetActionCostType():
return D20ACT_NULL
def AddToSequence(d20action, action_seq, tb_status):
action_seq.add_action... | GrognardsFromHell/TemplePlus | tpdatasrc/tpgamefiles/rules/d20_actions/action02603_feat_divine_spell_power.py | Python | mit | 346 | 0.040462 |
WMC_RATE_LIMIT = 5
WMC_USER = ''
WMC_PASSWORD = ''
BLOCKHASH_COMMAND = 'blockhash'
SQLALCHEMY_URL = 'postgresql://user:pass@localhost/test'
BROKER_URL = 'amqp://guest@localhost/'
try:
from config_local import *
except ImportError:
pass
| commonsmachinery/commonshasher | config.py | Python | gpl-3.0 | 246 | 0.004065 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fsolve
import argparse
import json
class Diagramas(object):
def __init__(self, datos, w, h, den, units='SI'):
self.CAM = datos["CAM"]
self.sw = datos["sw"]
self.a3D = datos["a3D"]
self.MTOW = datos["MTOW"... | enritoomey/DiagramaDeRafagasyManiobras | diagramas_class.py | Python | mit | 20,658 | 0.004211 |
# -*- coding: utf-8 -*-
users = {
'Jean-jacques': ('12345678', 'api-key'),
}
| Glandos/FreeMobile-SMS | config.sample.py | Python | mit | 82 | 0 |
from django.conf import settings
from django.core.cache import cache
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.products.models import HOT_TOPIC_SLUG
from kitsune.products.tests import ProductFactory, TopicFactory
from kitsune.questions.models import QuestionLocale
from kitsune.search.t... | safwanrahman/kitsune | kitsune/products/tests/test_templates.py | Python | bsd-3-clause | 6,625 | 0.001057 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.exceptions import APIException
class ResourceDoesNotExist(APIException):
status_code = status.HTTP_404_NOT_FOUND
class SentryAPIException(APIException):
code = ''
me... | ifduyue/sentry | src/sentry/api/exceptions.py | Python | bsd-3-clause | 2,003 | 0.000499 |
import yeti
class ModuleUno(yeti.Module):
def module_init(self):
raise Exception()
| Team4819/Yeti | tests/resources/engine/module2.py | Python | bsd-3-clause | 96 | 0.010417 |
import matplotlib.pyplot as pl
import random as rnd
a = rnd.sample(range(10),10)
print([a])
pl.imshow([a])
| JaeGyu/PythonEx_1 | MatplotlibEx.py | Python | mit | 116 | 0.051724 |
import time
import urllib2
from urllib2 import urlopen
import datetime
from sys import argv
website = argv[1]
topSplit = '<div class=\"post\">'
bottomSplit = '<div class=\"sp_right\">'
def main():
try:
sourceCode = urllib2.urlopen(website).read()
#print sourceCode
sourceSplit = sourceCode.split(topSplit)[1]... | genokan/Python-Learning | scraper.py | Python | gpl-2.0 | 443 | 0.031603 |
#!/usr/bin/python3
import exhibition
from data import TILE_SIZE
import pygame
import collections
import logging
log = logging.getLogger(__name__)
DEBUG_RENDER_COORDS = True
class Tile:
""" A tile represents one tile in an area's map.
It has an image, a position rectangle, and an optional collision rect... | kjwilcox/digital_heist | src/tile.py | Python | gpl-2.0 | 2,393 | 0.006268 |
# -*- coding: cp1250 -*-
try:
import datetime
import time
except ImportError as err:
print("Error import module: " + str(err))
exit(128)
__author__ = 'kszalai'
class Timing:
def __init__(self):
self.start = time.clock()
def end(self):
elapsed = time.clock() - self.start
... | KAMI911/histogrammer | libs/timing.py | Python | mpl-2.0 | 609 | 0 |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from autostew_web_session.models.models import Track
from autostew_web_session.... | Autostew/autostew | autostew_web_session/urls.py | Python | agpl-3.0 | 1,673 | 0.004782 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | agry/NGECore2 | scripts/mobiles/endor/frenzied_donkuwah.py | Python | lgpl-3.0 | 1,767 | 0.032258 |
try:
from urllib.parse import quote, urljoin
except ImportError:
from urllib import quote
from urlparse import urljoin
import requests
class BandsintownError(Exception):
def __init__(self, message, response=None):
self.message = message
self.response = response
def __str__(self):... | jolbyandfriends/python-bandsintown | bandsintown/client.py | Python | mit | 4,358 | 0.000688 |
#!/usr/bin/env python
"""
A script for automated nagging emails based on passed in queries
These can be collated into several 'queries' through the use of multiple query files with
a 'query_name' param set eg: 'Bugs tracked for Firefox Beta (13)'
Once the bugs have been collected from Bugzilla they are sorted into buc... | anoopvalluthadam/bztools | auto_nag/scripts/email_nag.py | Python | bsd-3-clause | 24,245 | 0.003465 |
#!/usr/bin/env python2
from os import listdir
from os.path import isfile, isdir, join, dirname
from re import sub
from urllib import urlopen
from subprocess import Popen, PIPE
from configparser import ConfigParser
import fcntl, socket, struct
def getHwAddr(ifname):
"""The pure python solution for this problem un... | stfc/MagDB | client/magdb-discover.py | Python | apache-2.0 | 5,206 | 0.00365 |
from mrjob.job import MRJob
from mrjob.protocol import JSONValueProtocol
import json
class WordCount(MRJob):
'''
The default MRJob.INPUT_PROTOCOL is `RawValueProtocol`, but we are reading tweets,
so we'll add a parser before we even get to the mapper.
'''
# incoming line needs to be parsed (I thin... | dssg/tweedr | tweedr/emr/gnip_wc.py | Python | mit | 1,253 | 0.00399 |
#!/usr/bin/env python
import sys
import os
os.environ['MPLCONFIGDIR'] = "/tmp/"
import pandas as pd
import numpy as np
import commands
import csv
from sklearn import svm
from sklearn.cross_validation import StratifiedKFold
from sklearn import preprocessing
from sklearn.externals import joblib
current_key = None
key... | WiproOpenSourcePractice/bdreappstore | enu/real_time_event_detection/hadoopstream/reducer_post.py | Python | apache-2.0 | 2,141 | 0.015413 |
# encoding: utf-8
from __future__ import unicode_literals
from ..compat import compat_urllib_parse
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/porn91.py | Python | unlicense | 2,548 | 0.000808 |
import sys
sys.path.append('../..')
import codestudio
z = codestudio.load('s1level108')
z.speed = 'faster'
def draw_tree(depth,branches):
if depth > 0:
z.color = z.random_color()
z.move_forward(7*depth)
z.turn_left(130)
for count in range(branches):
z.turn_right(180/bran... | skilstak/code-dot-org-python | solutions/stage19-artist5/s1level108.py | Python | unlicense | 449 | 0.013363 |
#!/usr/bin/env python
import warnings as _warnings
_warnings.resetwarnings()
_warnings.filterwarnings('error')
from tdi.tools import javascript
x = javascript.escape_string(u'\xe9--"\'\\-----]]></script>')
print type(x).__name__, x
x = javascript.escape_string(u'\xe9---"\'\\----]]></script>', inlined=False)
print ty... | ndparker/tdi | tests/tools/js_escape_string.py | Python | apache-2.0 | 1,877 | 0.007991 |
names = list()
times = list()
keys = list()
names.append("HeadPitch")
times.append([0.96, 1.68, 3.28, 3.96, 4.52, 5.08])
keys.append([-0.0261199, 0.427944, 0.308291, 0.11194, -0.013848, 0.061318])
names.append("HeadYaw")
times.append([0.96, 1.68, 3.28, 3.96, 4.52, 5.08])
keys.append([-0.234743, -0.622845, -0.113558, ... | davinellulinvega/COM1005 | Lab8/wipe.py | Python | gpl-3.0 | 2,414 | 0.000829 |
from interpreter.heap import stringify
from interpreter.interpret import DTREE, CTREE
class execute():
def __init__( self, program ):
self.len = 0
self.heap = {}
self.stack = []
H = "H" + str( self.len )
self.heap[H] = { "$": "nil" }
self.len = self.len + 1
... | brian-joseph-petersen/oply | interpreter/execute.py | Python | mit | 503 | 0.035785 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pyramid_sendgrid_webhooks
----------------------------------
Tests for `pyramid_sendgrid_webhooks` module.
"""
from __future__ import unicode_literals
import unittest
import pyramid_sendgrid_webhooks as psw
from pyramid_sendgrid_webhooks import events, errors
... | GoodRx/pyramid-sendgrid-webhooks | tests/test_pyramid_sendgrid_webhooks.py | Python | mit | 6,637 | 0 |
# coding: utf-8
# This file is a part of VK4XMPP transport
# © simpleApps, 2013 — 2015.
from datetime import datetime
if not require("attachments"):
raise AssertionError("'forwardMessages' requires 'attachments'")
BASE_SPACER = chr(32) + unichr(183) + chr(32)
def parseForwardedMessages(self, msg, depth=0):
body =... | unclev/vk.unclev.ru | extensions/forwarded_messages.py | Python | mit | 1,156 | 0.021683 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from configman import ConfigurationManager, Namespace
from configman.converters import list_converter, class_converter
... | Tayamarn/socorro | socorro/unittest/external/postgresql/unittestbase.py | Python | mpl-2.0 | 3,175 | 0 |
from __future__ import absolute_import, unicode_literals
import pytest
from case import Mock, patch, skip
try:
import librabbitmq
except ImportError:
librabbitmq = None # noqa
else:
from kombu.transport import librabbitmq # noqa
@skip.unless_module('librabbitmq')
class lrmqCase:
pass
class test... | urbn/kombu | t/unit/transport/test_librabbitmq.py | Python | bsd-3-clause | 5,055 | 0 |
"""
Django settings for tiny_hands_pac project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import os
from os.path import abspath, dirname, join, normpath
from ... | DonaldTrumpHasTinyHands/tiny_hands_pac | tiny_hands_pac/settings/base.py | Python | mit | 6,665 | 0.0006 |
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import base64
import json
log = CPLog(__name__)
class Pushbullet(Notification):
url = 'https://api.p... | rooi/CouchPotatoServer | couchpotato/core/notifications/pushbullet/main.py | Python | gpl-3.0 | 2,483 | 0.012485 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Joseph Herlant <herlantj@gmail.com>
# File name: hdfs_disk_usage_per_datanode.py
# Creation date: 2014-10-08
#
# Distributed under terms of the GNU GPLv3 license.
"""
This nagios active check parses the Hadoop HDFS web interface url:
http://<namenode>:<port>/d... | aerostitch/nagios_checks | hdfs_disk_usage_per_datanode.py | Python | gpl-2.0 | 3,375 | 0.002963 |
#----------------------------------------------------------------------------------------------------------------------#
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
#
# Adham Lucas da Silva Oliveira 1715310059
# Alexandre Marques Uchôa 1715310028
# A... | jucimarjr/IPC_2017-1 | lista04/lista04_lista02_questao21.py | Python | apache-2.0 | 2,408 | 0.014632 |
# -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
"""
from __future__ import division, absolute_import
__all__ = [
'IEncodable', 'IRecord',
'A',... | biddisco/VTK | ThirdParty/Twisted/twisted/names/dns.py | Python | bsd-3-clause | 58,390 | 0.004436 |
from typing import Union
from asphalt.core.context import Context
from wsproto.connection import WSConnection, ConnectionType
from wsproto.events import ConnectionRequested, ConnectionClosed, DataReceived
from asphalt.web.api import AbstractEndpoint
from asphalt.web.request import HTTPRequest
from asphalt.web.servers... | asphalt-framework/asphalt-web | asphalt/web/websocket.py | Python | apache-2.0 | 2,282 | 0 |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | arenadata/ambari | ambari-server/src/main/resources/stacks/BigInsights/4.2/services/KNOX/package/scripts/ldap.py | Python | apache-2.0 | 1,729 | 0.004627 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-20 16:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('billjobs', '0001_initial'),
]
operations = [
migrations.AddField(
... | ioO/billjobs | billjobs/migrations/0002_service_is_available.py | Python | mit | 478 | 0.002092 |
from __future__ import division
from ._base import Descriptor
from ._graph_matrix import Radius3D as CRadius3D
from ._graph_matrix import Diameter3D as CDiameter3D
__all__ = ("Diameter3D", "Radius3D", "GeometricalShapeIndex", "PetitjeanIndex3D")
class GeometricalIndexBase(Descriptor):
__slots__ = ()
explici... | mordred-descriptor/mordred | mordred/GeometricalIndex.py | Python | bsd-3-clause | 2,504 | 0.000399 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | rosenvladimirov/addons | printer_tray/__openerp__.py | Python | agpl-3.0 | 1,538 | 0 |
# -*- coding: utf-8 -*-
"""
Module for the generation of docx format documents.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache License, Version 2.0 (the L... | wtpayne/hiai | a3_src/h70_internal/da/report/html_builder.py | Python | apache-2.0 | 2,607 | 0.003836 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | tuturto/pyherc | src/pyherc/rules/constants.py | Python | mit | 1,438 | 0.002086 |
# -*- 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
#... | akosel/incubator-airflow | tests/contrib/hooks/test_jira_hook.py | Python | apache-2.0 | 1,861 | 0 |
from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from . import views
urlpatterns = [
url(r"^$", csrf_exempt(views.SamlView.as_view())),
url(r"^metadata/$", views.serve_metadata),
]
| FinnStutzenstein/OpenSlides | server/openslides/saml/urls.py | Python | mit | 229 | 0 |
# proxy module
from __future__ import absolute_import
from mayavi.modules.slice_unstructured_grid import *
| enthought/etsproxy | enthought/mayavi/modules/slice_unstructured_grid.py | Python | bsd-3-clause | 107 | 0 |
import sys
if __name__ == "__main__":
print("Genoa python script")
sys.exit(0)
| sfu-ireceptor/gateway | resources/agave_apps/genoa/genoa.py | Python | lgpl-3.0 | 88 | 0 |
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
import libxml2
import time
import traceback
import sys
import logging
from pyxmpp.all import JID,Iq,Presence,Message,StreamError
from pyxmpp.jabber.all import Client
class Disconnected(Exception):
pass
class MyClient(Client):
def session_started(self):
se... | Jajcus/pyxmpp | examples/c2s_test.py | Python | lgpl-2.1 | 1,349 | 0.014837 |
# 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... | BeenzSyed/tempest | tempest/api/compute/floating_ips/test_floating_ips_actions.py | Python | apache-2.0 | 5,488 | 0.000182 |
resource_id = "celery-1"
_install_script = """
[ { "id": "celery-1",
"key": {"name": "Celery", "version": "2.3"},
"config_port": {
"password": "engage_129",
"username": "engage_celery",
"vhost": "engage_celery_vhost"
},
"input_ports": {
"broker": {
"BROKER_HOST": "${hos... | quaddra/engage | python_pkg/engage/drivers/genforma/drivertest_celery.py | Python | apache-2.0 | 2,355 | 0.001274 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Smewt - A smart collection manager
# Copyright (c) 2008-2013 Nicolas Wack <wackou@smewt.com>
#
# Smewt 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 v... | wackou/smewt | smewt/actions.py | Python | gpl-3.0 | 5,613 | 0.004276 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-12 19:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ui", "0010_video_default_sort"),
]
operations = [
migrations.AddField(
... | mitodl/odl-video-service | ui/migrations/0011_collection_created_at.py | Python | bsd-3-clause | 602 | 0 |
# x = [4, 6, 1, 3, 5, 7, 25]
# def stars (a):
# i = 0
# while (i < len(a)):
# print '*' * a[i]
# i += 1
# stars(x)
x = [4, "Tom", 1, "Michael", 5, 7, "Jimmy Smith"]
def stars (a):
i = 0
while (i < len(a)):
if type(a[i]) is int:
print '*' * a[i]
i+=1
else:
temp = a[i]
temp = temp.lower()
... | jiobert/python | Paracha_Junaid/Assignments/Python/Web_fund/stars.py | Python | mit | 368 | 0.048913 |
import os.path as op
import numpy as np
from numpy.testing import assert_array_equal
import pytest
from mne.parallel import parallel_func
from mne.utils import ProgressBar, array_split_idx, use_log_level
def test_progressbar():
"""Test progressbar class."""
a = np.arange(10)
pbar = ProgressBar(a)
as... | Teekuningas/mne-python | mne/utils/tests/test_progressbar.py | Python | bsd-3-clause | 3,513 | 0 |
#coding:UTF-8
"""
磁盘监控模块
"""
from config import disk
from lib import core
import os,re
def init():
"对外接口"
sign=True
for t in disk.DISK_PATH:
warn,data=check(t)
if not warn:
login_time=time.time()
message="磁盘监控预警提示,磁盘使用率超过%s"%(disk.DISK_USED)+"%\n监控结果:"+data
... | yubang/smallMonitor | lib/disk.py | Python | apache-2.0 | 903 | 0.025094 |
"""Utility for changing directories and execution of commands in a subshell."""
from __future__ import print_function
import os
import shlex
import subprocess
# Store the previous working directory for the 'cd -' command.
class Holder:
"""Holds the _prev_dir_ class attribute for chdir() function."""
_prev_d... | endlessm/chromium-browser | third_party/llvm/lldb/examples/customization/pwd-cd-and-system/utils.py | Python | bsd-3-clause | 1,600 | 0 |
#!/usr/bin/python
#credits : https://gist.github.com/TheCrazyT/11263599
import socket
import ssl
import select
import time
import re
import sys
from thread import start_new_thread
from struct import pack
from random import randint
from subprocess import call
import os
import fnmatch
import argparse
import logging
c... | srirajan/lakkucast | lakkucast.py | Python | apache-2.0 | 21,535 | 0.014442 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000155.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/BIOMD0000000155 | BIOMD0000000155/model.py | Python | cc0-1.0 | 427 | 0.009368 |
'''
Created on Oct 29, 2015
@author: yangke
'''
from model.TaintVar import TaintVar
from TraceTrackTest import TraceTrackTest
class Test_objdump_addr:
def test(self):
passed_message="BINUTILS-2.23 'addr[1]' TEST PASSED!"
not_pass_message="ERRORS FOUND IN BINUTILS-2.23 'addr[1]' TEST!"
answe... | yangke/cluehunter | test/Test_objdump_addr.py | Python | gpl-3.0 | 852 | 0.023474 |
"""
Floater Class: Velocity style controller for floating point values with
a label, entry (validated), and scale
"""
__all__ = ['Floater', 'FloaterWidget', 'FloaterGroup']
from direct.showbase.TkGlobal import *
from Tkinter import *
from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL
from dir... | toontownfunserver/Panda3D-1.9.0 | direct/tkwidgets/Floater.py | Python | bsd-3-clause | 13,935 | 0.008396 |
import graphene
from graphene_django import DjangoObjectType
from graphene_django.debug import DjangoDebug
from pontoon.api.util import get_fields
from pontoon.base.models import (
Project as ProjectModel,
Locale as LocaleModel,
ProjectLocale as ProjectLocaleModel
)
class Stats(graphene.AbstractType):
... | mastizada/pontoon | pontoon/api/schema.py | Python | bsd-3-clause | 3,806 | 0.000263 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.test import TestCase
from ..forms import QuoteForm
class TestQuoteForm(TestCase):
def setUp(self):
pass
def test_validate_emtpy_quote(self):
form = QuoteForm({'message': ''})
self.assertFals... | gabrielsaldana/sqmc | sabesqmc/quote/tests/test_forms.py | Python | agpl-3.0 | 2,384 | 0.001258 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def main():
setup(
name = 'transloader',
packages=['transloader'],
package_dir = {'transloader':'transloader'},
version = open('VERSION.txt').read().strip(),
author='Mike Thornton... | six8/transloader | setup.py | Python | mit | 1,083 | 0.012927 |
# Create a process that won't end on its own
import subprocess
process = subprocess.Popen(['python.exe', '-c', 'while 1: pass'])
# Kill the process using pywin32
import win32api
win32api.TerminateProcess(int(process._handle), -1)
# Kill the process using ctypes
import ctypes
ctypes.windll.kernel32.TerminateProcess(... | ActiveState/code | recipes/Python/347462_Terminating_subprocess/recipe-347462.py | Python | mit | 817 | 0.00612 |
# pylint: disable=missing-docstring
import logging
import numpy as np
from scipy import stats
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from edxval.api import get_videos_for_course
from openedx.core.djangoapps.request_cache.middleware import request_cached
from ope... | gsehub/edx-platform | cms/djangoapps/contentstore/api/views/course_quality.py | Python | agpl-3.0 | 9,779 | 0.002761 |
def extractFinebymetranslationsWordpressCom(item):
'''
Parser for 'finebymetranslations.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Death Progress Bar', 'Death Progress ... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractFinebymetranslationsWordpressCom.py | Python | bsd-3-clause | 666 | 0.028529 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# iflytek.py ---
#
# Filename: iflytek.py
# Description:
# Author: Werther Zhang
# Maintainer:
# Created: Thu Sep 14 09:01:20 2017 (+0800)
#
# Change Log:
#
#
import time
from ctypes import *
from io import BytesIO
import wave
import platform
import logging
import os
... | pengzhangdev/slackbot | slackbot/plugins/component/ttsdriver/iflytek.py | Python | mit | 4,519 | 0.005567 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | cuducos/findaconf | migrations/env.py | Python | mit | 2,277 | 0.000878 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-09-17 19:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('travel', '0004_auto_20160319_0055'),
]
operations = [
migrations.RemoveField(
... | avaika/avaikame | project/travel/migrations/0005_auto_20160917_2211.py | Python | gpl-3.0 | 868 | 0 |
"""
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.http import (
Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect,
)
from django.template imp... | georgemarshall/django | django/shortcuts.py | Python | bsd-3-clause | 4,896 | 0.00143 |
# Copyright (c) 2014 Mirantis 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 writ... | esikachev/scenario | sahara/tests/unit/service/test_ops.py | Python | apache-2.0 | 7,257 | 0 |
"""
WSGI config for vcert 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`` se... | managai/myCert | vcert/wsgi.py | Python | mpl-2.0 | 1,416 | 0.000706 |
import random
from test import *
from branch import *
def test(rm, fn):
name = 'test_blx_reg_a1_%s' % tn()
cleanup = asm_wrap(name, 'r0')
print ' adr %s, %s' % (rm, fn)
if fn.startswith('thumb'):
print ' orr %s, #1' % (rm)
print '%s_tinsn:' % name
print ' blx %s' % (rm)
c... | Samsung/ADBI | arch/arm/tests/blx_reg_a1.py | Python | apache-2.0 | 580 | 0.008621 |
#
# 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/providers/telegram/hooks/test_telegram.py | Python | apache-2.0 | 7,973 | 0.003136 |
# -----------------
# lambdas
# -----------------
a = lambda: 3
#? int()
a()
x = []
a = lambda x: x
#? int()
a(0)
#? float()
(lambda x: x)(3.0)
arg_l = lambda x, y: y, x
#? float()
arg_l[0]('', 1.0)
#? list()
arg_l[1]
arg_l = lambda x, y: (y, x)
args = 1,""
result = arg_l(*args)
#? tuple()
result
#? str()
result[0]... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/jedi_deps/jedi/test/completion/lambdas.py | Python | gpl-3.0 | 1,833 | 0.022368 |
##
# Copyright (c) 2015-2017 Apple 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 l... | macosforge/ccs-calendarserver | txdav/common/datastore/podding/migration/work.py | Python | apache-2.0 | 5,171 | 0.003674 |
#!/usr/bin/env python
#
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2016-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file ex... | gridengine/config-api | test/test_parallel_environment.py | Python | apache-2.0 | 5,641 | 0.000709 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | mohittahiliani/tcp-eval-suite-ns3 | src/nix-vector-routing/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 373,845 | 0.015033 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.