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 |
|---|---|---|---|---|---|---|---|---|---|---|
ownport/ansible-lookups | src/lookups/lookup/first_found.py | 1 | 5368 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
# take a list of files and (optionally) a list of paths
# return the first existing file found in the paths
# [file1, file2, file3], [path1, path2, path3]
# search order is:
# path1/file1
# path1/file2
# path1/file3
# path2/file1
#... | gpl-3.0 | 3,413,578,414,428,634,000 | 30.952381 | 109 | 0.577124 | false |
geimer/easybuild-framework | easybuild/tools/build_log.py | 1 | 5969 | # #
# Copyright 2009-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... | gpl-2.0 | -4,285,533,224,115,982,300 | 32.161111 | 133 | 0.672642 | false |
Brett777/Predict-Risk | ApprovalModel.py | 1 | 1979 |
# coding: utf-8
# In[ ]:
import h2o
import pandas as pd
# initialize the model scoring server
h2o.init(nthreads=1,max_mem_size=1, start_h2o=True, strict_version_check = False)
def approve_loan(Loan_Amount,Term,Interest_Rate,Employment_Years,Home_Ownership,Annual_Income,Verification_Status,Loan_Purpose,State,
... | apache-2.0 | 5,041,993,009,624,065,000 | 45.023256 | 153 | 0.590197 | false |
jborean93/ntlm-auth | tests/test_compute_hash.py | 1 | 1658 | import ntlm_auth.compute_hash as compute_hash
class TestComputeHash(object):
def test_lmowfv1(self):
# 4.2.2.1.1 - LMOWFv1()
expected = b"\xe5\x2c\xac\x67\x41\x9a\x9a\x22" \
b"\x4a\x3b\x10\x8f\x3f\xa6\xcb\x6d"
actual = compute_hash._lmowfv1("Password")
assert ac... | mit | 641,826,958,621,194,500 | 37.55814 | 68 | 0.573583 | false |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/social_core/backends/line.py | 1 | 3104 | # vim:fileencoding=utf-8
import requests
import json
from .oauth import BaseOAuth2
from ..exceptions import AuthFailed
from ..utils import handle_http_errors
class LineOAuth2(BaseOAuth2):
name = 'line'
AUTHORIZATION_URL = 'https://access.line.me/dialog/oauth/weblogin'
ACCESS_TOKEN_URL = 'https://api.line... | apache-2.0 | -1,810,778,091,220,246,800 | 33.10989 | 87 | 0.559601 | false |
C-Pro/pgdocgen | pgdocgen/ddlobject/schema.py | 1 | 1808 | '''Schema description module'''
import copy
from pgdocgen.ddlobject.ddlobject import DDLObject
from pgdocgen.utils import get_logger
class Schema(DDLObject):
'''SQL schema class'''
contents = []
def read_contents(self, name, conn):
'''Read schema tables'''
sql = '''select c.relname,
... | gpl-2.0 | -8,471,032,404,717,346,000 | 36.666667 | 77 | 0.50719 | false |
Alignak-monitoring-contrib/alignak-app | test/test_about_dialog.py | 1 | 2159 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) 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 Sof... | agpl-3.0 | 6,058,119,185,082,601,000 | 28.175676 | 77 | 0.697545 | false |
SUSE/azurectl | azurectl/commands/base.py | 1 | 3692 | # Copyright (c) 2015 SUSE Linux GmbH. 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 la... | apache-2.0 | 6,654,451,718,416,698,000 | 30.827586 | 74 | 0.623239 | false |
txomon/SpockBot | spock/mcp/mcpacket.py | 1 | 4216 | try:
basestring
except NameError:
basestring = str
import copy
import logging
import zlib
from time import gmtime, strftime
from spock import utils
from spock.mcp import datautils, mcdata
from spock.mcp.mcdata import MC_VARINT
from spock.mcp.mcpacket_extensions import hashed_extensions
logger = logging.getL... | mit | -7,823,912,013,446,053,000 | 35.66087 | 79 | 0.57685 | false |
TopherGopher/aws-infra.jenkins-scripts | s3trim.py | 1 | 7063 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example usage:
# python s3trim.py --count 14 --key=AWS_KEY --secret=AWS_SECRET_KEY nmdarchive christest/production
import argparse
import logging
import operator
import re
import time
from collections import OrderedDict as Dict
from boto.s3.connection import S3Connection... | mit | 2,256,686,291,314,508,300 | 38.238889 | 160 | 0.624947 | false |
andersinno/foosball | config/settings/common.py | 1 | 9129 | # -*- coding: utf-8 -*-
"""
Django settings for foosball project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_li... | mit | -6,126,617,676,244,280,000 | 33.191011 | 98 | 0.615073 | false |
bolkedebruin/airflow | airflow/providers/apache/spark/hooks/spark_jdbc.py | 1 | 11610 | # -*- coding: 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 License, Version 2.0 (the
#... | apache-2.0 | 5,919,729,661,588,908,000 | 46.004049 | 89 | 0.589233 | false |
datacommonsorg/data | scripts/india_census/common/generic_base.py | 1 | 5322 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | 826,548,079,719,393,200 | 35.958333 | 93 | 0.643743 | false |
hryamzik/ansible | lib/ansible/modules/network/vyos/vyos_config.py | 1 | 8948 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... | gpl-3.0 | -3,160,238,732,959,698,000 | 30.957143 | 129 | 0.6616 | false |
bundgus/python-playground | matplotlib-playground/examples/event_handling/looking_glass.py | 1 | 1280 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
x, y = np.random.rand(2, 200)
fig, ax = plt.subplots()
circ = patches.Circle((0.5, 0.5), 0.25, alpha=0.8, fc='yellow')
ax.add_patch(circ)
ax.plot(x, y, alpha=0.2)
line, = ax.plot(x, y, alpha=1.0, clip_path=circ)
class EventHand... | mit | 5,355,964,802,835,473,000 | 26.234043 | 77 | 0.622656 | false |
zbarge/zeex | zeex/core/views/actions/merge_purge.py | 1 | 33284 | """
MIT License
Copyright (c) 2016 Zeke Barge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, di... | mit | 3,209,316,707,471,525,000 | 42.451697 | 122 | 0.609752 | false |
touqir14/Cmput_692_project | Extract_Context_From_Snippets_Surrounding_6_Words.py | 1 | 1310 | from sys import getsizeof
import collections
import pickle
# import timeit
from sys import getsizeof
import time
import csv
import io
output = io.StringIO()
with open('../dictionary_Nikon_Snippet_Surroundings.pickle', 'rb') as f:
d = (pickle.load(f))
with open('/Users/sasa/Dropbox/1-Uni/CMPUT 692/Project/Code... | apache-2.0 | 1,286,028,864,553,510,700 | 32.589744 | 111 | 0.566412 | false |
sayedmohamed/pomodora-todo | pomotodo/mytodo/migrations/0001_initial.py | 1 | 6658 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Project'
db.create_table(u'mytodo_project', (
... | gpl-2.0 | 2,260,904,148,231,961,900 | 64.930693 | 195 | 0.569841 | false |
jokkebk/euler | p59.py | 1 | 5359 | cipher = [79, 59, 12, 2, 79, 35, 8, 28, 20, 2, 3, 68, 8, 9, 68, 45, 0, 12, 9,
67, 68, 4, 7, 5, 23, 27, 1, 21, 79, 85, 78, 79, 85, 71, 38, 10, 71, 27,
12, 2, 79, 6, 2, 8, 13, 9, 1, 13, 9, 8, 68, 19, 7, 1, 71, 56, 11, 21,
11, 68, 6, 3, 22, 2, 14, 0, 30, 79, 1, 31, 6, 23, 19, 10, 0, 73, 79,
... | mit | -1,389,164,588,070,052,000 | 65.9875 | 79 | 0.407352 | false |
splotz90/urh | src/urh/models/PluginListModel.py | 1 | 1635 | from PyQt5.QtCore import QAbstractListModel, Qt, QModelIndex
from PyQt5.QtGui import QFont
from urh import constants
from urh.plugins import Plugin
class PluginListModel(QAbstractListModel):
def __init__(self, plugins, highlighted_plugins = None, parent=None):
"""
:type plugins: list of Plugin
... | gpl-3.0 | 8,113,814,833,017,521,000 | 37.952381 | 97 | 0.659327 | false |
commagere/commagere.com | main.py | 1 | 1348 | import os
import jinja2
import webapp2
"""
For Unit testing:
https://cloud.google.com/appengine/docs/python/tools/handlertesting
"""
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
def prep_template... | mit | -3,297,175,611,623,295,000 | 26.510204 | 77 | 0.683234 | false |
vesellov/bitdust.devel | services/service_my_ip_port.py | 1 | 1681 | #!/usr/bin/python
# service_my_ip_port.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (service_my_ip_port.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# t... | agpl-3.0 | 5,121,720,097,451,386,000 | 25.68254 | 77 | 0.690065 | false |
lliendo/PyZ80 | pyz80/tests/test_cpu.py | 1 | 1256 | # -*- coding: utf-8 -*-
"""
This file is part of PyZ80.
PyZ80 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 option) any later version.
PyZ80 is distributed ... | lgpl-3.0 | -1,833,531,757,788,214,800 | 31.205128 | 75 | 0.664013 | false |
Alexanau/table | table.py | 1 | 1041 | #!/usr/bin/python
import getopt as g
import sys
optlist, args = g.getopt(sys.argv[1:],'d:')
delim = ','
for o,a in optlist:
if o == '-d':
delim = a
max_width = [0]
with open(args[0],'r') as fh:
for line in fh:
line = line.rstrip()
fields = line.split(delim)
for idx,field in enumerate(fields):
... | mit | 8,851,027,751,409,064,000 | 21.148936 | 63 | 0.549472 | false |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/autotvm/database.py | 1 | 6064 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | -972,615,965,296,279,300 | 29.781726 | 88 | 0.606365 | false |
b3j0f/schema | b3j0f/schema/utils.py | 1 | 13398 | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | mit | -6,103,575,148,108,877,000 | 29.517084 | 80 | 0.614839 | false |
pombredanne/ghost-tree | ghosttree/silva/tests/test_filter.py | 1 | 3455 | # ----------------------------------------------------------------------------
# Copyright (c) 2015--, ghost-tree development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | 4,728,956,969,194,246,000 | 31.28972 | 78 | 0.590159 | false |
aio-libs/aiobotocore | tests/test_response.py | 1 | 5549 | import io
import pytest
from aiobotocore import response
from botocore.exceptions import IncompleteReadError
# https://github.com/boto/botocore/blob/develop/tests/unit/test_response.py
async def assert_lines(line_iterator, expected_lines):
for expected_line in expected_lines:
line = await line_iterator._... | apache-2.0 | 7,434,871,654,676,814,000 | 29.322404 | 75 | 0.684087 | false |
tomevans/pyphotom | photom_class.py | 1 | 14267 | import numpy as np
import matplotlib.pyplot as plt
import pdb
import os
import cPickle
import numpy as np
import shutil
from photom import photom_inspect, photom_reduce, photom_absolute, photom_relative, photom_checks, photom_optimise
homestr = os.path.expanduser( '~' )
class photom():
"""
"""
def __init_... | gpl-2.0 | -3,544,271,532,625,273,300 | 48.366782 | 134 | 0.593888 | false |
KECB/learn | computer_vision/12_rmv_salt_pepper_median_blur.py | 1 | 1464 | import numpy as np
import cv2
import matplotlib.pyplot as plt
# load in image and add Salt and pepper noise
moon = cv2.imread('images/moon.png', 0)
######################################################## ADD SALT & PEPPER NOISE
# salt and peppering manually (randomly assign coords as either white or black)
rows, col... | mit | 8,626,971,570,454,000,000 | 36.538462 | 80 | 0.660519 | false |
latrop/sdss_downloader | sdss_downloader.py | 1 | 22627 | #! /usr/bin/env python
#
# Author: Sergey Savchenko (savchenko.s.s@gmail.com)
#
from threading import Thread
import subprocess
from math import hypot, log10, sqrt
from time import time, sleep
import urllib.request
import urllib
import sys
import os
import glob
import shutil
import argparse
import bz2
import numpy a... | gpl-3.0 | 8,123,656,252,170,740,000 | 37.221284 | 115 | 0.515093 | false |
sevein/archivematica | src/dashboard/src/components/rights/views.py | 1 | 27795 | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | agpl-3.0 | 9,058,737,359,596,567,000 | 47.848858 | 293 | 0.666019 | false |
hydroffice/hyo_ssp | hydroffice/ssp/drivers/saiv.py | 1 | 6625 | from __future__ import absolute_import, division, print_function, unicode_literals
import datetime as dt
import numpy as np
import logging
log = logging.getLogger(__name__)
from .base_format import BaseFormat, FormatError
from .. import __version__
from ..ssp_dicts import Dicts
class Saiv(BaseFormat):
def __i... | lgpl-3.0 | -6,011,151,507,989,463,000 | 37.517442 | 94 | 0.508075 | false |
blitzmann/Pyfa | gui/builtinMarketBrowser/itemView.py | 1 | 10783 | import wx
from logbook import Logger
from eos.saveddata.module import Module
import gui.builtinMarketBrowser.pfSearchBox as SBox
from gui.builtinMarketBrowser.events import ItemSelected, MAX_RECENTLY_USED_MODULES, RECENTLY_USED_MODULES
from gui.contextMenu import ContextMenu
from gui.display import Display
from gui.ut... | gpl-3.0 | 2,533,936,064,626,691,000 | 37.927798 | 156 | 0.630344 | false |
maelnor/cinder | cinder/tests/fake_flags.py | 1 | 1947 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 | 2,221,961,948,262,156,300 | 42.266667 | 78 | 0.721109 | false |
ultrabug/py3status | py3status/modules/clock.py | 1 | 11062 | """
Display date and time.
This module allows one or more datetimes to be displayed.
All datetimes share the same format_time but can set their own timezones.
Timezones are defined in the `format` using the TZ name in squiggly brackets eg
`{GMT}`, `{Portugal}`, `{Europe/Paris}`, `{America/Argentina/Buenos_Aires}`.
IS... | bsd-3-clause | 510,640,373,761,391,170 | 33.481013 | 85 | 0.562408 | false |
Superjom/cHasky | python/chasky/node_def_builder.py | 1 | 2057 | import sys
#from graph_def_builder import GraphDefBuilder
from core.framework.attr_value_pb2 import AttrValue
from core.framework.graph_pb2 import NodeDef
from attr_value_builder import AttrValueBuilder
class NodeDefBuilder(object):
def __init__(self, node=None):
self.node_def_ = node if node else NodeDef(... | apache-2.0 | 1,262,839,180,241,818,400 | 26.065789 | 68 | 0.539135 | false |
mop/LTPTextDetector | scripts/pw_analyze/svmdelme.py | 1 | 5600 | import numpy as np
from sklearn.cross_validation import cross_val_score, ShuffleSplit
from sklearn.svm import LinearSVC, SVC
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import precision_recall_fscore_support
import matplotlib.pyplot as plt
data = np.genfromtxt('dists_cleaned.csv', delimiter=','... | gpl-3.0 | -3,740,228,563,177,557,000 | 29.601093 | 172 | 0.527143 | false |
Ruide/angr-dev | angr/angr/state_plugins/unicorn_engine.py | 1 | 53139 | import os
import sys
import copy
import struct
import ctypes
import threading
import itertools
import pkg_resources
import logging
from ..sim_options import UNICORN_HANDLE_TRANSMIT_SYSCALL
l = logging.getLogger("angr.state_plugins.unicorn_engine")
try:
import unicorn
except ImportError:
l.warning("Unicorn i... | bsd-2-clause | -4,790,305,247,972,902,000 | 40.129257 | 144 | 0.584411 | false |
Datera/python-sdk | utils/show_os_volumes.py | 1 | 4523 | #!/usr/bin/env python
from __future__ import (print_function, unicode_literals, division,
absolute_import)
"""
This script will output the Datera AppInstances that are being managed
by an OpenStack Cinder (or Glance) instance.
It does this by retrieving all the AppInstances on the Datera back... | apache-2.0 | 8,028,386,326,577,366,000 | 31.775362 | 79 | 0.605793 | false |
SheffieldML/GPy | GPy/models/gp_coregionalized_regression.py | 1 | 1940 | # Copyright (c) 2012 - 2014 the GPy Austhors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from ..core import GP
from .. import likelihoods
from .. import kern
from .. import util
class GPCoregionalizedRegression(GP):
"""
Gaussian Process model for heterosced... | bsd-3-clause | -3,529,963,618,376,943,600 | 41.173913 | 128 | 0.696392 | false |
mediafactory/tryton_core_daemon | trytond/backend/fields.py | 1 | 4187 | #This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import datetime
from decimal import Decimal
try:
import hashlib
except ImportError:
hashlib = None
import sha
class Field(object):
@staticmethod
def sql_fo... | gpl-3.0 | 9,029,150,380,682,607,000 | 21.390374 | 79 | 0.598042 | false |
HailStorm32/Q.bo_stacks | qbo_webi/src/recorder/recorder.py | 1 | 4591 | #!/usr/bin/env python2.6
# coding: utf-8
#
# Software License Agreement (GPLv2 License)
#
# Copyright (c) 2012 TheCorpora SL
#
# 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 ... | lgpl-2.1 | 7,839,901,651,375,165,000 | 39.628319 | 521 | 0.637552 | false |
Ptival/PeaCoq | ucsd/analysis/plot.py | 1 | 9691 | #!/usr/bin/env python2
from __future__ import print_function
import csv, sys, os.path
from datetime import datetime
from boomslang import *
def usage():
print('Usage: plot.py data.csv')
class Entry:
def __init__(self, usr, ver, stm, ctm, cmd, pay):
self.username = usr
self.version = ver
... | mit | -7,678,334,237,761,278,000 | 21.69555 | 152 | 0.534517 | false |
Julian/home-assistant | homeassistant/components/recorder.py | 1 | 15356 | """
homeassistant.components.recorder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component that records all events and state changes. Allows other components
to query this database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/recorder/
"""
from contextlib imp... | mit | -2,365,633,100,181,165,000 | 31.260504 | 79 | 0.547148 | false |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/ToolButton.py | 1 | 9124 | # encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
from ToolItem import ToolItem
class ToolButton(ToolItem):
"""
... | gpl-2.0 | -8,898,134,066,066,160,000 | 36.858921 | 153 | 0.662429 | false |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/compressor/parser/default_htmlparser.py | 1 | 3213 | import sys
from django.utils import six
from django.utils.encoding import smart_text
from compressor.exceptions import ParserError
from compressor.parser import ParserBase
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument which default to True (which we don't want).
# In Python 3.3, i... | bsd-3-clause | -1,011,857,011,579,656,000 | 31.785714 | 105 | 0.558668 | false |
ntucllab/libact | libact/query_strategies/tests/test_uncertainty_sampling.py | 1 | 3010 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from libact.base.dataset import Dataset
from libact.models import LogisticRegression, SVM, Perceptron
from libact.query_strategies import UncertaintySampling, QUIRE
from libact.labelers import IdealLabeler
def init_toyexample(X, y):
... | bsd-2-clause | 7,756,989,461,134,087,000 | 35.707317 | 84 | 0.601993 | false |
mchrzanowski/ProjectEuler | src/python/Problem031.py | 1 | 1985 | '''
Created on Jan 13, 2012
@author: mchrzanowski
'''
from time import time
import numpy as np
LIMIT = 300
COINS = (1, 2, 5, 10, 20, 50, 100, 200)
# O(LIMIT * |COINS|)
def dp():
M = np.zeros((LIMIT + 1, len(COINS) + 1), dtype=np.int)
# base cases.
for i in xrange(1, LIMIT + 1):
M[i, 1] = 1 # t... | mit | 3,372,529,188,409,175,000 | 30.015625 | 101 | 0.457431 | false |
googlefonts/glyphsLib | tests/util_test.py | 1 | 1437 | #
# Copyright 2016 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... | apache-2.0 | -969,451,578,652,326,800 | 37.837838 | 74 | 0.661795 | false |
ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/lib/agw/customtreectrl.py | 1 | 311049 | # --------------------------------------------------------------------------------- #
# CUSTOMTREECTRL wxPython IMPLEMENTATION
# Inspired By And Heavily Based On wxGenericTreeCtrl.
#
# Andrea Gavana, @ 17 May 2006
# Latest Revision: 27 Aug 2012, 21.00 GMT
#
#
# TODO List
#
# Almost All The Features Of wx.Tree... | mit | 8,084,265,007,689,295,000 | 34.572487 | 226 | 0.545631 | false |
copyliu/acfun_live_speech | utils.py | 1 | 1318 | # -*- coding: UTF-8 -*-
__author__ = 'Administrator'
import struct
acfun_magic_num=689
def acfunencode(d):
"""
类似urllib.urlencode()的功能 不过是给ACFUN用的
:param d: @type dict
:return: str
"""
#print d
result=""
if isinstance(d,dict):
for k,v in d.items():
result += "%s@... | gpl-2.0 | -1,133,777,531,886,321,800 | 21.137931 | 116 | 0.508567 | false |
mahim97/zulip | zilencer/models.py | 2 | 1101 | import datetime
from typing import Text
from django.db import models
import zerver.models
def get_remote_server_by_uuid(uuid: Text) -> 'RemoteZulipServer':
return RemoteZulipServer.objects.get(uuid=uuid)
class RemoteZulipServer(models.Model):
uuid = models.CharField(max_length=36, unique=True) # type: Text... | apache-2.0 | -1,857,730,610,358,638,600 | 39.777778 | 97 | 0.735695 | false |
matthijsvk/multimodalSR | code/Experiments/neon-master/examples/faster-rcnn/convert_xml_to_json.py | 1 | 5828 | # ----------------------------------------------------------------------------
# Copyright 2016 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | mit | -8,247,601,090,197,011,000 | 36.121019 | 94 | 0.577385 | false |
ncsulug/ncsulug-website | lug_people/migrations/0003_auto__add_accountrequest.py | 1 | 6919 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AccountRequest'
db.create_table('lug_people_accountrequest', (
('id', self.gf('d... | gpl-3.0 | -3,249,888,237,023,225,300 | 67.514851 | 182 | 0.554849 | false |
scrapinghub/dateparser | tests/test_hijri.py | 1 | 2000 | import sys
import unittest
from datetime import datetime
from parameterized import parameterized, param
from tests import BaseTestCase
is_python_supported = sys.version_info >= (3, 6)
try:
from dateparser.calendars.hijri import HijriCalendar
except ImportError:
if is_python_supported:
raise
@unitt... | bsd-3-clause | 1,600,178,833,128,748,500 | 37.313725 | 93 | 0.648414 | false |
miquelo/caviar | packages/caviar/engine/__init__.py | 1 | 3783 | #
# This file is part of CAVIAR.
#
# CAVIAR 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.
#
# CAVIAR is distributed in the hope that ... | gpl-3.0 | -3,241,001,883,956,268,000 | 20.016667 | 75 | 0.680412 | false |
msikma/zembu.py | zembu.py | 1 | 7381 | #!/usr/bin/env python
# coding=utf8
#
# zembu.py 0.1
# Script that checks whether dictionary words are available as domain names.
import subprocess
import datetime
import argparse
import pprint
import time
import sys
import os
# Get current console size.
ROWS, COLS = [int(n) for n in os.popen('stty size', 'r').read()... | mit | -5,755,920,373,877,593,000 | 26.85283 | 89 | 0.581493 | false |
carlosb1/examples-python | ideas/forecast-example/forecast.py | 1 | 6733 | """Docstring for MyClass."""
import datetime
import requests
from sqlalchemy import Column, Integer, String , create_engine
from celery import Celery
from sqlalchemy.sql import exists
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
# define o... | gpl-2.0 | 1,305,902,914,330,439,400 | 37.039548 | 323 | 0.613397 | false |
vedujoshi/tempest | tempest/scenario/test_object_storage_basic_ops.py | 1 | 2961 | # Copyright 2013 IBM Corp.
# 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 app... | apache-2.0 | 5,458,300,210,133,473,000 | 41.913043 | 78 | 0.648767 | false |
sergeii/swat-julia-admin | fabfile/settings.py | 1 | 3323 | # -*- coding: utf-8 -*-
import os
from unipath import Path
from fabric.api import *
env.kits = {
'swat4': {
'mod': 'Mod',
'content': 'Content',
'server': 'Swat4DedicatedServer.exe',
'ini': 'Swat4DedicatedServer.ini',
},
'swat4exp': {
'mod': 'ModX',
'content... | mit | -8,070,486,118,510,928,000 | 30.056075 | 111 | 0.554619 | false |
hammerlab/isovar | test/test_isovar_result.py | 1 | 4692 | from isovar import run_isovar
from isovar import ProteinSequence
from varcode import Variant
from testing_helpers import data_path
from nose.tools import eq_
def test_isovar_result_property_types():
for result in run_isovar(
variants=data_path("data/b16.f10/b16.vcf"),
alignment_file=data_... | apache-2.0 | -8,164,057,526,787,544,000 | 43.695238 | 85 | 0.68052 | false |
ssato/sos-analyzer | sos_analyzer/cli.py | 1 | 3519 | #
# Author: Satoru SATOH <ssato redhat.com>
# License: GPLv3+
#
import anyconfig
import logging
import optparse
import os
import os.path
import sys
from sos_analyzer.globals import DATA_SUBDIR
import sos_analyzer.archive
import sos_analyzer.runner
import sos_analyzer.utils
LOGGER = logging.getLogger(__name__)
DEFA... | gpl-3.0 | 8,322,061,659,670,095,000 | 30.141593 | 77 | 0.611253 | false |
JohnKendrick/PDielec | PDielec/pickled_reader.py | 1 | 1689 | #!/usr/bin/env python
"""Read the contents of a directory containing DFT output and create a csv style file of information"""
from __future__ import print_function
import sys
import dill as pickle
import PDielec.__init__
version = PDielec.__init__.__version__
def print_help():
print('pickled_reader filenames', fil... | mit | 1,048,433,540,079,126,100 | 29.709091 | 111 | 0.611604 | false |
google/tink | python/tink/core/_registry.py | 1 | 9252 | # Copyright 2019 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 | -6,869,653,254,760,174,000 | 37.87395 | 114 | 0.670774 | false |
mikekestemont/ruzicka | code/04latin_test_o2.py | 1 | 3340 | from __future__ import print_function
import os
import time
import json
import pickle
import sys
from itertools import product, combinations
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
from ruzicka.util... | mit | -2,859,075,003,246,265,300 | 31.115385 | 94 | 0.67994 | false |
bazzile/THE_BIG_ONE | Main/Tenderplan/participants2excel.py | 1 | 6915 | from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions impor... | mit | -720,732,314,296,447,400 | 47.625954 | 121 | 0.537991 | false |
mateoqac/unqTip | language/vgbs/web/base.py | 1 | 1839 | "Base classes for services."
import web
import local
def have_role(role_id):
"Return True iff the currently logged user has the given role."
user_id = local.session.user_id
it = local.db.select('role_assignments',
where='user_id=$user_id AND role_id=$role_id',
vars=locals()
... | gpl-3.0 | 8,681,706,271,270,517,000 | 25.652174 | 70 | 0.594345 | false |
whosonfirst/whosonfirst-www-boundaryissues | services/geojson-server/wof-geojson-server.py | 1 | 7923 | #!/usr/bin/env python
import StringIO
import sys
import logging
import os
import re
import flask
from flask import Flask, request, jsonify
import geojson
import requests
import json
import mapzen.whosonfirst.geojson
import mapzen.whosonfirst.export
import mapzen.whosonfirst.search
import mapzen.whosonfirst.utils
impo... | bsd-3-clause | -3,751,734,502,847,514,000 | 28.453532 | 158 | 0.689133 | false |
ZeitOnline/zeit.content.author | src/zeit/content/author/author.py | 1 | 9296 | from requests.exceptions import RequestException
from zeit.cms.content.property import ObjectPathProperty
from zeit.cms.i18n import MessageFactory as _
from zeit.content.author.interfaces import IAuthor
import UserDict
import grokcore.component as grok
import lxml.objectify
import requests
import urllib
import zeit.cms... | bsd-3-clause | 8,814,673,143,389,612,000 | 31.390244 | 79 | 0.668675 | false |
pedropena/iteexe | exe/export/singlepage.py | 1 | 14738 | # ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-2.0 | -3,200,414,544,592,148,500 | 41.350575 | 155 | 0.553874 | false |
ilblackdragon/tf_examples | seq2seq/data.py | 1 | 2291 | import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib import learn
def make_input_fn(mode, filename_in, filename_out, in_vocab_file, out_vocab_file, batch_size, vocab_size,
input_max_length, output_max_length, queue_capacity=10000, num_threads=10):
def input_fn():... | apache-2.0 | -6,994,326,927,575,541,000 | 51.068182 | 138 | 0.634657 | false |
joseamaya/tambox | almacen/managers.py | 1 | 2042 | # -*- coding: utf-8 -*-
from django.db import models
class DetalleMovimientoManager(models.Manager):
def guardar_detalles_con_referencia(self, objs, orden):
requerimiento = None
if orden.cotizacion is not None:
requerimiento = orden.cotizacion.requerimiento
for detalle in obj... | gpl-3.0 | -8,774,856,473,957,981,000 | 39.84 | 116 | 0.63859 | false |
admiralspark/NetSpark-Scripts | Example_Scripts/Cisco/auditQOS.py | 1 | 2040 | #Global imports
from netmiko import ConnectHandler
from datetime import datetime
import csv, os.path
#Local imports
import credentials
# Begin timing the script
start_time = datetime.now()
# Define the primary function (to be moved to a separate module some day...)
def nc(username, password, secret, customer):
wi... | gpl-3.0 | 1,225,461,975,589,799,000 | 36.090909 | 76 | 0.604412 | false |
TheWardoctor/Wardoctors-repo | script.stargate.guide/resources/playwith/playwith.py | 1 | 2975 | import sys
import xbmc,xbmcaddon,xbmcvfs
import sqlite3
from subprocess import Popen
import datetime,time
# from vpnapi import VPNAPI
channel = sys.argv[1]
start = sys.argv[2]
ADDON = xbmcaddon.Addon(id='script.stargate.guide')
def adapt_datetime(ts):
# http://docs.python.org/2/library/sqlite3.html#registering-a... | apache-2.0 | 375,599,105,848,866,940 | 30.648936 | 100 | 0.667227 | false |
capocchi/DEVSimPy-plugin-SIG-viewer | ExtendedFrame.py | 1 | 9957 | # -*- coding: utf-8 -*-
#import wxversion
#wxversion.select('2.8.11')
import wx
import os
import sys
import wx.combo
import wx.lib.agw.foldpanelbar as fpb
_ = wx.GetTranslation
def GetCollapsedIconData():
return \
'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
\x00\x00\x00\x1f\x... | lgpl-3.0 | -2,606,609,827,446,889,500 | 35.472527 | 125 | 0.63262 | false |
malisal/bfdpie | tests/bfdpie_test.py | 1 | 14822 | import unittest
from bfdpie import *
class Test(unittest.TestCase):
def test_large_vma(self):
b = Binary()
# 32-bit limit test
dis1 = b.disassemble(b"\x90", ARCH_I686, 0x80000000)
dis2 = b.disassemble(b"\x90", ARCH_X86_64, 0x80000000)
self.assertTrue(dis1[0].vma >= 0)
self.asse... | mit | 4,999,869,270,956,626,000 | 30.53617 | 83 | 0.484078 | false |
dingdong-io/brackets.beautify.io | thirdparty/js-beautify/python/cssbeautifier/tests/test.py | 1 | 20342 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import cssbeautifier
class CSSBeautifierTest(unittest.TestCase):
def resetOptions(self):
false = False
true = True
self.options = cssbeautifier.default_options()
self.options.indent_size = 1
self.options.indent... | mit | 2,475,564,816,802,160,000 | 58.479532 | 825 | 0.558893 | false |
thiagoss/splitencoder | splitencoder/splitter.py | 1 | 4258 | #!/usr/bin/env python
#
# splitencoder
#
# Copyright (C) 2015 Samsung Electronics. All rights reserved.
# Author: Thiago Santos <thiagoss@osg.samsung.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free ... | lgpl-2.1 | -6,288,029,190,002,081,000 | 33.33871 | 139 | 0.683654 | false |
aio-libs/aiohttp_session | tests/test_nacl_storage.py | 1 | 9303 | import asyncio
import json
import time
from typing import Any, Dict, MutableMapping, Optional, cast
import nacl.secret
import nacl.utils
import pytest
from aiohttp import web
from aiohttp.test_utils import TestClient
from aiohttp.web_middlewares import _Handler
from nacl.encoding import Base64Encoder
from aiohttp_ses... | apache-2.0 | 6,764,261,028,951,287,000 | 30.01 | 91 | 0.65151 | false |
SDX2000/hotwire | hotwire/builtins/json.py | 1 | 2675 | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includin... | gpl-2.0 | 7,491,138,800,768,257,000 | 42.145161 | 96 | 0.647477 | false |
paineliu/tflearn | helen.py | 1 | 1084 | import os
from PIL import Image
img_path = '/home/palm/deep/helen/train'
lab_path = '/home/palm/deep/helen/annotation'
filename = '/home/palm/deep/helen/trainnames.txt'
f = open(filename)
index = 1
for each in f:
each = each.strip()
img_file = os.path.join(img_path, each + '.jpg')
img = Image.open(img_fi... | apache-2.0 | -8,658,315,276,180,879,000 | 26.1 | 71 | 0.530443 | false |
douglask3/allocationModules | runGday/DUKE/simulations/duke_spinup_to_equilibrium.py | 1 | 24694 | #!/usr/bin/env python
""" Duke Simulation for NCEAS FACE experiment
Site History:
-------------
* Pre-1850 temperate broadleaved deciduous forest
* Harvest forest.
* Grassland from 1850-1982, mowed (+/- annually - DO NOT SIMULATE MOWING :P)
* burnt prior to planting
* At start of experiment aboveground biomass 5.5-1... | gpl-2.0 | -6,334,218,371,737,026,000 | 45.948669 | 231 | 0.39787 | false |
bponsler/pysiriproxy | pysiriproxy/config/plugins/resetPlugin.py | 1 | 1672 | # Copyright 2012 Brett Ponsler
# This file is part of pysiriproxy.
#
# pysiriproxy 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.
#
# ... | gpl-3.0 | -7,424,380,351,988,444,000 | 33.833333 | 79 | 0.70634 | false |
arximboldi/jagsat | lib/tf/gfx/widget/basic.py | 1 | 14927 | #
# Copyright (C) 2009 TribleFlame Oy
#
# This file is part of TF.
#
# TF 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.
# ... | gpl-3.0 | 2,505,682,993,001,608,700 | 31.170259 | 79 | 0.45823 | false |
ToonTownInfiniteRepo/ToontownInfinite | toontown/toon/InventoryNew.py | 1 | 56688 | from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase.ToontownBattleGlobals import *
import InventoryBase
from toontown.toonbase import TTLocalizer
from toontown.quest import BlinkingArrows
from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlo... | mit | 6,129,025,153,131,687,000 | 44.386709 | 433 | 0.609741 | false |
thiagopio/vendas_healthcheck | vendas/healthcheck/models.py | 1 | 3084 | # -*- coding: utf-8 -*-
from django.db import models
import requests
import re
class Project(models.Model):
name = models.CharField(max_length=50)
environment = models.CharField(max_length=10, choices=(('DEV', 'DEV'), ('QA', 'QA'), ('PROD', 'PROD')))
related_project = models.ManyToManyField('Project', bla... | gpl-2.0 | 4,263,134,354,998,096,400 | 36.156627 | 107 | 0.604734 | false |
jodal/comics | comics/core/migrations/0001_initial.py | 1 | 5776 | import django.core.files.storage
from django.db import migrations, models
import comics.core.models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Comic",
fields=[
(
"id",
... | agpl-3.0 | -7,052,791,291,109,992,000 | 32.777778 | 87 | 0.340547 | false |
ndn/somacube | python/somacube.py | 1 | 1941 | #!/usr/bin/python
import sys
import argparse
from threading import Thread
import problems
from solver import Solver
if __name__ != "__main__":
sys.exit()
parser = argparse.ArgumentParser(description="Kloetze algorithm.")
parser.add_argument("-p", "--problem")
parser.add_argument("-a", "--all", action="store_tru... | mit | 2,865,622,385,344,816,600 | 25.589041 | 112 | 0.64915 | false |
scorphus/politicos | politicos/migrations/versions/585774625ec2_create_mandate_events_table.py | 1 | 1328 | """create mandate events table
Revision ID: 585774625ec2
Revises: 2cbbef3d8e8f
Create Date: 2015-07-06 00:58:44.470013
"""
# revision identifiers, used by Alembic.
revision = '585774625ec2'
down_revision = '2cbbef3d8e8f'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'm... | agpl-3.0 | -2,576,167,274,743,739,400 | 25.039216 | 77 | 0.626506 | false |
borysiasty/inasafe | safe/impact_functions/generic/classified_polygon_people/metadata_definitions.py | 1 | 4522 | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Classified Polygon on
Land Cover Metadata Definitions.
Contact : ole.moller.nielsen@gmail.com
.. 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
t... | gpl-3.0 | -8,302,044,415,495,642,000 | 37.322034 | 79 | 0.558824 | false |
kotejante/python-moodle | examples/get_user.py | 1 | 1498 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Moodle Webservice
# Copyright (c) 2011 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Raimon Esteve <resteve@zikzakmedia.com>
# Jesus Martín <j... | agpl-3.0 | 6,578,865,608,761,057,000 | 31.543478 | 86 | 0.605878 | false |
mendersoftware/meta-mender-qemu | scripts/list-all-org-repos.py | 1 | 1955 | #!/usr/bin/python3
import argparse
import json
import re
import subprocess
import sys
parser = argparse.ArgumentParser()
parser.add_argument(
"--token",
help="Github Personal Access token, get it from https://github.com/settings/tokens.",
)
parser.add_argument(
"--org",
default="mendersoftware",
h... | apache-2.0 | -3,530,668,890,544,722,400 | 29.076923 | 311 | 0.630179 | false |
hulop/SfMLocalization | PyViewMatch/src/viewMatchPyCV.py | 1 | 5231 | ################################################################################
# Copyright (c) 2015 IBM Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, in... | mit | -5,417,052,964,673,170,000 | 41.877049 | 166 | 0.5909 | false |
PLyczkowski/Sticky-Keymap | 2.74/scripts/addons/add_mesh_extra_objects/add_mesh_pipe_joint.py | 1 | 33743 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-2.0 | -6,384,896,267,242,268,000 | 33.016129 | 78 | 0.532259 | false |
OpenTrading/OpenTrader | setup.py | 1 | 2533 | #!/usr/bin/env python
import codecs
import os
import sys
import glob
from setuptools import setup, find_packages
try:
# http://stackoverflow.com/questions/21698004/python-behave-integration-in-setuptools-setup-py
from setuptools_behave import behave_test
except ImportError:
behave_test = None
dirname = o... | lgpl-3.0 | -1,692,825,774,682,380,500 | 32.773333 | 94 | 0.578366 | false |
darkpeach/AlgorithmCoding | _046_Permutations.py | 1 | 1275 | class Solution(object):
def permute(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
# Non-recursive solution
if not nums:
return []
stack = [-1]
permutation = []
permutations = []
while len(stack):
... | epl-1.0 | -9,072,442,125,490,642,000 | 26.717391 | 80 | 0.443922 | false |
shakamunyi/os-cloud-config | os_cloud_config/neutron.py | 1 | 5961 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 | 3,773,661,173,082,691,600 | 41.578571 | 79 | 0.631605 | false |
michaelmior/pylinks | pylinks/links/views.py | 1 | 2010 | from django.db.models import F
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from pylinks.links.models import Category, Link
class LinkListView(ListView):
model = Link
context_object_name = 'links'
paginate_b... | mit | -3,037,833,652,373,392,000 | 26.162162 | 76 | 0.653234 | false |
zutshi/S3CAMR | src/nonlinprog/pyfmincon.py | 1 | 3601 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import numpy as np
import sympy as sym
import functools as ft
import atexit
from pymatopt.optimmatlab import init, deinit, fmincon
from utils import print
import nonlinprog.spec as spec
import settings
in... | bsd-2-clause | 394,142,603,970,509,250 | 25.284672 | 100 | 0.5604 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.