code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import os, json
from shutil import copyfile
from opendm import io
from opendm import log
from opendm import system
from opendm import context
from opendm import types
from opendm import gsd
from opendm.dem import commands, utils
from opendm.cropper import Cropper
from opendm import pseudogeo
from opendm.tiles.tiler im... | OpenDroneMap/OpenDroneMap | stages/odm_dem.py | Python | gpl-3.0 | 6,644 |
from __future__ import unicode_literals
import sys
from datetime import date
from django.apps import apps
from django.contrib.auth import management
from django.contrib.auth.checks import check_user_model
from django.contrib.auth.management import create_permissions
from django.contrib.auth.management.comman... | yephper/django | tests/auth_tests/test_management.py | Python | bsd-3-clause | 28,594 |
# -*- coding: utf-8 -*-
"""
top_rmq.utils
~~~~~
Implements RMQConn object for publishing and consuming messages to/from
RabbitMQ queues.
:copyright: (c) 2017 Peter Schutt
"""
import configparser
import json
import logging
import pathlib
import ssl
import backoff
import pika
LOGGER = logging.getLogger(__name__)
d... | 5uper5hoot/toputils | toputils/rmq/utils.py | Python | mit | 8,845 |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
"""
Interface for VW's active learning mode, which must be communicated with
over a socked.
Derived in great part from
https://github.com/JohnLangford/vowpal_wabbit/blob/master/utl/active_interactor.py
... | MrMathias/wabbit_wappa | wabbit_wappa/active_learner.py | Python | mit | 3,003 |
# file test_existdb/test_query.py
#
# Copyright 2011 Emory University Libraries
#
# 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
#
... | emory-libraries/eulexistdb | test/test_existdb/test_query.py | Python | apache-2.0 | 40,539 |
"""
This module contains all commands for searching the database for events with given criteria. The most important function here is searchNordic and most other functions and classes are here just to support it.
Functions and Classes
---------------------
"""
import numpy as np
from datetime import date
from datetime ... | MrCubanfrog/NorDB | nordb/database/nordicSearch.py | Python | mit | 17,679 |
import os
import sys
import typing
from decimal import Decimal
from knowit import VIDEO_EXTENSIONS
if sys.version_info < (3, 8):
OS_FAMILY = str
else:
OS_FAMILY = typing.Literal['windows', 'macos', 'unix']
OPTION_MAP = typing.Dict[str, typing.Tuple[str]]
def recurse_paths(
paths: typing.Union[str, ... | ratoaq2/knowit | knowit/utils.py | Python | mit | 4,268 |
# Copyright 2009-2015 MongoDB, 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 writin... | mongodb/mongo-python-driver | tools/fail_if_no_c.py | Python | apache-2.0 | 871 |
from time import sleep
def foo(N, message):
sleep(N)
print message
return message
| fikipollo/PySiQ | test/test_functions.py | Python | mit | 95 |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Open Data Portal.
# Copyright (C) 2017 CERN.
#
# CERN Open Data Portal is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, o... | RaoOfPhysics/opendata.cern.ch | cernopendata/modules/theme/config.py | Python | gpl-2.0 | 1,661 |
import unittest
import process_umd as umd
import common
class Test(unittest.TestCase):
path = 'data/country_admin_export_clean.xlsx - Admin_2013.csv'
thresh = 50
ts = umd.main(path, thresh, national=False)
raw = common.load(path)
ts_nat = umd.main(path, thresh, national=True)
raw_nat = commo... | wri/harvest-hansen | test_process_umd.py | Python | apache-2.0 | 1,045 |
# Time: O(n)
# Space: O(h)
# You need to find the largest value in each row of a binary tree.
#
# Example:
# Input:
#
# 1
# / \
# 3 2
# / \ \
# 5 3 9
#
# Output: [1, 3, 9]
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# ... | kamyu104/LeetCode | Python/find-largest-value-in-each-tree-row.py | Python | mit | 1,405 |
# [1] https://doi.org/10.1063/1.5082885
# Minimum dynamic path
# Unke, 2019
from collections import namedtuple
import operator
import re
import numpy as np
from pysisyphus.constants import AU2KJPERMOL
from pysisyphus.dynamics.driver import md, MDResult
from pysisyphus.dynamics.helpers import (
dump_coord... | eljost/pysisyphus | pysisyphus/dynamics/mdp.py | Python | gpl-3.0 | 11,338 |
import os
SHARE_DIR = '../../share'
TEMPLATE_DIR = os.path.join(SHARE_DIR, 'template')
CONFIG_DIR = '../../conf'
| StratusLab/client | api/code/src/test/python/TestDefaults.py | Python | apache-2.0 | 114 |
import sys
import io
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
from pathlib import Path
def read_version(package):
with (Path(package) / '__init__.py').open() as fd:
for line in fd:
if line.startswith('__version__ = '):
... | hjacobs/kube-aws-autoscaler | setup.py | Python | gpl-3.0 | 2,248 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from shuup.campaigns.models.campaigns import CatalogCampaign
from ._base import BaseCampaignForm
... | hrayr-artunyan/shuup | shuup/campaigns/admin_module/forms/_catalog.py | Python | agpl-3.0 | 508 |
class SecurityConfig:
SECURITY_PASSWORD_HASH = 'bcrypt'
SECURITY_PASSWORD_SALT = 'useless'
SECURITY_TOKEN_AUTHENTICATION_KEY = 'token'
SECURITY_SEND_REGISTER_EMAIL = False
SECURITY_REGISTERABLE = True
SECURITY_RECOVERABLE = True
| piotrdubiel/scribeserver | config/defaults.py | Python | mit | 255 |
# -*- coding: utf-8 -*-
# @Author: Gillett Hernandez
# @Date: 2017-08-21 14:45:40
# @Last Modified by: Gillett Hernandez
# @Last Modified time: 2017-09-29 05:04:09
from collections import Counter
from euler_funcs import get_primes, prime_factorization, divisor_pairs_pf, divisor_pairs, isint, timed, is_prime, true_... | gillett-hernandez/project-euler | Python/problem_136.py | Python | mit | 5,669 |
#!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
#This is not a module, but pylint thinks it is. This is a command.
#pylint: disable=invalid-name
# pylint flaggs import errors, as the bot doesn't know have openshift-tools libs
#pylint: disable=import-error
"""
ops-metric-client: Script that sends metrics ... | twiest/openshift-tools | scripts/monitoring/ops-metric-client.py | Python | apache-2.0 | 6,739 |
import unittest
import mock
from pulp.client.commands.repo.cudl import CreateRepositoryCommand, DeleteRepositoryCommand
from pulp.client.commands.repo.sync_publish import PublishStatusCommand, RunPublishRepositoryCommand
from pulp.client.extensions.core import PulpCli
from pulp_openstack.extensions.admin import pulp_... | pulp/pulp_openstack | extensions_admin/test/unit/extensions/admin/test_pulp_cli.py | Python | gpl-2.0 | 2,372 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class CaCertificatesMozilla(Package):
"""The Mozilla CA certificate store in PEM format"""
... | LLNL/spack | var/spack/repos/builtin/packages/ca-certificates-mozilla/package.py | Python | lgpl-2.1 | 2,432 |
# -*- coding: utf-8 -*-
"""
This module executes vsgen unittests (i.e. all tests in the current folder). It exists as an alernative to the command line interface::
> python -m unittest discover --start-directory . --pattern test*.py
For more testing options see the unittest documentation available at https://doc... | dbarsam/python-vsgen-ptvs | tests/__main__.py | Python | mit | 2,306 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | barachka/odoo | addons/mail/mail_message.py | Python | agpl-3.0 | 47,038 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | ohnoimdead/horizon | django-openstack/django_openstack/dash/views/keypairs.py | Python | apache-2.0 | 5,132 |
"""
Views for the PyAMF web based unit test runner.
"""
import logging, time
from django.shortcuts import render_to_response
from django.http import HttpResponseNotFound, HttpResponse
import pyamf
import simplejson
from punit import models
def frontpage(request):
tests = models.get_all_tests()
return render... | cardmagic/PyAMF | doc/tutorials/examples/actionscript/google_appengine/punit/views.py | Python | mit | 1,440 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = '''
options:
api_token:
description:
- This is the API To... | alxgu/ansible | lib/ansible/plugins/doc_fragments/hcloud.py | Python | gpl-3.0 | 744 |
from tsp.graph import Graph
__all__ = ['Graph', 'main']
import matplotlib.pyplot as plot
import numpy as np
import time
from argparse import ArgumentParser
from progressbar import ProgressBar
from tsp.data import DataLoader
from tsp.ga import GAFactory
from tsp.gui import GUI
def main():
parser = ArgumentParser(... | SoftlySplinter/sem6120-assign2 | tsp/__init__.py | Python | unlicense | 3,091 |
from parsimonious import NodeVisitor
from parsimonious import Grammar
class DocketVisitor(NodeVisitor):
def generic_visit(self, node, vc):
return self.stringify_list(vc)
def visit_docket(self, node, vc):
docket = " <docket> %s </docket> " % self.stringify_list(vc)
return docket
def visit_page(self... | NateV/GrammarDev | grammar_dev/grammars/Sectionize.py | Python | gpl-2.0 | 3,580 |
import pyshark
import collections
import time
import operator
import logging
import serial
import struct
import socket
### LOGGING AND SERIAL SETUP ###################################################
logging.basicConfig(level=logging.WARNING,
format='%(asctime)s %(levelname)s %(message)s',
... | sharkwheels/Independet_study_2017 | week2-wireshark/pyshark_test.py | Python | mit | 5,054 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0013_auto_20150715_1831'),
('contacts', '0004_auto_20150324_1024'),
('msgs', '0004_message_pollrun'),
]
oper... | xkmato/tracpro | tracpro/msgs/migrations/0005_inboxmessage.py | Python | bsd-3-clause | 1,185 |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HDSStream, HLSStream, HTTPStream
MEDIA_URL = "http://www.ardmediathek.de/play/media/{0}"
SWF_URL = "http://www.ardmediathek.de/ard/static/player/base/flash/PluginFlash.swf"
HDCORE_PARAMETER = "?hdco... | back-to/streamlink | src/streamlink/plugins/ard_mediathek.py | Python | bsd-2-clause | 4,132 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
class RuswarpDriver(webdriver.PhantomJS):
def parse_data_value(self, value_txt):
... | craigloftus/ruswarp-scraper | driver.py | Python | gpl-2.0 | 2,048 |
# -*- coding: utf-8 -*-
"""
Choices of ``critica.apps.issues`` application.
"""
from django.utils.translation import ugettext_lazy as _
# Status
# ------------------------------------------------------------------------------
STATUS_PUBLISHED = 1
STATUS_COMPLETE = 2
STATUS_NEW = 3
STATUS_CHOICES = (
(STATUS_PUB... | brunobord/critica | apps/issues/choices.py | Python | gpl-3.0 | 414 |
# Copyright 2011-2013, Damian Johnson
# Copyright 2013, Sean Robinson
# See LICENSE for licensing information
"""
Handlers for text configuration files. Configurations are simple string to
string mappings, with the configuration files using the following rules...
* the key/value is separated by a space
* anything aft... | arlolra/stem | stem/util/conf.py | Python | lgpl-3.0 | 22,101 |
import pytest
from midi.midi import Message
from midi.types import NoteOff, SysEx
from midi.utils import get_status_value
@pytest.fixture
def note_off_msg():
note_off = NoteOff(10, 100)
return Message(note_off, 1)
@pytest.fixture
def sysex_msg():
"""A SysEx message with 4 bytes of random data with manu... | edouardtheron/py-midi | tests/test_message_object.py | Python | gpl-3.0 | 1,316 |
import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
@pytest.fixture
def driver(... | olga121/Selenium_Webdriver | test_brouser_log_checking.py | Python | apache-2.0 | 1,792 |
#MenuTitle: Un-Round Corners
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
__doc__="""
Removes corners of outlines of the selected letters (current master only).
1. It doesn't do perfect job at curved segments, but does keep the original in the background. Please fine-tune by... | Tosche/Glyphs-Scripts | Path/Un-Round Corners.py | Python | apache-2.0 | 5,144 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | ramondelafuente/ansible-modules-extras | cloud/vmware/vmware_vswitch.py | Python | gpl-3.0 | 6,816 |
#!/usr/bin/python
'''
lanzar el script escribiendo esta linea dentro de la carpeta con los jp4s:
ls *.jpg | parallel -j 8 python jp4-elphel-exr.py {}
'''
import os, sys, subprocess
for infile in sys.argv[0:]:
f, e = os.path.splitext(infile)
command = "elphel_dng 100 "+f+e+" "+f+".dng"
subprocess.call(... | kinoraw/nautilus-scripts | old/elphel/jp4-elphel-exr.py | Python | gpl-3.0 | 952 |
"""
Copyright 2007 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from __future__ import absolute_import
from os import path
from gi.repository import Gtk
from . import Constants, Utils, Dialogs
class FileDialogHelper(Gtk.FileChooserDialog, object):
... | skoslowski/gnuradio | grc/gui/FileDialogs.py | Python | gpl-3.0 | 6,746 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'StudyPrivate'
db.delete_table(u'feed_studyprivate')
... | Squishymedia/feedingdb | src/feeddb/feed/migrations/0073_auto__del_studyprivate.py | Python | gpl-3.0 | 40,612 |
from django.apps import AppConfig
class FileserverConfig(AppConfig):
name = 'fileserver'
| opentelega/OpenTelega | fileserver/apps.py | Python | mit | 95 |
# dr14_t.meter: compute the DR14 value of the given audiofiles
# Copyright (C) 2011 Simone Riva
#
# 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... | magicgoose/dr14_t.meter | dr14tmeter/my_time_formatter.py | Python | gpl-3.0 | 1,668 |
from django.db import models
# Create your models here.
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_apphooks_config.managers import AppHookConfigManager
from faq.cms_appconfig import FaqConfig
class Entry(models.Model):
app_config = AppHookConfigField(FaqConfig)
question = models... | amitbend/Django-CMS-tutorial-project-django-1.8 | faq/models.py | Python | gpl-2.0 | 538 |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | barnone/EigenD | tools/packages/SCons/Tool/MSCommon/arch.py | Python | gpl-3.0 | 2,011 |
from django.db import models
from django.utils import simplejson
# Create your models here.
class Log(models.Model):
# Participant ID. Serves as a session ID.
pid = models.CharField(max_length=16)
# Task ID. Serves as a unique task ID.
tid = models.IntegerField(default=0)
# Which module is the ac... | pmitros/LectureScapeBlock | lecturescape/lecturescape/app/models.py | Python | agpl-3.0 | 977 |
import os
import sys
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
PYTHON_BIN = os.path.dirname(sys.executable)
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
if not os.path.exists(VAR_ROOT):
os.mkdir(VAR_ROOT)
#===================================================================... | django-de/django-de-v3 | django_de/global_settings.py | Python | bsd-3-clause | 3,699 |
# -*- coding:utf8 -*-
# Author: shizhenyu96@gamil.com
# github: https://github.com/imndszy
from . import admin
from flask import render_template, request, redirect, url_for
from app.admin.functions import admin_login_required
from app.models import Activity
@admin.route('/')
@admin_login_required
def index():
re... | StarInworld/voluntary | app/admin/views.py | Python | mit | 1,236 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
| rapidpro/ureport | ureport/__init__.py | Python | agpl-3.0 | 255 |
from flavorsync.parser.parser import Parser
from flask import json
class JSONParser(Parser):
def from_model(self, data):
return json.dumps(data.to_dict(), default=lambda o: o.__dict__) | Fiware/ops.Flavor-sync | flavorsync/parser/json/json_parser.py | Python | apache-2.0 | 197 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... | bitxbay/BitXBay | lib/daemon.py | Python | gpl-3.0 | 10,196 |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | cctaylor/googleads-python-lib | examples/dfp/v201411/custom_targeting_service/get_custom_targeting_values_by_statement.py | Python | apache-2.0 | 2,247 |
#
# Copyright (c) 2015 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... | SUNET/eduid-common | src/eduid_common/authn/eduid_saml2.py | Python | bsd-3-clause | 9,629 |
# Copyright (C) 2014 Josh Willis
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in th... | stevereyes01/pycbc | pycbc/libutils.py | Python | gpl-3.0 | 7,325 |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 13 12:27:48 2014
@author: Sebastian Held <sebastian.held@gmx.de>
"""
"""
Dieses Programm erzeugt eine iCalendar Datei, die die Müll-Abholtage enthält.
Auf https://www.mywastewatcher.de/abfallkalender/ die eigene Straße einstellen und
eine csv-Datei erzeugen lassen (Abfa... | sibbi77/Abfallkalender | AbfallkalenderHamminkeln.py | Python | gpl-3.0 | 2,309 |
# 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)
from pants.backend.c... | megaserg/pants | src/python/pants/backend/core/tasks/noop.py | Python | apache-2.0 | 1,306 |
import os
import sys
import string
import zipfile
import tempfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from bento.private.bytecode import \
bcompile
from bento.core.utils import \
pprint, ensure_dir
from bento._config \
import \
IPKG... | abadger/Bento | bento/commands/build_wininst.py | Python | bsd-3-clause | 2,781 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pppcemr', '0008_auto_20150901_1317'),
]
operations = [
migrations.CreateModel(
name='Room',
fields=[... | sstebbins/pppcpro | pppcemr/migrations/0009_room.py | Python | agpl-3.0 | 595 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import htpc
import cherrypy
import jsonrpclib
import logging
from ts import norbits
from ts import yts
from ts import ka
from ts import getstrike
from ts import ptp
from ts import rarbg
from cherrypy.lib.auth2 import require
class Torrentsearch(object):
def __init__(... | clausqr/HTPC-Manager | modules/torrentsearch.py | Python | mit | 8,337 |
# coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 versi... | bbbenja/SickRage | sickbeard/providers/kat.py | Python | gpl-3.0 | 9,357 |
from foam.sfa.rspecs.elements.element import Element
class OpenFlowSwitch(Element):
fields = [
'component_id',
'component_manager_id',
'dpid',
'port',
]
| dana-i2cat/felix | ofam/src/src/foam/sfa/rspecs/elements/openflow_switch.py | Python | apache-2.0 | 182 |
'''
Damped scroll effect
====================
.. versionadded:: 1.7.0
This damped scroll effect will use the
:attr:`~kivy.effects.scroll.ScrollEffect.overscroll` to calculate the scroll
value, and slows going back to the upper or lower limit.
'''
__all__ = ('DampedScrollEffect',)
from kivy.effects.scroll import S... | matham/kivy | kivy/effects/dampedscroll.py | Python | mit | 3,511 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import algolia
setup(
name='django-algolia',
version=algolia.__version__,
description='Synchronize your models with the Algolia API for easier and faster searches',
url='https://github.com/Kmaschta/django-algoli... | Kmaschta/django-algolia | setup.py | Python | bsd-2-clause | 984 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Canal para antena 3
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,re
import urllib, urllib2
from core import logger
fr... | titienmiami/mmc.repository | plugin.video.tvalacarta/tvalacarta/channels/a3media.py | Python | gpl-2.0 | 9,184 |
"""
Real life example:
Fitting data from an X-ray reflectometer
The sample is composed of a thin
silver nano-particle layer on a silicon
substrate. The substrate is covered with
SiO2 layer. The nano-particle layer has negligible density
and does not considerably affect
the observed reflectometry picture.
The followin... | DmitryYurov/BornAgain | Examples/python/fitting/ex03_ExtendedExamples/specular/RealLifeReflectometryFitting.py | Python | gpl-3.0 | 9,258 |
py_object = object
import pixie.vm.object as object
from pixie.vm.object import affirm, runtime_error
from pixie.vm.primitives import nil, false
from rpython.rlib.rarithmetic import r_uint
from rpython.rlib.listsort import TimSort
from rpython.rlib.jit import elidable_promote, promote
from rpython.rlib.objectmodel impo... | kidaa/pixie | pixie/vm/code.py | Python | lgpl-3.0 | 28,946 |
from utils.commands import ErrorHandlingCommand
from django.conf import settings
from utils.amazon import default_s3_store
from videos.models import Video, VIDEO_TYPE_FLV, VIDEO_TYPE_HTML5
import urllib
import os
import commands
import sys
from django.core.exceptions import ImproperlyConfigured
from django.core.files.b... | ofer43211/unisubs | apps/videos/management/commands/load_thumbnails.py | Python | agpl-3.0 | 4,203 |
__author__ = 'joon'
import sys
sys.path.insert(0, 'src')
sys.path.insert(0, 'lib')
sys.path.insert(0, 'ResearchTools')
from imports.basic_modules import *
from imports.ResearchTools import *
from imports.libmodules import *
def config_generate(control, conf, EXP_PHASE):
assert (EXP_PHASE == 'guide-generate')
... | coallaoh/GuidedLabelling | src/guide_generation/config.py | Python | mit | 2,151 |
#
# 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... | iemejia/incubator-beam | sdks/python/apache_beam/examples/wordcount.py | Python | apache-2.0 | 5,046 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('robocrm', '0019_auto_20141021_1157'),
]
operations = [
migrations.RemoveField(
model_name='robouser',
... | CMU-Robotics-Club/roboticsclub.org | robocrm/migrations/0020_auto_20141027_0145.py | Python | mit | 976 |
from oscar.apps.catalogue import config
class CatalogueConfig(config.CatalogueConfig):
name = 'demo.apps.catalogue'
| pgovers/oscar-wagtail-demo | demo/apps/catalogue/config.py | Python | mit | 122 |
"""
Views used by XQueue certificate generation.
"""
import json
import logging
from django.contrib.auth.models import User
from django.db import transaction
from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http impor... | lduarte1991/edx-platform | lms/djangoapps/certificates/views/xqueue.py | Python | agpl-3.0 | 9,680 |
import os
# main
DIR = os.path.abspath(os.path.dirname(__file__))
IMGDIR = os.path.join(DIR, 'imgs')
DATADIR = os.path.join(DIR, 'data')
LOGFILENAME = raw_input("Participant: ")
LOGFILE = os.path.join(DATADIR, LOGFILENAME)
# display
DISPTYPE = 'pygame'
DISPSIZE = (1024,768)
# validation points
PXY = [0.15, 0.5, 0.85... | esdalmaijer/EyeTribe_test | experiment/constants.py | Python | gpl-3.0 | 726 |
from django.conf.urls import patterns, url
urlpatterns = patterns('fpuf.utils.views',
url(r'^about/$', 'about', name ="varis_about_about" ) ,
url(r'^missatges/$', 'about', name ="varis_missatges_veure" ) ,
url(r'^condicions/$', 'condicions', name ="va... | ctrl-alt-d/fpuf | fpuf/utils/urls.py | Python | gpl-3.0 | 381 |
"""
libguestfs tools test utility functions.
"""
import logging
import signal
import os
import re
from autotest.client import os_dep, utils
from autotest.client.shared import error
import aexpect
import propcan
class LibguestfsCmdError(Exception):
"""
Error of libguestfs-tool command.
"""
def __in... | rbian/virt-test | virttest/utils_libguestfs.py | Python | gpl-2.0 | 91,195 |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | kerzhner/airflow | airflow/utils/email.py | Python | apache-2.0 | 3,917 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Oğuz Kırat
#
# 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... | okrt/usbtransfer | wintools.py | Python | gpl-2.0 | 2,310 |
import unittest
import json
from app import app
class TestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config["TESTING_DATAFILE"] = "testing/testdata.json"
self.app = app.test_client()
def tearDown(self):
pass
def test_empty_query(self):
response = self.app.get... | nusenu/tor-compass | testing/app_tests.py | Python | mit | 3,590 |
import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="scatter", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/scatter/_showlegend.py | Python | mit | 452 |
from optimus.pages.views.base import PageViewBase
from optimus.conf.registry import settings # noqa: F401
class IndexView(PageViewBase):
"""
Sample page for index
"""
title = "My project"
template_name = "index.html"
# Default destination include the language code
destination = "index_{l... | sveetch/Optimus | optimus/starters/basic/{{cookiecutter.package_name}}/project/views/index.py | Python | mit | 340 |
#!/usr/bin/env python
def get_host_from_uri(uri):
"""
examples: qemu+ssh://root@hail.cloud.example.com/system
test:///default
qemu+ssh://192.168.122.6/system
"""
uri = uri.split("//")[-1].split("/")[0].split("@")[-1]
if uri == '':
return 'localhost'
return u... | herlo/linchpin | linchpin/provision/filter_plugins/get_host_from_uri.py | Python | gpl-3.0 | 497 |
#!/usr/bin/python
import telepot
import pprint
import time
import sys
import os
import json
import requests
import ConfigParser
import datetime
import traceback
import sqlite3
# "Domotibot" e' un bot di telegram che permette la gestione di alcune funzionalita' all'interno
# di una rete domestica. Viene usata la libre... | cesco78/domotica-telegram | tvcc.py | Python | gpl-3.0 | 20,611 |
class GenericClassFactory(object):
"""
Factory for the registration and creation of classes
Usage:
# Create singleton factory object
example_factory = GenericClassFactory(YourAbstractClass)
def get_user_io_factory():
return example_factory;
example_factory.register_algorithm(id_cl... | cehberlin/photobooth | utils.py | Python | lgpl-3.0 | 1,723 |
# portage: news management code
# Copyright 2006-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
__all__ = ["NewsManager", "NewsItem", "DisplayRestriction",
"DisplayProfileRestriction", "DisplayKeywordRestriction",
"DisplayInstalledRest... | clickbeetle/portage-cb | pym/portage/news.py | Python | gpl-2.0 | 13,120 |
def zero():
print ""
def one():
print ""
# data function information
# funcs is """like""" a matrix of """functions"""
# def is like a function
funcs = {
'circle' : { 'area' : calc_circle_area, 'draw' : draw_circle_area},
'square' : one,
2 : two
}
# funcs is... | FlippantSol/CIS-121 | file.py | Python | mit | 1,005 |
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "style-src *"
resp... | kaixinjxq/web-testing-service | wts/tests/csp/csp_style-src_asterisk.py | Python | bsd-3-clause | 3,755 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C)
# 2004-2011: Pexego Sistemas Informáticos. (http://pexego.es)
# 2013: Top Consultant Software Creations S.L.
# (http://www.topconsultant.es/)
# 2014-201... | diagramsoftware/l10n-spain | l10n_es_aeat_mod349/__openerp__.py | Python | agpl-3.0 | 2,121 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the multi-processing analysis process."""
import os
import time
import unittest
from plaso.analysis import interface as analysis_interface
from plaso.containers import sessions
from plaso.engine import configurations
from plaso.multi_process import analysis_... | log2timeline/plaso | tests/multi_process/analysis_process.py | Python | apache-2.0 | 4,590 |
# -*- 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/sale_journal/sale_journal.py | Python | agpl-3.0 | 3,321 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/v1_replication_controller_spec.py | Python | apache-2.0 | 7,495 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distri... | paksas/anim_tools | anim_tools/__init__.py | Python | gpl-2.0 | 2,208 |
#!/usr/bin/env python
#
# Copyright 2011 Markus Pielmeier
#
# This file is part of tagfs-gui.
#
# tagfs-gui 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... | marook/tagfs-gui | setup.py | Python | gpl-3.0 | 3,636 |
#! /usr/bin/env python
# Copyright (C) 2014 Aldebaran
#
# 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 ... | LCAS/spqrel_tools | ros_ws/src/naoqi_bridge/naoqi_tools/scripts/blender/io_export_visual.py | Python | mit | 2,743 |
# create files for chart-02-X
# with these choices
# metric in median-root-median-squared-errors
# model in q50 (quantile-50)
# ndays in 30 60 ... 360
# predictors in act actlog ct ctlog
# responses in price logprice
# usetax in yes no
# year in 2008
# invocations and files created
# py... | rlowrance/re-local-linear | chart-02-huber100-2008-act-ct-median-median.py | Python | mit | 1,276 |
###
# Copyright (c) 2015, Andrew Phillips
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditio... | theasp/supybot-thecatapi | TheCatApi/plugin.py | Python | gpl-2.0 | 3,844 |
#!/usr/bin/python3
from tkinter import *
from tkinter.messagebox import *
fenetre = Tk()
fenetre.title("The Enigma Machine")
fenetre.configure(background='white')
fenetre.geometry("550x800")
class AutoScrollbar(Scrollbar):
#create a 'responsive' scrollbar
def set(self, lo, hi):
if float(lo) <= 0.0 and ... | omnitrogen/enigma | gui/enigma-gui-resizable-window.py | Python | mit | 11,660 |
#!/usr/bin/python
'''
Created on 2016-05-17
@author: jasonszang
'''
import numpy as np
from deeplearning.nlp.lm.lm_util import *
from deeplearning.util.onehot import VocabularyDict
TEXT = 'when there is a will there is a way .\nknowledge is power .'
ORDER = 5
def test_preprocess_text_ngram():
vocabulary = Vocab... | jasonszang/DeepLearning | tests/test_lm_util.py | Python | apache-2.0 | 1,529 |
from quicktions import Fraction
from . import (
_update,
deprecated,
enumerate,
format,
get,
illustrators,
io,
iterate,
iterpitches,
lyconst,
lyenv,
makers,
mutate,
persist,
string,
wf,
)
from ._version import __version__, __version_info__
from .bind impo... | Abjad/abjad | abjad/__init__.py | Python | gpl-3.0 | 11,596 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Xin Dou'
__email__ = "master2dou@gmail.com"
import xml.etree.ElementTree as ET
from wechat.responser.response import Response
class MusicResponse(Response):
def __init__(self, from_user_name, to_user_name, music_item):
Response.__init__(self, f... | douxin/python-wechat | responser/musicresponse.py | Python | mit | 1,404 |
'''
COM Bridge for SOAP Services
============================
This soaplib extension provides a simple COM bridge for accessing SOAP web
services, especially soaplib web services, via a COM-compliant language. It
was developed primarily for use with standard Windows VBScript/VBA.
To use the COM bridge to access a we... | gsson/soaplib | soaplib/ext/comproxy.py | Python | lgpl-2.1 | 9,149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.