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 sys
import json
import pdb
class client:
def __init__(self):
self.defaultEncoding = ""
self.system = ""
self.deviceName = ""
self.pythonVersion = ""
self.username = ""
self.cwd = ""
self.filesInCurrentDirectory = ""
self.currentUserID = ""
self.OS = ""
self.serverPort = 0
self.s... | latteBot/piRAT | piRAT/core.py | Python | apache-2.0 | 1,729 | 0.039329 |
# Generated by Django 3.0.3 on 2020-02-06 10:24
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("example", "0007_artproject_description"),
]
operations = [
migrations.CreateModel(
name="LabRes... | django-json-api/rest_framework_ember | example/migrations/0008_labresults.py | Python | bsd-2-clause | 1,087 | 0 |
"""Anchore Jenkins plugin source up-to-dateness collector."""
from base_collectors import JenkinsPluginSourceUpToDatenessCollector
class AnchoreJenkinsPluginSourceUpToDateness(JenkinsPluginSourceUpToDatenessCollector):
"""Collector for the up to dateness of the Anchore Jenkins plugin security report."""
| ICTU/quality-time | components/collector/src/source_collectors/anchore_jenkins_plugin/source_up_to_dateness.py | Python | apache-2.0 | 312 | 0.00641 |
import itertools
def topological_order(graph):
global current_label
current_label = len(graph)
global label_offset
label_offset = -1
global ordered_graph
ordered_graph = {}
explored_nodes = []
for node in graph:
if node not in explored_nodes:
explored_nodes.extend(df... | Preston4tw/elearning | coursera/algo-pt1/week4/graph_primitives.py | Python | mit | 3,909 | 0.005116 |
# oppia/gamification/models.py
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from oppia.models import Course, Activity, Media
class DefaultGamificationEvent(models.Model):
GLOBAL = 'global'
CO... | DigitalCampus/django-oppia | gamification/models.py | Python | gpl-3.0 | 2,912 | 0 |
''' Colour code '''
import webcolors
from operator import itemgetter
# Replacing Matplotlib code with webcolors
CNAMES = webcolors.css3_names_to_hex
# Special gradients
gradients = {}
# Colours from images
def top_colours(image, n):
''' Return top-n colours in the image with counts. '''
size = image.size[0] ... | snorecore/MincePi | mince/colours.py | Python | mit | 856 | 0.004673 |
from django import template
from .. import forms
register = template.Library()
@register.filter
def dyn_form(forms, pk):
return forms[pk]
| ainterr/scoring_engine | engine/templatetags/dyn_form.py | Python | mit | 144 | 0.006944 |
import math
import numpy as np
from firedrake import *
from pyop2 import MPI
from pyop2.profiling import Timer
parameters["pyop2_options"]["profiling"] = True
def measure(name, thunk):
if MPI.comm.rank == 0:
print "name:", name
mesh = thunk()
mesh.init()
timer = Timer("Mesh: cell_closure (... | miklos1/watton | measure.py | Python | mit | 1,052 | 0 |
# 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 ... | vulcansteel/autorest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/auto_rest_parameter_grouping_test_service/operations/parameter_grouping_operations.py | Python | mit | 11,840 | 0.00228 |
"""Helper functions and base classes for restapi module"""
from __future__ import print_function
import requests
import fnmatch
import datetime
import collections
import mimetypes
import urllib
import tempfile
import time
import codecs
import json
import copy
import os
import sys
import munch
from itertools import izip... | CalebM1987/serverAdminTools | serverAdminTools/restapi/rest_utils.py | Python | gpl-3.0 | 41,101 | 0.003358 |
"""
Prepare Sparse Matrix for Sparse Affinity Propagation Clustering (SAP)
"""
# Authors: Huojun Cao <bioinfocao at gmail.com>
# License: BSD 3 clause
import numpy as np
import pandas as pd
import sparseAP_cy # cython for calculation
####################################################################################... | bioinfocao/pysapc | pysapc/sparseMatrixPrepare.py | Python | bsd-3-clause | 8,514 | 0.024078 |
# Copyright (C) 2017 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
#
# config_tests.py - Boom report API tests.
#
# This file is part of the boom project.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU Genera... | bmr-cymru/boom | tests/config_tests.py | Python | gpl-2.0 | 4,151 | 0.001686 |
"""
Formtools Preview application.
"""
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_ti... | skevy/django | django/contrib/formtools/preview.py | Python | bsd-3-clause | 5,860 | 0.003072 |
"""Constants for Google Assistant."""
from homeassistant.components import (
binary_sensor,
camera,
climate,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
switch,
vacuum,
)
DOMAIN = 'google_assistant'
GOOGLE_ASSISTANT_API_ENDPOINT = ... | aequitas/home-assistant | homeassistant/components/google_assistant/const.py | Python | apache-2.0 | 3,816 | 0 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
doSpatialIndex.py - build spatial index for vector layers or files
--------------------------------------
Date : 11-Nov-2011
Copyright : (C) 2011 by Alexander Bruy
Ema... | innotechsoftware/Quantum-GIS | python/plugins/fTools/tools/doSpatialIndex.py | Python | gpl-2.0 | 7,344 | 0.03908 |
#!/usr/bin/env python
import csv, sys
mapping = {}
totalTruth, totalTesting, hit, miss, errors = (0, 0, 0, 0, 0)
with open(sys.argv[1], 'rb') as groundtruth:
reader = csv.reader(groundtruth)
for row in reader:
totalTruth += 1
mapping[(row[1], row[2])] = row[0]
with open(sys.argv[2], 'rb') ... | whoww/peel-flink-kmeans | VarianceBenchmarkResults/AccuracyMeasure.py | Python | apache-2.0 | 815 | 0.001227 |
MODULES = ['main', 'config']
DEPS = []
NAME = 'Notepad'
PLATFORMS = ['any']
DESCRIPTION = 'Configuration files editor'
VERSION = '0.1'
AUTHOR = 'Ajenti team'
HOMEPAGE = 'http://ajenti.org'
| DmZ/ajenti | plugins/notepad/__init__.py | Python | lgpl-3.0 | 192 | 0.005208 |
"""
For Django < 3.1, rely on django-jsonfield-backport for JSONField
functionality
https://github.com/laymonage/django-jsonfield-backport#installation
https://github.com/laymonage/django-jsonfield-backport#why-create-another-one
"""
try:
from django.db.models import JSONField # noqa
except ImportError:
from... | pinax/pinax-eventlog | pinax/eventlog/compat.py | Python | mit | 379 | 0 |
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Viewfinder UpdateFollowerOperation.
This operation update's follower metadata for a user.
"""
__authors__ = ['mike@emailscrubbed.com (Mike Purtell)',
'andy@emailscrubbed.com (Andy Kimball)']
import json
import logging
from tornado import gen
f... | 0359xiaodong/viewfinder | backend/op/update_follower_op.py | Python | apache-2.0 | 4,084 | 0.008815 |
"""
In-memory treq returns stubbed responses.
"""
from functools import partial
from inspect import getmembers, isfunction
from mock import ANY
from six import text_type, binary_type
from twisted.web.client import ResponseFailed
from twisted.web.error import SchemeNotSupported
from twisted.web.resource import Resour... | mithrandi/treq | src/treq/test/test_testing.py | Python | mit | 17,263 | 0 |
#------------------------------------------------------------------------
#
# Register the Addon
#
#------------------------------------------------------------------------
register(GENERAL,
id="libwebconnect",
name="libwebconnect",
description = _("Library for web site collections"),
... | sam-m888/addons-source | libwebconnect/libwebconnect.gpr.py | Python | gpl-2.0 | 516 | 0.027132 |
import json
import glob
import logging
import os
config = {}
log = logging.getLogger(__name__)
def get(key, default_value=None):
path = key.split(".")
value = config.copy()
for i in path:
if i not in value:
value = None
break
value = value[i]
return value or d... | Unix4ever/spike | common/config.py | Python | mit | 1,403 | 0.003564 |
from django.conf import settings
from django.core.handlers.base import get_path_info
from django.core.handlers.wsgi import WSGIHandler
from django.utils.six.moves.urllib.parse import urlparse
from django.utils.six.moves.urllib.request import url2pathname
from django.contrib.staticfiles import utils
from django.contrib... | edisonlz/fruit | web_project/base/site-packages/django/contrib/staticfiles/handlers.py | Python | apache-2.0 | 2,440 | 0.00082 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | felipenaselva/repo.felipe | plugin.video.exodus/resources/lib/sources/pftv_tv.py | Python | gpl-2.0 | 5,225 | 0.010718 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,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 copy of the Li... | stdweird/aquilon | upgrade/1.4.5/aquilon/aqdb/model/machine_specs.py | Python | apache-2.0 | 4,639 | 0.006036 |
from __future__ import absolute_import, unicode_literals
######################
# MEZZANINE SETTINGS #
######################
# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
# common enough to be put here, commented out, for con... | simodalla/mezzanine_mailchimper | project_template/settings.py | Python | bsd-3-clause | 14,784 | 0.000271 |
import marshal
import os
import subprocess
import urlparse
import dxr.plugins
"""Omniglot - Speaking all commonly-used version control systems.
At present, this plugin is still under development, so not all features are
fully implemented.
Omniglot first scans the project directory looking for the hallmarks of a VCS
... | nrc/dxr | dxr/plugins/omniglot/htmlifier.py | Python | mit | 10,987 | 0.001547 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | flumotion-mirror/flumotion | flumotion/component/effects/videoscale/admin_gtk.py | Python | lgpl-2.1 | 4,782 | 0.000209 |
# -*- coding: utf-8 -*-
import unicodecsv
from collections import Counter
from django.http import HttpResponse
from django.shortcuts import render
from .models import Disciplina, Docente, Pesquisa, Extensao, Administrativo
def query_estudantes(query):
result = [
['1-6', query.filter(estudantes__gte=... | UFRB/chdocente | cadastro/views.py | Python | agpl-3.0 | 13,491 | 0.005275 |
print ("ssimiliar to develop") | Dan-Donovan/cs3240-labdemo | helperMaster.py | Python | mit | 30 | 0.066667 |
from plugins.external.sergio_proxy.plugins.plugin import Plugin
class CacheKill(Plugin):
name = "CacheKill Plugin"
optname = "cachekill"
desc = "Kills page caching by modifying headers."
implements = ["handleHeader","connectionMade"]
has_opts = True
bad_headers = ['if-none-match','if-modified-s... | P0cL4bs/3vilTwinAttacker | plugins/external/sergio_proxy/plugins/CacheKill.py | Python | gpl-3.0 | 952 | 0.015756 |
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class CBondSpecialConditions(BaseModel):
"""
4.127 中国债券特殊条款
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Win... | SnowWalkerJ/quantlib | quant/data/wind/tables/cbondspecialconditions.py | Python | gpl-3.0 | 1,754 | 0.011139 |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import warnings
from . import AWSHelperFn, AWSObject, AWSProperty
warnings.warn("This module is outdated and will be replaced with "
"troposphere.dynamodb2. Please see the README for "
... | Yipit/troposphere | troposphere/dynamodb.py | Python | bsd-2-clause | 2,797 | 0.000358 |
import glob
import os
import re
import yaml
from argparse import ArgumentParser
from .runner import Runner
from .cli import CLI
class GhcRunner(Runner):
IMPORT_REGEX = re.compile(r'^\s*import\s+(.*?)$')
def reset(self):
self.required = []
self.incdirs = []
def make_code(self, file, fil... | srz-zumix/wandbox-api | wandbox/__ghc__.py | Python | mit | 4,680 | 0.000427 |
from django import forms
from .widgets import MarkdownxWidget
class MarkdownxFormField(forms.CharField):
"""
Used in FormFields as a Markdown enabled replacement for ``CharField``.
"""
def __init__(self, *args, **kwargs):
"""
Arguments are similar to Django's default ``CharField``.
... | wuga214/Django-Wuga | env/lib/python2.7/site-packages/markdownx/fields.py | Python | apache-2.0 | 1,070 | 0.004673 |
#!/usr/local/bin/python2.7
from sys import exit, stdout, argv
from os import environ, system
environ['KERAS_BACKEND'] = 'tensorflow'
import numpy as np
import utils
import signal
from keras.layers import Input, Dense, Dropout, concatenate, LSTM, BatchNormalization, Conv1D, concatenate
from keras.models import Model ... | sidnarayanan/BAdNet | train/pf/adv/models/train_panda_3.py | Python | mit | 9,427 | 0.017079 |
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | google-business-communications/bm-bonjour-meal-django-starter-code | bonjourmeal-codelab/full-sample/bmcodelab/settings.py | Python | apache-2.0 | 5,084 | 0.000787 |
#!/usr/bin/python2
# core.py
# aoneill - 04/10/17
import sys
import random
import time
import pauschpharos as PF
import lumiversepython as L
SEQ_LIM = 200
def memoize(ignore = None):
if(ignore is None):
ignore = set()
def inner(func):
cache = dict()
def wrapper(*args):
m... | alexoneill/15-love | game/core.py | Python | mit | 1,573 | 0.031786 |
import os
import sys
import django
from django.conf import settings
def runtests():
settings_file = 'django_ethereum_events.settings.test'
if not settings.configured:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', settings_file)
django.setup()
from django.test.runner import DiscoverRunner
... | artemistomaras/django-ethereum-events | runtests.py | Python | mit | 570 | 0 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Documents Attachment
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | muk-it/muk_dms | muk_dms_attachment/models/ir_attachment.py | Python | lgpl-3.0 | 10,186 | 0.005007 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
from frappe.model.naming import make_autoname
from frappe import throw, _
imp... | ShashaQin/erpnext | erpnext/hr/doctype/employee/employee.py | Python | agpl-3.0 | 8,327 | 0.023778 |
# -*- coding: UTF-8 -*-
__author__ = 'Jeffrey'
| duanhun/apk_for_linux | settings.py | Python | apache-2.0 | 47 | 0 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para cuevana
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import urlparse
from channelselector import get_thum... | ChopChopKodi/pelisalacarta | python/main-classic/channels/descargacineclasico.py | Python | gpl-3.0 | 6,362 | 0.017781 |
import os
from ctypes import CDLL
from ctypes.util import find_library
from django.conf import settings
# Creating the settings dictionary with any settings, if needed.
GEOIP_SETTINGS = dict((key, getattr(settings, key))
for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY... | 912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/gis/geoip/libgeoip.py | Python | gpl-2.0 | 1,094 | 0.001828 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | 3v1n0/snapcraft | snapcraft/tests/test_meta.py | Python | gpl-3.0 | 27,949 | 0 |
# This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Adrian Sampson, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
import sys
import locale
import xml.etree.ElementTree as ET
from . import compat
def _unicode(string... | hzlf/openbroadcast | website/apps/musicbrainzngs/util.py | Python | gpl-3.0 | 1,428 | 0.010504 |
"""
This file is meant to try the idea of having the diffraction pattern data appear in
one window, and then give the user the option of simply having
"""
| cduff4464/2016_summer_XPD | out_of_date/reverse_engineer/display2.py | Python | bsd-2-clause | 155 | 0.006452 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bokeh/bokeh | bokeh/sampledata/degrees.py | Python | bsd-3-clause | 2,054 | 0.008763 |
import os
import sys
from setuptools import setup
version = '1.6.2.dev0'
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wheel upload')
print("You probably want to also tag the version now:")
print(" git tag -a %s -m 'version %s'" % (version, version))
print(" git push --tags")... | jaap3/django-richtextfield | setup.py | Python | mit | 1,486 | 0.000673 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from counter.api import router
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tdc.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^', include(admin.site.urls)),
... | tdf/tdc | tdc/urls.py | Python | gpl-3.0 | 489 | 0.010225 |
# This is a hack to disable GDAL support in GeoDjango. It seems there is no
# easier way due to the GDAL_LIBRARY_PATH setting not behaving as documented
# (i.e. setting it to a non-existent file will disable GDAL). Disabling GDAL is
# unfortunately needed, because it breaks TIFF support for pgmagick, which is
# require... | catsop/CATMAID | django/lib/custom_postgresql_psycopg2/__init__.py | Python | gpl-3.0 | 1,268 | 0.003155 |
# !/usr/bin/env python
#
# Hornet - SSH Honeypot
#
# Copyright (C) 2015 Aniket Panse <aniketpanse@gmail.com>
#
# 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... | czardoz/hornet | hornet/tests/commands/test_ls.py | Python | gpl-3.0 | 45,918 | 0.001503 |
# vim: fileencoding=UTF-8 filetype=python ff=unix expandtab sw=4 sts=4 tw=120
# maintainer: Christer Sjöholm -- goobook AT furuvik DOT net
# authors: Marcus Nitzschke -- marcus.nitzschke AT gmx DOT com
#
# Copyright (C) 2009 Carlos José Barroso
# Copyright (C) 2010 Christer Sjöholm
#
# This program is free software: ... | mh21/goobook | goobook/goobook.py | Python | gpl-3.0 | 15,990 | 0.002252 |
"""Configuration definitions
"""
import numpy
from astropy import units as u
from astropy.coordinates import EarthLocation
from processing_library.util.coordinate_support import xyz_at_latitude
from data_models.memory_data_models import Configuration
from data_models.parameters import arl_path, get_parameter
from pr... | SKA-ScienceDataProcessor/algorithm-reference-library | processing_components/simulation/configurations.py | Python | apache-2.0 | 11,417 | 0.006131 |
from vsg import parser
class with_keyword(parser.keyword):
'''
unique_id = selected_waveform_assignment : with_keyword
'''
def __init__(self, sString):
parser.keyword.__init__(self, sString)
class select_keyword(parser.keyword):
'''
unique_id = selected_waveform_assignment : select... | jeremiah-c-leary/vhdl-style-guide | vsg/token/selected_waveform_assignment.py | Python | gpl-3.0 | 1,188 | 0 |
#
# zurllib.py
#
# This is (hopefully) a drop-in for urllib which will request gzip/deflate
# compression and then decompress the output if a compressed response is
# received while maintaining the API.
#
# by Robert Stone 2/22/2003
# extended by Matt Chisholm
#
from BitTorrent.platform import user_agent
import urllib... | rays/ipodderx-core | BitTorrent/zurllib.py | Python | mit | 4,720 | 0.005297 |
import string
# The lexer knows two classes of symbols:
# - any number of meta-symbols, which match a single meta-character each.
# this argument is a dictionary mapping meta-characters to symbol classes.
#
# - exactly one terminal symbol, which matches a run of any characters
# but ends as soon as a meta-... | cburschka/modod | src/modod/lexer.py | Python | mit | 2,843 | 0.003166 |
import logging
import sys
import tkinter as tk
from src.app import Labeler
LOGGER = logging.getLogger(__name__)
# parser = argparse.ArgumentParser(description='Some arguement for path connector')
# parser.add_argument('-m', '--max', type=int, default=300, help='maximum frame for displaying path')
# parser.add_argume... | kai06046/labeler | main.py | Python | apache-2.0 | 1,067 | 0.02343 |
import unittest
import socket
from time import sleep
import subprocess
TESTMSG = 'Hello World'
MSGLEN = len(TESTMSG)
PORT = 3000
class MySocket:
"""demonstration class only
- coded for clarity, not efficiency
"""
def close(self):
self.sock.close()
def __init__(self, sock=None):
... | koolkt/mendoza | tests/smtp_server/test_echo/test_echo.py | Python | gpl-3.0 | 2,153 | 0.002322 |
import argparse
from phocnet.training.phocnet_trainer import PHOCNetTrainer
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# required training parameters
parser.add_argument('--doc_img_dir', action='store', type=str, required=True,
help='The location of the document ima... | ssudholt/phocnet | tools/train_phocnet.py | Python | bsd-3-clause | 4,914 | 0.014449 |
# Copyright (C) 2001-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... | pbaesse/Sissens | lib/python2.7/site-packages/eventlet/support/dns/rdataset.py | Python | gpl-3.0 | 11,374 | 0.000176 |
from __future__ import print_function
import six
import datetime
from halonctl.modapi import Module
from halonctl.roles import HTTPStatus
class StatusModule(Module):
'''Checks node statuses'''
def run(self, nodes, args):
yield (u"Cluster", u"Name", u"Address", u"Uptime", u"Status")
for node, (code, result) ... | halonsecurity/halonctl | halonctl/modules/status.py | Python | bsd-3-clause | 576 | 0.027778 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# OMERO Grid Processor
# Copyright 2008 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
import os
import time
import signal
import logging
import traceback
import killableprocess as subprocess
from path import pat... | mtbc/openmicroscopy | components/tools/OmeroPy/src/omero/processor.py | Python | gpl-2.0 | 35,039 | 0.004053 |
from .settings import DEFAULT_MEDIA_FILTERS
from django.utils.encoding import smart_str
from hashlib import sha1
from mediagenerator.settings import MEDIA_DEV_MODE
from mediagenerator.utils import load_backend, find_file, read_text_file
import os
import time
class Filter(object):
takes_input = True
def __init... | Crop-R/django-mediagenerator | mediagenerator/generators/bundles/base.py | Python | bsd-3-clause | 8,535 | 0.001875 |
from __future__ import print_function
from contextlib import contextmanager
from distutils.util import convert_path
import os
from shutil import copyfile
import sys
import textwrap
from setuptools import setup, Command
from setuptools.command.develop import develop as develop_cmd
from setuptools.command.build_py impo... | dkillick/iris | setup.py | Python | lgpl-3.0 | 8,908 | 0.000449 |
import numpy as np
from pygmin.potentials.potential import BasePotential
class WhamPotential(BasePotential):
"""
#############################################################################
# the idea behind this minimization procedure is as follows:
##################################################... | js850/PyGMIN | pygmin/wham/wham_potential.py | Python | gpl-3.0 | 4,820 | 0.011618 |
from __future__ import unicode_literals
from django.utils.six.moves.urllib.parse import parse_qs, urlsplit
from reviewboard.hostingsvcs.utils.paginator import (APIPaginator,
InvalidPageError,
ProxyPaginator)
from... | KnowNo/reviewboard | reviewboard/hostingsvcs/utils/tests.py | Python | mit | 7,168 | 0 |
"""
Tests for Game scripts.
"""
import sys
from twisted.trial.unittest import TestCase
from twisted.python.failure import Failure
from twisted.internet.defer import Deferred
from twisted.python import log
from twisted.internet import reactor
from game.ui import UI
from game.scripts.network_client import NetworkClien... | eriknelson/gam3 | game/test/test_script.py | Python | mit | 4,405 | 0.002724 |
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy2Can(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_CAN=y
"""
sample_scripts = ["tests/package/sample_python_can.py"]... | masahir0y/buildroot-yamada | support/testing/tests/package/test_python_can.py | Python | gpl-2.0 | 617 | 0 |
# -*- coding: utf-8 -*-
import htmls
from django import test
from cradmin_legacy import datetimeutils
from model_bakery import baker
from devilry.devilry_cradmin import devilry_listbuilder
class TestItemValue(test.TestCase):
def test_title(self):
testassignment = baker.make('core.Assignment', long_name... | devilry/devilry-django | devilry/devilry_cradmin/tests/test_devilry_listbuilder/test_assignment.py | Python | bsd-3-clause | 1,305 | 0.005364 |
import os
import sys
from recommonmark.parser import CommonMarkParser
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'askomics'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
master_doc = 'index'
# The suffix of source filenames.
source_suffix = ['.rst', '.md']
source_parsers = {
... | askomics/askomics | docs/conf.py | Python | agpl-3.0 | 778 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('sistema', '0015_aporte'),
]
operations = [
migrations.RenameField(
... | gabrielf10/webAmpunc | sistema/migrations/0016_auto_20161024_1447.py | Python | bsd-3-clause | 1,903 | 0.001051 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, 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
#
# Unl... | OpenUniversity/ovirt-engine | packaging/setup/plugins/ovirt-engine-common/base/core/misc.py | Python | apache-2.0 | 4,950 | 0 |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Client for the Flocker REST API.
This may eventually be a standalone package.
"""
from ._client import (
IFlockerAPIV1Client, FakeFlockerClient, Dataset, DatasetState,
DatasetAlreadyExists,
)
__all__ = ["IFlockerAPIV1Client", "FakeFlockerClient",... | adamtheturtle/flocker | flocker/apiclient/__init__.py | Python | apache-2.0 | 383 | 0 |
# structureModifyPowerRechargeRate
#
# Used by:
# Structure Modules from group: Structure Capacitor Power Relay (2 of 2)
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("rechargeRate", module.getModifiedItemAttr("capacitorRechargeRateMultiplier"))
| bsmr-eve/Pyfa | eos/effects/structuremodifypowerrechargerate.py | Python | gpl-3.0 | 284 | 0.003521 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | kobejean/tensorflow | tensorflow/python/ops/ctc_ops.py | Python | apache-2.0 | 11,926 | 0.00218 |
"""tests/test_output_format.py.
Tests the output format handlers included with Hug
Copyright (C) 2015 Timothy Edmund Crosley
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, ... | janusnic/hug | tests/test_output_format.py | Python | mit | 2,987 | 0.004687 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from .compat import user_input
def correct(call_a, call_b):
"""
Informs the user that the order is correct.
:param call_a: first call number - not used at this time but could be
important in later versions.
:param call... | asmacdo/shelf-reader | shelf_reader/ui.py | Python | gpl-2.0 | 1,924 | 0.00052 |
from salesking.tests.base import SalesKingBaseTestCase
class MockCollectionContactResponse(object):
def __init__(self):
self.status_code = 200
self.content = u'''
{"contacts":
[{"contact":{"id":"a55-akQyir5ld2abxfpGMl","parent_id":null,"type":"Client","is_employee":false,"number":"K-2015-1286","... | salesking/salesking_python_sdk | salesking/tests/test_contacts_collection_mock.py | Python | apache-2.0 | 24,848 | 0.000926 |
"""Manipulate release notes from Github commits to make them more compact.
Gets its input from stdin, assumed in the following format:
1 line per commit, starting with "[Some subject]" and ending with "(#123456)"
Lines with the same subject will be grouped together, sorted by increasing PR number.
Commits not starti... | bayesimpact/bob-emploi | frontend/release/compress_notes.py | Python | gpl-3.0 | 1,668 | 0.002398 |
import re
import threading
from datetime import datetime, timedelta
from typing import Any, List, Mapping, Optional, Tuple, Union
from reactivex import Notification, Observable, abc, notification, typing
from reactivex.disposable import CompositeDisposable, Disposable
from reactivex.scheduler import NewThreadScheduler... | ReactiveX/RxPY | reactivex/observable/marbles.py | Python | mit | 9,232 | 0.000542 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Configuration options for Invenio-Search.
The documentation for the configuration... | inveniosoftware/invenio-search | invenio_search/config.py | Python | mit | 3,755 | 0 |
from __future__ import print_function, division
#
import sys,os
quspin_path = os.path.join(os.getcwd(),"../../")
sys.path.insert(0,quspin_path)
#
from quspin.operators import hamiltonian # Hamiltonians and operators
from quspin.basis import boson_basis_1d # Hilbert space spin basis
from quspin.tools.evolution import ev... | weinbe58/QuSpin | sphinx/doc_examples/evolve-example.py | Python | bsd-3-clause | 3,153 | 0.047257 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/mtx1_models/SHH_WT_models8077.py | Python | gpl-3.0 | 17,576 | 0.025091 |
#!/usr/bin/env python
import system as sys
import traces as tra
import info as nf
import pylab as pl
pos_info = '+0+600'
pos_tra = '+300+600'
pos_sys = '+0+0'
i = nf.info(position=pos_info)
s = sys.system(info=i, position=pos_sys)
t = tra.traces(s, info=i, position=pos_tra)
if pl.get_backend() == 'TkAgg':
s.fig.... | jusjusjus/Motiftoolbox | Fitzhugh_n-cell/run.py | Python | gpl-2.0 | 368 | 0.005435 |
"""
WSGI config for p27_d17 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`` ... | fogcitymarathoner/gae_p27_dj17 | p27_d17_prj/wsgi.py | Python | mit | 1,789 | 0.000559 |
import os
import re
from typing import Iterable
from .env import use_bintray, skip_build_py, skip_build_py2, skip_build_py_module, skip_build_py2_module, py_packages, py_packages2
from .package import enumerate_packages, import_package
built_packags: set = set()
need_rebuild: set = set()
def parse_packages(pkg_spec... | qpython-android/QPython3-core | pybuild/main.py | Python | apache-2.0 | 2,041 | 0.00196 |
from toast.scene_graph import Component
class Animation(Component):
def __init__(self, key=None, frames=None):
super(Animation, self).__init__()
self.__animation_list = {}
self.key = ''
self.__current_image = None
self.__index = 0
self.__time = 0
... | JoshuaSkelly/Toast | toast/animation.py | Python | mit | 2,328 | 0.010309 |
import ipaddress
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding, rsa
from .connection import NetworkAddress
def encode_address(addr: NetworkAddress) -> bytes:
return ipaddress.ip_address(add... | asajeffrey/servo | tests/wpt/web-platform-tests/tools/third_party/aioquic/src/aioquic/quic/retry.py | Python | mpl-2.0 | 1,449 | 0.003451 |
import StringIO
import numpy as np
from numpy.lib._iotools import LineSplitter, NameValidator, StringConverter,\
has_nested_fields
from numpy.testing import *
class TestLineSplitter(TestCase):
"Tests the LineSplitter class."
#
def test_no_delimiter(self):
"Test Line... | illume/numpy3k | numpy/lib/tests/test__iotools.py | Python | bsd-3-clause | 6,114 | 0.004416 |
import select, logging, threading, sys, ssl, errno, socket, platform, time
from threadly import Scheduler, Clock
from .stats import Stats
from .stats import noExcept
from .client import Client
from .server import Server
from .tcp import TCPClient, TCPServer
from .udp import UDPServer
try:
xrange(1)
except:
xra... | lwahlmeier/python-litesockets | litesockets/socketexecuter.py | Python | unlicense | 21,816 | 0.018702 |
import unittest
from mock import Mock
from biicode.common.model.content import Content
from biicode.common.model.content import ContentDeserializer
from biicode.common.model.content import content_diff
from biicode.common.exception import BiiSerializationException
from biicode.common.model.id import ID
class ContentT... | zhangf911/common | test/model/content_test.py | Python | mit | 1,322 | 0 |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
import os
import unittest
import sys
import itertools
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology import schema
import streamsx.topology.context
import streamsx.spl.op as op
... | ddebrunner/streamsx.topology | test/python/spl/tests/test_splpy_primitives.py | Python | apache-2.0 | 8,994 | 0.008117 |
from json_serializable import JSONSerializable
from irc_connection import IRCConnection
from models import Conversation, Message
from observable import ObservableList, SimpleObservable
class Session(SimpleObservable, JSONSerializable):
_json_attrs = ["conversations", "users"]
def __init__(self):
self.... | uniite/pyirc | models/session.py | Python | mit | 3,127 | 0.003518 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PowerDNS Recursor documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 28 14:56:44 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | Habbie/pdns | docs/conf.py | Python | gpl-2.0 | 8,446 | 0.001658 |
import time
from roboclaw import Roboclaw
#Windows comport name
rc = Roboclaw("COM11",115200)
#Linux comport name
#rc = Roboclaw("/dev/ttyACM0",115200)
rc.Open()
address = 0x80
while(1):
rc.ForwardM1(address,32) #1/4 power forward
rc.BackwardM2(address,32) #1/4 power backward
time.sleep(2)
rc.B... | hopkira/k9-chess-angular | python/roboclaw_simplepwm.py | Python | unlicense | 963 | 0.070613 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='morphounit',
version='1.0.4',
author='Shailesh Appukuttan, Pedro Garcia-Rodriguez',
author_email='shailesh.appukuttan@cnrs.fr, pedro.garcia@cnrs.fr',
packages=['morphounit',
'mo... | pedroernesto/morphounit | setup.py | Python | bsd-3-clause | 1,115 | 0.008072 |
# ENVISIoN
#
# Copyright (c) 2019-2021 Jesper Ericsson, Gabriel Anderberg, Didrik Axén,
# Adam Engman, Kristoffer Gubberud Maras, Joakim Stenborg
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | rartino/ENVISIoN | envisionpy/processor_network/LinePlotNetworkHandler.py | Python | bsd-2-clause | 11,390 | 0.003337 |
import re
from xcsoar.mapgen.waypoints.waypoint import Waypoint
from xcsoar.mapgen.waypoints.list import WaypointList
def __parse_line(line, bounds = None):
if line.startswith('$'): return None
lat = line[45:52]
lat_neg = lat.startswith('S')
lat = float(lat[1:3]) + float(lat[3:5]) / 60. + float... | TobiasLohner/mapgen | lib/xcsoar/mapgen/waypoints/welt2000_reader.py | Python | gpl-2.0 | 4,373 | 0.028813 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | nuagenetworks/vspk-python | vspk/v6/nuunderlay.py | Python | bsd-3-clause | 11,766 | 0.009009 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.