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 |
|---|---|---|---|---|---|
#
# Copyright John Reid 2008
#
"""
Code to partition Transfac factors into equivalent sets.
"""
import biopsy.transfac as T
import biopsy
import boost.graph as bgl
from cookbook.lru_cache import lru_cache
class Graph(bgl.Graph):
__getstate_manages_dict__ = 1
"""So Boost.python knows we manage the object's di... | JohnReid/biopsy | Python/biopsy/transfac/factor_synonyms.py | Python | mit | 7,294 |
from time import strftime as now
import threading
import serial
FORMAT = '%Y-%m-%d %H:%M:%S'
ser = serial.Serial('COM4', baudrate=57600)
def log(data, file='sim800.log'):
with open(file, 'a+') as f:
f.write(now(FORMAT) + ' ' + str(data) + '\n')
f.close()
def read_from_port(ser):
while True:
... | wittrup/crap | python/sim800l.py | Python | mit | 1,342 |
import pytest
import numpy as np
import murraylab_tools.echo as mt_echo
@pytest.mark.skip(reason="tests not yet implmented")
class TestEchoFunctions():
def test_implement_me(self):
assert 0
| sclamons/murraylab_tools | murraylab_tools/tests/echo_tests/test_misc_echo_functions.py | Python | mit | 204 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('core', '0009_drop_timtecuser'),
)
def forwards(self, orm):
# Adding model 'Answer'
db.rename_table('c... | mupi/tecsaladeaula | activities/migrations/0002_create_activity_and_answer.py | Python | agpl-3.0 | 5,688 |
# -*- coding: utf-8 -*-
from os import environ
#Create = 20120517
YBLOG_VERSION = '20120721' # 当前版本
APP_NAME = environ.get("APP_NAME", "")
debug = not APP_NAME
#Mysql收费太贵,用kvdb代替MySql,思路是尽量只改model和少量template,尽量不修改之前逻辑
MYSQL_TO_KVDB_SUPPORT = True
#迁移说明
#1.备份数据,登录SAE后台,备份sp_archive,sp_category,sp_links,sp_posts,sp_tag... | yobin/saepy-log | setting.py | Python | mit | 5,841 |
import os
import re
import sys
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), "cosmos/VERSION"), "r") as fh:
__version__ = fh.read().strip()
def find_all(path, reg_expr, inverse=False, remove_prefix=False):
if not path.endswith("/"):
path = path + "/"
... | LPM-HMS/COSMOS2 | setup.py | Python | gpl-3.0 | 2,740 |
import ply.lex as lex
states = (
('fa', 'inclusive'),
('pda', 'inclusive'),
('turing', 'inclusive'),
('grammar', 'inclusive'),
('lsystem', 'inclusive'),
('moore', 'inclusive'),
('mealy', 'inclusive'),
('re', 'inclusive')
)
tokens = (
'ID', # id=
'NAME', ... | leonardolima/jflap-check | lexer.py | Python | mit | 7,440 |
import libtcodpy as libtcod
from vec2d import Vec2d
from model.action import Action, ActionTag
from model.attribute import AttributeTag
from behavior import Behavior
class AIRandomWalkBehavior(Behavior):
def __init__(self, manager):
Behavior.__init__(self, manager)
def generate_actions(self):
events = []
fo... | RCIX/RogueP | model/behaviors/behavior_ai_randomwalk.py | Python | mit | 873 |
class Solution():
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
dic = {}
for i in range(len(nums)):
sub = target - nums[i]
if sub in dic:
return [i, dic... | YiqunPeng/Leetcode-pyq | solutions/1TwoSum.py | Python | gpl-3.0 | 377 |
#!/usr/bin/python3
"""Build macro-generation headers for to wrap the type-generic RB3 API.
You could say this is a program that writes a program that writes a program...
"""
import sys
import subprocess
def cs(xs):
return ', '.join(xs)
def cleanescapes(lines):
return [line.rstrip(' \\\n') + ' \\\n' for li... | jstimpfle/sil | rb3ptr/dist/gen-macros.py | Python | mit | 5,183 |
import math
from gi.repository import Gtk
from gaphas.item import Element as Box
from gaphas.tool.itemtool import (
DragState,
handle_at_point,
item_at_point,
item_tool,
on_drag_begin,
)
class MockEvent:
def __init__(self, modifiers=0):
self._modifiers = modifiers
def get_state(... | amolenaar/gaphas | tests/test_tool_item.py | Python | lgpl-2.1 | 2,557 |
#!/usr/bin/env python
"""
Rules
for *.py files
* if the changed file is __init__.py, and there is a side-band test/ dir, then test the entire test/functional directory
the reason for this is that the init files are usually organizing collections
and those can affect many different apis if they break
* if ... | F5Networks/f5-common-python | devtools/bin/create-test-list.py | Python | apache-2.0 | 4,268 |
# -*- coding: utf-8 -*-
'''
Created on 28.08.2015
@author: derChris
'''
import re
from collections import OrderedDict
from pydispatch import dispatcher
from abc import abstractmethod
from ezClasses.ezClasses import ezDict
####################
### SHARED GUI INFO
####################
class SharedGUIData():
... | ChrisCuts/fnode | src/PlugIns/NodeTemplates.py | Python | gpl-2.0 | 16,591 |
#!/usr/bin/env python
'''
SubSynco - a tool for synchronizing subtitle files
Copyright (C) 2015 da-mkay
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your o... | da-mkay/subsynco | src/subsynco/gst/filter.py | Python | gpl-3.0 | 4,647 |
# 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_08_01/aio/operations/_default_security_rules_operations.py | Python | mit | 8,854 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | illfelder/libcloud | libcloud/test/compute/test_dimensiondata_v2_4.py | Python | apache-2.0 | 163,626 |
"""
Tests for the public API exposed by L{eliot}.
"""
from __future__ import unicode_literals
from unittest import TestCase
from .._output import Logger
import eliot
class PublicAPITests(TestCase):
"""
Tests for the public API.
"""
def test_addDestination(self):
"""
L{eliot.addDesti... | iffy/eliot | eliot/tests/test_api.py | Python | apache-2.0 | 2,516 |
__author__ = "mfreer"
__date__ = "2011-05-27 14:27"
__version__ = "1.0"
__all__ = ["TempVirtualCnrm"]
import egads.core.egads_core as egads_core
import egads.core.metadata as egads_metadata
class TempVirtualCnrm(egads_core.EgadsAlgorithm):
"""
FILE temp_virtual_cnrm.py
VERSION 1.0
CA... | eufarn7sp/egads-eufar | egads/algorithms/thermodynamics/temp_virtual_cnrm.py | Python | bsd-3-clause | 3,161 |
from django.db import models
from django.template.defaultfilters import slugify
from django.contrib.auth.models import User
class Tapas(models.Model):
nombre_tapa = models.CharField(max_length=128, unique=True)
votos = models.IntegerField(default=0)
slug = models.SlugField()
def save(self, *args, **k... | sn1k/Vinos | rango/models.py | Python | mit | 1,441 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-06 02:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='GatherH... | alzeih/ava | ava_core/gather/gather_abstract/migrations/0001_initial.py | Python | gpl-3.0 | 1,208 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: metagriffin <mg.github@uberdev.org>
# date: 2013/12/14
# copy: (C) Copyright 2013-EOT metagriffin -- see LICENSE.txt
#-------------------------------------------------------... | metagriffin/proxylog | setup.py | Python | gpl-3.0 | 3,313 |
#!/usr/bin/env python
from wagtail import __version__
from wagtail.utils.setup import assets, check_bdist_egg, sdist
try:
from setuptools import find_packages, setup
except ImportError:
from distutils.core import setup
# Hack to prevent "TypeError: 'NoneType' object is not callable" error
# in multiprocess... | FlipperPA/wagtail | setup.py | Python | bsd-3-clause | 3,993 |
import datetime
import math
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.apps import apps
from django.db import connection
from radio.models import *
from django.db.utils import IntegrityError
table_list = (
#'auth_group',
#'auth_group_permiss... | ScanOC/trunk-player | radio/management/commands/move_db.py | Python | mit | 4,782 |
# Copyright 2014 Cloudera 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, so... | wesm/ibis | ibis/sql/sqlite/compiler.py | Python | apache-2.0 | 5,142 |
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | tkruse/rosinstall | src/rosinstall/simple_checkout.py | Python | bsd-3-clause | 2,400 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of <%= package.name %>.
# <%= package.url %>
# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %> <%= package.author.name %> <%= package.author.e... | heynemann/generator-tornado | app/templates/_setup.py | Python | mit | 1,832 |
# Copyright (c) 2019 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 absl import app
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.suppo... | ric2b/Vivaldi-browser | chromium/chrome/test/enterprise/e2e/policy/allow_deleting_browser_history/allow_deleting_browser_history_webdriver_test.py | Python | bsd-3-clause | 1,991 |
# Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 versio... | mkuron/espresso | testsuite/scripts/tutorials/test_04-lattice_boltzmann_part2.py | Python | gpl-3.0 | 1,053 |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class TanitJobsCategory(models.Model):
name = models.CharField(max_length=255, unique=True)
def __str__(self):
return "%s" % self.name
cla... | firasbenmakhlouf/JobLookup | metadata/models.py | Python | mit | 467 |
# encoding=utf-8
## SOLVED 2013/12/24
## 45228
# We shall say that an n-digit number is pandigital if it makes use of all the
# digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1
# through 5 pandigital.
# The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing
# multiplicand, m... | 6112/project-euler | problems/032.py | Python | mit | 1,539 |
from django.apps import apps
import logging
import urlparse
import random
import requests
from framework.exceptions import HTTPError
from framework.celery_tasks import app as celery_app
from framework import sentry
from website import settings, mails
from website.util.share import GraphNode, format_contributor, form... | caneruguz/osf.io | website/preprints/tasks.py | Python | apache-2.0 | 8,601 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from db.Corpus_DB import Corpus_DB
from db.BOW_DB import BOW_DB
from db.LDA_DB import LDA_DB
from db.ITM_DB import ITM_DB
from vis.ScatterPlot1 import ScatterPlot1 as ScatterPlot1Handler
def index():
with Corpus_DB() as corpus_db:
with BOW_DB() as bow_db:
... | maoxuxiang/termite_mallet_project | server_src/controllers/ScatterPlot1.py | Python | bsd-3-clause | 897 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | The-Compiler/qutebrowser | tests/unit/mainwindow/statusbar/test_progress.py | Python | gpl-3.0 | 3,724 |
# -*- coding: utf-8 -*-
from outwiker.gui.baseaction import BaseAction
from .i18n import get_
from . import defines
class BaseHeadAction(BaseAction):
"""
Базовый класс действий для вставки команд
"""
def __init__(self, application):
self._application = application
global _
_... | unreal666/outwiker | plugins/htmlheads/htmlheads/actions.py | Python | gpl-3.0 | 3,329 |
{
'name' : 'Product status at website shop',
'version' : '1.0.1',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category' : 'Sale',
'website' : 'https://yelizariev.github.io',
'depends' : ['website_sale', 'stock'],
'data':[
'website_sale_stock_status_views.x... | Endika/website-addons | website_sale_stock_status/__openerp__.py | Python | lgpl-3.0 | 408 |
# -*- coding: utf-8 -*-
"""Templates for description tags <dd>, <dl> and <dt>"""
from ..environment import env
dd = env.from_string("""\
<dd>{%- if text -%} {{ text }} {%- endif -%}</dd>
""")
dl = env.from_string("""\
<dl>{%- if text -%} {{ text }} {%- endif -%}</dl>
""")
dt = env.from_string("""\
<dt>{%- if text -... | bharadwajyarlagadda/korona | korona/templates/html/tags/description.py | Python | mit | 358 |
#----------------------------------------------------------------------
# Name: wxPython.tools.img2py
# Purpose: Convert an image to Python code.
#
# Author: Robin Dunn
#
# RCS-ID: $Id: img2py.py,v 1.5 2003/12/22 19:09:46 RD Exp $
# Copyright: (c) 2002 by Total Control Software
# Licence: wxW... | tibor95/phatch-python2.7 | phatch/other/pyWx/img2py.py | Python | gpl-3.0 | 8,953 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | airbnb/kafka | tests/kafkatest/tests/produce_consume_validate.py | Python | apache-2.0 | 8,828 |
# Copyright 2015 PerfKitBenchmarker 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 appli... | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/test_util.py | Python | apache-2.0 | 4,727 |
""" Supports scanning a Tomato router. """
import logging
import json
from datetime import datetime, timedelta
import re
import threading
import requests
import homeassistant as ha
import homeassistant.util as util
from homeassistant.components.device_tracker import DOMAIN
# Return cached results if last scan was le... | JMSwag/home-assistant | homeassistant/components/device_tracker/tomato.py | Python | mit | 5,382 |
'''
NPR Puzzle 2016-04-24
http://www.npr.org/2016/04/24/475299329/finish-this-puzzle-and-youll-be-just-like-overachievers-you-both-exceed
Name a famous singer -- first and last names.
The last four letters of the first name spelled
backward plus the first four letters of the last name
spelled forward, read togethe... | boisvert42/npr-puzzle-python | 2016/0424_drugstore_section.py | Python | cc0-1.0 | 1,003 |
""" Vanilla RNN
@author Graham Taylor
"""
import numpy as np
import theano
import theano.tensor as T
from sklearn.base import BaseEstimator
import logging
import time
import os
import datetime
import pickle as pickle
import math
import matplotlib.pyplot as plt
plt.ion()
mode = theano.Mode(linker='cvm')
#mode = '... | mengyun1993/RNN-binary | rnn03.py | Python | bsd-3-clause | 27,063 |
from __future__ import unicode_literals
import unittest
import json, os, shutil, subprocess
import bench
import bench.utils
import bench.app
import bench.config.common_site_config
import bench.cli
bench.cli.from_command_line = True
class TestBenchInit(unittest.TestCase):
def setUp(self):
self.benches_path = "."
... | yashodhank/bench | bench/tests/test_init.py | Python | gpl-3.0 | 8,306 |
from flask_wtf import Form
from wtforms import TextField, DecimalField, TextAreaField, DateField, validators, PasswordField, BooleanField
class CommentForm(Form):
text = TextField('Title', [validators.Required()])
text2 = TextAreaField('Body')
longitude = DecimalField('Longitude')
latitude = DecimalFie... | homoludens/EventMap | hello/forms.py | Python | agpl-3.0 | 1,156 |
from rest_framework import serializers
from organization.models import Organization, Register, Comment
# future expansion to support multiple registers per organization
class RegisterSerializer(serializers.ModelSerializer):
class Meta:
model = Register
fields = ('id', 'name')
# future expansion t... | sakset/getyourdata | getyourdata/api/serializers.py | Python | mit | 1,178 |
import numpy as np
import sklearn.datasets as skdata
from tfs.dataset import data_tool as dtool
from tfs.dataset.base import Dataset
# TODO:
# the following is not wrapped
#
# 1. multilabel
# 2. manifold learning
# 3. decomposition
# 4. biclustering
#
# real dataset:
#
# - The Olivetti faces dataset
# - The 20 newsgr... | crackhopper/TFS-toolbox | tfs/dataset/skdata.py | Python | mit | 3,278 |
from datetime import datetime, timedelta
| ourbest/sns_app | utils/scheduler.py | Python | lgpl-3.0 | 41 |
#!/usr/bin/env python
import requests
import cgi
## Extract qty if it exists
arguments = cgi.FieldStorage()
qty = None
if arguments != None:
qty = arguments.getvalue("qty")
if qty == None:
qty = 1
url = "https://coinbase.com/api/v1/prices/buy?qty=" + str(qty)
r = requests.get(url)
jsonResponse = "{\"error\":... | ravikiranj/rkjanardhana-dot-com | bitcoinPrice.py | Python | bsd-2-clause | 512 |
# ANI2012A17_Logic_Python.py | Programmation Python avec Maya | coding=utf-8
# Exemples de structures de contrôle logiques.
# variables
condition = True
number = 0
# 1. branchement conditionnel sans alternative
# le bloc d'instruction est exécuté seulement si la condition est vraie.
if condition:
p... | philvoyer/ANI2012A17 | Module07/EXE02/ANI2012A17_Logic_Python.py | Python | mit | 1,153 |
#!/usr/bin/env python
"""
Finds and prints coordinates of a required block, try with:
<worldpath> <x> <z> <range> <block>
./block_finder.py ./MyWorld 1 1 2 spawner
"""
import os, sys
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be... | macfreek/NBT | examples/block_finder.py | Python | mit | 3,182 |
# Copyright (c) 2010 Arjan Scherpenisse
# See LICENSE for details.
# -*- test-case-name: sparked.test.test_events -*-
"""
Classes which define a generic event system.
"""
from twisted.python import log
from twisted.words.xish import utility
class EventDispatcher(utility.EventDispatcher):
"""
The sparked event... | arjan/sparked | sparked/events.py | Python | mit | 2,560 |
"""
scraping
the utility functions for the actual web scraping
"""
import ssl
import datetime
import requests
import re
# this is the endpoint that my new version of this program will
# abuse with possible store ids. this is a much more reliable "darts at the wall"
# technique than the previous location-based one
QUE... | cfh294/WawaGeoScraper | utils/scraping/__init__.py | Python | gpl-3.0 | 5,149 |
"""
Copyright (c) 2011-2015 Nathan Boley
This file is part of GRIT.
GRIT 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.
GRIT is distribut... | nboley/grit | grit/peaks.py | Python | gpl-3.0 | 22,194 |
from flask import Blueprint, request
a40323148_1 = Blueprint('a40323148_1', __name__, url_prefix='/a40323148_1', template_folder='templates')
head_str = '''
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>網際 2D 繪圖</title>
<!-- IE 9: display inline SVG -->
<meta http-equiv="X-UA-Compatibl... | 2015fallhw/cdw11 | users/a/g1/a40323148_1.py | Python | agpl-3.0 | 37,865 |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
"""
Contains test related code that is executed at runtime
in the context of the application under test.
"""
import streamsx.ec as ec
import streamsx.topology.context as stc
import os
import unittest
import logging
import collections
imp... | IBMStreams/streamsx.topology | test/python/spl/tk17/opt/.__splpy/packages/streamsx/topology/tester_runtime.py | Python | apache-2.0 | 5,369 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
"""
Model test set
"""
import unittest
from tr55.model import runoff_nrcs, runoff_pitt, \
simulate_cell_day, simulate_water_quality, \
create_unmodified_census, create_modifie... | WikiWatershed/tr-55 | test/test_model.py | Python | apache-2.0 | 33,009 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This ... | grimoirelab/sortinghat | sortinghat/cmd/log.py | Python | gpl-3.0 | 4,929 |
"""
Copyright 2008-2011,2015 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from sys import platform
import os
import numbers
from gi.repository import GLib
import cairo
import six
from .canvas.colors import FLOWGRAPH_BACKGROUND_COLOR
from . import Cons... | trabucayre/gnuradio | grc/gui/Utils.py | Python | gpl-3.0 | 5,321 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... | hachreak/invenio-utils | invenio_utils/version.py | Python | gpl-2.0 | 1,123 |
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... | maui-packages/qt-creator | tests/system/suite_HELP/tst_HELP05/test.py | Python | lgpl-2.1 | 2,786 |
# -*- coding: utf-8 -*-
##############################################################################
#
# GNU Health: The Free Health and Hospital Information System
# Copyright (C) 2008-2016 Luis Falcon <falcon@gnu.org>
# Copyright (C) 2011-2016 GNU Solidario <health@gnusolidario.org>
#
#
# This program i... | kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/health_crypto/__init__.py | Python | gpl-3.0 | 1,303 |
#!/usr/bin/env python
# PyQt tutorial 7
import sys
from PySide import QtCore, QtGui
class LCDRange(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
lcd = QtGui.QLCDNumber(2)
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal)
... | cherry-wb/SideTools | examples/tutorial/t7.py | Python | apache-2.0 | 1,953 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | martensm/pywaifu | travis_pypi_setup.py | Python | mit | 3,754 |
# Copyright 2016 Criteo
#
# 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, softw... | criteo/biggraphite | biggraphite/cli/bg_carbon_cache.py | Python | apache-2.0 | 2,020 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, 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
import datetime
from django.conf i... | lawzou/shoop | shoop/core/utils/reference.py | Python | agpl-3.0 | 2,988 |
from __future__ import print_function
import sys, os, time
from h2o.exceptions import H2OTypeError
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.automl import H2OAutoML
"""
Those tests check time constraints on AutoML runs.
"""
def import_dataset(seed=0, larger... | michalkurka/h2o-3 | h2o-py/tests/testdir_algos/automl/pyunit_NOPASS_automl_timing.py | Python | apache-2.0 | 2,546 |
"""
Parses a variety of ``Accept-*`` headers.
These headers generally take the form of::
value1; q=0.5, value2; q=0
Where the ``q`` parameter is optional. In theory other parameters
exists, but this ignores them.
"""
import re
try:
sorted
except NameError:
from webob.compat import sorted
part_re = re.... | sizzlelab/pysmsd | extras/webob/acceptparse.py | Python | mit | 8,996 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import subprocess
import sys
from ....tests.helper import pytest
def test_wcsapi_extension(tmpdir):
# Test that we can build a simple C extension with the... | piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/wcs/tests/extension/test_extension.py | Python | mit | 2,891 |
#!/usr/bin/env python
# Copyright 2015 Matthew Wall
# See the file LICENSE.txt for your rights.
#
# Credits:
# Thanks to Benji for the identification and decoding of 7 packet types
#
# Thanks to Eric G for posting USB captures and providing hardware for testing
# https://groups.google.com/forum/#!topic/weewx-developm... | paolobenve/weewx | bin/weewx/drivers/wmr300.py | Python | gpl-3.0 | 46,206 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under t... | benfitzpatrick/rose | metomi/rose/suite_engine_proc.py | Python | gpl-3.0 | 22,663 |
#!/usr/bin/python
"""
Daylight savings dates.
Copyright (c) 2015 Kauinoa
License: MIT
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 ... | kauinoa/CalendarEvents | calendarevents/dst_holidays.py | Python | mit | 1,664 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
from configman.dotdict import DotDict
import isodate
import pytest
from socorro.lib import BadArgument... | mozilla/socorro | socorro/unittest/lib/test_external_common.py | Python | mpl-2.0 | 5,520 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui\dialog_error.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromU... | KatonaLab/vividstorm | views/dialog_error.py | Python | lgpl-3.0 | 2,356 |
# Copyright 2017 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... | tensorflow/tensorflow | tensorflow/python/data/kernel_tests/shard_test.py | Python | apache-2.0 | 7,742 |
# -*- coding: utf-8 -*-
#########################
# CONFLOG #
#########################
"""
Definitions of logging.
"""
#########################
# IMPORTS #
#########################
import logging
from logging.handlers import RotatingFileHandler
FILENAME_LOG = 'logs/munin.log'
LOGGER_NA... | Aluriak/munin | munin/config/conflog.py | Python | gpl-2.0 | 934 |
from app.controller.watsonLanguage import WatsonToneAnalyzer
app = WatsonToneAnalyzer()
print(app.doAnalyze(text='I am very happy')) | weizy1981/WatsonRobot | run/runToneAnalyzer.py | Python | apache-2.0 | 132 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('diagnosticos', '0013_auto_20150505_2053'),
]
operations = [
migrations.AlterField(
model_name='d... | btenaglia/hpc-historias-clinicas | hpc-historias-clinicas/diagnosticos/migrations/0014_auto_20150506_0117.py | Python | bsd-3-clause | 802 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Kyoukai documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 22 15:11:32 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | SunDwarf/Kyoukai | docs/conf.py | Python | mit | 5,660 |
#!/usr/bin/env python
#
# Copyright 2014 Institute for Theoretical Information Technology,
# RWTH Aachen University
# www.ti.rwth-aachen.de
#
# This 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 S... | rwth-ti/gr-ofdm | python/ofdm/moms_general.py | Python | gpl-3.0 | 2,451 |
# -*- coding: utf-8 -*-
# Copyright 2014 Nicolas Bessi, Alexandre Fayolle, Camptocamp SA
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def post_init_hook(cr, registry):
""" Add street3 to address format """
query = """
UPDATE res_country
SET address_f... | be-cloud-be/horizon-addons | partner-contact/partner_address_street3/hooks.py | Python | agpl-3.0 | 1,003 |
### Edge Bounce Behaviour ###
from Behaviour import Behaviour
from lwmath.Vector import Vector
class EdgeBounce(Behaviour):
def __init__(self):
self.min = Vector()
self.max = Vector()
super(EdgeBounce).__init__(self)
def apply(self, p, dt, index):
if p.pos.x - p.radius < se... | gregroper/Pycipia | behaviour/EdgeBounce.py | Python | mit | 651 |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | 09zwcbupt/ryu | ryu/lib/packet/icmpv6.py | Python | apache-2.0 | 7,229 |
# -*- 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... | romeoabulencia/glimsol_check | report/cdos.py | Python | gpl-2.0 | 3,179 |
"""
Copyright 2018 Attila Szollosi
This file is part of pmbootstrap.
pmbootstrap 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.
pmbootstr... | postmarketOS/pmbootstrap | pmb/install/recovery.py | Python | gpl-3.0 | 2,841 |
"""This module defines the Form class, a subclass of Views that can manage
widgets."""
import spyral
import operator
import inspect
class _FormFieldMeta(type):
"""
Black magic for wrapping widgets defined as class attributes. See python
documentation on overriding Python
`__metaclass__ <http://docs.py... | platipy/spyral | spyral/form.py | Python | lgpl-2.1 | 12,227 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-25 01:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workout', '0006_auto_20161024_2135'),
]
operations = [
migrations.AddField(... | audiolion/py-fitness | py_fitness/py_fitness/workout/migrations/0007_exercise_slug.py | Python | mit | 518 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Will Thames <@willthames>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | azaghal/ansible | test/support/integration/plugins/modules/k8s_info.py | Python | gpl-3.0 | 5,086 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import fluent_contents.plugins.oembeditem.fields
class Migration(migrations.Migration):
dependencies = [
('gk_collections_moving_image', '0002_auto_20161026_1312'),
]
operations = [
... | ic-labs/glamkit-collections | glamkit_collections/contrib/work_creator/plugins/moving_image/migrations/0003_movingimagework_trailer.py | Python | mit | 638 |
# -*- coding: utf-8 -*-
from .dropboxAdapter import DropboxAdapter
from .yesDocAdapter import YesDocAdapter
from .driveAdapter import DriveAdapter
# Se importa último, ya que hace uso del resto de adaptadores.
from .fileManagerFactory import FileManagerFactory
| lightning-round/salud-api | app/mod_profiles/adapters/__init__.py | Python | gpl-2.0 | 264 |
# Copyright 2017 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... | jiaphuan/models | research/gan/cifar/data_provider_test.py | Python | apache-2.0 | 1,803 |
import copy
import unittest
try:
from unittest import mock
except ImportError:
# Python 3.2 does not have mock in the standard library
import mock
import yaml
from sauna import Sauna, _merge_config
class ConfigTest(unittest.TestCase):
def test_dict_conf(self):
dict_conf = {
"plu... | bewiwi/sauna | tests/test_config.py | Python | bsd-2-clause | 8,010 |
import helper
if __name__ == "__main__":
helper.greeting("go hoos")
| tsteining/cs3240-labdemo | steining.py | Python | mit | 70 |
# Copyright 2017 AT&T Intellectual Property. All other 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... | att-comdev/drydock | drydock_provisioner/statemgmt/db/tables.py | Python | apache-2.0 | 4,033 |
import numpy
import numpy.linalg as la
import clq
import clq.backends.opencl.pyopencl as cl
from clq.backends.opencl import get_global_id
a = numpy.random.rand(50000).astype(numpy.float32)
b = numpy.random.rand(50000).astype(numpy.float32)
@clq.fn
def ew_add(a, b, dest):
gid = get_global_id(0)
dest[gid] = a[g... | cyrus-/ace | tests/ew_add.py | Python | lgpl-3.0 | 596 |
# 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 agreed... | google/shopping-markup | plugins/cloud_utils/__init__.py | Python | apache-2.0 | 1,168 |
# Copyright (C) 2015 Brent Baude <bbaude@redhat.com>
# Copyright (C) 2015 Red Hat Inc., Durham, North Carolina.
#
# This library 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 2 of the... | pthierry38/openscap-daemon | openscap_daemon/cve_scanner/scan.py | Python | lgpl-2.1 | 10,634 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | realms-team/basestation-fw | libs/smartmeshsdk-REL-1.3.0.1/libs/VManagerSDK/vmanager/models/software_info_list.py | Python | bsd-3-clause | 3,079 |
#!/usr/bin/env python2
#
# Copyright 2015 by Ss Cyril and Methodius University in Skopje, Macedonia
# Copyright 2015 by Idiap Research Institute in Martigny, Switzerland
#
# See the file COPYING for the licence associated with this software.
#
# Author(s):
# Branislav Gerazov, October 2015
# Aleksandar Gjoreski, O... | dipteam/wcad | wcad/object_types/atom.py | Python | gpl-3.0 | 5,941 |
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'test.db' # Or path to data... | jrutila/django-reportengine | example/settings.py | Python | bsd-3-clause | 1,333 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_assignments_operations.py | Python | mit | 30,831 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.