hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41fbbf014ccbedcb01ef08ab0992e617077687a6 | 19,512 | py | Python | picasso/gaussmle.py | UlrikeBoehm/picasso | 3994267f14cbd85bd962ce1d61f1d9487a8501f9 | [
"MIT"
] | 1 | 2018-10-24T20:35:05.000Z | 2018-10-24T20:35:05.000Z | picasso/gaussmle.py | UlrikeBoehm/picasso | 3994267f14cbd85bd962ce1d61f1d9487a8501f9 | [
"MIT"
] | null | null | null | picasso/gaussmle.py | UlrikeBoehm/picasso | 3994267f14cbd85bd962ce1d61f1d9487a8501f9 | [
"MIT"
] | 1 | 2018-11-10T13:01:03.000Z | 2018-11-10T13:01:03.000Z | """
picasso/gaussmle
~~~~~~~~~~~~~~~~
Maximum likelihood fits for single particle localization
:author: Joerg Schnitzbauer, 2016
:copyright: Copyright (c) 2016 Jungmann Lab, Max Planck Institute of Biochemistry
"""
import numpy as _np
import numba as _numba
import math as _math
import multiprocess... | 38.561265 | 217 | 0.552019 |
93478de8ca82a0da1355c4f4514b0d3fb584a47f | 155 | py | Python | tests/specs/__init__.py | ChristopherJHart/pycraigslist | cfff6d0368e3eac74416fbc9caf8984d37b69919 | [
"MIT"
] | null | null | null | tests/specs/__init__.py | ChristopherJHart/pycraigslist | cfff6d0368e3eac74416fbc9caf8984d37b69919 | [
"MIT"
] | null | null | null | tests/specs/__init__.py | ChristopherJHart/pycraigslist | cfff6d0368e3eac74416fbc9caf8984d37b69919 | [
"MIT"
] | null | null | null | """
pycraigslist.tests.specs
~~~~~~~~~~~~~~~~~~~~~~~~
A suite of modules that stores test data and utility methods.
"""
from tests.specs.static import *
| 17.222222 | 61 | 0.632258 |
ea64dc6d2208d1f77f4bca0d7a4b0d31493b1ac5 | 1,687 | py | Python | chatbotmaker/tests/bot_test.py | Dominique57/ChatBotMaker | 4d3d27f2a4f4a221eddac63316ddd7b56ab4b5e5 | [
"MIT"
] | null | null | null | chatbotmaker/tests/bot_test.py | Dominique57/ChatBotMaker | 4d3d27f2a4f4a221eddac63316ddd7b56ab4b5e5 | [
"MIT"
] | null | null | null | chatbotmaker/tests/bot_test.py | Dominique57/ChatBotMaker | 4d3d27f2a4f4a221eddac63316ddd7b56ab4b5e5 | [
"MIT"
] | null | null | null | from ..bot import Bot
from .. import ExtendedUser
from . import Mock, patch
def test_user_handle_create_close_session():
# Given
messenger, dispatcher, database = Mock(), Mock(), Mock()
bot = Bot({}, messenger, dispatcher, database)
# When
bot.user_handle('user_id', 'user_message')
# Then
... | 35.145833 | 79 | 0.721399 |
ab2b1e286f0be8439a38f4a5f410e09790e73292 | 898 | py | Python | transmute_core/framework/request_adapter.py | yunstanford/transmute-core | a8e5dd055f0f3d39327d71dd61bf0ee147f59ebe | [
"MIT"
] | null | null | null | transmute_core/framework/request_adapter.py | yunstanford/transmute-core | a8e5dd055f0f3d39327d71dd61bf0ee147f59ebe | [
"MIT"
] | null | null | null | transmute_core/framework/request_adapter.py | yunstanford/transmute-core | a8e5dd055f0f3d39327d71dd61bf0ee147f59ebe | [
"MIT"
] | null | null | null | class RequestAdapter(object):
"""
RequestAdapters bridge transmute's
representation of a request, with the framework's
implementation.
implement the unimplemented methods.
"""
@property
def body(self):
""" return the request body. """
raise NotImplementedError()
de... | 28.0625 | 71 | 0.662584 |
d4a49d725e1a1d9bbe12197ec085b88852d50299 | 9,321 | py | Python | bugsnag_agent/__init__.py | bix0r/bugsnag-agent | 0350209cc49431e0d92016cd5aa6e07a051f31b9 | [
"MIT"
] | 12 | 2015-05-20T10:13:04.000Z | 2022-01-18T11:01:54.000Z | bugsnag_agent/__init__.py | bix0r/bugsnag-agent | 0350209cc49431e0d92016cd5aa6e07a051f31b9 | [
"MIT"
] | 18 | 2015-05-18T04:21:03.000Z | 2022-03-03T15:53:25.000Z | bugsnag_agent/__init__.py | bix0r/bugsnag-agent | 0350209cc49431e0d92016cd5aa6e07a051f31b9 | [
"MIT"
] | 10 | 2015-04-12T06:26:35.000Z | 2020-04-16T03:01:25.000Z | import sys
import urllib2
from argparse import ArgumentParser
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from ConfigParser import RawConfigParser
from Queue import Queue
from thread import interrupt_main
from threading import Thread
from time import sleep
from traceback import print_exception
import ... | 32.936396 | 90 | 0.521832 |
5f6c2cb40a4b78466ea00e2ab04a5e54d6bd5281 | 13,525 | py | Python | command_line/cosym.py | JBlaschke/dials | 83fbc79864411b67933bd9708bc2d5f7d8f0859b | [
"BSD-3-Clause"
] | null | null | null | command_line/cosym.py | JBlaschke/dials | 83fbc79864411b67933bd9708bc2d5f7d8f0859b | [
"BSD-3-Clause"
] | null | null | null | command_line/cosym.py | JBlaschke/dials | 83fbc79864411b67933bd9708bc2d5f7d8f0859b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import logging
import random
import sys
import iotbx.phil
from cctbx import sgtbx
from xfel.clustering.cluster_groups import unit_cell_info
from dials.algorithms.clustering.unit_cell import UnitCellCluster
from dials.algorithms.symmetry.cosym import Co... | 35.498688 | 86 | 0.664695 |
1970a2d989d45e37a9d28f85c4b1d69adc14f18e | 971 | py | Python | app/migration/versions/8a20f21a30c3_add_item_model.py | nikaera/fastapi-sqlalchemy-alembic-pytest-sample | fe1e7fcb259301753071496a605030f330c8c0e9 | [
"MIT"
] | 1 | 2021-09-18T02:10:10.000Z | 2021-09-18T02:10:10.000Z | app/migration/versions/8a20f21a30c3_add_item_model.py | nikaera/fastapi-sqlalchemy-alembic-pytest-sample | fe1e7fcb259301753071496a605030f330c8c0e9 | [
"MIT"
] | null | null | null | app/migration/versions/8a20f21a30c3_add_item_model.py | nikaera/fastapi-sqlalchemy-alembic-pytest-sample | fe1e7fcb259301753071496a605030f330c8c0e9 | [
"MIT"
] | null | null | null | """Add Item model
Revision ID: 8a20f21a30c3
Revises:
Create Date: 2021-06-25 12:45:15.980332
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy_utils import UUIDType
# revision identifiers, used by Alembic.
revision = '8a20f21a30c3'
down_revision = None
branch_labels = None
depends_on = None
def ... | 26.972222 | 104 | 0.697219 |
43cff3b6244e3abf9831212ad72cbf021e3b228b | 7,846 | py | Python | tests/devices/test_mbed_devices.py | LDong-Arm/mbed-tools | f58033e1d4cfaf8178690d0c61ae2defdba0140d | [
"Apache-2.0"
] | 1 | 2021-03-26T16:37:04.000Z | 2021-03-26T16:37:04.000Z | tests/devices/test_mbed_devices.py | harmut01/mbed-tools | 19e0f34f5db4c7e57367bdbd47031ee9f3044313 | [
"Apache-2.0"
] | null | null | null | tests/devices/test_mbed_devices.py | harmut01/mbed-tools | 19e0f34f5db4c7e57367bdbd47031ee9f3044313 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020-2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
import pathlib
import re
from unittest import TestCase, mock
from mbed_tools.targets import Board
from mbed_tools.targets.exceptions import MbedTargetsError
from tests.devices.factories import Candi... | 40.235897 | 115 | 0.661611 |
d331fa3ea20b266a2d3d3a6fd8358d60f20d104a | 15,015 | py | Python | YorForger/modules/ImageEditor/edit_2.py | Voidxtoxic/kita | b2a3007349727280e149dcca017413d7dc2e7648 | [
"MIT"
] | null | null | null | YorForger/modules/ImageEditor/edit_2.py | Voidxtoxic/kita | b2a3007349727280e149dcca017413d7dc2e7648 | [
"MIT"
] | null | null | null | YorForger/modules/ImageEditor/edit_2.py | Voidxtoxic/kita | b2a3007349727280e149dcca017413d7dc2e7648 | [
"MIT"
] | null | null | null | # By @TroJanzHEX
import os
import shutil
import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageEnhance
async def circle_with_bg(client, message):
try:
userid = str(message.chat.id)
if not os.path.isdir(f"./DOWNLOADS/{userid}"):
os.makedirs(f"./DOWNLOADS/{userid}")
... | 37.5375 | 86 | 0.550117 |
1564e7b572d1c03cde57fbae93067a40f90644be | 17,843 | py | Python | pyiron_atomistics/gpaw/pyiron_ase.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 14 | 2021-01-18T10:03:56.000Z | 2022-03-01T20:59:35.000Z | pyiron_atomistics/gpaw/pyiron_ase.py | pyiron/pyiron_atomistics | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 569 | 2018-04-12T06:37:14.000Z | 2022-03-31T18:06:27.000Z | pyiron_atomistics/gpaw/pyiron_ase.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 6 | 2018-10-23T09:48:48.000Z | 2022-02-13T12:13:00.000Z | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from ase import Atoms
from ase.constraints import dict2constraint
import copy
import importlib
import numpy as np
from p... | 36.119433 | 108 | 0.596873 |
31a8642b18d985227a15dd658a68f6f8d9352007 | 50,779 | py | Python | yt/data_objects/profiles.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 2 | 2021-03-02T18:59:49.000Z | 2021-03-02T18:59:50.000Z | yt/data_objects/profiles.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 4 | 2018-04-13T23:03:42.000Z | 2018-05-08T17:50:43.000Z | yt/data_objects/profiles.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 1 | 2018-01-08T19:20:06.000Z | 2018-01-08T19:20:06.000Z | """
Profile classes, to deal with generating and obtaining profiles
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed ... | 40.688301 | 117 | 0.584119 |
f55c8fdcbc5d92bcae0cd90096b1b72adea0e307 | 14,559 | py | Python | plugins/geospatial/server/geospatial.py | data-exp-lab/girder | 25e5847eaefec75f02c83f8d46aa55dcc59acb01 | [
"Apache-2.0"
] | 1 | 2019-11-14T18:13:26.000Z | 2019-11-14T18:13:26.000Z | plugins/geospatial/server/geospatial.py | data-exp-lab/girder | 25e5847eaefec75f02c83f8d46aa55dcc59acb01 | [
"Apache-2.0"
] | 1 | 2021-11-10T17:00:12.000Z | 2021-11-10T17:00:12.000Z | plugins/geospatial/server/geospatial.py | data-exp-lab/girder | 25e5847eaefec75f02c83f8d46aa55dcc59acb01 | [
"Apache-2.0"
] | 3 | 2018-05-21T19:45:19.000Z | 2019-04-08T19:53:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | 39.455285 | 96 | 0.583144 |
2e9efac19e8a0b8ad4ac3f868ceb8a0eb896ec19 | 89 | py | Python | records/12-14/__init__.py | AaronYang2333/CSCI_570 | 03e34ce5ff192fc94612bc3afb51dcab3e854462 | [
"Apache-2.0"
] | 36 | 2020-07-25T00:13:25.000Z | 2022-02-28T17:48:15.000Z | records/12-14/__init__.py | AaronYang2333/LeetCode | 03e34ce5ff192fc94612bc3afb51dcab3e854462 | [
"Apache-2.0"
] | 6 | 2020-06-06T04:39:37.000Z | 2021-04-03T01:45:39.000Z | records/12-14/__init__.py | AaronYang2333/LeetCode | 03e34ce5ff192fc94612bc3afb51dcab3e854462 | [
"Apache-2.0"
] | 16 | 2020-12-16T02:38:16.000Z | 2022-02-28T17:48:16.000Z | __author__ = 'Aaron Yang'
__email__ = 'byang971@usc.edu'
__date__ = '12/14/2020 10:50 AM' | 29.666667 | 32 | 0.719101 |
af2c4281889b64bf37a652744c0db8171b5e6b8b | 3,226 | py | Python | jina/clients/__init__.py | themreza/jina | a813b15132df422aa9b5c0925cf62e587ad0aa61 | [
"Apache-2.0"
] | 1 | 2022-01-12T03:03:57.000Z | 2022-01-12T03:03:57.000Z | jina/clients/__init__.py | themreza/jina | a813b15132df422aa9b5c0925cf62e587ad0aa61 | [
"Apache-2.0"
] | null | null | null | jina/clients/__init__.py | themreza/jina | a813b15132df422aa9b5c0925cf62e587ad0aa61 | [
"Apache-2.0"
] | null | null | null | """Module wrapping the Client of Jina."""
import argparse
from typing import overload, Optional, Union, TYPE_CHECKING
__all__ = ['Client']
from ..enums import GatewayProtocolType
if TYPE_CHECKING:
from .grpc import GRPCClient, AsyncGRPCClient
from .websocket import WebSocketClient, AsyncWebSocketClient
f... | 30.72381 | 178 | 0.67235 |
a39370b636a6333fc9fa9f21479acc779da86357 | 62,080 | py | Python | domains/cho.py | thaddeuskkr/gulag | 4fa6fb7899838c309319ef9e812ce95960e0ae06 | [
"MIT"
] | null | null | null | domains/cho.py | thaddeuskkr/gulag | 4fa6fb7899838c309319ef9e812ce95960e0ae06 | [
"MIT"
] | null | null | null | domains/cho.py | thaddeuskkr/gulag | 4fa6fb7899838c309319ef9e812ce95960e0ae06 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import asyncio
import ipaddress
import re
import struct
import time
from datetime import date
from datetime import datetime
from datetime import timedelta
from pathlib import Path
from typing import Callable
from typing import Union
import aiomysql
import bcrypt
from cmyui.logging import Ansi
... | 34.091159 | 93 | 0.570425 |
e2115b0532e79c3a412eaca3018e8b49164b6980 | 1,176 | py | Python | Tools/SystemDebug/python/tca.py | tomlenth/oneAPI-samples | 67df7461a8484a6b928f41158e9b7f9c38eef7bd | [
"MIT"
] | 1 | 2020-12-07T22:50:13.000Z | 2020-12-07T22:50:13.000Z | Tools/SystemDebug/python/tca.py | tomlenth/oneAPI-samples | 67df7461a8484a6b928f41158e9b7f9c38eef7bd | [
"MIT"
] | 1 | 2020-08-24T19:09:28.000Z | 2020-08-24T19:09:28.000Z | Tools/SystemDebug/python/tca.py | tomlenth/oneAPI-samples | 67df7461a8484a6b928f41158e9b7f9c38eef7bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
==============================================================
Copyright © 2019 Intel Corporation
SPDX-License-Identifier: MIT
==============================================================
'''
import intel.tca as tca
target = tca.get_target(id="whl_u_cnp_lp")
components = [(c.component,... | 30.153846 | 71 | 0.684524 |
f35aa697b194d7fc0645a5c830b1bab937ce7aa9 | 981 | py | Python | plugins/packages/api.py | ajenti/ajen | 177c1a67278a7763ed06eb2f773d7b409a85ec77 | [
"MIT"
] | 3,777 | 2015-02-21T00:10:12.000Z | 2022-03-30T15:33:22.000Z | plugins/packages/api.py | ajenti/ajen | 177c1a67278a7763ed06eb2f773d7b409a85ec77 | [
"MIT"
] | 749 | 2015-03-12T14:17:03.000Z | 2022-03-25T13:22:28.000Z | plugins/packages/api.py | ajenti/ajen | 177c1a67278a7763ed06eb2f773d7b409a85ec77 | [
"MIT"
] | 687 | 2015-03-21T10:42:33.000Z | 2022-03-21T23:18:12.000Z | from jadi import interface
class Package():
"""
Basic container class for package informations.
"""
def __init__(self, manager):
self.manager = manager
self.id = None
self.name = None
self.version = None
self.description = None
self.released = None
... | 21.326087 | 68 | 0.640163 |
56df5be842a8715db31cc6fb8b3c9865efa2b4b3 | 180 | py | Python | tests/conftest.py | fotoknox/fotoknox | 1c262db0aa0b9f6f532a8ca69b230ac05d275206 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | fotoknox/fotoknox | 1c262db0aa0b9f6f532a8ca69b230ac05d275206 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | fotoknox/fotoknox | 1c262db0aa0b9f6f532a8ca69b230ac05d275206 | [
"Apache-2.0"
] | null | null | null | import pytest
from app import create_app
@pytest.fixture
def app():
app = create_app('testing')
yield app
@pytest.fixture
def client(app):
return app.test_client
| 11.25 | 31 | 0.705556 |
432e501c148fcb7585c9a83f7b22854b3cc1114f | 1,045 | py | Python | app23.py | pacpac1992/pyqt4_examples | 91e58594b58c687036f20c0c41a7379f228a9547 | [
"MIT"
] | null | null | null | app23.py | pacpac1992/pyqt4_examples | 91e58594b58c687036f20c0c41a7379f228a9547 | [
"MIT"
] | null | null | null | app23.py | pacpac1992/pyqt4_examples | 91e58594b58c687036f20c0c41a7379f228a9547 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
ZetCode PyQt4 tutorial
In this example, a QtGui.QCheckBox widget
is used to toggle the title of a window.
author: Jan Bodnar
website: zetcode.com
last edited: September 2011
"""
import sys
from PyQt4 import QtGui, QtCore
class Example(QtGui.QWidget):
def __i... | 20.490196 | 50 | 0.585646 |
a65ff3cdf9f30d71532a207f0369bb6d49b7c9a7 | 6,928 | py | Python | tests/unit/bokeh/core/property/test_color__property.py | RiccardoGiro/bokeh | 7e1bfeea4f3d7a6296aabfeec96e79e1f5a28467 | [
"BSD-3-Clause"
] | 1 | 2020-02-07T16:57:56.000Z | 2020-02-07T16:57:56.000Z | tests/unit/bokeh/core/property/test_color__property.py | Deng-Fankang/bokeh | 894731860c53b7c9ddd0057dee85cf064278dc0e | [
"BSD-3-Clause"
] | 12 | 2020-08-26T20:19:29.000Z | 2020-08-26T20:19:52.000Z | tests/unit/bokeh/core/property/test_color__property.py | Deng-Fankang/bokeh | 894731860c53b7c9ddd0057dee85cf064278dc0e | [
"BSD-3-Clause"
] | 1 | 2020-03-06T07:38:50.000Z | 2020-03-06T07:38:50.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 34.467662 | 78 | 0.48903 |
1b68fe72efd706e4520ad076d95f43dc37b91175 | 1,442 | py | Python | py/selenium/webdriver/common/actions/interaction.py | TamsilAmani/selenium | 65b7a240185e1de4bc7693c69cd60cca11c3903a | [
"Apache-2.0"
] | null | null | null | py/selenium/webdriver/common/actions/interaction.py | TamsilAmani/selenium | 65b7a240185e1de4bc7693c69cd60cca11c3903a | [
"Apache-2.0"
] | null | null | null | py/selenium/webdriver/common/actions/interaction.py | TamsilAmani/selenium | 65b7a240185e1de4bc7693c69cd60cca11c3903a | [
"Apache-2.0"
] | null | null | null | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 27.730769 | 64 | 0.704577 |
a4ffa5a3c0e794e26ca08f24791deccad8f4f48e | 9,427 | py | Python | wobbles/sampling/rejectionABC.py | dangilman/wobbles | 6719bfaabbbe475e4213fd5272375e381083c0b9 | [
"BSD-3-Clause"
] | null | null | null | wobbles/sampling/rejectionABC.py | dangilman/wobbles | 6719bfaabbbe475e4213fd5272375e381083c0b9 | [
"BSD-3-Clause"
] | 2 | 2020-10-30T06:40:54.000Z | 2020-11-19T00:15:41.000Z | wobbles/sampling/rejectionABC.py | dangilman/wobbles | 6719bfaabbbe475e4213fd5272375e381083c0b9 | [
"BSD-3-Clause"
] | 1 | 2020-09-14T15:03:52.000Z | 2020-09-14T15:03:52.000Z | from wobbles.workflow.forward_model import single_iteration
from wobbles.sampling.data import Data
import numpy as np
from time import time
class SimulationContainer(object):
def __init__(self, z_domain, simulated_asymmetry, simulated_mean_vz, simulated_params):
self.simulated_asymmetry = simulated_asymm... | 38.012097 | 114 | 0.561472 |
3ce67064d91de84a79e257398219fa713a6909d0 | 10,528 | py | Python | submarines_client/messages.py | orbarkai/submarines | 6b41415116bb23021ec8cf5bb20e696f0db06186 | [
"MIT"
] | null | null | null | submarines_client/messages.py | orbarkai/submarines | 6b41415116bb23021ec8cf5bb20e696f0db06186 | [
"MIT"
] | null | null | null | submarines_client/messages.py | orbarkai/submarines | 6b41415116bb23021ec8cf5bb20e696f0db06186 | [
"MIT"
] | null | null | null | """
This module has all the protocol's message types
"""
from abc import ABCMeta, abstractmethod
import enum
import struct
from submarines_client import exceptions
from submarines_client.constants import Protocol
@enum.unique
class SubmarineMessageType(enum.IntEnum):
GAME_REQUEST = 0
GAME_REPLY = 1
ORDE... | 25.368675 | 103 | 0.642097 |
b65124701db6b3efcb03bb4ca50ef02da94a4310 | 2,585 | py | Python | server/app/messaging/base.py | SlawekKalandyk/OnionMessenger | af448b74d0d20d5c4007c1eb856f84747e4e9eb7 | [
"BSD-3-Clause"
] | null | null | null | server/app/messaging/base.py | SlawekKalandyk/OnionMessenger | af448b74d0d20d5c4007c1eb856f84747e4e9eb7 | [
"BSD-3-Clause"
] | 12 | 2020-12-20T23:32:18.000Z | 2021-04-18T16:50:20.000Z | server/app/messaging/base.py | SlawekKalandyk/OnionMessenger | af448b74d0d20d5c4007c1eb856f84747e4e9eb7 | [
"BSD-3-Clause"
] | null | null | null | from app.networking.topology import Agent, Topology
from app.networking.base import ConnectionSettings
from dataclasses import dataclass, InitVar, field
from dataclasses_json import dataclass_json
from abc import ABC, abstractmethod
from typing import Dict, Tuple
from re import search
@dataclass(frozen=False)
class C... | 29.712644 | 70 | 0.653772 |
e83571ef6398774233cb399f964cb6ab24d4e9b2 | 499 | py | Python | stdlib/smtplib/mailtrap_simple.py | janbodnar/Python-Course | 51705ab5a2adef52bcdb99a800e94c0d67144a38 | [
"BSD-2-Clause"
] | 13 | 2017-08-22T12:26:07.000Z | 2021-07-29T16:13:50.000Z | stdlib/smtplib/mailtrap_simple.py | janbodnar/Python-Course | 51705ab5a2adef52bcdb99a800e94c0d67144a38 | [
"BSD-2-Clause"
] | 1 | 2021-02-08T10:24:33.000Z | 2021-02-08T10:24:33.000Z | stdlib/smtplib/mailtrap_simple.py | janbodnar/Python-Course | 51705ab5a2adef52bcdb99a800e94c0d67144a38 | [
"BSD-2-Clause"
] | 17 | 2018-08-13T11:10:33.000Z | 2021-07-29T16:14:02.000Z | #!/usr/bin/python
import smtplib
from email.mime.text import MIMEText
sender = 'admin@example.com'
receiver = 'info@example.com'
msg = MIMEText('Another test mail 2')
msg['Subject'] = 'Test mail'
msg['From'] = 'admin@example.com'
msg['To'] = 'info@example.com'
user = 'fe0e78fa439420'
password = 'b6bae53adb325b'
w... | 21.695652 | 54 | 0.709419 |
c29cbc5db01ce3285fa5c42eb4270c4dc7185c81 | 2,503 | py | Python | triplet_loss_test.py | TY0Jin/Speaker-Recognition | 52bad5f3faec0e576210f68f3afe5a587296f020 | [
"Apache-2.0"
] | 1 | 2021-03-05T13:33:54.000Z | 2021-03-05T13:33:54.000Z | triplet_loss_test.py | TY0Jin/Speaker-Recognition | 52bad5f3faec0e576210f68f3afe5a587296f020 | [
"Apache-2.0"
] | null | null | null | triplet_loss_test.py | TY0Jin/Speaker-Recognition | 52bad5f3faec0e576210f68f3afe5a587296f020 | [
"Apache-2.0"
] | 1 | 2021-03-05T13:33:57.000Z | 2021-03-05T13:33:57.000Z | import keras.backend as K
import numpy as np
import tensorflow as tf
from ds_constants import *
from triplet_loss import deep_speaker_loss
def opposite_positive_equal_negative_batch():
# should be the highest
b = np.random.uniform(low=-1, high=1, size=(BATCH_NUM_TRIPLETS * 3, 512))
b[0] = -b[6]
b[1] ... | 26.913978 | 102 | 0.578106 |
746ad552356bd29a607d798241e7a25d8b80c570 | 6,903 | py | Python | jax/fp_cast.py | phoenix-meadowlark/aqt | 74fa7c71c6761ed03d2251bbf551ed667619c4ac | [
"Apache-2.0"
] | null | null | null | jax/fp_cast.py | phoenix-meadowlark/aqt | 74fa7c71c6761ed03d2251bbf551ed667619c4ac | [
"Apache-2.0"
] | null | null | null | jax/fp_cast.py | phoenix-meadowlark/aqt | 74fa7c71c6761ed03d2251bbf551ed667619c4ac | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.672414 | 80 | 0.734463 |
d235ca79fce13d8ed9ad798d712ffc1db1aeebec | 12,385 | py | Python | stressor/plugins/base.py | mar10/stressor | 21ece6f74a8110c530980597b4f2d66e76298f16 | [
"MIT"
] | 7 | 2020-03-07T21:57:09.000Z | 2021-11-18T11:41:39.000Z | stressor/plugins/base.py | mar10/stressor | 21ece6f74a8110c530980597b4f2d66e76298f16 | [
"MIT"
] | 9 | 2020-03-24T18:13:46.000Z | 2021-04-01T16:33:20.000Z | stressor/plugins/base.py | mar10/stressor | 21ece6f74a8110c530980597b4f2d66e76298f16 | [
"MIT"
] | 3 | 2020-11-03T11:53:07.000Z | 2022-03-14T17:13:04.000Z | # -*- coding: utf-8 -*-
# (c) 2020-2021 Martin Wendt and contributors; see https://github.com/mar10/stressor
# Licensed under the MIT license: https://www.opensource.org/licenses/mit-license.php
"""
"""
import re
from abc import ABC, abstractmethod
from stressor.util import StressorError, assert_always, check_arg, par... | 35.58908 | 88 | 0.620428 |
42a18cf7fb666ad7f0533a40e63e073b12eb7d45 | 8,548 | py | Python | spider/spiders/game_3dmgame_spider.py | sppsun/spider | b5fb7fbd16df3960a5e12204db2ef1644fb3e882 | [
"MIT"
] | 1 | 2020-01-10T19:24:48.000Z | 2020-01-10T19:24:48.000Z | spider/spiders/game_3dmgame_spider.py | sunnypandas/spider | b5fb7fbd16df3960a5e12204db2ef1644fb3e882 | [
"MIT"
] | 1 | 2019-05-29T06:30:09.000Z | 2019-05-29T06:30:09.000Z | spider/spiders/game_3dmgame_spider.py | sppsun/spider | b5fb7fbd16df3960a5e12204db2ef1644fb3e882 | [
"MIT"
] | 3 | 2019-12-20T06:20:26.000Z | 2020-03-01T18:41:23.000Z | # -*- coding: utf-8 -*-
import datetime
import urllib
from math import ceil
import scrapy
from scrapy import Selector
from spider.consts import DOWNLOADER_MIDDLEWARES_HTTP_PROXY_OFF, MYSQL_ITEM_PIPELINES
from spider.items import SpiderLoaderItem, GameGeimuItem, GameDownloadItem
class DmGame3(scrapy.Spider):
nam... | 58.951724 | 266 | 0.628685 |
7cb8e5769412a249c3efe1e1c3fb4771b052232c | 2,095 | py | Python | netcheck.py | youuy/synology-dsm-tools | 626c239024a0a41f18e4f803e66f24b854095ef0 | [
"MIT"
] | null | null | null | netcheck.py | youuy/synology-dsm-tools | 626c239024a0a41f18e4f803e66f24b854095ef0 | [
"MIT"
] | null | null | null | netcheck.py | youuy/synology-dsm-tools | 626c239024a0a41f18e4f803e66f24b854095ef0 | [
"MIT"
] | null | null | null | import logging
import os
import time
import requests
logging.basicConfig(format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s',
filename=os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + os.path.sep + "."),
... | 33.790323 | 105 | 0.544153 |
8f4344492fe3a53f2703387bc6ae3c80b1a9a72e | 373 | py | Python | App/mod_auth/controllers.py | SharifulAlamSourav/BlogApp | 1f6c8f5ebdf474eda0a10252b41611fd3a327a9d | [
"MIT"
] | null | null | null | App/mod_auth/controllers.py | SharifulAlamSourav/BlogApp | 1f6c8f5ebdf474eda0a10252b41611fd3a327a9d | [
"MIT"
] | null | null | null | App/mod_auth/controllers.py | SharifulAlamSourav/BlogApp | 1f6c8f5ebdf474eda0a10252b41611fd3a327a9d | [
"MIT"
] | null | null | null | from flask import Blueprint, request, render_template,flash, g, session, redirect, url_for
# Define the blueprint: 'auth', set its url prefix: app.url/auth
mod_auth = Blueprint('auth', __name__, url_prefix='/auth')
# Set the route and accepted methods
@mod_auth.route('/signin/')
def signin():
#return "From contro... | 33.909091 | 90 | 0.739946 |
42242db2eba95e67a7efc813564f59ac856328ce | 3,470 | py | Python | Django_Basico/django1/settings.py | RafaelAparecidoSilva/DJANGO_FRAMEWORK | 24119599f4550f94b69333ce14c8179f1b9f194b | [
"MIT"
] | null | null | null | Django_Basico/django1/settings.py | RafaelAparecidoSilva/DJANGO_FRAMEWORK | 24119599f4550f94b69333ce14c8179f1b9f194b | [
"MIT"
] | null | null | null | Django_Basico/django1/settings.py | RafaelAparecidoSilva/DJANGO_FRAMEWORK | 24119599f4550f94b69333ce14c8179f1b9f194b | [
"MIT"
] | null | null | null | """
Django settings for django1 project.
Generated by 'django-admin startproject' using Django 3.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib... | 27.539683 | 101 | 0.703458 |
432e49b321d5708c79e8508994cb2fb0d63c3079 | 5,982 | py | Python | src/prefect/environments/execution/base.py | concreted/prefect | dd732f5990ee2b0f3d816adb285168fd63b239e4 | [
"Apache-2.0"
] | 8,633 | 2019-03-23T17:51:03.000Z | 2022-03-31T22:17:42.000Z | src/prefect/environments/execution/base.py | concreted/prefect | dd732f5990ee2b0f3d816adb285168fd63b239e4 | [
"Apache-2.0"
] | 3,903 | 2019-03-23T19:11:21.000Z | 2022-03-31T23:21:23.000Z | src/prefect/environments/execution/base.py | ngriffiths13/prefect | 7f5613abcb182494b7dc12159277c3bc5f3c9898 | [
"Apache-2.0"
] | 937 | 2019-03-23T18:49:44.000Z | 2022-03-31T21:45:13.000Z | """
Environments are JSON-serializable objects that fully describe how to run a flow. Serialization
schemas are contained in `prefect.serialization.environment.py`.
Different Environment objects correspond to different computation environments. Environments
that are written on top of a type of infrastructure also defi... | 33.79661 | 101 | 0.640756 |
e39265d4f87eebb9fe03544bdb02f5c439e9fe01 | 90,133 | py | Python | tensorflow_model_analysis/metrics/confusion_matrix_metrics.py | rtg0795/model-analysis | 0f73989a2dfe1e56548f1ccd0001d98846f89e05 | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/metrics/confusion_matrix_metrics.py | rtg0795/model-analysis | 0f73989a2dfe1e56548f1ccd0001d98846f89e05 | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/metrics/confusion_matrix_metrics.py | rtg0795/model-analysis | 0f73989a2dfe1e56548f1ccd0001d98846f89e05 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.688683 | 80 | 0.674315 |
bd5a9649a306c090064abc45c9b78f10f4b3c01a | 1,722 | py | Python | Algorithms/binarySearch.py | BirendraRokaha/Learn2020 | 5da92b1947a266f009f9cd371dd6a03610b95c9b | [
"MIT"
] | null | null | null | Algorithms/binarySearch.py | BirendraRokaha/Learn2020 | 5da92b1947a266f009f9cd371dd6a03610b95c9b | [
"MIT"
] | 11 | 2021-04-08T19:55:39.000Z | 2022-03-02T09:51:03.000Z | Algorithms/binarySearch.py | BirendraRokaha/Learn2020 | 5da92b1947a266f009f9cd371dd6a03610b95c9b | [
"MIT"
] | null | null | null | # Implement Binary search in Python
arr = [2,4,6,8,9,10,13,16,18,19,20,30,38,41,43,45,47,48,55,58]
target = 48
# linear search is not the most optimal method for searching through a list as it has to move through all the elements in the list.
def linear_search(arr , target):
for i in arr:
if i == targ... | 26.90625 | 131 | 0.639954 |
ff26cb482e0b2b98b37c7a75d4128515d7f1cf8c | 62 | py | Python | venv/wsgi.py | SoftEngTeam1/SoftEng | b25f95c3de0b302aaf35f024332308673cf8acb1 | [
"MIT"
] | null | null | null | venv/wsgi.py | SoftEngTeam1/SoftEng | b25f95c3de0b302aaf35f024332308673cf8acb1 | [
"MIT"
] | null | null | null | venv/wsgi.py | SoftEngTeam1/SoftEng | b25f95c3de0b302aaf35f024332308673cf8acb1 | [
"MIT"
] | null | null | null | from app.app import app
if __name__ == "__main__":
app.run() | 20.666667 | 26 | 0.693548 |
4fbd01d8f9a720253ea74c7b4e089b8257d087fb | 1,529 | py | Python | zeus/controller/BusinessController.py | flyliufu/PythonDemo | 9f31998a53e94b4036c6e96d80748945845b82b6 | [
"Apache-2.0"
] | null | null | null | zeus/controller/BusinessController.py | flyliufu/PythonDemo | 9f31998a53e94b4036c6e96d80748945845b82b6 | [
"Apache-2.0"
] | null | null | null | zeus/controller/BusinessController.py | flyliufu/PythonDemo | 9f31998a53e94b4036c6e96d80748945845b82b6 | [
"Apache-2.0"
] | null | null | null | from zeus.util.MsgUtil import MsgUtil
# 微信服务器推送消息是xml的,根据利用ElementTree来解析出的不同xml内容返回不同的回复信息,就实现了基本的自动回复功能了,也可以按照需求用其他的XML解析方法
import xml.etree.ElementTree as et
import logging
logger = logging.getLogger("django.request")
class BusinessController:
def auto_reply(self, body):
xml_data = et.fromstring(bod... | 33.23913 | 87 | 0.597122 |
49b190870fd94b97d455a7beb8e6fef711b0626a | 4,733 | py | Python | utils/build/configure.py | amiralies/hermes | f041ad442650d77f4e5efc4577c8b42039c44989 | [
"MIT"
] | null | null | null | utils/build/configure.py | amiralies/hermes | f041ad442650d77f4e5efc4577c8b42039c44989 | [
"MIT"
] | null | null | null | utils/build/configure.py | amiralies/hermes | f041ad442650d77f4e5efc4577c8b42039c44989 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import platform
import sub... | 35.856061 | 117 | 0.660258 |
1849c1b12a94d934f51b048a12ac611886e82408 | 44 | py | Python | poetry_packaging/src/optmod2/code.py | tim-barnes/lang-python | 3dbbc7f38cec598e32bd1a06827246dcab3a0ced | [
"MIT"
] | 1 | 2021-06-16T23:43:27.000Z | 2021-06-16T23:43:27.000Z | poetry_packaging/src/submod2/code.py | tim-barnes/lang-python | 3dbbc7f38cec598e32bd1a06827246dcab3a0ced | [
"MIT"
] | null | null | null | poetry_packaging/src/submod2/code.py | tim-barnes/lang-python | 3dbbc7f38cec598e32bd1a06827246dcab3a0ced | [
"MIT"
] | null | null | null | def foo():
print(__name__)
return 1
| 11 | 19 | 0.590909 |
e8fb7570528b44266c75a9836cdc6962114137d2 | 1,775 | py | Python | apps/public/pdb_utils/place_TERs.py | SchiefLab/Jade | 791d26892aacf21bca733aa9c1c6ea3f2be51958 | [
"BSD-3-Clause"
] | 5 | 2017-02-24T08:55:51.000Z | 2020-09-01T01:59:33.000Z | apps/public/pdb_utils/place_TERs.py | SchiefLab/Jade | 791d26892aacf21bca733aa9c1c6ea3f2be51958 | [
"BSD-3-Clause"
] | 2 | 2020-10-27T21:03:50.000Z | 2021-11-15T17:46:45.000Z | apps/public/pdb_utils/place_TERs.py | SchiefLab/Jade | 791d26892aacf21bca733aa9c1c6ea3f2be51958 | [
"BSD-3-Clause"
] | 2 | 2019-08-01T11:21:14.000Z | 2020-09-01T01:59:35.000Z | #!/usr/bin/env python
from __future__ import print_function
import os,sys,re
from argparse import ArgumentParser
def get_parser():
parser = ArgumentParser(description= "This script places ters between ATOM/HETATM columns. This is currently needed to reload symmetrized glycan poses"
"c... | 27.734375 | 156 | 0.581972 |
86e877501cfe9965205321634834c4eff91fd172 | 260 | py | Python | modules/api/index.py | scaamanho/flask-starter-kit | 69b8090242ef0ff84db89072b7658a91ba9d6dbe | [
"MIT"
] | 8 | 2017-10-24T06:22:05.000Z | 2021-03-17T19:38:24.000Z | modules/api/index.py | scaamanho/flask-starter-kit | 69b8090242ef0ff84db89072b7658a91ba9d6dbe | [
"MIT"
] | null | null | null | modules/api/index.py | scaamanho/flask-starter-kit | 69b8090242ef0ff84db89072b7658a91ba9d6dbe | [
"MIT"
] | 2 | 2017-11-14T06:04:48.000Z | 2021-03-17T19:38:26.000Z | from flask import Blueprint, make_response
""" blueprint module for url handler """
__method__ = Blueprint(__name__, __name__)
app = __method__
@app.route("/", methods=['GET'])
def index():
return make_response("Welcome to flask starter kit API!", 200)
| 23.636364 | 66 | 0.723077 |
9af526d07daa759b0474f0926652586687d89d34 | 6,311 | py | Python | kolejka/judge/tasks/run.py | Raalsky/kolejka-judge | 4fa42d9b9a52a94cd8dc57a99218b32d0e8fc18f | [
"MIT"
] | 2 | 2020-10-29T11:00:03.000Z | 2021-03-08T19:27:58.000Z | kolejka/judge/tasks/run.py | kolejka/kolejka-judge | 72dee578c6326d35c453cbb1128e592878b85ded | [
"MIT"
] | 1 | 2021-09-01T08:10:35.000Z | 2021-09-01T10:09:57.000Z | kolejka/judge/tasks/run.py | Raalsky/kolejka-judge | 4fa42d9b9a52a94cd8dc57a99218b32d0e8fc18f | [
"MIT"
] | 1 | 2021-10-08T19:32:09.000Z | 2021-10-08T19:32:09.000Z | # vim:ts=4:sts=4:sw=4:expandtab
import glob
import shlex
from kolejka.judge import config
from kolejka.judge.paths import *
from kolejka.judge.typing import *
from kolejka.judge.validators import *
from kolejka.judge.commands import *
from kolejka.judge.tasks.base import TaskBase
__all__ = [ 'ExecutableTask', 'Solu... | 33.930108 | 157 | 0.694977 |
6bb46e353d878e0ad3055ba92b54abbf9ec8810b | 1,869 | py | Python | hard-gists/053db410f7fdd4e1d6034a0a7fd45d9b/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/053db410f7fdd4e1d6034a0a7fd45d9b/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/053db410f7fdd4e1d6034a0a7fd45d9b/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import requests
import sys
from Crypto.Cipher import AES
def decrypt(data, key, iv):
"""Decrypt using AES CBC"""
decryptor = AES.new(key, AES.MODE_CBC, IV=iv)
return decryptor.decrypt(data)
def get_binary(url):
"""Get binary data fro... | 30.639344 | 95 | 0.572499 |
16e106b40e2b7308b566981e8c26c6b6712558eb | 180 | py | Python | Chapter03/roles/phonebook/templates/config.py | edinzade/ansible-automation | 49afa7e586ee36c7df96584218620d80b90fa15f | [
"MIT"
] | 19 | 2018-02-24T03:16:58.000Z | 2021-10-01T22:12:05.000Z | Chapter03/roles/phonebook/templates/config.py | edinzade/ansible-automation | 49afa7e586ee36c7df96584218620d80b90fa15f | [
"MIT"
] | null | null | null | Chapter03/roles/phonebook/templates/config.py | edinzade/ansible-automation | 49afa7e586ee36c7df96584218620d80b90fa15f | [
"MIT"
] | 28 | 2018-03-05T15:17:49.000Z | 2021-12-28T07:38:25.000Z | import os
SQLALCHEMY_DATABASE_URI = "mysql://app:{{ rds_admin_pass }}@{{hostvars[groups['tag_Application_cookbook_test'][0]].ansible_host}}/phonebook"
SECRET_KEY = os.urandom(32)
| 36 | 140 | 0.772222 |
1a4db0dd572a8738f2ef4152f86fd89e2090fa48 | 180 | py | Python | profiles_api/admin.py | developer-dorfling/profiles-rest-api | 91ca3b5c5736e25e0446e86eff5bcec44da01cfc | [
"MIT"
] | null | null | null | profiles_api/admin.py | developer-dorfling/profiles-rest-api | 91ca3b5c5736e25e0446e86eff5bcec44da01cfc | [
"MIT"
] | 8 | 2020-02-12T03:05:24.000Z | 2022-02-10T08:55:36.000Z | profiles_api/admin.py | kurtnovice/profiles-rest-api | cc78fce6137e66446cf59dd5a99ee03ec623a74a | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from profiles_api import models
admin.site.register(models.UserProfile)
admin.site.register(models.ProfileFeedItem)
| 22.5 | 43 | 0.833333 |
341d08b3e3bb2a4654217d0edbd54f0fcc840c96 | 2,236 | py | Python | py/adafruit-circuitpython-bundle-7.x-mpy-20211104/examples/st7565_simpletest.py | ParentZap/micro-projects | b260ac09057935f44d3d00ff96670fabfd567aac | [
"Apache-2.0"
] | null | null | null | py/adafruit-circuitpython-bundle-7.x-mpy-20211104/examples/st7565_simpletest.py | ParentZap/micro-projects | b260ac09057935f44d3d00ff96670fabfd567aac | [
"Apache-2.0"
] | null | null | null | py/adafruit-circuitpython-bundle-7.x-mpy-20211104/examples/st7565_simpletest.py | ParentZap/micro-projects | b260ac09057935f44d3d00ff96670fabfd567aac | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-FileCopyrightText: 2021 Mark Olsson <mark@markolsson.se>
# SPDX-License-Identifier: MIT
import time
import board
import busio
import digitalio
import adafruit_st7565
# Initialize SPI bus and control pins
spi = busio.SPI(board.SCK, MOSI... | 26.939759 | 84 | 0.685599 |
04f4c51f3b74165faa1275118321afccf103a268 | 22,570 | py | Python | c7n/resources/sagemaker.py | tjstansell/cloud-custodian | 830a1131537560e5032bc67e52b66e259630e899 | [
"Apache-2.0"
] | null | null | null | c7n/resources/sagemaker.py | tjstansell/cloud-custodian | 830a1131537560e5032bc67e52b66e259630e899 | [
"Apache-2.0"
] | 1 | 2020-04-28T17:53:06.000Z | 2020-04-28T17:53:06.000Z | c7n/resources/sagemaker.py | tjstansell/cloud-custodian | 830a1131537560e5032bc67e52b66e259630e899 | [
"Apache-2.0"
] | null | null | null | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.actions import BaseAction
from c7n.exceptions import PolicyValidationError
from c7n.manager import resources
from c7n.query import QueryResourceManager, TypeInfo
from c7n.utils import local_session, type_schema
from c7n.tags import... | 31.478382 | 85 | 0.595126 |
a2ce96bd12f2fc1e74667cdaa4ea58c685236ff9 | 430 | py | Python | urduhack/tokenization/tests/test_words.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 252 | 2018-08-20T16:16:45.000Z | 2022-03-04T07:03:58.000Z | urduhack/tokenization/tests/test_words.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 111 | 2019-01-21T11:39:45.000Z | 2021-09-30T07:26:50.000Z | urduhack/tokenization/tests/test_words.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 35 | 2019-02-09T14:29:36.000Z | 2022-01-09T10:02:56.000Z | # coding: utf8
"""Test Cases for words"""
from urduhack.tokenization.words import WORDS_SPACE
from urduhack.urdu_characters import URDU_ALPHABETS
def test_words():
"""Test Case"""
for key, value in WORDS_SPACE.items():
for char in key:
if char != ' ':
assert char in URDU_A... | 25.294118 | 51 | 0.604651 |
b243e246c64d19661eccb9cf632d246fde874c65 | 3,325 | py | Python | tests/utils_tester.py | Chrisk12/python-grader | 9bfe9beeffdeb8e50be1a9e2ae3b4fbf0728aa52 | [
"MIT"
] | 9 | 2015-06-06T06:15:12.000Z | 2020-05-27T21:37:16.000Z | tests/utils_tester.py | Chrisk12/python-grader | 9bfe9beeffdeb8e50be1a9e2ae3b4fbf0728aa52 | [
"MIT"
] | null | null | null | tests/utils_tester.py | Chrisk12/python-grader | 9bfe9beeffdeb8e50be1a9e2ae3b4fbf0728aa52 | [
"MIT"
] | 3 | 2018-11-17T22:51:45.000Z | 2021-01-22T14:07:48.000Z | import unittest
import os
from os.path import join
from grader.asset_management import tempModule, AssetFolder
from grader.utils import (
import_module,
beautifyDescription,
get_traceback
)
CURRENT_FOLDER = os.path.dirname(__file__)
def readFile(path):
with open(path) as file:
return file.read... | 36.141304 | 109 | 0.64 |
326124687001682e97094d130d587e283b4b77b3 | 1,627 | py | Python | examples/text_classification.py | LennartKeller/poutyne-transformers | 91194c5039750b59859e4f6def0df2f8837b043d | [
"Apache-2.0"
] | null | null | null | examples/text_classification.py | LennartKeller/poutyne-transformers | 91194c5039750b59859e4f6def0df2f8837b043d | [
"Apache-2.0"
] | null | null | null | examples/text_classification.py | LennartKeller/poutyne-transformers | 91194c5039750b59859e4f6def0df2f8837b043d | [
"Apache-2.0"
] | null | null | null | import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from datasets import load_dataset
from torch.utils.data import DataLoader
from torch import optim
from poutyne import Model, Accuracy
from poutyne_transformers import (
TransformerCollator,
model_loss,
ModelWrapper,
... | 31.901961 | 85 | 0.776275 |
fa08579ee386b0e476e39444eade74e27ec2b614 | 8,325 | py | Python | ons_api.py | dcorney/ons_api_demo | 4c7c4368cd4a74d5c762cd112022bd63e270fc8a | [
"CC0-1.0"
] | 3 | 2021-08-04T17:08:33.000Z | 2021-09-24T11:27:54.000Z | ons_api.py | dcorney/ons_api_demo | 4c7c4368cd4a74d5c762cd112022bd63e270fc8a | [
"CC0-1.0"
] | null | null | null | ons_api.py | dcorney/ons_api_demo | 4c7c4368cd4a74d5c762cd112022bd63e270fc8a | [
"CC0-1.0"
] | null | null | null | # Simple demo of how to access data from the ONS API
import requests
import pandas as pd
import pprint as pp
import logging
logger = logging.getLogger(__name__)
ROOT_URL = "https://api.beta.ons.gov.uk/v1/"
def get_list_of_datasets():
"""Get list of all datasets available from API.
Currently (August 2021), t... | 30.947955 | 94 | 0.644324 |
fd4bfc6dd03c10cdc6d5317075b49a83c59c035b | 3,788 | py | Python | frappe/database/mariadb/schema.py | Pbishtcians/frappe | f660ed21a43e164367c25301e4826e0ca7382b98 | [
"MIT"
] | 1 | 2021-12-23T11:56:09.000Z | 2021-12-23T11:56:09.000Z | frappe/database/mariadb/schema.py | cpdeethree/frappe | fe4a317861a5fd7cc0a4489285c22c9af1ce0167 | [
"MIT"
] | null | null | null | frappe/database/mariadb/schema.py | cpdeethree/frappe | fe4a317861a5fd7cc0a4489285c22c9af1ce0167 | [
"MIT"
] | null | null | null | import frappe
from frappe import _
from frappe.database.schema import DBTable
class MariaDBTable(DBTable):
def create(self):
additional_definitions = ""
engine = self.meta.get("engine") or "InnoDB"
varchar_len = frappe.db.VARCHAR_LEN
# columns
column_defs = self.get_column_definitions()
if column_defs:
... | 32.655172 | 111 | 0.687962 |
8ab17038ff3fcd305051e54cdb22fbb90e85d511 | 2,299 | py | Python | Model/FasterRCNN_model/losses.py | Nikhileshsandela/Window_Counter | 6f13b73c7317a7b272c820f0d168bcb0400c1c83 | [
"MIT"
] | null | null | null | Model/FasterRCNN_model/losses.py | Nikhileshsandela/Window_Counter | 6f13b73c7317a7b272c820f0d168bcb0400c1c83 | [
"MIT"
] | 13 | 2020-02-24T10:38:29.000Z | 2022-02-27T00:07:04.000Z | Model/FasterRCNN_model/losses.py | Nikhileshsandela/Window_Counter | 6f13b73c7317a7b272c820f0d168bcb0400c1c83 | [
"MIT"
] | 3 | 2020-02-20T15:48:03.000Z | 2020-02-29T21:16:45.000Z | from keras import backend as K
from keras.objectives import binary_crossentropy
if K.image_dim_ordering() == 'tf':
import tensorflow as tf
lambda_rpn_regr = 1.0
lambda_rpn_class = 1.0
lambda_cls_regr = 1.0
lambda_cls_class = 1.0
epsilon = 1e-4
# Calculates RPN_regressor losses
def rpn_loss_regr(num_anchors):
def... | 41.053571 | 189 | 0.665072 |
8fd722565defdac94b194d759b9c1a8c59cb72f8 | 6,624 | py | Python | recipes/freeimage/all/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | recipes/freeimage/all/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | recipes/freeimage/all/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
import functools
import os
required_conan_version = ">=1.43.0"
class FreeImageConan(ConanFile):
name = "freeimage"
description = "Open Source library project for developers who would like to support popular graphics image formats"\
"like PNG, BMP, ... | 39.903614 | 120 | 0.621981 |
922adcb2afc4c3895250d320e9d1271269a74991 | 6,458 | py | Python | devp2p/tests/test_peer.py | vaporydev/pydevp2p | 9a46658a5503b48c2e37b35181ec2d6def1428dc | [
"MIT"
] | 284 | 2015-04-05T07:05:51.000Z | 2022-01-12T06:00:51.000Z | devp2p/tests/test_peer.py | vaporydev/pydevp2p | 9a46658a5503b48c2e37b35181ec2d6def1428dc | [
"MIT"
] | 66 | 2015-08-08T11:30:53.000Z | 2018-11-20T06:53:08.000Z | devp2p/tests/test_peer.py | vaporydev/pydevp2p | 9a46658a5503b48c2e37b35181ec2d6def1428dc | [
"MIT"
] | 153 | 2015-04-18T19:20:11.000Z | 2022-03-28T18:47:56.000Z | import platform
import pytest
from devp2p import peermanager, peer
from devp2p import crypto
from devp2p.app import BaseApp
import devp2p.muxsession
import rlp
import devp2p.p2p_protocol
import time
import gevent
import copy
from rlp.utils import encode_hex, decode_hex, str_to_bytes
def get_connected_apps():
a_... | 29.221719 | 155 | 0.647104 |
7a8b9b390898ca8a28f4d0e57cd52b0d2067557d | 24,136 | py | Python | mmdet/models/roi_heads/bbox_heads/sabl_head.py | eynaij/mmdetection | 7b75383feea4db67aa3bc1d385a37a2fccbb44fd | [
"Apache-2.0"
] | 144 | 2021-03-22T07:29:51.000Z | 2022-03-30T03:04:09.000Z | mmdet/models/roi_heads/bbox_heads/sabl_head.py | eynaij/mmdetection | 7b75383feea4db67aa3bc1d385a37a2fccbb44fd | [
"Apache-2.0"
] | 27 | 2021-03-27T13:57:20.000Z | 2022-03-29T09:31:55.000Z | mmdet/models/roi_heads/bbox_heads/sabl_head.py | eynaij/mmdetection | 7b75383feea4db67aa3bc1d385a37a2fccbb44fd | [
"Apache-2.0"
] | 31 | 2021-03-24T09:04:18.000Z | 2022-02-02T13:18:47.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, kaiming_init, normal_init, xavier_init
from mmdet.core import (build_bbox_coder, force_fp32, multi_apply,
multiclass_nms)
from mmdet.models.builder import HEADS, build_loss
fro... | 42.794326 | 79 | 0.583858 |
0bf3635c38eff4732750abcad656f383a86d7773 | 13,738 | py | Python | pdfminer3/utils.py | 3stack-software/pdfminer | f5cfe9371a0d74279775025e6049bbc0f828c565 | [
"MIT"
] | null | null | null | pdfminer3/utils.py | 3stack-software/pdfminer | f5cfe9371a0d74279775025e6049bbc0f828c565 | [
"MIT"
] | null | null | null | pdfminer3/utils.py | 3stack-software/pdfminer | f5cfe9371a0d74279775025e6049bbc0f828c565 | [
"MIT"
] | null | null | null |
"""
Miscellaneous Routines.
"""
import struct
# from sys import maxint as INF #doesn't work anymore under Python3,
# but PDF still uses 32 bits ints
INF = (1 << 31) - 1
import chardet # For str encoding detection in Py3
def make_compat_bytes(in_str):
"In Py2, does nothing. In Py3, converts to bytes, encoding... | 22.051364 | 115 | 0.475106 |
21c88c1309d6861f4d58185823a8d78cb0ef19a3 | 12,229 | py | Python | Adafruit_BBIO/Encoder.py | haowang7/adafruit-beaglebone-io-python | 4cc4b761886c57b1b022d447eee20052c89ef1f4 | [
"MIT"
] | 1 | 2018-08-06T17:31:30.000Z | 2018-08-06T17:31:30.000Z | Adafruit_BBIO/Encoder.py | haowang7/adafruit-beaglebone-io-python | 4cc4b761886c57b1b022d447eee20052c89ef1f4 | [
"MIT"
] | null | null | null | Adafruit_BBIO/Encoder.py | haowang7/adafruit-beaglebone-io-python | 4cc4b761886c57b1b022d447eee20052c89ef1f4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""Quadrature Encoder Pulse interface.
This module enables access to the enhanced Quadrature Encoder Pulse (eQEP)
channels, which can be used to seamlessly interface with rotary encoder
hardware.
The channel identifiers are available as module variables :data:`eQEP0`,
:data:`eQEP1`, :data:`eQEP2` a... | 33.412568 | 79 | 0.597432 |
809a4d18b7eb79ec474f144325d0a5ebc9ccc098 | 451 | py | Python | osf/models/rdm_user_key.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 11 | 2018-12-11T16:39:40.000Z | 2022-02-26T09:51:32.000Z | osf/models/rdm_user_key.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 52 | 2018-04-13T05:03:21.000Z | 2022-03-22T02:56:19.000Z | osf/models/rdm_user_key.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 16 | 2018-07-09T01:44:51.000Z | 2021-06-30T01:57:16.000Z | from django.db import models
from osf.models.base import BaseModel, ObjectIDMixin
class RdmUserKey(ObjectIDMixin, BaseModel):
"""A persistent identifier model for DOIs, ARKs, and the like."""
# object to which the identifier points
guid = models.IntegerField()
key_name = models.CharField(max_length=5... | 32.214286 | 69 | 0.745011 |
e7f96917187ca5c6c0a1690d95a9dfdca360e7ed | 1,162 | py | Python | puppetboard/forms.py | jgrammen-agilitypr/puppetboard | 8d381676f974dceff5bf1e9d39aa180b72b340ae | [
"Apache-2.0"
] | 352 | 2016-01-04T21:27:26.000Z | 2022-03-22T14:04:47.000Z | puppetboard/forms.py | jgrammen-agilitypr/puppetboard | 8d381676f974dceff5bf1e9d39aa180b72b340ae | [
"Apache-2.0"
] | 465 | 2016-01-06T14:39:56.000Z | 2022-03-29T18:20:06.000Z | puppetboard/forms.py | jgrammen-agilitypr/puppetboard | 8d381676f974dceff5bf1e9d39aa180b72b340ae | [
"Apache-2.0"
] | 208 | 2016-01-08T20:08:37.000Z | 2022-03-29T14:34:38.000Z | from collections import OrderedDict
from flask_wtf import FlaskForm
from wtforms import (BooleanField, SelectField, TextAreaField, validators)
from puppetboard.core import get_app
app = get_app()
QUERY_ENDPOINTS = OrderedDict([
# PuppetDB API endpoint, Form name
('pql', 'PQL'),
('nodes', 'Nodes'),
('... | 31.405405 | 74 | 0.665232 |
44d926e769e4f0fc8640c711c0ed4172741b8b21 | 17,851 | py | Python | teuthology/task/install/__init__.py | alfredodeza/teuthology | aaff5feb6994cabffa4211bdfddc74fc08b65c50 | [
"MIT"
] | 1 | 2017-12-03T00:06:02.000Z | 2017-12-03T00:06:02.000Z | teuthology/task/install/__init__.py | alfredodeza/teuthology | aaff5feb6994cabffa4211bdfddc74fc08b65c50 | [
"MIT"
] | null | null | null | teuthology/task/install/__init__.py | alfredodeza/teuthology | aaff5feb6994cabffa4211bdfddc74fc08b65c50 | [
"MIT"
] | null | null | null | import contextlib
import copy
import logging
import os
import subprocess
import yaml
from teuthology import misc as teuthology
from teuthology import contextutil, packaging
from teuthology.parallel import parallel
from teuthology.orchestra import run
from teuthology.task import ansible
from .util import (
_get_bu... | 30.724613 | 79 | 0.617276 |
e1b04f0f9fb35002847438ffedc1c20de9dff015 | 16,862 | py | Python | mars/tensor/expressions/arithmetic/core.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | mars/tensor/expressions/arithmetic/core.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | mars/tensor/expressions/arithmetic/core.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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-... | 33.192913 | 104 | 0.574784 |
49ad003b1b4b98a6c2e780916291d9c8cf5e93c5 | 399 | py | Python | cryptopals/utils/pkcs7.py | rstoro/cryptopals | 5eb8f18ff48ff3b6cc02a687b5b9affa2a17b023 | [
"MIT"
] | null | null | null | cryptopals/utils/pkcs7.py | rstoro/cryptopals | 5eb8f18ff48ff3b6cc02a687b5b9affa2a17b023 | [
"MIT"
] | null | null | null | cryptopals/utils/pkcs7.py | rstoro/cryptopals | 5eb8f18ff48ff3b6cc02a687b5b9affa2a17b023 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def pkcs7(s, b=16):
if isinstance(s, str):
s = s.encode('utf-8')
elif not isinstance(s, bytes):
raise TypeError('Input must be of type <str> or <bytes>')
return s + bytes((chr(b-len(s) % b) * (b-len(s) % b)).encode('utf-8'))
if __name__ == '__main__':
ciphertext = 'YELLOW SUB... | 28.5 | 72 | 0.629073 |
32a0a14fd50c1659fd9434b154f2f03f4b27dfbb | 1,207 | py | Python | jp.atcoder/abc211/abc211_e/24526040.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc211/abc211_e/24526044.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc211/abc211_e/24526044.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import typing
def bit_count(
n: int,
) -> int:
c = 0
while n > 0:
c += n & 1
n >>= 1
return c
def solve(
n: int,
k: int,
s: typing.List[str],
) -> typing.NoReturn:
s = [
ord(x) - ord('#')
for x in ''.join(s)
]
def get_nexts(
i: int,
) -> typing.List[int]:
y, x = divmo... | 15.278481 | 30 | 0.466446 |
f13c06f1db8d2a53013ea86c2ba59184e70cbcf1 | 1,536 | py | Python | payex/service.py | Riidr/pypayex | 50615f9cad63d89b91e957e77a49182cf2c8e025 | [
"BSD-3-Clause"
] | null | null | null | payex/service.py | Riidr/pypayex | 50615f9cad63d89b91e957e77a49182cf2c8e025 | [
"BSD-3-Clause"
] | null | null | null | payex/service.py | Riidr/pypayex | 50615f9cad63d89b91e957e77a49182cf2c8e025 | [
"BSD-3-Clause"
] | null | null | null | from payex.pxagreement import (
PxCreateAgreement3Handler, PxAutoPay2Handler, PxDeleteAgreementHandler,
PxAgreementCheckHandler
)
from payex.pxorder import (
PxOrderInitialize7Handler, PxOrderCompleteHandler, PxOrderCapture4Handler,
PxOrderGetTransactionDetails2Handler, PxCancel2... | 37.463415 | 90 | 0.695313 |
4825a88c315f399486eed9fc6071c7db05d354c3 | 40 | py | Python | middlewares/__init__.py | SSabu/BikeMaps | c2c99f586293af6415bf1a5ce3da3d0c7126ee30 | [
"MIT"
] | 19 | 2015-10-17T10:46:22.000Z | 2022-03-04T07:29:38.000Z | middlewares/__init__.py | SSabu/BikeMaps | c2c99f586293af6415bf1a5ce3da3d0c7126ee30 | [
"MIT"
] | 36 | 2017-06-21T03:01:30.000Z | 2022-03-04T17:26:36.000Z | middlewares/__init__.py | SSabu/BikeMaps | c2c99f586293af6415bf1a5ce3da3d0c7126ee30 | [
"MIT"
] | 18 | 2015-05-17T03:53:38.000Z | 2021-04-16T19:00:56.000Z | from .force_default_middleware import *
| 20 | 39 | 0.85 |
5c40c1a93f208c16dc6efc941f1997ef810c42fd | 2,664 | py | Python | transactions/forms.py | wanqilim2019/CloudBank4 | cd352116d1f39e211ef29f09107eafa509ac2343 | [
"MIT"
] | 196 | 2018-04-25T17:17:22.000Z | 2022-03-21T09:47:18.000Z | transactions/forms.py | wanqilim2019/CloudBank4 | cd352116d1f39e211ef29f09107eafa509ac2343 | [
"MIT"
] | 40 | 2019-04-03T14:34:29.000Z | 2022-02-25T11:19:48.000Z | transactions/forms.py | wanqilim2019/CloudBank4 | cd352116d1f39e211ef29f09107eafa509ac2343 | [
"MIT"
] | 119 | 2018-03-07T16:36:03.000Z | 2022-03-24T03:34:39.000Z | import datetime
from django import forms
from django.conf import settings
from .models import Transaction
class TransactionForm(forms.ModelForm):
class Meta:
model = Transaction
fields = [
'amount',
'transaction_type'
]
def __init__(self, *args, **kwargs):
... | 28.340426 | 74 | 0.609985 |
17158185f554597e54d952c4644a0245641d7635 | 2,046 | py | Python | tensorflow_federated/experimental/python/core/backends/xla/execution_contexts_test.py | amrzv/federated | d8ac0d5f8d52541860fba881e87ccdd44c5d5b9b | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/experimental/python/core/backends/xla/execution_contexts_test.py | amrzv/federated | d8ac0d5f8d52541860fba881e87ccdd44c5d5b9b | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/experimental/python/core/backends/xla/execution_contexts_test.py | amrzv/federated | d8ac0d5f8d52541860fba881e87ccdd44c5d5b9b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 42.625 | 89 | 0.807429 |
3d8b18166c9beddd4af6c7dd3132a324079d3c24 | 36 | py | Python | examples/python/__init__.py | KonScanner/transitionMatrix | 55d7e84de1510a3dbc54b1dc8de727194b8d36e2 | [
"Apache-2.0"
] | 46 | 2018-01-30T18:00:00.000Z | 2022-01-28T11:49:43.000Z | examples/python/__init__.py | KonScanner/transitionMatrix | 55d7e84de1510a3dbc54b1dc8de727194b8d36e2 | [
"Apache-2.0"
] | 18 | 2018-10-12T09:43:01.000Z | 2021-12-17T10:51:15.000Z | examples/python/__init__.py | KonScanner/transitionMatrix | 55d7e84de1510a3dbc54b1dc8de727194b8d36e2 | [
"Apache-2.0"
] | 25 | 2018-01-30T18:00:11.000Z | 2022-03-02T02:26:43.000Z | # init funny all those empty inits
| 12 | 34 | 0.75 |
b01c68e89d3c384680d6eea1ace3367de895459c | 2,187 | py | Python | package/spack-cloog/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-cloog/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-cloog/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 42.057692 | 97 | 0.647005 |
f25d7497d6d266c32169b4f950c6e3f3be780483 | 1,461 | py | Python | ticket_office_service/train_services_adapters.py | youarhache/katas-TrainReservation | c0f3f48acdee527bfe59cbf236530e0dc095b69a | [
"MIT"
] | null | null | null | ticket_office_service/train_services_adapters.py | youarhache/katas-TrainReservation | c0f3f48acdee527bfe59cbf236530e0dc095b69a | [
"MIT"
] | null | null | null | ticket_office_service/train_services_adapters.py | youarhache/katas-TrainReservation | c0f3f48acdee527bfe59cbf236530e0dc095b69a | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Optional, List
import requests
import json
@dataclass
class Seat:
seat_name: str
seat_number: str
coach: str
booking_reference: str
class TrainDataAdapter:
URL = "http://127.0.0.1:8081"
def get_train_data(self, train_id: str) -> Optional[... | 28.096154 | 86 | 0.588638 |
dda1710d137d6bcc7b0e093504c309296576f387 | 1,619 | py | Python | old/vl8/function/periodic.py | rec/sorta | 8d7f61f7eaffbda7775cca06fca1002280223eb2 | [
"MIT"
] | 2 | 2020-12-16T10:49:52.000Z | 2021-09-12T08:01:31.000Z | old/vl8/function/periodic.py | rec/sorta | 8d7f61f7eaffbda7775cca06fca1002280223eb2 | [
"MIT"
] | 2 | 2021-06-13T09:41:32.000Z | 2021-06-13T09:49:29.000Z | old/vl8/function/periodic.py | rec/sorta | 8d7f61f7eaffbda7775cca06fca1002280223eb2 | [
"MIT"
] | null | null | null | from ..types import to_number, to_seconds, types
from .generator import Generator
from dataclasses import dataclass
from typing import Optional
@dataclass
class Periodic(Generator):
cycles: Optional[int] = None
phase: types.NumericSequence = 0
period: Optional[types.Number] = None
frequency: Optional[... | 31.134615 | 79 | 0.681902 |
c911edf3ba85e5ff8e77ac98a1e02d55913fa9e1 | 702 | py | Python | frameworks/flaml/__init__.py | PGijsbers/automlbenchmark | 6e0296b097455caf18d754e79a2bd85e85d01548 | [
"MIT"
] | 282 | 2018-09-19T09:45:46.000Z | 2022-03-30T04:05:51.000Z | frameworks/flaml/__init__.py | PGijsbers/automlbenchmark | 6e0296b097455caf18d754e79a2bd85e85d01548 | [
"MIT"
] | 267 | 2018-11-02T11:43:11.000Z | 2022-03-31T08:58:16.000Z | frameworks/flaml/__init__.py | PGijsbers/automlbenchmark | 6e0296b097455caf18d754e79a2bd85e85d01548 | [
"MIT"
] | 104 | 2018-10-17T19:32:36.000Z | 2022-03-19T22:47:59.000Z | from amlb.utils import call_script_in_same_dir
def setup(*args, **kwargs):
call_script_in_same_dir(__file__, "setup.sh", *args, **kwargs)
def run(dataset, config):
from frameworks.shared.caller import run_in_venv
data = dict(
train=dict(
X=dataset.train.X,
y=dataset.trai... | 25.071429 | 88 | 0.612536 |
4c3c38277cd1574cd282138b218a69cd3cbd14fe | 2,292 | py | Python | lp/ui/management/commands/make_sitemap.py | gwu-libraries/launchpad | 2ba3d52ee04add8c1f497b52811932f7ad53bc82 | [
"MIT"
] | 4 | 2015-11-01T19:15:06.000Z | 2016-06-22T05:58:41.000Z | lp/ui/management/commands/make_sitemap.py | leighannskeen/launchpad | 2ba3d52ee04add8c1f497b52811932f7ad53bc82 | [
"MIT"
] | 272 | 2015-01-06T16:07:58.000Z | 2021-06-10T18:04:43.000Z | lp/ui/management/commands/make_sitemap.py | leighannskeen/launchpad | 2ba3d52ee04add8c1f497b52811932f7ad53bc82 | [
"MIT"
] | 4 | 2016-08-02T19:20:18.000Z | 2021-12-04T07:49:12.000Z | import gzip
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connections
def _newfile(counter):
"""Generate a new sitemap filename based on count."""
name = '%s/sitemap-%s.xml.gz' % (settings.SITEMAPS_DIR,
counter)
fp = gzip.open... | 33.705882 | 73 | 0.550611 |
10d59a3e7d70363ff15ae41cc4f33a0935a16dce | 2,797 | py | Python | tests/test_dirstack.py | rpdelaney/xonsh | 32bddba3a3d5febcd12524f07086b6cce1e14397 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_dirstack.py | rpdelaney/xonsh | 32bddba3a3d5febcd12524f07086b6cce1e14397 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_dirstack.py | rpdelaney/xonsh | 32bddba3a3d5febcd12524f07086b6cce1e14397 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """Testing dirstack"""
import os
from contextlib import contextmanager
import pytest # noqa F401
from xonsh import dirstack
HERE = os.path.abspath(os.path.dirname(__file__))
PARENT = os.path.dirname(HERE)
@contextmanager
def chdir(adir):
old_dir = os.getcwd()
os.chdir(adir)
yield
os.chdir(old_dir... | 24.973214 | 82 | 0.610654 |
ab2514abffe7c3a9ab4bd598d665ed748a2486e6 | 6,721 | py | Python | kubevirt/models/v1_virtual_machine_instance_file_system.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 21 | 2018-02-21T23:59:28.000Z | 2021-12-08T05:47:37.000Z | kubevirt/models/v1_virtual_machine_instance_file_system.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 47 | 2018-02-01T15:35:01.000Z | 2022-02-11T07:45:54.000Z | kubevirt/models/v1_virtual_machine_instance_file_system.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 19 | 2018-04-03T09:20:52.000Z | 2021-06-01T06:07:28.000Z | # coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Virtua... | 28.845494 | 115 | 0.609433 |
6f645803a147f9302d52434f13f390543fad0702 | 32,239 | py | Python | exoplanet-ml/astrowavenet/data/base_test.py | ritwik12/exoplanet-ml | af443d3cd5e51f591527a7df51315b907057018c | [
"Apache-2.0"
] | 286 | 2018-12-05T00:04:50.000Z | 2022-03-23T03:35:54.000Z | exoplanet-ml/astrowavenet/data/base_test.py | ritwik12/exoplanet-ml | af443d3cd5e51f591527a7df51315b907057018c | [
"Apache-2.0"
] | 14 | 2019-02-26T01:44:16.000Z | 2022-01-24T21:59:51.000Z | exoplanet-ml/astrowavenet/data/base_test.py | ritwik12/exoplanet-ml | af443d3cd5e51f591527a7df51315b907057018c | [
"Apache-2.0"
] | 115 | 2018-12-04T19:44:26.000Z | 2022-02-20T17:57:16.000Z | # Copyright 2018 The Exoplanet ML Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 41.491634 | 80 | 0.44412 |
7cd3a20baa6efa8f895bf8db44685dd108ce961f | 2,727 | py | Python | humblecritic/humblebundle/scraper.py | witekbobrowski/humblecritic | 08ff00e4e233c251453f20bac2593be70235fac8 | [
"MIT"
] | 3 | 2018-02-24T12:23:21.000Z | 2018-10-15T11:18:17.000Z | humblecritic/humblebundle/scraper.py | witekbobrowski/humblecritic | 08ff00e4e233c251453f20bac2593be70235fac8 | [
"MIT"
] | 1 | 2018-02-24T20:24:57.000Z | 2018-02-24T21:35:58.000Z | humblecritic/humblebundle/scraper.py | witekbobrowski/humblecritic | 08ff00e4e233c251453f20bac2593be70235fac8 | [
"MIT"
] | 1 | 2018-02-27T16:07:28.000Z | 2018-02-27T16:07:28.000Z | #!/usr/bin/env python3
# -*- coding : utf-8 -*-
# Author: Witek Bobrowski
import re
import os.path
from urllib.parse import urlparse
from urllib.parse import urljoin
import requests
from selenium import webdriver
from bs4 import BeautifulSoup
base_url = "https://www.humblebundle.com/"
def get_page_content(url):
... | 32.464286 | 85 | 0.708838 |
fdabd0731380b756deb104c30450b65763cdeed8 | 3,459 | py | Python | sentiment_classification_api/sentiment_classification_api/settings.py | absolutedevelop/hamba-x-assessment-intern | ee666a76be65ba391d168bcc6683d5b4ae284f42 | [
"MIT"
] | null | null | null | sentiment_classification_api/sentiment_classification_api/settings.py | absolutedevelop/hamba-x-assessment-intern | ee666a76be65ba391d168bcc6683d5b4ae284f42 | [
"MIT"
] | null | null | null | sentiment_classification_api/sentiment_classification_api/settings.py | absolutedevelop/hamba-x-assessment-intern | ee666a76be65ba391d168bcc6683d5b4ae284f42 | [
"MIT"
] | null | null | null | """
Django settings for sentiment_classification_api project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings... | 26.40458 | 91 | 0.710032 |
34a38e005ead5bd79cb0ba00468ab10de0a507da | 872 | py | Python | biotransformers/tests/test_loglikelihoods.py | ranzenTom/bio-transformers | cf8243d027a83dff7475576a213096ff5b5170f3 | [
"Apache-2.0"
] | null | null | null | biotransformers/tests/test_loglikelihoods.py | ranzenTom/bio-transformers | cf8243d027a83dff7475576a213096ff5b5170f3 | [
"Apache-2.0"
] | null | null | null | biotransformers/tests/test_loglikelihoods.py | ranzenTom/bio-transformers | cf8243d027a83dff7475576a213096ff5b5170f3 | [
"Apache-2.0"
] | null | null | null | """Test module for testing loglikelihoods function"""
import numpy as np
import pytest
test_sequences = ["AAAA", "AKKF", "AHHFK", "KKKKKKKLLL"]
test_params = [
(1, list("ACDEFGHIKLMNPQRSTVWY"), "forward"),
(2, ["A", "F", "K"], "masked"),
(10, ["A"], "forward"),
]
@pytest.mark.parametrize("batch_size, to... | 30.068966 | 75 | 0.697248 |
57d89113e537ab3c4fbee3f8465b0c7929378e5c | 42 | py | Python | tests/__init__.py | juanvmarquezl/flicket | 0ed68d38b1f12e105436d8c51af163476b60a982 | [
"MIT"
] | 95 | 2017-10-31T21:25:11.000Z | 2022-03-07T05:46:12.000Z | tests/__init__.py | juanvmarquezl/flicket | 0ed68d38b1f12e105436d8c51af163476b60a982 | [
"MIT"
] | 47 | 2017-05-15T10:52:23.000Z | 2021-12-13T09:30:52.000Z | tests/__init__.py | juanvmarquezl/flicket | 0ed68d38b1f12e105436d8c51af163476b60a982 | [
"MIT"
] | 54 | 2017-07-13T03:38:47.000Z | 2022-02-12T20:10:02.000Z | #! usr/bin/python3
# -*- coding: utf8 -*-
| 14 | 22 | 0.547619 |
992fae3a0d003d732f10f21e8e6667ff8eaded08 | 14,106 | py | Python | flytekit/core/interface.py | slai/flytekit | 9d73d096b748d263a638e6865d15db4880845305 | [
"Apache-2.0"
] | null | null | null | flytekit/core/interface.py | slai/flytekit | 9d73d096b748d263a638e6865d15db4880845305 | [
"Apache-2.0"
] | null | null | null | flytekit/core/interface.py | slai/flytekit | 9d73d096b748d263a638e6865d15db4880845305 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import collections
import copy
import inspect
import typing
from collections import OrderedDict
from typing import Any, Dict, Generator, List, Optional, Tuple, Type, TypeVar, Union
from flytekit.common.exceptions.user import FlyteValidationException
from flytekit.core import context... | 40.534483 | 120 | 0.658869 |
a76601cc370b97f607599951f2cac20503ab2564 | 206 | py | Python | main.py | practice-lang/Age-analyzer | 819ee1c3615eae69e85cfdc23fa5d827a8028f7e | [
"MIT"
] | null | null | null | main.py | practice-lang/Age-analyzer | 819ee1c3615eae69e85cfdc23fa5d827a8028f7e | [
"MIT"
] | null | null | null | main.py | practice-lang/Age-analyzer | 819ee1c3615eae69e85cfdc23fa5d827a8028f7e | [
"MIT"
] | null | null | null | age = int(input("나이를 입력하십쇼.\n"))
if age < 1:
print("어디서 사기를 칩니까?");
exit();
elif age <= 5:
print("5이상이군요 아이입니다.");
exit();
elif age <= 8:
print("8이상이군요 초등학생입니다.")
exit()
| 17.166667 | 33 | 0.495146 |
5fa92a86fb13dca08a71de700b84dc5be30af5d0 | 13,387 | py | Python | reader/views.py | Kadantte/comicake | 205f327b920cbfdec86e57034d98a42f335d64ee | [
"ISC"
] | 18 | 2018-05-01T04:56:37.000Z | 2022-03-27T16:11:57.000Z | reader/views.py | Kadantte/comicake | 205f327b920cbfdec86e57034d98a42f335d64ee | [
"ISC"
] | 32 | 2018-06-08T06:29:35.000Z | 2022-03-11T23:32:21.000Z | reader/views.py | Kadantte/comicake | 205f327b920cbfdec86e57034d98a42f335d64ee | [
"ISC"
] | 13 | 2018-04-25T20:14:01.000Z | 2021-12-12T10:02:05.000Z | """Reader app views"""
# pylint: disable=E1101
from django.shortcuts import render
from django.conf import settings
from django.utils.translation import gettext as _
from django.http import HttpResponse, Http404, HttpResponseForbidden, HttpResponseServerError
from django.shortcuts import get_list_or_404, get_object_or_... | 32.891892 | 153 | 0.690147 |
b82359408c13119705f49a320d1257e41359520e | 20,686 | py | Python | sabnzbd/bpsmeter.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 1,354 | 2015-01-02T11:53:23.000Z | 2022-03-30T01:32:46.000Z | sabnzbd/bpsmeter.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 1,742 | 2015-01-01T20:17:35.000Z | 2022-03-30T21:05:00.000Z | sabnzbd/bpsmeter.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 410 | 2015-01-24T05:32:46.000Z | 2022-03-20T12:56:49.000Z | #!/usr/bin/python3 -OO
# Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... | 35.421233 | 116 | 0.559896 |
70025bf3a833bf29eb47b63eda8dd4b4d81c7191 | 2,779 | py | Python | Python/interview/DungeoneeringV1.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | 2 | 2015-12-02T06:44:01.000Z | 2016-05-04T21:40:54.000Z | Python/interview/DungeoneeringV1.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | Python/interview/DungeoneeringV1.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | '''
Created on 2016年1月31日
@author: Darren
'''
'''
You are given an array of integers with values greater than or equal to 0, for example:
[5, 6, 0, 4, 2, 4, 1, 0, 0, 4]
You will develop and implement an algorithm to traverse the array in the shortest number of “hops” starting at index 0, where traversal is defined as... | 49.625 | 293 | 0.729399 |
5b04950b0fb30697866c3360ede7769f21e037ef | 2,572 | py | Python | tests/snapshot_test.py | danjampro/illustris_python | c2f3a376ec7dd31e5b6ef8366768b929dcc5db30 | [
"BSD-2-Clause-FreeBSD"
] | 33 | 2020-01-06T16:13:57.000Z | 2022-03-23T08:39:31.000Z | tests/snapshot_test.py | danjampro/illustris_python | c2f3a376ec7dd31e5b6ef8366768b929dcc5db30 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2022-02-12T22:25:12.000Z | 2022-02-18T06:22:30.000Z | tests/snapshot_test.py | danjampro/illustris_python | c2f3a376ec7dd31e5b6ef8366768b929dcc5db30 | [
"BSD-2-Clause-FreeBSD"
] | 12 | 2019-12-29T00:26:35.000Z | 2022-02-19T14:00:41.000Z | """Tests for the `illustris_python.snapshot` submodule.
Running Tests
-------------
To run all tests, this script can be executed as:
`$ python tests/snapshot_test.py [-v] [--nocapture]`
from the root directory.
Alternatively, `nosetests` can be run and it will find the tests:
`$ nosetests [-v] [--nocapture]`... | 29.906977 | 89 | 0.639969 |
201b0c6ece8ee599a6d1e305915cb1ca7c778ce7 | 15,962 | py | Python | electionleaflets/apps/legacy/models.py | electionleaflets/electionleaflets | 4110e96a3035c32d0b6ff3c9f832c5e003728170 | [
"MIT"
] | null | null | null | electionleaflets/apps/legacy/models.py | electionleaflets/electionleaflets | 4110e96a3035c32d0b6ff3c9f832c5e003728170 | [
"MIT"
] | 23 | 2015-02-19T14:02:23.000Z | 2015-04-30T11:14:01.000Z | electionleaflets/apps/legacy/models.py | electionleaflets/electionleaflets | 4110e96a3035c32d0b6ff3c9f832c5e003728170 | [
"MIT"
] | 2 | 2015-02-02T19:39:54.000Z | 2017-02-08T09:19:53.000Z | # This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free ... | 29.724395 | 104 | 0.707618 |
409fb6c344d979511ea8bf94c48f99007553f899 | 9,222 | py | Python | tests/unit/_internal/bento/test_bento.py | sauyon/BentoML | ff702f1fc1ee7cc4cf7aab2e67d1e27512858fe4 | [
"Apache-2.0"
] | null | null | null | tests/unit/_internal/bento/test_bento.py | sauyon/BentoML | ff702f1fc1ee7cc4cf7aab2e67d1e27512858fe4 | [
"Apache-2.0"
] | null | null | null | tests/unit/_internal/bento/test_bento.py | sauyon/BentoML | ff702f1fc1ee7cc4cf7aab2e67d1e27512858fe4 | [
"Apache-2.0"
] | null | null | null | import os
from typing import TYPE_CHECKING
from datetime import datetime
from datetime import timezone
import fs
import pytest
from bentoml import Tag
from bentoml._internal.bento import Bento
from bentoml._internal.bento.bento import BentoInfo
from bentoml._internal.bento.bento import BentoModelInfo
from bentoml._in... | 31.910035 | 83 | 0.676101 |
1907d10c1a087b1f9af43ed8ca3259840882b97f | 69,265 | py | Python | tests/test_core_to_contrib.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | tests/test_core_to_contrib.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | tests/test_core_to_contrib.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.302922 | 107 | 0.720061 |
268aa3338e1135ed884d5dcd41a3e3e9f9f071b7 | 565 | py | Python | conektango/migrations/0002_auto_20190803_1308.py | alexdzul/conektango | 2df0112f83beed20651c64112be9d187ba7ec47a | [
"MIT"
] | null | null | null | conektango/migrations/0002_auto_20190803_1308.py | alexdzul/conektango | 2df0112f83beed20651c64112be9d187ba7ec47a | [
"MIT"
] | null | null | null | conektango/migrations/0002_auto_20190803_1308.py | alexdzul/conektango | 2df0112f83beed20651c64112be9d187ba7ec47a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2019-08-03 18:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('conektango', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 26.904762 | 175 | 0.619469 |
b2c8a05e1fbe8c23e61a27b492a140cb801c6363 | 2,479 | py | Python | blqs_cirq/blqs_cirq/protocols.py | ionq/blqs | 0667159d0475e0fc0df5aa607f87c8e90c38eb39 | [
"Apache-2.0"
] | 1 | 2022-02-01T18:38:30.000Z | 2022-02-01T18:38:30.000Z | blqs_cirq/blqs_cirq/protocols.py | ionq/blqs | 0667159d0475e0fc0df5aa607f87c8e90c38eb39 | [
"Apache-2.0"
] | null | null | null | blqs_cirq/blqs_cirq/protocols.py | ionq/blqs | 0667159d0475e0fc0df5aa607f87c8e90c38eb39 | [
"Apache-2.0"
] | 1 | 2022-02-03T21:09:59.000Z | 2022-02-03T21:09:59.000Z | # Copyright 2021 The Blqs Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 33.5 | 100 | 0.699476 |
e99d2120358966afc5b6cd1b45bc065a4863011e | 18,828 | py | Python | tests_app/tests/functional/routers/nested_router_mixin/tests.py | omniprojects/drf-extensions | 103d7e921cc15d7306367348752fcad4ab38b0d6 | [
"MIT"
] | 1 | 2019-06-18T16:40:33.000Z | 2019-06-18T16:40:33.000Z | tests_app/tests/functional/routers/nested_router_mixin/tests.py | omniprojects/drf-extensions | 103d7e921cc15d7306367348752fcad4ab38b0d6 | [
"MIT"
] | null | null | null | tests_app/tests/functional/routers/nested_router_mixin/tests.py | omniprojects/drf-extensions | 103d7e921cc15d7306367348752fcad4ab38b0d6 | [
"MIT"
] | 1 | 2019-10-19T10:34:39.000Z | 2019-10-19T10:34:39.000Z | # -*- coding: utf-8 -*-
from django.test import override_settings
from rest_framework_extensions.test import APITestCase
from .models import (
NestedRouterMixinUserModel as UserModel,
NestedRouterMixinGroupModel as GroupModel,
NestedRouterMixinPermissionModel as PermissionModel,
NestedRouterMixinTaskM... | 35.390977 | 116 | 0.562673 |
8297179e5cadf557f5a3ad1439f1f54e9d9f3798 | 4,605 | py | Python | graphql_compiler/compiler/validation.py | manesioz/graphql-compiler | b23be9c4a8e26f8c82e741625e04f7c9ac2e623b | [
"Apache-2.0"
] | 521 | 2017-07-18T23:56:25.000Z | 2022-03-25T16:39:06.000Z | graphql_compiler/compiler/validation.py | manesioz/graphql-compiler | b23be9c4a8e26f8c82e741625e04f7c9ac2e623b | [
"Apache-2.0"
] | 740 | 2017-07-19T01:52:42.000Z | 2021-09-30T11:15:00.000Z | graphql_compiler/compiler/validation.py | manesioz/graphql-compiler | b23be9c4a8e26f8c82e741625e04f7c9ac2e623b | [
"Apache-2.0"
] | 56 | 2017-07-18T23:56:14.000Z | 2021-10-30T08:08:56.000Z | # Copyright 2019-present Kensho Technologies, LLC.
from typing import List
from graphql import DocumentNode, GraphQLSchema
from graphql.language import DirectiveLocation
from graphql.validation import validate
import six
from ..schema import DIRECTIVES
def validate_schema_and_query_ast(schema: GraphQLSchema, query_... | 34.365672 | 100 | 0.578719 |
4610c91785728ac58a5a54722456971cf4eb1856 | 8,555 | py | Python | agent/src/clacks/agent/httpd.py | gonicus/clacks | da579f0acc4e48cf2e9451417ac6792282cf7ab6 | [
"ZPL-2.1"
] | 2 | 2015-01-26T07:15:19.000Z | 2015-11-09T13:42:11.000Z | agent/src/clacks/agent/httpd.py | gonicus/clacks | da579f0acc4e48cf2e9451417ac6792282cf7ab6 | [
"ZPL-2.1"
] | null | null | null | agent/src/clacks/agent/httpd.py | gonicus/clacks | da579f0acc4e48cf2e9451417ac6792282cf7ab6 | [
"ZPL-2.1"
] | null | null | null | # This file is part of the clacks framework.
#
# http://clacks-project.org
#
# Copyright:
# (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de
#
# License:
# GPL-2: http://www.gnu.org/licenses/gpl-2.0.html
#
# See the LICENSE file in the project's top-level directory for details.
"""
The *HTTPService* and t... | 34.495968 | 113 | 0.582817 |
48083945af543d97db7483a3fa8a52c072091871 | 29,532 | py | Python | src/pyunicorn/core/resistive_network.py | ntfrgl/test | 79ded90816f49274ab6ac91febe50e4dad7b710a | [
"BSD-3-Clause"
] | null | null | null | src/pyunicorn/core/resistive_network.py | ntfrgl/test | 79ded90816f49274ab6ac91febe50e4dad7b710a | [
"BSD-3-Clause"
] | 136 | 2015-01-12T14:27:05.000Z | 2015-04-10T10:03:16.000Z | src/pyunicorn/core/resistive_network.py | ntfrgl/test | 79ded90816f49274ab6ac91febe50e4dad7b710a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# # Copyright (C) 2014 Paul Schultz and the SWIPO Project
#
# Authors (this file):
# Stefan Schinkel <stefan.schinkel@gmail.com>
# Paul Schultz pschultz@pik-potsdam.de>
#
#
# References: [Schultz2014]_, [Schultz2014a]_,
#
# ToDo:
# - included Schultz' Predictor and growt... | 32.632044 | 79 | 0.504876 |
5aaccb122083eca829524994e71ff1f104e18ac6 | 1,292 | py | Python | textadventure/loader.py | sharkbound/textadventurepython | c544bcd34f2676d487a954096a99749006dc6bcc | [
"MIT"
] | null | null | null | textadventure/loader.py | sharkbound/textadventurepython | c544bcd34f2676d487a954096a99749006dc6bcc | [
"MIT"
] | null | null | null | textadventure/loader.py | sharkbound/textadventurepython | c544bcd34f2676d487a954096a99749006dc6bcc | [
"MIT"
] | null | null | null | from contextlib import contextmanager
from importlib import import_module
from inspect import isclass
from os import getcwd
from pathlib import Path
import sys
from typing import Union
__all__ = [
'temp_syspath',
'load'
]
def load(folder: Union[Path, str], manager_id: str = 'main'):
from .room import Ro... | 26.916667 | 91 | 0.575851 |
0435866484f584db9ee9c384513ba79718b88af9 | 2,757 | py | Python | test/5293/actions_test.py | dburkart/check-sieve | 667f0e9670e8820e37a8162ec09e794e6e4f1cb4 | [
"MIT"
] | 20 | 2015-09-06T04:16:04.000Z | 2022-03-24T16:34:56.000Z | test/5293/actions_test.py | dburkart/mail-sieve-verifier | cb51fda06c933dd1e1d0ded05ccba9bedbe67e7f | [
"MIT"
] | 24 | 2015-06-14T01:44:30.000Z | 2015-09-05T17:25:11.000Z | test/5293/actions_test.py | dburkart/mail-sieve-verifier | cb51fda06c933dd1e1d0ded05ccba9bedbe67e7f | [
"MIT"
] | 3 | 2015-09-08T05:24:08.000Z | 2019-04-01T00:15:29.000Z | import unittest
import checksieve
class TestAddHeader(unittest.TestCase):
def test_addheader_correct(self):
sieve = '''
if not header :contains "X-Sieve-Filtered"
["<kim@job.example.com>", "<kim@home.example.com>"]
{
addheader "X-Sieve-Filtered" "<kim@job.ex... | 32.05814 | 75 | 0.560754 |
9075ff99abf4f11a7b743a25416fdbcbb1fb3dbb | 1,043 | py | Python | imagetocsv.py | mluqmanbukhori/image-to-csv | 12fd8695b088f14287c70fad32fdb1aac022b85a | [
"MIT"
] | null | null | null | imagetocsv.py | mluqmanbukhori/image-to-csv | 12fd8695b088f14287c70fad32fdb1aac022b85a | [
"MIT"
] | null | null | null | imagetocsv.py | mluqmanbukhori/image-to-csv | 12fd8695b088f14287c70fad32fdb1aac022b85a | [
"MIT"
] | null | null | null | from PIL import Image
import numpy as np
import os
import csv
# default format can be changed as needed
def createFileList(myDir, format='.jpg'):
fileList = []
# print(myDir)
for root, dirs, files in os.walk(myDir, topdown=False):
for name in files:
if name.endswith(format):
... | 26.075 | 60 | 0.602109 |
281af91b769f8be00d2c5caee199c649900959ce | 6,590 | py | Python | src/txthings/test/test_coap.py | ziaul55/DHT22_Logger | 5892f6f6b9e52ff4b1567ee7b65ff84cd5e2c5f3 | [
"MIT"
] | 2 | 2022-01-19T23:55:57.000Z | 2022-03-24T20:18:52.000Z | src/txthings/test/test_coap.py | ziaul55/dht22_logger | 5892f6f6b9e52ff4b1567ee7b65ff84cd5e2c5f3 | [
"MIT"
] | null | null | null | src/txthings/test/test_coap.py | ziaul55/dht22_logger | 5892f6f6b9e52ff4b1567ee7b65ff84cd5e2c5f3 | [
"MIT"
] | 1 | 2022-01-19T23:56:02.000Z | 2022-01-19T23:56:02.000Z | '''
Created on 16-10-2012
@author: Maciej Wasilak
'''
from twisted.trial import unittest
from txthings import coap
import six
class TestMessage(unittest.TestCase):
def test_encode(self):
msg1 = coap.Message(mtype=coap.CON, mid=0)
binary1 = (chr(64)+chr(0)+chr(0)+chr(0)).encode()
self.asse... | 45.763889 | 178 | 0.557056 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.