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 |
|---|---|---|---|---|---|---|
# 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... | kobejean/tensorflow | tensorflow/python/training/checkpoint_utils.py | Python | apache-2.0 | 15,013 | 0.005728 |
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. 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/license... | tripzero/soletta | data/gdb/libsoletta.so-gdb.py | Python | apache-2.0 | 29,075 | 0.002511 |
def main():
return
| zwChan/VATEC | ~/eb-virt/Lib/site-packages/wheel/test/complex-dist/complexdist/__init__.py | Python | apache-2.0 | 23 | 0 |
"""
This module provides miscellaneous utilities.
.. moduleauthor:: Fabian Hirschmann <fabian@hirschmann.email>
.. moduleauthor:: Michael Markert <markert.michael@googlemail.com>
:copyright: PenchY Developers 2011-2012, see AUTHORS
:license: MIT License, see LICENSE
"""
from __future__ import print_function
impo... | fhirschmann/penchy | penchy/util.py | Python | mit | 6,303 | 0.000476 |
#!/usr/bin/env python
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2011-2013 Marcus Popp marcus@popp.mx
#########################################################################
# ... | mptei/smarthome | lib/logic.py | Python | gpl-3.0 | 4,430 | 0.001806 |
"""
Test lldb breakpoint command add/list/delete.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import side_effect
class BreakpointCommandTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
... | apple/swift-lldb | packages/Python/lldbsuite/test/commands/breakpoint/basic/TestBreakpointCommand.py | Python | apache-2.0 | 12,042 | 0.002076 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import os
import re
import subprocess
import sys
from datetime import date
import click
import yaml
from... | ThiefMaster/indico | bin/maintenance/update_header.py | Python | mit | 8,843 | 0.003279 |
# -*- test-case-name: txdav.carddav.datastore.test -*-
##
# Copyright (c) 2010-2014 Apple 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/l... | trevor/calendarserver | txdav/carddav/datastore/test/__init__.py | Python | apache-2.0 | 695 | 0 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | wulczer/ansible | v2/ansible/executor/playbook_iterator.py | Python | gpl-3.0 | 4,905 | 0.018756 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008-2011 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or... | stelfrich/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/controller/impexp.py | Python | gpl-2.0 | 1,024 | 0 |
# Generated by Django 3.2.6 on 2021-10-19 09:14
from django.db import migrations
from ureport.sql import InstallSQL
class Migration(migrations.Migration):
dependencies = [
("polls", "0069_pollquestion_color_choice"),
]
operations = [InstallSQL("polls_0070")]
| rapidpro/ureport | ureport/polls/migrations/0070_install_triggers.py | Python | agpl-3.0 | 285 | 0 |
#!/usr/bin/env python3
"""
librepo - download a package
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 40
finished = False
def callback(data, total_to_download, downloaded):
"""Progress callback"""
global finished
if to... | Tojaj/librepo | examples/python/download_package.py | Python | lgpl-2.1 | 1,388 | 0.005764 |
from corehq.apps.users.models import CommCareUser
from corehq.apps.hqcase.management.commands.ptop_fast_reindexer import PtopReindexer
from corehq.pillows.user import UserPillow
CHUNK_SIZE = 500
POOL_SIZE = 15
class Command(PtopReindexer):
help = "Fast reindex of user elastic index by using the domain view and r... | gmimano/commcaretest | corehq/apps/users/management/commands/ptop_fast_reindex_users.py | Python | bsd-3-clause | 433 | 0.004619 |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool by AusAid -**InaSAFE Wizard**
This module provides: Keyword Wizard Step: Classification Selector
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Pu... | Samweli/inasafe | safe/gui/tools/wizard/step_kw25_classification.py | Python | gpl-3.0 | 6,796 | 0 |
from weighted_quantiles import median
from scipy.stats import ks_2samp
import numpy as np
import os
import matplotlib.pyplot as plt
from frbpoppy import unpickle, TNS, poisson_interval, pprint
from tests.rates.alpha_real import EXPECTED
from tests.convenience import plot_aa_style, rel_path
from simulations import Simu... | davidgardenier/frbpoppy | tests/monte_carlo/goodness_of_fit.py | Python | mit | 11,050 | 0 |
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2017 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 o... | CERNDocumentServer/invenio | modules/websubmit/lib/functions/Print_Success_SRV.py | Python | gpl-2.0 | 1,933 | 0.008795 |
from sympy import I, Integer
from sympy.physics.quantum.innerproduct import InnerProduct
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.state import Bra, Ket, StateBase
def test_innerproduct():
k = Ket('k')
b = Bra('b')
ip = InnerProduct(b, k)
assert isinstance(ip, InnerPr... | wxgeo/geophar | wxgeometrie/sympy/physics/quantum/tests/test_innerproduct.py | Python | gpl-2.0 | 1,468 | 0 |
default_app_config = 'apps.datasetmanager.apps.datasetmanagerConfig'
| almey/policycompass-services | apps/datasetmanager/__init__.py | Python | agpl-3.0 | 69 | 0 |
"""
Allows custom jinja filters.
"""
### Built-in filters ###
def select(value, key):
"""
Select a key from a dictionary.
If ``value`` is not a dictionary or ``key`` does not exist in it,
the ``value`` is returned as is.
"""
return value.get(key, value) if isinstance(value, dict) else value... | locationlabs/confab | confab/jinja_filters.py | Python | apache-2.0 | 2,518 | 0.001191 |
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * ... | wood-galaxy/FreeCAD | src/Mod/Path/PathScripts/PathProfileEdges.py | Python | lgpl-2.1 | 32,805 | 0.003475 |
import sys
sys.path.insert(0, "../utils/")
import utils
def unjudged(qrelsFile, resultsFile):
qrels = utils.readQrels(qrelsFile)
results = utils.readResults(resultsFile)
unjudged = {}
for qid in results.keys():
qrelIds = set([did for (did, _) in qrels[qid]])
resIds = set([did for (did, _, _) in results[qid][:... | fmance/deep-medical-ir | ranking/unjudged.py | Python | gpl-3.0 | 594 | 0.023569 |
from hazelcast.serialization.bits import *
from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.builtin import DataCodec
# hex: 0x021... | hazelcast/hazelcast-python-client | hazelcast/protocol/codec/multi_map_lock_codec.py | Python | apache-2.0 | 1,157 | 0.002593 |
############################ Copyrights and license ############################
# #
# Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com> #
# ... | ahmad88me/PyGithub | github/Project.py | Python | lgpl-3.0 | 10,167 | 0.003836 |
def print_15perc_total_tax(bill):
'''return the amount of money to pay in tax in US dollars
'''
bill = float(bill)
total_tax = str( bill * .15 )
return "please graciously pay at least the amount of {} in total tax ".format(total_tax)
print print_15perc_total_tax(79)
| razzius/PyClassLessons | instructors/course-2015/functions_gens_and_ducks/examples/in_class/warm_up/calc_tax.py | Python | mit | 300 | 0.023333 |
#!/usr/bin/env python
import fileinput
class NotValidIP(Exception):
pass
class NotValidIPLength(Exception):
pass
while True:
try:
ip_addr = input("Enter a network IP address: ")
ip_addr_split = ip_addr.split('.')
len1 = len(ip_addr_split)
ip_addr_split = ip_addr_split[:3]
... | Noeud/KirkByers_Course | Week2/IPaddValidity_hex_bin.py | Python | unlicense | 1,174 | 0.007666 |
# ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The cor... | uclouvain/osis | infrastructure/shared_kernel/entite/dtos.py | Python | agpl-3.0 | 1,467 | 0.000682 |
import html
from urllib.parse import urljoin
from urllib.parse import urlparse
import wiki
from django.urls import resolve
from django.urls.exceptions import Resolver404
from markdown.extensions import Extension
from markdown.postprocessors import AndSubstitutePostprocessor
from markdown.treeprocessors import Treeproc... | nert-gu/Xposition | src/wiki/plugins/redlinks/mdx/redlinks.py | Python | gpl-3.0 | 3,427 | 0.000876 |
import gevent
import urllib
import urlparse
from geventwebsocket import WebSocketError
from gevent.queue import Empty
class BaseTransport(object):
"""Base class for all transports. Mostly wraps handler class functions."""
def __init__(self, handler, config, **kwargs):
"""Base transport class.
... | chrisfranklin/badasschat | badasschat/socketio/transports.py | Python | bsd-3-clause | 11,277 | 0.000709 |
"""
Django settings for djangoecommerce project.
Generated by 'django-admin startproject' using Django 1.9.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impo... | gileno/curso-citi | djangoecommerce/settings.py | Python | cc0-1.0 | 4,345 | 0.001151 |
from django.contrib.auth import get_user_model
from django.db import transaction
from django.db.models.signals import pre_delete
from django.dispatch import Signal, receiver
from misago.categories.models import Category
from misago.categories.signals import delete_category_content, move_category_content
from misago.co... | 1905410/Misago | misago/threads/signals.py | Python | gpl-2.0 | 4,750 | 0.000632 |
from django.core import exceptions
from devserver.logger import GenericLogger
MODULES = []
def load_modules():
global MODULES
MODULES = []
from devserver import settings
for path in settings.DEVSERVER_MODULES:
try:
name, class_name = path.rsplit('.', 1)
except ValueEr... | chriscauley/django-devserver | devserver/models.py | Python | bsd-3-clause | 1,050 | 0.004762 |
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | Phil-LiDAR2-Geonode/pl2-geonode | geonode/catalogue/backends/geonetwork.py | Python | gpl-3.0 | 1,161 | 0 |
#!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# 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/.
#
# ---
# Author: John Egan <jw... | shopkick/flawless | flawless/client/client.py | Python | mpl-2.0 | 9,588 | 0.002607 |
# -*- coding: utf-8 -*-
#
# PressMess processors.py.
# This file contains template processor functions.
# Copyright (C) 2013 Michał Kwiatkowski <michaelflowersky at gmail dot com>
# This file is released under the BSD license, see the COPYING file
from django.conf import settings
def disqus(request):
"""
Hand... | michaelflowersky/pressmess | blog/processors.py | Python | bsd-3-clause | 1,181 | 0.005085 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | zwChan/VATEC | ~/eb-virt/Lib/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | Python | apache-2.0 | 3,764 | 0.000531 |
from . import choose_delivery_package
| OCA/stock-logistics-workflow | delivery_total_weight_from_packaging/wizard/__init__.py | Python | agpl-3.0 | 38 | 0 |
#!/usr/bin/env python
import os
import setuptools
def read_requires(base):
path = os.path.join('tools', base)
requires = []
if not os.path.isfile(path):
return requires
with open(path, 'rb') as h:
for line in h.read.splitlines():
line = line.strip()
if len(line... | JohnGarbutt/TaskFlow | setup.py | Python | apache-2.0 | 1,330 | 0 |
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i.A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/conf/locale/sq/formats.py | Python | mit | 688 | 0 |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import logging
import os
import pkg_resources
import sys
import ConfigParser
from paste.deploy import loadapp, loadwsgi
SERVER = loadwsgi.SERVER
from gunicorn.app.base import Application
fr... | pschanely/gunicorn | gunicorn/app/pasterapp.py | Python | mit | 5,258 | 0.004755 |
""" Tests for library reindex command """
import ddt
from django.core.management import call_command, CommandError
import mock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from common.test.utils... | ahmadiga/min_edx | cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py | Python | agpl-3.0 | 6,713 | 0.004171 |
# -*- coding: utf-8 -*-
#
# two_neurons.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | magnastrazh/NEUCOGAR | nest/serotonin/research/C/nest-2.10.0/examples/nest/gap_junction/two_neurons.py | Python | gpl-2.0 | 2,414 | 0.008285 |
from tkinter import *
from PIL import Image, ImageTk
from mandelbrot import *
from julia_set import *
class App(object):
def __init__(self, master):
# CANVAS
self.ulx, self.uly, self.drx, self.dry, self.def_width = default_settings()[
:5]
self.image = ImageTk.PhotoImage(make_f... | KrozekGimVic/2013-Fraktali | main.py | Python | mit | 2,613 | 0.001914 |
from jabbapylib.distance.dist import lev_dist, ham_dist, similarity
def test_lev_dist():
assert lev_dist('ag-tcc', 'cgctca') == 3
assert lev_dist('GUMBO', 'GAMBOL') == 2
assert lev_dist('Google', 'Yahoo!') == 6
def test_ham_dist():
assert ham_dist('toned', 'roses') == 3
def test_similarity():
ass... | jabbalaci/jabbapylib | tests/distance/test_dist.py | Python | gpl-3.0 | 358 | 0.00838 |
# Copyright (C) 2017, Isaac Porta "uny11"
#
# This file is part of SE-Bigdata.
#
# SE-Bigdata 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... | uny11/SE-Bigdata | bigdata.py | Python | gpl-3.0 | 43,107 | 0.008287 |
#
# init_lib.py
#
# functions for initialization
#
from aws_lib import SpinupError
import base64
from boto import vpc, ec2
from os import environ
from pprint import pprint
import re
import sys
import time
from yaml_lib import yaml_attr
def read_user_data( fn ):
"""
Given a filename, returns the file's co... | smithfarm/ceph-auto-aws | susecon2015/init_lib.py | Python | bsd-3-clause | 9,277 | 0.013905 |
"""
This is the config file for the Migration
There are 3 things to configure.
- the old Database to migrate from
- the new Database to save the migration
- FTP connection to save the files
"""
# Old Database.
# This is where the Data is taken from
dbOld = {
'host': "", # host ip
'port': ... | TeachForAustria/Naschmarkt | migrationscript/config.py | Python | gpl-3.0 | 1,043 | 0 |
import urllib
import telnetlib
import logging
import cjson
from models import BinaryResource
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django import forms
from django.contrib.auth import authenticate, login
from sana.mrs.openmrs import sendToOpenMRS
from sana.mrs.util i... | addisclinic/mobile-dispatch-server | sana/mrs/views.py | Python | bsd-3-clause | 4,834 | 0.004758 |
import tensorflow as tf
class GRU2DCell(tf.contrib.rnn.RNNCell):
"""Gated Recurrent Unit cell (cf. http://arxiv.org/abs/1406.1078)."""
def __init__(self, num_units, channels):
self._num_units = num_units
self._channels = channels
@property
def state_size(self):
return self._nu... | yuxng/DA-RNN | lib/networks/gru2d.py | Python | mit | 2,570 | 0.003502 |
#!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import webapp2
from google.appengine.api import app_identity
from google.appe... | sikegame/udacity-project-4 | main.py | Python | apache-2.0 | 1,600 | 0.000625 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import simplejson as json
import tweepy
import bitly
import urllib2
import sqlite3
from local_settings import TwitterKey, BitlyKey
logging.basicConfig(filename='log.txt', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
def run():
... | chrishan/twitter-bot | twitter-bot/twitter-bot.py | Python | bsd-3-clause | 2,563 | 0.003512 |
from django.template import Library, Node, TemplateSyntaxError
from stats.views import get_next_rank_title_and_exp_points
register = Library()
class SetVariable(Node):
def __init__(self, varname, nodelist):
self.varname = varname
self.nodelist = nodelist
def render(self,context):
... | Kami/sgrstats.com | sgrstats/stats/templatetags/tags.py | Python | apache-2.0 | 1,515 | 0.009901 |
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the h... | Etxea/gestioneide | cambridge/urls.py | Python | gpl-3.0 | 7,898 | 0.018232 |
# perf script event handlers, generated by perf script -g python
# Licensed under the terms of the GNU GPL License version 2
# The common_* event handler fields are the most useful fields common to
# all events. They don't necessarily correspond to the 'common_*' fields
# in the format files. Those fields not availa... | dterei/Scraps | perf/syscall-latency.py | Python | bsd-3-clause | 1,275 | 0.017255 |
from django import forms
from django.forms import ModelForm
from django.db import models
from app.models import NFL_Division
from app.models import NFL_Conference_Choices
class NFL_DivisionForm_Create(ModelForm):
name = forms.CharField(max_length = 100,
widget = forms.TextInput({
... | LarryHillyer/PoolHost | PoolHost/nfl/division/forms.py | Python | gpl-3.0 | 1,479 | 0.025693 |
from pyh import *
list=[[1,'Lucy',25],[2,'Tom',30],[3,'Lily',20]]
page = PyH('Test')
page<<div(style="text-align:center")<<h4('Test table')
mytab = page << table(border="1",cellpadding="3",cellspacing="0",style="margin:auto")
tr1 = mytab << tr(bgcolor="lightgrey")
tr1 << th('id') + th('name')+th('age')
for i in range(l... | MiracleWong/PythonBasic | PyH/demo.py | Python | mit | 635 | 0.031496 |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | esikachev/scenario | sahara/utils/openstack/heat.py | Python | apache-2.0 | 2,155 | 0 |
# encoding: utf-8
# module pango
# from /usr/lib/python2.7/dist-packages/gtk-2.0/pango.so
# by generator 1.135
# no doc
# imports
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class WrapMode(__gobject.GEnum):
# no doc
def __init__(self, *args, **kwargs): # real signature unknown
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/pango/WrapMode.py | Python | gpl-2.0 | 659 | 0.009105 |
# -*- coding: utf-8 -*-
# Copyright(C) 2015 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | sputnick-dev/weboob | modules/entreparticuliers/module.py | Python | agpl-3.0 | 2,203 | 0 |
#!/usr/bin/python
import magic
import sys
m = magic.open(magic.MIME_TYPE)
m.load()
for f in sys.argv[1:]:
try :
print(f, m.file(f))
except :
prin... | pzia/keepmydatas | misc/testmagic.py | Python | mit | 344 | 0.014535 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eithe... | mablae/weblate | weblate/trans/tests/test_machine.py | Python | gpl-3.0 | 10,441 | 0 |
# coding: utf-8
from __future__ import division
class CharityItem(object):
def __init__(self, name, short_desc, long_desc, image_name, detail_image_name, rating, major, minor, objective_money, actual_money):
self.name = name
self.short_desc = short_desc
self.long_desc = long_desc
s... | hanks/Second_Hackson_Demo | BeaconCharityServer/app-server/models.py | Python | mit | 1,796 | 0.002227 |
from zerver.lib.test_classes import WebhookTestCase
class OpsGenieHookTests(WebhookTestCase):
STREAM_NAME = "opsgenie"
URL_TEMPLATE = "/api/v1/external/opsgenie?&api_key={api_key}&stream={stream}"
WEBHOOK_DIR_NAME = "opsgenie"
def test_acknowledge_alert(self) -> None:
expected_topic = "Integr... | rht/zulip | zerver/webhooks/opsgenie/tests.py | Python | apache-2.0 | 7,350 | 0.002041 |
# TODO separate into different package modules
| dibaunaumh/fcs-skateboard | fcs_aux/mies/__init__.py | Python | agpl-3.0 | 47 | 0 |
# Natural Language Toolkit: Clusterers
#
# Copyright (C) 2001-2010 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
This module contains a number of basic clustering algorithms. Clustering
describes the task of discovering groups of si... | markgw/jazzparser | lib/nltk/cluster/__init__.py | Python | gpl-3.0 | 4,217 | 0.000474 |
################################################################################
# iso_read.py
#
# Simple ISO NC code parsing
#
# Hirutso Enni, 2009-01-13
""" use this script to backplot nc files to *.scr file for autocad,bricscad,
draftsight,progecad,ares commander, etc....
usage: python cad_iso_read.py temp.... | JohnyEngine/CNC | heekscnc/nc/cad_iso_read.py | Python | apache-2.0 | 8,450 | 0.011006 |
'''
Created on 2014-1-21
@author: Administrator
'''
#import class/method
from athelets import get_data_filelist, get_data_in_file
james = get_data_in_file('james2.txt')
print(james.name);
print(get_data_filelist(['james2.txt']));
| kane-chen/headFirstPython | src/com/lasho/headfirst/chap4/module_import_test.py | Python | gpl-3.0 | 231 | 0.012987 |
"""Findall regex operations in python.
findall(string[, pos[, endpos]])
Returns a list:
not like search and match which returns objects
Otherwise, it returns an empty list.
"""
import re
# look for every word in a string
pattern = re.compile(r"\w+")
result = pattern.findall("hey bro")
print result
patt = re.compile... | andela-ggikera/regex | findall.py | Python | mit | 700 | 0.001453 |
from django.shortcuts import redirect, get_object_or_404, render
from django.views.generic import TemplateView, View
from django.http import HttpResponse
from django.views.decorators.clickjacking import xframe_options_exempt
import json
from .models import Page, CurrentGame, VisiblePage
from .game import Manager
clas... | COIN-L4D/L4D-intranet | server/intranet/views.py | Python | gpl-3.0 | 1,951 | 0.003588 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import errno
from typing import List
from typing import Optional
from typing import Text
def relative_normpath(f, path):
# type: (Optional[Text], Text) ->... | beeva-fernandocerezal/rasa_nlu | rasa_nlu/utils/__init__.py | Python | apache-2.0 | 3,329 | 0.003004 |
import re
import string
import sys
sys.path.append('/Users/exu/PlayGround/readinglists/')
from key.keys import *
from amazon.api import AmazonAPI
from html2text import html2text
pattern = re.compile("https?://.*amazon.com/gp/product/([0-9]+)/.*")
amazon = AmazonAPI(AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_ACCESS_KEY, AMAZ... | xuy/readinglists | md_gen/parse.py | Python | mit | 1,942 | 0.009269 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis_louvain | base/forms/education_group_admission.py | Python | agpl-3.0 | 2,239 | 0.000894 |
#!/usr/bin/python
# Copyright: Ansible Project
# 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',
'status': ['preview'],
... | anryko/ansible | lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_info.py | Python | gpl-3.0 | 4,728 | 0.00423 |
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 2011-2013 Bitcraze AB
#
... | Nowis75/crazyflie-pc-client-leapmotion | lib/leapmotion/__init__.py | Python | gpl-2.0 | 1,076 | 0.000929 |
"""
Module to create topo and qinit data files for this example.
"""
from clawpack.geoclaw import topotools
from pylab import *
def maketopo_hilo():
x = loadtxt('x.txt')
y = loadtxt('y.txt')
z = loadtxt('z.txt')
# modify x and y so that cell size is truly uniform:
dx = 1. / (3.*3600.) # 1... | rjleveque/tsunami_benchmarks | nthmp_currents_2015/problem2/maketopo.py | Python | bsd-3-clause | 2,646 | 0.027967 |
# -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | dlazz/ansible | lib/ansible/module_utils/network/aci/msc.py | Python | gpl-3.0 | 13,894 | 0.002159 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
patterns = [r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_center)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_anchor)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/bfly_jpg_makerDrop/(crop_fullsize_center)/?.*?/(\d{9}(.*?))\.(.*?)$',
... | relic7/prodimages | python/regex_matcherator_naturectr.py | Python | mit | 1,999 | 0.010505 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Doit task definitions."""
DOIT_CONFIG = {
'default_tasks': [
'flake8',
'docs',
],
'continue': True,
'verbosity': 1,
'num_process': 2,
'par_type': 'thread',
}
def task_flake8():
return {
'actions': ['flake8 m2r test... | miyakogi/m2r | dodo.py | Python | mit | 448 | 0 |
"""Convenient imports"""
from pswingw2.client import send_simple_message # noqa
from pswingw2.client import send # noqa
from pswingw2.client import send_single # noqa
from pswingw2.client import send_batch # noqa
from pswingw2.client import Client # noqa
from pswingw2.config_defaults import get_simple_config as c... | ZettaIO/pswingw2py | pswingw2/__init__.py | Python | mit | 334 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# scrapenhl2 documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 1 17:47:07 2017.
#
# 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
#... | muneebalam/scrapenhl2 | docs/source/conf.py | Python | mit | 4,961 | 0 |
###############################################################################
# $Id$
#
# Project: Sub1 project of IRRI
# Purpose: Quality Assessment extraction from MODIS
# Author: Yann Chemin, <yann.chemin@gmail.com>
#
###############################################################################
# Copyright (c... | YannChemin/wxGIPE | proc_modis_qc.py | Python | unlicense | 23,032 | 0.039293 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | program_management/forms/custom_xls.py | Python | agpl-3.0 | 3,162 | 0.002847 |
from django.conf import settings
from django.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError
from ordered_model.models import OrderedModel
from django.contrib.auth.models import User, Group
from django.conf import settings
# Useful for attempting full-text search on f... | global-humanitarians-unite/ghu | ghu_web/ghu_main/models.py | Python | apache-2.0 | 3,814 | 0.00236 |
#!/usr/bin/env python
# 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/.
"""
The script can be used to setup a virtual environment for running Firefox UI Tests.
It will a... | Motwani/firefox-ui-tests | .travis/create_venv.py | Python | mpl-2.0 | 3,764 | 0.000797 |
# -*- coding:utf-8 -*-
from socket import socket
import threading
import json
# id : [사용자 이름]
# action : [create | join | send_msg | broadcast | out ]
# action_value : [action에 따른 수행 값]
class Server :
def __init__(self):
self.server_sock = socket()
self.clients = []
self.rooms = {} ... | GreedyOsori/Chat | jaeeun/server.py | Python | mit | 3,583 | 0.00653 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Jan lehnardt <jan@apache.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Simple functional test for the replication notification trigger"""
imp... | kotejante/light-distribution-platform | libs/couchdb/tools/replication_helper_test.py | Python | lgpl-2.1 | 1,676 | 0.00179 |
#
# lastilePro.py
#
# (c) 2013, martin isenburg - http://rapidlasso.com
# rapidlasso GmbH - fast tools to catch reality
#
# uses lastile.exe to compute a tiling for a folder
# worth of LiDAR files with a user-specified tile
# size (and an optional buffer)
#
# LiDAR input: LAS/LAZ/BIN/TXT/SHP/BIL/ASC/DTM... | strummerTFIU/TFG-IsometricMaps | LAStools/ArcGIS_toolbox/scripts_production/lastilePro.py | Python | mit | 4,971 | 0.009254 |
import csv
def get_name_score(name):
score = 0
for ch in name:
score += ord(ch.lower()) - ord('a') + 1
return score
def find_total_name_scores_from_file(filename):
# read/parse from file
names = []
with open(filename, 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
... | birdchan/project_euler | problems/022/run.py | Python | mit | 762 | 0.023622 |
from ROOT import TH1I, gROOT, kRed, kBlue
import unittest
import tempfile
import shutil
import os
from varial.extensions.cmsrun import Sample
from varial.wrappers import HistoWrapper
from varial.history import History
from varial import analysis
from varial import settings
from varial import diskio
class TestHistoTo... | HeinerTholen/Varial | varial/test/test_histotoolsbase.py | Python | gpl-3.0 | 2,422 | 0.012386 |
import collections
from .settings import preferences_settings
from .exceptions import CachedValueNotFound, DoesNotExist
class PreferencesManager(collections.Mapping):
"""Handle retrieving / caching of preferences"""
def __init__(self, model, registry, **kwargs):
self.model = model
self.re... | willseward/django-dynamic-preferences | dynamic_preferences/managers.py | Python | bsd-3-clause | 4,981 | 0.001004 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-16 15:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0006_auto_20170316_1444'),
]
operations = [
migrations.AlterFiel... | pavlenk0/my-catalog | catalog/migrations/0007_auto_20170316_1730.py | Python | bsd-3-clause | 649 | 0.001541 |
from __future__ import division
import importlib
import re
import time
class SkeletonMode(object):
"""Skeleton (base) mode.
This mode can take two commands:
- change to another mode
- print help
It is also able to send messages to the channel.
This mode must superclass all... | PyCon/pc-bot | pycon_bot/modes/base.py | Python | bsd-3-clause | 12,485 | 0.004806 |
from __future__ import division
from libtbx.path import walk_source_tree
from libtbx.str_utils import show_string
from libtbx.utils import Sorry
from libtbx.option_parser import option_parser
from fnmatch import fnmatch
import re
import sys, os
def read_lines_if_possible(file_path):
try: f = open(file_path, "r")
e... | hickerson/bbn | fable/fable_sources/libtbx/command_line/find_files.py | Python | mit | 3,114 | 0.019268 |
# Copyright 2015 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | meidli/yabgp | yabgp/message/attribute/atomicaggregate.py | Python | apache-2.0 | 1,948 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys
import tempfile
from winsys._compat import unittest
import uuid
import win32file
from winsys.tests.test_fs import utils
from winsys import fs
class TestFS (unittest.TestCase):
filenames = ["%d" % i for i in range (5)]
def setUp (se... | operepo/ope | laptop_credential/winsys/tests/test_fs/test_fs.py | Python | mit | 1,100 | 0.030909 |
"""
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by Jeff Heaton
Licensed under the Apache License, Version 2.0 (the "License");
... | PeterLauris/aifh | vol1/python-examples/lib/aifh/train.py | Python | apache-2.0 | 13,698 | 0.003066 |
import os
PUPPETDB_HOST = 'localhost'
PUPPETDB_PORT = 8080
PUPPETDB_SSL_VERIFY = True
PUPPETDB_KEY = None
PUPPETDB_CERT = None
PUPPETDB_TIMEOUT = 20
SECRET_KEY = os.urandom(24)
DEV_LISTEN_HOST = '127.0.0.1'
DEV_LISTEN_PORT = 5000
DEV_COFFEE_LOCATION = 'coffee'
UNRESPONSIVE_HOURS = 2
ENABLE_QUERY = True
LOCALISE_TIMEST... | bewiwi/puppetboard | puppetboard/default_settings.py | Python | apache-2.0 | 1,121 | 0.005352 |
# Copyright(C) 2014 by Abe developers.
# test_btc200.py: test Abe loading through Bitcoin Block 200.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, o... | n00bsys0p/altcoin-abe | test/test_btc200.py | Python | agpl-3.0 | 98,158 | 0.00272 |
from django.test import TestCase
from django.core.management import call_command
from wagtail.tests.utils import WagtailTestUtils, WagtailPageTests
from wagtail.core.models import Page
from pages.models import (HomePage,
HigherEducation,
ContactUs,
... | openstax/openstax-cms | pages/tests.py | Python | agpl-3.0 | 9,623 | 0.002286 |
from core import messages
from core.weexceptions import FatalException
from mako import template
from core.config import sessions_path, sessions_ext
from core.loggers import log, stream_handler
from core.module import Status
import os
import yaml
import glob
import logging
import urlparse
import atexit
import ast
prin... | jorik041/weevely3 | core/sessions.py | Python | gpl-3.0 | 7,336 | 0.004635 |
from six.moves import xrange
import tensorflow as tf
from .var_layer import VarLayer
from ..tf import rescaled_laplacian
def conv(features, adj, weights):
K = weights.get_shape()[0].value - 1
# Create and rescale normalized laplacian.
lap = rescaled_laplacian(adj)
Tx_0 = features
output = tf.m... | rusty1s/embedded_gcnn | lib/layer/chebyshev_gcnn.py | Python | mit | 1,356 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.