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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FedoraScientific/salome-kernel | bin/appliskel/salome_tester/salome_instance.py | 1 | 3184 | # Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
#... | lgpl-2.1 | -4,801,765,214,694,821,000 | 27.428571 | 85 | 0.652952 | false | 3.593679 | false | false | false |
dtroyer/python-openstacksdk | openstack/network/v2/router.py | 1 | 5820 | # 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,754,145,010,826,601,500 | 38.060403 | 79 | 0.656873 | false | 4.124734 | false | false | false |
dparks1134/GenomeTreeTk | scripts/checkm_compare.py | 1 | 4871 | #!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | gpl-3.0 | -6,658,379,957,902,644,000 | 39.256198 | 117 | 0.49497 | false | 4.235652 | false | false | false |
pablocscode/TFG-CAEBAT | simulacion_basica_v1.py | 1 | 2696 | # -*- coding: utf-8 -*-
'''
Creado por Pablo Castro
28/03/17
Objetivo:
Automatizar todo el proceso de simulacion desde el terminal de linux.
Funciona para CAEBAT 1.0
Como usarlo:
1- Se situa el script en la carpeta 'examples'.
2- Se crea una carpeta llamada 'Mis simulaciones' en el escritorio.
3- Se ejecuta... | gpl-3.0 | -8,891,207,074,465,465,000 | 37.057971 | 130 | 0.751763 | false | 2.629268 | false | false | false |
indashnet/InDashNet.Open.UN2000 | android/external/llvm/utils/lit/lit/ShUtil.py | 1 | 12179 | from __future__ import absolute_import
import itertools
import lit.Util
from lit.ShCommands import Command, Pipeline, Seq
class ShLexer:
def __init__(self, data, win32Escapes = False):
self.data = data
self.pos = 0
self.end = len(data)
self.win32Escapes = win32Escapes
def eat(... | apache-2.0 | -4,915,834,333,598,974,000 | 33.307042 | 79 | 0.416126 | false | 4.46608 | true | false | false |
cloudera/hue | desktop/libs/librdbms/java/query.py | 2 | 1577 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 | -8,428,450,868,111,065,000 | 29.326923 | 83 | 0.717185 | false | 3.790865 | false | false | false |
adongy/spreads | spreads/util.py | 1 | 14770 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Johannes Baiter <johannes.baiter@gmail.com>
#
# 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 (at your ... | agpl-3.0 | 8,165,834,610,917,695,000 | 31.178649 | 79 | 0.599323 | false | 4.089147 | false | false | false |
uw-it-cte/uw-restclients | restclients/views.py | 1 | 6990 | try:
from importlib import import_module
except:
# python 2.6
from django.utils.importlib import import_module
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_protect
from django.http import HttpResponseNotFound, HttpRe... | apache-2.0 | 8,306,111,691,793,203,000 | 32.605769 | 79 | 0.580973 | false | 3.935811 | false | false | false |
dersphere/plugin.programm.xbmcmail | addon.py | 1 | 9677 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de)
#
# 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 ... | gpl-2.0 | -2,259,042,183,702,010,400 | 27.800595 | 73 | 0.512969 | false | 3.777127 | false | false | false |
Scille/parsec-cloud | tests/monitor.py | 1 | 13104 | # Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS
# Monitor POC, shamelessly taken from curio
import os
import signal
import socket
import traceback
import threading
import telnetlib
import argparse
import logging
import trio
from trio.abc import Instrument
from trio.lowlevel import cur... | agpl-3.0 | -6,085,939,352,050,087,000 | 32.403061 | 99 | 0.530548 | false | 3.955891 | false | false | false |
Ecotrust/hnfp | hnfp/migrations/0011_auto_20171025_0852.py | 1 | 3297 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-10-25 15:52
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hnfp', '0010_auto_20171024_1648'),
]
ope... | isc | -4,770,443,177,926,591,000 | 52.177419 | 158 | 0.584471 | false | 4.025641 | false | false | false |
alisa-ipn/writing-composition-crawler | src/crawl.py | 1 | 2670 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 21:49:22 2015
@author: Alisa
"""
import os
import utils, urlutils
URL1 = "http://abc-english-grammar.com/1/sochinenia_po_angliiskomu_yaziku.htm"
str_to_look = "<a href=\"http://abc-english-grammar.com/1/sochinenia_po_angliiskomu_yaziku"
URL2 = "http://en365.ru/topic... | mit | 1,130,901,153,823,493,900 | 24.673077 | 91 | 0.582397 | false | 3.090278 | false | false | false |
alexschiller/osf.io | api/logs/serializers.py | 1 | 7104 | from rest_framework import serializers as ser
from api.base.serializers import (
JSONAPISerializer,
RelationshipField,
RestrictedDictSerializer,
LinksField,
is_anonymized,
DateByVersion,
)
from website.project.model import Node
from website.util import permissions as osf_permissions
from framew... | apache-2.0 | -8,319,683,326,383,449,000 | 36.193717 | 132 | 0.652168 | false | 3.72327 | false | false | false |
classcat/cctf | cctf/initializations.py | 1 | 10251 | from __future__ import division, print_function, absolute_import
import math
import tensorflow as tf
try:
from tensorflow.contrib.layers.python.layers.initializers import \
xavier_initializer
except Exception:
xavier_initializer = None
try:
from tensorflow.contrib.layers.python.layers.initializers ... | agpl-3.0 | -1,623,474,419,808,075,000 | 37.537594 | 82 | 0.651546 | false | 4.116867 | false | false | false |
AlexOugh/horizon | openstack_dashboard/dashboards/nikolaboard/usagepanel/tabs.py | 1 | 1155 | from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.nikolaboard.usagepanel import tables
class UsageTab(tabs.TableTab):
name = _("List")
slug = "usage_tab"
table_classes = ... | apache-2.0 | 1,395,974,317,262,188,300 | 28.615385 | 81 | 0.62684 | false | 4.066901 | false | false | false |
eaudeweb/lcc-toolkit | lcc/views/legislation.py | 1 | 24257 | import json
import operator
from functools import reduce
from django import views
from django.conf import settings
from django.contrib.auth import mixins
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q as DjQ, IntegerField
from django.db.models.functions import ... | gpl-3.0 | 4,738,806,645,539,076,000 | 38.3047 | 108 | 0.474207 | false | 4.8502 | false | false | false |
leakim/svtplay-dl | lib/svtplay_dl/service/tv4play.py | 1 | 7249 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
import os
import xml.etree.ElementTree as ET
import json
import copy
from svtplay_dl.utils.urllib import urlparse, parse_qs, quote_plus
from svtplay_dl.service import Service, OpenG... | mit | 4,481,248,987,106,100,000 | 39.730337 | 165 | 0.531522 | false | 3.769631 | false | false | false |
Lorquas/subscription-manager | test/test_cache.py | 1 | 45245 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
#
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any late... | gpl-2.0 | -9,068,067,173,417,491,000 | 39.500448 | 124 | 0.626627 | false | 3.519175 | true | false | false |
Stratoscale/upseto | upseto/gitwrapper.py | 1 | 3364 | import urlparse
import os
import re
from upseto import run
from upseto import gitconfigparser
def originURLBasename(originURL):
originURLBasename = urlparse.urlparse(originURL).path.split("/")[-1]
if originURLBasename.endswith(".git"):
originURLBasename = originURLBasename[: - len(".git")] # pragma: ... | apache-2.0 | -6,241,408,017,556,831,000 | 35.172043 | 93 | 0.603448 | false | 4.194514 | false | false | false |
JohnLZeller/dd-agent | tests/test_win32.py | 1 | 1616 | # stdlib
import unittest
import logging
import gc
import sys
# 3p
#from nose.plugins.attrib import attr
# project
import checks.system.win32 as w32
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__file__)
AGENT_CONFIG = {} # None of the windows checks use this.
class TestWin32(unittest.TestCase)... | bsd-3-clause | -6,161,906,718,949,827,000 | 25.491803 | 79 | 0.627475 | false | 3.583149 | true | false | false |
hgwood/codingame | shadows_of_the_knight/part_two.py | 1 | 1627 | import sys
import random
import math
w, h = map(int, input().split())
jumps = int(input())
x, y = map(int, input().split())
px, py = x, y
search_zone = [(x, y) for x in range(w) for y in range(h)]
def distance(ax, ay, bx, by):
return math.sqrt((bx - ax)**2 + (by - ay)**2)
def around(zone, x, y):
return [(x, ... | gpl-3.0 | 9,150,318,430,111,574,000 | 32.895833 | 122 | 0.540873 | false | 2.684818 | false | false | false |
ntoll/yotta | yotta/init.py | 1 | 4970 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
from __future__ import print_function
import os
import logging
import re
# Component, , represents an installed component, internal
from .lib import component
# version, , re... | apache-2.0 | -5,474,865,060,728,439,000 | 32.809524 | 114 | 0.617505 | false | 3.665192 | false | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku.py | 1 | 1581 | # 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 ... | mit | -8,774,509,893,830,967,000 | 38.525 | 79 | 0.602783 | false | 3.923077 | false | false | false |
ros2/launch | launch/launch/substitutions/command.py | 1 | 5080 | # Copyright 2020 Open Source Robotics Foundation, 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... | apache-2.0 | -927,587,593,320,410,900 | 38.379845 | 95 | 0.638976 | false | 4.413553 | false | false | false |
cherrygirl/micronaet7 | pickin_import/importation.py | 1 | 6137 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP module
# Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>)
#
# Italian OpenERP Community (<http://www.openerp-italia.com>)
#
#####################################################... | agpl-3.0 | 859,732,967,655,162,200 | 42.211268 | 172 | 0.5559 | false | 4.157182 | false | false | false |
lukas-ke/faint-graphics-editor | build-sys/code_utils/find_defs.py | 1 | 3953 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Lukas Kemmer
#
# 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
#
# Unl... | apache-2.0 | 6,920,618,032,387,999,000 | 29.373016 | 78 | 0.521882 | false | 3.646679 | false | false | false |
vitorfs/bootcamp | bootcamp/articles/tests/test_views.py | 1 | 4751 | import tempfile
from PIL import Image
from django.test import Client, override_settings
from django.urls import reverse
from test_plus.test import TestCase
from bootcamp.articles.models import Article
def get_temp_img():
size = (200, 200)
color = (255, 0, 0, 0)
with tempfile.NamedTemporaryFile(suffix=... | mit | 4,451,839,674,186,486,000 | 34.721805 | 86 | 0.55904 | false | 4.109862 | true | false | false |
xletmjm416/space-trader-galaxy | main.py | 1 | 2578 | # -*- coding: utf-8 -*-
"""
Main Space Trader Galaxy class.
Created on Thu Jul 6 01:59:38 2017
@author: mjm
"""
import logging
import logging.config
import character as char
import good as good
def trade(seller, buyer, commodity, pay):
"""
Seller sells commodity to the buyer who pays with pay.
Argument... | mit | 8,642,490,935,781,050,000 | 22.66055 | 76 | 0.588441 | false | 3.625879 | false | false | false |
craffel/mir_eval | mir_eval/sonify.py | 1 | 10893 | '''
Methods which sonify annotations for "evaluation by ear".
All functions return a raw signal at the specified sampling rate.
'''
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy.interpolate import interp1d
from . import util
from . import chord
def clicks(times, fs, click=None, length... | mit | 147,390,526,746,069,660 | 32.109422 | 78 | 0.615074 | false | 3.919755 | false | false | false |
quattor/aquilon | lib/aquilon/worker/commands/add_network_device.py | 1 | 6514 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... | apache-2.0 | -409,722,923,466,763,400 | 45.863309 | 102 | 0.602241 | false | 4.336884 | false | false | false |
Eksmo/calibre | src/calibre/ebooks/mobi/writer2/resources.py | 1 | 5456 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import imghdr
... | gpl-3.0 | -8,675,809,270,525,001,000 | 37.971429 | 156 | 0.552786 | false | 3.606081 | false | false | false |
openstack/octavia | octavia/db/migration/alembic_migrations/versions/0fd2c131923f_add_timeout_fields_to_listener.py | 1 | 1794 | # Copyright 2018 GoDaddy
#
# 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 ... | apache-2.0 | -9,021,182,196,373,340,000 | 34.88 | 78 | 0.622074 | false | 4.09589 | false | false | false |
Endika/OpenUpgrade | openerp/addons/openupgrade_records/model/openupgrade_record.py | 1 | 3901 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module Copyright (C) 2012-2014 OpenUpgrade community
# https://launchpad.net/~openupgrade-committers
#
# Contributors:
# Therp BV <http://therp.nl>
#
... | agpl-3.0 | 9,089,793,331,484,869,000 | 30.97541 | 78 | 0.530377 | false | 4.310497 | false | false | false |
blythemusic/ClyphX | ClyphXControlSurfaceActions.py | 1 | 18706 | """
# Copyright (C) 2013-2016 Stray <stray411@hotmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
... | lgpl-2.1 | 3,540,569,321,692,649,500 | 37.809129 | 147 | 0.655512 | false | 3.265712 | false | false | false |
OCA/event | partner_event/models/event_registration.py | 1 | 2816 | # Copyright 2014 Tecnativa S.L. - Pedro M. Baeza
# Copyright 2015 Tecnativa S.L. - Javier Iniesta
# Copyright 2016 Tecnativa S.L. - Antonio Espinosa
# Copyright 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class EventRe... | agpl-3.0 | -2,625,753,482,065,121,300 | 38.111111 | 77 | 0.572798 | false | 3.905687 | false | false | false |
Jonathan-Livingston-Seagull/cerebro-dl | cerebro/models/hidden_layer_model.py | 1 | 2771 | import theano
import theano.tensor as T
import numpy
class HiddenLayerModel(object):
def __init__(self, rng, input, n_in, n_out, W=None, b=None,
activation=T.tanh):
"""
Typical hidden layer of a MLP: units are fully-connected and have
sigmoidal activation function. Weight ... | bsd-3-clause | 6,810,689,489,409,649,000 | 34.525641 | 79 | 0.562252 | false | 4.021771 | false | false | false |
tqchen/tvm | tutorials/frontend/from_onnx.py | 1 | 3929 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | -3,683,840,951,492,471,000 | 36.419048 | 89 | 0.614915 | false | 3.601283 | false | false | false |
kgeorge/kgeorge-cv | samples/skindetect/authoring/python/checkImages.py | 1 | 1352 | __author__ = 'kgeorge'
from optparse import OptionParser
from PIL import Image
import os
def main():
parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
help="imagefilename", metavar="FILE")
(options, args) = parser.parse_args()
print options.filename
src... | bsd-3-clause | 8,474,431,141,774,026,000 | 29.727273 | 100 | 0.617604 | false | 3.093822 | false | false | false |
rollbar/pyrollbar | rollbar/examples/fastapi/app_logger.py | 1 | 1747 | #!/usr/bin/env python
# This example uses Uvicorn package that must be installed. However, it can be
# replaced with any other ASGI-compliant server.
#
# NOTE: Python 3.6 requires aiocontextvars package to be installed.
# Optional asynchronous reporting requires HTTPX package to be installed.
#
# Run: python app... | mit | 5,014,467,864,173,894,000 | 28.116667 | 79 | 0.746422 | false | 3.662474 | false | false | false |
lorensen/VTKExamples | src/Python/Filtering/ConnectivityFilter.py | 1 | 1442 | #!/usr/bin/env python
import vtk
def main():
sphereSource1 = vtk.vtkSphereSource()
sphereSource1.Update()
delaunay1 = vtk.vtkDelaunay3D()
delaunay1.SetInputConnection(sphereSource1.GetOutputPort())
delaunay1.Update()
sphereSource2 = vtk.vtkSphereSource()
sphereSource2.SetCenter(5... | apache-2.0 | -5,614,666,063,002,479,000 | 27.27451 | 71 | 0.715673 | false | 3.845333 | false | false | false |
frontendphil/analyzr | analyzr/settings.py | 1 | 6077 | from os.path import abspath, dirname
# Django settings for analyzr project.
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
PROJECT_PATH = abspath('%s/..' % dirname(abspath(__file__)))
CHECKOUT_PATH = '%s/repos' % PROJECT_PATH
RESULT_PATH = '%s/resu... | mit | -6,614,729,428,346,790,000 | 30.487047 | 127 | 0.682245 | false | 3.6808 | false | false | false |
bhautikj/vrProjector | vrProjectorWrapper.py | 1 | 3828 | # Copyright 2016 Bhautik J Joshi
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 | 3,129,478,283,443,361,000 | 47.468354 | 183 | 0.738506 | false | 3.57423 | false | false | false |
Urinx/SomeCodes | Bioinformatics/other_code/Traindata.py | 1 | 2902 | #!/usr/bin/env python
# coding: utf-8
from time import time
import random
class Traindata():
"""docstring for Traindata"""
posi = []
nega = []
cv = []
k = 3
def __init__(self):
pass
def load_intm(self, filename, isPosi):
startTime = time()
dataset = self.posi if isPosi else self.nega
state = 'Positiv... | gpl-2.0 | -9,218,771,574,054,769,000 | 26.121495 | 95 | 0.601309 | false | 2.612061 | false | false | false |
galad-loth/LearnDescriptor | patchmatch/train_matchnet.py | 1 | 1806 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 25 11:28:35 2018
@author: galad-loth
"""
import mxnet as mx
import logging
import sys
from metric_net import match_net
from data import get_UBC_patch_dataiter
logging.basicConfig(level=logging.INFO)
root_logger = logging.getLogger()
stdout_handler = loggi... | apache-2.0 | -2,724,554,486,041,508,400 | 32.075472 | 92 | 0.566445 | false | 3.56213 | false | false | false |
nmayorov/scipy | scipy/integrate/_quad_vec.py | 3 | 20742 | import sys
import copy
import heapq
import collections
import functools
import numpy as np
from scipy._lib._util import MapWrapper
class LRUDict(collections.OrderedDict):
def __init__(self, max_size):
self.__max_size = max_size
def __setitem__(self, key, value):
existing_key = (key in self)... | bsd-3-clause | -1,173,841,174,148,520,200 | 31.460094 | 102 | 0.584177 | false | 3.290814 | false | false | false |
marcelocure/octopusapi | octopusapi/middleware.py | 1 | 1905 | import json
import logging
import falcon
class StorageError(Exception):
@staticmethod
def handle(ex, req, resp, params):
description = ('Sorry, could not store the message, it worked on my machine')
raise falcon.HTTPError(falcon.HTTP_725, 'Database Error', description)
class AuthMiddleware(o... | mit | -8,678,748,957,230,808,000 | 33.017857 | 155 | 0.651969 | false | 4.096774 | false | false | false |
deepmind/slim-dataset | reader.py | 1 | 10070 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | 6,471,769,179,025,854,000 | 36.022059 | 80 | 0.697319 | false | 3.632756 | false | false | false |
mhils/mitmproxy | mitmproxy/proxy2/layers/http/_http1.py | 1 | 17108 | import abc
from typing import Union, Optional, Callable, Type
import h11
from h11._readers import ChunkedReader, ContentLengthReader, Http10Reader
from h11._receivebuffer import ReceiveBuffer
from mitmproxy import exceptions, http
from mitmproxy.net import http as net_http
from mitmproxy.net.http import http1, status... | mit | 300,163,260,257,517,600 | 45.113208 | 119 | 0.613573 | false | 4.322385 | false | false | false |
delph-in/pydelphin | delphin/eds/_operations.py | 1 | 9714 |
"""
Operations on EDS
"""
import warnings
from itertools import count
from delphin import variable
from delphin import scope
from delphin import eds
from delphin import util
def from_mrs(m, predicate_modifiers=True, unique_ids=True,
representative_priority=None):
"""
Create an EDS by convertin... | mit | 6,722,001,387,782,816,000 | 34.323636 | 74 | 0.574532 | false | 3.87012 | false | false | false |
jrecuero/jc2li | jc2li/base.py | 1 | 26215 | __docformat__ = 'restructuredtext en'
# -----------------------------------------------------------------------------
# _ _
# (_)_ __ ___ _ __ ___ _ __| |_ ___
# | | '_ ` _ \| '_ \ / _ \| '__| __/ __|
# | | | | | | | |_) | (_) | | | |_\__ \
# |_|_| |_| |_| .__/ \___/|_| \__|___/
# ... | mit | 9,156,060,067,053,533,000 | 36.131728 | 117 | 0.529239 | false | 4.41553 | false | false | false |
ProjectQ-Framework/ProjectQ | projectq/setups/decompositions/cnot2cz.py | 1 | 1282 | # -*- coding: utf-8 -*-
# Copyright 2018 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... | apache-2.0 | 4,183,703,901,696,003,600 | 31.871795 | 100 | 0.711388 | false | 3.474255 | false | false | false |
haphaeu/yoshimi | EulerProject/061.py | 1 | 5270 | '''
THIS CODE IS WRONG - LOOK TO THE .C ONE
Problem 61
16 January 2004
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are
all figurate (polygonal) numbers and are generated by the following formulae:
Triangle P3,n = n(n+1)/2 1, 3, 6, 10, 15, ...
Square P4,n = n^2 ... | lgpl-3.0 | -4,745,148,190,800,327,000 | 34.85034 | 93 | 0.624288 | false | 2.113919 | false | false | false |
rolandgeider/OpenSlides | openslides/utils/views.py | 1 | 4506 | from io import BytesIO
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy
from django.views import generic as django_views
from django.views.decorators.csrf import ensure_csrf_cookie
from reportlab.lib.units import cm
from reportl... | mit | -4,697,838,992,160,653,000 | 28.644737 | 93 | 0.628051 | false | 4.227017 | false | false | false |
probcomp/bdbcontrib | src/parallel.py | 1 | 8878 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... | apache-2.0 | -2,968,221,592,813,170,700 | 34.654618 | 108 | 0.669633 | false | 3.895568 | false | false | false |
brianwc/courtlistener | cl/users/management/commands/cl_account_management.py | 1 | 4884 | import datetime
import hashlib
import random
from cl.users.models import UserProfile
from cl.users.utils import emails
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.core.management import BaseCommand
from django.utils.timezone import now
class Command(BaseCommand):
... | agpl-3.0 | 8,706,912,930,454,461,000 | 37.456693 | 80 | 0.558149 | false | 4.732558 | false | false | false |
jiaphuan/models | research/astronet/light_curve_util/util.py | 1 | 7461 | # Copyright 2018 The TensorFlow 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 ... | apache-2.0 | 6,828,795,574,697,506,000 | 34.193396 | 118 | 0.68275 | false | 3.604348 | false | false | false |
jean/sentry | tests/sentry/api/endpoints/test_organization_repositories.py | 1 | 1493 | from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from sentry.models import Repository
from sentry.testutils import APITestCase
class OrganizationRepositoriesListTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
org = self.crea... | bsd-3-clause | -1,317,995,337,978,983,400 | 30.104167 | 84 | 0.636303 | false | 4.002681 | true | false | false |
davidbgk/udata | udata/core/discussions/api.py | 1 | 6414 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from flask_security import current_user
from flask_restplus.inputs import boolean
from udata.auth import admin_permission
from udata.api import api, API, fields
from udata.core.user.api_fields import user_ref_fields
from .... | agpl-3.0 | -1,390,360,502,718,842,000 | 36.508772 | 79 | 0.651232 | false | 4.108905 | false | false | false |
log2timeline/dftimewolf | tests/lib/collectors/grr_base.py | 1 | 5042 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests the GRR base collector."""
import unittest
import mock
from grr_api_client import errors as grr_errors
from dftimewolf.lib import state
from dftimewolf.lib import errors
from dftimewolf.lib.collectors import grr_base
from dftimewolf import config
ACCESS_FORBI... | apache-2.0 | -2,875,692,896,729,224,700 | 33.534247 | 80 | 0.678104 | false | 3.560734 | true | false | false |
tobias-lang/crawl | src/old/collection_parser.py | 1 | 2434 | import traceback
import codecs
import src.parse.article_parser
class CollectionParser():
def __init__(self, article_parser=src.parse.article_parser.ArticleParser()):
self.article_parser = src.parse.article_parser
def get_filelist(self, dir, maxNumber=None):
from os import listdir
f... | gpl-3.0 | 3,377,325,573,410,735,000 | 29.810127 | 80 | 0.569433 | false | 4.104553 | false | false | false |
AravindK95/ee106b | project4/src/grasper_plan/src/transformations.py | 2 | 66033 | # -*- coding: utf-8 -*-
# transformations.py
# Copyright (c) 2006-2015, Christoph Gohlke
# Copyright (c) 2006-2015, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | mit | -8,569,947,633,209,522,000 | 33.410109 | 79 | 0.579559 | false | 3.015619 | false | false | false |
drivnal/drivnal | drivnal/handlers/task.py | 1 | 1800 | from drivnal.constants import *
from drivnal.client import Client
from drivnal.task import Task
from drivnal.event import Event
import drivnal.utils as utils
from drivnal import server
import os
import flask
import time
@server.app.route('/task/<volume_id>', methods=['GET'])
def task_get(volume_id):
client = Clien... | agpl-3.0 | 4,385,070,478,506,404,400 | 24.714286 | 69 | 0.583889 | false | 3.468208 | false | false | false |
coll-gate/collgate | server/settings/staging.py | 1 | 4562 | # -*- coding: utf-8; -*-
#
# @file staging.py
# @brief Staging specific settings.
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2016-09-01
# @copyright Copyright (c) 2016 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
import os
from .base import *
DEBUG = False
ADMINS = (
('admin_fscherma', 'frede... | mit | 8,841,889,773,940,665,000 | 24.47486 | 83 | 0.555702 | false | 3.418291 | false | false | false |
katacarbix/pyhp | resources/filebrowser.py | 1 | 1330 | <?py
import os
from datetime import datetime
path = postvars['path']
dir = postvars['dir']
def fsize(num, suffix='B'):
for unit in ['','K','M','G','T','P','E','Z']:
if abs(num) < 1024.0:
return "%3.0f %s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Y', suffix)
?... | gpl-2.0 | 1,932,784,922,014,772,200 | 22.350877 | 98 | 0.558647 | false | 2.449355 | false | false | false |
MediaKraken/MediaKraken_Deployment | docker/alpine/ComposeMediaKrakenLDAP/root/app/nginx-ldap-auth-daemon.py | 1 | 12042 | #!/bin/sh
''''[ -z $LOG ] && export LOG=/dev/stdout # '''
''''which python2 >/dev/null && exec python2 -u "$0" "$@" >> $LOG 2>&1 # '''
''''which python >/dev/null && exec python -u "$0" "$@" >> $LOG 2>&1 # '''
# Copyright (C) 2014-2015 Nginx, Inc.
# Copyright (C) 2018 LinuxServer.io
import sys, os, signal, base64, ... | gpl-3.0 | -7,031,179,566,730,927,000 | 35.93865 | 92 | 0.546836 | false | 4.115516 | false | false | false |
wisechengyi/pants | contrib/go/src/python/pants/contrib/go/register.py | 1 | 2555 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.build_graph.build_file_aliases import BuildFileAliases, TargetMacro
from pants.goal.task_registrar import TaskRegistrar as task
from pants.contrib.go.targets.go_binary import G... | apache-2.0 | 1,653,328,518,813,307,600 | 46.314815 | 85 | 0.735029 | false | 3.568436 | false | false | false |
SKIRT/PTS | core/prep/dustgrids.py | 1 | 23186 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | agpl-3.0 | 7,276,239,575,000,865,000 | 29.913333 | 224 | 0.528575 | false | 3.771759 | false | false | false |
ticosax/django-fsm-log | setup.py | 1 | 1452 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-fsm-log',
version='1.7.0dev',
description='Logging for django-fsm',
author='Gizmag',
author_email='tech@gizmag.com',
url='https://github.com/gizmag/django-fsm-log',
license='MIT',
packages=find_packag... | mit | 2,992,084,338,474,701,300 | 32 | 72 | 0.554408 | false | 4.148571 | false | false | false |
Microsoft/PTVS-Samples | PollsDjango/PollsDjango/urls.py | 1 | 1210 | """
Definition of urls for $safeprojectname$.
"""
from datetime import datetime
from django.conf.urls import url, include
from django.contrib import admin
import django.contrib.auth.views
import app.forms
import app.views
admin.autodiscover()
urlpatterns = [
url(r'^', include('app.urls', namespac... | apache-2.0 | 3,477,789,548,203,435,000 | 26.139535 | 73 | 0.561983 | false | 3.829114 | false | false | false |
VirusTotal/msticpy | msticpy/nbtools/security_event.py | 1 | 3507 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Module ... | mit | -7,031,642,204,383,718,000 | 33.722772 | 85 | 0.551468 | false | 4.496154 | false | false | false |
frollo/EquationReader | equationReader.py | 1 | 3520 | #!/usr/bin/python
import sys
import re
import string
variables = {}
outs = {}
monomial = "([a-zA-z]+\d+)"
mn = re.compile(monomial)
def extractValues(strin):
xAddr1 = strin[2].strip()
xAddr2 = strin[4].strip()
if xAddr1 in variables:
x1 = variables[xAddr1]
else:
... | gpl-3.0 | 5,119,402,926,935,882,000 | 31 | 103 | 0.509091 | false | 3.610256 | false | false | false |
DavideCanton/Python3 | concur/AABABB.py | 1 | 1342 | import contextlib
import threading
import io
from concur import KamiSemaphore
class A(threading.Thread):
def __init__(self, semA, semB, mutex):
threading.Thread.__init__(self)
self.setName("A")
self.semA = semA
self.semB = semB
self.mutex = mutex
def run(self):
... | gpl-3.0 | 6,614,634,021,793,715,000 | 23.851852 | 77 | 0.544709 | false | 3.476684 | false | false | false |
Talvalin/server-client-python | tableauserverclient/models/project_item.py | 1 | 2738 | import xml.etree.ElementTree as ET
from .property_decorators import property_is_enum, property_not_empty
from .. import NAMESPACE
class ProjectItem(object):
class ContentPermissions:
LockedToProject = 'LockedToProject'
ManagedByOwner = 'ManagedByOwner'
def __init__(self, name, description=Non... | mit | 9,043,964,154,326,998,000 | 32.390244 | 95 | 0.642805 | false | 4.258165 | false | false | false |
cmuphyscomp/hmv-s16 | Grasshopper/MocapDemo/GestureLogic.py | 1 | 19991 | # GestureLogic - state machine for interface logic for the gesture-based editing.
#
# This encompasses all the logic for the editor which is easier to write in
# Python than Grasshopper objects. Only one GestureLogic instance is expected to
# exist since it holds and tracks user inputs.
#
# Objectives for this ... | bsd-3-clause | -4,635,597,503,302,952,000 | 40.170886 | 144 | 0.573615 | false | 4.347325 | false | false | false |
marianotepper/nmu_rfit | rnmu/pme/sampling.py | 1 | 2096 | from __future__ import absolute_import
import numpy as np
import collections
try:
from itertools import imap
except ImportError:
imap = map
try:
from functools import reduce
except ImportError:
pass
class SampleSet(collections.MutableSet):
def __init__(self):
self._dict = {}
self._... | bsd-3-clause | -3,478,362,334,029,783,600 | 25.2 | 76 | 0.537214 | false | 4.038536 | false | false | false |
wimberosa/samba | source4/scripting/python/samba/netcmd/common.py | 1 | 2466 | #!/usr/bin/env python
#
# common functions for samba-tool python commands
#
# Copyright Andrew Tridgell 2010
# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.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 So... | gpl-3.0 | 3,366,601,980,079,461,000 | 32.780822 | 88 | 0.663017 | false | 3.42025 | false | false | false |
jptomo/rpython-lang-scheme | rpython/rlib/parsing/makepackrat.py | 1 | 24419 | from __future__ import with_statement
import py
import sys
from rpython.rlib.parsing.tree import Nonterminal, Symbol, RPythonVisitor
from rpython.rlib.parsing.codebuilder import Codebuilder
from rpython.rlib.objectmodel import we_are_translated
class BacktrackException(Exception):
def __init__(self, error=None):
... | mit | -3,646,075,986,021,694,500 | 31.645722 | 81 | 0.528113 | false | 3.803583 | false | false | false |
lkmnds/dickord | console.py | 1 | 1195 | import logging
import traceback
import asyncio
import requests
import dickord
route = dickord.route
import config
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('userbot')
benis = dickord.Dicker(user_pass=('luna@localhost', 'fuck'))
@benis.sensor('READY')
async def ready_for_work(payload):
... | mit | -1,654,092,541,386,538,200 | 24.425532 | 90 | 0.68954 | false | 3.111979 | false | false | false |
samuelefiorini/cgm-tools | scripts/run_kf.py | 1 | 2960 | """KF experiments development."""
from cgmtools import utils
from cgmtools import plotting
from cgmtools.forecast import kf
import datetime
import numpy as np
import pickle as pkl
###############################################################################
# Load full data set from pickle file (see data_wrangler.p... | gpl-3.0 | 4,648,840,799,209,392,000 | 35.54321 | 79 | 0.565203 | false | 3.406214 | false | false | false |
ftomassetti/plaid | app/views/decorators.py | 1 | 1552 | from functools import wraps
from flask import render_template, request, url_for
from app.models import PatchState
def filterable(f):
"""Filter a query"""
@wraps(f)
def wrapped(*args, **kwargs):
d = f(*args, **kwargs)
q = d['query']
state = request.args.get('state', None, type=str)... | gpl-2.0 | -1,112,586,424,140,818,000 | 24.442623 | 75 | 0.52384 | false | 3.860697 | false | false | false |
citizenlabsgr/voter-engagement | api/core/management/commands/gendata.py | 1 | 4551 | import random
from contextlib import suppress
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand
from django.db.utils import IntegrityError
from faker import Faker
from api.elections.models i... | mit | -1,028,694,120,705,746,800 | 32.711111 | 80 | 0.566249 | false | 4.202216 | false | false | false |
RCPRG-ros-pkg/control_subsystem | common/set_big_stiffness.py | 1 | 5158 | #!/usr/bin/env python
# Copyright (c) 2014, Robot Control and Pattern Recognition Group, Warsaw University of Technology
# 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 o... | bsd-3-clause | 521,373,026,289,866,900 | 40.596774 | 130 | 0.722373 | false | 3.504076 | false | false | false |
boada/planckClusters | MOSAICpipe/bpz-1.99.3/priors/prior_hdfn_gen.py | 1 | 2464 | from __future__ import division
from past.utils import old_div
from bpz_tools import *
def function(z, m, nt):
"""HDFN prior from Benitez 2000
for Ellipticals, Spirals, and Irregular/Starbursts
Returns an array pi[z[:],:nt]
The input magnitude is F814W AB
"""
global zt_at_a
nz = len(z)
... | mit | -1,657,587,623,260,758,800 | 27 | 77 | 0.520292 | false | 2.491405 | false | false | false |
pjiangtw/HOPE | WishCplex/WISHCPLEX.py | 1 | 2949 | #----------------------------------------------------------------------------------------
# Copyright, 2013:
#
# Stefano Ermon - Cornell University , ermonste@cs.cornell.edu
# Ashish Sabharwal - IBM Watson Research Center , ashish.sabharwal@us.ibm.com
#-----------------------------------------------------------... | apache-2.0 | 4,981,883,023,722,491,000 | 32.511364 | 162 | 0.631061 | false | 3.137234 | false | false | false |
mahyarap/httpclient | httpclient/httpclient.py | 1 | 1653 | #!/usr/bin/env python3
import sys
import argparse
from httpclient.http import HttpRequest
__version__ = '0.1.0'
def parse_cmd_options(args):
"""Parse the command line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument('url', help='URL to send the request to')
parser.add_argument... | gpl-3.0 | 8,312,854,801,826,824,000 | 28 | 66 | 0.503932 | false | 4.467568 | false | false | false |
mackal/faction.py | faction3.py | 1 | 35996 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Michael Cook <mcook@mackal.net>
#
# GPLv3
"""
Processes an eqlog file and generates SQL to update factions
Should work with a full log, but cleaning up the log will be quicker
The file needs at least the zone enter messages, faction ... | gpl-3.0 | -6,577,107,049,170,106,000 | 29.844045 | 80 | 0.576969 | false | 2.635066 | false | false | false |
Tilapiatsu/modo-tila_batchexporter | lxserv/Tila_BatchTransform.py | 1 | 2520 | #!/usr/bin/env python
import modo
import lx
import lxu.command
import lxu.select
import traceback
import Tila_BatchExportModule as t
from Tila_BatchExportModule import user_value
from Tila_BatchExportModule import batch_export
class CmdBatchExport(lxu.command.BasicCommand):
def __init__(self):
lxu.comman... | mit | -7,176,125,561,679,100,000 | 28.658824 | 76 | 0.483333 | false | 4.701493 | false | false | false |
no13bus/btcproject | btc/tasks.py | 1 | 13215 | #encoding=utf-8
from __future__ import absolute_import
from celery import shared_task
# from celery.task import task
from btcproject import celery_app
from btc.lib.okcoin import *
from btc.lib.btceapi import *
from btc.lib.bitfinex import *
from btc.lib.huobi import *
from btc.lib.btcchina import *
fr... | mit | -85,900,734,797,334,750 | 36.043353 | 179 | 0.697713 | false | 2.358961 | false | false | false |
valuesandvalue/valuesandvalue | vavs_project/fbdata/fields.py | 1 | 2071 | # fbdata.fields
# DJANGO
from django.db import models
from django.utils import six
# SOUTH
from south.modelsinspector import add_introspection_rules
class IntegerListField(models.Field):
description = "Integer List"
__metaclass__ = models.SubfieldBase
def __init__(self, *args, **kwargs):
k... | mit | 5,486,886,093,068,114,000 | 30.378788 | 74 | 0.593916 | false | 3.944762 | false | false | false |
jcurry/ZenPacks.ZenSystems.Juniper | ZenPacks/ZenSystems/Juniper/modeler/plugins/JuniperFPCMap.py | 1 | 6265 | ##########################################################################
# Author: Jane Curry, jane.curry@skills-1st.co.uk
# Date: February 28th, 2011
# Revised: Extra debugging added Aug 23, 2011
#
# JuniperFPC modeler plugin
#
# This program can be used under the GNU General Public L... | gpl-2.0 | 707,825,517,397,618,400 | 43.75 | 116 | 0.444054 | false | 4.341649 | false | false | false |
kussj/mesosbeat | scripts/generate_field_docs.py | 1 | 2634 | #!/usr/bin/env python
"""
This script generates markdown documentation from the fields yml file.
Usage: python generate_field_docs.py file.yml file.asciidoc
"""
import sys
import yaml
SECTIONS = [
("env", "Common"),
("cluster_health", "Contains elasticsearch cluster health statistics"),
("cluster_stats", "Con... | apache-2.0 | -3,599,554,905,244,448,000 | 24.572816 | 77 | 0.629461 | false | 3.452163 | false | false | false |
fragaria/BorIS | post_migration_restart.py | 1 | 2733 | """
This is script should bring existing installations in line with the state
in repository. It is supposed to be run after:
1. The migration_restart branch has been merged to master and deployed.
2. south_migrationhistory has been truncated.
3. The initial migrations for clients and services have been faked.
"... | mit | -3,734,604,905,836,807,700 | 32.329268 | 81 | 0.716429 | false | 3.8331 | false | false | false |
Zlash65/erpnext | erpnext/controllers/item_variant.py | 1 | 11842 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, flt
import json, copy
from six import string_types
class ItemVariantExistsError(frap... | gpl-3.0 | 1,849,677,033,109,478,400 | 33.932153 | 121 | 0.708326 | false | 3.235519 | false | false | false |
FlorianLudwig/scope | setup.py | 1 | 2287 | # -*- coding: utf-8 -*-
import os
import sys
from distutils.command.sdist import sdist
from setuptools import setup, find_packages
import setuptools.command.test
class TestCommand(setuptools.command.test.test):
def finalize_options(self):
setuptools.command.test.test.finalize_options(self)
self.t... | apache-2.0 | -363,262,786,118,607,400 | 31.211268 | 89 | 0.601224 | false | 3.76771 | true | false | false |
lewisodriscoll/sasview | src/sas/sascalc/simulation/pointsmodelpy/tests/testlores2d.py | 3 | 3235 | from __future__ import print_function
def test_lores2d(phi):
from sasModeling.pointsmodelpy import pointsmodelpy
from sasModeling.iqPy import iqPy
from sasModeling.geoshapespy import geoshapespy
#lores model is to hold several geometric objects
lm = pointsmodelpy.new_loresmodel(0.1)
#generate single ge... | bsd-3-clause | 863,925,136,733,527,400 | 26.415254 | 62 | 0.705719 | false | 2.80816 | false | false | false |
zhaochao/fuel-web | nailgun/nailgun/utils/zabbix.py | 1 | 3931 | # -*- coding: utf-8 -*-
# Copyright 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 requi... | apache-2.0 | -6,961,527,353,915,873,000 | 30.198413 | 78 | 0.568303 | false | 4.007136 | false | false | false |
lixiangning888/whole_project | modules/signatures_orginal_20151110/multiple_ua.py | 1 | 2186 | # Copyright (C) 2015 KillerInstinct
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in... | lgpl-3.0 | 7,584,770,034,356,479,000 | 36.050847 | 90 | 0.63495 | false | 3.960145 | false | false | false |
maclogan/VirtualPenPal | chatterbot/conversation/statement.py | 1 | 4801 | # -*- coding: utf-8 -*-
from .response import Response
from datetime import datetime
class Statement(object):
"""
A statement represents a single spoken entity, sentence or
phrase that someone can say.
"""
def __init__(self, text, **kwargs):
self.text = text
self.in_response_to = ... | bsd-3-clause | 6,238,078,572,523,169,000 | 29.579618 | 96 | 0.580712 | false | 4.524976 | false | false | false |
mozman/ezdxf | examples/render/render_ellipse.py | 1 | 1255 | # Copyright (c) 2018-2019, Manfred Moitzi
# License: MIT License
from math import radians
import ezdxf
from ezdxf.render.forms import ellipse
from ezdxf.math import Matrix44
NAME = 'ellipse.dxf'
doc = ezdxf.new('R12', setup=True)
msp = doc.modelspace()
def render(points):
msp.add_polyline2d(list(points))
def t... | mit | -3,324,645,544,781,303,000 | 24.612245 | 107 | 0.641434 | false | 2.670213 | false | false | false |
tochev/obshtestvo.bg | projects/admin.py | 1 | 20632 | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from django.forms import ModelForm
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from suit.widgets import *
from pagedown.widgets import AdminPag... | unlicense | -5,973,505,790,476,279,000 | 33.61745 | 148 | 0.612253 | false | 3.897978 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.