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 |
|---|---|---|---|---|---|
from ssms import app
from flask import render_template
from flask import request
from flask import url_for
from flask import redirect
from flask import Response
from flask import send_file
from flask import session
from flask import escape
from flask import g
from werkzeug import secure_filename
# built in:
from date... | a-r-d/ssms | ssms/routes/playlist.py | Python | mit | 4,545 |
# Yith Library Server is a password storage server.
# Copyright (C) 2015 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | lorenzogil/yith-library-server | wsgi.py | Python | agpl-3.0 | 1,537 |
# Copyright 2015-2021 Mathieu Bernard
#
# This file is part of phonemizer: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Phonemizer is distributed ... | bootphon/phonemizer | phonemizer/backend/base.py | Python | gpl-3.0 | 8,240 |
from suplemon import helpers
from suplemon.linelight.color_map import color_map
class Syntax:
def get_comment(self, line):
return ("", "")
def get_color(self, raw_line):
color = color_map["white"]
line = raw_line.strip()
if helpers.starts(line, ["{", "}"]):
color =... | twolfson/suplemon | suplemon/linelight/json.py | Python | mit | 442 |
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011-2016 Serge Noiraud
#
# 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... | gramps-project/gramps | gramps/plugins/lib/maps/osmgps.py | Python | gpl-2.0 | 23,674 |
# Copyright 2015 Matthew Pelland (matt@pelland.io)
#
# 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 ... | wolfier/incubator-airflow | airflow/contrib/auth/backends/github_enterprise_auth.py | Python | apache-2.0 | 7,919 |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2012 Rackspace Hosting
# 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
#
# ... | zestrada/nova-cs498cc | nova/cmd/cells.py | Python | apache-2.0 | 1,373 |
# swift_build_support/products/llvm.py --------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | amraboelela/swift | utils/swift_build_support/swift_build_support/products/llvm.py | Python | apache-2.0 | 2,121 |
import sys
from protocol.swg.objectControllerObjects import BiographyUpdate
from protocol.swg import ObjControllerMessage
def setup():
return
def run(core, actor, target, commandString):
if actor is None:
return
if len(commandString) > 200:
return
ghost = actor.getSlottedObject('ghost')
if ghost is No... | ProjectSWGCore/NGECore2 | scripts/commands/setbiography.py | Python | lgpl-3.0 | 569 |
"""Support for LiteJet lights."""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_TRANSITION,
SUPPORT_BRIGHTNESS,
SUPPORT_TRANSITION,
LightEntity,
)
from .const import CONF_DEFAULT_TRANSITION, DOMAIN
_LOGGER = logging.getLogger(__name__)
ATTR_NUMBER = "number"
... | jawilson/home-assistant | homeassistant/components/litejet/light.py | Python | apache-2.0 | 4,033 |
__author__ = 'Bohdan Mushkevych'
from threading import RLock
from bson import ObjectId
from db.model.site_statistics import SiteStatistics, DOMAIN_NAME, TIMEPERIOD
from synergy.db.manager import ds_manager
from synergy.system.decorator import thread_safe
class SiteDao(object):
""" Thread-safe Data Access Objec... | mushkevych/scheduler | db/dao/site_dao.py | Python | bsd-3-clause | 2,001 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import string
import glob
import sys
import codecs
from subprocess import Popen
work_dir = os.getcwd()
script_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(script_dir)
project_dir = '../'
proto_dir = './proto_v3'
header_dir = os.path.join(project_... | xresloader/xresloader | sample/gen_protocol_v3.py | Python | mit | 1,744 |
from __future__ import unicode_literals
from .common import SRPSessionBase
if False: # pragma: no cover
from .context import SRPContext
class SRPClientSession(SRPSessionBase):
role = 'client'
def __init__(self, srp_context, private=None):
"""
:param SRPContext srp_context:
:pa... | idlesign/srptools | srptools/client.py | Python | bsd-3-clause | 1,331 |
"""
Sanic-Cors example
===================
This is a tiny Sanic Application demonstrating Sanic-Cors, making it simple
to add cross origin support to your sanic app!
:copyright: (c) 2022 by Ashley Sommer (based on flask-cors by Cory Dolphin).
:license: MIT/X11, see LICENSE for more details.
"""
from sanic import San... | ashleysommer/sanic-cors | examples/view_based_example.py | Python | mit | 3,533 |
# Copyright 2015-2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | Tehsmash/networking-cisco | networking_cisco/plugins/ml2/drivers/cisco/ucsm/ucsm_model.py | Python | apache-2.0 | 2,376 |
#!/usr/bin/python
import os
import re
import sys
import time
import boto
import hashlib
# md5 function
def md5_for_file(filepath, block_size=2**20):
f = open(filepath, 'rb')
md5 = hashlib.md5()
while True:
data = f.read(block_size)
if not data:
break
md5.update(data)... | jjshoe/s3-cloudfront-upload-and-invalidate | s3-cloudfront-upload-and-invalidate.py | Python | agpl-3.0 | 4,503 |
#! /usr/bin/env python
from pyDFTutils.vasp.vasp_utils import read_poscar_and_unsort
import ase.calculators.vasp.create_input
if 'maskcell' not in ase.calculators.vasp.create_input.int_keys:
ase.calculators.vasp.create_input.int_keys.append('maskcell')
from ase.calculators.vasp import Vasp, Vasp2
from ase.dft.kpoi... | mailhexu/pyDFTutils | pyDFTutils/vasp/myvasp.py | Python | lgpl-3.0 | 29,832 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
human_curl.core
~~~~~~~~~~~~~~~
Heart of human_curl library
:copyright: Copyright 2011 - 2012 by Alexandr Lispython (alex@obout.ru).
:license: BSD, see LICENSE for more details.
"""
import time
from os.path import exists as file_exists
from logging import getLogger... | llange/human_curl | human_curl/core.py | Python | bsd-3-clause | 30,866 |
# -*- 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 'DeprecatedAppliedMigrations'
db.delete_table('applied_m... | AdaEne/CATMAID | django/applications/catmaid/migrations/0047_auto__del_deprecatedappliedmigrations__del_deprecatedsession.py | Python | gpl-3.0 | 36,251 |
# -*- coding: UTF-8 -*-
"""
This module implements the core ML algorithm of gender classification.
"""
from copy import copy
import os
import pickle
from time import time
import numpy as np
import tensorflow as tf
from sklearn.metrics import accuracy_score, classification_report
from tensorflow.contrib.tensorboard.plu... | kensk8er/chicksexer | chicksexer/classifier.py | Python | mit | 23,707 |
# encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
from authentic2.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'UserConsent'
db.delete_table('idp_userconsent')
# Adding model 'UserCo... | adieu/authentic2 | authentic2/idp/migrations/0002_auto__del_userconsent__add_userconsentattributes.py | Python | agpl-3.0 | 3,967 |
import socket
import sys
import argparse
import threading
import time
import select
def parse(response):
first_space = response.find(" ")
if first_space < 0:
return response, ""
else:
code = response[:first_space]
return code, response[first_space + 1:]
class RequestHandler(thread... | kumpelblase2/rn | Aufgabe1/server/server.py | Python | mit | 5,409 |
#-------------------------------------------------------------------------------
# Copyright (c) 2013 "Matteo Martelli".
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Public License v2.0
# which accompanies this distribution, and is available at
# htt... | matteomartelli/tabu | tabu/__init__.py | Python | gpl-2.0 | 573 |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.fields import RichTextField
from mezzanine.core.models import Orderable, Ri... | wbtuomela/mezzanine | mezzanine/forms/models.py | Python | bsd-2-clause | 4,939 |
# -*- coding: utf-8 -*-
"""
Datary commits Module
"""
from .commits import DataryCommits
| Datary/python-sdk | datary/commits/__init__.py | Python | mit | 89 |
#
# (c) 2016 Red Hat Inc.
#
# 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 License, or
# (at your option) any later version.
#
# Ansible is d... | rmfitzpatrick/ansible | lib/ansible/plugins/action/ce.py | Python | gpl-3.0 | 3,804 |
# -*- coding: utf-8 -*-
u"""Common execution template.
:copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcompat
from pykern import pkio
from pykern impor... | mkeilman/sirepo | sirepo/template/template_common.py | Python | apache-2.0 | 23,341 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
hpp_tmpl="""#ifndef __FRAGMENT_HPP__
#define __FRAGMENT_HPP__
// This file was auto generated by cppite, should not edit it by hands
#include <string>
// linux int type define; should be remove/add by system dependent in the future version.
#include <stdint.h>
{includ... | aceway/cppite | src/py/cpp_fragment_tmpl.py | Python | mit | 597 |
import numpy as np
class User(object):
'''
A user model that clicks on documents and stops based on relevance.
Args:
click_probs: [p0, p1, ...]. pi is probability of clicking on grade i
stop_probs: [p0, p1, ...]. pi is probability of stopping at grade i
'''
def __init__(self, cli... | mpkato/interleaving | interleaving/simulation/user.py | Python | mit | 1,254 |
#!/usr/bin/python
# (c) 2015-2021, Sergei Antipov
#
# 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 License, or
# (at your option) any later ... | UnderGreen/ansible-role-mongodb | library/mongodb_replication.py | Python | gpl-2.0 | 19,598 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Execute Patch Files
To run directly
python lib/wnf.py patch patch1, patch2 etc
python lib/wnf.py patch -f patch1, patch2 etc
where patch1, patch2 is module name
... | gangadhar-kadam/nassimlib | webnotes/modules/patch_handler.py | Python | mit | 3,605 |
class Solution(object):
def permute(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
perms = [[]]
for n in nums:
new_perms = []
for perm in perms:
for i in xrange(len(perm) + 1):
new_perms.... | Jspsun/LEETCodePractice | Python/Permutations.py | Python | mit | 461 |
from typing import NamedTuple
from kfp.components import create_component_from_func
def automl_deploy_model(
model_path: str,
) -> NamedTuple('Outputs', [
('model_path', str),
]):
"""Deploys a trained model.
Args:
model_path: The resource name of the model to export. Format: 'projects/<projec... | kubeflow/pipelines | components/gcp/automl/deploy_model/component.py | Python | apache-2.0 | 1,328 |
import tornado.websocket
from tornado import gen
import json
import sys
import logging
import traceback
import gc
from fabscan.FSEvents import FSEvents
from fabscan.lib.util.FSUtil import json2obj
import asyncio
class FSWebSocketHandler(tornado.websocket.WebSocketHandler):
def __init__(self, *args, **kwargs):
... | mariolukas/FabScanPi-Server | src/fabscan/server/services/websocket/FSWebSocketHandler.py | Python | gpl-2.0 | 3,040 |
#!/usr/bin/env python
"""
Setup file for pyddq.
This file was generated with PyScaffold 2.5.6, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import sys
import os
import glob
import subprocess
from setuptools import setup, Co... | FRosner/drunken-data-quality | python/setup.py | Python | apache-2.0 | 1,956 |
import click
from pbench.cli.agent import CliContext
def common_options(f):
f = _pbench_agent_config(f)
return f
def _pbench_agent_config(f):
"""Option for agent configuration"""
def callback(ctx, param, value):
clictx = ctx.ensure_object(CliContext)
clictx.config = value
r... | portante/pbench | lib/pbench/cli/agent/options.py | Python | gpl-3.0 | 768 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Renato Lima - Akretion
# Copyright (C) 2015 Luis Felipe Mileo - KMEE
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import re
import string
def punctuation_rm(string_value):
tmp_value = (
re.sub('[%s]' % re.escape(string.punctuation), '', s... | rvalyi/l10n-brazil | l10n_br_base/tools/misc.py | Python | agpl-3.0 | 531 |
"""
Copyright (c) 2016-2017, Kir Chou
https://github.com/note35/sinon/blob/master/LICENSE
"""
from .util import ErrorHandler
from .spy import SinonSpy
class SinonAssertion(object):
"""
assertion is an API for external to verify inspector(s)
"""
failException = AssertionError
message = ""
@cla... | note35/sinon | sinon/lib/assertion.py | Python | bsd-2-clause | 6,883 |
import torch
from allennlp.common.registrable import Registrable
class SpanExtractor(torch.nn.Module, Registrable):
"""
Many NLP models deal with representations of spans inside a sentence.
SpanExtractors define methods for extracting and representing spans
from a sentence.
SpanExtractors take ... | allenai/allennlp | allennlp/modules/span_extractors/span_extractor.py | Python | apache-2.0 | 2,656 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import time
from math import isinf
from indico.util.console import cformat
class Benchmark:
"""Simp... | pferreir/indico | indico/util/benchmark.py | Python | mit | 1,806 |
# -*- coding: utf-8 -*-
"""
Base Class for InvenTree plugins
"""
import warnings
from django.db.utils import OperationalError, ProgrammingError
from django.utils.text import slugify
class InvenTreePluginBase():
"""
Base class for a plugin
DO NOT USE THIS DIRECTLY, USE plugin.IntegrationPluginBase
"""... | inventree/InvenTree | InvenTree/plugin/plugin.py | Python | mit | 2,145 |
"""
WSGI config for dtwt 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", "dtwt.settings")
from django.core.wsgi im... | theju/dtwt | dtwt/wsgi.py | Python | mit | 383 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-08-06 21:08
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('minos', '0018_rule'),
]
operations = [
migr... | TomWerner/HawkeyeChallenge | minos/migrations/0019_auto_20160806_1708.py | Python | mit | 1,219 |
#!/usr/bin/env python2
# Copyright (c) 2019 Erik Schilling
# 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 ... | mpeuster/son-emu | src/emuvim/api/osm/nbi.py | Python | apache-2.0 | 7,633 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-10 16:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | amirm3hdi/donate-clan | account/migrations/0002_auto_20180310_1624.py | Python | gpl-3.0 | 699 |
import falcon
import mongoengine as mongo
# Resources
from resources.post.controller import post
from resources.author.controller import author
# Middleware
import middlewares
# Init falcon app
app = falcon.API(middleware=[
middlewares.JSONTranslator()
])
# DB
mongo.connect('admin')
# Routes
app.add_route('/au... | famoraes/falcon-api | src/app.py | Python | apache-2.0 | 440 |
import Orange
from collections import Counter
data = Orange.data.Table("lenses")
print Counter(str(d.get_class()) for d in data)
| qPCR4vir/orange | docs/tutorial/rst/code/data-instances4.py | Python | gpl-3.0 | 130 |
from .daq_device_info import DaqDeviceInfo
from .ai_info import AiInfo
from .ao_info import AoInfo
from .ctr_info import CtrInfo
from .daqi_info import DaqiInfo
from .daqo_info import DaqoInfo
from .dio_info import DioInfo
__all__ = ['DaqDeviceInfo', 'AiInfo', 'AoInfo', 'CtrInfo', 'DaqiInfo',
'DaqoInfo', 'D... | mccdaq/mcculw | mcculw/device_info/__init__.py | Python | mit | 329 |
import __builtin__
import getopt
import sys
import os
from CMException import CMException
dir_name = os.path.dirname(os.path.realpath(__file__)) + '/tools/'
sys.path.append(dir_name)
toolsModule = __import__('Tools')
func = getattr(toolsModule, 'Tools')
allFun = filter(lambda fun: fun[0] != '_', dir(func))
def usage... | hero78119/account-management-deploy-system | src/Main.py | Python | mit | 1,905 |
import os
import sys
import click
from alertaclient.api import Client
from alertaclient.auth.utils import get_token
from alertaclient.config import Config
CONTEXT_SETTINGS = dict(
auto_envvar_prefix='ALERTA',
default_map={'query': {'compact': True}},
help_option_names=['-h', '--help'],
)
cmd_folder = os.... | alerta/python-alerta-client | alertaclient/cli.py | Python | apache-2.0 | 2,859 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "aesarc.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Prillan/aesarc-server | aesarc/manage.py | Python | gpl-2.0 | 249 |
#! /usr/bin/python3
''' This module defines some constants for DDStorm '''
'''
Copyright (c) 2015 Agnibho Mondal
All rights reserved
This file is part of DDStorm.
DDStorm 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 Fou... | agnibho/ddstorm | const.py | Python | gpl-3.0 | 972 |
import os
from opsbro.collector import Collector
class Blockdevice(Collector):
def launch(self):
self.logger.debug('getBlockdevice: start')
res = {}
if not os.path.exists('/sys/block/'):
self.set_not_eligible('This collector is only availabe on linux')
return res
... | naparuba/kunai | data/global-configuration/packs/system/collectors/collector_blockdevice.py | Python | mit | 1,511 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com)
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 Softwar... | xbmcmegapack/plugin.video.megapack.dev | resources/lib/menus/home_languages_greek.py | Python | gpl-3.0 | 1,107 |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
An aggregator of sensors values
Created on 10 juil. 2012
:author: Thomas Calmant
"""
# ------------------------------------------------------------------------------
from pelix.ipopo import constants
from pelix.ipopo.decorators import ComponentFactory, Prov... | isandlaTech/cohorte-demos | temper/src/aggregator/aggregator.py | Python | apache-2.0 | 6,713 |
#
# Copyright 2015 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# Megara DRP 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) an... | Pica4x6/megaradrp | megaradrp/tests/test_products.py | Python | gpl-3.0 | 2,054 |
from datetime import datetime, timedelta
from fixture import DataSet
from tests.fixtures.dummy.unixaccount import UserData
from tests.fixtures.dummy.property import PropertyGroupData
class MembershipData(DataSet):
class dummy_membership:
begins_at = datetime.utcnow() - timedelta(1)
ends_at = dat... | lukasjuhrich/pycroft | tests/fixtures/ldap_sync/simple.py | Python | apache-2.0 | 820 |
"calculate and save 1D force profiles for 2D Howorka pore for different molecule charges"
import os, numpy, dolfin
import nanopores, Howorka
import matplotlib.pyplot as plt
from collections import OrderedDict
#from nanopores import kB, T, add_params, save_dict, saveplots, showplots
#from matplotlib.pyplot import figur... | mitschabaude/nanopores | scripts/numerics/force_profiles.py | Python | mit | 6,067 |
from cardboard import types
from cardboard.ability import (
AbilityNotImplemented, spell, activated, triggered, static
)
from cardboard.cards import card, common, keywords, match
@card("Maze of Ith")
def maze_of_ith(card, abilities):
def maze_of_ith():
return AbilityNotImplemented
return maze_of... | Julian/cardboard | cardboard/cards/sets/the_dark.py | Python | mit | 21,179 |
''' dbrev.database can be thought of as a bean or a template. It
has only attributes with getters and setters.
'''
import logging
LOG = logging.getLogger(__name__)
# LOG.setLevel(logging.INFO)
# Long lines expected.
# pylint: disable=C0301
# Cyclic imports protected by functions
# pylint: disable=R0401
class Da... | genevolv/dbrev | py/freevolv/models/dbrev/database.py | Python | bsd-2-clause | 4,409 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10a1 on 2016-06-30 01:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0037_auto_20160628_2150'),
]
operations = [
migrations.RenameF... | DLance96/ox-dashboard | dashboard/migrations/0038_auto_20160630_0154.py | Python | mit | 1,246 |
"""hominem URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | eponsko/you2rss | hominem/urls.py | Python | gpl-3.0 | 1,141 |
#import pythonista | yueqiw/ophys-game-ios | __init__.py | Python | gpl-3.0 | 18 |
import furl
from urlparse import urlparse
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from framework.guid.model import Guid
from website.addons.wiki.model import NodeWikiPage
from tests.base import ApiWikiTestCase
from tests.factories import (ProjectFactory, Registration... | rdhyee/osf.io | api_tests/wikis/views/test_wiki_detail.py | Python | apache-2.0 | 14,309 |
#!/usr/bin/env python
"""Example code of learning a large scale convnet from ILSVRC2012 dataset.
Prerequisite: To run this example, crop the center of ILSVRC2012 training and
validation images and scale them to 256x256, and make two lists of space-
separated CSV whose first column is full path to image and second colu... | ttakamura/chainer | examples/imagenet/train_imagenet.py | Python | mit | 9,557 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ElectrumTestFramework
from test_framework.util import *
from b... | sinraf96/electrum | qa/rpc-tests/getblocktemplate_proposals.py | Python | mit | 5,497 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | magic/sky/skysubtractor.py | Python | agpl-3.0 | 49,497 |
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
from commandment.mdm.schema import CommandSchema
from commandment.models import db, Command
class CommandsList(ResourceList):
schema = CommandSchema
data_layer = {
'session': db.session,
'model': Command,
}
... | mosen/commandment | commandment/mdm/resources.py | Python | mit | 638 |
import numpy as np
from bokeh.core.enums import MarkerType
from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid
from bokeh.models.markers import Scatter
from bokeh.io import curdoc, show
N = len(MarkerType)
x = np.linspace(-2, 2, N)
y = x**2
markers = list(MarkerType)
source = ColumnDataSource(dict(x=x,... | stonebig/bokeh | examples/reference/models/Scatter.py | Python | bsd-3-clause | 815 |
# 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
# d... | coreycb/horizon | openstack_dashboard/test/integration_tests/pages/loginpage.py | Python | apache-2.0 | 3,628 |
import json
from django.core.management.base import BaseCommand
from models_project import models
class Command(BaseCommand):
help = 'Commands for project'
def show_groups(self, *args, **options):
"""
command for run:
python manage.py commands show_groups
"""
return j... | polinaleonova/Project_Students_DB | main/management/commands/commands.py | Python | mit | 915 |
# Copyright (C) 2013 Google Inc.
# 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 th... | mispencer/YouCompleteMe | python/ycm/tests/syntax_parse_test.py | Python | gpl-3.0 | 14,600 |
# Copyright 2017, Internet Solutions.
#
# 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 ... | drifterza/oss-ansible-oracle_database | setup.py | Python | apache-2.0 | 1,004 |
from django.contrib.auth.models import User
from django.db import models
from oauth2client.django_orm import FlowField
from oauth2client.django_orm import CredentialsField
class Flow(models.Model):
"""
class to save flow objects in a multitreaded environment
"""
id = models.ForeignKey(User, prima... | rochapps/django-google-oauth | google_oauth/models.py | Python | bsd-3-clause | 545 |
import glob
import numpy as np
files = glob.glob('*.csv')
for f in files:
data = np.genfromtxt(f, delimiter=',')
# the [:-4] to strip off the extension
np.savez_compressed(f[:-4], data[:, 1][:, None])
| studywolf/NDMPS-paper | code/models/locomotion_trajectories/convert_csv_to_npz.py | Python | gpl-3.0 | 215 |
from routersploit.modules.payloads.mipsbe.reverse_tcp import Payload
# mipsbe reverse tcp with lhost=192.168.1.4 lport=4321
reverse_tcp = (
b"\x28\x04\xff\xff\x24\x02\x0f\xa6\x01\x09\x09\x0c\x28\x04\x11"
b"\x11\x24\x02\x0f\xa6\x01\x09\x09\x0c\x24\x0c\xff\xfd\x01\x80"
b"\x20\x27\x24\x02\x0f\xa6\x01\x09\x0... | dasseclab/dasseclab | clones/routersploit/tests/payloads/mipsbe/test_reverse_tcp.py | Python | gpl-2.0 | 2,649 |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
from __future__ import absolute_import
import tempf... | ryfeus/lambda-packs | HDF4_H5_NETCDF/source2.7/h5py/tests/old/test_h5f.py | Python | mit | 2,360 |
import os
import physical_validation as pv
systems = ["none", "shift", "switch"]
n_dts = 6
# change this to fit to your GROMACS installation
parser = pv.data.GromacsParser(
exe="~/bin/gromacs/bin/gmx_d", includepath="~/bin/gromacs/share/gromacs/top"
)
for sys in systems:
print("### Analyzing system " + sys)... | shirtsgroup/physical-validation | examples/argon_integrator/ana_argon.py | Python | lgpl-2.1 | 1,375 |
# -*- coding: utf-8 -*-
# Test file for node class
# Developer
# Ismail AKBUDAK
# ismailakbudak.com
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from graph import Node
def log(messag... | ismailakbudak/election-algorithm-on-graph | test/node_test.py | Python | mit | 1,091 |
#! /usr/bin/env python
import MDAnalysis
from MDAnalysis.analysis.leaflet import LeafletFinder
import numpy
from scipy import ndimage
from skimage import filter
import matplotlib.pyplot as plt
def render_image(image,colorMap,colorRange,ticks,filename):
plt.figure()
a=plt.imshow(image.transpose(), cmap=colorM... | philipwfowler/fd169-image-processing-example | detect-bilayer-phases.py | Python | mit | 6,774 |
from pimlico.datatypes.corpora.data_points import TextDocumentType
from pimlico.cli.browser.tools.formatter import DocumentBrowserFormatter
class TextDocumentFormatter(DocumentBrowserFormatter):
"""
Formatter for text document types for use in the corpus browser.
Simply displays the unicode text that's ... | markgw/pimlico | src/python/pimlico/datatypes/corpora/formatters/text.py | Python | gpl-3.0 | 449 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | sasha-gitg/python-aiplatform | google/cloud/aiplatform_v1/types/accelerator_type.py | Python | apache-2.0 | 1,060 |
"""
Post processing (subset of columns) to calculate intermediate sum edit counts
and other variables. Date sorted.
Usage:
calculate_intermediate_sums (-h|--help)
calculate_intermediate_sums <input> <output>
[--debug]
[--verbose]
Options:
-h... | hall1467/wikidata_usage_tracking | python_analysis_scripts/longitudinal_misalignment/calculate_intermediate_sums.py | Python | mit | 2,652 |
"""
Django settings for server project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | simonneuville/runamic_server | djangoserver/server/settings.py | Python | mit | 3,284 |
# -*- coding: utf-8 -*-
import unittest
from passwdgen.generator import *
from passwdgen.constants import *
from passwdgen.utils import *
class TestPasswordGeneration(unittest.TestCase):
word_list = load_word_list()
def test_unrecognised_charset(self):
try:
chars("some-unrecognised-cha... | thanethomson/passwdgen | tests/test_password_generation.py | Python | mit | 3,038 |
import os
for filename in os.listdir("./geojson"):
path, extension = os.path.splitext(filename)
if os.path.isfile("./geojson/" + filename) and extension == ".geojson":
with open("./geojson/" + filename, 'r') as f:
firstline = f.readline().strip()
if firstline != "{":
print "Error with '" + ... | lsjroberts/pi-me-a-river | data/check-geojson.py | Python | mit | 334 |
#!/usr/bin/env python3
"""scn_a
This file is a test scene.
This one is specifically used for testing
scene swaps and model data manipulation."""
# Import built-in libraries.
pass
# Import supplementary libraries.
import pygame
from pygame.locals import *
# Import local modules.
from bases import ... | Tricorne-Games/pyGameFrame | scn_a.py | Python | mit | 1,013 |
# -*- coding:utf-8 -*-
from odoo import models, fields, api
class cowin_sub_project_launch_edit_operation_records(models.Model):
_name = 'cowin_project.sub_project_launch_edit_operation_records'
name = fields.Char()
| shangdinvxu/cowinaddons | cowin_project/models/settings/approval_settings/cowin_sub_project_launch_edit_operation_records.py | Python | mit | 241 |
# -*- coding: utf-8 -*-
from .token import Token, TokenType, RESERVED_KEYWORDS, DATATYPES
class Lexer(object):
"""The lexer for Caspal.
Gets a stream of characters and converts them into tokens that are then
sent to the parser.
"""
def __init__(self, text):
self.text = text
sel... | kirang89/caspal | caspal/lexer.py | Python | gpl-3.0 | 3,448 |
"""
Usage::
hammer compute-resource [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
create Create a compute resource.
delete Delete a compute resou... | rplevka/robottelo | robottelo/cli/computeresource.py | Python | gpl-3.0 | 2,243 |
# Copyright 2014 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.
from telemetry.internal.results import page_test_results
from telemetry.page import page as page_module
from telemetry.value import list_of_scalar_values
fro... | catapult-project/catapult-csm | telemetry/telemetry/testing/test_page_test_results.py | Python | bsd-3-clause | 1,635 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# python verson: 2.7
# @Author: JinJin Lin
# @Email: jinjin.lin@outlook.com
# @License: MIT
# @Date: 2015-10-21 18:38:17
# @Last Modified time: 2015-12-17 21:59:04
# All copyright reserved
#
import Image
import wx
import os
import numpy as np
import matplotlib.pyplot as ... | linjinjin123/Digital-Image-Processing-Homework | hw4/src/UI.py | Python | mit | 41,289 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 16 18:19:24 2014
@authors: Federico Barabas, Luciano Masullo
"""
import subprocess
import sys
import numpy as np
import os
import datetime
import time
import re
from tkinter import Tk, filedialog, messagebox
import h5py as hdf
import tifffile as tiff # http://www.lfd... | fedebarabas/tormenta | tormenta/control/control.py | Python | gpl-3.0 | 67,339 |
# -*- coding: utf-8 -*-
import telebot # Librería de la API del bot.
from telebot import types # Tipos para la API del bot.
import time # Librería para hacer que el programa que controla el bot no se acabe.
TOKEN = '' # Nuestro token del bot (el que @BotFather nos dió).
bot = telebot.TeleBot(TOKEN) # Creamos el obje... | MiguelConcha/TelegramBot | main.py | Python | gpl-3.0 | 992 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutHashes in the Ruby Koans
#
from runner.koan import *
class AboutDictionaries(Koan):
def test_creating_dictionaries(self):
empty_dict = dict()
self.assertEqual(dict, type(empty_dict))
self.assertDictEqual({}, empty_dict)
... | ahartz1/python_koans | python3/koans/about_dictionaries.py | Python | mit | 1,964 |
#!/usr/bin/python
# CS Location decoder module for HSS Tools
##################################################################
# Copyright (c) 2015-2017 Denis Gudtsov
# License - GPL
# https://github.com/dgudtsov/hsstools
##################################################################
import logging
decoder_lo... | dgudtsov/hsstools | lib/location_decoder.py | Python | gpl-3.0 | 4,847 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# 1. Copyright
# 2. Lisence
# 3. Author
"""
Documents
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import threading
import subprocess
import re
import ti... | gepd/Stino | stino/pyarduino/arduino_compiler.py | Python | mit | 22,699 |
# -*- coding: utf-8 -*-
"""
pygments.styles.pastie
~~~~~~~~~~~~~~~~~~~~~~
Style similar to the `pastie`_ default style.
.. _pastie: http://pastie.caboo.se/
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from ..style import Style... | facelessuser/sublime-markdown-popups | st3/mdpopups/pygments/styles/pastie.py | Python | mit | 2,459 |
#!/usr/bin/env python
# Copyright (C) 2010 Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice ... | johnmgregoire/2013JCAPDataProcess | qhtest.py | Python | bsd-3-clause | 7,343 |
# Copyright (c) Matt Haggard.
# See LICENSE for details.
from distutils.core import setup
import os, re
def getVersion():
r_version = re.compile(r"__version__\s*=\s*'(.*?)'")
base_init = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'norm/__init__.py')
guts = open(base_init, 'r').read()
m ... | iffy/norm | setup.py | Python | mit | 737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.