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 |
|---|---|---|---|---|---|
# -*- 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_dataset_service_update_dataset_sync.py | Python | apache-2.0 | 1,707 |
# モデル2
#
# 畳み込みNN
#
import time
from datetime import datetime
from load_data import load2d
from saver import save_arch, save_history
from utils import reshape2d_by_image_dim_ordering
from plotter import plot_hist, plot_model_arch
import pickle
from keras.models import Sequential
from keras.layers import Convolution2D... | nipe0324/kaggle-keypoints-detection-keras | model2.py | Python | apache-2.0 | 2,420 |
import logging
import functools
from functools import (wraps)
from functools import partial
from functools import reduce
class Monad(object):
def bind(self, mf):
raise NotImplementedError
def map(self, mf):
raise NotImplementedError
def __rshift__(self, f):
return self.bind(f)
... | turbulent/dockwrkr | dockwrkr/monads.py | Python | apache-2.0 | 8,250 |
import collections
import json
from rest_framework.fields import MISSING_ERROR_MESSAGE, SerializerMethodField
from rest_framework.relations import *
from django.utils.translation import ugettext_lazy as _
from django.db.models.query import QuerySet
from django.db.models import Model
from rest_framework_json_api.excep... | Instawork/django-rest-framework-json-api | rest_framework_json_api/relations.py | Python | bsd-2-clause | 10,820 |
from django.shortcuts import render
from django.views.generic import TemplateView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from common import utils
# Create your views here.
class IndexView(TemplateView):
template_name = "index.html"
def ge... | jejimenez/invetronic | authentication/views.py | Python | mit | 746 |
# 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... | ArchiFleKs/magnum | magnum/db/sqlalchemy/alembic/versions/4956f03cabad_add_cluster_distro.py | Python | apache-2.0 | 1,131 |
import ocl
import camvtk
import time
import vtk
import datetime
import math
def drawLoops(myscreen, loops, loopcolor):
nloop = 0
for lop in loops:
n = 0
N = len(lop)
first_point=ocl.Point(-1,-1,5)
previous=ocl.Point(-1,-1,5)
for p in lop:
if n==0: # don't dra... | JohnyEngine/CNC | opencamlib/scripts/waterline/waterline_7_cavity.py | Python | apache-2.0 | 3,889 |
# Copyright 2010 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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.apach... | cyx1231st/nova | nova/api/openstack/compute/servers.py | Python | apache-2.0 | 56,020 |
import gmsh
import sys
gmsh.initialize(sys.argv)
gmsh.option.setNumber("General.Terminal", 1)
# Copied from discrete.py...
gmsh.model.add("test");
gmsh.model.addDiscreteEntity(2, 1)
gmsh.model.mesh.setNodes(2, 1, [1, 2, 3, 4],
[0., 0., 0.,
1., 0., 0.,
... | poofee/fastFEM | gmsh-4.2.2/demos/api/plugin.py | Python | mit | 1,313 |
chars = [chr(i)+chr(i).upper() for i in xrange(ord('a'), ord('z')+1)]
def reduce(s):
changes = True
while changes:
changes = False
for c in chars:
l = len(s)
s = s.replace(c, '')
s = s.replace(c[::-1],'')
if l != len(s):
changes = ... | pedrotari7/advent_of_code | py/2018/5B.py | Python | mit | 532 |
#!/usr/bin/env python
"""Command-line interface for SLAM."""
import os
import sys
import pwd
import argparse
import logging
import signal
os.environ["DJANGO_SETTINGS_MODULE"] = "webinterface.settings"
# Required for non-web Django applications
import django
django.setup()
from slam import models, interface, addrra... | LAL/SLAM | src/slam_cli.py | Python | apache-2.0 | 21,664 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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
#
# ... | ntt-sic/taskflow | taskflow/flow.py | Python | apache-2.0 | 2,637 |
"""Compliance app models"""
from django.conf import settings
from django.db import models
from mitol.common.models import TimestampedModel
from compliance.constants import (
RESULT_CHOICES,
RESULT_SUCCESS,
RESULT_DENIED,
RESULT_UNKNOWN,
RESULT_MANUALLY_APPROVED,
)
class ExportsInquiryLog(Timestam... | mitodl/bootcamp-ecommerce | compliance/models.py | Python | bsd-3-clause | 1,334 |
# Copyright 2012 Pedro Navarro Perez
# 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 requi... | saeki-masaki/cinder | cinder/volume/drivers/windows/windows.py | Python | apache-2.0 | 9,565 |
# Muuse - Yet another audio player
#
# Copyright (c) 2011 Joel Griffith
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later... | griffy/Muuse | muuse/gui/__init__.py | Python | gpl-2.0 | 801 |
import sys
import math
import json
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))) + '/utils/')
import numpy as np
import scipy.special as special
from algorithm_utils import get_parameters, set_algorithms_output_data
from pearsonc_lib import PearsonCorrelationLocalD... | madgik/mip-algorithms | PEARSON_CORRELATION/global.py | Python | mit | 2,365 |
# Copyright (c) 2010-2011 OpenStack, 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 to ... | houseurmusic/my-swift | swift/obj/updater.py | Python | apache-2.0 | 9,252 |
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code for calling ClustalW and parsing its output (DEPRECATED).
This module has been superseded by the Bio.AlignIO framework for
alignment parsing, a... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/Clustalw/__init__.py | Python | gpl-2.0 | 21,060 |
from github import Github
from django.conf import settings
from stars.models import Project, ProgrammingLanguage
class MegaUpdate:
__slots__ = (
'stars',
'first_run',
'saved_stars',
'expected_exceptions',
)
def __init__(self, saved_stars, expected_exceptions, first_run=Fa... | timkofu/gitstars | stars/mega_update.py | Python | mit | 2,601 |
from chota import app
from flask import render_template, redirect, request, jsonify, flash
import string
import random
import re
import httplib2
from urlparse import urlparse
import json
db = {}
def _protocol(url):
parsed = urlparse(url)
if parsed.scheme == "":
return "http://"+url
else:
... | davidhax0r/chota | chota/routes.py | Python | mit | 3,137 |
# this space left intentionally blank
| tailwind/bdot | benchmarks/asv/__init__.py | Python | mit | 39 |
def find_key_recursivly(key: str, dictionary: dict):
"""
Function that returns all instances of the given keys value inside a dictionary.
Searches recursively through the dictionary and yields the results.
:param key: String of the key whose values are being searched.
:param dictionary: Target dicti... | texta-tk/texta | utils/generic_helpers.py | Python | gpl-3.0 | 2,715 |
#
# Copyright (c) 2008--2018 Red Hat, Inc.
# Copyright (c) 2010--2011 SUSE Linux Products GmbH
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FO... | renner/spacewalk | backend/satellite_tools/reposync.py | Python | gpl-2.0 | 62,750 |
import datetime
import random
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.utils.translation impor... | VictorRocha/django-registration | registration/models.py | Python | bsd-3-clause | 10,244 |
"""
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... | rebost/django | tests/modeltests/model_forms/models.py | Python | bsd-3-clause | 8,153 |
# -*- coding: utf-8 -*-
basic_table = dict(map(lambda s: s.split(u'\t'), u'''
あ a
い i
う u
え e
お o
か ka
き ki
く ku
け ke
こ ko
さ sa
し shi
す su
せ se
そ so
た ta
ち chi
つ tsu
て te
と to
な na
に ni
ぬ nu
ね ne
の no
は ha
ひ hi
ふ fu
へ he
ほ ho
ま ma
み mi
む mu
め me
も mo
や ya
ゆ yu
よ yo
ら ra
り ri
る ru
れ re
ろ ro
わ wa
を o
ん n
ぁ a
ぃ i
ぅ u
ぇ e... | kosugi/alfred.romanizer | hepburn.py | Python | bsd-2-clause | 2,614 |
from uControl import *
from pylab import *
import util
def load(fn):
data = pickle.load(open(fn))
try:
out = data['hirate']
except ValueError:
out = data
return out
def plot_hirate(hirate):
times = hirate[:,0]
gage = hirate[:,1]
flow = hirate[:,2]
figure(1)
ax... | wyolum/uControl_v3 | scripts/plot_uc.py | Python | mit | 977 |
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import pyqtProperty, QObject, pyqtSignal
from typing import List
MYPY = False
if MYPY:
from cura.PrinterOutput.Models.ExtruderConfigurationModel import ExtruderConfigurationModel
class PrinterConfig... | Patola/Cura | cura/PrinterOutput/Models/PrinterConfigurationModel.py | Python | lgpl-3.0 | 4,372 |
#!/usr/bin/env python
#
# 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 "Lic... | thammegowda/incubator-joshua | scripts/toolkit/shorti.py | Python | apache-2.0 | 2,461 |
import numpy as np
from deli.demo_utils.traits_view import TraitsView
from deli.graph import Graph
from deli.artist.line_artist import LineArtist
from deli.tools.data_cursor_tool import DataCursorTool
class Demo(TraitsView):
def setup_graph(self):
x = np.linspace(0, 2 * np.pi)
y1 = np.sin(x)
... | tonysyu/deli | examples/tools/data_cursor.py | Python | bsd-3-clause | 696 |
"""
Magic Square
"""
if __name__ == '__main__':
while True:
n = int(raw_input())
if n == 0:
break
cell = [[0 for i in xrange(n)] for j in xrange(n)]
x, y = n / 2, (n / 2) + 1
cell[y][x] = 1
for v in xrange(2, n ** 2 + 1):
x, y = (x + 1) % n, ... | curryudon08/aoj | Volume0/0078.py | Python | unlicense | 539 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# AIOrchestra documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 7 00:06:42 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
... | aiorchestra/aiorchestra | docs/source/conf.py | Python | apache-2.0 | 12,148 |
#!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
import os
import sys
import time
reload(sys)
sys.setdefaultencoding('utf-8')
def app_path_load(dir_level=2):
app_root_path = os.path.abspath(__file__)
for i in xrange(0, dir_level):
app_root_path = os.path.dirname(app_root_pa... | tao12345666333/Talk-Is-Cheap | celery/task/mytask.py | Python | mit | 575 |
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The BrowserColumn widget displays the contents of a directory or file."""
from __future__ import (absolute_import, division, print_function)
import curses
import stat
from time import time
fr... | ranger/ranger | ranger/gui/widgets/browsercolumn.py | Python | gpl-3.0 | 20,402 |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# (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 yo... | tsdmgz/ansible | test/utils/shippable/tools/run.py | Python | gpl-3.0 | 3,570 |
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
if with_limits and self.query.low_mark == self.query.high_mark:
return '', ()
raw_sql, fields = super(SQLCompiler, self).as_sql... | leowa/django_informixdb | django_informixdb/compiler.py | Python | apache-2.0 | 1,808 |
#!/usr/bin/python
import time
elapseStart = time.time()
print('\033[92m' + 'Info: ' + '\033[0m' + 'Loading libraries...')
import objects.Star as Star
import objects.Binary as Binary
import objects.Orbit as Orbit
import objects.Observer as Observer
import objects.Function as Fn
import numpy as np
print('\033[92m' + '... | s-t-e-a-l-t-h/Eclipsing-binaries-library | main.py | Python | gpl-3.0 | 3,650 |
from core.himesis import Himesis
class HereferenceOUTeAnnotationsSolveRefEReferenceEAnnotationEReferenceEAnnotation(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HereferenceOUTeAnnotationsSolveRefEReferenceEAnnotationEReferenceEAnnotation.
"""
... | levilucio/SyVOLT | ECore_Copier_MM/transformation-Large/HereferenceOUTeAnnotationsSolveRefEReferenceEAnnotationEReferenceEAnnotation.py | Python | mit | 5,074 |
from .quantity import Quantity
class VoltageSquaredMixin(Quantity):
quantity = 'voltagesquared'
quantity_label = 'Voltage^2'
quantity_units = 'V^2'
is_voltagesquared = True
is_squared = True
| mph-/lcapy | lcapy/voltagesquaredmixin.py | Python | lgpl-2.1 | 219 |
# PyTIBot - IRC Bot using python and the twisted library
# Copyright (C) <2018-2022> <Sebastian Schmidt>
# 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
# a... | DefaultUser/PyTIBot | util/async_process.py | Python | gpl-3.0 | 3,028 |
#!/usr/bin/env python
# encoding: utf-8
"""
# from modules import process
"""
import shlex
from subprocess import PIPE, Popen
def get_exitcode_stdout_stderr(cmd):
"""
Execute the external command and get its exitcode, stdout and stderr.
"""
args = shlex.split(cmd)
proc = Popen(args, stdout=PIPE... | jabbalaci/PrimCom | modules/process.py | Python | gpl-2.0 | 554 |
from django.test import TestCase
from django.db import IntegrityError
from categories.models import Category, CategoryItem
class CategoriesTestCase(TestCase):
def setUp(self):
base_names = ['root', 'branch', 'leaf']
def build_children(base_name=None, parent=None):
if base_name is None:... | nocarryr/AV-Asset-Manager | avam/categories/tests.py | Python | gpl-3.0 | 5,595 |
import numpy
# set the values
kmax = 8
zsize = 0.5
stretch = 1.02
# equidistant grid
dz = zsize / kmax
z = numpy.linspace(0.5*dz, zsize-0.5*dz, kmax)
# non-equidistant grid
dz = zsize*(1-stretch)/(1-stretch**kmax)
z[0] = 0.5*dz
for k in range(1,kmax):
z[k] = z[k-1] + 0.5*dz
dz *= stretch
z[k] += 0.5*dz
# ... | jeremygibbs/microhh | cases_old_setup/taylorgreennoneq/taylorgreen16_4th/taylorgreenprof.py | Python | gpl-3.0 | 511 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-channel | samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_async.py | Python | apache-2.0 | 1,665 |
from string import ascii_lowercase as low, ascii_uppercase as up
def caesar(s, shift):
result = []
for a in s:
if a.isalpha():
if a.islower():
result.append(low[(low.index(a) + shift) % 26])
else:
result.append(up[(up.index(a) + shift) % 26])
... | the-zebulan/CodeWars | katas/beta/caesar_cipher.py | Python | mit | 387 |
import argparse
import ConfigParser
import importlib
import os
import pkg_resources
version = pkg_resources.get_distribution("rotterdam").version
import settings
DEFAULT_CONFIG_FILENAME = "/etc/rotterdam.conf"
class UnknownConfigError(Exception):
pass
class Config(object):
def __init__(self):
... | wglass/rotterdam | rotterdam/config.py | Python | mit | 3,337 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programs', '0011_auto_20170301_1844'),
]
operations = [
migrations.AlterModelOptions(
name='programsapiconfig',
options={},
),
... | stvstnfrd/edx-platform | openedx/core/djangoapps/programs/migrations/0012_auto_20170419_0018.py | Python | agpl-3.0 | 322 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, tools, models, _
from odoo.exceptions import UserError
class ProductUoMCategory(models.Model):
_name = 'product.uom.categ'
_description = 'Product UoM Categories'
name = field... | Aravinthu/odoo | addons/product/models/product_uom.py | Python | agpl-3.0 | 5,264 |
# coding=utf-8
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | google/learned_optimization | learned_optimization/tasks/quadratics.py | Python | apache-2.0 | 6,238 |
'''<h1>Library for surface x-ray diffraction simulations</h1>
<p> The problem of modelling the sample is divided to four
different classes: Sample, Slab, UnitCell and Instrument.
A Slab is the basic unit that builds up a sample and can
be seen as a quasi-unitcell for the sxrd problem.
Stricitly it is a 2D unitcell with... | jackey-qiu/genx_pc_qiu | models/raxs.py | Python | gpl-3.0 | 88,870 |
import os
import re
filenames = os.listdir('.')
file_tuples = []
re_file = re.compile(r'^(\d\d)_(.*)$')
for filename in filenames:
m = re_file.match(filename)
if m:
i = int(m.groups()[0])
t = i, filename
file_tuples.append(t)
file_tuples = sorted(file_tuples, key=lambda t: t[0])... | mbraak/jqTree | _entries/renumber.py | Python | apache-2.0 | 740 |
import functools
from bottle import request, response
from . import data
from .helpers import prepare_device_id
def set_track_id(cookie_name):
cookie_data = request.get_cookie(cookie_name)
if cookie_data:
# Cookie is already set, so we don't touch it
user_id, os_fam, agent_type = data.deseri... | Outernet-Project/librarian-analytics | librarian_analytics/decorators.py | Python | gpl-3.0 | 1,539 |
"""
WSGI config for {{ project_name }} 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/{{ docs_version }}/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ... | JamesRamm/longclaw | longclaw/project_template/project_name/wsgi.py | Python | mit | 431 |
import os
import fnmatch
import operator
from webob.exc import HTTPFound
class ThemeExtension:
""" Find available bootstrap themes """
#first = True # Parse the host name before anything else is done
needs = {'session'}
provides = {'themes'}
def __init__(self, *arg, **args):
themedir = os.... | bmillham/djrq2 | web/ext/theme.py | Python | mit | 2,009 |
from distutils.core import setup
import py2exe
setup(
windows=[{"script": "sha256app.py"}],
options={"py2exe": {"includes": ["PySide", "os", "json", "hashlib"]}}
) | printerpam/Satori | desktop-source/setup.py | Python | artistic-2.0 | 178 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | emgirardin/compassion-modules | mail_sendgrid/models/email_tracking.py | Python | agpl-3.0 | 888 |
# Copyright (c) 2016 Juniper Networks 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 requ... | openstack/python-neutronclient | neutronclient/osc/v2/networking_bgpvpn/bgpvpn.py | Python | apache-2.0 | 15,967 |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import logging
from oauthlib.common import Request
from oauthlib.oauth2.rfc6... | skion/oauthlib-oidc | oauthlib/oauth2/rfc6749/endpoints/token.py | Python | bsd-3-clause | 4,517 |
from __future__ import unicode_literals, print_function
import frappe
from frappe.utils import get_fullname
def get_leaderboards():
leaderboards = {
'User': {
'fields': ['points'],
'method': 'frappe.desk.leaderboard.get_energy_point_leaderboard',
'company_disabled': 1,
'icon': 'users'
}
}
return le... | saurabh6790/frappe | frappe/desk/leaderboard.py | Python | mit | 1,532 |
print('Interpreting submodule __init__.py')
| overfl0/Pythia | src/Pythia/python/adapter_import_test/module_one/submodule/__init__.py | Python | mit | 44 |
#!/usr/bin/env python
from setuptools import find_packages
from setuptools import setup
VERSION = 2.0
INSTALL_REQ = [
'h5py>=2.6.0',
'scipy>=0.17.0'
'numpy>=1.12.0',
'tornado>=4.4.2',
'futures>=3.0.5',
'pyaml>=16.12.2',
'tifffile>=0.11.1',
'pymongo>=3.4.0',
]
setup(
version=VERSION... | Rhoana/butterfly | setup.py | Python | mit | 722 |
import warnings
import os
import unittest
from test import test_support
# The warnings module isn't easily tested, because it relies on module
# globals to store configuration information. setUp() and tearDown()
# preserve the current settings to avoid bashing them while running tests.
# To capture the warning messa... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_warnings.py | Python | gpl-2.0 | 3,221 |
"""
Flask-User
==========
.. image:: https://img.shields.io/pypi/v/Flask-User.svg
:target: https://pypi.python.org/pypi/Flask-User
.. image:: https://img.shields.io/travis/lingthio/Flask-User.svg
:target: https://travis-ci.org/lingthio/Flask-User
.. image:: https://img.shields.io/pypi/dm/Flask-User.svg
:... | DimensionSoftware/Flask-User | setup.py | Python | bsd-2-clause | 4,899 |
"""
Minimalist wxPython PureMVC demo, Version 1.0
Copyright (c) 2009 Andy Bulka, www.andypatterns.com
"""
import puremvc.patterns.facade
class AppFacade(puremvc.patterns.facade.Facade):
STARTUP = "STARTUP"
DATA_SUBMITTED = "DATA_SUBMITTED"
DATA_CHANGED = "DATA_CHANGED"
@staticmethod
def getInstan... | PureMVC/puremvc-python-demo-wxpython-minimalist | src/AppFacade.py | Python | bsd-3-clause | 948 |
from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from geopy.geocoders import GoogleV3
from geopy.exc import GeocoderQuotaExceeded, GeocoderTimedOut, GeocoderServiceError
from time import sleep
from django.db import connections
from django.contrib.gis.geos impor... | HunterConnelly/firecares | firecares/firestation/management/commands/improve-bg-geocodes.py | Python | mit | 5,126 |
import json
import sys
import curses
from core import Game
output = sys.stdin.read()
data = json.loads(output)
try:
game = Game(data)
game.play()
finally:
curses.endwin()
| mrfuxi/strategypy-consoleui | consoleui/__main__.py | Python | mit | 186 |
#
# Copyright (C) 2013-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... | KaiSzuttor/espresso | testsuite/python/tabulated.py | Python | gpl-3.0 | 3,531 |
# Copyright 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | jprovaznik/os-cloud-management | os_cloud_management/utils/tests/test_clients.py | Python | apache-2.0 | 1,964 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | Gabrielcarvfer/NS3 | src/lr-wpan/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 582,780 |
# This module deals with input and output of configurations.
#
# Written by Konrad Hinsen
# last revision: 2000-6-5
#
_undocumented = 1
import ChemicalObjects, PDB, Units, Universe, Utility
from Scientific.Geometry.Objects3D import Sphere, Cone, Plane, Line, \
rotatePoint
fro... | fxia22/ASM_xf | PythonD/site_python/MMTK/ConfigIO.py | Python | gpl-2.0 | 10,719 |
from ddq.node import Node, Instantiator
from .node_types import is_term, is_variable_declaration
class Connective(Instantiator):
def __init__(self, symbol: str, arity: int, node_class: type):
self._symbol = symbol
self._arity = arity
self._node_class = node_class
def arity(self) -> in... | jadnohra/connect | proto_2/ddq/fol/connective.py | Python | unlicense | 1,108 |
from RoguePy.libtcod import libtcod
from RoguePy.UI.Elements import Element
from collections import namedtuple
from .. import Colors
CellView = namedtuple('CellView', ['char', 'fg', 'bg'])
class Map(Element):
def __init__(self, x, y, w, h, _map):
super(Map, self).__init__(x, y, w, h)
self._map = _map
... | v4nz666/7drl2017 | RoguePy/UI/Elements/Map.py | Python | gpl-3.0 | 5,016 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
#... | BorgERP/borg-erp-6of3 | base/base_base/ir/TODO/override_import_xml_schema/__init__.py | Python | agpl-3.0 | 1,151 |
from __future__ import division, absolute_import, print_function
import numpy as np
from . import kde_utils
class TestCDF(kde_utils.KDETester):
@classmethod
def setUpClass(cls):
kde_utils.setupClass_lognorm(cls)
def method_works(self, k, method, name):
begin, last = k.cdf([k.lower, k.uppe... | sergeyfarin/pyqt-fit | pyqt_fit/test/test_cdf.py | Python | gpl-3.0 | 3,379 |
# Copyright (c) 2012, CyberPoint International, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this lis... | CyberPoint/libpgm | libpgm/lgbayesiannetwork.py | Python | bsd-3-clause | 8,637 |
# Copyright (c) 2006-2008 Andreas Kloeckner
#
# 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, publi... | hobophobe/tagpy | tagpy/flac.py | Python | mit | 1,144 |
from .scanner import Scanner
import telnetlib
import re
import time
class Telnet(Scanner):
def __init__(self, cred, target, username, password, config):
super(Telnet, self).__init__(cred, target, config, username, password)
def _check(self):
try:
telnet = telnetlib.Telnet(str(self... | Graph-X/changeme | changeme/scanners/telnet.py | Python | gpl-3.0 | 3,106 |
'''Test module to thest the xmllib module.
Sjoerd Mullender
'''
from test_support import verbose
testdoc = """\
<?xml version="1.0" encoding="UTF-8" standalone='yes' ?>
<!-- comments aren't allowed before the <?xml?> tag,
but they are allowed before the <!DOCTYPE> tag -->
<!DOCTYPE greeting [
<!ELEMENT gree... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.1/Lib/test/test_xmllib.py | Python | mit | 532 |
import sys
from gossip import Node
if __name__ == '__main__':
server_port = sys.argv[1]
peers = sys.argv[2:]
n = Node(server_port, peers)
while True:
pass | abdelwas/GossipPubSub | subscriber.py | Python | gpl-3.0 | 183 |
# encoding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
TARGET_FKEY_ATTRS = dict(
null=True,
blank=True,
on_delete=models.SET_NULL,
... | conikuvat/shoottikala | event_log/models/entry.py | Python | mit | 2,549 |
#!/usr/bin/python -B
# -*- coding: utf-8 -*-
# Copied from master branch (old file mobygames_scraper_test.py).
# I will try to understand how the new scraper engine coded by Chrisism works.
# Unit Testing Framework
# https://docs.python.org/2.7/library/unittest.html
# https://docs.python.org/2.7/library/unittest.html... | Wintermute0110/plugin.program.advanced.emulator.launcher | dev-scrapers/unittest_scraper_mobygames.py | Python | gpl-2.0 | 7,151 |
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def parse_resource(s):
return s.strip()
def parse_number(s):
s = s.strip()
s = s.replace(".", "")
if s.find(",") > 0:
s = s.replace(",", ".");
return float(s), unit
return int(s)
def fetch(username, password):
result =... | andiwand/tmobile-scripts | personal.py | Python | gpl-3.0 | 1,172 |
from settings import PROJECT_ROOT, SITE_ROOT
import os
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
"default": {
"ENGINE": 'django.contrib.gis.db.backends.postgis',
"NAME": "kimathi_hostels",
"USER": "postgres",
"PASSWORD": "postgres",
"HOST": "localhost",
"PORT... | kngeno/kimathi_hostels | local_settings.py | Python | mit | 477 |
x = 37107287533902102798797998220837590246510135740250 + \
46376937677490009712648124896970078050417018260538 + \
74324986199524741059474233309513058123726617309629 + \
91942213363574161572522430563301811072406154908250 + \
23067588207539346171171980310421047513778063246676 + \
89261670696623633820136378418383684178734... | Rentier/project-euler | python/problem13.py | Python | gpl-3.0 | 5,520 |
from setuptools import setup
setup(
name='Pasvortilo',
version='0.1',
py_modules=['pasvortilo'],
install_requires=[
'Click',
],
entry_points='''
[console_scripts]
pasvortilo=pasvortilo:cli
''',
)
| kf5grd/pasvortilo | setup.py | Python | mit | 249 |
#
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# 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 a... | cosminbasca/rdftools | rdftools/tools/jvmrdftools/__init__.py | Python | apache-2.0 | 3,224 |
from django.contrib.auth.decorators import login_required
import logging
from certificates.models import GeneratedCertificate
from certificates.models import CertificateStatuses as status
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
import json
#@begin:View certificate page... | EduPepperPDTesting/pepper2013-testing | lms/djangoapps/certificates/views.py | Python | agpl-3.0 | 23,890 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/l... | aristanetworks/arista-ovs-quantum | quantum/tests/unit/test_extensions.py | Python | apache-2.0 | 25,545 |
##! /usr/bin/env python
# _*_ coding: latin-1 _*_
import jtutil
import jtsocket
import jtdom
def jtexec(cmd):
jtsocket.send("<jtexec>"+jtutil.cdataif(cmd)+"</jtexec>")
# <exitvalue>value</exitvalue>
# vagy
# <execerror>error</execerror>
while 1:
rsp=jtsocket.recv()
if r... | mrev11/ccc3 | jt/jtpython/jtlib/jtexec.py | Python | lgpl-2.1 | 653 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/kdiff3/package.py | Python | lgpl-2.1 | 1,853 |
import json
from unittest import skip, skipUnless
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase, APIRequestFactory, force_authenticate
from api.tests.factories import UserFactory, AnonymousUserFactory
from api.v2.views import ReportingViewSet
from core.models import Atmosphe... | CCI-MOC/GUI-Backend | api/tests/v2/test_reporting.py | Python | apache-2.0 | 4,602 |
config = {
"interfaces": {
"google.bigtable.admin.v2.BigtableTableAdmin": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": [],
},
"retry_params": {
"idempotent_params": {
... | tseaver/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client_config.py | Python | apache-2.0 | 5,606 |
# coding=utf-8
"""Smoke tests for the ``UI`` end-to-end scenario.
:Requirement: Ui Endtoend
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string, gen_ipaddr
from robottelo import manifests
from robot... | sghai/robottelo | tests/foreman/endtoend/test_ui_endtoend.py | Python | gpl-3.0 | 17,495 |
import psycopg2.extras
import json
import re
from collections import OrderedDict, Callable
import energyPATHWAYS.config as cfg
class DefaultOrderedDict(OrderedDict):
# Source: http://stackoverflow.com/a/6190500/562769
def __init__(self, default_factory=None, *a, **kw):
if (default_factory is not None a... | energyPATHWAYS/energyPATHWAYS | model_building_tools/db_to_file/extract_scenario_tree.py | Python | mit | 5,317 |
class Friend:
def __init__(self, name, phone):
self.name = name
self.phone = phone
def toString(self):
return self.name + " " + self.phone
| CoderDojo-Karlskrona/python-exercises | ex17/friendclass.py | Python | apache-2.0 | 184 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Swig(AutotoolsPackage, SourceforgePackage):
"""SWIG is an interface compiler th... | LLNL/spack | var/spack/repos/builtin/packages/swig/package.py | Python | lgpl-2.1 | 5,090 |
"""Defines the unit tests for the :mod:`colour.graph.conversion` module."""
import numpy as np
import unittest
from colour.characterisation import SDS_COLOURCHECKERS
from colour.colorimetry import CCS_ILLUMINANTS, SDS_ILLUMINANTS
from colour.models import COLOURSPACE_MODELS, RGB_COLOURSPACE_ACES2065_1
from colour.gra... | colour-science/colour | colour/graph/tests/test_conversion.py | Python | bsd-3-clause | 5,112 |
# Copyright 2011 OpenStack Foundation.
# 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 req... | fredericlepied/os-net-config | os_net_config/openstack/common/importutils.py | Python | apache-2.0 | 2,368 |
#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-
__author__ = 'Moskvitin Maxim'
from pymongo import MongoClient
from ORM.MongoDB.mongobase import MongoBase
import ORM
class MongoDBEngine(object):
altered_objects = []
def __init__(self, database, name=None, password=None, **connection_options):
self.... | muali/PyORM | ORM/MongoDB/mongodbengine.py | Python | mit | 1,300 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.defaults import get_user_permissions
from frappe.utils import add_days
from erpnext.utilities.doctype... | suyashphadtare/vestasi-erp-1 | erpnext/erpnext/accounts/party.py | Python | agpl-3.0 | 6,287 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.