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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SEL-Columbia/commcare-hq | corehq/apps/users/util.py | 1 | 4131 | import re
from django.conf import settings
from django.contrib.auth.models import User
from couchdbkit.resource import ResourceNotFound
from corehq import toggles, privileges
from dimagi.utils.couch.database import get_db
from django.core.cache import cache
from django_prbac.exceptions import PermissionDenied
from d... | bsd-3-clause | 3,465,629,854,168,599 | 28.719424 | 95 | 0.648995 | false | 3.592174 | false | false | false |
richhorace/docker-getpocket-elastic | scripts/reprocess-pocket-raw-data.py | 1 | 2316 | #/usr/bin/env python3
import argparse
import glob
import json
import logging
import datetime
import os
from local import DATA_DIR, LOG_DIR, REPROCESS_DIR
def parse_files(fnames):
for fname in fnames:
stat = os.stat(fname)
f_date = str(datetime.datetime.utcfromtimestamp(stat.st_birthtime).isoforma... | mit | 6,101,022,340,132,048,000 | 26.903614 | 103 | 0.525475 | false | 3.784314 | false | false | false |
WmHHooper/aima-python | submissions/Martinez/vacuum2.py | 1 | 1449 | import agents as ag
def HW2Agent() -> object:
def program(percept):
bump, status = percept
if status == 'Dirty':
action = 'Suck'
else:
lastBump, lastStatus, = program.oldPercepts[-1]
lastAction = program.oldActions[-1]
if bump == 'None':
... | mit | -7,472,466,343,766,180,000 | 26.884615 | 62 | 0.507246 | false | 4.187861 | false | false | false |
Novartis/railroadtracks | src/test/test_recipe.py | 1 | 26005 | # Copyright 2014-2015 Novartis Institutes for Biomedical Research
# 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 applic... | apache-2.0 | 5,608,266,947,258,619,000 | 44.304878 | 133 | 0.55051 | false | 4.339953 | true | false | false |
smurn/twistit | twistit/test_testing.py | 1 | 1640 | # Copyright (C) 2015 Stefan C. Mueller
import unittest
from twisted.internet import defer
import twistit
class TestExtract(unittest.TestCase):
def test_success(self):
d = defer.succeed(42)
self.assertEqual(42, twistit.extract(d))
def test_fail(self):
d = defer.fail(ValueE... | mit | -6,057,147,474,698,230,000 | 28.836364 | 77 | 0.622561 | false | 3.787529 | true | false | false |
coinbase/coinbase-python | coinbase/wallet/auth.py | 1 | 1718 | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hashlib
import hmac
from requests.utils import to_native_string
import time
from requests.auth import AuthBase
class HMACAuth(AuthBase):
def... | apache-2.0 | -6,887,145,672,861,208,000 | 32.038462 | 98 | 0.633295 | false | 3.976852 | false | false | false |
aerospike/aerospike-client-python | examples/client/remove_bin.py | 1 | 4429 | # -*- coding: utf-8 -*-
##########################################################################
# Copyright 2013-2021 Aerospike, 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
#
# ... | apache-2.0 | 4,883,970,964,990,964,000 | 32.300752 | 100 | 0.470761 | false | 4.883131 | false | false | false |
nigelb/gdata-utils | gdata_utils/fs/__init__.py | 1 | 5204 | # Helper utils for gdata.
#
# Copyright (C) 2012 NigelB
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-3.0 | -8,418,994,547,592,379,000 | 33.236842 | 106 | 0.63259 | false | 3.733142 | true | false | false |
saullocastro/pyNastran | pyNastran/utils/__init__.py | 1 | 9338 | # -*- coding: utf-8 -*-
from __future__ import print_function
from types import MethodType
import os
import io
import sys
from codecs import open as codec_open
from itertools import count
from six import PY2, string_types, iteritems, StringIO
import numpy as np
if PY2:
integer_types = (int, long, np.int32, np.in... | lgpl-3.0 | -8,305,409,958,395,564,000 | 31.996466 | 112 | 0.57507 | false | 3.641966 | false | false | false |
SWLBot/electronic-blackboard | board.py | 1 | 2049 | import tornado.ioloop
import tornado.web
import tornado.httpserver
from tornado.options import define, options, parse_command_line
import os.path
from broadcast_api import load_schedule
import argparse
import config.settings
define('port',default=4000,help='run the server on the given port',type=int)
#define('log_fil... | apache-2.0 | -8,772,363,605,874,281,000 | 33.728814 | 84 | 0.65349 | false | 3.691892 | false | false | false |
denys-duchier/django-wiki-py3 | wiki/core/plugins/registry.py | 1 | 1646 | # -*- coding: utf-8 -*-
from django.utils.importlib import import_module
_cache = {}
_settings_forms = []
_markdown_extensions = []
_article_tabs = []
_sidebar = []
def register(PluginClass):
"""
Register a plugin class. This function will call back your plugin's
constructor.
"""
if PluginClass in... | gpl-3.0 | 4,763,319,060,811,272,000 | 28.945455 | 88 | 0.647631 | false | 4.209719 | false | false | false |
licon02/pnn | pruebas/prueba04_b.py | 1 | 2843 | #!/usr/bin/python
#prueba de red LSTM
#genera grafica de las senales de entrada y la respuesta de la redes
#entrada senoidal
from __future__ import division
import numpy as np
from pybrain.datasets import SequentialDataSet
from itertools import cycle
from pybrain.supervised import RPropMinusTrainer
from sys import std... | gpl-3.0 | 2,559,812,335,112,786,400 | 29.569892 | 90 | 0.687654 | false | 2.593978 | false | false | false |
google/verible | bazel/build-version.py | 1 | 1343 | #!/usr/bin/env python3
# Copyright 2020-2021 The Verible Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | apache-2.0 | 656,127,483,831,813,100 | 24.826923 | 133 | 0.679821 | false | 3.600536 | false | false | false |
dimka665/vk | tests/conftest.py | 1 | 1967 | import requests
from pytest import fixture
from vk.session import APIBase
@fixture('session')
def v():
"""
Actual vk API version
"""
return '5.80'
class Attributable(object):
def set_attrs(self, attributes):
for attr_name, attr_value in attributes.items():
setattr(self, att... | mit | 8,648,724,391,978,122,000 | 21.101124 | 61 | 0.608541 | false | 3.926148 | false | false | false |
WadeHsiao/B | 3rd/yuv/libyuv/setup_links.py | 1 | 17186 | #!/usr/bin/env python
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | lgpl-3.0 | -4,101,265,656,489,156,600 | 32.897436 | 80 | 0.636216 | false | 3.765557 | false | false | false |
ProjectBabbler/ebird-api | src/ebird/api/statistics.py | 1 | 2558 | """Functions for fetching basic statistics about observers and observations."""
from ebird.api.utils import call
from ebird.api.validation import (
clean_area,
clean_date,
clean_max_observers,
clean_rank,
clean_region,
)
TOP_100_URL = "https://ebird.org/ws2.0/product/top100/%s/%s"
TOTALS_URL = "ht... | mit | -4,960,243,422,118,333,000 | 27.422222 | 110 | 0.681392 | false | 3.397078 | false | false | false |
diggcoin/diggcoin | contrib/linearize/linearize-hashes.py | 1 | 3037 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pr... | mit | -6,657,036,970,384,412,000 | 25.876106 | 90 | 0.663813 | false | 2.968719 | false | false | false |
openstack/surveil | surveil/api/handlers/status/live_host_handler.py | 1 | 2622 | # Copyright 2014 - Savoir-Faire Linux inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 | -4,852,115,580,305,140,000 | 31.37037 | 76 | 0.606789 | false | 3.789017 | false | false | false |
patrick91/pycon | backend/integrations/tests/test_tasks.py | 1 | 1179 | from unittest.mock import MagicMock, patch
from django.test import override_settings
from integrations.tasks import notify_new_submission, switchable_task
def test_notify_new_submission():
with patch("integrations.slack.send_message") as m1:
notify_new_submission(
"test_title",
"t... | mit | 500,003,179,471,033,660 | 27.756098 | 79 | 0.615776 | false | 3.52994 | true | false | false |
jpopelka/osbs-client | setup.py | 1 | 1520 | #!/usr/bin/python
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import re
import sys
from setuptools import setup, find_packages
data_files = {
"share/osbs": [
"inputs/image... | bsd-3-clause | 2,019,618,046,527,079,000 | 27.679245 | 84 | 0.644737 | false | 3.627685 | false | false | false |
dethi/duhpy | duhpy.py | 1 | 3987 | #!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import sys
import time
import argparse
from os import getenv
from os.path import expanduser
from threading import Thread
try:
from Queue import Queue
except:
from queue import Queue
import dropbox
PY2 = (s... | mit | 1,625,170,860,030,826,800 | 26.308219 | 78 | 0.536494 | false | 3.559821 | false | false | false |
grave-w-grave/zulip | confirmation/models.py | 2 | 5962 | # -*- coding: utf-8 -*-
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = '$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $'
import re
from django.db import models
from django.core.urlresolvers import reverse
from django.core.mail import send_mail
from django.conf import settings
from dj... | apache-2.0 | 4,702,718,434,550,939,000 | 38.746667 | 122 | 0.643911 | false | 4.001342 | false | false | false |
bsamseth/project-euler | 094/94.py | 1 | 1451 | """
It is easily proved that no equilateral triangle exists with integral length
sides and integral area. However, the almost equilateral triangle 5-5-6 has an
area of 12 square units.
We shall define an almost equilateral triangle to be a triangle for which two
sides are equal and the third differs by no more than on... | mit | -7,009,995,585,974,352,000 | 29.702128 | 79 | 0.544006 | false | 3.130152 | false | false | false |
flopp/airports_map | airports/db.py | 1 | 3270 | import os
import random
import typing
from airports.airport import Airport, AirportType
from airports.airportstable import AirportsTable
from airports.download import download
from airports.runwaystable import RunwaysTable
from airports.wikipediahelper import get_wikipedia_articles
class DB:
def __init__(self) -... | mit | -1,287,605,393,672,882,000 | 41.467532 | 101 | 0.62263 | false | 3.637375 | false | false | false |
arcan1s/git-etc | sources/ctrlconf/aboutwin.py | 1 | 5647 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'aboutwin.ui'
#
# Created: Mon Feb 18 04:26:37 2013
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attrib... | gpl-3.0 | -5,526,175,977,805,946,000 | 67.217949 | 589 | 0.713588 | false | 2.87311 | false | false | false |
DXCanas/content-curation | contentcuration/contentcuration/node_metadata/annotations.py | 1 | 8076 | from django.contrib.postgres.aggregates.general import ArrayAgg
from django.contrib.postgres.aggregates.general import BoolOr
from django.db.models import BooleanField
from django.db.models import CharField
from django.db.models import IntegerField
from django.db.models.aggregates import Count
from django.db.models.agg... | mit | -4,523,287,446,646,386,000 | 33.810345 | 97 | 0.616518 | false | 3.978325 | false | false | false |
lipis/github-stats | main/api/v1/repo.py | 1 | 1840 | # coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
import flask_restful
import flask
from api import helpers
import auth
import model
import util
from main import api_v1
@api_v1.resource('/repo/', endpoint='api.repo.list')
class RepoListAPI(flask_restful.Resource):
def g... | mit | 9,207,477,670,009,611,000 | 31.280702 | 79 | 0.646196 | false | 3.351548 | false | false | false |
flavoi/diventi | diventi/products/migrations/0060_auto_20200901_1950.py | 1 | 3075 | # Generated by Django 2.2.13 on 2020-09-01 17:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0059_auto_20200830_1804'),
]
operations = [
migrations.AlterField(
model_name='chapter',
name='title',
... | apache-2.0 | 258,824,874,770,298,750 | 33.943182 | 83 | 0.555122 | false | 4.34322 | false | false | false |
erdc/proteus | proteus/tests/LS_with_edgeBased_EV/MCorr/thelper_cons_ls.py | 1 | 3450 | from __future__ import division
from past.utils import old_div
from proteus import Domain
from proteus import Context
ct=Context.Options([
# General parameters #
("T",0.1,"Final time"),
("nDTout",1,"Number of time steps to archive"),
("refinement",0,"Level of refinement"),
("unstructured",False,"Us... | mit | -2,499,542,141,089,966,600 | 29.263158 | 146 | 0.71913 | false | 2.863071 | false | false | false |
frePPLe/frePPLe | freppledb/common/report.py | 1 | 134827 | #
# Copyright (C) 2007-2019 by frePPLe bv
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This library is d... | agpl-3.0 | -1,733,423,649,352,162,600 | 39.234855 | 148 | 0.454501 | false | 4.834588 | false | false | false |
ph1l/halo_radio | HaloRadio/UserSongStatsListMaker.py | 1 | 3143 | #
#
# Copyright (C) 2004 Philip J Freeman
#
# This file is part of halo_radio
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | gpl-2.0 | 6,443,673,913,120,863,000 | 35.126437 | 239 | 0.646834 | false | 3.408894 | false | false | false |
zstackio/zstack-woodpecker | integrationtest/vm/multihosts/invalid_path/snapshot/paths/invalid_path4.py | 1 | 1360 | import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=8, faild_point=13, path_list=[
[TestAction.create_vm, 'vm1', ],
[TestAction.create_volume, 'volume1', 'flag=scsi'],
[TestAction.attach_volume, 'vm1... | apache-2.0 | 2,703,161,563,352,621,600 | 34.815789 | 161 | 0.7 | false | 2.661448 | true | false | false |
liqd/adhocracy3.mercator | src/adhocracy_meinberlin/adhocracy_meinberlin/sheets/test_kiezkassen.py | 2 | 1796 | import colander
from pyramid import testing
from pytest import mark
from pytest import fixture
from pytest import raises
@mark.usefixtures('integration')
def test_includeme_register_proposal_sheet(registry):
from .kiezkassen import IProposal
context = testing.DummyResource(__provides__=IProposal)
assert r... | agpl-3.0 | 4,342,760,450,687,123,000 | 29.965517 | 60 | 0.671492 | false | 4.147806 | true | false | false |
philscher/gkc | Benchmarks/IntegralCode/SolveOK.py | 1 | 8023 | from pylab import *
import scipy
#import math
import mpmath as mp
import traceback
import random
import numpy
import Dispersion_ConstTheta
#import fpectl
#fpectl.turnon_sigfpe()
import scipy.linalg as la
import scipy.sparse.linalg as sla
import SlepcDet
import gkcStyle
import iCode
class Species:
def __init__(se... | gpl-3.0 | 5,590,745,320,015,303,000 | 27.756272 | 150 | 0.510408 | false | 2.578914 | false | false | false |
TomAugspurger/DSADD | setup.py | 1 | 1281 | from setuptools import setup, find_packages
# To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='dsadd',
version='0.0.2',
description='A python package for defensive data analysis.',
long_description='A python package for defensive data analysis... | mit | -496,449,566,151,237,250 | 26.255319 | 70 | 0.622951 | false | 4.092652 | false | false | false |
schuhumi/timetravel | timetravel-gui.py | 1 | 3226 | #!/usr/bin/env python3
# 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 distributed in the ho... | gpl-3.0 | 7,090,185,540,407,805,000 | 28.87037 | 87 | 0.599814 | false | 3.054924 | false | false | false |
Adista-ste/metabaseparser | script2012r2.py | 1 | 1237 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import etree
import argparse, sys, os, re
arguments = argparse.ArgumentParser()
arguments.add_argument("-s","--https",help="Traite également les domaines HTTPS", action='store_true')
arguments.add_argument("-f","--fichier",help="Définit le fichierxml utilise")
... | agpl-3.0 | -6,761,721,896,002,896,000 | 23.176471 | 102 | 0.6691 | false | 2.595789 | false | false | false |
guyrt/court-reminder | server/admin_app.py | 1 | 1277 | """
Flask Admin App
"""
import os
from flask import Flask, flash, render_template, request
from flask_admin import Admin
from flask_basicauth import BasicAuth
from azure.storage.blob import BlockBlobService, ContentSettings
from storage.models import Database
from storage.secrets import blob_key, blob_accountname, b... | mit | -6,595,723,578,014,805,000 | 28.697674 | 84 | 0.703994 | false | 3.405333 | false | false | false |
jantaylor/road-home-time-tracker | timetracker/models.py | 1 | 3525 | from django.db import models
from django.contrib import admin
from django.db.models import signals
class Volunteer(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
email = models.EmailField(max_length=254, unique=True)
is_group = models.BooleanFie... | mit | -9,162,268,426,743,387,000 | 36.5 | 114 | 0.670355 | false | 3.726216 | false | false | false |
SeungGiJeong/SK_FastIR | dump/mbr.py | 1 | 6740 | from construct import *
from distorm3 import Decode, Decode16Bits
import hexdump
import os
class Mbr:
def __init__(self, path):
self.mbrHexa = ""
self.mbrStruct = ""
self.bootloaderCode = ""
self.offset = 0
self.partition = {"name": []}
self.signature = ""
s... | gpl-3.0 | 5,784,401,525,415,355,000 | 49.676692 | 100 | 0.327448 | false | 4.970501 | false | false | false |
caderache2014/django-rest-tutorial | tutorial/tutorial/settings.py | 1 | 2075 | """
Django settings for tutorial 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, ...)
i... | mit | -1,510,887,145,338,488,600 | 22.590909 | 71 | 0.697831 | false | 3.330658 | false | false | false |
beiko-lab/gengis | bin/Lib/site-packages/scipy/optimize/tests/test_regression.py | 1 | 1237 | """Regression tests for optimize.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_almost_equal, \
assert_raises
import scipy.optimize
class TestRegression(TestCase):
def test_newton_x0_is... | gpl-3.0 | 797,545,178,663,493,000 | 25.488889 | 76 | 0.515764 | false | 3.817901 | true | false | false |
chrisrink10/mumpy | mumpy/interpreter.py | 1 | 5105 | """MUMPy Interpreter
The functions in this module represent various functions that may need
to be carried out from the command line (including starting the REPL
and compiling and executing a routine file).
Licensed under a BSD license. See LICENSE for more information.
Author: Christopher Rink"""
try:
# Used by ... | bsd-3-clause | -7,555,515,970,046,993,000 | 32.149351 | 80 | 0.543389 | false | 4.541815 | false | false | false |
Kozea/pygal | pygal/graph/xy.py | 1 | 4016 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2016 Kozea
#
# 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... | lgpl-3.0 | -429,799,592,630,257,700 | 29.648855 | 79 | 0.537983 | false | 4.039235 | false | false | false |
matichorvat/pydmrs | dmrs_preprocess/label.py | 1 | 4339 |
def create_label(dmrs_xml, carg_clean=False):
"""
Create an identifying label attribute for each node and link,
consisting of its arguments and properties.
:param dmrs_xml: Input DMRS XML
:return: Modified DMRS XML
"""
for entity in dmrs_xml:
if entity.tag == 'node':
... | mit | -1,478,493,958,019,896,300 | 29.342657 | 97 | 0.558424 | false | 3.536267 | false | false | false |
jonaustin/advisoryscan | django/django/middleware/cache.py | 1 | 4057 | from django.conf import settings
from django.core.cache import cache
from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers
class CacheMiddleware(object):
"""
Cache middleware. If this is enabled, each Django-powered page will be
cached for CACHE_MIDDLEWARE_SECONDS seconds. C... | mit | 901,742,829,478,083,500 | 47.297619 | 301 | 0.685975 | false | 4.438731 | false | false | false |
ostrokach/biskit | scripts/Mod/align.py | 1 | 4218 | #!/usr/bin/env python
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2012 Raik Gruenberg & Johan Leckner
##
## 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 Softwar... | gpl-3.0 | 5,412,043,434,244,115,000 | 31.446154 | 83 | 0.627786 | false | 3.671018 | false | false | false |
sopython/kesh | kesh/_database/creation/create_post_history.py | 1 | 1880 | from pymongo import MongoClient
from lxml import etree
from dateutil.parser import parse
import pickle
from time import gmtime, strftime
import os
import re
data_dir = '../../../bin/so_data_/'
file_name = 'PostHistory.xml'
db_name = 'kesh'
coll_name = 'post_history'
client = MongoClient()
db = client[db_name]
coll =... | bsd-3-clause | -2,257,058,302,008,041,500 | 27.923077 | 74 | 0.551064 | false | 3.047002 | false | false | false |
lsbardel/python-stdnet | tests/all/query/related.py | 1 | 6409 | import datetime
from random import randint, uniform
from stdnet.utils import test
from examples.models import Node, Role, Profile, Dictionary
from examples.data import FinanceTest, Position, Instrument, Fund
def create(cls, root=None, nesting=None):
models = cls.mapper
if root is None:
with models.s... | bsd-3-clause | -5,532,104,236,342,709,000 | 36.7 | 90 | 0.591512 | false | 4.040984 | true | false | false |
nijel/weblate | setup.py | 1 | 5078 | #!/usr/bin/env python3
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eithe... | gpl-3.0 | 7,299,572,486,727,412,000 | 34.229167 | 86 | 0.650108 | false | 3.831571 | false | false | false |
michael-hart/tactile_tablet | src/tablet.py | 1 | 1195 | # File created 26/01/2015
# Contains main method to write Braille output to a tablet
# Pins are [12, 16, 18, 22, 24, 26] in GPIO.BOARD mode
import RPi.GPIO as GPIO
import time
import atexit
from braille_converter import convert_string
from braille_dict import braille_dict as bdict
led_pins = [12, 16, 18, 22, 24, 26]... | gpl-2.0 | -7,119,182,581,759,252,000 | 22.431373 | 105 | 0.687029 | false | 2.94335 | false | false | false |
zmr/namsel | edit_distance_tests/generate_accuracy_report.py | 1 | 5481 | #encoding: utf-8
import os
import sys
import glob
import re
import codecs
from difflib import HtmlDiff
from recognize import run_main
import Levenshtein as L
import requests
import datetime
import multiprocessing
from config_manager import Config, run_all_confs_for_page
LOGIN_URL = 'https://dhattupages.appspot.com/a... | mit | 8,027,859,567,957,796,000 | 31.903614 | 129 | 0.564366 | false | 3.171312 | false | false | false |
rafin/Spotify-Visualizations | engine/views.py | 1 | 3163 | from django.http import JsonResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.core.urlresolvers import reverse
from urllib import unquote
#spotify tools
from spot import pl
from spot import keys
import json
from json import loads as dict #converts json back to dictionary
#ge... | mit | -6,362,495,189,862,798,000 | 33.010753 | 97 | 0.654758 | false | 3.690782 | false | false | false |
trthanhquang/bus-assistant | webApp/getBusTiming.py | 1 | 2827 | #!/usr/bin/env python
import urllib2
from bs4 import BeautifulSoup as BS
import re
import time
def getAgenciesList():
agenciesList_req = urllib2.Request('''http://services.my511.org/Transit2.0/GetAgencies.aspx?token=aeeb38de-5385-482a-abde-692dfb2769e3''')
xml_resp = urllib2.urlopen(agenciesList_req)
soup = BS(xm... | mit | 6,510,849,392,254,107,000 | 27 | 139 | 0.694022 | false | 2.664467 | false | false | false |
NYUEcon/NYUecondata | psid/psid.py | 1 | 12753 | """
Working with PSID in python
@author : Spencer Lyon <spencer.lyon@stern.nyu.edu>
@date : 2015-02-04 09:02:56
use the read_csv option `usecols` to only keep what we need
"""
import re
import os
import gc
import os.path
import zipfile
import requests
import lxml.html
import numpy as np
import pandas as pd
# ----... | mit | -7,739,318,489,776,719,000 | 28.183066 | 78 | 0.57312 | false | 3.605598 | false | false | false |
odoo-brazil/PySPED | pysped/cte/leiaute/consrecicte_300.py | 1 | 8951 | # -*- coding: utf-8 -*-
from pysped.xml_sped import *
from pysped.cte.leiaute import ESQUEMA_ATUAL_VERSAO_300 as ESQUEMA_ATUAL
import os
from .cte_300 import CTe
DIRNAME = os.path.dirname(__file__)
class ConsReciCTe(XMLNFe):
def __init__(self):
super(ConsReciCTe, self).__init__()
self.versao = ... | lgpl-2.1 | 8,531,728,794,076,872,000 | 40.985915 | 180 | 0.587499 | false | 2.901687 | false | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher.py | 1 | 2066 | # 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 ... | mit | 8,103,589,322,604,929,000 | 34.016949 | 85 | 0.575508 | false | 4.148594 | false | false | false |
RichardLMR/xls2txtISA.NANO.archive | xls2txtISA.NANO.archive.py | 1 | 9430 | '''
xls2txtISA.NANO.archive.py
***********************
The research leading to the development of this program has received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement number 309837 (NanoPUZZLES project).
http://wwww.nanopuzzles.eu
************************
######... | gpl-2.0 | -1,746,001,864,893,949,200 | 37.178138 | 259 | 0.714952 | false | 3.24055 | false | false | false |
rmelo19/rmelo19-arduino | fritzing/fritzing.0.9.2b.64.pc/parts/part-gen-scripts/misc_scripts/findfonts.py | 1 | 2245 | # usage:
# findfonts.py -d <directory> -f [font1] -f [font2] ....
#
# <directory> is a folder, with subfolders, containing .svg files. In each svg file in the directory or its children
# look for fonts that aren't in the list
import getopt, sys, os, re
def usage():
print """
usage:
droid.py ... | gpl-3.0 | -7,906,983,742,202,827,000 | 27.782051 | 120 | 0.498441 | false | 3.864028 | false | false | false |
peterheim1/robbie_ros | robbie_moveit/nodes/pick_test1.py | 1 | 4531 | #!/usr/bin/env python
import sys
import rospy
from moveit_commander import RobotCommander, MoveGroupCommander
from moveit_commander import PlanningSceneInterface, roscpp_initialize, roscpp_shutdown
from geometry_msgs.msg import PoseStamped
from moveit_msgs.msg import Grasp, GripperTranslation, PlaceLocation
from traj... | bsd-3-clause | -1,146,657,331,692,744,300 | 27.859873 | 87 | 0.651291 | false | 2.876825 | false | false | false |
plaes/numpy | numpy/core/code_generators/genapi.py | 1 | 15403 | """
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
try:
import hashlib
md5new = hashlib.md5
except ImportError:
import md5
md5new = md5.new
if sys.vers... | bsd-3-clause | 8,382,274,081,688,541,000 | 31.427368 | 81 | 0.510355 | false | 3.890629 | false | false | false |
skysports-digitalmedia/php-buildpack | tests/test_compile_helpers.py | 1 | 15810 | import os
import os.path
import tempfile
import shutil
from nose.tools import eq_
from build_pack_utils import utils
from compile_helpers import setup_webdir_if_it_doesnt_exist
from compile_helpers import convert_php_extensions
from compile_helpers import is_web_app
from compile_helpers import find_stand_alone_app_to_r... | apache-2.0 | 2,697,824,671,140,327,000 | 42.315068 | 76 | 0.569892 | false | 3.308916 | true | false | false |
soarpenguin/python-scripts | terminal.py | 1 | 1467 | #!/usr/bin/env python
import os
def clrscr():
""" Clear screen and move cursor to 1,1 (upper left) pos. """
print '\033[2J\033[1;1H'
def clreol():
""" Erases from the current cursor position to the end of the current line. """
print '\033[K'
def delline():
""" Erases the entire current line. """
... | gpl-3.0 | 4,358,864,761,990,705,700 | 30.891304 | 83 | 0.498978 | false | 3.6675 | false | false | false |
gelbander/retain24wrapper | retain24wrapper/retain24wrapper.py | 1 | 5339 | # -*- coding: utf-8 -*-
import time
from tempfile import NamedTemporaryFile
from xml.etree import cElementTree as ET
from xml.etree.cElementTree import XML
from dicttoxml import dicttoxml
import requests
import xmltodict
ACTIONS = {}
ACTIONS['GET_PROVIDERS'] = {'TA_ACTION': '5-45103'}
ACTIONS['ISSUE'] = {'TA_ACTION... | mit | -3,539,120,547,608,042,500 | 30.222222 | 129 | 0.567335 | false | 3.832735 | false | false | false |
chinfeng/gumpy | huacaya/auth/endpoint.py | 1 | 13593 | # -*- coding: utf-8 -*-
__author__ = 'chinfeng'
import os
import uuid
import json
import datetime
import tornado.web
from tornado.web import HTTPError
from tornado.escape import json_decode
try:
from urllib import urlencode
from urlparse import urlsplit, urlunsplit
except ImportError:
from urllib.parse imp... | lgpl-3.0 | -4,256,504,983,164,449,000 | 39.875758 | 127 | 0.602046 | false | 3.8862 | false | false | false |
provideyourown/SiteMonitoring | memoryusage.py | 1 | 1362 | #!/usr/bin/env python
"""
Display the system memory usage. Can be called on a remote server or use 'local' or 'localhost' for your computer
Usage:
./memoryusage.py MYSERVER
"""
import argparse
import subprocess
def getMemoryUsage(server):
"""
Returns the cpu load as a value from the interval [0.0, 1.0]
... | gpl-3.0 | 2,848,168,859,462,388,700 | 31.428571 | 193 | 0.654185 | false | 3.546875 | false | false | false |
Naeka/vosae-app | www/invoicing/models/payment.py | 1 | 3144 | # -*- coding:Utf-8 -*-
from mongoengine import Document, fields
from django.utils.timezone import now
import decimal
from core.fields import DateField
from invoicing import PAYMENT_TYPES, currency_format
from invoicing.exceptions import (
InvalidPaymentAmount,
)
__all__ = (
'Payment',
'InvoicePayment',
... | agpl-3.0 | -8,912,325,496,183,845,000 | 29.823529 | 100 | 0.66285 | false | 4.295082 | false | false | false |
BTCfork/hardfork_prototype_1_mvf-core | qa/rpc-tests/mvf-core-csig.py | 1 | 9119 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2016 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# MVF-Core
"""
Exercise the signature change (replay protectio... | mit | -2,729,698,025,060,871,000 | 43.26699 | 156 | 0.617173 | false | 3.665193 | true | false | false |
DBeath/flask-feedrsub | feedrsub/utils/feeds/feed_generation.py | 1 | 1207 | from flask import current_app as app
from typing import List, Dict
from flask import url_for
def websub_discovery_link() -> Dict:
"""
Creates a WebSub discovery link
:return: link as dict
"""
hub_enabled = app.config.get("HUB_ENABLED", False)
if hub_enabled:
hub_url = url_for(
... | mit | -544,283,231,300,035,600 | 22.211538 | 83 | 0.59652 | false | 3.668693 | false | false | false |
JonathanFrederick/job-hunt | company_scripts.py | 1 | 1197 | from selenium import webdriver
from companies.red_hat import red_hat
from app import db
from models import Company
def print_result(info):
"""Takes in a dictionary with keys for 'company', 'title', 'url',
and 'description' and prints them neatly to the terminal"""
for key in ['company', 'title', 'url', ... | mit | -6,624,179,340,990,161,000 | 28.195122 | 71 | 0.56391 | false | 4.003344 | false | false | false |
alexismirandan/Edit-image-kivy-app | layout/edit_image_layout.py | 1 | 2428 | # -*- coding: utf-8 -*
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ListProperty, ObjectProperty
from components.touch_selector import TouchSelector
from components.bubble_buttons import BubbleButtons
from layout.image_layout import ImageLayout
from kivy.uix.button import Button
class EditI... | mit | 7,713,281,658,232,743,000 | 43.145455 | 99 | 0.689044 | false | 3.570588 | false | false | false |
botswana-harvard/bcpp-export | bcpp_export/old_export/constants.py | 1 | 1213 | import numpy as np
from edc_constants.constants import (
ALIVE as edc_ALIVE, DEAD as edc_DEAD, YES as edc_YES, NO as edc_NO,
POS as edc_POS, NEG as edc_NEG, IND as edc_IND, UNK as edc_UNK,
NOT_APPLICABLE as edc_NOT_APPLICABLE,
MALE as edc_MALE, FEMALE as edc_FEMALE)
SUBJECT_IDENTIFIER = 'subject_ident... | gpl-2.0 | -9,128,420,541,188,606,000 | 17.104478 | 71 | 0.611707 | false | 2.284369 | false | true | false |
NLeSC/PattyAnalytics | tests/test_utils.py | 1 | 2201 | import os
from tempfile import NamedTemporaryFile
import pcl
import numpy as np
from patty import utils
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_equal, assert_raises
def _compare( pcA, pcB ):
''' compare two pointclouds point-by-point'''
pcA_arr = np.asarray(pcA)
... | apache-2.0 | -6,275,963,288,678,196,000 | 25.518072 | 73 | 0.625625 | false | 3.232012 | true | false | false |
Spotipo/spotipo | tests/core/test_guestutils.py | 1 | 10985 | import sys
import pytest
from flask import current_app,url_for
from flask_wtf import Form
from wtforms import TextField
from faker import Faker
import arrow
import uuid
from unifispot.core.models import Wifisite,Device,Guesttrack,Guest,Loginauth,\
Guestsession
from unifispot.core.g... | agpl-3.0 | -1,459,336,541,446,399,200 | 39.241758 | 146 | 0.640419 | false | 3.644658 | true | false | false |
giovannipro/map-the-glam | scraper/scrape/scrape_image_size-analogic.py | 1 | 9603 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Get data from file page
import os # get file path
import webbrowser # open webpages
import time # get unix code
import datetime # convert in unix timestamp
import urllib, json, io # read json
from urllib import urlopen # open file
import sys # r... | gpl-3.0 | -1,088,663,877,356,968,000 | 26.09322 | 88 | 0.512043 | false | 2.703975 | false | false | false |
tom-mi/pyrad | pyrad/server.py | 1 | 9027 | # server.py
#
# Copyright 2003-2004,2007 Wichert Akkerman <wichert@wiggy.net>
import select
import socket
from pyrad import host
from pyrad import packet
import logging
logger = logging.getLogger('pyrad')
class RemoteHost:
"""Remote RADIUS capable host we can talk to.
"""
def __init__(self, address, s... | bsd-3-clause | -1,549,894,543,043,070,200 | 34.4 | 80 | 0.611056 | false | 4.403415 | false | false | false |
unioslo/cerebrum | contrib/exchange/exchange_group_state_verification.py | 1 | 22909 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... | gpl-2.0 | 7,390,959,573,923,553,000 | 35.713141 | 79 | 0.533677 | false | 4.118102 | true | false | false |
domeger/SplunkTAforPuppetEnterprise | bin/puppet_enterprise_metrics.py | 1 | 4586 | import splunktaforpuppetenterprise_declare
import os
import sys
import time
import datetime
import json
import modinput_wrapper.base_modinput
from solnlib.packages.splunklib import modularinput as smi
import input_module_puppet_enterprise_metrics as input_module
bin_dir = os.path.basename(__file__)
'''
Do no... | apache-2.0 | -8,698,139,154,685,138,000 | 43.960784 | 214 | 0.586786 | false | 4.448109 | false | false | false |
EiNSTeiN-/deluge-gtk3 | deluge/ui/gtkui/edittrackersdialog.py | 1 | 9157 | #
# edittrackersdialog.py
#
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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)
... | gpl-3.0 | -8,834,094,978,799,285,000 | 38.640693 | 106 | 0.624331 | false | 3.787014 | false | false | false |
fsxfreak/club-suite | clubsuite/suite/views/view_budget.py | 1 | 4194 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.views.generic import View
from django.urls import reverse
from django.contrib import messages
from suite.models imp... | mit | -6,044,569,809,767,433,000 | 38.196262 | 94 | 0.610157 | false | 3.971591 | false | false | false |
tarbell-project/tarbell | setup.py | 1 | 2186 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
from tarbell import __VERSION__ as VERSION
APP_NAME = 'tarbell'
settings = dict()
# Publish Helper.
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
settings.upda... | bsd-3-clause | -7,955,737,072,833,608,000 | 30.2 | 339 | 0.619505 | false | 3.477707 | false | true | false |
USGSDenverPychron/pychron | pychron/hardware/pychron_laser.py | 1 | 1127 | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... | apache-2.0 | -491,999,547,571,266,600 | 40.740741 | 81 | 0.539485 | false | 5.053812 | false | false | false |
djmattyg007/bfinterpreter | bfinterpreter.py | 1 | 6325 | #!/usr/bin/python3
class Tape:
'''
A generic implementation of a record tape for a Turing Machine.
It's bounded on the left side and unbounded on the right side.
It stores only Python integers.
'''
def __init__(self):
self.reset()
def inc_val(self):
self.cells[self.pointer... | unlicense | 1,415,792,457,444,116,500 | 28.694836 | 112 | 0.502609 | false | 3.943267 | false | false | false |
eharney/cinder | cinder/cmd/volume_usage_audit.py | 1 | 10138 | #!/usr/bin/env python
# Copyright (c) 2011 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/LICE... | apache-2.0 | -8,139,628,104,453,433,000 | 40.044534 | 78 | 0.577037 | false | 3.890253 | false | false | false |
Davideddu/python-liquidcrystal | setup.py | 1 | 1093 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname), "r") as f:
return f.read()
setup(
name="liquidcrystal",
version="0.1",
author="Davide Depau",
author_email="apps@davideddu.org... | gpl-2.0 | -760,723,976,487,144,700 | 31.147059 | 117 | 0.650503 | false | 3.692568 | false | false | false |
agrover/targetd | targetd/fs.py | 1 | 10302 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 | -551,828,838,198,015,300 | 28.603448 | 79 | 0.584158 | false | 3.411258 | false | false | false |
viranch/exodus | resources/lib/indexers/episodes.py | 1 | 65108 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-3.0 | -4,454,347,603,305,280,000 | 41.526453 | 502 | 0.504408 | false | 3.897516 | false | false | false |
dakrauth/strutil | setup.py | 1 | 1169 | #!/usr/bin/env python
import os, sys
from setuptools import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit(0)
with open('README.rst', 'r') as f:
long_description = f.read()
# Dynamically calculate the version based on swingtime.VERSION.
version = __import__('struti... | mit | -4,161,712,837,771,272,700 | 30.594595 | 89 | 0.63302 | false | 3.962712 | false | false | false |
gabstopper/smc-python | smc/elements/profiles.py | 1 | 9278 | """
Profiles are templates used in other parts of the system to provide default
functionality for specific feature sets. For example, to enable DNS Relay on
an engine you must specify a DNSRelayProfile to use which defines the common
settings (or sub-settings) for that feature.
A DNS Relay Profile allows multiple DNS... | apache-2.0 | -6,040,503,220,421,455,000 | 32.861314 | 117 | 0.613171 | false | 4.223031 | false | false | false |
unicef/rhizome | rhizome/api/resources/source_submission.py | 1 | 1345 | from rhizome.api.resources.base_model import BaseModelResource
from rhizome.models.document_models import SourceSubmission
class SourceSubmissionResource(BaseModelResource):
'''
**GET Request** Returns all SourceSubmissions unless an optional parameter is specified
- *Optional Parameters:*
... | agpl-3.0 | 15,860,401,860,111,412 | 39.757576 | 93 | 0.657993 | false | 4.453642 | false | false | false |
Eksmo/calibre | src/calibre/gui2/preferences/search_ui.py | 1 | 13356 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/preferences/search.ui'
#
# Created: Thu Jul 19 23:32:29 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_... | gpl-3.0 | 2,683,885,192,424,116,700 | 63.834951 | 320 | 0.699386 | false | 3.60973 | false | false | false |
RobRuana/sideboard | sideboard/internal/logging.py | 1 | 1819 | from __future__ import unicode_literals, absolute_import
import os
import logging.config
import logging_unterpolation
from sideboard.config import config
class IndentMultilinesLogFormatter(logging.Formatter):
"""
Provide a formatter (unused by default) which adds indentation to messages
which are split ... | bsd-3-clause | -6,979,212,933,264,625,000 | 35.38 | 106 | 0.59978 | false | 4.558897 | true | false | false |
jolyonb/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py | 1 | 2916 | """
Tests for helpers.py
"""
from __future__ import absolute_import
import datetime
import hashlib
from django.test import TestCase
from mock import patch
from pytz import UTC
from openedx.core.djangolib.testing.utils import skip_unless_lms
from student.tests.factories import UserFactory
from ..image_helpers import... | agpl-3.0 | -586,315,608,555,252,000 | 34.560976 | 114 | 0.641632 | false | 3.762581 | true | false | false |
MarkusHackspacher/unknown-horizons | horizons/world/buildability/potentialroadconnectivitycache.py | 1 | 3725 | # ###################################################
# Copyright (C) 2008-2017 The Unknown Horizons Team
# team@unknown-horizons.org
# This file is part of Unknown Horizons.
#
# Unknown Horizons is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | gpl-2.0 | -8,918,137,794,307,005,000 | 37.010204 | 86 | 0.713826 | false | 3.527462 | false | false | false |
beeftornado/sentry | src/sentry/integrations/msteams/utils.py | 1 | 3654 | from __future__ import absolute_import
import six
import logging
import enum
from django.http import Http404
from sentry.models import (
Integration,
Organization,
IdentityProvider,
)
from sentry.shared_integrations.exceptions import ApiError
from sentry.utils.compat import filter
from .client import Ms... | bsd-3-clause | 6,982,754,459,844,222,000 | 29.966102 | 95 | 0.688013 | false | 3.883103 | false | false | false |
shnergle/ShnergleServer | api/util.py | 1 | 5137 | import calendar
import datetime
import functools
import json
import os
import time
import cherrypy
import pyodbc
def connect(thread_index):
cherrypy.thread_data.db = pyodbc.connect(os.environ['DATABASE'])
current_dir = os.path.dirname(os.path.abspath(__file__))
cherrypy.thread_data.placeholder_image = op... | mit | 8,012,379,061,196,236,000 | 30.133333 | 108 | 0.512167 | false | 3.819331 | false | false | false |
WheatonCS/Lexos | lexos/receivers/rolling_window_receiver.py | 1 | 7808 | """This is the receiver for rolling windows analysis model."""
import pandas as pd
from enum import Enum
from typing import NamedTuple, Optional, List
from lexos.receivers.base_receiver import BaseReceiver
from lexos.managers.utility import load_file_manager
class RWATokenType(Enum):
"""This type specify what ki... | mit | 428,797,673,821,050,750 | 34.981567 | 78 | 0.615907 | false | 4.053998 | false | false | false |
alexandresobolevski/yahoo_ff | yahoo_ff/tools/scrapingTools.py | 1 | 2687 | from urllib.request import urlopen
import time
import numpy as np
BASE_URL = 'https://ca.finance.yahoo.com/'
powers = {'%': 10 ** (-2), 'M': 10 ** 6, 'B': 10 ** 9, 'T': 10 ** 12}
def getUnixTime (dateTime):
return int(time.mktime(dateTime.timetuple()))
def parse_powers(x):
power = x[-1]
if (power in pow... | mit | 3,454,508,166,530,037,000 | 29.885057 | 123 | 0.599181 | false | 3.036158 | false | false | false |
totoro-zhang/hello-word | spider/distributespider/myfirstSpider_URLManager.py | 1 | 2465 | #coding:utf-8
import _compat_pickle
import hashlib
class UrlManager(object):
def __init__(self):
#self.new_urls = set()
#self.old_urls = set()
self.new_urls = self.load_progress('new_urls.txt')#未爬取的url集合
self.old_urls = self.load_progress('old_urls.txt')#已爬取的URL集合
def ... | unlicense | -7,736,062,366,020,673,000 | 22.833333 | 69 | 0.46264 | false | 2.983979 | false | false | false |
Azure/azure-sdk-for-python | sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/aio/operations/_operation_status_operations.py | 1 | 5447 | # 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 | 5,413,257,254,874,317,000 | 48.072072 | 217 | 0.665504 | false | 4.4141 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.