repo_name stringlengths 5 92 | path stringlengths 4 232 | copies stringclasses 19
values | size stringlengths 4 7 | content stringlengths 721 1.04M | 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 15 997 | alpha_frac float64 0.25 0.97 | autogenerated bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|
evansosenko/spin-lifetime-analysis | analysis/data.py | 1 | 3319 | import os
import numpy
import scipy_data_fitting
class Fig4(scipy_data_fitting.Data):
"""
Use this to load the data from Figure 4 in PhysRevLett.105.167202.
Should not be used directly, but only subclassed.
"""
def __init__(self, subfig):
super().__init__()
self.subfig = subfig
... | mit | 4,957,334,593,424,651,000 | 30.018692 | 83 | 0.6047 | false |
geomagpy/MARTAS | app/file_download.py | 1 | 42049 | #!/usr/bin/env python
"""
Get files from a remote server (to be reached by nfs, samba, ftp, html or local directory)
file content is directly added to a data bank (or local file if preferred).
"""
from __future__ import print_function
from magpy.stream import *
from magpy.database import *
from magpy.opt import cred... | gpl-3.0 | 1,479,611,255,749,253,000 | 37.862292 | 242 | 0.55509 | false |
rtibbles/kolibri | kolibri/utils/tests/test_cli.py | 1 | 3590 | """
Tests for `kolibri` module.
"""
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import pytest
from kolibri.utils import cli
from .base import KolibriTestBase
logger = logging.getLogger(__name__)
@pytest.fixture
def conf():
from kolibri.utils import conf
... | mit | 682,227,345,977,819,300 | 31.342342 | 78 | 0.609749 | false |
hmendozap/master-arbeit-projects | autosk_dev_test/component/implementation/FeedForwardNet.py | 1 | 15383 | """
Created on Jul 22, 2015
Modified on Apr 21, 2016
@author: Aaron Klein
@modified: Hector Mendoza
"""
import numpy as np
from sklearn.utils.validation import check_random_state
import theano
import theano.tensor as T
import theano.sparse as S
import lasagne
DEBUG = True
def sharedX(X, dtype=theano.config.floatX, ... | mit | -2,196,560,965,525,019,400 | 41.37741 | 96 | 0.556263 | false |
miguelinux/vbox | src/VBox/ValidationKit/common/utils.py | 1 | 58323 | # -*- coding: utf-8 -*-
# $Id: utils.py $
# pylint: disable=C0302
"""
Common Utility Functions.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute... | gpl-2.0 | -3,673,735,913,334,923,000 | 31.87655 | 124 | 0.55815 | false |
bright-sparks/wpull | wpull/url.py | 1 | 20604 | '''URL parsing based on WHATWG URL living standard.'''
import collections
import fnmatch
import functools
import gettext
import logging
import re
import string
import urllib.parse
import posixpath
from wpull.backport.logging import BraceMessage as __
import wpull.string
_logger = logging.getLogger(__name__)
_ = gett... | gpl-3.0 | 7,461,028,754,398,663,000 | 28.219858 | 86 | 0.597282 | false |
GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awxkit/awxkit/api/pages/roles.py | 1 | 1150 | import logging
from awxkit.api.resources import resources
from . import base
from . import page
log = logging.getLogger(__name__)
class Role(base.Base):
NATURAL_KEY = ('name',)
def get_natural_key(self, cache=None):
if cache is None:
cache = page.PageCache()
natural_key = su... | apache-2.0 | 3,697,434,702,690,880,500 | 24 | 89 | 0.595652 | false |
nyergler/pythonslides | readthedocs/builds/models.py | 1 | 11261 | import re
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _, ugettext
from guardian.shortcuts import assign, get_objects_for_user
from taggit.managers import TaggableManager
from projects.models import Pr... | mit | 4,639,291,233,820,865,000 | 34.749206 | 89 | 0.552704 | false |
mghpcc-projects/user_level_slurm_reservations | commands/hil_slurmctld_prolog.py | 1 | 14582 | """
MassOpenCloud / Hardware Isolation Layer (HIL)
Slurm Control Daemon - HIL Reservation Prolog
May 2017, Tim Donahue tpd001@gmail.com
"""
import argparse
import hostlist
import inspect
import logging
import os
import sys
from datetime import datetime, timedelta
from time import strftime
libdir = os.path.realpath(... | mit | -5,637,913,810,003,291,000 | 37.885333 | 116 | 0.577904 | false |
AlJohri/nucraigslist | listings/management/commands/download.py | 1 | 2466 | from django.core.management.base import BaseCommand, CommandError
from listings.models import Listing, User, Comment, Group
import os, sys
from django.utils import timezone
from optparse import make_option
from listings.lib import save_obj, get_fb_graph_api, get_word_bank, filter_listing
from dateutil.parser import pa... | gpl-3.0 | -2,108,560,672,248,644,000 | 35.264706 | 126 | 0.564477 | false |
xcme/briseis | devices/SW-Common-28.py | 1 | 5978 | # coding=UTF8
# Строчка выше нужна на случай использования Non-ASCII символов, например кириллицы.
ms_RxTx = {
# RX .1.3.6.1.2.1.31.1.1.1.6 ifHCInOctets
'~RX.1' : '.1.3.6.1.2.1.31.1.1.1.6.1',
'~RX.2' : '.1.3.6.1.2.1.31.1.1.1.6.2',
'~RX.3' : '.1.3.6.1.2.1.31.1.1.1.6.3',
'~RX... | gpl-2.0 | -7,170,010,892,784,283,000 | 43.818182 | 84 | 0.398749 | false |
Alymantara/maelstorm | tests/test_main.py | 1 | 1272 | from pytest import raises
# The parametrize function is generated, so this doesn't work:
#
# from pytest.mark import parametrize
#
import pytest
parametrize = pytest.mark.parametrize
from maelstorm import metadata
from maelstorm.main import main
class TestMain(object):
@parametrize('helparg', ['-h', '--help'... | mit | 4,045,476,757,722,540,500 | 34.333333 | 76 | 0.643082 | false |
jbenden/ansible | lib/ansible/modules/cloud/amazon/efs_facts.py | 1 | 11177 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
... | gpl-3.0 | -2,514,477,651,479,542,000 | 28.568783 | 156 | 0.585756 | false |
yelizariev/addons-yelizariev | ir_attachment_s3/tests/test_resized_attachments.py | 1 | 5679 | # Copyright 2019 Rafis Bikbov <https://it-projects.info/team/RafiZz>
# Copyright 2019 Alexandr Kolushov <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Eugene Molotov <https://it-projects.info/team/em230418>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import logging
from odoo... | lgpl-3.0 | 5,909,971,476,124,248,000 | 39.276596 | 134 | 0.631625 | false |
philipgian/pre-commit | tests/commands/install_uninstall_test.py | 1 | 20438 | from __future__ import absolute_import
from __future__ import unicode_literals
import io
import os.path
import re
import shutil
import subprocess
import sys
import mock
import pre_commit.constants as C
from pre_commit.commands.install_uninstall import CURRENT_HASH
from pre_commit.commands.install_uninstall import in... | mit | -5,424,046,404,525,893,000 | 33.407407 | 79 | 0.635728 | false |
pavolloffay/jaeger | plugin/storage/es/esCleaner.py | 1 | 4828 | #!/usr/bin/env python3
import curator
import elasticsearch
import os
import ssl
import sys
TIMEOUT=120
def main():
if len(sys.argv) != 3:
print('USAGE: [INDEX_PREFIX=(default "")] [ARCHIVE=(default false)] ... {} NUM_OF_DAYS http://HOSTNAME[:PORT]'.format(sys.argv[0]))
print('NUM_OF_DAYS ... dele... | apache-2.0 | 3,711,925,970,792,277,000 | 42.107143 | 250 | 0.663422 | false |
Lamelos/django-allauth-office365 | allauth_office365/adapter.py | 1 | 2506 | from django.contrib import messages
from django.dispatch import receiver
from django.http import HttpResponseForbidden
from allauth.account.signals import user_logged_in
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter, get_adapter
from allauth.... | mit | 1,764,432,020,011,735,000 | 44.563636 | 114 | 0.659218 | false |
cyberang3l/sysdata-collector | libs/globalvars.py | 1 | 2230 | # Copyright (C) 2014 Vangelis Tasoulas <vangelis@tasoulas.net>
#
# 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.
#
# Th... | gpl-3.0 | -8,446,234,026,580,170,000 | 26.875 | 71 | 0.685202 | false |
dcsch/pyif | pyif/story.py | 1 | 3162 | '''
Created on Nov 21, 2013
@author: david
'''
from thing import Thing, Player
import grammar
import parser
import action
import glk
class Story:
def __init__(self, name, headline, delegate):
self.name = name
self.headline = headline
self.release = 1
self.serial = 81001
s... | mit | -1,471,477,336,399,294,700 | 29.114286 | 67 | 0.550285 | false |
HomeRad/TorCleaner | doc/bfknav.py | 1 | 7157 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2009 Bastian Kleineidam
"""
General navigation writer reading .nav file info.
"""
import sys
import os
import re
from cStringIO import StringIO
_slashes_ro = re.compile(r"/+")
_thisdir_ro = re.compile(r"^\./")
_samedir_ro = re.compile(r"/\./|/\.$")
_parentdir_ro = re.... | gpl-2.0 | 5,557,763,311,401,146,000 | 26.526923 | 99 | 0.551069 | false |
EKiefer/edge-starter | py34env/Scripts/thresholder.py | 1 | 1845 | #!c:\users\ekiefer\projects\django\my_edge\py34env\scripts\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates how a 1-bit BitmapImage can be used
# as a dynamically updated overlay
#
try:
from tkinter import *
except ImportError:
from Tkinter import *
from PIL import Image, Imag... | mit | 5,243,874,531,555,993,000 | 23.932432 | 74 | 0.58916 | false |
DimensionDataCBUSydney/plumbery | plumbery/infrastructure.py | 1 | 66146 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 | -8,525,752,551,770,169,000 | 33.397296 | 88 | 0.515647 | false |
michaelrice/gotland | setup.py | 1 | 2459 | # Copyright 2014 Michael Rice <michael@michaelrice.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 | -6,532,868,214,960,393,000 | 36.830769 | 76 | 0.651891 | false |
ioos/catalog-ckan | ckanext/ioos_theme/controllers/feedback.py | 1 | 3831 | #!/usr/bin/env python
'''
ckanext/ioos_theme/controllers/feedback.py
IOOS Theme Feedback Controller
'''
from ckan.lib.base import BaseController, render, _
from ckan.lib import helpers as h
from ckan.common import request
from ckanext.ioos_theme.lib import feedback
from pylons import config
import logging
import urlli... | agpl-3.0 | 8,250,284,174,334,944,000 | 35.141509 | 90 | 0.577656 | false |
ned14/Bugs-Everywhere-for-BEurtle | libbe/command/severity.py | 1 | 4051 | # Copyright (C) 2005-2012 Aaron Bentley <abentley@panoramicfeedback.com>
# Chris Ball <cjb@laptop.org>
# Gianluca Montecchi <gian@grys.it>
# Marien Zwart <marien.zwart@gmail.com>
# Thomas Gerigk <tgerigk@gmx.de>
# ... | gpl-2.0 | 8,860,493,650,325,930,000 | 37.216981 | 79 | 0.596396 | false |
rkomartin/user-recs-example | util/process_movielens.py | 1 | 1215 | import json
import sys
from os.path import join
'''
Read movielens data into Veritable-ready json
'''
def main(input_file, output_dir):
data = {}
columns = set()
with open(input_file) as fd:
for line in fd:
tokens = line.split('\t')
user_id = 'U{}'.format(tokens[0]).decode(... | mit | -8,084,242,574,354,765,000 | 29.375 | 72 | 0.549794 | false |
nosyndicate/pytorchrl | pytorchrl/distributions/diagonal_gaussian.py | 1 | 4283 | import numpy as np
import torch
from pytorchrl.distributions.base import Distribution
from pytorchrl.misc.tensor_utils import constant
class DiagonalGaussian(Distribution):
"""
Instead of a distribution, rather a collection of distribution.
"""
def __init__(self, means, log_stds):
"""
... | mit | 3,443,545,097,000,983,600 | 32.234375 | 147 | 0.547485 | false |
qtproject/pyside-pyside | tests/QtCore/qflags_test.py | 1 | 4672 | #!/usr/bin/python
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holdin... | lgpl-2.1 | -8,054,306,986,531,099,000 | 37.61157 | 97 | 0.661173 | false |
h5py/h5py | h5py/tests/test_attrs_data.py | 1 | 7646 | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Attribute data transfer testing module
... | bsd-3-clause | 2,816,667,813,688,763,400 | 28.183206 | 78 | 0.552577 | false |
quantumlib/OpenFermion | src/openfermion/utils/grid.py | 1 | 11136 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | apache-2.0 | -896,618,528,948,675,100 | 36.494949 | 80 | 0.592672 | false |
abetusk/www.meowcad.com | cgi/picModLibSentry.py | 1 | 1864 | #!/usr/bin/python
#
import os
import cgi
import cgitb
import sys
import meowaux as mew
import urllib
import Cookie
import json
cgitb.enable();
#print "Content-Type: text/html"
#print
cookie = Cookie.SimpleCookie()
cookie_hash = mew.getCookieHash( os.environ )
g_debug = False
def log_line( l ):
logf = open("/tmp/... | agpl-3.0 | -7,365,819,750,410,541,000 | 20.929412 | 90 | 0.65397 | false |
alphapigger/igetui | igetui/google/protobuf/message_factory.py | 1 | 4235 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | mit | -3,856,056,638,776,542,700 | 35.477876 | 80 | 0.716883 | false |
ama-jharrison/agdc | agdc/api/source/main/python/datacube/api/tool/retrieve_dataset_stack.py | 1 | 12976 | #!/usr/bin/env python
# ===============================================================================
# Copyright 2015 Geoscience Australia
#
# 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
... | apache-2.0 | 1,836,849,953,270,979,000 | 38.560976 | 161 | 0.556412 | false |
gtrdotmcs/python-withings | tests/test_withings_measures.py | 1 | 1458 | import time
import unittest
from withings import WithingsMeasureGroup, WithingsMeasures
class TestWithingsMeasures(unittest.TestCase):
def test_withings_measures_init(self):
"""
Check that WithingsMeasures create groups correctly and that the
update time is parsed correctly
"""
... | mit | -9,134,735,069,673,304,000 | 41.882353 | 73 | 0.606996 | false |
ProjetPP/PPP-QuestionParsing-Grammatical | tests/test_dependencyTree.py | 1 | 4775 | import json
from nltk.stem.wordnet import WordNetLemmatizer
from ppp_questionparsing_grammatical import Word, DependenciesTree, TreeGenerator, computeTree
import data
from unittest import TestCase
class DependenciesTreeTests(TestCase):
########
# Word #
########
def testBasicWordConstructor1(self):
... | agpl-3.0 | 1,798,899,934,578,973,200 | 37.2 | 100 | 0.580105 | false |
janghe11/IoT_Hands-On-Lab | 02_iot-raspbian/05_rotary-led.py | 1 | 1863 | # Adjust LED brightness by rotating Potentiometer
# GrovePi + Rotary Angle Sensor (Potentiometer) + LED
# http://www.seeedstudio.com/wiki/Grove_-_Rotary_Angle_Sensor
# http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit
'''
The MIT License (MIT)
GrovePi for the Raspberry Pi: an open source platform for connecting... | mit | 6,494,753,258,044,894,000 | 32.890909 | 103 | 0.760601 | false |
enthought/traitsgui | examples/dock/dock_test2.py | 1 | 1977 | #-------------------------------------------------------------------------------
#
# Test the DockWindow.
#
# Written by: David C. Morrill
#
# Date: 10/20/2005
#
# (c) Copyright 2005 by Enthought, Inc.
#
#-------------------------------------------------------------------------------
#-----------------------------... | bsd-3-clause | 577,342,658,993,957,100 | 28.954545 | 80 | 0.254932 | false |
emmanvg/cti-stix-elevator | stix2elevator/convert_pattern.py | 1 | 89308 | import datetime
import re
import sys
from cybox.objects.account_object import Account
from cybox.objects.address_object import Address
from cybox.objects.archive_file_object import ArchiveFile
from cybox.objects.domain_name_object import DomainName
from cybox.objects.email_message_object import EmailMessage
from cybox... | bsd-3-clause | 1,290,568,712,240,709,000 | 43.676338 | 142 | 0.613797 | false |
Osthanes/appscan_static_analyzer | appscan_check.py | 1 | 36174 | #!/usr/bin/python
#***************************************************************************
# Copyright 2015 IBM
#
# 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.a... | apache-2.0 | -3,397,173,683,578,174,000 | 38.927152 | 268 | 0.565931 | false |
braams/shtoom | shtoom/ui/tkui/popups.py | 1 | 7401 |
from Tkinter import Toplevel, Tk
if __name__ == "__main__":
_ = lambda x:x
class Popup(Toplevel):
deferred = None
parent = None
def __init__(self, parent, addnl=None):
Toplevel.__init__(self)
self.initial_focus = self
self.parent = parent
self.addnl = addnl
s... | lgpl-2.1 | 8,494,601,776,254,829,000 | 31.460526 | 79 | 0.563437 | false |
shiaki/iterative-modelling | src/pcs_snap.py | 1 | 3204 | #!/usr/bin/python
work_dir = ''
import numpy as np
from scipy.io import FortranFile as ufmt
if __name__ == '__main__':
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
# See GALAXY 14.50 Manual, Sec. 9.2, P54
header_dtype = [('n1', '<i4'), ('n2', '<i4'), ('n3', '<i4'),
('nco... | bsd-3-clause | -3,170,242,807,777,087,500 | 25.92437 | 66 | 0.522784 | false |
ParticulateSolutions/django-sofortueberweisung | setup.py | 1 | 2687 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__... | mit | -1,253,928,873,854,482,700 | 30.768293 | 100 | 0.605136 | false |
olynch/dicebag | dicebag.py | 1 | 3627 | #!/usr/bin/env python3
import random, pickle, sys, cmd
class Dice:
""" Contains x dice with n sides, or a plain modifier """
def __init__(self, dice):
""" Either takes in a string with a modifier, such as +4, or a dice description, such as 2d8 """
if dice[0] in ("+", "-"):
self.mod = int(dice)
self.num, se... | mit | 1,283,960,359,057,703,400 | 29.225 | 102 | 0.632479 | false |
dsoprea/PySecure | pysecure/types.py | 1 | 4059 | import platform
from ctypes import *
from datetime import datetime
from pysecure.constants import TIME_DATETIME_FORMAT
from pysecure.constants.sftp import SSH_FILEXFER_TYPE_REGULAR, \
SSH_FILEXFER_TYPE_DIRECTORY, \
SSH_FILEXFER_TYPE_SYMLINK, \
... | gpl-2.0 | -6,243,054,323,641,303,000 | 30.465116 | 101 | 0.55186 | false |
dke-knu/i2am | i2am-app/AlgorithmSelectionEngine/PeriodicClassification/DeepLearning(local).py | 1 | 2820 | """ Learned classification model """
import tensorflow as tf
from PeriodicClassification import ModelConfig as myConfig
from PeriodicClassification import Preprocess as pre
def _model(X, keep_prob):
# input
W1 = tf.Variable(tf.random_normal([myConfig.INPUT_SIZE, myConfig.HIDDEN_SIZE]), name="weight1")
b1 ... | apache-2.0 | 5,677,919,536,755,330,000 | 33.207317 | 100 | 0.661912 | false |
jgliss/pyplis | pyplis/model_functions.py | 1 | 8950 | # -*- coding: utf-8 -*-
#
# Pyplis is a Python library for the analysis of UV SO2 camera data
# Copyright (C) 2017 Jonas Gliss (jonasgliss@gmail.com)
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License a
# published by the Free Software Foundat... | gpl-3.0 | 7,274,057,895,621,544,000 | 35.234818 | 79 | 0.603128 | false |
gomezgoiri/reusingWebActuatorsFromSemanticSpace | actuation/api/space.py | 1 | 1442 | # -*- coding: utf-8 -*-
'''
Copyright (C) 2013 onwards University of Deusto
All rights reserved.
This software is licensed as described in the file COPYING, which
you should have received as part of this distribution.
This software consists of contributions made by many individuals,
listed below:
@auth... | apache-2.0 | 147,625,966,535,404,900 | 18.226667 | 67 | 0.638446 | false |
UNC-Major-Lab/Fragment-Isotope-Distribution-Paper | scripts/theoretical/mergeHistogram.py | 1 | 1930 | #!/usr/bin/env python
import sys
import os
import re
from collections import defaultdict
from math import floor
from math import isnan
root_dir = sys.argv[1]
prefix = sys.argv[2]
do_iso = sys.argv[3]
if do_iso == 'F':
comp2bin2count = defaultdict(dict)
for f in os.listdir(root_dir):
fp = root_dir+"/"... | mit | 324,607,062,226,680,960 | 32.877193 | 95 | 0.526425 | false |
NETWAYS/ingraph | ingraph/api.py | 1 | 16388 | # inGraph (https://www.netways.org/projects/ingraph)
# Copyright (C) 2011-2012 NETWAYS GmbH
#
# 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 optio... | gpl-3.0 | 3,848,192,613,168,572,400 | 34.703704 | 134 | 0.527886 | false |
spark8103/deploy | app/celery_runner.py | 1 | 4976 | import subprocess
from subprocess import Popen, PIPE
from . import celery
@celery.task(bind=True)
def deploy_running_task(self, cmd, type='Deploy'):
has_error = False
result = None
output = ""
self.update_state(state='PROGRESS',
meta={'output': output,
... | mit | 2,258,274,440,267,406,800 | 35.321168 | 107 | 0.527532 | false |
talumbau/webapp-public | webapp/apps/taxbrain/helpers.py | 1 | 26371 | from collections import namedtuple
import taxcalc
import dropq
import os
import requests
from requests.exceptions import Timeout, RequestException
import json
import pandas as pd
import time
#
# Prepare user params to send to DropQ/Taxcalc
#
NUM_BUDGET_YEARS = int(os.environ.get('NUM_BUDGET_YEARS', 10))
START_YEAR =... | mit | -2,011,549,738,239,617,500 | 31.881546 | 93 | 0.540101 | false |
lucc/alot | tests/utils/argparse_test.py | 1 | 5935 | # encoding=utf-8
# Copyright © 2017 Dylan Baker
# 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 dist... | gpl-3.0 | -1,888,860,210,976,214,300 | 32.337079 | 93 | 0.667678 | false |
monkut/deso | deso/deso/layers/raster/management/commands/fill_raster_layer_cache.py | 1 | 2025 | """
Make requests for tiles at given zoom levels to fill the tilecache.
"""
from django.core.management.base import BaseCommand
from django.conf import settings
from ...models import RasterAggregatedLayer
WGS84_SRID = settings.WGS84_SRID
def request_layer_tiles(layer_url, layer, zoom):
"""
Request tiles for g... | mit | 2,064,351,220,925,089,800 | 37.207547 | 122 | 0.536296 | false |
MissionCriticalCloud/marvin | marvin/cloudstackAPI/uploadCustomCertificate.py | 1 | 1685 | """Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself."""
from baseCmd import *
from baseResponse import *
class upl... | apache-2.0 | 2,818,282,309,625,276,000 | 43.342105 | 328 | 0.651632 | false |
eunchong/build | scripts/slave/recipe_modules/chromium_tests/chromium_fyi.py | 1 | 63755 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from . import steps
RESULTS_URL = 'https://chromeperf.appspot.com'
SPEC = {
'settings': {
'build_gs_bucket': 'chromium-fyi-archive',
},
'builders... | bsd-3-clause | -3,632,314,178,595,956,000 | 28.792056 | 87 | 0.536115 | false |
intelligent-agent/redeem | tests/gcode/test_M114.py | 1 | 1069 | from __future__ import absolute_import
import mock
from random import random
from .MockPrinter import MockPrinter
from redeem.Gcode import Gcode
class M114_Tests(MockPrinter):
def test_gcodes_M114(self):
A = round(random() * 200, 1)
B = round(random() * 200, 1)
C = round(random() * 200, 1)
X = rou... | gpl-3.0 | 9,131,512,291,480,535,000 | 27.891892 | 95 | 0.533209 | false |
sunnychaudhari/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py | 1 | 226833 |
''' -- imports from python libraries -- '''
# import os -- Keep such imports here
import datetime
import csv
import time
import ast
import json
import math
import multiprocessing
''' -- imports from installed packages -- '''
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django... | agpl-3.0 | 7,496,256,682,763,233,000 | 40.658953 | 521 | 0.557128 | false |
yuhangc/HRI_planner | scripts/hri/human_traj_generator.py | 1 | 5437 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
class HumanTrajGenerator:
def __init__(self, T, dt):
self.T = T
self.dt = dt
# set some parameters
self.v_max = 1.0
self.a_max = 0.6
self.k_v = 0.8
self.k_hr = 0.6
self.th_hr... | apache-2.0 | -6,814,724,475,351,384,000 | 31.363095 | 108 | 0.48924 | false |
WaveBlocks/WaveBlocksND | examples/henon_heiles/henon2_p.py | 1 | 1311 | algorithm = "hagedorn"
propagator = "semiclassical"
splitting_method = "Y4"
T = 6
dt = 0.01
dimension = 2
ncomponents = 1
eps = 0.05
potential = "henon_heiles"
a = 1
b = 3
# The parameter set of the initial wavepacket
Q = [[1.0, 0.0],
[0.0, 1.0]]
P = [[1.0j, 0.0 ],
[0.0, 1.0j]]
q = [[0.06],
[0.0]... | bsd-3-clause | 1,590,440,808,835,866,000 | 18.279412 | 86 | 0.508772 | false |
mromanello/CitationExtractor | citation_extractor/settings/svm.py | 1 | 1036 | """Settings for an SVM-based citation extractor."""
import pkg_resources
from sklearn.svm import LinearSVC
# Sets debug on (=true) or off (=false)
DEBUG = False
POS = True
# leave empty to write the log to the console
LOG_FILE = ""
# list of directories containing data (IOB format with .iob extension)
DATA_DIRS = (
... | gpl-3.0 | 4,482,813,493,128,714,000 | 19.313725 | 70 | 0.665058 | false |
Astyan-42/skepticalscience | skepticalsciencewebsite/custompayment/forms.py | 1 | 3142 | from django import forms
from django.core.exceptions import ValidationError
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from custompayment.models import Addres... | agpl-3.0 | -482,083,300,925,337,660 | 36.86747 | 108 | 0.63972 | false |
Vaidyanath/tempest | tempest/tests/cmd/test_verify_tempest_config.py | 1 | 17401 | # Copyright 2014 IBM Corp.
#
# 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 t... | apache-2.0 | -2,029,038,440,269,864,700 | 47.470752 | 79 | 0.569163 | false |
giliam/turbo-songwriter | backend/songwriter/migrations/0001_initial.py | 1 | 5963 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-04 14:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | mit | 1,539,306,744,246,456,000 | 52.241071 | 135 | 0.584605 | false |
hkzhe/ddz_project | game_server/client.py | 1 | 1279 | import socket
import json
import struct
import sys
import time
def build_login_cmd():
cmd_dict = {}
cmd_dict["userID"] = sys.argv[1]
cmd_dict["cmd"] = "login"
return json.dumps( cmd_dict )
def send_cmd( sock , cmd ):
cmd_len = len( cmd )
send_str = struct.pack( 'i' , cmd_len )
sock.send( send_str... | bsd-3-clause | 6,844,430,092,311,269,000 | 24.102041 | 60 | 0.591869 | false |
dongweiming/web_develop | chapter10/section2/server.py | 1 | 3462 | # coding=utf-8
import os
import sys
from datetime import datetime
sys.path.append('gen-py')
sys.path.append('/usr/lib/python2.7/site-packages')
from flask_sqlalchemy import SQLAlchemy
from app import app
from models import PasteFile as BasePasteFile
from utils import get_file_md5
db = SQLAlchemy(app)
from thrift.t... | gpl-3.0 | 7,807,537,685,541,028,000 | 31.130841 | 79 | 0.62071 | false |
YoungKwonJo/mlxtend | tests/tests_classifier/test_logistic_regression.py | 1 | 1935 | from mlxtend.classifier import LogisticRegression
from mlxtend.data import iris_data
import numpy as np
X, y = iris_data()
X = X[:, [0, 3]] # sepal length and petal width
X = X[0:100] # class 0 and class 1
y = y[0:100] # class 0 and class 1
# standardize
X[:, 0] = (X[:, 0] - X[:, 0].mean()) / X[:, 0].std()
X[:, 1... | bsd-3-clause | -4,449,064,169,604,691,000 | 29.714286 | 79 | 0.518863 | false |
lambdamusic/OntoSPy | ontospy/ontodocs/utils.py | 1 | 6309 | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
# ===========
# Utilities
# ===========
def build_D3treeStandard(old, MAX_DEPTH, level=1, toplayer=None):
"""
For d3s examples all we need is a json with name, children and size .. eg
{
"name": "flare",
"children": [
{
"name": "analyt... | gpl-3.0 | -6,854,177,205,183,017,000 | 26.077253 | 96 | 0.5191 | false |
wutali/sauron | sauron/metrics/RedisMetric.py | 1 | 6731 | import redis
from sauron import logger
from sauron.metrics import Metric, MetricException
class RedisMetric(Metric):
@staticmethod
def parseMemory(x):
try:
if 'G' in x:
return (x.replace('G', ''), 'Gigabytes')
elif 'M' in x:
return (x.replace('M'... | mit | 2,291,710,560,482,880,000 | 44.47973 | 95 | 0.473332 | false |
rolandgeider/wger | wger/mailer/urls.py | 1 | 1189 | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | agpl-3.0 | 4,714,017,575,843,777,000 | 29.487179 | 78 | 0.721615 | false |
rvykydal/blivet | blivet/formats/disklabel.py | 1 | 22009 | # disklabel.py
# Device format classes for anaconda's storage configuration module.
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your ... | lgpl-2.1 | 3,892,311,891,357,951,500 | 35.927852 | 104 | 0.576809 | false |
JianfengYao/python-web-app | www/transwarp/db.py | 1 | 13974 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Michael Liao'
'''
Database operation module.
'''
import time, uuid, functools, threading, logging
# Dict object:
class Dict(dict):
'''
Simple dict but support access as x.y style.
>>> d1 = Dict()
>>> d1['x'] = 100
>>> d1.x
100
... | gpl-2.0 | -7,054,294,330,750,922,000 | 27.871901 | 140 | 0.563761 | false |
suprotkin/atm | atm/atm/settings.py | 1 | 2842 | """
Django settings for atm project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths in... | gpl-2.0 | -6,900,148,488,778,329,000 | 25.314815 | 74 | 0.69247 | false |
foundertherapy/django-users-plus | accountsplus/views.py | 1 | 8660 | from __future__ import unicode_literals
import logging
from django.utils.translation import ugettext as _
import django.views.decorators.cache
import django.views.decorators.csrf
import django.views.decorators.debug
import django.contrib.auth.decorators
import django.contrib.auth.views
import django.contrib.auth.forms... | mit | -1,332,505,607,043,437,000 | 40.238095 | 131 | 0.675751 | false |
enolfc/oauthenticator | oauthenticator/cilogon.py | 1 | 6879 | """CILogon OAuthAuthenticator for JupyterHub
Uses OAuth 2.0 with cilogon.org (override with CILOGON_HOST)
Caveats:
- For user whitelist/admin purposes, username will be the ePPN by default.
This is typically an email address and may not work as a Unix userid.
Normalization may be required to turn the JupyterHub ... | bsd-3-clause | 213,098,262,406,120,640 | 34.276923 | 92 | 0.612153 | false |
nacl-webkit/chrome_deps | tools/telemetry/telemetry/inspector_timeline_unittest.py | 1 | 4095 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import tab_test_case
from telemetry import util
from telemetry.inspector_timeline import InspectorTimeline
_SAM... | bsd-3-clause | 1,318,567,845,950,442,500 | 31.76 | 75 | 0.61978 | false |
kevin-intel/scikit-learn | sklearn/datasets/_kddcup99.py | 3 | 12676 | """KDDCUP 99 dataset.
A classic dataset for anomaly detection.
The dataset page is available from UCI Machine Learning Repository
https://archive.ics.uci.edu/ml/machine-learning-databases/kddcup99-mld/kddcup.data.gz
"""
import errno
from gzip import GzipFile
import logging
import os
from os.path import dirname, ex... | bsd-3-clause | 3,550,723,356,904,437,000 | 32.983914 | 98 | 0.574787 | false |
wheeler-microfluidics/dmf-device-ui | dmf_device_ui/canvas.py | 1 | 51678 | # -*- coding: utf-8 -*-
from collections import OrderedDict
import itertools
import functools as ft
import logging
import threading
from cairo_helpers.surface import flatten_surfaces
from logging_helpers import _L
from pygtkhelpers.ui.views.shapes_canvas_view import GtkShapesCanvasView
from pygtkhelpers.utils import g... | lgpl-2.1 | 1,564,422,671,550,628,900 | 40.079491 | 88 | 0.531251 | false |
hobson/pug-dj | pug/dj/miner/models.py | 1 | 13381 | import datetime
from django.db import models
#from django_hstore import hstore
from jsonfield import JSONField
from pug.nlp.db import representation
# FIXME: simplify circular import/dependencies with miner app
#from pug.dj.miner import explore
from model_mixin import DateMixin
class Connection(models.Model):
... | mit | 215,834,773,485,895,000 | 49.116105 | 348 | 0.653613 | false |
devilry/devilry-django | devilry/devilry_admin/views/dashboard/overview.py | 1 | 6086 | # -*- coding: utf-8 -*-
from devilry.devilry_cradmin import devilry_listbuilder
from devilry.devilry_cradmin.devilry_listbuilder.period import AdminItemValue
from django.db import models
from itertools import groupby
from django.utils.translation import gettext, gettext_lazy
from django.views.generic import Template... | bsd-3-clause | -6,426,557,289,801,527,000 | 36.801242 | 111 | 0.670884 | false |
jeetsukumaran/Ginkgo | ginkgopy/ginkgo/ginkgogrid.py | 1 | 5281 | #! /usr/bin/env python
import random
import sys
import os
from ginkgo import argparse
##############################################################################\\
# Grid
class Grid(object):
def __init__(self, **kwargs):
self.ncols = kwargs.get("ncols", None)
self.nrows = kwargs.get("nrows", ... | gpl-3.0 | 8,019,885,483,017,476,000 | 32.636943 | 112 | 0.492142 | false |
dtroyer/python-openstackclient | openstackclient/tests/unit/object/v1/test_object_all.py | 1 | 8188 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | apache-2.0 | 6,344,649,810,711,815,000 | 29.898113 | 79 | 0.559966 | false |
mattvonrocketstein/smash | smashlib/ipy3x/nbconvert/preprocessors/execute.py | 1 | 3693 | """Module containing a preprocessor that removes the outputs from code cells"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
try:
from queue import Empty # Py 3
except ImportError:
from Queue import Empty # Py 2
from IPython.utils.traitlets... | mit | -6,775,581,182,042,542,000 | 31.394737 | 86 | 0.541836 | false |
pettazz/pygooglevoice | examples/parse_sms.py | 1 | 1581 | #
# SMS test via Google Voice
#
# John Nagle
# nagle@animats.com
#
from googlevoice import Voice
import BeautifulSoup
def extractsms(htmlsms):
"""
extractsms -- extract SMS messages from BeautifulSoup
tree of Google Voice SMS HTML.
Output is a list of dictionaries, one per message.
"""
ms... | bsd-3-clause | 4,728,614,197,272,323,000 | 32.638298 | 79 | 0.611638 | false |
AlphaSmartDog/DeepLearningNotes | Note-6 A3CNet/Note 6 simple ACNet/ACNet_adjust.py | 1 | 3662 | import random
import tensorflow as tf
from FCNet import FCNet
LOSS_V = 100
ENTROPY_BETA = 0.05
_EPSILON = 1e-6
L2_P = 1e-5
L2_V = 1e-2
actor_learning_rate = 1e-3
critic_learning_rate = 1e-3
class ACNet(object):
def __init__(self, state_size, action_size):
self.state_size = state_size
self.action_... | mit | -7,544,644,809,307,700,000 | 39.7 | 100 | 0.629164 | false |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_operations.py | 1 | 4744 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit | -2,921,255,939,064,702,000 | 42.522936 | 133 | 0.640388 | false |
Azure/azure-sdk-for-python | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_event_channels_operations.py | 1 | 20000 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit | -8,665,553,303,715,228,000 | 49.377834 | 229 | 0.64735 | false |
datamicroscopes/lda | test/test_reuters.py | 1 | 4285 | import os
import numpy as np
from nose.plugins.attrib import attr
from nose.tools import assert_almost_equal, assert_dict_equal
from nose.tools import assert_list_equal
from microscopes.lda import model, runner
from microscopes.lda.definition import model_definition
from microscopes.common.rng import rng
from microsc... | bsd-3-clause | -5,277,405,691,397,815,000 | 37.258929 | 109 | 0.641774 | false |
bowenliu16/deepchem | deepchem/data/tests/test_datasets.py | 1 | 14450 | """
Tests for dataset creation
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "GPL"
import unittest
import tempfile
import os
import shutil
import num... | gpl-3.0 | -8,183,733,697,165,437,000 | 36.72846 | 79 | 0.637024 | false |
n6g7/django_markdown | django_markdown/widgets.py | 1 | 1852 | """ Widgets for django-markdown. """
import os
from django import forms
from django.contrib.admin.widgets import AdminTextareaWidget
from django.contrib.staticfiles.storage import staticfiles_storage
from django.utils.safestring import mark_safe
from . import settings
from .utils import editor_js_initialization
cla... | lgpl-3.0 | 4,647,823,019,649,413,000 | 30.389831 | 126 | 0.654428 | false |
xanthics/gw2craft-python3 | auto_gen/Armorsmith.py | 1 | 86598 | # -*- coding: utf-8 -*-
# Created: 2018-01-04T19:46:58 PST
recipes = {
9420: {'min': 0, 'max': 40, 'recipe': {19679: 10}},
9421: {'min': 75, 'max': 115, 'recipe': {13010: 1, 19683: 10}},
9422: {'min': 150, 'max': 190, 'recipe': {13006: 1, 19688: 10}},
9423: {'min': 225, 'max': 265, 'recipe': {13007: 1, 19681: 10}},... | mit | 8,320,170,496,389,430,000 | 72.637755 | 88 | 0.53686 | false |
pp-mo/iris-grib | iris_grib/tests/unit/load_rules/test_grib1_convert.py | 1 | 5593 | # (C) British Crown Copyright 2013 - 2016, Met Office
#
# This file is part of iris-grib.
#
# iris-grib is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your opt... | lgpl-3.0 | 6,769,606,754,175,757,000 | 36.790541 | 77 | 0.638119 | false |
Tristan79/ComicStreamer | comicstreamerlib/options.py | 1 | 4608 | import sys
import getopt
import platform
import os
import traceback
import csversion
try:
import argparse
except:
pass
class Options:
help_text = """
Usage: {0} [OPTION]... [FOLDER LIST]
A digital comic media server.
The FOLDER_LIST is a list of folders that will be scanned recursively
for comics to a... | apache-2.0 | 4,990,370,780,975,231,000 | 33.646617 | 118 | 0.496962 | false |
zpiman/MathIA | square.py | 1 | 1854 | import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 8, 0.01)
myb = []
for i in x:
if np.floor(i)%2 == 0:
myb.append(1)
else:
myb.append(0)
y = np.array(myb)
plt.subplot(121)
plt.plot(x,y)
plt.xticks([2,4,6],("-T","0","T"))
plt.tick_params(axis='x', labelsize="15")
plt.ylim([-... | apache-2.0 | 3,362,402,061,348,584,000 | 20.068182 | 62 | 0.59493 | false |
hsoft/send2trash | setup.py | 1 | 1335 | from setuptools import setup
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programm... | bsd-3-clause | -5,560,323,544,130,696,000 | 33.230769 | 83 | 0.6397 | false |
muffato/pyEnsemblRest | template/genome.py | 1 | 1247 |
#__GENERATED_OBJECTS__
__feature_types = {
'gene' : GeneFeature,
'transcript' : TranscriptFeature,
'cds': CDSFeature,
'exon' : ExonFeature,
'repeat' : RepeatFeature,
'simple' : SimpleFeature,
'misc' : MiscFeature,
'variation' : VariationFeature,
... | apache-2.0 | -6,060,772,300,965,686,000 | 28 | 75 | 0.587811 | false |
johnbywater/eventsourcing | setup.py | 1 | 2434 | from distutils.core import setup
from eventsourcing import __version__
crypto_requires = ["pycryptodome<=3.9.99999"]
postgresql_requires = ["psycopg2<=2.8.99999"]
postgresql_dev_requires = ["psycopg2-binary<=2.8.99999"]
docs_requires = (
postgresql_dev_requires
+ crypto_requires
+ [
"Sphinx==1.8.... | bsd-3-clause | -1,621,732,981,441,119,200 | 26.348315 | 87 | 0.620378 | false |
XuesongYang/end2end_dialog | PipelineLstmModel.py | 1 | 9106 | ''' Pipelined bi-directional LSTM model.
This model stacked biLSTM NLU and biLSTM SAP separate models together,
and its weights are initilized by the ones of seprate models. Besides,
for the SAP task, the decision threshold on the output layer is tuned
on dev data.
Author : Xuesong Yang
... | mit | 5,262,195,568,939,314,000 | 49.871508 | 190 | 0.669888 | false |
alviezhang/leetcode | 91.decode_ways/solution.py | 1 | 1077 | # coding: utf-8
class Solution:
def numDecodings(self, s):
"""
:type s: str
:rtype: int
"""
if s == "" or s[0] == '0':
return 0
# Initialization
before_previous = 0
previous_one = 0
current = 1
for i in range(1, len(s)):... | mit | 6,711,470,115,184,742,000 | 26.615385 | 84 | 0.44104 | false |
openelections/openelections-core | openelex/us/vt/validate/validates.py | 1 | 8951 | import re
from openelex.models import Contest, Candidate, Office, Result
import logging
import time
import os
# if not os.path.isdir("logs"):
# os.makedirs("logs")
# logging.basicConfig(filename=time.strftime("logs/%Y%m%d-%H%M%S-validate.log"),level=logging.DEBUG)
# Generic validation helpers
def _validate_can... | mit | -705,504,772,250,037,200 | 45.378238 | 117 | 0.669199 | false |
snowflying/messager | messager/common/sslutils.py | 1 | 2833 | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 | -7,891,878,470,662,829,000 | 27.908163 | 78 | 0.61772 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.