hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f731b7d1d6104774ffc3c228a51322e1885b01cf | 18,640 | py | Python | meta_dataset/analysis/select_best_model.py | jishnujayakumar/meta-dataset | fac43975e7e8931bd9c9a9171268758e26469646 | [
"Apache-2.0"
] | 643 | 2019-03-05T18:42:45.000Z | 2022-03-27T21:20:46.000Z | meta_dataset/analysis/select_best_model.py | jishnujayakumar/meta-dataset | fac43975e7e8931bd9c9a9171268758e26469646 | [
"Apache-2.0"
] | 80 | 2019-03-16T15:42:49.000Z | 2022-03-30T22:22:31.000Z | meta_dataset/analysis/select_best_model.py | jishnujayakumar/meta-dataset | fac43975e7e8931bd9c9a9171268758e26469646 | [
"Apache-2.0"
] | 126 | 2019-03-14T01:36:32.000Z | 2022-03-26T17:33:11.000Z | # coding=utf-8
# Copyright 2021 The Meta-Dataset Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.82906 | 110 | 0.712554 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
from absl import logging
import numpy as np
from six.moves import range
from six.moves import zip
import six.moves.cPickle as pkl
import tensorflow.compat.v1 as tf
FLAGS = tf.flags.FLA... | true | true |
f731b83aa10a8eac18891fcac6e5c14b63d9aa57 | 355 | py | Python | nikebot/__version__.py | olegaobini/NikeBot | fec0943c9dd215d05403bedfc69ef8a8ac0b228c | [
"MIT"
] | null | null | null | nikebot/__version__.py | olegaobini/NikeBot | fec0943c9dd215d05403bedfc69ef8a8ac0b228c | [
"MIT"
] | null | null | null | nikebot/__version__.py | olegaobini/NikeBot | fec0943c9dd215d05403bedfc69ef8a8ac0b228c | [
"MIT"
] | null | null | null | __logo__ = """
NikeBot
"""
__title__ = 'nikebotandroid'
__description__ = 'A retail automation bot for the Nike mobile app'
__url__ = 'https: // github.com/olegaobini/NikeBot'
__version__ = '0.0.1'
__debug_mode__ = False
__author__ = 'Olega Obini'
__author_email__ = 'obiniolega@gmail.com'
__license__ = 'MIT'
__copyrigh... | 27.307692 | 67 | 0.752113 | __logo__ = """
NikeBot
"""
__title__ = 'nikebotandroid'
__description__ = 'A retail automation bot for the Nike mobile app'
__url__ = 'https: // github.com/olegaobini/NikeBot'
__version__ = '0.0.1'
__debug_mode__ = False
__author__ = 'Olega Obini'
__author_email__ = 'obiniolega@gmail.com'
__license__ = 'MIT'
__copyrigh... | true | true |
f731b843168340ad5c3d5f4674b0c14240c39751 | 5,587 | py | Python | gremlin-python/src/main/python/tests/process/test_traversal.py | helpspace-co/tinkerpop | a31e8f402237de3491397d4f8bbd6a9761cd9068 | [
"Apache-2.0"
] | 1,425 | 2016-06-13T06:08:39.000Z | 2022-03-28T09:02:43.000Z | gremlin-python/src/main/python/tests/process/test_traversal.py | helpspace-co/tinkerpop | a31e8f402237de3491397d4f8bbd6a9761cd9068 | [
"Apache-2.0"
] | 1,049 | 2016-06-10T10:25:59.000Z | 2022-03-30T11:25:44.000Z | gremlin-python/src/main/python/tests/process/test_traversal.py | helpspace-co/tinkerpop | a31e8f402237de3491397d4f8bbd6a9761cd9068 | [
"Apache-2.0"
] | 732 | 2016-06-13T20:53:51.000Z | 2022-03-30T06:49:29.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... | 42.325758 | 151 | 0.642742 |
__author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
from pytest import fail
from gremlin_python.structure.graph import Graph
from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.process.traversal import P
from gremlin_python.process.traversal import Binding, Bindings
from gr... | true | true |
f731b86cd45adfb32aa7de95f369a6218bdbc653 | 42,404 | py | Python | tests/test_data.py | sdrobert/pydrobert-pytorch | 7abad0dbb2e80b4267aebcee492aa9fd7d83ea3f | [
"Apache-2.0"
] | 14 | 2019-01-04T21:19:55.000Z | 2021-01-06T16:01:03.000Z | tests/test_data.py | sdrobert/pydrobert-pytorch | 7abad0dbb2e80b4267aebcee492aa9fd7d83ea3f | [
"Apache-2.0"
] | 6 | 2021-04-17T23:34:57.000Z | 2022-02-11T00:49:41.000Z | tests/test_data.py | sdrobert/pydrobert-pytorch | 7abad0dbb2e80b4267aebcee492aa9fd7d83ea3f | [
"Apache-2.0"
] | 1 | 2020-05-19T08:03:43.000Z | 2020-05-19T08:03:43.000Z | # Copyright 2021 Sean Robertson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 36.027188 | 88 | 0.603905 |
import os
from itertools import repeat
from io import StringIO
import pytest
import torch
import torch.utils.data
import pydrobert.torch.data as data
from pydrobert.torch import INDEX_PAD_VALUE
@pytest.mark.cpu
@pytest.mark.parametrize("left", [0, 1, 100])
@pytest.mark.parametrize("right", [0, 1, 100])
@pytest.m... | true | true |
f731b8a53d9c151e77995f19a47fbebe678c89cd | 769 | py | Python | create.py | keatonkraiger/pysot-mot | b1447dc9569339592a09b25b097b363cff9f6de4 | [
"Apache-2.0"
] | null | null | null | create.py | keatonkraiger/pysot-mot | b1447dc9569339592a09b25b097b363cff9f6de4 | [
"Apache-2.0"
] | null | null | null | create.py | keatonkraiger/pysot-mot | b1447dc9569339592a09b25b097b363cff9f6de4 | [
"Apache-2.0"
] | null | null | null | import os
import re
import imageio
from glob import glob
from PIL import Image
SAVE_FORMAT = 'gif'
video_name = 'ants1'
image_folder = os.path.join(os.getcwd(), 'demo/demo_images/')
#images = [img for img in os.listdir(image_folder) if img.endswith(".jpg")]
#images.sort(key=lambda var:[int(x) if x.isdigit() else ... | 24.03125 | 90 | 0.638492 | import os
import re
import imageio
from glob import glob
from PIL import Image
SAVE_FORMAT = 'gif'
video_name = 'ants1'
image_folder = os.path.join(os.getcwd(), 'demo/demo_images/')
if SAVE_FORMAT == 'gif':
images = []
images = glob("demo/demo_images/*.jpg")
images.sort(key=lambda var:[int(x) if x.i... | true | true |
f731b9052df0f2dc9c9b090455306ea466ce939c | 253 | py | Python | cmdline_provenance/__init__.py | znicholls/cmdline_provenance | c9df55a9e4b0e7435499993c39eb9ff7e360b1c6 | [
"MIT"
] | null | null | null | cmdline_provenance/__init__.py | znicholls/cmdline_provenance | c9df55a9e4b0e7435499993c39eb9ff7e360b1c6 | [
"MIT"
] | null | null | null | cmdline_provenance/__init__.py | znicholls/cmdline_provenance | c9df55a9e4b0e7435499993c39eb9ff7e360b1c6 | [
"MIT"
] | null | null | null | """Utilities for capturing the history of commands used to produce a given output"""
from .cmdline_provenance import new_log
from .cmdline_provenance import read_log
from .cmdline_provenance import write_log
__all__ = [new_log, read_log, write_log]
| 25.3 | 84 | 0.810277 |
from .cmdline_provenance import new_log
from .cmdline_provenance import read_log
from .cmdline_provenance import write_log
__all__ = [new_log, read_log, write_log]
| true | true |
f731b912d65c6127ea588331a16ed36a53def65b | 3,387 | py | Python | homeassistant/components/tmb/sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | homeassistant/components/tmb/sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/components/tmb/sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for TMB (Transports Metropolitans de Barcelona) Barcelona public transport."""
from datetime import timedelta
import logging
from requests import HTTPError
from tmb import IBus
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUT... | 27.991736 | 89 | 0.660171 | from datetime import timedelta
import logging
from requests import HTTPError
from tmb import IBus
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, TIME_MINUTES
import homeassistant.helpers.config_validation as cv
from hom... | true | true |
f731b91eec02eb0ee49fd3752978d19259b17ce2 | 5,140 | py | Python | my_memory_card.py | all0ws/memorecard | ba90d4fd0663f11c963907290c19ad1305ba67cb | [
"CC0-1.0"
] | null | null | null | my_memory_card.py | all0ws/memorecard | ba90d4fd0663f11c963907290c19ad1305ba67cb | [
"CC0-1.0"
] | null | null | null | my_memory_card.py | all0ws/memorecard | ba90d4fd0663f11c963907290c19ad1305ba67cb | [
"CC0-1.0"
] | null | null | null |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QWidget, QHBoxLayout, QVBoxLayout, QGroupBox, QButtonGroup, QRadioButton, QPushButton, QLabel)
from random import shuffle,randint
class Question():
def __init__(self,question,right_answer,wrong1,wrong2 ,wrong3):
self... | 31.533742 | 138 | 0.706809 |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QWidget, QHBoxLayout, QVBoxLayout, QGroupBox, QButtonGroup, QRadioButton, QPushButton, QLabel)
from random import shuffle,randint
class Question():
def __init__(self,question,right_answer,wrong1,wrong2 ,wrong3):
self... | true | true |
f731baf2c2d2eefe7ec99e5e55ef74d57635e126 | 1,624 | py | Python | tools/mo/unit_tests/mo/ops/dft_signal_size_canonicalization_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/ops/dft_signal_size_canonicalization_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/ops/dft_signal_size_canonicalization_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from generator import generator, generate
from openvino.tools.mo.ops.dft import FFTBase
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
@generator
class DFTSignalSizeCanon... | 38.666667 | 109 | 0.606527 |
import unittest
import numpy as np
from generator import generator, generate
from openvino.tools.mo.ops.dft import FFTBase
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
@generator
class DFTSignalSizeCanonicalizationTest(unittest.TestCase):
@generate(*[
(int64_array([-1, 77]... | true | true |
f731bcca089c5e02b3aa0fbb5699fe5db61f89d1 | 30,419 | py | Python | back of code/RSCFN/rsden/models/rsn_cluster # without 0 fuse cluster.py | lidongyv/Monocular-depth-esitimation-with-region-support-cvpr | 7715c91b9c9f88de5c0233923c3a073edf9b2ca8 | [
"Apache-2.0"
] | null | null | null | back of code/RSCFN/rsden/models/rsn_cluster # without 0 fuse cluster.py | lidongyv/Monocular-depth-esitimation-with-region-support-cvpr | 7715c91b9c9f88de5c0233923c3a073edf9b2ca8 | [
"Apache-2.0"
] | null | null | null | back of code/RSCFN/rsden/models/rsn_cluster # without 0 fuse cluster.py | lidongyv/Monocular-depth-esitimation-with-region-support-cvpr | 7715c91b9c9f88de5c0233923c3a073edf9b2ca8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: lidong
# @Date: 2018-03-20 18:01:52
# @Last Modified by: yulidong
# @Last Modified time: 2018-11-06 20:45:11
import torch
import numpy as np
import torch.nn as nn
import math
from math import ceil
from torch.autograd import Variable
from rsden.cluster_loss import *
from rsden imp... | 49.704248 | 180 | 0.571715 |
import torch
import numpy as np
import torch.nn as nn
import math
from math import ceil
from torch.autograd import Variable
from rsden.cluster_loss import *
from rsden import caffe_pb2
from rsden.models.utils import *
import time
cuda_id=3
group_dim=1
def mean_shift(feature,mean,bandwidth):
for t in range(10):... | true | true |
f731bcccc4e6d8aaa6addf7cc5d2ba13d7d25f7c | 907 | py | Python | feed_generator.py | chand1012/static-rss-generator | 931ae40b156232d783202520c34bd175f615d4a4 | [
"MIT"
] | 1 | 2021-07-31T14:55:05.000Z | 2021-07-31T14:55:05.000Z | feed_generator.py | chand1012/static-rss-generator | 931ae40b156232d783202520c34bd175f615d4a4 | [
"MIT"
] | null | null | null | feed_generator.py | chand1012/static-rss-generator | 931ae40b156232d783202520c34bd175f615d4a4 | [
"MIT"
] | null | null | null | from datetime import datetime
import random
import json
import arrow
import feedparser
from rfeed import Feed, Item
# returns the feed string given the JSON object
def generate_feed(link_data: list[dict], rss_link: str) -> str:
data = []
for link in link_data:
feed = feedparser.parse(list(link.keys(... | 25.914286 | 79 | 0.594267 | from datetime import datetime
import random
import json
import arrow
import feedparser
from rfeed import Feed, Item
def generate_feed(link_data: list[dict], rss_link: str) -> str:
data = []
for link in link_data:
feed = feedparser.parse(list(link.keys())[0])
for i in range(list(link.values()... | true | true |
f731bd9216657521387add8186e360b1be8b9acc | 20,089 | py | Python | tests/unit/containers/test_declarative_py2_py3.py | whysage/python-dependency-injector | cef6d35cfdf5f39438a89f000d11a21860bc8c5f | [
"BSD-3-Clause"
] | 1,997 | 2016-04-26T13:41:45.000Z | 2022-03-31T16:17:53.000Z | tests/unit/containers/test_declarative_py2_py3.py | whysage/python-dependency-injector | cef6d35cfdf5f39438a89f000d11a21860bc8c5f | [
"BSD-3-Clause"
] | 399 | 2016-05-16T07:20:07.000Z | 2022-03-31T18:23:49.000Z | tests/unit/containers/test_declarative_py2_py3.py | whysage/python-dependency-injector | cef6d35cfdf5f39438a89f000d11a21860bc8c5f | [
"BSD-3-Clause"
] | 162 | 2016-05-16T09:21:43.000Z | 2022-03-30T23:00:26.000Z | """Dependency injector declarative container unit tests."""
import collections
import unittest
from dependency_injector import (
containers,
providers,
errors,
)
class ContainerA(containers.DeclarativeContainer):
p11 = providers.Provider()
p12 = providers.Provider()
class ContainerB(ContainerA... | 37.201852 | 86 | 0.603116 |
import collections
import unittest
from dependency_injector import (
containers,
providers,
errors,
)
class ContainerA(containers.DeclarativeContainer):
p11 = providers.Provider()
p12 = providers.Provider()
class ContainerB(ContainerA):
p21 = providers.Provider()
p22 = providers.Provid... | true | true |
f731bddc26f0944e091eb4201d1fed5699a2d7df | 359 | py | Python | sdk/python/pulumi_azure/notificationhub/__init__.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/notificationhub/__init__.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/notificationhub/__init__.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .hub import *
from .authorization_rule import *
from .namespace import *
from .get_hub... | 32.636364 | 87 | 0.727019 |
# Export this package's modules as members:
from .hub import *
from .authorization_rule import *
from .namespace import *
from .get_hub import *
from .get_namespace import *
| true | true |
f731be3829420df3473b875de15a7e7c4ab77ba2 | 653 | py | Python | synlib/descriptions/ADDFXL.py | vhnatyk/vlsistuff | 0981097bd19a0c482728dcc5048a3615ac9a9a90 | [
"MIT"
] | 26 | 2018-03-17T18:14:22.000Z | 2022-03-14T07:23:13.000Z | synlib/descriptions/ADDFXL.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 1 | 2019-10-16T10:31:11.000Z | 2019-10-17T04:14:53.000Z | synlib/descriptions/ADDFXL.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 7 | 2018-07-16T07:51:25.000Z | 2022-02-15T14:22:54.000Z | Desc = cellDescClass("ADDFXL")
Desc.properties["cell_footprint"] = "addf"
Desc.properties["area"] = "69.854400"
Desc.properties["cell_leakage_power"] = "3632.360760"
Desc.pinOrder = ['A', 'B', 'CI', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("CI","S","combi")
Desc.add_arc("A","C... | 31.095238 | 53 | 0.666156 | Desc = cellDescClass("ADDFXL")
Desc.properties["cell_footprint"] = "addf"
Desc.properties["area"] = "69.854400"
Desc.properties["cell_leakage_power"] = "3632.360760"
Desc.pinOrder = ['A', 'B', 'CI', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("CI","S","combi")
Desc.add_arc("A","C... | true | true |
f731beda637d2a5569a79ee173f7c5968ddc0fe2 | 1,688 | py | Python | base/log.py | testtuantuan/appTest | 2717b30b2cc63080cb0c68d72f4a772daf49e5c3 | [
"BSD-3-Clause"
] | null | null | null | base/log.py | testtuantuan/appTest | 2717b30b2cc63080cb0c68d72f4a772daf49e5c3 | [
"BSD-3-Clause"
] | null | null | null | base/log.py | testtuantuan/appTest | 2717b30b2cc63080cb0c68d72f4a772daf49e5c3 | [
"BSD-3-Clause"
] | null | null | null | # !/uer/bin/env python3
# coding=utf-8
import datetime
import logging
import functools
import os
import traceback
import inspect
if "logs" in os.listdir('../'):
pass
else:
os.mkdir('../logs')
now = datetime.datetime.now().strftime('%Y-%m-%d_%H_%M_%S')
_log_fp = "../logs/" + now + ".log"
logging.basicConfig(lev... | 28.133333 | 97 | 0.584716 | import datetime
import logging
import functools
import os
import traceback
import inspect
if "logs" in os.listdir('../'):
pass
else:
os.mkdir('../logs')
now = datetime.datetime.now().strftime('%Y-%m-%d_%H_%M_%S')
_log_fp = "../logs/" + now + ".log"
logging.basicConfig(level=logging.DEBUG,
f... | true | true |
f731bfab7f7356124c08783189c0a2d6c9d964d1 | 4,425 | py | Python | test/functional/wallet_part_segwit_scripts.py | bleach86/ghost-core | 59824a5e00fbc500eeec28950999a05967bad608 | [
"MIT"
] | null | null | null | test/functional/wallet_part_segwit_scripts.py | bleach86/ghost-core | 59824a5e00fbc500eeec28950999a05967bad608 | [
"MIT"
] | null | null | null | test/functional/wallet_part_segwit_scripts.py | bleach86/ghost-core | 59824a5e00fbc500eeec28950999a05967bad608 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019 The Particl Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_particl import GhostTestFramework
class SegwitScriptsTest(GhostTestFramework):
... | 40.59633 | 118 | 0.654011 |
from test_framework.test_particl import GhostTestFramework
class SegwitScriptsTest(GhostTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.extra_args = [ ['-debug','-noacceptnonstdtxn','-reservebalance=10000000'] for i in range(self.num_nodes)... | true | true |
f731c0b87e19e1774f95606b9d89e1dd2dc40b0a | 15,296 | py | Python | venv/lib/python3.6/site-packages/feedgen/ext/dc.py | jannahuang/blog | e1d8cfa9d79ac06097a0e55531bba9421fcbf283 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/feedgen/ext/dc.py | jannahuang/blog | e1d8cfa9d79ac06097a0e55531bba9421fcbf283 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/feedgen/ext/dc.py | jannahuang/blog | e1d8cfa9d79ac06097a0e55531bba9421fcbf283 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
feedgen.ext.dc
~~~~~~~~~~~~~~~~~~~
Extends the FeedGenerator to add Dubline Core Elements to the feeds.
Descriptions partly taken from
http://dublincore.org/documents/dcmi-terms/#elements-coverage
:copyright: 2013-2017, Lars Kiesow <lkiesow@uos.de>
:license: F... | 37.490196 | 79 | 0.622973 |
from feedgen.ext.base import BaseExtension
from feedgen.util import xml_elem
class DcBaseExtension(BaseExtension):
def __init__(self):
self._dcelem_contributor = None
self._dcelem_coverage = None
self._dcelem_creator = None
self._dcelem_date = None
... | true | true |
f731c242461116c49eda6d5115c4af06fc3b920c | 602 | py | Python | var/spack/repos/builtin/packages/opendx/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/opendx/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/opendx/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Opendx(AutotoolsPackage):
"""Open Visualization Data Explorer."""
homepage = "https://github.com/Mwoolsey/... | 28.666667 | 73 | 0.697674 |
class Opendx(AutotoolsPackage):
homepage = "https://github.com/Mwoolsey/OpenDX"
git = "https://github.com/Mwoolsey/OpenDX.git"
version('master', branch='master')
depends_on('motif') depends_on('gl')
@run_before('autoreconf')
def distclean(self):
make('distclean')
| true | true |
f731c2a3b3050eec2782a2b33492c47117028a37 | 2,974 | py | Python | hatanaka/test/test_general_compression.py | valgur/hatanaka | 2f2f413050a922a507841546ba9ac5610a0dd882 | [
"MIT"
] | 5 | 2021-04-14T15:37:48.000Z | 2022-02-11T08:59:34.000Z | hatanaka/test/test_general_compression.py | valgur/hatanaka | 2f2f413050a922a507841546ba9ac5610a0dd882 | [
"MIT"
] | null | null | null | hatanaka/test/test_general_compression.py | valgur/hatanaka | 2f2f413050a922a507841546ba9ac5610a0dd882 | [
"MIT"
] | 1 | 2021-11-10T22:28:50.000Z | 2021-11-10T22:28:50.000Z | import gzip
import io
import shutil
import pytest
from hatanaka import compress, compress_on_disk, decompress, decompress_on_disk
from .conftest import clean, compress_pairs, decompress_pairs, get_data_path
@pytest.mark.parametrize(
'input_suffix, expected_suffix',
decompress_pairs
)
def test_decompress(tmp... | 30.659794 | 95 | 0.718225 | import gzip
import io
import shutil
import pytest
from hatanaka import compress, compress_on_disk, decompress, decompress_on_disk
from .conftest import clean, compress_pairs, decompress_pairs, get_data_path
@pytest.mark.parametrize(
'input_suffix, expected_suffix',
decompress_pairs
)
def test_decompress(tmp... | true | true |
f731c31f75ea7cd476db15705457c015ff3032c0 | 17,905 | py | Python | python/apogee/aspcap/teff.py | sdss/apogee | e134409dc14b20f69e68a0d4d34b2c1b5056a901 | [
"BSD-3-Clause"
] | 5 | 2019-04-11T13:35:24.000Z | 2019-11-14T06:12:51.000Z | python/apogee/aspcap/teff.py | sdss/apogee | e134409dc14b20f69e68a0d4d34b2c1b5056a901 | [
"BSD-3-Clause"
] | null | null | null | python/apogee/aspcap/teff.py | sdss/apogee | e134409dc14b20f69e68a0d4d34b2c1b5056a901 | [
"BSD-3-Clause"
] | 5 | 2018-09-20T22:07:43.000Z | 2021-01-15T07:13:38.000Z | # routines for calibrating/comparing effective temperatures with photometric sample
from apogee.utils import apload
from apogee.utils import apselect
from astropy.io import fits, ascii
from tools import match
from tools import plots
from tools import fit
from apogee.utils import bitmask
from apogee.aspcap import err
i... | 46.26615 | 225 | 0.628093 |
from apogee.utils import apload
from apogee.utils import apselect
from astropy.io import fits, ascii
from tools import match
from tools import plots
from tools import fit
from apogee.utils import bitmask
from apogee.aspcap import err
import pdb
import matplotlib.pyplot as plt
import numpy as np
import os
import matplo... | true | true |
f731c428457d805737a8bac6b920e623e8b9e75c | 34,668 | py | Python | superset/security/manager.py | Visortech-Solutions/incubator-superset | 4b33597e521e07d1ec74cdbda761e103814f60a2 | [
"Apache-2.0"
] | 1 | 2020-08-31T17:22:25.000Z | 2020-08-31T17:22:25.000Z | superset/security/manager.py | Visortech-Solutions/incubator-superset | 4b33597e521e07d1ec74cdbda761e103814f60a2 | [
"Apache-2.0"
] | 1 | 2020-08-02T04:42:57.000Z | 2020-08-02T04:42:57.000Z | superset/security/manager.py | Visortech-Solutions/incubator-superset | 4b33597e521e07d1ec74cdbda761e103814f60a2 | [
"Apache-2.0"
] | null | null | null | # 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... | 35.089069 | 88 | 0.625937 | import logging
from typing import Any, Callable, cast, List, Optional, Set, Tuple, TYPE_CHECKING, Union
from flask import current_app, g
from flask_appbuilder import Model
from flask_appbuilder.security.sqla.manager import SecurityManager
from flask_appbuilder.security.sqla.models import (
assoc_permissionview_rol... | true | true |
f731c50ed0f870cecde73f61bbdb8ad20a18c647 | 7,795 | py | Python | api_tests/users/views/test_user_preprints_list.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | 1 | 2019-12-23T04:30:20.000Z | 2019-12-23T04:30:20.000Z | api_tests/users/views/test_user_preprints_list.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | 20 | 2020-03-24T16:48:03.000Z | 2022-03-08T22:38:38.000Z | api_tests/users/views/test_user_preprints_list.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin
from api_tests.preprints.views.test_preprint_list_mixin import PreprintIsPublishedListMixin, PreprintIsValidListMixin
from osf_tests.factories import (
ProjectFactory,
... | 32.615063 | 117 | 0.655805 | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin
from api_tests.preprints.views.test_preprint_list_mixin import PreprintIsPublishedListMixin, PreprintIsValidListMixin
from osf_tests.factories import (
ProjectFactory,
... | true | true |
f731c668ffccf5b4cbde0be62847a563f4f61341 | 14,260 | py | Python | packages/syft/src/syft/grid/duet/webrtc_duet.py | pculliton/PySyft | 23a0d1442d3d901b1139aeabe079ccf4177ebc0d | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/grid/duet/webrtc_duet.py | pculliton/PySyft | 23a0d1442d3d901b1139aeabe079ccf4177ebc0d | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/grid/duet/webrtc_duet.py | pculliton/PySyft | 23a0d1442d3d901b1139aeabe079ccf4177ebc0d | [
"Apache-2.0"
] | null | null | null | """
PySyft Duet (WebRTC)
This class aims to implement the PySyft Duet concept by using WebRTC protocol as a
connection channel in order to allow two different users to establish a direct
connection with high-quality Real-time Communication using private addresses.
The most common example showing how it can be used is... | 42.822823 | 117 | 0.629523 |
import asyncio
from typing import Optional
from nacl.signing import SigningKey
from ... import serialize
from ...core.io.route import SoloRoute
from ...core.node.common.metadata import Metadata
from ...core.node.domain.client import DomainClient
from ...core.node.domain.domain import Domain
from ...logger import err... | true | true |
f731c670570a5ddaf363e2a308eba6f30d1c3ed7 | 4,328 | py | Python | model-optimizer/extensions/middle/GatherNdNormalizer.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/middle/GatherNdNormalizer.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 19 | 2021-03-26T08:11:00.000Z | 2022-02-21T13:06:26.000Z | model-optimizer/extensions/middle/GatherNdNormalizer.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 1 | 2021-07-28T17:30:46.000Z | 2021-07-28T17:30:46.000Z | """
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 39.706422 | 113 | 0.661738 | import logging as log
import numpy as np
from extensions.ops.gather import Gather
from mo.front.common.partial_infer.utils import int64_array
from mo.front.tf.graph_utils import create_op_node_with_second_input, create_op_with_const_inputs
from mo.graph.graph import Graph, rename_node
from mo.middle.replacement impor... | true | true |
f731c9a631559d95706fad6adef4295840c8b049 | 5,926 | py | Python | src/third_party/wiredtiger/test/suite/test_config02.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_config02.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_config02.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... | 34.254335 | 86 | 0.643773 |
import os
import wiredtiger, wttest
class test_config02(wttest.WiredTigerTestCase):
table_name1 = 'test_config02'
nentries = 100
def setUpConnectionOpen(self, dir):
return None
def setUpSessionOpen(self, conn):
return None
def populate_and_check(self):
create_arg... | true | true |
f731ca4684b44d80d310ce6e1649c542bdaf125d | 1,926 | py | Python | samples/vsphere/vcenter/certificatemanagement/trusted_root_chains_delete.py | mariolenz/vsphere-automation-sdk-python | 22d8a834f08216d36c8bfdbff98a132b38b8ef82 | [
"MIT"
] | null | null | null | samples/vsphere/vcenter/certificatemanagement/trusted_root_chains_delete.py | mariolenz/vsphere-automation-sdk-python | 22d8a834f08216d36c8bfdbff98a132b38b8ef82 | [
"MIT"
] | null | null | null | samples/vsphere/vcenter/certificatemanagement/trusted_root_chains_delete.py | mariolenz/vsphere-automation-sdk-python | 22d8a834f08216d36c8bfdbff98a132b38b8ef82 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2020. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS... | 35.018182 | 100 | 0.692627 |
__author__ = 'VMware, Inc.'
__vcenter_version__ = '7.0+'
import argparse
from vmware.vapi.vsphere.client import create_vsphere_client
import requests
from com.vmware.vcenter.certificate_management.vcenter_client import TrustedRootChains
from samples.vsphere.common import (sample_cli, sample_util)
parser = sample_... | true | true |
f731ca59ce1647a04a57816eab1d646df4920770 | 744 | py | Python | setup.py | nthparty/fe25519 | 4badb675c7118f8e116f20d21c055e7872df0593 | [
"MIT"
] | null | null | null | setup.py | nthparty/fe25519 | 4badb675c7118f8e116f20d21c055e7872df0593 | [
"MIT"
] | null | null | null | setup.py | nthparty/fe25519 | 4badb675c7118f8e116f20d21c055e7872df0593 | [
"MIT"
] | 1 | 2020-05-20T21:56:51.000Z | 2020-05-20T21:56:51.000Z | from setuptools import setup
with open("README.rst", "r") as fh:
long_description = fh.read().replace(".. include:: toc.rst\n\n", "")
# The lines below are parsed by `docs/conf.py`.
name = "fe25519"
version = "1.2.0"
setup(
name=name,
version=version,
packages=[name,],
install_requires=[
... | 26.571429 | 72 | 0.633065 | from setuptools import setup
with open("README.rst", "r") as fh:
long_description = fh.read().replace(".. include:: toc.rst\n\n", "")
name = "fe25519"
version = "1.2.0"
setup(
name=name,
version=version,
packages=[name,],
install_requires=[
"parts~=1.3",
"bitlist~=0.7",
"f... | true | true |
f731caeaa20126dfbac6f2f856ed43cf1d1b4fd9 | 3,511 | py | Python | utest/api/test_exposed_api.py | rdagum/robotframework | b7069d505374e9f09a140ed5a9727d2a40716446 | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | utest/api/test_exposed_api.py | imust6226/robotframework | 08c56fef2ebc64d682c7f99acd77c480d8d0e028 | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | utest/api/test_exposed_api.py | rticau/robotframework | 33ee46dfacd5173c0a38d89c1a60abf6a747c8c0 | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | import unittest
from os.path import join
from robot import api, model, parsing, reporting, result, running
from robot.api import parsing as api_parsing
from robot.utils.asserts import assert_equal, assert_true
class TestExposedApi(unittest.TestCase):
def test_execution_result(self):
assert_equal(api.E... | 37.351064 | 86 | 0.720308 | import unittest
from os.path import join
from robot import api, model, parsing, reporting, result, running
from robot.api import parsing as api_parsing
from robot.utils.asserts import assert_equal, assert_true
class TestExposedApi(unittest.TestCase):
def test_execution_result(self):
assert_equal(api.E... | true | true |
f731caf89a847b286acea5dd16d4a275ed119bd1 | 764 | py | Python | app/db/database.py | Huangkai1008/market-admin | c149f425b640827526b65343b4bceecd528418bf | [
"MIT"
] | 6 | 2020-01-30T10:45:22.000Z | 2021-05-26T02:51:43.000Z | app/db/database.py | Huangkai1008/market-admin | c149f425b640827526b65343b4bceecd528418bf | [
"MIT"
] | null | null | null | app/db/database.py | Huangkai1008/market-admin | c149f425b640827526b65343b4bceecd528418bf | [
"MIT"
] | null | null | null | from tortoise import Tortoise
from loguru import logger
from app.core.config import DB_TYPE, DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DATABASE
DB_URL = f'{DB_TYPE}://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DATABASE}'
async def init():
"""初始化连接"""
logger.info(f'Connecting to database')
await Tortois... | 22.470588 | 87 | 0.660995 | from tortoise import Tortoise
from loguru import logger
from app.core.config import DB_TYPE, DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DATABASE
DB_URL = f'{DB_TYPE}://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DATABASE}'
async def init():
logger.info(f'Connecting to database')
await Tortoise.init(
... | true | true |
f731cb10fc8ac86aeacc7f0d065059f3fcf77ebf | 8,623 | py | Python | test/geometry/test_homography.py | shaunster0/kornia | 71acf455ee36f2050b7be5ea993b6db773f502eb | [
"ECL-2.0",
"Apache-2.0"
] | 51 | 2019-10-11T18:47:30.000Z | 2021-05-03T06:42:37.000Z | test/geometry/test_homography.py | shaunster0/kornia | 71acf455ee36f2050b7be5ea993b6db773f502eb | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2022-01-25T00:28:05.000Z | 2022-03-20T09:14:39.000Z | test/geometry/test_homography.py | shaunster0/kornia | 71acf455ee36f2050b7be5ea993b6db773f502eb | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2019-10-11T19:59:05.000Z | 2020-07-10T02:28:52.000Z | import random
import pytest
import torch
from torch.autograd import gradcheck
import kornia
from kornia.geometry.homography import find_homography_dlt, find_homography_dlt_iterated
from kornia.testing import assert_close
class TestFindHomographyDLT:
def test_smoke(self, device, dtype):
points1 = torch.r... | 41.859223 | 118 | 0.605938 | import random
import pytest
import torch
from torch.autograd import gradcheck
import kornia
from kornia.geometry.homography import find_homography_dlt, find_homography_dlt_iterated
from kornia.testing import assert_close
class TestFindHomographyDLT:
def test_smoke(self, device, dtype):
points1 = torch.r... | true | true |
f731cba9a9650e31323b7b28e22fc1895735634d | 9,219 | py | Python | code/combine_sectors.py | jradavenport/helloTESS | 1bd4680640e7b92ae3b2eeba19cc63e8b834eead | [
"MIT"
] | null | null | null | code/combine_sectors.py | jradavenport/helloTESS | 1bd4680640e7b92ae3b2eeba19cc63e8b834eead | [
"MIT"
] | null | null | null | code/combine_sectors.py | jradavenport/helloTESS | 1bd4680640e7b92ae3b2eeba19cc63e8b834eead | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib
import os
from glob import glob
from matplotlib.colors import LogNorm
from scipy.optimize import curve_fit
from astropy.table import Table
import astropy.io.fits as fits
from astropy.stats import LombSc... | 38.735294 | 126 | 0.574574 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib
import os
from glob import glob
from matplotlib.colors import LogNorm
from scipy.optimize import curve_fit
from astropy.table import Table
import astropy.io.fits as fits
from astropy.stats import LombSc... | true | true |
f731cbc6feb59399bb774f79ba1a3cf4105984b2 | 1,268 | py | Python | python/pw_multiScriptEditor/widgets/findWidget.py | ZBYVFX/NukeToolSet | a077aa9d8ac941f534d33dfebd27994fc9cefba7 | [
"MIT"
] | 1 | 2021-01-05T12:28:35.000Z | 2021-01-05T12:28:35.000Z | python/pw_multiScriptEditor/widgets/findWidget.py | ensii75/NukeToolSet | 0c47efc3bc7ca513f902e00a3e2b71404636aae9 | [
"MIT"
] | null | null | null | python/pw_multiScriptEditor/widgets/findWidget.py | ensii75/NukeToolSet | 0c47efc3bc7ca513f902e00a3e2b71404636aae9 | [
"MIT"
] | null | null | null | from Qt.QtCore import *
from Qt.QtGui import *
from Qt.QtWidgets import *
import findWidget_UIs as ui
class findWidgetClass(QWidget, ui.Ui_findReplace):
searchSignal = Signal(str)
replaceSignal = Signal(list)
replaceAllSignal = Signal(list)
def __init__(self, parent):
super(findWidgetClass, sel... | 34.27027 | 72 | 0.670347 | from Qt.QtCore import *
from Qt.QtGui import *
from Qt.QtWidgets import *
import findWidget_UIs as ui
class findWidgetClass(QWidget, ui.Ui_findReplace):
searchSignal = Signal(str)
replaceSignal = Signal(list)
replaceAllSignal = Signal(list)
def __init__(self, parent):
super(findWidgetClass, sel... | true | true |
f731cd74c0ad4505283364c86d8ef5503e3e88c9 | 2,763 | py | Python | dmutils/user.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | dmutils/user.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | dmutils/user.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | import hashlib
import base64
def hash_email(email):
m = hashlib.sha256()
m.update(email.encode('utf-8'))
return base64.urlsafe_b64encode(m.digest())
def user_logging_string(user):
if user.is_anonymous:
return 'User(anonymous)'
return 'User(id={}, role={}, hashed_email={})'.format(user.i... | 26.825243 | 109 | 0.591386 | import hashlib
import base64
def hash_email(email):
m = hashlib.sha256()
m.update(email.encode('utf-8'))
return base64.urlsafe_b64encode(m.digest())
def user_logging_string(user):
if user.is_anonymous:
return 'User(anonymous)'
return 'User(id={}, role={}, hashed_email={})'.format(user.i... | true | true |
f731cede9482145859d440ea399c33fb16b5b9b9 | 291 | py | Python | Python/Numpy/Shape and Reshape.py | pavstar619/HackerRank | 697ee46b6e621ad884a064047461d7707b1413cd | [
"MIT"
] | 61 | 2017-04-27T13:45:12.000Z | 2022-01-27T11:40:15.000Z | Python/Numpy/Shape and Reshape.py | fahad0193/HackerRank | eb6c95e16688c02921c1df6b6ea613667a251457 | [
"MIT"
] | 1 | 2017-06-24T14:16:06.000Z | 2017-06-24T14:16:28.000Z | Python/Numpy/Shape and Reshape.py | fahad0193/HackerRank | eb6c95e16688c02921c1df6b6ea613667a251457 | [
"MIT"
] | 78 | 2017-07-05T11:48:20.000Z | 2022-02-08T08:04:22.000Z | import numpy as np
class Main:
def __init__(self):
self.li = list(map(int, input().split()))
self.np_li = np.array(self.li)
def output(self):
print(np.reshape(self.np_li, (3,3)))
if __name__ == '__main__':
obj = Main()
obj.output()
| 20.785714 | 49 | 0.546392 | import numpy as np
class Main:
def __init__(self):
self.li = list(map(int, input().split()))
self.np_li = np.array(self.li)
def output(self):
print(np.reshape(self.np_li, (3,3)))
if __name__ == '__main__':
obj = Main()
obj.output()
| true | true |
f731cf1d9fcb728621d15653a869ac0796be8492 | 127,303 | py | Python | pylearn2/models/dbm/layer.py | kundajelab/pylearn2 | 17ebf0c37b35637e337b3ae884806d2c99beb31c | [
"BSD-3-Clause"
] | null | null | null | pylearn2/models/dbm/layer.py | kundajelab/pylearn2 | 17ebf0c37b35637e337b3ae884806d2c99beb31c | [
"BSD-3-Clause"
] | null | null | null | pylearn2/models/dbm/layer.py | kundajelab/pylearn2 | 17ebf0c37b35637e337b3ae884806d2c99beb31c | [
"BSD-3-Clause"
] | null | null | null | """
Common DBM Layer classes
"""
from __future__ import print_function
__authors__ = ["Ian Goodfellow", "Vincent Dumoulin"]
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import functools
import logging
import num... | 30.601683 | 315 | 0.55708 | from __future__ import print_function
__authors__ = ["Ian Goodfellow", "Vincent Dumoulin"]
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import functools
import logging
import numpy as np
import operator
from the... | true | true |
f731cf8514305b867ae3294d7fcffca29ab4ef7a | 8,011 | py | Python | stdplugins/update.py | birhan-15/PepeBot | e76f80eab21ce396a785aff271bcbae9cce6d2ba | [
"Apache-2.0"
] | 1 | 2020-08-09T11:43:20.000Z | 2020-08-09T11:43:20.000Z | stdplugins/update.py | mikisol95/UniDragon | 55d8aa0659c8406fe1681e977fab27e902dd44f6 | [
"Apache-2.0"
] | null | null | null | stdplugins/update.py | mikisol95/UniDragon | 55d8aa0659c8406fe1681e977fab27e902dd44f6 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
# Credits goes to @AvinashReddy3108 for creating this plugin
# edited to work on Uniborg by @Mayur_Karaniya
#
"""
This... | 35.135965 | 107 | 0.615653 |
from os import environ, execle, path, remove
import asyncio
import sys
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from os import remove
import sys
from git import Repo
from git.exc import GitCommandError
from git.exc import InvalidGitRepositoryError
from git.... | true | true |
f731cf92be64b50cb66f64fd5686247ba4b5e5d3 | 518 | py | Python | params.py | Jensbeltman/ai2ludo | b4acbdb319e044cc3db07e5dc8c8eba7955aa9f7 | [
"MIT"
] | null | null | null | params.py | Jensbeltman/ai2ludo | b4acbdb319e044cc3db07e5dc8c8eba7955aa9f7 | [
"MIT"
] | null | null | null | params.py | Jensbeltman/ai2ludo | b4acbdb319e044cc3db07e5dc8c8eba7955aa9f7 | [
"MIT"
] | null | null | null | ##Local indexes
homeI = 0
startI = 1
# Goal area
goalI = 57 # local goal index
goalAreaStartI = 52 # local index where goal are starts
#Stars
starI = [6,12,19,25,32,38,45,51] # start indexes
starAtGoalI = 51 # star infront of goal area
#Globes
globeAtStartI = [1]
globeEnemy = [14,27,40]
globeSafeI = [1,9,22,35,48]
gl... | 17.862069 | 55 | 0.706564 | homeI = 0
startI = 1
goalI = 57 goalAreaStartI = 52 starI = [6,12,19,25,32,38,45,51] starAtGoalI = 51 globeAtStartI = [1]
globeEnemy = [14,27,40]
globeSafeI = [1,9,22,35,48]
globeI = [1,9,14,22,27,35,40,48]
n_players = 4
n_pieces = 4
n_pieceParams = 10
globeDie = 3
starDie = 5
sentHomePlayer = 1
sentHomeEnemy = 2... | true | true |
f731d08063ca1f99f82b11fcdb5162109f2bc026 | 448 | py | Python | applications/signals.py | mattorgill/registration | 96effc1a826e81365f5f01ac0435e80419313b07 | [
"MIT"
] | 5 | 2020-07-22T19:18:09.000Z | 2021-02-05T21:30:42.000Z | applications/signals.py | mattorgill/registration | 96effc1a826e81365f5f01ac0435e80419313b07 | [
"MIT"
] | 9 | 2021-01-27T21:42:51.000Z | 2022-03-12T00:20:25.000Z | applications/signals.py | mattorgill/registration | 96effc1a826e81365f5f01ac0435e80419313b07 | [
"MIT"
] | 1 | 2018-02-25T02:05:30.000Z | 2018-02-25T02:05:30.000Z | from django.db.models.signals import post_save
from django.dispatch import receiver
from applications import models
# Delete DraftApplication when application submitted
@receiver(post_save, sender=models.Application)
def clean_draft_application(sender, instance, created, *args, **kwargs):
if not created:
... | 32 | 72 | 0.785714 | from django.db.models.signals import post_save
from django.dispatch import receiver
from applications import models
@receiver(post_save, sender=models.Application)
def clean_draft_application(sender, instance, created, *args, **kwargs):
if not created:
return None
models.DraftApplication.objects.... | true | true |
f731d0a14032c4b2950bf53f828df39fd8c4fedd | 12,274 | py | Python | nn_dataflow/core/layer.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/core/layer.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/core/layer.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | """ $lic$
Copyright (C) 2016-2019 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
This program is distributed in the hope that it will be useful, but WITHOU... | 31.715762 | 79 | 0.554913 |
from . import data_category_enum as de
from . import loop_enum as le
from .. import util
from .data_dim_loops import DataDimLoops
class Layer(util.ContentHashClass):
def __init__(self, nofm, sofm, strd=1):
if isinstance(sofm, int):
hofm = sofm
wofm = sofm
elif len(sofm) ==... | true | true |
f731d0bb38308f507a437ba37cd55c59966a1f08 | 3,594 | py | Python | Ui_DDSMonitor.py | zhangyintai/Experiment_Manager | 800f95068a12b64d4a7e524fe406d5ef3b47f521 | [
"MIT"
] | null | null | null | Ui_DDSMonitor.py | zhangyintai/Experiment_Manager | 800f95068a12b64d4a7e524fe406d5ef3b47f521 | [
"MIT"
] | null | null | null | Ui_DDSMonitor.py | zhangyintai/Experiment_Manager | 800f95068a12b64d4a7e524fe406d5ef3b47f521 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Z:\Users\Yintai Zhang\Research\ExperimentManger_Test_2\DDSMonitor.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DDS... | 53.641791 | 201 | 0.698664 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DDSMonitor(object):
def setupUi(self, DDSMonitor):
DDSMonitor.setObjectName("DDSMonitor")
DDSMonitor.resize(1179, 846)
self.Monitor_TextBrowser = QtWidgets.QTextBrowser(DDSMonitor)
self.Monitor_TextBrowser.setGeometry(Qt... | true | true |
f731d291e80cc193af3a536212a228f8cb28fbe4 | 13,723 | py | Python | selfdrive/monitoring/driver_monitor.py | flyingforyou/openpilot | 4667084dcfd9d5f01b39b3858fb8d5328840d5df | [
"MIT"
] | null | null | null | selfdrive/monitoring/driver_monitor.py | flyingforyou/openpilot | 4667084dcfd9d5f01b39b3858fb8d5328840d5df | [
"MIT"
] | null | null | null | selfdrive/monitoring/driver_monitor.py | flyingforyou/openpilot | 4667084dcfd9d5f01b39b3858fb8d5328840d5df | [
"MIT"
] | null | null | null | from math import atan2, sqrt
from cereal import car
from common.numpy_fast import interp
from common.realtime import DT_DMON
from selfdrive.hardware import TICI
from common.filter_simple import FirstOrderFilter
from common.stat_live import RunningStatFilter
EventName = car.CarEvent.EventName
# **********************... | 49.010714 | 194 | 0.722218 | from math import atan2, sqrt
from cereal import car
from common.numpy_fast import interp
from common.realtime import DT_DMON
from selfdrive.hardware import TICI
from common.filter_simple import FirstOrderFilter
from common.stat_live import RunningStatFilter
EventName = car.CarEvent.EventName
class DRIVER_MONITOR_SE... | true | true |
f731d2d82ea0d55223333c1605aa04d4f407f8b3 | 2,426 | py | Python | vivid/endpoint.py | haikuginger/vivid | 1ddfe293f0b5a95f3d52f5e737e85d98be1eaab8 | [
"MIT"
] | 4 | 2017-11-19T03:22:46.000Z | 2019-02-28T08:32:43.000Z | vivid/endpoint.py | haikuginger/vivid | 1ddfe293f0b5a95f3d52f5e737e85d98be1eaab8 | [
"MIT"
] | null | null | null | vivid/endpoint.py | haikuginger/vivid | 1ddfe293f0b5a95f3d52f5e737e85d98be1eaab8 | [
"MIT"
] | null | null | null | from vivid.common import ParametersMixin
class Endpoint(ParametersMixin, object):
"""
Descriptor that describes an attribute which acts
as a function making an HTTP request. Return a
bound endpoint attached to this and the base API.
"""
def __init__(self, method, path, *parameters):
... | 31.102564 | 68 | 0.622012 | from vivid.common import ParametersMixin
class Endpoint(ParametersMixin, object):
def __init__(self, method, path, *parameters):
self.method = method
self.path = path
self.parameters = parameters
super(Endpoint, self).__init__()
def __get__(self, instance, _owner):
retu... | true | true |
f731d330a352677e2aec29c1fc65fdf8568da45c | 1,747 | py | Python | neuralmonkey/processors/alignment.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | 5 | 2017-04-24T21:10:03.000Z | 2019-05-22T13:19:35.000Z | neuralmonkey/processors/alignment.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | null | null | null | neuralmonkey/processors/alignment.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | 5 | 2017-04-25T01:36:44.000Z | 2019-12-13T15:04:03.000Z | import re
from typing import List
import numpy as np
# pylint: disable=too-few-public-methods
ID_SEP = re.compile(r"[-:]")
class WordAlignmentPreprocessor(object):
"""A preprocessor for word alignments in a text format.
One of the following formats is expected:
s1-t1 s2-t2 ...
s1:1/w1 s2... | 30.12069 | 78 | 0.613051 | import re
from typing import List
import numpy as np
ID_SEP = re.compile(r"[-:]")
class WordAlignmentPreprocessor(object):
def __init__(self, source_len, target_len, dtype=np.float32,
normalize=True, zero_based=True):
self._source_len = source_len
self._target_len = target_len... | true | true |
f731d397e48ee7a09bfdd1a865be4a4cff1b7f89 | 5,899 | py | Python | archive/script_check_quote.py | THS-on/keylime | bb904fc98d9674832e630542d211e71102873b4d | [
"Apache-2.0"
] | 192 | 2019-05-08T14:43:50.000Z | 2022-03-28T20:21:28.000Z | archive/script_check_quote.py | THS-on/keylime | bb904fc98d9674832e630542d211e71102873b4d | [
"Apache-2.0"
] | 694 | 2019-04-18T14:08:36.000Z | 2022-03-31T13:55:37.000Z | archive/script_check_quote.py | THS-on/keylime | bb904fc98d9674832e630542d211e71102873b4d | [
"Apache-2.0"
] | 97 | 2019-04-17T19:04:00.000Z | 2022-03-20T18:19:28.000Z | #!/usr/bin/env python
'''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclu... | 33.902299 | 193 | 0.689778 |
import keylime.config
keylime.config.USE_CLIME=True
from keylime.tpm_quote import check_deep_quote, check_quote
from timeit import timeit
from timeit import default_timer as timer
import logging
import sys
import os
import tempfile
import subprocess
import base64
logging.basicConfig(stream=sys.stdout, level=logging... | true | true |
f731d3eb4aae5e78db2bfaf2ea2d5f1e9832f7d4 | 9,108 | py | Python | repos/system_upgrade/el7toel8/actors/systemfacts/libraries/systemfacts.py | adka1408/leapp-repository | be5a9603b57f86c65d395ba6a02b860cacae0fb6 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/systemfacts/libraries/systemfacts.py | adka1408/leapp-repository | be5a9603b57f86c65d395ba6a02b860cacae0fb6 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/systemfacts/libraries/systemfacts.py | adka1408/leapp-repository | be5a9603b57f86c65d395ba6a02b860cacae0fb6 | [
"Apache-2.0"
] | null | null | null | import errno
import functools
import grp
import json
import logging
import os
import pwd
import re
from six.moves import configparser
import six
from leapp.libraries.stdlib import CalledProcessError, api, run
from leapp.models import SysctlVariablesFacts, SysctlVariable, ActiveKernelModulesFacts, ActiveKernelModule, ... | 33.485294 | 117 | 0.60639 | import errno
import functools
import grp
import json
import logging
import os
import pwd
import re
from six.moves import configparser
import six
from leapp.libraries.stdlib import CalledProcessError, api, run
from leapp.models import SysctlVariablesFacts, SysctlVariable, ActiveKernelModulesFacts, ActiveKernelModule, ... | true | true |
f731d41dd8efc8ab1fafc24f2e3c8da6336f6369 | 2,557 | py | Python | rusty/src/odom_pub.py | siddarth09/Rusty | 8d4c818869843ddd4d37f4e82f1203cd5566f8b7 | [
"MIT"
] | 3 | 2022-01-09T08:45:31.000Z | 2022-02-03T04:22:55.000Z | rusty/src/odom_pub.py | siddarth09/Rusty | 8d4c818869843ddd4d37f4e82f1203cd5566f8b7 | [
"MIT"
] | 2 | 2022-01-19T07:23:59.000Z | 2022-02-21T10:17:39.000Z | rusty/src/odom_pub.py | siddarth09/Rusty | 8d4c818869843ddd4d37f4e82f1203cd5566f8b7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# This scripts takes the odom from TF published by Cartographer and publishes it as an individual topic. Only required when used with real robot.
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Pose, Twist
import tf
#Node to handle calculating and publishing odometry
cl... | 30.440476 | 145 | 0.70043 |
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Pose, Twist
import tf
class odometry_publisher():
def __init__(self):
rospy.init_node('odom_publisher')
self.listener = tf.TransformListener()
self.odom_publisher = rospy.Publisher('odom',Odometry,queue_size=1)
self.slee... | true | true |
f731d4c0ca2482c5e81b997cb3a82b35636c343b | 18,733 | py | Python | google/cloud/datastore_admin_v1/services/datastore_admin/transports/grpc_asyncio.py | freelancing-solutions/python-datastore | 160f7751db6a2a27cdf2a5232eadc538de8a8268 | [
"Apache-2.0"
] | null | null | null | google/cloud/datastore_admin_v1/services/datastore_admin/transports/grpc_asyncio.py | freelancing-solutions/python-datastore | 160f7751db6a2a27cdf2a5232eadc538de8a8268 | [
"Apache-2.0"
] | 1 | 2020-04-01T09:22:47.000Z | 2020-04-01T12:02:43.000Z | google/cloud/datastore_admin_v1/services/datastore_admin/transports/grpc_asyncio.py | freelancing-solutions/python-datastore | 160f7751db6a2a27cdf2a5232eadc538de8a8268 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 42.286682 | 87 | 0.644745 |
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple
from google.api_core import gapic_v1 from google.api_core import grpc_helpers_async from google.api_core import operations_v1 from google import auth from google.auth import credentials from google.auth.transport.grpc import... | true | true |
f731d7163a949e08b78c987d882201df17fa56fc | 6,194 | py | Python | keras/feature_column/dense_features_v2.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/feature_column/dense_features_v2.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/feature_column/dense_features_v2.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 required by applica... | 37.539394 | 80 | 0.674524 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
from keras.feature_column import base_feature_layer as kfc
from keras.feature_column import dense_features
from keras.utils import tf_contextlib
from tensorflow.python.util.... | true | true |
f731d83cb3bd2b8583121ddf5531aba8604bc008 | 14,005 | py | Python | main_old.py | umidjon-userbot/tgvcv | 78f461bf2e68902d6a9ab4b5d06aca6840c1844f | [
"MIT"
] | null | null | null | main_old.py | umidjon-userbot/tgvcv | 78f461bf2e68902d6a9ab4b5d06aca6840c1844f | [
"MIT"
] | null | null | null | main_old.py | umidjon-userbot/tgvcv | 78f461bf2e68902d6a9ab4b5d06aca6840c1844f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import os
import asyncio
import subprocess
import youtube_dl
from Python_ARQ import ARQ
from pytgcalls import GroupCall
from sys import version as pyver
from pyrogram import Client, filters
from misc import HELP_TEXT, START_TEXT, REPO_TEXT
from functions import (
t... | 30.645514 | 97 | 0.565084 | from __future__ import unicode_literals
import os
import asyncio
import subprocess
import youtube_dl
from Python_ARQ import ARQ
from pytgcalls import GroupCall
from sys import version as pyver
from pyrogram import Client, filters
from misc import HELP_TEXT, START_TEXT, REPO_TEXT
from functions import (
t... | true | true |
f731d84f286ed80e65155cc5debd5fca99760dfb | 186 | py | Python | 2_line_notify/src/config_sample.py | tenpa1105/m5camera_mpy_samples | a47d6eca951fc6298794226f51c20408d7c2d64c | [
"MIT"
] | null | null | null | 2_line_notify/src/config_sample.py | tenpa1105/m5camera_mpy_samples | a47d6eca951fc6298794226f51c20408d7c2d64c | [
"MIT"
] | null | null | null | 2_line_notify/src/config_sample.py | tenpa1105/m5camera_mpy_samples | a47d6eca951fc6298794226f51c20408d7c2d64c | [
"MIT"
] | null | null | null | WIFI_SSID = "please enter your wifi ssid"
WIFI_PASS = "please enter your wifi password"
LINE_TOKEN= "please enter your line notify token"
MOVING_DET_DIFF = 10
MOVING_DET_LIGHT_MAX = 200 | 37.2 | 50 | 0.795699 | WIFI_SSID = "please enter your wifi ssid"
WIFI_PASS = "please enter your wifi password"
LINE_TOKEN= "please enter your line notify token"
MOVING_DET_DIFF = 10
MOVING_DET_LIGHT_MAX = 200 | true | true |
f731d88c245e18608de7478443566fc03ff583a3 | 23,559 | py | Python | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_pipeline_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_pipeline_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_pipeline_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.690283 | 161 | 0.651259 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f731d8ca027353b729bc9ed640d9ad7a07e8266f | 1,587 | py | Python | CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 1 | 2021-04-02T18:04:49.000Z | 2021-04-02T18:04:49.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, merge, publish... | 39.675 | 83 | 0.750473 |
from CIM16.IEC61970.Dynamics.RotatingMachineDynamics import RotatingMachineDynamics
class SynchronousMachineDynamics(RotatingMachineDynamics):
def __init__(self, *args, **kw_args):
super(SynchronousMachineDynamics, self).__init__(*args, **kw_args)
_attrs = []
_attr_types = {}
_defa... | true | true |
f731d8f40c75040a81052514bb8660d957209d22 | 9,955 | py | Python | conans/test/functional/layout/test_in_cache.py | thorbenk/conan | 916cb10b99ed92d319cd0719462708ee0501ecd4 | [
"MIT"
] | null | null | null | conans/test/functional/layout/test_in_cache.py | thorbenk/conan | 916cb10b99ed92d319cd0719462708ee0501ecd4 | [
"MIT"
] | 1 | 2019-06-07T03:02:02.000Z | 2019-06-07T03:02:02.000Z | conans/test/functional/layout/test_in_cache.py | thorbenk/conan | 916cb10b99ed92d319cd0719462708ee0501ecd4 | [
"MIT"
] | 1 | 2021-08-20T19:47:51.000Z | 2021-08-20T19:47:51.000Z | import os
import re
import textwrap
import pytest
from conans import load
from conans.model.ref import ConanFileReference, PackageReference
from conans.test.assets.genconanfile import GenConanfile
from conans.test.utils.tools import TestClient
@pytest.fixture
def conanfile():
conan_file = str(GenConanfile().wit... | 36.465201 | 101 | 0.631241 | import os
import re
import textwrap
import pytest
from conans import load
from conans.model.ref import ConanFileReference, PackageReference
from conans.test.assets.genconanfile import GenConanfile
from conans.test.utils.tools import TestClient
@pytest.fixture
def conanfile():
conan_file = str(GenConanfile().wit... | true | true |
f731d92f11113ea1707e78d82712af11992ee782 | 1,834 | py | Python | plugins/digitalocean/komand_digitalocean/actions/shutdown_droplet/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/digitalocean/komand_digitalocean/actions/shutdown_droplet/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/digitalocean/komand_digitalocean/actions/shutdown_droplet/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
import json
import requests
from .schema import ShutdownDropletInput, ShutdownDropletOutput
class ShutdownDroplet(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="shutdown_droplet",
description="Shuts down the droplet from a specified im... | 35.960784 | 115 | 0.602508 | import komand
import json
import requests
from .schema import ShutdownDropletInput, ShutdownDropletOutput
class ShutdownDroplet(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="shutdown_droplet",
description="Shuts down the droplet from a specified im... | true | true |
f731d9abc87872b2a6859052c5d9bddd62dc2bbf | 7,144 | py | Python | statsmodels/regression/feasible_gls.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | 15 | 2015-03-03T09:47:42.000Z | 2022-01-05T18:28:31.000Z | statsmodels/regression/feasible_gls.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | 7 | 2015-11-20T08:33:04.000Z | 2020-07-24T19:34:39.000Z | statsmodels/regression/feasible_gls.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | 14 | 2015-01-06T22:08:34.000Z | 2021-01-01T16:33:23.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 20 20:24:20 2011
Author: Josef Perktold
License: BSD-3
"""
from statsmodels.compat.python import range
import numpy as np
import statsmodels.base.model as base
from statsmodels.regression.linear_model import OLS, GLS, WLS, RegressionResults
def atleast_2dcols(x):
... | 34.181818 | 85 | 0.663074 |
from statsmodels.compat.python import range
import numpy as np
import statsmodels.base.model as base
from statsmodels.regression.linear_model import OLS, GLS, WLS, RegressionResults
def atleast_2dcols(x):
x = np.asarray(x)
if x.ndim == 1:
x = x[:,None]
return x
class GLSHet2(GLS):
def __i... | true | true |
f731da5a81c641e31e53c884e6c9639b29b76505 | 9,408 | py | Python | openmixup/models/heads/mim_head.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | 10 | 2021-12-30T10:22:27.000Z | 2022-03-30T02:31:38.000Z | openmixup/models/heads/mim_head.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | 3 | 2022-01-20T21:02:48.000Z | 2022-03-19T13:49:45.000Z | openmixup/models/heads/mim_head.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from mmcv.runner import BaseModule
from torch.nn import functional as F
from mmcv.cnn.utils.weight_init import trunc_normal_init
from ..builder import build_loss
from ..registry import HEADS
from .cls_head import ClsHead
from openmixup.utils import print_log
@HEADS.register_module
... | 37.333333 | 95 | 0.573236 | import torch
import torch.nn as nn
from mmcv.runner import BaseModule
from torch.nn import functional as F
from mmcv.cnn.utils.weight_init import trunc_normal_init
from ..builder import build_loss
from ..registry import HEADS
from .cls_head import ClsHead
from openmixup.utils import print_log
@HEADS.register_module
... | true | true |
f731dac69125b54c276e48cad62937bf921dd204 | 4,008 | py | Python | tests/packets_ipv4_dns.py | mattjhayes/nmeta | 55cc27e81defc42775ff563bfbef31800e089b14 | [
"Apache-2.0"
] | 18 | 2015-02-18T22:53:32.000Z | 2021-11-16T11:36:50.000Z | tests/packets_ipv4_dns.py | mattjhayes/nmeta | 55cc27e81defc42775ff563bfbef31800e089b14 | [
"Apache-2.0"
] | 67 | 2015-01-05T07:27:22.000Z | 2017-07-21T11:38:14.000Z | tests/packets_ipv4_dns.py | mattjhayes/nmeta | 55cc27e81defc42775ff563bfbef31800e089b14 | [
"Apache-2.0"
] | 8 | 2015-05-01T18:35:03.000Z | 2019-10-02T13:54:53.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 30.830769 | 276 | 0.755739 |
import binascii
RAW = []
LEN = []
ETH_SRC = []
ETH_DST = []
ETH_TYPE = []
IP_SRC = []
IP_DST = []
PROTO = []
TP_SRC = []
TP_DST = []
TP_SEQ_SRC = []
TP_SEQ_DST = []
TCP_SYN = []
TCP_FIN = []
TCP_RST = []
TCP_PSH = []
TCP_ACK = []
PAYLOAD = []
DIRECTION = []
DNS_NAME = []
DNS_CNAME = []
DNS_IP = []
RAW.append(binas... | true | true |
f731db288f3af2b9725dd5bcb99c2c03c2bd44fa | 399 | py | Python | clubChinois/asgi.py | LonelVino/club-chinois-home | 3e2ecc6728f0b7349adfe10e515e3f5908d09c9d | [
"MIT"
] | null | null | null | clubChinois/asgi.py | LonelVino/club-chinois-home | 3e2ecc6728f0b7349adfe10e515e3f5908d09c9d | [
"MIT"
] | null | null | null | clubChinois/asgi.py | LonelVino/club-chinois-home | 3e2ecc6728f0b7349adfe10e515e3f5908d09c9d | [
"MIT"
] | null | null | null | """
ASGI config for clubChinois project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'clubChinois.settings')
application = get_asgi_application()
| true | true |
f731db2b22f21eabf1ae55d4e5b092cecb7772ad | 3,106 | py | Python | hooks/webkitpy/common/thread/messagepump_unittest.py | nizovn/luna-sysmgr | 48b7e2546e81d6ad1604353f2e5ab797a7d1667c | [
"Apache-2.0"
] | 15 | 2015-05-25T19:28:05.000Z | 2021-05-03T09:21:22.000Z | WebKit/Tools/Scripts/webkitpy/common/thread/messagepump_unittest.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | WebKit/Tools/Scripts/webkitpy/common/thread/messagepump_unittest.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | 7 | 2019-01-30T08:56:04.000Z | 2021-11-19T16:14:54.000Z | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 36.97619 | 79 | 0.691887 |
import unittest
from webkitpy.common.thread.messagepump import MessagePump, MessagePumpDelegate
from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
class TestDelegate(MessagePumpDelegate):
def __init__(self):
self.log = []
def schedule(self, interval, callback):
sel... | true | true |
f731dcea61a92d9d646629353eb1706f5a38b82e | 8,251 | py | Python | pwndbg/commands/nearpc.py | jmc1283/pwndbg | df165f0788948b9b12e6a80fa91d647c13e6eb0a | [
"MIT"
] | 21 | 2018-01-01T13:28:56.000Z | 2019-11-06T15:30:56.000Z | pwndbg/commands/nearpc.py | jmc1283/pwndbg | df165f0788948b9b12e6a80fa91d647c13e6eb0a | [
"MIT"
] | null | null | null | pwndbg/commands/nearpc.py | jmc1283/pwndbg | df165f0788948b9b12e6a80fa91d647c13e6eb0a | [
"MIT"
] | 5 | 2018-01-02T01:30:41.000Z | 2020-01-04T05:55:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import gdb
from capstone import *
import pwndbg.arguments
import pwndbg.color
import pwndbg.... | 39.290476 | 159 | 0.688038 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import gdb
from capstone import *
import pwndbg.arguments
import pwndbg.color
import pwndbg.color.context as C
import pwndbg.color.disasm ... | true | true |
f731df9decd333bae50c1e2a514b5c83b2a8f9b3 | 5,684 | py | Python | scripts/fig3_locking_across_frequencies.py | fabiansinz/locker | 9ca397d0a9aa747552bc43188b07056b87c6e9f0 | [
"MIT"
] | null | null | null | scripts/fig3_locking_across_frequencies.py | fabiansinz/locker | 9ca397d0a9aa747552bc43188b07056b87c6e9f0 | [
"MIT"
] | null | null | null | scripts/fig3_locking_across_frequencies.py | fabiansinz/locker | 9ca397d0a9aa747552bc43188b07056b87c6e9f0 | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
from matplotlib.collections import PolyCollection
from numpy.fft import fft, fftfreq, fftshift
from locker import mkdir
from locker.analysis import *
from locker.data import *
from scripts.config import params as plot_params, FormatedFigure
def generate_filename(cell, contrast)... | 43.389313 | 116 | 0.508797 | import matplotlib
matplotlib.use('Agg')
from matplotlib.collections import PolyCollection
from numpy.fft import fft, fftfreq, fftshift
from locker import mkdir
from locker.analysis import *
from locker.data import *
from scripts.config import params as plot_params, FormatedFigure
def generate_filename(cell, contrast)... | true | true |
f731e03ae1b3564391dc273fed1062bf7757db8f | 3,023 | py | Python | src/caravaggio_rest_api/users/admin.py | intellstartup/django-caravaggio-rest-api | 98a530f7c0c38860561fac2f57476cf40f03e3d7 | [
"MIT"
] | null | null | null | src/caravaggio_rest_api/users/admin.py | intellstartup/django-caravaggio-rest-api | 98a530f7c0c38860561fac2f57476cf40f03e3d7 | [
"MIT"
] | null | null | null | src/caravaggio_rest_api/users/admin.py | intellstartup/django-caravaggio-rest-api | 98a530f7c0c38860561fac2f57476cf40f03e3d7 | [
"MIT"
] | 1 | 2020-03-03T22:48:51.000Z | 2020-03-03T22:48:51.000Z | # -*- coding: utf-8 -*
# Copyright (c) 2019 BuildGroup Data Services, Inc.
# All rights reserved.
# This software is proprietary and confidential and may not under
# any circumstances be used, copied, or distributed.
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from caravaggio_rest... | 38.75641 | 113 | 0.629176 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from caravaggio_rest_api.users.models import CaravaggioOrganization, CaravaggioClient, CaravaggioUser
from caravaggio_rest_api.users.forms import CaravaggioUserCreationForm, CaravaggioUserChangeForm
from django.utils.translation import g... | true | true |
f731e044c42d70929ca1dde381c15c75b32e29b6 | 4,826 | py | Python | packages/fetchai/skills/thermometer/strategy.py | cyenyxe/agents-aea | c2aec9127028ae13def3f69fbc80d35400de1565 | [
"Apache-2.0"
] | null | null | null | packages/fetchai/skills/thermometer/strategy.py | cyenyxe/agents-aea | c2aec9127028ae13def3f69fbc80d35400de1565 | [
"Apache-2.0"
] | 1 | 2020-02-21T14:28:13.000Z | 2020-03-05T14:53:53.000Z | packages/fetchai/skills/thermometer/strategy.py | cyenyxe/agents-aea | c2aec9127028ae13def3f69fbc80d35400de1565 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 32.829932 | 92 | 0.61666 |
import logging
from random import randrange
from typing import Any, Dict, Tuple
from temper import Temper
from aea.helpers.search.models import Description, Query
from aea.mail.base import Address
from aea.skills.base import Model
from packages.fetchai.skills.thermometer.thermometer_data_model import (
SCHEME,
... | true | true |
f731e2cb91bc067b57e8218188dc62edb4b4ad1a | 3,754 | py | Python | utils/text_fallback.py | laura-ham/INTEX | 07bcf26ca17092ecf4fc41b85ea9d764a0caa8c9 | [
"MIT"
] | null | null | null | utils/text_fallback.py | laura-ham/INTEX | 07bcf26ca17092ecf4fc41b85ea9d764a0caa8c9 | [
"MIT"
] | null | null | null | utils/text_fallback.py | laura-ham/INTEX | 07bcf26ca17092ecf4fc41b85ea9d764a0caa8c9 | [
"MIT"
] | null | null | null | import nltk
import pandas as pd
try:
import libvoikko
except ModuleNotFoundError:
from voikko import libvoikko
import logging
from nltk.corpus import stopwords
logger = logging.getLogger(__name__)
nltk.download('stopwords')
EMAIL_REGEX = (
r"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]... | 33.81982 | 88 | 0.600693 | import nltk
import pandas as pd
try:
import libvoikko
except ModuleNotFoundError:
from voikko import libvoikko
import logging
from nltk.corpus import stopwords
logger = logging.getLogger(__name__)
nltk.download('stopwords')
EMAIL_REGEX = (
r"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]... | true | true |
f731e3087e60474a011882b5a3c220186114ae19 | 979 | py | Python | tests/tests_helpers.py | thsis/NIS18 | 1f2a7be1ab209fa7c0a25cb8eace744336b07c1f | [
"MIT"
] | null | null | null | tests/tests_helpers.py | thsis/NIS18 | 1f2a7be1ab209fa7c0a25cb8eace744336b07c1f | [
"MIT"
] | null | null | null | tests/tests_helpers.py | thsis/NIS18 | 1f2a7be1ab209fa7c0a25cb8eace744336b07c1f | [
"MIT"
] | null | null | null | import numpy as np
from algorithms import helpers
def test_QR(Ntests):
passed = 0
critical = 0
for _ in range(Ntests):
try:
n = np.random.randint(2, 11)
X = np.random.uniform(low=0.0,
high=100.0,
size=(n, n... | 26.459459 | 60 | 0.514811 | import numpy as np
from algorithms import helpers
def test_QR(Ntests):
passed = 0
critical = 0
for _ in range(Ntests):
try:
n = np.random.randint(2, 11)
X = np.random.uniform(low=0.0,
high=100.0,
size=(n, n... | true | true |
f731e5102507b94eeb51094b340932c5317bf095 | 46 | py | Python | tf1.6/hello_world.py | sgeos/tensorflow_playground | c4c10b74b1eebb63f0bf8de7a9a976c11f025618 | [
"CC0-1.0"
] | null | null | null | tf1.6/hello_world.py | sgeos/tensorflow_playground | c4c10b74b1eebb63f0bf8de7a9a976c11f025618 | [
"CC0-1.0"
] | null | null | null | tf1.6/hello_world.py | sgeos/tensorflow_playground | c4c10b74b1eebb63f0bf8de7a9a976c11f025618 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
print("Hello World!")
| 9.2 | 21 | 0.652174 |
print("Hello World!")
| true | true |
f731e51078bcba5985a20831c62f2df1e230b71b | 9,066 | py | Python | Layers/LSTM.py | starasteh/DeepLearning_from_scratch | 6ed4685e4da57ad5ea51edf84010f2cc9725a2ba | [
"MIT"
] | 6 | 2020-09-13T17:03:26.000Z | 2021-05-16T14:03:59.000Z | Layers/LSTM.py | starasteh/DeepLearning_from_scratch | 6ed4685e4da57ad5ea51edf84010f2cc9725a2ba | [
"MIT"
] | null | null | null | Layers/LSTM.py | starasteh/DeepLearning_from_scratch | 6ed4685e4da57ad5ea51edf84010f2cc9725a2ba | [
"MIT"
] | 2 | 2021-03-17T02:20:42.000Z | 2021-04-24T16:28:45.000Z | '''
Created on January 2020.
@author: Soroosh Tayebi Arasteh <soroosh.arasteh@fau.de>
https://github.com/tayebiarasteh/
'''
from Layers.Base import *
import numpy as np
import pdb
from Layers import Sigmoid, FullyConnected, TanH
import copy
class LSTM(base_layer):
def __init__(self, input_size, hidden_size, out... | 37.155738 | 124 | 0.64604 |
from Layers.Base import *
import numpy as np
import pdb
from Layers import Sigmoid, FullyConnected, TanH
import copy
class LSTM(base_layer):
def __init__(self, input_size, hidden_size, output_size):
super().__init__()
self.input_size = input_size
self.hidden_size = hidden_size
sel... | true | true |
f731e59f967dc833ca0efbb9f27ea0cceff52d86 | 285 | py | Python | tp_epi/tp_epi/doctype/epi_catalog_listing/test_epi_catalog_listing.py | mntechnique/tp_epi | 078a2590b50c759555880f143841ef74071b83bc | [
"MIT"
] | null | null | null | tp_epi/tp_epi/doctype/epi_catalog_listing/test_epi_catalog_listing.py | mntechnique/tp_epi | 078a2590b50c759555880f143841ef74071b83bc | [
"MIT"
] | null | null | null | tp_epi/tp_epi/doctype/epi_catalog_listing/test_epi_catalog_listing.py | mntechnique/tp_epi | 078a2590b50c759555880f143841ef74071b83bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, MN Technique and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('EPI Catalog Listing')
class TestEPICatalogListing(unittest.TestCase):
pass
| 21.923077 | 63 | 0.778947 | from __future__ import unicode_literals
import frappe
import unittest
class TestEPICatalogListing(unittest.TestCase):
pass
| true | true |
f731e5a5be517d62ed376f4bef3cd377ea2b9167 | 438 | py | Python | nodux_stock_one/config/desktop.py | tatiqm25/nodux_stock_one | 78bcfd33b8ec89e2f7399dff55bb597cc52be2c0 | [
"MIT"
] | null | null | null | nodux_stock_one/config/desktop.py | tatiqm25/nodux_stock_one | 78bcfd33b8ec89e2f7399dff55bb597cc52be2c0 | [
"MIT"
] | null | null | null | nodux_stock_one/config/desktop.py | tatiqm25/nodux_stock_one | 78bcfd33b8ec89e2f7399dff55bb597cc52be2c0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Nodux Stock One",
"color": "darkgrey",
"icon": "octicon octicon-file-directory",
"type": "module",
"hidden": 1
},
{
"module_name": "Stock",
"_doctype": "Stock One... | 18.25 | 44 | 0.586758 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Nodux Stock One",
"color": "darkgrey",
"icon": "octicon octicon-file-directory",
"type": "module",
"hidden": 1
},
{
"module_name": "Stock",
"_doctype": "Stock One",
"color": "#f39c12"... | true | true |
f731e64c211030f3004ca41b06d5ae447a8e7b28 | 3,626 | py | Python | configs/fcos/fcos_r50_caffe_fpn_gn_1x_4gpu.py | wangxu19920419/mmdetection | b7890e243babd7d916086ce288f12350d816bd15 | [
"Apache-2.0"
] | null | null | null | configs/fcos/fcos_r50_caffe_fpn_gn_1x_4gpu.py | wangxu19920419/mmdetection | b7890e243babd7d916086ce288f12350d816bd15 | [
"Apache-2.0"
] | null | null | null | configs/fcos/fcos_r50_caffe_fpn_gn_1x_4gpu.py | wangxu19920419/mmdetection | b7890e243babd7d916086ce288f12350d816bd15 | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='FCOS',
pretrained='open-mmlab://resnet50_caffe',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
style='caffe'),
ne... | 27.892308 | 113 | 0.620243 | model = dict(
type='FCOS',
pretrained='open-mmlab://resnet50_caffe',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
style='caffe'),
neck=dict(
... | true | true |
f731e6dbf70d7c3cf15954de216636afb6bd4249 | 3,337 | py | Python | main.py | LarsChrWiik/Comparing-Machine-Learning-Models | 050b1bdb40c1d2e9c15f927e9eb257b4b7aaacbe | [
"MIT"
] | null | null | null | main.py | LarsChrWiik/Comparing-Machine-Learning-Models | 050b1bdb40c1d2e9c15f927e9eb257b4b7aaacbe | [
"MIT"
] | null | null | null | main.py | LarsChrWiik/Comparing-Machine-Learning-Models | 050b1bdb40c1d2e9c15f927e9eb257b4b7aaacbe | [
"MIT"
] | null | null | null |
from scipy.io import arff
from sklearn.pipeline import Pipeline
from sklearn.utils import shuffle
from ModelScorer import ModelScorer
import pandas as pd
from Plotter import *
import warnings
#warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.filterwarnings("ignore")
pd.set_option('disp... | 33.707071 | 94 | 0.709919 |
from scipy.io import arff
from sklearn.pipeline import Pipeline
from sklearn.utils import shuffle
from ModelScorer import ModelScorer
import pandas as pd
from Plotter import *
import warnings
warnings.filterwarnings("ignore")
pd.set_option('display.expand_frame_repr', False)
from sklearn.dummy import Dum... | true | true |
f731e81692857af543cde6e9c07ecfe8dccf96ac | 841 | py | Python | test_seq_features.py | daviortega/protfeature | 76f0141f72d0c34a29704598cde5c15e68c6b818 | [
"MIT"
] | null | null | null | test_seq_features.py | daviortega/protfeature | 76f0141f72d0c34a29704598cde5c15e68c6b818 | [
"MIT"
] | null | null | null | test_seq_features.py | daviortega/protfeature | 76f0141f72d0c34a29704598cde5c15e68c6b818 | [
"MIT"
] | null | null | null | import pytest
from seq_features import *
def test_n_neg_for_single_E_or_D():
"""Perform unit tests on n_neg."""
assert n_neg('E') == 1
assert n_neg('D') == 1
def test_n_neg_for_empty_sequence():
assert n_neg('') == 0
def test_n_neg_for_longer_sequences():
assert n_neg('ACKLWTTAE') == 1
... | 25.484848 | 48 | 0.681332 | import pytest
from seq_features import *
def test_n_neg_for_single_E_or_D():
assert n_neg('E') == 1
assert n_neg('D') == 1
def test_n_neg_for_empty_sequence():
assert n_neg('') == 0
def test_n_neg_for_longer_sequences():
assert n_neg('ACKLWTTAE') == 1
assert n_neg('DDDDEEEE') == 8
def test... | true | true |
f731e81f7cb78dfca687516d372c3f03d4e3eccb | 56 | py | Python | inclearn/convnet/__init__.py | romilbhardwaj/incremental_learning.pytorch | 77097ef4dd4fc6b6c35d13ef66856d6f8a15598d | [
"MIT"
] | 3 | 2019-07-01T14:43:05.000Z | 2019-12-27T13:26:52.000Z | inclearn/convnet/__init__.py | rahulvigneswaran/incremental_learning.pytorch | 786ecda7dbce5977894737d61cd5e3a30f61aac6 | [
"MIT"
] | null | null | null | inclearn/convnet/__init__.py | rahulvigneswaran/incremental_learning.pytorch | 786ecda7dbce5977894737d61cd5e3a30f61aac6 | [
"MIT"
] | null | null | null | from . import cifar_resnet, densenet, my_resnet, resnet
| 28 | 55 | 0.803571 | from . import cifar_resnet, densenet, my_resnet, resnet
| true | true |
f731e8d74b347c0259534af53c389d1a5bf2b3bc | 13,125 | py | Python | devel/lib/python2.7/dist-packages/hector_uav_msgs/msg/_LandingActionGoal.py | pplankton/MRSLAM | 0a16489a2cbd0c2d1511b506c540446cc670bde8 | [
"MIT"
] | 1 | 2021-05-17T11:13:01.000Z | 2021-05-17T11:13:01.000Z | devel/lib/python2.7/dist-packages/hector_uav_msgs/msg/_LandingActionGoal.py | pplankton/MRSLAM | 0a16489a2cbd0c2d1511b506c540446cc670bde8 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/hector_uav_msgs/msg/_LandingActionGoal.py | pplankton/MRSLAM | 0a16489a2cbd0c2d1511b506c540446cc670bde8 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from hector_uav_msgs/LandingActionGoal.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
import hector_uav_msgs.msg
import genpy
import actionlib_ms... | 38.265306 | 327 | 0.643962 | import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
import hector_uav_msgs.msg
import genpy
import actionlib_msgs.msg
import std_msgs.msg
class LandingActionGoal(genpy.Message):
_md5sum = "f5e95feb07d8f5f21d989eb34d7c3243"
_type = "hector_uav_msg... | true | true |
f731e9a98528dc5e011f119e55fcaa7ffca1650c | 1,917 | py | Python | keanu-python/keanu/infer_type.py | rs992214/keanu | f7f9b877aaaf9c9f732604f17da238e15dfdad13 | [
"MIT"
] | 153 | 2018-04-06T13:30:31.000Z | 2022-01-31T10:05:27.000Z | keanu-python/keanu/infer_type.py | shinnlok/keanu | c75b2a00571a0da93c6b1d5e9f0cbe09aebdde4d | [
"MIT"
] | 168 | 2018-04-06T16:37:33.000Z | 2021-09-27T21:43:54.000Z | keanu-python/keanu/infer_type.py | shinnlok/keanu | c75b2a00571a0da93c6b1d5e9f0cbe09aebdde4d | [
"MIT"
] | 46 | 2018-04-10T10:46:01.000Z | 2022-02-24T02:53:50.000Z | from typing import Callable, Dict, Any, Union
import numpy as np
from keanu.vartypes import (numpy_types, tensor_arg_types, runtime_numpy_types, runtime_pandas_types,
runtime_primitive_types, runtime_bool_types, runtime_int_types, runtime_float_types,
primitive_... | 38.34 | 118 | 0.709442 | from typing import Callable, Dict, Any, Union
import numpy as np
from keanu.vartypes import (numpy_types, tensor_arg_types, runtime_numpy_types, runtime_pandas_types,
runtime_primitive_types, runtime_bool_types, runtime_int_types, runtime_float_types,
primitive_... | true | true |
f731e9dc46d9a42f547e7b29cb89e2dde3ec8755 | 15,925 | py | Python | tests/unit/api/resources/systems.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | 5 | 2020-06-04T10:20:33.000Z | 2020-10-26T15:09:19.000Z | tests/unit/api/resources/systems.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | tests/unit/api/resources/systems.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, 2017 IBM Corp.
#
# 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 writin... | 35.467706 | 79 | 0.589827 |
from tessia.server.api.resources.systems import SystemResource
from tessia.server.api.resources.systems import MSG_BAD_COMBO
from tessia.server.db import models
from tests.unit.api.resources.secure_resource import TestSecureResource
import json
class TestSystems(TestSecureResource):
RESOURCE_URL = '/system... | true | true |
f731e9f673edb980d0ac68138a8573de0e682d5d | 1,411 | py | Python | python/ledger/ledger.py | fruit-in/exercism-solution | 942f824e2dacd23ee9fd12f5b3e8abed0aeb9581 | [
"MIT"
] | 9 | 2020-12-12T03:29:33.000Z | 2021-08-11T13:08:06.000Z | python/ledger/ledger.py | fruit-in/exercism-solution | 942f824e2dacd23ee9fd12f5b3e8abed0aeb9581 | [
"MIT"
] | null | null | null | python/ledger/ledger.py | fruit-in/exercism-solution | 942f824e2dacd23ee9fd12f5b3e8abed0aeb9581 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def create_entry(date, description, change):
return (list(map(int, date.split("-"))), description, change)
def format_entries(currency, locale, entries):
if currency == "USD":
symbol = "$"
elif currency == "EUR":
symbol = u"€"
if locale == "en_US":
he... | 32.068182 | 78 | 0.530829 |
def create_entry(date, description, change):
return (list(map(int, date.split("-"))), description, change)
def format_entries(currency, locale, entries):
if currency == "USD":
symbol = "$"
elif currency == "EUR":
symbol = u"€"
if locale == "en_US":
header = ("Date", "Descrip... | true | true |
f731ea57e184ee823c29cfdd9e927eb1b20e4e3c | 9,625 | py | Python | portality/api/v1/data_objects/article.py | glauberm/doaj | dc24dfcbf4a9f02ce5c9b09b611a5766ea5742f7 | [
"Apache-2.0"
] | null | null | null | portality/api/v1/data_objects/article.py | glauberm/doaj | dc24dfcbf4a9f02ce5c9b09b611a5766ea5742f7 | [
"Apache-2.0"
] | null | null | null | portality/api/v1/data_objects/article.py | glauberm/doaj | dc24dfcbf4a9f02ce5c9b09b611a5766ea5742f7 | [
"Apache-2.0"
] | null | null | null | from portality.lib import dataobj, swagger
from portality import models
from portality.util import normalise_issn
from copy import deepcopy
BASE_ARTICLE_STRUCT = {
"fields": {
"id": {"coerce": "unicode"}, # Note that we'll leave these in for ease of use by the
"created_date": {"coerc... | 40.611814 | 213 | 0.511896 | from portality.lib import dataobj, swagger
from portality import models
from portality.util import normalise_issn
from copy import deepcopy
BASE_ARTICLE_STRUCT = {
"fields": {
"id": {"coerce": "unicode"}, "created_date": {"coerce": "utcdatetime"}, # caller, but we'll need to ignore ... | true | true |
f731eaedc7007e19c5df89d50ff508da3dfd5341 | 1,892 | py | Python | test/benchmark/time_examples.py | jni/asv | f1ec1c157d52c77a799853062dac3468fab3e2ab | [
"BSD-3-Clause"
] | null | null | null | test/benchmark/time_examples.py | jni/asv | f1ec1c157d52c77a799853062dac3468fab3e2ab | [
"BSD-3-Clause"
] | 3 | 2018-07-26T17:56:30.000Z | 2018-07-27T20:23:27.000Z | test/benchmark/time_examples.py | jni/asv | f1ec1c157d52c77a799853062dac3468fab3e2ab | [
"BSD-3-Clause"
] | 3 | 2018-07-25T22:53:31.000Z | 2018-09-16T06:14:43.000Z | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
if sys.version_info[0] == 3:
xrange = range
import warnings
class TimeSuite:
sample_time = 0.1
... | 18.732673 | 67 | 0.598309 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
if sys.version_info[0] == 3:
xrange = range
import warnings
class TimeSuite:
sample_time = 0.1
def setup(self):
self.n = 100
def time_example_benchmark_1(self):
... | true | true |
f731eba05d25ea0e31730128b001cfb74e109186 | 2,039 | py | Python | env/bin/thresholder.py | tarasen1/Django-Agregator-Site | 6d873fa3e845776242bca150330754fc98f82f24 | [
"Apache-2.0"
] | null | null | null | env/bin/thresholder.py | tarasen1/Django-Agregator-Site | 6d873fa3e845776242bca150330754fc98f82f24 | [
"Apache-2.0"
] | null | null | null | env/bin/thresholder.py | tarasen1/Django-Agregator-Site | 6d873fa3e845776242bca150330754fc98f82f24 | [
"Apache-2.0"
] | null | null | null | #!/home/tarasen/Studying/3kurs/kursova/Django-Agregator-Site/env/bin/python3
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates how a 1-bit BitmapImage can be used
# as a dynamically updated overlay
#
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter as tkinter
fr... | 25.17284 | 79 | 0.59539 |
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter as tkinter
from PIL import Image, ImageTk
class UI(tkinter.Frame):
def __init__(self, master, im, value=128):
tkinter.Frame.__init__(self, master)
self.image = im
self.value = value
self.canvas... | true | true |
f731ebd92d3e6a4eb9b1d1ad5a0b1c60aa2b84c8 | 235 | py | Python | main.py | gesa23/ds1hw1 | fe69bcfd311467611a9534bbeaa7705ed95fafdb | [
"MIT"
] | null | null | null | main.py | gesa23/ds1hw1 | fe69bcfd311467611a9534bbeaa7705ed95fafdb | [
"MIT"
] | null | null | null | main.py | gesa23/ds1hw1 | fe69bcfd311467611a9534bbeaa7705ed95fafdb | [
"MIT"
] | null | null | null | from sklearn.datasets import load_iris
import pandas as pd
ds = load_iris()
df = pd.DataFrame(data= ds["data"], columns=ds["feature_names"])
target_names = [ds.target_names[x] for x in ds.target]
df['species'] = target_names
print(df) | 29.375 | 64 | 0.744681 | from sklearn.datasets import load_iris
import pandas as pd
ds = load_iris()
df = pd.DataFrame(data= ds["data"], columns=ds["feature_names"])
target_names = [ds.target_names[x] for x in ds.target]
df['species'] = target_names
print(df) | true | true |
f731ebf69d1b3147077df832bd6fc49c83be8a50 | 5,683 | py | Python | core/target_assigner.py | jacke121/MBMD | 2daf5edb4fb40ee652baead4f9332ca00fa111a5 | [
"MIT"
] | 220 | 2018-09-17T15:42:54.000Z | 2021-09-13T13:14:22.000Z | core/target_assigner.py | jacke121/MBMD | 2daf5edb4fb40ee652baead4f9332ca00fa111a5 | [
"MIT"
] | 12 | 2018-09-19T09:30:42.000Z | 2019-07-01T04:03:51.000Z | core/target_assigner.py | jacke121/MBMD | 2daf5edb4fb40ee652baead4f9332ca00fa111a5 | [
"MIT"
] | 60 | 2018-09-18T00:29:50.000Z | 2021-02-22T03:55:19.000Z | from object_detection.core.target_assigner import TargetAssigner
import tensorflow as tf
from object_detection.core import box_list
class TargetAssignerExtend(TargetAssigner):
def assign(self, anchors, groundtruth_boxes, groundtruth_labels=None,
**params):
"""Assign classification and regres... | 52.137615 | 96 | 0.656343 | from object_detection.core.target_assigner import TargetAssigner
import tensorflow as tf
from object_detection.core import box_list
class TargetAssignerExtend(TargetAssigner):
def assign(self, anchors, groundtruth_boxes, groundtruth_labels=None,
**params):
if not isinstance(anchors, box_list... | true | true |
f731efb7559b666c4a6065e41852c7907e2377e0 | 1,575 | py | Python | tuframework/training/network_training/nnUNet_variants/loss_function/nnUNetTrainerV2_Loss_TopK10.py | Magnety/tuFramework | b31cb34d476ef306b52da955021f93c91c14ddf4 | [
"Apache-2.0"
] | null | null | null | tuframework/training/network_training/nnUNet_variants/loss_function/nnUNetTrainerV2_Loss_TopK10.py | Magnety/tuFramework | b31cb34d476ef306b52da955021f93c91c14ddf4 | [
"Apache-2.0"
] | null | null | null | tuframework/training/network_training/nnUNet_variants/loss_function/nnUNetTrainerV2_Loss_TopK10.py | Magnety/tuFramework | b31cb34d476ef306b52da955021f93c91c14ddf4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 47.727273 | 114 | 0.780952 |
from tuframework.training.network_training.tuTrainerV2 import tuframeworkTrainerV2
from tuframework.training.loss_functions.TopK_loss import TopKLoss
class tuframeworkTrainerV2_Loss_TopK10(tuframeworkTrainerV2):
def __init__(self, plans_file, fold, output_folder=None, dataset_directory=None, batch_dice=True, st... | true | true |
f731f193fe6801caeef3fb2dbd500edd4a60f9c2 | 966 | py | Python | projects/controllers/experiments/runs/metrics.py | dnlcesilva/projects | 8e367d502aa0ffe3ed29f767d6ab039e6bee282f | [
"Apache-2.0"
] | 1 | 2021-06-26T19:13:49.000Z | 2021-06-26T19:13:49.000Z | projects/controllers/experiments/runs/metrics.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | null | null | null | projects/controllers/experiments/runs/metrics.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Experiments Metrics controller."""
import platiagro
from projects.exceptions import NotFound
class MetricController:
def __init__(self, session):
self.session = session
def list_metrics(self, project_id: str, experiment_id: str, run_id: str, operator_id: str):
"""
... | 27.6 | 95 | 0.55176 | import platiagro
from projects.exceptions import NotFound
class MetricController:
def __init__(self, session):
self.session = session
def list_metrics(self, project_id: str, experiment_id: str, run_id: str, operator_id: str):
try:
return platiagro.list_metrics(experiment_id=exper... | true | true |
f731f1cac8881b492f15feffbb5c895e2bfc8902 | 13,143 | py | Python | diffusion_logic.py | marklr/vqgan-clip-app | 23edb7ae6234ab177a91865c02be160151fcf566 | [
"MIT"
] | null | null | null | diffusion_logic.py | marklr/vqgan-clip-app | 23edb7ae6234ab177a91865c02be160151fcf566 | [
"MIT"
] | null | null | null | diffusion_logic.py | marklr/vqgan-clip-app | 23edb7ae6234ab177a91865c02be160151fcf566 | [
"MIT"
] | null | null | null | import clip
import sys
import torch
from torchvision import transforms
from torchvision.transforms import functional as TF
from kornia import augmentation, filters
from torch import nn
from torch.nn import functional as F
import math
import lpips
from PIL import Image
sys.path.append("./guided-diffusion")
from guided... | 37.338068 | 104 | 0.575668 | import clip
import sys
import torch
from torchvision import transforms
from torchvision.transforms import functional as TF
from kornia import augmentation, filters
from torch import nn
from torch.nn import functional as F
import math
import lpips
from PIL import Image
sys.path.append("./guided-diffusion")
from guided... | true | true |
f731f4063b2323508a137e94df93708a25ff3792 | 11,583 | py | Python | evap/contributor/views.py | JannisBerndt/EvaP | a3ca8bcf091e811421084c4db14ae9666cf2a27f | [
"MIT"
] | 26 | 2015-01-18T18:01:57.000Z | 2018-10-12T14:37:15.000Z | evap/contributor/views.py | JannisBerndt/EvaP | a3ca8bcf091e811421084c4db14ae9666cf2a27f | [
"MIT"
] | 737 | 2015-01-02T17:43:25.000Z | 2018-12-10T20:45:10.000Z | evap/contributor/views.py | JannisBerndt/EvaP | a3ca8bcf091e811421084c4db14ae9666cf2a27f | [
"MIT"
] | 83 | 2015-01-14T12:39:41.000Z | 2018-10-29T16:36:43.000Z | from django.contrib import messages
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.db import IntegrityError, transaction
from django.db.models import Exists, Max, OuterRef, Q
from django.forms.models import inlineformset_factory
from django.shortcuts import get_object_or_404, redir... | 39 | 131 | 0.723388 | from django.contrib import messages
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.db import IntegrityError, transaction
from django.db.models import Exists, Max, OuterRef, Q
from django.forms.models import inlineformset_factory
from django.shortcuts import get_object_or_404, redir... | true | true |
f731f40f8cf167eb9de4c3331309f87f3f6d2a1d | 882 | py | Python | tests/test_deep/test_agents/test_a2c.py | Zeus3101/genrl | 03e7f693ede98b2afbcb3fc8505f8a2bc4eedffc | [
"MIT"
] | 1 | 2020-06-13T15:21:57.000Z | 2020-06-13T15:21:57.000Z | tests/test_deep/test_agents/test_a2c.py | Zeus3101/genrl | 03e7f693ede98b2afbcb3fc8505f8a2bc4eedffc | [
"MIT"
] | null | null | null | tests/test_deep/test_agents/test_a2c.py | Zeus3101/genrl | 03e7f693ede98b2afbcb3fc8505f8a2bc4eedffc | [
"MIT"
] | 2 | 2020-06-13T15:29:06.000Z | 2021-08-20T15:48:53.000Z | import shutil
from genrl.agents import A2C
from genrl.environments import VectorEnv
from genrl.trainers import OnPolicyTrainer
def test_a2c():
env = VectorEnv("CartPole-v0", 1)
algo = A2C("mlp", env, rollout_size=128)
trainer = OnPolicyTrainer(algo, env, log_mode=["csv"], logdir="./logs", epochs=1)
t... | 29.4 | 85 | 0.666667 | import shutil
from genrl.agents import A2C
from genrl.environments import VectorEnv
from genrl.trainers import OnPolicyTrainer
def test_a2c():
env = VectorEnv("CartPole-v0", 1)
algo = A2C("mlp", env, rollout_size=128)
trainer = OnPolicyTrainer(algo, env, log_mode=["csv"], logdir="./logs", epochs=1)
t... | true | true |
f731f473beaac8baa64a2a5996f9d8e18231c089 | 12,612 | py | Python | tests/cic_test.py | jurreht/cic | 95a5e32eeb26da8d18642add2259f164426e1a25 | [
"MIT"
] | null | null | null | tests/cic_test.py | jurreht/cic | 95a5e32eeb26da8d18642add2259f164426e1a25 | [
"MIT"
] | null | null | null | tests/cic_test.py | jurreht/cic | 95a5e32eeb26da8d18642add2259f164426e1a25 | [
"MIT"
] | null | null | null | import os
import numpy as np
from numpy.testing import assert_allclose
import pytest
import scipy.io
import scipy.stats
import cic
def cases():
"""
Loads all filenames of the pre-calculated test cases.
"""
case_dir = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'cases'
... | 37.20354 | 85 | 0.530526 | import os
import numpy as np
from numpy.testing import assert_allclose
import pytest
import scipy.io
import scipy.stats
import cic
def cases():
case_dir = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'cases'
)
cases = []
for dir_path, _, files in os.walk(case_dir):
... | true | true |
f731f50ee094446322139452ad53777186ce7f20 | 15,626 | py | Python | Servidor/ServidorMusa.py | TheSgtPepper23/Musa | ed670b9052bbd37b3ed229b7e9d8307b89cb8ac2 | [
"MIT"
] | null | null | null | Servidor/ServidorMusa.py | TheSgtPepper23/Musa | ed670b9052bbd37b3ed229b7e9d8307b89cb8ac2 | [
"MIT"
] | null | null | null | Servidor/ServidorMusa.py | TheSgtPepper23/Musa | ed670b9052bbd37b3ed229b7e9d8307b89cb8ac2 | [
"MIT"
] | null | null | null | from flask import *
from peewee import *
import sys
from playhouse.shortcuts import model_to_dict, dict_to_model
from base64 import b64encode
app = Flask(__name__)
musa_db = MySQLDatabase(
"musa", host="localhost", port=3306, user="euterpe", passwd="An6248322")
class MySQLModel(Model):
"""Database model"""
... | 33.822511 | 148 | 0.651222 | from flask import *
from peewee import *
import sys
from playhouse.shortcuts import model_to_dict, dict_to_model
from base64 import b64encode
app = Flask(__name__)
musa_db = MySQLDatabase(
"musa", host="localhost", port=3306, user="euterpe", passwd="An6248322")
class MySQLModel(Model):
class Meta:
da... | true | true |
f731f62c057be653547c98aaf27b9d20dd30444f | 8,308 | py | Python | alipay/aop/api/domain/HealthServiceFamilyDoctorDrugDTO.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/HealthServiceFamilyDoctorDrugDTO.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/HealthServiceFamilyDoctorDrugDTO.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class HealthServiceFamilyDoctorDrugDTO(object):
def __init__(self):
self._catalogue_listed = None
self._dosage_forms = None
self._drug_classification = None
self._genera... | 35.20339 | 103 | 0.630958 | import json
from alipay.aop.api.constant.ParamConstants import *
class HealthServiceFamilyDoctorDrugDTO(object):
def __init__(self):
self._catalogue_listed = None
self._dosage_forms = None
self._drug_classification = None
self._general_name = None
self._inventory = None
... | true | true |
f731f6480135c9b24ffbeee3ad28a14744c53924 | 35,263 | py | Python | shap/explainers/_deep/deep_tf.py | hannesdm/shap | ae96bef7879f47978c8a436ebf19c2f2747cd887 | [
"MIT"
] | null | null | null | shap/explainers/_deep/deep_tf.py | hannesdm/shap | ae96bef7879f47978c8a436ebf19c2f2747cd887 | [
"MIT"
] | null | null | null | shap/explainers/_deep/deep_tf.py | hannesdm/shap | ae96bef7879f47978c8a436ebf19c2f2747cd887 | [
"MIT"
] | null | null | null | import numpy as np
import warnings
from .._explainer import Explainer
from packaging import version
from ..tf_utils import _get_session, _get_graph, _get_model_inputs, _get_model_output
keras = None
tf = None
tf_ops = None
tf_backprop = None
tf_execute = None
tf_gradients_impl = None
def custom_record_gradient(op_name... | 45.208974 | 198 | 0.636588 | import numpy as np
import warnings
from .._explainer import Explainer
from packaging import version
from ..tf_utils import _get_session, _get_graph, _get_model_inputs, _get_model_output
keras = None
tf = None
tf_ops = None
tf_backprop = None
tf_execute = None
tf_gradients_impl = None
def custom_record_gradient(op_name... | true | true |
f731f68560aa545d23d46048a4fc173d215dc10a | 4,303 | py | Python | Univ_individual_files/133_uni_tech_sydney.py | srsarangi/univscanner | 8735628690f7f50662ee5abf14ac1d27a657b613 | [
"Apache-2.0"
] | null | null | null | Univ_individual_files/133_uni_tech_sydney.py | srsarangi/univscanner | 8735628690f7f50662ee5abf14ac1d27a657b613 | [
"Apache-2.0"
] | null | null | null | Univ_individual_files/133_uni_tech_sydney.py | srsarangi/univscanner | 8735628690f7f50662ee5abf14ac1d27a657b613 | [
"Apache-2.0"
] | 2 | 2021-05-18T07:50:15.000Z | 2021-05-18T11:16:04.000Z | import requests
import urllib.request
import time
import urllib
import re
import csv
import sys
from bs4 import BeautifulSoup
def uni_tech_sydney():
url = "https://www.uts.edu.au/about/faculty-engineering-and-information-technology/computer-science/school-computer-science-staff"
headers = {'User-Age... | 34.424 | 214 | 0.550314 | import requests
import urllib.request
import time
import urllib
import re
import csv
import sys
from bs4 import BeautifulSoup
def uni_tech_sydney():
url = "https://www.uts.edu.au/about/faculty-engineering-and-information-technology/computer-science/school-computer-science-staff"
headers = {'User-Age... | true | true |
f731f71d1eeb1bef0d1a1cfd91093af40b01de85 | 7,291 | py | Python | train.py | HustQBW/Single-Object-Localization | 3a6bd87cd75543f55eb3eed12b6d09475f05b8fd | [
"MIT"
] | 1 | 2021-12-21T16:14:21.000Z | 2021-12-21T16:14:21.000Z | train.py | HustQBW/Single-Object-Localization | 3a6bd87cd75543f55eb3eed12b6d09475f05b8fd | [
"MIT"
] | null | null | null | train.py | HustQBW/Single-Object-Localization | 3a6bd87cd75543f55eb3eed12b6d09475f05b8fd | [
"MIT"
] | null | null | null | from dataset import tiny_dataset
from bbox_codec import bbox_encode
from resnet50_base import Localization_net2
from torch.utils.data import DataLoader,random_split
import torch as t
import tqdm
from torch.utils.tensorboard import SummaryWriter
import torch.nn as nn
import torch.optim as optim
import argparse
from loss... | 38.57672 | 108 | 0.603758 | from dataset import tiny_dataset
from bbox_codec import bbox_encode
from resnet50_base import Localization_net2
from torch.utils.data import DataLoader,random_split
import torch as t
import tqdm
from torch.utils.tensorboard import SummaryWriter
import torch.nn as nn
import torch.optim as optim
import argparse
from loss... | true | true |
f731f79225b7db086a4396618b46b21004ef1931 | 7,642 | py | Python | armi/physics/neutronics/isotopicDepletion/isotopicDepletionInterface.py | albeanth/armi | 3755ffd2fcd1f7b6c557ef3e3f36126706a84c70 | [
"Apache-2.0"
] | null | null | null | armi/physics/neutronics/isotopicDepletion/isotopicDepletionInterface.py | albeanth/armi | 3755ffd2fcd1f7b6c557ef3e3f36126706a84c70 | [
"Apache-2.0"
] | null | null | null | armi/physics/neutronics/isotopicDepletion/isotopicDepletionInterface.py | albeanth/armi | 3755ffd2fcd1f7b6c557ef3e3f36126706a84c70 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 33.964444 | 110 | 0.691965 |
import collections
from armi import interfaces
from armi.nucDirectory import nuclideBases
from armi.nuclearDataIO import xsLibraries
from armi.physics.neutronics.isotopicDepletion.crossSectionTable import (
CrossSectionTable,
)
from armi.reactor import composites
from armi.reactor.flags import Flags
def isDeple... | true | true |
f731f79d2b20fb9001ff30e91ee5ab29fa4434c9 | 3,269 | py | Python | building_boundary/footprint.py | Geodan/building-boundary | d0eb88d99743af917568131e8609f481b10e4520 | [
"MIT"
] | 13 | 2018-12-14T05:34:48.000Z | 2021-12-23T13:32:51.000Z | building_boundary/footprint.py | Geodan/building-boundary | d0eb88d99743af917568131e8609f481b10e4520 | [
"MIT"
] | 20 | 2018-10-18T13:42:09.000Z | 2022-03-22T08:46:13.000Z | building_boundary/footprint.py | Geodan/building-boundary | d0eb88d99743af917568131e8609f481b10e4520 | [
"MIT"
] | 10 | 2018-09-28T20:01:30.000Z | 2020-11-30T17:40:19.000Z | # -*- coding: utf-8 -*-
"""
@author: Chris Lucas
"""
import math
import numpy as np
from shapely.geometry import (
Polygon, MultiPolygon, LineString, MultiLineString, LinearRing
)
from shapely import wkt
from building_boundary import utils
def line_orientations(lines):
"""
Computes the orientations of... | 29.718182 | 76 | 0.624962 |
import math
import numpy as np
from shapely.geometry import (
Polygon, MultiPolygon, LineString, MultiLineString, LinearRing
)
from shapely import wkt
from building_boundary import utils
def line_orientations(lines):
orientations = []
for l in lines:
dx, dy = l[0] - l[1]
orientation = m... | true | true |
f731f9a8d0502796635be32c92304f9df4b62384 | 25,546 | py | Python | nnunet/training/network_training/network_trainer.py | mangoyuan/Unifed-Seg3d | 74c82464dbe901cf18e38afb0e1b74cc159a8850 | [
"Apache-2.0"
] | null | null | null | nnunet/training/network_training/network_trainer.py | mangoyuan/Unifed-Seg3d | 74c82464dbe901cf18e38afb0e1b74cc159a8850 | [
"Apache-2.0"
] | null | null | null | nnunet/training/network_training/network_trainer.py | mangoyuan/Unifed-Seg3d | 74c82464dbe901cf18e38afb0e1b74cc159a8850 | [
"Apache-2.0"
] | null | null | null | from _warnings import warn
import matplotlib
from batchgenerators.utilities.file_and_folder_operations import *
from sklearn.model_selection import KFold
matplotlib.use("agg")
from time import time, sleep
import torch
import numpy as np
from torch.optim import lr_scheduler
import matplotlib.pyplot as plt
import sys
fro... | 41.605863 | 149 | 0.607257 | from _warnings import warn
import matplotlib
from batchgenerators.utilities.file_and_folder_operations import *
from sklearn.model_selection import KFold
matplotlib.use("agg")
from time import time, sleep
import torch
import numpy as np
from torch.optim import lr_scheduler
import matplotlib.pyplot as plt
import sys
fro... | true | true |
f731fa3b1b137c89eee62971f1b7005782a10a8c | 4,079 | py | Python | huaweicloud-sdk-rds/huaweicloudsdkrds/v3/model/list_postgresql_db_user_paginated_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-rds/huaweicloudsdkrds/v3/model/list_postgresql_db_user_paginated_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-rds/huaweicloudsdkrds/v3/model/list_postgresql_db_user_paginated_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ListPostgresqlDbUserPaginatedResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.725352 | 90 | 0.592792 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ListPostgresqlDbUserPaginatedResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'users': 'list[PostgresqlUserForList]',
... | true | true |
f731fa7e3673025c258022c3f2774631787e4331 | 3,643 | py | Python | partpipeline/parser.py | CIDARLAB/3DuF-server | 312da5e4dc3b6212db634ce6b0c0235d9779d27b | [
"BSD-3-Clause"
] | null | null | null | partpipeline/parser.py | CIDARLAB/3DuF-server | 312da5e4dc3b6212db634ce6b0c0235d9779d27b | [
"BSD-3-Clause"
] | null | null | null | partpipeline/parser.py | CIDARLAB/3DuF-server | 312da5e4dc3b6212db634ce6b0c0235d9779d27b | [
"BSD-3-Clause"
] | 3 | 2021-01-25T20:12:21.000Z | 2021-06-18T21:41:18.000Z | import json
import sys
from parchmint import Device
sys.path.append("/usr/lib/freecad-python3/lib")
import Draft
import FreeCAD
import Mesh
import Part
from threedprinting.components.box import Box
from threedprinting.components.connection import createConnection
from threedprinting.components.droplet import DropletG... | 30.358333 | 78 | 0.6437 | import json
import sys
from parchmint import Device
sys.path.append("/usr/lib/freecad-python3/lib")
import Draft
import FreeCAD
import Mesh
import Part
from threedprinting.components.box import Box
from threedprinting.components.connection import createConnection
from threedprinting.components.droplet import DropletG... | true | true |
f731fb049cc31abc6393352c8ef73b9b55622cf5 | 1,941 | py | Python | realtor/forms/staffCreation.py | franklin18ru/Indigo | ca559945de4724ea8d64af45a87d14b67740a146 | [
"MIT"
] | null | null | null | realtor/forms/staffCreation.py | franklin18ru/Indigo | ca559945de4724ea8d64af45a87d14b67740a146 | [
"MIT"
] | null | null | null | realtor/forms/staffCreation.py | franklin18ru/Indigo | ca559945de4724ea8d64af45a87d14b67740a146 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from realtor.models import Realtors, Positions
class Realtor(forms.ModelForm):
name = forms.CharField(required=True, widget=forms.TextInput(attrs={'class': 'form-control validate'}))
ema... | 32.898305 | 113 | 0.623905 | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from realtor.models import Realtors, Positions
class Realtor(forms.ModelForm):
name = forms.CharField(required=True, widget=forms.TextInput(attrs={'class': 'form-control validate'}))
ema... | true | true |
f731fb11331a48d87e7ec2442b5be6c0a5ed4a52 | 34,160 | py | Python | azure-mgmt-web/azure/mgmt/web/operations/global_model_operations.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-mgmt-web/azure/mgmt/web/operations/global_model_operations.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-mgmt-web/azure/mgmt/web/operations/global_model_operations.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... | 42.860728 | 140 | 0.666598 |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
from .. import models
class GlobalModelOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.