text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
from django.db import models
class TastingCategory(models.Model):
title = models.CharField(max_length=128)
singularTitle = models.CharField(max_length=128)
slug = models.SlugField(max_length=128)
def __unicode__(self):
return self.title
class Tasting(models.Model):
category = models.For... | aroquemaurel/Cuis-In | cuisin/tasting/models.py | Python | gpl-2.0 | 1,752 | 0.001712 |
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.db import models
from django.utils import timezone
from django.utils.http import urlquote
from django.utils.translation import ugettext_lazy as _
import warnings
from django.contrib.auth.models import (
BaseUs... | pusnik/django-libtech-emailuser | emailuser/models.py | Python | bsd-3-clause | 3,681 | 0.002717 |
import requests
class Status(object):
SKIP_LOCALES = ['en_US']
def __init__(self, url, app=None, highlight=None):
self.url = url
self.app = app
self.highlight = highlight or []
self.data = []
self.created = None
def get_data(self):
if self.data:
... | willkg/postatus | postatus/status.py | Python | bsd-3-clause | 4,559 | 0.001535 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | eneldoserrata/marcos_openerp | addons/report_xls/report_xls.py | Python | agpl-3.0 | 9,067 | 0.002207 |
from __future__ import print_function, division
from sympy.concrete.expr_with_limits import AddWithLimits
from sympy.concrete.expr_with_intlimits import ExprWithIntLimits
from sympy.core.function import Derivative
from sympy.core.relational import Eq
from sympy.core.singleton import S
from sympy.core.symbol import (Du... | grevutiu-gabriel/sympy | sympy/concrete/summations.py | Python | bsd-3-clause | 24,412 | 0.001106 |
import Tkinter
import tkMessageBox
top = Tkinter.Tk()
def helloCallBack():
tkMessageBox.showinfo( "Hello Python", "Hello World")
B = Tkinter.Button(top, text ="Hello", command = helloCallBack)
B.pack()
top.mainloop()
| dtg01100/edi-to-csv-converter | button.py | Python | gpl-3.0 | 224 | 0.03125 |
#! /usr/bin/env python
# coding=utf8
#
# Copyright (c) 2008 James Molloy, Jörg Pfähler, Matthew Iselin
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#... | jmolloy/pedigree | scripts/buildLibc.py | Python | isc | 2,327 | 0.005161 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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... | kshimo69/IkaLog | ikalog/outputs/alive_squids_csv.py | Python | apache-2.0 | 3,445 | 0.001462 |
import pytest
from thefuck.types import Command
from thefuck.rules.git_push_without_commits import (
fix,
get_new_command,
match,
)
command = 'git push -u origin master'
expected_error = '''
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:User/repo.git'
'''... | SimenB/thefuck | tests/rules/test_git_push_without_commits.py | Python | mit | 659 | 0 |
# -*- coding: utf-8 -*-
from bpy.types import PropertyGroup
from bpy.props import StringProperty, IntProperty, BoolProperty, FloatProperty, FloatVectorProperty
from mmd_tools.core.bone import FnBone
def _updateMMDBoneAdditionalTransform(prop, context):
prop['is_additional_transform_dirty'] = True
p_bone = co... | lordscales91/blender_mmd_tools | mmd_tools/properties/bone.py | Python | mit | 4,418 | 0.001132 |
# Copyright (c) 2013 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 ... | ntt-sic/neutron | neutron/plugins/ml2/drivers/mech_openvswitch.py | Python | apache-2.0 | 2,288 | 0 |
# -*- coding: utf-8 -*-
'''
Created on 2014-04-09
@author: Krzysztof Langner
'''
# import iclogger.file_logger as Logger
import iclogger.dynamodb_logger as Logger
if __name__ == "__main__":
Logger.app.run(debug=True) | klangner/iclogger | src/dev_server.py | Python | bsd-2-clause | 223 | 0.004484 |
import unittest
class TestGenearate(unittest.TestCase):
def setUp(self):
self.seq = range(10)
def test_smoke(self):
"Basic smoke test that should pickup any silly errors"
import external_naginator
external_naginator.__name__ == "external_naginator"
if __name__ == '__main__':... | daniellawrence/external_naginator | tests/test_basic.py | Python | mit | 341 | 0.002933 |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [−2,1,−3,4,−1,2,1,−5,4],
the contiguous subarray [4,−1,2,1] has the largest sum = 6.
More practice:
I... | Jan-zou/LeetCode | python/Array/53_maximum_subarray.py | Python | mit | 942 | 0.003297 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | citrix-openstack/horizon | horizon/horizon/dashboards/nova/containers/tests.py | Python | apache-2.0 | 10,798 | 0.000648 |
# -*- coding: utf-8 -*-
import pytz
import re
import time
import openerp
import openerp.service.report
import uuid
import collections
import babel.dates
from werkzeug.exceptions import BadRequest
from datetime import datetime, timedelta
from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta... | vileopratama/vitech | src/addons/calendar/calendar.py | Python | mit | 87,632 | 0.004211 |
import sys, time
from django.conf import settings
from django.db import connection, transaction, backend
from django.core import management, mail
from django.dispatch import dispatcher
from django.test import signals
from django.template import Template
# The prefix to put on the default database name when creating
# ... | jonaustin/advisoryscan | django/django/test/utils.py | Python | mit | 6,373 | 0.006433 |
# ============================================================================
# FILE: size.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
from defx.base.column import Base, Highlights
from defx.context im... | SpaceVim/SpaceVim | bundle/defx.nvim/rplugin/python3/defx/column/size.py | Python | gpl-3.0 | 1,686 | 0 |
import random
from Person import Person
class House(object):
def __init__(self):
self.rooms = []
self.actors = []
def __str__(self):
house_string = ""
for room in self.rooms:
house_string = house_string + str(room) + "\n\n"
return house_string[:-2]
def... | jdpepperman/houseSimulation | modules/House.py | Python | gpl-2.0 | 2,102 | 0.001903 |
# Copyright 2019 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 to in writing, ... | tensorflow/data-validation | tensorflow_data_validation/statistics/generators/sparse_feature_stats_generator.py | Python | apache-2.0 | 7,813 | 0.004736 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class School(models.Model):
_name = 'royalty.school'
name = fields.Char('Name', size=255, required=True)
address_line1 = fields.Char( 'Address 1', size=255 )
address_line2 = fields.Char( 'Address 2', size=255 )
city... | murphybytes/royalty | models/school.py | Python | mit | 841 | 0.042806 |
from unittest import mock
import pytest
from mitmproxy.test import tflow
from mitmproxy.net.http import http1
from mitmproxy.net.tcp import TCPClient
from mitmproxy.test.tutils import treq
from ... import tservers
class TestHTTPFlow:
def test_repr(self):
f = tflow.tflow(resp=True, err=True)
asse... | ujjwal96/mitmproxy | test/mitmproxy/proxy/protocol/test_http1.py | Python | mit | 3,325 | 0.000902 |
#encoding=utf-8
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "liyi"
__date__ = "2017-07-06"
import os
import sys
import argparse
import collections
import logging
import codecs
import charset
def generate_vocab(source_paths, save_path, d... | liyi193328/seq2seq | run_scripts/vocab.py | Python | apache-2.0 | 3,713 | 0.011869 |
name = raw_input("Enter your name:")
print "Hello" , name
| Pontianak/Python-For-Informatics-Assignments | 2.2.py | Python | mit | 58 | 0.017241 |
from typing import (
Iterable,
Mapping,
Union,
)
from pcs.cli.common.errors import (
SEE_MAN_CHANGES,
CmdLineInputError,
)
from pcs.common.str_tools import (
format_list,
format_plural,
)
from pcs.common.tools import timeout_to_seconds
ModifierValueType = Union[None, bool, str]
ARG_TYPE_D... | tomjelinek/pcs | pcs/cli/common/parse_args.py | Python | gpl-2.0 | 21,092 | 0.000379 |
from django.apps import AppConfig
class MoocConfig(AppConfig):
name = 'mooc'
| Zing22/Moogle | moogle/mooc/apps.py | Python | mit | 83 | 0 |
import sympy
x1, x2 = sympy.symbols('x1 x2')
f = 100*(x2 - x1**2)**2 + (1-x1)**2
df_dx1 = sympy.diff(f,x1)
df_dx2 = sympy.diff(f,x2)
H = sympy.hessian(f, (x1, x2))
xs = sympy.solve([df_dx1, df_dx2], [x1, x2])
H_xs = H.subs([(x1,xs[0][0]), (x2,xs[0][1])])
lambda_xs = H_xs.eigenvals()
count = 0
for i in lambda_xs.ke... | escorciav/amcs211 | hw3/hw3_2a.py | Python | bsd-2-clause | 502 | 0.007968 |
# -*- coding: utf-8 -*-
import logging
import re
import salt.client
from netaddr import IPNetwork, IPAddress
log = logging.getLogger(__name__)
def ping(cluster = None, exclude = None, **kwargs):
"""
Ping all addresses from all addresses on all minions. If cluster is passed,
restrict addresses to public... | supriti/DeepSea | srv/modules/runners/net.py | Python | gpl-3.0 | 8,475 | 0.009558 |
#!/usr/local/bin/python3.5
import itertools
import sys
from .stuff import word_set
__version__ = "1.1.0"
def find_possible(lst):
"""
Return all possible combinations of letters in lst
@type lst: [str]
@rtype: [str]
"""
returned_list = []
for i in range(0, len(lst) + 1):
for subs... | patrickleweryharris/anagram-solver | anagram_solver/anagram_solver.py | Python | mit | 1,532 | 0 |
# %% [markdown]
# # sklearn-porter
#
# Repository: [https://github.com/nok/sklearn-porter](https://github.com/nok/sklearn-porter)
#
# ## RandomForestClassifier
#
# Documentation: [sklearn.ensemble.RandomForestClassifier](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html)
# %... | nok/sklearn-porter | examples/estimator/classifier/RandomForestClassifier/js/basics_embedded.pct.py | Python | mit | 1,213 | 0.004122 |
from typing import Optional
from common.serializers.serialization import state_roots_serializer
from crypto.bls.bls_bft import BlsBft
from crypto.bls.bls_bft_replica import BlsBftReplica
from crypto.bls.bls_multi_signature import MultiSignature, MultiSignatureValue
from crypto.bls.indy_crypto.bls_crypto_indy_crypto im... | evernym/plenum | plenum/bls/bls_bft_replica_plenum.py | Python | apache-2.0 | 16,403 | 0.002561 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-28 14:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Employee'... | Avinash-Raj/appengine-django-skeleton | todo/migrations/0001_initial.py | Python | bsd-3-clause | 599 | 0.001669 |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Molecule design set library table.
"""
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy impo... | helixyte/TheLMA | thelma/repositories/rdb/schema/tables/moleculedesignlibrary.py | Python | mit | 1,817 | 0.002201 |
from .careful import *
from .noisy import *
from . import streams
from . import resetable
from lasagne.updates import * | maxim-borisyak/craynn | craynn/updates/__init__.py | Python | mit | 121 | 0.008264 |
'''Publish sensor events to MQTT broker.'''
import logging
import paho.mqtt.publish as mqtt_pub
import paho.mqtt.client as mqtt
import socket
class MqttPublisher():
'''Publish sensor events to an MQTT broker.'''
def __init__(self, broker, topic_prefix='/sensors'):
'''Initialize a MqttPublisher inst... | motlib/mqtt-ts | src/pub/evtpub.py | Python | gpl-3.0 | 1,817 | 0.003302 |
from ft.db.dbtestcase import DbTestCase
from passerine.db.session import Session
from passerine.db.common import ProxyObject
from passerine.db.uow import Record
from passerine.db.entity import entity
from passerine.db.mapper import link, CascadingType, AssociationType
@entity('test_db_uow_ass_one_to_many_computer')
cl... | shiroyuki/passerine | test/ft/db/test_uow_association_one_to_many.py | Python | mit | 4,063 | 0.001969 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | HaebinShin/tensorflow | tensorflow/tools/test/run_and_gather_logs.py | Python | apache-2.0 | 3,287 | 0.006693 |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | sunqm/pyscf | pyscf/cc/ccsd_t.py | Python | apache-2.0 | 10,987 | 0.012469 |
# ===============================================================================
# Copyright (c) 2014 Geoscience Australia
# 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... | alex-ip/agdc | api/source/main/python/datacube/api/__init__.py | Python | bsd-3-clause | 6,195 | 0.002744 |
#! /usr/bin/env python
"""
Notes
-----
Calculations are carried out with numpy.float64 precision.
This Python implementation is not optimized for speed.
Angles are in radians unless specified otherwise.
Quaternions ix+jy+kz+w are represented as [x, y, z, w].
"""
import rospy
# Messages
from std_msgs.msg import Float... | fsuarez6/rate_position_controller | scripts/bubble_technique.py | Python | bsd-3-clause | 12,314 | 0.013805 |
# coding: utf-8
from rest_framework import viewsets
from kpi.models import UserAssetSubscription
from kpi.serializers.v2.user_asset_subscription import (
UserAssetSubscriptionSerializer,
)
from kpi.utils.object_permission import get_database_user
class UserAssetSubscriptionViewSet(viewsets.ModelViewSet):
que... | kobotoolbox/kpi | kpi/views/v2/user_asset_subscription.py | Python | agpl-3.0 | 863 | 0 |
#!/usr/bin/env python2
#-*-indent-tabs-mode: nil-*-
import sys
import os.path
import gi
from gi.repository import Gtk, Gio
SCHEMAS = "org.cinnamon.desklets.launcher"
LAUNCHER_KEY = "launcher-list"
HOME_DIR = os.path.expanduser("~")+"/"
CUSTOM_LAUNCHERS_PATH = HOME_DIR + ".cinnamon/panel-launchers/"
EDITOR_DIALOG_UI... | artourkin/Cinnamon | files/usr/share/cinnamon/desklets/launcher@cinnamon.org/editorDialog.py | Python | gpl-2.0 | 8,165 | 0.004776 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | oliver-sanders/cylc | tests/unit/tui/test_data.py | Python | gpl-3.0 | 1,331 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python implementation of Poincaré Embeddings.
These embeddings are better at capturing... | napsternxg/gensim | gensim/models/poincare.py | Python | gpl-3.0 | 75,098 | 0.003356 |
from django.conf import settings
from django.utils import httpwrappers
from django.core.mail import mail_managers
import md5, os
class CommonMiddleware:
"""
"Common" middleware for taking care of some basic operations:
- Forbids access to User-Agents in settings.DISALLOWED_USER_AGENTS
- URL r... | tungvx/deploy | Django-0.90/django/middleware/common.py | Python | apache-2.0 | 3,684 | 0.004343 |
# -*- coding: utf-8 -*-
import requests
import urlparse
class TV(object):
def __init__(self, url):
self.url = url
self.chan = None
self.stream = None
def _post(self, endpoint, json):
url = urlparse.urljoin(self.url, endpoint)
try:
requests.post(url, json=j... | tschaefer/remote | remote/tv.py | Python | bsd-3-clause | 1,157 | 0.001729 |
import os
import unittest
from robot.utils.asserts import assert_equal, assert_true
from robot.utils.etreewrapper import ETSource, ET
from robot.utils import IRONPYTHON, PY3
PATH = os.path.join(os.path.dirname(__file__), 'test_etreesource.py')
if PY3:
unicode = str
class TestETSource(unittest.TestCase):
d... | alexandrul-ci/robotframework | utest/utils/test_etreesource.py | Python | apache-2.0 | 1,816 | 0 |
# Django
from django.conf.urls import patterns, url
# local Django
from organization.views import OrganizationCreateView, OrganizationDeleteView, OrganizationListView, OrganizationUpdateView
urlpatterns = patterns(
'',
url(r'^create/$', OrganizationCreateView.as_view(), name='create'),
url(r'^delete/(?P<o... | kamsuri/vms | vms/organization/urls.py | Python | gpl-2.0 | 585 | 0.001709 |
# -*- coding: utf-8 -*-
#
# GPy documentation build configuration file, created by
# sphinx-quickstart on Fri Sep 18 18:16:28 2015.
#
# 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
# autogenerated file.
#
# All c... | SheffieldML/GPy | doc/source/conf.py | Python | bsd-3-clause | 12,464 | 0.007221 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Nandaja Varma <nvarma@redhat.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 Software Foundation; either version 3 of the License, or
# (at your option) any later ve... | lioupayphone/gdeploy | gdeploylib/helpers.py | Python | gpl-2.0 | 21,630 | 0.001803 |
import unittest
from gi.repository import GElektra as kdb
TEST_NS = "user/tests/gi_py3"
class Constants(unittest.TestCase):
def setUp(self):
pass
def test_kdbconfig_h(self):
self.assertIsInstance(kdb.DB_SYSTEM, str)
self.assertIsInstance(kdb.DB_USER, str)
self.assertIsInstance(kdb.DB_HOME, str)
self.... | e1528532/libelektra | src/bindings/gi/python/testgi_kdb.py | Python | bsd-3-clause | 1,632 | 0.03125 |
#
# Read KRW-USD rates
#
# We have data from 1994 to 2009
years = range(1994, 2010)
# read one year into list data
def read_year(yr, data):
fname = "data/%d.txt" % yr
f = open(fname, "r")
for l in f:
date1, value1 = l.split()
value = float(value1)
# convert to KRW per USD
value = int(1.0 / value... | otfried/cs101 | code/files/krw1.py | Python | gpl-3.0 | 1,258 | 0.031797 |
# 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 os, sys
from ipdl.ast import Visitor
from ipdl.ast import IN, OUT, INOUT, ASYNC, SYNC, RPC
class CodePrinter:
... | sergecodd/FireFox-OS | B2G/gecko/ipc/ipdl/ipdl/cgen.py | Python | apache-2.0 | 3,280 | 0.007927 |
#!/usr/bin/env python
# Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
"""
Description here
"""
import logging as log
def check_liveness(ax, model, args, simconfig, timestep):
dif... | mmadsen/axelrod-ct | madsenlab/axelrod/utils/convergence.py | Python | apache-2.0 | 839 | 0.004768 |
#!/usr/bin/env python3
import sys
import os
import time
import atexit
from signal import SIGTERM
import logging
import logging.handlers
# load the config
from foostat import config
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
filehandler = logging.handlers.TimedRotatingFileHandler(config["files"]["lo... | dhardtke/foostat | Daemon.py | Python | mit | 5,006 | 0.001798 |
from bs4 import BeautifulSoup
import time
from selenium import webdriver
from pyvirtualdisplay import Display
__PROCESSOR = 'lxml'
__OFFERS_CLASS = 'offer-listing'
__PRICE_CLASS = 'dollars'
__FLIGHT_DURATION_CLASS = 'duration-emphasis'
__LAYOVR_CLASS = ''
__AIRLINE_CLASS = ''
def get_page_offers(url):
display =... | Shadi-A/ExpediaCrawler | expediacrawler/soupParser.py | Python | mit | 2,286 | 0.002625 |
"""Procedures to initialize the full text search in PostgresQL"""
from django.db import connection
def setup_full_text_search(script_path):
"""using postgresql database connection,
installs the plsql language, if necessary
and runs the stript, whose path is given as an argument
"""
fts_init_query =... | tvenkat/askbot-devel | askbot/search/postgresql/__init__.py | Python | gpl-3.0 | 723 | 0.004149 |
################################################################################
#
# Copyright 2015-2020 Félix Brezo and Yaiza Rubio
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... | i3visio/osrframework | osrframework/wrappers/pending/cloudflare/forocoches.py | Python | agpl-3.0 | 4,071 | 0.004914 |
# coding=utf-8
"""
Layer that support point clustering
===================================
"""
from os.path import dirname, join
from math import sin, log, pi, atan, exp, floor, sqrt
from mapview.view import MapLayer, MapMarker
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import (Obje... | shivan1b/pydelhi_mobile | pydelhiconf/libs/garden/garden.mapview/mapview/clustered_marker_layer.py | Python | agpl-3.0 | 13,896 | 0.001007 |
import os
import string
import random
from fabric.api import env
from fabric.colors import green
from literals import (DEFAULT_INSTALL_PATH, DEFAULT_VIRTUALENV_NAME,
DEFAULT_REPOSITORY_NAME, DEFAULT_OS, OS_CHOICES,
DEFAULT_DATABASE_MANAGER, DB_CHOICES, DEFAULT_DATABASE_NAME,
DEFAULT_WEBSERVER, WEB_CHOIC... | appsembler/mayan_appsembler | fabfile/conf.py | Python | gpl-3.0 | 2,675 | 0.00972 |
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
('', include('imago.urls')),
url(r'^report/(?P<module_name>[a-z0-9_]+)/$', 'reports.views.report', name='report'),
url(r'^represent/(?P<module_name>[a-z0-9_]+)/$', 'reports.views.represent', name='represent'),
url(r'^warning... | datamade/scrapers_ca_app | scrapers_ca_app/urls.py | Python | mit | 423 | 0.007092 |
from django.http import Http404
from django.shortcuts import render
from . import models
def index(request):
# Generate counts of some of the main objects
num_projects = models.Project.objects.all().count()
num_tasks = models.Tasks.objects.all().count()
num_fundings = models.Fundings.objects.all().co... | amexperts/bounty | projects/views.py | Python | gpl-3.0 | 1,079 | 0.007414 |
from helper import greeting
if "__name__" == "__main__":
greeting('hello') | jay4ek/cs3240-labdemo | hello.py | Python | mit | 75 | 0.026667 |
from datetime import timedelta
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.osv import orm
import openerp.tests.common as test_common
from .common import BaseAgreementTestMixin
class TestAgreementPriceList(test_common.TransactionCase,
BaseAgreementTestMixin):
"""... | rschnapka/purchase-workflow | framework_agreement/tests/test_framework_agreement_price_list.py | Python | agpl-3.0 | 4,066 | 0 |
from fabric.context_managers import settings
from golive.layers.base import BaseTask, DebianPackageMixin, IPTablesSetup
from golive.stacks.stack import environment
from golive.utils import get_remote_envvar
class RabbitMqSetup(BaseTask, DebianPackageMixin):
package_name = "rabbitmq-server"
GUEST_USER = "guest... | fatrix/django-golive | golive/layers/queue.py | Python | bsd-2-clause | 2,683 | 0.002609 |
from __future__ import absolute_import
__all__ = ("DebugMeta",)
from sentry.interfaces.base import Interface
from sentry.utils.json import prune_empty_keys
class DebugMeta(Interface):
"""
Holds debug meta information for processing stacktraces
and similar things. This information is deleted after event... | mvaled/sentry | src/sentry/interfaces/debug_meta.py | Python | bsd-3-clause | 1,172 | 0 |
#!/usr/bin/python
import sys
import os
if len(sys.argv) >= 4 :
filename = sys.argv[1]
row_i = int(sys.argv[2])-1
target_ls_filename = sys.argv[3]
output_filename = sys.argv[4]
else:
print("usage: python selectrow.py filename row_i target_ls_filename")
print("or ./selectrow.py filename row_i ta... | jason-weirather/IDP | bin/selectrow.py | Python | apache-2.0 | 1,076 | 0.01487 |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from .forms import LoginForm
class LoginViewTest(TestCase):
def setUp(self):
self.client = Client()
self.response = self.client.get(reve... | delete/estofadora | estofadora/login/tests.py | Python | mit | 3,269 | 0.001835 |
# 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-storage/azure/mgmt/storage/v2015_06_15/models/usage.py | Python | mit | 1,829 | 0 |
""" Django-admin autoregister -- automatic model registration
## sample admin.py ##
from yourproject.autoregister import autoregister
# register all models defined on each app
autoregister('app1', 'app2', 'app3', ...)
"""
from django.db.models import get_models, get_app
from django.contrib import admin
from django... | SlashRoot/WHAT | what_apps/utility/admin.py | Python | mit | 665 | 0.006015 |
from common import *
import conduit.datatypes.File as File
import conduit.utils as Utils
import os
import tempfile
import datetime
import random
import stat
tmpdir = tempfile.mkdtemp()
ok("Created tempdir %s" % tmpdir, True)
contents = Utils.random_string()
name = Utils.random_string()+".foo"
tmpFile = File.TempFile... | arsfeld/conduit | test/python-tests/TestCoreTempFile.py | Python | gpl-2.0 | 4,008 | 0.010729 |
"""Tests for the Hyperion config flow."""
import logging
from typing import Any, Dict, Optional
from hyperion import const
from homeassistant import data_entry_flow
from homeassistant.components.hyperion.const import (
CONF_AUTH_ID,
CONF_CREATE_TOKEN,
CONF_PRIORITY,
DOMAIN,
)
from homeassistant.compo... | tboyce1/home-assistant | tests/components/hyperion/test_config_flow.py | Python | apache-2.0 | 26,352 | 0.002277 |
#!/usr/bin/env python3
# Python libs
import os.path
import sys
import icebox
# FIXME: Move this into icebox
parts = [
# LP Series (Low Power)
"lp384",
"lp1k",
"lp8k",
# Unsupported: "lp640", "lp4k" (alias for lp8k),
# LM Series (Low Power, Embedded IP)
# Unsupported: "lm1k", "lm2k",
... | SymbiFlow/symbiflow-arch-defs | ice40/utils/ice40_list_layout_in_icebox.py | Python | isc | 972 | 0 |
'''
charlie.py
---class for controlling charlieplexed SparkFun 8x7 LED Array with the Raspberry Pi
Relies upon RPi.GPIO written by Ben Croston
The MIT License (MIT)
Copyright (c) 2016 Amanda Cole
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentati... | mandyRae/pythonic-charlieplex | charlie.py | Python | mit | 5,714 | 0.029051 |
# Copyright © 2016-2017 Simon McVittie
# SPDX-License-Identifier: GPL-2.0+
# (see vectis/__init__.py)
import os
import pwd
import shutil
import subprocess
from tempfile import TemporaryDirectory
from debian.debian_support import (
Version,
)
from vectis.commands.new import vmdebootstrap_argv
from vectis.error im... | smcv/vectis | vectis/commands/bootstrap.py | Python | gpl-2.0 | 4,115 | 0 |
# coding: utf8
from __future__ import unicode_literals
# Adding a lemmatizer lookup table
# Documentation: https://spacy.io/docs/usage/adding-languages#lemmatizer
# Entries should be added in the following format:
LOOKUP = {
"آ": "آنا",
"آْباد": "آْباد",
"آثار": "آثار",
"آثارِ": "آثارِ",
"آثارالصنادید": ... | recognai/spaCy | spacy/lang/ur/lemmatizer.py | Python | mit | 921,455 | 0.000003 |
""" Cisco_IOS_XR_patch_panel_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR patch\-panel package configuration.
This module contains definitions
for the following management objects\:
patch\-panel\: patch\-panel service submode
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All right... | 111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_patch_panel_cfg.py | Python | apache-2.0 | 2,513 | 0.035814 |
import pytest
from saleor.graphql.core.utils.reordering import perform_reordering
from saleor.product import models
SortedModel = models.AttributeValue
def _sorted_by_order(items):
return sorted(items, key=lambda o: o[1])
def _get_sorted_map():
return list(
SortedModel.objects.values_list("pk", "s... | maferelo/saleor | tests/api/test_core_reordering.py | Python | bsd-3-clause | 8,739 | 0.001831 |
# -*- coding: utf-8 -*-
import unittest
from test.basetestcases import PluginLoadingMixin
class StatisticsLoadingTest (PluginLoadingMixin, unittest.TestCase):
def getPluginDir(self):
"""
Должен возвращать путь до папки с тестируемым плагином
"""
return "../plugins/statistics"
... | unreal666/outwiker | src/test/plugins/statistics/test_loading.py | Python | gpl-3.0 | 587 | 0 |
#!/usr/bin/env python
"""
These functions search the environment for software dependencies and configuration.
"""
from __future__ import unicode_literals
import os
import subprocess
import logging
import pkg_resources
import ciftify.utilities as util
def find_workbench():
"""
Returns path of the workbench bi... | BrainIntensive/OnlineBrainIntensive | resources/HCP/ciftify/ciftify/config.py | Python | mit | 8,757 | 0.006052 |
#!/usr/bin/env python
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest
import random, numpy
from gnuradio import digital, blocks, channels
class qa_linear_equalizer(gr_unittest.TestCase):
... | jdemel/gnuradio | gr-digital/python/digital/qa_linear_equalizer.py | Python | gpl-3.0 | 5,126 | 0.013461 |
#
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 ... | isb-cgc/ISB-CGC-Webapp | scripts/isb_auth.py | Python | apache-2.0 | 4,266 | 0.003516 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserKey'
db.create_table('sshkey_userkey', (
('id', self.gf('django.db.models.... | ClemsonSoCUnix/django-sshkey | django_sshkey/south_migrations/0001_initial.py | Python | bsd-3-clause | 5,536 | 0.008309 |
"""Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer ... | obsh/tornado | tornado/websocket.py | Python | apache-2.0 | 41,216 | 0.000146 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | pacoqueen/bbinn | formularios/trazabilidad_articulos.py | Python | gpl-2.0 | 71,269 | 0.007906 |
from images import fields
from product_images.models import ProductImage
class ImagesFormField(fields.ImagesFormField):
def __init__(self):
super().__init__(ProductImage)
| pmaigutyak/mp-shop | product_images/fields.py | Python | isc | 188 | 0 |
from __future__ import print_function
from __future__ import unicode_literals
import io
import os.path
import pipes
import sys
from pre_commit import output
from pre_commit.util import make_executable
from pre_commit.util import mkdirp
from pre_commit.util import resource_filename
# This is used to identify the hoo... | Lucas-C/pre-commit | pre_commit/commands/install_uninstall.py | Python | mit | 3,549 | 0 |
intervals = [[10,20],[6,15],[0,22]]
print(sorted(intervals)) | jackchi/interview-prep | leetcode/meeting_rooms.py | Python | mit | 61 | 0.098361 |
self.Step (Message = "Receptionist-N ->> Klient-N [genvej: fokus-modtagerliste] (måske)")
self.Step (Message = "Receptionist-N ->> Klient-N [retter modtagerlisten]")
| AdaHeads/Hosted-Telephone-Reception-System | use-cases/.patterns/adjust_recipients/test.py | Python | gpl-3.0 | 217 | 0.041667 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.data import flt, nowdate, getdate, cint
class MoneyTransfere... | ahmadRagheb/goldenHR | erpnext/accounts/doctype/money_transfere/money_transfere.py | Python | gpl-3.0 | 4,294 | 0.034958 |
from django.conf.urls import patterns, url, include
from .views import empty_view, empty_view_partial, empty_view_wrapped, absolute_kwargs_view
other_patterns = patterns('',
url(r'non_path_include/$', empty_view, name='non_path_include'),
url(r'nested_path/$', 'urlpatterns_reverse.views.nested_view'),
)
url... | oscaro/django | tests/urlpatterns_reverse/urls.py | Python | bsd-3-clause | 3,830 | 0.003394 |
# Django settings for hikeplanner project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Jaime', 'jaime.m.mccandless@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
#'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'ENGINE': ... | jsquare/hikeplanner | src/settings.py | Python | gpl-2.0 | 5,672 | 0.001234 |
#
# Copyright (c) 2004 Conectiva, Inc.
# Copyright (c) 2005--2013 Red Hat, Inc.
#
# From code written by Gustavo Niemeyer <niemeyer@conectiva.com>
# Modified by Joel Martin <jmartin@redhat.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager is free software; you can redistribute it and/or
# m... | PaulWay/spacewalk | client/solaris/smartpm/smart/interfaces/up2date/interface.py | Python | gpl-2.0 | 19,239 | 0.001663 |
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | rubenk/cobbler | cobbler/server/xmlrpclib2.py | Python | gpl-2.0 | 9,102 | 0.002857 |
import os
import zipfile
import csv
from django.core.management.base import BaseCommand
from django.db import transaction
from django.conf import settings
from ...models import Service
def get_service(row):
for region in 'EA', 'EM', 'WM', 'SE', 'SW':
col = 'TNDS-' + region
if row[col]:
... | stev-0/bustimes.org.uk | busstops/management/commands/import_accessibility.py | Python | mpl-2.0 | 1,772 | 0.001693 |
import re
CJDNS_IP_REGEX = re.compile(r'^fc[0-9a-f]{2}(:[0-9a-f]{4}){7}$', re.IGNORECASE)
class Node(object):
def __init__(self, ip, version=None, label=None):
if not valid_cjdns_ip(ip):
raise ValueError('Invalid IP address')
if not valid_version(version):
raise ValueErro... | vdloo/raptiformica-map | raptiformica_map/graph.py | Python | gpl-3.0 | 1,111 | 0 |
from app import db
class Pets(db.Model):
__tablename__ = 'pets'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(128), unique=True)
color = db.Column(db.String(30))
pet = db.Column(db.String(10))
def __init__(self, name, color, pet):
self.name = name
sel... | jairoserrano/simpledevops | models.py | Python | apache-2.0 | 425 | 0.002353 |
# -*- coding: utf-8 -*-
#
# Rackspace Developer Documentation documentation build configuration file,
# created by sphinx-quickstart on Thu Mar 6 14:14:55 2014.
#
# 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
#... | RobinJoe/Docs | doc/conf.py | Python | gpl-3.0 | 8,757 | 0 |
import urllib.request
import os
'''if set smallFileMode to True, the program will use simpleDownload method, which may be faster for many small files but do not support break point resume.'''
smallFileMode=False
def showProgress(blockNum, blockSize, totalSize):
'''Called by urllib.request.urlretrieve
return the... | George-Gate/CERN-Video-Downloader | PerformDownload.py | Python | mit | 9,240 | 0.018831 |
def do_something():
for i in range(100):
print(i)
| jkorell/PTVS | Python/Tests/TestData/DebuggerProject/A/module1.py | Python | apache-2.0 | 67 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.