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 |
|---|---|---|---|---|---|---|
# coding=utf-8
import pygame
import pygame.locals
class Board(object):
"""
Plansza do gry. Odpowiada za rysowanie okna gry.
"""
def __init__(self, width, height):
"""
Konstruktor planszy do gry. Przygotowuje okienko gry.
:param width: szerokość w pikselach
... | roninek/python101 | docs/pygame/life/code1a.py | Python | mit | 5,039 | 0.001628 |
"""index_artifacts
Revision ID: 340d5cc7e806
Revises: af3f4bdc27d1
Create Date: 2019-08-09 12:37:50.706914
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "340d5cc7e806"
down_revision = "af3f4bdc27d1"
branch_labels = ()
depends_on = None
def upgrade():
# ... | getsentry/zeus | zeus/migrations/340d5cc7e806_index_artifacts.py | Python | apache-2.0 | 705 | 0.001418 |
import os
import numpy as np
def save_weights(layers, weights_dir, epoch):
for idx in range(len(layers)):
if hasattr(layers[idx], 'W'):
layers[idx].W.save_weight(
weights_dir, 'W' + '_' + str(idx) + '_' + str(epoch))
if hasattr(layers[idx], 'W0'):
layers[id... | myt00seven/svrg | para_gpu/tools.py | Python | mit | 2,391 | 0.000836 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Canonical
#
# Authors:
# Michael Vogt
#
# 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; version 3.
#
# This program is distributed in the hope that... | gusDuarte/software-center-5.2 | softwarecenter/ui/gtk3/review_gui_helper.py | Python | lgpl-3.0 | 55,851 | 0.00222 |
#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
######################
#Uniform result
##########################
#Uniform subject, uniform pattern#
command += testshade("-t... | lgritz/OpenShadingLanguage | testsuite/regex-reg/run.py | Python | bsd-3-clause | 2,682 | 0.011186 |
#!/usr/bin/env python
'''
Copyright (C) 2007 John Beard john.j.beard@gmail.com
##This extension allows you to draw a Cartesian grid in Inkscape.
##There is a wide range of options including subdivision, subsubdivions
## and logarithmic scales. Custom line widths are also possible.
##All elements are grouped with simi... | piksels-and-lines-orchestra/inkscape | share/extensions/grid_cartesian.py | Python | gpl-2.0 | 14,264 | 0.01998 |
# Copyright (C) 2017 Red Hat, Inc. Jake Hunsaker <jhunsake@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU Gener... | slashdd/sos | sos/report/plugins/docker_distribution.py | Python | gpl-2.0 | 1,334 | 0 |
def binarySearch(someList, target):
lo = 0
hi = len(someList)
while lo+1 < hi:
test = (lo + hi) / 2
if someList[test] > target:
hi = test
else:
lo = test
if someList[lo] == target:
return lo
else:
return -1
import random
def quickSort(someList):
listSize = len(someList)
... | KingSpork/sporklib | algorithms/binarySearch.py | Python | unlicense | 670 | 0.055224 |
from selenium import webdriver
from django.test import LiveServerTestCase, TestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
import datetime
from planner.models import Participation, Event, Occurrence, EventType, Role
from django.contrib.auth.models import User
import pytz
import time
tz ... | danieka/churchplanner | planner/functional_tests.py | Python | gpl-3.0 | 1,831 | 0.03337 |
import os
import unittest
import random
import xmlrunner
host = os.environ['FALKONRY_HOST_URL'] # host url
token = os.environ['FALKONRY_TOKEN'] # auth token
class TestDatastream(unittest.TestCase):
def setUp(self):
self.created_datastreams = []
self.fclient = FClient(host=host, token=token... | Falkonry/falkonry-python-client | test/TestDatastream.py | Python | mit | 35,686 | 0.00737 |
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.http import HttpResponseForbidden
from django.shortcuts import redirect, render
from django.views.generic import View
from django.views.generic.b... | pelgoros/kwyjibo | kwyjibo/views.py | Python | gpl-3.0 | 4,918 | 0.005696 |
'''
Created on June 6, 2018
Filer Guidelines: esma32-60-254_esef_reporting_manual.pdf
@author: Workiva
(c) Copyright 2022 Workiva, All rights reserved.
'''
try:
import regex as re
except ImportError:
import re
from arelle.ModelValue import qname
from arelle.XbrlConst import all, notAll, hypercubeDimension,... | acsone/Arelle | arelle/plugin/validate/ESEF/Const.py | Python | apache-2.0 | 19,152 | 0.00282 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
# python standard library
from socket import socket
import sys, os, re, stat, math, time, datetime
import importlib
# third party modules
try: # unicode monkeypatch for windoze
import win_unicode_console
win_unicode_console.enab... | RUB-NDS/PRET | helper.py | Python | gpl-2.0 | 21,528 | 0.019595 |
import nacl.exceptions
import nacl.utils
import nacl.secret
from salty.config import encoder, Store
from salty.exceptions import NoValidKeyFound, DefaultKeyNotSet
__all__ = ['new', 'current', 'select', 'add_secret', 'get_secret', 'encrypt', 'decrypt']
def _new():
return encoder.encode(nacl.utils.random(nacl.se... | Markcial/salty | salty/api.py | Python | mit | 1,918 | 0.000521 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
import translate.storage.base
import pootle_store.fields
import pootle.core.mixins.treeitem
import pootle.core.storage
from django.conf import settings
class ... | Yelp/pootle | pootle/apps/pootle_store/migrations/0001_initial.py | Python | gpl-3.0 | 7,129 | 0.005611 |
from ert.cwrap import CWrapper, BaseCClass
from ert.enkf import ENKF_LIB
from ert.util import StringList
class SummaryKeyMatcher(BaseCClass):
def __init__(self):
c_ptr = SummaryKeyMatcher.cNamespace().alloc()
super(SummaryKeyMatcher, self).__init__(c_ptr)
def addSummaryKey(self, key):
... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/enkf/summary_key_matcher.py | Python | gpl-3.0 | 1,882 | 0.007439 |
# -*- coding: utf-8 -*-
"""
The rrule module offers a small, complete, and very fast, implementation of
the recurrence rules documented in the
`iCalendar RFC <https://tools.ietf.org/html/rfc5545>`_,
including support for caching of results.
"""
import itertools
import datetime
import calendar
import re
import sys
try:... | ledtvavs/repository.ledtv | script.tvguide.Vader/resources/lib/dateutil/rrule.py | Python | gpl-3.0 | 64,642 | 0.000155 |
import logging
from ..analyses import AnalysesHub
from . import Analysis, CFGFast
l = logging.getLogger(name=__name__)
class Vtable:
"""
This contains the addr, size and function addresses of a Vtable
"""
def __init__(self, vaddr, size, func_addrs=None):
self.vaddr = vaddr
... | angr/angr | angr/analyses/vtable.py | Python | bsd-2-clause | 4,142 | 0.002897 |
# ***************************************************************************
# * Copyright (c) 2016 GigaSpaces Technologies 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 ... | cloudify-cosmo/cloudify-manager | tests/integration_tests/resources/dsl/plugin_tests/plugins/mock-plugin/mock_plugin/ops.py | Python | apache-2.0 | 940 | 0 |
# wikirandom.py: Functions for downloading random articles from Wikipedia
#
# Copyright (C) 2010 Matthew D. Hoffman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | ajbc/lda-svi | generalrandom.py | Python | gpl-3.0 | 8,782 | 0.00353 |
from tests.api import auth_for
from tests.data import add_fixtures, clubs, users
def test_lva(db_session, client):
lva = clubs.lva(owner=users.john())
add_fixtures(db_session, lva)
res = client.get("/clubs/{id}".format(id=lva.id))
assert res.status_code == 200
assert res.json == {
"id": l... | skylines-project/skylines | tests/api/views/clubs/read_test.py | Python | agpl-3.0 | 1,643 | 0 |
"""
Polish-specific form helpers
"""
import re
from django.newforms import ValidationError
from django.newforms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
class PLVoivodeshipSelect(Select):
"""
A select widget with list of Polish voivodeships (administrative prov... | diofeher/django-nfa | django/contrib/localflavor/pl/forms.py | Python | bsd-3-clause | 5,591 | 0.004114 |
from gui_items import *
from objects.xml.xml_step import Step
class ActionPanel:
def __init__(self, display):
self.steps = []
self.display = display
# new ACTION panel (textbox met draaien, knop voor het uitvoeren van de draaien)
self.panel = self.display.gui_items.add_panel(450,... | Willempie/Artificial_Intelligence_Cube | logic/handling/panel_action.py | Python | apache-2.0 | 5,455 | 0.005683 |
#-----------------------------------------------------------------------------
# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----... | ellisonbg/pyzmq | zmq/tests/test_version.py | Python | lgpl-3.0 | 1,970 | 0.003553 |
__author__ = 'sysferland'
import argparse, subprocess, os
parser = argparse.ArgumentParser()
parser.add_argument('-feed', help='feed name')
parser.add_argument('-ffserver', help='ffserver IP and PORT')
parser.add_argument('-source', help='video source path if DVD Raw the path to the VIDEO_TS folder')
parser.add_argume... | RIEI/tongue | TongueD/StreamThread.py | Python | gpl-2.0 | 1,400 | 0.013571 |
# -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.tests.common import TransactionCase
class TestSAuthSupplier(TransactionCase):
def setUp(self):
super(T... | MackZxh/OCA-Choice | server-tools/auth_supplier/tests/test_auth_supplier.py | Python | lgpl-3.0 | 852 | 0 |
from django.contrib import admin
import models
from pombola.slug_helpers.admin import StricterSlugFieldMixin
class QuizAdmin(StricterSlugFieldMixin, admin.ModelAdmin):
prepopulated_fields = {"slug": ["name"]}
class StatementAdmin(admin.ModelAdmin):
pass
class PartyAdmin(admin.ModelAdmin):
pass
class S... | hzj123/56th | pombola/votematch/admin.py | Python | agpl-3.0 | 754 | 0.01061 |
# coding=utf-8
# generate_completion_cache.py - generate cache for dnf bash completion
# Copyright © 2013 Elad Alfassa <elad@fedoraproject.org>
# 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 General Public Lice... | rholy/dnf-plugins-core | plugins/generate_completion_cache.py | Python | gpl-2.0 | 2,729 | 0 |
# Name: mapper_opendap_sentinel1.py
# Purpose: Nansat mapping for ESA Sentinel-1 data from the Norwegian ground segment
# Author: Morten W. Hansen
# Licence: This file is part of NANSAT. You can redistribute it or modify
# under the terms of GNU General Public License, v.3
# ... | nansencenter/nansat | nansat/mappers/mapper_opendap_sentinel1.py | Python | gpl-3.0 | 4,824 | 0.004561 |
#
# 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 us... | dhalperi/beam | sdks/python/apache_beam/utils/urns.py | Python | apache-2.0 | 4,265 | 0.00422 |
#!/usr/bin/python
import sys
""" My input is 2234,2234,765,2,3,44,44,55,33,33,2,33,33,33
my o/p
2234:2,765,2,3,44:2,55,33:2,2,33:3"""
my_input = sys.argv[1]
#my_input = "1,7,2234,2234,765,2,3,44,44,55,33,33,2,33,33,33,33,1"
my_list = my_input.split(",")
my_str = ""
#print my_list
init = my_list[0]
count = 0
final_list... | hiteshagrawal/python | info/bkcom/problem8.py | Python | gpl-2.0 | 635 | 0.034646 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eith... | miyataken999/weblate | weblate/trans/views/reports.py | Python | gpl-3.0 | 6,538 | 0 |
# This module is DEPRECATED!
#
# You should no longer be pointing your mod_python configuration
# at "django.core.handler".
#
# Use "django.core.handlers.modpython" instead.
from django.core.handlers.modpython import ModPythonHandler
def handler(req):
return ModPythonHandler()(req)
| ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-0.96/django/core/handler.py | Python | bsd-3-clause | 289 | 0.00346 |
# ported from:
# https://github.com/aio-libs/aiopg/blob/master/aiopg/sa/engine.py
import asyncio
import aiomysql
from .connection import SAConnection
from .exc import InvalidRequestError, ArgumentError
from ..utils import _PoolContextManager, _PoolAcquireContextManager
from ..cursors import (
Cursor, Deserializati... | aio-libs/aiomysql | aiomysql/sa/engine.py | Python | mit | 6,916 | 0 |
#!/usr/bin/python3
# Copyright 2018 Francisco Pina Martins <f.pinamartins@gmail.com>
# This file is part of geste2lfmm.
# geste2lfmm is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | StuntsPT/pyRona | helper_scripts/geste2lfmm.py | Python | gpl-3.0 | 2,430 | 0 |
# -*- coding: utf-8 -*-
"""Utility functions.
"""
from collections import OrderedDict
from .bsd_checksum import bsd_checksum # make name available from this module
def n_(s, replacement='_'):
"""Make binary fields more readable.
"""
if isinstance(s, (str, unicode, bytearray)):
return s.replace('... | thebjorn/fixedrec | fixedrec/utils.py | Python | mit | 2,032 | 0.001476 |
import inspect
import time
from collections import defaultdict
_method_time_logs = defaultdict(list)
def log_method_begin():
curframe = inspect.currentframe()
calframe = inspect.getouterframes(curframe, 2)
caller_name = "{}: {}".format(calframe[1].filename.split('/')[-1], calframe[1].function)
_met... | reo7sp/vk-text-likeness | vk_text_likeness/logs.py | Python | apache-2.0 | 889 | 0.003375 |
"""Classes to handle API queries/searches"""
import requests
from ticketpy.model import Venue, Event, Attraction, Classification
class BaseQuery:
"""Base query/parent class for specific serach types."""
#: Maps parameter names to parameters expected by the API
#: (ex: *market_id* maps to *marketId*)
a... | arcward/ticketpy | ticketpy/query.py | Python | mit | 13,726 | 0.003643 |
#
# This file is part of opsd.
#
# opsd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# opsd is distributed in the hope that it wil... | warwick-one-metre/opsd | warwick/observatory/operations/actions/superwasp/park_telescope.py | Python | gpl-3.0 | 1,410 | 0.001418 |
import argparse
class Wait(object):
@staticmethod
def add_parser(parser):
parser.add_parser('wait')
def __init__(self, dung):
self.dung = dung
def run(self):
self.dung.wait_for_it()
| dgholz/dung | dung/command/wait.py | Python | mit | 226 | 0.00885 |
import dbmanager
def main(args, config):
db = dbmanager.dbmanager(config.find('dbmanager'))
if args.make_migration:
db.make_migration()
| vyacheslav-bezborodov/skt | stockviewer/stockviewer/db/main.py | Python | mit | 142 | 0.028169 |
#!/usr/bin/env python
import sys
import PAM
from getpass import getpass
def pam_conv(auth, query_list, userData):
resp = []
for i in range(len(query_list)):
query, type = query_list[i]
if type == PAM.PAM_PROMPT_ECHO_ON:
val = raw_input(query)
resp.append((val, 0))
elif type == PAM.PAM_PROMPT_ECHO_OFF:... | unix4you2/practico | mod/pam/pam_nativo.py | Python | gpl-3.0 | 891 | 0.030303 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = """
---
module: nxos_interfac... | mheap/ansible | lib/ansible/modules/network/nxos/nxos_interface.py | Python | gpl-3.0 | 26,385 | 0.001819 |
from django.test import TestCase, RequestFactory
from ddah_web.models import DDAHTemplate, DDAHInstanceWeb
from ddah_web import read_template_as_string
from ddah_web.views import MoustacheTemplateResponse
class InstanceTemplateTestCase(TestCase):
'''There is a template which contains the html to be represented us... | ciudadanointeligente/deldichoalhecho | ddah_web/tests/instance_template_tests.py | Python | gpl-3.0 | 3,123 | 0.004483 |
#!/usr/bin/env python3
import json
import os
import sys
import anchore_engine.analyzers.utils
analyzer_name = "file_package_verify"
try:
config = anchore_engine.analyzers.utils.init_analyzer_cmdline(
sys.argv, analyzer_name
)
except Exception as err:
print(str(err))
sys.exit(1)
imgname = con... | anchore/anchore-engine | anchore_engine/analyzers/modules/31_file_package_verify.py | Python | apache-2.0 | 2,520 | 0.001587 |
# -*- coding: utf-8 -*-
import sys,pymongo
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure
from bson.code import Code
class MongoDBConfig:
def __init__(self, db_name, host):
self._db_name= db_name
self._host = host
class MongoDB:
'''Use mongo_client for a pooled m... | vollov/py-lab | src/mongodb/__init__.py | Python | mit | 1,550 | 0.007097 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Eric Beanland <eric.beanland@gmail.com>
# This file is part of RecordSheet
#
# RecordSheet 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, ... | ericbean/RecordSheet | test/test_jsonapp.py | Python | gpl-3.0 | 5,052 | 0.005542 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-03 17:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('oplan', '0007_auto_20160503_1638'),
]
operations = [
migrations.RemoveField(... | d120/kifplan | oplan/migrations/0008_auto_20160503_1910.py | Python | agpl-3.0 | 2,321 | 0.002155 |
from . import vertical_lift_shuttle
| OCA/stock-logistics-warehouse | stock_vertical_lift_server_env/models/__init__.py | Python | agpl-3.0 | 36 | 0 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# world_builder.py
class BuildMap(object):
"""
Base class to actually build a map which is defined
by the 'World' object or Grid (to be decided).
This can mean printing the grid, display as image,
create the map in Minecraft or create in other virtual
... | acutesoftware/worldbuild | worldbuild/world_builder.py | Python | gpl-2.0 | 2,333 | 0.014145 |
#! ../env/bin/python
from flask import Flask
from webassets.loaders import PythonLoader as PythonAssetsLoader
from appname import assets
from appname.models import db
from appname.controllers.main import main
from appname.controllers.categories import categories
from appname.controllers.products import products
from ... | ahmadpriatama/Flask-Simple-Ecommerce | appname/__init__.py | Python | bsd-2-clause | 1,969 | 0.001016 |
# coding: utf-8
# Simple chainer interfaces for Deep learning researching
# For autoencoder
# Author: Aiga SUZUKI <ai-suzuki@aist.go.jp>
import chainer
import chainer.functions as F
import chainer.optimizers as Opt
import numpy
from libdnn.nnbase import NNBase
from types import MethodType
from abc import abstractmetho... | tochikuji/chainer-libDNN | libdnn/autoencoder.py | Python | mit | 4,929 | 0.000406 |
"""
mountains
~~~~~~~~~
Takes a CSV file either via local or HTTP retrieval and outputs information about the mountains according to spec.
Originally a programming skills check for a particular position. I've get it updated to current python versions
as well as packaging and testing methodologies.
:copyright: 2016... | c17r/catalyst | src/mountains/__init__.py | Python | mit | 465 | 0 |
import tornado.ioloop
import tornado.web
import socket
import os
import sys
import time
import signal
# import datetime
import h5py
from datetime import datetime, date
import tornado.httpserver
from browserhandler import BrowseHandler
from annotationhandler import AnnotationHandler
from projecthandler import Proje... | fegonda/icon_demo | code/web/server.py | Python | mit | 3,926 | 0.018849 |
"""Support for exposing NX584 elements as sensors."""
import logging
import threading
import time
from nx584 import client as nx584_client
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OPENING,
DEVICE_CLASSES,
PLATFORM_SCHEMA,
BinarySensorEn... | aronsky/home-assistant | homeassistant/components/nx584/binary_sensor.py | Python | apache-2.0 | 4,476 | 0 |
# coding: utf-8
from __future__ import unicode_literals
import re
import hashlib
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
sanitized_Request,
urlencode_postdata,
)
class YandexMusicBaseIE(InfoExtractor):
... | nandhp/youtube-dl | youtube_dl/extractor/yandexmusic.py | Python | unlicense | 8,328 | 0.001817 |
# Authors: Fabian Pedregosa <fabian@fseoane.net>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import interpolate
from scipy.stats import spearmanr
from .base import BaseEstimator, TransformerMixi... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/sklearn/isotonic.py | Python | mit | 14,061 | 0 |
# Copyright 2013 VMware, 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 ... | noironetworks/neutron | neutron/extensions/l3_ext_gw_mode.py | Python | apache-2.0 | 820 | 0 |
# encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
fr... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KColorChooserMode.py | Python | gpl-2.0 | 508 | 0.009843 |
"""Script to build the xpi add-in for firefox
Usage : python build-implicit-wait.py "x.x.x.x"
"""
import os, re, sys, shutil, datetime, zipfile, glob
CD = os.path.dirname(os.path.abspath(__file__))
SRC_DIR = CD + r'\implicit-wait'
OUT_DIR = CD + r'\bin'
RDF_PATH = CD + r'\implicit-wait\install.rdf'
def main(args):... | florentbr/SeleniumBasic | FirefoxAddons/build-implicit-wait.py | Python | bsd-3-clause | 3,005 | 0.009318 |
from flask import Blueprint, render_template, session, redirect, url_for, request, flash, g, jsonify, abort
#from flask_login import requires_login
admin_order = Blueprint('admin_order', __name__)
@admin_order.route('/')
def index():
pass
@admin_order.route('/new', methods=['GET', 'POST'])
def new():
pass
... | friendly-of-python/flask-online-store | flask_online_store/views/admin/order.py | Python | mit | 396 | 0.005051 |
from common.common_consts.telem_categories import TelemCategoryEnum
from infection_monkey.telemetry.base_telem import BaseTelem
class ScanTelem(BaseTelem):
def __init__(self, machine):
"""
Default scan telemetry constructor
:param machine: Scanned machine
"""
super(ScanTele... | guardicore/monkey | monkey/infection_monkey/telemetry/scan_telem.py | Python | gpl-3.0 | 537 | 0.001862 |
import openerp.addons.website.tests.test_ui as test_ui
def load_tests(loader, base, _):
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'website_sale-add_product-test.js'),
{'redirect': '/page/website.homepage'}))
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'website_sa... | browseinfo/odoo_saas3_nicolas | addons/website_sale/tests/test_ui.py | Python | agpl-3.0 | 963 | 0.015576 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-09-09 07:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0002_auto_20160829_1730'),
]
operations = [
migrations.AlterField(
... | fidals/refarm-site | pages/migrations/0003_auto_20160909_0747.py | Python | mit | 467 | 0 |
"""
Copyright 2017 Ryan Wick (rrwick@gmail.com)
https://github.com/rrwick/Unicycler
This module contains functions relating to BLAST, which Unicycler uses to rotate completed circular
replicons to a standard starting point.
This file is part of Unicycler. Unicycler is free software: you can redistribute it and/or mod... | rrwick/Unicycler | unicycler/blast_func.py | Python | gpl-3.0 | 5,533 | 0.004518 |
# -*- encoding: utf-8 -*-
from shapely.wkt import loads as wkt_loads
import dsl
from . import FixtureTest
class ZoosZ13(FixtureTest):
def test_zoo_appears_at_z13(self):
# Zoo Montana, Billings, MT
self.generate_fixtures(dsl.way(2274329294, wkt_loads('POINT (-108.620965329915 45.7322965681428)'), {... | mapzen/vector-datasource | integration-test/421-zoos-z13.py | Python | mit | 609 | 0 |
import csv
from giantcellsim_trial import giantcellsim_trial
import itertools
import numpy
def flatten(items, seqtypes=(list, tuple)): # used for flattening lists
for i, x in enumerate(items):
while isinstance(items[i], seqtypes):
items[i:i+1] = items[i]
return items
def giantcellsim_moti... | kins912/giantcellsim | giantcellsim_motifoutput.py | Python | mit | 3,105 | 0.02963 |
import os
import shutil
import logging
from collections import OrderedDict
from mock import patch
from django.conf import settings
from django.test import TestCase
log = logging.getLogger(__name__)
class RTDTestCase(TestCase):
def setUp(self):
self.cwd = os.path.dirname(__file__)
self.build_dir ... | GovReady/readthedocs.org | readthedocs/rtd_tests/base.py | Python | mit | 3,856 | 0.001037 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import datetime
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('gym', '0001_initial'),
... | petervanderdoes/wger | wger/gym/migrations/0002_auto_20151003_1944.py | Python | agpl-3.0 | 1,061 | 0.002828 |
# -*- coding: utf-8 -*-
# Geocluster - A simple and naive geo cluster
# (c) Régis FLORET 2014 and later
#
def convert_lat_from_gps(value):
"""
Convert a lattitude from GPS coordinate to decimal degrees
:param value: The lattitude as a float between 0 and -90
:return: The lattitude in decimal degrees
... | regisf/geocluster | geocluster/geoconvertion.py | Python | mit | 1,701 | 0 |
#!/usr/bin/env python
# pip installs packages in editable mode using pip_install.py
#
# cryptography is currently using this script in their CI at
# https://github.com/pyca/cryptography/blob/a02fdd60d98273ca34427235c4ca96687a12b239/.travis/downstream.d/certbot.sh#L8-L9.
# We should try to remember to keep their repo up... | letsencrypt/letsencrypt | tools/pip_install_editable.py | Python | apache-2.0 | 629 | 0.00159 |
from django.db import migrations
from corehq.apps.smsbillables.management.commands.bootstrap_gateway_fees import (
bootstrap_pinpoint_gateway,
)
def add_pinpoint_gateway_fee_for_migration(apps, schema_editor):
bootstrap_pinpoint_gateway(apps)
class Migration(migrations.Migration):
dependencies = [
... | dimagi/commcare-hq | corehq/apps/smsbillables/migrations/0022_pinpoint_gateway_fee_amount_null.py | Python | bsd-3-clause | 485 | 0.002062 |
# encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
from Misc import Misc
class Arrow(Misc):
"""
Object GtkArr... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/Arrow.py | Python | gpl-2.0 | 6,743 | 0.002818 |
import datetime
import bcrypt
import rethinkdb as r
from sondra.api.expose import expose_method, expose_method_explicit
from sondra.auth.decorators import authorized_method, authorization_required, authentication_required, anonymous_method
from sondra.collection import Collection
from .documents import Credentials, R... | JeffHeard/sondra | sondra/auth/collections.py | Python | apache-2.0 | 11,035 | 0.007431 |
from django.db import models
from django.contrib.auth.models import User
import requests
from datetime import datetime
from BeautifulSoup import BeautifulSoup
import re
SPOJ_ENDPOINT = "http://www.spoj.com/status/%s/signedlist/"
class SpojUser(models.Model):
user = models.OneToOneField(User)
spoj_handle = mo... | krisys/SpojBot | src/spojbot/bot/models.py | Python | mit | 6,922 | 0.002023 |
# The web is built with HTML strings like "<i>Yay</i>" which draws Yay as
# italic text. In this example, the "i" tag makes <i> and </i> which surround
# the word "Yay". Given tag and word strings, create the HTML string with tags
# around the word, e.g. "<i>Yay</i>".
# make_tags('i', 'Yay') --> '<i>Yay</i>'
# make_t... | RCoon/CodingBat | Python/String_1/make_tags.py | Python | mit | 576 | 0.005208 |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | markflyhigh/incubator-beam | sdks/python/apache_beam/testing/benchmarks/chicago_taxi/trainer/task.py | Python | apache-2.0 | 5,417 | 0.009599 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | echohenry2006/tvb-library | tvb/basic/traits/util.py | Python | gpl-2.0 | 6,354 | 0.003777 |
from loaderio.resources.client import Client
class Servers(Client):
"""
"""
def __init__(self, api_key):
Client.__init__(self, api_key)
pass
def list(self):
return self.request('GET', 'servers') | kenyaapps/loaderio | loaderio/resources/servers.py | Python | mit | 207 | 0.043478 |
import re
import sjconfparts.exceptions
class Error(sjconfparts.exceptions.Error):
pass
class ConversionError(Error):
pass
class ConversionList:
"""Custom list implementation, linked to the related Conf.
Each modification of the list will auto-update the string representation
of the list dir... | SmartJog/sjconf | sjconfparts/type.py | Python | lgpl-2.1 | 16,215 | 0.001788 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: Philip J Grabner <grabner@cadit.com>
# date: 2013/07/31
# copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved.
#-----------------------------------------------------------------------... | cadithealth/genemail | genemail/modifier/base.py | Python | mit | 2,085 | 0.009592 |
""" ProxyManager is the implementation of the ProxyManagement service in the DISET framework
.. literalinclude:: ../ConfigTemplate.cfg
:start-after: ##BEGIN ProxyManager:
:end-before: ##END
:dedent: 2
:caption: ProxyManager options
"""
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Cor... | ic-hep/DIRAC | src/DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py | Python | gpl-3.0 | 18,027 | 0.003162 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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 o... | noironetworks/neutron | neutron/plugins/ml2/drivers/agent/capabilities.py | Python | apache-2.0 | 1,161 | 0 |
import sys
# It may be that the interpreter (wether python or pypy-c) was not linked
# with C++; force its loading before doing anything else (note that not
# linking with C++ spells trouble anyway for any C++ libraries ...)
if 'linux' in sys.platform and 'GCC' in sys.version:
# TODO: check executable to see wheth... | root-mirror/root | bindings/pyroot/cppyy/cppyy/python/cppyy/_stdcpp_fix.py | Python | lgpl-2.1 | 524 | 0 |
from flask import Flask
app = Flask(__name__)
from media import Movie
from flask import render_template
import re
@app.route('/')
def index():
'''View function for index page.'''
toy_story = Movie(title = "Toy Story 3", trailer_youtube_url ="https://www.youtube.com/watch?v=QW0sjQFpXTU",
poster_image_url="https... | mr-karan/Udacity-FullStack-ND004 | Project1/projects/movieServer/app.py | Python | mit | 2,980 | 0.034564 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'rbhusPipeSubmitRenderMod.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _f... | shrinidhi666/rbhus | rbhusUI/lib/rbhusPipeSubmitRenderMod.py | Python | gpl-3.0 | 30,076 | 0.003757 |
#std
import logging
#3rd
from gevent import Greenlet,sleep
#shaveet
from shaveet.config import MAX_CLIENTS_GC,CLIENT_GC_INTERVAL
from shaveet.lookup import all_clients,discard_client
logger = logging.getLogger("shaveet.gc")
class ClientGC(Greenlet):
"""
this greenthread collects the clients that are no longer act... | urielka/shaveet | shaveet/gc.py | Python | mit | 925 | 0.027027 |
# Copyright 2015 Planet Labs, 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 wr... | planetlabs/datalake-api | setup.py | Python | apache-2.0 | 2,140 | 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 u... | airbnb/superset | superset/migrations/versions/732f1c06bcbf_add_fetch_values_predicate.py | Python | apache-2.0 | 1,455 | 0.002062 |
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, nowdate
import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import ge... | mhbu50/erpnext | erpnext/hr/doctype/employee_advance/employee_advance.py | Python | gpl-3.0 | 8,463 | 0.025996 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib,urllib2,re,xbmcplugin,xbmcgui,sys,xbmcaddon
pluginhandle = int(sys.argv[1])
settings = xbmcaddon.Addon(id='plugin.video.dtm_tv')
translation = settings.getLocalizedString
language=""
language=settings.getSetting("language")
if language=="":
settings.openSettin... | AddonScriptorDE/plugin.video.dtm_tv | default.py | Python | gpl-2.0 | 6,186 | 0.032368 |
import discord
import re
import urllib.request
import xml.etree.ElementTree as ET
radio = {}
radioNames = {}
radioWhosPlaying = {}
radioNowPlaying = ''
playerStatus = 0
defaultChannel = ''
voice = ''
async def botWhatIsPlaying(client, message):
if playerStatus is 0:
await client.send_message(message.chann... | mephasor/mephaBot | addons/onlineRadio.py | Python | gpl-3.0 | 5,202 | 0.002169 |
# coding: utf-8
"""参数验证相关工具
"""
import re
import ujson
import types
import numbers
from girlfriend.util.lang import args2fields
from girlfriend.exception import InvalidArgumentException
class Rule(object):
"""描述参数验证规则,并执行验证过程
"""
@args2fields()
def __init__(self, name,
type=None,
... | chihongze/girlfriend | girlfriend/util/validating.py | Python | mit | 4,999 | 0.000236 |
import logging
from sen.docker_backend import DockerContainer, RootImage
from sen.exceptions import NotifyError
from sen.tui.commands.base import Command
from sen.tui.views.disk_usage import DfBufferView
from sen.tui.views.help import HelpBufferView, HelpCommandView
from sen.tui.views.main import MainListBox
from sen.... | TomasTomecek/sen | sen/tui/buffer.py | Python | mit | 10,717 | 0.001306 |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import codecs
from datetime import datetime
import hashlib
import os
import time
try:
from unittest import mock
except ImportError:
import mock
from azure.core... | Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client.py | Python | mit | 41,908 | 0.003508 |
# Copyright 2020 The Google Authors. All Rights Reserved.
#
# Licensed under the MIT License (the "License");
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN... | google-research/accelerated_gbm | solve_libsvm_instances.py | Python | mit | 4,858 | 0.004323 |
import __builtin__
import etcd
from etcd import Client
import importlib
import inspect
import maps
from mock import MagicMock
from mock import patch
import os
import pkgutil
import pytest
import yaml
from tendrl.commons import objects
import tendrl.commons.objects.node_context as node
from tendrl.commons import Tendr... | r0h4n/commons | tendrl/commons/tests/test_init.py | Python | lgpl-2.1 | 17,194 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from contextlib import contextmanager
@contextmanager
def log(name):
print('[%s] start...' % name)
yield
print('[%s] end.' % name)
with log('DEBUG'):
print('Hello, world!')
print('Hello, Python!')
| whyDK37/py_bootstrap | samples/context/do_with.py | Python | apache-2.0 | 269 | 0 |
#!/usr/bin/python
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | akiellor/selenium | py/test/selenium/webdriver/common/correct_event_firing_tests.py | Python | apache-2.0 | 5,557 | 0.003599 |
def test_basic_editor(scratch_tree):
sess = scratch_tree.edit('/')
assert sess.id == ''
assert sess.path == '/'
assert sess.record is not None
assert sess['_model'] == 'page'
assert sess['title'] == 'Index'
assert sess['body'] == 'Hello World!'
sess['body'] = 'A new body'
sess.com... | bameda/lektor | tests/test_editor.py | Python | bsd-3-clause | 1,424 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.