hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76ad7b07d56da2d702ac35c78341694d067d2d1 | 373 | py | Python | docs.py | atharva1996/WolfJobs | 6c05555f644d076a0e8f747474b6c9ddd675dc0f | [
"MIT"
] | 2 | 2021-09-29T19:51:19.000Z | 2021-09-29T22:09:22.000Z | docs.py | atharva1996/WolfJobs | 6c05555f644d076a0e8f747474b6c9ddd675dc0f | [
"MIT"
] | 30 | 2021-09-26T15:39:43.000Z | 2021-10-01T02:05:37.000Z | docs.py | atharva1996/WolfJobs | 6c05555f644d076a0e8f747474b6c9ddd675dc0f | [
"MIT"
] | 3 | 2021-09-30T18:56:37.000Z | 2021-12-06T13:06:08.000Z | """WolfJobs.
Usage:
docs.py [(<name1>|<name2>)] <name3>...
docs.py mov <name1> <name2>
docs.py (--h|--q) [<name1> -l]
docs.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
if __name__ == '__main__':
arguments = docopt(... | 19.631579 | 55 | 0.581769 |
from docopt import docopt
if __name__ == '__main__':
arguments = docopt(__doc__, version='WolfJobs 1.0')
print(arguments) | true | true |
f76ad8624cc6e8d56fe36a10015c2e765668db28 | 797 | py | Python | bigquery/samples/tests/test_delete_table.py | codyoss/google-cloud-python | 505d55357fbdffc5d55005c58712932c758737bd | [
"Apache-2.0"
] | 1 | 2020-01-09T14:42:37.000Z | 2020-01-09T14:42:37.000Z | bigquery/samples/tests/test_delete_table.py | codyoss/google-cloud-python | 505d55357fbdffc5d55005c58712932c758737bd | [
"Apache-2.0"
] | 3 | 2019-06-20T05:20:15.000Z | 2019-06-27T05:01:16.000Z | bigquery/samples/tests/test_delete_table.py | codyoss/google-cloud-python | 505d55357fbdffc5d55005c58712932c758737bd | [
"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, ... | 33.208333 | 74 | 0.750314 |
from .. import delete_table
def test_delete_table(capsys, client, table_id):
delete_table.delete_table(client, table_id)
out, err = capsys.readouterr()
assert "Deleted table '{}'.".format(table_id) in out
| true | true |
f76ad9b7cedb8b04c353b2286b603f59e587594f | 233 | py | Python | counter.py | lmerchant/ucsd-ext-put-final | f2a3b45d65e5e902be484ab6cd860d15b1c122ad | [
"MIT"
] | null | null | null | counter.py | lmerchant/ucsd-ext-put-final | f2a3b45d65e5e902be484ab6cd860d15b1c122ad | [
"MIT"
] | null | null | null | counter.py | lmerchant/ucsd-ext-put-final | f2a3b45d65e5e902be484ab6cd860d15b1c122ad | [
"MIT"
] | null | null | null | # counter.py
def inc(x):
"""
Increments the value of x
>>> inc(4)
5
"""
return x + 1
def dec(x):
"""
Decrements the value of x
>>> dec(5)
4
"""
return x - 1
| 9.708333 | 29 | 0.390558 |
def inc(x):
return x + 1
def dec(x):
return x - 1
| true | true |
f76ada56853f7da3c6fd84eade6150112287b5f4 | 1,658 | py | Python | platypush/backend/http/media/handlers/file.py | BlackLight/platypush | 6c0a8bf2599eb4ab41a6122dbd988075d8b1a63a | [
"MIT"
] | 228 | 2018-01-30T11:17:09.000Z | 2022-03-24T11:22:26.000Z | platypush/backend/http/media/handlers/file.py | BlackLight/platypush | 6c0a8bf2599eb4ab41a6122dbd988075d8b1a63a | [
"MIT"
] | 167 | 2017-12-11T19:35:38.000Z | 2022-03-27T14:45:30.000Z | platypush/backend/http/media/handlers/file.py | BlackLight/runbullet | 8d26c8634d2677b4402f0a21b9ab8244b44640db | [
"MIT"
] | 16 | 2018-05-03T07:31:56.000Z | 2021-12-05T19:27:37.000Z | import functools
import mimetypes
import os
from platypush.utils import get_mime_type
from . import MediaHandler
class FileHandler(MediaHandler):
prefix_handlers = ['file://']
def __init__(self, source, *args, **kwargs):
super().__init__(source, *args, **kwargs)
self.path = os.path.abspath... | 32.509804 | 114 | 0.597105 | import functools
import mimetypes
import os
from platypush.utils import get_mime_type
from . import MediaHandler
class FileHandler(MediaHandler):
prefix_handlers = ['file://']
def __init__(self, source, *args, **kwargs):
super().__init__(source, *args, **kwargs)
self.path = os.path.abspath... | true | true |
f76adaedf3d591a695937afa33b7b0f2f20fc2e9 | 4,481 | py | Python | lambda_function.py | andrewguest/slack-free-epic-games | 689c2042af3e8d7053a6487f6726854935a3ccf0 | [
"MIT"
] | 1 | 2021-12-25T22:48:53.000Z | 2021-12-25T22:48:53.000Z | lambda_function.py | andrewguest/slack-free-epic-games | 689c2042af3e8d7053a6487f6726854935a3ccf0 | [
"MIT"
] | null | null | null | lambda_function.py | andrewguest/slack-free-epic-games | 689c2042af3e8d7053a6487f6726854935a3ccf0 | [
"MIT"
] | null | null | null | import os
import logging
from typing import List
from datetime import datetime
from dataclasses import dataclass
import httpx
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
# Logging setup
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# Model setup
@dataclass
class Game:
... | 31.118056 | 99 | 0.5106 | import os
import logging
from typing import List
from datetime import datetime
from dataclasses import dataclass
import httpx
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
@dataclass
class Game:
title: str
store_link: ... | true | true |
f76adb3c7483be6419bc6580f24f8985f536d9ac | 2,052 | py | Python | misc_code/marking_detection.py | pbevan1/Skin-Deep-Unlearning | b8802db8bd61bbf3fdeb10c9899a4117ae38e89c | [
"MIT"
] | 3 | 2021-09-10T21:51:01.000Z | 2022-03-29T15:16:03.000Z | misc_code/marking_detection.py | pbevan1/Skin-Deep-Unlearning | b8802db8bd61bbf3fdeb10c9899a4117ae38e89c | [
"MIT"
] | null | null | null | misc_code/marking_detection.py | pbevan1/Skin-Deep-Unlearning | b8802db8bd61bbf3fdeb10c9899a4117ae38e89c | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import shutil
from zipfile import ZipFile
# Detecting Gentian Violet Markers
# defining numpy arrays for HSV threshold values to look for in images
lower_violet = np.array([125, 100, 60], dtype=np.uint8)
upper_violet = np.arra... | 45.6 | 130 | 0.748538 | import cv2
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import shutil
from zipfile import ZipFile
lower_violet = np.array([125, 100, 60], dtype=np.uint8)
upper_violet = np.array([145, 255, 255], dtype=np.uint8)
folder = '/Data/train'
for im in os.listdir(folder):
src = f'/Data... | true | true |
f76adc3e8cf865642aa6ec00ca8734ce1eb5b649 | 395 | py | Python | yoongram/notifications/migrations/0002_notification_comment.py | happyjy/yoonGram | 20555619721065296d5dab88e80c763b4a3f295e | [
"MIT"
] | null | null | null | yoongram/notifications/migrations/0002_notification_comment.py | happyjy/yoonGram | 20555619721065296d5dab88e80c763b4a3f295e | [
"MIT"
] | 9 | 2021-03-09T02:00:36.000Z | 2022-02-26T10:13:36.000Z | yoongram/notifications/migrations/0002_notification_comment.py | happyjy/yoonGram | 20555619721065296d5dab88e80c763b4a3f295e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.10 on 2019-03-02 14:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
name='comment',
... | 20.789474 | 58 | 0.6 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
name='comment',
field=models.TextField(blank=True, nul... | true | true |
f76add98c5649c81e3e1cb4e382511b985999bae | 2,931 | py | Python | eggs/zc.lockfile-1.1.0-py2.7.egg/zc/lockfile/tests.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | eggs/zc.lockfile-1.1.0-py2.7.egg/zc/lockfile/tests.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | eggs/zc.lockfile-1.1.0-py2.7.egg/zc/lockfile/tests.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 27.650943 | 78 | 0.557489 | import os, re, sys, unittest, doctest
import zc.lockfile, time, threading
from zope.testing import renormalizing, setupstack
checker = renormalizing.RENormalizing([
(re.compile("zc\.lockfile\.LockError:"),
r"LockError:"),
])
def inc():
while 1:
try:
lock = zc.lockfile.LockFile... | true | true |
f76addef04364b01d3fa2c09b3aa617c717d940d | 1,827 | py | Python | unittests/test_ui_helpers.py | stepanandr/taf | 75cb85861f8e9703bab7dc6195f3926b8394e3d0 | [
"Apache-2.0"
] | 10 | 2016-12-16T00:05:58.000Z | 2018-10-30T17:48:25.000Z | unittests/test_ui_helpers.py | stepanandr/taf | 75cb85861f8e9703bab7dc6195f3926b8394e3d0 | [
"Apache-2.0"
] | 40 | 2017-01-04T23:07:05.000Z | 2018-04-16T19:52:02.000Z | unittests/test_ui_helpers.py | stepanandr/taf | 75cb85861f8e9703bab7dc6195f3926b8394e3d0 | [
"Apache-2.0"
] | 23 | 2016-12-30T05:03:53.000Z | 2020-04-01T08:40:24.000Z | # coding=utf-8
# Copyright (c) 2011 - 2017, Intel Corporation.
#
# 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... | 33.218182 | 98 | 0.746579 |
from unittest.mock import MagicMock
import pytest
from .test_ui_onpss_shell import ports_side_effect, multicall_ports_side_effect
from testlib import ui_onpss_shell
@pytest.fixture
def ui_onpss():
return ui_onpss_shell.UiOnpssShell(MagicMock(**{"hw": type("SiliconFM10K", (object,), {})()}))
class TestLagHel... | true | true |
f76adeb093b5fae4c3bbea8ca77ffbbd2bc57d41 | 1,335 | py | Python | ros_ws/src/crazyswarm/scripts/perceived-safety-study/preStudy/main.py | rasmus-rudling/degree-thesis | d74581491ec9618149c582059e290dca9957951d | [
"MIT"
] | null | null | null | ros_ws/src/crazyswarm/scripts/perceived-safety-study/preStudy/main.py | rasmus-rudling/degree-thesis | d74581491ec9618149c582059e290dca9957951d | [
"MIT"
] | null | null | null | ros_ws/src/crazyswarm/scripts/perceived-safety-study/preStudy/main.py | rasmus-rudling/degree-thesis | d74581491ec9618149c582059e290dca9957951d | [
"MIT"
] | null | null | null | import sys
# sys.path.append(
# '/home/rpl/Documents/rasmus/crazyswarm/ros_ws/src/crazyswarm/scripts/perceived-safety-study'
# )
# sys.path.append(
# '/home/rpl/Documents/rasmus/crazyswarm/ros_ws/src/crazyswarm/scripts/perceived-safety-study/utils'
# )
sys.path.append(
"/home/rpl/Documents/rasmus/crazyswa... | 26.7 | 104 | 0.722097 | import sys
sys.path.append(
"/home/rpl/Documents/rasmus/crazyswarm/ros_ws/src/crazyswarm/scripts/perceived-safety-study"
)
sys.path.append(
"/home/rpl/Documents/rasmus/crazyswarm/ros_ws/src/crazyswarm/scripts/perceived-safety-study/utils"
)
from globalVariables import NUM_TRAJECTORIES_TO_TUNE_CBF
from Part... | true | true |
f76adf672617c6a536abcd050203fa9fb05cb252 | 4,421 | py | Python | torchbearer/callbacks/between_class.py | NunoEdgarGFlowHub/torchbearer | d2b21b8ffcabde5b505cb1c736e05af6ee4276ca | [
"MIT"
] | 358 | 2018-07-23T13:30:38.000Z | 2019-06-02T07:18:35.000Z | torchbearer/callbacks/between_class.py | Jayaudaykmar26589/torchbearer | 940e75ec88acd59d5a97aa8c721f7cfa30a5c4d0 | [
"MIT"
] | 307 | 2018-07-18T12:07:23.000Z | 2019-06-03T18:00:27.000Z | torchbearer/callbacks/between_class.py | Jayaudaykmar26589/torchbearer | 940e75ec88acd59d5a97aa8c721f7cfa30a5c4d0 | [
"MIT"
] | 42 | 2018-07-23T22:49:23.000Z | 2019-05-20T07:22:55.000Z | import torchbearer
from torchbearer import Callback
import torch
import torch.nn.functional as F
from torch.distributions import Beta
from torchbearer.bases import cite
bc = """
@inproceedings{tokozume2018between,
title={Between-class learning for image classification},
author={Tokozume, Yuji and Ushiku, Yoshitak... | 40.190909 | 137 | 0.654829 | import torchbearer
from torchbearer import Callback
import torch
import torch.nn.functional as F
from torch.distributions import Beta
from torchbearer.bases import cite
bc = """
@inproceedings{tokozume2018between,
title={Between-class learning for image classification},
author={Tokozume, Yuji and Ushiku, Yoshitak... | true | true |
f76ae0a81b484ceda10f3d6f62a996ce6c8e4edb | 41 | py | Python | bowling/sort/bubble/__init__.py | necromuralist/Bowling-For-Data | 8fb2bff206bf419812f96a5ad243e1d82959a00a | [
"MIT"
] | null | null | null | bowling/sort/bubble/__init__.py | necromuralist/Bowling-For-Data | 8fb2bff206bf419812f96a5ad243e1d82959a00a | [
"MIT"
] | null | null | null | bowling/sort/bubble/__init__.py | necromuralist/Bowling-For-Data | 8fb2bff206bf419812f96a5ad243e1d82959a00a | [
"MIT"
] | null | null | null | from .bubble import bubble, BubbleOutput
| 20.5 | 40 | 0.829268 | from .bubble import bubble, BubbleOutput
| true | true |
f76ae0ad2dd0f3e48ec54485aae531ca213daf2a | 818 | py | Python | django/blog_app/blog_app/urls.py | bogdan-veliscu/react-stack-compare | e7d2020ec8177e12d1b1c41bfaed96c2ee87490c | [
"Apache-2.0"
] | null | null | null | django/blog_app/blog_app/urls.py | bogdan-veliscu/react-stack-compare | e7d2020ec8177e12d1b1c41bfaed96c2ee87490c | [
"Apache-2.0"
] | 7 | 2021-10-06T14:03:21.000Z | 2022-02-27T02:40:18.000Z | django/blog_app/blog_app/urls.py | bogdan-veliscu/react-stack-compare | e7d2020ec8177e12d1b1c41bfaed96c2ee87490c | [
"Apache-2.0"
] | null | null | null | """blog_app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 34.083333 | 77 | 0.705379 | from django.contrib import admin
from django.urls import include, path
from blog import views
urlpatterns = [
path('', include('blog.urls')),
path('admin/', admin.site.urls),
]
| true | true |
f76ae1a386e310fd2d2acd52a1e5caddb7d64f3f | 1,998 | py | Python | test/test_inline_response20053_results.py | Lowe-Man/spoonacular-python-api | c5522abdc2ef48258434e22b4f2038d64bcebd86 | [
"MIT"
] | 21 | 2019-08-09T18:53:26.000Z | 2022-03-14T22:10:10.000Z | test/test_inline_response20053_results.py | Lowe-Man/spoonacular-python-api | c5522abdc2ef48258434e22b4f2038d64bcebd86 | [
"MIT"
] | null | null | null | test/test_inline_response20053_results.py | Lowe-Man/spoonacular-python-api | c5522abdc2ef48258434e22b4f2038d64bcebd86 | [
"MIT"
] | 55 | 2019-08-13T17:52:47.000Z | 2022-03-27T04:29:34.000Z | # coding: utf-8
"""
spoonacular API
The spoonacular Nutrition, Recipe, and Food API allows you to access over 380,000 recipes, thousands of ingredients, 800,000 food products, and 100,000 menu items. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural lang... | 48.731707 | 1,050 | 0.771772 |
from __future__ import absolute_import
import unittest
import spoonacular
from spoonacular.com.spoonacular.client.model.inline_response20053_results import InlineResponse20053Results from spoonacular.rest import ApiException
class TestInlineResponse20053Results(unittest.TestCase):
def setUp(self):
... | true | true |
f76ae243cb32e73f0398fef604c19acfce5be869 | 1,094 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_clear_platform_software_fed_active_acl_counters_hardware/test_api_execute_clear_platform_software_fed_active_acl_counters_hardware.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_clear_platform_software_fed_active_acl_counters_hardware/test_api_execute_clear_platform_software_fed_active_acl_counters_hardware.py | patrickboertje/genielibs | 61c37aacf3dd0f499944555e4ff940f92f53dacb | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_clear_platform_software_fed_active_acl_counters_hardware/test_api_execute_clear_platform_software_fed_active_acl_counters_hardware.py | patrickboertje/genielibs | 61c37aacf3dd0f499944555e4ff940f92f53dacb | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.iosxe.platform.execute import execute_clear_platform_software_fed_active_acl_counters_hardware
class TestExecuteClearPlatformSoftwareFedActiveAclCountersHardware(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed =... | 35.290323 | 119 | 0.680073 | import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.iosxe.platform.execute import execute_clear_platform_software_fed_active_acl_counters_hardware
class TestExecuteClearPlatformSoftwareFedActiveAclCountersHardware(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed =... | true | true |
f76ae31c1070df1c7401f9aad885208e291e4763 | 232 | py | Python | Reduce_hessian/tests/suffix.py | kuanhanl/k_aug | 5ceaccbf9e699a9dffe284de686f1b623cafbec5 | [
"BSD-3-Clause"
] | null | null | null | Reduce_hessian/tests/suffix.py | kuanhanl/k_aug | 5ceaccbf9e699a9dffe284de686f1b623cafbec5 | [
"BSD-3-Clause"
] | null | null | null | Reduce_hessian/tests/suffix.py | kuanhanl/k_aug | 5ceaccbf9e699a9dffe284de686f1b623cafbec5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu May 7 16:00:06 2020
@author: greg6
"""
from pyomo.environ import *
model = ConcreteModel()
model.x = Var()
model.y = Var([1,2,3])
model.foo = Suffix()
model.foo.set_value(model.x, 1.0) | 15.466667 | 35 | 0.633621 |
from pyomo.environ import *
model = ConcreteModel()
model.x = Var()
model.y = Var([1,2,3])
model.foo = Suffix()
model.foo.set_value(model.x, 1.0) | true | true |
f76ae38d44fcd5eb2ef7ef6a74a7192e667cbfdf | 2,980 | py | Python | wfexs_backend/fetchers/pride.py | inab/WES-backend | f260476e782edb52d168703d2c666daf56d48de3 | [
"Apache-2.0"
] | null | null | null | wfexs_backend/fetchers/pride.py | inab/WES-backend | f260476e782edb52d168703d2c666daf56d48de3 | [
"Apache-2.0"
] | null | null | null | wfexs_backend/fetchers/pride.py | inab/WES-backend | f260476e782edb52d168703d2c666daf56d48de3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), Spain
#
# 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... | 36.790123 | 141 | 0.716443 |
from __future__ import absolute_import
import io
import json
from typing import cast, List, Mapping, Optional, Tuple, Union
from urllib import request, parse
import urllib.error
from . import fetchClassicURL, FetcherException
from ..common import AbsPath, AnyURI, ContentKind, SecurityContextConfig
from ..common ... | true | true |
f76ae3c799b74eedb618c683bc935d80519bb226 | 48 | py | Python | util/log/__init__.py | bfgoldstein/tiny_torchfi | 82b0f4931ff8aac6079122200fbe61782bb1f0da | [
"Apache-2.0"
] | null | null | null | util/log/__init__.py | bfgoldstein/tiny_torchfi | 82b0f4931ff8aac6079122200fbe61782bb1f0da | [
"Apache-2.0"
] | null | null | null | util/log/__init__.py | bfgoldstein/tiny_torchfi | 82b0f4931ff8aac6079122200fbe61782bb1f0da | [
"Apache-2.0"
] | 1 | 2021-05-17T00:48:03.000Z | 2021-05-17T00:48:03.000Z | from .log import *
from .format_display import * | 24 | 29 | 0.770833 | from .log import *
from .format_display import * | true | true |
f76ae413f61cb71b5eab82043235c2c4e4e26981 | 1,332 | py | Python | probs/prob55.py | mattrid93/ProjectEuler | 3e1cf1bad9581e526b37d17e20b5fe8af837c1c6 | [
"MIT"
] | null | null | null | probs/prob55.py | mattrid93/ProjectEuler | 3e1cf1bad9581e526b37d17e20b5fe8af837c1c6 | [
"MIT"
] | null | null | null | probs/prob55.py | mattrid93/ProjectEuler | 3e1cf1bad9581e526b37d17e20b5fe8af837c1c6 | [
"MIT"
] | null | null | null | """Problem 55: Lychrel numbers"""
import unittest
def is_palindrome(n):
return str(n) == str(n)[::-1]
def reverse_and_add(n):
"""Returns n + reversed(n)."""
return n + int(str(n)[::-1])
def is_Lychrel(n):
""""Tests up to 50 iterations."""
count = 1
current = n
while count < 50:
cu... | 26.117647 | 53 | 0.632883 | import unittest
def is_palindrome(n):
return str(n) == str(n)[::-1]
def reverse_and_add(n):
return n + int(str(n)[::-1])
def is_Lychrel(n):
count = 1
current = n
while count < 50:
current = reverse_and_add(current)
if is_palindrome(current):
return False
count ... | true | true |
f76ae4bca7d05e7c1363c456ced81a5e807be037 | 207 | py | Python | app/auth/__init__.py | zxyle/staff-server | d52abe7c4dacdabe1242dd7372e34a500c4172c6 | [
"MIT"
] | 6 | 2020-10-08T14:06:15.000Z | 2022-01-24T12:38:59.000Z | app/auth/__init__.py | zxyle/staff-server | d52abe7c4dacdabe1242dd7372e34a500c4172c6 | [
"MIT"
] | 1 | 2020-09-01T01:17:59.000Z | 2020-09-01T01:17:59.000Z | app/auth/__init__.py | zxyle/staff-server | d52abe7c4dacdabe1242dd7372e34a500c4172c6 | [
"MIT"
] | 2 | 2020-11-06T14:16:26.000Z | 2022-01-24T12:39:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Zheng <zxyful@gmail.com>
# Date: 2020-08-30
# Desc:
from flask import Blueprint
auth_blue = Blueprint('auth', __name__)
from . import views, errors | 18.818182 | 39 | 0.68599 | from flask import Blueprint
auth_blue = Blueprint('auth', __name__)
from . import views, errors | true | true |
f76ae56cf8605b89f389064deae83cb00725be7a | 181 | py | Python | scripts/quest/q25517s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 9 | 2021-04-26T11:59:29.000Z | 2021-12-20T13:15:27.000Z | scripts/quest/q25517s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/quest/q25517s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 6 | 2021-07-14T06:32:05.000Z | 2022-02-06T02:32:56.000Z | # Bastion of Light
medal = 1142478
if sm.canHold(medal):
sm.chatScript("You obtained the <Bastion of Light> medal.")
sm.startQuest(parentID)
sm.completeQuest(parentID) | 22.625 | 63 | 0.718232 |
medal = 1142478
if sm.canHold(medal):
sm.chatScript("You obtained the <Bastion of Light> medal.")
sm.startQuest(parentID)
sm.completeQuest(parentID) | true | true |
f76ae658bd1fb96837bf383402a0a4d9ad3210ec | 4,432 | py | Python | mako/stats/xp.py | zer0tonin/mako | 12420056e13e1acd333e686537d5ebc909450620 | [
"MIT"
] | null | null | null | mako/stats/xp.py | zer0tonin/mako | 12420056e13e1acd333e686537d5ebc909450620 | [
"MIT"
] | 1 | 2021-06-02T04:22:46.000Z | 2021-06-02T04:22:46.000Z | mako/stats/xp.py | zer0tonin/mako | 12420056e13e1acd333e686537d5ebc909450620 | [
"MIT"
] | null | null | null | import asyncio
import logging
logger = logging.getLogger(__name__)
def compute_user_level(user_xp):
power = 1
while user_xp >= 2 ** power:
power = power + 1
return power
class XPAggregator:
def __init__(self, redis, levels):
self.redis = redis
self.levels = levels
async... | 35.741935 | 105 | 0.596119 | import asyncio
import logging
logger = logging.getLogger(__name__)
def compute_user_level(user_xp):
power = 1
while user_xp >= 2 ** power:
power = power + 1
return power
class XPAggregator:
def __init__(self, redis, levels):
self.redis = redis
self.levels = levels
async... | true | true |
f76ae73e1ec504f2d14c5b05d5c5543c2c80c18e | 183 | py | Python | web-interface/app/application/samples/pages/filters.py | horvathi94/seqmeta | 94f2f04c372181c93a6f68b6efe15b141ef02779 | [
"MIT"
] | null | null | null | web-interface/app/application/samples/pages/filters.py | horvathi94/seqmeta | 94f2f04c372181c93a6f68b6efe15b141ef02779 | [
"MIT"
] | null | null | null | web-interface/app/application/samples/pages/filters.py | horvathi94/seqmeta | 94f2f04c372181c93a6f68b6efe15b141ef02779 | [
"MIT"
] | null | null | null | from enum import Enum
class GisaidSubmission(Enum):
NONE = 0
SUBMITTED = 1
NOT_SUBMITTED = 2
class HasConsensus(Enum):
NONE = 0
HAS_FILE = 1
NO_FILE = 2
| 11.4375 | 29 | 0.628415 | from enum import Enum
class GisaidSubmission(Enum):
NONE = 0
SUBMITTED = 1
NOT_SUBMITTED = 2
class HasConsensus(Enum):
NONE = 0
HAS_FILE = 1
NO_FILE = 2
| true | true |
f76ae73e89dce3c5941fed39652c2ad93ec2e096 | 6,054 | py | Python | simplebgc/command_names.py | maiermic/robot-cameraman | afe441cf1677322062da77aa782a08f10440fcc7 | [
"MIT"
] | 7 | 2019-11-17T13:18:07.000Z | 2022-03-13T04:14:15.000Z | simplebgc/command_names.py | maiermic/robot-cameraman | afe441cf1677322062da77aa782a08f10440fcc7 | [
"MIT"
] | 14 | 2021-02-03T16:21:21.000Z | 2022-03-11T23:57:48.000Z | simplebgc/command_names.py | maiermic/robot-cameraman | afe441cf1677322062da77aa782a08f10440fcc7 | [
"MIT"
] | 2 | 2021-04-21T21:22:49.000Z | 2021-05-28T17:39:13.000Z | from typing import Optional
from simplebgc.command_ids import *
INCOMING_COMMAND_NAMES = {
CMD_BOARD_INFO: 'CMD_BOARD_INFO',
CMD_BOARD_INFO_3: 'CMD_BOARD_INFO_3',
CMD_READ_PARAMS_3: 'CMD_READ_PARAMS_3',
CMD_READ_PARAMS_EXT: 'CMD_READ_PARAMS_EXT',
CMD_READ_PARAMS_EXT2: 'CMD_READ_PARAMS_EXT2',
C... | 41.183673 | 71 | 0.780806 | from typing import Optional
from simplebgc.command_ids import *
INCOMING_COMMAND_NAMES = {
CMD_BOARD_INFO: 'CMD_BOARD_INFO',
CMD_BOARD_INFO_3: 'CMD_BOARD_INFO_3',
CMD_READ_PARAMS_3: 'CMD_READ_PARAMS_3',
CMD_READ_PARAMS_EXT: 'CMD_READ_PARAMS_EXT',
CMD_READ_PARAMS_EXT2: 'CMD_READ_PARAMS_EXT2',
C... | true | true |
f76ae7a1a52374b4e4c42f47fcd617945cfefdec | 4,385 | py | Python | src/mbed_tools/cli/build.py | ladislas/mbed-tools | 2ab99a15a38704574cd1e379ad4e09dd994db49c | [
"Apache-2.0"
] | null | null | null | src/mbed_tools/cli/build.py | ladislas/mbed-tools | 2ab99a15a38704574cd1e379ad4e09dd994db49c | [
"Apache-2.0"
] | null | null | null | src/mbed_tools/cli/build.py | ladislas/mbed-tools | 2ab99a15a38704574cd1e379ad4e09dd994db49c | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2020 Arm Mbed. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Command to build/compile an Mbed project using CMake."""
import os
import pathlib
import shutil
import click
from mbed_tools.build import build_project, generate_build_system, generate_config, flash_binary
from mbed_tools... | 38.130435 | 120 | 0.693273 | import os
import pathlib
import shutil
import click
from mbed_tools.build import build_project, generate_build_system, generate_config, flash_binary
from mbed_tools.devices import find_connected_device
from mbed_tools.project import MbedProgram
from mbed_tools.sterm import terminal
@click.command(name="compile", he... | true | true |
f76ae7f179d743ad3c147606b6a20687415c6085 | 2,757 | py | Python | gs-broker/gs-broker.py | cona-1030/gedge-platform | 37999afdada7f3bc4ccbb700fd55755aa9658e55 | [
"Apache-2.0"
] | 13 | 2020-10-14T07:45:08.000Z | 2021-10-01T08:19:56.000Z | gs-broker/gs-broker.py | cona-1030/gedge-platform | 37999afdada7f3bc4ccbb700fd55755aa9658e55 | [
"Apache-2.0"
] | null | null | null | gs-broker/gs-broker.py | cona-1030/gedge-platform | 37999afdada7f3bc4ccbb700fd55755aa9658e55 | [
"Apache-2.0"
] | 17 | 2020-11-09T05:16:42.000Z | 2021-12-28T08:04:33.000Z | import datetime
import json
import os
import sys
import paho.mqtt.client as mqtt
import multiprocessing
import grpc
if sys.version_info >= (3, 0):
from http.server import BaseHTTPRequestHandler, HTTPServer
else:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from pb.gsgateway_pb2
from pb.gsgatew... | 33.216867 | 123 | 0.676097 | import datetime
import json
import os
import sys
import paho.mqtt.client as mqtt
import multiprocessing
import grpc
if sys.version_info >= (3, 0):
from http.server import BaseHTTPRequestHandler, HTTPServer
else:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from pb.gsgateway_pb2
from pb.gsgatew... | false | true |
f76ae839da06eaf78d29a2b799b9e029a000138b | 483 | py | Python | webapp.py | sheldon-cooper26/PythonFlask-Docker | 6d366e3a21eac0fe3913c9b5c84bb9df49bbb238 | [
"MIT"
] | null | null | null | webapp.py | sheldon-cooper26/PythonFlask-Docker | 6d366e3a21eac0fe3913c9b5c84bb9df49bbb238 | [
"MIT"
] | null | null | null | webapp.py | sheldon-cooper26/PythonFlask-Docker | 6d366e3a21eac0fe3913c9b5c84bb9df49bbb238 | [
"MIT"
] | null | null | null | from flask import Flask, flash, redirect, render_template, request, session, abort
app = Flask(__name__)
@app.route("/")
def index():
return "Flask App!"
@app.route("/plants")
def plants():
return render_template('plants.html')
@app.route("/animals")
def animals():
return render_template('animals.html')... | 21 | 82 | 0.677019 | from flask import Flask, flash, redirect, render_template, request, session, abort
app = Flask(__name__)
@app.route("/")
def index():
return "Flask App!"
@app.route("/plants")
def plants():
return render_template('plants.html')
@app.route("/animals")
def animals():
return render_template('animals.html')... | true | true |
f76ae874d4a6b72a93659e49d8375c8dcf8ed992 | 27,939 | py | Python | fairscale/optim/adascale.py | ncilfone/fairscale | b434b7354898febf718f23c7ff21368a6e0bbe1a | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | fairscale/optim/adascale.py | ncilfone/fairscale | b434b7354898febf718f23c7ff21368a6e0bbe1a | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | fairscale/optim/adascale.py | ncilfone/fairscale | b434b7354898febf718f23c7ff21368a6e0bbe1a | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# Copyright 2020 Petuum, Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without... | 43.049307 | 120 | 0.629765 |
import functools
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type
import numpy as np
import torch
from torch.autograd import Variable
import torch.distributed as dist
from torch.optim import SGD, Optimizer
if TYPE_CHECKING: from torch.optim.optimizer import _params_t
else:
_params_t = Any
... | true | true |
f76ae9b4c4505b6811adcc7fecff5e2ffca63cd4 | 255 | py | Python | mysite/forms.py | wamakimaN/Instaclone | 4f93cab6e61617eb549c1460e6b1b32dac6eea15 | [
"MIT"
] | null | null | null | mysite/forms.py | wamakimaN/Instaclone | 4f93cab6e61617eb549c1460e6b1b32dac6eea15 | [
"MIT"
] | 4 | 2020-06-06T00:34:31.000Z | 2021-09-08T01:39:09.000Z | mysite/forms.py | wamakimaN/Instaclone | 4f93cab6e61617eb549c1460e6b1b32dac6eea15 | [
"MIT"
] | null | null | null | from django import forms
from .models import Post, Profile
class PostForm(forms.ModelForm):
class Meta:
model = Post
exclude = ['profile','posted_on']
class ProfileUpdateForm(forms.ModelForm):
class Meta:
model = Profile
fields = [] | 21.25 | 41 | 0.701961 | from django import forms
from .models import Post, Profile
class PostForm(forms.ModelForm):
class Meta:
model = Post
exclude = ['profile','posted_on']
class ProfileUpdateForm(forms.ModelForm):
class Meta:
model = Profile
fields = [] | true | true |
f76aec04a7a1859d81f12c861ad070ba5e6d824c | 6,414 | py | Python | repo_admin/tests/test_schema.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 26 | 2019-12-16T21:22:14.000Z | 2022-03-25T16:05:32.000Z | repo_admin/tests/test_schema.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 325 | 2019-10-28T16:24:45.000Z | 2022-03-31T13:12:15.000Z | repo_admin/tests/test_schema.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 9 | 2019-10-09T16:20:38.000Z | 2021-12-22T18:44:45.000Z | from math import floor
import pytest
import sqlalchemy.exc
from repo_admin.bare_database.model import Role
from repo_admin.bare_database.schema import RepoDatabase, fingerprints_table
from tests.conftest import integration
from tests.helpers import connect_as, insert_one, select_one, insert_many, select_all, files, R... | 33.061856 | 119 | 0.752572 | from math import floor
import pytest
import sqlalchemy.exc
from repo_admin.bare_database.model import Role
from repo_admin.bare_database.schema import RepoDatabase, fingerprints_table
from tests.conftest import integration
from tests.helpers import connect_as, insert_one, select_one, insert_many, select_all, files, R... | true | true |
f76aecd1b47fe2188c24de8aaf4f67624e35c1ef | 90 | py | Python | src/openclimategis/util/ncconv/experimental/ocg_dataset/__init__.py | Peshal1067/OpenClimateGIS | 297db6ae1f6dd8459ede6bed905c8d85bd93c5d6 | [
"BSD-3-Clause"
] | 3 | 2015-04-23T09:09:04.000Z | 2020-02-26T17:40:19.000Z | src/openclimategis/util/ncconv/experimental/ocg_dataset/__init__.py | arthur-e/OpenClimateGIS | 297db6ae1f6dd8459ede6bed905c8d85bd93c5d6 | [
"BSD-3-Clause"
] | null | null | null | src/openclimategis/util/ncconv/experimental/ocg_dataset/__init__.py | arthur-e/OpenClimateGIS | 297db6ae1f6dd8459ede6bed905c8d85bd93c5d6 | [
"BSD-3-Clause"
] | 2 | 2017-05-30T10:27:36.000Z | 2020-11-09T13:52:58.000Z | from dataset import OcgDataset, MaskedDataError, ExtentError
from sub import SubOcgDataset | 45 | 60 | 0.877778 | from dataset import OcgDataset, MaskedDataError, ExtentError
from sub import SubOcgDataset | true | true |
f76aece9a99b7c266c5dbe62a62bea5c4e8b5f20 | 4,176 | py | Python | src/snowflake/connector/auth_keypair.py | KyleJamesWalker/snowflake-connector-python | fb52f054246701052deaa8b587f669cc09325b24 | [
"Apache-2.0"
] | 1 | 2021-08-06T07:21:09.000Z | 2021-08-06T07:21:09.000Z | src/snowflake/connector/auth_keypair.py | KyleJamesWalker/snowflake-connector-python | fb52f054246701052deaa8b587f669cc09325b24 | [
"Apache-2.0"
] | 37 | 2021-08-11T23:22:14.000Z | 2021-08-12T22:27:15.000Z | src/snowflake/connector/auth_keypair.py | KyleJamesWalker/snowflake-connector-python | fb52f054246701052deaa8b587f669cc09325b24 | [
"Apache-2.0"
] | 1 | 2021-07-21T00:56:49.000Z | 2021-07-21T00:56:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import base64
import hashlib
from datetime import datetime, timedelta
from logging import getLogger
from typing import Optional
import jwt
from cryptography.hazmat.backends import default_backend
f... | 31.164179 | 101 | 0.633381 |
import base64
import hashlib
from datetime import datetime, timedelta
from logging import getLogger
from typing import Optional
import jwt
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey
from cryptography.hazmat.primitives.serialization ... | true | true |
f76aed8c8f6072cfe43cabb6c6bcd51879ea1f4f | 686 | py | Python | app/core/migrations/0003_ingrediant.py | Nick-foote/recipe-tutorial | 9168e76d3012f01d9a1dd77d817b850b04a23d02 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingrediant.py | Nick-foote/recipe-tutorial | 9168e76d3012f01d9a1dd77d817b850b04a23d02 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingrediant.py | Nick-foote/recipe-tutorial | 9168e76d3012f01d9a1dd77d817b850b04a23d02 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-12-02 21:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... | 28.583333 | 118 | 0.618076 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingrediant',
fields=[
... | true | true |
f76aefcb114ecb90506c66a4bf830e5f4a65d013 | 1,955 | py | Python | state_machines/control.py | carrasquel/SmartHomeApp | e5fb8eda0ddd103ba5366ed892bdce58ab768352 | [
"MIT"
] | null | null | null | state_machines/control.py | carrasquel/SmartHomeApp | e5fb8eda0ddd103ba5366ed892bdce58ab768352 | [
"MIT"
] | null | null | null | state_machines/control.py | carrasquel/SmartHomeApp | e5fb8eda0ddd103ba5366ed892bdce58ab768352 | [
"MIT"
] | null | null | null | import pigpio
from datetime import datetime
from rackio import Rackio, RackioStateMachine, State, GroupBinding
app = Rackio()
@app.define_machine('SmartHome', 60)
class SmartHome(RackioStateMachine):
# State Definitions
starting = State('start', initial=True)
running = State('on')
idle = State('off'... | 26.780822 | 101 | 0.617391 | import pigpio
from datetime import datetime
from rackio import Rackio, RackioStateMachine, State, GroupBinding
app = Rackio()
@app.define_machine('SmartHome', 60)
class SmartHome(RackioStateMachine):
starting = State('start', initial=True)
running = State('on')
idle = State('off')
start_to_... | true | true |
f76af01402c84679e4cd7f2bf52f632e7cb9898c | 2,870 | py | Python | contrib/avro/tests/python/pants_test/contrib/avro/tasks/test_avro_gen.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | contrib/avro/tests/python/pants_test/contrib/avro/tasks/test_avro_gen.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | contrib/avro/tests/python/pants_test/contrib/avro/tasks/test_avro_gen.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from textwrap import dedent
from pants.build_graph.build_file_aliases import BuildFileAl... | 32.613636 | 107 | 0.690592 |
from __future__ import absolute_import, division, print_function, unicode_literals
from textwrap import dedent
from pants.build_graph.build_file_aliases import BuildFileAliases
from pants_test.jvm.nailgun_task_test_base import NailgunTaskTestBase
from pants.contrib.avro.targets.java_avro_library import JavaAvroLibr... | true | true |
f76af055e888fc048c173bf12305b2900846dced | 2,491 | py | Python | examples/misc/exp_joint.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | examples/misc/exp_joint.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | examples/misc/exp_joint.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
This file is part of PyMbs.
PyMbs is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
PyMbs is distributed ... | 28.965116 | 73 | 0.625452 |
L = 3 d = 0.2 n = 3
from PyMbs.Input import *
world = MbsSystem([0, 0, -1])
bodies = [None]*n
joints = [None]*n
sensors = [None]*n
for i in range(0, n):
rho = 500 r = 0.1 l = L/n
m = rho*pi*r**2*l
bodies[i] = world.addBody(name='part%i_'%i, mass=m, cg=[l/2, 0,... | true | true |
f76af0d8280c6d71ba61fadf9e43c810cef6a0da | 6,234 | py | Python | create_ycb_sdf.py | lianghongzhuo/ycb-tools | e5d99a23a2b8b345c571acf9c8ea10a648d7fb03 | [
"MIT"
] | 2 | 2021-04-24T06:01:02.000Z | 2022-03-07T10:55:32.000Z | create_ycb_sdf.py | lianghongzhuo/ycb-tools | e5d99a23a2b8b345c571acf9c8ea10a648d7fb03 | [
"MIT"
] | null | null | null | create_ycb_sdf.py | lianghongzhuo/ycb-tools | e5d99a23a2b8b345c571acf9c8ea10a648d7fb03 | [
"MIT"
] | 1 | 2021-12-24T07:15:41.000Z | 2021-12-24T07:15:41.000Z | import os
import trimesh
import numpy as np
"""
Creates Gazebo compatible SDF files from downloaded YCB data.
This looks through all the YCB objects you have downloaded in a particular
folder, and creates Gazebo compatible SDF files from a set of templates.
If the object has google_16k meshes downloaded, it will us... | 46.522388 | 113 | 0.594161 | import os
import trimesh
import numpy as np
downsample_ratio = 0.33
ycb_folder = os.path.join("models", "ycb")
template_folder = os.path.join("templates", "ycb")
if __name__ == "__main__":
print("Creating files to use YCB objects in Gazebo...")
folder_names = os.listdir(ycb_folder)
config_tem... | true | true |
f76af0fa282bbb280e9c811221029660a94a3688 | 151 | py | Python | datahub/investment/investor_profile/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/investment/investor_profile/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/investment/investor_profile/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | """Functionality related to investor profiles for companies."""
default_app_config = 'datahub.investment.investor_profile.apps.InvestorProfileConfig'
| 37.75 | 85 | 0.834437 |
default_app_config = 'datahub.investment.investor_profile.apps.InvestorProfileConfig'
| true | true |
f76af12c057d5c720081e94a13bdf5589ab9a2c5 | 339,785 | py | Python | sympy/integrals/rubi/rules/hyperbolic.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/integrals/rubi/rules/hyperbolic.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/integrals/rubi/rules/hyperbolic.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | """
This code is automatically generated. Never edit it manually.
For details of generating the code see `rubi_parsing_guide.md` in `parsetools`.
"""
from sympy.external import import_module
matchpy = import_module("matchpy")
if matchpy:
from matchpy import Pattern, ReplacementRule, CustomConstraint, is_match
... | 24.352111 | 88 | 0.354657 |
from sympy.external import import_module
matchpy = import_module("matchpy")
if matchpy:
from matchpy import Pattern, ReplacementRule, CustomConstraint, is_match
from sympy.integrals.rubi.utility_function import (
Int,
Sum,
Set,
With,
Module,
Scan,
MapAn... | true | true |
f76af206da5b036f82bd337947ad5e1052f81d3c | 5,724 | py | Python | tests/bundles/graphene/test_mutations.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | null | null | null | tests/bundles/graphene/test_mutations.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | null | null | null | tests/bundles/graphene/test_mutations.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | null | null | null | import pytest
from flask_unchained import unchained
from ._bundles.graphene_bundle.graphql import types
parent_manager = unchained.get_local_proxy('parent_manager')
child_manager = unchained.get_local_proxy('child_manager')
CREATE_PARENT = '''
mutation createParent($name: String!, $children: [ID] = []) {
cre... | 38.416107 | 90 | 0.575472 | import pytest
from flask_unchained import unchained
from ._bundles.graphene_bundle.graphql import types
parent_manager = unchained.get_local_proxy('parent_manager')
child_manager = unchained.get_local_proxy('child_manager')
CREATE_PARENT = '''
mutation createParent($name: String!, $children: [ID] = []) {
cre... | true | true |
f76af357740d908216b07141b7334f17ab79271e | 1,856 | py | Python | ndscheduler/corescheduler/constants.py | palto42/ndscheduler | dc875b5c32192cb1fe2d658f320f81215cb1d9f5 | [
"BSD-2-Clause"
] | 9 | 2021-05-03T07:31:22.000Z | 2022-03-19T23:07:36.000Z | ndscheduler/corescheduler/constants.py | palto42/ndscheduler | dc875b5c32192cb1fe2d658f320f81215cb1d9f5 | [
"BSD-2-Clause"
] | 2 | 2021-05-01T14:40:21.000Z | 2021-06-20T16:50:37.000Z | ndscheduler/corescheduler/constants.py | palto42/ndscheduler | dc875b5c32192cb1fe2d658f320f81215cb1d9f5 | [
"BSD-2-Clause"
] | 3 | 2021-10-12T04:10:10.000Z | 2022-03-19T23:28:32.000Z | """Constants used in corescheduler library."""
#
# Database settings
#
DEFAULT_JOBS_TABLENAME = "scheduler_jobs"
DEFAULT_EXECUTIONS_TABLENAME = "scheduler_execution"
DEFAULT_AUDIT_LOGS_TABLENAME = "scheduler_jobauditlog"
#
# APScheduler Settings
#
DEFAULT_THREAD_POOL_SIZE = 4
DEFAULT_JOB_MAX_INSTANCES = 3
DEFAULT_JOB... | 26.140845 | 81 | 0.778017 |
DEFAULT_JOBS_TABLENAME = "scheduler_jobs"
DEFAULT_EXECUTIONS_TABLENAME = "scheduler_execution"
DEFAULT_AUDIT_LOGS_TABLENAME = "scheduler_jobauditlog"
DEFAULT_THREAD_POOL_SIZE = 4
DEFAULT_JOB_MAX_INSTANCES = 3
DEFAULT_JOB_COALESCE = True
DEFAULT_TIMEZONE = "UTC"
DEFAULT_JOB_MISFIRE_GRACE_SEC = 3600
# Number of args ... | true | true |
f76af465250fa3d3a06fe9935c3b5adf3e2200aa | 5,297 | py | Python | real_time_ABRS.py | neilzhang-ucsb/ABRS | 03acc766f87e58870fe39d5403570c44be69f235 | [
"BSD-2-Clause"
] | 10 | 2019-03-01T06:14:56.000Z | 2021-07-28T14:33:48.000Z | real_time_ABRS.py | neilzhang-ucsb/ABRS | 03acc766f87e58870fe39d5403570c44be69f235 | [
"BSD-2-Clause"
] | 2 | 2019-09-13T16:06:23.000Z | 2022-03-28T22:40:33.000Z | real_time_ABRS.py | neilzhang-ucsb/ABRS | 03acc766f87e58870fe39d5403570c44be69f235 | [
"BSD-2-Clause"
] | 6 | 2019-05-28T06:26:53.000Z | 2020-10-16T03:07:13.000Z | #real_time_ABRS
# Copyright (c) 2019 Primoz Ravbar UCSB
# Licensed under BSD 2-Clause [see LICENSE for details]
# Written by Primoz Ravbar
import numpy as np
import matplotlib.pyplot as plt
import cv2
import pickle
import msvcrt
from scipy import misc #pip install pillow
import scipy
from scipy impor... | 24.868545 | 118 | 0.636209 |
import numpy as np
import matplotlib.pyplot as plt
import cv2
import pickle
import msvcrt
from scipy import misc import scipy
from scipy import ndimage
from PIL import Image
from ABRS_modules import getting_frame_record
from ABRS_modules import center_of_gravity
from ABRS_modules import subtract... | true | true |
f76af477a877bb0f9700179c817d7910e995d16b | 19,306 | py | Python | model_card_toolkit/utils/graphics_test.py | moshebeeri/model-card-toolkit | dc657a962682af5c5a8f4f3a07e5ec75260e5288 | [
"Apache-2.0"
] | 267 | 2020-07-29T18:50:05.000Z | 2022-03-21T15:45:53.000Z | model_card_toolkit/utils/graphics_test.py | moshebeeri/model-card-toolkit | dc657a962682af5c5a8f4f3a07e5ec75260e5288 | [
"Apache-2.0"
] | 60 | 2020-07-31T08:05:14.000Z | 2022-03-29T22:09:30.000Z | model_card_toolkit/utils/graphics_test.py | moshebeeri/model-card-toolkit | dc657a962682af5c5a8f4f3a07e5ec75260e5288 | [
"Apache-2.0"
] | 47 | 2020-07-29T23:32:03.000Z | 2022-03-23T07:51:00.000Z | # Copyright 2020 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, ... | 31.290113 | 126 | 0.459287 |
import logging
from absl.testing import absltest
from absl.testing import parameterized
from model_card_toolkit import model_card as model_card_module
from model_card_toolkit.utils import graphics
import tensorflow_model_analysis as tfma
from google.protobuf import text_format
from tensorflow_metadata.proto.v0 import ... | true | true |
f76af4ba258ba912f06db2e09818e2b60df435af | 1,506 | py | Python | functions/losses.py | saralajew/robustNPCs | 41f2ce5618003a10db11601cded71ec3ba538bcc | [
"BSD-3-Clause"
] | 1 | 2020-11-02T09:05:44.000Z | 2020-11-02T09:05:44.000Z | functions/losses.py | saralajew/robust_NPCs | 41f2ce5618003a10db11601cded71ec3ba538bcc | [
"BSD-3-Clause"
] | null | null | null | functions/losses.py | saralajew/robust_NPCs | 41f2ce5618003a10db11601cded71ec3ba538bcc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras import backend as K
import numpy as np
class TripletReluLoss(object):
def __init__(self, p_norm, eps=0.):
self.p_norm = p_norm
self.eps = eps
def _... | 27.888889 | 72 | 0.562417 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras import backend as K
import numpy as np
class TripletReluLoss(object):
def __init__(self, p_norm, eps=0.):
self.p_norm = p_norm
self.eps = eps
def __call__(self, y_true, y_... | true | true |
f76af62fe4ae092387231ab929bc54d59265697c | 540 | py | Python | maxsum/main/main.py | arunstiwari/python-docker-demo | a6e6363c9a03f100563ae573d98035dd000c2315 | [
"MIT"
] | 17 | 2017-05-19T23:18:24.000Z | 2021-04-26T07:43:30.000Z | maxsum/main/main.py | arunstiwari/python-docker-demo | a6e6363c9a03f100563ae573d98035dd000c2315 | [
"MIT"
] | null | null | null | maxsum/main/main.py | arunstiwari/python-docker-demo | a6e6363c9a03f100563ae573d98035dd000c2315 | [
"MIT"
] | 31 | 2017-05-02T00:51:21.000Z | 2021-06-26T22:26:38.000Z | from ..core import maxsum
from ..cli import argparse
class Main:
def __init__(self):
self.args = None
def setArgs(self,args):
self.args = args
def run(self):
parser = argparse.MaxSumArgparse()
args = parser.parse(self.args)
p = maxsum.MaxSum()
p.setInteger... | 19.285714 | 42 | 0.596296 | from ..core import maxsum
from ..cli import argparse
class Main:
def __init__(self):
self.args = None
def setArgs(self,args):
self.args = args
def run(self):
parser = argparse.MaxSumArgparse()
args = parser.parse(self.args)
p = maxsum.MaxSum()
p.setInteger... | true | true |
f76af67d665e7a7a839621589c6d44a1d39a50be | 5,450 | py | Python | misago/misago/users/tests/test_validators.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | 2 | 2021-03-06T21:06:13.000Z | 2021-03-09T15:05:12.000Z | misago/misago/users/tests/test_validators.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | null | null | null | misago/misago/users/tests/test_validators.py | vascoalramos/misago-deployment | 20226072138403108046c0afad9d99eb4163cedc | [
"MIT"
] | null | null | null | from unittest.mock import Mock
from django.core.exceptions import ValidationError
from django.test import TestCase
from ..models import Ban
from ..test import create_test_user
from ..validators import (
validate_email,
validate_email_available,
validate_email_banned,
validate_gmail_email,
validate... | 35.855263 | 88 | 0.705138 | from unittest.mock import Mock
from django.core.exceptions import ValidationError
from django.test import TestCase
from ..models import Ban
from ..test import create_test_user
from ..validators import (
validate_email,
validate_email_available,
validate_email_banned,
validate_gmail_email,
validate... | true | true |
f76af6c42e612a666cf173ef31606c75251c07b7 | 2,385 | py | Python | test/install.py | gunjanbaid/octopus | b19e825d10c16bc14565338aadf4aee63c8fe816 | [
"MIT"
] | 278 | 2016-10-03T16:30:49.000Z | 2022-03-25T05:59:32.000Z | test/install.py | gunjanbaid/octopus | b19e825d10c16bc14565338aadf4aee63c8fe816 | [
"MIT"
] | 229 | 2016-10-13T14:07:35.000Z | 2022-03-19T18:59:58.000Z | test/install.py | gunjanbaid/octopus | b19e825d10c16bc14565338aadf4aee63c8fe816 | [
"MIT"
] | 37 | 2016-10-28T22:47:54.000Z | 2022-03-20T07:28:43.000Z | #!/usr/bin/env python3
import os
from subprocess import call
import argparse
import multiprocessing
def run_unit_tests(octopus_build_dir, use_verbose_output):
octopus_test_dir = octopus_build_dir + "/test"
os.chdir(octopus_test_dir)
ctest_options = []
if use_verbose_output:
ctest_options.appen... | 30.576923 | 112 | 0.650314 |
import os
from subprocess import call
import argparse
import multiprocessing
def run_unit_tests(octopus_build_dir, use_verbose_output):
octopus_test_dir = octopus_build_dir + "/test"
os.chdir(octopus_test_dir)
ctest_options = []
if use_verbose_output:
ctest_options.append("--verbose")
call... | true | true |
f76af6f1bdfa86e22acaa51e11710b716b03d492 | 1,749 | py | Python | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/__init__.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 11 | 2019-03-20T07:38:35.000Z | 2021-06-18T09:42:46.000Z | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/__init__.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 1 | 2019-04-04T23:32:50.000Z | 2019-04-04T23:34:19.000Z | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/__init__.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 7 | 2015-08-19T16:01:16.000Z | 2021-06-10T19:54:11.000Z | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above ... | 41.642857 | 72 | 0.758148 |
import unittest
from test_views import *
from test_store import *
from test_auth import *
from test_admin import *
def suite():
suite = unittest.TestSuite()
for name in ['test_auth', 'test_store', 'test_views', 'test_admin']:
mod = __import__('%s.%s' % (__name__, name), {}, {}, ['suite'])
sui... | true | true |
f76af703ae18e44823ee9e7d47fc3ba341a554dd | 5,162 | py | Python | gamestonk_terminal/etf/etf_controller.py | DT021/GamestonkTerminal | 10d231ec2f86a19e69fdb65a2f4d37f33f723f6a | [
"MIT"
] | 1 | 2021-07-25T20:34:29.000Z | 2021-07-25T20:34:29.000Z | gamestonk_terminal/etf/etf_controller.py | DT021/GamestonkTerminal | 10d231ec2f86a19e69fdb65a2f4d37f33f723f6a | [
"MIT"
] | 1 | 2022-02-10T06:49:37.000Z | 2022-02-10T06:49:37.000Z | gamestonk_terminal/etf/etf_controller.py | DT021/GamestonkTerminal | 10d231ec2f86a19e69fdb65a2f4d37f33f723f6a | [
"MIT"
] | null | null | null | """ETF Controller"""
__docformat__ = "numpy"
import argparse
import os
from typing import List
import matplotlib.pyplot as plt
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.helper_funcs import get_flair
from gamestonk_terminal.menu im... | 29.163842 | 101 | 0.586207 | __docformat__ = "numpy"
import argparse
import os
from typing import List
import matplotlib.pyplot as plt
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.helper_funcs import get_flair
from gamestonk_terminal.menu import session
from gam... | true | true |
f76af75ec0cd4f51f7701b682dab9ff79eb1198e | 1,770 | py | Python | mini-project-2/twenty_news_run.py | ding-ma/applied-ml | 91f5ade1984e84fd252fbc76d72f0ee8bd5c96d0 | [
"MIT"
] | null | null | null | mini-project-2/twenty_news_run.py | ding-ma/applied-ml | 91f5ade1984e84fd252fbc76d72f0ee8bd5c96d0 | [
"MIT"
] | null | null | null | mini-project-2/twenty_news_run.py | ding-ma/applied-ml | 91f5ade1984e84fd252fbc76d72f0ee8bd5c96d0 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import itertools
from random import randrange
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.utils import shuffle
from sklearn.naive_bayes import MultinomialNB, BernoulliNB
fr... | 33.396226 | 115 | 0.770621 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import itertools
from random import randrange
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.utils import shuffle
from sklearn.naive_bayes import MultinomialNB, BernoulliNB
fr... | true | true |
f76af77f772e2c611ff4c21a585f0ea9b2c58605 | 2,616 | py | Python | samples/cli/accelbyte_py_sdk_cli/basic/_get_banned_users.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | samples/cli/accelbyte_py_sdk_cli/basic/_get_banned_users.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | samples/cli/accelbyte_py_sdk_cli/basic/_get_banned_users.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-basic-service (1.36.3)
# pylint: disable=duplicate-code
... | 32.7 | 88 | 0.728593 |
import json
import yaml
from typing import Optional
import click
from .._utils import login_as as login_as_internal
from .._utils import to_dict
from accelbyte_py_sdk.api.basic import get_banned_users as get_banned_users_internal
from accelbyte_py_sdk.api.basic.models import ADTOObjectForEqu8UserBanStatus
from ac... | true | true |
f76af7a3ef75a41a4fec82d79ab176145cccc269 | 40,911 | py | Python | tests/transformers/grobid_jats_xslt_test.py | elifesciences/sciencebeam-pipelines | 3bbffb1060262d517bd0efd474f0b477e6854c06 | [
"MIT"
] | null | null | null | tests/transformers/grobid_jats_xslt_test.py | elifesciences/sciencebeam-pipelines | 3bbffb1060262d517bd0efd474f0b477e6854c06 | [
"MIT"
] | 49 | 2021-11-08T11:12:11.000Z | 2022-03-29T19:17:32.000Z | tests/transformers/grobid_jats_xslt_test.py | elifesciences/sciencebeam-pipelines | 3bbffb1060262d517bd0efd474f0b477e6854c06 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
import logging
from typing import List, Optional
try:
from typing import Protocol
except ImportError:
from typing_extensions import Protocol
import pytest
from lxml import etree
from lxml.builder import ElementMaker
from sciencebeam_utils.utils.collection import extend_dict
... | 37.464286 | 99 | 0.516365 | import logging
from typing import List, Optional
try:
from typing import Protocol
except ImportError:
from typing_extensions import Protocol
import pytest
from lxml import etree
from lxml.builder import ElementMaker
from sciencebeam_utils.utils.collection import extend_dict
from sciencebeam_utils.utils.xml ... | true | true |
f76af8ddae2fc2e60bab24bee31d39f4e3543536 | 15,182 | py | Python | intersight/model/connector_winrm_request.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/connector_winrm_request.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/connector_winrm_request.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 55.408759 | 1,678 | 0.647675 |
import re import sys
from intersight.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_... | true | true |
f76afb07077ad3305dc06d2b6df46d1926b7d345 | 765 | py | Python | tests/terraform/checks/resource/gcp/test_GoogleCloudSqlDatabaseRequireSsl.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | tests/terraform/checks/resource/gcp/test_GoogleCloudSqlDatabaseRequireSsl.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | tests/terraform/checks/resource/gcp/test_GoogleCloudSqlDatabaseRequireSsl.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import unittest
from checkov.terraform.checks.resource.gcp.GoogleCloudSqlDatabaseRequireSsl import check
from checkov.common.models.enums import CheckResult
class GoogleCloudSqlDatabaseRequireSsl(unittest.TestCase):
def test_failure(self):
resource_conf = {'name': ['google_cluster'], 'monitoring_service... | 33.26087 | 102 | 0.729412 | import unittest
from checkov.terraform.checks.resource.gcp.GoogleCloudSqlDatabaseRequireSsl import check
from checkov.common.models.enums import CheckResult
class GoogleCloudSqlDatabaseRequireSsl(unittest.TestCase):
def test_failure(self):
resource_conf = {'name': ['google_cluster'], 'monitoring_service... | true | true |
f76afb7ba428f4cb1d13be613242750858030720 | 3,394 | py | Python | p3_collab-compet/view-actors.py | pjordan/deep-reinforcement-learning | 4784635b67a30aadb5a7d93a0945781f55b6dccf | [
"MIT"
] | null | null | null | p3_collab-compet/view-actors.py | pjordan/deep-reinforcement-learning | 4784635b67a30aadb5a7d93a0945781f55b6dccf | [
"MIT"
] | null | null | null | p3_collab-compet/view-actors.py | pjordan/deep-reinforcement-learning | 4784635b67a30aadb5a7d93a0945781f55b6dccf | [
"MIT"
] | null | null | null | from model import Actor, Critic
from config import Config
import torch
from rlcc.act import NetworkActor, StackedActor
from unityagents import UnityEnvironment
import numpy as np
import imageio
import os
from itertools import cycle
configs = []
names = []
#
configs.append(Config())
configs[-1].fc1_units = 400
config... | 27.370968 | 107 | 0.692398 | from model import Actor, Critic
from config import Config
import torch
from rlcc.act import NetworkActor, StackedActor
from unityagents import UnityEnvironment
import numpy as np
import imageio
import os
from itertools import cycle
configs = []
names = []
configs.append(Config())
configs[-1].fc1_units = 400
configs[-... | true | true |
f76afbafe7d57dfaf7023de778f1110565d3a0d7 | 1,864 | py | Python | hail/python/hailtop/aiogoogle/client/logging_client.py | MariusDanner/hail | 5ca0305f8243b5888931b1afaa1fbfb617dee097 | [
"MIT"
] | 1 | 2020-12-03T11:20:22.000Z | 2020-12-03T11:20:22.000Z | hail/python/hailtop/aiogoogle/client/logging_client.py | MariusDanner/hail | 5ca0305f8243b5888931b1afaa1fbfb617dee097 | [
"MIT"
] | 3 | 2017-06-16T18:10:45.000Z | 2017-07-21T17:44:13.000Z | hail/python/hailtop/aiogoogle/client/logging_client.py | MariusDanner/hail | 5ca0305f8243b5888931b1afaa1fbfb617dee097 | [
"MIT"
] | 2 | 2020-07-28T18:55:19.000Z | 2020-10-19T16:43:03.000Z | from typing import Mapping, Any
from .base_client import BaseClient
class PagedEntryIterator:
def __init__(self, client: 'LoggingClient', body: Mapping[str, Any], request_kwargs: Mapping[str, Any]):
self._client = client
self._body = body
self._request_kwargs = request_kwargs
self.... | 36.54902 | 108 | 0.61427 | from typing import Mapping, Any
from .base_client import BaseClient
class PagedEntryIterator:
def __init__(self, client: 'LoggingClient', body: Mapping[str, Any], request_kwargs: Mapping[str, Any]):
self._client = client
self._body = body
self._request_kwargs = request_kwargs
self.... | true | true |
f76afc24005b089b5cc745ee9faa10af51139b3d | 10,850 | py | Python | venv/Lib/site-packages/keystoneauth1/exceptions/http.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/keystoneauth1/exceptions/http.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/keystoneauth1/exceptions/http.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, Inc.
# Copyright 2013 Alessio Ababilov
# Copyright 2013 OpenStack Foundation
# 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
# ... | 25.291375 | 79 | 0.659539 |
import inspect
import sys
from keystoneauth1.exceptions import base
__all__ = ('HttpError',
'HTTPClientError',
'BadRequest',
'Unauthorized',
'PaymentRequired',
'Forbidden',
'NotFound',
'MethodNotAllowed',
'NotAcceptable',
... | true | true |
f76afc2d384e6ee7aae727e40053556027942ae3 | 13,693 | py | Python | management_tool/tests/test_views.py | casol/MS-User-Management-App | fa61dbbbac655217987f7a44488ef72e181e7d81 | [
"MIT"
] | null | null | null | management_tool/tests/test_views.py | casol/MS-User-Management-App | fa61dbbbac655217987f7a44488ef72e181e7d81 | [
"MIT"
] | 5 | 2021-03-19T09:06:58.000Z | 2022-02-10T11:31:05.000Z | management_tool/tests/test_views.py | casol/MS-User-Management-App | fa61dbbbac655217987f7a44488ef72e181e7d81 | [
"MIT"
] | null | null | null | import datetime
import csv
import io
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.contrib.messages import get_messages
from users.forms import CustomUserCreationForm, CustomUserChangeForm
User = get_user_model()
class SignupViewTest(Tes... | 41.746951 | 80 | 0.638282 | import datetime
import csv
import io
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.contrib.messages import get_messages
from users.forms import CustomUserCreationForm, CustomUserChangeForm
User = get_user_model()
class SignupViewTest(Tes... | true | true |
f76afcfba944510207b949dc9f3387e84ea48719 | 128 | py | Python | yatube/users/urls.py | ArturYumagulov/Yatube_0.5 | e0c911e17ed00b978330a9c77f12ef53ffb27b87 | [
"MIT"
] | null | null | null | yatube/users/urls.py | ArturYumagulov/Yatube_0.5 | e0c911e17ed00b978330a9c77f12ef53ffb27b87 | [
"MIT"
] | null | null | null | yatube/users/urls.py | ArturYumagulov/Yatube_0.5 | e0c911e17ed00b978330a9c77f12ef53ffb27b87 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('signup/', views.SingUp.as_view(), name='signup'),
] | 18.285714 | 59 | 0.6875 | from django.urls import path
from . import views
urlpatterns = [
path('signup/', views.SingUp.as_view(), name='signup'),
] | true | true |
f76afe2b980a6f58c144687656f26c44a7b17120 | 124 | py | Python | 000403StepPyThin/000403_01_12_07_HappyTiket_02_StepikSolvers_ifElse_20191110.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 000403StepPyThin/000403_01_12_07_HappyTiket_02_StepikSolvers_ifElse_20191110.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 000403StepPyThin/000403_01_12_07_HappyTiket_02_StepikSolvers_ifElse_20191110.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | a, b, c, d, e, f = input()
l = int(a)+int(b)+int(c)
r = int(d)+int(e)+int(f)
if l == r:
"Cчастливый"
else:
"Обычный" | 17.714286 | 26 | 0.5 | a, b, c, d, e, f = input()
l = int(a)+int(b)+int(c)
r = int(d)+int(e)+int(f)
if l == r:
else:
"Обычный" | true | true |
f76afef21022088ca3c2c19af28bea5fc8b6e7f7 | 8,708 | py | Python | lib/googlecloudsdk/third_party/apis/billingbudgets/v1/billingbudgets_v1_client.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/third_party/apis/billingbudgets/v1/billingbudgets_v1_client.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/billingbudgets/v1/billingbudgets_v1_client.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | """Generated client library for billingbudgets version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.billingbudgets.v1 import billingbudgets_v1_messages as messages
class B... | 43.758794 | 290 | 0.718075 |
from __future__ import absolute_import
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.billingbudgets.v1 import billingbudgets_v1_messages as messages
class BillingbudgetsV1(base_api.BaseApiClient):
MESSAGES_MODULE = messages
BASE_URL = 'https://billingbudgets.googleapis.com/'
MTLS... | true | true |
f76affdc38138ab8124bdafdcded3db0bd0d2fdf | 2,693 | py | Python | test.py | lwerdna/sh4dis | 04aa2dafceb201ca58dba770545a8bd05d8938c6 | [
"Unlicense"
] | 1 | 2020-05-02T04:34:32.000Z | 2020-05-02T04:34:32.000Z | test.py | lwerdna/sh4dis | 04aa2dafceb201ca58dba770545a8bd05d8938c6 | [
"Unlicense"
] | null | null | null | test.py | lwerdna/sh4dis | 04aa2dafceb201ca58dba770545a8bd05d8938c6 | [
"Unlicense"
] | 1 | 2020-05-02T04:34:41.000Z | 2020-05-02T04:34:41.000Z | #!/usr/bin/env python
import os
import re
import sys
import struct
import ctypes
from sh4dis import sh4
RED = '\x1B[31m'
NORMAL = '\x1B[0m'
GREEN = '\x1B[32m'
gofer = None
cbuf = None
def disasm_libopcodes(data, addr):
# initialize disassembler, if necessary
global gofer, cbuf
if not gofer:
gofe... | 30.258427 | 98 | 0.554029 |
import os
import re
import sys
import struct
import ctypes
from sh4dis import sh4
RED = '\x1B[31m'
NORMAL = '\x1B[0m'
GREEN = '\x1B[32m'
gofer = None
cbuf = None
def disasm_libopcodes(data, addr):
global gofer, cbuf
if not gofer:
gofer = ctypes.CDLL("gofer.so")
cbuf = ctypes.create_strin... | true | true |
f76b00ffc9e1771f9556c4992c7def9a98bcbc08 | 3,998 | py | Python | ginga/mockw/CanvasRenderMock.py | finagle29/ginga | 161952a4016d3f014003db3d09dd78c61be85cb7 | [
"BSD-3-Clause"
] | 76 | 2015-01-05T14:46:14.000Z | 2022-03-23T04:10:54.000Z | ginga/mockw/CanvasRenderMock.py | finagle29/ginga | 161952a4016d3f014003db3d09dd78c61be85cb7 | [
"BSD-3-Clause"
] | 858 | 2015-01-17T01:55:12.000Z | 2022-03-08T20:20:31.000Z | ginga/mockw/CanvasRenderMock.py | finagle29/ginga | 161952a4016d3f014003db3d09dd78c61be85cb7 | [
"BSD-3-Clause"
] | 60 | 2015-01-14T21:59:07.000Z | 2022-02-13T03:38:49.000Z | #
# CanvasRenderMock.py -- for rendering into a ImageViewMock widget
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.canvas import render
from ginga.fonts import font_asst
# force registration of all canvas types
import ginga.canvas.types.all #... | 28.971014 | 76 | 0.636568 | from ginga.canvas import render
from ginga.fonts import font_asst
import ginga.canvas.types.all from ginga import trcalc
class RenderContext(render.RenderContextBase):
def __init__(self, renderer, viewer, surface):
render.RenderContextBase.__init__(self, renderer, viewer)
self.c... | true | true |
f76b02452911a8934ddcfc9bfe167ebde7cc9c0d | 5,207 | py | Python | src/clients/ctm_saas_client/models/privilege_name_controlm.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 5 | 2021-12-01T18:40:00.000Z | 2022-03-04T10:51:44.000Z | src/clients/ctm_saas_client/models/privilege_name_controlm.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 3 | 2022-02-21T20:08:32.000Z | 2022-03-16T17:41:03.000Z | src/clients/ctm_saas_client/models/privilege_name_controlm.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 7 | 2021-12-01T11:59:16.000Z | 2022-03-01T18:16:40.000Z | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.30
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from clients.ctm... | 28.60989 | 107 | 0.589591 |
import pprint
import re
import six
from clients.ctm_saas_client.configuration import Configuration
class PrivilegeNameControlm(object):
swagger_types = {
'privilege': 'str',
'controlm_server': 'str',
'name': 'str'
}
attribute_map = {
'privilege': 'Privilege',
... | true | true |
f76b03664b94f1df49f1b8557993ecf73c280f01 | 254 | py | Python | pyror/utils.py | sckott/pyror | e50f71cf668110844ecd74e5451cd88c2298fd3c | [
"MIT"
] | 2 | 2021-12-15T16:15:07.000Z | 2021-12-24T18:09:05.000Z | pyror/utils.py | sckott/pyror | e50f71cf668110844ecd74e5451cd88c2298fd3c | [
"MIT"
] | null | null | null | pyror/utils.py | sckott/pyror | e50f71cf668110844ecd74e5451cd88c2298fd3c | [
"MIT"
] | null | null | null | def parse_ids(d):
vars = ["id", "name", "links"]
z = {v: d[v] for v in vars}
z["grid_id"] = d["external_ids"]["GRID"]["preferred"]
z["link"] = None
if len(z["links"]):
z["link"] = z["links"][0]
z.pop("links")
return z
| 25.4 | 57 | 0.488189 | def parse_ids(d):
vars = ["id", "name", "links"]
z = {v: d[v] for v in vars}
z["grid_id"] = d["external_ids"]["GRID"]["preferred"]
z["link"] = None
if len(z["links"]):
z["link"] = z["links"][0]
z.pop("links")
return z
| true | true |
f76b067a6a8c3d5e96a13ee97dcd519521fe7966 | 743 | py | Python | nyc/convert-sids.py | susannahsoon/oldperth | a09ea03e8b0f96ffe235755a1120569a61a0dd79 | [
"Apache-2.0"
] | 302 | 2015-03-19T20:40:47.000Z | 2022-03-27T23:31:21.000Z | nyc/convert-sids.py | gegilligan/oldnyc | a09ea03e8b0f96ffe235755a1120569a61a0dd79 | [
"Apache-2.0"
] | 88 | 2015-02-23T18:29:23.000Z | 2020-08-23T18:32:18.000Z | nyc/convert-sids.py | gegilligan/oldnyc | a09ea03e8b0f96ffe235755a1120569a61a0dd79 | [
"Apache-2.0"
] | 186 | 2015-02-12T11:16:39.000Z | 2022-02-12T16:21:08.000Z | #!/usr/bin/python
'''
See comments in download-mrsids.py.
This does step #4: convert MrSID -> JPG
It's designed to run continually, checking for new .sid files.
This lets it run in parallel to a download process (download-mrsids.py)
'''
import glob
import os
import random
import subprocess
import sys
import time
cmd... | 22.515152 | 71 | 0.69179 | '''
See comments in download-mrsids.py.
This does step #4: convert MrSID -> JPG
It's designed to run continually, checking for new .sid files.
This lets it run in parallel to a download process (download-mrsids.py)
'''
import glob
import os
import random
import subprocess
import sys
import time
cmd = 'mrsiddecode -i... | false | true |
f76b069e27a687efa6e5398ac2f4ccf96650cd65 | 1,343 | py | Python | mlt/utils/process_helpers.py | mas-dse-greina/mlt | 6a5a156196a1cc372bb13dc402fc933a0bb0c5ae | [
"Apache-2.0"
] | 1 | 2021-11-29T10:35:20.000Z | 2021-11-29T10:35:20.000Z | mlt/utils/process_helpers.py | mas-dse-greina/mlt | 6a5a156196a1cc372bb13dc402fc933a0bb0c5ae | [
"Apache-2.0"
] | 1 | 2018-05-01T23:19:01.000Z | 2018-05-02T00:09:43.000Z | mlt/utils/process_helpers.py | mas-dse-greina/mlt | 6a5a156196a1cc372bb13dc402fc933a0bb0c5ae | [
"Apache-2.0"
] | 1 | 2020-02-22T01:04:15.000Z | 2020-02-22T01:04:15.000Z | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Intel Corporation
#
# 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 app... | 31.97619 | 74 | 0.711095 | import os
import sys
from subprocess import check_output, CalledProcessError, Popen, PIPE
def run(command, cwd=None):
try:
output = check_output(command, cwd=cwd).decode("utf-8")
except CalledProcessError as e:
print(e.output)
sys.exit(1)
return output
def run_popen(command, she... | true | true |
f76b06bfa976a8be6bac1563105511e4407af6fc | 22,189 | py | Python | tpdatasrc/co8infra/scr/Co8.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 69 | 2015-05-05T14:09:25.000Z | 2022-02-15T06:13:04.000Z | tpdatasrc/co8infra/scr/Co8.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 457 | 2015-05-01T22:07:45.000Z | 2022-03-31T02:19:10.000Z | tpdatasrc/co8infra/scr/Co8.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 25 | 2016-02-04T21:19:53.000Z | 2021-11-15T23:14:51.000Z | from toee import *
from utilities import *
from ed import *
from batch import *
###################################################################
### (18:55 20/04/06) A script written by Glen Wheeler (Ugignadl) for manipulating ToEE files.
### Requested by Cerulean the Blue from Co8.
##
### (13:05 22/04/06)... | 33.568835 | 528 | 0.680067 | from toee import *
from utilities import *
from ed import *
from batch import *
def boh_newbag(bagcontents=[11300], bagnum=0, bgfilename='modules\\ToEE\\Bag_of_Holding.mes'):
""" This function only takes keyword arguments. bagnum of 0 will ask the function to use the lowest available, otherwise will use that ... | false | true |
f76b06c867952c8d585a06e455bfc89eca38c871 | 475 | py | Python | djnic/zonas/admin.py | avdata99/nic | 70399bd78fd2b4b496d338e7959867ad12cdf477 | [
"MIT"
] | 8 | 2021-05-01T13:03:22.000Z | 2021-12-17T21:50:04.000Z | djnic/zonas/admin.py | avdata99/nic | 70399bd78fd2b4b496d338e7959867ad12cdf477 | [
"MIT"
] | 16 | 2020-11-20T23:18:22.000Z | 2021-04-08T20:09:35.000Z | djnic/zonas/admin.py | OpenDataCordoba/nic | f9528856e13d106bdfb476cab1236bc5b8a92183 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Zona, GrupoZona, ZonaEnGrupo
@admin.register(Zona)
class ZonaAdmin(admin.ModelAdmin):
list_display = ['nombre']
list_per_page = 10
@admin.register(GrupoZona)
class GrupoZonaAdmin(admin.ModelAdmin):
list_display = ['nombre', 'published']
list_per_p... | 22.619048 | 49 | 0.736842 | from django.contrib import admin
from .models import Zona, GrupoZona, ZonaEnGrupo
@admin.register(Zona)
class ZonaAdmin(admin.ModelAdmin):
list_display = ['nombre']
list_per_page = 10
@admin.register(GrupoZona)
class GrupoZonaAdmin(admin.ModelAdmin):
list_display = ['nombre', 'published']
list_per_p... | true | true |
f76b0777f47abeeee9d9850fc7c37fd02149f98a | 2,446 | py | Python | ipawac_assistant/assistant/plugins/utilities/paths.py | shreyashag/ipawac_assistant | 57b4f93651a75b113833389db7d6de18c67c7f1e | [
"MIT"
] | null | null | null | ipawac_assistant/assistant/plugins/utilities/paths.py | shreyashag/ipawac_assistant | 57b4f93651a75b113833389db7d6de18c67c7f1e | [
"MIT"
] | null | null | null | ipawac_assistant/assistant/plugins/utilities/paths.py | shreyashag/ipawac_assistant | 57b4f93651a75b113833389db7d6de18c67c7f1e | [
"MIT"
] | null | null | null | # -*- coding: utf-8-*-
import os
# Jasper main directory
APP_PATH = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.pardir, os.pardir, os.pardir))
CONFIG_PATH = os.path.expanduser(os.getenv('IPAWAC_CONFIG'))
PLUGIN_PATH = os.path.normpath(os.path.join(APP_PATH, 'assistant'))
LIB... | 28.776471 | 78 | 0.715454 | import os
APP_PATH = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.pardir, os.pardir, os.pardir))
CONFIG_PATH = os.path.expanduser(os.getenv('IPAWAC_CONFIG'))
PLUGIN_PATH = os.path.normpath(os.path.join(APP_PATH, 'assistant'))
LIB_PATH = os.path.join(APP_PATH, "client")
MODU... | true | true |
f76b0795d0ed46fd8304f53270f53cd7478e983d | 1,224 | py | Python | src/cowrie/python/logfile.py | GreyNoise-Intelligence/cowrie | d2a9b30f5fd23428baf32e2de1d24e944cf8cde7 | [
"BSD-3-Clause"
] | null | null | null | src/cowrie/python/logfile.py | GreyNoise-Intelligence/cowrie | d2a9b30f5fd23428baf32e2de1d24e944cf8cde7 | [
"BSD-3-Clause"
] | null | null | null | src/cowrie/python/logfile.py | GreyNoise-Intelligence/cowrie | d2a9b30f5fd23428baf32e2de1d24e944cf8cde7 | [
"BSD-3-Clause"
] | null | null | null | # -*- test-case-name: cowrie.test.utils -*-
# Copyright (c) 2017 Michel Oosterhof <michel@oosterhof.net>
# See the COPYRIGHT file for more information
from os import environ
from twisted.logger import textFileLogObserver
from twisted.python import logfile
from cowrie.core.config import CowrieConfig
class CowrieDa... | 28.465116 | 70 | 0.629085 |
from os import environ
from twisted.logger import textFileLogObserver
from twisted.python import logfile
from cowrie.core.config import CowrieConfig
class CowrieDailyLogFile(logfile.DailyLogFile):
def suffix(self, tupledate):
try:
return "{:02d}-{:02d}-{:02d}".format(
tupl... | true | true |
f76b07f5a79ea9eaa13d0b99633e3efca4e62e08 | 78,035 | py | Python | sympy/printing/tests/test_latex.py | akash9712/sympy | 28d913d3cead6c5646307ffa6540b21d65059dfd | [
"BSD-3-Clause"
] | 3 | 2015-01-17T23:15:04.000Z | 2015-05-26T14:11:44.000Z | sympy/printing/tests/test_latex.py | akash9712/sympy | 28d913d3cead6c5646307ffa6540b21d65059dfd | [
"BSD-3-Clause"
] | 1 | 2017-08-26T01:07:46.000Z | 2017-08-26T16:05:49.000Z | sympy/printing/tests/test_latex.py | leosartaj/sympy | 28d913d3cead6c5646307ffa6540b21d65059dfd | [
"BSD-3-Clause"
] | null | null | null | from sympy import (
Add, Abs, Chi, Ci, CosineTransform, Dict, Ei, Eq, FallingFactorial,
FiniteSet, Float, FourierTransform, Function, Indexed, IndexedBase, Integral,
Interval, InverseCosineTransform, InverseFourierTransform,
InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform,
Lamb... | 40.749347 | 239 | 0.564196 | from sympy import (
Add, Abs, Chi, Ci, CosineTransform, Dict, Ei, Eq, FallingFactorial,
FiniteSet, Float, FourierTransform, Function, Indexed, IndexedBase, Integral,
Interval, InverseCosineTransform, InverseFourierTransform,
InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform,
Lamb... | true | true |
f76b090b18c62cdf91df3c869f411b7ec8a9bd18 | 5,864 | py | Python | unittests/test_all.py | electronicvisions/pygccxml | 464825367daff2e364a5095220f173f23538a365 | [
"BSL-1.0"
] | null | null | null | unittests/test_all.py | electronicvisions/pygccxml | 464825367daff2e364a5095220f173f23538a365 | [
"BSL-1.0"
] | null | null | null | unittests/test_all.py | electronicvisions/pygccxml | 464825367daff2e364a5095220f173f23538a365 | [
"BSL-1.0"
] | null | null | null | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import sys
import unittest
import platform
from . import decl_string_tester
from . import declaration_files_tester... | 30.226804 | 69 | 0.800989 |
import os
import sys
import unittest
import platform
from . import decl_string_tester
from . import declaration_files_tester
from . import declarations_comparison_tester
from . import declarations_tester
from . import file_cache_tester
from . import gccxml_runner_tester
from . import project_reader_correctness_tester... | true | true |
f76b09280e224a293663f40a6dec6b5d13caa927 | 360 | py | Python | spectrocrunch/resources/__init__.py | woutdenolf/spectrocrunch | fde4b6e0f462f464ce7af6a942b355d3d8f39f77 | [
"MIT"
] | 3 | 2018-04-16T15:51:36.000Z | 2019-12-16T11:21:05.000Z | spectrocrunch/resources/__init__.py | woutdenolf/spectrocrunch | fde4b6e0f462f464ce7af6a942b355d3d8f39f77 | [
"MIT"
] | null | null | null | spectrocrunch/resources/__init__.py | woutdenolf/spectrocrunch | fde4b6e0f462f464ce7af6a942b355d3d8f39f77 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Resource files
"""
import os
def resource_filename(resource):
"""
Args:
resource(str): resource path relative to resource directory
Returns:
str: absolute resource path in the file system
"""
return os.path.join(
os.path.abspath(os.path.dirname... | 18 | 72 | 0.613889 |
import os
def resource_filename(resource):
return os.path.join(
os.path.abspath(os.path.dirname(__file__)), *resource.split("/")
)
| true | true |
f76b09561093e616d1d65d06e1a274a49cce070d | 1,199 | py | Python | Droit/views/GeographyBase.py | Halleloya/DBAC | af149fdcb18cb12817ea44b45750ede502d114a2 | [
"BSD-3-Clause"
] | null | null | null | Droit/views/GeographyBase.py | Halleloya/DBAC | af149fdcb18cb12817ea44b45750ede502d114a2 | [
"BSD-3-Clause"
] | null | null | null | Droit/views/GeographyBase.py | Halleloya/DBAC | af149fdcb18cb12817ea44b45750ede502d114a2 | [
"BSD-3-Clause"
] | null | null | null | from shapely.geometry import Polygon
class GeographyBase:
def __init__(self, level : str , coordinates : list, validate : bool):
self.level = level
p = Polygon(coordinates)
if validate:
if not isinstance(coordinates, list):
raise TypeError("Coordinates must be a l... | 32.405405 | 94 | 0.609675 | from shapely.geometry import Polygon
class GeographyBase:
def __init__(self, level : str , coordinates : list, validate : bool):
self.level = level
p = Polygon(coordinates)
if validate:
if not isinstance(coordinates, list):
raise TypeError("Coordinates must be a l... | true | true |
f76b0a6f7ca8c5d5a8a4f7b599e04604a3892608 | 38 | py | Python | tests/test_instrumentum.py | FedericoMontana/instrumentum | 0d07f6503c3c0fc980d349aeb6f47c960a4afe9c | [
"MIT"
] | 1 | 2022-02-22T17:27:39.000Z | 2022-02-22T17:27:39.000Z | tests/test_instrumentum.py | FedericoMontana/instrumentum | 0d07f6503c3c0fc980d349aeb6f47c960a4afe9c | [
"MIT"
] | 1 | 2021-12-03T21:43:42.000Z | 2021-12-03T21:43:42.000Z | tests/test_instrumentum.py | FedericoMontana/instrumentum | 0d07f6503c3c0fc980d349aeb6f47c960a4afe9c | [
"MIT"
] | null | null | null | from instrumentum import instrumentum
| 19 | 37 | 0.894737 | from instrumentum import instrumentum
| true | true |
f76b0ad4a5a6ac1b0a0f691cb7453bfc2400c7be | 730 | py | Python | 03-simple-add-calculator.py | inderpal2406/python-udemy-training-2022 | 55084e083a7359b6a836ceb20586006668490a45 | [
"MIT"
] | null | null | null | 03-simple-add-calculator.py | inderpal2406/python-udemy-training-2022 | 55084e083a7359b6a836ceb20586006668490a45 | [
"MIT"
] | null | null | null | 03-simple-add-calculator.py | inderpal2406/python-udemy-training-2022 | 55084e083a7359b6a836ceb20586006668490a45 | [
"MIT"
] | null | null | null | # This script will accept two numbers from user, then add them and give the result.
# Import modules.
import platform
import os
# Clear the screen as per the OS type.
os_name=platform.system()
if os_name == "Windows":
os.system("cls")
elif os_name == "Linux":
os.system("clear")
else:
print(f"The OS is n... | 21.470588 | 105 | 0.70137 |
import platform
import os
os_name=platform.system()
if os_name == "Windows":
os.system("cls")
elif os_name == "Linux":
os.system("clear")
else:
print(f"The OS is not Windows/Linux. This script is designed only for Windows/Linux. Hence exiting.")
exit()
print(f"This script will accept 2 numbers and... | true | true |
f76b0afa0c820acd33b95450813cb5132878f6fc | 2,909 | py | Python | test/functional/mempool_resurrect.py | vpubchain/syscoin | 72af49f24d2f4dd3628fd3ca8f7e3415534f55c8 | [
"MIT"
] | 1 | 2020-02-09T21:15:36.000Z | 2020-02-09T21:15:36.000Z | test/functional/mempool_resurrect.py | vpubchain/syscoin | 72af49f24d2f4dd3628fd3ca8f7e3415534f55c8 | [
"MIT"
] | null | null | null | test/functional/mempool_resurrect.py | vpubchain/syscoin | 72af49f24d2f4dd3628fd3ca8f7e3415534f55c8 | [
"MIT"
] | 1 | 2021-12-01T07:18:04.000Z | 2021-12-01T07:18:04.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the blockchain is re-organized."""
from test_framework.bl... | 40.971831 | 123 | 0.674459 |
from test_framework.blocktools import create_raw_transaction
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import assert_equal
class MempoolCoinbaseTest(SyscoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def skip_test_if_missing_module(self... | true | true |
f76b0b824f92abf243865518dabdfed3521f7e0a | 2,365 | py | Python | library_collection/human_to_bytes.py | tingletech/avram | 4ad6bb0d40d3dba400245133bc273904c527d693 | [
"Unlicense"
] | null | null | null | library_collection/human_to_bytes.py | tingletech/avram | 4ad6bb0d40d3dba400245133bc273904c527d693 | [
"Unlicense"
] | null | null | null | library_collection/human_to_bytes.py | tingletech/avram | 4ad6bb0d40d3dba400245133bc273904c527d693 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""
Bytes-to-human / human-to-bytes converter.
Based on: http://goo.gl/kTQMs
Working with Python 2.x and 3.x.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
http://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/
"""
# see: http://goo.gl/kTQ... | 29.5625 | 83 | 0.52685 |
SYMBOLS = {
'ours' : ('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'),
'customary' : ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'),
'customary_ext' : ('byte', 'kilo', 'mega', 'giga', 'tera', 'peta', 'exa',
'zetta', 'iotta'),
'iec' : ('Bi', 'Ki', 'Mi',... | true | true |
f76b0bab7e2e3e6afb19fc70c1c31ca4daa47527 | 1,820 | py | Python | csrank/dataset_reader/labelranking/survey_dataset_reader.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | null | null | null | csrank/dataset_reader/labelranking/survey_dataset_reader.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | null | null | null | csrank/dataset_reader/labelranking/survey_dataset_reader.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | 1 | 2018-10-30T08:57:14.000Z | 2018-10-30T08:57:14.000Z | import os
import numpy as np
import pandas as pd
from sklearn.model_selection import ShuffleSplit
from sklearn.preprocessing import Imputer, StandardScaler
from sklearn.utils import check_random_state
from csrank.constants import LABEL_RANKING
from csrank.util import ranking_ordering_conversion
from ..dataset_reader ... | 40.444444 | 111 | 0.676374 | import os
import numpy as np
import pandas as pd
from sklearn.model_selection import ShuffleSplit
from sklearn.preprocessing import Imputer, StandardScaler
from sklearn.utils import check_random_state
from csrank.constants import LABEL_RANKING
from csrank.util import ranking_ordering_conversion
from ..dataset_reader ... | true | true |
f76b0bac2268b3b65d3e61feefa00cee67a7b45a | 6,517 | py | Python | test/integration/ggrc/converters/test_import_csv.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | null | null | null | test/integration/ggrc/converters/test_import_csv.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 12 | 2015-01-08T14:50:19.000Z | 2017-11-29T19:37:53.000Z | test/integration/ggrc/converters/test_import_csv.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 1 | 2015-01-08T13:25:09.000Z | 2015-01-08T13:25:09.000Z | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from ggrc import models
from ggrc.converters import errors
from integration.ggrc... | 38.335294 | 79 | 0.705386 |
from ggrc import models
from ggrc.converters import errors
from integration.ggrc import converters
from integration.ggrc import generator
class TestBasicCsvImport(converters.TestCase):
def setUp(self):
converters.TestCase.setUp(self)
self.generator = generator.ObjectGenerator()
self.client.get("/login... | true | true |
f76b0c01acc7f6e424ef71f5e04ea476ace8297e | 5,958 | py | Python | st2common/tests/unit/test_service_setup.py | shusugmt/st2 | 31da26badfb4ca3fb3e8cae07cfeec4791191afd | [
"Apache-2.0"
] | 1 | 2020-11-09T21:05:33.000Z | 2020-11-09T21:05:33.000Z | st2common/tests/unit/test_service_setup.py | ellerbrock/st2 | b3a0d9f82053c1fd5adb616dc8331bad427cd11f | [
"Apache-2.0"
] | 3 | 2021-03-26T00:29:52.000Z | 2021-03-26T00:34:45.000Z | st2common/tests/unit/test_service_setup.py | ellerbrock/st2 | b3a0d9f82053c1fd5adb616dc8331bad427cd11f | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | 38.43871 | 97 | 0.662303 |
from __future__ import absolute_import
import tempfile
import six
import mock
from oslo_config import cfg
from oslo_config.cfg import ConfigFilesNotFoundError
from st2common import service_setup
from st2common.transport.bootstrap_utils import register_exchanges
from st2common.transport.bootstrap_utils import QUEUE... | true | true |
f76b0c2a354446548270bf083ca9a51d2d524aa7 | 6,628 | py | Python | python/tvm/relay/testing/mobilenet.py | ravikumarvc/incubator-tvm | 9826947ffce0ed40e9d47a0db2abb033e394279e | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/tvm/relay/testing/mobilenet.py | ravikumarvc/incubator-tvm | 9826947ffce0ed40e9d47a0db2abb033e394279e | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/tvm/relay/testing/mobilenet.py | ravikumarvc/incubator-tvm | 9826947ffce0ed40e9d47a0db2abb033e394279e | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.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 u... | 40.662577 | 80 | 0.611346 |
from tvm import relay
from . import layers
from .init import create_workload
def conv_block(data, name, channels, kernel_size=(3, 3), strides=(1, 1),
padding=(1, 1), epsilon=1e-5, layout='NCHW'):
conv = layers.conv2d(
data=data,
channels=channels,
kernel_size=kernel_siz... | true | true |
f76b0c39048ce9e58fb1221b74e1beefc22adbc9 | 2,490 | py | Python | test/python/fingerprintfiles.py | timvdm/Helium | 79db85da43f20606710263f800deac52534d437e | [
"BSD-3-Clause"
] | 13 | 2015-02-04T17:02:25.000Z | 2018-04-25T22:48:52.000Z | test/python/fingerprintfiles.py | timvdm/Helium | 79db85da43f20606710263f800deac52534d437e | [
"BSD-3-Clause"
] | null | null | null | test/python/fingerprintfiles.py | timvdm/Helium | 79db85da43f20606710263f800deac52534d437e | [
"BSD-3-Clause"
] | 4 | 2015-11-27T06:19:40.000Z | 2021-04-20T17:35:41.000Z | import helium
import unittest
import os
class TestBinaryInputFile(unittest.TestCase):
datadir = os.getenv('HEDATADIR', os.getenv('HOME', 'c:/') + '/Helium/data')
def test_data_dir(self):
self.assertTrue(os.path.isdir(self.datadir))
def test_in_memory_row_major_fingerprint_storage(self):
... | 38.90625 | 115 | 0.686747 | import helium
import unittest
import os
class TestBinaryInputFile(unittest.TestCase):
datadir = os.getenv('HEDATADIR', os.getenv('HOME', 'c:/') + '/Helium/data')
def test_data_dir(self):
self.assertTrue(os.path.isdir(self.datadir))
def test_in_memory_row_major_fingerprint_storage(self):
... | true | true |
f76b0dacb88b9d395f1bfb2949c2bf60bae40965 | 269 | py | Python | src/lck/__init__.py | ar4s/kitdjango | 1da443296ac780ae002b66452df2251642374a13 | [
"MIT"
] | 10 | 2015-06-17T08:22:10.000Z | 2020-12-10T13:48:37.000Z | src/lck/__init__.py | ar4s/kitdjango | 1da443296ac780ae002b66452df2251642374a13 | [
"MIT"
] | null | null | null | src/lck/__init__.py | ar4s/kitdjango | 1da443296ac780ae002b66452df2251642374a13 | [
"MIT"
] | 8 | 2015-03-23T10:59:22.000Z | 2022-01-17T09:49:26.000Z | # -*- coding: utf-8 -*-
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| 33.625 | 75 | 0.758364 | try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| true | true |
f76b0e00d63c834bf32a2e83896bc45589f983f8 | 736 | py | Python | shims/__init__.py | uranusjr/snafu | ddcbf8dc8f26fbab6f352058d4b3e62fd01ea331 | [
"ISC"
] | 27 | 2017-10-09T02:41:23.000Z | 2020-12-18T22:42:55.000Z | shims/__init__.py | imbi7py/snafu | ddcbf8dc8f26fbab6f352058d4b3e62fd01ea331 | [
"ISC"
] | 10 | 2017-12-20T02:24:54.000Z | 2018-02-22T17:10:04.000Z | shims/__init__.py | imbi7py/snafu | ddcbf8dc8f26fbab6f352058d4b3e62fd01ea331 | [
"ISC"
] | 1 | 2020-12-19T05:56:54.000Z | 2020-12-19T05:56:54.000Z | import pathlib
import os
import invoke
TOP_LEVEL = [
'shim',
'snafu',
]
CURDIR = pathlib.Path(__file__, '..')
def _run_for_each(ctx, cmd):
for p in TOP_LEVEL:
# Can't use Path.resolve() because it can return a UNC path, which
# ctx.cd() does not accept.
with ctx.cd(os.path.abs... | 17.95122 | 74 | 0.612772 | import pathlib
import os
import invoke
TOP_LEVEL = [
'shim',
'snafu',
]
CURDIR = pathlib.Path(__file__, '..')
def _run_for_each(ctx, cmd):
for p in TOP_LEVEL:
# ctx.cd() does not accept.
with ctx.cd(os.path.abspath(CURDIR.joinpath(p))):
ctx.run(cmd)
@invoke.task(... | true | true |
f76b0e7058d1498ed56ee2906385ef807b1a1fd1 | 354 | py | Python | authlib/specs/rfc7519/errors.py | tk193192/authlib | 4c60a628f64c6d385a06ea55e416092726b94d07 | [
"BSD-3-Clause"
] | 2 | 2021-04-26T18:17:37.000Z | 2021-04-28T21:39:45.000Z | authlib/specs/rfc7519/errors.py | tk193192/authlib | 4c60a628f64c6d385a06ea55e416092726b94d07 | [
"BSD-3-Clause"
] | 4 | 2021-03-19T08:17:59.000Z | 2021-06-10T19:34:36.000Z | authlib/specs/rfc7519/errors.py | tk193192/authlib | 4c60a628f64c6d385a06ea55e416092726b94d07 | [
"BSD-3-Clause"
] | 2 | 2021-05-24T20:34:12.000Z | 2022-03-26T07:46:17.000Z | from authlib.jose.errors import (
JoseError,
DecodeError, InvalidClaimError,
MissingClaimError, InsecureClaimError,
ExpiredTokenError, InvalidTokenError,
)
__all__ = [
'JWTError', 'DecodeError', 'InvalidClaimError',
'MissingClaimError', 'InsecureClaimError',
'ExpiredTokenError', 'InvalidTok... | 23.6 | 51 | 0.740113 | from authlib.jose.errors import (
JoseError,
DecodeError, InvalidClaimError,
MissingClaimError, InsecureClaimError,
ExpiredTokenError, InvalidTokenError,
)
__all__ = [
'JWTError', 'DecodeError', 'InvalidClaimError',
'MissingClaimError', 'InsecureClaimError',
'ExpiredTokenError', 'InvalidTok... | true | true |
f76b0ed4f98e22e34434b0eb4ac0e54269d230c0 | 491 | py | Python | app/kobo/migrations/0017_auto_20181220_0328.py | wri/django_kobo | 505d52fc0d49d875af068e58ad959b95d1464dd5 | [
"MIT"
] | 1 | 2018-12-20T07:59:55.000Z | 2018-12-20T07:59:55.000Z | app/kobo/migrations/0017_auto_20181220_0328.py | wri/django_kobo | 505d52fc0d49d875af068e58ad959b95d1464dd5 | [
"MIT"
] | 9 | 2018-11-06T01:51:28.000Z | 2018-12-21T22:19:42.000Z | app/kobo/migrations/0017_auto_20181220_0328.py | wri/django_kobo | 505d52fc0d49d875af068e58ad959b95d1464dd5 | [
"MIT"
] | 2 | 2018-11-21T15:13:32.000Z | 2020-02-19T08:39:37.000Z | # Generated by Django 2.1.4 on 2018-12-20 03:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo', '0016_kobouser'),
]
operations = [
migrations.RemoveField(
model_name='kobouser',
name='surveys',
),
... | 21.347826 | 61 | 0.564155 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo', '0016_kobouser'),
]
operations = [
migrations.RemoveField(
model_name='kobouser',
name='surveys',
),
migrations.AddField(
model_n... | true | true |
f76b0f54e2897a4f5e7951d69a59b6c309013c74 | 4,655 | py | Python | BboxToolkit/datasets/HRSCio.py | jbwang1997/BboxToolk | a1e6b9dfcf1f533b630d656dc114ff62a5b37ba9 | [
"Apache-2.0"
] | 38 | 2021-02-05T14:39:11.000Z | 2022-03-28T07:41:41.000Z | BboxToolkit/datasets/HRSCio.py | jbwang1997/BboxToolk | a1e6b9dfcf1f533b630d656dc114ff62a5b37ba9 | [
"Apache-2.0"
] | 5 | 2021-11-01T08:17:09.000Z | 2022-03-28T12:40:06.000Z | BboxToolkit/datasets/HRSCio.py | jbwang1997/BboxToolk | a1e6b9dfcf1f533b630d656dc114ff62a5b37ba9 | [
"Apache-2.0"
] | 13 | 2021-08-20T12:26:04.000Z | 2022-03-18T12:45:31.000Z | import os
import time
import os.path as osp
import xml.etree.ElementTree as ET
import numpy as np
from PIL import Image
from functools import partial
from multiprocessing import Pool
from .misc import img_exts, get_classes, _ConstMapper
def load_hrsc(img_dir, ann_dir, classes=None, img_keys=None, obj_keys=None, npro... | 35.807692 | 90 | 0.584748 | import os
import time
import os.path as osp
import xml.etree.ElementTree as ET
import numpy as np
from PIL import Image
from functools import partial
from multiprocessing import Pool
from .misc import img_exts, get_classes, _ConstMapper
def load_hrsc(img_dir, ann_dir, classes=None, img_keys=None, obj_keys=None, npro... | true | true |
f76b0f8b94d0042f94ae4fe9aca8e547b7bf67b2 | 3,062 | py | Python | jabbbar/jabbbar.py | barguman/jabbbar | c857a87062e92fe7e35b3a8d423199a0c7d9f7a7 | [
"WTFPL"
] | 4 | 2017-01-21T19:57:23.000Z | 2021-08-02T05:30:37.000Z | jabbbar/jabbbar.py | barguman/jabbbar | c857a87062e92fe7e35b3a8d423199a0c7d9f7a7 | [
"WTFPL"
] | 1 | 2019-08-28T10:36:12.000Z | 2020-07-31T13:24:33.000Z | jabbbar/jabbbar.py | barguman/jabbbar | c857a87062e92fe7e35b3a8d423199a0c7d9f7a7 | [
"WTFPL"
] | 3 | 2018-11-25T02:04:24.000Z | 2020-11-27T13:13:08.000Z | import requests as req
__author__ = "Karim Cheurfi"
API_URL = "https://api.dribbble.com/v1"
AUTH_ENDPOINT = "https://dribbble.com/oauth/authorize"
OAUTH_ENDPOINT = "https://dribbble.com/oauth/token"
SCOPE = ['write', 'public', 'comment', 'upload']
class Jabbbar(object):
def __init__(self, c... | 43.126761 | 141 | 0.648596 | import requests as req
__author__ = "Karim Cheurfi"
API_URL = "https://api.dribbble.com/v1"
AUTH_ENDPOINT = "https://dribbble.com/oauth/authorize"
OAUTH_ENDPOINT = "https://dribbble.com/oauth/token"
SCOPE = ['write', 'public', 'comment', 'upload']
class Jabbbar(object):
def __init__(self, c... | true | true |
f76b0f8d19e4fe8a67a6700e4653f568c038e0c2 | 599 | py | Python | euler_4.py | somiari/Project-Euler | f16f37925185079d1d61046c44a768289ca67264 | [
"MIT"
] | null | null | null | euler_4.py | somiari/Project-Euler | f16f37925185079d1d61046c44a768289ca67264 | [
"MIT"
] | null | null | null | euler_4.py | somiari/Project-Euler | f16f37925185079d1d61046c44a768289ca67264 | [
"MIT"
] | null | null | null | print("Project Euler Question 4: Largest palindrome product\n\n")
result = 0
def ispalindrome(string):
position = -1
hold_word = ""
for char in string:
hold_word += string[position]
position -= 1
return string == hold_word
for num1 in range(100, 1000):
for num2 in range(100, 1... | 19.322581 | 65 | 0.564274 | print("Project Euler Question 4: Largest palindrome product\n\n")
result = 0
def ispalindrome(string):
position = -1
hold_word = ""
for char in string:
hold_word += string[position]
position -= 1
return string == hold_word
for num1 in range(100, 1000):
for num2 in range(100, 1... | true | true |
f76b11b1f0a4a99ea3967b174b4b1b52644b75f6 | 515 | py | Python | custom_components/airly/const.py | bieniu/ha-airly | f075688bc58e36af601a21227e28dbaf8f0007bb | [
"Apache-2.0"
] | 12 | 2019-07-05T07:18:37.000Z | 2021-06-25T18:41:02.000Z | custom_components/airly/const.py | bieniu/ha-airly-component | f075688bc58e36af601a21227e28dbaf8f0007bb | [
"Apache-2.0"
] | 2 | 2019-10-07T09:09:31.000Z | 2019-12-19T15:40:20.000Z | custom_components/airly/const.py | bieniu/ha-airly | f075688bc58e36af601a21227e28dbaf8f0007bb | [
"Apache-2.0"
] | 6 | 2019-07-05T12:53:06.000Z | 2021-03-30T14:26:53.000Z | """Constants for Airly integration."""
ATTR_CAQI = "CAQI"
ATTR_CAQI_ADVICE = "advice"
ATTR_CAQI_DESCRIPTION = "DESCRIPTION"
ATTR_CAQI_LEVEL = "level"
CONF_LANGUAGE = "language"
CONF_USE_NEAREST = "use_nearest"
DEFAULT_LANGUAGE = "en"
DEFAULT_NAME = "Airly"
DEFAULT_SCAN_INTERVAL = 900
DOMAIN = "airly"
MANUFACTURER = "... | 24.52381 | 64 | 0.718447 | ATTR_CAQI = "CAQI"
ATTR_CAQI_ADVICE = "advice"
ATTR_CAQI_DESCRIPTION = "DESCRIPTION"
ATTR_CAQI_LEVEL = "level"
CONF_LANGUAGE = "language"
CONF_USE_NEAREST = "use_nearest"
DEFAULT_LANGUAGE = "en"
DEFAULT_NAME = "Airly"
DEFAULT_SCAN_INTERVAL = 900
DOMAIN = "airly"
MANUFACTURER = "Airly sp. z o.o."
LANGUAGE_CODES = ["e... | true | true |
f76b12bfa1d8278c2bb1509ab179b26290b7a0e8 | 16,728 | py | Python | lingvo/tasks/asr/model_test.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/asr/model_test.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/asr/model_test.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. 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
#
... | 38.455172 | 80 | 0.638809 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import numpy as np
import six
from six.moves import range
import tensorflow as tf
from lingvo.core import base_layer
from lingvo.core import cluster_factory
from lingvo.core import py_ut... | true | true |
f76b12fb4c03e70579ef98fff56a6a9fd83a79d6 | 489 | py | Python | doc/kendo/src/ch7/datepicker.py | axiros/transcrypt_material | 2fdffe0331ea6c368fc1dde3bd1102135c082fa9 | [
"BSD-3-Clause"
] | 3 | 2016-07-25T11:39:11.000Z | 2016-11-29T23:54:30.000Z | doc/kendo/src/ch7/datepicker.py | axiros/transcrypt_material | 2fdffe0331ea6c368fc1dde3bd1102135c082fa9 | [
"BSD-3-Clause"
] | null | null | null | doc/kendo/src/ch7/datepicker.py | axiros/transcrypt_material | 2fdffe0331ea6c368fc1dde3bd1102135c082fa9 | [
"BSD-3-Clause"
] | null | null | null | import tools
from kendo_base import KendoWidget
__pragma__('alias', 'jq', '$')
class DatePicker(KendoWidget, tools.PyDate):
'''
vim: gx over the url:
http://docs.telerik.com/kendo-ui/api/javascript/ui/datepicker#fields-options
'''
format = 'yyyy-MM-dd'
_k_cls = jq().kendoDatePicker.widget
_... | 25.736842 | 80 | 0.629857 | import tools
from kendo_base import KendoWidget
__pragma__('alias', 'jq', '$')
class DatePicker(KendoWidget, tools.PyDate):
format = 'yyyy-MM-dd'
_k_cls = jq().kendoDatePicker.widget
_functions = ['enable', 'close', 'destroy', 'readonly', 'max', 'min',
'open', 'setOptions']
def post... | true | true |
f76b130ab7391885d1e63b90e75fa74b9c2c42fb | 5,460 | py | Python | libs/cherrypy/test/sessiondemo.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 422 | 2015-01-08T14:08:08.000Z | 2022-02-07T11:47:37.000Z | libs/cherrypy/test/sessiondemo.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 581 | 2015-01-01T08:07:16.000Z | 2022-02-23T11:44:37.000Z | libs/cherrypy/test/sessiondemo.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 115 | 2015-01-08T14:41:00.000Z | 2022-02-13T12:31:17.000Z | #!/usr/bin/python
"""A session demonstration app."""
import calendar
from datetime import datetime
import sys
import cherrypy
from cherrypy.lib import sessions
from cherrypy._cpcompat import copyitems
page = """
<html>
<head>
<style type='text/css'>
table { border-collapse: collapse; border: 1px solid #663333; }
th ... | 34.339623 | 100 | 0.591392 |
import calendar
from datetime import datetime
import sys
import cherrypy
from cherrypy.lib import sessions
from cherrypy._cpcompat import copyitems
page = """
<html>
<head>
<style type='text/css'>
table { border-collapse: collapse; border: 1px solid #663333; }
th { text-align: right; background-color: #663333; color... | true | true |
f76b136e596d5c5e88d1e43c629f0f85c6ce644a | 1,806 | py | Python | Aulas/Aula11/exercicio.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | Aulas/Aula11/exercicio.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | Aulas/Aula11/exercicio.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | #Definir exceptions
class UsernameDuplicado(Exception):
pass
class IdadeMenor(Exception):
pass
class IdadeInvalida(Exception):
pass
class EmailInvalido(Exception):
pass
class User:
def __init__(self, username, idade, email):
self.__username = username
self.__idade = idade
... | 25.083333 | 81 | 0.54928 |
class UsernameDuplicado(Exception):
pass
class IdadeMenor(Exception):
pass
class IdadeInvalida(Exception):
pass
class EmailInvalido(Exception):
pass
class User:
def __init__(self, username, idade, email):
self.__username = username
self.__idade = idade
self.__email = ema... | true | true |
f76b15b2f70ee475b4d5d6aa58d01696dcbbc0bc | 5,180 | py | Python | lib/core.py | yubang/ftp | 55118d8126e68a98d9cf37a8cd445071bd4a3043 | [
"Apache-2.0"
] | null | null | null | lib/core.py | yubang/ftp | 55118d8126e68a98d9cf37a8cd445071bd4a3043 | [
"Apache-2.0"
] | null | null | null | lib/core.py | yubang/ftp | 55118d8126e68a98d9cf37a8cd445071bd4a3043 | [
"Apache-2.0"
] | null | null | null | #coding:UTF-8
"""
ftp客户端实现核心方法
@author:yubang
2014-04-23
"""
import socket,re,time,os
class Client(object):
def __init__(self):
self.__fileSocket=None
def __del__(self):
pass
def __initConnect(self):
"初始化连接"
self.__socket = socket.socket(socket.AF_INET, socket.SOCK_STREA... | 27.553191 | 81 | 0.494402 |
"""
ftp客户端实现核心方法
@author:yubang
2014-04-23
"""
import socket,re,time,os
class Client(object):
def __init__(self):
self.__fileSocket=None
def __del__(self):
pass
def __initConnect(self):
"初始化连接"
self.__socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sel... | false | true |
f76b15fb802420b0eecf006af8e6c9b6527a64ae | 46 | py | Python | motley_cue/dependencies.py | lburgey/motley_cue | 537f02aa1ecbe4ef42b233542023ad395339e109 | [
"CC-BY-4.0",
"MIT"
] | 5 | 2022-01-25T18:58:24.000Z | 2022-02-24T06:11:01.000Z | motley_cue/dependencies.py | lburgey/motley_cue | 537f02aa1ecbe4ef42b233542023ad395339e109 | [
"CC-BY-4.0",
"MIT"
] | 27 | 2021-04-20T12:21:56.000Z | 2022-02-15T15:46:09.000Z | motley_cue/dependencies.py | lburgey/motley_cue | 537f02aa1ecbe4ef42b233542023ad395339e109 | [
"CC-BY-4.0",
"MIT"
] | 2 | 2021-02-26T20:56:50.000Z | 2022-02-04T14:00:38.000Z | from .mapper import Mapper
mapper = Mapper()
| 11.5 | 26 | 0.73913 | from .mapper import Mapper
mapper = Mapper()
| true | true |
f76b162509f9ac30b4e0819ad2b3df19bb2b1166 | 2,383 | py | Python | microbepy/tests/common/test_partition.py | ScienceStacks/MicrobEPy | 704435e66c58677bab24f27820458870092924e2 | [
"MIT"
] | 1 | 2019-05-04T00:31:05.000Z | 2019-05-04T00:31:05.000Z | microbepy/tests/common/test_partition.py | ScienceStacks/MicrobEPy | 704435e66c58677bab24f27820458870092924e2 | [
"MIT"
] | null | null | null | microbepy/tests/common/test_partition.py | ScienceStacks/MicrobEPy | 704435e66c58677bab24f27820458870092924e2 | [
"MIT"
] | null | null | null | from microbepy.common.partition import Partition
import copy
import numpy as np
import pandas as pd
import unittest
IGNORE_TEST = False
ELEMENTS = ['a', 'b', 'c', 'd', 'e']
SET1 = set(['a', 'b', 'c'])
SET2 = set(['d', 'e'])
PARTITION = [SET1, SET2]
class TestPartition(unittest.TestCase):
def setUp(self):
se... | 30.164557 | 61 | 0.703315 | from microbepy.common.partition import Partition
import copy
import numpy as np
import pandas as pd
import unittest
IGNORE_TEST = False
ELEMENTS = ['a', 'b', 'c', 'd', 'e']
SET1 = set(['a', 'b', 'c'])
SET2 = set(['d', 'e'])
PARTITION = [SET1, SET2]
class TestPartition(unittest.TestCase):
def setUp(self):
se... | true | true |
f76b17c87dde4eb709de76833a922ca8d0bf1d5a | 1,201 | py | Python | startapp/public/forms.py | samsonpaul/startapp | fb5cc454aacf20a90107518c760edf3381d02c90 | [
"BSD-3-Clause"
] | 1 | 2017-01-22T21:10:47.000Z | 2017-01-22T21:10:47.000Z | startapp/public/forms.py | samsonpaul/startapp | fb5cc454aacf20a90107518c760edf3381d02c90 | [
"BSD-3-Clause"
] | null | null | null | startapp/public/forms.py | samsonpaul/startapp | fb5cc454aacf20a90107518c760edf3381d02c90 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Public forms."""
from flask_wtf import Form
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired
from startapp.user.models import User
class LoginForm(Form):
"""Login form."""
username = StringField('Username', validators=[DataRequired()])
... | 30.025 | 77 | 0.6403 | from flask_wtf import Form
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired
from startapp.user.models import User
class LoginForm(Form):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.