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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cffb6437c4e4737ed0d16d417d528aae9ad7f455 | 3,121 | py | Python | tests/views/test_plot_configuration_dialog.py | lsst-sitcom/spot_motion_monitor | 3d0242276198126240667ba13e95b7bdf901d053 | [
"BSD-3-Clause"
] | null | null | null | tests/views/test_plot_configuration_dialog.py | lsst-sitcom/spot_motion_monitor | 3d0242276198126240667ba13e95b7bdf901d053 | [
"BSD-3-Clause"
] | 5 | 2020-01-08T23:50:22.000Z | 2020-02-14T18:15:20.000Z | tests/views/test_plot_configuration_dialog.py | lsst-com/spot_motion_monitor | 3d0242276198126240667ba13e95b7bdf901d053 | [
"MIT"
] | null | null | null | # This file is part of spot_motion_monitor.
#
# Developed for LSST System Integration, Test and Commissioning.
#
# See the LICENSE file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a 3-clause BSD-style
# license that can be found in the LICE... | 45.231884 | 106 | 0.694008 | 2,627 | 0.841717 | 0 | 0 | 0 | 0 | 0 | 0 | 607 | 0.194489 |
cffcff915342cd1b241c4888358b81014d40b492 | 1,586 | py | Python | spider/pipelines.py | TeamDDH/bbk-server | 3fdd201e8b7854759b6f5113790d90adb9879b88 | [
"MIT"
] | 3 | 2018-08-20T04:57:57.000Z | 2021-11-01T01:27:34.000Z | spider/pipelines.py | TeamDDH/bbk-server | 3fdd201e8b7854759b6f5113790d90adb9879b88 | [
"MIT"
] | null | null | null | spider/pipelines.py | TeamDDH/bbk-server | 3fdd201e8b7854759b6f5113790d90adb9879b88 | [
"MIT"
] | 2 | 2019-06-18T09:00:46.000Z | 2020-04-09T20:32:45.000Z | # -*- coding: utf-8 -*-
"""
pipelines
~~~~~~~~~
:copyright: (c) 2017-18 by Wendell Hu.
:license: MIT, see LICENSE for more details.
"""
from scrapy.exceptions import DropItem
from .db import spider_session_generator, RawArticle
class ArticlePipeline(object):
"""Persist article items into databas... | 31.72 | 80 | 0.566204 | 1,337 | 0.843001 | 0 | 0 | 0 | 0 | 0 | 0 | 492 | 0.310214 |
cffe63c3675a8ef582e92a5d2831d5faa5ba38af | 1,268 | py | Python | commonmark/main.py | phst/commonmark.py | d031003aa23cfce1787cfb29c1eb109b369ca5b7 | [
"BSD-3-Clause"
] | 154 | 2015-12-10T23:17:28.000Z | 2019-04-04T06:49:36.000Z | commonmark/main.py | phst/commonmark.py | d031003aa23cfce1787cfb29c1eb109b369ca5b7 | [
"BSD-3-Clause"
] | 131 | 2019-07-02T15:56:33.000Z | 2022-03-25T19:54:02.000Z | commonmark/main.py | phst/commonmark.py | d031003aa23cfce1787cfb29c1eb109b369ca5b7 | [
"BSD-3-Clause"
] | 53 | 2015-12-08T18:06:51.000Z | 2019-05-02T18:08:10.000Z | # 2014 - Bibek Kafle & Roland Shoemaker
# 2015-2017 - Nikolas Nyby
# Port of @jgm's commonmark.js implementation of the CommonMark spec.
# Basic usage:
#
# import commonmark
# parser = commonmark.Parser()
# renderer = commonmark.HtmlRenderer()
# print(renderer.render(parser.parse('Hello *world*')))
from __future__ im... | 30.190476 | 69 | 0.669558 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 577 | 0.455047 |
cffe643a173408cf62f7360aa229e9e14fe19bb1 | 686 | py | Python | crowdsourcing/viewsets/drive.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | null | null | null | crowdsourcing/viewsets/drive.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | null | null | null | crowdsourcing/viewsets/drive.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | 2 | 2020-01-27T05:35:50.000Z | 2020-02-29T12:55:39.000Z | from rest_framework import viewsets
from rest_framework.response import Response
from crowdsourcing.serializers.accountModel import *
from crowdsourcing.models import *
from crowdsourcing.permissions.util import *
class AccountModelViewSet(viewsets.ModelViewSet):
queryset = AccountModel.objects.all()
seriali... | 32.666667 | 75 | 0.733236 | 468 | 0.682216 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
32018d05e0f153d9cb272bc8a457d7fb3169bb74 | 37,195 | py | Python | ktapp/views/web/user_profile.py | cu2/KT | 8a0964b77dce150358637faa679d969a07e42f07 | [
"CC-BY-3.0"
] | 5 | 2015-04-13T09:44:31.000Z | 2017-10-19T01:07:58.000Z | ktapp/views/web/user_profile.py | cu2/KT | 8a0964b77dce150358637faa679d969a07e42f07 | [
"CC-BY-3.0"
] | 49 | 2015-02-15T07:12:05.000Z | 2022-03-11T23:11:43.000Z | ktapp/views/web/user_profile.py | cu2/KT | 8a0964b77dce150358637faa679d969a07e42f07 | [
"CC-BY-3.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import math
from django.db import connection
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.db.models... | 45.249392 | 171 | 0.652561 | 0 | 0 | 0 | 0 | 7,663 | 0.206022 | 0 | 0 | 11,231 | 0.301949 |
3203fae2c1ebbadbcbadad1e8f81eafc6e2e9be9 | 353 | py | Python | snippet/py/ver_division.py | walker-zheng/code | 2959e4227e168aab4d5420bc836768730f2bffdd | [
"MIT"
] | 4 | 2018-05-18T10:58:41.000Z | 2021-12-29T16:17:53.000Z | snippet/py/ver_division.py | walker-zheng/code | 2959e4227e168aab4d5420bc836768730f2bffdd | [
"MIT"
] | 4 | 2017-10-09T09:42:09.000Z | 2019-02-21T01:31:09.000Z | snippet/py/ver_division.py | walker-zheng/code | 2959e4227e168aab4d5420bc836768730f2bffdd | [
"MIT"
] | 1 | 2021-04-09T00:58:19.000Z | 2021-04-09T00:58:19.000Z | #!/usr/bin/python
import os ,Image
j = 1
dir="./code/"
for f in os.listdir(dir):
if f.endswith(".jpg"):
img = Image.open(dir+f)
img = img.convert('RGB')
for i in range(6):
x = 5 + i*9
y = 6
img.crop((x, y, x+9, y+13)).save("font/%d.jpg" % j)
... | 19.611111 | 63 | 0.430595 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 0.152975 |
320512f0c69af9c1065d29be90296020700656ad | 141 | py | Python | testing/pkg1/patchingmod_main.py | mxr/pymonkey | f2e55590c7064019e928eddc41dad5d288722ce6 | [
"MIT"
] | 4 | 2018-04-02T18:10:02.000Z | 2019-09-28T21:43:56.000Z | testing/pkg1/patchingmod_main.py | mxr/pymonkey | f2e55590c7064019e928eddc41dad5d288722ce6 | [
"MIT"
] | 4 | 2016-05-05T02:08:59.000Z | 2017-08-15T01:33:19.000Z | testing/pkg1/patchingmod_main.py | mxr/pymonkey | f2e55590c7064019e928eddc41dad5d288722ce6 | [
"MIT"
] | 1 | 2018-04-09T15:14:33.000Z | 2018-04-09T15:14:33.000Z | from pymonkey import make_entry_point
main = make_entry_point(('patchingmod',), 'targetmod')
if __name__ == '__main__':
exit(main())
| 15.666667 | 54 | 0.70922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0.241135 |
32051e69655135f9cec16bd36a2816331e97b889 | 279 | py | Python | tatk/dst/trade/multiwoz/trade.py | libing125/tatk | 1473a162cf45a4a40a60473169bc034234412b2e | [
"Apache-2.0"
] | 81 | 2019-03-12T13:40:29.000Z | 2022-01-17T10:59:21.000Z | tatk/dst/trade/multiwoz/trade.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 35 | 2019-03-13T14:05:05.000Z | 2021-08-25T15:38:14.000Z | tatk/dst/trade/multiwoz/trade.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 41 | 2019-03-13T09:40:24.000Z | 2022-03-07T17:59:07.000Z | class TRADE:
def __init__(self):
pass
def update(self, user_act, history):
"""
Args:
user_act: dict
history: [[system, user], [s, u], ...]
Returns:
The current dialogue state.
"""
pass
| 18.6 | 50 | 0.451613 | 278 | 0.996416 | 0 | 0 | 0 | 0 | 0 | 0 | 165 | 0.591398 |
32059ef6b7d6492ac78fa492483daba2584c090a | 18,502 | py | Python | metrics.py | adamtiger/CPmethod | 9220d39f2f8cbfc191a89418c8795eabf09469d0 | [
"MIT"
] | null | null | null | metrics.py | adamtiger/CPmethod | 9220d39f2f8cbfc191a89418c8795eabf09469d0 | [
"MIT"
] | null | null | null | metrics.py | adamtiger/CPmethod | 9220d39f2f8cbfc191a89418c8795eabf09469d0 | [
"MIT"
] | 1 | 2019-11-20T15:48:57.000Z | 2019-11-20T15:48:57.000Z | from dataloader_utils import Gender, HeartPart, EndPhase
from enum import Enum
import numpy as np
import math
import cv2
# --------------------------------------
# Shape (contour) similarity
# --------------------------------------
def __areas(curve1, curve2):
# floats come in
# find the corners of the bbox
... | 37.15261 | 117 | 0.600908 | 8,068 | 0.436061 | 0 | 0 | 1,590 | 0.085937 | 0 | 0 | 3,885 | 0.209977 |
3205fc49b31c38e613e355108db58e375a25db95 | 1,107 | py | Python | app/users/migrations/0005_auto_20180322_1621.py | StrandHQ/strand-api | afa2da651ef9046ea39c044a65bdd88d814838b4 | [
"MIT"
] | 1 | 2018-10-23T16:02:54.000Z | 2018-10-23T16:02:54.000Z | app/users/migrations/0005_auto_20180322_1621.py | StrandHQ/strand-api | afa2da651ef9046ea39c044a65bdd88d814838b4 | [
"MIT"
] | 3 | 2020-06-05T18:21:51.000Z | 2021-06-10T20:25:15.000Z | app/users/migrations/0005_auto_20180322_1621.py | tadasant/strand-api | afa2da651ef9046ea39c044a65bdd88d814838b4 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-09 18:07
from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations
def set_default_group_permissions(apps, schema_editor):
"""Get or create the d... | 28.384615 | 104 | 0.717254 | 199 | 0.179765 | 0 | 0 | 0 | 0 | 0 | 0 | 310 | 0.280036 |
3206936433ce667f0ce4f6df51f664f04496ea93 | 9,077 | py | Python | coinbase.py | foppini975/FinRL | aead943817d1387dc3654de2c189767d10140b78 | [
"MIT"
] | null | null | null | coinbase.py | foppini975/FinRL | aead943817d1387dc3654de2c189767d10140b78 | [
"MIT"
] | null | null | null | coinbase.py | foppini975/FinRL | aead943817d1387dc3654de2c189767d10140b78 | [
"MIT"
] | null | null | null | # Coinbase Pro library:
# https://github.com/danpaquin/coinbasepro-python
#curl "https://api.pro.coinbase.com/products/BTC-USD/candles?start=2021-01-01T12:00:00&end=2021-01-12T12:00:00&granularity=3600"
import cbpro
import numpy as np
import pandas as pd
import logging
from datetime import datetime, timedelta
imp... | 46.076142 | 128 | 0.593588 | 8,701 | 0.958577 | 0 | 0 | 385 | 0.042415 | 0 | 0 | 2,385 | 0.262752 |
3206d78caefb347d3aafe66f87b062f05ea1e6f8 | 1,134 | py | Python | tests/integration/shell/runner.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | 1 | 2015-06-05T13:47:02.000Z | 2015-06-05T13:47:02.000Z | tests/integration/shell/runner.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | tests/integration/shell/runner.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | '''
Tests for the salt-run command
'''
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class RunTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
'''
Test the salt-run command
'''
_call_... | 24.652174 | 76 | 0.617284 | 857 | 0.755732 | 0 | 0 | 0 | 0 | 0 | 0 | 418 | 0.368607 |
320a56299d5b0a2df9ef09f9fd22f38ffc418aca | 8,229 | py | Python | stacktach/stacklog.py | PreetiKamble29/stacktach | f4f905393a0d7eaa226a72b6a27b61e4ef52211d | [
"Apache-2.0"
] | null | null | null | stacktach/stacklog.py | PreetiKamble29/stacktach | f4f905393a0d7eaa226a72b6a27b61e4ef52211d | [
"Apache-2.0"
] | 4 | 2020-02-28T10:27:34.000Z | 2022-02-02T01:13:09.000Z | stacktach/stacklog.py | PreetiKamble29/stacktach | f4f905393a0d7eaa226a72b6a27b61e4ef52211d | [
"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... | 34.2875 | 97 | 0.655244 | 4,475 | 0.543808 | 0 | 0 | 0 | 0 | 0 | 0 | 2,018 | 0.24523 |
320cdcd9ce44fc3ffc19a1a748600d473ae84e85 | 785 | py | Python | admin/collection_providers/urls.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | admin/collection_providers/urls.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | 20 | 2020-03-24T16:48:03.000Z | 2022-03-08T22:38:38.000Z | admin/collection_providers/urls.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = 'admin'
urlpatterns = [
url(r'^create/$', views.CreateCollectionProvider.as_view(), name='create'),
url(r'^$', views.CollectionProviderList.as_view(), name='list'),
url(r'^import/$', views.ImportCollectionProvider.as_view(), name='import'),
... | 52.333333 | 117 | 0.699363 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 283 | 0.36051 |
320d4ac1c04314ad47e8ce414ec8f5ce00f6d0a4 | 1,087 | py | Python | Chapter07/plotly_flask_demo1/template2.py | allen-zqh/plotly | bcaf0930901e77db07245b63bff049eb75893416 | [
"MIT"
] | null | null | null | Chapter07/plotly_flask_demo1/template2.py | allen-zqh/plotly | bcaf0930901e77db07245b63bff049eb75893416 | [
"MIT"
] | null | null | null | Chapter07/plotly_flask_demo1/template2.py | allen-zqh/plotly | bcaf0930901e77db07245b63bff049eb75893416 | [
"MIT"
] | 1 | 2021-02-04T06:56:18.000Z | 2021-02-04T06:56:18.000Z | from flask import render_template
from flask import Flask
import plotly as py
import plotly.graph_objs as go
app = Flask(__name__)
@app.route('/')
def index():
pyplt = py.offline.plot
trace0 = go.Bar(
x=['A类户型', 'B类户型', 'C类户型'],
y=[20, 14, 23],
text=['27%市场占有率', '24%市场占有率', '19%市场占有率... | 22.645833 | 97 | 0.547378 | 0 | 0 | 0 | 0 | 989 | 0.840272 | 0 | 0 | 270 | 0.229397 |
320ed9f71383693ed5738f144db75650764b8b50 | 79 | py | Python | test_custom_user_subclass/__init__.py | montebond/pyp | 9a0356f8ade44fd813e03d54f5b934336c6b6656 | [
"BSD-3-Clause"
] | 238 | 2015-01-05T16:51:00.000Z | 2022-03-31T16:06:19.000Z | test_custom_user_subclass/__init__.py | montebond/pyp | 9a0356f8ade44fd813e03d54f5b934336c6b6656 | [
"BSD-3-Clause"
] | 32 | 2015-02-20T18:10:15.000Z | 2022-03-29T18:54:04.000Z | test_custom_user_subclass/__init__.py | montebond/pyp | 9a0356f8ade44fd813e03d54f5b934336c6b6656 | [
"BSD-3-Clause"
] | 72 | 2015-01-05T16:56:24.000Z | 2022-02-27T17:34:48.000Z | default_app_config = 'test_custom_user_subclass.apps.CustomUserSubclassConfig'
| 39.5 | 78 | 0.898734 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 57 | 0.721519 |
320ee976739f42fedf893794dfa5031aa4b5791f | 1,488 | py | Python | app/models.py | pianomanfrazier/simple-blog | e3e1058c83726ec49273323625fcc3e721618d3d | [
"MIT"
] | null | null | null | app/models.py | pianomanfrazier/simple-blog | e3e1058c83726ec49273323625fcc3e721618d3d | [
"MIT"
] | null | null | null | app/models.py | pianomanfrazier/simple-blog | e3e1058c83726ec49273323625fcc3e721618d3d | [
"MIT"
] | null | null | null | from datetime import datetime
from app import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64), index=True, unique=True)
email = db.Column(db.String(64))
class Category(db.Model):
category = db.Column(db.String(32), primary_key=T... | 38.153846 | 75 | 0.645161 | 1,425 | 0.957661 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
320f12ab86bda006032ebb1d2d905632503cf322 | 3,360 | py | Python | cs15211/MajorityElement.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2021-07-05T01:53:30.000Z | 2021-07-05T01:53:30.000Z | cs15211/MajorityElement.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | null | null | null | cs15211/MajorityElement.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2018-01-08T07:14:08.000Z | 2018-01-08T07:14:08.000Z | __source__ = 'https://leetcode.com/problems/majority-element/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/majority-element.py
# Time: O(n)
# Space: O(1)
#
# Description: Leetcode # 169. Majority Element
#
# Given an array of size n, find the majority element.
# The majority element is the element that a... | 24.347826 | 96 | 0.507738 | 588 | 0.175 | 0 | 0 | 0 | 0 | 0 | 0 | 2,723 | 0.810417 |
320f405199d5ce9241ae050a831d48536cdecf70 | 150 | py | Python | ncmw/setup_models/__init__.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 5 | 2022-01-19T12:55:35.000Z | 2022-03-10T13:17:22.000Z | ncmw/setup_models/__init__.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 5 | 2022-02-18T08:17:04.000Z | 2022-02-23T13:50:15.000Z | ncmw/setup_models/__init__.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 1 | 2021-12-02T12:23:59.000Z | 2021-12-02T12:23:59.000Z | from .setup import (
create_consistent_model,
set_default_configs_and_snm3_medium,
gapfill_model,
gapfill_medium,
score_memote,
)
| 18.75 | 40 | 0.746667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
320f930d9ba74b1df7112b848be26ad7f7ad719b | 4,101 | py | Python | scraper/log.py | micort35/prestiology | 729d4558005e1c6d07ac5044ff10cbb1b7a522c6 | [
"MIT"
] | null | null | null | scraper/log.py | micort35/prestiology | 729d4558005e1c6d07ac5044ff10cbb1b7a522c6 | [
"MIT"
] | null | null | null | scraper/log.py | micort35/prestiology | 729d4558005e1c6d07ac5044ff10cbb1b7a522c6 | [
"MIT"
] | null | null | null | import statistics
from datetime import date
import psycopg2
from psycopg2 import sql
class Log:
def __init__(self, score, gameday):
#gather player data
self.name = score.get('name')
self.team = (score.get('team')).name
self.date = gameday
self.mins = round(((score.get('seco... | 41.424242 | 121 | 0.568642 | 4,015 | 0.97903 | 0 | 0 | 0 | 0 | 0 | 0 | 1,283 | 0.312851 |
32117082982e1b0cb2bf7bcfb0c7a96c4bf33ab1 | 14,141 | py | Python | main.py | VuNguyenQS/My-capstone-project | 219bdd50aa046bbecc30496cfdba39ea8799537c | [
"MIT"
] | null | null | null | main.py | VuNguyenQS/My-capstone-project | 219bdd50aa046bbecc30496cfdba39ea8799537c | [
"MIT"
] | null | null | null | main.py | VuNguyenQS/My-capstone-project | 219bdd50aa046bbecc30496cfdba39ea8799537c | [
"MIT"
] | null | null | null | import os
import time
import csv
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.optim
cudnn.benchmark = True
from models import ResNet
from metrics import AverageMeter, Result
from dataloaders.dense_to_sparse import UniformSampling, SimulatedStereo
import criteria
import utils
# Th... | 40.402857 | 148 | 0.617849 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,313 | 0.234283 |
32154a7bfec8aa22a3e74820b2c2af57fc5f81c6 | 647 | py | Python | reports/forms.py | kreeger/etcetera | a0e82e56ffc76cbc73aa59e23f6a77fce92fad08 | [
"BSD-3-Clause"
] | 1 | 2015-02-26T20:47:40.000Z | 2015-02-26T20:47:40.000Z | reports/forms.py | kreeger/etcetera | a0e82e56ffc76cbc73aa59e23f6a77fce92fad08 | [
"BSD-3-Clause"
] | null | null | null | reports/forms.py | kreeger/etcetera | a0e82e56ffc76cbc73aa59e23f6a77fce92fad08 | [
"BSD-3-Clause"
] | null | null | null | import urllib
from django import forms
from etcetera.reports import models as reports
from etcetera.extras.dateutil import formfield_callback, DateTimeField
class SearchForm(forms.Form):
q = forms.CharField(max_length=50)
def get_list(self):
# The search list is automatically everything
... | 24.884615 | 70 | 0.678516 | 485 | 0.749614 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.106646 |
32180c83a0a4b8233e9903ee6c946175a6e07df6 | 2,873 | py | Python | cac/server/announcement.py | tobias93/cards-against-cli | 33c5a43a3b821438c94da719571655d87998384a | [
"MIT"
] | null | null | null | cac/server/announcement.py | tobias93/cards-against-cli | 33c5a43a3b821438c94da719571655d87998384a | [
"MIT"
] | null | null | null | cac/server/announcement.py | tobias93/cards-against-cli | 33c5a43a3b821438c94da719571655d87998384a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Handles the service announcement of the Cards against Cli Server.
Debugging command: (linux, requires avahi)
(A similar command should be available using bonjour on mac)
> avahi-browse --resolve "_cac._tcp"
Use the environment variable CAC_LISTEN_INTERFACES to control,
on which interface(s)... | 29.618557 | 78 | 0.674904 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 883 | 0.307344 |
3218c85b611430d9cfad372e384dd6e2a555de20 | 1,440 | py | Python | Python-desenvolvimento/ex059.py | MarcosMaciel-MMRS/Desenvolvimento-python | 2b2fc54788da3ca110d495b9e80a494f2b31fb09 | [
"MIT"
] | null | null | null | Python-desenvolvimento/ex059.py | MarcosMaciel-MMRS/Desenvolvimento-python | 2b2fc54788da3ca110d495b9e80a494f2b31fb09 | [
"MIT"
] | null | null | null | Python-desenvolvimento/ex059.py | MarcosMaciel-MMRS/Desenvolvimento-python | 2b2fc54788da3ca110d495b9e80a494f2b31fb09 | [
"MIT"
] | null | null | null | #o programa vai ler 2 números, em seguida mostrar um menu.
''' O programa vai pedir 2 número.
Tabela
[1]- Soma
[2]- Multiplica
[3]- Maior
[4]-Novos números
[5]- sair
'''
from time import sleep
n1 = int(input('Informe o primeiro núm... | 30.638298 | 87 | 0.4875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 786 | 0.539095 |
321a077e7efc9d3ad00c1d1ebd91b91a3a74dcc6 | 3,320 | py | Python | mdstudio_cli/wamp_services.py | MD-Studio/lie_cli | 567c2c7f146898b804f418e052f01960fca7e0d4 | [
"Apache-2.0"
] | null | null | null | mdstudio_cli/wamp_services.py | MD-Studio/lie_cli | 567c2c7f146898b804f418e052f01960fca7e0d4 | [
"Apache-2.0"
] | 1 | 2019-12-03T10:47:11.000Z | 2019-12-03T10:47:11.000Z | mdstudio_cli/wamp_services.py | MD-Studio/MDStudio_cli | 567c2c7f146898b804f418e052f01960fca7e0d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
file: wamp_services.py
WAMP service methods the module exposes.
"""
import os
import json
import logging
from twisted.internet import reactor
from autobahn.wamp.exception import ApplicationError
from graphit.graph_io.io_jsonschema_format import read_json_schema
from mdstudio.component.s... | 29.380531 | 104 | 0.656928 | 2,726 | 0.821084 | 954 | 0.287349 | 969 | 0.291867 | 0 | 0 | 1,220 | 0.36747 |
321a849775e824655942ecde437bbf281050052a | 4,692 | py | Python | code_verification.py | KeithYue/weibo-keywords-crawler | 6d90dea6c1619e06b1846f849e3c3c89fad26dd8 | [
"MIT"
] | 16 | 2015-03-08T20:32:47.000Z | 2021-12-26T09:11:34.000Z | code_verification.py | KeithYue/weibo-keywords-crawler | 6d90dea6c1619e06b1846f849e3c3c89fad26dd8 | [
"MIT"
] | 1 | 2015-04-10T03:15:23.000Z | 2016-04-10T12:16:58.000Z | code_verification.py | KeithYue/weibo-keywords-crawler | 6d90dea6c1619e06b1846f849e3c3c89fad26dd8 | [
"MIT"
] | 13 | 2015-10-15T07:37:35.000Z | 2021-12-26T09:14:01.000Z | # coding=utf-8
import base64
import time
import logging
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.common.exceptions import NoSuchElementException
from PIL import Image
from io import StringIO, BytesIO
from synchronize_util import synchron... | 31.702703 | 107 | 0.660912 | 0 | 0 | 0 | 0 | 348 | 0.073171 | 0 | 0 | 2,203 | 0.463204 |
321b20f9d6d0aa3b0ffc1a6053b57cbad71ac3d1 | 40 | py | Python | lspy/__init__.py | liushilive/PythonTutor | 967cdc842fcfef7477110889e2d947116a2448c7 | [
"MIT"
] | null | null | null | lspy/__init__.py | liushilive/PythonTutor | 967cdc842fcfef7477110889e2d947116a2448c7 | [
"MIT"
] | null | null | null | lspy/__init__.py | liushilive/PythonTutor | 967cdc842fcfef7477110889e2d947116a2448c7 | [
"MIT"
] | 3 | 2020-08-30T06:00:06.000Z | 2022-01-06T12:36:43.000Z | __version__ = "0.0.4"
__author__ = "刘士"
| 13.333333 | 21 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0.340909 |
321decb6ca970c41a09fbd744d03c6e085870fdf | 3,800 | py | Python | src/printer.py | 93suhwan/python-sos | 47ac07fa4a8c670cf7fdd436d61d8aa2caa9fcc5 | [
"MIT"
] | null | null | null | src/printer.py | 93suhwan/python-sos | 47ac07fa4a8c670cf7fdd436d61d8aa2caa9fcc5 | [
"MIT"
] | null | null | null | src/printer.py | 93suhwan/python-sos | 47ac07fa4a8c670cf7fdd436d61d8aa2caa9fcc5 | [
"MIT"
] | null | null | null | from visitor import PrintVisitor
class Printer(PrintVisitor):
"""A simple pretty-printer class"""
def __init__(self):
self._indent = 0
def print_Lambda(self, node):
var_name = node.var.name
indent_prev = self._indent
self._indent = 0
exp_str = self.print(node.exp)
... | 32.20339 | 70 | 0.564737 | 3,764 | 0.990526 | 0 | 0 | 0 | 0 | 0 | 0 | 200 | 0.052632 |
321e6aa3a34d2b1a511cf34c749778b9c25dfae5 | 3,364 | py | Python | util/triplet_loss.py | mbanani/pytorch-magnet-loss | 9919be9684f765aaaa33ef49ad08502a342bf417 | [
"MIT"
] | 11 | 2018-04-19T15:17:45.000Z | 2021-01-03T15:39:26.000Z | util/triplet_loss.py | mbanani/pytorch-magnet-loss | 9919be9684f765aaaa33ef49ad08502a342bf417 | [
"MIT"
] | 1 | 2020-07-27T13:01:16.000Z | 2020-07-27T13:01:16.000Z | util/triplet_loss.py | mbanani/pytorch-magnet-loss | 9919be9684f765aaaa33ef49ad08502a342bf417 | [
"MIT"
] | 6 | 2018-04-19T13:55:15.000Z | 2021-12-14T16:22:34.000Z | """
A PyTorch implmentation of the KL-Divergence Loss as described in (https://arxiv.org/abs/1511.06321)
Lua Implementation (not inspected yet TODO) (https://github.com/yenchanghsu/NNclustering/blob/master/BatchKLDivCriterion.lua)
"""
import torch
import torch.nn.functional as F
from torch import nn
import numpy as ... | 36.967033 | 185 | 0.540131 | 3,013 | 0.89566 | 0 | 0 | 0 | 0 | 0 | 0 | 1,145 | 0.340369 |
321e85edacc121735ab053bcc8ba4d291a252957 | 2,505 | py | Python | IRIS_data_download/IRIS_download_support/obspy/io/y/tests/test_core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/io/y/tests/test_core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/io/y/tests/test_core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
import os
import unittest
import warnings
from obspy.io.y.core import _is_y, _read_y
class CoreTestCase(unittest.TestCase):
"""
Nanometri... | 33.4 | 78 | 0.621557 | 2,109 | 0.841916 | 0 | 0 | 0 | 0 | 0 | 0 | 517 | 0.206387 |
321f7027c4b3e142783807c61cd763b71e69de66 | 456 | py | Python | nick_derobertis_site/software_page/config/page.py | nickderobertis/nick-derobertis-site | 386061dc258921eed41f2d3965ef69e02adde7ba | [
"MIT"
] | 1 | 2022-03-31T10:55:40.000Z | 2022-03-31T10:55:40.000Z | nick_derobertis_site/software_page/config/page.py | nickderobertis/nick-derobertis-site | 386061dc258921eed41f2d3965ef69e02adde7ba | [
"MIT"
] | 8 | 2020-08-28T11:44:37.000Z | 2020-08-31T09:19:19.000Z | nick_derobertis_site/software_page/config/page.py | nickderobertis/nick-derobertis-site | 386061dc258921eed41f2d3965ef69e02adde7ba | [
"MIT"
] | null | null | null | from nick_derobertis_site.software_page.config.banner import SOFTWARE_BANNER_MODEL
from nick_derobertis_site.software_page.config.card import SOFTWARE_CARD_MODELS
from nick_derobertis_site.software_page.software_page_model import SoftwarePageModel
SOFTWARE_PAGE_MODEL = SoftwarePageModel(
page_title="Nick DeRoberti... | 45.6 | 84 | 0.859649 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0.107456 |
321fe3fffb7f34d969a6ea5e9ebdd09311e57e9d | 409 | py | Python | aa/single_pages/views.py | kimdonggun12/Django_site | 98dd0ceaca30f6c966dde7475637106e38f12e51 | [
"MIT"
] | null | null | null | aa/single_pages/views.py | kimdonggun12/Django_site | 98dd0ceaca30f6c966dde7475637106e38f12e51 | [
"MIT"
] | null | null | null | aa/single_pages/views.py | kimdonggun12/Django_site | 98dd0ceaca30f6c966dde7475637106e38f12e51 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from blog.models import Post
# Create your views here.
def landing(request):
recent_posts = Post.objects.order_by('-pk')[:3]
return render(
request,
'single_pages/landing.html',
{
'recent_posts': recent_posts,
}
)
def aboutm... | 19.47619 | 51 | 0.611247 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 98 | 0.239609 |
32259b79359f50ecade0ee8800c6824d9a8c8b29 | 279 | py | Python | hausl_bot/my_ip_fetcher.py | Michael-List/hauslbot | 62fd3f789481929f78e86f1be777f2f3835838d1 | [
"MIT"
] | null | null | null | hausl_bot/my_ip_fetcher.py | Michael-List/hauslbot | 62fd3f789481929f78e86f1be777f2f3835838d1 | [
"MIT"
] | 4 | 2019-04-21T15:59:17.000Z | 2019-05-03T12:43:21.000Z | hausl_bot/my_ip_fetcher.py | Michael-List/hauslbot | 62fd3f789481929f78e86f1be777f2f3835838d1 | [
"MIT"
] | null | null | null | import requests
class MyIPFetcher:
@staticmethod
def fetch_ip():
r = requests.get('https://api.ipify.org')
if r.status_code != 200:
return 'Could not get the ip address. Status: ' + r.status_code
return 'The public ip is: ' + r.text | 25.363636 | 75 | 0.605735 | 261 | 0.935484 | 0 | 0 | 238 | 0.853047 | 0 | 0 | 83 | 0.297491 |
5c4d369413fd643cd1e49d231d62a011fe2c227d | 7,032 | py | Python | blender/addons/io_scene_fmod/__init__.py | tkgamegroup/flame | f1628100cc66e13f84ea3047ea33af019caeb01b | [
"MIT"
] | 25 | 2018-02-28T05:59:50.000Z | 2022-03-18T03:11:52.000Z | blender/addons/io_scene_fmod/__init__.py | tkgamegroup/flame | e5884c7a773c351f3dadadbdb908cfe00f1ce586 | [
"MIT"
] | null | null | null | blender/addons/io_scene_fmod/__init__.py | tkgamegroup/flame | e5884c7a773c351f3dadadbdb908cfe00f1ce586 | [
"MIT"
] | 5 | 2018-05-17T04:16:30.000Z | 2021-12-22T04:02:02.000Z | bl_info = {
"name": "flame model format",
"blender": (2, 81, 6),
"category": "Import-Export",
}
import bpy
from bpy.props import (
BoolProperty,
FloatProperty,
StringProperty,
EnumProperty,
)
from bpy_extras.io_utils import (
ImportHelper,
ExportHelpe... | 30.977974 | 154 | 0.55347 | 4,480 | 0.637088 | 0 | 0 | 0 | 0 | 0 | 0 | 399 | 0.056741 |
5c4f3ff0fca74925cdc32cdab044c3f0a4860df6 | 1,616 | py | Python | tests/dataverk/connectors/storage/test_nais_s3_storage_connector.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 3 | 2019-09-29T20:48:46.000Z | 2021-03-31T10:16:07.000Z | tests/dataverk/connectors/storage/test_nais_s3_storage_connector.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 148 | 2019-02-08T12:30:58.000Z | 2021-03-11T15:31:55.000Z | tests/dataverk/connectors/storage/test_nais_s3_storage_connector.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 1 | 2020-11-18T14:10:05.000Z | 2020-11-18T14:10:05.000Z | import unittest
import requests
from unittest import mock
from dataverk.connectors import NaisS3Connector
from tests.dataverk.connectors.storage.test_resources.mock_nais_s3_api import mock_requests_put, mock_requests_get
from tests.dataverk.connectors.storage.test_resources.nais_s3_storage_common import NAIS_S3_ENDPOI... | 48.969697 | 122 | 0.799505 | 1,196 | 0.740099 | 0 | 0 | 963 | 0.595916 | 0 | 0 | 131 | 0.081064 |
5c5070cb18878ecd7f37417f5ff3abcf765afa7a | 222 | py | Python | tests/template_backends/test_django.py | arachnegl/django | c4e796aa1bab70ee66151d24a061af811e08ad08 | [
"BSD-3-Clause"
] | 1 | 2019-01-14T10:58:43.000Z | 2019-01-14T10:58:43.000Z | tests/template_backends/test_django.py | arachnegl/django | c4e796aa1bab70ee66151d24a061af811e08ad08 | [
"BSD-3-Clause"
] | null | null | null | tests/template_backends/test_django.py | arachnegl/django | c4e796aa1bab70ee66151d24a061af811e08ad08 | [
"BSD-3-Clause"
] | null | null | null | from django.template.backends.django import DjangoTemplates
from .test_dummy import TemplateStringsTests
class DjangoTemplatesTests(TemplateStringsTests):
engine_class = DjangoTemplates
backend_name = 'django'
| 22.2 | 59 | 0.824324 | 113 | 0.509009 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.036036 |
5c50c15b31a06a2fc340734629a90deb26627e13 | 275 | py | Python | onlineshopping/cart/templatetags/cart_tag.py | SarahMohamedAbdAlkader/DjangoEcommerceProject | edfe3071e5ee301702ff8e55a513efbb8feadab8 | [
"MIT"
] | 1 | 2021-01-27T03:20:45.000Z | 2021-01-27T03:20:45.000Z | onlineshopping/cart/templatetags/cart_tag.py | SarahMohamedAbdAlkader/DjangoEcommerceProject | edfe3071e5ee301702ff8e55a513efbb8feadab8 | [
"MIT"
] | null | null | null | onlineshopping/cart/templatetags/cart_tag.py | SarahMohamedAbdAlkader/DjangoEcommerceProject | edfe3071e5ee301702ff8e55a513efbb8feadab8 | [
"MIT"
] | 1 | 2020-03-24T21:28:31.000Z | 2020-03-24T21:28:31.000Z | from django import template
from cart.models import Order
register = template.Library()
@register.filter
def cart_total(user):
order = Order.objects.filter(user=user, ordered=False)
if order.exists():
return order[0].orderitems.count()
else:
return 0 | 21.153846 | 58 | 0.716364 | 0 | 0 | 0 | 0 | 185 | 0.672727 | 0 | 0 | 0 | 0 |
5c51c0397e0805fb91d95ef1e2d33d5b04ad1808 | 1,466 | py | Python | scripts/tomidi.py | callistachang/CycleGAN-Music-Transfer | 928e87b4bebc4da1dcf7c43936d2c10fe76170f1 | [
"MIT"
] | null | null | null | scripts/tomidi.py | callistachang/CycleGAN-Music-Transfer | 928e87b4bebc4da1dcf7c43936d2c10fe76170f1 | [
"MIT"
] | 1 | 2021-07-07T13:36:18.000Z | 2021-07-07T13:36:18.000Z | scripts/tomidi.py | callistachang/CycleGAN-Music-Transfer | 928e87b4bebc4da1dcf7c43936d2c10fe76170f1 | [
"MIT"
] | null | null | null | import numpy as np
from working import writemidi
def load_npy_data(npy_data):
npy_A = np.load(npy_data[0]) * 1.0 # 64 * 84 * 1
npy_B = np.load(npy_data[1]) * 1.0 # 64 * 84 * 1
npy_AB = np.concatenate(
(
npy_A.reshape(npy_A.shape[0], npy_A.shape[1], 1),
npy_B.reshape(npy_B... | 28.192308 | 80 | 0.566849 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 93 | 0.063438 |
5c537a8e61ec1322b58888794e0c3ec98800a4b8 | 7,087 | py | Python | boa3_test/tests/compiler_tests/test_class.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | null | null | null | boa3_test/tests/compiler_tests/test_class.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | null | null | null | boa3_test/tests/compiler_tests/test_class.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | null | null | null | from boa3.boa3 import Boa3
from boa3.exception import CompilerError
from boa3.neo.cryptography import hash160
from boa3.neo.vm.type.String import String
from boa3_test.tests.boa_test import BoaTest
from boa3_test.tests.test_classes.testengine import TestEngine
class TestClass(BoaTest):
default_folder: str = 'tes... | 41.688235 | 82 | 0.699732 | 6,823 | 0.962749 | 0 | 0 | 0 | 0 | 0 | 0 | 799 | 0.112742 |
5c541aa9113adae24d37bc78ba5676b3f3fe64e0 | 524 | py | Python | cdwar1.py | fernandopm248/digital-root | b2039eb50a9a23b0a7799dfd36c1a3380b841ed9 | [
"MIT"
] | null | null | null | cdwar1.py | fernandopm248/digital-root | b2039eb50a9a23b0a7799dfd36c1a3380b841ed9 | [
"MIT"
] | null | null | null | cdwar1.py | fernandopm248/digital-root | b2039eb50a9a23b0a7799dfd36c1a3380b841ed9 | [
"MIT"
] | null | null | null | def digital_root (n):
total = 10
while total > 9 :
total = 0
x = str(n)
stringfy = []
cont = (len(x))
i = 0
e = 1
num = []
while i < cont :
stringfy += x[i:e]
i += 1
e += 1
for i in range(len(stringfy... | 12.186047 | 38 | 0.389313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c558b5f5e8456363bff492630d64b29d53b48cb | 55 | py | Python | django_fastapi/test/apply_rds/Package/Connector/__init__.py | ehddn5252/FastAPI_Django | a179aedb62c28d1700578882e681002a61576060 | [
"MIT"
] | null | null | null | django_fastapi/test/apply_rds/Package/Connector/__init__.py | ehddn5252/FastAPI_Django | a179aedb62c28d1700578882e681002a61576060 | [
"MIT"
] | null | null | null | django_fastapi/test/apply_rds/Package/Connector/__init__.py | ehddn5252/FastAPI_Django | a179aedb62c28d1700578882e681002a61576060 | [
"MIT"
] | 1 | 2021-11-26T08:22:57.000Z | 2021-11-26T08:22:57.000Z | from .Connector import Connector
from .Info import Info | 27.5 | 32 | 0.836364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c59b8fe0c256e8b00d27cb87aafc78c144f7a64 | 10,263 | py | Python | tests/test_main.py | AndreLouisCaron/runwith | cfa2b6ae67d73ec5b24f1502a37060d838276e8b | [
"MIT"
] | null | null | null | tests/test_main.py | AndreLouisCaron/runwith | cfa2b6ae67d73ec5b24f1502a37060d838276e8b | [
"MIT"
] | null | null | null | tests/test_main.py | AndreLouisCaron/runwith | cfa2b6ae67d73ec5b24f1502a37060d838276e8b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (
print_function,
unicode_literals,
)
import hypothesis
import hypothesis.strategies
import mock
import os.path
import pytest
from datetime import timedelta
from hypothesis_regex import regex
from runwith import (
main,
__main__,
timespan,
SIGKI... | 31.194529 | 78 | 0.659164 | 0 | 0 | 0 | 0 | 8,937 | 0.870798 | 0 | 0 | 677 | 0.065965 |
5c5a5460d0ba3fe976caca1f2575a005ff9201fc | 35,567 | py | Python | src/data/data_classes.py | sandralima/MLMortgage | 16946e4c1a1cfec87739eb5aa0c711e5e305dc24 | [
"MIT"
] | null | null | null | src/data/data_classes.py | sandralima/MLMortgage | 16946e4c1a1cfec87739eb5aa0c711e5e305dc24 | [
"MIT"
] | null | null | null | src/data/data_classes.py | sandralima/MLMortgage | 16946e4c1a1cfec87739eb5aa0c711e5e305dc24 | [
"MIT"
] | null | null | null | """Module for loading the real datasets."""
import numpy as np
import pandas as pd
import os
import math
import glob
import random_permutation as rp
from datetime import datetime
import sys
RANDOM_SEED = 123 # eliminate for taking from the clock!
class DataBatch(object):
"""ABC."""
def __init__(self, archi... | 58.498355 | 247 | 0.575196 | 34,913 | 0.981612 | 0 | 0 | 730 | 0.020525 | 0 | 0 | 9,995 | 0.281019 |
5c5bcfb620d91c04a78b6a0659fdd5357ae64bd7 | 402 | py | Python | ch9/place.py | chunhua2017/pythonprogrammingdemo | 64e4ac2b33c54cde4671291a6203e94cd96de4ba | [
"MIT"
] | 4 | 2020-05-18T05:25:44.000Z | 2021-07-30T01:02:39.000Z | ch9/place.py | chunhua2017/pythonprogrammingdemo | 64e4ac2b33c54cde4671291a6203e94cd96de4ba | [
"MIT"
] | null | null | null | ch9/place.py | chunhua2017/pythonprogrammingdemo | 64e4ac2b33c54cde4671291a6203e94cd96de4ba | [
"MIT"
] | 2 | 2021-09-15T05:41:05.000Z | 2022-01-25T05:44:43.000Z | from tkinter import * #导入tkinter模块
window = Tk() #创建主窗口对象
window.title('Place Example') #设置窗口标题
window.geometry('300x200') #设置窗口大小与位置
colors = ['red', 'green', 'light blue', 'yellow']
#Place放置效果
[Label(window, font="Arial 12",text='place(80,%d),anchor=NW' % (20 + i * 40),
bg=colors[i]).place(x=40, y=20 +... | 30.923077 | 77 | 0.646766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 218 | 0.459916 |
5c5be2e85385fe803c3e3c5ae2638a84d89644dc | 387 | py | Python | src/devicectl/urls.py | fullctl/devicectl | 633b78986a68bf4afb43c43c91fadef9be940906 | [
"Apache-2.0"
] | null | null | null | src/devicectl/urls.py | fullctl/devicectl | 633b78986a68bf4afb43c43c91fadef9be940906 | [
"Apache-2.0"
] | 2 | 2021-01-25T10:14:53.000Z | 2021-06-14T15:36:10.000Z | src/devicectl/urls.py | fullctl/devicectl | 633b78986a68bf4afb43c43c91fadef9be940906 | [
"Apache-2.0"
] | null | null | null | from django.urls import path, include
from django.contrib import admin
import fullctl.django.views as views
import django_devicectl.urls
urlpatterns = [
path("admin/", admin.site.urls),
path("", include("social_django.urls", namespace="social")),
path("", include("fullctl.django.urls")),
path("", incl... | 27.642857 | 64 | 0.702842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.22739 |
5c5e3aae9b20d433324b1ee0506da0c93c47e6f1 | 5,110 | py | Python | satflow/models/hub.py | lewtun/satflow | 6a675e4fa921b4dd023361b55cc2a5fa25b8f8ed | [
"MIT"
] | null | null | null | satflow/models/hub.py | lewtun/satflow | 6a675e4fa921b4dd023361b55cc2a5fa25b8f8ed | [
"MIT"
] | null | null | null | satflow/models/hub.py | lewtun/satflow | 6a675e4fa921b4dd023361b55cc2a5fa25b8f8ed | [
"MIT"
] | null | null | null | """
Originally Taken from https://github.com/rwightman/pytorch-image-models/blob/acd6c687fd1c0507128f0ce091829b233c8560b9/timm/models/hub.py
"""
import json
import logging
import os
from functools import partial
from typing import Union, Optional
import pytorch_lightning
import torch
try:
from torch.hub import g... | 35.241379 | 136 | 0.722505 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,530 | 0.299413 |
5c5e444508c1d5dbd6e723bb097fe9dacfc02998 | 1,434 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/TransactionStatus.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/TransactionStatus.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/TransactionStatus.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class TransactionStatus(Enum, IComparable, IFormattable, IConvertible):
"""
An enumerated type listing the possible statuses associated with a Transaction,TransactionGroup,or SubTransaction,
or the result of a particular method call on one of those objects.
enum TransactionStatus,values: Committe... | 27.056604 | 221 | 0.600418 | 1,432 | 0.998605 | 0 | 0 | 0 | 0 | 0 | 0 | 680 | 0.474198 |
5c616179b40409b6df7a7b9997dac34dc5c2f054 | 1,568 | py | Python | VM/__main__.py | djtech-dev/PyVM | 1edda436ce7073d0cecbf16f5cab2509895d953c | [
"MIT"
] | 75 | 2017-09-22T22:36:13.000Z | 2022-03-20T16:18:27.000Z | VM/__main__.py | djtech-dev/PyVM | 1edda436ce7073d0cecbf16f5cab2509895d953c | [
"MIT"
] | 7 | 2019-05-10T19:15:08.000Z | 2021-08-24T16:03:34.000Z | VM/__main__.py | djtech-dev/PyVM | 1edda436ce7073d0cecbf16f5cab2509895d953c | [
"MIT"
] | 14 | 2018-07-02T02:49:46.000Z | 2022-02-22T15:24:47.000Z | import argparse
import shlex
import logging
import sys
from . import VMKernel, ExecutionStrategy
parser = argparse.ArgumentParser()
parser.add_argument('command', help='The command to be executed')
parser.add_argument(
'-t', '--type',
default=ExecutionStrategy.ELF, type=lambda s: ExecutionStrategy[s.upper()]... | 30.745098 | 118 | 0.698342 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 543 | 0.346301 |
5c61d523b5aab9332a583c4fbce5282a1d349b34 | 198 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C03StacksQueues/questions/3.2-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C03StacksQueues/questions/3.2-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C03StacksQueues/questions/3.2-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 3.2 Stack Min
# How would you design a stack which, in addition to push and pop, has a function min which
# returns the minimum element? Push, pop, and min should all operate in O(1) time.
| 39.6 | 92 | 0.712121 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 190 | 0.959596 |
5c62285051765df8785d97d4cb963aaaad64edf9 | 2,224 | py | Python | imomoe_client/japanese_anime_page.py | xiaoland/DuerosSkill_ImomoeService | e94e74f9c1939cca80e0592d8d1f2f4d2520bb04 | [
"MIT"
] | 5 | 2020-06-15T01:43:07.000Z | 2021-02-08T03:01:53.000Z | imomoe_client/japanese_anime_page.py | xiaoland/DuerosSkill_ImomoeService | e94e74f9c1939cca80e0592d8d1f2f4d2520bb04 | [
"MIT"
] | null | null | null | imomoe_client/japanese_anime_page.py | xiaoland/DuerosSkill_ImomoeService | e94e74f9c1939cca80e0592d8d1f2f4d2520bb04 | [
"MIT"
] | 2 | 2020-06-15T01:43:17.000Z | 2021-02-08T03:00:17.000Z | # coding=utf-8
import requests
from bs4 import BeautifulSoup as bs
class ImomoeClientJapaneseAnimePage(object):
def __init__(self):
self.base_url = "http://www.imomoe.in"
r = requests.get(self.base_url + "/list/2.html")
self.jp_html = r.content
self.soup = bs(self.jp_html, "lxml"... | 26.164706 | 58 | 0.513939 | 2,234 | 0.969618 | 0 | 0 | 0 | 0 | 0 | 0 | 449 | 0.194878 |
5c62c7542b38a5760c7218089280959bf24857b6 | 119 | py | Python | enthought/contexts/adapter/unit_conversion_adapter.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/contexts/adapter/unit_conversion_adapter.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/contexts/adapter/unit_conversion_adapter.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from codetools.contexts.adapter.unit_conversion_adapter import *
| 29.75 | 64 | 0.865546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.117647 |
5c631bfeab917305e9175e3e350986dbb7edc383 | 998 | py | Python | raisimGymTorch/raisimGymTorch/stable_baselines3/anymal.py | simRepoRelease/raisimLib | 00724ac2abb0b4c11aadb4ddd3455fc42c57a34e | [
"Apache-2.0"
] | 142 | 2020-10-21T18:18:13.000Z | 2022-03-29T11:49:25.000Z | raisimGymTorch/raisimGymTorch/stable_baselines3/anymal.py | simRepoRelease/raisimLib | 00724ac2abb0b4c11aadb4ddd3455fc42c57a34e | [
"Apache-2.0"
] | 192 | 2020-10-21T15:51:15.000Z | 2022-03-28T12:56:01.000Z | raisimGymTorch/raisimGymTorch/stable_baselines3/anymal.py | simRepoRelease/raisimLib | 00724ac2abb0b4c11aadb4ddd3455fc42c57a34e | [
"Apache-2.0"
] | 51 | 2020-10-26T08:29:54.000Z | 2022-03-23T12:00:23.000Z | import gym
import os
from ruamel.yaml import YAML, dump, RoundTripDumper
from stable_baselines3 import PPO
from stable_baselines3.ppo import MlpPolicy
from raisimGymTorch.env.bin import rsg_anymal
from raisimGymTorch.stable_baselines3.RaisimSbGymVecEnv import RaisimSbGymVecEnv as VecEnv
# Parallel environments
# dir... | 32.193548 | 117 | 0.735471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 220 | 0.220441 |
5c63298d5f399fa1ac8a31fab042f54823289e28 | 16,267 | py | Python | RI/flask_server/tapi_server/models/tapi_connectivity_resilience_constraint.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 57 | 2018-04-09T08:56:18.000Z | 2022-03-23T08:31:06.000Z | RI/flask_server/tapi_server/models/tapi_connectivity_resilience_constraint.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 143 | 2016-06-08T04:09:54.000Z | 2018-02-23T10:45:59.000Z | RI/flask_server/tapi_server/models/tapi_connectivity_resilience_constraint.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 64 | 2018-03-07T07:55:17.000Z | 2022-03-28T07:14:28.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501
from tapi... | 47.150725 | 391 | 0.733018 | 15,589 | 0.958321 | 0 | 0 | 11,172 | 0.686789 | 0 | 0 | 11,291 | 0.694105 |
5c66f8436b90a5feb352d70a8c8dc1a774132fb0 | 4,285 | py | Python | src/api.py | lunixbochs/microlathe | fbd896fb534dd8d83f4b2725d3767b0d46c9bcf0 | [
"MIT"
] | 1 | 2016-05-29T16:30:48.000Z | 2016-05-29T16:30:48.000Z | src/api.py | lunixbochs/microlathe | fbd896fb534dd8d83f4b2725d3767b0d46c9bcf0 | [
"MIT"
] | null | null | null | src/api.py | lunixbochs/microlathe | fbd896fb534dd8d83f4b2725d3767b0d46c9bcf0 | [
"MIT"
] | null | null | null | import base64
import json
import requests
import thread
import urllib
from app import redis
import config
class ApiError(Exception):
pass
class AuthError(ApiError):
pass
def cookies():
cookies = redis.get(config.COOKIE_KEY)
if not cookies:
raise AuthError('could not load cookies')
ret... | 22.087629 | 77 | 0.565228 | 2,545 | 0.593932 | 0 | 0 | 1,474 | 0.343991 | 0 | 0 | 676 | 0.15776 |
5c681bfcfa74d1be9aaebde6587999c9c705b9c2 | 24,882 | py | Python | sylvadbclient/api.py | CulturePlex/sylvadb-python-client | 03ebd9f8da702c7330e82417bcd383c21aef5125 | [
"MIT"
] | null | null | null | sylvadbclient/api.py | CulturePlex/sylvadb-python-client | 03ebd9f8da702c7330e82417bcd383c21aef5125 | [
"MIT"
] | null | null | null | sylvadbclient/api.py | CulturePlex/sylvadb-python-client | 03ebd9f8da702c7330e82417bcd383c21aef5125 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import slumber
HOST = "http://api.sylvadb.com/v1/"
SYLVADB_API = os.environ.get("SYLVADB_API", HOST)
NODE = "node"
RELATIONSHIP = "relationship"
# Extracted from Six for Python 2 and 3 compatibility
def add_metaclass(metaclas... | 34.751397 | 79 | 0.571096 | 23,988 | 0.96407 | 0 | 0 | 1,986 | 0.079817 | 0 | 0 | 7,931 | 0.318744 |
5c688d37744f8919869471727e3b542ad0e4c131 | 940 | py | Python | star-track/testprog.py | valentinp72/star-track | 0537f1a9494297d6de5025a945abc41ca4a40738 | [
"MIT"
] | null | null | null | star-track/testprog.py | valentinp72/star-track | 0537f1a9494297d6de5025a945abc41ca4a40738 | [
"MIT"
] | null | null | null | star-track/testprog.py | valentinp72/star-track | 0537f1a9494297d6de5025a945abc41ca4a40738 | [
"MIT"
] | null | null | null | import time
from logic.axis import Axis
e = Axis.azimuth()
#e.motor.set_dist(209)
#e.move_angle(degrees=-90)
#time.sleep(1)
#e.move_angle(seconds=340)
from skyfield.api import load
from skyfield.api import Topos
ts = load.timescale()
planets = load('de421.bsp')
earth = planets["earth"]
moon = planets["moon"]
j... | 19.583333 | 65 | 0.661702 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 283 | 0.301064 |
5c697a310f0427f6467e603fb1ffba4ed0518bf0 | 717 | py | Python | DFRobot_MAX31855.py | Red-Hide/ZeroP_Software | 8cc1b39966bb69870efabfc47c08aac7af1090c5 | [
"MIT"
] | null | null | null | DFRobot_MAX31855.py | Red-Hide/ZeroP_Software | 8cc1b39966bb69870efabfc47c08aac7af1090c5 | [
"MIT"
] | null | null | null | DFRobot_MAX31855.py | Red-Hide/ZeroP_Software | 8cc1b39966bb69870efabfc47c08aac7af1090c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import sys
import pigpio as GPIO
MAX31855_ADDR = 0x10
pi = GPIO.pi()
class DFRobot_MAX31855:
def __init__(self):
self.i2c = pi.i2c_open(1,MAX31855_ADDR)
def readData(self):
a = pi.i2c_read_byte_data(self.i2c.handle, 0x00)
b = pi.i2c_read_byte_data(self.i2c.handl... | 21.727273 | 53 | 0.595537 | 605 | 0.843794 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.105997 |
5c699ef3fd575d105c696e0e7b84e269c01b955d | 316 | py | Python | logger.py | BradynWeil/linuxdeploy_sendSms | 463c42d56bc5fbb850f07166ccdae26aa7c74f8e | [
"MIT"
] | null | null | null | logger.py | BradynWeil/linuxdeploy_sendSms | 463c42d56bc5fbb850f07166ccdae26aa7c74f8e | [
"MIT"
] | null | null | null | logger.py | BradynWeil/linuxdeploy_sendSms | 463c42d56bc5fbb850f07166ccdae26aa7c74f8e | [
"MIT"
] | null | null | null | import logging
log_name = 'runtime.log'
LOGGER = logging.getLogger(__name__)
fh = logging.FileHandler(encoding='utf-8', mode='a', filename=log_name)
logging.basicConfig(handlers=[fh], format='[%(asctime)s %(levelname)s]<%(process)d> %(message)s',
datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO) | 45.142857 | 97 | 0.667722 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 96 | 0.303797 |
5c6a85a9d1b092254c2132467b21aaf79fda4140 | 1,060 | py | Python | student-project-management-devv/code.py | deveshk72/dsmp-pre-work | f7bdcd976bcff6c93819f35fb5ce013a0d2b9a10 | [
"MIT"
] | null | null | null | student-project-management-devv/code.py | deveshk72/dsmp-pre-work | f7bdcd976bcff6c93819f35fb5ce013a0d2b9a10 | [
"MIT"
] | null | null | null | student-project-management-devv/code.py | deveshk72/dsmp-pre-work | f7bdcd976bcff6c93819f35fb5ce013a0d2b9a10 | [
"MIT"
] | null | null | null | # --------------
# Code starts here
class_1 = ['Geoffrey Hinton','Andrew Ng','Sebastian Raschka','Yoshua Bengio']
class_2 = ['Hilary Mason','Carla Gentry','Corinna Cortes']
new_class = class_1+class_2
print(new_class)
new_class.append('Peter Warden')
print(new_class)
new_class.remove('Carla Gentry')
print(new_class)... | 16.825397 | 77 | 0.683019 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 480 | 0.45283 |
5c6c408433b03a9fe094016964841137491b8945 | 812 | py | Python | src/paper/management/commands/recalc_discussion_count.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/paper/management/commands/recalc_discussion_count.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/paper/management/commands/recalc_discussion_count.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | '''
Recalculates paper discussion count
'''
from django.core.management.base import BaseCommand
from paper.models import Paper
class Command(BaseCommand):
def handle(self, *args, **options):
papers = Paper.objects.iterator()
count = Paper.objects.count()
print('Recalculating paper discus... | 30.074074 | 79 | 0.587438 | 681 | 0.83867 | 0 | 0 | 0 | 0 | 0 | 0 | 222 | 0.273399 |
5c6dee994fb01185ef6915184567b795aa87c303 | 2,291 | py | Python | ccc/py/ccc05j5.py | tylertian123/CompSciSolutions | 33769a20ea613439f92055b40deeac4927cb0a91 | [
"MIT"
] | null | null | null | ccc/py/ccc05j5.py | tylertian123/CompSciSolutions | 33769a20ea613439f92055b40deeac4927cb0a91 | [
"MIT"
] | null | null | null | ccc/py/ccc05j5.py | tylertian123/CompSciSolutions | 33769a20ea613439f92055b40deeac4927cb0a91 | [
"MIT"
] | null | null | null | """
ccc05j5.py: Python solution to CCC '05 J5 (Bananas)
"""
# Create these sets to hold the known valid and invalid A-words to save time
# We already know that 'A' is a valid A-word and an empty string is always invalid
known_awords = set(['A'])
known_nonawords = set([''])
def is_aword(word):
# First try looking i... | 32.728571 | 93 | 0.588826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 944 | 0.412047 |
5c6f489d7f4ddd337cd5c3487bd38ef583744941 | 1,004 | py | Python | 07/p1_test.py | en0/aoc2021 | 14c74f872319f023b7ee4293009445dab315716f | [
"Unlicense"
] | null | null | null | 07/p1_test.py | en0/aoc2021 | 14c74f872319f023b7ee4293009445dab315716f | [
"Unlicense"
] | null | null | null | 07/p1_test.py | en0/aoc2021 | 14c74f872319f023b7ee4293009445dab315716f | [
"Unlicense"
] | null | null | null | from unittest import TestCase, main
from aocfw import TestCaseMixin
from p1 import Solution
class SolutionTests(TestCase, TestCaseMixin):
solution = Solution
source = "sample.txt"
given = 37
def test_find_target(self):
data = self.get_parsed_data()
self.assertEqual(Solution().get_tar... | 25.74359 | 56 | 0.656375 | 869 | 0.865538 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0.021912 |
5c6f61323eed68703a3ed669efbf6f92ee935246 | 2,569 | py | Python | server.py | telminov/prometheus-rabbitmq-exporter | d13f67102c60853132dc3efcb8a2d54b1bd2e2ac | [
"MIT"
] | null | null | null | server.py | telminov/prometheus-rabbitmq-exporter | d13f67102c60853132dc3efcb8a2d54b1bd2e2ac | [
"MIT"
] | null | null | null | server.py | telminov/prometheus-rabbitmq-exporter | d13f67102c60853132dc3efcb8a2d54b1bd2e2ac | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import argparse
import yaml
from aiohttp import web, ClientSession, TCPConnector, BasicAuth
import async_timeout
parser = argparse.ArgumentParser(description='Prometheus rabbitmq exporter.')
parser.add_argument('-c', '--config', dest='config', default='config.yml',
help='Path... | 33.802632 | 120 | 0.606462 | 0 | 0 | 0 | 0 | 0 | 0 | 1,495 | 0.581938 | 620 | 0.241339 |
5c705653960bf8c4fea49d4f71bff6d854d0afcb | 7,638 | py | Python | scancodes.py | mallardtheduck/ericvnc | 2b064f00de097d336804d06ca444cd2d17ab9303 | [
"MIT"
] | null | null | null | scancodes.py | mallardtheduck/ericvnc | 2b064f00de097d336804d06ca444cd2d17ab9303 | [
"MIT"
] | null | null | null | scancodes.py | mallardtheduck/ericvnc | 2b064f00de097d336804d06ca444cd2d17ab9303 | [
"MIT"
] | null | null | null | KEY_BackSpace = 0xff08
KEY_Tab = 0xff09
KEY_Return = 0xff0d
KEY_Escape = 0xff1b
KEY_Insert = 0xff63
KEY_Delete = 0xffff
KEY_Home = 0xff50
KEY_End = 0xff57
KEY_PageUp = 0xff55
KEY_PageDown = 0xff56
KEY_Left = 0xff51
KEY_Up = 0xff52
KEY_Right = 0xff53
KEY_Down = 0xff5... | 38.771574 | 68 | 0.465829 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,015 | 0.132888 |
5c70686eff77db80beddfa384c6528f590c5841f | 2,235 | py | Python | shopping/models.py | Darkwing42/home_app | c5a996b39714d755bd1dd6b354937f342efc75b0 | [
"MIT"
] | null | null | null | shopping/models.py | Darkwing42/home_app | c5a996b39714d755bd1dd6b354937f342efc75b0 | [
"MIT"
] | null | null | null | shopping/models.py | Darkwing42/home_app | c5a996b39714d755bd1dd6b354937f342efc75b0 | [
"MIT"
] | null | null | null | from app import db
from sqlalchemy.dialects.postgresql import UUID
import uuid
from app.utils.uuid_converter import str2uuid
class ShoppingItemModel(db.Model):
__tablename__ = 'shoppingItems'
id = db.Column(UUID(as_uuid=True), default=lambda: uuid.uuid4().hex)
shoppingItemID = db.Column(db.Integer, primary_key=Tr... | 26.607143 | 94 | 0.752573 | 2,102 | 0.940492 | 0 | 0 | 237 | 0.10604 | 0 | 0 | 251 | 0.112304 |
5c7148885a4bcc7103f891edb01fd7a7ba508c40 | 1,705 | py | Python | olea/core/errors/__init__.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 2 | 2020-06-18T03:25:52.000Z | 2020-06-18T07:33:45.000Z | olea/core/errors/__init__.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 15 | 2021-01-28T07:11:04.000Z | 2021-05-24T07:11:37.000Z | olea/core/errors/__init__.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | null | null | null | __all__ = [
'AccessDenied', 'AccountDeactivated', 'BaseError', 'DoesNotMeetRequirements',
'DuplicatedRecord', 'FileExist', 'FileVerConflict', 'InvalidAccessToken', 'InvalidCredential',
'InvalidRefreshToken', 'InvalidReply', 'InvalidSource', 'NotQualifiedToPick',
'PermissionDenied', 'PitStatusLocked'... | 46.081081 | 99 | 0.651613 | 0 | 0 | 0 | 0 | 135 | 0.079179 | 0 | 0 | 462 | 0.270968 |
5c7477f36dcee6cdfe5a742028ac33aba04df8c0 | 255 | py | Python | scripts/env/script/python_console.py | ZhuoZhuoCrayon/djangocli | c5b40c46922b70d066141c65c60bf19c809f3197 | [
"MIT"
] | 5 | 2021-03-08T02:39:02.000Z | 2021-09-10T03:40:29.000Z | scripts/env/script/python_console.py | ZhuoZhuoCrayon/djangocli | c5b40c46922b70d066141c65c60bf19c809f3197 | [
"MIT"
] | 80 | 2021-03-05T15:17:37.000Z | 2021-11-15T01:46:59.000Z | scripts/env/script/python_console.py | ZhuoZhuoCrayon/djangocli | c5b40c46922b70d066141c65c60bf19c809f3197 | [
"MIT"
] | 1 | 2021-09-10T03:49:40.000Z | 2021-09-10T03:49:40.000Z | # -*- coding: utf-8 -*-
import sys
import dotenv
# 打印系统信息
print("Python %s on %s" % (sys.version, sys.platform))
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
# 导入环境变量
dotenv.load_dotenv(dotenv_path=PROJECT_ROOT + "scripts/deploy/local/environ.sh")
| 19.615385 | 80 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 113 | 0.405018 |
5c75c79e7b141cc80ac12483d8bd267f8a675134 | 110 | py | Python | Lampi/main.py | Ooyekunle/dummytestFeb172020 | fbf0f966d38a90af4fede4c1deef341bf9f7d8c3 | [
"RSA-MD"
] | null | null | null | Lampi/main.py | Ooyekunle/dummytestFeb172020 | fbf0f966d38a90af4fede4c1deef341bf9f7d8c3 | [
"RSA-MD"
] | null | null | null | Lampi/main.py | Ooyekunle/dummytestFeb172020 | fbf0f966d38a90af4fede4c1deef341bf9f7d8c3 | [
"RSA-MD"
] | null | null | null | #!/usr/bin/env python3
from lampi.lampi_app import LampiApp
if __name__ == "__main__":
LampiApp().run()
| 15.714286 | 36 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 0.290909 |
5c7679f7f5b438170113cc7075f9558e13ac35ef | 33 | py | Python | reporting/__init__.py | 4ESoftware/TempRent | 822268c787bdd2be6e6c446db8417da24dbb2ec5 | [
"MIT"
] | null | null | null | reporting/__init__.py | 4ESoftware/TempRent | 822268c787bdd2be6e6c446db8417da24dbb2ec5 | [
"MIT"
] | null | null | null | reporting/__init__.py | 4ESoftware/TempRent | 822268c787bdd2be6e6c446db8417da24dbb2ec5 | [
"MIT"
] | null | null | null | from .rep_utils import RepEngine
| 16.5 | 32 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c7771b8e689f85c44bb0476f8c6fdb2d2047022 | 3,592 | py | Python | encodeAudio.py | TimelessParadise/encodeAudio | a17403628699e2ff08a02e60f8bfb93c786c4bb6 | [
"MIT"
] | null | null | null | encodeAudio.py | TimelessParadise/encodeAudio | a17403628699e2ff08a02e60f8bfb93c786c4bb6 | [
"MIT"
] | null | null | null | encodeAudio.py | TimelessParadise/encodeAudio | a17403628699e2ff08a02e60f8bfb93c786c4bb6 | [
"MIT"
] | null | null | null | import subprocess as sp
import shlex
import os
import argparse
import glob
import sys
extensionsTuple = (".m2ts", ".wav", ".flac")
def wavEncode(filePath):
sp.run(
shlex.split(
f"eac3to \"{filePath}\" -log=NUL \"{os.path.splitext(filePath)[0]}.wav\""
)
)
def wavEncode2(filePath, t... | 35.92 | 138 | 0.560412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,102 | 0.306793 |
5c7898a236d93a0f71c8b6e1ef252d0e74cabda8 | 12,285 | py | Python | augmentation/methods/robust/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | 28 | 2020-08-19T02:59:37.000Z | 2022-03-17T18:10:24.000Z | augmentation/methods/robust/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | null | null | null | augmentation/methods/robust/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | 3 | 2021-01-29T10:20:14.000Z | 2021-11-15T17:06:27.000Z | import tensorflow as tf
import wandb
import yaml
import subprocess
from augmentation.utilities.visualize import gallery
from augmentation.utilities.wandb import *
from augmentation.utilities.checkpoint import load_tf_optimizer_state
def rewrite_config_for_resumption(config):
config.prev_wandb_entity = config.wand... | 48.944223 | 156 | 0.641758 | 2,071 | 0.16858 | 0 | 0 | 0 | 0 | 0 | 0 | 3,199 | 0.260399 |
5c794db4e212c6cf7d9537acd92f512aa6cdb0cf | 1,046 | py | Python | main.py | Jodagito/Pandomit | 19278aee951d1238272a18473ea1581380f437d7 | [
"MIT"
] | null | null | null | main.py | Jodagito/Pandomit | 19278aee951d1238272a18473ea1581380f437d7 | [
"MIT"
] | null | null | null | main.py | Jodagito/Pandomit | 19278aee951d1238272a18473ea1581380f437d7 | [
"MIT"
] | null | null | null | import os
import parser
import pandas as pd
def file_converter(filename, expected_format):
"""Given a file returns a converted file to a preferred format"""
read_methods = [method for method in dir(pd) if method[:4] == 'read']
i = 0
while os.path.exists("converted filename {}.".format(i) + expected_f... | 33.741935 | 131 | 0.58891 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 183 | 0.174952 |
5c7a952effb826e1fbf8fc0f5e9663289f251cf5 | 4,317 | py | Python | apps/run_command_line.py | MattSegal/AuTuMN | 49d78d9c07ea3825ac31682a4d124eab9d3365ce | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | apps/run_command_line.py | MattSegal/AuTuMN | 49d78d9c07ea3825ac31682a4d124eab9d3365ce | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | apps/run_command_line.py | MattSegal/AuTuMN | 49d78d9c07ea3825ac31682a4d124eab9d3365ce | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """
Runs AuTuMN apps
You can access this script from your CLI by running:
python -m apps --help
"""
import os
import click
from . import covid_19, marshall_islands, mongolia, sir_example
from .marshall_islands.calibration import run_calibration_chain as run_rmi_calibration_chain
from .mongolia.calibration impo... | 28.401316 | 100 | 0.756544 | 0 | 0 | 0 | 0 | 3,317 | 0.768358 | 0 | 0 | 1,115 | 0.258281 |
5c7b170332c963d2c748af8230525d7348d1ce37 | 1,851 | py | Python | Toolkits/Discovery/meta/searx/searx/engines/translated.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | Toolkits/Discovery/meta/searx/searx/engines/translated.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | searx/engines/translated.py | xu1991/open | 5398dab4ba669b3ca87d9fe26eb24431c45f153e | [
"CC0-1.0"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | """
MyMemory Translated
@website https://mymemory.translated.net/
@provide-api yes (https://mymemory.translated.net/doc/spec.php)
@using-api yes
@results JSON
@stable yes
@parse url, title, content
"""
import re
from sys import version_info
from searx.utils import is_valid_lang
if version_... | 26.826087 | 93 | 0.590492 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 593 | 0.320367 |
5c7c7bbed183e6691077921479d848eb10529f59 | 4,849 | py | Python | core/python_src/test_protobuf.py | kellpossible/libgdx-atc-sim | b469ccc3245004d36a9e0f6d1d27651182ba2962 | [
"MIT"
] | null | null | null | core/python_src/test_protobuf.py | kellpossible/libgdx-atc-sim | b469ccc3245004d36a9e0f6d1d27651182ba2962 | [
"MIT"
] | 1 | 2019-07-03T04:28:57.000Z | 2019-07-03T04:28:57.000Z | core/python_src/test_protobuf.py | kellpossible/libgdx-atc-sim | b469ccc3245004d36a9e0f6d1d27651182ba2962 | [
"MIT"
] | 2 | 2019-05-06T14:54:26.000Z | 2021-02-16T03:33:16.000Z | import DebugDataFeedServe_pb2 as NetworkInterfacePacket
import socket
import sys
import time
import math
from google.protobuf.internal import encoder
from google.protobuf.internal import decoder
from threading import Thread
from Queue import Queue
def build_test_packet(dt):
t = int(round(time.time() * 1000))
... | 28.028902 | 80 | 0.655599 | 1,731 | 0.356981 | 0 | 0 | 0 | 0 | 0 | 0 | 875 | 0.18045 |
5c7c9a535fbd18754102262dd39390f40bebc58c | 89 | py | Python | sorl/thumbnail_standalone/__init__.py | kreopt/sorl-thumbnail | cbc02e642c45e6206234bcfb0562c243ecffacf7 | [
"BSD-3-Clause"
] | null | null | null | sorl/thumbnail_standalone/__init__.py | kreopt/sorl-thumbnail | cbc02e642c45e6206234bcfb0562c243ecffacf7 | [
"BSD-3-Clause"
] | null | null | null | sorl/thumbnail_standalone/__init__.py | kreopt/sorl-thumbnail | cbc02e642c45e6206234bcfb0562c243ecffacf7 | [
"BSD-3-Clause"
] | null | null | null | from sorl.thumbnail_standalone.base import ThumbnailBackend
from sorl import __version__
| 29.666667 | 59 | 0.88764 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c7e24193cb0e93738e911a3f9a9ff0f6899a584 | 452 | py | Python | multivision/oa_file_utils.py | olaals/tpktools | 50416ca554809e3d2f364b25531c78cf4751311c | [
"MIT"
] | null | null | null | multivision/oa_file_utils.py | olaals/tpktools | 50416ca554809e3d2f364b25531c78cf4751311c | [
"MIT"
] | null | null | null | multivision/oa_file_utils.py | olaals/tpktools | 50416ca554809e3d2f364b25531c78cf4751311c | [
"MIT"
] | null | null | null | import os
import random
def search_substring_from_folder(path, substr):
files = os.listdir(path)
for file in files:
if substr in file:
return os.path.join(path, file)
return None
def list_all_files(dir_path):
files = os.listdir(dir_path)
return [os.path.join(dir_path, name) f... | 22.6 | 60 | 0.70354 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c7eb80cf8b1bfaa306b45aca379671fb5dcc981 | 365 | py | Python | modules/constants.py | sandeepsoni/semantic-progressiveness | 824079b388d0eebc92b2197805b27ed320353f8f | [
"MIT"
] | 2 | 2021-04-11T16:28:44.000Z | 2021-07-31T03:22:07.000Z | modules/constants.py | sandeepsoni/semantic-progressiveness | 824079b388d0eebc92b2197805b27ed320353f8f | [
"MIT"
] | null | null | null | modules/constants.py | sandeepsoni/semantic-progressiveness | 824079b388d0eebc92b2197805b27ed320353f8f | [
"MIT"
] | 1 | 2021-09-01T22:45:25.000Z | 2021-09-01T22:45:25.000Z | import os
CLDIR = "/hg190/corpora/courtlistener"
CLUSTERS_DIR = os.path.join (CLDIR, "clusters")
OPINIONS_DIR = os.path.join (CLDIR, "opinions")
NL="\n"
JSON_EXT = ".json"
JSONL_EXT = ".jsonl"
TXT_EXT = ".txt"
MIL = 1000000
HALFMIL = 500000
LAKH = 100000
CL_TOKEN="df4dd26ef31ffc5cd9398804fc354cf09ece7e0a"
CL_USERNA... | 19.210526 | 51 | 0.750685 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.39726 |
5c7ef61a5d394fa533e6ad33c697d5d4aacf0bf9 | 645 | py | Python | scripts/annotation/extract_cds_by_gff.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 10 | 2015-04-28T14:15:04.000Z | 2021-03-15T00:07:38.000Z | scripts/annotation/extract_cds_by_gff.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | null | null | null | scripts/annotation/extract_cds_by_gff.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 6 | 2017-03-16T22:38:41.000Z | 2021-08-11T00:22:52.000Z | #!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import argparse
from RouToolPa.Tools.Expression import Gffread
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", action="store", dest="input", required=True,
help="Input gff with annotation")
parser.add_argument("-g", "--... | 33.947368 | 83 | 0.665116 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 196 | 0.303876 |
5c7f2b4d05c98efc722f2031521e7206c2e38a4e | 86 | py | Python | microgrid/__init__.py | bcornelusse/microgrid-bench | 3f9a8a99f12b580c81f52bb146a5f47f08a032c0 | [
"BSD-2-Clause"
] | 10 | 2017-10-11T11:50:30.000Z | 2021-08-02T20:44:42.000Z | microgrid/__init__.py | bcornelusse/microgrid-bench | 3f9a8a99f12b580c81f52bb146a5f47f08a032c0 | [
"BSD-2-Clause"
] | null | null | null | microgrid/__init__.py | bcornelusse/microgrid-bench | 3f9a8a99f12b580c81f52bb146a5f47f08a032c0 | [
"BSD-2-Clause"
] | 1 | 2017-10-11T11:49:52.000Z | 2017-10-11T11:49:52.000Z | """
The microgrid package organizes the test-bench functionalities in subpackages.
""" | 28.666667 | 78 | 0.790698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 1 |
5c7f7deeb931e035995b8a071503bf7f94cb090c | 89 | py | Python | epsilon/apps.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | null | null | null | epsilon/apps.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | 7 | 2020-06-05T16:37:46.000Z | 2022-03-11T23:11:36.000Z | epsilon/apps.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class EpsilonConfig(AppConfig):
name = 'epsilon'
| 14.833333 | 33 | 0.752809 | 52 | 0.58427 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0.101124 |
5c7feab221c96db63d98f5d88bb5ba774ac8981e | 3,414 | py | Python | amshared/pipe.py | avidclam/amshared | fc605639409f3ea2b0efb2c0b45ad03969115bb6 | [
"MIT"
] | null | null | null | amshared/pipe.py | avidclam/amshared | fc605639409f3ea2b0efb2c0b45ad03969115bb6 | [
"MIT"
] | null | null | null | amshared/pipe.py | avidclam/amshared | fc605639409f3ea2b0efb2c0b45ad03969115bb6 | [
"MIT"
] | null | null | null | """
Pipe is a quick-and-dirty implementation of sequential functions invocation.
Functions should be designed the way that a result returned by
preceding function (pipe argument) could be used as the first argument
to the next function, and so on.
"""
def run(*args, initial=None):
"""Creates and runs the pipe c... | 23.708333 | 80 | 0.641183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,691 | 0.788225 |
5c826613b4eb9967c2381828b12ff8fbe1540c84 | 6,879 | py | Python | demo/python/picovoice_demo_mic.py | soltrinox/picovoice | 2fb47389c7031c3a365eca40edd67cef1dc152c5 | [
"Apache-2.0"
] | null | null | null | demo/python/picovoice_demo_mic.py | soltrinox/picovoice | 2fb47389c7031c3a365eca40edd67cef1dc152c5 | [
"Apache-2.0"
] | null | null | null | demo/python/picovoice_demo_mic.py | soltrinox/picovoice | 2fb47389c7031c3a365eca40edd67cef1dc152c5 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020-2021 Picovoice Inc.
#
# You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
# file accompanying this source.
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS ... | 35.096939 | 120 | 0.643989 | 2,984 | 0.433784 | 0 | 0 | 698 | 0.101468 | 0 | 0 | 2,002 | 0.291031 |
5c862c8e739f0576851e5f917cdfc1912121180e | 700 | py | Python | algorithms_and_data_structures/algorithms/sorting/insertion_sort/insertion_sort_naive.py | JCPedroza/algorithms-and-data-structures-py | e8532060e82bb7f56d667c587469dea2921117df | [
"MIT"
] | 2 | 2022-01-14T01:33:24.000Z | 2022-01-14T03:23:41.000Z | algorithms_and_data_structures/algorithms/sorting/insertion_sort/insertion_sort_naive.py | JCPedroza/algorithms-and-data-structures-py | e8532060e82bb7f56d667c587469dea2921117df | [
"MIT"
] | 1 | 2022-01-14T03:26:58.000Z | 2022-01-14T03:26:58.000Z | algorithms_and_data_structures/algorithms/sorting/insertion_sort/insertion_sort_naive.py | JCPedroza/algorithms-and-data-structures-py | e8532060e82bb7f56d667c587469dea2921117df | [
"MIT"
] | 1 | 2022-01-14T03:23:45.000Z | 2022-01-14T03:23:45.000Z | def insertion_sort(nums: list[float]) -> list[float]:
"""Sorts a list in-place using the insertion sort approach.
This version does more comparisons and moves more data than necessary, so
it is sub-optimal.
Time complexity: O(n) best O(n^2) worst O(n^2) average.
Space complexity: O(n) total O(1) a... | 24.137931 | 77 | 0.607143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 378 | 0.54 |
5c86d2ba40619a738f5d8ad8d925e6ddb561978c | 6,010 | py | Python | drf_localize/serializers.py | ebs-integrator/DRF-Localize | 85201157027770ff3859842f04ce8a3e302ab072 | [
"MIT"
] | 3 | 2022-03-10T12:34:18.000Z | 2022-03-14T08:52:22.000Z | drf_localize/serializers.py | ebs-integrator/drf-localize | 85201157027770ff3859842f04ce8a3e302ab072 | [
"MIT"
] | null | null | null | drf_localize/serializers.py | ebs-integrator/drf-localize | 85201157027770ff3859842f04ce8a3e302ab072 | [
"MIT"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
from rest_framework.serializers import (
Serializer,
JSONField,
ModelSerializer,
)
from rest_framework.utils.serializer_helpers import BindingDict
from rest_framework.exceptions import ValidationError
from rest_framework.fields import empty
from django... | 35.56213 | 136 | 0.612313 | 5,480 | 0.911814 | 0 | 0 | 661 | 0.109983 | 0 | 0 | 1,129 | 0.187854 |
5c8a860b757814040a5cb080bf8349089a11404b | 2,417 | py | Python | backend/api/views/tests/test_image_c.py | jenhaoyang/Disfactory | 40f9e14044f0e457489164745095f24cd1e923dd | [
"MIT"
] | null | null | null | backend/api/views/tests/test_image_c.py | jenhaoyang/Disfactory | 40f9e14044f0e457489164745095f24cd1e923dd | [
"MIT"
] | null | null | null | backend/api/views/tests/test_image_c.py | jenhaoyang/Disfactory | 40f9e14044f0e457489164745095f24cd1e923dd | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
from unittest.mock import patch
from pathlib import Path
from freezegun import freeze_time
from django.test import TestCase, Client
from django.conf import settings
from api.models import Image
HERE = Path(__file__).resolve().parent
FAKE_IMGUR_PATH = "https://i.imgur.com/RxAr... | 38.983871 | 95 | 0.678527 | 2,085 | 0.86264 | 0 | 0 | 2,029 | 0.83947 | 0 | 0 | 368 | 0.152255 |
5c8d31e642b15145aa91d1757e96e178ea0de22f | 730 | py | Python | excursion/testcases/fast3d.py | tutrie/excursion | a2845739fadfa038c3266b5850523fca808b49af | [
"Apache-2.0"
] | null | null | null | excursion/testcases/fast3d.py | tutrie/excursion | a2845739fadfa038c3266b5850523fca808b49af | [
"Apache-2.0"
] | 1 | 2021-08-16T19:18:11.000Z | 2021-08-16T19:18:11.000Z | excursion/testcases/fast3d.py | tutrie/excursion | a2845739fadfa038c3266b5850523fca808b49af | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .. import utils
from .. import ExcursionProblem
def truth(x):
xv, yv, zv = x[:,0],x[:,1], x[:,2]
'''more wiggles in physics case'''
def xsec(xv,yv,zv):
return (12*np.exp(-xv/2)+((0.1*np.cos(10*yv)))+((0.2*np.cos(15*xv))))*np.exp(-0.3*zv)
def eff(xv,yv,zv):
retu... | 27.037037 | 109 | 0.590411 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0.046575 |
5c8d6b05589431afdb44c561968ad8afd76daf0c | 3,365 | py | Python | lib/JumpScale/baselib/vcs/vcsfactory.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | lib/JumpScale/baselib/vcs/vcsfactory.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | lib/JumpScale/baselib/vcs/vcsfactory.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | from JumpScale import j
BASEURLS = {'github': 'github.com',
'bitbucket': 'bitbucket.org'}
class VCSConfig(object):
def __init__(self, provider, account):
self._account = account
self._provider = provider
self._ini = j.config.getInifile(provider)
def _getConfig(self, key, p... | 30.044643 | 98 | 0.58841 | 3,252 | 0.966419 | 0 | 0 | 148 | 0.043982 | 0 | 0 | 354 | 0.105201 |
5c8fb708a31f92aa30ed34d57058f849faa1abff | 488 | py | Python | S4/S4 Decompiler/Old Libraries/xdis/opcodes/opcode_23.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Decompiler/Old Libraries/xdis/opcodes/opcode_23.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Decompiler/Old Libraries/xdis/opcodes/opcode_23.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | # (C) Copyright 2017, 2019 by Rocky Bernstein
"""
CPython 2.3 bytecode opcodes
This is a like Python 2.3's opcode.py with some classification
of stack usage.
"""
import xdis.opcodes.opcode_2x as opcode_2x
from xdis.opcodes.base import (
finalize_opcodes,
format_extended_arg,
init_opdata,
update_pj2,
)... | 18.074074 | 62 | 0.741803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 175 | 0.358607 |
5c8fd73e664627880e0ceebfd049cc8bfc1a9308 | 2,302 | py | Python | prodj/pdblib/track.py | beauburrows/python-prodj-link | 1cc6b6c19e38ac09fadb91420e45adbe2c9691bb | [
"Apache-2.0"
] | 66 | 2018-01-16T09:25:30.000Z | 2022-03-24T14:58:44.000Z | prodj/pdblib/track.py | beauburrows/python-prodj-link | 1cc6b6c19e38ac09fadb91420e45adbe2c9691bb | [
"Apache-2.0"
] | 25 | 2018-05-16T12:17:11.000Z | 2021-02-06T11:09:03.000Z | prodj/pdblib/track.py | beauburrows/python-prodj-link | 1cc6b6c19e38ac09fadb91420e45adbe2c9691bb | [
"Apache-2.0"
] | 18 | 2018-03-15T13:54:40.000Z | 2022-03-24T20:49:43.000Z | from construct import Struct, Int8ul, Int16ul, Int32ul, Array, Const, Tell, Default
from .piostring import PioString, IndexedPioString
TRACK_ENTRY_MAGIC = 0x24
Track = Struct(
"entry_start" / Tell,
"magic" / Const(TRACK_ENTRY_MAGIC, Int16ul),
"index_shift" / Int16ul, # the index inside the page <<5 (0x00, 0x20,... | 37.129032 | 120 | 0.682016 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,039 | 0.451347 |
5c92a88457ea25794c1ceb7149e058a6f314e651 | 1,301 | py | Python | core/wakeup/SnowboyWakeup.py | aibittek/WallERobot | 956f47ce91cb8e89d67c7a3df23e1a7014ffc1e5 | [
"MIT"
] | 1 | 2021-07-06T04:13:56.000Z | 2021-07-06T04:13:56.000Z | core/wakeup/SnowboyWakeup.py | aibittek/WallERobot | 956f47ce91cb8e89d67c7a3df23e1a7014ffc1e5 | [
"MIT"
] | null | null | null | core/wakeup/SnowboyWakeup.py | aibittek/WallERobot | 956f47ce91cb8e89d67c7a3df23e1a7014ffc1e5 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import os
import sys
import wakeup
import snowboydetect
class SnowboyWakeup(wakeup.Wakeup):
def __init__(self, args):
print(args)
tm = type(args['models'])
ts = type(args['sensitivity'])
if tm is not list:
args['models'] = [args['models']]
... | 36.138889 | 86 | 0.617218 | 1,219 | 0.936972 | 0 | 0 | 0 | 0 | 0 | 0 | 230 | 0.176787 |
5c92ee282d9ec36a7c22cb593bc6dbc705b019f8 | 637 | py | Python | graycode.py | pritam19798/BPCS-Steganography | 3e0025f34bc42d4c5de1a84177a130ff33d3e35e | [
"MIT"
] | null | null | null | graycode.py | pritam19798/BPCS-Steganography | 3e0025f34bc42d4c5de1a84177a130ff33d3e35e | [
"MIT"
] | null | null | null | graycode.py | pritam19798/BPCS-Steganography | 3e0025f34bc42d4c5de1a84177a130ff33d3e35e | [
"MIT"
] | null | null | null |
import cv2
def grayCode(n):
return n ^ (n >> 1)
def inversegrayCode(n):
inv = 0;
while(n):
inv = inv ^ n;
n = n >> 1;
return inv;
def image_grayCode(image):
row,col,channel=image.shape
for r in range(row):
for c in range(col):
for ch in range(channel):
... | 19.30303 | 64 | 0.549451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c9442c10bb96001521c2caf5ee91fdcca995f9d | 35,725 | py | Python | pysnmp-with-texts/SNMP553S-MGMT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/SNMP553S-MGMT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/SNMP553S-MGMT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SNMP553S-MGMT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SNMP553S-MGMT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:08:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 169.312796 | 3,925 | 0.789475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13,812 | 0.38662 |
5c973fe5744d6e662b689c47a3285c65fec2e1df | 6,768 | py | Python | WRN-backbone-32/utils/utils_my.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 5 | 2021-05-23T13:05:45.000Z | 2022-02-13T21:40:59.000Z | WRN-backbone-32/utils/utils_my.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | null | null | null | WRN-backbone-32/utils/utils_my.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 3 | 2021-08-11T03:23:31.000Z | 2021-11-17T01:48:52.000Z | from nested_dict import nested_dict
from functools import partial
import torch
from torch.nn.init import kaiming_normal_
from torch.nn.parallel._functions import Broadcast
from torch.nn.parallel import scatter, parallel_apply, gather
import torch.nn.functional as F
from torch.distributions import Normal, Independent, k... | 31.924528 | 130 | 0.621602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,823 | 0.269356 |
5c9779b9846edaea3abba37e7318794d8978a855 | 1,030 | py | Python | azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/hd_insight_management_client_enums.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | null | null | null | azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/hd_insight_management_client_enums.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/hd_insight_management_client_enums.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 22.391304 | 76 | 0.6 | 519 | 0.503883 | 0 | 0 | 0 | 0 | 0 | 0 | 597 | 0.579612 |
5c9cd4d2ff71a7b5c5769ea7aac45585efe9e300 | 913 | py | Python | src/main.py | ChiaCatPool/ChiaSignature | 114cce3b1e811183c85ef745e21f564b9a6e718c | [
"MIT"
] | 2 | 2021-05-27T09:36:54.000Z | 2021-10-12T08:03:08.000Z | src/main.py | Pow-Duck/ChiaSignature | 114cce3b1e811183c85ef745e21f564b9a6e718c | [
"MIT"
] | null | null | null | src/main.py | Pow-Duck/ChiaSignature | 114cce3b1e811183c85ef745e21f564b9a6e718c | [
"MIT"
] | null | null | null | from fastapi import FastAPI, Response
from pydantic import BaseModel
import src.option as option
import src.plot as plot
app = FastAPI()
@app.get("/")
async def root():
return "Chia Signature Version: 0.0.1 https://github.com/Pow-Duck/ChiaSignature"
class InputDataModel(BaseModel):
farmer_public_key: str
... | 31.482759 | 120 | 0.731654 | 77 | 0.084337 | 0 | 0 | 689 | 0.754655 | 634 | 0.694414 | 162 | 0.177437 |
5c9e7f1f755ab1c025d13ac796c3080931f4af5f | 9,720 | py | Python | notifandhelpline.py | deepthiinduri/TRACK_THE_COVID | c1f3773c5d7e9f41fe464786c6e29bb419ab78e0 | [
"Apache-2.0"
] | 1 | 2021-07-21T08:13:37.000Z | 2021-07-21T08:13:37.000Z | notifandhelpline.py | deepthiinduri/TRACK_THE_COVID | c1f3773c5d7e9f41fe464786c6e29bb419ab78e0 | [
"Apache-2.0"
] | null | null | null | notifandhelpline.py | deepthiinduri/TRACK_THE_COVID | c1f3773c5d7e9f41fe464786c6e29bb419ab78e0 | [
"Apache-2.0"
] | 1 | 2022-02-28T13:05:29.000Z | 2022-02-28T13:05:29.000Z | from tkinter import *
from PIL import ImageTk, Image ,ImageDraw, ImageFont, ImageFilter
import json
import html5lib
import plyer
import urllib.request
import imageio
import webbrowser
import requests
import bs4
def notif_and_helplines():
url = "https://www.mohfw.gov.in/"
html_data = requests.get(url)
bs ... | 66.575342 | 315 | 0.648045 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,625 | 0.267802 |
5c9febd4c5cf40ff34bafdd56f8c84d210e5451c | 56 | py | Python | easy_differ/__init__.py | FurkanOzkaya/easy_differ | 9c81a53447536df006045ea35f264225367c4b61 | [
"MIT"
] | 1 | 2020-09-26T21:46:48.000Z | 2020-09-26T21:46:48.000Z | easy_differ/__init__.py | FurkanOzkaya/easy_differ | 9c81a53447536df006045ea35f264225367c4b61 | [
"MIT"
] | null | null | null | easy_differ/__init__.py | FurkanOzkaya/easy_differ | 9c81a53447536df006045ea35f264225367c4b61 | [
"MIT"
] | null | null | null | from easy_differ.easy_differ import list_diff, text_diff | 56 | 56 | 0.892857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ca0753faa0c3624a568c8b193e922d0dbffa828 | 429 | py | Python | supports/pyload/src/pyload/plugins/accounts/CloudsharesNet.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | 1 | 2020-04-02T17:03:39.000Z | 2020-04-02T17:03:39.000Z | supports/pyload/src/pyload/plugins/accounts/CloudsharesNet.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | null | null | null | supports/pyload/src/pyload/plugins/accounts/CloudsharesNet.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from ..base.xfs_account import XFSAccount
class CloudsharesNet(XFSAccount):
__name__ = "CloudsharesNet"
__type__ = "account"
__version__ = "0.03"
__status__ = "testing"
__pyload_version__ = "0.5"
__description__ = """Cloudshares.net account plugin"""
__license__ ... | 22.578947 | 59 | 0.666667 | 359 | 0.83683 | 0 | 0 | 0 | 0 | 0 | 0 | 163 | 0.379953 |
5ca16157b5f09400ffca7155b0bd7515dc8fa4bf | 790 | py | Python | tests/test_mean_std.py | rdemaria/xfields | 0f1a984c4dda7cd5dadd199e748fb2b584a096c9 | [
"MIT"
] | null | null | null | tests/test_mean_std.py | rdemaria/xfields | 0f1a984c4dda7cd5dadd199e748fb2b584a096c9 | [
"MIT"
] | null | null | null | tests/test_mean_std.py | rdemaria/xfields | 0f1a984c4dda7cd5dadd199e748fb2b584a096c9 | [
"MIT"
] | null | null | null | import numpy as np
import xobjects as xo
import xfields as xf
def test_mean_and_std():
for CTX in xo.ContextCpu, xo.ContextPyopencl, xo.ContextCupy:
if CTX not in xo.context.available:
continue
print(f"Test {CTX}")
ctx = CTX()
n_x=100
a_host = np.array(np.ran... | 28.214286 | 65 | 0.640506 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0.016456 |