hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
78cc971de7aaf0971e41724761db2a4979e3f26e | 2,248 | py | Python | ranker.py | Aklaran/11411-Final-Project | d4f459b40b0adfe42c820c8614f64e115ddcefed | [
"MIT"
] | 2 | 2019-11-05T21:00:16.000Z | 2019-11-28T10:24:04.000Z | ranker.py | Aklaran/11411-Final-Project | d4f459b40b0adfe42c820c8614f64e115ddcefed | [
"MIT"
] | 10 | 2019-10-06T17:32:13.000Z | 2019-11-28T10:05:33.000Z | ranker.py | Aklaran/11411-Final-Project | d4f459b40b0adfe42c820c8614f64e115ddcefed | [
"MIT"
] | 1 | 2019-10-31T19:25:21.000Z | 2019-10-31T19:25:21.000Z | import string
from utils import *
IDEAL_Q_LENGTH = 10
MAX_SCORE = 17
class Ranker:
'''
Holds the ranking data structure for how questions are scored and sorted
The q_list becomes a max priority queue, with the max score at the front.
Properties:
q_list: (list(Question, int)) list tuples of un... | 33.552239 | 93 | 0.606762 | import string
from utils import *
IDEAL_Q_LENGTH = 10
MAX_SCORE = 17
def sortSecond(val):
return val[1]
class Ranker:
'''
Holds the ranking data structure for how questions are scored and sorted
The q_list becomes a max priority queue, with the max score at the front.
Properties:
q_list:... | 1,627 | 0 | 194 |
8133a23f2db8b3156ee7fe282dd901d1f01c8eac | 73 | py | Python | octoprint_marlin_flasher/validation/validators/__init__.py | thinkyhead/OctoPrint-Marlin-Flasher | c43110226d1b9d4aa0df2fdfb8cffab47d687957 | [
"MIT"
] | 1 | 2021-09-20T22:17:22.000Z | 2021-09-20T22:17:22.000Z | octoprint_marlin_flasher/validation/validators/__init__.py | thinkyhead/OctoPrint-Marlin-Flasher | c43110226d1b9d4aa0df2fdfb8cffab47d687957 | [
"MIT"
] | null | null | null | octoprint_marlin_flasher/validation/validators/__init__.py | thinkyhead/OctoPrint-Marlin-Flasher | c43110226d1b9d4aa0df2fdfb8cffab47d687957 | [
"MIT"
] | 1 | 2021-12-10T03:37:29.000Z | 2021-12-10T03:37:29.000Z | from . import arduino
from . import platformio
from . import unsupported
| 18.25 | 25 | 0.794521 | from . import arduino
from . import platformio
from . import unsupported
| 0 | 0 | 0 |
adb3fa1f62395ea649960ae27c16a0c4f6308688 | 678 | py | Python | profiles/migrations/0003_profiles_for_existing_users.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 32 | 2016-03-25T01:03:13.000Z | 2022-01-15T19:35:42.000Z | profiles/migrations/0003_profiles_for_existing_users.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 4,858 | 2016-03-03T13:48:30.000Z | 2022-03-29T22:09:51.000Z | profiles/migrations/0003_profiles_for_existing_users.py | umarmughal824/micromasters | ea92d3bcea9be4601150fc497302ddacc1161622 | [
"BSD-3-Clause"
] | 20 | 2016-08-18T22:07:44.000Z | 2021-11-15T13:35:35.000Z | """
Create Profiles for existing Users
"""
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
def create_profiles(apps, schema_editor):
"""
Create Profiles for all users that do't have it
"""
Users = apps.get_model("auth", "User")
Pr... | 21.1875 | 51 | 0.669617 | """
Create Profiles for existing Users
"""
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
def create_profiles(apps, schema_editor):
"""
Create Profiles for all users that do't have it
"""
Users = apps.get_model("auth", "User")
Pr... | 0 | 163 | 23 |
c59abf44ec8c701a3ad0bb7382ce2ff42210a0b8 | 1,044 | py | Python | severus/blockchain/utils/calculate_funds.py | f-prime/Severus | 9edfab52ecfb9d8db3095a74feef12de1b24d75f | [
"MIT"
] | null | null | null | severus/blockchain/utils/calculate_funds.py | f-prime/Severus | 9edfab52ecfb9d8db3095a74feef12de1b24d75f | [
"MIT"
] | 1 | 2021-04-30T20:52:55.000Z | 2021-04-30T20:52:55.000Z | severus/blockchain/utils/calculate_funds.py | f-prime/Severus | 9edfab52ecfb9d8db3095a74feef12de1b24d75f | [
"MIT"
] | null | null | null | import severus
| 34.8 | 76 | 0.539272 | import severus
def check_spent(output, blocks):
for block in blocks:
for data in block.block_data:
if data.type == "TRANSACTION":
for input_ in data.inputs:
if input_.output_id == output.output_id:
return True
return False
def get... | 943 | 0 | 85 |
b9e593578f911b147e0aa9611956dc2039e2b45f | 711 | py | Python | Python Programs/django_project/blog/get_request.py | mkpro118/github-slideshow | 9e5dad667c81b90a3f7a63cb911e0ce41c0e5b8c | [
"MIT"
] | 3 | 2021-06-13T20:21:08.000Z | 2021-12-19T08:46:18.000Z | Python Programs/django_project/blog/get_request.py | mkpro118/mkpro118-repository | 31670f03e529750720cdfb764bb2c3d3d6e91a04 | [
"MIT"
] | 3 | 2021-06-08T21:43:24.000Z | 2021-06-09T07:56:31.000Z | Python Programs/django_project/blog/get_request.py | mkpro118/github-slideshow | 9e5dad667c81b90a3f7a63cb911e0ce41c0e5b8c | [
"MIT"
] | 2 | 2021-12-20T14:51:54.000Z | 2022-03-19T02:29:56.000Z | from threading import current_thread
from django.utils.deprecation import MiddlewareMixin
_requests = {}
| 27.346154 | 70 | 0.699015 | from threading import current_thread
from django.utils.deprecation import MiddlewareMixin
_requests = {}
def get_request():
return _requests.get(current_thread().ident, None)
class RequestMiddleware(MiddlewareMixin):
def process_request(self, request):
_requests[current_thread().i... | 436 | 20 | 137 |
72750fe3b07b4b6c588f86e209faa589b8b1112c | 2,815 | py | Python | crawl_for_guazi/dataReader.py | hcffffff/secondhand-car-price-prediction | 522b5fa7d1b3e61234766df9b61739211042bc8d | [
"CC0-1.0"
] | null | null | null | crawl_for_guazi/dataReader.py | hcffffff/secondhand-car-price-prediction | 522b5fa7d1b3e61234766df9b61739211042bc8d | [
"CC0-1.0"
] | null | null | null | crawl_for_guazi/dataReader.py | hcffffff/secondhand-car-price-prediction | 522b5fa7d1b3e61234766df9b61739211042bc8d | [
"CC0-1.0"
] | null | null | null | import json
import pandas as pd
import os
def getDict(title, dict):
'''
获取一个子列表,并返回该列表
'''
for child in dict:
if child['title'] == title:
return child
return None
def readSingleCarFile(path):
'''
读位于allData目录下的单个车辆信息json文件
'''
with open(path) as f:
car... | 47.711864 | 244 | 0.623446 | import json
import pandas as pd
import os
def getDict(title, dict):
'''
获取一个子列表,并返回该列表
'''
for child in dict:
if child['title'] == title:
return child
return None
def readSingleCarFile(path):
'''
读位于allData目录下的单个车辆信息json文件
'''
with open(path) as f:
car... | 0 | 0 | 0 |
cd6609433476115c7f383118c51cc74906243bd4 | 19 | py | Python | src/bl_schedule/__init__.py | niebloomj/bl-schedule | a8c5d21d887d39260a8a2d850ebd64d72d4c2227 | [
"MIT"
] | null | null | null | src/bl_schedule/__init__.py | niebloomj/bl-schedule | a8c5d21d887d39260a8a2d850ebd64d72d4c2227 | [
"MIT"
] | 19 | 2022-03-04T02:59:00.000Z | 2022-03-28T03:35:39.000Z | src/bl_schedule/__init__.py | niebloomj/bl-schedule | a8c5d21d887d39260a8a2d850ebd64d72d4c2227 | [
"MIT"
] | null | null | null | """BL Schedule."""
| 9.5 | 18 | 0.526316 | """BL Schedule."""
| 0 | 0 | 0 |
d1eb46995fe247d3cc15118cb1409509c9bf3123 | 280 | py | Python | tadataka/optimization/array_utils.py | IshitaTakeshi/Tadataka | 852c7afb904503005e51884408e1492ef0be836f | [
"Apache-2.0"
] | 54 | 2019-11-15T16:30:34.000Z | 2022-01-13T15:18:54.000Z | tadataka/optimization/array_utils.py | IshitaTakeshi/Tadataka | 852c7afb904503005e51884408e1492ef0be836f | [
"Apache-2.0"
] | 11 | 2019-02-28T08:28:24.000Z | 2020-04-07T04:47:12.000Z | tadataka/optimization/array_utils.py | IshitaTakeshi/Tadataka | 852c7afb904503005e51884408e1492ef0be836f | [
"Apache-2.0"
] | 1 | 2020-02-26T13:59:40.000Z | 2020-02-26T13:59:40.000Z | from tadataka.optimization.functions import Function
| 18.666667 | 52 | 0.664286 | from tadataka.optimization.functions import Function
class Reshape(Function):
def __init__(self, shape):
self.shape = shape
def compute(self, x):
return x.reshape(self.shape)
class Flatten(object):
def compute(self, x):
return x.flatten()
| 96 | 4 | 125 |
b63d906a4974c18d8dfd527b2aad409746c00f6c | 2,323 | py | Python | datalab/context/commands/_projects.py | freyrsae/pydatalab | 9aba1ac6bbe8e1384e7a4b07c5042af84348797d | [
"Apache-2.0"
] | 198 | 2016-07-14T19:47:52.000Z | 2022-03-15T08:45:21.000Z | datalab/context/commands/_projects.py | freyrsae/pydatalab | 9aba1ac6bbe8e1384e7a4b07c5042af84348797d | [
"Apache-2.0"
] | 534 | 2016-07-15T19:12:43.000Z | 2022-03-11T23:11:39.000Z | datalab/context/commands/_projects.py | freyrsae/pydatalab | 9aba1ac6bbe8e1384e7a4b07c5042af84348797d | [
"Apache-2.0"
] | 86 | 2016-07-13T17:39:05.000Z | 2021-11-03T03:39:41.000Z | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 38.716667 | 99 | 0.722772 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 1,240 | 0 | 68 |
fc1f1a3ceee91538d48acfeecd775aa8980f93e8 | 6,275 | py | Python | website/views.py | nahgil2614/country-management-system | a845e7f1c5216cb9e316c459e9843cf97b4f001c | [
"MIT"
] | null | null | null | website/views.py | nahgil2614/country-management-system | a845e7f1c5216cb9e316c459e9843cf97b4f001c | [
"MIT"
] | null | null | null | website/views.py | nahgil2614/country-management-system | a845e7f1c5216cb9e316c459e9843cf97b4f001c | [
"MIT"
] | 1 | 2021-12-02T14:37:58.000Z | 2021-12-02T14:37:58.000Z | from flask import Blueprint, render_template, request, flash, jsonify, redirect, url_for
from flask_login import login_required, current_user
from . import db, cursor, dbmysql
import json
import random
from . import user_info
views = Blueprint('views', __name__)
@views.route('/', methods=['GET', 'POST'])
@login_requi... | 48.269231 | 198 | 0.580398 | from flask import Blueprint, render_template, request, flash, jsonify, redirect, url_for
from flask_login import login_required, current_user
from . import db, cursor, dbmysql
import json
import random
from . import user_info
views = Blueprint('views', __name__)
@views.route('/', methods=['GET', 'POST'])
@login_requi... | 5,679 | 0 | 88 |
1f443840a7e9287bb448c92b7f3e3bc8652f23bb | 3,916 | py | Python | taint_analysis/helper.py | k-karakatsanis/BootStomp | 954ddcdb7a286bd0d6e5be0522266be729baabe5 | [
"BSD-2-Clause"
] | 354 | 2017-08-16T08:19:07.000Z | 2022-03-11T02:39:58.000Z | taint_analysis/helper.py | ethicalhackeragnidhra/BootStomp | 77e4d090585ad1b28bf3ebb65b8eab33e785b78e | [
"BSD-2-Clause"
] | 11 | 2017-08-17T03:36:11.000Z | 2022-02-22T07:11:27.000Z | taint_analysis/helper.py | ethicalhackeragnidhra/BootStomp | 77e4d090585ad1b28bf3ebb65b8eab33e785b78e | [
"BSD-2-Clause"
] | 71 | 2017-08-16T06:54:36.000Z | 2022-01-10T09:20:42.000Z | import operator
from idaapi import *
from idautils import *
# Globals: risky but friendly peeps to speed up coding
# A CFG constructed by angr CFGFast analysis
cfg = ''
# Count of methods discovered by auto-analysis
methods_identified = 0
# A list of FuncInfo() structures holding information on
# functions identified... | 31.580645 | 135 | 0.712717 | import operator
from idaapi import *
from idautils import *
# Globals: risky but friendly peeps to speed up coding
# A CFG constructed by angr CFGFast analysis
cfg = ''
# Count of methods discovered by auto-analysis
methods_identified = 0
# A list of FuncInfo() structures holding information on
# functions identified... | 2,621 | 142 | 157 |
a1bb7d528e1f9be8d3d7e6c5ad3dc47b03bba61c | 2,079 | py | Python | internalCheck/data_saver.py | dario617/RSE-Puppy-bot | f25df7364def0f58ce7abf9f646bb3acbf25b646 | [
"MIT"
] | null | null | null | internalCheck/data_saver.py | dario617/RSE-Puppy-bot | f25df7364def0f58ce7abf9f646bb3acbf25b646 | [
"MIT"
] | null | null | null | internalCheck/data_saver.py | dario617/RSE-Puppy-bot | f25df7364def0f58ce7abf9f646bb3acbf25b646 | [
"MIT"
] | 1 | 2019-11-27T15:43:00.000Z | 2019-11-27T15:43:00.000Z | #coding: utf-8
import json, pymysql, datetime, time
import mysqlcredentials
| 34.081967 | 162 | 0.64406 | #coding: utf-8
import json, pymysql, datetime, time
import mysqlcredentials
def month_to_number(month):
m = { 'ene': 1, 'jan': 1, 'feb': 2, 'mar': 3, 'abr':4, 'apr':4, 'may':5, 'jun':6, 'jul':7, 'ago':8, 'aug':8, 'sep':9, 'oct':10, 'nov':11, 'dic':12, 'dec':12 }
return m[month]
def text_to_dict(text):
try:
... | 1,890 | 0 | 115 |
5843078ff0b838386067b41258a285cd41727b65 | 13,922 | py | Python | server/main/models/metadata.py | somtirtharoy/edd | b69c42d6d3f383347054f2df76d4e577642b2021 | [
"BSD-3-Clause-LBNL"
] | 13 | 2016-11-15T07:33:40.000Z | 2021-09-22T12:19:13.000Z | server/main/models/metadata.py | somtirtharoy/edd | b69c42d6d3f383347054f2df76d4e577642b2021 | [
"BSD-3-Clause-LBNL"
] | 40 | 2017-04-04T15:20:14.000Z | 2022-03-31T04:34:37.000Z | server/main/models/metadata.py | somtirtharoy/edd | b69c42d6d3f383347054f2df76d4e577642b2021 | [
"BSD-3-Clause-LBNL"
] | 10 | 2017-09-21T07:27:01.000Z | 2022-03-10T17:02:19.000Z | """Models for handling metadata."""
import dataclasses
import logging
from django.db import models
from django.db.models import F, Func
from django.utils.translation import gettext_lazy as _
from edd.fields import VarCharField
from .common import EDDSerialize
logger = logging.getLogger(__name__)
class MetadataG... | 33.386091 | 88 | 0.58641 | """Models for handling metadata."""
import dataclasses
import logging
from django.db import models
from django.db.models import F, Func
from django.utils.translation import gettext_lazy as _
from edd.fields import VarCharField
from .common import EDDSerialize
logger = logging.getLogger(__name__)
def __getattr__(... | 1,287 | 123 | 319 |
60c5948b435621c10b46244e429ad6569eb151a6 | 467 | py | Python | SikuliScripts/Settings.sikuli/Settings.py | JabRef-628298/jabref-4.2 | ebf5ff3e1a22ec5881de001a1fbc9214d3c1348d | [
"MIT"
] | null | null | null | SikuliScripts/Settings.sikuli/Settings.py | JabRef-628298/jabref-4.2 | ebf5ff3e1a22ec5881de001a1fbc9214d3c1348d | [
"MIT"
] | null | null | null | SikuliScripts/Settings.sikuli/Settings.py | JabRef-628298/jabref-4.2 | ebf5ff3e1a22ec5881de001a1fbc9214d3c1348d | [
"MIT"
] | null | null | null | App.open("java -jar C:/JabRef-4.2-fat.jar")
wait(30)
click("1529632189350.png")
wait(2)
click("1529632296782.png")
wait(2)
click("1530899089323.png")
wait(2)
click("1530899105356.png")
wait(2)
click("1530899134798.png")
wait(2)
click("1530899120685.png")
wait(2)
click("1530899134798.png")
wait(2)
click("1530899165770.p... | 16.678571 | 43 | 0.732334 | App.open("java -jar C:/JabRef-4.2-fat.jar")
wait(30)
click("1529632189350.png")
wait(2)
click("1529632296782.png")
wait(2)
click("1530899089323.png")
wait(2)
click("1530899105356.png")
wait(2)
click("1530899134798.png")
wait(2)
click("1530899120685.png")
wait(2)
click("1530899134798.png")
wait(2)
click("1530899165770.p... | 0 | 0 | 0 |
25a62d15e741772a1316fa861a4d7b911a81d427 | 4,125 | py | Python | scripts/email_flags.py | lbouma/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 15 | 2015-05-06T05:11:48.000Z | 2021-12-03T14:56:58.000Z | scripts/email_flags.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | null | null | null | scripts/email_flags.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 8 | 2015-05-06T05:11:36.000Z | 2020-11-04T05:11:22.000Z | #!/usr/bin/python
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# Get and set email flags for a given user
import optparse
import sys
# SYNC_ME: Search: Scripts: Load pyserver.
import os
import sys
sys.path.insert(0, os.path.abspath('%s/util'
... | 31.730769 | 79 | 0.636848 | #!/usr/bin/python
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# Get and set email flags for a given user
import optparse
import sys
# SYNC_ME: Search: Scripts: Load pyserver.
import os
import sys
sys.path.insert(0, os.path.abspath('%s/util'
... | 2,553 | 0 | 23 |
69f58cd93503d8fb127e0676b894c56fd0d1aa5d | 1,551 | py | Python | tests/test_promise.py | loehnertj/quickrpc | a051b5eef89bbfc1201f4a5e3e403acb8779a2ee | [
"MIT"
] | null | null | null | tests/test_promise.py | loehnertj/quickrpc | a051b5eef89bbfc1201f4a5e3e403acb8779a2ee | [
"MIT"
] | null | null | null | tests/test_promise.py | loehnertj/quickrpc | a051b5eef89bbfc1201f4a5e3e403acb8779a2ee | [
"MIT"
] | null | null | null | import pytest
import threading
from unittest.mock import Mock, call
from quickrpc.promise import Promise, PromiseDoneError, PromiseTimeoutError, PromiseDeadlockError
@pytest.fixture
@pytest.fixture
| 23.861538 | 97 | 0.712444 | import pytest
import threading
from unittest.mock import Mock, call
from quickrpc.promise import Promise, PromiseDoneError, PromiseTimeoutError, PromiseDeadlockError
class MyVal: pass
class MyError(Exception): pass
@pytest.fixture
def p():
return Promise()
@pytest.fixture
def mock():
return Mock()
def tes... | 1,043 | 5 | 301 |
2df702486a72c56443e6a7b430b136b4d1ae7c3b | 5,493 | py | Python | pyKinectTools/algs/GeodesicSkeleton.py | colincsl/pyKinectTools | a84bb5b7ff9dd613576415932865c2ad435520b3 | [
"BSD-2-Clause-FreeBSD"
] | 33 | 2015-04-07T16:28:04.000Z | 2021-11-22T00:28:43.000Z | pyKinectTools/algs/GeodesicSkeleton.py | colincsl/pyKinectTools | a84bb5b7ff9dd613576415932865c2ad435520b3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | pyKinectTools/algs/GeodesicSkeleton.py | colincsl/pyKinectTools | a84bb5b7ff9dd613576415932865c2ad435520b3 | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2015-04-07T16:28:34.000Z | 2021-04-26T08:04:36.000Z | import numpy as np
import scipy.ndimage as nd
import pyKinectTools.algs.Dijkstras as dgn
# from pyKinectTools.utils.DepthUtils import *
from pyKinectTools.utils.DepthUtils import depthIm2PosIm
from copy import deepcopy
from skimage.draw import circle
from IPython import embed
from pylab import *
def geodesic_extrema... | 30.016393 | 119 | 0.697797 | import numpy as np
import scipy.ndimage as nd
import pyKinectTools.algs.Dijkstras as dgn
# from pyKinectTools.utils.DepthUtils import *
from pyKinectTools.utils.DepthUtils import depthIm2PosIm
from copy import deepcopy
from skimage.draw import circle
from IPython import embed
from pylab import *
def geodesic_extrema... | 451 | 0 | 69 |
16b4cd7e4ade58b63e776516a300279bdbc2cf7e | 1,821 | py | Python | tests/test_parser_always.py | jakesen/opsdroid | 8bd640685ee1b8c8965dfdeb8f1ab06a45a2b85b | [
"Apache-2.0"
] | null | null | null | tests/test_parser_always.py | jakesen/opsdroid | 8bd640685ee1b8c8965dfdeb8f1ab06a45a2b85b | [
"Apache-2.0"
] | 1 | 2018-03-02T19:41:41.000Z | 2018-03-02T19:46:04.000Z | tests/test_parser_always.py | jakesen/opsdroid | 8bd640685ee1b8c8965dfdeb8f1ab06a45a2b85b | [
"Apache-2.0"
] | null | null | null |
import asynctest
import asynctest.mock as amock
from opsdroid.core import OpsDroid
from opsdroid.matchers import match_always
from opsdroid.message import Message
from opsdroid.parsers.always import parse_always
class TestParserAlways(asynctest.TestCase):
"""Test the opsdroid always parser."""
| 32.517857 | 79 | 0.643602 |
import asynctest
import asynctest.mock as amock
from opsdroid.core import OpsDroid
from opsdroid.matchers import match_always
from opsdroid.message import Message
from opsdroid.parsers.always import parse_always
class TestParserAlways(asynctest.TestCase):
"""Test the opsdroid always parser."""
async def te... | 1,437 | 0 | 81 |
4a98389093d9400c70d6d47b1c383ddcaad7dbc3 | 21,031 | py | Python | salt/states/pbm.py | mariusvw/saltstack---salt | 26507afee323b567159795bb45c4b43f192dd4be | [
"Apache-2.0"
] | null | null | null | salt/states/pbm.py | mariusvw/saltstack---salt | 26507afee323b567159795bb45c4b43f192dd4be | [
"Apache-2.0"
] | null | null | null | salt/states/pbm.py | mariusvw/saltstack---salt | 26507afee323b567159795bb45c4b43f192dd4be | [
"Apache-2.0"
] | null | null | null | """
Manages VMware storage policies
(called pbm because the vCenter endpoint is /pbm)
Examples
========
Storage policy
--------------
.. code-block:: python
{
"name": "salt_storage_policy"
"description": "Managed by Salt. Random capability values.",
"resource_type": "STORAGE",
"s... | 37.223009 | 89 | 0.491988 | """
Manages VMware storage policies
(called pbm because the vCenter endpoint is /pbm)
Examples
========
Storage policy
--------------
.. code-block:: python
{
"name": "salt_storage_policy"
"description": "Managed by Salt. Random capability values.",
"resource_type": "STORAGE",
"s... | 531 | 0 | 23 |
0be00f95c2aa2e9ca346775c283e68c0831e2d3f | 548 | py | Python | setup.py | btotharye/mattermost-wrapper-v4 | 955972e3cca401b4e115afd6eb5aaf37e487480b | [
"MIT"
] | 1 | 2018-03-31T13:20:45.000Z | 2018-03-31T13:20:45.000Z | setup.py | btotharye/mattermost-wrapper-v4 | 955972e3cca401b4e115afd6eb5aaf37e487480b | [
"MIT"
] | 3 | 2019-10-17T07:59:31.000Z | 2020-02-18T09:59:16.000Z | setup.py | btotharye/mattermost-wrapper-v4 | 955972e3cca401b4e115afd6eb5aaf37e487480b | [
"MIT"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup
setup(
name="mattermostwrapper",
packages=['mattermostwrapper'],
version="2.2",
author="Brian Hopkins",
author_email="btotharye@gmail.com",
url='https://github.com/btotharye/mattermostwrapper.git',
download_url='https:... | 24.909091 | 85 | 0.684307 | # Always prefer setuptools over distutils
from setuptools import setup
setup(
name="mattermostwrapper",
packages=['mattermostwrapper'],
version="2.2",
author="Brian Hopkins",
author_email="btotharye@gmail.com",
url='https://github.com/btotharye/mattermostwrapper.git',
download_url='https:... | 0 | 0 | 0 |
aef9f93e89345f5b2c02002a3c875efa8715f0f3 | 20,069 | py | Python | tests/dataset/test_synthetic_slate.py | usaito/zr-obp | 57b4bc79d21301703a2b7e6e0c284a308194a795 | [
"Apache-2.0"
] | null | null | null | tests/dataset/test_synthetic_slate.py | usaito/zr-obp | 57b4bc79d21301703a2b7e6e0c284a308194a795 | [
"Apache-2.0"
] | null | null | null | tests/dataset/test_synthetic_slate.py | usaito/zr-obp | 57b4bc79d21301703a2b7e6e0c284a308194a795 | [
"Apache-2.0"
] | null | null | null | from typing import List
import pytest
import numpy as np
import pandas as pd
from obp.dataset import (
linear_reward_function,
logistic_reward_function,
linear_behavior_policy_logit,
SyntheticSlateBanditDataset,
)
from obp.types import BanditFeedback
# n_unique_action, len_list, dim_context, reward_... | 28.107843 | 198 | 0.612836 | from typing import List
import pytest
import numpy as np
import pandas as pd
from obp.dataset import (
linear_reward_function,
logistic_reward_function,
linear_behavior_policy_logit,
SyntheticSlateBanditDataset,
)
from obp.types import BanditFeedback
# n_unique_action, len_list, dim_context, reward_... | 11,476 | 0 | 159 |
c6580967485287133868b6b8ec88ea62ce7707b9 | 4,748 | py | Python | package/cloudshell/tests/test_vm/test_dvswitch_connector.py | DYeag/vCenterShell | e2e24cd938a92a68f4a8e6a860810d3ef72aae6d | [
"Apache-2.0"
] | 20 | 2015-12-06T10:19:27.000Z | 2020-08-05T06:19:46.000Z | package/cloudshell/tests/test_vm/test_dvswitch_connector.py | DYeag/vCenterShell | e2e24cd938a92a68f4a8e6a860810d3ef72aae6d | [
"Apache-2.0"
] | 956 | 2015-12-06T13:00:17.000Z | 2021-03-31T23:54:51.000Z | package/cloudshell/tests/test_vm/test_dvswitch_connector.py | DYeag/vCenterShell | e2e24cd938a92a68f4a8e6a860810d3ef72aae6d | [
"Apache-2.0"
] | 26 | 2015-12-06T15:24:17.000Z | 2020-09-16T09:27:03.000Z | from unittest import TestCase
from mock import Mock, MagicMock
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
from cloudshell.cp.vcenter.common.vcenter.task_waiter import SynchronousTaskWaiter
from cloudshell.cp.vcenter.common.vcenter.vmomi_service import pyVmomiService
from cloudshell.cp.v... | 51.053763 | 116 | 0.573083 | from unittest import TestCase
from mock import Mock, MagicMock
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
from cloudshell.cp.vcenter.common.vcenter.task_waiter import SynchronousTaskWaiter
from cloudshell.cp.vcenter.common.vcenter.vmomi_service import pyVmomiService
from cloudshell.cp.v... | 3,816 | 31 | 77 |
acfcc967ab137664a189755cf911564205187b6a | 5,618 | py | Python | keybind/binder.py | idlesign/keybind | d439051bf3db019f466aa6396b31d61d9df9d254 | [
"BSD-3-Clause"
] | 14 | 2018-12-15T08:40:47.000Z | 2022-03-29T13:37:09.000Z | keybind/binder.py | idlesign/keybind | d439051bf3db019f466aa6396b31d61d9df9d254 | [
"BSD-3-Clause"
] | 4 | 2019-07-04T21:26:19.000Z | 2021-03-03T09:25:02.000Z | keybind/binder.py | idlesign/keybind | d439051bf3db019f466aa6396b31d61d9df9d254 | [
"BSD-3-Clause"
] | 3 | 2019-04-25T18:53:59.000Z | 2020-04-16T11:36:15.000Z | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import logging
import threading
LOGGER = logging.getLogger('keybinder')
def configure_logging(log_level=None):
"""Performs basic logging configuration.
:param log_level: logging level, e.g. logging.DEBUG
Default: logging.INFO
:p... | 26.375587 | 107 | 0.568708 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import logging
import threading
LOGGER = logging.getLogger('keybinder')
def configure_logging(log_level=None):
"""Performs basic logging configuration.
:param log_level: logging level, e.g. logging.DEBUG
Default: logging.INFO
:p... | 509 | 0 | 58 |
315d4ecb38bf33b7c1331d69e086fca1574f3726 | 16,931 | py | Python | tests/dj_project/tests/integration/callbacks/test_missing_inputs.py | pikhovkin/dj-plotly-dash | eed3ced1e652510e39d1aeec4e2703ed21e9f752 | [
"MIT"
] | 39 | 2018-10-07T23:44:51.000Z | 2022-02-16T18:16:40.000Z | tests/dj_project/tests/integration/callbacks/test_missing_inputs.py | pikhovkin/dj-plotly-dash | eed3ced1e652510e39d1aeec4e2703ed21e9f752 | [
"MIT"
] | 66 | 2018-10-07T16:57:25.000Z | 2022-03-17T18:29:47.000Z | tests/dj_project/tests/integration/callbacks/test_missing_inputs.py | pikhovkin/dj-plotly-dash | eed3ced1e652510e39d1aeec4e2703ed21e9f752 | [
"MIT"
] | 7 | 2019-02-13T14:54:18.000Z | 2022-02-15T20:03:19.000Z | import json
import dash_html_components as html
import dash
from dash.testing import wait
from dash.dependencies import Input, Output, State, ALL, MATCH
from dash.testing.plugin import *
from .. import BaseDashView
| 32.372849 | 88 | 0.590928 | import json
import dash_html_components as html
import dash
from dash.testing import wait
from dash.dependencies import Input, Output, State, ALL, MATCH
from dash.testing.plugin import *
from .. import BaseDashView
def wait_for_queue(dash_duo):
# mostly for cases where no callbacks should fire:
# just wait un... | 16,476 | 0 | 230 |
f0004cce83a77ebf6b42caa7b6d81249d0d99be3 | 90 | py | Python | iconizer/msg_service/predefined_receivers.py | weijia/iconizer | 4793e315bcd533f1878d5585b93137789685a387 | [
"BSD-3-Clause"
] | null | null | null | iconizer/msg_service/predefined_receivers.py | weijia/iconizer | 4793e315bcd533f1878d5585b93137789685a387 | [
"BSD-3-Clause"
] | 1 | 2020-07-19T02:28:55.000Z | 2020-07-19T02:28:55.000Z | iconizer/msg_service/predefined_receivers.py | weijia/iconizer | 4793e315bcd533f1878d5585b93137789685a387 | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'Richard'
TAGGING_RECEIVER = "tagging_receiver"
DISTRIBUTOR = "distributor" | 18 | 37 | 0.788889 | __author__ = 'Richard'
TAGGING_RECEIVER = "tagging_receiver"
DISTRIBUTOR = "distributor" | 0 | 0 | 0 |
d2601dd64409ae2ca3603ec1aa5b7359f84718b1 | 4,486 | py | Python | covid_data_tracker/cli.py | granularai/gh5050_covid_data_tracker | 7af3013ad9142a20cf42963e39c8968081cec7db | [
"MIT"
] | null | null | null | covid_data_tracker/cli.py | granularai/gh5050_covid_data_tracker | 7af3013ad9142a20cf42963e39c8968081cec7db | [
"MIT"
] | 51 | 2020-05-31T17:36:37.000Z | 2020-06-24T05:23:19.000Z | covid_data_tracker/cli.py | granularai/gh5050_covid_data_tracker | 7af3013ad9142a20cf42963e39c8968081cec7db | [
"MIT"
] | 1 | 2020-06-11T19:35:41.000Z | 2020-06-11T19:35:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is the entry point for the command-line interface (CLI) application.
It can be used as a handy facility for running the task from a command line.
.. note::
To learn more about Click visit the
`project website <http://click.pocoo.org/5/>`_. There is als... | 32.985294 | 132 | 0.621489 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is the entry point for the command-line interface (CLI) application.
It can be used as a handy facility for running the task from a command line.
.. note::
To learn more about Click visit the
`project website <http://click.pocoo.org/5/>`_. There is als... | 0 | 0 | 0 |
7ea84541c26147b48c9e94445bc34a970f8576e4 | 270 | py | Python | onep/commands/share.py | apognu/1p | 4e3840d166e43d96300045363ad5f59e0a22c52c | [
"MIT"
] | null | null | null | onep/commands/share.py | apognu/1p | 4e3840d166e43d96300045363ad5f59e0a22c52c | [
"MIT"
] | null | null | null | onep/commands/share.py | apognu/1p | 4e3840d166e43d96300045363ad5f59e0a22c52c | [
"MIT"
] | null | null | null | from ..util import run
| 19.285714 | 64 | 0.574074 | from ..util import run
def share(session: str, id: str, time: str, once: bool) -> None:
args = ["item", "share", id]
if time is not None:
args.append(f"--expiry={time}")
if once:
args.append("--view-once")
run(args, session=session)
| 223 | 0 | 23 |
9cdae9bbb89cdc0545646b16d0bcf93e33ac150a | 1,741 | py | Python | luminoth/tools/dataset/merge.py | czbiohub/luminoth | 3b4d57a9b4c3704c64816bbcbd6126a2ac23a069 | [
"BSD-3-Clause"
] | 3 | 2020-01-29T12:04:28.000Z | 2021-04-05T16:30:57.000Z | luminoth/tools/dataset/merge.py | czbiohub/luminoth-uv-imaging | 3b4d57a9b4c3704c64816bbcbd6126a2ac23a069 | [
"BSD-3-Clause"
] | 9 | 2019-11-20T16:57:45.000Z | 2021-03-18T06:57:10.000Z | luminoth/tools/dataset/merge.py | czbiohub/luminoth | 3b4d57a9b4c3704c64816bbcbd6126a2ac23a069 | [
"BSD-3-Clause"
] | null | null | null | import click
import pandas as pd
import tensorflow as tf
@click.command()
@click.argument("src", nargs=-1)
@click.argument("dst", nargs=1)
@click.option(
"--type", type=str, default="tf", help="Type of datasets to merge."
) # noqa
@click.option("--debug", is_flag=True, help="Set level logging to DEBUG.")
def mer... | 27.634921 | 84 | 0.577829 | import click
import pandas as pd
import tensorflow as tf
@click.command()
@click.argument("src", nargs=-1)
@click.argument("dst", nargs=1)
@click.option(
"--type", type=str, default="tf", help="Type of datasets to merge."
) # noqa
@click.option("--debug", is_flag=True, help="Set level logging to DEBUG.")
def mer... | 0 | 0 | 0 |
9000c49563e3616eda6c3dc183420c44aa7fe114 | 783 | py | Python | scripts/BHtry1.py | cesine/BrainHacks-mmMRI | 388cb978b355d5e1cd2b6e4aac99145b89f19237 | [
"BSD-3-Clause"
] | 5 | 2015-03-18T13:42:05.000Z | 2021-03-20T15:07:26.000Z | scripts/BHtry1.py | cesine/BrainHacks-mmMRI | 388cb978b355d5e1cd2b6e4aac99145b89f19237 | [
"BSD-3-Clause"
] | null | null | null | scripts/BHtry1.py | cesine/BrainHacks-mmMRI | 388cb978b355d5e1cd2b6e4aac99145b89f19237 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 25 20:34:32 2014
@author: Imane
"""
import numpy as np
import matplotlib.pyplot as plt
#from os import listdir
#from os.path import isfile, join
#from zscoring import zscoringNII
#from masking import maskdata
from sklearn.decomposition import PCA
from k_means import kmean... | 24.46875 | 70 | 0.690932 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 25 20:34:32 2014
@author: Imane
"""
import numpy as np
import matplotlib.pyplot as plt
#from os import listdir
#from os.path import isfile, join
#from zscoring import zscoringNII
#from masking import maskdata
from sklearn.decomposition import PCA
from k_means import kmean... | 0 | 0 | 0 |
b30657b49136e9a30c83ef5eac46374b0de24e64 | 5,342 | py | Python | service/app.py | lfelipev/tcu-classifier | cb386215d1a106ebe953bad251f20cd2e1cc8335 | [
"MIT"
] | null | null | null | service/app.py | lfelipev/tcu-classifier | cb386215d1a106ebe953bad251f20cd2e1cc8335 | [
"MIT"
] | 6 | 2020-12-07T13:56:40.000Z | 2020-12-07T14:15:29.000Z | service/app.py | lfelipev/tcu-classifier | cb386215d1a106ebe953bad251f20cd2e1cc8335 | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify, make_response
from flask_restplus import Api, Resource, fields
import joblib
import numpy as np
from nltk.corpus import stopwords
import nltk
import json
import stanza
import pandas as pd
from nltk.probability import FreqDist
pd.set_option("display.max_colwidth", 200)
import... | 31.797619 | 129 | 0.662486 | from flask import Flask, request, jsonify, make_response
from flask_restplus import Api, Resource, fields
import joblib
import numpy as np
from nltk.corpus import stopwords
import nltk
import json
import stanza
import pandas as pd
from nltk.probability import FreqDist
pd.set_option("display.max_colwidth", 200)
import... | 3,456 | 124 | 22 |
bf94e538696ce6b664b46a403a730142a910e535 | 2,269 | py | Python | cnswd/scripts/wy_index.py | NeoBert/liudengfeng-cnswd | a9ba636b86de001a75cd51e453a308755b5c1661 | [
"MIT"
] | 7 | 2019-05-23T17:38:16.000Z | 2021-06-26T13:23:01.000Z | cnswd/scripts/wy_index.py | NeoBert/liudengfeng-cnswd | a9ba636b86de001a75cd51e453a308755b5c1661 | [
"MIT"
] | 11 | 2019-09-06T12:52:00.000Z | 2020-10-11T06:14:32.000Z | cnswd/scripts/wy_index.py | NeoBert/liudengfeng-cnswd | a9ba636b86de001a75cd51e453a308755b5c1661 | [
"MIT"
] | 1 | 2019-07-24T11:56:06.000Z | 2019-07-24T11:56:06.000Z | """
刷新指数日线数据
"""
import time
from multiprocessing import Pool
import pandas as pd
from retry.api import retry_call
from ..mongodb import get_db
from ..setting.constants import MAIN_INDEX, MARKET_START, MAX_WORKER
from ..utils import ensure_dtypes
from ..utils.db_utils import to_dict
from ..utils.log_utils import ma... | 27.011905 | 71 | 0.602027 | """
刷新指数日线数据
"""
import time
from multiprocessing import Pool
import pandas as pd
from retry.api import retry_call
from ..mongodb import get_db
from ..setting.constants import MAIN_INDEX, MARKET_START, MAX_WORKER
from ..utils import ensure_dtypes
from ..utils.db_utils import to_dict
from ..utils.log_utils import ma... | 1,711 | 0 | 115 |
c13948a2992008d87905542ff7032970cacc9ef4 | 2,787 | py | Python | F29.Phen2Gene/Phen2GeneTests/phen2gene_exec_tests.py | foundation29org/F29.Phen2Gene | a5a211c9d839382dee32ee7be93c845fe8affd1e | [
"MIT"
] | null | null | null | F29.Phen2Gene/Phen2GeneTests/phen2gene_exec_tests.py | foundation29org/F29.Phen2Gene | a5a211c9d839382dee32ee7be93c845fe8affd1e | [
"MIT"
] | null | null | null | F29.Phen2Gene/Phen2GeneTests/phen2gene_exec_tests.py | foundation29org/F29.Phen2Gene | a5a211c9d839382dee32ee7be93c845fe8affd1e | [
"MIT"
] | null | null | null | import unittest
from ._common import *
from Phen2Gene import Phen2Gene
FOLDER = 'exec'
KBASE_PATH = os.environ.get('KBASE_PATH', '/kbase')
| 48.894737 | 327 | 0.667025 | import unittest
from ._common import *
from Phen2Gene import Phen2Gene
FOLDER = 'exec'
KBASE_PATH = os.environ.get('KBASE_PATH', '/kbase')
class Phen2GeneExecTests(unittest.TestCase):
def __init__(self):
super().__init__(methodName='runTest')
self.phen2gene = Phen2Gene(KBASE_PATH)
def test... | 2,383 | 23 | 238 |
7b880c6f4c099d5b5bb66e894cddd4fafc10a5c8 | 2,084 | py | Python | sandbox/finetuning/envs/mujoco/gather/snake_fixedegoobs_gather_env.py | andrewli77/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 23 | 2020-04-27T23:53:44.000Z | 2022-03-10T03:13:16.000Z | sandbox/finetuning/envs/mujoco/gather/snake_fixedegoobs_gather_env.py | WeiChengTseng/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 1 | 2021-11-14T13:30:22.000Z | 2021-11-14T13:30:22.000Z | sandbox/finetuning/envs/mujoco/gather/snake_fixedegoobs_gather_env.py | WeiChengTseng/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 8 | 2020-06-17T03:28:34.000Z | 2022-03-09T03:13:03.000Z | import math
import numpy as np
from rllab.envs.mujoco.gather.gather_env import GatherEnv
from sandbox.finetuning.envs.mujoco.snake_env import SnakeEnv
APPLE = 0
BOMB = 1
| 37.214286 | 80 | 0.581574 | import math
import numpy as np
from rllab.envs.mujoco.gather.gather_env import GatherEnv
from sandbox.finetuning.envs.mujoco.snake_env import SnakeEnv
APPLE = 0
BOMB = 1
class SnakeFixedEgoObsGatherEnv(GatherEnv):
MODEL_CLASS = SnakeEnv
ORI_IND = 2
def get_readings(self): # equivalent to get_current_m... | 1,796 | 93 | 23 |
0e7ed289b6ce28634dc005c8241a2cd6d022c868 | 273 | py | Python | scripts/ingestors/rwis/get_rwis_ftp_password.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | scripts/ingestors/rwis/get_rwis_ftp_password.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | scripts/ingestors/rwis/get_rwis_ftp_password.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | """Get RWIS FTP password from the database settings"""
from __future__ import print_function
from pyiem.util import get_properties
def main():
"""Go Main Go"""
props = get_properties()
print(props['rwis_ftp_password'])
if __name__ == '__main__':
main()
| 19.5 | 54 | 0.699634 | """Get RWIS FTP password from the database settings"""
from __future__ import print_function
from pyiem.util import get_properties
def main():
"""Go Main Go"""
props = get_properties()
print(props['rwis_ftp_password'])
if __name__ == '__main__':
main()
| 0 | 0 | 0 |
b7c8d659e456237cc34ca4a1da5d670b68288b07 | 3,265 | py | Python | algolab/Assignment1/3/main.py | CaptainLazarus/7thSem | 950d3dbb4abfd32186cb03908f45b6d0e3c8a740 | [
"MIT"
] | null | null | null | algolab/Assignment1/3/main.py | CaptainLazarus/7thSem | 950d3dbb4abfd32186cb03908f45b6d0e3c8a740 | [
"MIT"
] | null | null | null | algolab/Assignment1/3/main.py | CaptainLazarus/7thSem | 950d3dbb4abfd32186cb03908f45b6d0e3c8a740 | [
"MIT"
] | 1 | 2020-10-02T19:13:20.000Z | 2020-10-02T19:13:20.000Z | import time
import json
import functools
from math import atan2
import matplotlib.pyplot as plt
# Debug func
# Plotting points/hull
# Graham Func
#Assumption -> Input is vertices of polygon given in order (CCW) starting with leftmost point
if __name__ == "__main__":
a = [[0,0] , [5,0] , [6,1] , [3,2] , [7,5] , ... | 26.983471 | 93 | 0.454211 | import time
import json
import functools
from math import atan2
import matplotlib.pyplot as plt
# Debug func
def show(L: list):
n = len(L)
# print(n)
for i in range(10):
print(L[i])
print()
# Plotting points/hull
def plot(points, hull=None, type=0 , hull2=None):
if type == 0:
X = [... | 2,249 | 0 | 66 |
527b40fedbba21cd2891da59f496e657036ee656 | 667 | py | Python | core/page/update_manager/update_manager.py | Yellowen/wnframework | 43b7efee96e138dff6c9e22f4e6bcafd963f65e6 | [
"MIT"
] | null | null | null | core/page/update_manager/update_manager.py | Yellowen/wnframework | 43b7efee96e138dff6c9e22f4e6bcafd963f65e6 | [
"MIT"
] | null | null | null | core/page/update_manager/update_manager.py | Yellowen/wnframework | 43b7efee96e138dff6c9e22f4e6bcafd963f65e6 | [
"MIT"
] | 1 | 2018-10-26T01:06:38.000Z | 2018-10-26T01:06:38.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
@webnotes.whitelist(allow_roles=["System Manager", "Administrator"])
| 31.761905 | 92 | 0.748126 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
@webnotes.whitelist(allow_roles=["System Manager", "Administrator"])
def update_this_app():
import co... | 358 | 0 | 22 |
0dd4616afa2002ebe6f6e6585cf5fd1aa5df4349 | 279 | py | Python | src/tsadmuser/views.py | tsadm/webapp | 85056841fbaa06de18844630977b163a6a999e8a | [
"BSD-3-Clause"
] | null | null | null | src/tsadmuser/views.py | tsadm/webapp | 85056841fbaa06de18844630977b163a6a999e8a | [
"BSD-3-Clause"
] | null | null | null | src/tsadmuser/views.py | tsadm/webapp | 85056841fbaa06de18844630977b163a6a999e8a | [
"BSD-3-Clause"
] | null | null | null | from tsadm.log import TSAdmLogger
from tsadm.views.base import TSAdmView
logger = TSAdmLogger(__name__)
| 23.25 | 41 | 0.724014 | from tsadm.log import TSAdmLogger
from tsadm.views.base import TSAdmView
logger = TSAdmLogger(__name__)
class UserView(TSAdmView):
template_name = 'tsadmuser/home.html'
def __init__(self):
logger.debug('UserView init')
super(UserView, self).__init__()
| 77 | 74 | 23 |
67c68ae6495adcc936704241cc97da22d246c62c | 29,574 | py | Python | SimpleDicomToolkit/DicomDatabaseSQL.py | heydude1337/SimpleDicomToolkit | 66d97333900c10d7968a7f46f665d6b530512dd0 | [
"MIT"
] | 1 | 2021-04-07T23:42:57.000Z | 2021-04-07T23:42:57.000Z | SimpleDicomToolkit/DicomDatabaseSQL.py | heydude1337/SimpleDicomToolkit | 66d97333900c10d7968a7f46f665d6b530512dd0 | [
"MIT"
] | null | null | null | SimpleDicomToolkit/DicomDatabaseSQL.py | heydude1337/SimpleDicomToolkit | 66d97333900c10d7968a7f46f665d6b530512dd0 | [
"MIT"
] | 1 | 2019-04-07T02:48:04.000Z | 2019-04-07T02:48:04.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 5 16:54:20 2017
@author: HeyDude
"""
import os
import json
import warnings
import logging
import pydicom
import SimpleITK as sitk
import SimpleDicomToolkit as sdtk
VERSION = 0.93
class Database(sdtk.Logger):
""" Creates a Sqlite3 table from a list of dicom file... | 34.26883 | 79 | 0.580442 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 5 16:54:20 2017
@author: HeyDude
"""
import os
import json
import warnings
import logging
import pydicom
import SimpleITK as sitk
import SimpleDicomToolkit as sdtk
VERSION = 0.93
class Database(sdtk.Logger):
""" Creates a Sqlite3 table from a list of dicom file... | 10,650 | 0 | 715 |
5ec1ddbd9dae1d46b48eb8c21db57932a6255765 | 785 | py | Python | app/migrations/0005_personel.py | Elias999/Mayor_Office | 43218be0f7b53d8a93f77d61f115e61f27c24f81 | [
"MIT"
] | null | null | null | app/migrations/0005_personel.py | Elias999/Mayor_Office | 43218be0f7b53d8a93f77d61f115e61f27c24f81 | [
"MIT"
] | null | null | null | app/migrations/0005_personel.py | Elias999/Mayor_Office | 43218be0f7b53d8a93f77d61f115e61f27c24f81 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-18 10:05
from django.db import migrations, models
| 29.074074 | 114 | 0.543949 | # Generated by Django 3.1.1 on 2020-09-18 10:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0004_auto_20200916_1421'),
]
operations = [
migrations.CreateModel(
name='personel',
fields=[
... | 0 | 671 | 23 |
b789d341cff57442ad337011c673c7053a5f155c | 21,853 | py | Python | alphacsc/other/sporco/sporco/plot.py | sophiaas/alphacsc | 402b8f6c8ee4ba9c86e9da0e2073d900cf8da207 | [
"BSD-3-Clause"
] | 89 | 2017-05-31T19:20:52.000Z | 2022-03-22T09:52:17.000Z | alphacsc/other/sporco/sporco/plot.py | sophiaas/alphacsc | 402b8f6c8ee4ba9c86e9da0e2073d900cf8da207 | [
"BSD-3-Clause"
] | 75 | 2017-07-15T14:03:40.000Z | 2022-03-29T17:31:58.000Z | alphacsc/other/sporco/sporco/plot.py | sophiaas/alphacsc | 402b8f6c8ee4ba9c86e9da0e2073d900cf8da207 | [
"BSD-3-Clause"
] | 35 | 2017-06-16T12:48:23.000Z | 2022-03-21T09:49:55.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2015-2018 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Plotting/visualisation fun... | 34.306122 | 80 | 0.629387 | # -*- coding: utf-8 -*-
# Copyright (C) 2015-2018 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Plotting/visualisation fun... | 972 | 0 | 204 |
0be457c52ae6d97b69eec0781cb801b4d2add802 | 256 | py | Python | onmt/translate/__init__.py | kellywzhang/OpenNMT-py | 2a38fb035fed0597f22694f4580303d1490cbb39 | [
"MIT"
] | 48 | 2018-06-25T09:04:34.000Z | 2021-08-04T05:47:13.000Z | onmt/translate/__init__.py | kellywzhang/OpenNMT-py | 2a38fb035fed0597f22694f4580303d1490cbb39 | [
"MIT"
] | 12 | 2018-09-08T11:12:08.000Z | 2020-07-14T18:42:34.000Z | onmt/translate/__init__.py | kellywzhang/OpenNMT-py | 2a38fb035fed0597f22694f4580303d1490cbb39 | [
"MIT"
] | 21 | 2019-01-04T23:32:22.000Z | 2022-01-16T13:12:27.000Z | from onmt.translate.Translator import Translator
from onmt.translate.Translation import Translation, TranslationBuilder
from onmt.translate.Beam import Beam, GNMTGlobalScorer
__all__ = [Translator, Translation, Beam, GNMTGlobalScorer, TranslationBuilder]
| 42.666667 | 79 | 0.855469 | from onmt.translate.Translator import Translator
from onmt.translate.Translation import Translation, TranslationBuilder
from onmt.translate.Beam import Beam, GNMTGlobalScorer
__all__ = [Translator, Translation, Beam, GNMTGlobalScorer, TranslationBuilder]
| 0 | 0 | 0 |
3efeebd49298a5da51477ea62d25795ff94c73f2 | 9,703 | py | Python | structureimpute/explore/shape_out_stat.py | Tsinghua-gongjing/StructureImpute | 59e33e913998a8841c2cb552828f0f0cc19ebc21 | [
"MIT"
] | 9 | 2021-11-17T11:27:41.000Z | 2022-03-04T10:27:37.000Z | structureimpute/explore/shape_out_stat.py | Tsinghua-gongjing/StructureImpute | 59e33e913998a8841c2cb552828f0f0cc19ebc21 | [
"MIT"
] | null | null | null | structureimpute/explore/shape_out_stat.py | Tsinghua-gongjing/StructureImpute | 59e33e913998a8841c2cb552828f0f0cc19ebc21 | [
"MIT"
] | null | null | null | import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="ticks")
sns.set_context("poster")
import sys, os
from nested_dict import nested_dict
import pandas as pd
import numpy as np
from pyfasta import Fasta
import os
import re
from scipy import stats
import util
get_... | 50.536458 | 570 | 0.712357 | import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="ticks")
sns.set_context("poster")
import sys, os
from nested_dict import nested_dict
import pandas as pd
import numpy as np
from pyfasta import Fasta
import os
import re
from scipy import stats
import util
def ... | 7,921 | 0 | 115 |
0d79acdb8ea7ea231d45d3bcfbdb502ca4100cb1 | 8,470 | py | Python | XAFSmass/__init__.py | kklmn/XAFSmass | f313d382f8ef8e2f1300dc9f28f395c1d3ee3a9a | [
"MIT"
] | 7 | 2016-03-29T18:22:36.000Z | 2021-06-27T14:42:02.000Z | XAFSmass/__init__.py | kklmn/XAFSmass | f313d382f8ef8e2f1300dc9f28f395c1d3ee3a9a | [
"MIT"
] | 1 | 2019-01-24T22:36:42.000Z | 2019-01-24T22:39:53.000Z | XAFSmass/__init__.py | kklmn/XAFSmass | f313d382f8ef8e2f1300dc9f28f395c1d3ee3a9a | [
"MIT"
] | 1 | 2017-05-26T15:35:23.000Z | 2017-05-26T15:35:23.000Z | # -*- coding: utf-8 -*-
r"""
\
+-------------------+--------------------+
| |Screenshot1| | |Screenshot3| |
+-------------------+--------------------+
A program for calculating the mass of XAFS [X-Ray Absorption Fine Structure]
samples. The chemical formula parser understands parentheses and weight
percenta... | 40.917874 | 79 | 0.699882 | # -*- coding: utf-8 -*-
r"""
\
+-------------------+--------------------+
| |Screenshot1| | |Screenshot3| |
+-------------------+--------------------+
A program for calculating the mass of XAFS [X-Ray Absorption Fine Structure]
samples. The chemical formula parser understands parentheses and weight
percenta... | 0 | 0 | 0 |
0eba8eb1e3c2fdb7909ecfd5bd8dab1f098cdb93 | 5,146 | py | Python | plot_weibull_slowdown.py | DistributedSystemsGroup/schedsim | 24afeaf3205a73f7e1811dedb00ba84ce14ec292 | [
"Apache-2.0"
] | 2 | 2018-07-25T08:10:11.000Z | 2019-07-15T11:21:45.000Z | plot_weibull_slowdown.py | DistributedSystemsGroup/schedsim | 24afeaf3205a73f7e1811dedb00ba84ce14ec292 | [
"Apache-2.0"
] | null | null | null | plot_weibull_slowdown.py | DistributedSystemsGroup/schedsim | 24afeaf3205a73f7e1811dedb00ba84ce14ec292 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from __future__ import division
import argparse
import collections
import glob
import shelve
import os.path
import numpy as np
import matplotlib.pyplot as plt
import plot_helpers
import weibull_workload
axes = 'shape sigma load timeshape njobs'.split()
parser = argparse.ArgumentParser(descr... | 36.757143 | 78 | 0.607073 | #!/usr/bin/env python3
from __future__ import division
import argparse
import collections
import glob
import shelve
import os.path
import numpy as np
import matplotlib.pyplot as plt
import plot_helpers
import weibull_workload
axes = 'shape sigma load timeshape njobs'.split()
parser = argparse.ArgumentParser(descr... | 161 | 0 | 23 |
d4f34a62a9ff0342d692105f25171116cdd9329d | 591 | py | Python | cactus/tests/compat.py | danielchasehooper/Cactus | b6dc9fb92248e1fd7fb6f44b57b8835802e9d880 | [
"BSD-3-Clause"
] | 1,048 | 2016-06-04T07:37:40.000Z | 2022-03-06T02:03:16.000Z | cactus/tests/compat.py | danielchasehooper/Cactus | b6dc9fb92248e1fd7fb6f44b57b8835802e9d880 | [
"BSD-3-Clause"
] | 49 | 2016-06-11T18:53:40.000Z | 2021-09-29T07:07:53.000Z | cactus/tests/compat.py | kamalx/Cactus | 8badeff999b9e63092eef0bac2d33d1e6d7c50ed | [
"BSD-3-Clause"
] | 153 | 2016-06-04T08:55:22.000Z | 2021-11-12T17:35:51.000Z | import os
import os.path
import shutil
import tempfile
has_symlink = False
compat_test_dir = tempfile.mkdtemp()
# Check for symlink support (available and usable)
src = os.path.join(compat_test_dir, "src")
dst = os.path.join(compat_test_dir, "dst")
with open(src, "w"):
pass
try:
os.symlink(src, dst)
exc... | 19.064516 | 75 | 0.722504 | import os
import os.path
import shutil
import tempfile
has_symlink = False
compat_test_dir = tempfile.mkdtemp()
# Check for symlink support (available and usable)
src = os.path.join(compat_test_dir, "src")
dst = os.path.join(compat_test_dir, "dst")
with open(src, "w"):
pass
try:
os.symlink(src, dst)
exc... | 0 | 0 | 0 |
aec85b6053c15c5ed1eb3a3227b2b1829e04228f | 768 | py | Python | questionbank/users/tests/test_models.py | SyafiqTermizi/questionbank | 33e58db1a1610a85bd30a85d2f52e819bc27058b | [
"MIT"
] | 1 | 2018-04-17T23:58:46.000Z | 2018-04-17T23:58:46.000Z | questionbank/users/tests/test_models.py | SyafiqTermizi/questionbank | 33e58db1a1610a85bd30a85d2f52e819bc27058b | [
"MIT"
] | 8 | 2019-12-04T23:08:00.000Z | 2022-02-13T22:48:26.000Z | questionbank/users/tests/test_models.py | SyafiqTermizi/questionbank | 33e58db1a1610a85bd30a85d2f52e819bc27058b | [
"MIT"
] | null | null | null | import pytest
from django.shortcuts import reverse
from questionbank.users.constants import ADMIN
pytestmark = pytest.mark.django_db
def test_user_role(user, admin_user):
"""
calling user.role method should return the user group which they are in.
if the user is not in any group, NotImplementedError is... | 24 | 76 | 0.734375 | import pytest
from django.shortcuts import reverse
from questionbank.users.constants import ADMIN
pytestmark = pytest.mark.django_db
def test_user_str(user):
assert user.username == user.__str__()
def test_user_role(user, admin_user):
"""
calling user.role method should return the user group which the... | 254 | 0 | 69 |
b2ecea3b15eaa9e2945b3b55396f7954744dd9ca | 256 | py | Python | Kattis/problems/tripletexting.py | object-oriented-human/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | 2 | 2021-07-27T10:46:47.000Z | 2021-07-27T10:47:57.000Z | Kattis/problems/tripletexting.py | foooop/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | null | null | null | Kattis/problems/tripletexting.py | foooop/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | null | null | null | s = input()
length = len(s)
word_len = int(length / 3)
t = ""
if s[0:word_len] == s[word_len:word_len*2]:
t = s[0:word_len]
elif s[word_len:word_len*2] == s[word_len*2:word_len*3]:
t = s[word_len:word_len*2]
else:
t = s[0:word_len]
print(t) | 17.066667 | 56 | 0.613281 | s = input()
length = len(s)
word_len = int(length / 3)
t = ""
if s[0:word_len] == s[word_len:word_len*2]:
t = s[0:word_len]
elif s[word_len:word_len*2] == s[word_len*2:word_len*3]:
t = s[word_len:word_len*2]
else:
t = s[0:word_len]
print(t) | 0 | 0 | 0 |
8bba8fe7439b221a959efd0041e62cb446c5ea79 | 238 | py | Python | raspy/components/potentiometers/microchip/mcp_command.py | cyrusbuilt/RasPy | 1e34840cc90ea7f19317e881162209d3d819eb09 | [
"MIT"
] | null | null | null | raspy/components/potentiometers/microchip/mcp_command.py | cyrusbuilt/RasPy | 1e34840cc90ea7f19317e881162209d3d819eb09 | [
"MIT"
] | null | null | null | raspy/components/potentiometers/microchip/mcp_command.py | cyrusbuilt/RasPy | 1e34840cc90ea7f19317e881162209d3d819eb09 | [
"MIT"
] | null | null | null | """MCP45XX and MCP46XX commands."""
WRITE = 0x00 << 2
"""Writes to the device."""
INCREASE = 0x01 << 2
"""Increase the resistance."""
DECREASE = 0x02 << 2
"""Decrease the resistance."""
READ = 0x03 << 2
"""Read the current value."""
| 15.866667 | 35 | 0.621849 | """MCP45XX and MCP46XX commands."""
WRITE = 0x00 << 2
"""Writes to the device."""
INCREASE = 0x01 << 2
"""Increase the resistance."""
DECREASE = 0x02 << 2
"""Decrease the resistance."""
READ = 0x03 << 2
"""Read the current value."""
| 0 | 0 | 0 |
53a46f5a2f0c585eebd6a934d242cb5163fe0549 | 8,185 | py | Python | tests/test_big.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | null | null | null | tests/test_big.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | null | null | null | tests/test_big.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Alibaba Cloud 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 la... | 36.540179 | 134 | 0.641295 | # Copyright 2018 Alibaba Cloud 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 la... | 6,673 | 430 | 153 |
d10eef30fb841ae352eda2f77073680588aae65d | 8,961 | py | Python | code/main.py | ashishonce/amlworkspace_2 | cbb82eb0218a6f35a02540f9857bf03bd084fd8d | [
"MIT"
] | null | null | null | code/main.py | ashishonce/amlworkspace_2 | cbb82eb0218a6f35a02540f9857bf03bd084fd8d | [
"MIT"
] | null | null | null | code/main.py | ashishonce/amlworkspace_2 | cbb82eb0218a6f35a02540f9857bf03bd084fd8d | [
"MIT"
] | null | null | null | import os
import json
from azureml.core import Workspace
from azureml.exceptions import WorkspaceException, AuthenticationException, ProjectSystemException
from azureml.core.authentication import ServicePrincipalAuthentication
from adal.adal_error import AdalError
from msrest.exceptions import AuthenticationError
from... | 59.74 | 351 | 0.677603 | import os
import json
from azureml.core import Workspace
from azureml.exceptions import WorkspaceException, AuthenticationException, ProjectSystemException
from azureml.core.authentication import ServicePrincipalAuthentication
from adal.adal_error import AdalError
from msrest.exceptions import AuthenticationError
from... | 8,458 | 0 | 23 |
275a3a779d7095abe93cb6da721d5db31cf36506 | 812 | py | Python | day_4/Binary Search.py | ujjwal002/100daysofDSA | d015973d9256923c2fe7cae74f8cf0b167e74456 | [
"MIT"
] | 1 | 2021-03-08T14:47:24.000Z | 2021-03-08T14:47:24.000Z | day_4/Binary Search.py | ujjwal002/100daysofDSA | d015973d9256923c2fe7cae74f8cf0b167e74456 | [
"MIT"
] | null | null | null | day_4/Binary Search.py | ujjwal002/100daysofDSA | d015973d9256923c2fe7cae74f8cf0b167e74456 | [
"MIT"
] | null | null | null |
arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9]
x = 10
# Function call
result = binary_Search(arr, 0, len(arr)-1, x)
if result != -1:
print ("Element is present at index % d" % result)
else:
print ("Element is not present in array")
| 23.2 | 55 | 0.496305 | def binary_Search (arr, l, r, x):
if r >= l:
mid = l + (r - l) // 2
if arr[mid] == x:
return mid
# If element is smaller than mid, then it
# can only be present in left subarray
elif arr[mid] > x:
return binarySearc... | 547 | 0 | 22 |
d4b57839488f39de601b8c68a86ebfce03f65e96 | 5,481 | py | Python | evaluate.py | oshToy/Character-Aware-LM | 18ebb71f46bd925695c8fbb12bed8479d18af2fd | [
"MIT"
] | null | null | null | evaluate.py | oshToy/Character-Aware-LM | 18ebb71f46bd925695c8fbb12bed8479d18af2fd | [
"MIT"
] | null | null | null | evaluate.py | oshToy/Character-Aware-LM | 18ebb71f46bd925695c8fbb12bed8479d18af2fd | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import pandas as pd
import model
from data_reader import load_data, DataReader, DataReaderFastText, FasttextModel
FLAGS = tf.flags.FLAGS
def r... | 35.590909 | 149 | 0.619595 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import pandas as pd
import model
from data_reader import load_data, DataReader, DataReaderFastText, FasttextModel
FLAGS = tf.flags.FLAGS
def r... | 846 | 0 | 46 |
114e360a4d55580ef9a106bebd8e1ee947f88ad7 | 445 | py | Python | examples/example7-all-boards.py | KebabLord/py8chan | e52081a728c172e3bbbf1fa88951d24295930f90 | [
"WTFPL"
] | 16 | 2016-01-29T01:06:24.000Z | 2021-01-11T17:33:14.000Z | examples/example7-all-boards.py | KebabLord/py8chan | e52081a728c172e3bbbf1fa88951d24295930f90 | [
"WTFPL"
] | 20 | 2015-10-23T14:47:58.000Z | 2021-07-05T23:39:17.000Z | examples/example7-all-boards.py | KebabLord/py8chan | e52081a728c172e3bbbf1fa88951d24295930f90 | [
"WTFPL"
] | 13 | 2016-10-07T18:46:10.000Z | 2022-03-27T16:08:43.000Z | # This example demonstrates the use of the get_all_boards function
import py8chan
if __name__ == '__main__':
main()
| 29.666667 | 66 | 0.676404 | # This example demonstrates the use of the get_all_boards function
import py8chan
def main():
# Get a list of all boards
boards = py8chan.get_all_boards()
# Sort boards by the number of posts
boards.sort(key=lambda x: x.num_posts, reverse=True)
# Print the title and subtitle of the first 10 boards
... | 301 | 0 | 23 |
8eebb725730bdc2531cd4bc575da05e14e0918de | 641 | py | Python | 1131.py | luizgallas/uri_iniciante | fd23f2fe1638b373b94b7b4ddb2d906cec8db87b | [
"Apache-2.0"
] | null | null | null | 1131.py | luizgallas/uri_iniciante | fd23f2fe1638b373b94b7b4ddb2d906cec8db87b | [
"Apache-2.0"
] | null | null | null | 1131.py | luizgallas/uri_iniciante | fd23f2fe1638b373b94b7b4ddb2d906cec8db87b | [
"Apache-2.0"
] | null | null | null | fim = 1
vgremio = 0
vinter = 0
empate = 0
final = 0
soma = 0
while (fim == 1):
inter, gremio = map(int, input().split())
soma += 1
if inter > gremio:
vinter = vinter + 1
elif gremio > inter:
vgremio = vgremio + 1
elif inter == gremio:
empate += 1
print(... | 19.424242 | 45 | 0.560062 | fim = 1
vgremio = 0
vinter = 0
empate = 0
final = 0
soma = 0
while (fim == 1):
inter, gremio = map(int, input().split())
soma += 1
if inter > gremio:
vinter = vinter + 1
elif gremio > inter:
vgremio = vgremio + 1
elif inter == gremio:
empate += 1
print(... | 0 | 0 | 0 |
844b5ebc3ef476cc2e483fc7bde27ac1c66bea6d | 1,199 | py | Python | setup.py | pnnayyeri/ENX16EASY | afb7f6d90ae4edb638812aff5407dd678b845a56 | [
"MIT"
] | 1 | 2021-11-04T10:35:47.000Z | 2021-11-04T10:35:47.000Z | setup.py | pnnayyeri/ENXEASY | afb7f6d90ae4edb638812aff5407dd678b845a56 | [
"MIT"
] | null | null | null | setup.py | pnnayyeri/ENXEASY | afb7f6d90ae4edb638812aff5407dd678b845a56 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="ENXEASY",
version="1.0",
author="Pooyan Nayyeri",
author_email="pnnayyeri@gmail.com",
description="ENX EASY absolute rotary encoders library for Raspberry Pi.",
long_description=long_d... | 31.552632 | 78 | 0.601334 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="ENXEASY",
version="1.0",
author="Pooyan Nayyeri",
author_email="pnnayyeri@gmail.com",
description="ENX EASY absolute rotary encoders library for Raspberry Pi.",
long_description=long_d... | 0 | 0 | 0 |
db4cad8c61460a72d6f582bff2316e9ab3b291a4 | 99 | py | Python | src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/__init__.py | liamtimms/dicom_parser | 963e9e344358c74afe699a25ea250a1baf91dbe0 | [
"MIT"
] | null | null | null | src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/__init__.py | liamtimms/dicom_parser | 963e9e344358c74afe699a25ea250a1baf91dbe0 | [
"MIT"
] | null | null | null | src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/__init__.py | liamtimms/dicom_parser | 963e9e344358c74afe699a25ea250a1baf91dbe0 | [
"MIT"
] | null | null | null | from dicom_parser.utils.sequence_detector.sequences.mr.dwi.dwi import \
MR_DIFFUSION_SEQUENCES
| 33 | 71 | 0.838384 | from dicom_parser.utils.sequence_detector.sequences.mr.dwi.dwi import \
MR_DIFFUSION_SEQUENCES
| 0 | 0 | 0 |
568c6e4d5b703aa804056fa33495e42711d8696a | 899 | py | Python | karapace/protobuf/type_element.py | dswiecki/karapace | b3cc47ee5cd14ed7113748e7fb36744c808f7131 | [
"Apache-2.0"
] | null | null | null | karapace/protobuf/type_element.py | dswiecki/karapace | b3cc47ee5cd14ed7113748e7fb36744c808f7131 | [
"Apache-2.0"
] | null | null | null | karapace/protobuf/type_element.py | dswiecki/karapace | b3cc47ee5cd14ed7113748e7fb36744c808f7131 | [
"Apache-2.0"
] | null | null | null | # Ported from square/wire:
# wire-library/wire-schema/src/commonMain/kotlin/com/squareup/wire/schema/internal/parser/TypeElement.kt
from dataclasses import dataclass
from karapace.protobuf.location import Location
from typing import List, TYPE_CHECKING
if TYPE_CHECKING:
from karapace.protobuf.option_element import... | 27.242424 | 104 | 0.694105 | # Ported from square/wire:
# wire-library/wire-schema/src/commonMain/kotlin/com/squareup/wire/schema/internal/parser/TypeElement.kt
from dataclasses import dataclass
from karapace.protobuf.location import Location
from typing import List, TYPE_CHECKING
if TYPE_CHECKING:
from karapace.protobuf.option_element import... | 159 | 370 | 22 |
53657a65410b07af7f80cd70b060f1ec67ff419b | 7,201 | py | Python | graphgallery/data/base_graph.py | Aria461863631/GraphGallery | 7b62f80ab36b29013bea2538a6581fc696a80201 | [
"MIT"
] | null | null | null | graphgallery/data/base_graph.py | Aria461863631/GraphGallery | 7b62f80ab36b29013bea2538a6581fc696a80201 | [
"MIT"
] | null | null | null | graphgallery/data/base_graph.py | Aria461863631/GraphGallery | 7b62f80ab36b29013bea2538a6581fc696a80201 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import os.path as osp
from functools import partial
from copy import copy as _copy, deepcopy as _deepcopy
from .apply import check_and_convert, sparse_apply
from .io import load_npz
| 32.29148 | 137 | 0.585058 | import sys
import numpy as np
import os.path as osp
from functools import partial
from copy import copy as _copy, deepcopy as _deepcopy
from .apply import check_and_convert, sparse_apply
from .io import load_npz
class BaseGraph:
multiple = None
def __init__(self, **kwargs):
kwargs.pop(... | 2,047 | 4,907 | 24 |
1059c662fed53b358b2a96c687c0843680adf107 | 589 | py | Python | FridgeCade-Project/ggpo/gui/__init__.py | Linuks777/FridgeCade | 22de6933ae642d9ed393f86160670a6906c3ff9a | [
"WTFPL"
] | null | null | null | FridgeCade-Project/ggpo/gui/__init__.py | Linuks777/FridgeCade | 22de6933ae642d9ed393f86160670a6906c3ff9a | [
"WTFPL"
] | null | null | null | FridgeCade-Project/ggpo/gui/__init__.py | Linuks777/FridgeCade | 22de6933ae642d9ed393f86160670a6906c3ff9a | [
"WTFPL"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
import PyQt4.uic
__all__ = ['loadUi']
def loadUi(modpath, widget):
"""
Uses the PyQt4.uic.loadUI method to load the inputed ui file associated
with the given module path and widget class information on the inputed
widget.
:param modpath | str
:par... | 23.56 | 75 | 0.65365 | # -*- coding: utf-8 -*-
import os.path
import PyQt4.uic
__all__ = ['loadUi']
def loadUi(modpath, widget):
"""
Uses the PyQt4.uic.loadUI method to load the inputed ui file associated
with the given module path and widget class information on the inputed
widget.
:param modpath | str
:par... | 0 | 0 | 0 |
0a87a37d777eb8e70a10dcc868c55d19f0561423 | 34,439 | py | Python | python_modules/dagster/dagster/core/definitions/decorators/schedule.py | soyelherein/dagster | f969a3b24e66e61f91e3a7beaedbd2a87f86f85d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/decorators/schedule.py | soyelherein/dagster | f969a3b24e66e61f91e3a7beaedbd2a87f86f85d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/decorators/schedule.py | soyelherein/dagster | f969a3b24e66e61f91e3a7beaedbd2a87f86f85d | [
"Apache-2.0"
] | null | null | null | import datetime
import warnings
from functools import update_wrapper
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, cast
from dagster import check
from dagster.core.definitions.partition import (
PartitionScheduleDefinition,
PartitionSetDefinition,
ScheduleType,
TimeBasedPartiti... | 48.233894 | 103 | 0.687505 | import datetime
import warnings
from functools import update_wrapper
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, cast
from dagster import check
from dagster.core.definitions.partition import (
PartitionScheduleDefinition,
PartitionSetDefinition,
ScheduleType,
TimeBasedPartiti... | 8,698 | 0 | 135 |
e993c68c73de460fcd5c5540b9d6cb382bbcb018 | 1,816 | py | Python | Parse Teslagrad. Get and show scrolls/main.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | Parse Teslagrad. Get and show scrolls/main.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | Parse Teslagrad. Get and show scrolls/main.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# Teslagrad. Прохождение игры на 100%. Карта расположения и изображения свитков (Сайт GamesisArt.ru)
import os
from urllib.parse import urljoin
import requests
# Cache
if not os.path.exists('scrolls.html'):
rs = requests.get('http://gamesi... | 23.584416 | 100 | 0.696035 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# Teslagrad. Прохождение игры на 100%. Карта расположения и изображения свитков (Сайт GamesisArt.ru)
import os
from urllib.parse import urljoin
import requests
# Cache
if not os.path.exists('scrolls.html'):
rs = requests.get('http://gamesi... | 0 | 0 | 0 |
ddb64314faa55bbdc767062c7d701fec41c5ba60 | 865 | py | Python | polyaxon/commands/management/commands/clean_tensorboards.py | wbuchwalter/polyaxon | a01396ea86a74082c457bfbc2c91d283b6ff6fba | [
"MIT"
] | null | null | null | polyaxon/commands/management/commands/clean_tensorboards.py | wbuchwalter/polyaxon | a01396ea86a74082c457bfbc2c91d283b6ff6fba | [
"MIT"
] | null | null | null | polyaxon/commands/management/commands/clean_tensorboards.py | wbuchwalter/polyaxon | a01396ea86a74082c457bfbc2c91d283b6ff6fba | [
"MIT"
] | null | null | null | from django.core.management import BaseCommand
from django.db import ProgrammingError
from constants.jobs import JobLifeCycle
from db.models.tensorboards import TensorboardJob
from scheduler import tensorboard_scheduler
| 33.269231 | 67 | 0.685549 | from django.core.management import BaseCommand
from django.db import ProgrammingError
from constants.jobs import JobLifeCycle
from db.models.tensorboards import TensorboardJob
from scheduler import tensorboard_scheduler
class Command(BaseCommand):
@staticmethod
def _clean():
for job in TensorboardJob... | 543 | 77 | 23 |
8a6f0db6ae90a514e01b72597b2b2bc01ecd14e8 | 4,107 | py | Python | face_recognition/model_interface.py | JierunChen/TVConv | b86e95dbd94bd7fc910e7e643dfd1ca68ac94137 | [
"MIT"
] | 6 | 2022-03-24T03:02:41.000Z | 2022-03-28T14:14:00.000Z | face_recognition/model_interface.py | JierunChen/TVConv | b86e95dbd94bd7fc910e7e643dfd1ca68ac94137 | [
"MIT"
] | null | null | null | face_recognition/model_interface.py | JierunChen/TVConv | b86e95dbd94bd7fc910e7e643dfd1ca68ac94137 | [
"MIT"
] | 1 | 2022-03-28T14:15:36.000Z | 2022-03-28T14:15:36.000Z | from torch.optim.lr_scheduler import *
from face_recognition.model import *
from face_recognition.utils.utils import *
from torch import nn
import pytorch_lightning as pl
from torchmetrics.functional.classification.accuracy import accuracy
# will be used during inference
| 41.484848 | 114 | 0.562941 | from torch.optim.lr_scheduler import *
from face_recognition.model import *
from face_recognition.utils.utils import *
from torch import nn
import pytorch_lightning as pl
from torchmetrics.functional.classification.accuracy import accuracy
class LitModel(pl.LightningModule):
def __init__(self, num_classes, hparam... | 3,605 | 14 | 210 |
7d70c64ebc4f7637fe43fa44cd861920dd1dc255 | 2,149 | py | Python | diagbot.py | pmineev/DiagnosticBot | 7e4ca3c6a187de1dc85e29dfe2db8337f5c9e113 | [
"MIT"
] | null | null | null | diagbot.py | pmineev/DiagnosticBot | 7e4ca3c6a187de1dc85e29dfe2db8337f5c9e113 | [
"MIT"
] | null | null | null | diagbot.py | pmineev/DiagnosticBot | 7e4ca3c6a187de1dc85e29dfe2db8337f5c9e113 | [
"MIT"
] | 1 | 2019-05-06T21:19:46.000Z | 2019-05-06T21:19:46.000Z | import json
from os.path import getmtime
from threading import Thread
from time import sleep
from pyswip import Prolog
from telegram.bot import Bot
from telegram.ext import CommandHandler
from telegram.ext import MessageHandler, Filters
from telegram.ext import Updater
from telegram.utils.request import Requ... | 31.144928 | 84 | 0.611913 | import json
from os.path import getmtime
from threading import Thread
from time import sleep
from pyswip import Prolog
from telegram.bot import Bot
from telegram.ext import CommandHandler
from telegram.ext import MessageHandler, Filters
from telegram.ext import Updater
from telegram.utils.request import Requ... | 1,613 | 22 | 139 |
24da7d5c285c023a8edea696a0d2c3a884618989 | 1,801 | py | Python | documents/第二课----网络爬虫技术/code/资源/《用Python写网络爬虫(第2版)》源代码/wswp-code/code/chp6/edit.py | wynshiter/NLP_DEMO | be3b613f5c2bcde29603c207f620d68e0d571aba | [
"MIT"
] | 7 | 2018-11-28T04:34:55.000Z | 2019-07-02T02:52:51.000Z | documents/第二课----网络爬虫技术/code/资源/《用Python写网络爬虫(第2版)》源代码/wswp-code/code/chp6/edit.py | wynshiter/nlp_demo | be3b613f5c2bcde29603c207f620d68e0d571aba | [
"MIT"
] | null | null | null | documents/第二课----网络爬虫技术/code/资源/《用Python写网络爬虫(第2版)》源代码/wswp-code/code/chp6/edit.py | wynshiter/nlp_demo | be3b613f5c2bcde29603c207f620d68e0d571aba | [
"MIT"
] | 7 | 2019-08-16T07:04:28.000Z | 2022-03-07T13:56:58.000Z | import requests
import json
from lxml.html import fromstring
from chp6.login import login, parse_form
COUNTRY_OR_DISTRICT_URL = 'http://example.python-scraping.com/edit/United-Kingdom-233'
VIEW_URL = 'http://example.python-scraping.com/view/United-Kingdom-233'
if __name__ == '__main__':
add_population()
| 33.351852 | 86 | 0.726818 | import requests
import json
from lxml.html import fromstring
from chp6.login import login, parse_form
COUNTRY_OR_DISTRICT_URL = 'http://example.python-scraping.com/edit/United-Kingdom-233'
VIEW_URL = 'http://example.python-scraping.com/view/United-Kingdom-233'
def get_population():
html = requests.get(VIEW_URL)
... | 1,393 | 0 | 92 |
4ce829be488e26ea7780553b5796418b26efc1b6 | 9,231 | py | Python | federated_datasets/latent_dist.py | NVlabs/FedFomo | fe04f6641407bce4fc58ea3fbf8cb314f9af8629 | [
"BSD-3-Clause-Attribution"
] | 7 | 2021-12-08T00:44:17.000Z | 2022-03-02T13:52:45.000Z | federated_datasets/latent_dist.py | ywang037/FedFomo | fe04f6641407bce4fc58ea3fbf8cb314f9af8629 | [
"BSD-3-Clause-Attribution"
] | null | null | null | federated_datasets/latent_dist.py | ywang037/FedFomo | fe04f6641407bce4fc58ea3fbf8cb314f9af8629 | [
"BSD-3-Clause-Attribution"
] | 5 | 2021-12-28T12:48:33.000Z | 2022-03-05T08:44:22.000Z | """
Train an initial model to compute non-IID client datasets based on the latent representations of samples.
"""
import numpy as np
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler
from torchvision.models import vgg11_bn... | 40.665198 | 146 | 0.628426 | """
Train an initial model to compute non-IID client datasets based on the latent representations of samples.
"""
import numpy as np
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler
from torchvision.models import vgg11_bn... | 6,121 | -4 | 187 |
6765052498eaa7f7fa8aa362cd580ddc751b3260 | 677 | py | Python | Curso/Challenges/URI/1040Average3.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/Challenges/URI/1040Average3.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/Challenges/URI/1040Average3.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | A, B, C, D = input().split(" ")
n1, n2, n3, n4 = float(A), float(B), float(C), float(D)
estado = str("")
media_final = False
teste = 0
media = (n1 * 2 + n2 * 3 + n3 * 4 + n4 * 1) / (2 + 3 + 4 + 1)
print(f"Media: {media:.1f}")
if media >= 7:
estado = "Aluno aprovado."
elif media < 5:
estado = "Aluno reprovado."
... | 26.038462 | 61 | 0.555391 | A, B, C, D = input().split(" ")
n1, n2, n3, n4 = float(A), float(B), float(C), float(D)
estado = str("")
media_final = False
teste = 0
media = (n1 * 2 + n2 * 3 + n3 * 4 + n4 * 1) / (2 + 3 + 4 + 1)
print(f"Media: {media:.1f}")
if media >= 7:
estado = "Aluno aprovado."
elif media < 5:
estado = "Aluno reprovado."
... | 0 | 0 | 0 |
ed5d0576268ee2e1bba5ea85fb35899044c0ec57 | 9,345 | py | Python | AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-12T14:13:45.000Z | 2022-03-12T14:13:45.000Z | AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | 2 | 2022-01-13T04:29:38.000Z | 2022-03-12T01:05:31.000Z | AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Main suite tests for the Atom renderer.
"""
import logging
import os
import pytest
import editor_python_test_tool... | 51.065574 | 117 | 0.635741 | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Main suite tests for the Atom renderer.
"""
import logging
import os
import pytest
import editor_python_test_tool... | 0 | 0 | 0 |
0b4ac6ebe626909088c876c1a968f748aeb07de2 | 7,391 | py | Python | aiohs2/cursor.py | wabu/aio-hs2 | 28096ac21925b41e9f7ec572af989a610517881d | [
"Apache-2.0"
] | 1 | 2015-01-22T10:45:02.000Z | 2015-01-22T10:45:02.000Z | aiohs2/cursor.py | wabu/aio-hs2 | 28096ac21925b41e9f7ec572af989a610517881d | [
"Apache-2.0"
] | null | null | null | aiohs2/cursor.py | wabu/aio-hs2 | 28096ac21925b41e9f7ec572af989a610517881d | [
"Apache-2.0"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2013 Brad Ruderman
# Copyright (c) 2014 Paul Colomiets
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | 38.097938 | 91 | 0.639156 | # The MIT License (MIT)
#
# Copyright (c) 2013 Brad Ruderman
# Copyright (c) 2014 Paul Colomiets
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | 5,226 | 558 | 69 |
2a448f490b15468e20b23b766c100be681a10fce | 3,821 | py | Python | app/app_v2.py | georgetown-analytics/Air-Pollution | 52740e7c338aa25eac4ba7a9a7a8eedf6854283d | [
"MIT"
] | 1 | 2020-01-31T19:20:20.000Z | 2020-01-31T19:20:20.000Z | app/app_v2.py | georgetown-analytics/Air-Pollution | 52740e7c338aa25eac4ba7a9a7a8eedf6854283d | [
"MIT"
] | 23 | 2020-03-13T18:03:04.000Z | 2020-05-16T13:10:33.000Z | app/app_v2.py | georgetown-analytics/Air-Pollution | 52740e7c338aa25eac4ba7a9a7a8eedf6854283d | [
"MIT"
] | 3 | 2020-02-22T18:55:36.000Z | 2020-05-09T01:54:11.000Z | # Standard modules
import numpy as np
import random
import pandas as pd
from flask import Flask, request, render_template
# Scikit Learn modules
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import RandomizedSearchCV
from sklearn.pipeline import Pipeline
from sklearn.preprocessing im... | 27.688406 | 115 | 0.525255 | # Standard modules
import numpy as np
import random
import pandas as pd
from flask import Flask, request, render_template
# Scikit Learn modules
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import RandomizedSearchCV
from sklearn.pipeline import Pipeline
from sklearn.preprocessing im... | 3,118 | 0 | 44 |
fcfa4faf9b31b237e7a70c8e3ca87d2b93cf1e88 | 90 | py | Python | c__63.py | fhansmann/coding-challenges | eebb37565c72e05b77383c24e8273a1e4019b58e | [
"MIT"
] | null | null | null | c__63.py | fhansmann/coding-challenges | eebb37565c72e05b77383c24e8273a1e4019b58e | [
"MIT"
] | null | null | null | c__63.py | fhansmann/coding-challenges | eebb37565c72e05b77383c24e8273a1e4019b58e | [
"MIT"
] | null | null | null | n=int(input())
sum=0.0
for i in range(1,n+1):
sum += float(float(i)/(i+1))
print(sum)
| 15 | 32 | 0.577778 | n=int(input())
sum=0.0
for i in range(1,n+1):
sum += float(float(i)/(i+1))
print(sum)
| 0 | 0 | 0 |
7f5dd4fd7ac17925b4c0bfdedfc8c8dc2512cee6 | 3,334 | py | Python | XueshuSpider/tools/paper_download.py | dilllll/xueshu_spider | 48e35e2a5581cc2bb9864ef01cec7dffe9ba5e74 | [
"MIT"
] | 6 | 2018-07-05T06:17:17.000Z | 2021-05-12T09:09:05.000Z | XueshuSpider/tools/paper_download.py | dilllll/xueshu_spider | 48e35e2a5581cc2bb9864ef01cec7dffe9ba5e74 | [
"MIT"
] | 4 | 2020-10-27T21:18:53.000Z | 2022-03-02T14:55:28.000Z | XueshuSpider/tools/paper_download.py | dilllll/xueshu_spider | 48e35e2a5581cc2bb9864ef01cec7dffe9ba5e74 | [
"MIT"
] | 3 | 2019-11-15T12:45:38.000Z | 2020-11-24T03:13:14.000Z | """
@Author : dilless
@Time : 2018/6/25 22:46
@File : paper_download.py
"""
import os
import re
from datetime import datetime
import MySQLdb
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
if __name__ == '__main__':
db = MySQLAccess()
down = DownloadPape... | 35.468085 | 115 | 0.585183 | """
@Author : dilless
@Time : 2018/6/25 22:46
@File : paper_download.py
"""
import os
import re
from datetime import datetime
import MySQLdb
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
class MySQLAccess(object):
def __init__(self):
self.conn = MySQ... | 2,385 | 397 | 99 |
aca523c82c68b014d3a45ceb0f2c86e7db13a53d | 388 | py | Python | api/ver1/offices/models.py | codacy-badger/politico-api | 10d926bf34f12631cb19bb9c82ccded36557c790 | [
"MIT"
] | null | null | null | api/ver1/offices/models.py | codacy-badger/politico-api | 10d926bf34f12631cb19bb9c82ccded36557c790 | [
"MIT"
] | null | null | null | api/ver1/offices/models.py | codacy-badger/politico-api | 10d926bf34f12631cb19bb9c82ccded36557c790 | [
"MIT"
] | null | null | null | from api.strings import id_key, type_key, name_key
from api.ver1.offices.strings import loc_gov_type, mca, state_type, gov, leg_type, prezzo, fed_type, sen
political_offices = [ { id_key: 1, type_key: loc_gov_type, name_key: mca}, { id_key: 2, type_key: state_type, name_key: prezzo }, { id_key: 3, type_key: fed_type, ... | 77.6 | 230 | 0.742268 | from api.strings import id_key, type_key, name_key
from api.ver1.offices.strings import loc_gov_type, mca, state_type, gov, leg_type, prezzo, fed_type, sen
political_offices = [ { id_key: 1, type_key: loc_gov_type, name_key: mca}, { id_key: 2, type_key: state_type, name_key: prezzo }, { id_key: 3, type_key: fed_type, ... | 0 | 0 | 0 |
8738f235f29b09dfc1be102086343cf4449a35a7 | 985 | py | Python | BBC Microbits/Code/radioluciole.py | TuxStory/Python3 | 4c1b2291d1613b32aa36b62b0b881ea40b423cce | [
"MIT"
] | null | null | null | BBC Microbits/Code/radioluciole.py | TuxStory/Python3 | 4c1b2291d1613b32aa36b62b0b881ea40b423cce | [
"MIT"
] | null | null | null | BBC Microbits/Code/radioluciole.py | TuxStory/Python3 | 4c1b2291d1613b32aa36b62b0b881ea40b423cce | [
"MIT"
] | null | null | null | import radio
import random
from microbit import display, Image, button_a, sleep
# Création de la liste "flash" contenant les images de l'animation
# Comprends-tu comment ça fonctionne ?
flash = [Image().invert()*(i/9) for i in range(9, -1, -1)]
# La radio ne marchera pas sauf si on l'allume !
radio.on()
# Boucle évé... | 33.965517 | 71 | 0.64264 | import radio
import random
from microbit import display, Image, button_a, sleep
# Création de la liste "flash" contenant les images de l'animation
# Comprends-tu comment ça fonctionne ?
flash = [Image().invert()*(i/9) for i in range(9, -1, -1)]
# La radio ne marchera pas sauf si on l'allume !
radio.on()
# Boucle évé... | 0 | 0 | 0 |
2d371ac199cbd395ad6edde42e7059ba720dd21f | 1,270 | py | Python | random_num_rounds_multiplayer/__init__.py | oTree-org/snippets | 6bd4b5fe9fdcec4d759cc0a5b2b2b1c7bb6fe73c | [
"MIT"
] | null | null | null | random_num_rounds_multiplayer/__init__.py | oTree-org/snippets | 6bd4b5fe9fdcec4d759cc0a5b2b2b1c7bb6fe73c | [
"MIT"
] | null | null | null | random_num_rounds_multiplayer/__init__.py | oTree-org/snippets | 6bd4b5fe9fdcec4d759cc0a5b2b2b1c7bb6fe73c | [
"MIT"
] | null | null | null | from otree.api import *
doc = """
Random number of rounds for multiplayer (random stopping rule)
"""
# PAGES
page_sequence = [MyPage, ResultsWaitPage, Results]
| 20.483871 | 62 | 0.690551 | from otree.api import *
doc = """
Random number of rounds for multiplayer (random stopping rule)
"""
class C(BaseConstants):
NAME_IN_URL = 'random_num_rounds_multiplayer'
PLAYERS_PER_GROUP = None
# choose NUM_ROUNDS high enough that the chance of
# maxing out is negligible
NUM_ROUNDS = 50
ST... | 546 | 368 | 183 |
a3b2dc5f95ecd699ec28a083d92b7662638588a7 | 1,159 | py | Python | Nearest Neighboor/iris-nn.py | tinenbruno/ml_examples | a86b27044d6b4add9c862affea4199c560d869da | [
"MIT"
] | null | null | null | Nearest Neighboor/iris-nn.py | tinenbruno/ml_examples | a86b27044d6b4add9c862affea4199c560d869da | [
"MIT"
] | null | null | null | Nearest Neighboor/iris-nn.py | tinenbruno/ml_examples | a86b27044d6b4add9c862affea4199c560d869da | [
"MIT"
] | null | null | null | import csv
import math
training_dataset = []
training_labels = []
test_dataset = []
test_labels = []
# Populate training and test sets
with open('iris_training.csv', 'rU') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', dialect=csv.excel_tab)
for row in spamreader:
training_dataset.append([ float... | 29.717949 | 91 | 0.704055 | import csv
import math
def euclideanDistance(x, y):
distance = 0
for i in range(len(x)):
distance += math.pow(x[i] - y[i], 2)
return distance
training_dataset = []
training_labels = []
test_dataset = []
test_labels = []
# Populate training and test sets
with open('iris_training.csv', 'rU') as csvfile:
s... | 107 | 0 | 23 |
c1fb9df8f10cb711bd9da302508f6c8d904a5b51 | 40,683 | py | Python | pysnmp/Wellfleet-DVMRP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Wellfleet-DVMRP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Wellfleet-DVMRP-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 Wellfleet-DVMRP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-DVMRP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:33:21 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 149.021978 | 7,472 | 0.785758 | #
# PySNMP MIB module Wellfleet-DVMRP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-DVMRP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:33:21 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 0 | 0 | 0 |
864a4a65b6b78d499aea63872b6c1777604ad5b1 | 1,992 | py | Python | libs/research/lyrics.py | niryarden/lyrics_bot | 9968dea4c3aea0cdd254ae02d4fe9d745c76dd2a | [
"MIT"
] | null | null | null | libs/research/lyrics.py | niryarden/lyrics_bot | 9968dea4c3aea0cdd254ae02d4fe9d745c76dd2a | [
"MIT"
] | 1 | 2021-06-02T00:44:27.000Z | 2021-06-02T00:44:27.000Z | libs/research/lyrics.py | niryarden/lyrics_bot | 9968dea4c3aea0cdd254ae02d4fe9d745c76dd2a | [
"MIT"
] | null | null | null | import os
import json
import requests
from bs4 import BeautifulSoup as bs
from googlesearch import search
| 42.382979 | 106 | 0.668173 | import os
import json
import requests
from bs4 import BeautifulSoup as bs
from googlesearch import search
def get_lyrics_for_hebrew(to_search):
# google search the song on "shironet.mako.co.il"
lyrics_site = "shironet.mako.co.il"
query = "site:" + lyrics_site + " " + to_search
results_lst = [result fo... | 1,844 | 0 | 46 |
ffb417d3c5d405319d38eb56b00db6cc344256b5 | 2,376 | py | Python | gs/group/member/subscribe/tests/messagesender.py | groupserver/gs.group.member.subscribe | 726044cf0caa58bcbb170ccf7467d3398bd9d07a | [
"ZPL-2.1"
] | null | null | null | gs/group/member/subscribe/tests/messagesender.py | groupserver/gs.group.member.subscribe | 726044cf0caa58bcbb170ccf7467d3398bd9d07a | [
"ZPL-2.1"
] | null | null | null | gs/group/member/subscribe/tests/messagesender.py | groupserver/gs.group.member.subscribe | 726044cf0caa58bcbb170ccf7467d3398bd9d07a | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2016 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... | 40.965517 | 92 | 0.673401 | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2016 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... | 735 | 738 | 23 |
e09954847d0a59744f3d011da3e1f3c26ac6a502 | 1,867 | py | Python | hopper_controller/src/hopper_leg_position_reader_node.py | CreedyNZ/Hopper_ROS | 1e6354109f034a7d1d41a5b39ddcb632cfee64b2 | [
"MIT"
] | 36 | 2018-12-19T18:03:08.000Z | 2022-02-21T16:20:12.000Z | hopper_controller/src/hopper_leg_position_reader_node.py | CreedyNZ/Hopper_ROS | 1e6354109f034a7d1d41a5b39ddcb632cfee64b2 | [
"MIT"
] | null | null | null | hopper_controller/src/hopper_leg_position_reader_node.py | CreedyNZ/Hopper_ROS | 1e6354109f034a7d1d41a5b39ddcb632cfee64b2 | [
"MIT"
] | 7 | 2019-08-11T20:31:27.000Z | 2021-09-19T04:34:18.000Z | #!/usr/bin/env python
from __future__ import division
import rospy
from ros_abstraction import IkController
from geometry_msgs.msg import Point, Vector3
from std_msgs.msg import ColorRGBA
from visualization_msgs.msg import Marker
if __name__ == "__main__":
LegPositionReader()
| 35.903846 | 88 | 0.726834 | #!/usr/bin/env python
from __future__ import division
import rospy
from ros_abstraction import IkController
from geometry_msgs.msg import Point, Vector3
from std_msgs.msg import ColorRGBA
from visualization_msgs.msg import Marker
def create_marker_for_feet(leg_positions):
marker = Marker()
marker.header.fram... | 1,498 | 11 | 72 |
eb6068178324838ca9a6303139d13984c44d4170 | 977 | py | Python | examples/1827402013.py | lobo0616/bysj | c90bf1de8328cf44acb6faaaac4b575b83ef11a1 | [
"MIT"
] | 1 | 2020-03-30T15:33:25.000Z | 2020-03-30T15:33:25.000Z | examples/1827402013.py | lobo0616/bysj | c90bf1de8328cf44acb6faaaac4b575b83ef11a1 | [
"MIT"
] | null | null | null | examples/1827402013.py | lobo0616/bysj | c90bf1de8328cf44acb6faaaac4b575b83ef11a1 | [
"MIT"
] | 1 | 2020-04-02T14:37:26.000Z | 2020-04-02T14:37:26.000Z | # 学号:1827402013
# 姓名:司诺男
# IP:192.168.157.154
# 上传时间:2018/11/12 15:02:21
import math
if __name__=="__main__":
pass
| 19.938776 | 36 | 0.417605 | # 学号:1827402013
# 姓名:司诺男
# IP:192.168.157.154
# 上传时间:2018/11/12 15:02:21
import math
def func1(a,b):
if a>b:
return None
else:
ji=1
for i in range (a,b+1):
ji=ji*i
count = 0
while ji%10 == 0:
count+=1
ji=ji/10
... | 760 | 0 | 85 |
d2dff796d6401a02a1eb29a62f519960d97951f2 | 2,441 | py | Python | planning_and_simulation_modules/dhcoptimizerplanheat/optimizer/config.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 2 | 2020-04-07T03:43:33.000Z | 2021-03-23T13:17:42.000Z | planning_and_simulation_modules/dhcoptimizerplanheat/optimizer/config.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 1 | 2020-07-20T09:56:13.000Z | 2020-07-22T10:26:06.000Z | planning_and_simulation_modules/dhcoptimizerplanheat/optimizer/config.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 1 | 2020-07-20T09:40:15.000Z | 2020-07-20T09:40:15.000Z | # == CRS settings == #
CRS = {'init': 'epsg:4326'}
# == KEYS == #
# geopandas geometry key
GPD_GEO_KEY = "geometry"
# graph keys
NODE_TYPE_KEY = "nodetype"
EDGE_COST_KEY = "cost"
EDGE_LENGTH_KEY = "length"
SOLUTION_POWER_FLOW_KEY = "flow"
NODE_ELEVATION_KEY = "z"
ORIGINAL_EDGE_KEY = "original_edge"
PIPE_DIAMETER_KEY ... | 27.122222 | 107 | 0.796395 | # == CRS settings == #
CRS = {'init': 'epsg:4326'}
# == KEYS == #
# geopandas geometry key
GPD_GEO_KEY = "geometry"
# graph keys
NODE_TYPE_KEY = "nodetype"
EDGE_COST_KEY = "cost"
EDGE_LENGTH_KEY = "length"
SOLUTION_POWER_FLOW_KEY = "flow"
NODE_ELEVATION_KEY = "z"
ORIGINAL_EDGE_KEY = "original_edge"
PIPE_DIAMETER_KEY ... | 0 | 0 | 0 |
7405f935910ace579eb3708003af47c622f51a31 | 2,643 | py | Python | pyi2c/nomblot_i2c.py | alsprogrammer/pyi2c | aed6d6eabb7f8efad839f62eccd86450619b0e70 | [
"MIT"
] | null | null | null | pyi2c/nomblot_i2c.py | alsprogrammer/pyi2c | aed6d6eabb7f8efad839f62eccd86450619b0e70 | [
"MIT"
] | null | null | null | pyi2c/nomblot_i2c.py | alsprogrammer/pyi2c | aed6d6eabb7f8efad839f62eccd86450619b0e70 | [
"MIT"
] | null | null | null | """Main module."""
# ! /usr/bin/env python
#
# python I2C
#
# (C)2020 Aleksandr Saiapin <alstutor@gmail.com>
# (C)2006 Patrick Nomblot <pyI2C@nomblot.org>
# this is distributed under a free software license, see license.txt
import time
from typing import List
from pyi2c.protocol import I2CProtocol
I2C_REGISTER_WRITE... | 28.419355 | 98 | 0.608021 | """Main module."""
# ! /usr/bin/env python
#
# python I2C
#
# (C)2020 Aleksandr Saiapin <alstutor@gmail.com>
# (C)2006 Patrick Nomblot <pyI2C@nomblot.org>
# this is distributed under a free software license, see license.txt
import time
from typing import List
from pyi2c.protocol import I2CProtocol
I2C_REGISTER_WRITE... | 2,069 | 179 | 46 |
dcab9f546b815ab3b8e6736895cee21bbb24b5e7 | 53,997 | py | Python | src/fitly/api/fitlyAPI.py | ethanopp/fitly | 8ee1c9db840b61424c0eea81b7805aa65f097146 | [
"MIT"
] | 107 | 2020-03-03T07:22:53.000Z | 2022-03-07T18:45:00.000Z | src/fitly/api/fitlyAPI.py | ethanopp/fitly | 8ee1c9db840b61424c0eea81b7805aa65f097146 | [
"MIT"
] | 20 | 2020-03-03T15:43:34.000Z | 2021-03-14T03:30:58.000Z | src/fitly/api/fitlyAPI.py | ethanopp/fitly | 8ee1c9db840b61424c0eea81b7805aa65f097146 | [
"MIT"
] | 22 | 2020-03-06T11:01:12.000Z | 2022-03-04T02:10:48.000Z | from datetime import datetime, timedelta
import numpy as np
from ..api.sqlalchemy_declarative import ouraSleepSummary, ouraReadinessSummary, withings, athlete, stravaSummary, \
strydSummary, fitbod, workoutStepLog, dbRefreshStatus
from sqlalchemy import func, cast, Date
from sweat.io.models.dataframes import Workou... | 55.268168 | 199 | 0.567124 | from datetime import datetime, timedelta
import numpy as np
from ..api.sqlalchemy_declarative import ouraSleepSummary, ouraReadinessSummary, withings, athlete, stravaSummary, \
strydSummary, fitbod, workoutStepLog, dbRefreshStatus
from sqlalchemy import func, cast, Date
from sweat.io.models.dataframes import Workou... | 29,242 | 7,289 | 92 |
59f09b3b7d5c664c555744b84e7e62ab66807092 | 452 | py | Python | flask_ssl/main.py | joaovitorvlb/flask_apps | faeecdb7f46ca76d9c032819a5e919b472f0a143 | [
"MIT"
] | null | null | null | flask_ssl/main.py | joaovitorvlb/flask_apps | faeecdb7f46ca76d9c032819a5e919b472f0a143 | [
"MIT"
] | null | null | null | flask_ssl/main.py | joaovitorvlb/flask_apps | faeecdb7f46ca76d9c032819a5e919b472f0a143 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify
from OpenSSL import SSL
app = Flask(__name__)
context = SSL.Context(SSL.TLSv1_1_METHOD)
context.use_privatekey_file("server.key")
context.use_certificate_file("server.crt")
@app.route("/")
@app.route("/data")
if __name__ == "__main__":
app.run(ssl_context=context)
| 19.652174 | 60 | 0.69469 | from flask import Flask, jsonify
from OpenSSL import SSL
app = Flask(__name__)
context = SSL.Context(SSL.TLSv1_1_METHOD)
context.use_privatekey_file("server.key")
context.use_certificate_file("server.crt")
@app.route("/")
def index():
return "Flask is running!"
@app.route("/data")
def names():
data = {"nam... | 99 | 0 | 44 |
53ed96d2e771b101baa8cba6bee5361fccf2a8dd | 2,824 | py | Python | tms_rp/smartpal5_arm_navigation/scripts/moveit_fk_demo.py | robotpilot/ros_tms | 3d6b6579e89aa9cb216cd3cb6157fabc553c18f1 | [
"BSD-3-Clause"
] | 54 | 2015-01-06T06:58:28.000Z | 2021-05-02T07:49:37.000Z | tms_rp/smartpal5_arm_navigation/scripts/moveit_fk_demo.py | robotpilot/ros_tms | 3d6b6579e89aa9cb216cd3cb6157fabc553c18f1 | [
"BSD-3-Clause"
] | 114 | 2015-01-07T06:42:21.000Z | 2022-02-12T05:54:04.000Z | tms_rp/smartpal5_arm_navigation/scripts/moveit_fk_demo.py | robotpilot/ros_tms | 3d6b6579e89aa9cb216cd3cb6157fabc553c18f1 | [
"BSD-3-Clause"
] | 24 | 2015-03-27T08:35:59.000Z | 2020-06-08T13:05:31.000Z | #!/usr/bin/env python
"""
moveit_fk_demo.py - Version 0.1.1 2015-08-26
Use forward kinemtatics to move the arm to a specified set of joint angles
Copyright 2014 by Patrick Goebel <patrick@pirobot.org, www.pirobot.org>
Copyright 2015 by YS Pyo <passionvirus@gmail.com>
This program is free softwar... | 29.726316 | 78 | 0.67068 | #!/usr/bin/env python
"""
moveit_fk_demo.py - Version 0.1.1 2015-08-26
Use forward kinemtatics to move the arm to a specified set of joint angles
Copyright 2014 by Patrick Goebel <patrick@pirobot.org, www.pirobot.org>
Copyright 2015 by YS Pyo <passionvirus@gmail.com>
This program is free softwar... | 1,665 | -2 | 50 |
0e827b9d60d0930985e58dfe5f8f3d12c9d98106 | 425 | py | Python | app/routes.py | n0hype/nemnodetracker | 4b72626a4d1b23305ba8bd9e416b866d6b6bb2f2 | [
"MIT"
] | null | null | null | app/routes.py | n0hype/nemnodetracker | 4b72626a4d1b23305ba8bd9e416b866d6b6bb2f2 | [
"MIT"
] | 4 | 2020-03-24T17:48:22.000Z | 2021-08-23T20:27:00.000Z | app/routes.py | n0hype/nemnodetracker | 4b72626a4d1b23305ba8bd9e416b866d6b6bb2f2 | [
"MIT"
] | null | null | null | from flask import render_template
from app import app, cache
import app.views as v
@app.route('/')
@app.route('/index')
| 26.5625 | 155 | 0.762353 | from flask import render_template
from app import app, cache
import app.views as v
@app.route('/')
@app.route('/index')
def index():
node_heights_data = v.getNodesHeights()
network_node_state_data = v.getNodeState()
colors = app.config['GRAPH_COLORS']
return render_template("index.html", title="Hom... | 279 | 0 | 22 |
ae2d235885830d2d237b2856d5ea2e0a52e0dca1 | 166 | py | Python | skforecast/model_selection/__init__.py | JavierEscobarOrtiz/skforecast | a3af4a1dd4201c582f159d4e3a1734ed6d29b6c5 | [
"MIT"
] | 1 | 2021-12-01T09:21:21.000Z | 2021-12-01T09:21:21.000Z | skforecast/model_selection/__init__.py | JavierEscobarOrtiz/skforecast | a3af4a1dd4201c582f159d4e3a1734ed6d29b6c5 | [
"MIT"
] | null | null | null | skforecast/model_selection/__init__.py | JavierEscobarOrtiz/skforecast | a3af4a1dd4201c582f159d4e3a1734ed6d29b6c5 | [
"MIT"
] | null | null | null | from .model_selection import time_series_splitter, cv_forecaster, backtesting_forecaster, grid_search_forecaster, random_search_forecaster, bayesian_search_forecaster | 166 | 166 | 0.915663 | from .model_selection import time_series_splitter, cv_forecaster, backtesting_forecaster, grid_search_forecaster, random_search_forecaster, bayesian_search_forecaster | 0 | 0 | 0 |
5a0aceb49809bb6c3d722d1f3392f138ac3a9545 | 909 | py | Python | Noise2noise_pytorch/main.py | davidpqc1231/AnnotatedNetworkModelGit | 419e6c9ef31f1efe7fd63d693b12c08a7d8c0f33 | [
"MIT"
] | 1 | 2020-04-11T10:13:35.000Z | 2020-04-11T10:13:35.000Z | Noise2noise_pytorch/main.py | wuxiaolianggit/PytorchNetHub | e6bcb57b8ffb61b53ebdb9a09f6b25e516b4efc7 | [
"MIT"
] | null | null | null | Noise2noise_pytorch/main.py | wuxiaolianggit/PytorchNetHub | e6bcb57b8ffb61b53ebdb9a09f6b25e516b4efc7 | [
"MIT"
] | null | null | null | import os
from utils.config import opt_train,opt_test
from data.datasets import load_dataset
from noise2noise import Noise2Noise
if __name__ == '__main__':
os.environ['CUDA_VISIBLE_DEVICES'] = '1' # 选择哪块GPU运行 '0' or '1' or '0,1'
#训练
# train()
# 测试单张图片,将结果保存到文件夹下
test()
| 27.545455 | 101 | 0.722772 | import os
from utils.config import opt_train,opt_test
from data.datasets import load_dataset
from noise2noise import Noise2Noise
def train():
# 加载训练集和验证集
train_loader = load_dataset(opt_train.train_dir, opt_train.train_size, opt_train, shuffled=True)
valid_loader = load_dataset(opt_train.valid_dir, opt_tra... | 640 | 0 | 45 |
2db595049969d705011650eb6f5af525e944d3c3 | 177 | py | Python | test.py | sebastian-meier/LoCobSS-text-sentiment | 181212466a8553562a66a558e8d0ffaa1a386b5f | [
"MIT"
] | null | null | null | test.py | sebastian-meier/LoCobSS-text-sentiment | 181212466a8553562a66a558e8d0ffaa1a386b5f | [
"MIT"
] | null | null | null | test.py | sebastian-meier/LoCobSS-text-sentiment | 181212466a8553562a66a558e8d0ffaa1a386b5f | [
"MIT"
] | null | null | null | import requests
url = 'http://localhost:5050/predict'
body = {
"text": "The insurance company is evil!"
}
response = requests.post(url, data=body)
print(response.json()) | 16.090909 | 44 | 0.689266 | import requests
url = 'http://localhost:5050/predict'
body = {
"text": "The insurance company is evil!"
}
response = requests.post(url, data=body)
print(response.json()) | 0 | 0 | 0 |
dcd73de5f87e14339a62f0717c2f34c931f7730d | 429 | py | Python | src/datamodules/transforms/random_choice_compose.py | AlessandroRuzzi/Computational-Intelligence-Lab-2021 | ed9dae37618e0ca2f01c4e336df4354e77e00c1f | [
"MIT"
] | null | null | null | src/datamodules/transforms/random_choice_compose.py | AlessandroRuzzi/Computational-Intelligence-Lab-2021 | ed9dae37618e0ca2f01c4e336df4354e77e00c1f | [
"MIT"
] | null | null | null | src/datamodules/transforms/random_choice_compose.py | AlessandroRuzzi/Computational-Intelligence-Lab-2021 | ed9dae37618e0ca2f01c4e336df4354e77e00c1f | [
"MIT"
] | 2 | 2022-01-22T21:06:10.000Z | 2022-01-30T13:30:39.000Z | import random
from typing import Any, Callable, List
class RandomChoiceCompose:
"""
Randomly choose to apply one transform from a collection of transforms.
"""
| 25.235294 | 75 | 0.67366 | import random
from typing import Any, Callable, List
class RandomChoiceCompose:
"""
Randomly choose to apply one transform from a collection of transforms.
"""
def __init__(self, transforms: List[Callable]) -> None:
self.transforms = transforms
def __call__(self, *inputs: Any) -> Any:
... | 201 | 0 | 54 |
1395e786e57475eaebb495baf9d9e0425d773dd0 | 1,494 | py | Python | extensions.py | SuperSonicHub1/Twitter-RSS | 585739604bec89b8a3e867bc67d2f79abe550e85 | [
"Unlicense"
] | null | null | null | extensions.py | SuperSonicHub1/Twitter-RSS | 585739604bec89b8a3e867bc67d2f79abe550e85 | [
"Unlicense"
] | null | null | null | extensions.py | SuperSonicHub1/Twitter-RSS | 585739604bec89b8a3e867bc67d2f79abe550e85 | [
"Unlicense"
] | null | null | null | from rfeed import *
| 27.666667 | 72 | 0.586345 | from rfeed import *
class MediaContent(Extension):
def get_namespace(self):
return {
"xmlns:content": "http://purl.org/rss/1.0/modules/content/",
'xmlns:media': 'http://search.yahoo.com/mrss/',
}
class MediaItem(Serializable):
def __init__(self, url, type, medium, isDef... | 1,094 | 48 | 330 |
f8ddaaad5b11fabc24bf9aa453001c852f19ca2e | 7,054 | py | Python | src/werdich_cfr/tfutils/video2tfr.py | awerdich/werdich-cfr | 39d9a7f05d0a92304a6dd60df0124068735222ad | [
"MIT"
] | null | null | null | src/werdich_cfr/tfutils/video2tfr.py | awerdich/werdich-cfr | 39d9a7f05d0a92304a6dd60df0124068735222ad | [
"MIT"
] | null | null | null | src/werdich_cfr/tfutils/video2tfr.py | awerdich/werdich-cfr | 39d9a7f05d0a92304a6dd60df0124068735222ad | [
"MIT"
] | null | null | null | import os
import numpy as np
import pickle
import lz4.frame
import cv2
import pandas as pd
pd.set_option('display.max_rows', 50)
pd.set_option('display.max_columns', 100)
pd.set_option('display.width', 1000)
# Custom import
from werdich_cfr.tfutils.TFRprovider import Dset
from werdich_cfr.utils.processing import Vide... | 41.739645 | 109 | 0.594982 | import os
import numpy as np
import pickle
import lz4.frame
import cv2
import pandas as pd
pd.set_option('display.max_rows', 50)
pd.set_option('display.max_columns', 100)
pd.set_option('display.width', 1000)
# Custom import
from werdich_cfr.tfutils.TFRprovider import Dset
from werdich_cfr.utils.processing import Vide... | 0 | 0 | 0 |
103e29035888791c32213588253013d3f3e7cc25 | 3,694 | py | Python | puzzle12.py | flothesof/advent_of_code2019 | cd46964e5b74129ef6a26d3aa692f8b1c128999e | [
"MIT"
] | 1 | 2020-12-02T00:13:19.000Z | 2020-12-02T00:13:19.000Z | puzzle12.py | flothesof/advent_of_code2019 | cd46964e5b74129ef6a26d3aa692f8b1c128999e | [
"MIT"
] | null | null | null | puzzle12.py | flothesof/advent_of_code2019 | cd46964e5b74129ef6a26d3aa692f8b1c128999e | [
"MIT"
] | null | null | null | import numpy as np
inp1 = """<x=-1, y=0, z=2>
<x=2, y=-10, z=-7>
<x=4, y=-8, z=8>
<x=3, y=5, z=-1>"""
# moons 'Io', 'Europa', 'Ganymede', 'Callisto'
# unit test part1
moons = parse_input(inp1)
assert np.allclose(moons['Io'], np.array([-1, 0, 2]))
velocities = {key: np.array([0, 0, 0]) for key in moons}
if False... | 31.844828 | 105 | 0.618571 | import numpy as np
inp1 = """<x=-1, y=0, z=2>
<x=2, y=-10, z=-7>
<x=4, y=-8, z=8>
<x=3, y=5, z=-1>"""
def parse_input(inp1):
lines = inp1.split('\n')
moons = []
for line in lines:
coords = line.split(',')
moon = []
for coord in coords:
coord = coord.replace(' ', '').re... | 1,410 | 0 | 114 |
a832db94ea230bb679367d88ac647b99ae7011a6 | 1,265 | py | Python | practica_con2grafos_en_1.py | SalimChikh/edem-clase-git | c034af54882215c111d5c5105744a4ff08f9dd9f | [
"Apache-2.0"
] | null | null | null | practica_con2grafos_en_1.py | SalimChikh/edem-clase-git | c034af54882215c111d5c5105744a4ff08f9dd9f | [
"Apache-2.0"
] | null | null | null | practica_con2grafos_en_1.py | SalimChikh/edem-clase-git | c034af54882215c111d5c5105744a4ff08f9dd9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 21 12:56:48 2019
@author: salim
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
os.chdir('/Users/salim/Desktop/EDEM/Python/Code')
a11 = pd.read_csv ('rentals_weather_2011.csv', sep=',', decimal='.')
a12 = pd.... | 26.914894 | 82 | 0.69249 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 21 12:56:48 2019
@author: salim
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
os.chdir('/Users/salim/Desktop/EDEM/Python/Code')
a11 = pd.read_csv ('rentals_weather_2011.csv', sep=',', decimal='.')
a12 = pd.... | 0 | 0 | 0 |
0cd8439ebf1e80d0ed7dd26670816c64205696f9 | 764 | py | Python | aoc2021/10/d10_2.py | kewbish/ka-algorithms | 7a893fdaebd99530eaf0d9633c2721763707e92f | [
"MIT"
] | null | null | null | aoc2021/10/d10_2.py | kewbish/ka-algorithms | 7a893fdaebd99530eaf0d9633c2721763707e92f | [
"MIT"
] | null | null | null | aoc2021/10/d10_2.py | kewbish/ka-algorithms | 7a893fdaebd99530eaf0d9633c2721763707e92f | [
"MIT"
] | null | null | null | with open("input.txt") as x:
lines = x.read().splitlines()
pairs = {"(": ")", "{": "}", "<": ">", "[": "]"}
points = {")": 1, "]": 2, "}": 3, ">": 4}
context = []
p_array = []
p = 0
corrupted = False
for l in lines:
context = []
corrupted = False
p = 0
for char in l:
if char in pairs.keys... | 23.151515 | 48 | 0.448953 | with open("input.txt") as x:
lines = x.read().splitlines()
pairs = {"(": ")", "{": "}", "<": ">", "[": "]"}
points = {")": 1, "]": 2, "}": 3, ">": 4}
context = []
p_array = []
p = 0
corrupted = False
for l in lines:
context = []
corrupted = False
p = 0
for char in l:
if char in pairs.keys... | 0 | 0 | 0 |
90405a53d0207fde45760e2f8d9efdf3fa98f749 | 273 | py | Python | build/prebuilt/dir_exists.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 210 | 2019-02-05T12:45:09.000Z | 2022-03-28T07:59:06.000Z | build/prebuilt/dir_exists.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 56 | 2021-06-03T03:16:25.000Z | 2022-03-20T01:07:44.000Z | build/prebuilt/dir_exists.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 73 | 2019-03-06T18:55:23.000Z | 2022-03-26T12:04:51.000Z | #!/usr/bin/env python3.8
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
if __name__ == '__main__':
print(os.path.isdir(sys.argv[1]))
| 22.75 | 72 | 0.732601 | #!/usr/bin/env python3.8
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
if __name__ == '__main__':
print(os.path.isdir(sys.argv[1]))
| 0 | 0 | 0 |
a778c0babba2bcdd3b02b5ac984d94fb9743acb4 | 2,587 | py | Python | src/collect_issues.py | Linary/github-tools | 101be4e7038013a04c81f5088c055dd7948585ca | [
"Apache-2.0"
] | null | null | null | src/collect_issues.py | Linary/github-tools | 101be4e7038013a04c81f5088c055dd7948585ca | [
"Apache-2.0"
] | 1 | 2019-12-31T07:17:10.000Z | 2019-12-31T07:17:10.000Z | src/collect_issues.py | Linary/github-tools | 101be4e7038013a04c81f5088c055dd7948585ca | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
import sys
from github import Github
reload(sys)
sys.setdefaultencoding('utf-8')
# var legendData = ['linary', 'zhangyi', 'javame'];
# var seriesData = [{name: 'linary', value: 2}, {name: 'zhangyi', value: 3},{name: 'javame', value: 4}];
# var selected = {'linary': true, 'zhangyi': true... | 29.397727 | 163 | 0.593738 | # -*- coding:utf-8 -*-
import sys
from github import Github
reload(sys)
sys.setdefaultencoding('utf-8')
def replace_last_char(result, signal):
rs_list = list(result)
last = len(rs_list) - 1
rs_list[last] = signal
return ''.join(rs_list)
# var legendData = ['linary', 'zhangyi', 'javame'];
def writ... | 643 | 0 | 89 |
1b070e7974d29a6a2b95f4797619a12e18918f8e | 107 | py | Python | se-idr/se_openeducat_se_idr/models/__init__.py | aaparicio87/Odoo13 | d9581d356af7886708bb7a81c066f6a616368d16 | [
"MIT"
] | null | null | null | se-idr/se_openeducat_se_idr/models/__init__.py | aaparicio87/Odoo13 | d9581d356af7886708bb7a81c066f6a616368d16 | [
"MIT"
] | null | null | null | se-idr/se_openeducat_se_idr/models/__init__.py | aaparicio87/Odoo13 | d9581d356af7886708bb7a81c066f6a616368d16 | [
"MIT"
] | 1 | 2021-09-11T15:06:49.000Z | 2021-09-11T15:06:49.000Z | # -*- coding: utf-8 -*-
from . import op_student
from . import op_admission
from . import account_invoice | 21.4 | 30 | 0.719626 | # -*- coding: utf-8 -*-
from . import op_student
from . import op_admission
from . import account_invoice | 0 | 0 | 0 |
706944535bbaa1a365f720301b4f51b60b0a610b | 13,073 | py | Python | multiagent_envs/multiagent/scenarios/simple_tag.py | sarahpratt/introspective | 8b0ed53666077b8360a40ab6d17cdc70e6e82724 | [
"MIT"
] | null | null | null | multiagent_envs/multiagent/scenarios/simple_tag.py | sarahpratt/introspective | 8b0ed53666077b8360a40ab6d17cdc70e6e82724 | [
"MIT"
] | null | null | null | multiagent_envs/multiagent/scenarios/simple_tag.py | sarahpratt/introspective | 8b0ed53666077b8360a40ab6d17cdc70e6e82724 | [
"MIT"
] | null | null | null | import numpy as np
from multiagent_envs.multiagent.core import World, Agent, Landmark, Hole, Snack, Obstacle
from multiagent_envs.multiagent.scenario import BaseScenario
import pdb
from vars import pargs
import math
#from train import past
import random
from a2c_ppo_acktr.arguments import get_args
| 31.200477 | 160 | 0.660292 | import numpy as np
from multiagent_envs.multiagent.core import World, Agent, Landmark, Hole, Snack, Obstacle
from multiagent_envs.multiagent.scenario import BaseScenario
import pdb
from vars import pargs
import math
#from train import past
import random
from a2c_ppo_acktr.arguments import get_args
class Scenario(Base... | 11,497 | 1,253 | 23 |