repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
luntos/bianalyzer | bianalyzer/main.py | 1 | 4399 | # -*- coding: utf-8 -*-
import sys
import getopt
from bianalyzer import BianalyzerText
from bianalyzer.abstracts import download_abstracts
from bianalyzer.biclustering import get_keyword_biclusters, GreedyBBox, get_keyword_text_biclusters, \
save_keyword_text_biclusters
from bianalyzer.biclustering.keywords_analys... | mit | -5,883,963,076,646,310,000 | 38.630631 | 119 | 0.629234 | false | 3.808658 | false | false | false |
kyleam/pymc3 | pymc/sampling.py | 1 | 7330 | from . import backends
from .backends.base import merge_traces, BaseTrace, MultiTrace
from .backends.ndarray import NDArray
import multiprocessing as mp
from time import time
from .core import *
from . import step_methods
from .progressbar import progress_bar
from numpy.random import seed
__all__ = ['sample', 'iter_sa... | apache-2.0 | 3,758,578,631,098,075,600 | 30.324786 | 76 | 0.605866 | false | 4.014239 | false | false | false |
muisit/freezer | model/archive.py | 1 | 4651 | #
# Copyright Muis IT 2011 - 2016
#
# This file is part of AWS Freezer
#
# AWS Freezer 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 | 763,632,750,901,110,500 | 36.813008 | 180 | 0.592346 | false | 3.536882 | false | false | false |
wenhulove333/ScutServer | Sample/ClientSource/tools/bindings-generator/generator.py | 1 | 34942 | #!/usr/bin/env python
# generator.py
# simple C++ generator, originally targetted for Spidermonkey bindings
#
# Copyright (c) 2011 - Zynga Inc.
from clang import cindex
import sys
import pdb
import ConfigParser
import yaml
import re
import os
import inspect
from Cheetah.Template import Template
type_m... | mit | 4,857,824,112,327,277,000 | 41.568579 | 149 | 0.548509 | false | 4.159267 | true | false | false |
saily/flake8-isort | setup.py | 1 | 1504 | # -*- coding: utf-8 -*-
from setuptools import setup
short_description = 'flake8 plugin that integrates isort .'
long_description = '{0}\n{1}'.format(
open('README.rst').read(),
open('CHANGES.rst').read()
)
setup(
name='flake8-isort',
version='0.3.dev0',
description=short_description,
long_d... | gpl-2.0 | 5,845,875,406,787,083,000 | 27.923077 | 75 | 0.588431 | false | 3.650485 | false | true | false |
timrchavez/capomastro | capomastro/settings.py | 1 | 2529 | """
Django settings for capomastro project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | mit | -5,883,969,919,784,102,000 | 24.039604 | 71 | 0.710953 | false | 3.332016 | false | false | false |
StephenLujan/Naith | game/plugins/dirlight/dirlight.py | 1 | 2681 | # -*- coding: utf-8 -*-
# Copyright Tom SF Haines, Aaron Snoswell
#
# 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 appl... | apache-2.0 | 6,424,593,677,426,341,000 | 37.3 | 147 | 0.675121 | false | 3.203106 | false | false | false |
davesque/django-rest-framework-simplejwt | rest_framework_simplejwt/compat.py | 1 | 1286 | import warnings
try:
from django.urls import reverse, reverse_lazy
except ImportError:
from django.core.urlresolvers import reverse, reverse_lazy # NOQA
class RemovedInDjango20Warning(DeprecationWarning):
pass
class CallableBool: # pragma: no cover
"""
An boolean-like object that is also call... | mit | -1,465,149,060,535,745,800 | 23.264151 | 80 | 0.629082 | false | 4.272425 | false | false | false |
aroth-arsoft/arsoft-web-crashupload | app/crashdump/xmlreport.py | 1 | 58814 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# kate: space-indent on; indent-width 4; mixedindent off; indent-mode python;
import sys
import base64
import struct
from datetime import datetime, tzinfo, timedelta
from uuid import UUID
from lxml import etree
from crashdump.exception_info import exception_code_names_per_pla... | gpl-3.0 | -559,323,098,969,346,050 | 35.850877 | 217 | 0.524909 | false | 3.941429 | false | false | false |
flags/Reactor-3 | tools/ReactorWatch.py | 1 | 1492 | #This tool was rushed together over the course of an hour or so. Be gentle.
from flask import Flask, render_template, request
import threading
import socket
import json
app = Flask(__name__)
def request(request, value=None):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(5)
sock.connect... | mit | -1,046,577,889,139,109,800 | 23.080645 | 76 | 0.683646 | false | 2.902724 | false | false | false |
tuskar/tuskar-ui | openstack_dashboard/dashboards/admin/users/tests.py | 1 | 18692 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 | -2,188,680,730,515,127,000 | 39.458874 | 79 | 0.546223 | false | 4.105425 | true | false | false |
laserson/rock-health-python | luigi/luigi-ngrams.py | 1 | 1715 | import os
import re
import luigi
import luigi.hadoop
import luigi.hdfs
class InputText(luigi.ExternalTask):
path = luigi.Parameter()
def output(self):
return luigi.hdfs.HdfsTarget(self.path)
class Ngrams(luigi.hadoop.JobTask):
source = luigi.Parameter()
destination = luigi.Parameter()
... | apache-2.0 | 8,702,826,489,544,018,000 | 25.796875 | 101 | 0.566764 | false | 3.802661 | false | false | false |
phac-nml/dynamic-tool-destination | tests/mockGalaxy.py | 1 | 3562 | """
# =============================================================================
Copyright Government of Canada 2015
Written by: Eric Enns, Public Health Agency of Canada,
National Microbiology Laboratory
Daniel Bouchard, Public Health Agency of Canada,
Nat... | apache-2.0 | 8,361,889,673,550,643,000 | 29.444444 | 107 | 0.624088 | false | 3.706556 | false | false | false |
benschmaus/catapult | telemetry/telemetry/internal/backends/chrome_inspector/inspector_backend.py | 1 | 18595 | # Copyright 2013 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 functools
import logging
import socket
import sys
from py_trace_event import trace_event
from telemetry.core import exceptions
from telemetry import... | bsd-3-clause | -3,750,426,105,838,133,000 | 35.821782 | 80 | 0.703469 | false | 4.352762 | false | false | false |
dyzajash/scanlation_cms | scanlation_cms/app.py | 1 | 3430 | # -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template, request, send_from_directory
from flask.ext.principal import RoleNeed, UserNeed, identity_loaded
from flask_login import current_user
from scanlation_cms import api, panel, public, user
from sca... | bsd-3-clause | 9,077,521,675,694,444,000 | 31.666667 | 80 | 0.669971 | false | 3.853933 | true | false | false |
Panagiotis-Kon/empower-runtime | empower/vbsp/vbspconnection.py | 1 | 15120 | #!/usr/bin/env python3
#
# Copyright (c) 2016 Supreeth Herle
#
# 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 applicabl... | apache-2.0 | -7,264,704,974,746,397,000 | 30.565762 | 84 | 0.56164 | false | 3.585487 | true | false | false |
OmkarPathak/pygorithm | pygorithm/dynamic_programming/lis.py | 1 | 1439 | """
Author: Omkar Pathak
Created At: 25th August 2017
"""
import inspect
def longest_increasing_subsequence(_list):
"""
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a
given sequence such that all elements of the subsequence are sorted in increasing or... | mit | 7,613,543,510,586,332,000 | 30.977778 | 106 | 0.628909 | false | 3.544335 | false | false | false |
CCI-MOC/nova | nova/image/glance.py | 1 | 26640 | # Copyright 2010 OpenStack Foundation
# 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 requ... | apache-2.0 | -405,195,565,436,879,100 | 37.002853 | 79 | 0.589902 | false | 4.143079 | false | false | false |
steny138/SE3Borrow | home/decorator.py | 1 | 1389 | # -*- coding: utf-8 -*-
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.decorators import available_attrs
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.contrib ... | apache-2.0 | -5,133,462,619,210,425,000 | 34.153846 | 84 | 0.665937 | false | 3.894886 | false | false | false |
opendatakosovo/bpo | utils/importer/import_idams.py | 1 | 6870 | # -*- coding: UTF-8 -*-
import csv
import os
import re
from datetime import datetime
from pymongo import MongoClient
import json
# Connect to defualt local instance of MongoClient
client = MongoClient()
# Get database and collection
db = client.bpo
collection = db.idams
def parse():
collection.remove({})
p... | cc0-1.0 | -4,839,804,771,402,337,000 | 59.80531 | 215 | 0.496943 | false | 4.178832 | false | false | false |
cariaso/zebraguide | zebraguide/zebraguide.py | 1 | 9159 | #!/usr/bin/env python
import argparse
import Bio.SeqIO
import sys
def get_args():
parser = argparse.ArgumentParser(
description="""Make the BoulderIO formatter config file for primer3 to direct guide sequences against a reference.
Typical usage:
./zebraguide.py sample2.fasta | primer3_core -format_outpu... | mit | -370,202,171,412,303,400 | 41.799065 | 122 | 0.632165 | false | 2.361176 | false | false | false |
unreal666/outwiker | src/outwiker/gui/controls/ultimatelistctrl.py | 2 | 456589 | # --------------------------------------------------------------------------------- #
# ULTIMATELISTCTRL wxPython IMPLEMENTATION
# Inspired by and heavily based on the wxWidgets C++ generic version of wxListCtrl.
#
# Andrea Gavana, @ 08 May 2009
# Latest Revision: 27 Dec 2012, 21.00 GMT
#
#
# TODO List
#
# 1) Subitem ... | gpl-3.0 | -2,917,967,209,524,716,500 | 32.50866 | 459 | 0.561998 | false | 4.191697 | false | false | false |
rackerlabs/heat-pyrax | pyrax/autoscale.py | 1 | 46139 | # -*- coding: utf-8 -*-
# Copyright (c)2013 Rackspace US, 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/LIC... | apache-2.0 | -1,451,871,668,392,427,000 | 35.531275 | 80 | 0.592731 | false | 4.265021 | true | false | false |
gplepage/lsqfit | examples/p-corr.py | 1 | 1909 | """
p-corr.py - Code for "Correlated Parameters"
"""
# Copyright (c) 2017-20 G. Peter Lepage.
#
# 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
# any later ve... | gpl-3.0 | -3,654,074,718,163,940,400 | 28.369231 | 75 | 0.584075 | false | 2.723252 | false | false | false |
cpatrick/comic-django | django/filetransfers/views.py | 1 | 9577 | import pdb
import posixpath
import re
import os
try:
from urllib.parse import unquote
except ImportError: # Python 2
from urllib import unquote
from exceptions import Exception
from django.core.files import File
from django.core.files.storage import DefaultStorage
from django.core.urlresolvers import rever... | apache-2.0 | -8,936,553,819,921,376,000 | 36.120155 | 125 | 0.6454 | false | 4.207821 | false | false | false |
larsborn/hetzner-zonefiles | dns.py | 1 | 3978 | import requests
import re
import os
import sys
from BeautifulSoup import BeautifulSoup
base_url = 'https://robot.your-server.de'
zonefiledir = 'zonefiles'
def log(msg, level = ''):
print '[%s] %s' % (level, msg)
def login(username, password):
login_form_url = base_url + '/login'
login_url =... | mit | 5,876,934,618,418,820,000 | 26.414286 | 98 | 0.578431 | false | 3.580558 | false | false | false |
misterresse/astrid-tp | tests/mail/tests.py | 1 | 1766 | # -*- coding: utf-8 -*-
# Copyright the original 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 ... | apache-2.0 | -8,088,331,116,841,964,000 | 32.62 | 115 | 0.656548 | false | 3.175803 | false | false | false |
lizhuangzi/QSQuantificationCode | QSQuantifier/DataGetter.py | 1 | 4473 | #!/usr/bin python
# coding=utf-8
# This Module provides some functions about getting stock's data.
import DataConnection as dc
import datetime
import numpy as np
import db_func
LEAST_DATE = '2016-01-01 00:00:00'
def string_toDatetime(timestr):
return datetime.datetime.strptime(timestr,"%Y-%m-%d %H:%M:%S")
def las... | apache-2.0 | -8,739,037,170,679,827,000 | 22.919786 | 144 | 0.678068 | false | 2.785181 | false | false | false |
DirectXMan12/nova-hacking | nova/tests/api/openstack/compute/contrib/test_server_start_stop.py | 1 | 3702 | # Copyright (c) 2012 Midokura Japan K.K.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | -2,595,194,122,138,429,400 | 38.806452 | 78 | 0.667747 | false | 3.615234 | true | false | false |
valkyriesavage/invenio | modules/bibedit/lib/bibedit_engine.py | 1 | 51248 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option... | gpl-2.0 | -4,159,289,337,030,909,400 | 44.312113 | 88 | 0.550812 | false | 4.272803 | false | false | false |
who-emro/meerkat_api | meerkat_api/resources/epi_week.py | 1 | 1398 | """
Resource to deal with epi-weeks
"""
import datetime
from dateutil.parser import parse
from flask import jsonify
from flask_restful import Resource
from meerkat_api.extensions import api
import meerkat_abacus.util.epi_week as epi_week_util
class EpiWeek(Resource):
"""
Get epi week of date(defaults to toda... | mit | 5,886,391,900,665,190,000 | 25.377358 | 87 | 0.620887 | false | 3.134529 | false | false | false |
aftersight/After-Sight-Model-1 | keyPress.py | 1 | 13557 | class _Getch:
"""Gets a single character from standard input. Does not echo to the
screen. From http://code.activestate.com/recipes/134892/"""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
try:
self.impl = _GetchMacCarbon()
... | cc0-1.0 | -7,249,865,575,136,879,000 | 33.321519 | 121 | 0.619827 | false | 4.243192 | false | false | false |
rpedde/python-carbon-buildpkg | lib/carbon/writer.py | 1 | 5802 | """Copyright 2009 Chris Davis
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
dist... | apache-2.0 | 4,351,749,073,916,351,000 | 30.362162 | 118 | 0.685453 | false | 4.141328 | false | false | false |
shellderp/sublime-robot-plugin | lib/robot/utils/argumentparser.py | 1 | 15983 | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 | 2,738,208,641,721,807,400 | 38.27027 | 84 | 0.565789 | false | 4.043258 | false | false | false |
Yelp/paasta | paasta_tools/contrib/utilization_check.py | 1 | 2057 | #!/usr/bin/env python
"""Reads a list of hosts to stdin and produces
a utilization report for those hosts.
"""
import functools
import json
import sys
from typing import Sequence
from a_sync import block
from paasta_tools.mesos.exceptions import MasterNotAvailableException
from paasta_tools.mesos_tools import get_mes... | apache-2.0 | 2,211,955,582,909,433,000 | 32.177419 | 77 | 0.679144 | false | 3.558824 | false | false | false |
indictranstech/osmosis-erpnext | erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py | 1 | 17555 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and
from frappe import msgprint, _
from frappe.model.document import ... | agpl-3.0 | -528,266,665,888,626,050 | 36.114165 | 120 | 0.659641 | false | 2.96838 | false | false | false |
simotek/tanko-bot | src/test-client.py | 1 | 1418 |
# test client - Simon Lees simon@simotek.net
# Copyright (C) 2015 Simon Lees
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) an... | lgpl-2.1 | -5,472,748,171,853,558,000 | 28.541667 | 80 | 0.708745 | false | 3.884932 | false | false | false |
google-coral/pycoral | tests/imprinting_engine_test.py | 1 | 6413 | # Lint as: python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 | -5,368,133,874,632,009,000 | 35.856322 | 80 | 0.655076 | false | 3.462743 | true | false | false |
fritz0705/lglass | lglass/object.py | 1 | 14874 | class Object(object):
def __init__(self, data=None):
self._data = []
if data is not None:
self.extend(data)
@property
def data(self):
"""List of key-value-tuples."""
return self._data
@property
def object_class(self):
"""Object class of this obje... | mit | 5,814,712,941,590,227,000 | 32.804545 | 117 | 0.538994 | false | 4.20407 | false | false | false |
timbuchwaldt/bundlewrap | bundlewrap/items/users.py | 1 | 11714 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from logging import ERROR, getLogger
from pipes import quote
from string import ascii_lowercase, digits
from passlib.hash import bcrypt, md5_crypt, sha256_crypt, sha512_crypt
from bundlewrap.exceptions import BundleError
from bundlewrap.items import BUI... | gpl-3.0 | -5,239,586,966,625,551,000 | 33.863095 | 93 | 0.522452 | false | 4.073018 | false | false | false |
windelbouwman/ppci-mirror | test/test_hexutil.py | 1 | 2515 | import unittest
import tempfile
import io
import os
from unittest.mock import patch
from helper_util import relpath, do_long_tests
from ppci.cli.hexutil import hexutil
def new_temp_file(suffix):
""" Generate a new temporary filename """
handle, filename = tempfile.mkstemp(suffix=suffix)
os.close(handle)
... | bsd-2-clause | 3,596,360,861,681,178,600 | 36.537313 | 78 | 0.638171 | false | 3.623919 | true | false | false |
bertothunder/coursera-algorithms | quickfind.py | 1 | 1155 | #!/usr/bin/env python3
class QuickFindUF(object):
def __init__(self, N):
self.__id__ = [i for i in range(N)]
self.__count__ = N
def union(self, p, q):
# Check indices
if (p > self.__count__ or q > self.__count__):
print('Indices do not exist')
elif (self.__id__[q] != self.__id__[p]): # Not connected ye... | gpl-3.0 | 641,932,581,429,565,000 | 27.9 | 62 | 0.550649 | false | 2.649083 | false | false | false |
fuziontech/pgshovel | src/main/python/pgshovel/relay/handlers/kafka.py | 1 | 2002 | from __future__ import absolute_import
import functools
import threading
import click
from pgshovel.interfaces.streams_pb2 import Message
from pgshovel.relay.entrypoint import entrypoint
from pgshovel.utilities import import_extras
from pgshovel.utilities.protobuf import BinaryCodec
with import_extras('kafka'):
... | apache-2.0 | -3,662,419,686,862,684,000 | 28.441176 | 94 | 0.663836 | false | 3.686924 | false | false | false |
imiolek-ireneusz/pysiogame | game_boards/game044.py | 1 | 8476 | # -*- coding: utf-8 -*-
import os
import pygame
import random
import classes.board
import classes.extras as ex
import classes.game_driver as gd
import classes.level_controller as lc
class Board(gd.BoardGame):
def __init__(self, mainloop, speaker, config, screen_w, screen_h):
self.level = lc.Level(self, ... | gpl-3.0 | 6,823,931,356,465,523,000 | 43.846561 | 115 | 0.549788 | false | 3.191265 | false | false | false |
sandlbn/django-theatre | theatre_performance/views.py | 1 | 6668 | # -*- coding: utf-8 -*-
__author__ = 'sandlbn'
from .models import Performance
from .models import PerformanceFrontPage
from .models import PerformanceGenre
from .models import PerformanceTime
from .models import PerformanceDonor
from theatre_news.models import News
from .forms import PerformanceForm
from .forms import... | lgpl-3.0 | -5,993,623,482,546,329,000 | 32.847716 | 79 | 0.741602 | false | 4.277101 | false | false | false |
mugurrus/ally-py-common | hr-user/hr/user/impl/user.py | 1 | 7083 | '''
Created on Mar 6, 2012
@package: hr user
@copyright: 2011 Sourcefabric o.p.s.
@license http://www.gnu.org/licenses/gpl-3.0.txt
@author: Mihai Balaceanu
Implementation for user services.
'''
from functools import reduce
import hashlib
from ally.api.criteria import AsLike, AsBoolean
from ally.api.validate import ... | gpl-3.0 | -8,506,056,176,071,447,000 | 38.792135 | 128 | 0.620076 | false | 4.118023 | false | false | false |
shobhitmishra/CodingProblems | LeetCode/Session3/SencondMinInABTree.py | 1 | 1590 | import sys
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def findSecondMinimumValue(self, root: TreeNode) -> int:
if not root or (not root.left and not root.right):
return -1
if root.left.va... | mit | -278,850,236,724,756,200 | 35.159091 | 100 | 0.627673 | false | 3.613636 | false | false | false |
junhaodong/misc | web_crawler/find_email_addresses.py | 1 | 3846 | import dryscrape, re, sys
from bs4 import BeautifulSoup
class EmailCrawler:
"""
Takes a domain name and prints out a list of email addresses found on that web page
or a lower level web page with the same given domain name.
Stores emails, paths, and visited_paths as sets to avoid duplicates.
Uses Dr... | mit | -1,839,977,054,518,523,100 | 34.611111 | 99 | 0.583983 | false | 3.900609 | false | false | false |
strus38/WPaaS | wpars/tasks.py | 1 | 8400 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicabl... | apache-2.0 | -7,396,022,001,565,113,000 | 28.166667 | 98 | 0.647143 | false | 2.770449 | false | false | false |
thisisshi/cloud-custodian | c7n/resources/ssm.py | 1 | 27799 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
import hashlib
import operator
from concurrent.futures import as_completed
from c7n.actions import Action
from c7n.exceptions import PolicyValidationError
from c7n.filters import Filter, CrossAccountAccessFilter
from c7n.query i... | apache-2.0 | -7,850,574,087,396,876,000 | 34.457908 | 97 | 0.548869 | false | 4.371599 | false | false | false |
ashutoshvt/psi4 | tests/pytests/test_jkmemory.py | 1 | 1305 | """
Tests for the memory estimators on JK objects
"""
import psi4
import pytest
from .utils import *
def _build_system(basis):
mol = psi4.geometry("""
Ar 0 0 0
Ar 0 0 5
Ar 0 0 15
Ar 0 0 25
Ar 0 0 35
""")
#psi4.set_options({"INTS_TOLERANCE": 0.0})
basis = psi4.core.B... | lgpl-3.0 | -1,547,428,685,653,749,200 | 24.588235 | 97 | 0.56092 | false | 2.843137 | true | false | false |
unreal666/outwiker | src/outwiker/gui/controls/togglebutton.py | 3 | 9278 | # -*- coding: utf-8 -*-
import wx
from wx.lib.buttons import ThemedGenBitmapTextToggleButton
class ToggleButton(ThemedGenBitmapTextToggleButton):
def __init__(self,
parent,
id=-1,
bitmap=None,
label='',
pos=wx.DefaultPosition,
... | gpl-3.0 | 532,456,159,052,573,950 | 29.221498 | 104 | 0.573184 | false | 3.800901 | false | false | false |
RobinQuetin/CAIRIS-web | cairis/cairis/PropertyDialog.py | 1 | 3948 | # 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... | apache-2.0 | 1,893,080,471,082,788,000 | 46.566265 | 170 | 0.744681 | false | 3.421144 | false | false | false |
openslack/openslack-web | openslack/userena/contrib/umessages/templatetags/umessages_tags.py | 1 | 2642 | from django import template
from userena.contrib.umessages.models import MessageRecipient
import re
register = template.Library()
class MessageCount(template.Node):
def __init__(self, um_from_user, var_name, um_to_user=None):
self.user = template.Variable(um_from_user)
self.var_name = var_name
... | apache-2.0 | 3,915,772,045,790,340,000 | 28.685393 | 99 | 0.604845 | false | 3.840116 | false | false | false |
leyyin/university-PC | elearning/course/forms.py | 1 | 3054 | from django import forms
from django.contrib.admin import widgets
from django.db.models.query_utils import Q
from django.forms.extras.widgets import SelectDateWidget
from django.forms.widgets import HiddenInput, Textarea, DateInput
from django.forms import ModelForm, CheckboxSelectMultiple
from django.contrib.auth.mode... | mit | -862,088,765,838,127,400 | 35.795181 | 165 | 0.69057 | false | 4.172131 | false | false | false |
harishvc/githubanalytics | MyMoment.py | 1 | 1651 | import datetime
from time import gmtime, strftime
import pytz
#Humanize time in milliseconds
#Reference: http://stackoverflow.com/questions/26276906/python-convert-seconds-from-epoch-time-into-human-readable-time
def HTM(a, context):
#print "Processing ....", a
b = int(datetime.datetime.now().strftime("%s"))
... | mit | 2,189,820,734,005,846,300 | 32.693878 | 119 | 0.621442 | false | 3.25641 | false | false | false |
dpetzold/dakku | dakku/backup.py | 1 | 4832 | import datetime
import logging
import re
import socket
import subprocess
import os
from django.conf import settings
from . import exceptions as dakku_exception
logger = logging.getLogger(__name__)
class BackupBase(object):
def deletefile(self, date_str):
"""Given a date in YYYYMMDD check if the file s... | bsd-3-clause | -8,806,372,401,183,013,000 | 32.79021 | 87 | 0.569536 | false | 3.871795 | false | false | false |
chripell/mytools | gimp/plugins/resizer.py | 1 | 1661 | #!/usr/bin/env python
import ConfigParser
import errno
from gimpfu import register, PF_INT16, pdb, main
from gimpenums import INTERPOLATION_CUBIC
import gimp
import os
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
... | apache-2.0 | -2,538,402,579,378,744,300 | 21.146667 | 65 | 0.615292 | false | 3.263261 | true | false | false |
kurtraschke/camelot | camelot/view/controls/editors/wideeditor.py | 1 | 1420 | # ============================================================================
#
# Copyright (C) 2007-2010 Conceptive Engineering bvba. All rights reserved.
# www.conceptive.be / project-camelot@conceptive.be
#
# This file is part of the Camelot Library.
#
# This file may be used under the terms of the GNU General... | gpl-2.0 | 3,623,529,977,134,472,700 | 42.030303 | 90 | 0.675352 | false | 4.201183 | false | false | false |
wuchaofan/collectsource | mobileinterest/settings.py | 1 | 2223 | """
Django settings for mobileinterest project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | gpl-2.0 | 5,870,867,587,422,026,000 | 23.163043 | 86 | 0.7148 | false | 3.193966 | false | false | false |
jacol12345/TP-ankiety-web-app | mobilepolls/polls/models.py | 1 | 5421 | # -*- coding: utf-8 -*-
import json
from datetime import datetime
from django.core.urlresolvers import reverse
from django.db import models
from django.contrib.auth.models import User
from model_utils.managers import InheritanceManager
class PollManager(models.Manager):
def active(self):
return self.filt... | mit | 3,513,476,015,671,460,000 | 29.116667 | 109 | 0.617229 | false | 3.723214 | false | false | false |
YcheLanguageStudio/PythonStudy | bioinformatics/dynamic_programming/global_alignment.py | 1 | 2764 | import numpy as np
def global_alignment(seq0, seq1):
def get_dp_table():
dp_score_table = np.ndarray(shape=(len(seq0) + 1, len(seq1) + 1), dtype=int)
dp_score_table.fill(0)
for col_idx in range(dp_score_table.shape[1]):
dp_score_table[0][col_idx] = (-1) * col_idx
for ro... | mit | 6,954,767,011,223,040,000 | 37.929577 | 110 | 0.517366 | false | 3.137344 | false | false | false |
wizzard/sdk | tests/sync_test_megacli.py | 1 | 5819 | """
Application for testing syncing algorithm
(c) 2013-2014 by Mega Limited, Wellsford, New Zealand
This file is part of the MEGA SDK - Client Access Engine.
Applications using the MEGA API must present a valid application key
and comply with the the rules set forth in the Terms of Service.
The MEGA SDK is di... | bsd-2-clause | 4,365,006,259,359,789,000 | 35.829114 | 156 | 0.647534 | false | 3.675932 | true | false | false |
elitegreg/mudpy | mudpy/gameproperty.py | 1 | 1060 | # Game properties should be registered at import time
class GameProperty:
__slots__ = ('__propname', '__default', '__readonly')
def __init__(self, propname, default=None, readonly=False, tmp=False):
if not tmp:
self.__propname = '_GameProperty_' + propname
else:
self.__... | gpl-3.0 | -9,018,803,080,407,469,000 | 34.333333 | 79 | 0.614151 | false | 4.092664 | false | false | false |
GlobalFishingWatch/vessel-classification | classification/metadata_test.py | 1 | 6965 | # Copyright 2017 Google Inc. and Skytruth Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 | 7,179,996,861,872,246,000 | 40.706587 | 89 | 0.576741 | false | 3.489479 | true | false | false |
RIFTIO/rift.ware-descriptor-packages | 4.3/src/vnfd/ping_vnf/scripts/ping_set_rate.py | 1 | 3804 | #!/usr/bin/env python3
############################################################################
# Copyright 2017 RIFT.IO Inc #
# #
# Licensed under the Apache License, Version 2.0 (the "License");... | apache-2.0 | -337,360,539,746,339,460 | 33.899083 | 93 | 0.518139 | false | 4.029661 | false | false | false |
jmartinz/pyCrawler | 10.contratacionE/pce_extrae_contratos.py | 1 | 6399 | # coding=utf-8
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from bs4 import BeautifulSoup
import sys
#phantonPath = "/home/jmartinz/00.py/phantomjs/phantomjs"
phantonPath = "../phantomjs/phantomjs"
contratacionPage = "https://... | apache-2.0 | -4,426,364,085,573,958,000 | 36.757396 | 514 | 0.63501 | false | 2.86529 | false | false | false |
project-asap/IReS-Platform | asap-tools/monitoring/reporter_cli.py | 1 | 5614 | #!/usr/bin/env python
from cement.core import foundation, controller
from lib import get_backend, set_backend
from monitor import *
from pprint import PrettyPrinter
pprint = PrettyPrinter(indent=2).pprint
backend = get_backend()
def my_split(p):
"""
splits args based on '=' delim
:return:
"""
... | apache-2.0 | -2,881,919,297,781,870,000 | 37.724138 | 144 | 0.633238 | false | 4.00428 | false | false | false |
istb-mia/miapy | miapy/data/conversion.py | 1 | 6690 | """This module holds classes related to image conversion.
The main purpose of this module is the conversion between SimpleITK images and numpy arrays.
"""
import typing
import SimpleITK as sitk
import numpy as np
class ImageProperties:
"""Represents ITK image properties.
Holds common ITK image meta-data su... | apache-2.0 | -5,434,569,577,237,771,000 | 34.210526 | 120 | 0.588789 | false | 4.477912 | false | false | false |
libvirt/libvirt-test-API | libvirttestapi/repos/storage/define_iscsi_pool.py | 1 | 1805 | # Copyright (C) 2010-2012 Red Hat, Inc.
# This work is licensed under the GNU GPLv2 or later.
# Define a storage pool of 'iscsi' type
from libvirt import libvirtError
from libvirttestapi.src import sharedmod
from libvirttestapi.repos.storage import storage_common
required_params = ('poolname', 'sourcehost', 'sourcepa... | gpl-2.0 | 7,912,506,781,527,067,000 | 34.392157 | 88 | 0.646537 | false | 3.729339 | false | false | false |
rpm-software-management/rpmlint | test/test_polkit.py | 1 | 2216 | import os
import pytest
from rpmlint.checks.PolkitCheck import PolkitCheck
from rpmlint.filter import Filter
import Testing
from Testing import get_tested_package
def get_polkit_check(config_path):
from rpmlint.config import Config
if not os.path.isabs(config_path):
config_path = Testing.testpath()... | gpl-2.0 | -8,447,820,223,201,931,000 | 37.877193 | 175 | 0.743682 | false | 3.268437 | true | false | false |
spacecowboy/pysurvival-ann | setup.py | 1 | 2269 | #!/usr/bin/env python
"""
General instructions:
python setup.py build
python setup.py install
To include parts that depend on R's survival module, do:
python setup.py build --with-R
Info: This package depends on numpy, and optionally R, RInside
"""
from distutils.core import setup, Extension
import subprocess
... | gpl-2.0 | 3,438,694,046,496,193,500 | 28.467532 | 69 | 0.557074 | false | 3.6304 | false | false | false |
patcamwol/frontendXInterfaces | libsrc/python/input_ports.py | 1 | 7409 | #
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK frontendInterfaces.
#
# REDHAWK frontendInterfaces is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public Licen... | lgpl-3.0 | -1,823,136,341,251,483,000 | 33.300926 | 93 | 0.668241 | false | 4.160022 | false | false | false |
Azure/azure-sdk-for-python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py | 1 | 4664 | # 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 | 1,130,047,885,149,254,000 | 43.846154 | 133 | 0.645583 | false | 4.636183 | false | false | false |
pbourgel/mybreakout | bounceables.py | 1 | 7962 | ###############################################################################
# #
# bounceables.py #
# #
... | gpl-3.0 | -7,460,730,442,292,494,000 | 49.713376 | 242 | 0.568325 | false | 3.910609 | false | false | false |
cymplecy/codebug_tether | setup.py | 1 | 1209 | import sys
from distutils.core import setup
VERSION_FILE = 'codebug_tether/version.py'
PY3 = sys.version_info[0] >= 3
def get_version():
if PY3:
version_vars = {}
with open(VERSION_FILE) as f:
code = compile(f.read(), VERSION_FILE, 'exec')
exec(code, None, version_vars)
... | gpl-3.0 | -6,195,292,297,385,302,000 | 29.225 | 77 | 0.621175 | false | 3.754658 | false | false | false |
uclouvain/osis | ddd/logic/learning_unit/domain/model/_titles.py | 1 | 2084 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 | 9,158,577,290,105,660,000 | 37.574074 | 87 | 0.6265 | false | 3.908068 | false | false | false |
FreeOpcUa/python-opcua | examples/client_to_prosys.py | 1 | 2365 | import sys
sys.path.insert(0, "..")
import time
import logging
from opcua import Client
from opcua import ua
class SubHandler(object):
"""
Client to subscription. It will receive events from server
"""
def datachange_notification(self, node, val, data):
print("Python: New data change event"... | lgpl-3.0 | 5,179,125,964,854,195,000 | 34.298507 | 112 | 0.629598 | false | 3.493353 | false | false | false |
naoyat/latin | latin/latindic.py | 1 | 1985 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import latin_noun
import latin_pronoun
import latin_adj
import latin_conj
import latin_prep
import latin_verb_reg
import latin_verb_irreg
import util
class LatinDic:
dic = {}
auto_macron_mode = False
def flatten(text):
return text.replace(u'ā',u'a').replac... | mit | 3,132,495,049,686,143,000 | 20.053191 | 137 | 0.583123 | false | 3.068217 | false | false | false |
hfaran/ubc-timetabler | timetabler/util.py | 1 | 3085 | from __future__ import division
from math import sqrt
#############
# Constants #
#############
DAY_LIST = ["Mon", "Tue", "Wed", "Thu", "Fri"]
###########
# Helpers #
###########
# General
def chunks(l, n):
"""Yields successive ``n``-sized chunks from ``l``
http://stackoverflow.com/a/312464/1798683
... | mit | -6,416,785,595,618,662,000 | 21.035714 | 89 | 0.561426 | false | 3.306538 | false | false | false |
cpenner461/tellmewhen | tmw/server.py | 1 | 4361 | '''
Built-in web server using Flask. Should mirror functionality offered by the
cli.
'''
from flask import Flask
from flask import render_template, request, session
import tmw.config as config
import tmw.core as core
import json
from uuid import uuid4
from multiprocessing import Pool
app = Flask(__name__)
pool = ... | mit | -1,459,745,616,760,489,200 | 30.601449 | 83 | 0.608347 | false | 3.586349 | true | false | false |
googleapis/googleapis-gen | google/cloud/aiplatform/v1beta1/aiplatform-v1beta1-py/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py | 1 | 26691 | # -*- 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 | -7,461,925,922,549,992,000 | 41.165877 | 185 | 0.616762 | false | 4.62422 | false | false | false |
Magicked/crits | crits/events/event.py | 4 | 3783 | import uuid
try:
from django_mongoengine import Document
except ImportError:
from mongoengine import Document
from mongoengine import StringField, UUIDField, BooleanField
from mongoengine import EmbeddedDocument
from django.conf import settings
from crits.core.crits_mongoengine import CritsBaseAttributes
from crit... | mit | 5,491,923,777,403,173,000 | 33.081081 | 79 | 0.545863 | false | 4.563329 | false | false | false |
autopower/thermeq3 | obsolete/lib/dummy.py | 1 | 1621 | import thermeq3
import datetime
def add_dummy(status):
"""
:param status: is window open?
:return: nothing
"""
# valves = {valve_adr: [valve_pos, valve_temp, valve_curtemp, valve_name]}
# rooms = {id : [room_name, room_address, is_win_open, curr_temp, average valve position]}
# devices = {... | gpl-3.0 | 619,798,513,470,130,000 | 45.314286 | 112 | 0.592844 | false | 2.752122 | false | false | false |
colloquium/spacewalk | client/solaris/smartpm/smart/channels/rpm_md.py | 1 | 5464 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | gpl-2.0 | -5,483,863,477,960,673,000 | 38.594203 | 80 | 0.554539 | false | 4.248834 | false | false | false |
DTU-ELMA/teaching-games | pay_as_bid/python/init.py | 1 | 8764 | import random, csv
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from itertools import chain,cycle,islice
def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
# Recipe credited to George Sakkis
pending = len(iterables)
nexts = cycle(iter(it).next for it in... | mit | -494,952,331,219,167,040 | 36.775862 | 98 | 0.5623 | false | 3.191551 | false | false | false |
chiamingyen/PythonCAD_py3 | Interface/Preview/arc.py | 1 | 3347 | #!/usr/bin/env python
#
# Copyright (c) 2010 Matteo Boscolo
#
# This file is part of PythonCAD.
#
# PythonCAD 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 opt... | gpl-2.0 | 1,902,915,272,490,773,000 | 34.606383 | 92 | 0.618166 | false | 4.003589 | false | false | false |
Honzin/ccs | tests/testAdapter/testBtcc/testOrder.py | 1 | 1854 | import unittest
import ccs
import time
####################################################################################################################
# BITFINEX #
##############################################... | agpl-3.0 | 2,400,904,288,709,812,700 | 27.96875 | 116 | 0.515102 | false | 4.185102 | true | false | false |
lagner/academ-weather | bootstrap/utils.py | 1 | 2005 | import os
import subprocess
import logging as log
from shutil import copy2
from contextlib import contextmanager
@contextmanager
def pushd(newDir):
previousDir = os.getcwd()
os.chdir(newDir)
yield
os.chdir(previousDir)
def static_vars(**kwargs):
def decorate(func):
for k in kwargs:
... | mit | 6,562,177,993,364,735,000 | 23.156627 | 77 | 0.6 | false | 3.754682 | false | false | false |
dimtion/jml | outputFiles/statistics/archives/ourIA/closest.py/0.7/3/player1.py | 1 | 11241 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
####################################################################################################################################################################################################################################
############################################... | mit | -5,020,732,711,863,126,000 | 63.982659 | 228 | 0.356641 | false | 7.419802 | false | false | false |
invinst/ResponseBot | responsebot/responsebot_client.py | 1 | 12103 | from __future__ import absolute_import
from decorator import decorate
from tweepy.error import TweepError, RateLimitError
from responsebot.common.constants import TWITTER_PAGE_DOES_NOT_EXISTS_ERROR, TWITTER_TWEET_NOT_FOUND_ERROR, \
TWITTER_USER_NOT_FOUND_ERROR, TWITTER_DELETE_OTHER_USER_TWEET, TWITTER_ACCOUNT_SUS... | apache-2.0 | -2,195,622,971,623,110,000 | 33.58 | 119 | 0.592002 | false | 3.761032 | false | false | false |
praekeltfoundation/certbot | marathon_acme/server.py | 1 | 3528 | import json
from klein import Klein
from twisted.internet.endpoints import serverFromString
from twisted.logger import Logger
from twisted.web.http import NOT_IMPLEMENTED, OK, SERVICE_UNAVAILABLE
from twisted.web.server import Site
def write_request_json(request, json_obj):
request.setHeader('Content-Type', 'ap... | mit | 7,013,790,470,706,764,000 | 33.588235 | 79 | 0.637755 | false | 4.286756 | false | false | false |
Udzu/pudzu | dataviz/markovtext.py | 1 | 6426 | import pickle
import seaborn as sns
import string
from pudzu.sandbox.markov import *
from pudzu.sandbox.bamboo import *
from pudzu.charts import *
from math import log
CORPUS = "wikienglish"
TITLE = "Letter and next-letter frequencies in English"
SUBTITLE = "measured across 1 million sentences from Wikiped... | mit | 4,370,538,101,888,572,400 | 53.396552 | 287 | 0.644569 | false | 2.780614 | false | false | false |
brython-dev/brython | www/src/Lib/test/test_eof.py | 2 | 2490 | """test script for a few new invalid token catches"""
import sys
from test import support
from test.support import script_helper
import unittest
class EOFTestCase(unittest.TestCase):
def test_EOFC(self):
expect = "EOL while scanning string literal (<string>, line 1)"
try:
eval("""'this... | bsd-3-clause | 7,089,911,229,699,417,000 | 37.307692 | 77 | 0.590763 | false | 4.08867 | true | false | false |
EmanueleCannizzaro/scons | test/Split.py | 1 | 2076 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... | mit | 3,093,363,460,903,866,000 | 29.086957 | 87 | 0.69027 | false | 3.431405 | true | false | false |
adampresley/bottlepy-bootstrap | model/DateHelper.py | 1 | 2135 | from model.Service import Service
from datetime import tzinfo, timedelta, datetime
from dateutil import tz
class DateHelper(Service):
utc = tz.gettz("UTC")
pyToJsFormatMapping = {
"%m/%d/%Y": "MM/dd/yyyy",
"%d/%m/%Y": "dd/MM/yyyy",
"%Y-%m-%d": "yyyy-MM-dd"
}
def __init__(self, db, timezone = "UTC", dateFo... | mit | 6,094,790,128,665,935,000 | 24.129412 | 103 | 0.685714 | false | 2.973538 | false | false | false |
domeav/sonofages-agenda | agenda/events.py | 1 | 2899 | from agenda.model import Occurrence, Event, Venue, Tag, EventTag
from agenda.forms import EventForm
from flask import render_template, request, redirect, url_for
from flask_security import login_required
from datetime import datetime
from agenda import app
@app.route('/')
@app.route('/events/')
def events():
page ... | mit | 1,869,846,341,948,956,400 | 34.353659 | 75 | 0.601932 | false | 3.660354 | false | false | false |
endthestart/tinsparrow | tinsparrow/tinsparrow/views.py | 1 | 1746 | import os
from django.contrib import messages
from django.contrib.auth import logout as logout_user
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django import http
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
... | mit | 6,564,142,620,204,948,000 | 30.178571 | 87 | 0.699885 | false | 3.932432 | false | false | false |
code-for-india/sahana_shelter_worldbank | private/templates/IFRC/config.py | 1 | 76404 | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from datetime import timedelta
from gluon import current
from gluon.storage import Storage
T = current.T
settings = current.deployment_sett... | mit | -5,644,412,904,426,701,000 | 37.11982 | 189 | 0.511329 | false | 4.436864 | false | false | false |
liangdebin/tor | handlers/base.py | 1 | 2310 | import json
import tornado.web
import logging
logger = logging.getLogger('boilerplate.' + __name__)
class BaseHandler(tornado.web.RequestHandler):
"""A class to collect common handler methods - all other handlers should
subclass this one.
"""
def load_json(self):
"""Load JSON from the reques... | mit | -580,859,130,668,034,600 | 33.477612 | 79 | 0.58658 | false | 4.10302 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.