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 glob
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from netCDF4 import Dataset
from postladim import ParticleFile
# ---------------
# User settings
# ---------------
# Files
particle_file = "split.nc"
# particle_file = 'restart_0002.nc'
grid_file = "../data/o... | bjornaa/ladim | examples/restart/animate_split.py | Python | mit | 2,467 |
#!/usr/bin/env python
import time
from rapp_robot_api import RappRobot
rh = RappRobot()
rh.vision.capturePhoto("/home/nao/aoua.jpg", "front", '1280x960')
rh.utilities.moveFileToPC('/home/nao/aoua.jpg', 'aoua.jpg')
rh.utilities.moveFileToNAO('/home/nao/aoua2.jpg', 'aoua.jpg')
| rapp-project/rapp-robots-api | python/examples/vision_test_from_pc.py | Python | apache-2.0 | 279 |
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.pdf import PDFSupport
from ingestors.support.ooxml import OOXMLSupport
class OfficeOpenXMLIngestor(Ingestor, OOXMLSupport, PDFSupport):
"""Office/Word document ingestor class.
Converts the document to PDF and ext... | alephdata/ingestors | ingestors/documents/ooxml.py | Python | mit | 1,494 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from kindo.modules.run.command import Command
class MaintainerCommand(Command):
def __init__(self, startfolder, configs, options, logger):
Command.__init__(self, startfolder, configs, options, logger)
def parse(self, value, kic_path=None):
... | shenghe/kindo | kindo/modules/run/maintainer_command.py | Python | apache-2.0 | 1,785 |
'''
@author Stephen White <stephenawhite57@gmail.com>
@copyright Stephen White
@link https://github.com/readsoftware
@version 1.0
@license <http://www.gnu.org/licenses/>
@package READ.Admin.ORM
Flask Admin Views for READ data model
'''
from functools import partial
from sqlalchemy.orm import... | readsoftware/read | admin/ORM/readFlaskView.py | Python | gpl-3.0 | 51,433 |
# pylint: disable=ungrouped-imports
import json
from datetime import datetime
from typing import List, Union
from urllib.parse import quote
import requests
from tools import ToolException
from tools._typing import PetscanLemma
def listify(item) -> list:
"""
If given a non-list, encapsulate in a single-eleme... | the-it/WS_THEbotIT | tools/petscan.py | Python | mit | 8,968 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VmDateRolledBackEvent(vim, *args, **kwargs):
'''This event records when the VirtualCe... | xuru/pyvisdk | pyvisdk/do/vm_date_rolled_back_event.py | Python | mit | 1,178 |
#!/usr/bin/env python
##
##$Id$
##
##Tommy Carstensen, University College Dublin, 2005
import sys, Utilities
sys.path.append("../")
import Environment
class vibration:
def main(
self, jobid, filename,
atoms_hessian = ['CA'], frames = 50,
cutoff_distance = 10.,
path_python = None, ... | dmnfarrell/peat | PEATSA/Core/Goodvibes/Main.py | Python | mit | 9,423 |
from ponytools import VCF
def VCFInfo(args):
vcf = VCF(args.vcf)
print(
'''Information for: {filename}
Num Samples: {nsamples}
Num SNPs: {nSNPs}
Phased: {isPhased}'''.format(
**{
'filename' : vcf.vcffile.name,
'nsamples' : len(vcf.samples),
... | schae234/PonyTools | ponytools/cli/VCFInfo.py | Python | mit | 415 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ancoweb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| iago-suarez/ancoweb-TFG | src/manage.py | Python | apache-2.0 | 250 |
# -*- 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):
pass
def backwards(self, orm):
pass
models = {
}
... | CWVanderReyden/originalMyHomeNet | recipeBox/migrations/0001_initial.py | Python | gpl-3.0 | 353 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
"""Test of line navigation output of Firefox on bugzilla's advanced
search page.
"""
from macaroon.playback import *
import utils
sequence = MacroSequence()
########################################################################
# We wait for the focus to be on a blank Fir... | h4ck3rm1k3/orca-sonar | test/keystrokes/firefox/label_guess_bugzilla_search.py | Python | lgpl-2.1 | 24,546 |
#!/usr/bin/python
import sys
import os
import string
import re
from xml.sax import make_parser
from xml.sax.handler import ContentHandler, property_lexical_handler
try:
from _xmlplus.sax.saxlib import LexicalHandler
no_comments = False
except ImportError:
class LexicalHandler:
pass
no_comments = True
class parse... | BlackPole/bp-dvbapp | po/xml2po.py | Python | gpl-2.0 | 1,584 |
# -*- coding: utf-8 -*-
"""
On the Subject of Wires
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from ..templating import render_template
def render_page():
return render_template('wires')
| homeworkprod/better-bomb-defusal-manual | bombdefusalmanual/pages/wires.py | Python | mit | 235 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('configuration', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Values',
fields=[
... | Kvoti/ditto | ditto/configuration/migrations/0002_auto_20151012_1146.py | Python | bsd-3-clause | 1,784 |
VERSION = (0,7,0)
| osuosl/django_object_log | object_log/__init__.py | Python | mit | 18 |
import logging
import uuid
import jsonschema
import newrelic.agent
import slugid
from treeherder.etl.common import to_timestamp
from treeherder.etl.exceptions import MissingPushException
from treeherder.etl.jobs import store_job_data
from treeherder.etl.schema import job_json_schema
from treeherder.model.models impor... | edmorley/treeherder | treeherder/etl/job_loader.py | Python | mpl-2.0 | 12,219 |
# Copyright 2018 The TensorFlow Probability Authors.
#
# 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... | tensorflow/probability | tensorflow_probability/python/optimizer/proximal_hessian_sparse.py | Python | apache-2.0 | 25,566 |
#!/usr/bin/python
"""
This program is demonstration for face and object detection using haar-like features.
The program finds faces in a camera image or video stream and displays a red box around them.
Original C implementation by: ?
Python implementation by: Roman Stanchak, James Bowman
"""
import sys
import cv2.cv ... | gmnamra/python-image-utils | haarfacedetect.py | Python | mit | 3,479 |
from Study import Study
import Workflow
import Debug
from vtools.datastore.dss.api import *
from vtools.functions.api import *
from vtools.data.api import *
import collections
import csv
# parse setting file and vardef files
studyMap = Workflow.readReference('./example_data/dts.setting')
# read timeseries into stud... | kuckaogh/csclpp | csclpp/src/csclpp/dts/Example_dts.py | Python | gpl-3.0 | 808 |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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 agree... | ilveroluca/pydoop | test/common/test_pydoop.py | Python | apache-2.0 | 2,152 |
from __future__ import division
from data_3d import *
class Updateable_Line:
def __init__(self, scale=8):
self.index = 50
self.min = 0
self.max = len(WaveFront.get_hardcoded_frame_faces())-1
self.scale = scale
self.__internal_set()
def __internal_set(self):
... | LightStage-Aber/LightStage-Repo | src/modes/updateable_line.py | Python | apache-2.0 | 1,035 |
from distutils.core import setup
setup(
name='curie',
version='0.1.1',
author='Eric Viara',
author_email='eric.viara@curie.fr',
packages=['curie'],
url='http://pypi.python.org/pypi/TowelStuff/',
license='LICENSE.txt',
description='NaviCell Python Binding',
long_description=open('REA... | sysbio-curie/NaviCell | bindings/python/setup.py | Python | lgpl-3.0 | 340 |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class PapersPipeline(object):
def process_item(self, item, spider):
return item
| ShiZhan/pub-owl | collector/papers/pipelines.py | Python | bsd-3-clause | 260 |
"""
Parallel Plot
=============
_thumb: .2, .5
"""
import arviz as az
data = az.load_arviz_data("centered_eight")
ax = az.plot_parallel(data, var_names=["theta", "tau", "mu"], backend="bokeh")
| arviz-devs/arviz | examples/bokeh/bokeh_plot_parallel.py | Python | apache-2.0 | 195 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | arhik/nupic | examples/opf/experiments/spatial_classification/scalar_1/description.py | Python | agpl-3.0 | 2,144 |
# Patchless XMLRPC Service for Django
# Kind of hacky, and stolen from Crast on irc.freenode.net:#django
# Self documents as well, so if you call it from outside of an XML-RPC Client
# it tells you about itself and its methods
#
# Brendan W. McAdams <brendan.mcadams@thewintergrp.com>
# SimpleXMLRPCDispatcher lets us r... | SolusOS-discontinued/RepoHub | buildfarm/views.py | Python | mit | 5,488 |
import os
import sys
from collections import namedtuple
from struct import iter_unpack, unpack, unpack_from
import pygame
from cli import print_hex_view
from .extract import extract_file
CmpSubImage = namedtuple('CmpSubImage', ['cmp_file', 'image_number', 'x', 'y'])
class TerrainFile:
def __init__(self, file_d... | joetsoi/moonstone | python/resources/terrain.py | Python | agpl-3.0 | 2,736 |
# Using the following encoding: utf-8
# Python 2
from ConfigParser import ConfigParser, NoOptionError
# End Python 2
# Python 3
# from configparser import ConfigParser, NoOptionError
# End Python 3
import requests
import ctypes
import ltk.check_connection
import os
import shutil
import fnmatch
import time
import getpas... | Lingotek/client | python2/ltk/actions/action.py | Python | mit | 38,378 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | dholbach/snapcraft | integration_tests/test_store_sign_build.py | Python | gpl-3.0 | 3,865 |
#!/usr/bin/env python
import subprocess
import socket
import ssl
import sys
import time
if sys.version < '2.7':
print("WARNING: SSL not supported on Python 2.6")
exit(0)
if ssl.OPENSSL_VERSION_NUMBER < 0x10000000:
print("WARNING: TLS-PSK not supported on OpenSSL < 1.0")
exit(0)
import inspect, os, ... | zhkzyth/better-mosquitto | test/broker/08-tls-psk-bridge.py | Python | bsd-3-clause | 2,347 |
# -*- coding: utf-8 -*-
import datetime
import unittest
from fs.memoryfs import MemoryFS
from lxml import etree
from mock import Mock, patch
from django.utils.timezone import UTC
from xmodule.xml_module import is_pointer_tag
from xmodule.modulestore import Location
from xmodule.modulestore.xml import ImportSystem, ... | apigee/edx-platform | common/lib/xmodule/xmodule/tests/test_import.py | Python | agpl-3.0 | 20,326 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rumps: Ridiculously Uncomplicated Mac os x Python Statusbar apps.
# Copyright: (c) 2013, Jared Suttles. All rights reserved.
# License: BSD, see LICENSE for details.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
from collections import ... | tito/rumps | rumps/utils.py | Python | bsd-3-clause | 1,144 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.surface_construction_elements import WindowMaterialGas
log = logging.getLogger(__name__)
class TestWindowMaterialGas(unittest.TestCase):
def setUp(self):
self.fd, s... | rbuffat/pyidf | tests/test_windowmaterialgas.py | Python | apache-2.0 | 3,880 |
"""
WSGI config for techtest project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "techtest.settings")
from django.core... | oerb/django-techtest | techtest/techtest/wsgi.py | Python | gpl-3.0 | 391 |
# Speak.activity
# A simple front end to the espeak text-to-speech engine on the XO laptop
# http://wiki.laptop.org/go/Speak
#
# Copyright (C) 2008 Joshua Minor
# This file is part of Speak.activity
#
# Parts of Speak.activity are based on code from Measure.activity
# Copyright (C) 2007 Arjun Sarwal - arjun@laptop.or... | walterbender/speak | glasses.py | Python | gpl-3.0 | 2,781 |
from nose.tools import assert_equals, assert_items_equal, assert_raises
from rsk_mind.datasource import CSVDataSource
from rsk_mind.dataset import Dataset
import os
class TestCsvDatasource:
def __init__(self):
self.out_path = os.path.join(os.getcwd(), 'tests/files/out.csv')
self.in_path = os.path.... | rsk-mind/rsk-mind-framework | tests/datasource/test_csv_datasource.py | Python | mit | 3,020 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 by Pablo Martín <goinnn@gmail.com>
#
# This software is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... | goinnn/django-model-history | example/news/tests.py | Python | lgpl-3.0 | 4,539 |
import os
import sys
import json
import time
import datetime
from functools import partial
from omni_api.hackpad import HackpadClient
from omni_api.jira import JiraClient
from omni_api.jive import JiveClient
from omni_api.github import GithubClient
from omni_api.trello import TrelloClient
import click
import pytz
fro... | harveyr/alfred-omni-api | alfred_omni_api.py | Python | mit | 12,695 |
#
# Copyright 2017 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-2.0
#
# Unless required by applicable law or agreed to in writing... | google/eclipse2017 | scripts/confirm_photos.py | Python | apache-2.0 | 2,144 |
#
# 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
# di... | rh-s/heat | heat/engine/resources/openstack/manila/share_network.py | Python | apache-2.0 | 6,482 |
# -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... | muraliselva10/cloudkitty | cloudkitty/transformer/__init__.py | Python | apache-2.0 | 1,199 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.dates import DateFormatter
from matplotlib.dates import MinuteLocator, HourLocator, DayLocator
from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator
def date_format(format='%Y-%... | yhat/ggplot | ggplot/scales/date_utils.py | Python | bsd-2-clause | 1,661 |
import numpy as np
import torch
from torch.autograd import Variable
from stats.tensor import tensor
def fit(pdfs, parameters, observations, iter, lr):
"""Estimates the parameters of a mixture model via maximum likelihood maximization.
Uses gradient descent for optimization.
Parameters
----------
... | mlosch/pytorch-stats | stats/estimation/mm.py | Python | mit | 4,418 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C)2004-TODAY Tech Receptives(<https://www.techreceptives.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | lertech/extra-addons | website_recaptcha_reloaded/models/res_config.py | Python | gpl-3.0 | 1,452 |
"""
Some code to manage elastic load balancers.
ELBs are load balancers that we can assign to auto scaling groups.
"""
import re
import logging
import boto3
import botocore
from .disco_route53 import DiscoRoute53
from .disco_acm import DiscoACM
from .disco_iam import DiscoIAM
from .exceptions import CommandError
from... | Angakkuit/asiaq-aws | disco_aws_automation/disco_elb.py | Python | bsd-2-clause | 8,851 |
from __future__ import division
import json
import bcrypt
from tornado_json.exceptions import api_assert, APIError
from tornado_json import schema
from pony.orm import db_session, select, commit
from tornado.web import authenticated
from wlsports.db import Game as GameEntity
from wlsports.db import Player as PlayerE... | hfaran/CitySportsLeague-Server | src/wlsports/api/game.py | Python | mit | 8,245 |
import image
import pygame
import math
class Thing( object ):
# A Thing is a generic game object, i.e. the parent class of just about
# everything else.
TERMINAL_VELOCITY = 10
def __init__(self, x=0, y=0, width=32, height=32, sprite_name="", frame=0, topmargin=0, sidemargin=0, bottommargin=0, invisib... | jwvhewitt/rixs | things.py | Python | lgpl-2.1 | 4,807 |
import sys # importa módulo sys
k = 1.3806503*(10**(-23))
import argparse # importa módulo argparse
parser = argparse.ArgumentParser() # cria um objeto do tipo argument do módulo argparse
# Definindo funções e variáveis de acordo com o argparse:
parser.add_argument("--f", "--funcao", type=str, default= "(p*v) + w1*(N... | iancounter/AcensQuestoes | q4.py | Python | mit | 2,954 |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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 applicabl... | 5g-empower/empower-runtime | empower/cli/devices_commands/list_wtps.py | Python | apache-2.0 | 1,495 |
#!/usr/bin/env python
import sys, os
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension, find_packages
# jump through some hoops to get access to versionstring()
from os.path import abspath, dirname
sys.path.insert(0, abspath(dirname(__file__)))
from terane import versionstr... | msfrank/terane-toolbox | setup.py | Python | gpl-3.0 | 2,972 |
"""VRML97-compliant Parser
This example is a full VRML97 parser, originally created
for the mcf.vrml VRML-processing system. It supports all
VRML97 constructs, and should be correct for any VRML97
content you can produce. The parser is fairly fast
(parsing around 280,000 cps on a 1GHz Athlon machine).
This is the e... | alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/simpleparse/examples/vrml_erronfail.py | Python | mit | 4,026 |
import placebo
import boto3
import os
import functools
def placebo_session(function):
"""
Decorator to help do testing with placebo.
Simply wrap the function you want to test and make sure to add
a "session" argument so the decorator can pass the placebo session.
Accepts the following environment ... | mnahm5/django-estore | Lib/site-packages/placebo/utils.py | Python | mit | 1,550 |
# -*- coding: utf-8 -*-
"""
This is a fake __init__.py to help pkgutil find the i18n data. There
is no actual python code in this package.
"""
| NanakiPL/lolwikibot | i18n/__init__.py | Python | gpl-3.0 | 143 |
#!/usr/bin/env python
# Source: https://gist.github.com/jtriley/1108174
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
- get width and height of console
- works on linux,os x,windows,cygwin(windows)
originally retrieved from:
... | graveljp/smugcli | smugcli/terminal_size.py | Python | mit | 2,716 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | rabipanda/tensorflow | tensorflow/python/kernel_tests/array_ops_test.py | Python | apache-2.0 | 46,150 |
import unittest
from numpy.random import RandomState
from pypuf.simulation.arbiter_based.ltfarray import LTFArray
from pypuf.learner.regression.logistic_regression import LogisticRegression
from pypuf.tools import TrainingSet
class TestLogisticRegression(unittest.TestCase):
"""
This module tests the logis... | nicostephan/pypuf | test/test_logistic_regression.py | Python | gpl-3.0 | 2,320 |
# coding: utf8
import logging
import time
from weakref import WeakValueDictionary
from octopus.dispatcher.model import FolderNode, TaskNode, Pool, RenderNode, Task, TaskGroup, Command, PoolShare
from octopus.dispatcher.model.node import BaseNode
from octopus.dispatcher.strategies import FifoStrategy, loadStrategyCla... | mikrosimage/OpenRenderManagement | src/octopus/dispatcher/model/dispatchtree.py | Python | bsd-3-clause | 22,876 |
import pickle
import datetime
import nltk
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import gensim
import sys
from itertools import chain
from functools import reduce
from collections import Counter
from multiprocessing import Pool
class WTVTimeline():
def __init__(self, *args, **... | devincornell/semanticanlysis | timelines.py | Python | mit | 6,401 |
# coding=utf-8
import os
from pyow.dll_loader import load_dll
from pyow.lib.withhacks import WithHack
# from pyow.owtypes import Disposable
load_dll()
# noinspection PyUnresolvedReferences
from CASCExplorer import CASCConfig, CASCHandler, LocaleFlags, ContentFlags, CASCFolder, Wildcard, ICASCEntry, \
PackageInd... | ZingBallyhoo/OverwatchDataManager | pyow/casc.py | Python | mit | 11,154 |
# Demo of the flip parameters for transformSprite
# Use direction keys to flip horizontally or vertically
# Use space key to rotate
from pygame_functions import *
screenSize(1024, 768)
jurassic = makeSprite("images/Jurassic.jpg")
showSprite(jurassic)
angle = 0
hflip = False
vflip = False
while True:
if keyPress... | StevePaget/Pygame_Functions | demos/flipDemo.py | Python | gpl-2.0 | 632 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from pyramid.view import view_config
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS
from pontus.view import BasicView
from novaideo.content.proces... | ecreall/nova-ideo | novaideo/views/question_management/answer/support_answer.py | Python | agpl-3.0 | 1,328 |
# Python3
# 有限制修改區域
class Counter(object):
def __init__(self, beta):
self.value = beta
def inc(self):
self.value += 1
def get(self):
return self.value
def countVisitors(beta, k, visitors):
counter = Counter(beta)
for visitor in visitors:
if visitor >= k:
... | RevansChen/online-judge | Codefights/arcade/python-arcade/level-12/78.Count-Visitors/Python/solution1.py | Python | mit | 377 |
# Copyright (c) 2013 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 ... | gotostack/swift | swift/common/middleware/slo.py | Python | apache-2.0 | 34,316 |
# -*- coding: utf-8 -*-
"""Module to daemonize the current process on Unix."""
#
# (C) Pywikibot team, 2007-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
import codecs
import os
import sys
is_daemon = False
def daemonize(cl... | darthbhyrava/pywikibot-local | pywikibot/daemonize.py | Python | mit | 2,017 |
from __future__ import unicode_literals
from django.contrib.auth import (login as auth_login, authenticate,
logout as auth_logout, get_user_model)
from django.contrib.auth.decorators import login_required
from django.contrib.messages import info, error
from django.core.urlresolvers imp... | Kniyl/mezzanine | mezzanine/accounts/views.py | Python | bsd-2-clause | 6,335 |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | debugger06/MiroX | tv/lib/frontends/widgets/gtk/customcontrols.py | Python | gpl-2.0 | 20,354 |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | NERSC/qpredict | neon/custom_dataiterator.py | Python | gpl-3.0 | 6,431 |
#!/usr/bin/python
import os
import multiprocessing
import shutil
# Provide access to the helper scripts
def modify_path():
scripts_dir = os.path.dirname(__file__)
while not 'Scripts' in os.listdir(scripts_dir):
scripts_dir = os.path.abspath(os.path.join(scripts_dir, '..'))
scripts_dir = os.path.jo... | mkraska/CalculiX-Examples | Contact/Hertz_axi/test.py | Python | mit | 1,476 |
"""
===========================================================
Plot sensor denoising using oversampled temporal projection
===========================================================
This demonstrates denoising using the OTP algorithm [1]_ on data with
with sensor artifacts (flux jumps) and random noise.
"""
# Author... | mne-tools/mne-tools.github.io | 0.17/_downloads/88bdc9b3f1301664807e59da29e5434f/plot_otp.py | Python | bsd-3-clause | 3,406 |
"""
WSGI config for weather_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | wdherndon/WeatherServer | weather_server/weather_server/wsgi.py | Python | gpl-2.0 | 405 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='sample_python_package',
version='0.0.3',
description='Sample package for Python',
long_description=readme,
autho... | avihoo/samplemod | setup.py | Python | bsd-2-clause | 492 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SagaAlgorithm.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | dwadler/QGIS | python/plugins/processing/algs/saga/SagaAlgorithm.py | Python | gpl-2.0 | 20,651 |
import sys
from quex.frs_py.file_in import error_msg
import quex.lexer_mode as lexer_mode
from quex.core_engine.generator.action_info import CodeFragment
def do(Modes):
"""If consistency check fails due to a fatal error, then this functions
exits back to the system with error code -1. Otherwise,... | grit-engine/grit-engine | dependencies/quex-0.34.1/quex/consistency_check.py | Python | mit | 3,553 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (... | kionetworks/openstack-dashboard-essex | openstack_dashboard/overrides/images/views.py | Python | apache-2.0 | 1,682 |
#!/usr/bin/python
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | pombredanne/pytype | pytype/pytd/setup.py | Python | apache-2.0 | 1,063 |
import os
import distutils
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, loca... | cortext/crawtextV2 | ~/venvs/crawler/lib/python2.7/site-packages/setuptools/command/setopt.py | Python | mit | 5,068 |
# coding=utf-8
import unittest
from katas.kyu_5.ninja_vs_samurai_attack_block import Warrior
class WarriorTestCase(unittest.TestCase):
def test_equals_1(self):
ninja = Warrior('Hanzo Hattori')
samurai = Warrior('Ryōma Sakamoto')
samurai.block = 'l'
ninja.attack(samurai, 'h')
... | the-zebulan/CodeWars | tests/kyu_5_tests/test_ninja_vs_samurai_attack_block.py | Python | mit | 954 |
'''Heuristic code design
'''
import math
from functools import partial, lru_cache
from diskcache import Cache
from pynumeric import numinv, cnuminv
from .. import Soliton
from ..coding.stats import c_from_delta_mode
from .analytic import decoding_failure_prob_estimate
# create a cache for storing optimized paramete... | severinson/pyrateless | pyrateless/optimize/heuristic.py | Python | apache-2.0 | 5,227 |
# Copyright 2016 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | jiaphuan/models | research/cognitive_mapping_and_planning/src/utils.py | Python | apache-2.0 | 5,218 |
#!/usr/bin/env python3
# coding: utf-8
from parkworker3.monits.base import Monit
import argparse
parser = argparse.ArgumentParser(description='Run monitoring checks manually.')
parser.add_argument('monit_name', type=str, help='Monitoring name. For example: general.ping')
parser.add_argument('hosts', nargs='+', type=s... | telminov/park-worker-p3 | parkworker3/bin/check.py | Python | mit | 527 |
"""Class to handle the minification of JS/CSS"""
import os
from suitcase.plugins.assets.bin.jsmin import jsmin
def javascript(global_config, package_config):
"""Minifies JavaScript"""
target_dir = os.path.join(
package_config["working_dir"],
package_config["destination_mapping"]["root"],... | brosner/suitcaseproject | suitcase/plugins/assets/minify.py | Python | bsd-3-clause | 1,180 |
# !/usr/bin/python
import sys
directorySeparationCharacter="/"
maxDirectoryDepth=99
##
# Extract a module name from a given file name.
#
# Calculates the name of the directory to which the given file name belongs.
# restricted to a directory nesting depth of maxDirectoryDepth.
#
# E.g.:
# extractModuleNameFromFileN... | carvalhomb/tsmells | fetch/src/CDIF2RSF/writeFiles.py | Python | gpl-2.0 | 6,733 |
# =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# 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 ... | anushreejangid/csmpe-main | csmpe/core_plugins/csm_install_operations/exr/prepare_clean.py | Python | bsd-2-clause | 4,627 |
"""
Encrypt or decrypt the contents of a message file using an enigma machine.
"""
import encode
import decode
from enigma import Enigma
import os.path
ENCODE = "e"
DECODE = "d"
# FIXME still using some old file names
def get_valid_filename(msg):
"""
Prompt the user, using msg, to type the name of a file. T... | patrickleweryharris/enigma | cipher_program/__main__.py | Python | mit | 3,746 |
#! /usr/bin/python
from com.goffersoft.utils.utils import readonly
""" This Module Contains header types specific to raw
messaging protocol
"""
class _RawMsgHdrType(type):
"""Raw Message Header Names"""
CONTENT = readonly('Content')
CONTENT_TYPE = readonly('Content-Type')
FROM = readonly('From')... | goffersoft/common-utils-python | experimental/com/goffersoft/raw/rawhdr.py | Python | gpl-2.0 | 543 |
"""
Django management command to load the `lms_user_id` column from historical user data.
******
Please see the `0001-pausing-lms-user-id-backfill` ADR before attempting to use this management command.
******
"""
import logging
from django.contrib.auth import get_user_model
from django.core.management.base import B... | edx/credentials | credentials/apps/core/management/commands/sync_lms_user_ids.py | Python | agpl-3.0 | 7,922 |
from model.group import Group
import random
def test_some_first_group(app,db,check_ui):
if len(db.get_group_list())==0:
db.creat(Group(name="Test1",footer="Test2"))
old_groups = db.get_group_list()
group=random.choice(old_groups)
modify_group=Group(name="Hallo")
modify_group.id=group.id
... | mari44ka/python_training | test/test_editing_some_group.py | Python | apache-2.0 | 590 |
# Copyright (c) 2015-2016 Tigera, 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 applicabl... | projectcalico/calico | node/tests/st/bgp/test_internal_route_reflector.py | Python | apache-2.0 | 5,038 |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... | jimsize/PySolFC | pysollib/games/pasdedeux.py | Python | gpl-3.0 | 7,417 |
# This is a variant of the very old (early 90's) file
# Demo/threads/bug.py. It simply provokes a number of threads into
# trying to import the same module "at the same time".
# There are no pleasant failure modes -- most likely is that Python
# complains several times about module random having no attribute
# randran... | neopoly/rubyfox-server | lib/rubyfox/server/data/lib/Lib/test/test_threaded_import.py | Python | mit | 1,978 |
# -*- coding: utf-8 -*-
# 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 __future__ import unicode_literals
SIMPLE_INPUT_TYPES = ('text', 'hid... | shawnadelic/shuup | shuup/testing/soup_utils.py | Python | agpl-3.0 | 1,829 |
#!/usr/bin/env python
#
# USBTORS485 Converter, Y-1081 USB2.0 to RS485 Converter(FT232 Chip)
# lllking: DDS238-2 ZN/S
# Author Feb 2018 Zhenxing Xu <xuzhenxing@canaan.creative.com>
#
# /dev/ttyUSB0 permission
# Add /etc/udev/rules.d/99-plugdev.rules
# 99-plugdev.rules: ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0002",... | Canaan-Creative/Avalon-extras | dds238-2-power/usr/bin/read-power.py | Python | unlicense | 3,080 |
# $Id$
import pidtest
def testLatin1Chars(can):
curx,cury = 10,20
can.drawString("hola Málaga amigos niños", curx,cury)
cury = cury + 20
can.drawString("Como estan?", curx, cury)
can.flush()
can.clear() # get our next page ???
curx,cury = 10,20
can.drawString("hola Málaga amigos niños... | rdkit/rdkit-orig | rdkit/sping/tests/pstests.py | Python | bsd-3-clause | 461 |
"""Constants used for LG webOS Smart TV."""
import asyncio
from aiowebostv import WebOsTvCommandError
from websockets.exceptions import ConnectionClosed, ConnectionClosedOK
DOMAIN = "webostv"
PLATFORMS = ["media_player"]
DATA_CONFIG_ENTRY = "config_entry"
DATA_HASS_CONFIG = "hass_config"
DEFAULT_NAME = "LG webOS Smar... | rohitranjan1991/home-assistant | homeassistant/components/webostv/const.py | Python | mit | 882 |
#!/usr/bin/python
#
# www.darkc0de.com
# this script is protected by the GPL
# get your copy here >> http://www.gnu.org/licenses/gpl-3.0.txt
# this c0de belongs to darkc0de !!
# main code low1z & rsauron
from Tkinter import *
from tkFileDialog import *
import random, cookielib, urllib, urllib2, re, sys, socket, tim... | knightmare2600/d4rkc0de | others/simpleDorkGUi.py | Python | gpl-2.0 | 23,719 |
## @file
# This file is used to create/update/query/erase table for data models
#
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. Th... | carmark/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Table/TableDataModel.py | Python | gpl-2.0 | 3,275 |
# -*- coding: utf-8 -*-
import cfme.web_ui.flash as flash
import pytest
import random
import time
from cfme import test_requirements
from cfme.common.vm import VM
from cfme.infrastructure.provider import InfraProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.infrastructure.provide... | okolisny/integration_tests | cfme/tests/infrastructure/test_vm_power_control.py | Python | gpl-2.0 | 18,002 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of th... | jun66j5/trac-ja | trac/perm.py | Python | bsd-3-clause | 29,676 |
"""Tests main.ParseNTCodonCounts.
Written by Jesse Bloom, 2012.
"""
import time
import sys
import os
import unittest
import mapmuts.sequtils
import mapmuts.main
class TestParseAlignments(unittest.TestCase):
"""Tests main.ParseNTCodonCounts."""
def test_ParseNTCodonCounts(self):
"""Tests main.Pars... | jbloom/mapmuts | tests/test_parsealignments.py | Python | gpl-3.0 | 3,010 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.