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 |
|---|---|---|---|---|---|---|
"""
Given Style Rules, create an SLD in XML format add it to a layer
"""
if __name__=='__main__':
import os, sys
DJANGO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(DJANGO_ROOT)
os.environ['DJANGO_SETTINGS_MODULE'] = 'geonode.settings'
import logging
import os
from... | cga-harvard/cga-worldmap | geonode/contrib/dataverse_styles/style_layer_maker.py | Python | gpl-3.0 | 12,317 | 0.004871 |
# encoding: utf-8
"""
Paging capabilities for IPython.core
Authors:
* Brian Granger
* Fernando Perez
Notes
-----
For now this uses ipapi, so it can't be in IPython.utils. If we can get
rid of that dependency, we could move it there.
-----
"""
#----------------------------------------------------------------------... | mattvonrocketstein/smash | smashlib/ipy3x/core/page.py | Python | mit | 12,350 | 0.001053 |
# Copyright (c) 2014 by pyramid_decoy authors and contributors
# <see AUTHORS file>
#
# This module is part of pyramid_decoy and is released under
# the MIT License (MIT): http://opensource.org/licenses/MIT
"""Main decoy module."""
__version__ = "0.2.0"
SETTINGS_PREFIX = "decoy"
def includeme(configurator):
"""... | fizyk/pyramid_decoy | src/pyramid_decoy/__init__.py | Python | mit | 1,031 | 0 |
from utils import secret
import requests
import re
import json
import os
def gf_families_ignore_camelcase():
"""Find family names in the GF collection which cannot be derived by
splitting the filename using a camelcase function e.g
VT323, PTSans.
If these filenames are split, they will be V T 32... | googlefonts/gfregression | Lib/gfregression/gf_families_ignore_camelcase.py | Python | apache-2.0 | 936 | 0.002137 |
import cffi
#
# This is only a demo based on the GMP library.
# There is a rather more complete (but perhaps outdated) version available at:
# http://bazaar.launchpad.net/~tolot-solar-empire/+junk/gmpy_cffi/files
#
ffibuilder = cffi.FFI()
ffibuilder.cdef("""
typedef struct { ...; } MP_INT;
type... | hipnusleo/laserjet | resource/pypi/cffi-1.9.1/demo/gmp_build.py | Python | apache-2.0 | 733 | 0.001364 |
import sys
inFile = open(sys.argv[1],'r')
nuc = {'A':'T','T':'A','G':'C','C':'G','K':'M','M':'K','R':'Y','Y':'R','S':'W','W':'W','B':'V','V':'B','H':'G','D':'C','X':'N','N':'N'}
def revComp(seq):
rev = ''
for i in range(len(seq) - 1,-1,-1):
rev += nuc[seq[i]]
return rev
header = ''
seq = ''
for... | pandeyravi15/SGMBL | script/revcomp.py | Python | gpl-3.0 | 576 | 0.064236 |
from django.contrib.auth.forms import AuthenticationForm
from django.core.urlresolvers import reverse
from actstream.models import user_stream
from dnstorm.app import DNSTORM_URL
from dnstorm.app.utils import get_option
from dnstorm.app.models import Problem, Idea
from dnstorm.app.utils import get_option
def base(re... | vmassuchetto/dnstorm | dnstorm/app/context_processors.py | Python | gpl-2.0 | 1,367 | 0.003658 |
from __future__ import absolute_import, unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
import django
from django.db.models.sql import compiler
import re
NEEDS_AGGREGATES_FIX = django.VERSION[:2] < (1, 7)
# query_clas... | theoriginalgri/django-mssql | sqlserver_ado/compiler.py | Python | mit | 10,087 | 0.002776 |
"""
Support for ISY994 fans.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/fan.isy994/
"""
import logging
from typing import Callable
from homeassistant.components.fan import (FanEntity, DOMAIN, SPEED_OFF,
SPEE... | PetePriority/home-assistant | homeassistant/components/isy994/fan.py | Python | apache-2.0 | 3,213 | 0 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | eneldoserrata/marcos_openerp | addons/purchase/purchase.py | Python | agpl-3.0 | 67,788 | 0.007612 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | mfem/PyMFEM | mfem/_par/sparsemat.py | Python | bsd-3-clause | 42,261 | 0.004023 |
import json
from mockito import *
import os
import shutil
import tempfile
import unittest
from ice.history import ManagedROMArchive
class ManagedROMArchiveTests(unittest.TestCase):
def setUp(self):
self.tempdir = tempfile.mkdtemp()
self.temppath = os.path.join(self.tempdir, "tempfile")
self.mock_user =... | scottrice/Ice | tests/managed_rom_archive_tests.py | Python | mit | 2,688 | 0.005952 |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | dpgoetz/swift | swift/common/middleware/keystoneauth.py | Python | apache-2.0 | 25,905 | 0.000116 |
from flask.ext.wtf import Form
from wtforms import TextAreaField
from wtforms.validators import DataRequired
class RequestForm(Form):
inputText = TextAreaField('inputText', validators=[DataRequired()])
| jarjun/EmergencyTextToVoiceCall | app/forms.py | Python | mit | 204 | 0.009804 |
# Authors: David Goodger; Gunnar Schwant
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 21817 $
# Date: $Date: 2005-07-21 13:39:57 -0700 (Thu, 21 Jul 2005) $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, p... | garinh/cs | docs/support/docutils/languages/de.py | Python | lgpl-2.1 | 1,814 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
########################################################################
# Solves problem 76 from projectEuler.net.
# Finds the number of different ways that 100 can be written as sum of
# 2 positive integers.
# Copyright (C) 2010 Santiago Alessandri
#
# This p... | salessandri/programming-contests | project-euler/problem076.py | Python | gpl-3.0 | 1,376 | 0.00218 |
import rdtest
class D3D11_Texture_Zoo(rdtest.TestCase):
slow_test = True
demos_test_name = 'D3D11_Texture_Zoo'
def __init__(self):
rdtest.TestCase.__init__(self)
self.zoo_helper = rdtest.Texture_Zoo()
def check_capture(self):
# This takes ownership of the controller and shuts... | moradin/renderdoc | util/test/tests/D3D11/D3D11_Texture_Zoo.py | Python | mit | 457 | 0.002188 |
# coding: utf-8
from geventwebsocket.handler import WebSocketHandler
from gevent import pywsgi, sleep
import json
import MySQLdb
class JPC:
#
# 初期化
#
def __init__(self, filepath_config):
import hashlib
# 設定ファイルをロード
fp = open(filepath_config, 'r')
config = json.load(fp)
... | ptr-yudai/JokenPC | server/JPC.py | Python | mit | 11,068 | 0.006781 |
# Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | AlanCoding/tower-cli | tests/test_cli_action.py | Python | apache-2.0 | 2,582 | 0 |
"""
File format detector
"""
import logging, sys, os, csv, tempfile, shutil, re, zipfile
import registry
from galaxy import util
log = logging.getLogger(__name__)
def get_test_fname(fname):
"""Returns test data filename"""
path, name = os.path.split(__file__)
full_path = os.path.join(path, 'test',... | dbcls/dbcls-galaxy | lib/galaxy/datatypes/sniff.py | Python | mit | 9,773 | 0.014734 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_router_peerings_operations.py | Python | mit | 22,524 | 0.004972 |
"""
The collection of decorators for the ``color()`` method, each CA model
should have.
The method should be decorated by one of the classes below, otherwise
the correct model behavior will not be guaranteed.
All decorators are get the ``(red, green, blue)`` tuple from
``color()`` method, then process it to create so... | a5kin/hecate | xentica/core/color_effects.py | Python | mit | 4,034 | 0 |
# -*- coding: utf-8 -*-
import operator
from django.conf import settings
from moneyed import CURRENCIES, DEFAULT_CURRENCY, DEFAULT_CURRENCY_CODE
# The default currency, you can define this in your project's settings module
# This has to be a currency object imported from moneyed
DEFAULT_CURRENCY = getattr(settings,... | rescale/django-money | djmoney/settings.py | Python | bsd-3-clause | 987 | 0.001013 |
# coding=utf-8
from _commandbase import RadianceCommand
from ..datatype import RadiancePath, RadianceTuple
from ..parameters.gensky import GenskyParameters
import os
class Gensky(RadianceCommand):
u"""
gensky - Generate an annual Perez sky matrix from a weather tape.
The attributes for this class and th... | antonszilasi/honeybeex | honeybeex/honeybee/radiance/command/gensky.py | Python | gpl-3.0 | 5,946 | 0.001177 |
# 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
# distributed under t... | openstack/keystone | keystone/common/policies/domain.py | Python | apache-2.0 | 3,937 | 0 |
""" process_model.py
Usage:
process_model.py <command> <project_code> <full_model_path> [options]
Arguments:
command action to be run on model, like: qc, audit or dwf
currently available: qc, audit, dwf
project_code unique project code consis... | hdm-dt-fb/rvt_model_services | process_model.py | Python | mit | 14,344 | 0.00251 |
import os, sys
sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics.context import *
from nodebox.graphics import *
txt = Text("So long!\nThanks for all the fish.",
font = "Droid Serif",
fontsize = 20,
fontweight = BOLD,
lineheight = 1.2,
fill = color(0.25))
# Text.s... | pepsipepsi/nodebox_opengl_python3 | examples/04-text/02-style.py | Python | bsd-3-clause | 687 | 0.039301 |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | UManPychron/pychron | pychron/processing/ratios/ratio_editor.py | Python | apache-2.0 | 4,353 | 0.003446 |
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPT... | hqpr/findyour3d | config/settings/local.py | Python | mit | 1,853 | 0.001079 |
/usr/share/pyshared/gwibber/microblog/urlshorter/zima.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/pymodules/python2.7/gwibber/microblog/urlshorter/zima.py | Python | gpl-3.0 | 56 | 0.017857 |
import sys
import re
for lines in open(sys.argv[1], "rU"):
line = lines.strip()
lexemes = re.split(".out:", line)
oid = lexemes[0].split(".")[1]
ncbi = re.split("val=|'", lexemes[1])[2]
print oid + " \t" + ncbi
| fandemonium/code | parsers/img_oid_to_ncbi_from_html.py | Python | mit | 234 | 0.004274 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ClusterDestroyedEvent(vim, *args, **kwargs):
'''This event records when a cluster is ... | xuru/pyvisdk | pyvisdk/do/cluster_destroyed_event.py | Python | mit | 1,147 | 0.00959 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/interfaces/interface/subinterfaces/subinterface/ipv4/unnumbered/interface_ref/__init__.py | Python | apache-2.0 | 9,237 | 0.001191 |
#!/usr/bin/env python
""" Calculate the Julian Date """
import time
import math
t = time.time()
""" Technically, we should be adding 2440587.5,
however, since we are trying to stick to the stardate
concept, we add only 40587.5"""
jd = (t / 86400.0 + 40587.5)
# Use the idea that 10 Julian days is equal to 1 ... | casep/Molido | sdate.py | Python | gpl-2.0 | 350 | 0.002857 |
# -*- coding: utf-8 -*-
import sys
import time
import json
import datetime
import scrapy
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
import robot
from robot.items import RobotItem
from robot.models.base import Base
from robot.settings import logger
class EladiedSinaComCnItem(RobotIt... | li282886931/apistore | robot/robot/news/eladies_sina_com_cn.py | Python | gpl-2.0 | 2,757 | 0.005261 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/availability_sets_operations.py | Python | mit | 17,248 | 0.002609 |
from __future__ import division
| laowantong/mocodo | mocodo/tests/__init__.py | Python | mit | 33 | 0 |
# -*- coding: utf-8 -*-
# gthnk (c) Ian Dennis Miller
import os
import flask
import logging
from flaskext.markdown import Markdown
from mdx_linkify.mdx_linkify import LinkifyExtension
from mdx_journal import JournalExtension
from . import db, login_manager, bcrypt
from .models.day import Day
from .models.entry impo... | iandennismiller/gthnk | src/gthnk/server.py | Python | mit | 1,615 | 0.000619 |
# Copyright 2013-2016 DataStax, 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 writi... | Richard-Mathie/cassandra_benchmark | vendor/github.com/datastax/python-driver/tests/integration/cqlengine/columns/test_validation.py | Python | apache-2.0 | 21,274 | 0.001081 |
# Copyright 2008 German Aerospace Center (DLR)
#
# 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... | khertan/ownNotes | python/webdav/acp/Privilege.py | Python | gpl-3.0 | 4,423 | 0.007009 |
# Copyright (c) 2017 Microsoft Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publis... | domin1101/malmo-challenge | malmopy/version.py | Python | mit | 1,232 | 0.007305 |
from django.db import models
from django.contrib.auth.models import User
from albaproject.settings import MEDIA_ROOT
import pdb
def _upload_to_generic(prefix_path=None, instance=None, field=None, filename=None):
#pdb.set_trace()
if not instance.pk: # generate DB PK if not present
instance... | marcos-sb/quick-openstacked-hadoop | Alba/albaproject/mapred/models.py | Python | apache-2.0 | 2,416 | 0.009934 |
import collections
from django import forms
from django.forms.util import ErrorDict
from tower import ugettext as _, ugettext_lazy as _lazy
import amo
from amo import helpers
from applications.models import AppVersion
sort_by = (
('', _lazy(u'Keyword Match')),
('updated', _lazy(u'Updated', 'advanced_search_... | jbalogh/zamboni | apps/search/forms.py | Python | bsd-3-clause | 11,040 | 0.000815 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | rajul/tvb-framework | tvb/config/logger/cluster_handler.py | Python | gpl-2.0 | 3,331 | 0.006304 |
"""
===============================================
Demonstration for filling a histogram in a loop
===============================================
A simple, one dimensional histogram is filled in a loop with random
values. The result is than plotted with the build in plot command.
"""
from pyhistogram import Hist
im... | chrisboo/pyhistogram | examples/plot_simple_1D_hist_example.py | Python | gpl-3.0 | 478 | 0 |
import logging
from django.core.management.base import BaseCommand
from waldur_rancher.utils import SyncUser
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = """Sync users from Waldur to Rancher."""
def handle(self, *args, **options):
def print_message(count, action, name='u... | opennode/nodeconductor-assembly-waldur | src/waldur_rancher/management/commands/sync_users.py | Python | mit | 986 | 0.004057 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Canonical
#
# Authors:
# Didier Roche
#
# 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 ... | didrocks/cupstream2distro | cupstream2distro/utils.py | Python | gpl-3.0 | 904 | 0 |
from pythonthegathering import ManaPool, spell
pool = ManaPool()
@spell('WBB')
def boop(x):
print(x)
pool.tap('plains').tap('swamp').tap('swamp')
boop('boop', mana_pool=pool, mana_pay={'W': 1, 'B': 2})
| linky00/pythonthegathering | test.py | Python | mit | 209 | 0.009569 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-28 04:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('atlas_doc', '0007_page_version'),
]
operations = [
migrations.AlterField(
... | robertdown/atlas_docs | atlas_doc/migrations/0008_auto_20170828_0043.py | Python | gpl-3.0 | 461 | 0 |
#!/usr/bin/env python
import math
fin = open('figs/single-rod-in-water.dat', 'r')
fout = open('figs/single-rods-calculated-density.dat', 'w')
kB = 3.16681539628059e-6 # This is Boltzmann's constant in Hartree/Kelvin
first = 1
nm = 18.8972613
for line in fin:
current = str(line)
pieces = current.split('\t')... | droundy/deft | papers/hughes-saft/figs/density_calc.py | Python | gpl-2.0 | 986 | 0.004057 |
from flask_user import login_required
from app.API_Rest.Services.BaseService import BaseService
from app.models.generadorJSON.respuestas_encuestas_generadorJSON import generarJSON_encuesta_alumno
from app.models.respuestas_encuesta_models import EncuestaAlumno, RespuestaEncuestaTematica, RespuestaEncuestaTags
from app.... | jennywoites/MUSSA | MUSSA_Flask/app/API_Rest/Services/AlumnoServices/EncuestaAlumnoService.py | Python | gpl-3.0 | 6,276 | 0.002709 |
#!/usr/bin/env python
from nipype.interfaces.io import FreeSurferSource, DataSink
from nipype.interfaces.utility import IdentityInterface
from nipype import Workflow, Node, MapNode, JoinNode, Function
import nibabel as nib
import numpy as np
import os
import surfdist as sd
import csv
def trimming(itemz, phrase):
it... | margulies/surfdist | nipype/surfdist_nipype.py | Python | mit | 8,586 | 0.02737 |
# -*- test-case-name: twisted.test.test_ftp -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An FTP protocol implementation
@author: Itamar Shtull-Trauring
@author: Jp Calderone
@author: Andrew Bennetts
"""
# System Imports
import os
import time
import re
import operator
impo... | eunchong/build | third_party/twisted_10_2/twisted/protocols/ftp.py | Python | bsd-3-clause | 93,283 | 0.002969 |
"""Setup for HDD-indexer
This module provides the setup for ``hdd-indexer`` by downloading its
`dependencies`, creating the `database`, createing a sampel `user`.
Usage:
$ python setup.py
Dependencies:
The dependencies are installed with pip.
$ pip install -r requirements.txt
Database:
The d... | coolharsh55/hdd-indexer | setup.py | Python | mit | 8,480 | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | dayatz/taiga-back | taiga/celery.py | Python | agpl-3.0 | 1,321 | 0.000758 |
import numpy as np
from menpo.base import Targetable, Vectorizable
from menpo.model import MeanInstanceLinearModel
from menpofit.differentiable import DP
def similarity_2d_instance_model(shape):
r"""
A MeanInstanceLinearModel that encodes all possible 2D similarity
transforms of a 2D shape (of n_points).... | mrgloom/menpofit | menpofit/modelinstance.py | Python | bsd-3-clause | 11,665 | 0.000171 |
import time
import datetime
import sqlite3
import urllib
import gzip
import urllib2
import StringIO
import sickbeard
from sickbeard import db
from sickbeard import logger
from sickbeard.common import *
class TVCache():
def __init__(self, providerName):
self.providerName = pr... | mattsch/Sickbeard | sickbeard/tvcache.py | Python | gpl-3.0 | 1,097 | 0.012762 |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
#
# 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.
#
... | ekohl/ganeti | lib/opcodes.py | Python | gpl-2.0 | 47,432 | 0.005081 |
import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, json_output
@click.command('run_workflow')
@click.argument("workflow_id", type=str)
@click.option(
"--dataset_map",
help="A mapping of workflow inputs to datasets. The datasets source can be a LibraryD... | galaxy-iuc/parsec | parsec/commands/workflows/run_workflow.py | Python | apache-2.0 | 4,029 | 0.001986 |
import copy
import secrets
races = {}
colors = {
'🐶': 0xccd6dd,
'🐱': 0xffcb4e,
'🐭': 0x99aab5,
'🐰': 0x99aab5,
'🐙': 0x9266cc,
'🐠': 0xffcc4d,
'🦊': 0xf4900c,
'🦀': 0xbe1931,
'🐸': 0x77b255,
'🐧': 0xf5f8fa
}
names = {
'🐶': 'dog',
'🐱': 'cat',
'🐭': 'mouse',
... | AXAz0r/apex-sigma-core | sigma/modules/minigames/racing/nodes/race_storage.py | Python | gpl-3.0 | 1,238 | 0 |
#!/usr/bin/python3
import tornado.ioloop
import tornado.options
import tornado.httpserver
from routes import routes_setup
import settings
clients = []
if __name__ == '__main__':
tornado.options.parse_command_line()
tornado.options.define('log_file_max_size', default=str(10*1024*1024))
tornado.options.de... | andrewisakov/taximaster_x | router/main.py | Python | unlicense | 572 | 0 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EmailShareStatistic'
db.create_table('statistic_emailsharestatistic', (
('... | ujdhesa/unisubs | apps/statistic/migrations/0001_initial.py | Python | agpl-3.0 | 10,707 | 0.008219 |
# Copyright (c) 2017-present, Facebook, 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... | facebookresearch/Detectron | detectron/datasets/cityscapes_json_dataset_evaluator.py | Python | apache-2.0 | 3,355 | 0 |
'''
New Integration Test for hybrid.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
test_obj_dict = test_state.TestStateDict()
test_stub = test_lib.lib_get_test_stub()
hybrid = test_stu... | zstackorg/zstack-woodpecker | integrationtest/vm/hybrid/test_add_iz.py | Python | apache-2.0 | 623 | 0.004815 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# This file is in the public domain
### END LICENSE
"""Provides a shared preferences dictionary"""
from desktopcouch.records.server import CouchDatabase
from desktopcouch.records.record import Record
import gtk
import gobject... | nickpascucci/Robot-Arm | software/desktop/brazo/brazo_lib/preferences.py | Python | mit | 3,116 | 0.007702 |
import sqlite3
import os
def init():
"""
Creates and initializes settings database.
Doesn't do anything if the file already exists. Remove the local copy to recreate the database.
"""
if not os.path.isfile("settings.sqlite"):
app_db_connection = sqlite3.connect('settings.sqlite')
... | Pasotaku/Anime-Feud-Survey-Backend | Old Python Code/settings_db_init.py | Python | mit | 617 | 0.001621 |
"""autogenerated by genpy from outdoor_bot/mainTargetsCommand_msg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class mainTargetsCommand_msg(genpy.Message):
_md5sum = "b1faa92c8dffb7694c609d94e4e2d116"
_type = "outdoor_bot/mainTargetsCommand_ms... | dan-git/outdoor_bot | src/outdoor_bot/msg/_mainTargetsCommand_msg.py | Python | bsd-2-clause | 4,588 | 0.017873 |
import jinja2
from jingo import register
from tower import ugettext_lazy as _lazy
from mkt.site.helpers import page_title
@register.function
@jinja2.contextfunction
def operators_page_title(context, title=None):
section = _lazy('Operator Dashboard')
title = u'%s | %s' % (title, section) if title else sectio... | jamesthechamp/zamboni | mkt/operators/helpers.py | Python | bsd-3-clause | 360 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
group_and_permission = [
("超级管理员", [], ['all']),
("运营部", ['Can change teacher'],
[
# 待上架, 已上架老师, 老师编辑
'teachers_unpublished',
'teachers_published',
'teachers_unpublished_e... | malaonline/Server | server/app/migrations/0186_change_user_group.py | Python | mit | 7,213 | 0.000161 |
from unittest import TestCase
from intent.igt.rgxigt import RGIgt
class ConstructIGTTests(TestCase):
def setUp(self):
self.lines = [{'text':'This is a test','tag':'L'},
{'text':'blah blah blah blah','tag':'G'}]
def test_add_raw_lines(self):
inst = RGIgt(id='i1')
... | rgeorgi/intent | intent/tests/instance_construction_tests.py | Python | mit | 718 | 0.009749 |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / Hildo Guillardi Júnior
#
# 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 with... | xesscorp/KiCost | kicost/distributors/__init__.py | Python | mit | 3,347 | 0.000299 |
import subprocess
import shutil
from unittest import TestCase
if shutil.which('flake8'):
class TestCodeQuality(TestCase):
def test_flake8(self):
self.assertEqual(0, subprocess.call('flake8'))
else:
print("I: skipping flake8 test (flake8 not available)")
| Linaro/squad | test/test_code_quality.py | Python | agpl-3.0 | 285 | 0 |
#!/usr/bin/env python
import ROOT as r
def setTextBoxAttributes(text, color, font):
text.SetTextColor(color)
text.SetTextAlign(13)
text.SetTextSize(0.04)
text.SetTextFont(font)
def dress(canv, colors):
# need this to keep the objects alive
objs = []
vub_inc = r.TLatex(0.16,0.655,"V_{ub} inclusive")
... | matthewkenzie/gammacombo | scripts/plotModuleExample.py | Python | gpl-3.0 | 1,823 | 0.044981 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## Copyright © 2007-2012, Matthias Urlichs <matthias@urlichs.de>
##
## 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 L... | smurfix/HomEvenT | test/mod_path.py | Python | gpl-3.0 | 1,386 | 0.025271 |
from django.core.validators import validate_email
from django import forms
from captcha.fields import ReCaptchaField
from .models import ContactUs
class CreateContact(forms.ModelForm):
captcha = ReCaptchaField()
class Meta:
model = ContactUs
fields = '__all__'
widgets = {
... | emanuelcovaci/TLT | blog/contact/forms.py | Python | agpl-3.0 | 1,487 | 0.000672 |
# -*- coding: utf-8 -*-
# django-simple-help
# simple_help/admin.py
from __future__ import unicode_literals
from django.contrib import admin
try: # add modeltranslation
from modeltranslation.translator import translator
from modeltranslation.admin import TabbedDjangoJqueryTranslationAdmin
except ImportErro... | DCOD-OpenSource/django-simple-help | simple_help/admin.py | Python | mit | 1,108 | 0.000903 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2013, IOhannes m zmölnig, IEM
# This file is part of WILMix
#
# 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 th... | iem-projects/WILMAmix | WILMA/net/resolv.py | Python | gpl-2.0 | 2,201 | 0.011369 |
# coding=UTF-8
"""
Tests courseware views.py
"""
import unittest
from datetime import datetime
from mock import MagicMock, patch
from pytz import UTC
from django.test import TestCase
from django.http import Http404
from django.test.utils import override_settings
from django.contrib.auth.models import User, AnonymousU... | morenopc/edx-platform | lms/djangoapps/courseware/tests/test_views.py | Python | agpl-3.0 | 21,213 | 0.002641 |
# ------------------------------------------------------------------------------
# This extension adds support for Jinja templates.
# ------------------------------------------------------------------------------
import sys
from ivy import hooks, site, templates
try:
import jinja2
except ImportError:
jinja2 =... | dmulholland/ivy | ivy/ext/ivy_jinja.py | Python | unlicense | 1,779 | 0.000562 |
from django import forms
from django.forms import Form, ModelForm
from django.utils import timezone
from webapp.models import Task, TaskGroup, TaskGroupSet
from webapp.validators import validate_package
from webapp.widgets import CustomSplitDateTimeWidget
class TaskGroupForm(ModelForm):
class Meta:
model... | algochecker/algochecker-web | webapp/forms.py | Python | mit | 6,858 | 0.001896 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 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... | Brocade-OpenSource/OpenStack-DNRM-Neutron | neutron/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py | Python | apache-2.0 | 2,023 | 0.001483 |
from django.contrib import admin
from django.utils.encoding import smart_text
from import_export.admin import ExportMixin
from remo.dashboard.models import ActionItem
def encode_action_item_names(modeladmin, request, queryset):
for obj in queryset:
ActionItem.objects.filter(pk=obj.id).update(name=smart_... | tsmrachel/remo | remo/dashboard/admin.py | Python | bsd-3-clause | 835 | 0 |
#!/usr/bin/env python
#
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Prepares the Google Play services split client libraries before usage by
Chrome's build system.
We need to preprocess Google Play... | geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/build/android/play_services/preprocess.py | Python | gpl-3.0 | 9,974 | 0.008823 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Used to access the cr50 console and handle RMA Open
"""Open cr50 using RMA authentication.
Run RMA Open ... | coreboot/chrome-ec | extra/cr50_rma_open/cr50_rma_open.py | Python | bsd-3-clause | 26,490 | 0.000227 |
""" pydatastream main module
(c) Vladimir Filimonov, 2013 - 2021
"""
import warnings
import json
import math
from functools import wraps
import requests
import pandas as pd
###############################################################################
_URL = 'https://product.datastream.com/dswsclient/V1/DSServic... | vfilimonov/pydatastream | pydatastream/pydatastream.py | Python | mit | 32,857 | 0.002404 |
# coding=utf-8
# Copyright 2017 The DLT2T 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 or ... | renqianluo/DLT2T | DLT2T/utils/registry_test.py | Python | apache-2.0 | 7,045 | 0.008375 |
salario = float(raw_input())
print(salario + (salario * 0.78)) | matheusmonte/PythonScripts | Salario078.py | Python | mit | 62 | 0.016129 |
# Copyright (c) 2013 Mirantis 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 writi... | TechJournalist/stackalytics | tests/unit/test_web_utils.py | Python | apache-2.0 | 3,954 | 0.000506 |
from __future__ import print_function
import numpy as np
from landlab import ModelParameterDictionary
from landlab.core.model_parameter_dictionary import MissingKeyError, ParameterValueError
from landlab.field.scalar_data_fields import FieldError
from landlab.grid.base import BAD_INDEX_VALUE
class StreamPowerEroder(... | decvalts/landlab | landlab/components/stream_power/stream_power.py | Python | mit | 17,514 | 0.010049 |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 09 10:39:38 2015
@author: 108630
"""
import os
import numpy as np
import pandas as pd
from scipy.stats import multivariate_normal, norm
from dtocean_core.utils.moorings import get_moorings_tables
# Note that the electrical folder in the test_data directory should be
#... | DTOcean/dtocean-core | example_data/fixed_tidal_fixed_layout_10_scenario.py | Python | gpl-3.0 | 31,371 | 0.008288 |
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# 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
#
# ... | openstack/neutron-lib | neutron_lib/api/definitions/segment.py | Python | apache-2.0 | 4,049 | 0 |
#
# usage: python k67.py {alias}
#
import sys
import pymongo
def find_aliases(alias):
cn = pymongo.MongoClient().MusicBrainz.artist
return [a for a in cn.find({'aliases.name': alias})]
if __name__ == '__main__':
n = sys.argv[1]
for a in find_aliases(n):
print(a)
| wtsnjp/nlp100 | chap07/k67.py | Python | unlicense | 290 | 0.006897 |
from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.active()
if not request.session.get('currency'):
try:
currency = Currency.objects.get(is_default__exact=True)
except Currency.DoesNotExist:
currency = None
request.ses... | barseghyanartur/django-currencies | currencies/context_processors.py | Python | bsd-3-clause | 450 | 0 |
"""!
@brief Cluster analysis algorithm: Expectation-Maximization Algorithm for Gaussian Mixture Model.
@details Implementation based on paper @cite article::ema::1.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import numpy
import random
from pycluster... | annoviko/pyclustering | pyclustering/cluster/ema.py | Python | gpl-3.0 | 28,795 | 0.010662 |
import itertools
from batchy.runloop import coro_return, runloop_coroutine
from batchy.batch_coroutine import batch_coroutine, class_batch_coroutine
from . import BaseTestCase
CALL_COUNT = 0
@batch_coroutine()
def increment(arg_lists):
def increment_single(n):
return n + 1
global CALL_COUNT
CAL... | mikekap/batchy | tests/batch_tests.py | Python | apache-2.0 | 4,519 | 0.002213 |
import Sofa
import random
from cmath import *
############################################################################################
# this is a PythonScriptController example script
############################################################################################
###################################... | FabienPean/sofa | applications/plugins/BulletCollisionDetection/examples/PrimitiveCreation.py | Python | lgpl-2.1 | 9,475 | 0.054142 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... | skarphed/skarphed | core/lib/database.py | Python | agpl-3.0 | 15,700 | 0.008153 |
"""Admin functionality for services."""
from django.contrib import admin
from django.contrib.admin import site
from leaflet.admin import LeafletGeoAdmin
from .models import Service, ServiceImage
class ServiceImageInline(admin.TabularInline):
"""The inline for service images."""
model = ServiceImage
ex... | empowerhack/HealthMate | healthmate/services/admin.py | Python | mit | 530 | 0 |
"""
@package mi.dataset.parser.test
@file mi/dataset/parser/test/test_nutnr_m_glider.py
@author Emily Hahn
@brief A test parser for the nutnr series m instrument through a glider
"""
import os
from nose.plugins.attrib import attr
from mi.core.exceptions import SampleException, ConfigurationException, DatasetParserExce... | oceanobservatories/mi-instrument | mi/dataset/parser/test/test_nutnr_m_glider.py | Python | bsd-2-clause | 7,448 | 0.003894 |
#!/usr/bin/python
# Import System Required Paths
import sys
sys.path.append('/usr/local/src/volatility-master')
# Import Volalatility
import volatility.conf as conf
import volatility.registry as registry
registry.PluginImporter()
config = conf.ConfObject()
import volatility.commands as commands
import volatility.addr... | muscatmat/vmi-event-naive-detector | scripts/check_creds.py | Python | mit | 972 | 0.012346 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.