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 |
|---|---|---|---|---|---|---|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import pymeanshift as pms
from blobs.BlobResult import CBlobResult
from blobs.Blob import CBlob # Note: This must be imported in order to destroy blobs and use other methods
################################################################... | xmnlab/minilab | ia/ocr/alpr.py | Python | gpl-3.0 | 10,141 | 0.008776 |
#!/usr/bin/env python
from __future__ import print_function
from builtins import input
import sys
import pmagpy.pmag as pmag
def main():
"""
NAME
gofish.py
DESCRIPTION
calculates fisher parameters from dec inc data
INPUT FORMAT
takes dec/inc as first two columns in space delimite... | Caoimhinmg/PmagPy | programs/gofish.py | Python | bsd-3-clause | 1,976 | 0.0167 |
""" This file mainly exists to allow python setup.py test to work. """
import os
import sys
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'testdb',
}
},
INSTALLED_APPS=(
... | cschwede/django-userattributes | userattributes/runtests.py | Python | mit | 846 | 0.002364 |
# -*- coding: utf-8 -*-
"""
project............: meat-a
description........: web application for sharing meta information
date...............: 04/2013
copyright..........: Sebastian Fedrau
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation f... | 20centaurifux/meat-a | controller.py | Python | agpl-3.0 | 29,635 | 0.02902 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | oposs/check_mk_mirror | web/htdocs/guitester.py | Python | gpl-2.0 | 10,454 | 0.005452 |
from strings_anagrams import are_anagrams
def test_funny_anagrams():
assert are_anagrams("the eyes", "they see")
assert are_anagrams("Allahu Akbar, Obama", "Aha bub, koala alarm")
assert are_anagrams("Donald Trump", "Damp Old Runt")
def test_same_is_anagram():
assert are_anagrams("foo", "Foo")
ass... | elli0ttB/problems | sorting/test_are_anagrams.py | Python | mit | 556 | 0.008993 |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QGraphicsLayoutItem import QGraphicsLayoutItem
class QGraphicsLayout(QGraphicsLayoutItem):
""" QGraphicsLay... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QGraphicsLayout.py | Python | gpl-2.0 | 2,337 | 0.009414 |
# -*- coding: utf-8 -*-
"""Tests for aiohttp/client.py"""
import asyncio
import gc
import unittest
from unittest import mock
import aiohttp
from aiohttp.client import ClientSession
from aiohttp.multidict import MultiDict, CIMultiDict
from aiohttp.connector import BaseConnector, TCPConnector
class TestClientSession(... | flying-sheep/aiohttp | tests/test_client_session.py | Python | apache-2.0 | 13,926 | 0 |
import unittest
from BTrees.OOBTree import OOBTree
from arche.interfaces import IObjectUpdatedEvent
from arche.interfaces import IWillLoginEvent
from arche.interfaces import IUser
from arche.testing import barebone_fixture
from pyramid import testing
from zope.interface.verify import verifyObject
from zope.interface.v... | ArcheProject/arche_pas | arche_pas/tests/test_models.py | Python | gpl-2.0 | 17,498 | 0.000343 |
import os
import pickle
import socket
import sys
import threading
import struct
import time
import yaml
# from gen_scraper import scraper
def handle_slave(slaveconn_info, config_info, work_info):
# print(v_chunk)
"""
handles a slave connection, sending config, work, or receiving more results.
param... | puddl3glum/gen_scraper | build/lib/gen_scraper/gen_master.py | Python | mit | 5,572 | 0.006999 |
# -*- coding: utf-8 -*-
"""
.. module:: utils
"""
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.utils.text import slugify
from apps.volontulo.models import UserProfile
# Offers statuses dictionary with meaningful names.
... | magul/volontulo | backend/apps/volontulo/utils.py | Python | mit | 1,857 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.template import Library
from ..models import Counter
register = Library()
@register.assignment_tag
def counter_for_object(name, obj, default=0):
"""Returns the counter value for the given name and instance."""
try:
return Counter.objects.get... | natural/django-objectcounters | objectcounters/templatetags/counter_tags.py | Python | bsd-3-clause | 398 | 0 |
from collections import defaultdict
import paddle.v2.framework.framework as framework
from paddle.v2.framework.backward import append_backward_ops
from paddle.v2.framework.regularizer import append_regularization_ops
__all__ = [
'SGDOptimizer', 'MomentumOptimizer', 'AdagradOptimizer', 'AdamOptimizer',
'Adamax... | pengli09/Paddle | python/paddle/v2/framework/optimizer.py | Python | apache-2.0 | 21,289 | 0.000141 |
import logging
from pyvirtualdisplay.display import Display
from pyvirtualdisplay.about import __version__
log = logging.getLogger(__name__)
log = logging.getLogger(__name__)
log.debug('version=%s', __version__)
| suninsky/ReceiptOCR | Python/server/lib/python2.7/site-packages/pyvirtualdisplay/__init__.py | Python | mit | 216 | 0 |
from __future__ import with_statement, absolute_import
from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.views.main import ChangeList, SEARCH_VAR, ALL_VAR
from django.contrib.auth.models import User
from django.template import Context, Templat... | lisael/pg-django | tests/regressiontests/admin_changelist/tests.py | Python | bsd-3-clause | 24,196 | 0.003017 |
# -*- coding:utf-8 -*-
import os
import sys
import sublime
import sublime_plugin
from .archiver import Archiver
from .settings import API_UPLOAD_URL
from .command import CommandWithStatus
sys.path.append(os.path.dirname(__file__))
import requests
class SublimeSyncUploadCommand(sublime_plugin.ApplicationCommand, Comm... | florianpaquet/sublime-sync | upload.py | Python | mit | 3,373 | 0.001779 |
from flask_dance.consumer.storage import BaseStorage
import flask
class SessionStorage(BaseStorage):
"""
The default storage backend. Stores and retrieves OAuth tokens using
the :ref:`Flask session <flask:sessions>`.
"""
def __init__(self, key="{bp.name}_oauth_token"):
"""
Args:
... | singingwolfboy/flask-dance | flask_dance/consumer/storage/session.py | Python | mit | 1,085 | 0.001843 |
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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... | NeCTAR-RC/designate | designate/utils.py | Python | apache-2.0 | 8,767 | 0.000114 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
#sys.path.append ('.')
#sys.path.append ('.libs')
import Hamlib
def StartUp():
"""Simple script to test the Hamlib.py module with... | airween/hamlib | bindings/pytest.py | Python | gpl-2.0 | 4,198 | 0.00143 |
# 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 ... | mtagle/airflow | airflow/configuration.py | Python | apache-2.0 | 29,594 | 0.002298 |
import numpy as np
import binvox_rw
import numba
import mcubes
@numba.jit(forceobj=True)
def get_voxel_resolution(pc, patch_size):
"""
This function takes in a pointcloud and returns the resolution
of a voxel given that there will be a fixed number of voxels.
For example if patch_size is 40, then we... | CRLab/curvox | src/curvox/pc_vox_utils.py | Python | mit | 14,287 | 0.00378 |
# -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
class CookiesTest(object):
def test_create_and_access_a_cookie(self):
"should be able to create and access a cookie"
... | nikolas/splinter | tests/cookies.py | Python | bsd-3-clause | 3,162 | 0 |
"""
Search and get metadata for articles in Pubmed.
"""
import logging
import requests
from time import sleep
from typing import List
from functools import lru_cache
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
logger = logging.getLogger(__name__)
pubmed_search = 'https://eu... | sorgerlab/belpy | indra/literature/pubmed_client.py | Python | mit | 22,934 | 0.000392 |
__author__ = 'Victoria'
#Decorator Pattern in Characters
class BarDecorators(Barbarian):
pass
class ImageBarDecorator(BarDecorators):
def __init__(self, decorated, picFile):
self.decorated = decorated
self.picFile = picFile
super(ImageBarDecorator, self).__init__(self.decorated.canvas,
... | victorianorton/SimpleRPGGame | src/game/Decorators.py | Python | mit | 1,582 | 0.007585 |
def somefunc():
pass
| level12/blazeweb | tests/apps/nlsupporting/components/news/__init__.py | Python | bsd-3-clause | 26 | 0 |
import os
import sys
import subprocess
""" Use gpg to decrypt password.
"""
def mailpasswd(path):
cmd = "gpg --quiet --batch --use-agent --decrypt --output - " + os.path.expanduser(path)
try:
return subprocess.check_output(cmd, shell=True).strip()
except subprocess.CalledProcessError:
retur... | ajaybhatia/archlinux-dotfiles | home/.config/offlineimap/offlineimap-helpers.py | Python | mit | 2,790 | 0.010394 |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 7 18:08:41 2011
@author: steven
"""
# word = 'banana'
# count = 0
# for letter in word:
# if letter == 'a':
# count = count + 1
# print count
# Rewrite this function so that instead of traversing the string, it uses the
# three-parameter version of find from ... | epequeno/ThinkPy-Solutions | ch08/8.06.py | Python | gpl-3.0 | 828 | 0.002415 |
# Docker-specific local settings
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db',
}
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = ''
TEMPLATE_DIRS = (
'/srv/webldap/templates',
)
EMAIL_F... | FedeRez/webldap | app/webldap/local_settings.docker.py | Python | mit | 764 | 0 |
class DataLabels(object):
def __init__(self, enabled=True):
self.enabled = enabled
def show_labels(self, enable):
if not type(enable) is bool:
raise TypeError('enable should be a boolean (True or False).')
self.enabled = enable
def to_javascript(self):
jsc = ... | jpmfribeiro/PyCharts | pycharts/fields/plot_options/data_labels.py | Python | mit | 493 | 0.004057 |
# Copyright 2011 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... | tanglei528/glance | glance/tests/functional/v1/test_api.py | Python | apache-2.0 | 24,300 | 0 |
# Copyright 2017 ForgeFlow S.L.
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import _, fields
from odoo.exceptions import UserError, ValidationError
from odoo.fields import Date
from odoo.tests.common import Form, SavepointCase
class Tes... | OCA/bank-payment | account_payment_partner/tests/test_account_payment_partner.py | Python | agpl-3.0 | 21,944 | 0.001276 |
from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import xml.etree.ElementTree
from ..compat import (
compat_cookiejar,
compat_http_client,
compat_urllib_error,
compat_urllib_parse_urlp... | fluks/youtube-dl | youtube_dl/extractor/common.py | Python | unlicense | 38,144 | 0.001022 |
# Originally contributed by Stefan Schukat as part of this arbitrary-sized
# arrays patch.
from win32com.client import gencache
from win32com.test import util
import unittest
ZeroD = 0
OneDEmpty = []
OneD = [1,2,3]
TwoD = [
[1,2,3],
[1,2,3],
[1,2,3]
]
TwoD1 = [
[
... | sserrot/champion_relationships | venv/Lib/site-packages/win32com/test/testArrays.py | Python | mit | 2,505 | 0.050699 |
# -*- coding: utf-8 -*-
import json
from mock import patch
from collections import defaultdict
from requests import Session
from connect.api import ConnectApi
from connect.event import Event
from connect import responses
PROJECT_ID = "MY_PROJECT_ID"
API_PUSH_KEY = "MY_PUSH_API_KEY"
BASE_URL = "https://api.getconnect.... | getconnect/connect-python | tests/test_api.py | Python | mit | 9,933 | 0.010772 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ncbi.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| erickpeirson/django-ncbi | ncbi/manage.py | Python | gpl-3.0 | 247 | 0 |
#!/usr/bin/env python3
"""
s2_pi.py
Copyright (c) 2016-2018 Alan Yorinks All right reserved.
Python Banyan is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any la... | MrYsLab/s2-pi | s2_pi/s2_pi.py | Python | agpl-3.0 | 5,512 | 0.000727 |
#!/usr/bin/env python
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import cm
import numpy as np# reshape
from cstoolkit import drange
from matplotlib.colors import LinearSegmentedColormap
"""
cmap_cs_precp = [ (242, 242, 242), (191, 239, 255), (178, 223, 238),
(154, 192, 205), ( 0, 235, 235)... | sunchaoatmo/cplot | plotset.py | Python | gpl-3.0 | 28,891 | 0.077291 |
import numpy as np
import scipy
import math
import argparse
import lightcurve
import powerspectrum
#### MULTIPLY LIGHT CURVES TOGETHER ##################
#
# Little functions that multiplies light curves of different
# processes together.
# Base_lc can be any LightCurve object, even one of the three options given... | dhuppenkothen/UTools | simpower.py | Python | bsd-2-clause | 7,317 | 0.02132 |
import ipaddress
import docker.types
def init():
pass
def get_next_cidr(client):
networks = client.networks.list()
last_cidr = ipaddress.ip_network("10.0.0.0/24")
for network in networks:
if (network.attrs["IPAM"] and network.attrs["IPAM"]["Config"]
and len(network.attrs["IPA... | puffinrocks/puffin | puffin/core/network.py | Python | agpl-3.0 | 1,606 | 0.003113 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Execute to run double Cole-Cole term characterization
"""
import sys
sys.path.append('..')
import test_helper as th
import os
import itertools
import numpy as np
import subprocess
testdir = 'data'
def _generate_cc_sets():
"""Generate multiple complex resistivity spec... | m-weigand/Cole-Cole-fit | tests/2-term/test_cases.py | Python | gpl-3.0 | 1,602 | 0.003121 |
from backend import photos, boards
p = photos()
#print p.new('asdf',1,1)
print p.get(1)
b = boards()
print p.all(1)
print b.get(1)
| teriyakichild/photoboard | photoboard/tests/test.py | Python | apache-2.0 | 133 | 0.007519 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | jtrobec/pants | contrib/scrooge/tests/python/pants_test/contrib/scrooge/tasks/test_scrooge_gen.py | Python | apache-2.0 | 4,867 | 0.005137 |
from looker_sdk import methods, models40
import looker_sdk
import exceptions
sdk = looker_sdk.init40("../looker.ini")
def create_simple_schedule(dashboard_id:int,user_id:int,schedule_title:str, format:str, email:str,type:str, message:str, crontab:str):
### For more information on the Params accepted https://githu... | looker-open-source/sdk-codegen | examples/python/simple_schedule_plan.py | Python | mit | 1,296 | 0.022377 |
# Copyright (C) 2013 eNovance SAS <licensing@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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | openstack/tempest | tempest/api/object_storage/test_container_acl_negative.py | Python | apache-2.0 | 10,958 | 0 |
# -*- coding: utf-8 -*-
import functools
import urlparse
import logging
import re
import pytz
from dirtyfields import DirtyFieldsMixin
from include import IncludeManager
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.contrib.contenttypes.fields import GenericR... | pattisdr/osf.io | osf/models/preprint.py | Python | apache-2.0 | 40,401 | 0.002401 |
# coding=utf-8
__author__ = 'mic'
from django import forms
from django.utils.translation import ugettext, ugettext_lazy as _
from django.contrib.auth.forms import UserCreationForm
from public.models import User
class UserSignupForm(forms.ModelForm):
"""
A form that creates a user, with no privileges, from th... | micfan/dinner | src/public/forms.py | Python | mit | 2,640 | 0.001515 |
"""
Main organisation:
- L{amcat.scripts.tools} contains helper classes that are used by the scripts
- L{amcat.scripts.searchscripts} contains scripts that search the index or the database
- L{amcat.scripts.processors} contains scripts that process the input of a script
- L{amcat.scripts.output} contains scripts t... | amcat/amcat | amcat/scripts/__init__.py | Python | agpl-3.0 | 482 | 0.008299 |
# coding: utf-8
import base64
import pytest
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from tests_silverlight import SilverlightTestCase
By.XNAME = 'xname'
class TestGetCommands(SilverlightTestCase):
"""
Test GET commands that do not change an... | 2gis/Winium.StoreApps | Winium/TestApp.Test/py-functional/tests_silverlight/test_commands.py | Python | mpl-2.0 | 8,916 | 0.002916 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
import hooks
import manager.hooks
import technician.hooks
urlpatterns = patterns('',
# general hooks
(r'^$', hooks.index),
(r'^api/$', hooks.api_index),
(r'^api/export/$', hooks.export_csv),
... | SEC-i/ecoControl | server/urls.py | Python | mit | 2,212 | 0.005425 |
# -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# 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... | aboyett/blockdiag | src/blockdiag/plugins/__init__.py | Python | apache-2.0 | 1,527 | 0 |
# -*- coding: utf-8 -*-
import unittest
from wechatpy.replies import TextReply, create_reply
class CreateReplyTestCase(unittest.TestCase):
def test_create_reply_with_text_not_render(self):
text = "test"
reply = create_reply(text, render=False)
self.assertEqual("text", reply.type)
... | jxtech/wechatpy | tests/test_create_reply.py | Python | mit | 4,741 | 0 |
from rest_framework import generics
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.reverse import reverse
from .models import Feedback
from .serializers import *
class FeedbackListView(generics.ListCreateAPIView):
# permission_classes = IsAuthenticatedOrR... | mmilaprat/policycompass-services | apps/feedbackmanager/views.py | Python | agpl-3.0 | 891 | 0.001122 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import hypothesis
from hypothesis import given, settings, HealthCheck
import hypothesis.strategies as st
import numpy as np
from caffe2.python import c... | ryfeus/lambda-packs | pytorch/source/caffe2/python/operator_test/adadelta_test.py | Python | mit | 7,954 | 0.002137 |
# Create your views here.
from django.shortcuts import render, get_object_or_404
from django.views import generic
from modelcontrol.models import Plant
from xmlrpclib import ServerProxy, Error
class IndexView(generic.ListView):
template_name = 'modelcontrol/index.html'
context_object_name = 'plant_list'
... | BrummbQ/plantcontrol | plant/modelcontrol/views.py | Python | gpl-3.0 | 1,079 | 0.000927 |
def update_time(sender, **kwargs):
"""
When a Comment is added, updates the Update to set "last_updated" time
"""
comment = kwargs['instance']
if comment.content_type.app_label == "happenings" and comment.content_type.name == "Update":
from .models import Update
item = Update.object... | tBaxter/tango-happenings | happenings/signals.py | Python | mit | 368 | 0.002717 |
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=25, default='Rico')
last_name = models.CharField(max_length=25, blank=True)
hair_color = models.CharField(max_length=10, blank=True)
eye_color = models.CharField(max_length=10)
age = models.IntegerFie... | ricomoss/learn-tech | python/track_2/lesson2/apples_to_apples/common/models.py | Python | gpl-3.0 | 490 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
import os
# import json as JSON
from network import Client
from PyQt4.QtCore import SIGNAL, QObject, QString
from PyQt4 import Qt, QtCore, QtGui
import threading
import socket
import Queue
import time
sys.path.append('../')
# from util.util import... | dyf102/Gomoku-online | client/controller/basecontroller.py | Python | apache-2.0 | 2,390 | 0.000418 |
# Included modules
import os
import time
import json
import itertools
# Third party modules
import gevent
from Debug import Debug
from Config import config
from util import RateLimit
from util import StreamingMsgpack
from util import helper
from Plugin import PluginManager
FILE_BUFF = 1024 * 512
# Incoming request... | frerepoulet/ZeroNet | src/File/FileRequest.py | Python | gpl-2.0 | 19,416 | 0.003348 |
# Copyright 2020 initOS GmbH
# Copyright 2012-2018 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "LDAP groups assignment",
"version": "11.0.1.0.0",
"depends": ["auth_ldap"],
"author": "initOS GmbH, Therp BV, Odoo Community Association (OCA)",... | brain-tec/server-tools | users_ldap_groups/__manifest__.py | Python | agpl-3.0 | 704 | 0 |
"""
Support for plotting vector fields.
Presently this contains Quiver and Barb. Quiver plots an arrow in the
direction of the vector, with the size of the arrow related to the
magnitude of the vector.
Barbs are like quiver in that they point along a vector, but
the magnitude of the vector is given schematically by t... | jonyroda97/redbot-amigosprovaveis | lib/matplotlib/quiver.py | Python | gpl-3.0 | 46,115 | 0.00039 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | qma/pants | src/python/pants/backend/jvm/tasks/jvm_compile/jvm_classpath_publisher.py | Python | apache-2.0 | 2,151 | 0.010693 |
#!/usr/bin/env python3
# Optimizer calibration test for bitmap and brin indexes, also btree on AO tables
#
# This program runs a set of queries, varying several parameters:
#
# - Selectivity of predicates
# - Plan type (plan chosen by the optimizer, various forced plans)
# - Width of the selected columns
#
# The progr... | 50wu/gpdb | src/backend/gporca/scripts/cal_bitmap_test.py | Python | apache-2.0 | 70,529 | 0.003474 |
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys
import os
import re
import traceback
import platform
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from electrum import util
from electrum.i18n import _
if platform.sys... | cryptapus/electrum | electrum/gui/qt/console.py | Python | mit | 11,672 | 0.002656 |
import pytest
import os
import sys
from polyglotdb.io import inspect_ilg
from polyglotdb.io.helper import guess_type
from polyglotdb.exceptions import DelimiterError, ILGWordMismatchError
from polyglotdb import CorpusContext
def test_inspect_ilg(ilg_test_dir):
basic_path = os.path.join(ilg_test_dir, 'basic.tx... | PhonologicalCorpusTools/PolyglotDB | tests/test_io_ilg.py | Python | mit | 1,972 | 0.000507 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility functions that can be used in multiple scripts.""" | MartinThoma/pysec | pysec/utils.py | Python | mit | 108 | 0.009259 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/guild_deed/shared_tatooine_guild_style_02_deed.iff"
result.att... | anhstudios/swganh | data/scripts/templates/object/tangible/deed/guild_deed/shared_tatooine_guild_style_02_deed.py | Python | mit | 473 | 0.046512 |
# vim: set fileencoding=utf-8
# Pavel Odvody <podvody@redhat.com>
#
# HICA - Host integrated container applications
#
# MIT License (C) 2015
import os, sys
from json import loads
from base.hica_base import *
library_path='/usr/lib64'
class LibraryInjector(HicaInjector):
def _get_libs(self):
return sorted(loads... | shaded-enmity/docker-hica | injectors/libs.py | Python | mit | 1,615 | 0.011765 |
""" The SystemAdministratorClient is a class representing the client of the DIRAC
SystemAdministrator service. It has also methods to update the Configuration
Service with the DIRAC components options
"""
__RCSID__ = "$Id$"
from DIRAC.Core.Base.Client import Client, createClient
SYSADMIN_PORT = 9162
@creat... | fstagni/DIRAC | FrameworkSystem/Client/SystemAdministratorClient.py | Python | gpl-3.0 | 683 | 0.005857 |
# Copyright 2016 OpenMarket Ltd
# Copyright 2017 Vector Creations Ltd
# Copyright 2018-2019 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 t... | matrix-org/synapse | synapse/rest/client/versions.py | Python | apache-2.0 | 4,936 | 0.003241 |
#!/usr/bin/python
# #
# Copyright 2012-2019 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Res... | gppezzi/easybuild-framework | test/framework/suite.py | Python | gpl-2.0 | 4,872 | 0.001437 |
#!/usr/bin/env python3
import os
from setuptools import setup
import nvpy
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
... | yuuki0xff/nvpy | setup.py | Python | bsd-3-clause | 1,989 | 0.001508 |
#
# ovirt-hosted-engine-ha -- ovirt hosted engine high availability
# Copyright (C) 2013 Red Hat, Inc.
#
# This library 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 2.1 of the Licens... | oVirt/ovirt-hosted-engine-ha | ovirt_hosted_engine_ha/broker/submonitors/mem_free.py | Python | lgpl-2.1 | 1,774 | 0 |
# -*- 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_metadata_service_query_context_lineage_subgraph_async.py | Python | apache-2.0 | 1,624 | 0.001847 |
# -*- coding: utf-8 -*-
# template 18
"""
Various tools at your fingertips.
The available tools are:
* cvt_csv_2_rst.py: convert csv file into rst file
* cvt_csv_2_xml.py: convert csv file into xml file
* cvt_script: parse bash script and convert to meet company standard
* gen_readme.py: generate documentation files,... | zeroincombenze/tools | wok_code/scripts/main.py | Python | agpl-3.0 | 6,236 | 0.00016 |
# GUI frame for the sineTransformations_function.py
import os
from Tkinter import *
import tkFileDialog
import tkMessageBox
import numpy as np
from smst.utils import audio
from . import sineTransformations_function as sT
from smst.utils.files import strip_file
class SineTransformationsFrame:
def __init__(self,... | bzamecnik/sms-tools | smst/ui/transformations/sineTransformations_GUI_frame.py | Python | agpl-3.0 | 9,380 | 0.004158 |
N = int(input())
ans = [0] * N
for i in range(0, N, 5):
q = [0] * N
for j in range(i, min(N, i + 5)):
q[j] = 10 ** (j - i)
print('? {}'.format(' '.join(map(str, q))), flush=True)
S = str(int(input().strip()) - sum(q) * 7)[::-1]
for j in range(i, min(N, i + 5)):
ans[j] = (int(S[j - i]... | knuu/competitive-programming | atcoder/corp/codethanksfes2017_e.py | Python | mit | 389 | 0 |
# A Magento 2 module generator library
# Copyright (C) 2016 Maikel Martens
#
# This file is part of Mage2Gen.
#
# Mage2Gen 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
# ... | krukas/Mage2Gen | mage2gen/utils.py | Python | gpl-3.0 | 1,144 | 0.012238 |
# (c) Copyright 2014 Cisco Systems Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | openstack/cinder | cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py | Python | apache-2.0 | 20,088 | 0 |
# Generated by Django 2.0 on 2017-12-06 09:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profile', '0001_squashed_0005_auto_20170408_1400'),
]
operations = [
migrations.AlterField(
model_name='Profile',
name... | AlexandreDecan/Lexpage | app/profile/migrations/0002_auto_20171206_0943.py | Python | gpl-3.0 | 651 | 0.001541 |
# Copyright 2012 OpenStack Foundation
#
# 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... | UTSA-ICS/keystone-kerberos | keystone/exception.py | Python | apache-2.0 | 15,384 | 0 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | crmccreary/openerp_server | openerp/addons/event/wizard/event_confirm_registration.py | Python | agpl-3.0 | 2,865 | 0.002792 |
from setuptools import setup, find_packages
import os
import codecs
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
return codecs.open(os.path.join(here, *parts), 'r').read()
install_requires = [
"click==6.6",
"jinja2==2.8"... | nir0s/logrotated | setup.py | Python | apache-2.0 | 879 | 0 |
from snovault import upgrade_step
@upgrade_step('publication', '', '2')
def publication(value, system):
# http://redmine.encodedcc.org/issues/2591
value['identifiers'] = []
if 'references' in value:
for reference in value['references']:
value['identifiers'].append(reference)
d... | T2DREAM/t2dream-portal | src/encoded/upgrade/publication.py | Python | mit | 1,991 | 0 |
from django.shortcuts import render
from datetime import date, datetime, timedelta
from .models import Event, SponsoredContent
from pytz import timezone
def index(request):
now = datetime.now(timezone('Australia/Sydney')).date()
if now.isoweekday() in [5, 6, 7]:
weekend_s... | coreymcdermott/artbot | artbot_website/views.py | Python | mit | 793 | 0.022699 |
#!/usr/bin/env python
"""
Python Tetris is a clunky pygame Tetris clone. Feel free to make it better!!
Copyright (C) 2008 Nick Crafford <nickcrafford@earthlink.net>
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
... | nickcrafford/python-pygame-tetris | src/Tetromino.py | Python | gpl-3.0 | 8,712 | 0.015725 |
#!/usr/bin/python
# logging.basicConfig
# Messages on screen or file like object - StreamHandlers
# logging.Formatter
# man date/https://docs.python.org/2/library/time.html#time.strftime
import logging
logging.basicConfig(filename="disk.log",filemode='a',level=logging.DEBUG,format='%(asctime)s - %(name)s - %(levelnam... | tuxfux-hlp-notes/python-batches | archieves/batch-56/logging/second.py | Python | gpl-3.0 | 1,002 | 0.005988 |
from collections import namedtuple
from prophyc.generators import base, word_wrap
INDENT_STR = u" "
MAX_LINE_WIDTH = 100
DocStr = namedtuple("DocStr", "block, inline")
def _form_doc(model_node, max_inl_docstring_len, indent_level):
block_doc, inline_doc = "", ""
if model_node.docstring:
if len(m... | aurzenligl/prophy | prophyc/generators/prophy.py | Python | mit | 5,118 | 0.00254 |
from distutils.core import setup
import os
import glob
setup(
name = 'pyspecfit',
url = 'http://justincely.github.io',
version = '0.0.1',
description = 'interact with IRAF task specfit I/O products',
author = 'Justin Ely',
author_email = 'ely@stsci.edu',
keywords = ['astronomy'],
classi... | justincely/pyspecfit | setup.py | Python | bsd-3-clause | 731 | 0.025992 |
# coding: utf-8
import bisect
import contextlib
import csv
from datetime import datetime
import functools
import json
import logging
import random
import threading
import time
import unittest
import uuid
import redis
QUIT = False
SAMPLE_COUNT = 100
config_connection = None
# 代码清单 5-1
# <start id="recent_log"/>
# ... | huangz1990/riacn-code | ch05_listing_source.py | Python | mit | 29,256 | 0.006797 |
# -*- coding: utf-8 -*-
"""
Created on Sun May 14 22:13:58 2017
"""
#python3
"""
>>> exc_coro = demo_exc_handling()
>>> next(exc_coro)
-> coroutine started
>>> exc_coro.send(11)
-> coroutine received: 11
>>> exc_coro.send(22)
-> coroutine received: 22
>>> exc_coro.close()
>>> from inspect import getgeneratorstate
>... | wuqize/FluentPython | chapter16/coro_exc_demo.py | Python | lgpl-3.0 | 1,499 | 0.00403 |
# -*- coding: utf-8 -*-
ADMIN_MAPPING = {
'admin_user_suspend': {
'resource': 'admin/users/{id}/suspend',
'docs': ('http://docs.discourse.org/#tag/'
'Admin%2Fpaths%2F~1admin~1users~1%7Bid%7D~1suspend%2Fput'),
'methods': ['PUT'],
},
'admin_user_unsuspend': {
... | 0xc0ffeec0de/tapioca-discourse | tapioca_discourse/resource_mapping/admin.py | Python | mit | 3,741 | 0.001604 |
#!/usr/bin/env python
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Greg Aitkenhead
#
# 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 ... | HarryLoofah/gae-bead-calculator | main.py | Python | mit | 8,656 | 0.000116 |
# Configuration file for ipython.
# pylint: disable=E0602
c = get_config()
# -----------------------------------------------------------------------------
# InteractiveShellApp configuration
# -----------------------------------------------------------------------------
# A Mixin for applications that start Interac... | jalanb/jab | ipython/profile_jalanb/ipython_config.py | Python | mit | 18,065 | 0.001439 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | atsushieno/cerbero | cerbero/bootstrap/linux.py | Python | lgpl-2.1 | 10,061 | 0.00497 |
{
'name': 'Discount prepaid order',
'version': '1.0',
'category': 'Custom',
'description': """
Order Discount when it's prepaid and margin is between specific values
""",
'author': 'Nadia Ferreyra',
'website': '',
'depends': ['base',
'sale',
'pro... | Comunitea/CMNT_004_15 | project-addons/prepaid_order_discount/__manifest__.py | Python | agpl-3.0 | 697 | 0.002869 |
# coding: utf-8
"""FETCH parser tests."""
from __future__ import print_function
import unittest
import six
from modoboa_webmail.lib.fetch_parser import FetchResponseParser
from . import data
def dump_bodystructure(fp, bs, depth=0):
"""Dump a parsed BODYSTRUCTURE."""
indentation = " " * (depth * 4)
f... | modoboa/modoboa-webmail | modoboa_webmail/tests/test_fetch_parser.py | Python | mit | 3,016 | 0 |
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext, ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.shortcuts import get_object_or_404
from django_countries im... | alirizakeles/tendenci | tendenci/apps/forms_builder/forms/models.py | Python | gpl-3.0 | 20,327 | 0.002903 |
from django.db import models
# Create your models here.
class ImageModel(models.Model):
image = models.ImageField(upload_to = 'pic_folder/') | MilesDuronCIMAT/django_image | upload_image/models.py | Python | mit | 145 | 0.027586 |
# 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 https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import hashlib
class message(object):
def __init__(self):
'''
... | mpurzynski/MozDef | mq/plugins/nagioshostname.py | Python | mpl-2.0 | 902 | 0.002217 |
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from staticmethod_ext import *
>>> class X1(X):
... pass
>>> x = X(16)
>>> x1 = X1(17)
>>> x1.count()
... | alexa-infra/negine | thirdparty/boost-python/libs/python/test/staticmethod.py | Python | mit | 826 | 0.007264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.