repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vapor-ware/synse-server | synse_server/backoff.py | 1 | 1845 | """Retry backoff strategies."""
import random
import time
from typing import Union
__all__ = ['ExponentialBackoff']
class ExponentialBackoff:
"""An implementation of the exponential backoff strategy.
This is useful for getting an exponentially backed-off delay for
reconnection or retry actions.
Ea... | gpl-3.0 | 5,880,698,989,741,114,000 | 31.946429 | 79 | 0.625474 | false | 4.072848 | false | false | false |
ecreall/lagendacommun | urlshortener/main.py | 1 | 5007 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# Source: https://github.com/narenaryan/Pyster
# licence: AGPL
# author: Amen Souissi
import sqlite3
import string
from flask import Flask, request, render_template, redirect, jsonify
f... | agpl-3.0 | 2,148,260,794,711,410,000 | 31.72549 | 78 | 0.505892 | false | 3.905616 | false | false | false |
liverliu/netmusichacker | python/hacker/hacker.py | 1 | 7384 | import logging
import web
import config
import requests
import json
import hashlib
import random
logger = logging.getLogger('route')
logger.setLevel(logging.INFO)
formatter = logging.Formatter('[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s','%m-%d %H:%M:%S')
#console
ch = logging.StreamHandler()
... | apache-2.0 | 2,123,856,222,579,568,600 | 35.20098 | 120 | 0.574485 | false | 3.632071 | true | false | false |
repotvsupertuga/tvsupertuga.repository | script.module.streamlink.base/resources/lib/streamlink/plugin/api/validate.py | 1 | 12873 | """This module provides an API to validate and to some extent
manipulate data structures, such as JSON and XML parsing results.
Example usage:
>>> validate(int, 5)
5
>>> validate({text: int}, {'foo': '1'})
ValueError: Type of '1' should be 'int' but is 'str'
>>> validate({'foo': transform(int)... | gpl-2.0 | 4,050,243,957,748,727,000 | 25.325153 | 86 | 0.61027 | false | 4.095768 | false | false | false |
doc-cloud/ds | string/string-rotate/rotate.py | 1 | 1026 | # -*- coding: utf-8 -*-
import copy
def simple_rotate(s, m):
if m < 0:
raise Exception('m is less than 0')
m %= len(s)
t = copy.copy(s)
del s[:]
s += t[m:] + t[:m]
def left_shift_m(s, m):
if m < 0:
raise Exception('m is less than 0')
length = len(s)
m %= length
for ... | gpl-2.0 | 102,612,010,791,808,480 | 19.52 | 47 | 0.457115 | false | 2.597468 | false | false | false |
elfnor/sverchok | nodes/transforms/scale_mk2.py | 1 | 2683 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | gpl-3.0 | -1,494,444,262,516,776,700 | 34.315789 | 90 | 0.656355 | false | 3.784203 | false | false | false |
lucidfrontier45/flasktest | test/test.py | 1 | 2489 | from flask_app import application
import unittest
import logging
import json
import uuid
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
def make_logger(name):
logger = logging.getLogger(name)
... | mit | -5,974,267,527,050,064,000 | 29 | 85 | 0.575733 | false | 3.505634 | true | false | false |
awni/tensorflow | tensorflow/python/training/training.py | 1 | 7130 | # Copyright 2015 Google 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 or a... | apache-2.0 | 2,207,461,269,452,418,600 | 32.952381 | 84 | 0.78892 | false | 4.055745 | false | false | false |
pacoqueen/bbinn | formularios/utils_almacen.py | 1 | 5346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | gpl-2.0 | 4,870,805,919,252,435,000 | 39.5 | 181 | 0.532548 | false | 3.597577 | false | false | false |
FederatedAI/FATE | python/federatedml/param/encrypted_mode_calculation_param.py | 1 | 1888 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | apache-2.0 | -2,847,998,658,587,991,000 | 36.019608 | 120 | 0.630826 | false | 3.983122 | false | false | false |
appleseedhq/cortex | python/IECoreMaya/Collapsible.py | 5 | 8941 | ##########################################################################
#
# Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | bsd-3-clause | -3,500,785,268,951,882,000 | 29.831034 | 92 | 0.690527 | false | 3.728524 | false | false | false |
lefnire/tensorforce | tensorforce/models/q_naf_model.py | 1 | 8828 | # Copyright 2017 reinforce.io. 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 or... | apache-2.0 | 6,982,727,479,257,415,000 | 38.410714 | 134 | 0.609538 | false | 4.073835 | false | false | false |
victorianorton/SimpleRPGGame | src/game/Creature.py | 1 | 2202 |
from src.common.Observable import*
from src.game.AttackSpell import *
from src.game.AttackWeapon import *
from src.game.Attributes import *
from src.game.visit import *
from src.game.Heroes import *
#from src.game.AttackInventory import*
from random import*
class Creatures(Observable, GameAttributes, Visitor):
de... | mit | 8,173,256,232,380,542,000 | 26.197531 | 66 | 0.601726 | false | 3.663894 | false | false | false |
eric-stanley/NewsBlur | apps/social/models.py | 1 | 137635 | import datetime
import time
import zlib
import hashlib
import redis
import re
import mongoengine as mongo
import random
import requests
import HTMLParser
from collections import defaultdict
from pprint import pprint
from BeautifulSoup import BeautifulSoup
from mongoengine.queryset import Q
from django.conf import setti... | mit | -3,288,628,194,197,878,000 | 42.804901 | 195 | 0.551655 | false | 3.929846 | false | false | false |
tsdotca/dmclient | core/hacks.py | 1 | 2964 | # core/hacks.py
# Copyright (C) 2018 Alex Mair. All rights reserved.
# This file is part of dmclient.
#
# dmclient 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, version 2 of the License.
#
# dmclient is dist... | gpl-2.0 | 6,981,152,763,329,449,000 | 34.285714 | 82 | 0.568826 | false | 4.151261 | false | false | false |
F5Networks/f5-common-python | f5/bigip/tm/util/test/unit/test_get_dossier.py | 1 | 1572 | # Copyright 2016 F5 Networks 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 writi... | apache-2.0 | 1,810,308,920,897,840,400 | 33.173913 | 76 | 0.713104 | false | 3.462555 | false | false | false |
cirosantilli/python-utils | sandbox/elearning/generate_tocs.py | 1 | 2277 | import os.path
from xml.dom.minidom import parse
home_dir = os.path.dirname(os.path.dirname(__file__)) #elearning/
html_path = os.path.join(home_dir,'toc.html') #elearning/toc.html
tocs_root_rel_path = 'sidebars'
tocs_path = os.path.join(home_dir,tocs_root_rel_path) #elearning/tocs partial tocs home
class_name = 'nav_... | mit | 458,288,741,566,199,200 | 37.610169 | 88 | 0.684673 | false | 3.481651 | false | false | false |
Autodesk/molecular-design-toolkit | moldesign/compute/remote_procedure_calls.py | 1 | 5016 | from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | apache-2.0 | -2,045,807,102,273,718,300 | 38.496063 | 99 | 0.61862 | false | 4.454707 | false | false | false |
astagi/chickenfoot | test.py | 1 | 1972 | from chickenfoot import Chickenfoot
import socket
class TestChickenfootClient():
def setUp(self):
TCP_IP = '192.168.0.6'
TCP_PORT = 5005
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((TCP_IP, TCP_PORT))
def tearDown(self):
self.s.close()
... | mit | -5,306,917,132,645,212,000 | 19.340206 | 66 | 0.345842 | false | 3.591985 | false | false | false |
rossella/neutron | quantum/api/extensions.py | 1 | 22315 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2011 Justin Santa Barbara
# 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 Licens... | apache-2.0 | 665,210,720,194,459,000 | 35.581967 | 79 | 0.585122 | false | 4.805125 | false | false | false |
ddico/odoo | addons/l10n_id_efaktur/models/account_move.py | 1 | 16354 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import re
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
FK_HEAD_LIST = ['FK', 'KD_JENIS_TRANSAKSI', 'FG_PENGGANTI', 'NOMOR_FAKTUR', 'MASA_PAJAK', 'TAHUN_P... | agpl-3.0 | -4,605,886,058,610,855,000 | 52.973597 | 308 | 0.577107 | false | 3.246129 | false | false | false |
dbarenas/django-scheduler | agenda_template/agenda_template/schedule/periods.py | 1 | 14782 | from __future__ import unicode_literals
from builtins import range
from builtins import object
import pytz
import datetime
import calendar as standardlib_calendar
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.template.defaultfilters import date as date_filte... | gpl-2.0 | 3,281,308,981,689,938,000 | 35.862843 | 117 | 0.625085 | false | 3.854498 | false | false | false |
arruda/presente_14 | presente_14/chat_parser/html_parser.py | 1 | 4871 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from bs4 import BeautifulSoup
from .chat_objects import *
def get_emails_html(path_to_html='emails.html'):
"returns the html from the emails file"
html = None
with open(path_to_html, 'r') as emails_file:
html = emails_file.read()
... | mit | -3,933,352,032,407,904,000 | 30.425806 | 89 | 0.674605 | false | 3.408677 | false | false | false |
GeoMop/GeoMop | src/gm_base/model_data/export_con.py | 1 | 4070 | """Module for exporting the data structure to .con format.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
INDENTATION = ' '
class Exporter:
"""Exporter from data structure to con files."""
def __init__(self):
"""Initialize the class."""
self.lines = ['']
self.indent_level ... | gpl-3.0 | -7,520,589,368,520,169,000 | 29.601504 | 87 | 0.561425 | false | 3.951456 | false | false | false |
emencia/emencia-django-forum | forum/settings.py | 1 | 2607 | """
Default Forum settings to import/define in your project settings
"""
# Categories pagination in 'Category index' (=forum index) view
FORUM_CATEGORY_INDEX_PAGINATE = 6
# Threads pagination in 'Last threads' view
FORUM_LAST_THREAD_PAGINATE = 15
# Threads pagination in 'Category detail' view
FORUM_CATEGORY_THREAD_PAG... | mit | -1,560,000,287,349,011,200 | 39.734375 | 116 | 0.754507 | false | 3.522973 | false | false | false |
davy39/eric | Graphics/Ui_UMLSceneSizeDialog.py | 1 | 2749 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './Graphics/UMLSceneSizeDialog.ui'
#
# Created: Tue Nov 18 17:53:58 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_UMLSceneSizeDialo... | gpl-3.0 | -7,273,575,584,148,077,000 | 50.867925 | 107 | 0.731539 | false | 3.765753 | false | false | false |
mozilla/mozilla-ignite | apps/challenges/migrations/0017_auto__add_field_phase_start_date__add_field_phase_end_date.py | 1 | 13053 | # 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 field 'Phase.start_date'
db.add_column('challenges_phase', 'start_date', self.gf('django.db.model... | bsd-3-clause | -5,817,836,040,785,347,000 | 75.782353 | 185 | 0.553742 | false | 3.653233 | false | false | false |
akellne/toolshed | plugins/ifi.py | 1 | 4495 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import datetime
import urllib2
import re
import json
from base import Plugin
#URL to the ifi news ics file
URL = "http://webhelper.informatik.uni-goettingen.de/editor/ical/ifinews.ics"
#dateformat used in ics files (date with and without time)
ICS_U... | gpl-3.0 | -3,895,263,639,573,684,700 | 32.051471 | 81 | 0.441824 | false | 4.293219 | false | false | false |
cherry-wb/SideTools | examples/mainwindows/sdi/sdi.py | 1 | 11026 | #!/usr/bin/env python
############################################################################
#
# Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
#
# This file is part of the example classes of the Qt Toolkit.
#
# This file may be used under the terms of the GNU General Public
# License... | apache-2.0 | -1,914,550,978,136,689,000 | 35.376271 | 102 | 0.597497 | false | 4.170197 | false | false | false |
Zefiros-Software/Zefiros-Bot | bot/slack_clients.py | 1 | 8173 | import logging
import re
import time
import json
import traceback
import os
import raven
from slacker import Slacker
from slackclient import SlackClient
from asq.initiators import *
from phabricator import Phabricator
from functools import wraps
class memo:
def __init__(self, fn):
self.fn ... | mit | 7,156,433,444,986,988,000 | 38.261084 | 301 | 0.608345 | false | 3.66996 | false | false | false |
Wilsh/goldwarsplus | commerce/models.py | 1 | 13576 | from django.db import models
from django.utils import timezone
from urllib.request import urlretrieve
import hashlib
import os
from django.conf import settings
from math import ceil
# Create your models here.
class Item(models.Model):
'''All items discovered by players in the game'''
item_id = models.PositiveI... | mit | -482,726,655,842,744,700 | 42.373802 | 147 | 0.648129 | false | 3.781616 | false | false | false |
marscher/mdtraj | MDTraj/utils/unit/quantity.py | 1 | 27812 | #!/bin/env python
"""
Module simtk.unit.quantity
Physical quantities with units, intended to produce similar functionality
to Boost.Units package in C++ (but with a runtime cost).
Uses similar API as Scientific.Physics.PhysicalQuantities
but different internals to satisfy our local requirements.
In particular, there i... | lgpl-2.1 | 5,665,115,278,954,907,000 | 38.282486 | 126 | 0.580469 | false | 4.468509 | false | false | false |
diego-d5000/MisValesMd | env/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py | 1 | 11456 | import _sqlite3 # isort:skip
import codecs
import copy
from decimal import Decimal
from django.apps.registry import Apps
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.utils import six
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_table = "DROP TA... | mit | 8,917,223,311,476,454,000 | 43.102362 | 114 | 0.56669 | false | 4.088508 | false | false | false |
AustereCuriosity/astropy | astropy/samp/tests/test_hub_proxy.py | 1 | 1178 | from ..hub_proxy import SAMPHubProxy
from ..hub import SAMPHubServer
from .. import conf
def setup_module(module):
conf.use_internet = False
class TestHubProxy(object):
def setup_method(self, method):
self.hub = SAMPHubServer(web_profile=False, mode='multiple', pool_size=1)
self.hub.start... | bsd-3-clause | 5,713,479,540,355,891,000 | 21.653846 | 81 | 0.654499 | false | 3.537538 | true | false | false |
fxia22/pointGAN | show_gan_rnn.py | 1 | 2043 | from __future__ import print_function
from show3d_balls import *
import argparse
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torc... | mit | -721,880,346,011,303,300 | 23.035294 | 92 | 0.675967 | false | 2.82964 | false | false | false |
alex-eri/aiohttp-1 | aiohttp/client_proto.py | 1 | 6070 | import asyncio
import asyncio.streams
from .client_exceptions import (ClientOSError, ClientPayloadError,
ClientResponseError, ServerDisconnectedError)
from .http import HttpResponseParser, StreamWriter
from .streams import EMPTY_PAYLOAD, DataQueue
class ResponseHandler(DataQueue, asyn... | apache-2.0 | 8,525,949,508,562,163,000 | 30.780105 | 77 | 0.531796 | false | 4.891217 | false | false | false |
martinhbramwell/evalOfFlask | frmwk/forms/attic/demo_forms.py | 1 | 1202 | from flask.ext.wtf import Form, TextField, BooleanField, TextAreaField
from flask.ext.wtf import Required, Length
from flask.ext.babel import gettext
from frmwk.model.mdUser import User
class EditForm(Form):
nickname = TextField('nickname', validators = [Required()])
about_me = TextAreaField('about_me', valid... | bsd-3-clause | 4,632,528,655,272,532,000 | 41.928571 | 145 | 0.65807 | false | 4.202797 | false | false | false |
Zerknechterer/pyload | module/plugins/crypter/MultiloadCz.py | 1 | 1754 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.Crypter import Crypter
class MultiloadCz(Crypter):
__name__ = "MultiloadCz"
__type__ = "crypter"
__version__ = "0.41"
__pattern__ = r'http://(?:[^/]*\.)?multiload\.cz/(stahnout|slozka)/.+'
__config__ = [("use_subfolder" , ... | gpl-3.0 | -8,429,412,199,865,437,000 | 40.761905 | 117 | 0.530217 | false | 3.303202 | false | false | false |
openconfig/oc-pyang | openconfig_pyang/plugins/util/yangpath.py | 1 | 1676 | """Copyright 2016 The OpenConfig Authors.
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, s... | apache-2.0 | 9,101,595,041,839,160,000 | 24.014925 | 72 | 0.704057 | false | 4.038554 | false | false | false |
rossant/galry | examples/mandelbrot.py | 1 | 1978 | """GPU-based interactive Mandelbrot fractal example."""
from galry import *
import numpy as np
import numpy.random as rdn
FSH = """
// take a position and a number of iterations, and
// returns the first iteration where the system escapes a box of size N.
int mandelbrot_escape(vec2 pos, int iterations)
{
vec2 z = vec2... | bsd-3-clause | 5,936,480,683,851,878,000 | 24.701299 | 78 | 0.627401 | false | 3.033742 | false | false | false |
textioHQ/pattern | examples/05-vector/06-svm.py | 1 | 4083 | from __future__ import print_function
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import random
from pattern.db import Datasheet
from pattern_text.nl import tag, predicative
from pattern.vector import SVM, KNN, NB, count, shuffled
# This example demonstrates a Support ... | bsd-3-clause | -5,175,451,043,334,958,000 | 38.640777 | 87 | 0.70267 | false | 3.405338 | true | false | false |
Reigel/kansha | kansha/authentication/ldap/ldap_auth.py | 1 | 4186 | # -*- coding:utf-8 -*-
# --
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
from nagare import log
try:
import ldap
except ImportError:
ldap ... | bsd-3-clause | 3,308,616,112,407,735,300 | 29.779412 | 106 | 0.567845 | false | 3.75763 | false | false | false |
CrowdStrike/kafka-python | setup.py | 1 | 1752 | import sys
from setuptools import setup, Command
with open('VERSION', 'r') as v:
__version__ = v.read().rstrip()
class Tox(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
@classmethod
def run(cls):
import tox
... | apache-2.0 | 5,926,308,993,090,215,000 | 24.764706 | 78 | 0.627283 | false | 4.112676 | true | false | false |
davy39/eric | eric6_trpreviewer.py | 1 | 2399 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2004 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Eric6 TR Previewer.
This is the main Python script that performs the necessary initialization
of the tr previewer and starts the Qt event loop. This is a standalone version
of the integrated t... | gpl-3.0 | -8,780,271,109,807,929,000 | 25.076087 | 78 | 0.581909 | false | 4.045531 | true | false | false |
h-friederich/lpm | login.py | 1 | 3179 | from functools import wraps
from flask import Blueprint, request, redirect, render_template, url_for, g, flash
from flask.ext.login import LoginManager, login_user, logout_user, current_user
from flask_wtf import Form
from wtforms import StringField, PasswordField
import base64
from . import auth
login_manager = Login... | bsd-3-clause | 5,078,731,911,012,853,000 | 29 | 95 | 0.621579 | false | 4.101935 | false | false | false |
diegonalvarez/tournament-stats | equipos/migrations/0001_initial.py | 1 | 5904 | # -*- coding: 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 'Equipo'
db.create_table(u'equipos_equipo', (
(u'id', self.gf('django.db.models.f... | mit | -1,342,480,729,113,450,200 | 66.873563 | 195 | 0.558435 | false | 3.543818 | false | false | false |
mortentoo/maya | scripts/animvr/export_obj_sequence.py | 1 | 1035 | import pymel.core as pm
class ExportObjSequence:
def __init__(self):
self.objects = []
self.start_frame = None
self.end_frame = None
def export(self):
if not pm.ls(sl=True):
pm.warning("No objects selected")
return
path = pm.fileDia... | gpl-3.0 | -4,551,239,341,659,585,500 | 27.75 | 118 | 0.523671 | false | 3.833333 | false | false | false |
patrick-winter-knime/mol-struct-nets | molstructnets/steps/prediction/tensor2d/tensor_2d.py | 1 | 3072 | import h5py
from keras import models
import numpy
from steps.prediction.shared.tensor2d import prediction_array
from util import data_validation, file_structure, progressbar, logger, file_util, hdf5_util, misc
class Tensor2D:
@staticmethod
def get_id():
return 'tensor_2d'
@staticmethod
def ... | gpl-3.0 | -7,248,230,788,257,675,000 | 51.067797 | 128 | 0.623372 | false | 4.517647 | false | false | false |
tomicic/ModelMMORPG | sc.py | 1 | 3434 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from spade.Agent import BDIAgent
from spade.Behaviour import OneShotBehaviour, EventBehaviour, ACLTemplate, MessageTemplate
from spade.ACLMessage import ACLMessage
from spade.AID import aid
from spade.SWIKB import SWIKB as KB
Overflow = 0.00
'''
TODO:
Reimplement agents... | gpl-3.0 | 5,696,110,524,052,965,000 | 33.686869 | 135 | 0.655213 | false | 3.124659 | false | false | false |
EnviDat/ckanext-envidat_theme | ckanext/envidat_theme/action.py | 1 | 3448 | # coding: utf8
from ckan.logic import side_effect_free
from ckan.logic.action.get import user_show
import ckan.plugins.toolkit as toolkit
from ckanext.passwordless import util
import json
from xml.etree import ElementTree
import requests
from logging import getLogger
log = getLogger(__name__)
@side_effect_free
de... | agpl-3.0 | -2,467,828,462,179,743,000 | 27.262295 | 84 | 0.555394 | false | 3.719525 | false | false | false |
rbarlow/pulp_python | plugins/test/unit/plugins/importers/test_importer.py | 1 | 7890 | """
Contains tests for pulp_python.plugins.importers.importer.
"""
from gettext import gettext as _
import unittest
import mock
from pulp_python.common import constants
from pulp_python.plugins import models
from pulp_python.plugins.importers import importer
class TestEntryPoint(unittest.TestCase):
"""
Test... | gpl-2.0 | -8,726,490,154,107,941,000 | 42.833333 | 100 | 0.641825 | false | 4.00711 | true | false | false |
Aiacos/DevPyLib | mayaLib/guiLib/base/baseUI.py | 1 | 6497 | __author__ = 'Lorenzo Argentieri'
import inspect
import ast
import mayaLib.pipelineLib.utility.docs as doc
from PySide2 import QtCore, QtWidgets
import pymel.core as pm
def test(a, b, c, d='ciao', e='stronzo', f=1):
"""
Test Function
:param a:
:param b:
:param c:
:param d:
:param e:
:... | agpl-3.0 | -574,755,296,216,365,000 | 29.502347 | 108 | 0.52732 | false | 4.3055 | false | false | false |
marco-lancini/Showcase | app_socialnetworks/tumblr.py | 1 | 7041 | from __init__ import *
from oauthclient import *
class TumblrClient(OauthClient):
"""
Wrapper for Tumblr APIs
:CONSUMER_KEY: Tumblr App ID
:CONSUMER_SECRET: Tumblr API Secret
:blog: the connected Tumblr blog, if any
:user_auth: account of the user on Showcase
:auth: boolean flag (if True,... | mit | -552,312,351,703,994,600 | 30.017621 | 115 | 0.530464 | false | 4.103147 | false | false | false |
crowsonkb/style_transfer | log_utils.py | 1 | 3838 | import logging
import os
import sys
try:
import curses
except ImportError:
curses = None
def _stderr_supports_color():
color = False
if curses and hasattr(sys.stderr, 'isatty') and sys.stderr.isatty():
try:
curses.setupterm()
if curses.tigetnum("colors") > 0:
... | mit | 4,683,264,071,271,343,000 | 32.964602 | 99 | 0.585201 | false | 4.052798 | false | false | false |
itu-oss-project-team/oss-github-analysis-project | github_analysis_tool/analyzer/commit_based_analyzer.py | 1 | 2535 | import collections
from github_analysis_tool.analyzer.abstract_analyzer import AbstractAnalyzer
from github_analysis_tool.services.db_column_constants import Columns
class CommitBasedAnalyzer(AbstractAnalyzer):
def __init__(self):
AbstractAnalyzer.__init__(self, "commit")
def create_matrix(self, repo... | mit | -7,743,140,120,545,697,000 | 43.473684 | 118 | 0.624852 | false | 3.998423 | false | false | false |
DiamondLightSource/diffcalc | diffcalc/gdasupport/you.py | 1 | 4367 | from diffcalc.gdasupport.scannable.diffractometer import DiffractometerScannableGroup
from diffcalc.gdasupport.scannable.hkl import Hkl
from diffcalc.gdasupport.scannable.hkloffset import HklOffset
from diffcalc.gdasupport.scannable.simulation import SimulatedCrystalCounter
from diffcalc.gdasupport.scannable.wavelength... | gpl-3.0 | -3,793,663,831,858,863,000 | 32.083333 | 107 | 0.715365 | false | 2.950676 | false | false | false |
kubeflow/tf-operator | sdk/python/kubeflow/tfjob/models/v1_tf_job.py | 1 | 7910 | # Copyright 2019 kubeflow.org.
#
# 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,... | apache-2.0 | 2,290,367,220,663,842,300 | 31.024291 | 295 | 0.604172 | false | 3.927507 | false | false | false |
Mossman1215/pgp-backup | upload_dir_instructions.py | 1 | 2112 | import os,sys,json,random
class uploadTest:
def __init__(self):
self.source = sys.argv[1]
self.f = open("operations.txt",'w',1)
self.counter = 0
print('running')
self.mapping = dict()
def getParentID(self,filename):
... | mit | -2,677,422,769,158,516,000 | 43 | 97 | 0.432292 | false | 4.778281 | false | false | false |
Fe-Nik-S/Examples | python/external_api/Sencore/lib/const.py | 1 | 4426 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import namedtuple
path_attr = namedtuple("path_attr", ("PATH", "ATTR"))
__ALL__ = ["SENCORE_URLS_ENUM", "SENCORE_DATA_PATH", "SENCORE_ATTRS_ENUM", "RESULT_PATH"]
class SENCORE_URLS_ENUM(object):
ETH = "http://{address}/probe/ethdata"
ETR_ALL = ... | mit | -8,902,507,808,757,745,000 | 33.310078 | 115 | 0.584049 | false | 3.127915 | false | false | false |
8l/beri | cheritest/trunk/tests/trace/test_raw_trace.py | 2 | 2042 | #-
# Copyright (c) 2013 Colin Rothwell
# All rights reserved.
#
# This software was developed by and Colin Rothwell as part of his summer
# internship.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor
# license agreements. See the NOTICE file distributed wi... | apache-2.0 | 5,793,459,442,878,046,000 | 41.541667 | 79 | 0.711557 | false | 3.726277 | true | false | false |
bwohlberg/sporco | sporco/admm/tvl1.py | 1 | 24507 | # -*- coding: utf-8 -*-
# Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
r"""Classes for ADMM algorith... | bsd-3-clause | 4,074,499,690,839,444,500 | 31.373844 | 79 | 0.541478 | false | 3.305057 | false | false | false |
sukritranjan/ranjansasselov2016b | compute_UV_doses.py | 1 | 29816 | # -*- coding: iso-8859-1 -*-
"""
This code is used to weigh the UV radiances we compute by biological action spectra.
"""
########################
###Import useful libraries
########################
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pdb
from matplotlib.pyp... | mit | -5,561,900,649,416,079,000 | 54.317254 | 825 | 0.713442 | false | 2.646077 | false | false | false |
nonbiostudent/python-spectroscopy | src/spectroscopy/plugins/flyspec.py | 1 | 8319 | """
Plugin to read and write FlySpec data.
"""
import calendar
import datetime
import os
import numpy as np
from spectroscopy.dataset import Dataset, Spectra, ResourceIdentifier, Retrievals
from spectroscopy.plugins import DatasetPluginBase
class FlySpecPluginException(Exception):
pass
class FlySpecPlugin(Dat... | gpl-3.0 | 7,344,202,771,692,823,000 | 38.42654 | 81 | 0.538406 | false | 3.796896 | false | false | false |
maggienj/ActiveData | tests/test_jx/test_set_ops.py | 1 | 34963 | # encoding: utf-8
#
#
# 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: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import division
from __future_... | mpl-2.0 | -3,831,913,277,298,706,400 | 29.995567 | 90 | 0.263736 | false | 4.12008 | true | false | false |
jameswatt2008/jameswatt2008.github.io | python/Python基础/截图和代码/加强/老王开枪/老王开枪-7-创建敌人.py | 1 | 2720 | class Person(object):
"""人的类"""
def __init__(self, name):
super(Person, self).__init__()
self.name = name
self.gun = None#用来保存枪对象的引用
self.hp = 100
def anzhuang_zidan(self, dan_jia_temp, zi_dan_temp):
"""把子弹装到弹夹中"""
#弹夹.保存子弹(子弹)
dan_jia_temp.baocun_zidan(zi_dan_temp)
def anzhuang_danjia(self, gun_... | gpl-2.0 | 8,752,744,205,176,716,000 | 17.552632 | 60 | 0.62772 | false | 1.534107 | false | false | false |
ThibaultReuille/graphiti | Scripts/console/edition.py | 1 | 5823 | import script
from script import *
class Info(script.Script):
def run(self, args):
self.console.log("{0} nodes, {1} edges.".format(og.count_nodes(), og.count_edges()))
class Load(script.Script):
def run(self, args):
if len(args) < 2:
self.console.log("Usage: {0} <filename>".format(args[0]))
return
std... | bsd-2-clause | -4,776,052,747,866,240,000 | 32.471264 | 116 | 0.638502 | false | 2.738946 | false | false | false |
nanshihui/PocCollect | component/fast_cgi/fast_cgi.py | 1 | 2068 | #!/usr/bin/env python
# encoding: utf-8
from t import T
import socket
class P(T):
def __init__(self):
T.__init__(self)
def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
timeout=3
result = {}
result['result']=False
target_url... | mit | 5,356,842,197,419,762,000 | 28.414286 | 93 | 0.499514 | false | 3.542169 | false | false | false |
klmitch/python-keystoneclient | keystoneclient/contrib/auth/v3/oidc.py | 1 | 8795 | # 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
# distributed under t... | apache-2.0 | -3,890,712,068,428,765 | 40.880952 | 79 | 0.61444 | false | 4.861802 | false | false | false |
Yarichi/Proyecto-DASI | Malmo/Python_Examples/mission_quit_command_example.py | 1 | 4421 | # ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
# 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 Softw... | gpl-2.0 | -3,410,355,032,639,231,500 | 35.151261 | 117 | 0.598055 | false | 4.182592 | false | false | false |
ema/conpaas | conpaas-services/src/conpaas/services/htc/manager/configuration.py | 1 | 4786 | '''
Created on Jul 23, 2013
@author: Vlad
'''
import random
class Configuration:
def __init__(self,types_list, cost_list, limit_list):
self.keys = dict(zip(types_list, range(len(types_list))))
self.averages = {} # dictionary of averages with k as a machine type
self.rav = {} # di... | bsd-3-clause | -8,171,769,272,402,431,000 | 32.236111 | 126 | 0.494985 | false | 3.563663 | false | false | false |
omerwe/LEAP | leapUtils.py | 1 | 10998 | import numpy as np
from optparse import OptionParser
import scipy.linalg as la
import scipy.stats as stats
import scipy.linalg.blas as blas
import pandas as pd
import csv
import time
import fastlmm.util.VertexCut as vc
from pysnptools.snpreader.bed import Bed
import pysnptools.util as pstutil
import pysnptools.util.phe... | apache-2.0 | 3,903,449,392,061,788,700 | 32.530488 | 122 | 0.68367 | false | 2.639942 | false | false | false |
puruckertom/ubertool | ubertool/varroapop/varroapop_functions.py | 1 | 11627 | from __future__ import division #brings in Python 3.0 mixed type calculation rules
import logging
import json
import requests
import math
import pandas as pd
import os
rest_url_varroapop = os.environ.get('OPENCPU_REST_SERVER')
#rest_url_varroapop = 'http://localhost'
if not os.environ.get('OPENCPU_REST_SERVER'):
... | unlicense | -3,814,458,858,010,616,000 | 65.821839 | 133 | 0.649609 | false | 3.002066 | false | false | false |
TravelModellingGroup/TMGToolbox | TMGToolbox/src/network_editing/NCS11/conversion/convert_VDFs.py | 1 | 8469 | '''
Copyright 2014 Travel Modelling Group, Department of Civil Engineering, University of Toronto
This file is part of the TMG Toolbox.
The TMG Toolbox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fou... | gpl-3.0 | -17,125,685,268,828,372 | 41.139303 | 148 | 0.526036 | false | 4.089329 | false | false | false |
ioreshnikov/wells | wells/time_dependent.py | 1 | 1615 | import scipy as s
import scipy.fftpack as fft
import scipy.integrate
import sys
def integrate(t, x, input, potential, delta, pump, loss, absorber):
nt = len(t)
nx = len(x)
dx = x[1] - x[0]
k = 2*s.pi * fft.fftfreq(nx, dx)
d = - delta - 1/2 * k**2
spectrum = fft.fft(input)
spectrum_ = sp... | mit | 2,178,837,503,368,915,500 | 28.907407 | 73 | 0.544892 | false | 3.117761 | false | false | false |
HenriqueLR/payments | app/main/decorators.py | 1 | 1514 | #encoding: utf-8
from django.core.exceptions import PermissionDenied
from django.contrib import messages
from django.shortcuts import redirect
from django.contrib.auth import get_user_model
from wallet.models import Debit, Deposit, Note
from main.utils import get_list_permissions
User = get_user_model()
def ajax_r... | mit | 5,929,164,697,228,002,000 | 31.12766 | 103 | 0.721007 | false | 3.217484 | false | false | false |
vindeka/gateswift | gateswift/middleware.py | 1 | 5131 | # Copyright (c) 2013 Vindeka, 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 writ... | apache-2.0 | 8,751,585,938,849,223,000 | 38.469231 | 101 | 0.618008 | false | 4.094972 | false | false | false |
EdTsft/swilite | swilite/prolog.py | 1 | 50967 | """An object-oriented interface to Prolog."""
from collections import namedtuple
from ctypes import (
POINTER,
byref,
c_char,
c_double,
c_int,
c_int64,
c_size_t,
c_void_p,
)
from swilite.core import (
BUF_DISCARDABLE,
CVT_WRITEQ,
PL_ATOM,
PL_BLOB,
PL_DICT,
PL_FLO... | mit | -278,160,444,804,315,000 | 30.287293 | 80 | 0.567858 | false | 4.042754 | false | false | false |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/galaxy/util/plugin_config.py | 1 | 2386 | from xml.etree import ElementTree
try:
from galaxy import eggs
eggs.require('PyYAML')
except Exception:
# If not in Galaxy, ignore this.
pass
try:
import yaml
except ImportError:
yaml = None
from galaxy.util.submodules import submodules
def plugins_dict(module, plugin_type_identifier):
"... | gpl-3.0 | -1,747,664,163,855,154,200 | 28.45679 | 108 | 0.650042 | false | 3.943802 | true | false | false |
jakevdp/scipy | scipy/special/orthogonal.py | 1 | 58856 | """
A collection of functions to find the weights and abscissas for
Gaussian Quadrature.
These calculations are done by finding the eigenvalues of a
tridiagonal matrix whose entries are dependent on the coefficients
in the recursion formula for the orthogonal polynomials with the
corresponding weighting function over ... | bsd-3-clause | -6,653,320,370,332,630,000 | 27.296154 | 139 | 0.55544 | false | 3.099805 | false | false | false |
lobnek/pyutil | test/test_mongo/test_engine/test_strategy.py | 1 | 3434 | from pyutil.mongo.engine.strategy import Strategy, strategies, configuration
from pyutil.mongo.engine.symbol import Symbol, Group
from pyutil.performance.drawdown import drawdown
from pyutil.performance.month import monthlytable
from pyutil.performance.return_series import from_nav
from pyutil.portfolio.portfolio impor... | mit | 5,867,971,628,889,860,000 | 29.39823 | 97 | 0.689866 | false | 3.437437 | true | false | false |
KlinkOnE/caf-port | scripts/gcc-wrapper.py | 1 | 3550 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, The Linux Foundation. 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 abo... | gpl-2.0 | -2,623,976,439,378,806,300 | 32.17757 | 97 | 0.663099 | false | 3.626149 | false | false | false |
CanalTP/navitia | source/tyr/tests/integration/autocomplete_test.py | 1 | 11540 | # coding: utf-8
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to... | agpl-3.0 | 7,122,653,603,733,621,000 | 33.550898 | 110 | 0.62175 | false | 3.319908 | true | false | false |
samuelshaner/openmc | tests/run_tests.py | 1 | 17900 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import shutil
import re
import glob
import socket
from subprocess import call, check_output
from collections import OrderedDict
from optparse import OptionParser
# Command line parsing
parser = OptionParser()
parser.add_option('-j', '--... | mit | -5,832,388,550,918,468,000 | 31.965009 | 134 | 0.611955 | false | 3.545256 | true | false | false |
tsotetsi/textily-web | temba/middleware.py | 1 | 5471 | from __future__ import absolute_import, unicode_literals
import pstats
import traceback
import copy
from cStringIO import StringIO
from django.conf import settings
from django.db import transaction
from django.utils import timezone, translation
from temba.orgs.models import Org
from temba.contacts.models import Conta... | agpl-3.0 | 4,714,688,521,143,626,000 | 31.182353 | 126 | 0.628039 | false | 4.138427 | false | false | false |
FlintHill/SUAS-Competition | SUASSystem/SUASSystem/image_processing.py | 1 | 3266 | from time import sleep
from PIL import Image
import os
import math
import random
from .utils import *
from UpdatedImageProcessing import *
from .settings import GCSSettings
from .converter_functions import inverse_haversine, get_mission_json
from .location import Location
"""
This file contains our image processing log... | mit | -1,299,459,855,585,969,200 | 56.298246 | 236 | 0.672994 | false | 3.745413 | false | false | false |
itoledoc/gWTO2 | arrayResolution2p.py | 1 | 23318 | #!/usr/bin/python
"""
Script to return the Cycle 2 arrays for a given LAS, Angular Resolution
HISTORY:
2012.10.11:
- first shot
- Cycle 1 setup
2012.11.20:
- Adding resolution, LAS for different declination
2012.12.27:
- adding a filter if no configurati... | gpl-2.0 | -7,200,967,021,325,123,000 | 30.173797 | 133 | 0.46908 | false | 3.904555 | true | false | false |
Sayter99/86Scratch | Helpers/86Scratch/s2a_fm.py | 1 | 4575 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 13:17:15 2013
@author: Alan Yorinks
Copyright (c) 2013-14 Alan Yorinks All right reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Fre... | mit | -6,333,871,453,249,498,000 | 34.75 | 111 | 0.676066 | false | 3.950777 | false | false | false |
maxvonhippel/q2-diversity | q2_diversity/_filter.py | 1 | 1145 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | -3,368,935,227,757,453,300 | 41.407407 | 78 | 0.571179 | false | 4.525692 | false | false | false |
lamotriz/sistemas-de-aterramento | src/agilent_u2531a.py | 1 | 14700 | # -*- coding: utf-8 -*-
# Comunicacao com a placa agilent U2531A
#
# UFC - Universidade de Federal do Ceará
#
# Responsáveis:
# Felipe Bandeira da Silva
# Francisco Alexander
#
from __future__ import division
import platform
#if platform.system() == 'Windows':
# import visa
#else:
# import visa_linux_emulatio... | apache-2.0 | -3,173,579,012,957,982,000 | 25.769231 | 110 | 0.557373 | false | 2.980828 | false | false | false |
argivaitv/argivaitv | plugin.video.salts/salts_lib/kodi.py | 1 | 4210 | """
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | gpl-2.0 | -4,517,156,319,772,024,300 | 33.793388 | 139 | 0.670784 | false | 3.493776 | false | false | false |
jwayneroth/mpd-touch | pygameui/button.py | 1 | 11634 | import label
import callback
import theme
import pygame
import view
import imageview
CENTER = 0
LEFT = 1
RIGHT = 2
TOP = 3
BOTTOM = 4
WORD_WRAP = 0
CLIP = 1
"""
Button
A button with a text caption.
Essentially an interactive label.
Signals
on_clicked(button, mousebutton)
"""
class Button(label.Label):
def __in... | mit | -5,597,498,205,768,523,000 | 27.101449 | 83 | 0.514097 | false | 2.448748 | false | false | false |
ABI-Software/ZincView | src/zincview.py | 1 | 30614 | #!/usr/bin/python
"""
ZincView example visualisation application using OpenCMISS-Zinc, python, Qt (PySide)
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
impo... | mpl-2.0 | -1,349,197,757,580,551,200 | 40.822404 | 202 | 0.641471 | false | 4.339949 | false | false | false |
dmishin/knuth_bendix | vondyck.py | 1 | 4552 | from knuth_bendix import knuthBendix, RewriteRuleset, shortLex
def vdRule(n, m, k=2):
"""Create initial ruleset for von Dyck group with inverse elements
https://en.wikipedia.org/wiki/Triangle_group#von_Dyck_groups
"""
return RewriteRuleset({
tuple('aA'): (),
tuple('Aa'): (),
tup... | mit | -8,688,118,971,699,404,000 | 26.257485 | 95 | 0.491872 | false | 3.332357 | false | false | false |
cgarrard/osgeopy-code | Chapter13/listing13_4.py | 1 | 1939 | # Script to draw world countries as patches.
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
from osgeo import ogr
def order_coords(coords, clockwise):
"""Orders coordinates."""
total = 0
x1, y1 = coords[0]
for x, y in coords[1:... | mit | 7,704,621,990,206,990,000 | 29.777778 | 70 | 0.643115 | false | 3.378049 | false | false | false |
aleneum/kogniserver | src/kogniserver/async.py | 1 | 2307 | import logging
import os
from threading import Thread
import time
try:
import asyncio
except ImportError:
# Trollius >= 0.3 was renamed
import trollius as asyncio
from autobahn.asyncio.wamp import ApplicationSession
from services import SessionHandler
class Ping(Thread):
def __init__(self, wamp):
... | mit | 8,312,911,809,580,319,000 | 26.141176 | 97 | 0.61075 | false | 3.896959 | false | false | false |
jainanisha90/WeVoteServer | import_export_facebook/models.py | 1 | 55791 | # import_export_facebook/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.core.validators import RegexValidator
from django.db import models
from email_outbound.models import SEND_STATUS_CHOICES, TO_BE_PROCESSED
from wevote_functions.functions import generate_random_string, positive_... | mit | -7,461,401,211,381,602,000 | 53.536657 | 120 | 0.582764 | false | 4.082766 | false | false | false |
arthurmensch/modl | benchmarks/log.py | 1 | 2179 | import time
import numpy as np
from lightning.impl.primal_cd import CDClassifier
from lightning.impl.sag import SAGAClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from lightning.classification import SAGClassifier
from sklearn.linear_model import LogisticRegression
bunch = fetch_20newsgroups_v... | bsd-2-clause | 7,691,973,709,971,517,000 | 33.046875 | 68 | 0.490133 | false | 3.947464 | false | false | false |
chatziko/mopidy-youtube | mopidy_youtube/backend.py | 1 | 5534 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import string
from multiprocessing.pool import ThreadPool
from urlparse import urlparse, parse_qs
import unicodedata
import pafy
from mopidy import backend
from mopidy.models import SearchResult, Track, Album
import pykka
import requests
from ... | apache-2.0 | 1,411,562,814,534,946,800 | 27.822917 | 76 | 0.555114 | false | 3.922041 | false | false | false |
DucQuang1/py-earth | setup.py | 1 | 3348 | from setuptools import setup, Extension
import numpy
import sys
import os
sys.path.insert(0, os.path.join('.', 'pyearth'))
from _version import __version__
# Determine whether to use Cython
if '--cythonize' in sys.argv:
cythonize_switch = True
del sys.argv[sys.argv.index('--cythonize')]
else:
cythonize_swi... | bsd-3-clause | -5,795,489,001,214,014,000 | 32.148515 | 78 | 0.506272 | false | 3.995227 | false | false | false |
biddellns/sc2league-server | config/urls.py | 1 | 1043 | """sc2league URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | gpl-3.0 | -8,316,606,483,788,474,000 | 32.645161 | 82 | 0.71908 | false | 3.559727 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.