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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7ebd7693e140d649a7aa40bd78592d393e9e6f67 | 618 | py | Python | tests/app/routes/test_routes.py | kentsanggds/api | 651cdf7d496690722d6a4f5b51f04f4be97899d4 | [
"MIT"
] | 1 | 2018-10-12T15:04:31.000Z | 2018-10-12T15:04:31.000Z | tests/app/routes/test_routes.py | kentsanggds/api | 651cdf7d496690722d6a4f5b51f04f4be97899d4 | [
"MIT"
] | 169 | 2017-11-07T00:45:25.000Z | 2022-03-12T00:08:59.000Z | tests/app/routes/test_routes.py | kentsanggds/api | 651cdf7d496690722d6a4f5b51f04f4be97899d4 | [
"MIT"
] | 1 | 2019-08-15T14:51:31.000Z | 2019-08-15T14:51:31.000Z | import pytest
from app.routes import is_running_locally
@pytest.mark.parametrize('url,expected_res', [
('http://localhost:5000/test', True),
('http://127.0.0.1:5000/test', True),
('http://live.website/test', False),
])
| 26.869565 | 84 | 0.650485 | import pytest
from app.routes import is_running_locally
@pytest.mark.parametrize('url,expected_res', [
('http://localhost:5000/test', True),
('http://127.0.0.1:5000/test', True),
('http://live.website/test', False),
])
class WhenCheckingRequest:
def it_returns_true_if_running_locally(self, client, mo... | 331 | 5 | 48 |
3677aecafa8af2453264a152c0aa94e0c15da665 | 186 | py | Python | main.py | ZzAZz4/recon_app | 00a430e8cf3657b923286fe13d39f0706290608c | [
"MIT"
] | null | null | null | main.py | ZzAZz4/recon_app | 00a430e8cf3657b923286fe13d39f0706290608c | [
"MIT"
] | null | null | null | main.py | ZzAZz4/recon_app | 00a430e8cf3657b923286fe13d39f0706290608c | [
"MIT"
] | 1 | 2020-12-16T03:55:02.000Z | 2020-12-16T03:55:02.000Z | from kivy.app import App
from kivy.uix.button import Button
from kivy import utils
if __name__ == "__main__":
MainApp().run()
| 16.909091 | 34 | 0.682796 | from kivy.app import App
from kivy.uix.button import Button
from kivy import utils
class MainApp(App):
def build(self):
pass
if __name__ == "__main__":
MainApp().run()
| 8 | -2 | 49 |
b27777f3d4622fee2e631a02cb9de8c559c5e33d | 227 | py | Python | tuiuiu/contrib/sitemaps/apps.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 3 | 2019-08-08T09:09:35.000Z | 2020-12-15T18:04:17.000Z | tuiuiu/contrib/sitemaps/apps.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | null | null | null | tuiuiu/contrib/sitemaps/apps.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 1 | 2017-09-09T20:10:40.000Z | 2017-09-09T20:10:40.000Z | from __future__ import absolute_import, unicode_literals
from django.apps import AppConfig
| 22.7 | 56 | 0.770925 | from __future__ import absolute_import, unicode_literals
from django.apps import AppConfig
class SitemapsAppConfig(AppConfig):
name = 'tuiuiu.contrib.sitemaps'
label = 'sitemaps'
verbose_name = "Tuiuiu sitemaps"
| 0 | 111 | 23 |
bc592c05e03dbc7d1f1393e32a6fe943823163b8 | 2,241 | py | Python | nbr/kernel.py | zhivykh/nbrunner | b5b77aec3b9c71d594ca116f2b5eefeb08dd0475 | [
"MIT"
] | null | null | null | nbr/kernel.py | zhivykh/nbrunner | b5b77aec3b9c71d594ca116f2b5eefeb08dd0475 | [
"MIT"
] | null | null | null | nbr/kernel.py | zhivykh/nbrunner | b5b77aec3b9c71d594ca116f2b5eefeb08dd0475 | [
"MIT"
] | null | null | null | import asyncio
import json
from typing import List
from websockets.legacy.client import WebSocketClientProtocol
from nbr.schemas.message import Content
from nbr.schemas.result import ExecutionStatus, RunResult
from nbr.schemas.session import Session
from nbr.utils.message import create_message
from nbr.utils.websocke... | 29.103896 | 77 | 0.613565 | import asyncio
import json
from typing import List
from websockets.legacy.client import WebSocketClientProtocol
from nbr.schemas.message import Content
from nbr.schemas.result import ExecutionStatus, RunResult
from nbr.schemas.session import Session
from nbr.utils.message import create_message
from nbr.utils.websocke... | 1,098 | 772 | 23 |
a9c0784c20aa7324f070f9a0f1a0cc3f287c3b63 | 10,391 | py | Python | scripts/Agents.py | Youngl41/A3C | e82a93eca37ded7814be58ee253abd7d08e27355 | [
"Apache-2.0"
] | null | null | null | scripts/Agents.py | Youngl41/A3C | e82a93eca37ded7814be58ee253abd7d08e27355 | [
"Apache-2.0"
] | null | null | null | scripts/Agents.py | Youngl41/A3C | e82a93eca37ded7814be58ee253abd7d08e27355 | [
"Apache-2.0"
] | null | null | null | # env.unwrapped.get_action_meanings()
#======================================================
# Agent classes
#======================================================
'''
Info:
Version: 1.0
Author: Young Lee
Created: Friday, 16 August 2019
'''
# Import modules
import os
import re
import sys
try:
ge... | 47.884793 | 295 | 0.590992 | # env.unwrapped.get_action_meanings()
#======================================================
# Agent classes
#======================================================
'''
Info:
Version: 1.0
Author: Young Lee
Created: Friday, 16 August 2019
'''
# Import modules
import os
import re
import sys
try:
ge... | 6,632 | -6 | 308 |
319df75b5ec5c80ff285a5dd8607c14cab95ac51 | 351 | py | Python | examples/fastapi_integration/src/fastapi_integration/congratulations/role_checking.py | maximsakhno/galo-ioc | d300cc0e63e6ad375b7d2e75ac2b2e2fda30da4f | [
"MIT"
] | 9 | 2022-01-16T11:45:00.000Z | 2022-03-23T07:42:24.000Z | examples/fastapi_integration/src/fastapi_integration/congratulations/role_checking.py | maximsakhno/galo-ioc | d300cc0e63e6ad375b7d2e75ac2b2e2fda30da4f | [
"MIT"
] | 2 | 2022-01-16T12:03:14.000Z | 2022-01-16T12:11:27.000Z | examples/fastapi_integration/src/fastapi_integration/congratulations/role_checking.py | maximsakhno/galo-ioc | d300cc0e63e6ad375b7d2e75ac2b2e2fda30da4f | [
"MIT"
] | null | null | null | from fastapi_integration.current_user_resolvers.role_checkers import RoleCheckerFactory
from galo_ioc import get_factory
__all__ = [
"load",
]
| 27 | 87 | 0.777778 | from fastapi_integration.current_user_resolvers.role_checkers import RoleCheckerFactory
from galo_ioc import get_factory
__all__ = [
"load",
]
def load() -> None:
role_checker_factory = get_factory(RoleCheckerFactory)
role_checker = role_checker_factory()
role_checker.register_roles_for_route("POST",... | 179 | 0 | 23 |
12c32d59d3ae193352b3e3043ee04147f412d795 | 2,783 | py | Python | src/build/android/pylib/instrumentation/test_package.py | bopopescu/MQUIC | 703e944ec981366cfd2528943b1def2c72b7e49d | [
"MIT"
] | 1 | 2018-01-02T15:42:08.000Z | 2018-01-02T15:42:08.000Z | src/build/android/pylib/instrumentation/test_package.py | bopopescu/MQUIC | 703e944ec981366cfd2528943b1def2c72b7e49d | [
"MIT"
] | null | null | null | src/build/android/pylib/instrumentation/test_package.py | bopopescu/MQUIC | 703e944ec981366cfd2528943b1def2c72b7e49d | [
"MIT"
] | 1 | 2020-07-25T02:05:49.000Z | 2020-07-25T02:05:49.000Z | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Class representing instrumentation test apk and jar."""
import os
from devil.android import apk_helper
from pylib.instrumentation import test_jar
fr... | 35.679487 | 80 | 0.740927 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Class representing instrumentation test apk and jar."""
import os
from devil.android import apk_helper
from pylib.instrumentation import test_jar
fr... | 1,667 | 721 | 23 |
7310a4fa6daa6cfe1b119f1478c9d97c6d3e9123 | 1,303 | py | Python | cliboa/test/util/test_cache.py | chiru1221/cliboa | 0aad84f237b7c0d8a5ae0cbd27b9d70f97acbee1 | [
"MIT"
] | null | null | null | cliboa/test/util/test_cache.py | chiru1221/cliboa | 0aad84f237b7c0d8a5ae0cbd27b9d70f97acbee1 | [
"MIT"
] | null | null | null | cliboa/test/util/test_cache.py | chiru1221/cliboa | 0aad84f237b7c0d8a5ae0cbd27b9d70f97acbee1 | [
"MIT"
] | 1 | 2020-12-20T10:59:16.000Z | 2020-12-20T10:59:16.000Z | #
# Copyright 2019 BrainPad Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 37.228571 | 86 | 0.72218 | #
# Copyright 2019 BrainPad Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 505 | 7 | 103 |
821cdfc7341c60ceb2082af14f96e549c30418c0 | 156 | py | Python | web_frameworks/resources/forms.py | Minkov/python-web-frameworks-2020-11 | 5857bb626792a9efe1f2d06677fa3779f5e2cc1d | [
"MIT"
] | 4 | 2020-11-21T20:06:39.000Z | 2020-12-15T13:30:23.000Z | web_frameworks/resources/forms.py | Minkov/python-web-frameworks-2020-11 | 5857bb626792a9efe1f2d06677fa3779f5e2cc1d | [
"MIT"
] | null | null | null | web_frameworks/resources/forms.py | Minkov/python-web-frameworks-2020-11 | 5857bb626792a9efe1f2d06677fa3779f5e2cc1d | [
"MIT"
] | null | null | null | from django import forms
from resources.models import Pet
| 15.6 | 32 | 0.673077 | from django import forms
from resources.models import Pet
class PetForm(forms.ModelForm):
class Meta:
model = Pet
fields = '__all__'
| 0 | 73 | 23 |
2033b6dddfb77b16a6c23592bad60a247462cec3 | 7,719 | py | Python | src/analysis_diagrams.py | seedatnabeel/Data-Imputation-Uncertainty | ffde47089546702b42045a92f9796bc1b5b7a662 | [
"Apache-2.0"
] | null | null | null | src/analysis_diagrams.py | seedatnabeel/Data-Imputation-Uncertainty | ffde47089546702b42045a92f9796bc1b5b7a662 | [
"Apache-2.0"
] | null | null | null | src/analysis_diagrams.py | seedatnabeel/Data-Imputation-Uncertainty | ffde47089546702b42045a92f9796bc1b5b7a662 | [
"Apache-2.0"
] | null | null | null | from utils import normdata, myrmse
from sklearn.metrics import (
accuracy_score,
roc_curve,
auc,
roc_auc_score,
mean_squared_error,
)
import numpy as np
import random
import matplotlib.pyplot as plt
def performance_vs_confidence(
original_data,
imp_data,
missing_data,
testY,
te... | 29.018797 | 104 | 0.62832 | from utils import normdata, myrmse
from sklearn.metrics import (
accuracy_score,
roc_curve,
auc,
roc_auc_score,
mean_squared_error,
)
import numpy as np
import random
import matplotlib.pyplot as plt
def performance_vs_confidence(
original_data,
imp_data,
missing_data,
testY,
te... | 0 | 0 | 0 |
f10fc2985e9f4384694ff72b97ae00b09b69bb67 | 971 | py | Python | app/tests/configs/conftest_result_extractor.py | GeorgianBadita/remote-code-execution-engine | 4ac3ca7567cd89cc1f979622add81efa9edfea8f | [
"MIT"
] | null | null | null | app/tests/configs/conftest_result_extractor.py | GeorgianBadita/remote-code-execution-engine | 4ac3ca7567cd89cc1f979622add81efa9edfea8f | [
"MIT"
] | null | null | null | app/tests/configs/conftest_result_extractor.py | GeorgianBadita/remote-code-execution-engine | 4ac3ca7567cd89cc1f979622add81efa9edfea8f | [
"MIT"
] | null | null | null | import pytest
@pytest.fixture
def passed_submission_py() -> str:
"""
Function which returns a passed execution output in python
"""
return """
..
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
"""
@pytest.fixture
@pytest.fixture
| 24.275 | 110 | 0.500515 | import pytest
@pytest.fixture
def passed_submission_py() -> str:
"""
Function which returns a passed execution output in python
"""
return """
..
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
"""
@pytest.fixture
def not_passed_submission_py() -... | 621 | 0 | 44 |
7be1a277da21b142d3eccde4f5166dabe54f8d13 | 9,710 | py | Python | bblogger/deserialize.py | lohmega/jamble | ca7d2788c584cfb1c86ae766d06f6a9d57a60974 | [
"Apache-2.0"
] | null | null | null | bblogger/deserialize.py | lohmega/jamble | ca7d2788c584cfb1c86ae766d06f6a9d57a60974 | [
"Apache-2.0"
] | 3 | 2020-05-27T13:00:45.000Z | 2020-09-29T12:42:23.000Z | bblogger/deserialize.py | lohmega/jamble | ca7d2788c584cfb1c86ae766d06f6a9d57a60974 | [
"Apache-2.0"
] | null | null | null | import logging
import csv
import json
from platform import system
from sys import stderr, stdout
# not needed in python >= 3.6? as default dict keeps order
from collections import OrderedDict, deque
try:
from google.protobuf.json_format import MessageToDict
except ImportError:
# not in debian stretch dpkg/ap... | 29.603659 | 89 | 0.564367 | import logging
import csv
import json
from platform import system
from sys import stderr, stdout
# not needed in python >= 3.6? as default dict keeps order
from collections import OrderedDict, deque
try:
from google.protobuf.json_format import MessageToDict
except ImportError:
# not in debian stretch dpkg/ap... | 3,744 | 0 | 269 |
10038b738f6469b9b9ad1c6a2c49ca0cecf4a83d | 497 | py | Python | encore/managers.py | filonik/encore | e6e95ad114a1c094f9c1134cd1d22f1994f065f7 | [
"MIT"
] | null | null | null | encore/managers.py | filonik/encore | e6e95ad114a1c094f9c1134cd1d22f1994f065f7 | [
"MIT"
] | null | null | null | encore/managers.py | filonik/encore | e6e95ad114a1c094f9c1134cd1d22f1994f065f7 | [
"MIT"
] | null | null | null | import contextlib as cl
from . import accessors
@cl.contextmanager
@cl.contextmanager
| 20.708333 | 52 | 0.67002 | import contextlib as cl
from . import accessors
@cl.contextmanager
def attrset(obj, name, value=accessors.Delete):
value = accessors.swapattr(obj, name, value)
try:
yield
finally:
value = accessors.swapattr(obj, name, value)
return value
@cl.contextmanager
def itemset(obj, name, val... | 362 | 0 | 44 |
c448d924e39cdd3b511d47b105bb773ffd02d4fe | 121 | py | Python | error_handlers/__init__.py | NikitolProject/idm_lp | a1eeb1c12e1918a715beb63c3bee97b7e1404801 | [
"MIT"
] | 2 | 2020-11-04T15:16:08.000Z | 2020-11-04T15:55:29.000Z | error_handlers/__init__.py | Dlol0ne/idm_lp | 3a5563024a3062d74b8c47259c4241554f073b39 | [
"MIT"
] | null | null | null | error_handlers/__init__.py | Dlol0ne/idm_lp | 3a5563024a3062d74b8c47259c4241554f073b39 | [
"MIT"
] | 1 | 2021-03-04T03:00:06.000Z | 2021-03-04T03:00:06.000Z | from error_handlers import captha
from error_handlers import rps
error_handlers_bp = (
rps.user,
captha.user,
)
| 15.125 | 33 | 0.752066 | from error_handlers import captha
from error_handlers import rps
error_handlers_bp = (
rps.user,
captha.user,
)
| 0 | 0 | 0 |
4a43febd8c2f697fbbc2dd319b189c165f503979 | 5,422 | py | Python | SimTools/test_RNA_describe.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | 1 | 2021-08-16T14:49:04.000Z | 2021-08-16T14:49:04.000Z | SimTools/test_RNA_describe.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | null | null | null | SimTools/test_RNA_describe.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | null | null | null | import pytest
from RNA_describe import RNA_describer
from RNA_describe import ORF_counter
from RNA_describe import ORF_RE
# The following unix command will run all tests.
# $ pytest
# The -v option will list each test and show progress.
# $ pytest -v
# By default, pytest captures stdout unless the tests fail.
# Use th... | 42.359375 | 83 | 0.610107 | import pytest
from RNA_describe import RNA_describer
from RNA_describe import ORF_counter
from RNA_describe import ORF_RE
# The following unix command will run all tests.
# $ pytest
# The -v option will list each test and show progress.
# $ pytest -v
# By default, pytest captures stdout unless the tests fail.
# Use th... | 4,606 | 9 | 407 |
bf2f1d9446ec60f471d359d9fe43b44c01929162 | 56 | py | Python | src/components/__init__.py | jgarciaf106/dash-boilerplate | 746c7601411af722c8517888c11bb77c7a24064b | [
"MIT"
] | null | null | null | src/components/__init__.py | jgarciaf106/dash-boilerplate | 746c7601411af722c8517888c11bb77c7a24064b | [
"MIT"
] | null | null | null | src/components/__init__.py | jgarciaf106/dash-boilerplate | 746c7601411af722c8517888c11bb77c7a24064b | [
"MIT"
] | null | null | null | from .navbar import nav_bar
from .visuals import gdp_viz | 28 | 28 | 0.839286 | from .navbar import nav_bar
from .visuals import gdp_viz | 0 | 0 | 0 |
980eb881b9183a85e8a0d89ebe3875d7adc604ce | 4,544 | py | Python | scripts/gen_negative_agreements.py | aistairc/lm_syntax_negative | 19889a84d6ce32531fe82dfeea7a48df233d7f50 | [
"MIT"
] | 3 | 2020-05-07T06:58:53.000Z | 2021-02-19T13:37:57.000Z | scripts/gen_negative_agreements.py | aistairc/lm_syntax_negative | 19889a84d6ce32531fe82dfeea7a48df233d7f50 | [
"MIT"
] | null | null | null | scripts/gen_negative_agreements.py | aistairc/lm_syntax_negative | 19889a84d6ce32531fe82dfeea7a48df233d7f50 | [
"MIT"
] | null | null | null |
import argparse
import corenlp
import gzip
import inflect
from tqdm import tqdm
if __name__ == '__main__':
parser = argparse.ArgumentParser('Generate negative examples for LM agreement task.')
parser.add_argument('--source', required=True, type=str)
parser.add_argument('--output', default='verb_negative_... | 37.553719 | 97 | 0.559419 |
import argparse
import corenlp
import gzip
import inflect
from tqdm import tqdm
def open_f(fn, mode='rt'):
if fn.endswith('.gz'):
return gzip.open(fn, mode)
else:
return open(fn, mode)
class VerbFinder(object):
def __init__(self):
# each position is a pair (idx, si... | 3,983 | 4 | 176 |
50236fdf6467d13205dc115c04971b4092f2ea4f | 5,125 | py | Python | snake.py | 0Franky/snAIke | ddabb04c68e81d21b6ad23454ea2b8d67357aefb | [
"MIT"
] | null | null | null | snake.py | 0Franky/snAIke | ddabb04c68e81d21b6ad23454ea2b8d67357aefb | [
"MIT"
] | 1 | 2020-05-16T14:33:39.000Z | 2020-05-16T14:33:39.000Z | snake.py | 0Franky/ai-battleship | ddabb04c68e81d21b6ad23454ea2b8d67357aefb | [
"MIT"
] | 1 | 2020-11-08T17:08:10.000Z | 2020-11-08T17:08:10.000Z | # Valentin Macé
# valentin.mace@kedgebs.com
# Developed for fun
# Feel free to use this code as you wish as long as you quote me as author
"""
snake.py
~~~~~~~~~~
This module is for building the snake itself in the snake game
The snake:
- Is on the form of a list, each element for a body block (containing its coordi... | 37.962963 | 116 | 0.58478 | # Valentin Macé
# valentin.mace@kedgebs.com
# Developed for fun
# Feel free to use this code as you wish as long as you quote me as author
"""
snake.py
~~~~~~~~~~
This module is for building the snake itself in the snake game
The snake:
- Is on the form of a list, each element for a body block (containing its coordi... | 0 | 0 | 0 |
80cdfea7dc48867c436f0e3fb26d31ebb7279008 | 4,414 | py | Python | tests.py | gwpicard/flask-kanban | 49a13635d14723639bde896d802e8f67b1c3147e | [
"MIT"
] | 9 | 2019-02-01T01:17:28.000Z | 2022-02-01T14:50:58.000Z | tests.py | gwpicard/flask-kanban | 49a13635d14723639bde896d802e8f67b1c3147e | [
"MIT"
] | null | null | null | tests.py | gwpicard/flask-kanban | 49a13635d14723639bde896d802e8f67b1c3147e | [
"MIT"
] | 1 | 2022-02-21T11:20:49.000Z | 2022-02-21T11:20:49.000Z | # project/test_basic.py
import os
import unittest
from app.app import Kanban_app
from app.models import db, User, Card
TEST_DB = 'test.db'
# execute before each test
# execute after each test
# methods to help pass data to views
# tests to run
# check home view works
# test user can reg... | 34.217054 | 104 | 0.646353 | # project/test_basic.py
import os
import unittest
from app.app import Kanban_app
from app.models import db, User, Card
TEST_DB = 'test.db'
class BasicTests(unittest.TestCase):
# execute before each test
def setUp(self):
Kanban_app.config['TESTING'] = True # set test mode
Kanban_app.config['... | 3,386 | 15 | 389 |
914dc2978f7ce70ef0733bfca7b7d211db0b3238 | 1,823 | py | Python | src/pwned_passwords_django/api.py | jdufresne/pwned-passwords-django | 664df66b54f662a26d98f34f1713281a15d0eb0b | [
"BSD-3-Clause"
] | 102 | 2018-03-06T11:46:40.000Z | 2022-03-23T17:25:19.000Z | src/pwned_passwords_django/api.py | jdufresne/pwned-passwords-django | 664df66b54f662a26d98f34f1713281a15d0eb0b | [
"BSD-3-Clause"
] | 24 | 2018-03-08T08:19:54.000Z | 2020-11-05T11:09:03.000Z | src/pwned_passwords_django/api.py | jdufresne/pwned-passwords-django | 664df66b54f662a26d98f34f1713281a15d0eb0b | [
"BSD-3-Clause"
] | 6 | 2018-03-07T22:19:48.000Z | 2020-05-05T00:43:52.000Z | """
Direct access to the Pwned Passwords API for checking whether a
password is compromised.
"""
import hashlib
import logging
import sys
import requests
from django.conf import settings
from . import __version__
log = logging.getLogger(__name__)
API_ENDPOINT = "https://api.pwnedpasswords.com/range/{}"
REQUEST_TI... | 28.046154 | 86 | 0.675261 | """
Direct access to the Pwned Passwords API for checking whether a
password is compromised.
"""
import hashlib
import logging
import sys
import requests
from django.conf import settings
from . import __version__
log = logging.getLogger(__name__)
API_ENDPOINT = "https://api.pwnedpasswords.com/range/{}"
REQUEST_TI... | 0 | 0 | 0 |
906c9cd8624d841bd93c4dfadff12bec3fb9bb94 | 3,004 | py | Python | tests/python/test_dataset_methods.py | billschereriii/SmartRedis | 63147106d90df11765b5dd93f03df64a26937da6 | [
"BSD-2-Clause"
] | null | null | null | tests/python/test_dataset_methods.py | billschereriii/SmartRedis | 63147106d90df11765b5dd93f03df64a26937da6 | [
"BSD-2-Clause"
] | null | null | null | tests/python/test_dataset_methods.py | billschereriii/SmartRedis | 63147106d90df11765b5dd93f03df64a26937da6 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from smartredis import Dataset
def test_add_get_tensor(mock_data):
"""Test adding and retrieving 1D tensors to
a dataset and with all datatypes
"""
dataset = Dataset("test-dataset")
# 1D tensors of all data types
data = mock_data.create_data(10)
add_get_arrays(dataset,... | 26.121739 | 91 | 0.649134 | import numpy as np
from smartredis import Dataset
def test_add_get_tensor(mock_data):
"""Test adding and retrieving 1D tensors to
a dataset and with all datatypes
"""
dataset = Dataset("test-dataset")
# 1D tensors of all data types
data = mock_data.create_data(10)
add_get_arrays(dataset,... | 0 | 0 | 0 |
4e33af41f91bf3279f87a9264303d28578362862 | 386 | py | Python | backend/items/apiviews.py | jahidulrudro/Invoice-Maker-Django-VueJs | bc1f1ee086e666f1f7e88c9f15083d26d8af156a | [
"MIT"
] | 1 | 2019-05-24T21:40:37.000Z | 2019-05-24T21:40:37.000Z | backend/items/apiviews.py | jahidulrudro/Invoice-Maker-Django-VueJs | bc1f1ee086e666f1f7e88c9f15083d26d8af156a | [
"MIT"
] | 15 | 2019-10-21T19:11:26.000Z | 2022-02-17T23:12:21.000Z | backend/items/apiviews.py | jahidulrudro/Invoice-Maker-Django-VueJs | bc1f1ee086e666f1f7e88c9f15083d26d8af156a | [
"MIT"
] | null | null | null | from rest_framework import generics
from .models import Item
from .serializers import ItemSerializer
| 25.733333 | 78 | 0.816062 | from rest_framework import generics
from .models import Item
from .serializers import ItemSerializer
class ItemListCreateApiView(generics.ListCreateAPIView):
queryset = Item.objects.all()
serializer_class = ItemSerializer
class ItemRetrieveUpdateDestroyApiView(generics.RetrieveUpdateDestroyAPIView):
qu... | 0 | 236 | 46 |
137463cfc39f1173fd92189be66736d31bb70731 | 341 | py | Python | ants/cyants/ex-setup.py | bwhewe-13/ants | 6923cfc1603e0cd90c2ae90fa0fed6dd86edc0b2 | [
"MIT"
] | null | null | null | ants/cyants/ex-setup.py | bwhewe-13/ants | 6923cfc1603e0cd90c2ae90fa0fed6dd86edc0b2 | [
"MIT"
] | null | null | null | ants/cyants/ex-setup.py | bwhewe-13/ants | 6923cfc1603e0cd90c2ae90fa0fed6dd86edc0b2 | [
"MIT"
] | null | null | null | from distutils.core import setup, Extension
from Cython.Build import cythonize
# ext = Extension(name="wrap_fib", source=["cfibc.c", "wrap_fib.pyx"])
# ext = ["hermite_splines.pyx", "source_iteration.pyx", "splines.pyx"]
ext = ["multi_group.pyx", "x_sweeps.pyx"] #, "x_sweeps.pxd"]
setup(ext_modules=cythonize(ext, l... | 34.1 | 71 | 0.721408 | from distutils.core import setup, Extension
from Cython.Build import cythonize
# ext = Extension(name="wrap_fib", source=["cfibc.c", "wrap_fib.pyx"])
# ext = ["hermite_splines.pyx", "source_iteration.pyx", "splines.pyx"]
ext = ["multi_group.pyx", "x_sweeps.pyx"] #, "x_sweeps.pxd"]
setup(ext_modules=cythonize(ext, l... | 0 | 0 | 0 |
9c8267f71830eb7f8fa7c49b3f712bc593dfe2dd | 205 | py | Python | bus_plan/wsgi.py | diegopmayer/bussiness_plan | 56f7491a9b1767f60341e003648a7b9a946a877c | [
"MIT"
] | null | null | null | bus_plan/wsgi.py | diegopmayer/bussiness_plan | 56f7491a9b1767f60341e003648a7b9a946a877c | [
"MIT"
] | 2 | 2019-02-27T16:46:53.000Z | 2019-05-07T00:32:10.000Z | bus_plan/wsgi.py | diegopmayer/bussiness_plan | 56f7491a9b1767f60341e003648a7b9a946a877c | [
"MIT"
] | null | null | null |
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bus_plan.settings')
application = Cling(get_wsgi_application())
| 20.5 | 68 | 0.82439 |
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bus_plan.settings')
application = Cling(get_wsgi_application())
| 0 | 0 | 0 |
e851c09d856bac197cdb3242af940148b3e9a3ea | 210 | py | Python | awaitawaitawait.py | bmintz/python-snippets | 982861c173bf4bcd5d908514a9e8b1914a580a5d | [
"CC0-1.0"
] | 2 | 2018-11-12T10:33:13.000Z | 2019-02-24T05:01:40.000Z | awaitawaitawait.py | iomintz/python-snippets | 982861c173bf4bcd5d908514a9e8b1914a580a5d | [
"CC0-1.0"
] | null | null | null | awaitawaitawait.py | iomintz/python-snippets | 982861c173bf4bcd5d908514a9e8b1914a580a5d | [
"CC0-1.0"
] | 2 | 2018-11-24T08:16:59.000Z | 2019-02-24T04:41:30.000Z | #!/usr/bin/env python3
# encoding: utf-8
import asyncio
asyncio.run(main())
| 15 | 49 | 0.633333 | #!/usr/bin/env python3
# encoding: utf-8
import asyncio
async def f(*, n=5):
if n == 1: return True
return f(n=n-1)
async def main():
print(await (await (await (await (await f())))))
asyncio.run(main())
| 86 | 0 | 46 |
58fe7c9a90e9776fd8838d8eb40a468fc3594ba1 | 792 | py | Python | examples/windows/python/example.py | gomiero/bin2src | 5b1e849873631fe2bef76cc77ed18026cd90c2d9 | [
"MIT"
] | 1 | 2022-03-07T08:21:49.000Z | 2022-03-07T08:21:49.000Z | examples/windows/python/example.py | gomiero/bin2src | 5b1e849873631fe2bef76cc77ed18026cd90c2d9 | [
"MIT"
] | null | null | null | examples/windows/python/example.py | gomiero/bin2src | 5b1e849873631fe2bef76cc77ed18026cd90c2d9 | [
"MIT"
] | 1 | 2021-08-02T08:07:16.000Z | 2021-08-02T08:07:16.000Z | #
# Embed a photo data inside a Tk frame
#
import tkinter as tk
import smimgpng as smimg
AUTHOR = "Alexandre Gomiero de Oliveira"
REPO = "https://github.com/gomiero/bin2src"
# Entry point: create the root window...
root = tk.Tk()
# ...the App instance...
app = App(master = root)
# ...and run the main loop.
app.mainlo... | 28.285714 | 82 | 0.651515 | #
# Embed a photo data inside a Tk frame
#
import tkinter as tk
import smimgpng as smimg
AUTHOR = "Alexandre Gomiero de Oliveira"
REPO = "https://github.com/gomiero/bin2src"
class App(tk.Frame):
def __init__(self, master):
super().__init__(master)
self.config(width=427, height=640)
canvas ... | 418 | -1 | 49 |
7f239a35b8bfe0d55adf866be0eed7cdbdd57884 | 156 | py | Python | aim/cli/push/utils.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | aim/cli/push/utils.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | aim/cli/push/utils.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | import struct
| 22.285714 | 68 | 0.647436 | import struct
def send_flags_file(client, path):
client.send_line(path.encode())
client.send(struct.pack('>i', 1) + struct.pack('>i', 0) + b'\n')
| 118 | 0 | 23 |
89eceb97defaf6b94989b220fc011b9d1fc8eae1 | 574 | py | Python | demos/instance_occlsegm/tests/datasets_tests/apc_tests/apc2016_tests/test_jsk_apc2016_dataset.py | pazeshun/jsk_apc | 0ff42000ad5992f8a31e719a5360a39cf4fa1fde | [
"BSD-3-Clause"
] | null | null | null | demos/instance_occlsegm/tests/datasets_tests/apc_tests/apc2016_tests/test_jsk_apc2016_dataset.py | pazeshun/jsk_apc | 0ff42000ad5992f8a31e719a5360a39cf4fa1fde | [
"BSD-3-Clause"
] | 2 | 2019-04-11T05:36:23.000Z | 2019-08-19T12:58:10.000Z | demos/instance_occlsegm/tests/datasets_tests/apc_tests/apc2016_tests/test_jsk_apc2016_dataset.py | pazeshun/jsk_apc | 0ff42000ad5992f8a31e719a5360a39cf4fa1fde | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from instance_occlsegm_lib.datasets.apc.apc2016 import JskAPC2016Dataset
| 23.916667 | 72 | 0.702091 | import numpy as np
from instance_occlsegm_lib.datasets.apc.apc2016 import JskAPC2016Dataset
def test_jsk_apc2016_dataset():
for split in ['train', 'valid']:
_test_jsk(JskAPC2016Dataset(split))
def _test_jsk(dataset):
assert len(dataset) > 0
assert hasattr(dataset, 'split')
assert hasattr(d... | 433 | 0 | 46 |
cd3674dec17b95aad27026a2d25e684aed395eb7 | 1,312 | py | Python | symmetric/management/commands/obfuscatesettings.py | symmetricapi/django-symmetric | 32f291e15bb382cf22790dfda4c6bbb6ff46e9c1 | [
"MIT"
] | 3 | 2017-04-28T18:34:41.000Z | 2017-04-29T21:48:57.000Z | symmetric/management/commands/obfuscatesettings.py | symmetricapi/django-symmetric | 32f291e15bb382cf22790dfda4c6bbb6ff46e9c1 | [
"MIT"
] | 4 | 2017-07-11T05:26:07.000Z | 2021-06-10T18:46:37.000Z | symmetric/management/commands/obfuscatesettings.py | symmetricapi/django-symmetric | 32f291e15bb382cf22790dfda4c6bbb6ff46e9c1 | [
"MIT"
] | 1 | 2017-07-04T12:11:17.000Z | 2017-07-04T12:11:17.000Z | import random
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
| 34.526316 | 136 | 0.53125 | import random
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Obfuscate specified settings, keys, secrets etc. for use in mobile apps.'
option_list = BaseCommand.option_list + (
make_option(
... | 602 | 553 | 23 |
7640a854eb6514e315d4382f00b04b6a3bbf1c3f | 5,852 | py | Python | lib/eval.py | yzhq97/SCKR | 601545db60eac3845e0eeaaae6b0580d4a41d949 | [
"MIT"
] | 7 | 2019-05-02T07:26:46.000Z | 2020-04-06T06:59:25.000Z | lib/eval.py | yzhq97/SCKR | 601545db60eac3845e0eeaaae6b0580d4a41d949 | [
"MIT"
] | 1 | 2019-06-06T18:26:25.000Z | 2020-11-07T08:39:39.000Z | lib/eval.py | yzhq97/SCKR | 601545db60eac3845e0eeaaae6b0580d4a41d949 | [
"MIT"
] | 3 | 2019-09-20T09:14:19.000Z | 2021-02-13T15:17:59.000Z | from lib.mlnet import MLNet
from data.data_loader import DataLoader
from data.utils import split_and_pack
import tensorflow as tf
import numpy as np
import time
def get_descs_and_labels(net: MLNet, sess: tf.Session, modal,
paths_with_labels, process_fn, batch_size):
"""
This function ... | 36.805031 | 140 | 0.645762 | from lib.mlnet import MLNet
from data.data_loader import DataLoader
from data.utils import split_and_pack
import tensorflow as tf
import numpy as np
import time
def get_descs_and_labels(net: MLNet, sess: tf.Session, modal,
paths_with_labels, process_fn, batch_size):
"""
This function ... | 2,327 | 0 | 23 |
c685fdb6b92c9e8375aa383895edecf724d650b5 | 379 | py | Python | tests/exceptions/test_repo_not_found.py | geometry-labs/tackle-box | 83424a10416955ba983f0c14ec89bd79673a4282 | [
"BSD-3-Clause"
] | 1 | 2021-04-13T23:10:11.000Z | 2021-04-13T23:10:11.000Z | tests/exceptions/test_repo_not_found.py | geometry-labs/tackle-box | 83424a10416955ba983f0c14ec89bd79673a4282 | [
"BSD-3-Clause"
] | 4 | 2021-01-27T00:06:12.000Z | 2021-02-12T01:20:32.000Z | tests/exceptions/test_repo_not_found.py | geometry-labs/tackle-box | 83424a10416955ba983f0c14ec89bd79673a4282 | [
"BSD-3-Clause"
] | 1 | 2021-05-07T05:07:29.000Z | 2021-05-07T05:07:29.000Z | """Testing invalid cookiecutter template repositories."""
import pytest
from tackle import exceptions, main
def test_should_raise_error_if_repo_does_not_exist(chdir):
"""Cookiecutter invocation with non-exist repository should raise error."""
chdir('/')
with pytest.raises(exceptions.UnknownSourceExceptio... | 31.583333 | 79 | 0.76781 | """Testing invalid cookiecutter template repositories."""
import pytest
from tackle import exceptions, main
def test_should_raise_error_if_repo_does_not_exist(chdir):
"""Cookiecutter invocation with non-exist repository should raise error."""
chdir('/')
with pytest.raises(exceptions.UnknownSourceExceptio... | 0 | 0 | 0 |
8785153ec48817e3188a7b8b4bf14392a9bd7b80 | 6,260 | py | Python | src/analyze_orig_data.py | MadryLab/dataset-replication-analysis | f06ee16f0bb1c119492c6134788e62457ad9f5bb | [
"MIT"
] | 25 | 2020-05-19T20:06:58.000Z | 2022-01-19T07:41:06.000Z | src/analyze_orig_data.py | MadryLab/dataset-replication-analysis | f06ee16f0bb1c119492c6134788e62457ad9f5bb | [
"MIT"
] | null | null | null | src/analyze_orig_data.py | MadryLab/dataset-replication-analysis | f06ee16f0bb1c119492c6134788e62457ad9f5bb | [
"MIT"
] | 5 | 2020-05-20T06:30:56.000Z | 2021-03-03T00:46:24.000Z | import torch as ch
import pandas as pd
import numpy as np
from pathlib import Path
from pathos.multiprocessing import Pool
from argparse import ArgumentParser
from numpy.random import seed
import matplotlib as mpl
from matplotlib import rc
from matplotlib import pyplot as plt
import seaborn as sns
sns.set()
mpl.style.... | 40.387097 | 117 | 0.620128 | import torch as ch
import pandas as pd
import numpy as np
from pathlib import Path
from pathos.multiprocessing import Pool
from argparse import ArgumentParser
from numpy.random import seed
import matplotlib as mpl
from matplotlib import rc
from matplotlib import pyplot as plt
import seaborn as sns
sns.set()
mpl.style.... | 3,529 | 0 | 249 |
f78ed197c79dd4247a597e1b42e0f17b20112e58 | 1,525 | py | Python | remote-notify/server.py | JOndra91/siliness | a0aa3af1f57ec15e9ebfa952351cb3e6d644e8f7 | [
"Unlicense"
] | null | null | null | remote-notify/server.py | JOndra91/siliness | a0aa3af1f57ec15e9ebfa952351cb3e6d644e8f7 | [
"Unlicense"
] | null | null | null | remote-notify/server.py | JOndra91/siliness | a0aa3af1f57ec15e9ebfa952351cb3e6d644e8f7 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
import argparse
from http import server
import json
import subprocess
if __name__ == '__main__':
main()
| 27.232143 | 63 | 0.566557 | #!/usr/bin/python3
import argparse
from http import server
import json
import subprocess
def main():
argp = argparse.ArgumentParser()
argp.add_argument('--host', default='0.0.0.0')
argp.add_argument('--port', default=6969, type=int)
# argp.add_argument('--password')
args = argp.parse_args()
... | 1,290 | 30 | 73 |
c073e119a8186298ac7dffa8adb5db13b57599fc | 212 | py | Python | rexplore/initialize.py | Seraphyx/reddit_explorer | a0c23e995c893fb40875a9248d9527b9402a1b95 | [
"Apache-2.0"
] | null | null | null | rexplore/initialize.py | Seraphyx/reddit_explorer | a0c23e995c893fb40875a9248d9527b9402a1b95 | [
"Apache-2.0"
] | null | null | null | rexplore/initialize.py | Seraphyx/reddit_explorer | a0c23e995c893fb40875a9248d9527b9402a1b95 | [
"Apache-2.0"
] | null | null | null | import mysql
import configparser
def initialize(config_path):
'''
Import a config .ini file.
It should have the following definition:
'''
config = configparser.ConfigParser()
config.read(config_path)
| 14.133333 | 41 | 0.745283 | import mysql
import configparser
def initialize(config_path):
'''
Import a config .ini file.
It should have the following definition:
'''
config = configparser.ConfigParser()
config.read(config_path)
| 0 | 0 | 0 |
0c8fcd1a6114c33b2a99b9de62a42b63033f28bd | 1,406 | py | Python | tests/test_parsers.py | ggoldman1/project1 | 28a9b36a0873ee1ecb391b818611dfe119a87048 | [
"MIT"
] | null | null | null | tests/test_parsers.py | ggoldman1/project1 | 28a9b36a0873ee1ecb391b818611dfe119a87048 | [
"MIT"
] | null | null | null | tests/test_parsers.py | ggoldman1/project1 | 28a9b36a0873ee1ecb391b818611dfe119a87048 | [
"MIT"
] | null | null | null | # write tests for parsers
from seqparser import (
FastaParser,
FastqParser)
def test_freebie_parser_1():
"""
This one is a freebie
DO NOT MODIFY THIS FUNCTION
"""
assert True
def test_freebie_parser_2():
"""
This too is a freebie
DO NOT MODIFY THIS FUNCTION
"""
... | 26.037037 | 107 | 0.652916 | # write tests for parsers
from seqparser import (
FastaParser,
FastqParser)
def test_freebie_parser_1():
"""
This one is a freebie
DO NOT MODIFY THIS FUNCTION
"""
assert True
def test_freebie_parser_2():
"""
This too is a freebie
DO NOT MODIFY THIS FUNCTION
"""
... | 0 | 0 | 0 |
4c6a9382b347ed5d441f6449ab4c5d19324704dd | 1,692 | py | Python | home/migrations/0003_auto_20220326_0711.py | SeanCodeMedia/codeMedia-django | 734284859e35f24bc4a0131154f175614804d4fa | [
"MIT"
] | null | null | null | home/migrations/0003_auto_20220326_0711.py | SeanCodeMedia/codeMedia-django | 734284859e35f24bc4a0131154f175614804d4fa | [
"MIT"
] | null | null | null | home/migrations/0003_auto_20220326_0711.py | SeanCodeMedia/codeMedia-django | 734284859e35f24bc4a0131154f175614804d4fa | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2022-03-26 11:11
from django.db import migrations, models
| 30.214286 | 106 | 0.550827 | # Generated by Django 3.1.2 on 2022-03-26 11:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0002_home_main_photo'),
]
operations = [
migrations.RemoveField(
model_name='home',
name='icon1',
),... | 0 | 1,578 | 23 |
08975034e5eeea126f26be92ee6ee1566c77c249 | 8,678 | py | Python | src/everythingAboutTheMetalAPI/chapter09/__main__.py | pome-ta/pystaMetalStudy | 530248ad8621ec951fcbaf450ebd26ac2752e540 | [
"MIT"
] | 1 | 2021-08-05T04:31:02.000Z | 2021-08-05T04:31:02.000Z | src/everythingAboutTheMetalAPI/chapter09/__main__.py | pome-ta/pystaMetalStudy | 530248ad8621ec951fcbaf450ebd26ac2752e540 | [
"MIT"
] | 2 | 2021-08-14T03:33:12.000Z | 2021-11-11T06:25:01.000Z | src/everythingAboutTheMetalAPI/chapter09/__main__.py | pome-ta/pystaMetalStudy | 530248ad8621ec951fcbaf450ebd26ac2752e540 | [
"MIT"
] | null | null | null | import pathlib
import ctypes
import numpy as np
from objc_util import c, create_objc_class, ObjCClass, ObjCInstance
import ui
#import pdbg
shader_path = pathlib.Path('./Shaders.metal')
# --- load objc classes
MTKView = ObjCClass('MTKView')
MTLCompileOptions = ObjCClass('MTLCompileOptions')
MTLRenderPipelineDescr... | 31.442029 | 151 | 0.671583 | import pathlib
import ctypes
import numpy as np
from objc_util import c, create_objc_class, ObjCClass, ObjCInstance
import ui
#import pdbg
shader_path = pathlib.Path('./Shaders.metal')
# --- load objc classes
MTKView = ObjCClass('MTKView')
MTLCompileOptions = ObjCClass('MTLCompileOptions')
MTLRenderPipelineDescr... | 6,156 | 77 | 258 |
8cd547ed24dfc46665b2b6848260fc45380cd132 | 8,521 | py | Python | ncmapi.py | NKID00/NeteaseCloudMusicApiPy | 731e8c405928d38be693739cff6449e3426d22c7 | [
"MIT"
] | null | null | null | ncmapi.py | NKID00/NeteaseCloudMusicApiPy | 731e8c405928d38be693739cff6449e3426d22c7 | [
"MIT"
] | null | null | null | ncmapi.py | NKID00/NeteaseCloudMusicApiPy | 731e8c405928d38be693739cff6449e3426d22c7 | [
"MIT"
] | null | null | null | '''NeteaseCloudMusicApiPy
NeteaseCloudMusicApi 的 Python 绑定
https://github.com/NKID00/NeteaseCloudMusicApiPy
MIT License
Copyright (c) 2020 NKID00
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 ... | 35.065844 | 78 | 0.593006 | '''NeteaseCloudMusicApiPy
NeteaseCloudMusicApi 的 Python 绑定
https://github.com/NKID00/NeteaseCloudMusicApiPy
MIT License
Copyright (c) 2020 NKID00
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 ... | 409 | 0 | 81 |
821f7729b184207b23c910240f3e1ceacd2e28df | 12,862 | py | Python | tests/test_datasets.py | platiagro/projects | 00da234b35003bb0ecc2d22a997e08737ceda044 | [
"Apache-2.0"
] | 6 | 2019-09-16T13:07:20.000Z | 2021-06-02T19:02:05.000Z | tests/test_datasets.py | platiagro/projects | 00da234b35003bb0ecc2d22a997e08737ceda044 | [
"Apache-2.0"
] | 325 | 2019-09-20T20:06:00.000Z | 2022-03-30T15:05:49.000Z | tests/test_datasets.py | platiagro/projects | 00da234b35003bb0ecc2d22a997e08737ceda044 | [
"Apache-2.0"
] | 17 | 2019-08-02T16:55:47.000Z | 2021-06-26T19:13:35.000Z | # -*- coding: utf-8 -*-
import unittest
import unittest.mock as mock
from fastapi.testclient import TestClient
from projects.api.main import app
from projects.database import session_scope
import tests.util as util
app.dependency_overrides[session_scope] = util.override_session_scope
TEST_CLIENT = TestClient(app)
| 33.235142 | 132 | 0.594698 | # -*- coding: utf-8 -*-
import unittest
import unittest.mock as mock
from fastapi.testclient import TestClient
from projects.api.main import app
from projects.database import session_scope
import tests.util as util
app.dependency_overrides[session_scope] = util.override_session_scope
TEST_CLIENT = TestClient(app)
... | 0 | 12,519 | 23 |
9b3a7229fadeb38ae1b74adf5f3dcf9d0cc78deb | 144 | py | Python | dashboard/k8s/endpoint.py | getfirstcn/dashboard | 36b0416f0b02c37c4310822d1484496ed9070b58 | [
"BSD-3-Clause"
] | 5 | 2018-04-15T22:37:49.000Z | 2020-07-24T06:53:15.000Z | dashboard/k8s/endpoint.py | getfirstcn/dashboard | 36b0416f0b02c37c4310822d1484496ed9070b58 | [
"BSD-3-Clause"
] | null | null | null | dashboard/k8s/endpoint.py | getfirstcn/dashboard | 36b0416f0b02c37c4310822d1484496ed9070b58 | [
"BSD-3-Clause"
] | 1 | 2019-09-10T09:07:07.000Z | 2019-09-10T09:07:07.000Z | from django.views.generic.base import TemplateView | 36 | 57 | 0.826389 | from django.views.generic.base import TemplateView
class endpoint_list(TemplateView):
template_name = "dashboard/kubernetes/endpoints.html" | 0 | 71 | 23 |
ae6c947746f3d9976489ea081db5ec36cf12f7d9 | 117 | py | Python | tests/test_django2_2_fixers.py | pakal/django-compat-patcher | 62c1a766807f2be11b03ea481fbb4c9f9e6529ba | [
"MIT"
] | 12 | 2017-05-21T10:52:45.000Z | 2022-03-04T09:52:58.000Z | tests/test_django2_2_fixers.py | pakal/django-compat-patcher | 62c1a766807f2be11b03ea481fbb4c9f9e6529ba | [
"MIT"
] | 18 | 2019-04-18T12:42:18.000Z | 2022-02-23T09:38:45.000Z | tests/test_django2_2_fixers.py | pakal/django-compat-patcher | 62c1a766807f2be11b03ea481fbb4c9f9e6529ba | [
"MIT"
] | 2 | 2019-05-07T20:28:25.000Z | 2022-03-03T22:13:15.000Z | from __future__ import absolute_import, print_function, unicode_literals
import _test_utilities
# NOTHING FOR NOW
| 16.714286 | 72 | 0.846154 | from __future__ import absolute_import, print_function, unicode_literals
import _test_utilities
# NOTHING FOR NOW
| 0 | 0 | 0 |
71479f55708352b7b69778fa052c2356f1afdd1e | 4,738 | py | Python | main.py | Amirmoradi94/SmartCar | 4c0f17a6a98e6db46769787dc95d11e48b335488 | [
"MIT"
] | 3 | 2021-01-15T04:33:43.000Z | 2021-02-15T18:20:15.000Z | main.py | Amirmoradi94/SmartCar | 4c0f17a6a98e6db46769787dc95d11e48b335488 | [
"MIT"
] | null | null | null | main.py | Amirmoradi94/SmartCar | 4c0f17a6a98e6db46769787dc95d11e48b335488 | [
"MIT"
] | 1 | 2021-04-07T15:38:47.000Z | 2021-04-07T15:38:47.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 3 21:40:05 2020
@author: Amir Moradi
"""
import cv2
from Utils.undistortion import undistortion
from Utils.angle_calculation import angle_calculation
import numpy as np
import serial
video_StreamL = cv2.VideoCapture(2) # index of left camera
video_StreamR = cv2.Video... | 36.728682 | 120 | 0.548122 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 3 21:40:05 2020
@author: Amir Moradi
"""
import cv2
from Utils.undistortion import undistortion
from Utils.angle_calculation import angle_calculation
import numpy as np
import serial
video_StreamL = cv2.VideoCapture(2) # index of left camera
video_StreamR = cv2.Video... | 0 | 0 | 0 |
96636c79f61d2c52c4c27582d3d3210f08ece747 | 3,547 | py | Python | bot/exts/cricket.py | ShakyaMajumdar/ShaqqueBot | f618ae21e4bf700d86674399670634e8d1cc1dc9 | [
"MIT"
] | null | null | null | bot/exts/cricket.py | ShakyaMajumdar/ShaqqueBot | f618ae21e4bf700d86674399670634e8d1cc1dc9 | [
"MIT"
] | null | null | null | bot/exts/cricket.py | ShakyaMajumdar/ShaqqueBot | f618ae21e4bf700d86674399670634e8d1cc1dc9 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
# from pprint import pprint
import aiohttp
import discord
from discord.ext import commands
from bot import constants
API_URL = "https://livescore6.p.rapidapi.com/matches/v2/"
LIVE_MATCHES_URL = API_URL + "list-live"
HEADERS = {
"x-rapidapi-key": constants.RAPIDAPI_KEY,
"x-r... | 32.842593 | 120 | 0.480124 | from dataclasses import dataclass
# from pprint import pprint
import aiohttp
import discord
from discord.ext import commands
from bot import constants
API_URL = "https://livescore6.p.rapidapi.com/matches/v2/"
LIVE_MATCHES_URL = API_URL + "list-live"
HEADERS = {
"x-rapidapi-key": constants.RAPIDAPI_KEY,
"x-r... | 761 | 2,265 | 45 |
fb2b3853f43ad28f2ba2ee5903c79c030ef5c9c5 | 1,662 | py | Python | families/ubuntutw_family.py | Botomatik/JackBot | 58651d8b5a5bcead2a2eb79849019cb4f972b7cd | [
"MIT"
] | null | null | null | families/ubuntutw_family.py | Botomatik/JackBot | 58651d8b5a5bcead2a2eb79849019cb4f972b7cd | [
"MIT"
] | null | null | null | families/ubuntutw_family.py | Botomatik/JackBot | 58651d8b5a5bcead2a2eb79849019cb4f972b7cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import family
| 19.325581 | 96 | 0.427798 | # -*- coding: utf-8 -*-
import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'ubuntutw' #Set the family name; this should be the same as in the filename.
self.langs = {
'zh': None,
}
self.namespaces[-2] = {... | 1,602 | 7 | 131 |
10b3905d95f1693576c1d6105f16c89c21dc74cc | 422 | py | Python | keggretrieve.py | dewuem/python-bioinf | 9dc45a467fc884644157ef75c4e3c34f5fd8ebcf | [
"MIT"
] | 1 | 2019-06-26T23:27:05.000Z | 2019-06-26T23:27:05.000Z | keggretrieve.py | dewuem/python-bioinf | 9dc45a467fc884644157ef75c4e3c34f5fd8ebcf | [
"MIT"
] | null | null | null | keggretrieve.py | dewuem/python-bioinf | 9dc45a467fc884644157ef75c4e3c34f5fd8ebcf | [
"MIT"
] | null | null | null | #!/usr/bin/python2
# coding: utf-8
# Daniel Elsner
# Get the amino acid sequence from the correct url for a kegg entry...
# Use best with GNU parallel (Tange 2011a) and an input list containing all the gene IDs from a kegg pathway.
import sys
from bs4 import BeautifulSoup
import requests
url = sys.argv[1]
r = r... | 17.583333 | 109 | 0.729858 | #!/usr/bin/python2
# coding: utf-8
# Daniel Elsner
# Get the amino acid sequence from the correct url for a kegg entry...
# Use best with GNU parallel (Tange 2011a) and an input list containing all the gene IDs from a kegg pathway.
import sys
from bs4 import BeautifulSoup
import requests
url = sys.argv[1]
r = r... | 0 | 0 | 0 |
5453adee0e0e4fddde2b22cec442f20c9387e946 | 57 | py | Python | tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/fixtures/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | 21 | 2018-04-12T16:25:24.000Z | 2022-02-14T23:05:43.000Z | tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/fixtures/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | 8 | 2019-03-19T12:36:36.000Z | 2020-11-11T12:46:00.000Z | tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/fixtures/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | 5 | 2018-08-07T13:00:16.000Z | 2021-11-01T00:55:10.000Z | from .axle import * # noqa
from .cycle import * # noqa
| 19 | 28 | 0.649123 | from .axle import * # noqa
from .cycle import * # noqa
| 0 | 0 | 0 |
dd31c901989b3a7d1c580d100e0ea44a15b539f7 | 905 | py | Python | feincms3_forms/reporting.py | matthiask/feincms3-forms | 38f0f8a897ff36f99be989e133902e4926de451b | [
"BSD-3-Clause"
] | 2 | 2021-04-09T20:01:03.000Z | 2021-10-03T12:05:17.000Z | feincms3_forms/reporting.py | matthiask/feincms3-forms | 38f0f8a897ff36f99be989e133902e4926de451b | [
"BSD-3-Clause"
] | null | null | null | feincms3_forms/reporting.py | matthiask/feincms3-forms | 38f0f8a897ff36f99be989e133902e4926de451b | [
"BSD-3-Clause"
] | null | null | null | from itertools import chain
from django.template.defaultfilters import linebreaksbr, urlize
from django.utils.html import format_html, mark_safe
from feincms3_forms.models import FormFieldBase
| 25.857143 | 83 | 0.61989 | from itertools import chain
from django.template.defaultfilters import linebreaksbr, urlize
from django.utils.html import format_html, mark_safe
from feincms3_forms.models import FormFieldBase
def get_loaders(items):
return list(
chain.from_iterable(
item.get_loaders() for item in items if i... | 639 | 0 | 69 |
a5d94fadc5c483bc4f0c130583259b8d58126dd1 | 3,209 | py | Python | kogia/core/models.py | pascalpepe/kogia | af41f857729144f3c747a812345892e21d561e89 | [
"Apache-2.0"
] | null | null | null | kogia/core/models.py | pascalpepe/kogia | af41f857729144f3c747a812345892e21d561e89 | [
"Apache-2.0"
] | null | null | null | kogia/core/models.py | pascalpepe/kogia | af41f857729144f3c747a812345892e21d561e89 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017-2020 Pascal Pepe <contact@pascalpepe.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 23.423358 | 74 | 0.63727 | # Copyright (C) 2017-2020 Pascal Pepe <contact@pascalpepe.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 98 | 189 |
65145260a9407e4c4c5f11fa168a6c7e6ff28eaf | 985 | py | Python | example/sql.py | kmuehlbauer/wetterdienst | 85e72ccdbd00f0e8285e1ba24800dfafb81ccd63 | [
"MIT"
] | 1 | 2021-01-23T22:52:52.000Z | 2021-01-23T22:52:52.000Z | example/sql.py | kmuehlbauer/wetterdienst | 85e72ccdbd00f0e8285e1ba24800dfafb81ccd63 | [
"MIT"
] | null | null | null | example/sql.py | kmuehlbauer/wetterdienst | 85e72ccdbd00f0e8285e1ba24800dfafb81ccd63 | [
"MIT"
] | null | null | null | """
=====
About
=====
Acquire measurement information from DWD and filter using SQL.
=====
Setup
=====
::
pip install wetterdienst[sql]
"""
import logging
from wetterdienst import DWDStationRequest
from wetterdienst import TimeResolution, Parameter, PeriodType
log = logging.getLogger()
if __name__ == "__m... | 18.240741 | 84 | 0.652792 | """
=====
About
=====
Acquire measurement information from DWD and filter using SQL.
=====
Setup
=====
::
pip install wetterdienst[sql]
"""
import logging
from wetterdienst import DWDStationRequest
from wetterdienst import TimeResolution, Parameter, PeriodType
log = logging.getLogger()
def sql_example():
... | 600 | 0 | 46 |
717ef021b534903c9c8167a5c7531193230a9ab0 | 2,400 | py | Python | click_game/MainWindow.py | HSU-S21-CS232/gui-examples | 5f7d011dd13cee0648a3d69f1774edef7424e422 | [
"Apache-2.0"
] | null | null | null | click_game/MainWindow.py | HSU-S21-CS232/gui-examples | 5f7d011dd13cee0648a3d69f1774edef7424e422 | [
"Apache-2.0"
] | null | null | null | click_game/MainWindow.py | HSU-S21-CS232/gui-examples | 5f7d011dd13cee0648a3d69f1774edef7424e422 | [
"Apache-2.0"
] | null | null | null | import sys
from enum import Enum
from PySide2.QtUiTools import QUiLoader #allows us to load .ui files
#be sure to import any widget that you want to manipulate
from PySide2.QtWidgets import QApplication, QPushButton, QGridLayout, QSizePolicy
from PySide2.QtCore import QFile, QObject
import random
#class construct... | 30.379747 | 92 | 0.63375 | import sys
from enum import Enum
from PySide2.QtUiTools import QUiLoader #allows us to load .ui files
#be sure to import any widget that you want to manipulate
from PySide2.QtWidgets import QApplication, QPushButton, QGridLayout, QSizePolicy
from PySide2.QtCore import QFile, QObject
import random
class MainWindow(QOb... | 1,850 | 5 | 103 |
2de795b5bf05bc4e60da1705586f10f407d4268b | 1,573 | py | Python | list-quotas-regional.py | thiago-a-azevedo/gcp-resource-list | df7fe500f86b745e1815c8d510f8dca6e8bc355c | [
"Apache-2.0"
] | 2 | 2022-02-05T21:05:43.000Z | 2022-02-06T01:55:50.000Z | list-quotas-regional.py | thiago-a-azevedo/gcp-resource-list | df7fe500f86b745e1815c8d510f8dca6e8bc355c | [
"Apache-2.0"
] | null | null | null | list-quotas-regional.py | thiago-a-azevedo/gcp-resource-list | df7fe500f86b745e1815c8d510f8dca6e8bc355c | [
"Apache-2.0"
] | null | null | null | # List GCP Regional project quotas
# Official GCP SDK (Python) Documentation: https://googleapis.github.io/google-api-python-client/docs/dyn/
import json
import ipcalc
import sys
import argparse
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
from google.cloud import resource_ma... | 32.770833 | 106 | 0.689129 | # List GCP Regional project quotas
# Official GCP SDK (Python) Documentation: https://googleapis.github.io/google-api-python-client/docs/dyn/
import json
import ipcalc
import sys
import argparse
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
from google.cloud import resource_ma... | 0 | 0 | 0 |
df462c1c222636422e075517ef3000fe1439adb5 | 411 | py | Python | osmaxx/profile/admin.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | null | null | null | osmaxx/profile/admin.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | null | null | null | osmaxx/profile/admin.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | null | null | null | from django import forms
from django.contrib import admin
from osmaxx.profile.models import Profile
admin.site.register(Profile, ProfileAdmin)
| 24.176471 | 58 | 0.751825 | from django import forms
from django.contrib import admin
from osmaxx.profile.models import Profile
class ProfileAdminForm(forms.ModelForm):
class Meta:
model = Profile
fields = ['associated_user', 'unverified_email']
class ProfileAdmin(admin.ModelAdmin):
list_display = ['associated_user', ... | 0 | 219 | 46 |
1abc0cd17b3be692c4ae6a95012e1e744129a64f | 6,798 | py | Python | rdkit/ML/ModelPackage/UnitTestPackage.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 1,609 | 2015-01-05T02:41:13.000Z | 2022-03-30T21:57:24.000Z | rdkit/ML/ModelPackage/UnitTestPackage.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 3,412 | 2015-01-06T12:13:33.000Z | 2022-03-31T17:25:41.000Z | rdkit/ML/ModelPackage/UnitTestPackage.py | bp-kelley/rdkit | e0de7c9622ce73894b1e7d9568532f6d5638058a | [
"BSD-3-Clause"
] | 811 | 2015-01-11T03:33:48.000Z | 2022-03-28T11:57:49.000Z | #
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit tests for the model and descriptor packager """
import os
import random
import unittest
from xml.dom import minidom
from xml.etree import ElementTree as ET
from rdkit import Chem
from rdkit import RDConfig
from rdkit.Chem import Descripto... | 38.191011 | 104 | 0.597823 | #
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit tests for the model and descriptor packager """
import os
import random
import unittest
from xml.dom import minidom
from xml.etree import ElementTree as ET
from rdkit import Chem
from rdkit import RDConfig
from rdkit.Chem import Descripto... | 5,715 | 13 | 366 |
b8e52ec0a3645f3856a2bca4415ce72d79a4ffcf | 3,180 | py | Python | tests/unit/utilities/test_general.py | scherroman/mvgen | 0e79079b3fb71e94c67d48fd5599b6c43602d3b5 | [
"MIT"
] | 9 | 2016-11-28T00:54:57.000Z | 2016-12-22T21:21:17.000Z | tests/unit/utilities/test_general.py | scherroman/mvgen | 0e79079b3fb71e94c67d48fd5599b6c43602d3b5 | [
"MIT"
] | null | null | null | tests/unit/utilities/test_general.py | scherroman/mvgen | 0e79079b3fb71e94c67d48fd5599b6c43602d3b5 | [
"MIT"
] | null | null | null | from fractions import Fraction
import pytest
from mugen.utilities import conversion, general
@pytest.mark.parametrize(
"a_start, a_end, b_start, b_end, do_overlap",
[
(5, 10, 11, 12, False), # disjoint
(5, 10, 10, 12, False), # contiguous
(5, 10, 9, 12, True), # overlaps right
... | 29.174312 | 88 | 0.573899 | from fractions import Fraction
import pytest
from mugen.utilities import conversion, general
class DummyList(list):
foo = 1
@pytest.mark.parametrize(
"a_start, a_end, b_start, b_end, do_overlap",
[
(5, 10, 11, 12, False), # disjoint
(5, 10, 10, 12, False), # contiguous
(5, 10... | 731 | 13 | 177 |
0700d43171f01aecee586622fd901c92050a6f9c | 2,501 | py | Python | tests/test_metrics_list.py | amitsagtani97/prometheus-api-client-python | 49d0fdfc9a1fcfd5f51c53972cd2fcd223b1ddcf | [
"MIT"
] | 3 | 2020-05-06T06:39:00.000Z | 2020-06-05T06:23:05.000Z | tests/test_metrics_list.py | amitsagtani97/prometheus-api-client-python | 49d0fdfc9a1fcfd5f51c53972cd2fcd223b1ddcf | [
"MIT"
] | 2 | 2020-07-14T14:50:39.000Z | 2020-08-10T02:27:44.000Z | tests/test_metrics_list.py | amitsagtani97/prometheus-api-client-python | 49d0fdfc9a1fcfd5f51c53972cd2fcd223b1ddcf | [
"MIT"
] | null | null | null | import unittest
import json
import os
import datetime
from prometheus_api_client import MetricsList
if __name__ == "__main__":
unittest.main()
| 33.346667 | 100 | 0.608956 | import unittest
import json
import os
import datetime
from prometheus_api_client import MetricsList
class TestMetricsList(unittest.TestCase):
def setUp(self):
"""
read metrics stored as jsons in './tests/metrics'
"""
self.raw_metrics_list = list()
for (dir_path, _, file_nam... | 1,338 | 990 | 23 |
a757eb7b2184767f8ea2351b30cce6601a45be78 | 1,076 | py | Python | captioning/utils/div_utils.py | HongkuanZhang/self-critical.pytorch | deccb8bf624ad6771193dfdfbe71bec958c7f715 | [
"MIT"
] | 1,030 | 2017-11-18T09:15:26.000Z | 2022-03-29T05:35:24.000Z | misc/div_utils.py | sgondala/GoogleConceptualCaptioning | b7aef355bcf893d9f1e2250efd3a9b0e30646331 | [
"MIT"
] | 261 | 2017-06-09T03:45:54.000Z | 2022-03-30T05:19:20.000Z | misc/div_utils.py | sgondala/GoogleConceptualCaptioning | b7aef355bcf893d9f1e2250efd3a9b0e30646331 | [
"MIT"
] | 332 | 2017-05-10T02:28:48.000Z | 2022-03-30T08:26:33.000Z | from random import uniform
import numpy as np
from collections import OrderedDict, defaultdict
from itertools import tee
import time
# ----------------------------------------------- | 28.315789 | 67 | 0.596654 | from random import uniform
import numpy as np
from collections import OrderedDict, defaultdict
from itertools import tee
import time
# -----------------------------------------------
def find_ngrams(input_list, n):
return zip(*[input_list[i:] for i in range(n)])
def compute_div_n(caps,n=1):
aggr_div = []
for ... | 825 | 0 | 68 |
fbcedc37d1242b6a75437cb537ee7a1051dfc8d8 | 358 | py | Python | tests/test_bonddata.py | andrew-block/jamesbond | 9820526df12cc7b62b93638788ca8bbef2081c9b | [
"MIT"
] | 3 | 2021-10-18T18:51:40.000Z | 2021-12-20T15:45:26.000Z | tests/test_bonddata.py | andrew-block/jamesbond | 9820526df12cc7b62b93638788ca8bbef2081c9b | [
"MIT"
] | null | null | null | tests/test_bonddata.py | andrew-block/jamesbond | 9820526df12cc7b62b93638788ca8bbef2081c9b | [
"MIT"
] | 3 | 2020-08-27T11:06:02.000Z | 2021-08-10T10:13:24.000Z | import pytest
from jamesbond import bonddata
def test_load_data():
"""
Test the row & column count (shape)
Test the first column from the last row of the dataset 'Spectre'.
"""
df = bonddata.load_data()
shape = df.shape
last_row_first_col = df.iloc[-1, 1]
assert shape == (24, 27)
a... | 23.866667 | 69 | 0.659218 | import pytest
from jamesbond import bonddata
def test_load_data():
"""
Test the row & column count (shape)
Test the first column from the last row of the dataset 'Spectre'.
"""
df = bonddata.load_data()
shape = df.shape
last_row_first_col = df.iloc[-1, 1]
assert shape == (24, 27)
a... | 0 | 0 | 0 |
7c28549faf904dad9ced65ad4b3cab1ce627221f | 40 | py | Python | tests/__init__.py | bgailleton/helplotlib | 1c517e997cbb7dca021b589d8237637f09040c42 | [
"MIT"
] | null | null | null | tests/__init__.py | bgailleton/helplotlib | 1c517e997cbb7dca021b589d8237637f09040c42 | [
"MIT"
] | null | null | null | tests/__init__.py | bgailleton/helplotlib | 1c517e997cbb7dca021b589d8237637f09040c42 | [
"MIT"
] | null | null | null | """Unit test package for helplotlib."""
| 20 | 39 | 0.7 | """Unit test package for helplotlib."""
| 0 | 0 | 0 |
43cd4c86ae09c8f5727dc536abc8a702deb94a79 | 52 | py | Python | testcase/test.py | songhuijuantianxiezuo/songhuijuan | a80f4add92035914c61ccf5d873e4bc2063ef147 | [
"MIT"
] | null | null | null | testcase/test.py | songhuijuantianxiezuo/songhuijuan | a80f4add92035914c61ccf5d873e4bc2063ef147 | [
"MIT"
] | null | null | null | testcase/test.py | songhuijuantianxiezuo/songhuijuan | a80f4add92035914c61ccf5d873e4bc2063ef147 | [
"MIT"
] | null | null | null |
a=1,b=2
print(assertEqual(a,b)) #验证是否一致
| 7.428571 | 32 | 0.538462 |
a=1,b=2
print(assertEqual(a,b)) #验证是否一致
| 0 | 0 | 0 |
c4c753f45db71b0be93714242ffc0238d4d7156f | 10,257 | py | Python | matlab_test_files/invfreqs_test.py | vishalbelsare/parametric_modeling | 9bfe5df35671930043215c8f6c855af8f49e28bf | [
"BSD-3-Clause"
] | 37 | 2015-02-01T12:03:48.000Z | 2021-12-23T14:38:38.000Z | matlab_test_files/invfreqs_test.py | vishalbelsare/parametric_modeling | 9bfe5df35671930043215c8f6c855af8f49e28bf | [
"BSD-3-Clause"
] | 2 | 2015-07-27T11:34:24.000Z | 2019-12-11T13:39:18.000Z | matlab_test_files/invfreqs_test.py | vishalbelsare/parametric_modeling | 9bfe5df35671930043215c8f6c855af8f49e28bf | [
"BSD-3-Clause"
] | 19 | 2016-09-06T20:23:19.000Z | 2021-11-07T16:07:40.000Z |
import numpy as np
import scipy
import matcompat
# if available import pylab (from matlibplot)
try:
import matplotlib.pylab as plt
except ImportError:
pass | 35.989474 | 253 | 0.538267 |
import numpy as np
import scipy
import matcompat
# if available import pylab (from matlibplot)
try:
import matplotlib.pylab as plt
except ImportError:
pass
def invfreqs(g, w, varargin):
# Local Variables: realFlag, cg, realStr, D31, gndir, t1, cw, nk, kom, nm, na, nb, Vcap, V1, rg, pf, rw, tol, maxiter,... | 10,047 | 0 | 45 |
000b1fd18754a4d6247223a1d655166753c79f23 | 22,046 | py | Python | corehq/apps/api/es.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/api/es.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/api/es.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | import copy
import datetime
import json
import logging
from django.http import HttpResponse
from django.utils.decorators import classonlymethod, method_decorator
from django.views.generic import View
from corehq.util.es.elasticsearch import ElasticsearchException, NotFoundError
from casexml.apps.case.models import C... | 37.177066 | 144 | 0.606459 | import copy
import datetime
import json
import logging
from django.http import HttpResponse
from django.utils.decorators import classonlymethod, method_decorator
from django.views.generic import View
from corehq.util.es.elasticsearch import ElasticsearchException, NotFoundError
from casexml.apps.case.models import C... | 11,331 | 464 | 684 |
848837b79db84cc5164466f468155b31ba48468a | 166 | py | Python | graphene_neo4j/rest_framework/models.py | Usama0121/graphene-neo4j | 8d8c5a106b3d41851516eb7334d4f9beb8bb301c | [
"MIT"
] | 8 | 2020-01-18T20:52:16.000Z | 2022-03-18T02:28:09.000Z | graphene_neo4j/rest_framework/models.py | Usama0121/graphene-neo4j | 8d8c5a106b3d41851516eb7334d4f9beb8bb301c | [
"MIT"
] | 6 | 2021-03-19T09:07:56.000Z | 2022-02-10T09:25:41.000Z | graphene_neo4j/rest_framework/models.py | Usama0121/graphene-neo4j | 8d8c5a106b3d41851516eb7334d4f9beb8bb301c | [
"MIT"
] | 4 | 2019-06-10T19:33:32.000Z | 2020-01-30T20:08:04.000Z | from django.db import models
| 23.714286 | 53 | 0.777108 | from django.db import models
class MyFakeModel(models.Model):
cool_name = models.CharField(max_length=50)
created = models.DateTimeField(auto_now_add=True)
| 0 | 113 | 23 |
0079cd9a1c9858deccf8054f86b028bf23ff6bd4 | 489 | py | Python | Day 5 Assign 2.py | dishabhavsar/Letsupgrade-python-b7 | 3c78bfe8aaa113a003efcccdb3d1787c95aef78e | [
"Apache-2.0"
] | null | null | null | Day 5 Assign 2.py | dishabhavsar/Letsupgrade-python-b7 | 3c78bfe8aaa113a003efcccdb3d1787c95aef78e | [
"Apache-2.0"
] | null | null | null | Day 5 Assign 2.py | dishabhavsar/Letsupgrade-python-b7 | 3c78bfe8aaa113a003efcccdb3d1787c95aef78e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[69]:
# In[70]:
isPrime(7)
# In[71]:
isPrime(8)
# In[72]:
pno = []
# In[73]:
lst = list(range(0,2500))
# In[74]:
for item in lst:
if isPrime(item):
pno.append(item)
# In[75]:
print(pno)
# In[76]:
lst_prime_no = filter(isPrime,lst)
# I... | 6.985714 | 34 | 0.507157 | #!/usr/bin/env python
# coding: utf-8
# In[69]:
def isPrime(n):
for i in range(2,n):
if n % i ==0:
return False
else:
return True
# In[70]:
isPrime(7)
# In[71]:
isPrime(8)
# In[72]:
pno = []
# In[73]:
lst = list(range(0,2500))
# In[74]:
for item in lst:
if ... | 96 | 0 | 23 |
3bb68af9b0478d9ea6afdf11b949fe5e580705ff | 5,131 | py | Python | deliver/tests/converter/test_converter.py | sirech/deliver | 0ddb47d9b7c7a4bddfcf92e4bd683803c95efd3a | [
"MIT"
] | 3 | 2017-06-07T21:48:20.000Z | 2020-06-15T16:27:43.000Z | deliver/tests/converter/test_converter.py | sirech/deliver | 0ddb47d9b7c7a4bddfcf92e4bd683803c95efd3a | [
"MIT"
] | null | null | null | deliver/tests/converter/test_converter.py | sirech/deliver | 0ddb47d9b7c7a4bddfcf92e4bd683803c95efd3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from deliver.tests.test_base import BaseTest, load_msg, load_all_msg
class ConverterTest(BaseTest):
'''Tests for the UnicodeMessage class'''
| 38.291045 | 99 | 0.653479 | # -*- coding: utf-8 -*-
from deliver.tests.test_base import BaseTest, load_msg, load_all_msg
class ConverterTest(BaseTest):
'''Tests for the UnicodeMessage class'''
def setUp(self):
super(ConverterTest,self).setUp()
self.msg = load_msg('sample3')
def get_text(self, decode=False):
... | 4,167 | 0 | 810 |
4b059cdf1fee82342ebf26912e0f23a357b0cc33 | 1,961 | py | Python | example/crawler/pool_client.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | 1 | 2022-03-18T15:20:53.000Z | 2022-03-18T15:20:53.000Z | example/crawler/pool_client.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | null | null | null | example/crawler/pool_client.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | null | null | null | import requests
import random
import os
DEVELOPMENT_MODE = os.getenv("DEVELOPMENT_MODE", True)
if DEVELOPMENT_MODE:
# Import package multirunnable
import pathlib
import sys
package_path = str(pathlib.Path(__file__).absolute().parent.parent.parent)
sys.path.append(package_path)
# multirunnable pac... | 30.169231 | 153 | 0.688424 | import requests
import random
import os
DEVELOPMENT_MODE = os.getenv("DEVELOPMENT_MODE", True)
if DEVELOPMENT_MODE:
# Import package multirunnable
import pathlib
import sys
package_path = str(pathlib.Path(__file__).absolute().parent.parent.parent)
sys.path.append(package_path)
# multirunnable pac... | 1,193 | 153 | 73 |
853a07f29158122ed01614d80889727843fe1daf | 3,733 | py | Python | jetson/train.py | team7561/2022RapidReact | 8b6e0d2a24411100689774c6c2e3b76c1c69deab | [
"BSD-3-Clause"
] | null | null | null | jetson/train.py | team7561/2022RapidReact | 8b6e0d2a24411100689774c6c2e3b76c1c69deab | [
"BSD-3-Clause"
] | null | null | null | jetson/train.py | team7561/2022RapidReact | 8b6e0d2a24411100689774c6c2e3b76c1c69deab | [
"BSD-3-Clause"
] | null | null | null | # %%
import torch
import torchvision
import threading
import time
from utils import preprocess
import torch.nn.functional as F
import traitlets
import torchvision.transforms as transforms
from dataset import ImageClassificationDataset
device = torch.device('cuda')
TASK = 'balls'
CATEGORIES = ['red_ball','... | 28.715385 | 162 | 0.583981 | # %%
import torch
import torchvision
import threading
import time
from utils import preprocess
import torch.nn.functional as F
import traitlets
import torchvision.transforms as transforms
from dataset import ImageClassificationDataset
device = torch.device('cuda')
TASK = 'balls'
CATEGORIES = ['red_ball','... | 2,034 | 0 | 79 |
16ecd44268339807a3ab50f1f6e9552e1c4a7e7f | 2,500 | py | Python | tests/functional/push/test_remove_channels_from_push.py | Versature/pubnub-python | a558d212a44ada6fbf2793a32e93685c959b8b22 | [
"MIT"
] | null | null | null | tests/functional/push/test_remove_channels_from_push.py | Versature/pubnub-python | a558d212a44ada6fbf2793a32e93685c959b8b22 | [
"MIT"
] | null | null | null | tests/functional/push/test_remove_channels_from_push.py | Versature/pubnub-python | a558d212a44ada6fbf2793a32e93685c959b8b22 | [
"MIT"
] | null | null | null | import unittest
try:
from mock import MagicMock
except ImportError:
from unittest.mock import MagicMock
from pubnub.pubnub import PubNub
import pubnub.enums
from pubnub.endpoints.push.remove_channels_from_push import RemoveChannelsFromPush
from tests.helper import pnconf, sdk_name
| 34.246575 | 117 | 0.656 | import unittest
try:
from mock import MagicMock
except ImportError:
from unittest.mock import MagicMock
from pubnub.pubnub import PubNub
import pubnub.enums
from pubnub.endpoints.push.remove_channels_from_push import RemoveChannelsFromPush
from tests.helper import pnconf, sdk_name
class TestRemoveChannels... | 2,044 | 31 | 130 |
70d0c88563906e11580cfe5c56c6f22438a75531 | 280 | py | Python | Python/find the Rhombus Area.py | Bijitakc/Hacktoberfest2021-2 | 167e7c81dc9c5cc83fd604ea1d4bce52aa882605 | [
"MIT"
] | 20 | 2021-10-06T13:51:46.000Z | 2021-11-11T16:12:17.000Z | Python/find the Rhombus Area.py | Bijitakc/Hacktoberfest2021-2 | 167e7c81dc9c5cc83fd604ea1d4bce52aa882605 | [
"MIT"
] | 42 | 2021-10-08T09:49:17.000Z | 2021-10-21T23:18:39.000Z | Python/find the Rhombus Area.py | Bijitakc/Hacktoberfest2021-2 | 167e7c81dc9c5cc83fd604ea1d4bce52aa882605 | [
"MIT"
] | 97 | 2021-10-06T13:04:34.000Z | 2021-11-11T16:12:21.000Z |
rhombusD1 = float(input("Enter Rhombus First Diagonal = "))
rhombusD2 = float(input("Enter Rhombus Second Diagonal = "))
rhombusArea = calRhombusArea(rhombusD1, rhombusD2)
print("The Area of a Rhombus = %.3f" %rhombusArea)
| 25.454545 | 60 | 0.710714 | def calRhombusArea(d1, d2):
return (d1 * d2)/2
rhombusD1 = float(input("Enter Rhombus First Diagonal = "))
rhombusD2 = float(input("Enter Rhombus Second Diagonal = "))
rhombusArea = calRhombusArea(rhombusD1, rhombusD2)
print("The Area of a Rhombus = %.3f" %rhombusArea)
| 29 | 0 | 22 |
02ae1dd4f0b18eabd2110e77fdbaa8e28cc8fbf7 | 5,796 | py | Python | Testing/elx_compare_overlap.py | eliseemond/elastix | 0e8572f4a315e0a8f08b07d5947b4f3ac160b575 | [
"Apache-2.0"
] | 318 | 2017-05-22T11:39:46.000Z | 2022-03-27T04:40:13.000Z | Testing/elx_compare_overlap.py | eliseemond/elastix | 0e8572f4a315e0a8f08b07d5947b4f3ac160b575 | [
"Apache-2.0"
] | 358 | 2017-05-22T11:36:05.000Z | 2022-03-18T15:49:10.000Z | Testing/elx_compare_overlap.py | eliseemond/elastix | 0e8572f4a315e0a8f08b07d5947b4f3ac160b575 | [
"Apache-2.0"
] | 102 | 2017-05-22T11:38:44.000Z | 2021-12-23T20:27:51.000Z | import sys, subprocess
import os
import os.path
import shutil
import re
import glob
from optparse import OptionParser
#-------------------------------------------------------------------------------
# the main function
# Below we deform the moving image segmentation by the current result as well as
# by a previous sto... | 45.637795 | 149 | 0.675811 | import sys, subprocess
import os
import os.path
import shutil
import re
import glob
from optparse import OptionParser
#-------------------------------------------------------------------------------
# the main function
# Below we deform the moving image segmentation by the current result as well as
# by a previous sto... | 5,103 | 0 | 23 |
2b52a93d3cf4e00721091ea445ca5eee4afc169e | 1,771 | py | Python | build-tools/code_generator/function_generator/generate_src_nbla_function_cpp.py | PAC-P2P/nnabla | bb7e7d52555a5bc145ec3c9a2e152fa5b11574de | [
"Apache-2.0"
] | 1 | 2021-04-08T00:33:23.000Z | 2021-04-08T00:33:23.000Z | build-tools/code_generator/function_generator/generate_src_nbla_function_cpp.py | enomotom/nnabla | 1947fe16a0a41d19d76cd916f151aa1991ea1b44 | [
"Apache-2.0"
] | null | null | null | build-tools/code_generator/function_generator/generate_src_nbla_function_cpp.py | enomotom/nnabla | 1947fe16a0a41d19d76cd916f151aa1991ea1b44 | [
"Apache-2.0"
] | 1 | 2020-08-19T08:32:51.000Z | 2020-08-19T08:32:51.000Z | # Copyright (c) 2017 Sony Corporation. 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 applic... | 45.410256 | 99 | 0.645963 | # Copyright (c) 2017 Sony Corporation. 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 applic... | 1,073 | 0 | 23 |
a91c73d911d11954dcaa3a07d8b540556f00da65 | 679 | py | Python | utils.py | selplacei/b20q | b8734b1afceb3a9175e6a75d857825190c55841b | [
"Apache-2.0"
] | 1 | 2019-11-29T01:20:15.000Z | 2019-11-29T01:20:15.000Z | utils.py | selplacei/b20q | b8734b1afceb3a9175e6a75d857825190c55841b | [
"Apache-2.0"
] | 1 | 2020-04-24T17:04:42.000Z | 2020-04-24T17:04:42.000Z | utils.py | selplacei/b20q | b8734b1afceb3a9175e6a75d857825190c55841b | [
"Apache-2.0"
] | 1 | 2020-04-24T16:33:47.000Z | 2020-04-24T16:33:47.000Z | import re
| 23.413793 | 78 | 0.539028 | import re
async def noop():
pass
def remove_formatting(text):
re_strip = (
(r'(\*{1,3})(.+?)\1', '*'),
(r'(\_{1,3})(.+?)\1', '_'),
(r'```([^`]+?)```', '```'),
(r'`([^`\r\n]+?)`', '`')
)
re_strip_one = (
(r'(\~\~)(.+?)\1', '~~'),
(r'(\|\|)(.+?)\1', '||')
)
re_special_code_block = r'```\w+$'
text ... | 621 | 0 | 46 |
7106131880699d6f4381bcf92970ea93379347b3 | 4,583 | py | Python | low_shot_learning/architectures/tools.py | ZhenLiuBuaa/wDAE_GNN_FewShot | 6db1e4b1fe99821ffa116be009b5765f47932400 | [
"MIT"
] | 150 | 2019-04-06T15:27:15.000Z | 2022-03-23T07:52:20.000Z | low_shot_learning/architectures/tools.py | ZhenLiuBuaa/wDAE_GNN_FewShot | 6db1e4b1fe99821ffa116be009b5765f47932400 | [
"MIT"
] | 17 | 2019-05-14T06:55:04.000Z | 2021-03-12T15:45:54.000Z | low_shot_learning/architectures/tools.py | gidariss/wDAE_GNN_FewShot | 6db1e4b1fe99821ffa116be009b5765f47932400 | [
"MIT"
] | 21 | 2019-06-22T02:26:35.000Z | 2022-01-14T15:37:44.000Z | import torch
import torch
import torch.nn as nn
import torch.nn.functional as F
def batch_cosine_fully_connected_layer(x_in, weight, scale=None, bias=None):
"""
Args:
x_in: a 3D tensor with shape
[meta_batch_size x num_examples x num_features_in]
weight: a 3D tensor with shape
... | 29.567742 | 76 | 0.602444 | import torch
import torch
import torch.nn as nn
import torch.nn.functional as F
class LinearDiag(nn.Module):
def __init__(self, num_features, bias=False):
super(LinearDiag, self).__init__()
# initialize to the identity transform
weight = torch.FloatTensor(num_features).fill_(1)
sel... | 3,202 | 39 | 301 |
27da8b8c9f15b6143439568cacc7459e3df67bd2 | 1,527 | py | Python | atlasutil/dvpp_process/dvpp_process.py | Atlas200DKTest/sample-facedetection-python | b1266604c853ab04efac6ed6656b192f72d0778c | [
"Apache-2.0"
] | 1 | 2020-04-10T08:48:05.000Z | 2020-04-10T08:48:05.000Z | atlasutil/dvpp_process/dvpp_process.py | Atlas200DKTest/sample-facedetection-python | b1266604c853ab04efac6ed6656b192f72d0778c | [
"Apache-2.0"
] | 1 | 2020-01-23T11:41:25.000Z | 2020-02-25T08:54:54.000Z | atlasutil/dvpp_process/dvpp_process.py | Atlas200DKTest/sample-facedetection-python | b1266604c853ab04efac6ed6656b192f72d0778c | [
"Apache-2.0"
] | 1 | 2020-04-10T08:47:53.000Z | 2020-04-10T08:47:53.000Z | # !/usr/bin/env python
# -*- coding:utf-8 -*-
import ctypes
from ctypes import *
import os
import numpy as np
import time
JPGENC_FORMAT_NV12 = 0x10
| 31.8125 | 113 | 0.638507 | # !/usr/bin/env python
# -*- coding:utf-8 -*-
import ctypes
from ctypes import *
import os
import numpy as np
import time
JPGENC_FORMAT_NV12 = 0x10
class CameraImageBuf(Structure):
_fields_ = [
('size', c_uint),
('data', POINTER(c_ubyte))
]
class DvppImageBuffer(Structure):
_fields_ =... | 852 | 454 | 69 |
0b832f5ceea1a3fbf7ea9c67e5673b38acad18d4 | 850 | py | Python | programmers/lv3/shopping.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/lv3/shopping.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/lv3/shopping.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # 보석 쇼핑
if __name__ == "__main__":
gems = ["DIA", "RUBY", "RUBY", "DIA", "DIA", "EMERALD", "SAPPHIRE", "DIA"]
print(solution(gems))
| 26.5625 | 78 | 0.451765 | # 보석 쇼핑
def solution(gems):
answer = []
counts = {}
kinds = len(set(gems))
minimum = 987654321
left, right = 0, 0
while right < len(gems):
cur_right = gems[right]
counts[cur_right] = counts.get(cur_right, 0) + 1
right += 1
if kinds == len(counts):
wh... | 684 | 0 | 23 |
ac46915ed60f6f977d96ec5919d4614d21f262fd | 3,517 | py | Python | Battleships/Source/Set_Ai_ai_game.py | Dorthion/Python-Minigames | 91ba20d42ac7376ccaad60cd948a576800085623 | [
"MIT"
] | null | null | null | Battleships/Source/Set_Ai_ai_game.py | Dorthion/Python-Minigames | 91ba20d42ac7376ccaad60cd948a576800085623 | [
"MIT"
] | null | null | null | Battleships/Source/Set_Ai_ai_game.py | Dorthion/Python-Minigames | 91ba20d42ac7376ccaad60cd948a576800085623 | [
"MIT"
] | null | null | null | import pygame
import numpy as np
from Source import UI_functions as UI
from Source import battleships_functions_bot as bfb
from Source import battleships_functions_check as bfc | 40.895349 | 135 | 0.586295 | import pygame
import numpy as np
from Source import UI_functions as UI
from Source import battleships_functions_bot as bfb
from Source import battleships_functions_check as bfc
def Play_Game(screen, bg, cfg):
#Init
screen, bg = UI.Update_Screen_Values(screen, bg)
pygame.time.Clock().tick(cfg["Basic"].... | 3,323 | 0 | 23 |
022d20ed03d831aaada101ae2cab7e00cafb2ea8 | 30,512 | py | Python | head_tracker.py | kalleknast/head-tracker | df06cc71e1f36d7c752d82f94a010b5258fd1fb9 | [
"Apache-2.0"
] | 2 | 2019-06-03T17:21:46.000Z | 2021-05-27T04:48:24.000Z | head_tracker.py | kalleknast/head-tracker | df06cc71e1f36d7c752d82f94a010b5258fd1fb9 | [
"Apache-2.0"
] | null | null | null | head_tracker.py | kalleknast/head-tracker | df06cc71e1f36d7c752d82f94a010b5258fd1fb9 | [
"Apache-2.0"
] | 1 | 2017-03-30T08:23:11.000Z | 2017-03-30T08:23:11.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 30 15:20:09 2016
@author: hjalmar
"""
import tensorflow as tf
from ht_helper import HeSD, angle2class, FrameStepper, class2angle, whiten
from ht_helper import anglediff, get_max_gaze_line, CountdownPrinter
from ht_helper import angles2complex, complex2angles, softmax, get... | 41.740082 | 181 | 0.470897 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 30 15:20:09 2016
@author: hjalmar
"""
import tensorflow as tf
from ht_helper import HeSD, angle2class, FrameStepper, class2angle, whiten
from ht_helper import anglediff, get_max_gaze_line, CountdownPrinter
from ht_helper import angles2complex, complex2angles, softmax, get... | 5,763 | -9 | 174 |
138027569280d43b0a88e865f59f229b1878cf3b | 14,614 | py | Python | Py2ExeDecompiler/resources/pyc2.py | kuteminh11/Py2ExeDecompiler | e871e045334074314ab5fc377cfd8955d768c809 | [
"Apache-2.0"
] | 175 | 2017-04-25T21:58:42.000Z | 2022-03-28T19:19:46.000Z | Py2ExeDecompiler/resources/pyc2.py | nsxz/Py2ExeDecompiler | e871e045334074314ab5fc377cfd8955d768c809 | [
"Apache-2.0"
] | 2 | 2017-04-27T11:31:43.000Z | 2018-04-02T05:54:01.000Z | Py2ExeDecompiler/resources/pyc2.py | nsxz/Py2ExeDecompiler | e871e045334074314ab5fc377cfd8955d768c809 | [
"Apache-2.0"
] | 36 | 2017-04-26T17:22:00.000Z | 2021-08-08T09:02:42.000Z | import marshal
import imp
import struct
import os
import sys
import base64
import new
import dis
from dis import opmap, opname
class Bytecode():
'''
Class to store individual instruction as a node in the graph
'''
def len(self):
'''
Returns the length of the bytecode
1 for no ... | 29.053678 | 115 | 0.529561 | import marshal
import imp
import struct
import os
import sys
import base64
import new
import dis
from dis import opmap, opname
class Bytecode():
'''
Class to store individual instruction as a node in the graph
'''
def __init__(self, addr, buffer, prev=None, next=None, xrefs=[]):
self.opcode = ... | 2,861 | 7,772 | 118 |
be8eb67926a73287d11d270f9ad6d308dbf977a1 | 23,118 | py | Python | rotkehlchen/chain/ethereum/modules/liquity/trove.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 137 | 2018-03-05T11:53:29.000Z | 2019-11-03T16:38:42.000Z | rotkehlchen/chain/ethereum/modules/liquity/trove.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 385 | 2018-03-08T12:43:41.000Z | 2019-11-10T09:15:36.000Z | rotkehlchen/chain/ethereum/modules/liquity/trove.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 59 | 2018-03-08T10:08:27.000Z | 2019-10-26T11:30:44.000Z | import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, List, Literal, NamedTuple, Optional
from eth_utils import to_checksum_address
from gevent.lock import Semaphore
from rotkehlchen.accounting.structures.balance import AssetBalance, Balance
... | 40.700704 | 128 | 0.541483 | import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, List, Literal, NamedTuple, Optional
from eth_utils import to_checksum_address
from gevent.lock import Semaphore
from rotkehlchen.accounting.structures.balance import AssetBalance, Balance
... | 19,599 | 1,236 | 369 |
09649fc65519ebd7fff4291f0c134bd3591e2f27 | 792 | py | Python | accounts/api/views.py | mcastellin/anem-per-feina | 5c7072c560e8e34355f7bbf7db12e36403766e68 | [
"MIT"
] | null | null | null | accounts/api/views.py | mcastellin/anem-per-feina | 5c7072c560e8e34355f7bbf7db12e36403766e68 | [
"MIT"
] | null | null | null | accounts/api/views.py | mcastellin/anem-per-feina | 5c7072c560e8e34355f7bbf7db12e36403766e68 | [
"MIT"
] | null | null | null | from rest_framework import decorators, permissions, response, status
from rest_framework.request import Request
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext as _
from .serializers import UserCreateSerializer
User = get_user_model()
@decorators.api_view(["POST"])
@dec... | 33 | 80 | 0.768939 | from rest_framework import decorators, permissions, response, status
from rest_framework.request import Request
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext as _
from .serializers import UserCreateSerializer
User = get_user_model()
@decorators.api_view(["POST"])
@dec... | 399 | 0 | 22 |
3863645c8e2604383c3376d4ce87e6f9580e9466 | 1,526 | py | Python | Blog/migrations/0002_multimedia_news_posttags.py | softrebel/djangoBlog | 1c93d15788b37cf3fd53479419064dcaa234ecad | [
"MIT"
] | null | null | null | Blog/migrations/0002_multimedia_news_posttags.py | softrebel/djangoBlog | 1c93d15788b37cf3fd53479419064dcaa234ecad | [
"MIT"
] | null | null | null | Blog/migrations/0002_multimedia_news_posttags.py | softrebel/djangoBlog | 1c93d15788b37cf3fd53479419064dcaa234ecad | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-31 16:43
from django.db import migrations, models
import django.db.models.deletion
| 38.15 | 114 | 0.577326 | # Generated by Django 2.1.7 on 2019-03-31 16:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='MultiMedia',
... | 0 | 1,379 | 23 |
183886fe1e13ac8ce545eb2db5d498e15f3c866e | 8,435 | py | Python | qiskit/transpiler/passes/optimization/consolidate_blocks.py | HuangJunye/qiskit-terra | 0c8bb3dbf8d688590431ca79a83ba8aede84ed20 | [
"Apache-2.0"
] | null | null | null | qiskit/transpiler/passes/optimization/consolidate_blocks.py | HuangJunye/qiskit-terra | 0c8bb3dbf8d688590431ca79a83ba8aede84ed20 | [
"Apache-2.0"
] | 2 | 2022-03-30T10:09:44.000Z | 2022-03-30T10:09:45.000Z | qiskit/transpiler/passes/optimization/consolidate_blocks.py | HuangJunye/qiskit-terra | 0c8bb3dbf8d688590431ca79a83ba8aede84ed20 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 44.867021 | 90 | 0.583521 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 0 | 0 | 0 |
a41c6af363966da210561bb7fd8f3b3ce7b0c46e | 891 | py | Python | apps/auth/migrations/0002_websettings.py | realnoobs/wagtail_simple_blog | 01b35153f6dd90e9c12234a5aaae8eebe3940f37 | [
"MIT"
] | null | null | null | apps/auth/migrations/0002_websettings.py | realnoobs/wagtail_simple_blog | 01b35153f6dd90e9c12234a5aaae8eebe3940f37 | [
"MIT"
] | null | null | null | apps/auth/migrations/0002_websettings.py | realnoobs/wagtail_simple_blog | 01b35153f6dd90e9c12234a5aaae8eebe3940f37 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2021-12-24 07:16
from django.db import migrations, models
import django.db.models.deletion
| 33 | 131 | 0.606061 | # Generated by Django 3.2.10 on 2021-12-24 07:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0066_collection_management_permissions'),
('authentication', '0001_initial'),
]
operations ... | 0 | 743 | 23 |
b442fb3307b5147128f913d2434d01da33a6bf32 | 12,664 | py | Python | feichangzun/allflight.py | Octoberr/feivhangzunpac | af080c9fac777b80c053ce187b8eec6e4b29b2e5 | [
"Apache-2.0"
] | null | null | null | feichangzun/allflight.py | Octoberr/feivhangzunpac | af080c9fac777b80c053ce187b8eec6e4b29b2e5 | [
"Apache-2.0"
] | null | null | null | feichangzun/allflight.py | Octoberr/feivhangzunpac | af080c9fac777b80c053ce187b8eec6e4b29b2e5 | [
"Apache-2.0"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from time import sleep
from retrying import retry
import json
import re
import pymongo
import datetime
from feichangzun import config
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 '
'(KHTML, like Gecko) Chrome/... | 44.591549 | 108 | 0.52669 | import requests
from bs4 import BeautifulSoup
from time import sleep
from retrying import retry
import json
import re
import pymongo
import datetime
from feichangzun import config
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 '
'(KHTML, like Gecko) Chrome/... | 11,738 | 264 | 72 |
3c6e114d1d7026284730233e91143fd1decf8300 | 1,103 | py | Python | Gauss_elimination.py | subhamkd/Numerical-methods-Grad | 0d89e56de3d8db6b0b16b79711ac5559e111f5bf | [
"MIT"
] | null | null | null | Gauss_elimination.py | subhamkd/Numerical-methods-Grad | 0d89e56de3d8db6b0b16b79711ac5559e111f5bf | [
"MIT"
] | null | null | null | Gauss_elimination.py | subhamkd/Numerical-methods-Grad | 0d89e56de3d8db6b0b16b79711ac5559e111f5bf | [
"MIT"
] | null | null | null | from numpy import zeros
import time
n=6 # number of equations
A=[[10.0, -1.0, 4.0, 0.0, 2.0, 9.0, 19.0], [0.0, 25.0, -2.0, 7.0, 8.0, 4.0, 2.0], [1.0, 0.0, 15.0, 7.0, 3.0, -2.0, 13.0], [6.0, -1.0, 2.0, 23.0, 0.0, 8.0, -7.0], [-4.0, 2.0, 0.0, 5.0, -25.0, 3.0, -9.0], [0.0, 7.0, -1.0, 5.0, 4.0, -22.0, 2.0]] #the augmented... | 30.638889 | 264 | 0.468722 | from numpy import zeros
import time
def GE(A):
# function for determining solution using Gaussian Elimination
# Forward Elimination step
start=time.time()
for i in range(n):
if A[i][i] == 0.0:
t=A[i]
A[i]=A[i+1]
A[i+1]=t
for j in range(i+1, n):
... | 704 | 0 | 23 |
39d574e23e5afc9e16a82e90c23924da5242a6a9 | 3,290 | py | Python | ML_prep-master/ML_prep-master/Practical_Coding_Challenges/Solutions/Tic_Tac_Toe_EX3.py | anushka-DS/DS-Interview-Prep | c331769f8f2d11e167d782b3b2e48ca4709d9b54 | [
"CC-BY-4.0"
] | 1 | 2022-01-01T07:18:42.000Z | 2022-01-01T07:18:42.000Z | ML_prep-master/ML_prep-master/Practical_Coding_Challenges/Solutions/Tic_Tac_Toe_EX3.py | anushka-DS/DS-Interview-Prep | c331769f8f2d11e167d782b3b2e48ca4709d9b54 | [
"CC-BY-4.0"
] | null | null | null | ML_prep-master/ML_prep-master/Practical_Coding_Challenges/Solutions/Tic_Tac_Toe_EX3.py | anushka-DS/DS-Interview-Prep | c331769f8f2d11e167d782b3b2e48ca4709d9b54 | [
"CC-BY-4.0"
] | null | null | null | """
Code up the game tic tac toe
1 class solution
"""
if __name__ == "__main__":
t = TicTacToe()
t.print_board()
t.play_game()
| 26.967213 | 120 | 0.518541 | """
Code up the game tic tac toe
1 class solution
"""
class TicTacToe():
def __init__(self):
self.board = self.create_board()
self.current = 'X'
def create_board(self):
"Create the board for Tic Tac Toe"
board = [['', '', ''],
['', '', ''],
[... | 1,184 | 1,942 | 23 |
afc3f86a3c27c3e0823794ed1f7c2e0e76c6fd50 | 372 | py | Python | data/contacts.py | anreysolovyev/python_training | ab109a4a64997ea4a668ec7004c2169d962c8d61 | [
"Apache-2.0"
] | null | null | null | data/contacts.py | anreysolovyev/python_training | ab109a4a64997ea4a668ec7004c2169d962c8d61 | [
"Apache-2.0"
] | null | null | null | data/contacts.py | anreysolovyev/python_training | ab109a4a64997ea4a668ec7004c2169d962c8d61 | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
testdata = [
Contact(firstname="name1", lastname="lastname1", middlename="middlename1",
nickname="nickname1", title="title1", company="company1",
address="address1", homephone="homephone1", mobilephone="mobphone1",
workphone="workphone1", fax="f... | 41.333333 | 91 | 0.680108 | from model.contact import Contact
testdata = [
Contact(firstname="name1", lastname="lastname1", middlename="middlename1",
nickname="nickname1", title="title1", company="company1",
address="address1", homephone="homephone1", mobilephone="mobphone1",
workphone="workphone1", fax="f... | 0 | 0 | 0 |
d9220984cf73f571b9944f46ad7558d5aec58bfd | 20,880 | py | Python | ukpsummarizer-be/cplex/python/docplex/docplex/cp/config.py | avineshpvs/vldb2018-sherlock | 5e116f42f44c50bcb289be3c4b4b76e29b238c18 | [
"Apache-2.0"
] | 2 | 2019-01-13T08:41:00.000Z | 2021-03-27T22:55:10.000Z | ukpsummarizer-be/cplex/python/docplex/docplex/cp/config.py | AIPHES/vldb2018-sherlock | 3746efa35c4c1769cc4aaeb15aeb9453564e1226 | [
"Apache-2.0"
] | null | null | null | ukpsummarizer-be/cplex/python/docplex/docplex/cp/config.py | AIPHES/vldb2018-sherlock | 3746efa35c4c1769cc4aaeb15aeb9453564e1226 | [
"Apache-2.0"
] | 4 | 2018-11-06T16:12:55.000Z | 2019-08-21T13:22:32.000Z | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
Configurati... | 39.028037 | 143 | 0.669109 | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
Configurati... | 92 | 0 | 25 |
e530990e462d48de1908284febfb999d17ad76c7 | 9,123 | py | Python | ServiceManager/db_func.py | ISISNeutronMuon/HLM_PV_Import | f20355d847078c42e16240abc8782776eb768da5 | [
"BSD-3-Clause"
] | null | null | null | ServiceManager/db_func.py | ISISNeutronMuon/HLM_PV_Import | f20355d847078c42e16240abc8782776eb768da5 | [
"BSD-3-Clause"
] | 17 | 2021-01-04T13:59:34.000Z | 2022-02-02T13:04:14.000Z | ServiceManager/db_func.py | ISISNeutronMuon/HLM_PV_Import | f20355d847078c42e16240abc8782776eb768da5 | [
"BSD-3-Clause"
] | null | null | null | from peewee import DoesNotExist
from datetime import datetime
from ServiceManager.utilities import generate_module_name
from shared.const import DBTypeIDs, DBClassIDs
from shared.utils import need_connection
from shared.db_models import *
from ServiceManager.logger import manager_logger as logger
@need_connection
... | 28.961905 | 114 | 0.679711 | from peewee import DoesNotExist
from datetime import datetime
from ServiceManager.utilities import generate_module_name
from shared.const import DBTypeIDs, DBClassIDs
from shared.utils import need_connection
from shared.db_models import *
from ServiceManager.logger import manager_logger as logger
def db_connect():
... | 1,216 | 36 | 166 |
fe805a61b2b33eac84f19857fd056154b9478764 | 2,175 | py | Python | pysol_cards/random_base.py | thesamesam/pysol_cards | 55aeb94601a9f652b0e6001bf8c24179f5eccd27 | [
"MIT"
] | 4 | 2019-06-20T17:00:46.000Z | 2021-09-01T22:34:37.000Z | pysol_cards/random_base.py | thesamesam/pysol_cards | 55aeb94601a9f652b0e6001bf8c24179f5eccd27 | [
"MIT"
] | 4 | 2020-03-08T07:09:51.000Z | 2021-11-25T07:09:25.000Z | pysol_cards/random_base.py | thesamesam/pysol_cards | 55aeb94601a9f652b0e6001bf8c24179f5eccd27 | [
"MIT"
] | 1 | 2021-08-05T20:11:42.000Z | 2021-08-05T20:11:42.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Shlomi Fish <shlomif@cpan.org>
#
# Distributed under terms of the MIT license.
from pysol_cards.errors import SubclassResponsibility
| 24.715909 | 76 | 0.584368 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Shlomi Fish <shlomif@cpan.org>
#
# Distributed under terms of the MIT license.
from pysol_cards.errors import SubclassResponsibility
class RandomBase(object):
DEALS_PYSOL = 0
DEALS_PYSOLFC = 1
DEALS_MS = 2
MAX_SEED ... | 724 | 1,208 | 23 |
49b12c74814b733e89f12d59c80b0437328d4604 | 2,767 | py | Python | conceptnet5/builders/morphology.py | CollectiWise/conceptnet | 2998df5a9d287ca72032abb1d9b082747ba97c08 | [
"Apache-2.0"
] | 1 | 2018-11-27T17:00:57.000Z | 2018-11-27T17:00:57.000Z | conceptnet5/builders/morphology.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | null | null | null | conceptnet5/builders/morphology.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from conceptnet5.edges import make_edge
from conceptnet5.formats.msgpack_stream import MsgpackStreamWriter
from conceptnet5.languages import ATOMIC_SPACE_LANGUAGES
from conceptnet5.nodes import split_uri
from conceptnet5.uri import get_uri_language, join_uri, Licenses
def prepare_... | 38.430556 | 79 | 0.648356 | from collections import defaultdict
from conceptnet5.edges import make_edge
from conceptnet5.formats.msgpack_stream import MsgpackStreamWriter
from conceptnet5.languages import ATOMIC_SPACE_LANGUAGES
from conceptnet5.nodes import split_uri
from conceptnet5.uri import get_uri_language, join_uri, Licenses
def prepare_... | 0 | 0 | 0 |
94f484cca39d83c812666097b2a837e523ddf6b0 | 1,324 | py | Python | src/timeset/month.py | eeriksp/timeset | 7ac68a3e619057571c77680fe9e12f56fe77f641 | [
"MIT"
] | 1 | 2021-06-06T20:17:23.000Z | 2021-06-06T20:17:23.000Z | src/timeset/month.py | eeriksp/timeset | 7ac68a3e619057571c77680fe9e12f56fe77f641 | [
"MIT"
] | null | null | null | src/timeset/month.py | eeriksp/timeset | 7ac68a3e619057571c77680fe9e12f56fe77f641 | [
"MIT"
] | null | null | null | from __future__ import annotations
from calendar import monthrange
from datetime import timedelta, date
from .timerange import TimeRange
from .date_range import daterange
class CalendarMonth(TimeRange):
"""
Represent a calendar month.
"""
@property
def next(self) -> CalendarMonth:
"""Re... | 33.1 | 101 | 0.695619 | from __future__ import annotations
from calendar import monthrange
from datetime import timedelta, date
from .timerange import TimeRange
from .date_range import daterange
class CalendarMonth(TimeRange):
"""
Represent a calendar month.
"""
def __init__(self, year: int, month: int):
date_rang... | 435 | 0 | 80 |
46a2f6aa0d4a527286f097b05049619ed6808a58 | 1,008 | py | Python | no_covers/migrations/0001_initial.py | qiwiGremL1n/blog | 2ed534c0c62d91603f39da6b1c7e421b1cbf4047 | [
"MIT"
] | null | null | null | no_covers/migrations/0001_initial.py | qiwiGremL1n/blog | 2ed534c0c62d91603f39da6b1c7e421b1cbf4047 | [
"MIT"
] | null | null | null | no_covers/migrations/0001_initial.py | qiwiGremL1n/blog | 2ed534c0c62d91603f39da6b1c7e421b1cbf4047 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-06 22:35
from django.db import migrations, models
import markupfield.fields
| 36 | 149 | 0.595238 | # Generated by Django 2.0.2 on 2018-02-06 22:35
from django.db import migrations, models
import markupfield.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
(... | 0 | 868 | 23 |
baab3036b38177c9996cbcb4a9f5047bed5ed26e | 94 | py | Python | Custom middleware for user to autometically logout after xx.xx.xx time/BlogSite/blogPosts/admin.py | AyemunHossain/Django | 0b1ed21fd6bd2906a4a1a220c029a2193658320f | [
"MIT"
] | 2 | 2020-02-14T19:23:50.000Z | 2020-04-19T08:26:38.000Z | Custom middleware for user to autometically logout after xx.xx.xx time/BlogSite/blogPosts/admin.py | AyemunHossain/Django | 0b1ed21fd6bd2906a4a1a220c029a2193658320f | [
"MIT"
] | 42 | 2021-02-02T23:08:30.000Z | 2022-03-12T00:54:55.000Z | Project _ 2 -- BlogSite/blogPosts/admin.py | AyemunHossain/Django | 0b1ed21fd6bd2906a4a1a220c029a2193658320f | [
"MIT"
] | 1 | 2022-03-07T08:09:41.000Z | 2022-03-07T08:09:41.000Z | from django.contrib import admin
from .models import blogPost
admin.site.register(blogPost) | 15.666667 | 32 | 0.819149 | from django.contrib import admin
from .models import blogPost
admin.site.register(blogPost) | 0 | 0 | 0 |
0774a8fc8155745e2ffce489ba770491adbcd7b9 | 68 | py | Python | resources/colours.py | PyBot-Development/PyBot-v4 | 7fb821940bf43ded7d6996342b83afda4174d36e | [
"MIT"
] | null | null | null | resources/colours.py | PyBot-Development/PyBot-v4 | 7fb821940bf43ded7d6996342b83afda4174d36e | [
"MIT"
] | null | null | null | resources/colours.py | PyBot-Development/PyBot-v4 | 7fb821940bf43ded7d6996342b83afda4174d36e | [
"MIT"
] | null | null | null | red = 0xff3d3d
green = 0xb8ff3d
blue = 0x2e66ff
yellow = 0xfff94d | 17 | 17 | 0.735294 | red = 0xff3d3d
green = 0xb8ff3d
blue = 0x2e66ff
yellow = 0xfff94d | 0 | 0 | 0 |
07944afff49fa24e07a81620b7148f2200f931cc | 10,403 | py | Python | pyscf/sgx/sgx.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 1 | 2021-11-12T11:55:25.000Z | 2021-11-12T11:55:25.000Z | pyscf/sgx/sgx.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/sgx/sgx.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | #!/usr/bin/env python
# Copyright 2018-2020 The PySCF Developers. 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
#
# U... | 33.775974 | 89 | 0.604249 | #!/usr/bin/env python
# Copyright 2018-2020 The PySCF Developers. 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
#
# U... | 5,307 | 1,175 | 288 |
d9fe37ca4723be9704a492674ba8604c492b90eb | 9,975 | py | Python | gobbli/model/base.py | RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | [
"Apache-2.0"
] | 276 | 2019-09-13T08:25:51.000Z | 2022-03-05T13:07:55.000Z | gobbli/model/base.py | RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | [
"Apache-2.0"
] | 15 | 2019-09-06T14:05:30.000Z | 2022-01-01T20:15:06.000Z | gobbli/model/base.py | RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | [
"Apache-2.0"
] | 24 | 2019-09-18T15:11:42.000Z | 2021-12-23T18:59:55.000Z | import logging
import warnings
from abc import ABC, abstractmethod
from pathlib import Path
from timeit import default_timer as timer
from typing import Any, Dict, Optional
import docker
from gobbli.model.context import ContainerTaskContext
from gobbli.util import (
format_duration,
generate_uuid,
gobbli_... | 34.756098 | 105 | 0.602907 | import logging
import warnings
from abc import ABC, abstractmethod
from pathlib import Path
from timeit import default_timer as timer
from typing import Any, Dict, Optional
import docker
from gobbli.model.context import ContainerTaskContext
from gobbli.util import (
format_duration,
generate_uuid,
gobbli_... | 0 | 0 | 0 |
144efd6cd4ac37aabce925e18b3a0cdbb19184cd | 30 | py | Python | tomorrow/__init__.py | madisonmay/Tomorrow | 34e0bf422e5f81fd60872367c4fdf2b89d26ec14 | [
"MIT"
] | 1,679 | 2015-08-02T16:20:05.000Z | 2022-03-19T15:39:30.000Z | tomorrow/__init__.py | hugoren/Tomorrow | 9d397c3f4dc7df3fd1e0c66ed912935e69c08ea5 | [
"MIT"
] | 24 | 2015-08-02T15:53:31.000Z | 2020-02-18T18:01:44.000Z | tomorrow/__init__.py | hugoren/Tomorrow | 9d397c3f4dc7df3fd1e0c66ed912935e69c08ea5 | [
"MIT"
] | 141 | 2015-08-02T19:39:23.000Z | 2021-07-28T03:33:51.000Z | from .tomorrow import threads
| 15 | 29 | 0.833333 | from .tomorrow import threads
| 0 | 0 | 0 |
4bfd526d716c81fc787d1b1f9508eebc364bffcb | 2,631 | py | Python | aws_gate/list.py | gnought/aws-gate | 20728e0926e6eb36b5f6a6c8ed91b21c010674c8 | [
"BSD-3-Clause"
] | null | null | null | aws_gate/list.py | gnought/aws-gate | 20728e0926e6eb36b5f6a6c8ed91b21c010674c8 | [
"BSD-3-Clause"
] | null | null | null | aws_gate/list.py | gnought/aws-gate | 20728e0926e6eb36b5f6a6c8ed91b21c010674c8 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
import csv
import io
import itertools
import json
from aws_gate.constants import (
AWS_DEFAULT_PROFILE,
AWS_DEFAULT_REGION,
DEFAULT_LIST_OUTPUT_FIELDS,
DEFAULT_LIST_HUMAN_FIELDS,
DEFAULT_LIST_OUTPUT,
)
from aws_gate.query import get_multiple_instance_details
from aws_gate.... | 30.952941 | 118 | 0.733561 | # -*- encoding: utf-8 -*-
import csv
import io
import itertools
import json
from aws_gate.constants import (
AWS_DEFAULT_PROFILE,
AWS_DEFAULT_REGION,
DEFAULT_LIST_OUTPUT_FIELDS,
DEFAULT_LIST_HUMAN_FIELDS,
DEFAULT_LIST_OUTPUT,
)
from aws_gate.query import get_multiple_instance_details
from aws_gate.... | 2,074 | 0 | 137 |
c5d1832646589e3f5dff30fb1dbb0792478ae215 | 3,630 | py | Python | network_test/network_test/suites/node.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 12 | 2021-04-06T06:27:18.000Z | 2022-03-18T10:52:29.000Z | network_test/network_test/suites/node.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 6 | 2022-01-04T13:32:16.000Z | 2022-03-28T21:13:59.000Z | network_test/network_test/suites/node.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 7 | 2021-09-27T13:14:42.000Z | 2022-03-28T16:24:15.000Z | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import logging
import random
from typing import Any, Dict, List, Set
from terragraph_thrift.Controller.ttypes import IperfTransportProtocol
from terragraph_thrift.Topology.ttypes import NodeStatusType
from tglib.clients import APIServiceCl... | 38.617021 | 87 | 0.599449 | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import logging
import random
from typing import Any, Dict, List, Set
from terragraph_thrift.Controller.ttypes import IperfTransportProtocol
from terragraph_thrift.Topology.ttypes import NodeStatusType
from tglib.clients import APIServiceCl... | 593 | 2,542 | 23 |
31490150ab82b1e45f821526838a643a9c49233f | 1,449 | py | Python | Medium/228_2.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 6 | 2017-09-25T18:05:50.000Z | 2019-03-27T00:23:15.000Z | Medium/228_2.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 1 | 2017-10-29T12:04:41.000Z | 2018-08-16T18:00:37.000Z | Medium/228_2.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | null | null | null | # ------------------------------
# 228. Summary Ranges
#
# Description:
#
# Version: 2.0
# 09/25/18 by Jianfa
# ------------------------------
# Used for testing
if __name__ == "__main__":
test = Solution()
# ------------------------------
# Summary:
# | 28.98 | 107 | 0.461698 | # ------------------------------
# 228. Summary Ranges
#
# Description:
#
# Version: 2.0
# 09/25/18 by Jianfa
# ------------------------------
class Solution(object):
def summaryRanges(self, nums):
"""
:type nums: List[int]
:rtype: List[str]
The idea is use two pointers: ... | 0 | 1,147 | 23 |