hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
584b6938b21baa80544be5899accf3e8f5524589 | 218 | py | Python | Modulo 3/HelloWorld.py | antonio343/clase | fda04a606246695aa5d93c8b2b5e2890a16d5973 | [
"MIT"
] | null | null | null | Modulo 3/HelloWorld.py | antonio343/clase | fda04a606246695aa5d93c8b2b5e2890a16d5973 | [
"MIT"
] | null | null | null | Modulo 3/HelloWorld.py | antonio343/clase | fda04a606246695aa5d93c8b2b5e2890a16d5973 | [
"MIT"
] | null | null | null | import sys
print("Hello world, I am",sys.executable, sys.version)
x=input("Dame un numero mayor que cero: ")
x = int(x)
if x < 0:
print('Negative changed to zero')
x = 0
print(f"El valor final de x es: {x}") | 19.818182 | 54 | 0.646789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 108 | 0.495413 |
584b955b3560453b5439bd686f05b35e554caf34 | 436 | py | Python | rasiberryPiGPIOBaseController/driver/test.py | onwebbe/rasiberryPiBaseController | bdb81cb5a0e62414fa091635a83db799017249e7 | [
"MIT"
] | null | null | null | rasiberryPiGPIOBaseController/driver/test.py | onwebbe/rasiberryPiBaseController | bdb81cb5a0e62414fa091635a83db799017249e7 | [
"MIT"
] | null | null | null | rasiberryPiGPIOBaseController/driver/test.py | onwebbe/rasiberryPiBaseController | bdb81cb5a0e62414fa091635a83db799017249e7 | [
"MIT"
] | null | null | null | def convertToHEXForChar(charList):
convertedCharList = []
for message in charList:
convertedCharList.append(ord(message))
return convertedCharList
def displayChar(line, *args):
concatedList = []
for argItem in args:
concatedList.extend(argItem)
print(len(concatedList))
for message in c... | 22.947368 | 63 | 0.713303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 0.036697 |
584bc0b37c22b1a874521a0f4acbe34fb62b2cde | 17,670 | py | Python | Acquire/Client/_user.py | michellab/BioSimSpaceCloud | 456b146a2131565e354352872d3e75a08c3652d1 | [
"Apache-2.0"
] | 2 | 2019-02-15T16:04:19.000Z | 2019-02-19T15:42:27.000Z | Acquire/Client/_user.py | michellab/BioSimSpaceCloud | 456b146a2131565e354352872d3e75a08c3652d1 | [
"Apache-2.0"
] | null | null | null | Acquire/Client/_user.py | michellab/BioSimSpaceCloud | 456b146a2131565e354352872d3e75a08c3652d1 | [
"Apache-2.0"
] | null | null | null |
import os as _os
from enum import Enum as _Enum
from datetime import datetime as _datetime
import time as _time
from Acquire.Service import call_function as _call_function
from Acquire.Service import Service as _Service
from Acquire.ObjectStore import bytes_to_string as _bytes_to_string
from Acquire.ObjectStore im... | 32.244526 | 79 | 0.590323 | 14,177 | 0.80232 | 0 | 0 | 0 | 0 | 0 | 0 | 5,409 | 0.306112 |
584c241bf384f1ee86da8eb49a7b42c532f3a92a | 8,007 | py | Python | botasky/utils/MyMAIL.py | 5atouristspot/sql_audit | 54c6d5ac9f8178ab1a17b7ff2d04ff738f14e0b7 | [
"MIT"
] | null | null | null | botasky/utils/MyMAIL.py | 5atouristspot/sql_audit | 54c6d5ac9f8178ab1a17b7ff2d04ff738f14e0b7 | [
"MIT"
] | null | null | null | botasky/utils/MyMAIL.py | 5atouristspot/sql_audit | 54c6d5ac9f8178ab1a17b7ff2d04ff738f14e0b7 | [
"MIT"
] | null | null | null | #! /usr/bin/python2.7
# -*- coding: utf-8 -*-
"""
Created on 2017-4-06
@module: MyMAIL
@used: send mail
"""
import smtplib
import mimetypes
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
from MyLOG import MyLog
from bot... | 36.729358 | 114 | 0.429374 | 6,562 | 0.819533 | 0 | 0 | 0 | 0 | 0 | 0 | 2,737 | 0.341826 |
584dcc24968eeec28c6969e280feb5d4d108b6e6 | 7,694 | py | Python | db_adapter/curw_fcst/source/source_utils.py | CUrW-SL/curw_db_adapter | 9d9ef24f42080910e0bd251bc7f001b0a4b0ab31 | [
"MIT"
] | 2 | 2019-04-26T07:50:33.000Z | 2019-09-28T20:15:33.000Z | db_adapter/curw_fcst/source/source_utils.py | CUrW-SL/curw_db_adapter | 9d9ef24f42080910e0bd251bc7f001b0a4b0ab31 | [
"MIT"
] | 1 | 2019-04-03T09:30:38.000Z | 2019-04-20T18:11:59.000Z | db_adapter/curw_fcst/source/source_utils.py | shadhini/curw_db_adapter | 4db8e1ea8794ffbd0dce29ac954a13315e83d843 | [
"MIT"
] | null | null | null | import json
import traceback
from db_adapter.exceptions import DatabaseAdapterError
from db_adapter.logger import logger
"""
Source JSON Object would looks like this
e.g.:
{
'model' : 'wrfSE',
'version' : 'v3',
'parameters': { }
}
{
'model' : 'OBS_WATER_LEVEL',
... | 32.601695 | 127 | 0.583442 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,324 | 0.432025 |
584f6d166970adb6f3793037f401b85f026ce2ab | 511 | py | Python | tests/kyu_7_tests/test_binary_addition.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/kyu_7_tests/test_binary_addition.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/kyu_7_tests/test_binary_addition.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.kyu_7.binary_addition import add_binary
class AddBinaryTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(add_binary(1, 1), '10')
def test_equals_2(self):
self.assertEqual(add_binary(0, 1), '1')
def test_equals_3(self):
self.assertEqu... | 24.333333 | 54 | 0.675147 | 440 | 0.861057 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.04501 |
584ff888d14bb4a1085d283e99cd26c1976fee31 | 739 | py | Python | var/spack/repos/builtin/packages/netdata/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/netdata/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/netdata/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Netdata(AutotoolsPackage):
"""Real-time performance monitoring, done right!"""
homepa... | 32.130435 | 96 | 0.70636 | 518 | 0.700947 | 0 | 0 | 0 | 0 | 0 | 0 | 479 | 0.648173 |
5850feed17b8dae7b2795290112a605c61fbeef1 | 1,727 | py | Python | examples/my_quickstart.py | 87boy/sisu | 823d12c9a8126ab41bb14b6d91cad9acbb95bc47 | [
"Apache-2.0"
] | null | null | null | examples/my_quickstart.py | 87boy/sisu | 823d12c9a8126ab41bb14b6d91cad9acbb95bc47 | [
"Apache-2.0"
] | null | null | null | examples/my_quickstart.py | 87boy/sisu | 823d12c9a8126ab41bb14b6d91cad9acbb95bc47 | [
"Apache-2.0"
] | null | null | null | import flask
import flask.ext.sqlalchemy
import flask.ext.restless
# Create the Flask application and the Flask-SQLAlchemy object.
app = flask.Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = flask.ext.sqlalchemy.SQLAlchemy(app)
# Create your Flask-SQLAL... | 35.244898 | 76 | 0.711639 | 561 | 0.324841 | 0 | 0 | 0 | 0 | 0 | 0 | 827 | 0.478865 |
5853ac3ad2b07e0bcfbda162b15356c29c25cefe | 4,687 | py | Python | src/crypto_wallet/crypto_wallet.py | Sedosa/Blockchain-Analytics | a09de9cfd308c70e38a05d4127fb372af5b919b7 | [
"MIT"
] | null | null | null | src/crypto_wallet/crypto_wallet.py | Sedosa/Blockchain-Analytics | a09de9cfd308c70e38a05d4127fb372af5b919b7 | [
"MIT"
] | null | null | null | src/crypto_wallet/crypto_wallet.py | Sedosa/Blockchain-Analytics | a09de9cfd308c70e38a05d4127fb372af5b919b7 | [
"MIT"
] | null | null | null | """
This is a script that takes a calculates the value of a cryptocurrency portfolio
It uses JSON in the with quantities of different cryptocurrencies in the form
{
"ticker" : volume,
"ticker" : volume
}
gets the live price from an API endpoint and returns the price of each item in the portfolio and the total... | 26.480226 | 123 | 0.631961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,696 | 0.574963 |
5853d100285433e6202ec4adff867b94b7270769 | 1,685 | py | Python | np43s.py | Muraru-taketa/100_knocks | d34c0157d15a0fda45ac60e41e93bd6b73cebb58 | [
"MIT"
] | null | null | null | np43s.py | Muraru-taketa/100_knocks | d34c0157d15a0fda45ac60e41e93bd6b73cebb58 | [
"MIT"
] | null | null | null | np43s.py | Muraru-taketa/100_knocks | d34c0157d15a0fda45ac60e41e93bd6b73cebb58 | [
"MIT"
] | null | null | null | #np43.py
#43. 名詞を含む文節が動詞を含む文節に係るものを抽出
"""名詞を含む文節が,動詞を含む文節に係るとき,
これらをタブ区切り形式で抽出せよ.ただし,句読点などの記号は出力しないようにせよ.
"""
import re
# 区切り文字
separator = re.compile('\t|,')
# かかりうけ
kakari = re.compile(r'''(?:\*\s\d+\s) # キャプチャ対象外
(-?\d+) # 数字(係り先)
''', re.VERBOSE)
class M... | 30.636364 | 113 | 0.619585 | 630 | 0.295636 | 0 | 0 | 0 | 0 | 0 | 0 | 884 | 0.414829 |
585453c1a7dceaddf108fc0199e9890c1f5860d6 | 4,026 | py | Python | backend/presentation/Viewsets/comment_view.py | Weida-W/CMPUT404-project-socialdistribution | 41d8a7f7f013723d2a3878156953fbc11c2e6156 | [
"W3C-20150513"
] | null | null | null | backend/presentation/Viewsets/comment_view.py | Weida-W/CMPUT404-project-socialdistribution | 41d8a7f7f013723d2a3878156953fbc11c2e6156 | [
"W3C-20150513"
] | 75 | 2021-01-13T23:48:48.000Z | 2021-04-16T19:39:38.000Z | backend/presentation/Viewsets/comment_view.py | Weida-W/CMPUT404-project-socialdistribution | 41d8a7f7f013723d2a3878156953fbc11c2e6156 | [
"W3C-20150513"
] | 12 | 2021-01-13T23:22:35.000Z | 2021-04-28T08:13:38.000Z | from presentation.models import Author, Follower, Post, Comment
from django.shortcuts import get_object_or_404
from presentation.Serializers.comment_serializer import CommentSerializer
from rest_framework import viewsets, status
from django.http import JsonResponse
from rest_framework.response import Response
import uu... | 37.981132 | 115 | 0.655986 | 3,093 | 0.766733 | 0 | 0 | 0 | 0 | 0 | 0 | 799 | 0.198066 |
5854bedf049dafa402041ca2798dee49d6f30c6d | 11,520 | py | Python | bundle/vim-pandoc-master/python3/vim_pandoc/command.py | ian-mitchell-001/my-vim-configs | 198747234df311179185ce9fb8424bb1c1c64771 | [
"Unlicense"
] | null | null | null | bundle/vim-pandoc-master/python3/vim_pandoc/command.py | ian-mitchell-001/my-vim-configs | 198747234df311179185ce9fb8424bb1c1c64771 | [
"Unlicense"
] | null | null | null | bundle/vim-pandoc-master/python3/vim_pandoc/command.py | ian-mitchell-001/my-vim-configs | 198747234df311179185ce9fb8424bb1c1c64771 | [
"Unlicense"
] | null | null | null | # encoding=utf-8
import vim
import re
import sys
import os.path
import argparse
import shlex
from subprocess import Popen, PIPE
from itertools import chain
from vim_pandoc.utils import plugin_enabled_modules, ensure_string
from vim_pandoc.bib.vim_completer import find_bibfiles
from vim_pandoc.helpparser import PandocI... | 44.307692 | 118 | 0.521354 | 11,168 | 0.969444 | 0 | 0 | 0 | 0 | 0 | 0 | 3,163 | 0.274566 |
58560f5398484c07794db5199083195112cafef3 | 10,955 | py | Python | databricks/koalas/strings.py | mercileesb/koalas | 685176c512f31166f0e472aa0f461d0f1449fb0c | [
"Apache-2.0"
] | 1 | 2021-01-17T18:26:33.000Z | 2021-01-17T18:26:33.000Z | databricks/koalas/strings.py | mercileesb/koalas | 685176c512f31166f0e472aa0f461d0f1449fb0c | [
"Apache-2.0"
] | null | null | null | databricks/koalas/strings.py | mercileesb/koalas | 685176c512f31166f0e472aa0f461d0f1449fb0c | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2019 Databricks, 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 to i... | 31.033994 | 76 | 0.583204 | 10,089 | 0.920949 | 0 | 0 | 0 | 0 | 0 | 0 | 6,762 | 0.617252 |
585693264a6958d193fa10022658456c7350638b | 807 | py | Python | python/turbodbc_test/test_cursor_async_io.py | fjetter/turbodbc | b11f0a1bc7d67bc3cbc60f564594f0e735f524f4 | [
"MIT"
] | null | null | null | python/turbodbc_test/test_cursor_async_io.py | fjetter/turbodbc | b11f0a1bc7d67bc3cbc60f564594f0e735f524f4 | [
"MIT"
] | null | null | null | python/turbodbc_test/test_cursor_async_io.py | fjetter/turbodbc | b11f0a1bc7d67bc3cbc60f564594f0e735f524f4 | [
"MIT"
] | null | null | null | import pytest
import six
from turbodbc import connect
from query_fixture import query_fixture
from helpers import for_one_database, open_cursor
@for_one_database
def test_many_batches_with_async_io(dsn, configuration):
with open_cursor(configuration, use_async_io=True) as cursor:
with query_fixture(curs... | 36.681818 | 84 | 0.629492 | 0 | 0 | 0 | 0 | 658 | 0.815366 | 0 | 0 | 112 | 0.138786 |
5856c891983edcd6b2efc2d720455bfccf0cdf79 | 1,491 | py | Python | llist_gameboard/urls.py | Plongesam/data-structures-game | a47c849ea97763eff1005273a58aa3d8ab663ff2 | [
"Apache-2.0"
] | 2 | 2021-03-02T20:06:34.000Z | 2021-03-31T02:51:35.000Z | llist_gameboard/urls.py | Plongesam/data-structures-game | a47c849ea97763eff1005273a58aa3d8ab663ff2 | [
"Apache-2.0"
] | 68 | 2021-03-02T20:20:21.000Z | 2021-05-13T02:21:57.000Z | llist_gameboard/urls.py | Plongesam/data-structures-game | a47c849ea97763eff1005273a58aa3d8ab663ff2 | [
"Apache-2.0"
] | null | null | null | """
URL's for the LList Game Board app.
"""
from django.urls import path
from llist_gameboard.api import llist_api
from . import views
urlpatterns = [
# Views
path('', views.llist_game_board, name='llist-game-board'),
#Game Play API Calls For Linked List
path('llist_api', llist_api.api_overview,... | 59.64 | 147 | 0.733736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 923 | 0.619048 |
5857c8cf49629013e2ff3dd558ee69aaefccf283 | 208 | py | Python | tests/test_most_invoices.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | tests/test_most_invoices.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | tests/test_most_invoices.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | from src import most_invoices
EXPECTED_RESULT = (14, 'Berlin')
def test_most_invoices() -> None:
tested_result = most_invoices.get_city_with_most_invoices()
assert tested_result == EXPECTED_RESULT
| 23.111111 | 63 | 0.774038 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.038462 |
58593da1cc559e0383548c77af9516f78e6dbe07 | 8,223 | py | Python | VIP_modules/widgets/ResultCanvas_QTAgg.py | Nikolaj-K/lab-control-GUI | 3c7811de57f110870cf4740743fd84b76d918ad3 | [
"MIT"
] | 17 | 2017-05-24T13:31:31.000Z | 2021-12-04T22:47:33.000Z | VIP_modules/widgets/ResultCanvas_QTAgg.py | Nikolaj-K/lab-control-GUI | 3c7811de57f110870cf4740743fd84b76d918ad3 | [
"MIT"
] | null | null | null | VIP_modules/widgets/ResultCanvas_QTAgg.py | Nikolaj-K/lab-control-GUI | 3c7811de57f110870cf4740743fd84b76d918ad3 | [
"MIT"
] | 6 | 2017-11-21T01:32:33.000Z | 2020-12-15T05:28:17.000Z | import random
import numpy as np
import operator
from scipy import optimize
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
from matplotlib.figure import Figure as MatplotlibFigure
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm as color_map
from matplotlib.ticker import Lin... | 46.721591 | 147 | 0.531558 | 7,479 | 0.909522 | 0 | 0 | 0 | 0 | 0 | 0 | 1,932 | 0.234951 |
585a68e41b2ee9276af7dd0a8f001bc6f258c0ac | 4,538 | py | Python | data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_kruskal.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_kruskal.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_kruskal.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | #!/usr/bin/env python
# Given weighted graph, perform kruskal-based clustering
from common import *
from cluster_common import *
import argparse
import csv
import pickle as pickle
from collections import defaultdict
class unionfind:
mp = {}
blacklisted_edges = set()
# blacklisted_e_nodes = set()
# bla... | 29.855263 | 133 | 0.642794 | 1,252 | 0.275892 | 0 | 0 | 0 | 0 | 0 | 0 | 841 | 0.185324 |
585b50403351ad785a902fa91bf54e0474f5e68a | 4,019 | py | Python | third_party/gsutil/oauth2_plugin/oauth2_helper.py | bdero/depot_tools | 685577439cbf9cb8c660e3da39bdcbb64c197c95 | [
"BSD-3-Clause"
] | 20 | 2015-12-07T06:08:27.000Z | 2021-11-08T11:06:18.000Z | third_party/gsutil/oauth2_plugin/oauth2_helper.py | bdero/depot_tools | 685577439cbf9cb8c660e3da39bdcbb64c197c95 | [
"BSD-3-Clause"
] | 1 | 2019-01-14T00:36:35.000Z | 2019-01-14T00:36:35.000Z | third_party/gsutil/oauth2_plugin/oauth2_helper.py | bdero/depot_tools | 685577439cbf9cb8c660e3da39bdcbb64c197c95 | [
"BSD-3-Clause"
] | 23 | 2015-05-05T08:22:59.000Z | 2021-11-10T06:24:46.000Z | # Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.644231 | 91 | 0.736502 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,927 | 0.479473 |
585b570f1181a34255df0bd7a81ffc1c67034916 | 5,311 | py | Python | csl-tracking-dependents.py | Marcool04/utilities | d9bf0aae7decdad111fc0c8cefacf10c230ce9ee | [
"MIT"
] | 10 | 2015-04-14T16:49:43.000Z | 2020-06-01T14:31:04.000Z | csl-tracking-dependents.py | Marcool04/utilities | d9bf0aae7decdad111fc0c8cefacf10c230ce9ee | [
"MIT"
] | 23 | 2015-01-20T04:13:35.000Z | 2021-09-07T18:36:00.000Z | csl-tracking-dependents.py | Marcool04/utilities | d9bf0aae7decdad111fc0c8cefacf10c230ce9ee | [
"MIT"
] | 6 | 2015-01-10T13:00:37.000Z | 2021-09-19T09:25:22.000Z | # -*- coding: utf-8 -*-
# Python script to manage automatically generated dependents
# Author: Rintze M. Zelle
# Version: 2014-04-17
# * Requires lxml library (http://lxml.de/)
import os, glob, re, inspect, shutil
from lxml import etree
# http://stackoverflow.com/questions/50499
folderPath = os.path.dirname(os.path.... | 44.630252 | 148 | 0.656562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,147 | 0.592544 |
585f06a860286b312d33973ef25ef2866dfc0808 | 642 | py | Python | selenium_browser/__resources/constants.py | kkristof200/selenium_browser | b8144fe935073367911e90b50f078bfa985d6c0f | [
"MIT"
] | 1 | 2021-06-25T06:55:43.000Z | 2021-06-25T06:55:43.000Z | selenium_browser/__resources/constants.py | kkristof200/selenium_browser | b8144fe935073367911e90b50f078bfa985d6c0f | [
"MIT"
] | null | null | null | selenium_browser/__resources/constants.py | kkristof200/selenium_browser | b8144fe935073367911e90b50f078bfa985d6c0f | [
"MIT"
] | null | null | null | # ------------------------------------------------------- class: Constants ------------------------------------------------------- #
class Constants:
# --------------------------------------------------- Public properties -------------------------------------------------- #
USER_AGENT_FILE_NAME = 'ua.... | 45.857143 | 132 | 0.311526 | 373 | 0.580997 | 0 | 0 | 0 | 0 | 0 | 0 | 436 | 0.679128 |
585fbd132230f1c1b7c7d02416766ecbbe4a68a2 | 2,893 | py | Python | api/models/__init__.py | victorabarros/challenge-alloy-card | a3188fea298541130c24ebf4639d2af4700ba362 | [
"MIT"
] | null | null | null | api/models/__init__.py | victorabarros/challenge-alloy-card | a3188fea298541130c24ebf4639d2af4700ba362 | [
"MIT"
] | null | null | null | api/models/__init__.py | victorabarros/challenge-alloy-card | a3188fea298541130c24ebf4639d2af4700ba362 | [
"MIT"
] | null | null | null |
class Game:
def __init__(self, *args, **kwargs):
self.player_0 = 'white'
self.player_1 = 'black'
self._new_pieces_game()
self.current_player_turn = self.player_0
def _new_pieces_game(self):
self.board = {
0: {
0: Piece(self.player_0, "rook", ... | 36.620253 | 69 | 0.444867 | 1,359 | 0.469755 | 0 | 0 | 0 | 0 | 0 | 0 | 263 | 0.090909 |
58610c3f91576fd189f2c5eb7bc06289b39922a3 | 50,976 | py | Python | spinta/manifests/tabular/helpers.py | atviriduomenys/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 2 | 2019-03-14T06:41:14.000Z | 2019-03-26T11:48:14.000Z | spinta/manifests/tabular/helpers.py | sirex/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 44 | 2019-04-05T15:52:45.000Z | 2022-03-30T07:41:33.000Z | spinta/manifests/tabular/helpers.py | sirex/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 1 | 2019-04-01T09:54:27.000Z | 2019-04-01T09:54:27.000Z | from __future__ import annotations
import csv
import pathlib
import textwrap
from operator import itemgetter
from typing import Any
from typing import Callable
from typing import Dict
from typing import IO
from typing import Iterable
from typing import Iterator
from typing import List
from typing import NamedTuple
fro... | 27.779837 | 80 | 0.568464 | 19,973 | 0.391812 | 16,499 | 0.323662 | 0 | 0 | 0 | 0 | 5,897 | 0.115682 |
5861890f40c195d9d9cd8464fdd3da892466f679 | 8,080 | py | Python | python/mxnet/context.py | feevos/incubator-mxnet | 275378a49a6035fd5bdead4a74ac36b6070295a7 | [
"Apache-2.0"
] | null | null | null | python/mxnet/context.py | feevos/incubator-mxnet | 275378a49a6035fd5bdead4a74ac36b6070295a7 | [
"Apache-2.0"
] | null | null | null | python/mxnet/context.py | feevos/incubator-mxnet | 275378a49a6035fd5bdead4a74ac36b6070295a7 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30.490566 | 91 | 0.627104 | 3,935 | 0.487005 | 0 | 0 | 1,194 | 0.147772 | 0 | 0 | 5,603 | 0.693441 |
58618a4465a15f955aaa88fd0bac8fbce9ce5c48 | 3,422 | py | Python | theory/model/tconfig.py | ralfonso/theory | 41684969313cfc545d74b306e409fd5bf21387b3 | [
"MIT"
] | 4 | 2015-07-03T19:53:59.000Z | 2016-04-25T03:03:56.000Z | theory/model/tconfig.py | ralfonso/theory | 41684969313cfc545d74b306e409fd5bf21387b3 | [
"MIT"
] | null | null | null | theory/model/tconfig.py | ralfonso/theory | 41684969313cfc545d74b306e409fd5bf21387b3 | [
"MIT"
] | 2 | 2020-03-29T22:02:29.000Z | 2021-07-13T07:17:19.000Z | # theory MPD client
# Copyright (C) 2008 Ryan Roemmich <[email protected]>
#
# 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 ve... | 34.918367 | 108 | 0.630333 | 2,607 | 0.761835 | 0 | 0 | 0 | 0 | 0 | 0 | 1,476 | 0.431327 |
5861aaa87e16980cf7f95fd4b748950ec3d44176 | 5,055 | py | Python | tests/test_error.py | iotanbo/iotanbo_py_utils | 96a2728e051b5e5ee601459b4c449b5495768ba8 | [
"MIT"
] | null | null | null | tests/test_error.py | iotanbo/iotanbo_py_utils | 96a2728e051b5e5ee601459b4c449b5495768ba8 | [
"MIT"
] | 14 | 2021-06-07T17:36:02.000Z | 2021-06-07T18:02:37.000Z | tests/test_error.py | iotanbo/iotanbo_py_utils | 96a2728e051b5e5ee601459b4c449b5495768ba8 | [
"MIT"
] | null | null | null | """Test `iotanbo_py_utils.error.py`."""
from iotanbo_py_utils.error import Error
from iotanbo_py_utils.error import ErrorKind
def test_error_one_of_arithmetic_errors() -> None:
errs = (
Error(ErrorKind.ArithmeticError),
Error(ErrorKind.FloatingPointError),
Error(ErrorKind.OverflowError),
... | 28.240223 | 76 | 0.669041 | 42 | 0.008309 | 0 | 0 | 0 | 0 | 0 | 0 | 389 | 0.076954 |
58641c0b89af2618e34db3686e77a3a4237fbad3 | 651 | py | Python | setup.py | wontonst/orvibo | 72722b16caa929ae3f07b0a6789a0f18cd3ebad3 | [
"MIT"
] | null | null | null | setup.py | wontonst/orvibo | 72722b16caa929ae3f07b0a6789a0f18cd3ebad3 | [
"MIT"
] | null | null | null | setup.py | wontonst/orvibo | 72722b16caa929ae3f07b0a6789a0f18cd3ebad3 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='orvibo',
version='1.5.0... | 27.125 | 108 | 0.725038 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 254 | 0.390169 |
58652e385a1acfda94718bdec15c5a91dde6b8c7 | 3,053 | py | Python | autograder-master/autograder/test_runner.py | Diana1320622/AILabs | 315a6f4b8f8dd60e4f53d348e06e23b4d827d179 | [
"MIT"
] | null | null | null | autograder-master/autograder/test_runner.py | Diana1320622/AILabs | 315a6f4b8f8dd60e4f53d348e06e23b4d827d179 | [
"MIT"
] | null | null | null | autograder-master/autograder/test_runner.py | Diana1320622/AILabs | 315a6f4b8f8dd60e4f53d348e06e23b4d827d179 | [
"MIT"
] | null | null | null | import glob, os
import subprocess
from difflib import context_diff
class TestRunner(object):
def __init__(self, context):
self.context = context
self.error_count = 0
self.test_count = 0
self.success_count = 0
def run(self):
os.getcwd()
os.chdir(self.context.repo... | 33.184783 | 83 | 0.556174 | 2,983 | 0.977072 | 0 | 0 | 0 | 0 | 0 | 0 | 332 | 0.108745 |
5865c20624359a297b3a450c2e37573f88fc2710 | 245 | py | Python | amazon/model/admin.py | Lakshmivijaykrishnan/mini-amazon | 89ce7c5e2af127a2e8e027c87cb245fa82d184d6 | [
"Unlicense"
] | null | null | null | amazon/model/admin.py | Lakshmivijaykrishnan/mini-amazon | 89ce7c5e2af127a2e8e027c87cb245fa82d184d6 | [
"Unlicense"
] | null | null | null | amazon/model/admin.py | Lakshmivijaykrishnan/mini-amazon | 89ce7c5e2af127a2e8e027c87cb245fa82d184d6 | [
"Unlicense"
] | null | null | null | from amazon.model import db
def __search_by_admin_name(username):
query={'username': username}
matching_user = db['users'].find(query)
if matching_user.count() > 0:
return matching_user.next()
else:
return None
| 22.272727 | 43 | 0.669388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.069388 |
58672ac219aa158da24cd5ab42129bffccff6013 | 2,429 | py | Python | tests/fixtures/test_abstracts/content_03_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 9 | 2015-04-16T08:13:31.000Z | 2020-05-18T14:03:06.000Z | tests/fixtures/test_abstracts/content_03_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 310 | 2015-02-11T00:30:09.000Z | 2021-07-14T23:58:50.000Z | tests/fixtures/test_abstracts/content_03_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 9 | 2015-02-04T01:21:28.000Z | 2021-06-15T12:50:47.000Z | expected = [
{
"abstract_type": None,
"content": "RET can be activated in cis or trans by its co-receptors and ligands in vitro, but the physiological roles of trans signaling are unclear. Rapidly adapting (RA) mechanoreceptors in dorsal root ganglia (DRGs) express Ret and the co-receptor Gfr\u03b12... | 303.625 | 1,326 | 0.792096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,361 | 0.972005 |
5868165c78c75470f0c193bcf63d0eb76394d605 | 5,059 | py | Python | NER-BiLSTM-CRF-PyTorch-main/src/eval.py | OscarChang46/de-identify-sensitive-data-for-cybersecurity-use-cases-e.g.-PII-and-PHI-data-in-unstructured-text-an | e77ca0d5c19206a349ecc94fc71febdc10824482 | [
"MIT"
] | 22 | 2021-04-28T04:19:04.000Z | 2022-03-20T17:17:57.000Z | NER-BiLSTM-CRF-PyTorch-main/src/eval.py | OscarChang46/de-identify-sensitive-data-for-cybersecurity-use-cases-e.g.-PII-and-PHI-data-in-unstructured-text-an | e77ca0d5c19206a349ecc94fc71febdc10824482 | [
"MIT"
] | 3 | 2021-09-03T12:14:36.000Z | 2022-03-07T10:43:51.000Z | NER-BiLSTM-CRF-PyTorch-main/src/eval.py | OscarChang46/de-identify-sensitive-data-for-cybersecurity-use-cases-e.g.-PII-and-PHI-data-in-unstructured-text-an | e77ca0d5c19206a349ecc94fc71febdc10824482 | [
"MIT"
] | 9 | 2021-03-25T13:44:51.000Z | 2022-02-19T03:56:38.000Z | # coding=utf-8
import optparse
import torch
import time
import pickle
from torch.autograd import Variable
from loader import *
from utils import *
# python -m visdom.server
optparser = optparse.OptionParser()
optparser.add_option(
"-t", "--test", default="data/eng.testb",
help="Test set location"
)
optparse... | 32.22293 | 94 | 0.613758 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 757 | 0.149634 |
586904d063488a1bde40ac6c380144e572f09389 | 789 | py | Python | src/openbiolink/graph_creation/metadata_db_file/edge/dbMetaEdgeSiderInd.py | cthoyt/OpenBioLink | c5f85b99f9104f70493136c343e4554261e990a5 | [
"MIT"
] | null | null | null | src/openbiolink/graph_creation/metadata_db_file/edge/dbMetaEdgeSiderInd.py | cthoyt/OpenBioLink | c5f85b99f9104f70493136c343e4554261e990a5 | [
"MIT"
] | null | null | null | src/openbiolink/graph_creation/metadata_db_file/edge/dbMetaEdgeSiderInd.py | cthoyt/OpenBioLink | c5f85b99f9104f70493136c343e4554261e990a5 | [
"MIT"
] | null | null | null | from openbiolink.graph_creation.metadata_db_file.edge.dbMetadataEdge import DbMetadataEdge
from openbiolink.graph_creation.types.dbType import DbType
class DbMetaEdgeSiderInd(DbMetadataEdge):
NAME = 'Edge - Sider - Indications'
URL = "http://sideeffects.embl.de/media/download/meddra_all_indications.tsv.gz"
... | 43.833333 | 90 | 0.69455 | 637 | 0.807351 | 0 | 0 | 0 | 0 | 0 | 0 | 230 | 0.291508 |
586a480b0504292a0e113f2a2851c35d28765f0b | 377 | py | Python | rename_files.py | ssinhaleite/util | b65a6e0d7ff270cc2bbdbc09b7894ffc77edaf8d | [
"MIT"
] | 1 | 2018-10-10T11:37:45.000Z | 2018-10-10T11:37:45.000Z | rename_files.py | ssinhaleite/util | b65a6e0d7ff270cc2bbdbc09b7894ffc77edaf8d | [
"MIT"
] | null | null | null | rename_files.py | ssinhaleite/util | b65a6e0d7ff270cc2bbdbc09b7894ffc77edaf8d | [
"MIT"
] | null | null | null | import mahotas as mh
import glob
import os
# rename files from 0 to number of files.
files = glob.glob("/path/*")
files.sort()
if not os.path.isdir("/path/renamed/"):
os.mkdir("/path/renamed/")
for i in range(len(files)):
print("Processing " + files[i])
renamedFile = mh.imread(files[i])
mh.imsave("... | 20.944444 | 71 | 0.649867 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 117 | 0.310345 |
586b210947d0b950e98da84e776f0d34d976b0d2 | 1,749 | py | Python | scripts/download_lookml.py | orf/lkml | 2175a22e0fe8a894ef9312c73c6a062df2447795 | [
"MIT"
] | 110 | 2019-06-25T14:26:41.000Z | 2022-02-01T13:27:19.000Z | scripts/download_lookml.py | orf/lkml | 2175a22e0fe8a894ef9312c73c6a062df2447795 | [
"MIT"
] | 56 | 2019-06-26T22:11:43.000Z | 2022-03-15T20:37:30.000Z | scripts/download_lookml.py | orf/lkml | 2175a22e0fe8a894ef9312c73c6a062df2447795 | [
"MIT"
] | 28 | 2019-07-08T17:34:49.000Z | 2022-03-25T14:36:00.000Z | import os
import re
from base64 import b64decode
from pathlib import Path
import requests
username = os.environ["GITHUB_USERNAME"]
password = os.environ["GITHUB_PERSONAL_ACCESS_TOKEN"]
auth = requests.auth.HTTPBasicAuth(username, password)
directory = Path(__file__).resolve().parent.parent / "github"
directory.mkdir... | 26.5 | 71 | 0.573471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 313 | 0.178959 |
586cd0144d170eb0711f6999768b768351ab3215 | 579 | py | Python | docs/conf.py | RTBHOUSE/carreralib | 1daa959ef411b29601c92f86c0f6876fe8367837 | [
"MIT"
] | null | null | null | docs/conf.py | RTBHOUSE/carreralib | 1daa959ef411b29601c92f86c0f6876fe8367837 | [
"MIT"
] | null | null | null | docs/conf.py | RTBHOUSE/carreralib | 1daa959ef411b29601c92f86c0f6876fe8367837 | [
"MIT"
] | 1 | 2020-02-25T20:40:50.000Z | 2020-02-25T20:40:50.000Z | import os
import sys
sys.path.insert(0, os.path.abspath('..'))
def get_version(filename):
from re import findall
with open(filename) as f:
metadata = dict(findall(r"__([a-z]+)__ = '([^']+)'", f.read()))
return metadata['version']
project = 'carreralib'
copyright = '2015-2017 Thomas Kemmer'
vers... | 20.678571 | 71 | 0.658031 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 207 | 0.357513 |
586d9bd962737e276a73a87798d6fdc63e31cd16 | 503 | py | Python | algos/lcs.py | asaini/algo-py | e9d18ef82d14e6304430bbd8b065430e76aa7eb8 | [
"MIT"
] | 1 | 2015-10-01T21:17:10.000Z | 2015-10-01T21:17:10.000Z | algos/lcs.py | asaini/algo-py | e9d18ef82d14e6304430bbd8b065430e76aa7eb8 | [
"MIT"
] | null | null | null | algos/lcs.py | asaini/algo-py | e9d18ef82d14e6304430bbd8b065430e76aa7eb8 | [
"MIT"
] | null | null | null | def lcs(x, y):
"""
Longest Common Subsequence
"""
n = len(x) + 1
m = len(y) + 1
table = [ [0]*m for i in range(n) ]
for i in range(n):
for j in range(m):
# If either string is empty, then lcs = 0
if i == 0 or j == 0:
table[i][j] = 0
elif x[i - 1] == y[j - 1]:
table[i][j] = 1 + table[i-1]... | 16.225806 | 51 | 0.499006 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 105 | 0.208748 |
586f8df02b72779b1db755aeb20b5f85e4d788d2 | 350 | py | Python | app/models/methods/set_device_info_method.py | luisalvesmartins/TAPO-P100 | 02bc929a87bbe4681739b14a716f6cef2b159fd1 | [
"MIT"
] | null | null | null | app/models/methods/set_device_info_method.py | luisalvesmartins/TAPO-P100 | 02bc929a87bbe4681739b14a716f6cef2b159fd1 | [
"MIT"
] | 1 | 2021-06-23T09:21:40.000Z | 2021-07-02T17:21:12.000Z | app/models/methods/set_device_info_method.py | luisalvesmartins/TAPO-P100 | 02bc929a87bbe4681739b14a716f6cef2b159fd1 | [
"MIT"
] | null | null | null | from models.methods import method
from typing import Any
class SetDeviceInfoMethod(method.Method):
def __init__(self, params: Any):
super().__init__("set_device_info", params)
def set_request_time_milis(self, t: float):
self.requestTimeMils = t
def set_terminal_uuid(self, uuid: str):
... | 25 | 51 | 0.708571 | 290 | 0.828571 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.048571 |
586fa3eca62dcbd41023f2732e592c80e6a5d80c | 3,077 | py | Python | projects/InterpretationReID/train_net.py | SheldongChen/AMD.github.io | 5f3018f239127949b2d3995162ffe033dcf8051a | [
"Apache-2.0"
] | 17 | 2021-11-01T01:14:06.000Z | 2022-03-02T14:59:39.000Z | projects/InterpretationReID/train_net.py | SheldongChen/AMD.github.io | 5f3018f239127949b2d3995162ffe033dcf8051a | [
"Apache-2.0"
] | 2 | 2021-12-22T07:56:13.000Z | 2022-03-18T10:26:21.000Z | projects/InterpretationReID/train_net.py | SheldongChen/AMD.github.io | 5f3018f239127949b2d3995162ffe033dcf8051a | [
"Apache-2.0"
] | 2 | 2022-02-18T07:42:38.000Z | 2022-02-18T10:16:26.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@author: sherlock
@contact: [email protected]
"""
import logging
import os
import sys
sys.path.append('.')
from fastreid.config import get_cfg
from projects.InterpretationReID.interpretationreid.engine import DefaultTrainer, default_argument_parser, default_setup, ... | 26.756522 | 128 | 0.677283 | 986 | 0.320442 | 0 | 0 | 935 | 0.303867 | 0 | 0 | 979 | 0.318167 |
586fc6bf6803a3f84dbc2e58fa7867211fee503b | 826 | py | Python | asynciomeasures/collectors.py | Poogles/aiomeasures | d62482e8de56a00bce310e7c422d1a1e7a114ef7 | [
"MIT"
] | 2 | 2018-12-27T22:01:41.000Z | 2019-04-29T11:51:15.000Z | asynciomeasures/collectors.py | Poogles/aiomeasures | d62482e8de56a00bce310e7c422d1a1e7a114ef7 | [
"MIT"
] | null | null | null | asynciomeasures/collectors.py | Poogles/aiomeasures | d62482e8de56a00bce310e7c422d1a1e7a114ef7 | [
"MIT"
] | null | null | null | from collections import deque
from asynciomeasures.events import Event
class Collector(deque):
"""Caped list of metrics
"""
def flush(self, rate=None, formatter=None):
while True:
try:
metric = self.popleft()
if isinstance(metric, Event):
... | 28.482759 | 63 | 0.457627 | 752 | 0.910412 | 686 | 0.830508 | 0 | 0 | 0 | 0 | 32 | 0.038741 |
58708500568a55067da2b5aa34b23852b3efa570 | 1,576 | py | Python | hardware/testbenches/common/drivers/state/driver.py | Intuity/nexus | 0d1414fa2ea518dae9f031930c40692ebac5d154 | [
"Apache-2.0"
] | 6 | 2021-06-28T05:52:15.000Z | 2022-03-27T20:45:28.000Z | hardware/testbenches/common/drivers/state/driver.py | Intuity/nexus | 0d1414fa2ea518dae9f031930c40692ebac5d154 | [
"Apache-2.0"
] | null | null | null | hardware/testbenches/common/drivers/state/driver.py | Intuity/nexus | 0d1414fa2ea518dae9f031930c40692ebac5d154 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, Peter Birch, mailto:[email protected]
#
# 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... | 37.52381 | 74 | 0.692259 | 853 | 0.541244 | 0 | 0 | 0 | 0 | 757 | 0.48033 | 954 | 0.60533 |
5870b28965fe63f49e7e9e53bb51b1566ea6452e | 1,463 | py | Python | python/primsAlgo.py | Ayushd70/RetartedCodes | 301ced178a0ec352b2d127e19028845de950551d | [
"MIT"
] | null | null | null | python/primsAlgo.py | Ayushd70/RetartedCodes | 301ced178a0ec352b2d127e19028845de950551d | [
"MIT"
] | null | null | null | python/primsAlgo.py | Ayushd70/RetartedCodes | 301ced178a0ec352b2d127e19028845de950551d | [
"MIT"
] | null | null | null | # Prim's Algorithm in Python
INF = 9999999
# number of vertices in graph
V = 5
# create a 2d array of size 5x5
# for adjacency matrix to represent graph
G = [
[0, 9, 75, 0, 0],
[9, 0, 95, 19, 42],
[75, 95, 0, 51, 66],
[0, 19, 51, 0, 31],
[0, 42, 66, 31, 0],
]
# create a array to track... | 31.12766 | 68 | 0.546822 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 746 | 0.509911 |
5870fd20f646ac17e765716a8a7674f3e6c452db | 13,449 | py | Python | tests/test_likelihood.py | sa2c/care-home-fit | 58a2639c74b53e24f062d0dfc3e21df6d53b3077 | [
"MIT"
] | null | null | null | tests/test_likelihood.py | sa2c/care-home-fit | 58a2639c74b53e24f062d0dfc3e21df6d53b3077 | [
"MIT"
] | null | null | null | tests/test_likelihood.py | sa2c/care-home-fit | 58a2639c74b53e24f062d0dfc3e21df6d53b3077 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''Tests for the likelihood.py module'''
from time import perf_counter_ns
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_almost_equal
from scipy.stats import gamma
import likelihood
SMALL_FIT_PARAMS = {
'baseline_intensities': np.asarray([1, 2, np.na... | 32.485507 | 79 | 0.693509 | 0 | 0 | 0 | 0 | 5,112 | 0.380103 | 0 | 0 | 3,412 | 0.253699 |
5871c92a8c31f58780367e72dd645d194490519d | 266 | py | Python | HalleyComet/bit/models.py | ryanduan/Halley_Comet | bd3263e4575c820dd14c265c2c0d4b6b44197682 | [
"Apache-2.0"
] | null | null | null | HalleyComet/bit/models.py | ryanduan/Halley_Comet | bd3263e4575c820dd14c265c2c0d4b6b44197682 | [
"Apache-2.0"
] | null | null | null | HalleyComet/bit/models.py | ryanduan/Halley_Comet | bd3263e4575c820dd14c265c2c0d4b6b44197682 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class Url(models.Model):
long_url = models.CharField(max_length=200)
short_url = models.CharField(max_length=100)
visit_time = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return self.long_url
| 26.6 | 56 | 0.740602 | 235 | 0.883459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
587220b8fa00eda9456728bff03e4461bf290254 | 2,411 | py | Python | data-structure/queue.py | 66chenbiao/sleepace_verification_tool | 6271312d9d78ee50703e27a75787510cab4c7f4d | [
"Apache-2.0"
] | null | null | null | data-structure/queue.py | 66chenbiao/sleepace_verification_tool | 6271312d9d78ee50703e27a75787510cab4c7f4d | [
"Apache-2.0"
] | null | null | null | data-structure/queue.py | 66chenbiao/sleepace_verification_tool | 6271312d9d78ee50703e27a75787510cab4c7f4d | [
"Apache-2.0"
] | null | null | null | import unittest
class Queue:
"""Simple Queue implementation - First in First Out"""
def __init__(self):
self.__data = []
def enqueue(self, text):
"""Add new element to queue
Arguments:
text {string} -- An element which needs to be added to an end of a queue
"... | 27.397727 | 84 | 0.561178 | 2,340 | 0.970552 | 0 | 0 | 0 | 0 | 0 | 0 | 794 | 0.329324 |
58731f101956f7789a536c381812a3703830d466 | 262 | py | Python | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 108 | 2015-07-21T10:40:36.000Z | 2021-07-01T06:54:51.000Z | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 320 | 2015-07-21T01:33:20.000Z | 2020-07-21T15:57:02.000Z | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 61 | 2015-07-20T18:26:37.000Z | 2021-03-17T01:18:54.000Z | import logging
from iemit_plugin import IEmitter
from plugins.emitters.base_http_emitter import BaseHttpEmitter
logger = logging.getLogger('crawlutils')
class HttpEmitter(BaseHttpEmitter, IEmitter):
def get_emitter_protocol(self):
return 'http'
| 20.153846 | 62 | 0.793893 | 104 | 0.396947 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.068702 |
58733d23c2ee586468a2e3bd18d3eae0569b7613 | 1,946 | py | Python | frequency_domain/dwt.py | StephenTaylor1998/Research | 193dc88d368caf5a458be24456c4f6d5045d341f | [
"Apache-2.0"
] | null | null | null | frequency_domain/dwt.py | StephenTaylor1998/Research | 193dc88d368caf5a458be24456c4f6d5045d341f | [
"Apache-2.0"
] | null | null | null | frequency_domain/dwt.py | StephenTaylor1998/Research | 193dc88d368caf5a458be24456c4f6d5045d341f | [
"Apache-2.0"
] | 1 | 2022-03-27T14:04:46.000Z | 2022-03-27T14:04:46.000Z | import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
import pywt
class DWTForward(nn.Module):
def __init__(self, wave_name="haar"):
super(DWTForward, self).__init__()
wavelet = pywt.Wavelet(wave_name)
ll = np.outer(wavelet.dec_lo, wavelet.dec_lo)
lh... | 38.156863 | 81 | 0.571429 | 1,843 | 0.947071 | 0 | 0 | 0 | 0 | 0 | 0 | 124 | 0.06372 |
58747a38ec4c868ae85caa7d4f7a021b2a655030 | 7,973 | py | Python | facebook_messenger_conversation.py | davidkrantz/FacebookChatStatistics | 01fc2a022d45ed695fa7f4ad53d6532a160379db | [
"MIT"
] | 35 | 2018-02-22T09:04:21.000Z | 2022-03-21T18:28:21.000Z | facebook_messenger_conversation.py | davidkrantz/FacebookChatStatistics | 01fc2a022d45ed695fa7f4ad53d6532a160379db | [
"MIT"
] | 5 | 2018-05-03T17:56:35.000Z | 2022-02-24T08:19:58.000Z | facebook_messenger_conversation.py | davidkrantz/FacebookChatStatistics | 01fc2a022d45ed695fa7f4ad53d6532a160379db | [
"MIT"
] | 12 | 2018-05-15T19:15:25.000Z | 2022-02-24T08:20:15.000Z | import sys
import numpy as np
import json
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
from matplotlib.backends.backend_pdf import PdfPages
from datetime import datetime, timedelta
import matplotlib.dates as mdates
import emoji
class FacebookMessengerConversation():
"""Module for get... | 34.07265 | 82 | 0.56014 | 7,712 | 0.967265 | 0 | 0 | 0 | 0 | 0 | 0 | 2,945 | 0.369372 |
5876eec474b4c0410b6e104f6c352d08e47e01ce | 1,758 | py | Python | setup.py | stevearc/pyramid_duh | af14b185533d00b69dfdb8ab1cab6f1d1d8d4647 | [
"MIT"
] | 5 | 2015-12-15T09:27:16.000Z | 2017-12-12T12:56:04.000Z | setup.py | stevearc/pyramid_duh | af14b185533d00b69dfdb8ab1cab6f1d1d8d4647 | [
"MIT"
] | null | null | null | setup.py | stevearc/pyramid_duh | af14b185533d00b69dfdb8ab1cab6f1d1d8d4647 | [
"MIT"
] | null | null | null | """ Setup file """
import os
import sys
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(HERE, 'README.rst')).read()
CHANGES = open(os.path.join(HERE, 'CHANGES.rst')).read()
REQUIREMENTS = [
'pyramid',
'six',
]
TEST_REQUIREMENTS = [
... | 30.310345 | 61 | 0.580205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 745 | 0.423777 |
5877683380ccf730fab956e05f9d48490796920d | 555 | py | Python | telegramhelpers.py | olgamirete/log-public-ip | 0e53c27e62f0709a9d0adf52c860b407a841a252 | [
"MIT"
] | null | null | null | telegramhelpers.py | olgamirete/log-public-ip | 0e53c27e62f0709a9d0adf52c860b407a841a252 | [
"MIT"
] | null | null | null | telegramhelpers.py | olgamirete/log-public-ip | 0e53c27e62f0709a9d0adf52c860b407a841a252 | [
"MIT"
] | null | null | null | import requests, os
from dotenv import load_dotenv
load_dotenv()
API_TOKEN = os.getenv('API_TOKEN')
def sendMessage(user_id: str, text: str, max_retries: int = 1):
url = f'https://api.telegram.org/bot{API_TOKEN}/sendMessage'
payload = {
"chat_id": user_id,
"text": text
}
for i in rang... | 24.130435 | 64 | 0.572973 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 84 | 0.151351 |
58793e76d3fcb25dfcdd3339f4cd5621aa988f33 | 1,880 | py | Python | datawinners/questionnaire/tests/test_questionnaire_template.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/questionnaire/tests/test_questionnaire_template.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/questionnaire/tests/test_questionnaire_template.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from mock import patch, MagicMock
from mangrove.datastore.database import DatabaseManager
from datawinners.questionnaire.library import QuestionnaireLibrary
class TestQuestionnaireTemplate(TestCase):
def test_get_category_to_doc_mappings(self):
with patch('datawinners.quest... | 47 | 100 | 0.643617 | 1,688 | 0.897872 | 0 | 0 | 0 | 0 | 0 | 0 | 430 | 0.228723 |
58795121905bb3b21c3853525b46782e8fe333ee | 2,826 | py | Python | chainer_chemistry/links/update/ggnn_update.py | pfnet/chainerchem | efe323aa21f63a815130d673781e7cca1ccb72d2 | [
"MIT"
] | 184 | 2019-11-27T12:59:01.000Z | 2022-03-29T19:18:54.000Z | chainer_chemistry/links/update/ggnn_update.py | pfnet/chainerchem | efe323aa21f63a815130d673781e7cca1ccb72d2 | [
"MIT"
] | 21 | 2019-12-08T01:53:33.000Z | 2020-10-23T01:19:56.000Z | chainer_chemistry/links/update/ggnn_update.py | pfnet/chainerchem | efe323aa21f63a815130d673781e7cca1ccb72d2 | [
"MIT"
] | 45 | 2019-11-28T09:59:54.000Z | 2022-02-07T02:42:46.000Z | import chainer
from chainer import functions
from chainer import links
import chainer_chemistry
from chainer_chemistry.links.connection.graph_linear import GraphLinear
from chainer_chemistry.utils import is_sparse
class GGNNUpdate(chainer.Chain):
"""GGNN submodule for update part.
Args:
in_channels ... | 36.230769 | 79 | 0.624204 | 2,608 | 0.922859 | 0 | 0 | 0 | 0 | 0 | 0 | 657 | 0.232484 |
587a404ecb9909eff07171e4499fcb5702d3abd5 | 78 | py | Python | samples/ast/test.py | Ryoich/python_zero | fe4a5fd8b11c8c059d82b797cd1668f96d54e541 | [
"CC-BY-4.0"
] | 203 | 2018-12-14T10:16:33.000Z | 2022-03-10T07:23:34.000Z | samples/ast/test.py | Ryoich/python_zero | fe4a5fd8b11c8c059d82b797cd1668f96d54e541 | [
"CC-BY-4.0"
] | 39 | 2019-06-21T12:28:03.000Z | 2022-01-17T10:41:53.000Z | samples/ast/test.py | Ryoich/python_zero | fe4a5fd8b11c8c059d82b797cd1668f96d54e541 | [
"CC-BY-4.0"
] | 29 | 2018-12-30T06:48:59.000Z | 2022-03-10T07:43:42.000Z | def func(a, b):
return a + b
def func2(a):
print(a)
print("Hello")
| 8.666667 | 16 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0.089744 |
587a892ea698fcb43f251688aa0bd017aec53e6b | 1,621 | py | Python | badboids/test/test_simulation_parameters.py | RiannaK/Coursework2 | 471589593fd09c61fae39cb5975cc88fee36971c | [
"MIT"
] | null | null | null | badboids/test/test_simulation_parameters.py | RiannaK/Coursework2 | 471589593fd09c61fae39cb5975cc88fee36971c | [
"MIT"
] | 2 | 2017-01-02T11:11:31.000Z | 2017-01-02T22:09:15.000Z | badboids/test/test_simulation_parameters.py | RiannaK/Coursework2 | 471589593fd09c61fae39cb5975cc88fee36971c | [
"MIT"
] | null | null | null | from numpy.testing import assert_array_almost_equal as array_assert
from badboids.boids import SimulationParameters
def test_simulation_parameters_init():
"""Tests Simulation Parameters constructor"""
# Arrange
formation_flying_distance = 800
formation_flying_strength = 0.10
alert_distance = 8
... | 33.770833 | 100 | 0.779766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 142 | 0.0876 |
587e704ad57d09ab05a6f91557e90faddd8fb439 | 3,247 | py | Python | django_town/oauth2/models.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | django_town/oauth2/models.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | django_town/oauth2/models.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from django_town.core.settings import OAUTH2_SETTINGS
try:
if not OAUTH2_SETTINGS.ACCESS_TOKEN_SECRET_KEY:
raise ImportError
except KeyError:
# import traceback
# traceback.print_exc()
raise ImportError
from django.db import models
from django.conf import settings
from ... | 33.132653 | 92 | 0.73206 | 1,816 | 0.559285 | 0 | 0 | 0 | 0 | 0 | 0 | 597 | 0.183862 |
587e7271e86565dcf7c4f99ca8d0228de3d2839e | 265 | py | Python | util_list_files.py | jhu-alistair/image_utilities | 07fcf2fb78b57b3e8ac798daffa9f4d7b05d9063 | [
"Apache-2.0"
] | null | null | null | util_list_files.py | jhu-alistair/image_utilities | 07fcf2fb78b57b3e8ac798daffa9f4d7b05d9063 | [
"Apache-2.0"
] | null | null | null | util_list_files.py | jhu-alistair/image_utilities | 07fcf2fb78b57b3e8ac798daffa9f4d7b05d9063 | [
"Apache-2.0"
] | null | null | null | # List files in a directory. Useful for testing the path
from local_tools import *
from image_renamer import ImageRenamer
if confirm_config('path'):
img_path = get_config('path')
fl = ImageRenamer(img_path)
for ff in fl.image_files():
print(ff)
| 29.444444 | 56 | 0.720755 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 68 | 0.256604 |
587f22d6d391706fced03d26fcfcf342a5722cf3 | 1,394 | py | Python | deepmedic_config.py | farrokhkarimi/deepmedic_project | b0c916171673ce3259d2458146f2db941f0bf270 | [
"MIT"
] | 2 | 2021-07-15T18:40:18.000Z | 2021-08-03T17:10:12.000Z | deepmedic_config.py | farrokhkarimi/deepmedic_project | b0c916171673ce3259d2458146f2db941f0bf270 | [
"MIT"
] | null | null | null | deepmedic_config.py | farrokhkarimi/deepmedic_project | b0c916171673ce3259d2458146f2db941f0bf270 | [
"MIT"
] | 1 | 2022-01-17T12:11:51.000Z | 2022-01-17T12:11:51.000Z | import os
def deepmedic_config(config_files_path, niftis_path, test_flair_file_name, test_t1c_file_name, mask, prediction_file_name, output_path):
with open(os.path.join(config_files_path, 'model', 'modelConfig.cfg'), 'r') as f:
lines = f.readlines()
lines[8] = 'folderForOutput = "%s"\n'... | 48.068966 | 137 | 0.636298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 284 | 0.20373 |
587fce66d43c23ddc2eed105e1033650f3ef5080 | 174 | py | Python | configs/models/aott.py | yoxu515/aot-benchmark | 5a7665fc8e0f0e64bc8ba6028b15d9ab32f4c56a | [
"BSD-3-Clause"
] | 105 | 2021-11-16T12:43:59.000Z | 2022-03-31T08:05:11.000Z | configs/models/aott.py | lingyunwu14/aot-benchmark | 99f74f051c91ac221e44f3edab3534ae4dd233f7 | [
"BSD-3-Clause"
] | 14 | 2021-11-18T09:52:36.000Z | 2022-03-31T16:26:32.000Z | configs/models/aott.py | lingyunwu14/aot-benchmark | 99f74f051c91ac221e44f3edab3534ae4dd233f7 | [
"BSD-3-Clause"
] | 17 | 2021-11-16T13:28:29.000Z | 2022-03-29T02:14:48.000Z | import os
from .default import DefaultModelConfig
class ModelConfig(DefaultModelConfig):
def __init__(self):
super().__init__()
self.MODEL_NAME = 'AOTT'
| 21.75 | 39 | 0.706897 | 122 | 0.701149 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.034483 |
58803dca4ce3bbdf62d3eb2aca41861e7c2239d8 | 1,125 | py | Python | main.py | philipperemy/tensorflow-fifo-queue-example | 1e38e6e907b7856e954caeeb01d52f7d66e54de0 | [
"MIT"
] | 42 | 2017-03-17T07:22:30.000Z | 2022-03-31T16:11:50.000Z | main.py | afcarl/tensorflow-fifo-queue-example | 885bcfe417f6d3a9beb4180922cd221d95abc1ef | [
"MIT"
] | 2 | 2017-08-15T19:23:26.000Z | 2017-08-18T02:49:11.000Z | main.py | afcarl/tensorflow-fifo-queue-example | 885bcfe417f6d3a9beb4180922cd221d95abc1ef | [
"MIT"
] | 15 | 2017-05-04T07:27:24.000Z | 2022-03-31T16:26:28.000Z | from __future__ import print_function
import time
import tensorflow as tf
from data import DataGenerator
def define_net(input_batch):
return input_batch + 20 # simplest network I could think of.
def main():
batch_size = 1
coord = tf.train.Coordinator()
with tf.name_scope('create_inputs'):
... | 25 | 95 | 0.683556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 261 | 0.232 |
58803eeb0ae16d220e9ed2f74395fa7c80ff5afa | 1,285 | py | Python | Chapter_3/OO_DimmerSwitch_Model1.py | zjwillie/Object-Oriented-Python-Code | 017b07084c7937c870926b96a856f60b9d7077aa | [
"BSD-2-Clause"
] | 38 | 2021-11-16T03:04:42.000Z | 2022-03-27T05:57:50.000Z | Chapter_3/OO_DimmerSwitch_Model1.py | zjwillie/Object-Oriented-Python-Code | 017b07084c7937c870926b96a856f60b9d7077aa | [
"BSD-2-Clause"
] | null | null | null | Chapter_3/OO_DimmerSwitch_Model1.py | zjwillie/Object-Oriented-Python-Code | 017b07084c7937c870926b96a856f60b9d7077aa | [
"BSD-2-Clause"
] | 22 | 2021-11-11T15:57:58.000Z | 2022-03-18T12:58:07.000Z | # Dimmer Switch class
class DimmerSwitch():
def __init__(self, label):
self.label = label
self.isOn = False
self.brightness = 0
def turnOn(self):
self.isOn = True
# turn the light on at self.brightness
def turnOff(self):
self.isOn = False
# ... | 23.363636 | 61 | 0.654475 | 730 | 0.568093 | 0 | 0 | 0 | 0 | 0 | 0 | 389 | 0.302724 |
5881480162c7fded411cf84766484caa36fe07ea | 2,101 | py | Python | python/vosk/transcriber/cli.py | madkote/vosk-api | 8cf64ee93e5cc21a6d53595c6a80fc638a45b1d7 | [
"Apache-2.0"
] | 33 | 2019-09-03T23:21:14.000Z | 2020-01-02T10:18:15.000Z | python/vosk/transcriber/cli.py | madkote/vosk-api | 8cf64ee93e5cc21a6d53595c6a80fc638a45b1d7 | [
"Apache-2.0"
] | 7 | 2019-09-11T09:40:03.000Z | 2019-12-31T10:04:21.000Z | python/vosk/transcriber/cli.py | madkote/vosk-api | 8cf64ee93e5cc21a6d53595c6a80fc638a45b1d7 | [
"Apache-2.0"
] | 10 | 2019-09-05T05:30:16.000Z | 2020-01-02T10:18:17.000Z | #!/usr/bin/env python3
import logging
import argparse
from pathlib import Path
from vosk import list_models, list_languages
from vosk.transcriber.transcriber import Transcriber
parser = argparse.ArgumentParser(
description = 'Transcribe audio file and save result in selected format')
parser.add_argument(
... | 28.013333 | 113 | 0.634936 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 599 | 0.285102 |
58816407aff8c18d528cadd21c391b1d398c40c2 | 2,923 | py | Python | OCR-Flask-app-master/tesseract.py | ChungNPH/OCR | 06a78fa5f2c8f5891db1969ac2076ef8d20b74a8 | [
"MIT"
] | null | null | null | OCR-Flask-app-master/tesseract.py | ChungNPH/OCR | 06a78fa5f2c8f5891db1969ac2076ef8d20b74a8 | [
"MIT"
] | null | null | null | OCR-Flask-app-master/tesseract.py | ChungNPH/OCR | 06a78fa5f2c8f5891db1969ac2076ef8d20b74a8 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from imutils.object_detection import non_max_suppression
import pytesseract
from matplotlib import pyplot as plt
def ocr(images):
results = []
for image in images:
args = {"image": image, "east": "frozen_east_text_detection.pb", "min_confidence": 0.5, "width": 320,
... | 30.134021 | 109 | 0.485118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 229 | 0.078344 |
5882bcb6d8e741c3012ffb7ce72cd027f9aee6d9 | 727 | py | Python | Scripts/autotest/bug/migrations/0003_auto_20180128_2144.py | ludechu/DJevn | ee97447da3f6f55c92bfa1b6a20436a4f3098150 | [
"bzip2-1.0.6"
] | null | null | null | Scripts/autotest/bug/migrations/0003_auto_20180128_2144.py | ludechu/DJevn | ee97447da3f6f55c92bfa1b6a20436a4f3098150 | [
"bzip2-1.0.6"
] | null | null | null | Scripts/autotest/bug/migrations/0003_auto_20180128_2144.py | ludechu/DJevn | ee97447da3f6f55c92bfa1b6a20436a4f3098150 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.0 on 2018-01-28 21:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bug', '0002_auto_20180110_1107'),
]
operations = [
migrations.AlterField(
model_name='bug',
name='buglevel',
... | 30.291667 | 153 | 0.558459 | 688 | 0.883184 | 0 | 0 | 0 | 0 | 0 | 0 | 223 | 0.286264 |
5882ce3c784a4517fd7838c8665ee9d1be914598 | 17,439 | py | Python | tests/test_validators.py | STYLER-Inc/styler-validation | 73e6e3ac241cf26ca3ccee070f2736778d3d4849 | [
"MIT"
] | null | null | null | tests/test_validators.py | STYLER-Inc/styler-validation | 73e6e3ac241cf26ca3ccee070f2736778d3d4849 | [
"MIT"
] | null | null | null | tests/test_validators.py | STYLER-Inc/styler-validation | 73e6e3ac241cf26ca3ccee070f2736778d3d4849 | [
"MIT"
] | null | null | null | """ Tests for validators
"""
from decimal import Decimal
from unittest.mock import Mock
import random
import string
from styler_validation import validators as va
from styler_validation import messages as msg
class MyModel:
pass
class TestIsRequired:
def test_is_required(self):
val = va.is_require... | 23.159363 | 68 | 0.565113 | 17,177 | 0.984976 | 0 | 0 | 0 | 0 | 0 | 0 | 838 | 0.048053 |
5883b253d513cb80bd2362de5b0a8311d18ca8c7 | 3,305 | py | Python | blog/models.py | Libor03/django-final | e29dc3237252c7b0fcfea13d948ed54ffe6d0339 | [
"CC0-1.0"
] | null | null | null | blog/models.py | Libor03/django-final | e29dc3237252c7b0fcfea13d948ed54ffe6d0339 | [
"CC0-1.0"
] | null | null | null | blog/models.py | Libor03/django-final | e29dc3237252c7b0fcfea13d948ed54ffe6d0339 | [
"CC0-1.0"
] | null | null | null | from django.core.files.storage import FileSystemStorage
from django.db import models
# Create your models here.
from datetime import date
from django.urls import reverse #Used to generate URLs by reversing the URL patterns
from django.contrib.auth.models import User #Blog author or commenter
def attachment_path(ins... | 36.722222 | 135 | 0.698033 | 2,803 | 0.825626 | 0 | 0 | 0 | 0 | 0 | 0 | 1,760 | 0.518409 |
5884a5b1746cc453a881292d3b4f5da9a92c1838 | 369 | py | Python | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E1.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | 12 | 2018-11-14T03:55:58.000Z | 2021-12-12T01:13:05.000Z | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E1.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | null | null | null | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E1.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | 7 | 2019-10-10T06:28:58.000Z | 2022-02-15T07:18:12.000Z | print(list(range(10, 0, -2)))
# if start > end and step > 0:
# a list generated from start to no more than end with step as constant increment
# if start > end and step < 0:
# an empty list generated
# if start < end and step > 0:
# an empty list generated
# if start < end and step < 0
# a list generated from start to ... | 36.9 | 81 | 0.704607 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 331 | 0.897019 |
588580ba517b618b5770a81ab628f3858c9ed41b | 3,141 | py | Python | DeepModels/KerasConvNetMNIST.py | amingolnari/Deep-Learning-Course | 00d4fe10db8d1dde3d9b2a94fe93531e8f836cbc | [
"MIT"
] | 17 | 2018-12-05T06:50:34.000Z | 2021-05-26T04:03:18.000Z | DeepModels/KerasConvNetMNIST.py | amingolnari/Deep-Learning-Course | 00d4fe10db8d1dde3d9b2a94fe93531e8f836cbc | [
"MIT"
] | null | null | null | DeepModels/KerasConvNetMNIST.py | amingolnari/Deep-Learning-Course | 00d4fe10db8d1dde3d9b2a94fe93531e8f836cbc | [
"MIT"
] | 3 | 2018-12-08T14:59:47.000Z | 2019-12-26T17:52:09.000Z | """
github : https://github.com/amingolnari/Deep-Learning-Course
Author : Amin Golnari
Keras Version : 2.2.4
Date : 4/12/2018
Keras CNN Classification on MNIST Data
Code 301
"""
## If your GPU is AMD , you can use PlaidML Backend
# import os
# os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
from keras.models i... | 32.381443 | 97 | 0.61127 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 869 | 0.276663 |
588a0eb119fc13cdd266d6e4d090c38c400126a9 | 526 | py | Python | armstrong.py | Sanchr-sys/Letsupgrade_python7 | f130cb1dff259878193fb65dd414fc936a7c760d | [
"Apache-2.0"
] | null | null | null | armstrong.py | Sanchr-sys/Letsupgrade_python7 | f130cb1dff259878193fb65dd414fc936a7c760d | [
"Apache-2.0"
] | null | null | null | armstrong.py | Sanchr-sys/Letsupgrade_python7 | f130cb1dff259878193fb65dd414fc936a7c760d | [
"Apache-2.0"
] | null | null | null | start = 104200
end = 702648265
for arm1 in range(start, end + 1):
exp = len(str(arm1))
num_sum = 0
c = arm1
while c > 0:
num = c % 10
num_sum += num ** exp
c //= 10
if arm1 != num_sum:
continue
else:
if arm1 == num_sum:
... | 17.533333 | 70 | 0.503802 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 151 | 0.287072 |
588a5c56f6208237e504aa5b6fa4afab73e5300c | 787 | py | Python | neji.py | NejiViraj/Viraj | d5bfc60e29100e00a87596b5e16961ab97a3dc4c | [
"BSD-2-Clause"
] | null | null | null | neji.py | NejiViraj/Viraj | d5bfc60e29100e00a87596b5e16961ab97a3dc4c | [
"BSD-2-Clause"
] | null | null | null | neji.py | NejiViraj/Viraj | d5bfc60e29100e00a87596b5e16961ab97a3dc4c | [
"BSD-2-Clause"
] | null | null | null | import requests
import json
def Neji_version():
# import neji
# print(neji.Neji_version())
# output: Hydrogen-0.0.0.1
return "Hydrogen-0.0.0.1"
def Neji_upload(put_file_directory_in_string_format):
# import neji
# print(neji.Neji_upload(r"C:\...\Pictures\trial\black1 - Copy (5).png"))
... | 24.59375 | 125 | 0.645489 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 316 | 0.401525 |
588aa8a3b88a98a9d49032a085a9b2d4f04e667f | 9,731 | py | Python | xmaintnote/ticketing.py | 0xmc/maint-notification | bdf27f7b863a45d2191068c46f729db3c94386d1 | [
"BSD-2-Clause"
] | null | null | null | xmaintnote/ticketing.py | 0xmc/maint-notification | bdf27f7b863a45d2191068c46f729db3c94386d1 | [
"BSD-2-Clause"
] | null | null | null | xmaintnote/ticketing.py | 0xmc/maint-notification | bdf27f7b863a45d2191068c46f729db3c94386d1 | [
"BSD-2-Clause"
] | null | null | null | #!/bin/env python3
"""Handling events as tickets
The goal here is, provided a maintenance event, create an event if not a
duplicate. To determine if not duplicate, use some combination of values to
form a key. Methods to delete, update, and otherwise transform the ticket
should be available
A base class, Ticket, is ... | 33.439863 | 79 | 0.582468 | 9,273 | 0.952934 | 0 | 0 | 0 | 0 | 0 | 0 | 6,103 | 0.627171 |
588c7a9a7c5017d9a74e862c7ceb6ee60b5f425a | 554 | py | Python | pycell/prologue/native/set_.py | andybalaam/cell | 03d0670f9ebd513a983b9327108a84f2eff8ee75 | [
"MIT"
] | 118 | 2016-10-17T09:04:42.000Z | 2021-12-31T03:00:55.000Z | pycell/prologue/native/set_.py | JoeyCluett/cell | a3203731e0c63a55955509e843fb99e38cf7cc7c | [
"MIT"
] | 4 | 2019-01-23T09:59:43.000Z | 2020-11-02T11:00:38.000Z | pycell/prologue/native/set_.py | JoeyCluett/cell | a3203731e0c63a55955509e843fb99e38cf7cc7c | [
"MIT"
] | 21 | 2016-06-05T08:05:53.000Z | 2022-01-29T10:08:47.000Z |
def _do_set(env, name, value):
if env.contains(name):
env.set(name, value)
elif env.parent is not None:
_do_set(env.parent, name, value)
else:
raise Exception(
"Attempted to set name '%s' but it does not exist." %
name
)
def set_(env, symbol_name, va... | 26.380952 | 71 | 0.561372 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.209386 |
588c8d695d5770a68e19da667343fb316670eec3 | 195 | py | Python | tests/commands/types/test_flag_param.py | cicdenv/cicdenv | 5b72fd9ef000bf07c2052471b59edaa91af18778 | [
"MIT"
] | 8 | 2020-08-10T20:57:24.000Z | 2021-08-08T10:46:20.000Z | tests/commands/types/test_flag_param.py | cicdenv/cicdenv | 5b72fd9ef000bf07c2052471b59edaa91af18778 | [
"MIT"
] | null | null | null | tests/commands/types/test_flag_param.py | cicdenv/cicdenv | 5b72fd9ef000bf07c2052471b59edaa91af18778 | [
"MIT"
] | 1 | 2020-08-10T20:42:09.000Z | 2020-08-10T20:42:09.000Z | from cicdctl.commands.types.flag import FlagParamType
def test_flag():
flag = '-no-color'
parsed = FlagParamType().convert(value=flag, param=None, context={})
assert flag == parsed
| 24.375 | 72 | 0.702564 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0.05641 |
588dd58a16badefdc5a90e5e3a2eb711ee8221dd | 194 | py | Python | modules/util/objects/query_parts/postgres_query_part.py | stevekineeve88/doubloon | 4c7c9163e96877ad23663c3dd9a73ef6ccde3e22 | [
"MIT"
] | null | null | null | modules/util/objects/query_parts/postgres_query_part.py | stevekineeve88/doubloon | 4c7c9163e96877ad23663c3dd9a73ef6ccde3e22 | [
"MIT"
] | 8 | 2021-01-29T15:49:17.000Z | 2021-10-14T01:03:27.000Z | modules/util/objects/query_parts/postgres_query_part.py | stevekineeve88/doubloon | 4c7c9163e96877ad23663c3dd9a73ef6ccde3e22 | [
"MIT"
] | null | null | null | class PostgresQueryPart:
""" Object representing Postgres query part
"""
def get_query(self) -> str:
""" Get query
Returns:
str
"""
pass
| 17.636364 | 47 | 0.505155 | 193 | 0.994845 | 0 | 0 | 0 | 0 | 0 | 0 | 109 | 0.561856 |
588fc576880c0f000634f775d5b9b45b44869222 | 7,957 | py | Python | tools/merge_messages.py | cclauss/personfinder | 62417192e79c9711d0c6c7cfc042f6d6b0dc2dc2 | [
"Apache-2.0"
] | 1 | 2021-11-18T20:09:09.000Z | 2021-11-18T20:09:09.000Z | tools/merge_messages.py | ZhengC1/personfinder | 7e40f2783ac89b91efd1d8497f1acc5b006361fa | [
"Apache-2.0"
] | null | null | null | tools/merge_messages.py | ZhengC1/personfinder | 7e40f2783ac89b91efd1d8497f1acc5b006361fa | [
"Apache-2.0"
] | 1 | 2022-01-05T07:06:43.000Z | 2022-01-05T07:06:43.000Z | #!/usr/bin/env python
# Copyright 2010 Google 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 ... | 39.004902 | 80 | 0.662184 | 1,161 | 0.145909 | 0 | 0 | 0 | 0 | 0 | 0 | 3,621 | 0.455071 |
5890360ab5457f3e208d3176b19465a1fa0b29ad | 621 | py | Python | misc/derwin.py | ssebs/nccsv | f5e94dab833a5f0822308299e154f13fd68d88f6 | [
"MIT"
] | null | null | null | misc/derwin.py | ssebs/nccsv | f5e94dab833a5f0822308299e154f13fd68d88f6 | [
"MIT"
] | null | null | null | misc/derwin.py | ssebs/nccsv | f5e94dab833a5f0822308299e154f13fd68d88f6 | [
"MIT"
] | null | null | null | # derwin.py - testing a window within a window
import curses
def main(stdscr):
# Create container window from stdscr
sh, sw = stdscr.getmaxyx()
container_win = curses.newwin(sh-1, sw-1, 1, 1)
# Create inner window from container win
bh, bw = container_win.getmaxyx()
box_win = container_win.de... | 20.7 | 52 | 0.653784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 214 | 0.344605 |
589099f22121deb7215ea93a44c6ab088a52a57b | 1,110 | py | Python | test/z_emulator_autoload.py | DXCyber409/AndroidNativeEmulator | 11a0360a947114375757724eecd9bd9dbca43a56 | [
"Apache-2.0"
] | 3 | 2020-05-21T09:15:11.000Z | 2022-01-12T13:52:20.000Z | test/z_emulator_autoload.py | DXCyber409/AndroidNativeEmulator | 11a0360a947114375757724eecd9bd9dbca43a56 | [
"Apache-2.0"
] | null | null | null | test/z_emulator_autoload.py | DXCyber409/AndroidNativeEmulator | 11a0360a947114375757724eecd9bd9dbca43a56 | [
"Apache-2.0"
] | null | null | null | import sys
import logging
from unicorn import *
from unicorn.arm_const import *
from androidemu.emulator import Emulator
from UnicornTraceDebugger import udbg
logging.basicConfig(stream=sys.stdout,
level=logging.DEBUG,
format="%(asctime)s %(levelname)7s %(name)34s | %(message)s")
logger = logging.getLogger(__n... | 29.210526 | 72 | 0.73964 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.104505 |
58919030577b20ce04be8ee22121a25618dfdeb8 | 816 | py | Python | community_ext/__init__.py | altsoph/community_loglike | ea8800217097575558f8bfb97f7737d12cad2339 | [
"BSD-3-Clause"
] | 16 | 2018-02-14T23:14:32.000Z | 2021-09-15T09:38:47.000Z | community_ext/__init__.py | altsoph/community_loglike | ea8800217097575558f8bfb97f7737d12cad2339 | [
"BSD-3-Clause"
] | null | null | null | community_ext/__init__.py | altsoph/community_loglike | ea8800217097575558f8bfb97f7737d12cad2339 | [
"BSD-3-Clause"
] | 7 | 2019-05-09T10:25:24.000Z | 2020-06-06T09:37:18.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This package implements several community detection.
Originally based on community aka python-louvain library from Thomas Aynaud
(https://github.com/taynaud/python-louvain)
"""
from .community_ext import (
partition_at_level,
modularity,
best_partition,
ge... | 24.727273 | 83 | 0.72549 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 511 | 0.626225 |
589531a8cfe2795a9b90146b7a85879eaadf036f | 895 | py | Python | youbot_gazebo_publisher/src/listener.py | ingjavierpinilla/youBot-Gazebo-Publisher | 9314f5c471cde91127d76ba205ce6259e595145a | [
"MIT"
] | null | null | null | youbot_gazebo_publisher/src/listener.py | ingjavierpinilla/youBot-Gazebo-Publisher | 9314f5c471cde91127d76ba205ce6259e595145a | [
"MIT"
] | null | null | null | youbot_gazebo_publisher/src/listener.py | ingjavierpinilla/youBot-Gazebo-Publisher | 9314f5c471cde91127d76ba205ce6259e595145a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from nav_msgs.msg import Odometry
from trajectory_msgs.msg import JointTrajectory
from control_msgs.msg import JointTrajectoryControllerState
def callback_odom(data):
print("odom\n" + str(data))
def callback_JointTrajectory(data):
print("gri... | 24.861111 | 102 | 0.746369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 286 | 0.319553 |
5895c3e0dafc21f11b778b930d6d27f00014cab8 | 75,699 | py | Python | main.py | hustleer/Discord-Encouragement-Bot | 4105d1e81fa0e76ade7cfd293dd82ea610064f58 | [
"Apache-2.0"
] | null | null | null | main.py | hustleer/Discord-Encouragement-Bot | 4105d1e81fa0e76ade7cfd293dd82ea610064f58 | [
"Apache-2.0"
] | null | null | null | main.py | hustleer/Discord-Encouragement-Bot | 4105d1e81fa0e76ade7cfd293dd82ea610064f58 | [
"Apache-2.0"
] | null | null | null | #Botpic:https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Red_Rose_Photography.jpg/800px-Red_Rose_Photography.jpg
#Botpic:https://commons.wikimedia.org/wiki/File:Red_Rose_Photography.jpg
#reference:https://www.youtube.com/watch?v=SPTfmiYiuok
import discord
import os
import requests
import json
import math, ra... | 34.03732 | 253 | 0.588462 | 5,127 | 0.067626 | 889 | 0.011726 | 49,373 | 0.651239 | 54,015 | 0.712467 | 33,656 | 0.443929 |
589634be0915da002b383091ea3d6a080249430a | 9,862 | py | Python | mwp_solver/module/Layer/transformer_layer.py | max-stack/MWP-SS-Metrics | 01268f2d6da716596216b04de4197e345b96c219 | [
"MIT"
] | null | null | null | mwp_solver/module/Layer/transformer_layer.py | max-stack/MWP-SS-Metrics | 01268f2d6da716596216b04de4197e345b96c219 | [
"MIT"
] | null | null | null | mwp_solver/module/Layer/transformer_layer.py | max-stack/MWP-SS-Metrics | 01268f2d6da716596216b04de4197e345b96c219 | [
"MIT"
] | null | null | null | # Code Taken from https://github.com/LYH-YF/MWPToolkit
# -*- encoding: utf-8 -*-
# @Author: Yihuai Lan
# @Time: 2021/08/29 22:05:03
# @File: transformer_layer.py
import torch
import math
from torch import nn
from torch.nn import functional as F
from transformers.activations import gelu_new as gelu_bert
from module... | 43.831111 | 205 | 0.688806 | 9,303 | 0.943318 | 0 | 0 | 0 | 0 | 0 | 0 | 3,247 | 0.329244 |
5897a699b6d877a1d06ab69aa68b4566e5a0268c | 6,564 | py | Python | tests/4_ckks_basics.py | TimTam725/SEAL-true | 87c3f3f345b7dc5f49380556c55a85a7efa45bb6 | [
"MIT"
] | null | null | null | tests/4_ckks_basics.py | TimTam725/SEAL-true | 87c3f3f345b7dc5f49380556c55a85a7efa45bb6 | [
"MIT"
] | null | null | null | tests/4_ckks_basics.py | TimTam725/SEAL-true | 87c3f3f345b7dc5f49380556c55a85a7efa45bb6 | [
"MIT"
] | null | null | null | import math
from seal import *
from seal_helper import *
def example_ckks_basics():
print_example_banner("Example: CKKS Basics")
parms = EncryptionParameters(scheme_type.CKKS)
poly_modulus_degree = 8192
parms.set_poly_modulus_degree(poly_modulus_degree)
parms.set_coeff_modulus(CoeffModulus.Creat... | 35.673913 | 84 | 0.655088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,289 | 0.34872 |
5899ee9d789144345b8642bab6672fe498055f42 | 2,422 | py | Python | FigureTable/NeuroPathRegions/barplots.py | vkola-lab/multi-task | 6a61db4223e1812744f13028747b07e2f840cc0b | [
"MIT"
] | 1 | 2021-12-19T01:45:01.000Z | 2021-12-19T01:45:01.000Z | FigureTable/NeuroPathRegions/barplots.py | vkola-lab/multi-task | 6a61db4223e1812744f13028747b07e2f840cc0b | [
"MIT"
] | null | null | null | FigureTable/NeuroPathRegions/barplots.py | vkola-lab/multi-task | 6a61db4223e1812744f13028747b07e2f840cc0b | [
"MIT"
] | 1 | 2022-03-14T18:30:23.000Z | 2022-03-14T18:30:23.000Z | from correlate import *
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import rc, rcParams
rc('axes', linewidth=1)
rc('font', weight='bold', size=10)
def barplots(prefixes, regions, stains, corre, error, name, folder, ylim):
for stain in stains:
barplot(prefixes, r... | 36.69697 | 143 | 0.627168 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 314 | 0.129645 |
589a8463ce8f13fdbedded623d8ccbad3c17d953 | 4,549 | py | Python | examples/distributed_autofaiss_n_indices.py | Rexiome/autofaiss | 79d7c396819ffd6859edde17c6958c1c3338b29b | [
"Apache-2.0"
] | null | null | null | examples/distributed_autofaiss_n_indices.py | Rexiome/autofaiss | 79d7c396819ffd6859edde17c6958c1c3338b29b | [
"Apache-2.0"
] | null | null | null | examples/distributed_autofaiss_n_indices.py | Rexiome/autofaiss | 79d7c396819ffd6859edde17c6958c1c3338b29b | [
"Apache-2.0"
] | null | null | null | """
An example of running autofaiss by pyspark to produce N indices.
You need to install pyspark before using the following example.
"""
from typing import Dict
import faiss
import numpy as np
from autofaiss import build_index
# You'd better create a spark session before calling build_index,
# otherwise, a spark se... | 34.992308 | 135 | 0.675533 | 1,103 | 0.242471 | 0 | 0 | 0 | 0 | 0 | 0 | 1,921 | 0.422291 |
589dcbc08792dc79d40776858af24dca67ad7bfe | 4,170 | py | Python | rbkcli/core/handlers/callback.py | rubrikinc/rbkcli | 62bbb20d15c78d2554d7258bdae655452ac826c7 | [
"MIT"
] | 10 | 2019-07-23T13:13:16.000Z | 2022-03-04T17:48:10.000Z | rbkcli/core/handlers/callback.py | rubrikinc/rbkcli | 62bbb20d15c78d2554d7258bdae655452ac826c7 | [
"MIT"
] | 19 | 2019-08-22T06:23:09.000Z | 2021-12-28T04:04:52.000Z | rbkcli/core/handlers/callback.py | rubrikinc/rbkcli | 62bbb20d15c78d2554d7258bdae655452ac826c7 | [
"MIT"
] | 5 | 2019-08-06T14:29:35.000Z | 2021-06-17T20:35:17.000Z | """Callback module for rbkcli."""
import json
from rbkcli.core.handlers.inputs import InputHandler
from rbkcli.base.essentials import DotDict, RbkcliException
from rbkcli.core.handlers import ApiTargetTools
from rbkcli.core.handlers.outputs import OutputHandler
class CallBack(ApiTargetTools):
"""Class ... | 37.232143 | 90 | 0.591367 | 3,894 | 0.933813 | 0 | 0 | 0 | 0 | 0 | 0 | 562 | 0.134772 |
589e413db07bdd7cf6dcd6e3ab66ffc0b716eb5c | 1,001 | py | Python | portrait/webapp/migrations/0001_initial.py | andela-sjames/Portrait | 83074e3d16d8009a71b674b6859f7c276b8d6537 | [
"MIT"
] | null | null | null | portrait/webapp/migrations/0001_initial.py | andela-sjames/Portrait | 83074e3d16d8009a71b674b6859f7c276b8d6537 | [
"MIT"
] | null | null | null | portrait/webapp/migrations/0001_initial.py | andela-sjames/Portrait | 83074e3d16d8009a71b674b6859f7c276b8d6537 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-16 23:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 34.517241 | 152 | 0.631369 | 842 | 0.841159 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.144855 |
589e51c361515efc2c983bdbd855621e6ab93aac | 9,950 | py | Python | src/greenbudget/app/group/serializers.py | nickmflorin/django-proper-architecture-testing | da7c4019697e85f921695144375d2f548f1e98ad | [
"MIT"
] | null | null | null | src/greenbudget/app/group/serializers.py | nickmflorin/django-proper-architecture-testing | da7c4019697e85f921695144375d2f548f1e98ad | [
"MIT"
] | null | null | null | src/greenbudget/app/group/serializers.py | nickmflorin/django-proper-architecture-testing | da7c4019697e85f921695144375d2f548f1e98ad | [
"MIT"
] | null | null | null | from rest_framework import serializers, exceptions
from greenbudget.lib.rest_framework_utils.serializers import (
EnhancedModelSerializer)
from greenbudget.app.account.models import BudgetAccount, TemplateAccount
from greenbudget.app.tagging.serializers import ColorField
from greenbudget.app.subaccount.models imp... | 37.689394 | 80 | 0.63206 | 9,420 | 0.946734 | 0 | 0 | 0 | 0 | 0 | 0 | 4,643 | 0.466633 |
589f45393545cfab296cec7cb3f2cc4a519dd5d0 | 570 | py | Python | vaccine_tracker/email.py | Shishir-Bondre/content-alerts | 37be34c781338ef3968e1257f5c0d1148bb022e5 | [
"Apache-2.0"
] | null | null | null | vaccine_tracker/email.py | Shishir-Bondre/content-alerts | 37be34c781338ef3968e1257f5c0d1148bb022e5 | [
"Apache-2.0"
] | null | null | null | vaccine_tracker/email.py | Shishir-Bondre/content-alerts | 37be34c781338ef3968e1257f5c0d1148bb022e5 | [
"Apache-2.0"
] | null | null | null | def email_subject(center_name):
return f"[Urgent Reminder] Vaccine slot is now available at {center_name}"
def email_body(email_data):
return f"Hi, \n" \
f"Vaccine slot is available for below centers \n " \
f"Center name and available data \n {email_data} \n" \
f"Please regis... | 38 | 92 | 0.615789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 385 | 0.675439 |
58a0bffac08dce61ed79b44c63defce1adefa9d1 | 12,103 | py | Python | objects/CSCG/_2d/mesh/domain/inputs/base.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_2d/mesh/domain/inputs/base.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_2d/mesh/domain/inputs/base.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
INTRO
@author: Yi Zhang. Created on Tue May 21 11:57:52 2019
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft,
Delft, the Netherlands
"""
import inspect
from screws.freeze.main import FrozenOnly
from typing import Dict, Union
import ... | 36.345345 | 125 | 0.629513 | 11,703 | 0.96695 | 0 | 0 | 8,304 | 0.686111 | 0 | 0 | 4,411 | 0.364455 |
58a1f761a8b86a42b461b76e20b0ebb5fa21fa7a | 4,098 | py | Python | src/sage/modules/vector_symbolic_dense.py | sloebrich/sage | b8f53f72e817e78722ad1b40d70aa9071426700b | [
"BSL-1.0"
] | 1 | 2020-05-19T22:34:03.000Z | 2020-05-19T22:34:03.000Z | src/sage/modules/vector_symbolic_dense.py | sbt4104/sage | 2cbd93e0b78dec701f4b7ad9271d3b1e967bcd6c | [
"BSL-1.0"
] | null | null | null | src/sage/modules/vector_symbolic_dense.py | sbt4104/sage | 2cbd93e0b78dec701f4b7ad9271d3b1e967bcd6c | [
"BSL-1.0"
] | 3 | 2020-03-29T17:13:36.000Z | 2021-05-03T18:11:28.000Z | """
Vectors over the symbolic ring.
Implements vectors over the symbolic ring.
AUTHORS:
- Robert Bradshaw (2011-05-25): Added more element-wise simplification methods
- Joris Vankerschaver (2011-05-15): Initial version
EXAMPLES::
sage: x, y = var('x, y')
sage: u = vector([sin(x)^2 + cos(x)^2, log(2*y) + l... | 34.728814 | 108 | 0.59346 | 90 | 0.021962 | 0 | 0 | 0 | 0 | 0 | 0 | 3,524 | 0.859932 |
58a347a92a051b6eeb3be14043e523039fd31e40 | 784 | py | Python | backend/app/models/weather.py | francoiscolombo/webnews | 2f4c3fa5343919e6c658d97aebec4997d4d7ea48 | [
"MIT"
] | null | null | null | backend/app/models/weather.py | francoiscolombo/webnews | 2f4c3fa5343919e6c658d97aebec4997d4d7ea48 | [
"MIT"
] | 4 | 2021-03-10T12:26:29.000Z | 2022-02-27T02:00:32.000Z | backend/app/models/weather.py | francoiscolombo/webnews | 2f4c3fa5343919e6c658d97aebec4997d4d7ea48 | [
"MIT"
] | null | null | null | from app import db
from app.models.serializer import Serializer
class Weather(db.Model, Serializer):
id = db.Column(db.Integer, primary_key=True)
ip = db.Column(db.String(15), index=True, unique=True)
country = db.Column(db.String(80))
flag = db.Column(db.String(512))
town = db.Column(db.String(80... | 32.666667 | 70 | 0.672194 | 717 | 0.914541 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.024235 |
58a3ad8eacd907942afee36829131b2e139101c4 | 894 | py | Python | conu/backend/nspawn/constants.py | lslebodn/conu | dee6fd958471f77d1c0511b031ea136dfaf8a77a | [
"MIT"
] | 95 | 2018-05-19T14:35:08.000Z | 2022-01-08T23:31:40.000Z | conu/backend/nspawn/constants.py | lslebodn/conu | dee6fd958471f77d1c0511b031ea136dfaf8a77a | [
"MIT"
] | 179 | 2017-09-12T11:14:30.000Z | 2018-04-26T05:36:13.000Z | conu/backend/nspawn/constants.py | lslebodn/conu | dee6fd958471f77d1c0511b031ea136dfaf8a77a | [
"MIT"
] | 16 | 2018-05-09T14:15:32.000Z | 2021-08-02T21:11:33.000Z | # -*- coding: utf-8 -*-
#
# Copyright Contributors to the Conu project.
# SPDX-License-Identifier: MIT
#
# TODO: move this line to some generic constants, instead of same in
# docker and nspawn
CONU_ARTIFACT_TAG = 'CONU.'
CONU_IMAGES_STORE = "/opt/conu-nspawn-images/"
CONU_NSPAWN_BASEPACKAGES = [
"dnf",
"ipro... | 22.35 | 68 | 0.587248 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 488 | 0.545861 |
58a653052f6df764ec062ee02680225f5a15d5ec | 805 | py | Python | onnxruntime/python/tools/quantization/operators/qdq_base_operator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 669 | 2018-12-03T22:00:31.000Z | 2019-05-06T19:42:49.000Z | onnxruntime/python/tools/quantization/operators/qdq_base_operator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 440 | 2018-12-03T21:09:56.000Z | 2019-05-06T20:47:23.000Z | onnxruntime/python/tools/quantization/operators/qdq_base_operator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 140 | 2018-12-03T21:15:28.000Z | 2019-05-06T18:02:36.000Z | import itertools
from ..quant_utils import QuantizedValue, QuantizedValueType, attribute_to_kwarg, quantize_nparray
from .base_operator import QuantOperatorBase
class QDQOperatorBase:
def __init__(self, onnx_quantizer, onnx_node):
self.quantizer = onnx_quantizer
self.node = onnx_node
self... | 32.2 | 106 | 0.719255 | 640 | 0.795031 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58a66b1c1e9cbe9103fe7260fec4a45f53280f13 | 495 | py | Python | baya/tests/models.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | null | null | null | baya/tests/models.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | 1 | 2018-12-28T16:53:42.000Z | 2018-12-28T16:53:42.000Z | baya/tests/models.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Blag(models.Model):
name = models.CharField(max_length=128)
class BlagEntry(models.Model):
blag = models.ForeignKey(Blag)
title = models.CharField(max_length=255)
body = models.TextField()
class Meta:
verbose_name_plural = "... | 21.521739 | 47 | 0.711111 | 429 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 78 | 0.157576 |
58a67e64a1b78dbe199317a20cf65d4984a16e33 | 7,598 | py | Python | code/rec_eval.py | dawenl/content_wmf | b3e0a8eeb1b28836f280997c47444786afe91d3f | [
"MIT"
] | 24 | 2016-09-18T10:28:07.000Z | 2021-08-21T14:48:01.000Z | code/rec_eval.py | dawenl/content_wmf | b3e0a8eeb1b28836f280997c47444786afe91d3f | [
"MIT"
] | null | null | null | code/rec_eval.py | dawenl/content_wmf | b3e0a8eeb1b28836f280997c47444786afe91d3f | [
"MIT"
] | 15 | 2015-10-29T14:46:03.000Z | 2020-03-12T09:35:55.000Z | import bottleneck as bn
import numpy as np
from scipy import sparse
"""
All the data should be in the shape of (n_users, n_items)
All the latent factors should in the shape of (n_users/n_items, n_components)
1. train_data refers to the data that was used to train the model
2. heldout_data refers to the data that wa... | 37.613861 | 79 | 0.633325 | 0 | 0 | 262 | 0.034483 | 0 | 0 | 0 | 0 | 1,196 | 0.15741 |
58a6b4335eac35be6ee8f5597bc84e5d66427621 | 1,295 | py | Python | pgdrive/tests/vis_block/vis_std_t_intersection.py | decisionforce/pgdrive | 19af5d09a40a68a2a5f8b3ac8b40f109e71c26ee | [
"Apache-2.0"
] | 97 | 2020-12-25T06:02:17.000Z | 2022-01-16T06:58:39.000Z | pgdrive/tests/vis_block/vis_std_t_intersection.py | decisionforce/pgdrive | 19af5d09a40a68a2a5f8b3ac8b40f109e71c26ee | [
"Apache-2.0"
] | 192 | 2020-12-25T07:58:17.000Z | 2021-08-28T10:13:59.000Z | pgdrive/tests/vis_block/vis_std_t_intersection.py | decisionforce/pgdrive | 19af5d09a40a68a2a5f8b3ac8b40f109e71c26ee | [
"Apache-2.0"
] | 11 | 2020-12-29T11:23:44.000Z | 2021-12-06T23:25:49.000Z | from pgdrive.component.blocks.curve import Curve
from pgdrive.component.blocks.first_block import FirstPGBlock
from pgdrive.component.blocks.std_t_intersection import StdTInterSection
from pgdrive.component.blocks.straight import Straight
from pgdrive.component.road.road_network import RoadNetwork
from pgdrive.tests.vi... | 40.46875 | 86 | 0.766023 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.007722 |
58a742e0b8ad8aa4381262e4194d124ffb86733b | 6,241 | py | Python | version/v 4.0/spider/config.py | zhong-yan/neteasenews | 4dda8ef13d44f08e90e3869f4a7d972fb4b9feed | [
"Apache-2.0"
] | null | null | null | version/v 4.0/spider/config.py | zhong-yan/neteasenews | 4dda8ef13d44f08e90e3869f4a7d972fb4b9feed | [
"Apache-2.0"
] | null | null | null | version/v 4.0/spider/config.py | zhong-yan/neteasenews | 4dda8ef13d44f08e90e3869f4a7d972fb4b9feed | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
BASE_URL = 'http://news.163.com/'
# 首页ajax内容,无人机ajax,其实后面?callback=data_callback'可以省略
# 如何快速找到json链接?现在只能手工完成..添加每一个json文档
JSON_INDEX_URLS = [
'http://temp.163.com/special/00804KVA/cm_yaowen.js?callback=data_callback',
'http://house.163.com/special/00078GU7/guangzhou_xw_news_v1.j... | 54.745614 | 92 | 0.737863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,590 | 0.861723 |
58a7437e24bf8faeb840154530f279b8c6eee778 | 2,044 | py | Python | assignments/10_conserved/conserved.py | brianUA/be434-fall-2021 | bf0bb3f1c8129599818b98b7ee25b39aa926fd1f | [
"MIT"
] | null | null | null | assignments/10_conserved/conserved.py | brianUA/be434-fall-2021 | bf0bb3f1c8129599818b98b7ee25b39aa926fd1f | [
"MIT"
] | null | null | null | assignments/10_conserved/conserved.py | brianUA/be434-fall-2021 | bf0bb3f1c8129599818b98b7ee25b39aa926fd1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : Brian Scott <[email protected]>
Date : 2021-11-09
Purpose: FInd the similarities between sequences.
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
... | 27.621622 | 73 | 0.54501 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 829 | 0.405577 |
58a9853e032d70b843b4faffe8df15e8491bea40 | 13,999 | py | Python | ldss_spec/tools/spec_red.py | dsanmartim/ldss_specred | 8274ce0cf0eddfc7649106d7b9d0ce733e69c722 | [
"MIT"
] | null | null | null | ldss_spec/tools/spec_red.py | dsanmartim/ldss_specred | 8274ce0cf0eddfc7649106d7b9d0ce733e69c722 | [
"MIT"
] | null | null | null | ldss_spec/tools/spec_red.py | dsanmartim/ldss_specred | 8274ce0cf0eddfc7649106d7b9d0ce733e69c722 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# Loading a few python packages
import os
import glob
import warnings
from astropy import log
from astropy.io import fits as pyfits
import json
# Loading iraf packages
from pyraf import iraf
from pyraf.iraf import onedspec
from pyraf.iraf import twodspec, apextract
class ... | 37.733154 | 129 | 0.572541 | 13,683 | 0.977427 | 0 | 0 | 1,955 | 0.139653 | 0 | 0 | 5,614 | 0.401029 |
58a9c2475f1d862dde62daacb24c84dc06c0e208 | 1,667 | py | Python | lookupService/helpers/job_scheduler.py | selfjell/MirMachine | b61b555e7d0942f6fdcc53634469fffea2b92f4c | [
"MIT"
] | 1 | 2021-11-11T12:47:20.000Z | 2021-11-11T12:47:20.000Z | lookupService/helpers/job_scheduler.py | selfjell/MirMachine | b61b555e7d0942f6fdcc53634469fffea2b92f4c | [
"MIT"
] | null | null | null | lookupService/helpers/job_scheduler.py | selfjell/MirMachine | b61b555e7d0942f6fdcc53634469fffea2b92f4c | [
"MIT"
] | null | null | null | from ..models import Job
from engine.scripts.mirmachine_args import run_mirmachine
from .socket_helper import announce_status_change, announce_queue_position, announce_initiation, announce_completed
from .maintainer import clean_up_temporary_files
from django.utils import timezone
from MirMachineWebapp import user_conf... | 30.309091 | 115 | 0.718056 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.088782 |
542d0bbb398d02e9717cfe574c3d52048a5a205b | 836 | py | Python | Exercicios Colecoes Python/exercicio 33 - secao 7 - p1.py | cristinamais/exercicios_python | 8a09b0b68ffaa62d13afb952998e890a79667c7e | [
"MIT"
] | null | null | null | Exercicios Colecoes Python/exercicio 33 - secao 7 - p1.py | cristinamais/exercicios_python | 8a09b0b68ffaa62d13afb952998e890a79667c7e | [
"MIT"
] | null | null | null | Exercicios Colecoes Python/exercicio 33 - secao 7 - p1.py | cristinamais/exercicios_python | 8a09b0b68ffaa62d13afb952998e890a79667c7e | [
"MIT"
] | null | null | null | """
33 - Faca um programa que leia um vetor de 15 posicoes e o compacte, ou seja, elimine as posicoes com valor zero.
Para isso, todos os elementos a frente do valor zero, devem ser movidos uma posicao para tras no vetor.
"""
"""
vetor = []
count = 0
for x in range(1, 16):
vetor.append(int(input(f'Digite o {x}/15... | 22 | 113 | 0.626794 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 650 | 0.777512 |
542d7e740031b1e39b6ee826c5f6675358cb832c | 533 | py | Python | multimedia/Pygame/02-plot_pixels.py | vicente-gonzalez-ruiz/python-tutorial | e6a79510a0b3663786d6476a40e79fc8e8726f61 | [
"CC0-1.0"
] | 4 | 2017-03-06T09:49:11.000Z | 2019-10-16T00:09:38.000Z | multimedia/Pygame/02-plot_pixels.py | vicente-gonzalez-ruiz/python-tutorial | e6a79510a0b3663786d6476a40e79fc8e8726f61 | [
"CC0-1.0"
] | null | null | null | multimedia/Pygame/02-plot_pixels.py | vicente-gonzalez-ruiz/python-tutorial | e6a79510a0b3663786d6476a40e79fc8e8726f61 | [
"CC0-1.0"
] | 7 | 2017-11-02T11:00:30.000Z | 2020-01-31T22:41:27.000Z | import pygame
import my_colors as color
pygame.init()
screen_width = 800
screen_height = 600
screen_size = (screen_width, screen_height)
screen = pygame.display.set_mode(screen_size)
pygame.display.set_caption("Search the green pixel at the coordinates (x=10, y=100)")
running = True
while running:
screen.set_at((... | 24.227273 | 85 | 0.718574 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 67 | 0.125704 |