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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ArcherSys/ArcherSys | Lib/lib2to3/fixes/fix_paren.py | 1 | 3821 | <<<<<<< HEAD
<<<<<<< HEAD
"""Fixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
# By Taek Joo Kim and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen
# XXX This doesn't support nested for loops l... | mit | 4,850,586,695,565,860,000 | 26.688406 | 80 | 0.461136 | false | 3.775692 | true | false | false |
atzengin/OCC | ocvc-runtime/examples/mp-sched/affinity_set.py | 1 | 2416 | #!/usr/bin/env python
##################################################
# Ocvc Python Flow Graph
# Title: Affinity Set Test
##################################################
from ocvc import eng_notation
from ocvc import gr
from ocvc import blocks
from ocvc import filter
from ocvc.eng_option import eng_option
#from ... | gpl-3.0 | 3,370,296,344,391,745,500 | 32.555556 | 82 | 0.534354 | false | 3.441595 | false | false | false |
wangtianqi1993/machine-learning-project | DeepLearning/tensorflow_test.py | 1 | 1477 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'wtq'
import tensorflow as tf
from data_set.tensorflow_data import mnist_input_data
mnist = mnist_input_data.read_data_sets("MNIST_data/", one_hot=True)
def tensor_flow_test():
"""
:return:
"""
matrix1 = tf.constant([[3, 3]])
matrix2 =... | gpl-3.0 | -4,340,738,443,261,843,500 | 24.912281 | 85 | 0.608666 | false | 3.008147 | true | false | false |
vegardli/PyBitica.txt | pybitica.txt.py | 1 | 12782 | #!/usr/bin/python
# Copyright 2016 Vegard Knutsen Lillevoll
#
# Follow this project at https://github.com/vegardli/PyBitica.txt
#
# 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 ... | gpl-3.0 | -3,961,661,283,830,218,000 | 32.028424 | 116 | 0.585902 | false | 3.633314 | false | false | false |
psaavedra/matrix-bot | setup.py | 1 | 2010 | from setuptools import setup, find_packages
import os
here = os.path.abspath(os.path.dirname(__file__))
def read_file(path_segments):
"""Read a file from the package. Takes a list of strings to join to
make the path"""
file_path = os.path.join(here, *path_segments)
with open(file_path) as f:
... | mit | 9,037,680,031,715,388,000 | 24.125 | 74 | 0.59602 | false | 3.489583 | false | false | false |
jarifibrahim/ashoka-dashboard | dashboard/migrations/0017_auto_20170110_0012.py | 1 | 1141 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-09 18:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0016_auto_20170106_2126'),
]
operations = [
migrations.AddFiel... | apache-2.0 | -3,525,246,500,700,450,300 | 37.033333 | 216 | 0.592463 | false | 3.85473 | false | false | false |
mattilyra/gensim | gensim/similarities/index.py | 1 | 7557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Intro
-----
This module contains integration Annoy with :class:`~gensim.models.word2vec.Word2Vec`,
:class:`~gensim.models.doc2vec.Doc2V... | lgpl-2.1 | -2,261,581,594,857,947,400 | 35.157895 | 119 | 0.618367 | false | 3.695355 | false | false | false |
TomTranter/OpenPNM | openpnm/utils/misc.py | 1 | 18899 | import inspect
import warnings
import functools
import numpy as _np
import scipy as _sp
import time as _time
import copy
from collections import OrderedDict
from docrep import DocstringProcessor
class Docorator(DocstringProcessor):
__instance__ = None
def __new__(cls, *args, **kwargs):
if Docorator.... | mit | -6,256,350,218,331,608,000 | 28.599673 | 88 | 0.513663 | false | 3.344719 | false | false | false |
edilio/tobeawebproperty | haweb/apps/housing/views/html.py | 1 | 1822 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from ..forms import UploadFileForm
from ..csvmgr import (import_active_contracts,
import_new_admissions,
import_move_outs,
... | mit | 9,058,497,713,841,926,000 | 38.630435 | 82 | 0.593304 | false | 4.454768 | false | false | false |
buchwj/xvector | server/xVServer/ServerCore.py | 1 | 21576 | # xVector Engine Server
# Copyright (c) 2011 James Buchwald
# 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 pr... | gpl-3.0 | 5,859,160,141,894,764,000 | 38.016275 | 79 | 0.528133 | false | 4.955443 | true | false | false |
fedora-conary/rmake-2 | rmake/messagebus/logger.py | 1 | 3495 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 | 2,911,372,966,933,494,300 | 37.406593 | 78 | 0.637768 | false | 4.309494 | false | false | false |
petxo/clitellum | clitellum/examples/channels/tcpChannels/receiverTcpChannel.py | 1 | 1556 | import logging
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../../../../../'))
from clitellum.core import loadbalancers, queue
from clitellum.endpoints.channels.amqpchannels import OutBoundAmqpChannel
from clitellum.endpoints.gatewaysqueue import SenderGatewayQueue
__author__ = ... | gpl-3.0 | -2,692,581,931,069,989,000 | 30.755102 | 129 | 0.721722 | false | 3.346237 | false | false | false |
jvicu2001/alexis-bot | modules/starboard.py | 1 | 8622 | import re
from datetime import datetime
import discord
import peewee
import emoji
from discord import Emoji, Embed
from bot import Command, categories, BaseModel
from bot.lib.guild_configuration import GuildConfiguration
from bot.utils import auto_int, compare_ids
class Starboard(BaseModel):
message_id = peewee... | mit | 6,556,475,329,084,990,000 | 37.32 | 117 | 0.564718 | false | 3.813357 | true | false | false |
guillermo-sentinella/jaeger-client-python | jaeger_client/codecs.py | 1 | 8929 | # Copyright (c) 2016 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | mit | -7,586,765,878,585,847,000 | 37.487069 | 79 | 0.613283 | false | 4.067882 | false | false | false |
tensorflow/lingvo | lingvo/base_runner.py | 1 | 25527 | # Lint as: python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 | -3,977,921,297,288,659,500 | 39.390823 | 80 | 0.640851 | false | 3.910985 | true | false | false |
Midnighter/nadist | setup.py | 1 | 5367 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import (absolute_import, print_function)
import io
import os
import re
from glob import glob
from os.path import (basename, dirname, join, relpath, splitext)
from setuptools import (Extension, find_packages, setup)
from setuptools.command.build_ext imp... | bsd-3-clause | -7,672,936,896,319,823,000 | 31.527273 | 96 | 0.608347 | false | 3.931868 | false | false | false |
elcarlitux/software | django/mysite/polls/views.py | 1 | 1634 | # Create your views here.
from django.shortcuts import render_to_response,get_object_or_404
from django.template import Context, loader,RequestContext
from django.http import HttpResponse,HttpResponseRedirect
from polls.models import Poll,Choice
from django.core.urlresolvers import reverse
from django.http import Http4... | agpl-3.0 | -3,826,983,697,096,341,000 | 42 | 90 | 0.675031 | false | 3.68018 | false | false | false |
mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/network/vrid6_nsip_binding.py | 1 | 5336 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 | -5,332,571,485,993,202,000 | 26.364103 | 130 | 0.682346 | false | 3.187575 | false | false | false |
agincel/AdamTestBot | adamtestbot.py | 1 | 5414 | import requests
import time
import sys
import datetime
import csv
import random
import re
import json
import traceback
import os
import telegram
import gc
import signal
from threading import Thread
import builtins #I'm so sorry
from pydblite import Base #The PyDbLite stuff
import src.atbCommands as ... | mit | 1,916,340,045,784,511,500 | 34.829932 | 223 | 0.630772 | false | 3.643338 | false | false | false |
vluzko/test | ml/theano/RNN.py | 1 | 5428 | import numpy as np
import theano as theano
import theano.tensor as T
from utils import *
import operator
class TheanoRNN:
def __init__(self, word_dim, hidden_dim=100, bptt_truncate=4):
# Assign instance variables
self.word_dim = word_dim
self.hidden_dim = hidden_dim
self.bptt_trun... | mit | 1,087,767,060,908,480,500 | 43.491803 | 132 | 0.57664 | false | 3.550033 | false | false | false |
jirikuncar/invenio-access | invenio_access/scripts/authaction.py | 1 | 3316 | #!@PYTHON@
# -*- mode: python; coding: utf-8; -*-
#
# This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundati... | gpl-2.0 | 7,031,112,304,229,078,000 | 35.844444 | 127 | 0.630881 | false | 3.422085 | false | false | false |
wadobo/timebank | main/views.py | 1 | 5098 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Eduardo Robles Elvira <edulix AT gmail DOT 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 yo... | agpl-3.0 | 4,461,199,355,873,981,400 | 36.211679 | 88 | 0.642409 | false | 4.049245 | false | false | false |
ericbrandwein/levelup-steps | helper-scripts/feature2file.py | 1 | 1997 | import os
FILE_TEMPLATE = """extends ../../../path-feature-template.pug
block description
| """
def parseFeatureDescription(feature):
description = feature.description.replace('\n', '\n | ')
return FILE_TEMPLATE + description + '\n'
def getFeatureFileName(feature):
return feature.title.replace... | gpl-3.0 | -6,694,659,816,388,695,000 | 28.367647 | 74 | 0.679519 | false | 3.789374 | false | false | false |
Mariaanisimova/pythonintask | INBa/2015/Serdehnaya_A_M/task_10_25.py | 1 | 2217 | #Задача 10. Вариант 25
#Напишите программу "Генератор персонажей" для игры. Пользователю должно быть предоставлено 30 пунктов, которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но и возвр... | apache-2.0 | 4,640,120,143,633,528,000 | 33.645833 | 372 | 0.677497 | false | 1.727651 | false | false | false |
Symmetric/calico-docker | calico_containers/calico_ctl/container.py | 1 | 15244 | """
Usage:
calicoctl container <CONTAINER> ip (add|remove) <IP> [--interface=<INTERFACE>]
calicoctl container <CONTAINER> endpoint-id show
calicoctl container add <CONTAINER> <IP> [--interface=<INTERFACE>]
calicoctl container remove <CONTAINER>
Description:
Add or remove containers to calico networking and m... | apache-2.0 | 6,288,813,733,888,830,000 | 33.333333 | 87 | 0.598137 | false | 4.333144 | false | false | false |
nicolasfauchereau/paleopy | scripts/proxy_oper.py | 1 | 8384 | #!/Users/nicolasf/anaconda/anaconda/bin/python
import os
import sys
import argparse
import json
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
sys.path.insert(0, '../')
from paleopy import proxy
from paleopy import analogs
from paleopy import ensemble
from paleopy.plotting import scala... | mit | -2,305,939,461,410,291,000 | 29.050179 | 167 | 0.681894 | false | 3.078957 | false | false | false |
shipci/boto | setup.py | 1 | 4556 | #!/usr/bin/env python
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 t... | mit | 7,083,085,816,140,457,000 | 45.020202 | 78 | 0.588894 | false | 3.844726 | false | false | false |
Kyria/LazyBlacksmith | lbcmd/manual_celery_tasks.py | 1 | 1373 | # -*- encoding: utf-8 -*-
from flask_script import Command, Option
from lbtasks.tasks import (spawn_character_tasks, spawn_universe_tasks,
task_purge)
class ManualCeleryTasks(Command):
""" Manually trigger task spawner for celery.
Arguments:
-c|--character: triggers charac... | bsd-3-clause | -3,421,041,925,589,255,700 | 27.604167 | 78 | 0.530954 | false | 4.561462 | false | false | false |
pyrocko/pyrocko | src/parstack.py | 1 | 3212 | # http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
import numpy as num
from . import parstack_ext
try:
range = xrange
except NameError:
pass
def parstack(arrays, offsets, shifts, weights, method,
le... | gpl-3.0 | 641,153,344,792,440,800 | 27.175439 | 76 | 0.606787 | false | 3.388186 | false | false | false |
matthew-sochor/trail-cam-detector | modeling/imgs_to_arr.py | 1 | 1440 | import os
import subprocess
import tqdm
import numpy as np
from keras.preprocessing.image import load_img
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
img_width = int(os.environ.get("IMG_DIM"))
img_height = int(os.environ.get("IMG_DIM"))
def imgdir_to_arr(data_dir, arr_dir):
print(... | mit | 4,260,651,782,672,149,000 | 30.304348 | 73 | 0.602778 | false | 2.975207 | false | false | false |
132nd-etcher/EMFT | emft/gui/tab_about.py | 1 | 1269 | # coding=utf-8
from emft.core import constant
from emft.core.logging import make_logger
from emft.gui.base import GridLayout, HSpacer, Label, VLayout, VSpacer
from emft.gui.main_ui_tab_widget import MainUiTabChild
LOGGER = make_logger(__name__)
class TabChildAbout(MainUiTabChild):
def tab_clicked(self):
... | gpl-3.0 | 5,567,846,663,171,130,000 | 27.2 | 82 | 0.502758 | false | 4.054313 | false | false | false |
SanPen/GridCal | src/GridCal/Engine/Sparse/utils.py | 1 | 2463 | # This file is part of GridCal.
#
# GridCal 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.
#
# GridCal is distributed in the hope that... | gpl-3.0 | -268,926,645,728,303,700 | 33.208333 | 113 | 0.587089 | false | 3.508547 | false | false | false |
regionbibliotekhalland/digitalasagor | edittabvideo.py | 1 | 4897 | # Copyright 2013 Regionbibliotek Halland
#
# This file is part of Digitala sagor.
#
# Digitala sagor 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
# ... | gpl-3.0 | -4,274,116,946,208,393,700 | 35.669231 | 112 | 0.603226 | false | 3.974838 | false | false | false |
ciudadanointeligente/lobby_cplt | lobby/csv_reader.py | 1 | 1655 | from lobby.models import Active, Audiencia, Passive
from popolo.models import Identifier
import uuid
import unicodedata
from datetime import datetime
class ActivosCSVReader():
def parse_line(self, line):
active = Active()
active.name = unicode(line[3] + " " + line[4])
active.save()
... | agpl-3.0 | -3,626,880,591,057,471,000 | 30.826923 | 87 | 0.607855 | false | 3.238748 | false | false | false |
RootForum/magrathea | magrathea/cli/commands/version.py | 1 | 1239 | # -*- coding: utf-8 -*-
"""
magrathea.cli.commands.version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the RootForum.org team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import magrathea
from ..base import BaseCommand
class VersionCommand(BaseCommand):
"""
... | mit | 6,254,561,424,545,703,000 | 30.769231 | 95 | 0.603713 | false | 4.04902 | false | false | false |
ratnania/pigasus | doc/manual/include/demo/test_neumann_quartcircle.py | 1 | 2730 | #! /usr/bin/python
# ...
try:
from matplotlib import pyplot as plt
PLOT=True
except ImportError:
PLOT=False
# ...
import numpy as np
from pigasus.gallery.poisson import *
import sys
import inspect
filename = inspect.getfile(inspect.currentframe()) # script filename (usually with path)
# ...... | mit | -1,505,926,330,432,978,000 | 17.322148 | 97 | 0.456044 | false | 2.811535 | false | false | false |
wsilva/fdp-folha-de-ponto-ach2077 | fdp/settings/base.py | 1 | 2384 | """
Django settings for fdp project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | gpl-3.0 | 3,432,215,530,178,696,000 | 23.326531 | 71 | 0.713926 | false | 3.124509 | false | false | false |
antonioguirola/webpy-base | forms.py | 1 | 4418 | # -*- coding: utf-8 -*-
from web import form
import re
import db
# Expresiones regulares necesarias:
#formatoVisa=re.compile(r'[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}')
# Funciones necesarias para las validaciones
def fooFunction():
pass
"""
EJEMPLO DE FORMULARIO PARA DARSE DE ALTA
formularioInscripcion = form.... | gpl-3.0 | 5,946,189,467,328,933,000 | 33.155039 | 121 | 0.433727 | false | 3.677796 | false | false | false |
estaban/pyload | module/plugins/accounts/FileserveCom.py | 1 | 2261 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... | gpl-3.0 | -6,783,191,814,099,837,000 | 37.982759 | 116 | 0.597523 | false | 4.141026 | false | false | false |
OCA/stock-logistics-barcode | stock_barcodes/wizard/stock_production_lot.py | 1 | 1359 | # Copyright 2019 Sergio Teruel <sergio.teruel@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class WizStockBarcodesNewLot(models.TransientModel):
_inherit = 'barcodes.barcode_events_mixin'
_name = 'wiz.stock.barcodes.new.lot'
_descriptio... | agpl-3.0 | 6,824,069,839,289,448,000 | 29.886364 | 68 | 0.592347 | false | 3.672973 | false | false | false |
RoboCupULaval/RULEngine | Game/Team.py | 1 | 1310 | # Under MIT License, see LICENSE.txt
from RULEngine.Game.Player import Player
from RULEngine.Util.constant import PLAYER_PER_TEAM
from RULEngine.Util.team_color_service import TeamColor
class Team():
def __init__(self, team_color, type="friend"):
self.players = {}
for player_id in range(PLAYER_PER... | mit | -7,209,480,122,618,741,000 | 29.465116 | 73 | 0.61145 | false | 3.679775 | false | false | false |
dajohnso/cfme_tests | widgetastic_manageiq/__init__.py | 1 | 87294 | # -*- coding: utf-8 -*-
import atexit
import json
import os
import re
import six
from collections import namedtuple
from datetime import date
from math import ceil
from tempfile import NamedTemporaryFile
from wait_for import wait_for
from cached_property import cached_property
from jsmin import jsmin
from lxml.html im... | gpl-2.0 | 4,857,805,675,932,547,000 | 32.717265 | 100 | 0.592607 | false | 3.997893 | false | false | false |
asmikhailov/i3pystatus | i3pystatus/zabbix.py | 1 | 2493 | from i3pystatus import IntervalModule
from pyzabbix import ZabbixAPI
class Zabbix(IntervalModule):
"""
Zabbix alerts watcher
Requires: pyzabbix
.. rubric:: Available formatters
* {default} - Full output count alerts like total:a5/a4/a3/a2/a1/a0
* {total} - Total count of alerts
* {aX_co... | mit | 745,224,424,911,811,000 | 34.112676 | 130 | 0.478941 | false | 3.889236 | false | false | false |
DzinVision/adventofcode-2016 | day_13.py | 1 | 1232 | from queue import Queue
seed = 1362
seen = set()
def is_empty(x, y):
n = x*x + 3*x + 2*x*y + y + y*y + seed
return bin(n).count('1') % 2 == 0
def valid_moves(x, y):
result = []
actions = [-1, 1]
for action in actions:
new_x = x + action
if x > 0 and is_empty(new_x, y) and (new_x... | gpl-3.0 | -2,430,251,141,979,315,000 | 19.533333 | 67 | 0.541396 | false | 3.041975 | false | false | false |
ros2/ci | ros2_batch_job/vendor/osrf_pycommon/osrf_pycommon/process_utils/impl.py | 1 | 12684 | # Copyright 2014 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 | -1,682,285,952,039,231,200 | 41.99661 | 79 | 0.660123 | false | 4.162783 | false | false | false |
pmidford/arachadmin | models/db.py | 1 | 17623 | import os
from ConfigParser import SafeConfigParser
defaults = dict(
host="localhost",
user="user",
password="userpass",
dbname="arachadmin")
conf = SafeConfigParser(defaults)
user = password = dbname = host = ''
if os.path.isfile("applications/%s/private/localconfig" % request.application):
con... | mit | -5,455,336,316,017,859,000 | 38.425056 | 86 | 0.520399 | false | 4.491081 | true | false | false |
Mahi/EzPyGame | ezpygame/scene.py | 1 | 5091 | class Scene:
"""An isolated scene which can be ran by an application.
Create your own scene by subclassing and overriding any methods.
The hosting :class:`.Application` instance is accessible
through the :attr:`application` property.
Example usage with two scenes interacting:
.. code-block:: ... | mit | -5,380,502,855,221,938,000 | 32.715232 | 70 | 0.573758 | false | 4.578237 | false | false | false |
rx2130/Leetcode | python/322 Coin Change.py | 1 | 1430 | class Solution(object):
def coinChange(self, coins, amount):
"""
:type coins: List[int]
:type amount: int
:rtype: int
"""
if amount < 1:
return 0
return self.helper(coins, amount, [0] * amount)
def helper(self, coins, target, cache):
#... | apache-2.0 | 8,560,938,447,716,615,000 | 28.791667 | 68 | 0.511888 | false | 3.454106 | false | false | false |
jfietkau/Streets4MPI | persistence.py | 1 | 1926 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# persistence.py
# Copyright 2012 Julian Fietkau <http://www.julian-fietkau.de/>
#
# This file is part of Streets4MPI.
#
# Streets4MPI 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... | gpl-3.0 | 7,688,861,371,860,292,000 | 31.1 | 70 | 0.708204 | false | 3.798817 | false | false | false |
mlabru/ptracks | view/dbedit/dlg_exe_data_new.py | 1 | 36600 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
dlg_exe_data_new
mantém as informações sobre a dialog de edição da tabela de exercícios
This program is free software: you can redistribute it and/or modify
it under th... | gpl-3.0 | 7,855,665,685,907,597,000 | 35.080677 | 129 | 0.528502 | false | 3.392807 | true | false | false |
siketh/ASR | catkin_ws/src/asr/src/slam_controller.py | 1 | 1585 | #!/usr/bin/env python
import rospy, os, signal, subprocess
from std_msgs.msg import String
from std_msgs.msg import Bool
def state_callback(data):
if data.data == "Shutdown":
rospy.signal_shutdown(shutdown_hook())
def mapping_callback(data):
global mapping
mapping = data.data
def shutdown_hoo... | mit | -483,380,572,584,401,100 | 23.384615 | 111 | 0.625237 | false | 3.711944 | false | false | false |
alexgorban/models | official/vision/image_classification/resnet_model.py | 1 | 12450 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | 160,315,715,792,612,700 | 28.363208 | 80 | 0.622249 | false | 3.401639 | false | false | false |
instacart/ahab | examples/nathook.py | 1 | 4880 | #!/usr/bin/env python
# coding: utf-8
# © 2015 Instacart
# Published as part of http://tech.instacart.com/ahab/
from contextlib import contextmanager
import logging
from pprint import pformat
from random import randint
import subprocess
from ahab import Ahab
import iptc
log = logging.getLogger()
def main():
lo... | isc | 3,008,786,882,495,630,300 | 33.118881 | 79 | 0.569994 | false | 3.931507 | false | false | false |
IODisrupt/OmegaBot | cogs/image.py | 1 | 4412 | import discord
from discord.ext import commands
from random import randint
import aiohttp
import random
class Image:
"""Image related commands."""
def __init__(self, bot):
self.bot = bot
#Reserved for further ... stuff
"""Commands section"""
@commands.command(no_pm=True)
async de... | gpl-3.0 | 192,364,097,975,051,680 | 38.392857 | 148 | 0.504306 | false | 4 | false | false | false |
johnkingsley/aprinter | config_system/utils/nix_utils.py | 1 | 2105 | # Copyright (c) 2015 Ambroz Bizjak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-2-clause | -881,511,893,180,323,700 | 47.953488 | 143 | 0.691686 | false | 3.971698 | false | false | false |
yang1fan2/nematus | test/config.py | 1 | 1647 | import numpy
import os
import sys
SRC = "de"
TGT = "en"
DATA_DIR = "data/"
from nematus.nmt import train
if __name__ == '__main__':
validerr = train(saveto='models/model.npz',
reload_=False,
dim_word=256,
dim=256,
n_words=20000,
... | bsd-3-clause | -7,334,645,368,551,240,000 | 38.214286 | 139 | 0.460231 | false | 3.978261 | false | false | false |
jbarkschat/Yu-gi-oh_pack_generator | Yu-gi-oh_pack_generator_alpha.py | 1 | 13809 | import urllib.request
from bs4 import BeautifulSoup
from PIL import Image
from tkinter import Tk, Label, Button
import requests
import pprint
import secrets
import os
class RarityUnknown(Exception):
"""Raised in this program when an unhandled rarity is encountered"""
pp = pprint.PrettyPrinter(indent=4... | gpl-3.0 | -36,560,402,219,080,536 | 34.537037 | 151 | 0.628793 | false | 3.359854 | false | false | false |
wireservice/agate | setup.py | 1 | 1797 | #!/usr/bin/env python
from setuptools import setup
install_requires = [
'six>=1.9.0',
'pytimeparse>=1.1.5',
'parsedatetime>=2.1',
'Babel>=2.0',
'isodate>=0.5.4',
'python-slugify>=1.2.1',
'leather>=0.3.2',
'PyICU>=2.4.2',
]
setup(
name='agate',
version='1.6.2',
description=... | mit | 2,069,988,854,236,103,400 | 31.672727 | 92 | 0.592098 | false | 3.88961 | false | false | false |
rusty1s/embedded_gcnn | cifar_graph.py | 1 | 3650 | from lib.datasets import Cifar10 as Data
from lib.model import Model as BaseModel, generate_placeholders, train
from lib.segmentation import extract_features_fixed
# from lib.segmentation import slic_fixed
from lib.segmentation import quickshift_fixed
from lib.pipeline import preprocess_pipeline_fixed
from lib.layer im... | mit | -5,641,273,794,863,657,000 | 30.73913 | 79 | 0.62411 | false | 3.218695 | false | false | false |
thuydang/ocrfeeder | src/ocrfeeder/feeder/imageManipulation.py | 1 | 8701 | # -*- coding: utf-8 -*-
###########################################################################
# OCRFeeder - The complete OCR suite
# Copyright (C) 2009 Joaquim Rocha
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-3.0 | 1,223,663,431,530,886,700 | 34.806584 | 108 | 0.526951 | false | 4.005985 | false | false | false |
sysbot/cloudenvy | cloudenvy/main.py | 1 | 3204 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
import argparse
import logging
import pkgutil
import string
from cloudenvy.config import EnvyConfig
import cloudenvy.commands
#TODO(bcwaldon): replace this with entry points!
def _load_commands():
"""Iterate through modules in command and import suspected command cla... | apache-2.0 | 618,700,753,464,824,700 | 33.085106 | 78 | 0.669476 | false | 3.985075 | true | false | false |
pychess/pychess | setup.py | 1 | 12398 | # -*- coding: UTF-8 -*-
from glob import glob
from os import listdir
from os.path import isdir, isfile
import os
import site
import sys
import subprocess
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path = [os.path.join(this_dir, "lib")] + sys.path
msi = False
if sys.argv[-1] == "bdist_msi":
try:
... | gpl-3.0 | 6,733,587,486,028,105,000 | 37.030675 | 142 | 0.640103 | false | 3.260915 | false | false | false |
Kesmon/VolumCalc | calc.py | 1 | 2474 | # Volum kalkulator
# made by Kristian Sundal/(Kesmon/)
# Release 1.0
pi=3.14159265359
start = '\n\nVelg mellom\n"kjegle","pyramide","tpyramide","sylinder","kule","prisme" eller "tprisme"\n"avslutt" for å avslutte'
trekant = 'Vil du ha trekant versjonen? "ja/nei"'
fase=''
print(start)
fase = input('> ')
while fase ... | unlicense | 8,808,921,450,736,615,000 | 18.100775 | 127 | 0.493912 | false | 3.004878 | false | false | false |
xiaoyexu/xCRM | setup.py | 1 | 19311 | # -*- coding: UTF-8 -*-
import os, django
os.environ['DJANGO_SETTINGS_MODULE'] = 'crm_site.settings'
django.setup()
from crm.models import *
from crm.common import *
# Demo initialize
# UserRoleType
userRoleTypes = [
['SALES_ROLE', u"销售"],
['DEV_ROLE', u"CRM开发"]
]
for userRoleType in userRoleTypes:
p = ... | gpl-3.0 | 987,139,168,184,626,300 | 37.755319 | 531 | 0.548394 | false | 2.576379 | false | false | false |
Ouranosinc/Magpie | magpie/alembic/versions/2018-06-04_a395ef9d3fe6_reference_root_service.py | 1 | 2200 | """
reference root service.
Revision ID: a395ef9d3fe6
Revises: ae1a3c8c7860
Create Date: 2018-06-04 11:38:31.296950
"""
import sqlalchemy as sa
from alembic import op
from alembic.context import get_context # noqa: F401
from sqlalchemy.dialects.postgresql.base import PGDialect
from sqlalchemy.orm.session import sess... | apache-2.0 | 8,186,256,314,903,162,000 | 32.333333 | 107 | 0.677727 | false | 3.773585 | false | false | false |
OiNutter/microbit-scripts | runner/runner.py | 1 | 4487 | from microbit import *
import random
from math import ceil
MAX_COLS = 5
PAUSE = 500
def init():
global blocks, wait, player, old_player, jump_counter, start, counter, lives, jump_held, jump_amount, jump_maxed, PAUSE
blocks = []
wait = 0
player = [1, 4]
old_player = None
jump_counter = 0
s... | mit | -1,286,049,152,465,547,000 | 26.03012 | 123 | 0.539782 | false | 3.739167 | false | false | false |
biothings/biothings_explorer | biothings_explorer/utils/networkx.py | 1 | 4018 | # -*- coding: utf-8 -*-
"""A collection of util functions related to networkx
.. moduleauthor:: Jiwen Xin <kevinxin@scripps.edu>
"""
from collections import defaultdict
def load_res_to_networkx(_res, G, labels, id_mapping, output_id_types):
"""Load restructured API response into a networkx MultiDiGraph.
... | apache-2.0 | -7,102,546,292,403,562,000 | 35.198198 | 88 | 0.529119 | false | 4.070922 | false | false | false |
stu314159/pyNFC | partition_suggestion.py | 1 | 5450 | """
partition_suggestion.py
purpose: Given Nx, Ny, Nz and a number of processes, suggest a partitioning strategy that would result in
more-or-less cube-shaped partitions
"""
import random
from collections import deque
def random_partition(factors,n_factors):
"""
factors = list of prime factors of a number
... | mit | 3,723,244,840,983,612,000 | 25.715686 | 107 | 0.572661 | false | 3.710007 | false | false | false |
rchrd2/markdown-keyval | key_val.py | 1 | 2188 | """
KeyValue Extension for Python-Markdown
=============================================
A simple example:
Apple: Pomaceous fruit of plants of the genus Malus in.
Orange: The fruit of an evergreen tree of the genus Citrus.
@todo get this to print out in a table
"""
from __future__ import absolute_import
from __futu... | mit | -2,305,283,626,722,497,500 | 33.1875 | 85 | 0.590494 | false | 3.949458 | false | false | false |
SylvainCecchetto/plugin.video.catchuptvandmore | plugin.video.catchuptvandmore/resources/lib/channels/jp/ntvnews24.py | 1 | 2396 | # -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2018 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... | gpl-2.0 | 2,987,740,199,929,455,600 | 35.30303 | 79 | 0.645659 | false | 3.641337 | false | false | false |
keflavich/pyspeckit-obsolete | pyspeckit/spectrum/models/ammonia.py | 1 | 28836 | """
========================================
Ammonia inversion transition TKIN fitter
========================================
Ammonia inversion transition TKIN fitter translated from Erik Rosolowsky's
http://svn.ok.ubc.ca/svn/signals/nh3fit/
.. moduleauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com>
Module API
^^^... | mit | -4,252,892,229,494,766,600 | 44.554502 | 188 | 0.575808 | false | 3.304607 | false | false | false |
Yelp/pootle | tests/import_export/import.py | 1 | 1745 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
import pytes... | gpl-3.0 | -3,093,608,413,008,632,300 | 31.924528 | 77 | 0.684241 | false | 3.518145 | true | false | false |
TiddlySpace/tiddlywebplugins.jsondispatcher | setup.py | 1 | 1099 | AUTHOR = 'Chris Dent'
AUTHOR_EMAIL = 'cdent@peermore.com'
MAINTAINER = 'Ben Paddock'
MAINTAINER_EMAIL = 'pads@thisispads.me.uk'
NAME = 'tiddlywebplugins.jsondispatcher'
DESCRIPTION = 'A TiddlyWeb plugin to allow the dispatching of tiddlers to non-Python handlers by serialising tiddler data to JSON'
VERSION = '0.1.4'
i... | bsd-3-clause | -7,600,328,731,646,267,000 | 33.34375 | 130 | 0.630573 | false | 3.488889 | false | true | false |
vincentchoqueuse/parametrix | parametrix/bayesian_linear_model/signal_models.py | 1 | 1666 | from parametrix.core.signal_models import BaseSignalModel
import numpy as np
import scipy.linalg as lg
from scipy.stats import multivariate_normal
class M_Bayesian_L(BaseSignalModel):
""" Bayesian Linear Signal Model (Eq 10.26)[KAY93]_
.. math::
\\textbf{y}=\\textbf{H}\\textbf{x}... | bsd-3-clause | 7,996,712,236,074,467,000 | 27.237288 | 111 | 0.553421 | false | 3.023593 | false | false | false |
Glf9832/AjkSpider | AjkSpider/spiders/AjkZsSpider.py | 1 | 2002 | # -*- coding: utf-8 -*-
import scrapy
from AjkSpider.items import AjkZsspiderItem
class AjkzsspiderSpider(scrapy.Spider):
name = "AjkZsSpider"
allowed_domains = ["zs.fang.anjuke.com"]
start_urls = ['http://zs.fang.anjuke.com/']
def parse(self, response):
subSelector = response.xpath('//div[@cl... | gpl-3.0 | 5,894,071,452,755,513,000 | 44.181818 | 138 | 0.515091 | false | 3.291391 | false | false | false |
MKuranowski/WarsawGTFS | static/downloader.py | 1 | 11293 | from dataclasses import dataclass
from datetime import date, datetime, timedelta
from operator import itemgetter
from typing import Dict, List, Optional, Set, Tuple
from pytz import timezone
import libarchive.public
import logging
import ftplib
import json
import re
import os
from .const import DIR_DOWNLOAD, DIR_CONVE... | mit | -6,927,628,474,505,717,000 | 33.117825 | 98 | 0.644736 | false | 3.6797 | false | false | false |
nextgis/nextgisweb | nextgisweb/vector_layer/test/test_source_error.py | 1 | 6886 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
from uuid import uuid4
import six
import pytest
from osgeo import ogr
from nextgisweb.models import DBSession
from nextgisweb.auth import User
from nextgisweb.compat import Path
from nextgisweb.core.exception im... | gpl-3.0 | -574,434,457,849,723,500 | 29.334802 | 92 | 0.596573 | false | 3.81919 | true | false | false |
dsapandora/die_hard | diehard.py | 1 | 1608 | #!/usr/bin/env python
import roslib; roslib.load_manifest('DroneInteractiveEnviroment')
import rospy
import json
import requests
from std_msgs.msg import String
from geometry_msgs.msg import Twist
from ardrone_autonomy.msg import Navdata
class DieHard(object):
def __init__(self):
self.twist = Twist()
... | gpl-3.0 | -3,877,265,271,598,974,500 | 35.545455 | 139 | 0.603856 | false | 3.209581 | false | false | false |
duboviy/pybenchmark | pybenchmark/gprofiler.py | 1 | 3896 | """
Module for visualizing Python code profiles using the Chrome developer tools.
Example usage:
>>> profiler = Profiler()
>>> profiler.start()
>>> my_expensive_code()
>>> profiler.stop()
>>> with open('my.cpuprofile', 'w') as f:
... f.write(profiler.output())
In a gevented environnment, context switches can make t... | mit | 4,730,682,478,425,819,000 | 27.647059 | 90 | 0.545688 | false | 3.907723 | false | false | false |
federicoviola/alpha | wsgi/migrations/versions/42caf438dcdf_.py | 1 | 3965 | """empty message
Revision ID: 42caf438dcdf
Revises: None
Create Date: 2015-05-15 13:14:21.980616
"""
# revision identifiers, used by Alembic.
revision = '42caf438dcdf'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | mit | -6,533,818,527,457,595,000 | 41.634409 | 91 | 0.653216 | false | 3.374468 | false | false | false |
PeterCP/Genera-Flask | migrations/versions/f90d3b386518_add_columns_to_event_model.py | 1 | 1289 | """Add columns to Event model
Columns added:
location_name
latitude
longitude
price
and max_attendants
Revision ID: f90d3b386518
Revises: 1150136bf0ab
Create Date: 2016-08-08 11:30:45.154593
"""
# revision identifiers, used by Alembic.
revision = 'f90d3b386518'
down_revision = '1150136bf0ab'
fro... | gpl-3.0 | -9,144,359,881,202,681,000 | 31.225 | 101 | 0.686579 | false | 3.356771 | false | false | false |
devonjones/PSRD-Parser | src/psrd/extensions/table/weapon.py | 1 | 2927 | #import pprint
from BeautifulSoup import BeautifulSoup
from psrd.extensions.table.general import add_additional_fields, fix_cost, set_subtype, clear_nbsp
def set_damage(weapon):
damage = {
"see text": ('see text', 'see text'),
"special": ('special', 'special'),
"Special": ('Special', 'Special'),
"1d2": ('&mda... | gpl-3.0 | 4,741,995,699,257,910,000 | 26.35514 | 98 | 0.594465 | false | 2.491064 | false | false | false |
INCF/BIDS2ISATab | setup.py | 1 | 2176 | from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
setup(
name="BIDS2ISATab",
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# http://packaging.python.org/en/latest/tutorial.html#... | apache-2.0 | -2,931,770,675,141,887,500 | 33 | 119 | 0.641085 | false | 4.300395 | false | false | false |
lkundrak/scraperwiki | web/api/viewshandlers.py | 1 | 31419 | import urllib
import urllib2
from django.contrib.sites.models import Site
from django.conf import settings
from django.template import RequestContext, loader, Context
from django.http import HttpResponseRedirect, HttpResponse, Http404, HttpResponseNotFound
from django.shortcuts import render_to_response
from django.s... | agpl-3.0 | -3,396,897,372,369,275,400 | 39.593023 | 160 | 0.62529 | false | 3.869335 | false | false | false |
npardington/fabric-bolt | fabric_bolt/task_runners/channels/consumers.py | 1 | 3109 | import json
import subprocess
from importlib import import_module
import ansiconv
import sys
from channels import Group
from channels.auth import channel_session_user_from_http
from channels.sessions import channel_session
from django.conf import settings
from fabric_bolt.projects.models import Project, Deployment
f... | mit | -7,930,746,221,363,774,000 | 29.782178 | 106 | 0.677067 | false | 4.069372 | false | false | false |
gobstones/PyGobstones | pygobstones/gui/mainWindow.py | 1 | 26321 | # -*- coding: utf-8 -*-
from views.gobstonesMain import *
from PyQt4 import QtGui
from PyQt4 import QtCore
import datetime
from views.qDesigner.interactive import *
sys.path.append('..')
from .fileOption import FileOption
from .preferencesWindow import PreferencesWindow
from .editOption import EditOption
from .boardOp... | gpl-3.0 | 9,027,376,901,329,861,000 | 37.368805 | 111 | 0.616808 | false | 3.925578 | false | false | false |
teodorch85/teir | python/script.py | 1 | 1551 | import webiopi
import datetime
GPIO = webiopi.GPIO
#LIGHT = 17 # GPIO pin using BCM numbering
VALVE1 = 2
VALVE2 = 3
VALVE3 = 7
VALVE4 = 8
VALVE5 = 9
VALVE6 = 10
VALVE7 = 11
VALVE8 = 18
#HOUR_ON = 8 # Turn Light ON at 08:00
#HOUR_OFF = 18 # Turn Light OFF at 18:00
# setup function is automatically called at WebIOP... | mit | 1,581,921,889,849,100,500 | 25.288136 | 59 | 0.694391 | false | 2.851103 | false | false | false |
PaloAltoNetworks-BD/autofocus-client-library | autofocus/config.py | 1 | 1373 | import logging
try:
from .gsrt_config import GSRTConfig
except ImportError:
from gsrt_config import GSRTConfig
def get_logger():
""" To change log level from calling code, use something like
logging.getLogger("autofocus").setLevel(logging.DEBUG)
"""
logger = logging.getLogger("autofocus")... | isc | -221,946,744,656,364,380 | 26.46 | 108 | 0.689002 | false | 3.458438 | true | false | false |
HugoMMRabson/fonsa | src/my/oledhat/interface.py | 1 | 12780 | '''
my.oledhat.interface
This library contains the high-level functions for drawing on the MyOled class (the means of publishing
new images onto the NanoHat OLED device).
Key functions:-
prompt_for_keyboard_text display keyboard; let user enter a phrase; return the phrase
choose_from_list ... | gpl-3.0 | 7,816,275,130,026,679,000 | 32.899204 | 113 | 0.514397 | false | 3.279446 | false | false | false |
giserh/pysparkling | pysparkling/rdd.py | 1 | 44048 | """
Provides a Python implementation of RDDs.
"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import io
import sys
import copy
import pickle
import random
import logging
import functools
import itertools
import subprocess
from collections import defaul... | mit | -438,791,647,940,619,650 | 25.376048 | 79 | 0.509649 | false | 4.239869 | false | false | false |
robjwells/adventofcode-solutions | 2015/python/2015-07.py | 1 | 3324 | #!/usr/bin/env python3
"""Advent of Code 2015, Day 7: Some Assembly Required"""
class Circuit:
"""A set of wires connected with bitwise logic gates"""
def __init__(self, instructions):
"""Parse instructions into a circuit layout
instructions should be the text from the puzzle input without
... | mit | -3,761,301,647,110,829,000 | 30.657143 | 74 | 0.552647 | false | 3.947743 | false | false | false |
charanpald/sandbox | sandbox/predictors/edge/EgoEdgeLabelPredictor.py | 1 | 4133 |
import logging
import gc
from apgl.predictors.AbstractPredictor import AbstractPredictor
from exp.sandbox.predictors.edge.AbstractEdgeLabelPredictor import AbstractEdgeLabelPredictor
from sandbox.util.Util import Util
from sandbox.util.Parameter import Parameter
from apgl.data import *
import numpy
class EgoEdgeL... | gpl-3.0 | -4,064,797,585,648,417,300 | 36.572727 | 100 | 0.639487 | false | 3.862617 | false | false | false |
Lynn-015/NJU_DMRG | dmrg/hgen.py | 1 | 4476 | import numpy as np
from scipy.sparse import kron,identity
from copy import copy,deepcopy
from ops import Z,Zs
from utils import index_map
class HGen(object):
def __init__(self,terms,L,d=2,part='left',fermi=False,sfermi=False,sectors=np.array([0.5,-0.5])):
self.l=1;self.d=d;self.D=self.d
self.H=np.zeros([self.d,s... | mit | -1,375,554,513,258,585,600 | 36.613445 | 105 | 0.669571 | false | 2.471563 | false | false | false |
tinfoilboy/Tiger | Tiger/shader_build.py | 1 | 2471 | import json
import os
import textwrap
import re
import sys
BASE_DIR = os.path.dirname(__file__)
# Global defines for the file paths
shaders_path = "shaders/"
shader_builder_class_path = "FileFragments/Shader/ShaderBuilderClass.part"
shader_method_path = "FileFragments/Shader/ShaderMethod.part"
shader_builder_header_... | mit | -2,424,530,186,793,516,000 | 34.826087 | 121 | 0.718737 | false | 3.119949 | false | false | false |
dpshelio/sunpy | sunpy/map/sources/iris.py | 2 | 2106 | import numpy as np
from sunpy.map import GenericMap
__all__ = ['SJIMap']
class SJIMap(GenericMap):
"""
A 2D IRIS Slit Jaw Imager Map.
The Interface Region Imaging Spectrograph (IRIS) small explorer spacecraft
provides simultaneous spectra and images of the photosphere, chromosphere,
transition ... | bsd-2-clause | -1,119,281,357,650,623,600 | 37.290909 | 79 | 0.662393 | false | 3.41329 | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/contactpoint.py | 1 | 2156 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2019-05-07.
# 2019, SMART Health IT.
from . import element
class ContactPoint(element.Element):
""" Details of a Technology mediated contact point (phone, fax, email,... | bsd-3-clause | 6,030,556,860,741,067,000 | 32.169231 | 109 | 0.579314 | false | 4.154143 | false | false | false |
andrewebdev/tehblog | src/tehblog/templatetags/tehblog_tags.py | 1 | 3510 | # -*- coding: utf-8 -*-
# © Copyright 2009 Andre Engelbrecht. All Rights Reserved.
# This script is licensed under the BSD Open Source Licence
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
import re
from django import template
from djan... | bsd-3-clause | 5,456,668,170,593,911,000 | 26.421875 | 74 | 0.667142 | false | 3.894562 | false | false | false |
nzmm/granite | pages/admin.py | 1 | 1080 | from django.contrib import admin
from django.contrib.auth.models import User
from reversion.admin import VersionAdmin
from pages.models import (
Template,
Page,
)
from pages.forms import (
TemplateAdminForm,
PageAdminForm
)
@admin.register(Template)
class TemplateAdmin(VersionAdmin):
list_display ... | gpl-3.0 | -411,300,705,075,125,440 | 30.764706 | 91 | 0.668519 | false | 3.737024 | false | false | false |
JungWinter/HongikFood | app/message.py | 1 | 3222 | from .keyboard import Keyboard
from json import loads, dumps
class Message:
# Message클래스를 생성할 때 기본적인 틀만 구현하고
# 값들은 던져주면 알아서 메시지를 리턴한다
baseKeyboard = {
"type": "buttons",
"buttons": Keyboard.buttons,
}
baseMessage = {
"message": {
"text": "",
},
... | mit | 7,895,352,751,004,431,000 | 25.964912 | 84 | 0.576448 | false | 3.450056 | false | false | false |
commtrack/temp-aquatest | apps/buildmanager/api/resources.py | 1 | 5466 | import os
import bz2
import sys
import logging
import traceback
import cStringIO
import tempfile
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.servers.basehttp import FileWrapper
from django.core import serializers
from buildmanager.models ... | bsd-3-clause | 6,441,088,789,940,433,000 | 38.205882 | 99 | 0.655507 | false | 3.969499 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.