hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7908d337d6152662d0f863c174c8395f105d01a4 | 8,404 | py | Python | swift/proxy/controllers/account.py | fvennetier/swift | 127bf9707c383ac737fce9f243bcc8f6655910df | [
"Apache-2.0"
] | 3 | 2020-08-10T14:13:49.000Z | 2021-08-08T10:21:31.000Z | swift/proxy/controllers/account.py | fvennetier/swift | 127bf9707c383ac737fce9f243bcc8f6655910df | [
"Apache-2.0"
] | 4 | 2018-01-04T14:47:30.000Z | 2021-05-07T10:57:24.000Z | swift/proxy/controllers/account.py | fvennetier/swift | 127bf9707c383ac737fce9f243bcc8f6655910df | [
"Apache-2.0"
] | 2 | 2017-11-16T14:56:15.000Z | 2017-11-16T14:57:54.000Z | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | 46.175824 | 77 | 0.642789 |
from six.moves.urllib.parse import unquote
from swift import gettext_ as _
from swift.account.utils import account_listing_response
from swift.common.middleware.acl import parse_acl, format_acl
from swift.common.utils import public
from swift.common.constraints import check_metadata
from swift.common.h... | true | true |
7908d35c4dbf2724356c58e5f3a0f424313b4a87 | 4,177 | py | Python | scripts/plotting/plot_lfes.py | acumb/LatticeDNAOrigami | 0f2522286adc9815865d4abfc55f546da40e606b | [
"MIT"
] | 5 | 2016-04-10T21:21:52.000Z | 2018-07-21T15:33:07.000Z | scripts/plotting/plot_lfes.py | acumb/LatticeDNAOrigami | 0f2522286adc9815865d4abfc55f546da40e606b | [
"MIT"
] | 1 | 2017-06-22T17:31:37.000Z | 2017-06-22T17:31:37.000Z | scripts/plotting/plot_lfes.py | acumb/LatticeDNAOrigami | 0f2522286adc9815865d4abfc55f546da40e606b | [
"MIT"
] | 1 | 2019-04-30T03:11:19.000Z | 2019-04-30T03:11:19.000Z | #!/usr/bin/python
"""Plot LFEs of given order parameter."""
import argparse
import sys
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import gridspec
from matplotlib.ticker import MaxNLocator
import numpy as np
import pandas as pd
from matplotlibstyles import styles
from matplotlibstyles ... | 28.414966 | 96 | 0.625808 |
import argparse
import sys
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import gridspec
from matplotlib.ticker import MaxNLocator
import numpy as np
import pandas as pd
from matplotlibstyles import styles
from matplotlibstyles import plotutils
def main():
args = parse_args()
... | true | true |
7908d48d572968773d17eac5920a57118da9966f | 663 | py | Python | car_rental/car_rental/users/tests/test_drf_urls.py | TheHaRyPL/Car-rental | 21eb7b4c66bef5d6377dcfcc1006f7742b4339f5 | [
"MIT"
] | null | null | null | car_rental/car_rental/users/tests/test_drf_urls.py | TheHaRyPL/Car-rental | 21eb7b4c66bef5d6377dcfcc1006f7742b4339f5 | [
"MIT"
] | null | null | null | car_rental/car_rental/users/tests/test_drf_urls.py | TheHaRyPL/Car-rental | 21eb7b4c66bef5d6377dcfcc1006f7742b4339f5 | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from car_rental.users.models import User
pytestmark = pytest.mark.django_db
def test_user_detail(user: User):
assert (
reverse("api:user-detail", kwargs={"username": user.username})
== f"/api/users/{user.username}/"
)
assert resolve(... | 26.52 | 81 | 0.669683 | import pytest
from django.urls import resolve, reverse
from car_rental.users.models import User
pytestmark = pytest.mark.django_db
def test_user_detail(user: User):
assert (
reverse("api:user-detail", kwargs={"username": user.username})
== f"/api/users/{user.username}/"
)
assert resolve(... | true | true |
7908d4968ae6b535b2977d6f888376196da01990 | 12,318 | py | Python | examples/minkunet.py | zarzarj/MinkowskiEngine | 1c1c09d23bd2147fa41cae25fa8837290c2bd07b | [
"MIT"
] | 1 | 2022-01-17T13:06:05.000Z | 2022-01-17T13:06:05.000Z | examples/minkunet.py | zarzarj/MinkowskiEngine | 1c1c09d23bd2147fa41cae25fa8837290c2bd07b | [
"MIT"
] | null | null | null | examples/minkunet.py | zarzarj/MinkowskiEngine | 1c1c09d23bd2147fa41cae25fa8837290c2bd07b | [
"MIT"
] | null | null | null | # Copyright (c) Chris Choy (chrischoy@ai.stanford.edu).
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, ... | 35.194286 | 99 | 0.624696 |
# Networks", CVPR'19 (https://arxiv.org/abs/1904.08755) if you use any part
# of the code.
import torch
import torch.nn as nn
from torch.optim import SGD
import MinkowskiEngine as ME
from MinkowskiEngine.modules.resnet_block import BasicBlock, Bottleneck
from examples.resnet import ResNetBase
... | true | true |
7908d49b0bbc0c0c66a33b21167659dc4f383409 | 1,465 | py | Python | tests/sentry/logging/test_handler.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/logging/test_handler.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/logging/test_handler.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import pytest
import logging
import mock
from sentry.logging.handlers import StructLogHandler
@pytest.fixture
def handler():
return StructLogHandler()
@pytest.fixture
def logger():
return mock.MagicMock()
def make_logrecord(**extra):
kwargs = dict(
name... | 24.016393 | 92 | 0.640273 | from __future__ import absolute_import
import pytest
import logging
import mock
from sentry.logging.handlers import StructLogHandler
@pytest.fixture
def handler():
return StructLogHandler()
@pytest.fixture
def logger():
return mock.MagicMock()
def make_logrecord(**extra):
kwargs = dict(
name... | true | true |
7908d4cc766fa19b9dc718d41898eca8af92e658 | 2,607 | py | Python | telechat/__init__.py | Sefank/telechat | 8439f1565d363ffb18c44a647fc6440e2f3b6b41 | [
"MIT"
] | null | null | null | telechat/__init__.py | Sefank/telechat | 8439f1565d363ffb18c44a647fc6440e2f3b6b41 | [
"MIT"
] | null | null | null | telechat/__init__.py | Sefank/telechat | 8439f1565d363ffb18c44a647fc6440e2f3b6b41 | [
"MIT"
] | null | null | null | import os
import click
from flask import Flask, render_template
from flask_wtf.csrf import CSRFError
from telechat.extensions import db, login_manager, csrf, moment
from telechat.blueprints.auth import auth_bp
from telechat.blueprints.chat import chat_bp
from telechat.blueprints.admin import admin_bp
from telechat.bl... | 28.336957 | 92 | 0.693901 | import os
import click
from flask import Flask, render_template
from flask_wtf.csrf import CSRFError
from telechat.extensions import db, login_manager, csrf, moment
from telechat.blueprints.auth import auth_bp
from telechat.blueprints.chat import chat_bp
from telechat.blueprints.admin import admin_bp
from telechat.bl... | true | true |
7908d5b20e263d111b51de7124bd201f44c00f47 | 2,073 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Volume/Operators/clip.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Volume/Operators/clip.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Volume/Operators/clip.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | from DejaVu.IndexedPolygons import IndexedPolygons
from Volume.Grid3D import Grid3D
class ClipMeshWithMask:
"""Clip method of this class takes a mesh i.e. IndexedPolgons and
selects all vertices which fall onto voxel witha true value in a mask grid.
It returns a new IndexedPolygons geometry with the triangles for... | 33.435484 | 77 | 0.549445 | from DejaVu.IndexedPolygons import IndexedPolygons
from Volume.Grid3D import Grid3D
class ClipMeshWithMask:
def __init__(self):
pass
def clip(self, mesh, grid):
assert isinstance(mesh, IndexedPolygons)
assert isinstance(grid, Grid3D)
origin = grid.getOriginReal()
stepS... | true | true |
7908d661dc9f49748aba23e48f0244f72f2bdfa7 | 21,846 | py | Python | etl/parsers/etw/Microsoft_Windows_ShellCommon_StartLayoutPopulation.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 104 | 2020-03-04T14:31:31.000Z | 2022-03-28T02:59:36.000Z | etl/parsers/etw/Microsoft_Windows_ShellCommon_StartLayoutPopulation.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 7 | 2020-04-20T09:18:39.000Z | 2022-03-19T17:06:19.000Z | etl/parsers/etw/Microsoft_Windows_ShellCommon_StartLayoutPopulation.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 16 | 2020-03-05T18:55:59.000Z | 2022-03-01T10:19:28.000Z | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-ShellCommon-StartLayoutPopulation
GUID : 97ca8142-10b1-4baa-9fbb-70a7d11231c3
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dt... | 30.899576 | 123 | 0.72178 |
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parsers.etw.core import Etw, declare, guid
@declare(guid=guid("97ca8142-10b1-4baa-9fbb-70a7d11231c3"),... | true | true |
7908d6b09c56bc0b7507e3574e698af7985b0ce7 | 18,814 | py | Python | test/test_pymbolic.py | sv2518/pymbolic | 42687a410b1c355beec510b91c18f97e5137795b | [
"MIT"
] | null | null | null | test/test_pymbolic.py | sv2518/pymbolic | 42687a410b1c355beec510b91c18f97e5137795b | [
"MIT"
] | null | null | null | test/test_pymbolic.py | sv2518/pymbolic | 42687a410b1c355beec510b91c18f97e5137795b | [
"MIT"
] | null | null | null | __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | 27.831361 | 83 | 0.590837 | __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | true | true |
7908d746ff18a71c46571423dc0b91c0ad61e883 | 1,906 | py | Python | netdata/workers/json_storage.py | mincode/netdata | 4369a3bfb473509eff92083e03f214d5b75f6074 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | netdata/workers/json_storage.py | mincode/netdata | 4369a3bfb473509eff92083e03f214d5b75f6074 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | netdata/workers/json_storage.py | mincode/netdata | 4369a3bfb473509eff92083e03f214d5b75f6074 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import os
import json
__author__ = 'Manfred Minimair <manfred@minimair.org>'
class JSONStorage:
"""
File storage for a dictionary.
"""
file = '' # file name of storage file
data = None # data dict
indent = ' ' # indent prefix for pretty printing json files
def __init__(self, path, n... | 28.029412 | 77 | 0.559811 | import os
import json
__author__ = 'Manfred Minimair <manfred@minimair.org>'
class JSONStorage:
file = ''
data = None
indent = ' '
def __init__(self, path, name):
if path:
os.makedirs(path, exist_ok=True)
self.file = os.path.normpath(os.path.join(path, name))
... | true | true |
7908d88ba569ad63d3dfe13890f364ae53088ea0 | 912 | py | Python | tests/unit/test_advanced_collectible.py | Sam44323/nft-mix-opensea | 05f85412d6e088094ea18d2b0372578cbab2ebc4 | [
"MIT"
] | null | null | null | tests/unit/test_advanced_collectible.py | Sam44323/nft-mix-opensea | 05f85412d6e088094ea18d2b0372578cbab2ebc4 | [
"MIT"
] | null | null | null | tests/unit/test_advanced_collectible.py | Sam44323/nft-mix-opensea | 05f85412d6e088094ea18d2b0372578cbab2ebc4 | [
"MIT"
] | null | null | null | from brownie import AdvancedCollectible, network
import pytest
from scripts.advanced_collectible.deploy_and_create import deploy_and_create, get_contract
from scripts.utils.helpful_scripts import LOCAL_BLOCKCHAIN_ENVIRONMENTS, get_account
def test_can_create_advanced_collectible():
if network.show_active() not in... | 48 | 90 | 0.804825 | from brownie import AdvancedCollectible, network
import pytest
from scripts.advanced_collectible.deploy_and_create import deploy_and_create, get_contract
from scripts.utils.helpful_scripts import LOCAL_BLOCKCHAIN_ENVIRONMENTS, get_account
def test_can_create_advanced_collectible():
if network.show_active() not in... | true | true |
7908d8b8118a8f8da1175e4e0304b7e98d832205 | 7,037 | py | Python | lib/galaxy/files/uris.py | itisAliRH/galaxy | b3b693ea0788f773442c8481472a87f43ccb10d7 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/files/uris.py | itisAliRH/galaxy | b3b693ea0788f773442c8481472a87f43ccb10d7 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | lib/galaxy/files/uris.py | itisAliRH/galaxy | b3b693ea0788f773442c8481472a87f43ccb10d7 | [
"CC-BY-3.0"
] | null | null | null | import base64
import ipaddress
import logging
import os
import socket
import tempfile
import urllib.request
from typing import (
List,
Optional,
TYPE_CHECKING,
Union,
)
from urllib.parse import urlparse
from galaxy.exceptions import (
AdminRequiredException,
ConfigDoesNotAllowException,
)
from ... | 41.639053 | 120 | 0.656672 | import base64
import ipaddress
import logging
import os
import socket
import tempfile
import urllib.request
from typing import (
List,
Optional,
TYPE_CHECKING,
Union,
)
from urllib.parse import urlparse
from galaxy.exceptions import (
AdminRequiredException,
ConfigDoesNotAllowException,
)
from ... | true | true |
7908d98db986c3b603109c9af73e58b1ea91cf9b | 4,059 | py | Python | tools/chrome_proxy/webdriver/variations_combinations.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/chrome_proxy/webdriver/variations_combinations.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/chrome_proxy/webdriver/variations_combinations.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-01-05T23:43:46.000Z | 2021-01-07T23:36:34.000Z | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import io
import os
import platform
import sys
import time
import unittest
import common
sys.path.append(os.path.joi... | 33.545455 | 80 | 0.716433 |
from __future__ import print_function
import io
import os
import platform
import sys
import time
import unittest
import common
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
os.pardir, 'tools', 'variations'))
import fieldtrial_util
test_blacklist = [
'quic.Quic.testCheckPag... | true | true |
7908d99819f24bfd0b83b16febaeb5d0fe85ff40 | 90 | py | Python | python/p020.py | Martin-Gong/euler | dc29cb99c0e5f9916428de624edc375d9d5b4543 | [
"MIT"
] | null | null | null | python/p020.py | Martin-Gong/euler | dc29cb99c0e5f9916428de624edc375d9d5b4543 | [
"MIT"
] | null | null | null | python/p020.py | Martin-Gong/euler | dc29cb99c0e5f9916428de624edc375d9d5b4543 | [
"MIT"
] | null | null | null | # 20
num = 1
for i in range(100):
num *= i + 1
print(sum(int(n) for n in str(num)))
| 11.25 | 36 | 0.544444 |
num = 1
for i in range(100):
num *= i + 1
print(sum(int(n) for n in str(num)))
| true | true |
7908d9fe1ccbca93979cef5a519dac2aede81f9f | 11,585 | py | Python | cfltools/depreciated/getuniqueip.py | bradley-evans/cfltools | 940014313063c97875a2fe1085cbfe392cb3ec44 | [
"MIT"
] | 8 | 2018-07-26T02:32:33.000Z | 2022-02-18T00:55:32.000Z | cfltools/depreciated/getuniqueip.py | bradley-evans/cfltools | 940014313063c97875a2fe1085cbfe392cb3ec44 | [
"MIT"
] | 3 | 2018-07-23T17:13:45.000Z | 2018-07-31T19:57:43.000Z | cfltools/depreciated/getuniqueip.py | bradley-evans/cfltools | 940014313063c97875a2fe1085cbfe392cb3ec44 | [
"MIT"
] | 1 | 2019-10-06T23:20:17.000Z | 2019-10-06T23:20:17.000Z | import csv # csv reader functions
from collections.abc import Counter # count uniques in a file quickly, O(nlogn)
from decimal import Decimal # just to show decimals with lower precision
# Global Variables #
from cfltools.settings import APPFOLDER
class IpAddress:
def __init__(self, ip, numOccurances):
... | 41.375 | 86 | 0.489167 | import csv
from collections.abc import Counter
from decimal import Decimal
from cfltools.settings import APPFOLDER
class IpAddress:
def __init__(self, ip, numOccurances):
self.ip = ip
self.numOccurances = numOccurances
self.startTime = float('inf')
self.endTime = float('-in... | true | true |
7908da2e7d3605d288fb3f68c65c0ddb0ec54557 | 437 | py | Python | plotly/validators/streamtube/_name.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/streamtube/_name.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/streamtube/_name.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name='name', parent_name='streamtube', **kwargs):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edi... | 31.214286 | 79 | 0.647597 | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name='name', parent_name='streamtube', **kwargs):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edi... | true | true |
7908da3a9de13aa8b47d74510aff12c78f3cf400 | 1,156 | py | Python | checkov/terraform/checks/resource/aws/S3BucketObjectLock.py | jamesholland-uk/checkov | d73fd4bd7096d48ab3434a92a177bcc55605460a | [
"Apache-2.0"
] | 1 | 2021-02-13T15:24:42.000Z | 2021-02-13T15:24:42.000Z | checkov/terraform/checks/resource/aws/S3BucketObjectLock.py | jamesholland-uk/checkov | d73fd4bd7096d48ab3434a92a177bcc55605460a | [
"Apache-2.0"
] | 7 | 2021-04-12T06:54:07.000Z | 2022-03-21T14:04:14.000Z | checkov/terraform/checks/resource/aws/S3BucketObjectLock.py | jamesholland-uk/checkov | d73fd4bd7096d48ab3434a92a177bcc55605460a | [
"Apache-2.0"
] | 1 | 2021-12-16T03:09:55.000Z | 2021-12-16T03:09:55.000Z | from typing import Dict, List, Any
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck
class S3BucketObjectLock(BaseResourceCheck):
def __init__(self) -> None:
name = "Ensure that S3 bucket has lock... | 38.533333 | 106 | 0.712803 | from typing import Dict, List, Any
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck
class S3BucketObjectLock(BaseResourceCheck):
def __init__(self) -> None:
name = "Ensure that S3 bucket has lock... | true | true |
7908daefc745db57da1e75a03a505539fc39727a | 4,708 | py | Python | opts.py | yucornetto/CAKES | a1f87694028e1fae45c993129fe2e7f034a977cc | [
"MIT"
] | 8 | 2020-12-15T03:05:13.000Z | 2021-06-07T08:42:56.000Z | opts.py | yucornetto/CAKES | a1f87694028e1fae45c993129fe2e7f034a977cc | [
"MIT"
] | null | null | null | opts.py | yucornetto/CAKES | a1f87694028e1fae45c993129fe2e7f034a977cc | [
"MIT"
] | 1 | 2021-01-04T08:07:53.000Z | 2021-01-04T08:07:53.000Z | import argparse
parser = argparse.ArgumentParser(description="PyTorch implementation of action recognition models")
parser.add_argument('--dataset', type=str, choices=['somethingv1','somethingv2','diving48'],
default = 'somethingv1')
parser.add_argument('--root_path', type = str, default = '../',
... | 62.773333 | 140 | 0.594095 | import argparse
parser = argparse.ArgumentParser(description="PyTorch implementation of action recognition models")
parser.add_argument('--dataset', type=str, choices=['somethingv1','somethingv2','diving48'],
default = 'somethingv1')
parser.add_argument('--root_path', type = str, default = '../',
... | true | true |
7908dcae58f72e537451fda85c471be83bee3ac4 | 1,042 | py | Python | cride/utils/models.py | Jonulo/dejango-adv | 29bdec2f3a4c2cf9d9ff154e5c1bedf4006e479a | [
"MIT"
] | null | null | null | cride/utils/models.py | Jonulo/dejango-adv | 29bdec2f3a4c2cf9d9ff154e5c1bedf4006e479a | [
"MIT"
] | null | null | null | cride/utils/models.py | Jonulo/dejango-adv | 29bdec2f3a4c2cf9d9ff154e5c1bedf4006e479a | [
"MIT"
] | null | null | null | """Django models utilities."""
#Django
from django.db import models
class CRideModel(models.Model):
"""
CrideModel acts as an abastract base class from
which every other model in the project will inherit.
This class provides every table with de following
attributes:
+ created (Datetime): s... | 29.771429 | 78 | 0.649712 |
from django.db import models
class CRideModel(models.Model):
created = models.DateTimeField(
'created at',
auto_now_add=True,
help_text='Date time on which the object was created.'
)
modified = models.DateTimeField(
'modified at',
auto_now=True,
help_tex... | true | true |
7908dd28cb376d21480645ce25ee9573cdeda8a6 | 382 | py | Python | web/node_modules/weblas/test/data/binary_matrix.py | egornagornov3tf4k/Zeta36y | 4502be4c86195b0aa5184c45d6f221b34daee7a8 | [
"MIT"
] | 13 | 2017-12-29T12:16:36.000Z | 2022-01-22T21:23:00.000Z | web/node_modules/weblas/test/data/binary_matrix.py | egornagornov3tf4k/Zeta36y | 4502be4c86195b0aa5184c45d6f221b34daee7a8 | [
"MIT"
] | null | null | null | web/node_modules/weblas/test/data/binary_matrix.py | egornagornov3tf4k/Zeta36y | 4502be4c86195b0aa5184c45d6f221b34daee7a8 | [
"MIT"
] | 6 | 2018-02-21T02:11:10.000Z | 2022-01-22T21:23:47.000Z | #!/usr/bin/env python
"""Create two randomly generated matrices, of the specified sizes and write them
to JSON files.
"""
import json
import numpy as np
def read(path):
with open(path, 'rb') as f:
matrix = np.fromfile(f, dtype=np.float32)
return matrix
def write(path, matrix):
with open(path, 'wb') as f:
... | 16.608696 | 80 | 0.704188 |
import json
import numpy as np
def read(path):
with open(path, 'rb') as f:
matrix = np.fromfile(f, dtype=np.float32)
return matrix
def write(path, matrix):
with open(path, 'wb') as f:
f.write(matrix.astype(np.float32).tostring())
return matrix
| true | true |
7908dd7b845bff1879f13e4eec61ac675b3a410d | 2,723 | py | Python | gate/mixin.py | n-serrette/wedding-website | 9086edee97b8c99beb2da7f833663ef15520b46a | [
"MIT"
] | null | null | null | gate/mixin.py | n-serrette/wedding-website | 9086edee97b8c99beb2da7f833663ef15520b46a | [
"MIT"
] | null | null | null | gate/mixin.py | n-serrette/wedding-website | 9086edee97b8c99beb2da7f833663ef15520b46a | [
"MIT"
] | null | null | null | from urllib.parse import urlparse
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.shortcuts import resolve_url
from gate.views import redirect_to_gate
from gate import REDIRECT_FIELD_NAME
class GateLockMixin:
gate_url = None
permission_d... | 34.468354 | 109 | 0.658465 | from urllib.parse import urlparse
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.shortcuts import resolve_url
from gate.views import redirect_to_gate
from gate import REDIRECT_FIELD_NAME
class GateLockMixin:
gate_url = None
permission_d... | true | true |
7908deb22f18ae2f3b153c75fdd6b8808525f189 | 2,622 | py | Python | Trees/BinaryTreePL.py | eferroni/Data-Structure-and-Algorithms | bad33d4619884e03c85e13f604db753af5b543a0 | [
"MIT"
] | null | null | null | Trees/BinaryTreePL.py | eferroni/Data-Structure-and-Algorithms | bad33d4619884e03c85e13f604db753af5b543a0 | [
"MIT"
] | null | null | null | Trees/BinaryTreePL.py | eferroni/Data-Structure-and-Algorithms | bad33d4619884e03c85e13f604db753af5b543a0 | [
"MIT"
] | null | null | null | import QueueLinkedList as queue
"""
n1
/\
n2 n3
/\ /\
n4 n5 n6 n7
"""
class BinaryTree:
def __init__(self, size) -> None:
self.customList = size * [None]
self.lastUsedIndex = 0
self.maxSize = size
def inserNode(self, value):
if self.lastUsedIndex + 1 == self.m... | 25.705882 | 72 | 0.621663 | import QueueLinkedList as queue
class BinaryTree:
def __init__(self, size) -> None:
self.customList = size * [None]
self.lastUsedIndex = 0
self.maxSize = size
def inserNode(self, value):
if self.lastUsedIndex + 1 == self.maxSize:
return "Full"
self.customL... | true | true |
7908deb2cec3d0a93231706775a7f0c1ea2e97e5 | 994 | py | Python | test/test_check_invalid_value_IATA_code.py | Sergei-Soldatov/IFD.A | 5ec99de7a0059e1ae3551e4df89c461332246f60 | [
"Apache-2.0"
] | null | null | null | test/test_check_invalid_value_IATA_code.py | Sergei-Soldatov/IFD.A | 5ec99de7a0059e1ae3551e4df89c461332246f60 | [
"Apache-2.0"
] | null | null | null | test/test_check_invalid_value_IATA_code.py | Sergei-Soldatov/IFD.A | 5ec99de7a0059e1ae3551e4df89c461332246f60 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# IFD.A-8 :: Версия: 1 :: Проверка ввода невалидного значения в поле "код IATA" для выбора аэропорта
# Шаг 1
def test_check_invalid_value_IATA_to_select_airport(app):
app.session.enter_login(username="test")
app.session.enter_password(password="1245")
app.airport.open_form_add_airpo... | 41.416667 | 100 | 0.751509 |
def test_check_invalid_value_IATA_to_select_airport(app):
app.session.enter_login(username="test")
app.session.enter_password(password="1245")
app.airport.open_form_add_airport()
app.airport.enter_IATA_code(iata_cod="QWE")
app.airport.search_airport_by_parameter()
app.airport.message_no_airp... | true | true |
7908e1416c956529d1e7d2760160bb600aff2d8c | 6,798 | py | Python | bolinette/data/mapping/mapper.py | TheCaptainCat/flasque | d42deb57572084f513202a32c460186700ce8e0b | [
"MIT"
] | 3 | 2019-10-25T12:21:28.000Z | 2020-09-11T13:43:32.000Z | bolinette/data/mapping/mapper.py | TheCaptainCat/bolinette | d42deb57572084f513202a32c460186700ce8e0b | [
"MIT"
] | null | null | null | bolinette/data/mapping/mapper.py | TheCaptainCat/bolinette | d42deb57572084f513202a32c460186700ce8e0b | [
"MIT"
] | null | null | null | from typing import Literal
from bolinette import data, types
from bolinette.data import mapping
from bolinette.exceptions import InternalError
from bolinette.utils.functions import getattr_, hasattr_, invoke
class Mapper:
def __init__(self):
self._payloads: dict[str, dict[str, mapping.Definition]] = {}
... | 35.968254 | 88 | 0.582966 | from typing import Literal
from bolinette import data, types
from bolinette.data import mapping
from bolinette.exceptions import InternalError
from bolinette.utils.functions import getattr_, hasattr_, invoke
class Mapper:
def __init__(self):
self._payloads: dict[str, dict[str, mapping.Definition]] = {}
... | true | true |
7908e22e579eb3be116fc20dca793d18b300fcc5 | 7,015 | py | Python | tests/components/sensor/test_canary.py | dannyqwertz/home-assistant | 688bdc6532e514afbdc8efd1f574a7b5c9e8d280 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | tests/components/sensor/test_canary.py | au190/home-assistant | e87ecbd5007acad7468d7118d02b21f6d783c8bc | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | tests/components/sensor/test_canary.py | au190/home-assistant | e87ecbd5007acad7468d7118d02b21f6d783c8bc | [
"Apache-2.0"
] | 3 | 2018-08-29T19:26:20.000Z | 2020-01-19T11:58:22.000Z | """The tests for the Canary sensor platform."""
import copy
import unittest
from unittest.mock import Mock
from homeassistant.components.canary import DATA_CANARY
from homeassistant.components.sensor import canary
from homeassistant.components.sensor.canary import CanarySensor, \
SENSOR_TYPES, ATTR_AIR_QUALITY, ST... | 34.219512 | 79 | 0.648753 | import copy
import unittest
from unittest.mock import Mock
from homeassistant.components.canary import DATA_CANARY
from homeassistant.components.sensor import canary
from homeassistant.components.sensor.canary import CanarySensor, \
SENSOR_TYPES, ATTR_AIR_QUALITY, STATE_AIR_QUALITY_NORMAL, \
STATE_AIR_QUALITY_... | true | true |
7908e22f51452c20a3bfb329a57192bddb17bbda | 6,409 | py | Python | core/models/nddr_net.py | WZzhaoyi/MTLNAS | c04fcce1437eef306a41a6a224551be99d88f9a3 | [
"Apache-2.0"
] | 86 | 2020-04-04T03:37:33.000Z | 2022-03-13T07:36:24.000Z | core/models/nddr_net.py | hengxyz/MTLNAS | c04fcce1437eef306a41a6a224551be99d88f9a3 | [
"Apache-2.0"
] | 6 | 2020-04-05T15:09:15.000Z | 2021-06-08T21:12:35.000Z | core/models/nddr_net.py | hengxyz/MTLNAS | c04fcce1437eef306a41a6a224551be99d88f9a3 | [
"Apache-2.0"
] | 15 | 2020-04-07T03:27:34.000Z | 2021-12-22T09:13:27.000Z | import numpy as np
from time import sleep
import torch
import torch.nn as nn
import torch.nn.functional as F
from core.models.common_layers import batch_norm, get_nddr
from core.tasks import get_tasks
from core.utils import AttrDict
from core.utils.losses import poly
class SingleTaskNet(nn.Module):
def __init__... | 36.414773 | 124 | 0.559058 | import numpy as np
from time import sleep
import torch
import torch.nn as nn
import torch.nn.functional as F
from core.models.common_layers import batch_norm, get_nddr
from core.tasks import get_tasks
from core.utils import AttrDict
from core.utils.losses import poly
class SingleTaskNet(nn.Module):
def __init__... | true | true |
7908e2d4ea654159fc7e3d60596282dd1dfd6428 | 6,383 | py | Python | word2vec/estimators/word2vec.py | akb89/word2vec | 0533e6c1b5ee02d2523bc18359423f94651f7805 | [
"MIT"
] | 14 | 2019-06-19T15:26:07.000Z | 2021-11-13T20:15:58.000Z | word2vec/estimators/word2vec.py | akb89/word2vec | 0533e6c1b5ee02d2523bc18359423f94651f7805 | [
"MIT"
] | 9 | 2019-05-03T09:50:32.000Z | 2022-02-10T00:16:56.000Z | word2vec/estimators/word2vec.py | akb89/word2vec | 0533e6c1b5ee02d2523bc18359423f94651f7805 | [
"MIT"
] | 4 | 2019-12-06T09:49:48.000Z | 2022-01-19T08:56:32.000Z | """A word2vec implementation using Tensorflow and estimators."""
import os
from collections import defaultdict
import logging
import tensorflow as tf
# from tensorflow.python import debug as tf_debug # pylint: disable=E0611
import word2vec.utils.datasets as datasets_utils
import word2vec.models.word2vec as w2v_mod... | 44.950704 | 81 | 0.608491 |
import os
from collections import defaultdict
import logging
import tensorflow as tf
.datasets as datasets_utils
import word2vec.models.word2vec as w2v_model
from word2vec.evaluation.men import MEN
logger = logging.getLogger(__name__)
__all__ = ('Word2Vec')
class Word2Vec():
def __init__(self):
sel... | true | true |
7908e30251196b26a18072bb4b63cce247904208 | 10,205 | py | Python | conans/client/rest/uploader_downloader.py | xaqq/conan | ab0870336550b7521da71595c6babf42d5690f7b | [
"MIT"
] | null | null | null | conans/client/rest/uploader_downloader.py | xaqq/conan | ab0870336550b7521da71595c6babf42d5690f7b | [
"MIT"
] | 1 | 2018-06-01T09:34:49.000Z | 2018-06-01T13:51:07.000Z | conans/client/rest/uploader_downloader.py | xaqq/conan | ab0870336550b7521da71595c6babf42d5690f7b | [
"MIT"
] | null | null | null | import os
import time
import traceback
from conans.client.tools.files import human_size
from conans.errors import AuthenticationException, ConanConnectionError, ConanException, \
NotFoundException
from conans.util.files import mkdir, save_append, sha1sum, to_file_bytes
from conans.util.log import logger
from conan... | 38.655303 | 106 | 0.590691 | import os
import time
import traceback
from conans.client.tools.files import human_size
from conans.errors import AuthenticationException, ConanConnectionError, ConanException, \
NotFoundException
from conans.util.files import mkdir, save_append, sha1sum, to_file_bytes
from conans.util.log import logger
from conan... | true | true |
7908e52b5acc8f196064f27d3b05b84effb3e4c0 | 1,251 | py | Python | paddlemm/models/retrieval/layers/contrastive.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | 42 | 2022-01-05T13:49:48.000Z | 2022-03-30T20:20:18.000Z | paddlemm/models/retrieval/layers/contrastive.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | null | null | null | paddlemm/models/retrieval/layers/contrastive.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | 5 | 2022-01-19T00:27:24.000Z | 2022-03-23T08:29:50.000Z | import paddle
import paddle.nn as nn
class ContrastiveLoss(nn.Layer):
"""
Compute contrastive loss
"""
def __init__(self, margin=0, max_violation=False):
super(ContrastiveLoss, self).__init__()
self.margin = margin
self.max_violation = max_violation
def forward(self, score... | 32.921053 | 84 | 0.620304 | import paddle
import paddle.nn as nn
class ContrastiveLoss(nn.Layer):
def __init__(self, margin=0, max_violation=False):
super(ContrastiveLoss, self).__init__()
self.margin = margin
self.max_violation = max_violation
def forward(self, scores):
diag_idx = [[i, i] for i... | true | true |
7908e53a9b546b8e543c022f21a7efebaae89a17 | 740 | py | Python | networkit/test/test_reachability.py | angriman/network | 3a4c5fd32eb2be8d5b34eaee17f8fe4e6e141894 | [
"MIT"
] | 366 | 2019-06-27T18:48:18.000Z | 2022-03-29T08:36:49.000Z | networkit/test/test_reachability.py | angriman/network | 3a4c5fd32eb2be8d5b34eaee17f8fe4e6e141894 | [
"MIT"
] | 387 | 2019-06-24T11:30:39.000Z | 2022-03-31T10:37:28.000Z | networkit/test/test_reachability.py | angriman/network | 3a4c5fd32eb2be8d5b34eaee17f8fe4e6e141894 | [
"MIT"
] | 131 | 2019-07-04T15:40:13.000Z | 2022-03-29T12:34:23.000Z | #!/usr/bin/env python3
import unittest
import networkit as nk
class TestReachability(unittest.TestCase):
def testReachableNodes(self):
for directed in [False, True]:
for exact in [False, True]:
g = nk.generators.ErdosRenyiGenerator(100, 0.01, directed).generate()
rn = nk.reachability.ReachableNodes(g, ... | 30.833333 | 75 | 0.709459 |
import unittest
import networkit as nk
class TestReachability(unittest.TestCase):
def testReachableNodes(self):
for directed in [False, True]:
for exact in [False, True]:
g = nk.generators.ErdosRenyiGenerator(100, 0.01, directed).generate()
rn = nk.reachability.ReachableNodes(g, exact).run()
for u... | true | true |
7908e56570449d11614316ad38365ff90b93d140 | 401 | py | Python | setup.py | Frederick-S/wtouch | 4d6b2fefca8eb0b14b56ca9c5e1c060473093609 | [
"MIT"
] | null | null | null | setup.py | Frederick-S/wtouch | 4d6b2fefca8eb0b14b56ca9c5e1c060473093609 | [
"MIT"
] | null | null | null | setup.py | Frederick-S/wtouch | 4d6b2fefca8eb0b14b56ca9c5e1c060473093609 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='wtouch',
version='0.0.1',
description='Create a file in current folder.',
url='https://github.com/Frederick-S/wtouch',
packages=find_packages(exclude=['tests']),
entry_points={
'console_scripts': [
'wtouch = wtouch.mai... | 23.588235 | 51 | 0.628429 | from setuptools import setup, find_packages
setup(
name='wtouch',
version='0.0.1',
description='Create a file in current folder.',
url='https://github.com/Frederick-S/wtouch',
packages=find_packages(exclude=['tests']),
entry_points={
'console_scripts': [
'wtouch = wtouch.mai... | true | true |
7908e6043af0fbdf0d7188b4db6c8a049ae2a209 | 748 | py | Python | test/unit/rules/resources/properties/test_onlyone.py | duartemendes/cfn-python-lint | b0c599773761cf3d6a3be27b6ad96c2b76d9b266 | [
"MIT-0"
] | null | null | null | test/unit/rules/resources/properties/test_onlyone.py | duartemendes/cfn-python-lint | b0c599773761cf3d6a3be27b6ad96c2b76d9b266 | [
"MIT-0"
] | null | null | null | test/unit/rules/resources/properties/test_onlyone.py | duartemendes/cfn-python-lint | b0c599773761cf3d6a3be27b6ad96c2b76d9b266 | [
"MIT-0"
] | null | null | null | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from test.unit.rules import BaseRuleTestCase
from cfnlint.rules.resources.properties.OnlyOne import OnlyOne # pylint: disable=E0401
class TestPropertyOnlyOne(BaseRuleTestCase):
"""Test OnlyOne Property ... | 29.92 | 87 | 0.696524 | from test.unit.rules import BaseRuleTestCase
from cfnlint.rules.resources.properties.OnlyOne import OnlyOne
class TestPropertyOnlyOne(BaseRuleTestCase):
def setUp(self):
super(TestPropertyOnlyOne, self).setUp()
self.collection.register(OnlyOne())
def test_file_positive(self):
self.... | true | true |
7908e63e0376665719f7c607907de5ac3a07dd99 | 8,249 | py | Python | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/dagutil.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/dagutil.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/dagutil.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2021-12-16T23:31:37.000Z | 2021-12-16T23:31:37.000Z | # dagutil.py - dag utilities for mercurial
#
# Copyright 2010 Benoit Boissinot <bboissin@gmail.com>
# and Peter Arrenbrecht <peter@arrenbrecht.ch>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import nullrev
from i18n ... | 29.672662 | 79 | 0.564432 |
from node import nullrev
from i18n import _
class basedag(object):
def __init__(self):
self._inverse = None
def nodeset(self):
raise NotImplementedError()
def heads(self):
raise NotImplementedError()
def parents(self, ix):
raise NotImplementedError()
de... | true | true |
7908e73eb5b7b886b228430c6d2786bb4d94665f | 5,456 | py | Python | src/test/resources/expected/neuron/hhcell/main_script.py | openworm/org.geppetto.model.neuroml | 50afef112ecd4acf5b7e938784dac51eaebb09ea | [
"MIT"
] | 4 | 2015-03-04T18:18:08.000Z | 2021-03-06T16:29:48.000Z | src/test/resources/expected/neuron/hhcell/main_script.py | openworm/org.geppetto.model.neuroml | 50afef112ecd4acf5b7e938784dac51eaebb09ea | [
"MIT"
] | 46 | 2015-01-06T17:23:53.000Z | 2021-03-24T17:06:18.000Z | src/test/resources/expected/neuron/hhcell/main_script.py | openworm/org.geppetto.model.neuroml | 50afef112ecd4acf5b7e938784dac51eaebb09ea | [
"MIT"
] | 13 | 2015-02-04T13:41:49.000Z | 2019-02-15T21:46:18.000Z | '''
Neuron simulator export for:
Components:
net1 (Type: network)
sim1 (Type: Simulation: length=1.0 (SI time) step=5.0E-5 (SI time))
hhcell (Type: cell)
passive (Type: ionChannelPassive: conductance=1.0E-11 (SI conductance))
na (Type: ionChannelHH: conductance=1.0E-11 (SI conductance))
k (T... | 31.72093 | 128 | 0.566166 |
import neuron
import time
import hashlib
h = neuron.h
h.load_file("stdlib.hoc")
h.load_file("stdgui.hoc")
h("objref p")
h("p = new PythonObject()")
class NeuronSimulation():
def __init__(self, tstop, dt, seed=123456789):
print("\n Starting simulation in NEURON of %sms generated from NeuroML2 mode... | true | true |
7908e7e6b04137ecf4709441a1b6aa39615103e8 | 1,208 | py | Python | Programs/env_lda.py | mikepackard415/Scientific-Environmental-Discourse | f8d08734f7c2ce98e088479ac7b58c7b348c0401 | [
"MIT"
] | null | null | null | Programs/env_lda.py | mikepackard415/Scientific-Environmental-Discourse | f8d08734f7c2ce98e088479ac7b58c7b348c0401 | [
"MIT"
] | null | null | null | Programs/env_lda.py | mikepackard415/Scientific-Environmental-Discourse | f8d08734f7c2ce98e088479ac7b58c7b348c0401 | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from lda import LDA
def learn_topics(texts, topicnum):
# Get vocabulary and word counts. Use the top 10,000 most frequent
# lowercase unigrams with at least 3 alphabetical, non-numeric characters,
# punctuation treate... | 34.514286 | 84 | 0.701987 | import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from lda import LDA
def learn_topics(texts, topicnum):
print("Vectorizing...")
CVzer = CountVectorizer(max_features=10000,
lowercase=True)
doc_vcnts = CVzer.fit_transform(tex... | true | true |
7908e8ae137ab9e85eff92ca84e83834e0215fda | 5,047 | py | Python | fate-manager/hyperion/entity/types.py | cold-code/FATE-Cloud | 60de124a084624d46a9c2c9c8ca2a3dd4968d65d | [
"Apache-2.0"
] | null | null | null | fate-manager/hyperion/entity/types.py | cold-code/FATE-Cloud | 60de124a084624d46a9c2c9c8ca2a3dd4968d65d | [
"Apache-2.0"
] | null | null | null | fate-manager/hyperion/entity/types.py | cold-code/FATE-Cloud | 60de124a084624d46a9c2c9c8ca2a3dd4968d65d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020 The FATE 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
#
# Unless required by applicable ... | 33.423841 | 144 | 0.69467 |
class BaseStatus(object):
@classmethod
def status_list(cls):
return [cls.__dict__[k] for k in cls.__dict__.keys() if not callable(getattr(cls, k)) and not k.startswith("__")]
@classmethod
def contains(cls, status):
return status in cls.status_list()
class BaseStateTra... | true | true |
7908e94da7c76cb8d0aef0a9b2f0abe8549e4d02 | 1,527 | py | Python | pet_mk_viii/UnitTest/push_button.py | Pet-Series/Pet-Mk-VII | 4f14d8af46d6a3f4d9838028a6ac0d3c37695ab2 | [
"MIT"
] | null | null | null | pet_mk_viii/UnitTest/push_button.py | Pet-Series/Pet-Mk-VII | 4f14d8af46d6a3f4d9838028a6ac0d3c37695ab2 | [
"MIT"
] | 1 | 2022-03-30T20:40:19.000Z | 2022-03-30T20:40:19.000Z | pet_mk_viii/UnitTest/push_button.py | Pet-Series/Pet-Mk-VIII | 4f14d8af46d6a3f4d9838028a6ac0d3c37695ab2 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
from time import sleep
import sys
#Set warnings off (optional)
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
#Set Button and LED pins
JOYSTICK_BUTTON = 12
MAIN_SWITCH = 22
LED = 6
class button():
'''
A simple Push-Button class
'''
def __init__(self, pin, pud_up_down):
... | 27.763636 | 104 | 0.618206 | import RPi.GPIO as GPIO
from time import sleep
import sys
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
JOYSTICK_BUTTON = 12
MAIN_SWITCH = 22
LED = 6
class button():
def __init__(self, pin, pud_up_down):
print("'def __init__(self," + str(pin)+ "): '")
GPIO.setup(pin, GPIO.IN, pull_up_down=pud_... | true | true |
7908e96224c11c7a1c29ab81251541832b7ef41c | 3,287 | py | Python | src/covid_model_seiir_pipeline/lib/utilities.py | yukgu/covid-model-seiir-pipeline | 3433034d3f089938e7993b6321d570365bdf62db | [
"BSD-3-Clause"
] | 23 | 2020-05-25T00:20:32.000Z | 2022-01-18T10:32:09.000Z | src/covid_model_seiir_pipeline/lib/utilities.py | yukgu/covid-model-seiir-pipeline | 3433034d3f089938e7993b6321d570365bdf62db | [
"BSD-3-Clause"
] | 15 | 2020-06-15T16:34:22.000Z | 2021-08-15T22:11:37.000Z | src/covid_model_seiir_pipeline/lib/utilities.py | yukgu/covid-model-seiir-pipeline | 3433034d3f089938e7993b6321d570365bdf62db | [
"BSD-3-Clause"
] | 11 | 2020-05-24T21:57:29.000Z | 2021-09-07T18:21:15.000Z | from __future__ import annotations
import abc
from dataclasses import asdict as asdict_, fields, is_dataclass
from pathlib import Path
from typing import Dict, Union, Tuple
from pprint import pformat
from covid_shared import ihme_deps
import numpy as np
import pandas as pd
import yaml
class YamlIOMixin:
"""Mixi... | 29.612613 | 79 | 0.634621 | from __future__ import annotations
import abc
from dataclasses import asdict as asdict_, fields, is_dataclass
from pathlib import Path
from typing import Dict, Union, Tuple
from pprint import pformat
from covid_shared import ihme_deps
import numpy as np
import pandas as pd
import yaml
class YamlIOMixin:
@stati... | true | true |
7908ea2c9f6d7e854bd9299e0904e32c5cbc531b | 5,965 | py | Python | episode-7/main.py | abhra2020-smart/python-minecraft-clone | 08e186763ad778bc2a47c55fa30732f64d36f4e7 | [
"MIT"
] | null | null | null | episode-7/main.py | abhra2020-smart/python-minecraft-clone | 08e186763ad778bc2a47c55fa30732f64d36f4e7 | [
"MIT"
] | null | null | null | episode-7/main.py | abhra2020-smart/python-minecraft-clone | 08e186763ad778bc2a47c55fa30732f64d36f4e7 | [
"MIT"
] | null | null | null |
import math
import ctypes
import pyglet
pyglet.options["shadow_window"] = False
pyglet.options["debug_gl"] = False
import pyglet.gl as gl
import matrix
import shader
import camera
import block_type
import texture_manager
class Window(pyglet.window.Window):
def __init__(self, **args):
super().__init__(**args)
... | 30.126263 | 133 | 0.718692 |
import math
import ctypes
import pyglet
pyglet.options["shadow_window"] = False
pyglet.options["debug_gl"] = False
import pyglet.gl as gl
import matrix
import shader
import camera
import block_type
import texture_manager
class Window(pyglet.window.Window):
def __init__(self, **args):
super().__init__(**args)
... | true | true |
7908eac94588f0c35d6443c95e4a889dcdd92644 | 945 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_mac_address/test_api_get_interface_mac_address.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/interface/get/get_interface_mac_address/test_api_get_interface_mac_address.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"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/interface/get/get_interface_mac_address/test_api_get_interface_mac_address.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"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.interface.get import get_interface_mac_address
class TestGetInterfaceMacAddress(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = """
devices:
R1_xe:
connections:
... | 30.483871 | 93 | 0.621164 | import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.iosxe.interface.get import get_interface_mac_address
class TestGetInterfaceMacAddress(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = """
devices:
R1_xe:
connections:
... | true | true |
7908eb5c747d1b302729d9401e1781c65d594dd4 | 30,985 | py | Python | pycalc/MAVProxy/modules/mavproxy_cmdlong.py | joakimzhang/python-electron | 79bc174a14c5286ca739bb7d8ce6522fdc6e9e80 | [
"CC0-1.0"
] | null | null | null | pycalc/MAVProxy/modules/mavproxy_cmdlong.py | joakimzhang/python-electron | 79bc174a14c5286ca739bb7d8ce6522fdc6e9e80 | [
"CC0-1.0"
] | 8 | 2021-01-28T19:26:22.000Z | 2022-03-24T18:07:24.000Z | pycalc/MAVProxy/modules/mavproxy_cmdlong.py | joakimzhang/python-electron | 79bc174a14c5286ca739bb7d8ce6522fdc6e9e80 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
'''command long'''
import threading
import time, os
import math
from pymavlink import mavutil
from MAVProxy.modules.lib import mp_module
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
from threading import Thread
import mpl_toolkits.mplot3d.axes3d as... | 36.367371 | 93 | 0.487333 |
'''command long'''
import threading
import time, os
import math
from pymavlink import mavutil
from MAVProxy.modules.lib import mp_module
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
from threading import Thread
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib... | false | true |
7908ec075a8b14b62076c5abbb6d278914aac0b6 | 1,743 | py | Python | apps/jd_app/models.py | fengjinqi/linjuanbang | 8cdc4e81df73ccd737ac547da7f2c7dca545862a | [
"MIT"
] | 5 | 2019-10-30T01:16:30.000Z | 2020-06-14T03:32:19.000Z | apps/jd_app/models.py | fengjinqi/linjuanbang | 8cdc4e81df73ccd737ac547da7f2c7dca545862a | [
"MIT"
] | 2 | 2020-10-12T07:12:48.000Z | 2021-06-02T03:15:47.000Z | apps/jd_app/models.py | fengjinqi/linjuanbang | 8cdc4e81df73ccd737ac547da7f2c7dca545862a | [
"MIT"
] | 3 | 2019-12-06T17:33:49.000Z | 2021-03-01T13:24:22.000Z | from datetime import datetime
from django.db import models
# Create your models here.
class JD(models.Model):
appkey = models.CharField(max_length=100,verbose_name='appkey')
secret = models.CharField(max_length=100,verbose_name='secret')
add_time = models.DateTimeField(default=datetime.now,verbose_name=... | 24.9 | 87 | 0.690189 | from datetime import datetime
from django.db import models
class JD(models.Model):
appkey = models.CharField(max_length=100,verbose_name='appkey')
secret = models.CharField(max_length=100,verbose_name='secret')
add_time = models.DateTimeField(default=datetime.now,verbose_name='添加时间')
def __str__(s... | true | true |
7908edc30bcf26d9931d6ebc78acb1c00e718f42 | 3,298 | py | Python | src/commercetools/testing/auth.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | 15 | 2018-11-02T14:35:52.000Z | 2022-03-16T07:51:44.000Z | src/commercetools/testing/auth.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | 84 | 2018-11-02T12:50:32.000Z | 2022-03-22T01:25:54.000Z | src/commercetools/testing/auth.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | 13 | 2019-01-03T09:16:50.000Z | 2022-02-15T18:37:19.000Z | import base64
import typing
import uuid
from urllib.parse import parse_qs
from commercetools.testing.abstract import BaseBackend
from commercetools.testing.utils import create_commercetools_response
class AuthModel:
def __init__(self):
self.tokens: typing.List[str] = []
def add_token(self, token):
... | 34 | 87 | 0.61037 | import base64
import typing
import uuid
from urllib.parse import parse_qs
from commercetools.testing.abstract import BaseBackend
from commercetools.testing.utils import create_commercetools_response
class AuthModel:
def __init__(self):
self.tokens: typing.List[str] = []
def add_token(self, token):
... | true | true |
7908ee6a8bd2987044d87e1114158c744b4cf8f0 | 616 | py | Python | partners/urls.py | IndraTeja/uno-cpi | b9e635d4273613602b6c57a0c70d82d3df5c77ca | [
"MIT"
] | null | null | null | partners/urls.py | IndraTeja/uno-cpi | b9e635d4273613602b6c57a0c70d82d3df5c77ca | [
"MIT"
] | 7 | 2020-02-11T23:38:26.000Z | 2022-01-13T01:02:45.000Z | partners/urls.py | Goutham2591/mav-cpi | 3f7985d2a7bf57c08a1ff65bc14a8e60c3d0464b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'partners'
urlpatterns = [
path('registerCampusPartner/', views.registerCampusPartner, name='registerCampusPartner'),
path('registerCommunityPartner/', views.registerCommunityPartner, name='registerCommunityPartner'),
path('profile/userprofile/... | 47.384615 | 104 | 0.761364 | from django.urls import path
from . import views
app_name = 'partners'
urlpatterns = [
path('registerCampusPartner/', views.registerCampusPartner, name='registerCampusPartner'),
path('registerCommunityPartner/', views.registerCommunityPartner, name='registerCommunityPartner'),
path('profile/userprofile/... | true | true |
7908eea552959b49b7b10164847eb7dc74028999 | 5,430 | py | Python | example/usermanagement/serve_flask_marshmallow.py | raphj/hapic | b169ee901005bbe535e27ec878a051c2c1226e43 | [
"MIT"
] | 20 | 2017-10-13T11:23:33.000Z | 2021-12-09T12:42:06.000Z | example/usermanagement/serve_flask_marshmallow.py | raphj/hapic | b169ee901005bbe535e27ec878a051c2c1226e43 | [
"MIT"
] | 130 | 2017-10-10T15:09:13.000Z | 2021-12-30T10:36:08.000Z | example/usermanagement/serve_flask_marshmallow.py | raphj/hapic | b169ee901005bbe535e27ec878a051c2c1226e43 | [
"MIT"
] | 7 | 2017-10-17T07:24:42.000Z | 2021-09-16T14:33:17.000Z | # -*- coding: utf-8 -*-
from datetime import datetime
import json
import time
import flask
from example.usermanagement.schema_marshmallow import AboutSchema
from example.usermanagement.schema_marshmallow import NoContentSchema
from example.usermanagement.schema_marshmallow import UserAvatarSchema
from example.userma... | 36.689189 | 98 | 0.707182 |
from datetime import datetime
import json
import time
import flask
from example.usermanagement.schema_marshmallow import AboutSchema
from example.usermanagement.schema_marshmallow import NoContentSchema
from example.usermanagement.schema_marshmallow import UserAvatarSchema
from example.usermanagement.schema_marshma... | true | true |
7908f006c711ecbda5d511f15234b90e66530ec4 | 3,098 | py | Python | test.py | Leo-xxx/flappy | bf3d09ecf8ad2a7a35d7513d3d6eb39bca9c1922 | [
"MIT"
] | 192 | 2019-02-28T05:50:59.000Z | 2022-03-21T07:23:32.000Z | test.py | yangluliang/flappy | 746cd33d8b56f09b71a308ce041150d8eb61344b | [
"MIT"
] | 6 | 2019-05-18T09:19:31.000Z | 2020-11-15T01:13:07.000Z | test.py | yangluliang/flappy | 746cd33d8b56f09b71a308ce041150d8eb61344b | [
"MIT"
] | 52 | 2019-03-07T03:15:23.000Z | 2022-03-03T06:17:28.000Z | ########################## FWMAV Simulation #########################
# Version 0.3
# Fan Fei Feb 2019
# Direct motor driven flapping wing MAV simulation
#######################################################################
import gym
import flappy
from stable_baselines.common.policies import MlpPolicy
from stab... | 31.612245 | 145 | 0.714009 | true | true | |
7908f041090e0ad93a81737cfc2b38afecb21b6a | 592 | py | Python | offpcc/domains/dmc_cartpole_su.py | zhihanyang2022/CleanRL | dfeb9aa992032b63bab9df0dc08ded334ceda546 | [
"MIT"
] | 27 | 2021-10-10T17:15:42.000Z | 2022-03-02T02:38:44.000Z | offpcc/domains/dmc_cartpole_su.py | zhihanyang2022/CleanRL | dfeb9aa992032b63bab9df0dc08ded334ceda546 | [
"MIT"
] | 1 | 2021-06-08T12:37:12.000Z | 2021-06-08T12:37:12.000Z | offpcc/domains/dmc_cartpole_su.py | zhihanyang2022/CleanRL | dfeb9aa992032b63bab9df0dc08ded334ceda546 | [
"MIT"
] | 3 | 2021-11-18T11:15:02.000Z | 2022-03-09T12:51:35.000Z | import dmc2gym
from domains.wrappers import ConcatObs
def mdp():
return dmc2gym.make(domain_name="cartpole", task_name="swingup", keys_to_exclude=[], frame_skip=5, track_prev_action=False)
def p():
return dmc2gym.make(domain_name="cartpole", task_name="swingup", keys_to_exclude=['velocity'], frame_skip=5, t... | 26.909091 | 137 | 0.741554 | import dmc2gym
from domains.wrappers import ConcatObs
def mdp():
return dmc2gym.make(domain_name="cartpole", task_name="swingup", keys_to_exclude=[], frame_skip=5, track_prev_action=False)
def p():
return dmc2gym.make(domain_name="cartpole", task_name="swingup", keys_to_exclude=['velocity'], frame_skip=5, t... | true | true |
7908f0aae83b8012b04742235aed97f8a6ab12bf | 777 | py | Python | Exercicios em python/ex69.py | GabrielSantos25/Python | 208eec0144587aa4e0aa7fa00da29ffa0478eac8 | [
"MIT"
] | null | null | null | Exercicios em python/ex69.py | GabrielSantos25/Python | 208eec0144587aa4e0aa7fa00da29ffa0478eac8 | [
"MIT"
] | null | null | null | Exercicios em python/ex69.py | GabrielSantos25/Python | 208eec0144587aa4e0aa7fa00da29ffa0478eac8 | [
"MIT"
] | null | null | null | print('-'*20)
print('CADASTRE UMA PESSOA')
print('-'*20)
total = totalm = totalf = 0
while True:
idade = int(input('Idade: '))
if idade >= 18:
total += 1
sexo = ' '
while sexo not in 'MF':
sexo = str(input('Sexo: [M/F]')).strip().upper()[0]
# observações!
if sexo == 'M':
... | 25.9 | 73 | 0.537967 | print('-'*20)
print('CADASTRE UMA PESSOA')
print('-'*20)
total = totalm = totalf = 0
while True:
idade = int(input('Idade: '))
if idade >= 18:
total += 1
sexo = ' '
while sexo not in 'MF':
sexo = str(input('Sexo: [M/F]')).strip().upper()[0]
if sexo == 'M':
totalm +=... | true | true |
7908f0be09c001faf60d38698ab97836651a2937 | 1,241 | py | Python | QuoteEngine/Ingestor.py | 1ayham1/Data_Science-MemesGenerator | 71f64960122e8b32acf84cc71dbcec4fac90b0d1 | [
"MIT"
] | null | null | null | QuoteEngine/Ingestor.py | 1ayham1/Data_Science-MemesGenerator | 71f64960122e8b32acf84cc71dbcec4fac90b0d1 | [
"MIT"
] | null | null | null | QuoteEngine/Ingestor.py | 1ayham1/Data_Science-MemesGenerator | 71f64960122e8b32acf84cc71dbcec4fac90b0d1 | [
"MIT"
] | null | null | null | """Define family of algorithms and make them interchangeable
The algorithms vary independetly from the clients using it.
This class implements to IngestorInterface and dynamically invoke
a suitable algorithm (strategy.algorithm()), through parse()
abstract method. i.e. it is independent of how an algorithm
is im... | 34.472222 | 79 | 0.759871 |
from typing import List
from .IngestorInterface import IngestorInterface
from .QuoteModel import QuoteModel
from .CSVImporter import CSVImporter
from .PDFImporter import PDFImporter
from .DocxImporter import DocxImporter
from .TXTImporter import TXTImporter
class Ingestor(IngestorInterface):
impor... | true | true |
7908f0d2e966cd5b8a3b2952f22d9cdd3ff7b664 | 2,368 | py | Python | invenio_app_ils/circulation/jsonresolvers/loan.py | equadon/invenio-app-ils | 42ba282968d0aa28fb1bfc71d0709685165aaec4 | [
"MIT"
] | null | null | null | invenio_app_ils/circulation/jsonresolvers/loan.py | equadon/invenio-app-ils | 42ba282968d0aa28fb1bfc71d0709685165aaec4 | [
"MIT"
] | null | null | null | invenio_app_ils/circulation/jsonresolvers/loan.py | equadon/invenio-app-ils | 42ba282968d0aa28fb1bfc71d0709685165aaec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019-2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Circulation Loan resolvers."""
from invenio_circulation.proxies import current_circulation
from invenio_p... | 28.190476 | 76 | 0.668074 |
from invenio_circulation.proxies import current_circulation
from invenio_pidstore.errors import PIDDeletedError
from invenio_app_ils.circulation.utils import resolve_item_from_loan
from invenio_app_ils.jsonresolver.api import \
get_field_value_for_record as get_field_value
from invenio_app_ils.jsonresolver... | true | true |
7908f1126071b8be0fdbd134d770ce9c20ce7b27 | 1,127 | py | Python | ReinforcementLearning/Bandit/EpsilonGreedy.py | MitI-7/MachineLearning | 6450e2a9260ae70cb75cd2f195729143fe427431 | [
"MIT"
] | null | null | null | ReinforcementLearning/Bandit/EpsilonGreedy.py | MitI-7/MachineLearning | 6450e2a9260ae70cb75cd2f195729143fe427431 | [
"MIT"
] | null | null | null | ReinforcementLearning/Bandit/EpsilonGreedy.py | MitI-7/MachineLearning | 6450e2a9260ae70cb75cd2f195729143fe427431 | [
"MIT"
] | null | null | null | import random
import math
import numpy as np
from typing import List
class EpsilonGreedy:
def __init__(self, epsilon: float, counts: List[int], values: List[float]):
assert epsilon is None or 0.0 <= epsilon <= 1.0
self.epsilon = epsilon
self.counts = counts
self.values = values
... | 28.175 | 108 | 0.584738 | import random
import math
import numpy as np
from typing import List
class EpsilonGreedy:
def __init__(self, epsilon: float, counts: List[int], values: List[float]):
assert epsilon is None or 0.0 <= epsilon <= 1.0
self.epsilon = epsilon
self.counts = counts
self.values = values
... | true | true |
7908f1cccbd446c855fab8653d88ad1c9a2bd027 | 569 | py | Python | venv/Lib/site-packages/skimage/conftest.py | 997Yi/Flask-web | 6b5e5d274bfa25fbd3db5af02723a5671f1e901d | [
"MIT"
] | 2 | 2020-08-25T13:55:00.000Z | 2020-08-25T16:36:03.000Z | venv/Lib/site-packages/skimage/conftest.py | 997Yi/Flask-web | 6b5e5d274bfa25fbd3db5af02723a5671f1e901d | [
"MIT"
] | 1 | 2020-04-25T20:36:07.000Z | 2020-04-25T20:36:07.000Z | site-packages/skimage/conftest.py | Wristlebane/Pyto | 901ac307b68486d8289105c159ca702318bea5b0 | [
"MIT"
] | 1 | 2020-07-30T10:30:48.000Z | 2020-07-30T10:30:48.000Z | # Use legacy numpy printing. This fix is made to keep doctests functional.
# For more info, see https://github.com/scikit-image/scikit-image/pull/2935 .
# TODO: remove this workaround once minimal required numpy is set to 1.14.0
from distutils.version import LooseVersion as Version
import numpy as np
if Version(np.__v... | 35.5625 | 77 | 0.760984 |
from distutils.version import LooseVersion as Version
import numpy as np
if Version(np.__version__) >= Version('1.14'):
np.set_printoptions(legacy='1.13')
collect_ignore = ["io/_plugins",]
try:
import visvis
except ImportError:
collect_ignore.append("measure/mc_meta/visual_test.py")
| true | true |
7908f1fc56f5ecaaa2415bd1b8957b5348177620 | 1,811 | py | Python | exaslct_src/lib/export_container_tasks_creator.py | mace84/script-languages | d586cbe212bbb4efbfb39e095183729c65489360 | [
"MIT"
] | null | null | null | exaslct_src/lib/export_container_tasks_creator.py | mace84/script-languages | d586cbe212bbb4efbfb39e095183729c65489360 | [
"MIT"
] | 1 | 2019-05-06T07:36:11.000Z | 2019-05-06T07:36:11.000Z | exaslct_src/lib/export_container_tasks_creator.py | mace84/script-languages | d586cbe212bbb4efbfb39e095183729c65489360 | [
"MIT"
] | 1 | 2019-05-03T08:49:29.000Z | 2019-05-03T08:49:29.000Z | from typing import Dict
from exaslct_src.lib.export_container_task import ExportContainerTask
from exaslct_src.lib.data.required_task_info import RequiredTaskInfo
from exaslct_src.lib.docker.docker_create_image_task import DockerCreateImageTask
class ExportContainerTasksCreator():
def __init__(self, export_path... | 45.275 | 92 | 0.692435 | from typing import Dict
from exaslct_src.lib.export_container_task import ExportContainerTask
from exaslct_src.lib.data.required_task_info import RequiredTaskInfo
from exaslct_src.lib.docker.docker_create_image_task import DockerCreateImageTask
class ExportContainerTasksCreator():
def __init__(self, export_path... | true | true |
7908f38a2f366f8efa26aa93d4185f78abc6b682 | 145 | py | Python | apache/util_script.py | GrahamDumpleton-abandoned/apswigpy | b821b94a78ceed5b8991f7c345aeeadca3729a90 | [
"Apache-2.0"
] | null | null | null | apache/util_script.py | GrahamDumpleton-abandoned/apswigpy | b821b94a78ceed5b8991f7c345aeeadca3729a90 | [
"Apache-2.0"
] | null | null | null | apache/util_script.py | GrahamDumpleton-abandoned/apswigpy | b821b94a78ceed5b8991f7c345aeeadca3729a90 | [
"Apache-2.0"
] | null | null | null | import apache
if apache.version == (2, 2):
from apache22.util_script import *
else:
raise RuntimeError('Apache version not supported.')
| 20.714286 | 55 | 0.717241 | import apache
if apache.version == (2, 2):
from apache22.util_script import *
else:
raise RuntimeError('Apache version not supported.')
| true | true |
7908f69fd6f5e627e54b697a55756de54ed44c2e | 28,367 | py | Python | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | 10 | 2020-06-05T19:42:26.000Z | 2022-03-11T23:38:35.000Z | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
"""Implements the... | 30.934569 | 92 | 0.501251 | = self.conn.execute_2darray(SQL)
if len(rset['rows']) == 0:
return gone(_("""Could not find the check constraint."""))
if "convalidated" in rset['rows'][0] and rset['rows'][0]["convalidated"]:
icon = "icon-check_constraints_bad"
valid = False
else:
... | true | true |
7908f716a9071b582abe39f0e366ba440e8de357 | 710 | gyp | Python | test/copies/src/copies-sourceless-shared-lib.gyp | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | test/copies/src/copies-sourceless-shared-lib.gyp | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | test/copies/src/copies-sourceless-shared-lib.gyp | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright (c) 2015 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'mylib',
'type': 'static_library',
'sources': [ 'foo.c' ],
},
{
'target_name': 'mysolib',
... | 25.357143 | 76 | 0.540845 |
{
'targets': [
{
'target_name': 'mylib',
'type': 'static_library',
'sources': [ 'foo.c' ],
},
{
'target_name': 'mysolib',
'type': 'shared_library',
'dependencies': [ 'mylib' ],
'copies': [
{
'destination': '<(PRODUCT_DIR)/copies-out',
... | true | true |
7908f7ec5839a4deb692ebb3693747826a3a5a18 | 10,364 | py | Python | tools/create_makefile.py | mehrdad-shokri/phxpaxos | c6c8806c3497cabe6e74dc09aa4487b6fd2057f7 | [
"OpenSSL"
] | 2,025 | 2017-08-02T09:32:00.000Z | 2022-03-30T05:16:30.000Z | tools/create_makefile.py | mehrdad-shokri/phxpaxos | c6c8806c3497cabe6e74dc09aa4487b6fd2057f7 | [
"OpenSSL"
] | 130 | 2017-08-02T11:05:48.000Z | 2022-01-29T04:24:48.000Z | tools/create_makefile.py | mehrdad-shokri/phxpaxos | c6c8806c3497cabe6e74dc09aa4487b6fd2057f7 | [
"OpenSSL"
] | 580 | 2017-08-02T15:31:36.000Z | 2022-03-16T14:09:01.000Z | import sys
import os
import pwd
import getpass
from build_comm import *
base_path=""
include_makefile=[]
makefile=[]
obj_list=[]
clean_dir=[]
lib_path="$(SRC_BASE_PATH)/.lib"
ext_lib_path="$(SRC_BASE_PATH)/.lib/extlib"
sbin_path="$(SRC_BASE_PATH)/.sbin"
def writefile(write_file, text):
write_file.append(text + "\... | 31.02994 | 139 | 0.661521 | import sys
import os
import pwd
import getpass
from build_comm import *
base_path=""
include_makefile=[]
makefile=[]
obj_list=[]
clean_dir=[]
lib_path="$(SRC_BASE_PATH)/.lib"
ext_lib_path="$(SRC_BASE_PATH)/.lib/extlib"
sbin_path="$(SRC_BASE_PATH)/.sbin"
def writefile(write_file, text):
write_file.append(text + "\... | true | true |
7908f8598d94e85f7bd651d199599fbd62fdb5f7 | 623 | py | Python | tests/wrangled_test.py | zack-murray/lambdata-zmurray | 5c41af2f2159cc081b86077a8b24d9920609e08a | [
"MIT"
] | null | null | null | tests/wrangled_test.py | zack-murray/lambdata-zmurray | 5c41af2f2159cc081b86077a8b24d9920609e08a | [
"MIT"
] | null | null | null | tests/wrangled_test.py | zack-murray/lambdata-zmurray | 5c41af2f2159cc081b86077a8b24d9920609e08a | [
"MIT"
] | 1 | 2020-05-06T01:47:15.000Z | 2020-05-06T01:47:15.000Z | import unittest
from my_lambdata.assignment1 import WrangledFrame
class TestWrangledFrame(unittest.TestCase):
def test_add_state_names(self):
wf = WrangledFrame({"abbrev": ["CA", "CO", "CT", "DC", "TX"]})
breakpoint()
wf.add_state_names()
# ensure there is a "name" column
... | 27.086957 | 70 | 0.627608 | import unittest
from my_lambdata.assignment1 import WrangledFrame
class TestWrangledFrame(unittest.TestCase):
def test_add_state_names(self):
wf = WrangledFrame({"abbrev": ["CA", "CO", "CT", "DC", "TX"]})
breakpoint()
wf.add_state_names()
self.assertEqual(list(wf.column... | true | true |
7908fa0ca084705fd59f6d525bd1cd830f4d5cb5 | 652 | py | Python | bandit/insecureCode.py | mir-dhaka/coding_playground | f20138e404c27e008b2902d4be2e9f9d4c25b11f | [
"Apache-2.0"
] | 2 | 2019-05-23T06:05:20.000Z | 2019-11-17T01:35:45.000Z | bandit/insecureCode.py | mir-dhaka/coding_playground | f20138e404c27e008b2902d4be2e9f9d4c25b11f | [
"Apache-2.0"
] | 2 | 2020-08-29T12:29:11.000Z | 2020-08-29T12:30:14.000Z | bandit/insecureCode.py | mir-dhaka/coding_playground | f20138e404c27e008b2902d4be2e9f9d4c25b11f | [
"Apache-2.0"
] | 2 | 2020-07-18T17:07:36.000Z | 2021-12-06T02:21:15.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 damian <damian@C-DZ-E5500>
#
# Distributed under terms of the MIT license.
"""
"""
import subprocess
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import yaml
def read_file(filename):
with open(f... | 19.757576 | 52 | 0.691718 |
import subprocess
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import yaml
def read_file(filename):
with open(filename) as f:
data = yaml.load(f.read())
def run_command(cmd):
return subprocess.check_call(cmd, shell=True)
db = create_engine('sqlite:///somedata... | true | true |
7908fb3364f621064e1037dcfd71331b065775e4 | 935 | py | Python | llvm/test/MC/COFF/bigobj.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 4,812 | 2015-01-02T19:38:10.000Z | 2022-03-27T12:42:24.000Z | llvm/test/MC/COFF/bigobj.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 127 | 2015-12-03T21:42:53.000Z | 2019-11-21T14:34:20.000Z | llvm/test/MC/COFF/bigobj.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,543 | 2015-01-01T11:18:36.000Z | 2022-03-22T21:32:36.000Z | # RUN: python %s | llvm-mc -filetype=obj -triple i686-pc-win32 - | llvm-readobj -h | FileCheck %s
from __future__ import print_function
# This test checks that the COFF object emitter can produce objects with
# more than 65279 sections.
# While we only generate 65277 sections, an implicit .text, .data and .bss will
... | 32.241379 | 97 | 0.656684 |
from __future__ import print_function
num_sections = 65277
for i in range(0, num_sections):
print(""" .section .bss,"bw",discard,_b%d
.globl _b%d # @b%d
_b%d:
.byte 0 # 0x0
""" % (i, i, i, i))
| true | true |
7908fc415dfc1cd7d22cd6fb320f53e39b4e70d5 | 3,401 | py | Python | jenkins_client.py | hummerstudio/jenkinsclient | d8cbdab84d837a45c644a67e1072778f41bb89a5 | [
"MulanPSL-1.0"
] | 1 | 2021-10-05T16:34:05.000Z | 2021-10-05T16:34:05.000Z | jenkins_client.py | hummerstudio/jenkinsclient | d8cbdab84d837a45c644a67e1072778f41bb89a5 | [
"MulanPSL-1.0"
] | 1 | 2020-10-16T07:56:44.000Z | 2021-05-16T06:14:23.000Z | jenkins_client.py | hummerstudio/jenkinsclient | d8cbdab84d837a45c644a67e1072778f41bb89a5 | [
"MulanPSL-1.0"
] | 1 | 2021-10-05T16:34:14.000Z | 2021-10-05T16:34:14.000Z | """
Copyright (c) 2020 Tang Ming
jenkinsclient is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES O... | 29.833333 | 201 | 0.648339 | import locale
import os
import fire
from jenkinsclient.core import Core
from jenkinsclient.credentials import Credentials
from jenkinsclient.executor import Executor
from jenkinsclient.build import Build
from jenkinsclient.config import Config
from jenkinsclient.job import Job
from jenkinsclient.node import Node
from... | true | true |
7908fcfdc28bc6f848ba082bddc54e43af6b8532 | 20,002 | py | Python | mutation_origin/cli.py | Phuong-Le/mutationorigin | fad00fca3c1073637ede2c6948f5278a030971dc | [
"BSD-3-Clause"
] | 1 | 2020-01-10T02:46:06.000Z | 2020-01-10T02:46:06.000Z | mutation_origin/cli.py | Phuong-Le/mutationorigin | fad00fca3c1073637ede2c6948f5278a030971dc | [
"BSD-3-Clause"
] | 1 | 2019-10-16T01:12:45.000Z | 2019-10-16T01:12:45.000Z | mutation_origin/cli.py | Phuong-Le/mutationorigin | fad00fca3c1073637ede2c6948f5278a030971dc | [
"BSD-3-Clause"
] | 3 | 2020-02-10T02:00:16.000Z | 2021-01-14T02:14:03.000Z | """command line interface for mutation_origin"""
import os
import time
import pickle
from collections import defaultdict
import click
from tqdm import tqdm
import pandas
from numpy import log
from numpy.random import seed as np_seed
from scitrack import CachingLogger
from sklearn.model_selection import train_test_split... | 35.40177 | 108 | 0.606739 | import os
import time
import pickle
from collections import defaultdict
import click
from tqdm import tqdm
import pandas
from numpy import log
from numpy.random import seed as np_seed
from scitrack import CachingLogger
from sklearn.model_selection import train_test_split
from mutation_origin.opt import (_seed, _featur... | true | true |
7908fdd54a96c094be872a6f7be7d3858c5af6b3 | 7,750 | py | Python | main.py | papaispicolo/CarNDT3-SemanticSegmentation | c1940c01769cbf03d7c28c3a72946e4bd9682d59 | [
"MIT"
] | null | null | null | main.py | papaispicolo/CarNDT3-SemanticSegmentation | c1940c01769cbf03d7c28c3a72946e4bd9682d59 | [
"MIT"
] | null | null | null | main.py | papaispicolo/CarNDT3-SemanticSegmentation | c1940c01769cbf03d7c28c3a72946e4bd9682d59 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os.path
import tensorflow as tf
import helper
import warnings
from distutils.version import LooseVersion
import project_tests as tests
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.fo... | 41.891892 | 146 | 0.711613 |
import os.path
import tensorflow as tf
import helper
import warnings
from distutils.version import LooseVersion
import project_tests as tests
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__)
print('TensorFlow Version: ... | true | true |
7908fe19f061ef977f21b52d2782a3887c88c794 | 35,017 | py | Python | template/parser.py | lmr/Template-Toolkit-Python | 3b1affc79c2f650b057956b0dbf6e0cb51515999 | [
"Artistic-2.0"
] | 2 | 2021-05-07T08:50:06.000Z | 2021-06-12T15:48:23.000Z | template/parser.py | lmr/Template-Toolkit-Python | 3b1affc79c2f650b057956b0dbf6e0cb51515999 | [
"Artistic-2.0"
] | 1 | 2018-11-29T08:49:42.000Z | 2018-11-29T08:49:42.000Z | template/parser.py | lmr/Template-Toolkit-Python | 3b1affc79c2f650b057956b0dbf6e0cb51515999 | [
"Artistic-2.0"
] | null | null | null | #
# The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008,
# derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy
# Wardley. All Rights Reserved.
#
# The file "LICENSE" at the top level of this source distribution describes
# the terms under which this file may be distributed.
#
... | 32.818182 | 101 | 0.58583 |
import collections
import re
import sys
from template import util
from template.constants import *
from template.directive import Directive
from template.grammar import Grammar
from template.util import TemplateException
CONTINUE = 0
ACCEPT = 1
ERROR = 2
ABORT = 3
TAG_STYLE = {
"default": (r"\[%", r"%... | true | true |
7908fe75e07930f352f3b769db6fb5dc1058566b | 89,512 | py | Python | dataactcore/scripts/pull_fpds_data.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | dataactcore/scripts/pull_fpds_data.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | 3 | 2021-08-22T11:47:45.000Z | 2022-03-29T22:06:49.000Z | dataactcore/scripts/pull_fpds_data.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | import boto3
import logging
import argparse
import requests
import xmltodict
import asyncio
import datetime
import time
import re
import json
import math
from sqlalchemy import func
from dateutil.relativedelta import relativedelta
from requests.exceptions import ConnectionError, ReadTimeout
from urllib3.exceptions ... | 46.57232 | 120 | 0.652259 | import boto3
import logging
import argparse
import requests
import xmltodict
import asyncio
import datetime
import time
import re
import json
import math
from sqlalchemy import func
from dateutil.relativedelta import relativedelta
from requests.exceptions import ConnectionError, ReadTimeout
from urllib3.exceptions ... | true | true |
7908fe7fbee791b88a73632579a09a78b09348d4 | 2,724 | py | Python | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ModifyEipAddressAttributeRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ModifyEipAddressAttributeRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ModifyEipAddressAttributeRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 34.05 | 84 | 0.769457 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvpc.endpoint import endpoint_data
class ModifyEipAddressAttributeRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Vpc', '2016-04-28', 'ModifyEipAddressAttribute','vpc')
self.set_method('POST')
if hasattr(self, "en... | true | true |
7908fed372287d58f9cf742f2a75006852ac4e38 | 5,177 | py | Python | btDown.py | tianxiaxi/iDown | f958871f6476ea660da26adc4648a679259d7624 | [
"MIT"
] | 2 | 2021-07-26T16:03:54.000Z | 2021-11-17T19:42:01.000Z | btDown.py | tianxiaxi/iDown | f958871f6476ea660da26adc4648a679259d7624 | [
"MIT"
] | 1 | 2018-10-09T01:55:21.000Z | 2018-10-09T06:18:27.000Z | btDown.py | tianxiaxi/iDown | f958871f6476ea660da26adc4648a679259d7624 | [
"MIT"
] | 2 | 2020-04-10T13:28:55.000Z | 2021-07-26T16:03:55.000Z | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
'''btDown.py - Download resource for HTTP/HTTPS/FTP/Thunder/Magnet/BT
Usage: python3 btDown.py <url> [path]
Required:
url HTTP/HTTPS/FTP/Thunder/MagNet/BT downloading URL
Optionals:
path The store path for the downloaded file
Notice: Python3 requ... | 31.760736 | 75 | 0.596871 |
import os
import sys
import requests
import time
import re
import enum
import base64
from urllib import parse, request
def usage(err=None):
if err:
print(err)
print(__doc__)
sys.exit(0)
@enum.unique
class PROTROL_TYEP(enum.Enum):
UNKNOWN = 0
HTTP = 1
FTP = 2
BT... | true | true |
7908ff135c22d7c8e2ea5483b3b23182ff9ab182 | 615 | py | Python | Python-codes-CeV/40-Average.py | engcristian/Python | 726a53e9499fd5d0594572298e59e318f98e2d36 | [
"MIT"
] | 1 | 2021-02-22T03:53:23.000Z | 2021-02-22T03:53:23.000Z | Python-codes-CeV/40-Average.py | engcristian/Python | 726a53e9499fd5d0594572298e59e318f98e2d36 | [
"MIT"
] | null | null | null | Python-codes-CeV/40-Average.py | engcristian/Python | 726a53e9499fd5d0594572298e59e318f98e2d36 | [
"MIT"
] | null | null | null | '''Ask two student's grade, inform 3 possible averages.
average :
> 7 = Approved
< 7 & > 5 = Recovery
< 5 = Failed
'''
g1 = float(input("Inform the student's first grade: "))
g2 = float(input("Inform the student's second grade: "))
average = (g1 + g2)/2 # how to calculate the avarege grade between two values
if averag... | 38.4375 | 82 | 0.687805 | g1 = float(input("Inform the student's first grade: "))
g2 = float(input("Inform the student's second grade: "))
average = (g1 + g2)/2
if average >= 7:
print(f"Student with avarege \033[35m{average}\033[m: \033[32mAPPROVED\033[m")
elif average >= 5 and average < 7:
print(f"Student with avarege \033[35m{averag... | true | true |
79090001c6f55f22f5669e721a69995553e7c9bb | 1,046 | py | Python | PyUtilities/hdf5_stress_range.py | MingAtUWA/SimpleMPM2 | 7a1d7c257c621123d85a0630e93d42ae25c70fb4 | [
"MIT"
] | null | null | null | PyUtilities/hdf5_stress_range.py | MingAtUWA/SimpleMPM2 | 7a1d7c257c621123d85a0630e93d42ae25c70fb4 | [
"MIT"
] | null | null | null | PyUtilities/hdf5_stress_range.py | MingAtUWA/SimpleMPM2 | 7a1d7c257c621123d85a0630e93d42ae25c70fb4 | [
"MIT"
] | null | null | null | import numpy as np
import h5py as py
import matplotlib.pyplot as plt
import sys
hdf5_file = py.File("..\\Build\\TestsWithGL\\t2d_mpm_chm_t_bar_conference_restart.hdf5", "r")
frame_id = 0
th_grp = hdf5_file['TimeHistory']['penetration']
pcl_dset = th_grp['frame_%d' % frame_id]['ParticleData']
pcl_num = pcl_dset.attrs[... | 29.055556 | 93 | 0.664436 | import numpy as np
import h5py as py
import matplotlib.pyplot as plt
import sys
hdf5_file = py.File("..\\Build\\TestsWithGL\\t2d_mpm_chm_t_bar_conference_restart.hdf5", "r")
frame_id = 0
th_grp = hdf5_file['TimeHistory']['penetration']
pcl_dset = th_grp['frame_%d' % frame_id]['ParticleData']
pcl_num = pcl_dset.attrs[... | true | true |
7909001e6a21fbc44e84258b061f8c6d4d90019b | 74,026 | py | Python | python/ccxt/async_support/bitvavo.py | DoctorSlimm/ccxt | 8f19512dfc5dac159eaeb465c98226c00252a9b6 | [
"MIT"
] | 1 | 2021-11-16T15:45:34.000Z | 2021-11-16T15:45:34.000Z | python/ccxt/async_support/bitvavo.py | DoctorSlimm/ccxt | 8f19512dfc5dac159eaeb465c98226c00252a9b6 | [
"MIT"
] | null | null | null | python/ccxt/async_support/bitvavo.py | DoctorSlimm/ccxt | 8f19512dfc5dac159eaeb465c98226c00252a9b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticatio... | 45.082826 | 340 | 0.514184 |
rt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.bas... | true | true |
7909007417512d15c6c39b097333e348548af6ea | 586 | py | Python | submissions/submissions_22.py | arnabbiswas1/k_tab_sept_roc_auc_binary_classification_KFold | 7a5a91e52d460fd25133b76d5241462a4aedc474 | [
"Apache-2.0"
] | null | null | null | submissions/submissions_22.py | arnabbiswas1/k_tab_sept_roc_auc_binary_classification_KFold | 7a5a91e52d460fd25133b76d5241462a4aedc474 | [
"Apache-2.0"
] | null | null | null | submissions/submissions_22.py | arnabbiswas1/k_tab_sept_roc_auc_binary_classification_KFold | 7a5a91e52d460fd25133b76d5241462a4aedc474 | [
"Apache-2.0"
] | null | null | null |
import os
import pandas as pd
COMPETITION_NAME = "tabular-playground-series-sep-2021"
SUBMISSION_DIR = "."
SUBMISSION_FILE = "sub_blending_1_my_rank_004-2o-lightgbm-colsample_81830_my_ranking_81790_0926_1918.csv"
SUBMISSION_MESSAGE = '"004-2o-lightgbm-colsample-tps-sep-2021 + stacking_lgb_xbg_cat_imputer_no_impute... | 29.3 | 130 | 0.812287 |
import os
import pandas as pd
COMPETITION_NAME = "tabular-playground-series-sep-2021"
SUBMISSION_DIR = "."
SUBMISSION_FILE = "sub_blending_1_my_rank_004-2o-lightgbm-colsample_81830_my_ranking_81790_0926_1918.csv"
SUBMISSION_MESSAGE = '"004-2o-lightgbm-colsample-tps-sep-2021 + stacking_lgb_xbg_cat_imputer_no_impute... | true | true |
7909036782a088913328994be9d41fb8ab88ca3e | 3,684 | py | Python | collectd-smartmon.py | nlm/collectd-smartmon | 7fbbf1a8074dff59dfead8df5069c811563c9aff | [
"MIT"
] | null | null | null | collectd-smartmon.py | nlm/collectd-smartmon | 7fbbf1a8074dff59dfead8df5069c811563c9aff | [
"MIT"
] | null | null | null | collectd-smartmon.py | nlm/collectd-smartmon | 7fbbf1a8074dff59dfead8df5069c811563c9aff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function, absolute_import
import re
import subprocess
import os
import time
import argparse
import sys
class SmartDevice(object):
smartcmdfmt = ['sudo', 'smartctl', '-f', 'brief', '-A', '/dev/{dev}']
def __init__(self, dev):
self.dev = dev
s... | 35.76699 | 85 | 0.540717 |
from __future__ import print_function, absolute_import
import re
import subprocess
import os
import time
import argparse
import sys
class SmartDevice(object):
smartcmdfmt = ['sudo', 'smartctl', '-f', 'brief', '-A', '/dev/{dev}']
def __init__(self, dev):
self.dev = dev
self.attrcmd = [x.form... | true | true |
7909039deafd00c16d2abe8b5ae9232446976ad3 | 8,913 | py | Python | custom/icds/management/commands/populate_mother_name.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds/management/commands/populate_mother_name.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | custom/icds/management/commands/populate_mother_name.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | import csv
import six
import sys
import time
from datetime import (
datetime,
date,
timedelta,
)
from xml.etree import cElementTree as ElementTree
from django.core.management.base import BaseCommand
from corehq.apps.users.util import SYSTEM_USER_ID
from corehq.form_processor.backends.sql.dbaccessors impo... | 41.84507 | 102 | 0.62392 | import csv
import six
import sys
import time
from datetime import (
datetime,
date,
timedelta,
)
from xml.etree import cElementTree as ElementTree
from django.core.management.base import BaseCommand
from corehq.apps.users.util import SYSTEM_USER_ID
from corehq.form_processor.backends.sql.dbaccessors impo... | true | true |
7909043c829cf1680c1db567491ee4d952463ffa | 667 | py | Python | dcodex/migrations/0035_auto_20210216_0331.py | rbturnbull/dcodex | 85ac729aa9d2cfd0540738efc7d2ce5913c97351 | [
"Apache-2.0"
] | 5 | 2020-12-19T18:21:56.000Z | 2021-11-03T01:09:42.000Z | dcodex/migrations/0035_auto_20210216_0331.py | rbturnbull/dcodex | 85ac729aa9d2cfd0540738efc7d2ce5913c97351 | [
"Apache-2.0"
] | 6 | 2021-04-04T12:08:27.000Z | 2022-03-12T01:07:00.000Z | dcodex/migrations/0035_auto_20210216_0331.py | rbturnbull/dcodex | 85ac729aa9d2cfd0540738efc7d2ce5913c97351 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.3 on 2021-02-16 11:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("imagedeck", "0009_auto_20201122_2300"),
("dcodex", "0034_auto_20201215_0315"),
]
operations = [
mig... | 24.703704 | 64 | 0.562219 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("imagedeck", "0009_auto_20201122_2300"),
("dcodex", "0034_auto_20201215_0315"),
]
operations = [
migrations.AlterField(
model_name="man... | true | true |
790904fc423a70595a615822cd209d3fec2f81a0 | 788 | py | Python | conanfile.py | demo-ci-conan/libB | 16059c79804bd773a4de75728cf24408db4c6149 | [
"MIT"
] | null | null | null | conanfile.py | demo-ci-conan/libB | 16059c79804bd773a4de75728cf24408db4c6149 | [
"MIT"
] | null | null | null | conanfile.py | demo-ci-conan/libB | 16059c79804bd773a4de75728cf24408db4c6149 | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake
class LibB(ConanFile):
name = "libB"
version = "0.0"
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False]}
default_options = {"shared": False}
generators = "cmake"
scm = {"type": "git",
"url": "auto",
... | 23.176471 | 57 | 0.568528 | from conans import ConanFile, CMake
class LibB(ConanFile):
name = "libB"
version = "0.0"
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False]}
default_options = {"shared": False}
generators = "cmake"
scm = {"type": "git",
"url": "auto",
... | true | true |
79090565ec3a1c5532ff5245c32e5148e4906b95 | 1,490 | py | Python | dashboard/entities/Devices.py | Hexagoons/GUI-Arduino-Weather-Station | a4966ea765dbec61b0da6cb1c2efc30a43fa8d0d | [
"MIT"
] | null | null | null | dashboard/entities/Devices.py | Hexagoons/GUI-Arduino-Weather-Station | a4966ea765dbec61b0da6cb1c2efc30a43fa8d0d | [
"MIT"
] | null | null | null | dashboard/entities/Devices.py | Hexagoons/GUI-Arduino-Weather-Station | a4966ea765dbec61b0da6cb1c2efc30a43fa8d0d | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import ttk
import json
from dashboard.entities.InputField import InputField
from dashboard.entities.StatusField import StatusField
class Devices(ttk.Frame):
"""
Devices Frame for Settings
"""
def __init__(self, parent, settings):
"""
Constructs a Warni... | 33.111111 | 96 | 0.641611 | import tkinter as tk
from tkinter import ttk
import json
from dashboard.entities.InputField import InputField
from dashboard.entities.StatusField import StatusField
class Devices(ttk.Frame):
def __init__(self, parent, settings):
self.settings = settings
ttk.Frame.__init__(self, parent, relief="rai... | true | true |
790908c900d3cb9ed9674bb1af267a72a156b11f | 8,127 | py | Python | upconvert/parser/geda_commands.py | lehaianh1986/schematic-file-converter | ed67274511a5b0e1b378e4e0fd3943ec8a189f43 | [
"Apache-2.0"
] | null | null | null | upconvert/parser/geda_commands.py | lehaianh1986/schematic-file-converter | ed67274511a5b0e1b378e4e0fd3943ec8a189f43 | [
"Apache-2.0"
] | null | null | null | upconvert/parser/geda_commands.py | lehaianh1986/schematic-file-converter | ed67274511a5b0e1b378e4e0fd3943ec8a189f43 | [
"Apache-2.0"
] | null | null | null | class GEDAColor:
""" Enumeration of gEDA colors """
BACKGROUND_COLOR = 0
PIN_COLOR = 1
NET_ENDPOINT_COLOR = 2
GRAPHIC_COLOR = 3
NET_COLOR = 4
ATTRIBUTE_COLOR = 5
LOGIC_BUBBLE_COLOR = 6
DOTS_GRID_COLOR = 7
DETACHED_ATTRIBUTE_COLOR = 8
TEXT_COLOR = 9
BUS_COLOR = 10
SELE... | 28.921708 | 69 | 0.621632 | class GEDAColor:
BACKGROUND_COLOR = 0
PIN_COLOR = 1
NET_ENDPOINT_COLOR = 2
GRAPHIC_COLOR = 3
NET_COLOR = 4
ATTRIBUTE_COLOR = 5
LOGIC_BUBBLE_COLOR = 6
DOTS_GRID_COLOR = 7
DETACHED_ATTRIBUTE_COLOR = 8
TEXT_COLOR = 9
BUS_COLOR = 10
SELECT_COLOR = 11
BOUNDINGBOX_COLOR = 1... | true | true |
79090a5fd1a3a33a089c5fbe3390777081cf79d7 | 2,642 | py | Python | pywren_ibm_cloud/libs/ibm_cloudfunctions/iam.py | class-euproject/lithops | acf381817673c29db0e9e143001029357890a39b | [
"Apache-2.0"
] | 1 | 2020-08-04T08:16:31.000Z | 2020-08-04T08:16:31.000Z | pywren_ibm_cloud/libs/ibm_cloudfunctions/iam.py | class-euproject/lithops | acf381817673c29db0e9e143001029357890a39b | [
"Apache-2.0"
] | null | null | null | pywren_ibm_cloud/libs/ibm_cloudfunctions/iam.py | class-euproject/lithops | acf381817673c29db0e9e143001029357890a39b | [
"Apache-2.0"
] | null | null | null | #
# (C) Copyright IBM Corp. 2019
#
# 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 writi... | 38.289855 | 117 | 0.671461 |
import logging
import requests
from urllib.parse import urlencode
logger = logging.getLogger(__name__)
class IBMIAMClient:
def __init__(self, iam_config, cf_endpoint, cf_namespace):
self.iam_api_key = iam_config.get('api_key', None)
self.iam_auth_endpoint = iam_config['ibm_auth_... | true | true |
79090ae7f5b2eb168df9aaf66cbdcea43e9ae8dd | 3,759 | py | Python | infoblox_netmri/api/broker/broker.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/broker/broker.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/broker/broker.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | from infoblox_netmri.utils.utils import locate, to_snake
from infoblox_netmri.api.exceptions.netmri_exceptions import NotImplementedException
class Broker(object):
""" Base class for broker instances, provides methods for API requests.
And return responces wrapped with specific class
:param client... | 34.172727 | 85 | 0.623304 | from infoblox_netmri.utils.utils import locate, to_snake
from infoblox_netmri.api.exceptions.netmri_exceptions import NotImplementedException
class Broker(object):
controller = None
def __init__(self, client):
self.client = client
def api_request(self, method_name, params):
data = self.c... | true | true |
79090e5a83eb25559b684d75ae6fb2a9c884e5e9 | 4,627 | py | Python | test/functional/p2p_node_network_limited.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | test/functional/p2p_node_network_limited.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | test/functional/p2p_node_network_limited.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Vadercoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests NODE_NETWORK_LIMITED.
Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITE... | 40.587719 | 121 | 0.694619 |
from test_framework.messages import CInv, MSG_BLOCK, msg_getdata, msg_verack, NODE_NETWORK_LIMITED, NODE_WITNESS
from test_framework.p2p import P2PInterface
from test_framework.test_framework import VadercoinTestFramework
from test_framework.util import (
assert_equal,
)
class P2PIgnoreInv(P2PInterface):
... | true | true |
79090ed4fae9ab29304bd432c2797964675df5ec | 13,148 | py | Python | kivy/uix/image.py | eman1can/kivy | 58bd0dcaf73d7a167a4df53879bfb18e5a005277 | [
"MIT"
] | null | null | null | kivy/uix/image.py | eman1can/kivy | 58bd0dcaf73d7a167a4df53879bfb18e5a005277 | [
"MIT"
] | null | null | null | kivy/uix/image.py | eman1can/kivy | 58bd0dcaf73d7a167a4df53879bfb18e5a005277 | [
"MIT"
] | null | null | null | '''
Image
=====
The :class:`Image` widget is used to display an image::
Example in python::
wimg = Image(source='mylogo.png')
Kv Example::
Image:
source: 'mylogo.png'
size: self.texture_size
Asynchronous Loading
--------------------
To load an image asynchronously (for example from an ex... | 30.435185 | 140 | 0.625114 | __all__ = ('Image', 'AsyncImage')
from kivy.uix.widget import Widget
from kivy.core.image import Image as CoreImage
from kivy.resources import resource_find
from kivy.properties import StringProperty, ObjectProperty, ListProperty, \
AliasProperty, BooleanProperty, NumericProperty, ColorProperty
from kivy.logger im... | true | true |
79090eef96959629c484b5871518c33b54fcbf81 | 8,323 | py | Python | beta/trim_primers.py | ArthurDondi/cDNA_Cupcake | 528b9593b0ad166ac720be7c5c07a968730a2ce2 | [
"BSD-3-Clause-Clear"
] | 205 | 2016-07-13T06:26:20.000Z | 2022-03-03T06:29:43.000Z | beta/trim_primers.py | ArthurDondi/cDNA_Cupcake | 528b9593b0ad166ac720be7c5c07a968730a2ce2 | [
"BSD-3-Clause-Clear"
] | 186 | 2017-02-22T22:46:46.000Z | 2022-03-23T16:16:15.000Z | beta/trim_primers.py | ArthurDondi/cDNA_Cupcake | 528b9593b0ad166ac720be7c5c07a968730a2ce2 | [
"BSD-3-Clause-Clear"
] | 93 | 2016-08-31T02:24:52.000Z | 2022-02-24T14:01:27.000Z | """
Experimemtal code for trimming primers & polyA tails from high error rate long reads
"""
import os, sys, pdb
from csv import DictWriter
from collections import namedtuple
from multiprocessing import Process
from Bio.Seq import Seq
from Bio import SeqIO
import parasail
ScoreTuple = namedtuple('ScoreTuple', ['score5... | 36.344978 | 123 | 0.58104 | import os, sys, pdb
from csv import DictWriter
from collections import namedtuple
from multiprocessing import Process
from Bio.Seq import Seq
from Bio import SeqIO
import parasail
ScoreTuple = namedtuple('ScoreTuple', ['score5', 'end5', 'score3', 'end3', 'endA'])
ISOSEQ_5P = 'GCAATGAAGTCGCAGGGTTGGG'
ISOSEQ_3P = '... | true | true |
79090fbe9b8b68ec68479f9a113253ecc8047899 | 2,523 | py | Python | chapter4_serving_patterns/prep_pred_pattern/src/proto/prediction_service_pb2_grpc.py | sudabon/ml-system-in-actions | 4fb1b3e53e4ed7c36e82f7d4b5570e3959aef525 | [
"MIT"
] | 133 | 2021-04-24T09:57:58.000Z | 2022-03-29T06:23:56.000Z | chapter4_serving_patterns/prep_pred_pattern/src/proto/prediction_service_pb2_grpc.py | sudabon/ml-system-in-actions | 4fb1b3e53e4ed7c36e82f7d4b5570e3959aef525 | [
"MIT"
] | 6 | 2021-04-24T09:58:40.000Z | 2021-11-19T04:04:40.000Z | chapter4_serving_patterns/prep_pred_pattern/src/proto/prediction_service_pb2_grpc.py | sudabon/ml-system-in-actions | 4fb1b3e53e4ed7c36e82f7d4b5570e3959aef525 | [
"MIT"
] | 40 | 2021-05-21T23:32:40.000Z | 2022-03-30T00:33:08.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import src.proto.predict_pb2 as predict__pb2
class PredictionServiceStub(object):
"""Missing associated documentation comment in .proto file."""
def __... | 32.766234 | 119 | 0.67063 |
import grpc
import src.proto.predict_pb2 as predict__pb2
class PredictionServiceStub(object):
def __init__(self, channel):
self.Predict = channel.unary_unary(
"/onnxruntime.server.PredictionService/Predict",
request_serializer=predict__pb2.PredictRequest.SerializeToString,
... | true | true |
79090ff89d1a5582585b1d7794f226b636dd9b02 | 20,150 | py | Python | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/contrib/mongoengine/view.py | hexlism/css_platform | 0c80cb314e7e3ecf73de2feec5349c04c0dd581b | [
"Apache-2.0"
] | null | null | null | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/contrib/mongoengine/view.py | hexlism/css_platform | 0c80cb314e7e3ecf73de2feec5349c04c0dd581b | [
"Apache-2.0"
] | null | null | null | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/contrib/mongoengine/view.py | hexlism/css_platform | 0c80cb314e7e3ecf73de2feec5349c04c0dd581b | [
"Apache-2.0"
] | null | null | null | import logging
from flask import request, flash, abort, Response
from flask_admin import expose
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import wrap_fields_in_fieldlist
from flask_admin.model.fields import ListEditableFieldLi... | 31.095679 | 114 | 0.551663 | import logging
from flask import request, flash, abort, Response
from flask_admin import expose
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import wrap_fields_in_fieldlist
from flask_admin.model.fields import ListEditableFieldLi... | true | true |
79091091c4e06730ed2243a54682e0bb34a550b5 | 329 | py | Python | courier/management/commands/clear_old_admin_logs.py | HelloMelanieC/FiveUp | ab97d311f163b09146fe330e4360d8e75d769f95 | [
"MIT"
] | 12 | 2017-09-10T01:43:42.000Z | 2020-09-20T01:17:20.000Z | courier/management/commands/clear_old_admin_logs.py | HelloMelanieC/FiveUp | ab97d311f163b09146fe330e4360d8e75d769f95 | [
"MIT"
] | 22 | 2016-12-26T21:46:10.000Z | 2022-02-10T08:01:52.000Z | courier/management/commands/clear_old_admin_logs.py | HelloMelanieC/FiveUp | ab97d311f163b09146fe330e4360d8e75d769f95 | [
"MIT"
] | 4 | 2017-08-24T16:01:37.000Z | 2019-02-14T23:50:17.000Z | from django.core.management.base import BaseCommand
from django.contrib.admin.models import LogEntry
def clear_old_admin_logs():
logs = LogEntry.objects.all()
for i in range(2000, len(logs)):
logs[i].delete()
class Command(BaseCommand):
def handle(self, *args, **options):
clear_old_admi... | 21.933333 | 51 | 0.705167 | from django.core.management.base import BaseCommand
from django.contrib.admin.models import LogEntry
def clear_old_admin_logs():
logs = LogEntry.objects.all()
for i in range(2000, len(logs)):
logs[i].delete()
class Command(BaseCommand):
def handle(self, *args, **options):
clear_old_admi... | true | true |
790910f6dbfe1ac36189de9e30ba162e48df428e | 2,579 | py | Python | scripts/camera_publisher_node.py | Alexandre-Bonneau/uwds3_perception | 21529f63b3b3d2ad5e30eefece2d75378ae7651f | [
"MIT"
] | null | null | null | scripts/camera_publisher_node.py | Alexandre-Bonneau/uwds3_perception | 21529f63b3b3d2ad5e30eefece2d75378ae7651f | [
"MIT"
] | null | null | null | scripts/camera_publisher_node.py | Alexandre-Bonneau/uwds3_perception | 21529f63b3b3d2ad5e30eefece2d75378ae7651f | [
"MIT"
] | 1 | 2020-02-07T15:54:03.000Z | 2020-02-07T15:54:03.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import rospy
import cv2
import sensor_msgs
import numpy as np
from cv_bridge import CvBridge
class CameraPublisher(object):
""" """
def __init__(self):
"""Default constructor"""
self.rgb_image_topic = rospy.get_param("~rgb_image_topic",... | 36.842857 | 118 | 0.633579 |
import os
import rospy
import cv2
import sensor_msgs
import numpy as np
from cv_bridge import CvBridge
class CameraPublisher(object):
def __init__(self):
self.rgb_image_topic = rospy.get_param("~rgb_image_topic", "/camera/rgb/image_raw")
self.camera_publisher = rospy.Publisher(self.rgb_image_t... | true | true |
7909113b4715f07283c948e8bdf136b70c8c9250 | 4,077 | py | Python | pde/tools/parse_duration.py | lmenou/py-pde | 3899cba0481657ea7b3d5c05e318d0b851bbe8cd | [
"MIT"
] | null | null | null | pde/tools/parse_duration.py | lmenou/py-pde | 3899cba0481657ea7b3d5c05e318d0b851bbe8cd | [
"MIT"
] | null | null | null | pde/tools/parse_duration.py | lmenou/py-pde | 3899cba0481657ea7b3d5c05e318d0b851bbe8cd | [
"MIT"
] | null | null | null | """
Parsing time durations from strings
This module provides a function that parses time durations from strings. It has
been copied from the django software, which comes with the following notes:
Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.
Redistribution and use in sour... | 36.079646 | 80 | 0.651459 |
import datetime
import re
standard_duration_re = re.compile(
r"^"
r"(?:(?P<days>-?\d+) (days?, )?)?"
r"((?:(?P<hours>-?\d+):)(?=\d+:\d+))?"
r"(?:(?P<minutes>-?\d+):)?"
r"(?P<seconds>-?\d+)"
r"(?:\.(?P<microseconds>\d{1,6})\d{0,6})?"
r"$"
)
iso8601_duration_re = re.compile(
r"^(?P<si... | true | true |
790911bb0668c537a7d71a71d91876a2a82c231f | 1,206 | py | Python | pommerman/NN/neural_net.py | MaxU11/playground | 240182f88836e860fc144a82e98c0f4028294334 | [
"Apache-2.0"
] | null | null | null | pommerman/NN/neural_net.py | MaxU11/playground | 240182f88836e860fc144a82e98c0f4028294334 | [
"Apache-2.0"
] | null | null | null | pommerman/NN/neural_net.py | MaxU11/playground | 240182f88836e860fc144a82e98c0f4028294334 | [
"Apache-2.0"
] | null | null | null | class NeuralNet():
def __init__(self, game):
pass
def train(self, examples):
"""
This function trains the neural network with examples obtained from
self-play.
Input:
examples: a list of training examples, where each example is of form
... | 30.15 | 80 | 0.554726 | class NeuralNet():
def __init__(self, game):
pass
def train(self, examples):
pass
def predict(self, board):
pass
def save_checkpoint(self, folder, filename):
pass
def load_checkpoint(self, folder, filename):
pass | true | true |
790912ae9300aaef288f70c7804b874ce94c60ea | 35 | py | Python | plot_utils/__init__.py | IntelLabs/causality-lab | 6ee7d4325257a38666558f8b7e310581a709d256 | [
"Apache-2.0"
] | 18 | 2021-12-08T09:06:52.000Z | 2022-03-07T01:08:47.000Z | plot_utils/__init__.py | IntelLabs/causality-lab | 6ee7d4325257a38666558f8b7e310581a709d256 | [
"Apache-2.0"
] | null | null | null | plot_utils/__init__.py | IntelLabs/causality-lab | 6ee7d4325257a38666558f8b7e310581a709d256 | [
"Apache-2.0"
] | null | null | null | from .draw_graph import draw_graph
| 17.5 | 34 | 0.857143 | from .draw_graph import draw_graph
| true | true |
790913f4fe7b4920a7ab123f0f5c8acb5971d779 | 243 | py | Python | pytest_selenium_enhancer/plugin.py | popescunsergiu/pytest-selenium-enhancer | 9966604d5c44621b2ac707fbec278bed7771594a | [
"MIT"
] | 2 | 2021-01-20T02:38:31.000Z | 2021-10-01T11:51:14.000Z | pytest_selenium_enhancer/plugin.py | popescunsergiu/pytest-selenium-enhancer | 9966604d5c44621b2ac707fbec278bed7771594a | [
"MIT"
] | null | null | null | pytest_selenium_enhancer/plugin.py | popescunsergiu/pytest-selenium-enhancer | 9966604d5c44621b2ac707fbec278bed7771594a | [
"MIT"
] | null | null | null | """Pytest plugin entry point. Used for any fixtures needed."""
import pytest
from .pytest_selenium_enhancer import add_custom_commands
@pytest.fixture(scope='session')
def selenium_patcher():
"""Add custom ."""
add_custom_commands()
| 24.3 | 62 | 0.753086 | import pytest
from .pytest_selenium_enhancer import add_custom_commands
@pytest.fixture(scope='session')
def selenium_patcher():
add_custom_commands()
| true | true |
7909141e062b1594972a31affbd61618b4c51153 | 15,584 | py | Python | mailchimp_marketing_asyncio/models/add_list_members1.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/add_list_members1.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/add_list_members1.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 31.934426 | 273 | 0.61345 |
import pprint
import re
import six
class AddListMembers1(object):
swagger_types = {
'email_address': 'str',
'email_type': 'str',
'status': 'str',
'merge_fields': 'dict(str, object)',
'interests': 'dict(str, bool)',
'language': 'str',
'vip': 'bool',
... | true | true |
790914c6fc3b1b230cc4b756155b1ead618c0045 | 14,321 | py | Python | edgedb/transaction.py | mkniewallner/edgedb-python | 2086b866d3c87c215eecf644b2393ddd857457e0 | [
"Apache-2.0"
] | 214 | 2019-01-19T03:56:10.000Z | 2022-03-31T01:37:33.000Z | edgedb/transaction.py | mkniewallner/edgedb-python | 2086b866d3c87c215eecf644b2393ddd857457e0 | [
"Apache-2.0"
] | 120 | 2019-03-19T23:01:52.000Z | 2022-03-14T08:41:27.000Z | edgedb/transaction.py | mkniewallner/edgedb-python | 2086b866d3c87c215eecf644b2393ddd857457e0 | [
"Apache-2.0"
] | 24 | 2019-04-29T22:41:10.000Z | 2021-11-15T00:28:01.000Z | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 32.696347 | 77 | 0.601215 |
import enum
import typing
from . import abstract
from . import base_con
from . import enums
from . import errors
from . import options
from .datatypes import datatypes
from .protocol import protocol
__all__ = ('Transaction', 'AsyncIOTransaction')
class TransactionState(enum.Enum):
NEW = 0
... | true | true |
7909157e975064cc5d3fcee7b606dbc848876a6b | 2,646 | py | Python | src/abaqus/BoundaryCondition/DisplacementBaseMotionBCState.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/BoundaryCondition/DisplacementBaseMotionBCState.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/BoundaryCondition/DisplacementBaseMotionBCState.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from abaqusConstants import *
from .BoundaryConditionState import BoundaryConditionState
class DisplacementBaseMotionBCState(BoundaryConditionState):
"""The DisplacementBaseMotionBCState object stores the propagating data for a velocity base
motion boundary condition in a step. One instance of this object is ... | 35.756757 | 179 | 0.733182 | from abaqusConstants import *
from .BoundaryConditionState import BoundaryConditionState
class DisplacementBaseMotionBCState(BoundaryConditionState):
amplitudeState: SymbolicConstant = None
status: SymbolicConstant = None
... | true | true |
790915af616b625666da4042e9338d6c6ec67436 | 4,391 | py | Python | tensorflow/python/ops/data_flow_grad.py | devsangwoo/tensor | 066592c9f9cdf4acdd1b9b104766271133e9088e | [
"Apache-2.0"
] | 1 | 2020-01-12T14:38:34.000Z | 2020-01-12T14:38:34.000Z | tensorflow/python/ops/data_flow_grad.py | devsangwoo/tensor | 066592c9f9cdf4acdd1b9b104766271133e9088e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/data_flow_grad.py | devsangwoo/tensor | 066592c9f9cdf4acdd1b9b104766271133e9088e | [
"Apache-2.0"
] | null | null | null | <<<<<<< HEAD
# Copyright 2015 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
#
# Unless requir... | 36.289256 | 80 | 0.751765 | <<<<<<< HEAD
"""Gradients for operators defined in data_flow_ops.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import xrange
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
... | false | true |
790915ec8056e8dd88be493b2112f4eb4e3539c8 | 2,653 | py | Python | ssd_mobilenetv2/BoundingBoxes.py | videetparekh/model-zoo-models | 431d6e8f04c343a2e6dbc140e1b060cc5f0a089d | [
"Apache-2.0"
] | null | null | null | ssd_mobilenetv2/BoundingBoxes.py | videetparekh/model-zoo-models | 431d6e8f04c343a2e6dbc140e1b060cc5f0a089d | [
"Apache-2.0"
] | null | null | null | ssd_mobilenetv2/BoundingBoxes.py | videetparekh/model-zoo-models | 431d6e8f04c343a2e6dbc140e1b060cc5f0a089d | [
"Apache-2.0"
] | null | null | null | from BoundingBox import *
from eval_utils import *
class BoundingBoxes:
def __init__(self):
self._boundingBoxes = []
def addBoundingBox(self, bb):
self._boundingBoxes.append(bb)
def removeBoundingBox(self, _boundingBox):
for d in self._boundingBoxes:
if BoundingBox.co... | 34.012821 | 81 | 0.614776 | from BoundingBox import *
from eval_utils import *
class BoundingBoxes:
def __init__(self):
self._boundingBoxes = []
def addBoundingBox(self, bb):
self._boundingBoxes.append(bb)
def removeBoundingBox(self, _boundingBox):
for d in self._boundingBoxes:
if BoundingBox.co... | true | true |
790915feecd00d4818aeaa33269fedf6ba8e231d | 779 | py | Python | DNA.py | bharathgs/warcode | b810ab6722c9d6a9aa3dc443dece682479ca9ed4 | [
"MIT"
] | 5 | 2018-06-02T07:54:41.000Z | 2022-02-07T19:37:17.000Z | DNA.py | Thearakim/warcode | b810ab6722c9d6a9aa3dc443dece682479ca9ed4 | [
"MIT"
] | 1 | 2017-08-06T19:19:55.000Z | 2017-08-06T19:19:55.000Z | DNA.py | bharathgs/Codewars | b810ab6722c9d6a9aa3dc443dece682479ca9ed4 | [
"MIT"
] | 6 | 2018-05-10T23:11:32.000Z | 2022-03-03T13:24:27.000Z | '''Deoxyribonucleic acid (DNA) is a chemical found in the nucleus
of cells and carries the "instructions" for the development and functioning of living organisms.
If you want to know more http://en.wikipedia.org/wiki/DNA
In DNA strings, symbols "A" and "T" are complements of each other,
as "C" and "G". You have functi... | 41 | 96 | 0.698331 |
def DNA_strand(dna):
Dna_dict = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'}
return ''.join(Dna_dict[letter] for letter in dna if letter in Dna_dict.keys())
| true | true |
79091623a8a682cbdb929e2f50e5725f793d8b44 | 23,970 | py | Python | pw_watch/py/pw_watch/watch.py | mspang/pigweed | 89ff5f98f38b1ff7a1ff0633c590479e9b592a14 | [
"Apache-2.0"
] | null | null | null | pw_watch/py/pw_watch/watch.py | mspang/pigweed | 89ff5f98f38b1ff7a1ff0633c590479e9b592a14 | [
"Apache-2.0"
] | 1 | 2021-06-18T13:54:41.000Z | 2021-06-18T13:54:41.000Z | pw_watch/py/pw_watch/watch.py | mspang/pigweed | 89ff5f98f38b1ff7a1ff0633c590479e9b592a14 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 36.208459 | 80 | 0.617063 |
import argparse
from dataclasses import dataclass
import logging
import os
from pathlib import Path
import shlex
import subprocess
import sys
import threading
from typing import (Iterable, List, NamedTuple, NoReturn, Optional, Sequence,
Tuple)
from watchdog.events import FileSystemEv... | true | true |
790917e35510609617691935a3f39c34c1af58af | 1,886 | py | Python | onconet/models/mirai_full.py | harrivle/Mirai | ea2d4839f1f8b9f881798b819b2192ce2795bd5d | [
"MIT"
] | 37 | 2021-01-28T06:00:34.000Z | 2022-03-29T21:14:12.000Z | onconet/models/mirai_full.py | NkwamPhilip/Mirai | 70413de690da36c5878e2e6006711476e166bb1d | [
"MIT"
] | null | null | null | onconet/models/mirai_full.py | NkwamPhilip/Mirai | 70413de690da36c5878e2e6006711476e166bb1d | [
"MIT"
] | 14 | 2021-02-02T09:42:18.000Z | 2022-03-23T00:36:41.000Z | from onconet.models.factory import load_model, RegisterModel, get_model_by_name
import math
import torch
import torch.nn as nn
import pdb
import numpy as np
@RegisterModel("mirai_full")
class MiraiFull(nn.Module):
def __init__(self, args):
super(MiraiFull, self).__init__()
self.args = args
... | 47.15 | 233 | 0.68929 | from onconet.models.factory import load_model, RegisterModel, get_model_by_name
import math
import torch
import torch.nn as nn
import pdb
import numpy as np
@RegisterModel("mirai_full")
class MiraiFull(nn.Module):
def __init__(self, args):
super(MiraiFull, self).__init__()
self.args = args
... | true | true |
79091b625d1a649330301222b1198dd838d24029 | 5,701 | py | Python | xview/models/dirichletEstimation.py | ethz-asl/modular_semantic_segmentation | 7c950f24df11540a7ddae4ff806d5b31934a3210 | [
"BSD-3-Clause"
] | 20 | 2018-08-01T15:02:59.000Z | 2021-04-19T07:22:17.000Z | xview/models/dirichletEstimation.py | davesean/modular_semantic_segmentation | 5f9e34243915b862e8fef5e6195f1e29f4cebf50 | [
"BSD-3-Clause"
] | null | null | null | xview/models/dirichletEstimation.py | davesean/modular_semantic_segmentation | 5f9e34243915b862e8fef5e6195f1e29f4cebf50 | [
"BSD-3-Clause"
] | 9 | 2018-08-01T15:03:03.000Z | 2019-12-17T05:12:48.000Z | #!/usr/bin/python
#
# A library for finding the optimal dirichlet prior from counts
# By: Max Sklar
# @maxsklar
# https://github.com/maxsklar
# Copyright 2013 Max Sklar
import math
import logging
import random
import scipy.special as mathExtra
import scipy
import numpy as np
def digamma(x): return mathExtra.psi(x)
d... | 30.164021 | 107 | 0.695141 |
import math
import logging
import random
import scipy.special as mathExtra
import scipy
import numpy as np
def digamma(x): return mathExtra.psi(x)
def trigamma(x): return mathExtra.polygamma(1, x)
def getSufficientStatistic(multinomials):
N = len(multinomials)
K = len(multinomials[0])
retVal = [0]*... | true | true |
79091ba7fa4a904460858a2d54c32390dcc3491e | 2,179 | py | Python | test/functional/beerchain_gas_limit.py | beerchainproject/beerchain | 85a2701aff25358bbf2da6651d407a8d63ea2be8 | [
"MIT"
] | null | null | null | test/functional/beerchain_gas_limit.py | beerchainproject/beerchain | 85a2701aff25358bbf2da6651d407a8d63ea2be8 | [
"MIT"
] | null | null | null | test/functional/beerchain_gas_limit.py | beerchainproject/beerchain | 85a2701aff25358bbf2da6651d407a8d63ea2be8 | [
"MIT"
] | 2 | 2020-09-15T08:11:39.000Z | 2021-03-22T21:56:28.000Z | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.beerchain import *
from test_framework.beerchainconfig import *
from test_framework.blocktools import *
i... | 35.721311 | 282 | 0.677375 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.beerchain import *
from test_framework.beerchainconfig import *
from test_framework.blocktools import *
import time
NUM_OUTPUT... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.