repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wdavilaneto/ultron | mlcore/pipeline/bag_of_bigrams.py | 1 | 1609 | #!/usr/bin/env python3
# pylint: disable=C0103
"""This module does nothing ...."""
import math
from document.utils import printProgressBar
from nltk.collocations import BigramCollocationFinder
from nltk.metrics import BigramAssocMeasures
from mlcore import TextService
import progressbar
import pyorient
orientdb = pyor... | gpl-3.0 | -959,391,149,232,723,200 | 33.234043 | 163 | 0.699814 | false | 3.198807 | false | false | false |
arpan-chavda/rh_app | libs/venus/planet/idindex.py | 1 | 3113 | from glob import glob
import os, sys
if __name__ == '__main__':
rootdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, rootdir)
from planet.spider import filename
from planet import config
def open():
try:
cache = config.cache_directory()
index=os.path.jo... | gpl-3.0 | -2,870,029,551,038,159,400 | 30.444444 | 78 | 0.54417 | false | 3.787105 | false | false | false |
ghidalgo3/gen-javadoc | JavadocCreator.py | 1 | 2107 | import sublime, sublime_plugin
from Javadoc import *
class JavadocCommand(sublime_plugin.TextCommand):
def determineIndentation(self,region):
(row, col) = self.view.rowcol(region.begin())
indent_region = self.view.find('^\s+', self.view.text_point(row, 0))
indent_level = len(self.view.... | mit | -1,093,159,872,325,818,500 | 45.822222 | 110 | 0.657807 | false | 3.975472 | false | false | false |
skies-io/django-rest-api | setup.py | 1 | 1233 | from setuptools import setup # find_packages
from codecs import open
from os import path
with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='django-rest-api',
version='0.1.5',
description='Django REST API',
long... | mit | -5,980,093,340,751,972,000 | 35.264706 | 96 | 0.614761 | false | 3.901899 | false | true | false |
lmascare/utils | python/bin/watch_adobe.py | 1 | 1617 | #!/usr/local/bin/python3
"""Script to watch Adobe Security page
This script looks at https://helpx.adobe.com/security.html and parses the
html file for all the products. It then determines if the page was updated
from the last check.
Design Spec
- Create 2 tables with the following schemas
Table 1
- Product Nam... | artistic-2.0 | 7,700,682,488,215,118,000 | 26.896552 | 93 | 0.595547 | false | 3.334021 | false | false | false |
pszemus/grpc | tools/profiling/bloat/bloat_diff.py | 5 | 2816 | #!/usr/bin/env python2.7
#
# Copyright 2017 gRPC 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 ... | apache-2.0 | 1,848,135,676,354,107,600 | 29.27957 | 82 | 0.622514 | false | 3.364397 | false | false | false |
squarebracket/coen315 | timing.py | 1 | 4898 | import GNUCapSimulationData as gc
import numpy as np
import plotly.plotly as py
from plotly.graph_objs import *
py.sign_in('squarebracket', '6edn8gin4t')
for x in [1, 2, 3]:
sim_data = None
sim_data = gc.GNUCapSimulationData('circuit%s.csv' % x, index_col='Time',
delim_w... | gpl-2.0 | 5,969,815,710,889,868,000 | 43.93578 | 128 | 0.444059 | false | 2.427156 | false | false | false |
kunitoki/nublas | nublas/db/fields/color.py | 1 | 1094 | import re
from django.db import models
from django.core.validators import RegexValidator
from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
#==============================================================================
color_re = re.compile('^\#([a-fA-F0-9]{6}|[a-fA-F0-9]... | mit | 3,558,500,804,969,140,700 | 35.466667 | 79 | 0.555759 | false | 4.223938 | false | false | false |
andreasots/lrrbot | lrrbot/twitchfollows.py | 2 | 1782 | import asyncio
from common.config import config
from common import rpc
from common import storm
from common import twitch
from common import utils
import dateutil.parser
FOLLOWER_CHECK_DELAY = 60
class TwitchFollows:
def __init__(self, lrrbot, loop):
self.lrrbot = lrrbot
self.loop = loop
self.last_timestamp ... | apache-2.0 | -1,351,116,069,295,548,700 | 28.213115 | 102 | 0.676207 | false | 3.25777 | false | false | false |
mingot/detectme_server | detectme/detectme/urls.py | 1 | 2056 | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(template_name... | mit | 3,397,887,765,450,255,000 | 33.847458 | 94 | 0.648346 | false | 3.684588 | false | false | false |
nw0/mealy | views.py | 1 | 13867 | from django.contrib.auth.decorators import login_required, user_passes_test, \
permission_required
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import loader
from django.core.ur... | gpl-3.0 | -3,726,163,514,609,451,500 | 39.905605 | 113 | 0.591909 | false | 3.695896 | false | false | false |
sammyf/dungeon-bot | redis-dungeon.py | 1 | 2533 | #!/usr/bin/python2
"""
initialize the redis databases and create and store a random maze recursively
"""
import redis
import random
import sys
import math
global gMaze, sx, sy, it
gMaze = []
maxX = 6
maxY = 6
sx = 6
sy = 6
it = 0
sys.setrecursionlimit( 2000)
db_MazeLayout = 0
db_Entities = 1
random.seed()
for i in... | gpl-3.0 | -3,030,606,899,594,232,000 | 25.663158 | 157 | 0.437821 | false | 3.008314 | false | false | false |
aprotopopov/lifetimes | tests/test_plotting.py | 1 | 5568 | import pytest
import matplotlib
matplotlib.use('AGG') # use a non-interactive backend
from matplotlib import pyplot as plt
from lifetimes import plotting
from lifetimes import BetaGeoFitter, ParetoNBDFitter, ModifiedBetaGeoFitter
from lifetimes.datasets import load_cdnow_summary, load_transaction_data
from lifetimes ... | mit | 235,944,716,493,724,300 | 37.4 | 112 | 0.679598 | false | 3.334132 | true | false | false |
hivemined/queen | src/hivemined/container.py | 1 | 4385 | #!/usr/bin/python3
import docker
import docker.utils
from .core import Docker
from .image import Image
__author__ = 'Ryan Clarke - faceless.saint@gmail.com'
class Container:
"""Base Container class for docker containers managed by Hivemined."""
label = 'hivemined.container'
def __init__(self, name, ima... | apache-2.0 | 5,664,839,434,192,485,000 | 34.942623 | 119 | 0.605701 | false | 4.041475 | false | false | false |
neothemachine/crowfood | crowfood/engine.py | 1 | 12443 | from __future__ import print_function, absolute_import
from six.moves import filter
from io import open # to use encoding kw in Python 2
import os
from collections import defaultdict
from crowfood.utils import is_subdir
import re
import sys
import itertools
def get_roots_and_include_paths(args):
# convention:
... | mit | 7,126,259,649,590,224,000 | 44.75 | 105 | 0.562565 | false | 4.372101 | false | false | false |
nutszebra/multimodal_word2vec | word2vec/downloadCIFAR100.py | 1 | 3055 | #!/usr/bin/env python
from six.moves.urllib import request
import cPickle as pickle
import os
import cv2
import subprocess
import numpy as np
picBase = "/mnt/s3pic/cifar10/"
def save_object(obj, filename):
with open(filename, 'wb') as output:
pickle.dump(obj, output, pickle.HIGHEST_PROTOCOL)
def checkExi... | mit | -1,638,127,540,387,665,400 | 26.522523 | 83 | 0.618658 | false | 2.69163 | true | false | false |
EMATech/autopower | autopower.py | 2 | 1804 | #!/bin/env python2
"""
Automate powered loudspeakers power with EATON UPS from Denon DN-500AV pre-amplifier state
"""
from twisted.internet import reactor
from twisted.internet.protocol import ClientFactory
from twisted.conch.telnet import TelnetTransport, TelnetProtocol # Unavailable in Python3, yet
from PyNUT impo... | gpl-3.0 | 7,586,736,075,752,400,000 | 31.8 | 95 | 0.687916 | false | 3.475915 | false | false | false |
jigarkb/CTCI | CTCI/chapter_2/2.3.py | 2 | 1156 | # Delete Middle Node: Implement an algorithm to delete a node in the middle of
# singly linked list, given only access to that node
from LinkedList import Node, LinkedList
def delete_middle_node(node_to_delete):
if node_to_delete.next is None:
raise Exception("Invalid node to delete")
node_to_delete.d... | mit | -1,494,367,965,266,206,200 | 37.533333 | 80 | 0.623702 | false | 3.420118 | false | false | false |
agalitsyn/play | 6-web-stream-server/server.py | 1 | 1507 | # http://flask.pocoo.org/docs/patterns/fileuploads/
import os
from flask import Flask, request, redirect, url_for, send_from_directory
from werkzeug import secure_filename
UPLOAD_FOLDER = 'uploads'
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] ... | gpl-3.0 | 5,452,678,844,395,169,000 | 34.069767 | 87 | 0.625083 | false | 3.79597 | false | false | false |
fginter/dep_search | bracketed2dsearch.py | 1 | 4894 | import six
assert six.PY3, "Please run me with Python3"
import ply.lex as lex
import ply.yacc as yacc
import readline
import urllib.parse
import requests
import sys
class Node:
def __init__(self,dtype,children):
self.dtype=dtype
self.children=children
def dsearch_ex_lin(self):
#cases... | gpl-3.0 | 2,211,182,918,179,198,000 | 25.743169 | 109 | 0.547814 | false | 3.284564 | false | false | false |
google-research/falken | service/learner/assignment_processor.py | 1 | 30183 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -273,857,898,316,733,730 | 39.030504 | 80 | 0.654541 | false | 4.001458 | false | false | false |
bittner/django-cms | cms/templatetags/cms_admin.py | 1 | 9639 | # -*- coding: utf-8 -*-
from classytags.arguments import Argument
from classytags.core import Options, Tag
from classytags.helpers import InclusionTag
from cms.constants import PUBLISHER_STATE_PENDING
from cms.toolbar.utils import get_plugin_toolbar_js
from cms.utils.admin import render_admin_rows
from sekizai.helpers ... | bsd-3-clause | -2,619,761,319,136,201,700 | 34.178832 | 120 | 0.634713 | false | 3.924674 | false | false | false |
open-synergy/event | event_sale_registration_partner_unique/models/sale_order.py | 1 | 1091 | # -*- coding: utf-8 -*-
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, models
from openerp.addons.event_registration_partner_unique import exceptions
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
... | agpl-3.0 | 2,935,847,197,673,163,300 | 35.3 | 75 | 0.573921 | false | 4.01845 | false | false | false |
hanw/connectal | scripts/adb/adb_protocol.py | 3 | 13753 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit | -4,266,882,794,569,911,000 | 33.906091 | 80 | 0.644369 | false | 3.800221 | false | false | false |
breakhearts/wallstreet | wallstreet/test/test_stock_api.py | 1 | 2758 | from __future__ import absolute_import
from wallstreet.crawler import stockapi
from wallstreet.crawler.fetcher import CurlFetcher
from datetime import datetime
from wallstreet import config
class TestYahooStockHistoryAPI:
def test_get_url_params(self):
api = stockapi.YahooHistoryDataAPI()
url, met... | apache-2.0 | 6,489,140,336,624,224,000 | 42.793651 | 125 | 0.642857 | false | 3.256198 | true | false | false |
lpsinger/astropy | examples/coordinates/plot_galactocentric-frame.py | 8 | 8058 | # -*- coding: utf-8 -*-
"""
========================================================================
Transforming positions and velocities to and from a Galactocentric frame
========================================================================
This document shows a few examples of how to use and customize the
`~ast... | bsd-3-clause | 7,444,938,070,177,072,000 | 40.323077 | 81 | 0.61169 | false | 3.385714 | false | false | false |
stxnext-kindergarten/presence-analyzer-drudkiewicz | src/presence_analyzer/utils.py | 1 | 5035 | # -*- coding: utf-8 -*-
"""
Helper functions used in views.
"""
import csv
from lxml import etree
from json import dumps
from functools import wraps
from datetime import datetime
from flask import Response
from presence_analyzer.main import app
import logging
log = logging.getLogger(__name__) # pylint: disable=C01... | mit | -7,590,320,113,156,924,000 | 23.802956 | 79 | 0.540417 | false | 3.915241 | false | false | false |
ghtmtt/DataPlotly | DataPlotly/core/plot_settings.py | 1 | 9944 | # -*- coding: utf-8 -*-
"""Encapsulates settings for a plot
.. note:: 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.
"""
from... | gpl-2.0 | 3,380,574,620,063,825,000 | 36.104478 | 120 | 0.573109 | false | 4.024282 | false | false | false |
basilboli/playground | pubsub-hello/subscribe.py | 1 | 1330 | from client import *
import base64
client = create_pubsub_client()
# You can fetch multiple messages with a single API call.
batch_size = 100
subscription = 'projects/single-object-747/subscriptions/mysubscription'
# Create a POST body for the Pub/Sub request
body = {
# Setting ReturnImmediately to false instru... | unlicense | -353,386,624,742,801,900 | 32.275 | 72 | 0.658647 | false | 4.222222 | false | false | false |
dhyeon/ingredient2vec | src/IngredientAnalysis.py | 1 | 1337 |
# import implemented python files
import Config
from utils import DataLoader, GensimModels, DataPlotter
class IngredientAnalysis:
def __init__(self, word_vectors):
print "\nIngredientAnalysis initialized"
self.word_vectors = word_vectors
def analogy(self):
list_most_similar_cosmul = self.wor... | apache-2.0 | -8,695,295,712,565,464,000 | 19.253968 | 129 | 0.697083 | false | 3.102088 | false | false | false |
mcocdawc/chemcoord | setup.py | 1 | 2131 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup file for the chemcoord package.
"""
from __future__ import with_statement
from __future__ import absolute_import
from setuptools import setup, find_packages
from io import open # pylint:disable=redefined-builtin
import version
MAIN_PACKAGE = 'chemcoord'
DESCRIPT... | lgpl-3.0 | -9,055,857,766,856,021,000 | 30.80597 | 79 | 0.635382 | false | 3.791815 | false | false | false |
mcrute/pydora | pydora/utils.py | 1 | 5542 | import os
import sys
import getpass
import subprocess
class TerminalPlatformUnsupported(Exception):
"""Platform-specific functionality is not supported
Raised by code that can not be used to interact with the terminal on this
platform.
"""
pass
class Colors:
def __wrap_with(raw_code):
... | mit | 2,048,144,627,866,843,600 | 25.644231 | 78 | 0.600686 | false | 4.243492 | false | false | false |
tfiers/arenberg-online | ticketing/management/commands/prefill_given_paper_tickets.py | 1 | 2064 | from django.core.management.base import BaseCommand
from given_paper_tickets import given_paper_tickets
from core.models import User
from ticketing.models import GivenPaperTickets, Performance
from datetime import datetime, date
from django.contrib.contenttypes.models import ContentType
import django.utils.timezone as ... | mit | 3,304,924,674,308,608,500 | 34 | 82 | 0.731589 | false | 2.831276 | false | false | false |
rendermotion/RMMel | rig/constraintSwitch.py | 1 | 5465 | import pymel.core as pm
from RMPY.rig import rigBase
class ConstraintSwitchModel(rigBase.BaseModel):
def __init__(self):
super(ConstraintSwitchModel, self).__init__()
self.outputs = []
self.list_a = []
self.list_b = []
self.constraints = []
self.attribute_output_a =... | lgpl-3.0 | -212,268,365,905,434,180 | 35.684564 | 106 | 0.597987 | false | 4.027266 | false | false | false |
latreides/SE_Team3 | flashcards/migrations/0002_auto_20140922_1421.py | 1 | 2495 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('flashcards', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='card',
name='Card... | mit | 8,965,067,324,240,967,000 | 30.582278 | 122 | 0.536273 | false | 4.400353 | false | false | false |
aosingh/lexpy | lexpy/trie.py | 1 | 1734 | from lexpy._base.node import FSANode
from lexpy._base.automata import FSA
__all__ = ['Trie']
class Trie(FSA):
__slots__ = 'root'
"""
Description:
To create a Trie instance, create an object of this class.
Attributes:
root: (_TrieNode) The Top level node which is created every time ... | gpl-3.0 | 1,698,374,852,213,542,100 | 26.109375 | 99 | 0.535755 | false | 4.25 | false | false | false |
CorundumGames/Invasodado | game/player.py | 1 | 9349 | from functools import partial
from itertools import chain
from math import sin, cos, pi
from random import gauss, uniform
from pygame import Rect, Surface
from pygame.constants import *
import pygame.key
from core import color
from core import config
from core.particles import Par... | gpl-3.0 | -2,049,556,484,475,392,000 | 38.121339 | 96 | 0.535886 | false | 3.63209 | true | false | false |
hughobrien/shimmer-nokia-fall-detection | MovementGrapher.py | 1 | 6767 | # Accelerometer Grapher and Fall Dector - Hugh O'Brien March 2009
#
#This is a script for PyS60 that opens a bluetooth serial connection
#to a pre-programmed SHIMMER sensor, The SHIMMER provides accelerometer
#data in the form "1111 1111 1111" where '1111' will be in the range
#of 0 -> 4400. The three values repre... | mit | -3,011,709,792,132,006,400 | 36.242938 | 75 | 0.648589 | false | 3.574749 | false | false | false |
proflayton/iPerfParser | ParserStructure/Pings.py | 1 | 4794 |
# ------------------------------------------------------------------------
# This block checks to see if the script is being run directly,
# i.e. through the command line. If it is, then it stops and exits the
# program, asking the user to use these files by running the main.py
# --------------------------------------... | mit | -2,295,991,434,001,595,400 | 40.695652 | 97 | 0.539007 | false | 3.872375 | false | false | false |
HKuz/Test_Code | setup.py | 1 | 4412 | #!/Applications/anaconda/envs/Python3/bin
import sys
def main():
'''Python 3 Quick Start Code Examples'''
# Get input from user and display it
# feels = input("On a scale of 1-10, how do you feel? ")
# print("You selected: {}".format(feels))
# Python Data Types
integer = 42
floater = 3.1... | mit | 3,006,655,741,803,645,000 | 32.172932 | 98 | 0.541024 | false | 3.758092 | false | false | false |
TEAM-HRA/hra_suite | HRAGUI/src/hra_gui/qt/docks/tachogram_plot_statistics_dock_widget.py | 1 | 4657 | '''
Created on 04-04-2013
@author: jurek
'''
from hra_core.special import ImportErrorMessage
try:
from PyQt4.QtCore import * # @UnusedWildImport
from PyQt4.QtGui import * # @UnusedWildImport
from hra_core.misc import Params
from hra_math.model.data_vector_listener import DataVectorListener
from h... | lgpl-3.0 | 8,411,936,265,652,319,000 | 40.954955 | 102 | 0.643333 | false | 4.124889 | false | false | false |
zsiki/ulyxes | pyapi/bluetoothiface.py | 1 | 5203 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: bluetoothiface.py
:platform: Unix, Windows
:synopsis: Ulyxes - an open source project to drive total stations and
publish observation results. GPL v2.0 license Copyright (C)
2010-2013 Zoltan Siki <siki.zoltan@epito.bme.hu>.
sudo apt-get ... | gpl-2.0 | -7,032,048,408,603,781,000 | 32.333333 | 91 | 0.566923 | false | 3.954373 | false | false | false |
ntt-nflex/flexer | examples/get_logs.py | 1 | 3563 | """This is an example implementation of a "get_logs" handler
for cmp-connectors. For the purpose of this example, a python generator is
generating fake logs
"""
import datetime as dt
import itertools
def get_logs(event, context):
# mock the credentials for now, they're usually inside the event
# e.g. credent... | gpl-2.0 | -4,423,594,845,112,025,600 | 30.254386 | 76 | 0.586304 | false | 3.802561 | false | false | false |
foraliving/pilot | foraliving/forms.py | 1 | 2864 | from django import forms
from django.forms import CharField, Form, PasswordInput
from .models import *
from django.contrib.auth.models import User, Group
from django.db.models.fields import BLANK_CHOICE_DASH
class volunteerUserSignupForm(forms.ModelForm):
password = forms.CharField(widget=PasswordInput())
cl... | mit | -6,639,675,033,360,926,000 | 43.061538 | 121 | 0.639665 | false | 3.912568 | false | false | false |
wangjun/pyload | module/plugins/hoster/UlozTo.py | 1 | 6962 | # -*- 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 | -4,936,276,214,774,120,000 | 44.201299 | 137 | 0.605085 | false | 3.575244 | false | false | false |
opennode/nodeconductor-saltstack | src/nodeconductor_saltstack/saltstack/apps.py | 1 | 2254 | from django.apps import AppConfig
from django.db.models import signals
from nodeconductor.structure import SupportedServices
class SaltStackConfig(AppConfig):
name = 'nodeconductor_saltstack.saltstack'
verbose_name = 'SaltStack Core'
service_name = 'SaltStack'
def ready(self):
from .backend ... | mit | -2,577,255,075,806,401,500 | 37.862069 | 117 | 0.63354 | false | 4.63786 | true | false | false |
MeGotsThis/Hanabi-AI | server.py | 1 | 20140 | import math
import random
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Type
from bot import bot
from enums import Action, Clue, Rank, Suit, Variant
from game import Game
names: List[str] = ['Alice', 'Bob', 'Cathy', 'Donald', 'Emily']
numberWords: List[str] = ['zero', 'one', 'two', 'thre... | gpl-3.0 | 8,164,153,947,375,564,000 | 39.04175 | 79 | 0.511867 | false | 4.117767 | false | false | false |
Enteee/pdml2flow | pdml2flow/cli.py | 1 | 4583 | # vim: set fenc=utf8 ts=4 sw=4 et :
import sys
import xml.sax
import imp
from os import path
from signal import signal, SIGINT
from shutil import copytree, ignore_patterns
from pkg_resources import resource_filename
from configparser import ConfigParser
from .logging import *
from .conf import Conf
from .plugin impor... | apache-2.0 | 7,527,734,594,599,178,000 | 26.443114 | 119 | 0.543749 | false | 3.957686 | false | false | false |
demisto/content | Packs/OpenCTI/Integrations/OpenCTI/OpenCTI.py | 1 | 24064 | import copy
from typing import List, Optional
from io import StringIO
import sys
import demistomock as demisto # noqa: E402 lgtm [py/polluting-import]
import urllib3
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
from pycti import OpenCTIApiClient, Identity
# Disable insecure warnings
urlli... | mit | 1,067,112,909,605,929,900 | 34.284457 | 120 | 0.607713 | false | 3.993362 | false | false | false |
daniilidis-group/bird_recording | src/find_onset.py | 1 | 4304 | #!/usr/bin/env python
#
# read and plot audio file
#
import numpy as np
import matplotlib.pyplot as plt;
import struct
import sys, os
import argparse
import scipy.signal
import ipdb
from scipy.io import wavfile
def plot_wave(t, s):
if s.ndim > 1:
for i in range(0, s.shape[1]):
plt.subplot(s.sh... | mit | 3,815,214,340,486,254,600 | 43.833333 | 132 | 0.618727 | false | 3.125635 | false | false | false |
fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractCleverneckoHomeBlog.py | 1 | 1509 | def extractCleverneckoHomeBlog(item):
'''
Parser for 'clevernecko.home.blog'
'''
badwords = [
'movie review',
'badword',
]
if any([bad in item['tags'] for bad in badwords]):
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in... | bsd-3-clause | -7,540,003,231,956,800,000 | 39.702703 | 138 | 0.495017 | false | 3.725248 | false | false | false |
j3camero/canada-election-forecast | calculate_redistributed_2011_results.py | 1 | 1836 | import csv
party_names = [
('Conservative', 'cpc'),
('NDP', 'ndp'),
('Liberal', 'lpc'),
('Bloc', 'bq'),
('Green', 'gpc'),
('Other', 'oth'),
]
ridings = {}
def AddVotes(riding_number, party_code, additional_votes):
if riding_number not in ridings:
ridings[riding_number] = {}
ri... | apache-2.0 | 15,204,818,751,444,074 | 33 | 76 | 0.587691 | false | 3.497143 | false | false | false |
tomncooper/heron | heron/tools/explorer/src/python/version.py | 5 | 1401 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 | 2,370,272,471,565,272,600 | 33.170732 | 63 | 0.725196 | false | 3.796748 | false | false | false |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/keyword_plan_campaign.py | 1 | 3725 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -3,534,356,946,514,556,000 | 29.284553 | 109 | 0.62953 | false | 4.204289 | false | false | false |
mapix/WebHello | WebHello/response.py | 1 | 1510 | # -*- coding:utf-8 -*-
import Cookie
import datetime
__all__ = ['Response']
class Response(object):
status = "200 OK"
def __init__(self, output="", request=None):
self.output = output
self.request = request
self.cookies = Cookie.SimpleCookie()
self.response_headers = [('Con... | bsd-3-clause | 305,731,184,399,917,760 | 35.829268 | 120 | 0.593377 | false | 3.852041 | false | false | false |
shawnhermans/cyborgcrm | cycomments/migrations/0001_initial.py | 1 | 1964 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import django_extensions.db.fields
import audit_log.models.fields
class Migration(migrations.Migration):
dependencies = [
('contenttypes'... | bsd-2-clause | -4,017,765,377,546,259,000 | 52.081081 | 204 | 0.660387 | false | 4.205567 | false | false | false |
kaushik94/sympy | examples/intermediate/coupled_cluster.py | 3 | 3691 | #!/usr/bin/env python
"""
Calculates the Coupled-Cluster energy- and amplitude equations
See 'An Introduction to Coupled Cluster Theory' by
T. Daniel Crawford and Henry F. Schaefer III.
Other Resource : http://vergil.chemistry.gatech.edu/notes/sahan-cc-2010.pdf
"""
from sympy.physics.secondquant import (AntiSymmetri... | bsd-3-clause | 5,840,633,361,370,606,000 | 29.504132 | 134 | 0.614739 | false | 2.787764 | false | false | false |
MelanieBittl/dolfin | demo/undocumented/petsc4py/python/demo_petsc4py.py | 3 | 2737 | """This demo program solves Poisson's equation
- div grad u(x, y) = f(x, y)
on the unit square with source f given by
f(x, y) = 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02)
and boundary conditions given by
u(x, y) = 0 for x = 0 or x = 1
du/dn(x, y) = sin(5*x) for y = 0 or y = 1
It demonstrates h... | gpl-3.0 | 8,582,205,401,691,385,000 | 25.833333 | 83 | 0.686518 | false | 2.887131 | false | false | false |
davidzchen/tensorflow | tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py | 3 | 6827 | # Copyright 2020 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 | -5,343,875,307,564,638,000 | 40.628049 | 85 | 0.666178 | false | 3.943963 | true | false | false |
xiaohan2012/capitalization-restoration-train | tests/test_util.py | 1 | 3055 | # -*- coding: utf-8 -*-
import os
from nose.tools import assert_equal, assert_true, assert_false
from capitalization_train.util import (extract_title,
get_document_content_paf,
is_monocase,
get_title_an... | mit | 683,156,147,735,513,900 | 30.173469 | 165 | 0.630442 | false | 3.260406 | false | false | false |
dallingham/regenerate | setup.py | 1 | 1326 | try:
from setuputils import setup
except ImportError:
from distutils.core import setup
setup(
name='regenerate',
version='1.0.0',
license='License.txt',
author='Donald N. Allingham',
author_email='dallingham@gmail.com',
description='Register editor for ASIC/FPGA designs',
long_descr... | gpl-2.0 | 6,191,504,294,718,468,000 | 43.2 | 82 | 0.636501 | false | 3.693593 | false | false | false |
altai/altai-api | altai_api/blueprints/invites.py | 1 | 3002 |
# vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab autoindent
# Altai API Service
# Copyright (C) 2012-2013 Grid Dynamics Consulting Services, Inc
# All Rights Reserved
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License ... | lgpl-2.1 | -2,387,585,171,577,959,000 | 27.590476 | 73 | 0.692871 | false | 3.438717 | false | false | false |
Christoph-D/Japanese-Tools | reading/read.py | 1 | 4247 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
#
# Automatic reading generation with kakasi and mecab.
# See http://ichi2.net/anki/wiki/JapaneseSupport
#
# Adapted for stand-alone use by
# Christoph Dittma... | gpl-3.0 | -5,141,048,142,559,384,000 | 32.230159 | 78 | 0.523525 | false | 3.30205 | false | false | false |
robinandeer/puzzle | puzzle/plugins/base_variant_mixin.py | 1 | 2440 | from puzzle.utils import (get_gene_info, get_cytoband_coord)
class BaseVariantMixin(object):
"""Base class for variant mixins"""
def variants(self, case_id, skip=0, count=30, filters=None):
"""Return a results tuple with variants and nr_of_variants.
"""
raise NotImplementedError
... | mit | -7,586,782,505,556,927,000 | 31.972973 | 71 | 0.515574 | false | 4.518519 | false | false | false |
yantisj/netgrph | nglib/ngtree/upgrade.py | 1 | 1274 | 'Upgrade older ngtrees to newer version'
import logging
logger = logging.getLogger(__name__)
def upgrade_ngt_v2(ngt):
'Upgrade ngt structures to version 2 for the API'
stack = list()
# Add dictionary to stack
stack.append(ngt)
# upgrade keys on all dictionaries
for tree in stack:
# ... | agpl-3.0 | -167,502,471,302,788,800 | 22.163636 | 64 | 0.526688 | false | 3.98125 | false | false | false |
DarKnight--/owtf | framework/plugin/scanner.py | 2 | 8554 | #!/usr/bin/env python
'''
The scan_network scans the network for different ports and call network plugins for different services running on target
'''
import re
import logging
from framework.dependency_management.dependency_resolver import BaseComponent
from framework.utils import FileOperations
SCANS_FOLDER = "scan... | bsd-3-clause | -6,012,392,452,692,870,000 | 47.327684 | 120 | 0.535773 | false | 3.492854 | false | false | false |
bungoume/webhook-deploy | webhook_deploy/core/models.py | 1 | 1442 | from django.db import models
from django.utils import timezone
from jsonfield import JSONField
class Repository(models.Model):
# github, gitbucket, etc...
hub = models.CharField(max_length=191, db_index=True)
# user
user = models.CharField(max_length=191)
# repository_name
name = models.CharFi... | mit | -1,986,875,627,614,209,300 | 29.680851 | 83 | 0.654646 | false | 3.483092 | false | false | false |
Yelp/kafka-python | test/test_admin_client_integration.py | 1 | 2702 | import os
import time
import unittest
import pytest
from kafka.admin_client import AdminClient, NewTopic, NewPartitionsInfo
from kafka.protocol.metadata import MetadataRequest
from test.fixtures import ZookeeperFixture, KafkaFixture
from test.testutil import KafkaIntegrationTestCase, env_kafka_version
KAFKA_ADMIN_TIM... | apache-2.0 | 4,979,695,835,716,379,000 | 35.513514 | 97 | 0.634345 | false | 3.910275 | true | false | false |
normalnorway/avtalegiro | ordernumber.py | 1 | 1492 | r"""
ORDER NUMBER: Numerical, 7 positions.
Unique numbering must be used for orders per payee's recipient agreement,
12 months + one day ahead.
An atomic incrementing counter is used, modulu 1e8. A check is done to
assert that order number is not reused in the last 12 months + 1 day.
@todo implement that check!
"""
... | gpl-3.0 | -4,596,594,146,202,820,000 | 32.155556 | 75 | 0.676273 | false | 3.767677 | false | false | false |
easyCZ/SLIP-A-2015 | respiratory/Processed Datasets/Processed Datasets/week6.py | 1 | 2409 | class patients(object):
def __init__(self,number,scores,stats,participated,rank,actual_rank,overall):
self.number = number # integer from 1-10. patient number.
self.scores = scores # list of floats element of [0,10]. Floats are scores for a given exercise.
self.stats = stats # for n exercises this is a list c... | mit | -4,914,040,263,418,544,000 | 25.483516 | 214 | 0.611042 | false | 2.283412 | false | false | false |
aaichsmn/tacc_stats | tacc_stats/analysis/job_printer.py | 1 | 2175 | #!/usr/bin/env python
import sys, os
import cPickle as pickle
from datetime import datetime
from tacc_stats import cfg as cfg
from tacc_stats.pickler import batch_acct,job_stats
def main(**args):
acct = batch_acct.factory(cfg.batch_system,
cfg.acct_path,
... | lgpl-2.1 | 5,620,917,312,338,584,000 | 33.52381 | 94 | 0.567816 | false | 3.983516 | false | false | false |
prontodev/ban2stats_dynamodb | stats/tests/test_blocked_country_package.py | 1 | 2434 | from django.test import SimpleTestCase
from django.conf import settings
from stats.models import BlockedCountry
from stats.packages.blocked_country import BlockedCountryPackageBuilder
import time
class TestBlockedCountryPackageBuilder(SimpleTestCase):
def setUp(self):
self.builder = BlockedCountryPackage... | gpl-2.0 | -482,902,131,101,907,100 | 39.583333 | 94 | 0.657354 | false | 3.6823 | true | false | false |
rjw57/edpcmentoring | edpcmentoring/cuedmembers/migrations/0001_initial.py | 2 | 2205 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-26 12:51
from __future__ import unicode_literals
from django.conf import settings
from django.core.management import call_command
from django.db import migrations, models
import django.db.models.deletion
def load_dept_structure(apps, schema_editor):
c... | mit | -1,037,518,257,966,597,800 | 38.375 | 152 | 0.609524 | false | 4.176136 | false | false | false |
mlufei/depot_tools | third_party/gsutil/gslib/addlhelp/metadata.py | 51 | 8027 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause | -694,530,456,639,687,000 | 42.155914 | 114 | 0.754952 | false | 4.297109 | false | false | false |
KRHS-GameProgramming-2014/SUPER-AWESOME-NINJA-GAME | HUD.py | 1 | 1412 | import pygame
class Text():
def __init__(self, pos, text = "", textSize = 12, textColor=(255,255,255), font = None):
self.text = text
self.textColor = textColor
self.font = pygame.font.Font(font, textSize)
self.image = self.font.render(self.text, 1, textColor)
self.rect = self.image.get_rect()
self.place(... | bsd-2-clause | 5,879,221,224,374,994,000 | 25.641509 | 100 | 0.667847 | false | 2.881633 | false | false | false |
ifermon/garagePi | event.py | 1 | 1068 | class Event(object):
_event_groups = {}
@classmethod
def get_events(cls, key="Default"):
return cls._event_groups.get(key, [])
def __init__(self, name, msg=None, group_key="Default"):
self._name = name
self._msg = msg
self._my_group = group_key
groups = Event.... | gpl-2.0 | -2,078,049,025,914,573,300 | 20.36 | 63 | 0.519663 | false | 3.56 | false | false | false |
argaen/restmote | restmote/sync.py | 1 | 2059 | import requests
import logging
import urlparse
from django.conf import settings
root = urlparse.urljoin(settings.RESTMOTE_HOST + ":" + settings.RESTMOTE_PORT, settings.RESTMOTE_API_ROOT)
def get_data(url):
if hasattr(settings, "RESTMOTE_USER") and hasattr(settings, "RESTMOTE_PASSWORD"):
r = requests.ge... | apache-2.0 | -7,204,773,143,457,903,000 | 31.171875 | 106 | 0.595435 | false | 3.35342 | false | false | false |
ChenJunor/hue | apps/pig/src/pig/models.py | 4 | 5507 | #!/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 | 6,807,907,979,281,745,000 | 31.585799 | 130 | 0.684402 | false | 3.620644 | false | false | false |
AdamMagoon/WhatCD | WhatMain.py | 1 | 3126 | from Models import query_all_requests, organize_data_model
from WhatApi import get_login, similar, GazelleAPIMod, \
get_requests_soup, parse_requests_page, match_two_sets, \
filter_torrent_alphabetically
u_name, pw = get_login()
# user = UserSession(user_name=u_name, password=pw)
def update_album_requests():... | mit | -2,521,717,268,370,013,000 | 36.214286 | 78 | 0.574216 | false | 4.049223 | false | false | false |
sam-m888/gprime | gprime/datehandler/_date_bg.py | 1 | 10250 | # -*- coding: utf-8 -*-
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# 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 Lice... | gpl-2.0 | 4,148,409,983,572,741,600 | 27.898089 | 116 | 0.426603 | false | 2.758893 | false | false | false |
telegraphic/allantools | tests/np_tests.py | 1 | 26560 | #!/usr/bin/env python
"""
np_tests.py
-----------
Compare output validity and speedup of numpy-accelerated codes to reference
pure python codes.
TODO: Tidy this up
"""
import numpy as np
import allantools.allantools_pure_python as alt
import allantools.allantools as alp
import time
if __name__ == "__main__":
... | gpl-3.0 | -3,758,425,467,134,489,000 | 29.955711 | 99 | 0.503539 | false | 2.659457 | true | false | false |
jwesstrom/cleverMirror | testStuff/animationTesting.py | 1 | 1907 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.clock import Clock
from kivy.graphics import Color, Ellipse
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.animation import Animation
class timerWidget(Widget):
def __init__(self, x=350, y =350, sizeWH=200, angle... | gpl-3.0 | 749,775,957,101,477,100 | 24.77027 | 121 | 0.558469 | false | 3.381206 | false | false | false |
dimatura/pydisp | pydisp/cli.py | 1 | 1988 | # -*- coding: utf-8 -*-
import os
import base64
import time
import click
import pydisp
@click.command(context_settings={'help_option_names':['-h','--help']})
@click.argument('images', nargs=-1, type=click.Path(exists=True), required=True)
@click.option('--title', '-t', type=str, help='Window title')
@click.option(... | mit | -8,539,764,335,290,668,000 | 35.145455 | 132 | 0.579477 | false | 3.674677 | false | false | false |
derkling/trappy | tests/test_run.py | 1 | 12778 | # Copyright 2015-2015 ARM Limited
#
# 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 | 8,696,708,809,115,110,000 | 32.362924 | 147 | 0.613789 | false | 3.628052 | true | false | false |
Wevolver/HAVE | multiple/repositories/backends/git/main.py | 1 | 6122 | import calendar
import collections
import io
import itertools
import stat
import time
import dulwich
import dulwich.objects
from multiple import repositories
from multiple import utils
class RepositoryGit(repositories.RepositoryBase):
def __init__(self, dulwich_repository):
self.backend = dulwich_repos... | gpl-3.0 | -2,013,109,953,934,375,700 | 28.574879 | 77 | 0.583633 | false | 4.081333 | false | false | false |
goodfeli/pylearn2 | pylearn2/datasets/dense_design_matrix.py | 2 | 54738 | """
The DenseDesignMatrix class and related code. Functionality for representing
data that can be described as a dense matrix (rather than a sparse matrix)
with each row containing an example and each column corresponding to a
different feature. DenseDesignMatrix also supports other "views" of the data,
for example a d... | bsd-3-clause | 8,283,100,961,385,428,000 | 33.644304 | 79 | 0.547389 | false | 4.456766 | false | false | false |
galaxy-team/website | newrelic/hooks/framework_cherrypy.py | 1 | 4772 | from __future__ import with_statement
import sys
import types
import newrelic.api.transaction
import newrelic.api.web_transaction
import newrelic.api.function_trace
import newrelic.api.object_wrapper
import newrelic.api.error_trace
class HandlerWrapper(object):
def __init__(self, wrapped):
self.__name =... | agpl-3.0 | -5,887,581,141,992,436,000 | 31.684932 | 72 | 0.564334 | false | 4.570881 | false | false | false |
Bergiu/smarthomepi | packages/shp/client/ServerController.py | 1 | 3142 | #
from ..Controller import Controller
from .Server import Server
class ServerController ( Controller ):
table_name="tbl_server"
def __init__( self, process, database):
"""
@database: Database
@**kwargs
user_controller: UserController
program_controller: ProgramController
bwl_list_controller: Bw... | gpl-3.0 | 1,749,547,383,230,368,300 | 21.442857 | 82 | 0.660089 | false | 2.964151 | false | false | false |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/pip-0.6.3-py2.7.egg/pip/vcs/subversion.py | 1 | 10484 | import os
import re
from pip import call_subprocess
from pip.index import Link
from pip.util import rmtree, display_path
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_re = re.compile(r'URL: (.+... | apache-2.0 | 2,218,389,806,356,872,200 | 40.438735 | 101 | 0.52499 | false | 3.974223 | false | false | false |
nccgroup/featherduster | feathermodules/auxiliary/rand_time.py | 1 | 2373 | import cryptanalib as ca
import feathermodules
from time import time
import random
def rand_seeded_with_time_check(samples):
def seed_and_generate_value(seed, lowest, highest):
random.seed(seed)
return random.randint(lowest, highest)
options = feathermodules.current_options
options_tmp = dict(... | bsd-3-clause | 35,931,700,480,913,720 | 37.274194 | 163 | 0.657817 | false | 3.968227 | false | false | false |
rpav/io_scene_consmodel | nodes.py | 1 | 6385 | __all__ = ["make_node", "CM_Node"]
import bpy
import bpy.types
import bpy_types
import bmesh
import bmesh.ops
import math
import mathutils
import pyconspack as cpk
from array import array
from pyconspack import Conspack
from mathutils import Matrix
import io_scene_consmodel.consmodel as consmodel
from io_scene_con... | bsd-2-clause | -6,084,708,919,340,452,000 | 29.697115 | 120 | 0.552702 | false | 3.362296 | false | false | false |
steven-cutting/latinpigsay | latinpigsay/tmp/experiments/timedtest.py | 1 | 1262 | # -*- coding: utf-8 -*-
__title__ = 'latinpigsay'
__license__ = 'MIT'
__author__ = 'Steven Cutting'
__author_email__ = 'steven.c.projects@gmail.com'
__created_on__ = '12/3/2014'
def func1(listofstrings):
return max([len(string) for string in listofstrings])
def func2(listofstrings):
return max(len(string) f... | mit | -2,829,386,036,969,377,300 | 17.558824 | 57 | 0.588748 | false | 3.100737 | false | false | false |
Patrick-Cole/pygmi | pygmi/pfmod/datatypes.py | 1 | 12775 | # -----------------------------------------------------------------------------
# Name: datatypes.py (part of PyGMI)
#
# Author: Patrick Cole
# E-Mail: pcole@geoscience.org.za
#
# Copyright: (c) 2013 Council for Geoscience
# Licence: GPL-3.0
#
# This file is part of PyGMI
#
# PyGMI is free softwa... | gpl-3.0 | -730,418,106,219,455,900 | 29.200946 | 79 | 0.517417 | false | 3.601635 | false | false | false |
bmccann/examples | super_resolution/main.py | 6 | 3291 | from __future__ import print_function
import argparse
from math import log10
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from model import Net
from data import get_training_set, get_test_set
# Training settings
parser = arg... | bsd-3-clause | 8,631,834,601,338,594,000 | 34.010638 | 120 | 0.679733 | false | 3.358163 | true | false | false |
SuperHouse/esp-open-rtos | utils/filteroutput.py | 16 | 3583 | #!/usr/bin/env python
#
# A thin Python wrapper around addr2line, can monitor esp-open-rtos
# output and uses gdb to convert any suitable looking hex numbers
# found in the output into function and line numbers.
#
# Works with a serial port if the --port option is supplied.
# Otherwise waits for input on stdin.
#
impor... | bsd-3-clause | -3,975,044,797,260,328,400 | 33.12381 | 142 | 0.590008 | false | 3.630193 | false | false | false |
birm/dbops | dbops/RecursiveDep.py | 1 | 3451 | import os
class RecursiveDep(object):
"""
Map all dependencies for a database/schema, to advise changes.
args:
host: the hostname to use to connect to
database: the database to check against
form: the form to return the result
"""
def __init__(self,... | gpl-3.0 | -2,130,449,234,815,290,400 | 38.215909 | 81 | 0.558968 | false | 4.464424 | false | false | false |
smartanthill/smartanthill1_0 | smartanthill/network/service.py | 1 | 8242 | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
# pylint: disable=W0613
from binascii import hexlify
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, maybeDeferred, returnValue
from twisted.internet.serialport import SerialPort
import smartanthill.ne... | mit | 1,871,958,403,645,602,300 | 34.373391 | 79 | 0.615749 | false | 4.110723 | false | false | false |
locationtech/geowave | python/src/main/python/pygw/geotools/simple_feature_type_builder.py | 2 | 2794 | #
# Copyright (c) 2013-2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 whic... | apache-2.0 | 3,524,314,869,859,865,000 | 31.488372 | 112 | 0.622047 | false | 4.633499 | false | false | false |
subutai/nupic | tests/integration/nupic/algorithms/knn_classifier_test/categories_test.py | 10 | 3864 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 | 3,642,878,663,968,790,000 | 29.666667 | 79 | 0.658644 | false | 3.726133 | true | false | false |
happeninghq/happening | src/happening/templatetags/forms.py | 2 | 1471 | """Form helpers."""
from django import template
from django.template.loader import render_to_string
from collections import OrderedDict
register = template.Library()
@register.filter
def render_as_blocks(form):
"""Render a form using blocks to contain sections."""
o_label_suffix = form.label_suffix
form.... | mit | -6,167,044,077,358,500,000 | 26.240741 | 67 | 0.634262 | false | 4.263768 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.