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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f756370ff38b779e9d5f94d06a038a158760e458 | 23,845 | py | Python | pypowervm/tests/utils/test_lpar_bldr.py | VedaAnnayappa/pypowervm | 266e5cb2f8725c63267b41b617ba5a1db2adadfa | [
"Apache-2.0"
] | null | null | null | pypowervm/tests/utils/test_lpar_bldr.py | VedaAnnayappa/pypowervm | 266e5cb2f8725c63267b41b617ba5a1db2adadfa | [
"Apache-2.0"
] | null | null | null | pypowervm/tests/utils/test_lpar_bldr.py | VedaAnnayappa/pypowervm | 266e5cb2f8725c63267b41b617ba5a1db2adadfa | [
"Apache-2.0"
] | null | null | null | # Copyright 2015, 2018 IBM Corp.
#
# 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 require... | 47.031558 | 79 | 0.636192 |
import uuid
import mock
import six
import testtools
from pypowervm.tests import test_fixtures as fx
from pypowervm.tests.test_utils import xml_sections
from pypowervm.utils import lpar_builder as lpar_bldr
import pypowervm.utils.uuid as pvm_uuid
from pypowervm.wrappers import base_partition as bp
from... | true | true |
f756384c8e1466b04778991d3f8f2463685017d2 | 975 | py | Python | indico/modules/cephalopod/__init__.py | salevajo/indico | 6f9cbabc20d1641caea907099388ae2b04965cf8 | [
"MIT"
] | 1 | 2021-12-27T17:51:27.000Z | 2021-12-27T17:51:27.000Z | indico/modules/cephalopod/__init__.py | salevajo/indico | 6f9cbabc20d1641caea907099388ae2b04965cf8 | [
"MIT"
] | 5 | 2021-04-08T19:26:47.000Z | 2022-01-24T16:30:18.000Z | indico/modules/cephalopod/__init__.py | salevajo/indico | 6f9cbabc20d1641caea907099388ae2b04965cf8 | [
"MIT"
] | 2 | 2019-02-24T17:29:10.000Z | 2021-04-08T19:23:27.000Z | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import session
from indico.core import signals
from indico.core.logger import Logger
from indi... | 27.857143 | 113 | 0.744615 |
from flask import session
from indico.core import signals
from indico.core.logger import Logger
from indico.core.settings import SettingsProxy
from indico.util.i18n import _
from indico.web.flask.util import url_for
from indico.web.menu import SideMenuItem
__all__ = ('logger', 'cephalopod_settings')
logger =... | true | true |
f75639d891b4b88505cbb675b4db4239614d5885 | 1,950 | py | Python | contrib/runners/mistral_v2/setup.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | contrib/runners/mistral_v2/setup.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 1 | 2020-03-19T23:45:59.000Z | 2020-03-19T23:45:59.000Z | contrib/runners/mistral_v2/setup.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Licen... | 35.454545 | 81 | 0.73641 |
from __future__ import absolute_import
import os.path
from setuptools import setup
from setuptools import find_packages
from dist_utils import fetch_requirements
from dist_utils import apply_vagrant_workaround
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
REQUIREMENTS_FILE = os.path.join(BASE... | true | true |
f7563a77cfe8f8ed57a93edf963a164235370e0c | 2,818 | py | Python | Bio/PopGen/SimCoal/Cache.py | zachcp/biopython | b31bbfee64da8b0fa9c63f29a26bc99b72c003de | [
"PostgreSQL"
] | 5 | 2016-03-09T03:41:23.000Z | 2022-01-24T12:34:44.000Z | Bio/PopGen/SimCoal/Cache.py | phillord/biopython | c8dfe46f192d6ccfac94b156cef024776545638e | [
"PostgreSQL"
] | null | null | null | Bio/PopGen/SimCoal/Cache.py | phillord/biopython | c8dfe46f192d6ccfac94b156cef024776545638e | [
"PostgreSQL"
] | 6 | 2016-10-24T11:27:13.000Z | 2020-02-26T16:35:01.000Z | # Copyright 2007 by Tiago Antao <tiagoantao@gmail.com>. All rights reserved.
"""
This module allows to cache Simcoal2 results, and return on the fly
in case the calculation was done.
"""
import os
import tarfile
from .Controller import SimCoalController
class SimCoalCache(object):
def __init__(self, data_dir,... | 32.022727 | 77 | 0.587296 |
import os
import tarfile
from .Controller import SimCoalController
class SimCoalCache(object):
def __init__(self, data_dir, simcoal_dir):
self.dataDir = data_dir
self.cacheDir = os.sep.join([data_dir, 'SimCoal', 'cache'])
self.simcoalDir = simcoal_dir
def run_simcoal(self, par_file... | true | true |
f7563a7b2c825604ac5e3c7398303973bb140d68 | 15,599 | py | Python | examples/mount_virtual_media.py | huiyudwmd/python-redfish-lenovo | 035f9606f2df6c939b0bae0002e3a4a3dff8895d | [
"Apache-2.0"
] | null | null | null | examples/mount_virtual_media.py | huiyudwmd/python-redfish-lenovo | 035f9606f2df6c939b0bae0002e3a4a3dff8895d | [
"Apache-2.0"
] | null | null | null | examples/mount_virtual_media.py | huiyudwmd/python-redfish-lenovo | 035f9606f2df6c939b0bae0002e3a4a3dff8895d | [
"Apache-2.0"
] | null | null | null | ###
#
# Lenovo Redfish examples - Insert vitual media
#
# Copyright Notice:
#
# Copyright 2019 Lenovo 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.or... | 51.82392 | 216 | 0.594269 |
mport sys
import redfish
import json
import traceback
import lenovo_utils as utils
def mount_virtual_media(ip, login_account, login_password, fsprotocol, fsip, fsport, fsusername, fspassword, image, fsdir, inserted=True, writeprotocol=True):
result = {}
login_host = "https://" + ip
... | true | true |
f7563b19f21846cdbf55ce9ef7a1cbca61f76cd5 | 3,998 | py | Python | runs/cylinder2dRe40/scripts/plot_pressure_coefficients.py | mesnardo/petibm-decoupledibpm | 675615a882cc8418b15a34e1100ccfb421f1d9d1 | [
"BSD-3-Clause"
] | null | null | null | runs/cylinder2dRe40/scripts/plot_pressure_coefficients.py | mesnardo/petibm-decoupledibpm | 675615a882cc8418b15a34e1100ccfb421f1d9d1 | [
"BSD-3-Clause"
] | null | null | null | runs/cylinder2dRe40/scripts/plot_pressure_coefficients.py | mesnardo/petibm-decoupledibpm | 675615a882cc8418b15a34e1100ccfb421f1d9d1 | [
"BSD-3-Clause"
] | null | null | null | """Plot the surface pressure coefficient at final time step."""
from matplotlib import pyplot
import numpy
import pathlib
import petibmpy
import rodney
def get_pressure(simudir, timestep):
name = 'p' # name of the field variable to load
datadir = simudir / 'output'
# Load the gridlines from file.
... | 33.596639 | 73 | 0.663582 |
from matplotlib import pyplot
import numpy
import pathlib
import petibmpy
import rodney
def get_pressure(simudir, timestep):
name = 'p'
datadir = simudir / 'output'
filepath = datadir / 'grid.h5'
x, y = petibmpy.read_grid_hdf5(filepath, name)
filepath = datadir / f'{timestep:0>7}.h5... | true | true |
f7563b1bedd1179310a8d648d13c9c8388a9a5bf | 583 | py | Python | parcellearning/fn/ops.py | kristianeschenburg/parcellearning | 93811f7d11c1c5583d8f541c7629dbbaa1785304 | [
"BSD-3-Clause"
] | 6 | 2017-07-03T23:11:29.000Z | 2022-01-04T16:41:57.000Z | parcellearning/fn/ops.py | kristianeschenburg/parcellearning | 93811f7d11c1c5583d8f541c7629dbbaa1785304 | [
"BSD-3-Clause"
] | null | null | null | parcellearning/fn/ops.py | kristianeschenburg/parcellearning | 93811f7d11c1c5583d8f541c7629dbbaa1785304 | [
"BSD-3-Clause"
] | 1 | 2018-04-24T18:01:19.000Z | 2018-04-24T18:01:19.000Z | import torch
import dgl
def cosine(nodes):
"""
Compute the cosine distance between all pairs of nodes adjacent on a source node.
"""
# ```m``` is a matrix of N nodes x E edges x F features
# representing the messages incident on source nodes with E edges
m = nodes.mailbox['m']
N = m.shap... | 21.592593 | 85 | 0.571184 | import torch
import dgl
def cosine(nodes):
m = nodes.mailbox['m']
N = m.shape[1]
N = (N*(N-1))/2
if m.ndim > 3:
m = m.transpose(1,2)
e = torch.matmul(m, m.transpose(2, 3))
else:
e = torch.matmul(m, m.transpose(1,2))
e = torch.triu(e, diagonal=1).sum(-1).su... | true | true |
f7563b41f209bd1cdbc4f6fe13071e9969093e89 | 5,340 | py | Python | UnoCPI/settings.py | Goutham2591/mav-cpi | 3f7985d2a7bf57c08a1ff65bc14a8e60c3d0464b | [
"MIT"
] | null | null | null | UnoCPI/settings.py | Goutham2591/mav-cpi | 3f7985d2a7bf57c08a1ff65bc14a8e60c3d0464b | [
"MIT"
] | 7 | 2020-02-11T23:38:26.000Z | 2022-01-13T01:02:45.000Z | UnoCPI/settings.py | Goutham2591/mav-cpi | 3f7985d2a7bf57c08a1ff65bc14a8e60c3d0464b | [
"MIT"
] | null | null | null | """
Django settings for UnoCPI project.
Generated by 'django-admin startproject' using Django 2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
from dj... | 26.176471 | 91 | 0.703371 |
import os
from django.contrib.messages import constants as messages
import dj_database_url
from django.urls import reverse_lazy
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = ')z8d*5_%@v!h@bl3-vl2gn@mwcd@6vlz061+b=o02jc5@2r1gg'
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDE... | true | true |
f7563b8073a6ef1c297d38e03733e179c29d689f | 199,887 | py | Python | CloudStack/Client.py | lcosmin/cloudstack-python-client | 7bafbb4bb4a78834e712ce61437988eeac9b16b0 | [
"MIT"
] | 21 | 2015-01-15T10:37:45.000Z | 2019-06-03T09:34:36.000Z | CloudStack/Client.py | lcosmin/cloudstack-python-client | 7bafbb4bb4a78834e712ce61437988eeac9b16b0 | [
"MIT"
] | 1 | 2015-04-22T23:48:19.000Z | 2015-04-22T23:48:19.000Z | CloudStack/Client.py | lcosmin/cloudstack-python-client | 7bafbb4bb4a78834e712ce61437988eeac9b16b0 | [
"MIT"
] | 23 | 2015-01-27T05:34:57.000Z | 2020-07-27T00:42:20.000Z | from BaseClient import BaseClient
class Client(BaseClient):
def createNetworkOffering(self, args={}):
'''
Creates a network offering.
args - A dictionary. The following are options for keys:
displaytext - the display text of the network offering
guestiptype - guest ... | 38.722782 | 95 | 0.609124 | from BaseClient import BaseClient
class Client(BaseClient):
def createNetworkOffering(self, args={}):
if not 'displaytext' in args:
raise RuntimeError("Missing required argument 'displaytext'")
if not 'guestiptype' in args:
raise RuntimeError("Missing required argument 'gues... | true | true |
f7563c6ba352172c4260a046582f2e17a1cdfcc2 | 3,479 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_pipeline_kind.py | jjasonkal/polyaxon | 8454b29b2b971b965de8a7bf63afdd48f07d6d53 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_pipeline_kind.py | jjasonkal/polyaxon | 8454b29b2b971b965de8a7bf63afdd48f07d6d53 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_pipeline_kind.py | jjasonkal/polyaxon | 8454b29b2b971b965de8a7bf63afdd48f07d6d53 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 29.483051 | 85 | 0.598735 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1PipelineKind(object):
DAG = "dag"
PARALLEL = "parallel"
allowable_values = [DAG, PARALLEL]
openapi_types = {}
attribute_map = {}
def __init__(self, local_vars_configur... | true | true |
f7563e6d4a79f334bb77d62bbe3f62f76d1bd750 | 11,199 | py | Python | src/python/autotransform/scripts/commands/settings.py | nathro/AutoTransform | 04ef5458bc8401121e33370ceda6ef638e535e9a | [
"MIT"
] | 11 | 2022-01-02T00:50:24.000Z | 2022-02-22T00:30:09.000Z | src/python/autotransform/scripts/commands/settings.py | nathro/AutoTransform | 04ef5458bc8401121e33370ceda6ef638e535e9a | [
"MIT"
] | 6 | 2022-01-06T01:45:34.000Z | 2022-02-03T21:49:52.000Z | src/python/autotransform/scripts/commands/settings.py | nathro/AutoTransform | 04ef5458bc8401121e33370ceda6ef638e535e9a | [
"MIT"
] | null | null | null | # AutoTransform
# Large scale, component based code modification library
#
# Licensed under the MIT License <http://opensource.org/licenses/MIT>
# SPDX-License-Identifier: MIT
# Copyright (c) 2022-present Nathan Rockenbach <http://github.com/nathro>
# @black_format
"""The settings command is used to update AutoTransf... | 35.216981 | 100 | 0.657648 |
import json
import os
from argparse import ArgumentParser, Namespace
from typing import Dict, List
from autotransform.config.config import Config
from autotransform.config.default import DefaultConfigFetcher
from autotransform.schema.schema import AutoTransformSchema
from autotransform.util.component import ... | true | true |
f7563e6eee86d73dd1073658c63b913763d4c15f | 795 | py | Python | tests/test_data_utils/test_du_deep_image.py | jin530/pytorch-widedeep | 4ff1008ba6c62e64383267c924cfd3cf3cbc609c | [
"MIT"
] | null | null | null | tests/test_data_utils/test_du_deep_image.py | jin530/pytorch-widedeep | 4ff1008ba6c62e64383267c924cfd3cf3cbc609c | [
"MIT"
] | null | null | null | tests/test_data_utils/test_du_deep_image.py | jin530/pytorch-widedeep | 4ff1008ba6c62e64383267c924cfd3cf3cbc609c | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
from pytorch_widedeep.preprocessing import ImagePreprocessor
full_path = os.path.realpath(__file__)
path = os.path.split(full_path)[0]
df = pd.DataFrame({"galaxies": ["galaxy1.png", "galaxy2.png"]})
img_col = "galaxies"
imd_dir = os.path.join(path, "images")
processor... | 33.125 | 81 | 0.596226 | import numpy as np
import pandas as pd
import os
from pytorch_widedeep.preprocessing import ImagePreprocessor
full_path = os.path.realpath(__file__)
path = os.path.split(full_path)[0]
df = pd.DataFrame({"galaxies": ["galaxy1.png", "galaxy2.png"]})
img_col = "galaxies"
imd_dir = os.path.join(path, "images")
processor... | true | true |
f7563f2cbd5e6e7de7db2416da9236a4e05bc67a | 119 | py | Python | whereami_server/context_processors.py | martilidad/whereami_server | 35455632cae43dbce2a8be148c57c66946b0f413 | [
"MIT"
] | 1 | 2020-05-13T11:46:29.000Z | 2020-05-13T11:46:29.000Z | whereami_server/context_processors.py | martilidad/whereami_server | 35455632cae43dbce2a8be148c57c66946b0f413 | [
"MIT"
] | 40 | 2020-05-11T20:01:59.000Z | 2022-03-19T21:58:32.000Z | whereami_server/context_processors.py | martilidad/whereami_server | 35455632cae43dbce2a8be148c57c66946b0f413 | [
"MIT"
] | null | null | null | from whereami_server.version import GIT_SHA
def version(request):
return {
'version': GIT_SHA
} | 17 | 44 | 0.638655 | from whereami_server.version import GIT_SHA
def version(request):
return {
'version': GIT_SHA
} | true | true |
f7563f34ae7c1ec57ed0d60160f2041ec5509d0e | 7,527 | py | Python | src/oci/object_storage/models/work_request_resource.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/object_storage/models/work_request_resource.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/object_storage/models/work_request_resource.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32.584416 | 245 | 0.650857 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class WorkRequestResource(object):
ACTION_TYPE_CREATED = "CREATED"
ACTION_TYPE_UPDATED = "UPDATED"
... | true | true |
f7563fa2a695f9616f7b0a106d3c2617a7ab5cc3 | 1,020 | py | Python | mesos_slave/tests/conftest.py | jstoja/integrations-core | 704fa31f7db642c6df9e0969b3b2778fc6144fa7 | [
"BSD-3-Clause"
] | null | null | null | mesos_slave/tests/conftest.py | jstoja/integrations-core | 704fa31f7db642c6df9e0969b3b2778fc6144fa7 | [
"BSD-3-Clause"
] | null | null | null | mesos_slave/tests/conftest.py | jstoja/integrations-core | 704fa31f7db642c6df9e0969b3b2778fc6144fa7 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T13:35:17.000Z | 2019-12-23T13:35:17.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import pytest
from datadog_checks.dev import docker_run
from datadog_checks.mesos_slave import MesosSlave
from . import common
from .utils import read_fixture
@pytest.fixture(scope='sess... | 22.173913 | 98 | 0.746078 |
import json
import os
import pytest
from datadog_checks.dev import docker_run
from datadog_checks.mesos_slave import MesosSlave
from . import common
from .utils import read_fixture
@pytest.fixture(scope='session')
def dd_environment():
compose_file = os.path.join(common.HERE, 'compose', 'docker-compose.yml'... | true | true |
f756404ab4ffae855c0dc8ddf914377a00deab3b | 2,504 | py | Python | ivy/functional/ivy/activations.py | AbdulRafay98/ivy | 308a5397e5be81534bf31eb2a1ed8ba3a3bc8b87 | [
"Apache-2.0"
] | null | null | null | ivy/functional/ivy/activations.py | AbdulRafay98/ivy | 308a5397e5be81534bf31eb2a1ed8ba3a3bc8b87 | [
"Apache-2.0"
] | null | null | null | ivy/functional/ivy/activations.py | AbdulRafay98/ivy | 308a5397e5be81534bf31eb2a1ed8ba3a3bc8b87 | [
"Apache-2.0"
] | null | null | null | """
Collection of Ivy activation functions.
"""
# global
from typing import Union
# local
import ivy
from ivy.framework_handler import current_framework as _cur_framework
# Extra #
# ------#
def relu(x: Union[ivy.Array, ivy.NativeArray])\
-> ivy.Array:
"""
Applies the rectified linear unit function... | 22.558559 | 115 | 0.645767 |
from typing import Union
import ivy
from ivy.framework_handler import current_framework as _cur_framework
def relu(x: Union[ivy.Array, ivy.NativeArray])\
-> ivy.Array:
return _cur_framework(x).relu(x)
def leaky_relu(x, alpha=0.2):
return _cur_framework(x).leaky_relu(x, alpha)
def gelu(x, appr... | true | true |
f756416b92cd16553488842fdf9f9993591ff223 | 5,295 | py | Python | src/starlingpy/StarlingClass.py | ethansimpson285/StarlingPy | 0afba0444b695c431227f4e28d6d3edde5b56af7 | [
"MIT"
] | null | null | null | src/starlingpy/StarlingClass.py | ethansimpson285/StarlingPy | 0afba0444b695c431227f4e28d6d3edde5b56af7 | [
"MIT"
] | null | null | null | src/starlingpy/StarlingClass.py | ethansimpson285/StarlingPy | 0afba0444b695c431227f4e28d6d3edde5b56af7 | [
"MIT"
] | null | null | null | from requests import get
import datetime
import pandas as pd
from starlingpy.StarlingAPIs import Account_APIs
BASE_PATH = "https://api.starlingbank.com/api/v2/"
class TransactionHistory:
"""
A history of transactions associated with the Starling account, between stipulated datetimes.
Requires the Sta... | 31.331361 | 161 | 0.654391 | from requests import get
import datetime
import pandas as pd
from starlingpy.StarlingAPIs import Account_APIs
BASE_PATH = "https://api.starlingbank.com/api/v2/"
class TransactionHistory:
def __init__(self,Account,**kwargs):
self.associated_Account = Account
output = Account.get_transact... | true | true |
f75642e4fe88122886e02dd215674ddd5b43d135 | 1,604 | py | Python | handlers/login.py | cstieg/Multi-User-Blog | bbc791910aed4fb3845f50c4fb267d7733290421 | [
"MIT"
] | null | null | null | handlers/login.py | cstieg/Multi-User-Blog | bbc791910aed4fb3845f50c4fb267d7733290421 | [
"MIT"
] | null | null | null | handlers/login.py | cstieg/Multi-User-Blog | bbc791910aed4fb3845f50c4fb267d7733290421 | [
"MIT"
] | null | null | null | import models, handlers
class Login(handlers.Handler):
"""Allows registered user to login"""
def get(self):
"""Renders login page"""
caller = handlers.sanitize(self.request.get('caller'))
self.render('login.html', caller=caller)
def post(self):
"""Accepts login info from lo... | 36.454545 | 89 | 0.662095 | import models, handlers
class Login(handlers.Handler):
def get(self):
caller = handlers.sanitize(self.request.get('caller'))
self.render('login.html', caller=caller)
def post(self):
caller = handlers.sanitize(self.request.get('caller'))
username = handlers.sanitize(self.request... | true | true |
f7564333907e8fb62bad663af8e21c83b5adda21 | 4,094 | py | Python | basset/basset_ios.py | team-supercharge/basset-ios | 8336eb2df0d03fe184c7fd14843c8facd471607d | [
"MIT"
] | null | null | null | basset/basset_ios.py | team-supercharge/basset-ios | 8336eb2df0d03fe184c7fd14843c8facd471607d | [
"MIT"
] | null | null | null | basset/basset_ios.py | team-supercharge/basset-ios | 8336eb2df0d03fe184c7fd14843c8facd471607d | [
"MIT"
] | null | null | null | import argparse
import logging
import sys
import time
import coloredlogs
from basset.helpers.configuration_manager import ConfigurationManager
from basset.helpers.converter import Converter
from basset.helpers.extractor import Extractor
from basset.helpers.merger import Merger
from basset.exceptions import *
class ... | 45.488889 | 129 | 0.643136 | import argparse
import logging
import sys
import time
import coloredlogs
from basset.helpers.configuration_manager import ConfigurationManager
from basset.helpers.converter import Converter
from basset.helpers.extractor import Extractor
from basset.helpers.merger import Merger
from basset.exceptions import *
class ... | true | true |
f7564399d394de5b1d15df22eca8eeb5a5c533b1 | 925 | py | Python | gpscraper/headers.py | alverelt/gpscraper | 9c0322d1b8f0c70786bd15512746650b6c4d9ded | [
"MIT"
] | 1 | 2021-06-09T05:15:49.000Z | 2021-06-09T05:15:49.000Z | gpscraper/headers.py | alverelt/gpscraper | 9c0322d1b8f0c70786bd15512746650b6c4d9ded | [
"MIT"
] | 1 | 2021-07-30T21:30:31.000Z | 2021-08-10T21:15:53.000Z | gpscraper/headers.py | alverelt/gpscraper | 9c0322d1b8f0c70786bd15512746650b6c4d9ded | [
"MIT"
] | null | null | null | GET = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3',
'Connection': 'keep-alive',
'Host': 'play.google.com',
'Upgrade-Insecure-Requests': '1',
'User-Age... | 38.541667 | 97 | 0.597838 | GET = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3',
'Connection': 'keep-alive',
'Host': 'play.google.com',
'Upgrade-Insecure-Requests': '1',
'User-Age... | true | true |
f75644498867f1aa945af30741f5576d625d5285 | 1,464 | py | Python | machine-learning-algorithms/reducao-rbm.py | RichardOkubo/DS-Scripts | adf3845802b52e8901d381ffff60f9c1276dabe1 | [
"MIT"
] | null | null | null | machine-learning-algorithms/reducao-rbm.py | RichardOkubo/DS-Scripts | adf3845802b52e8901d381ffff60f9c1276dabe1 | [
"MIT"
] | null | null | null | machine-learning-algorithms/reducao-rbm.py | RichardOkubo/DS-Scripts | adf3845802b52e8901d381ffff60f9c1276dabe1 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets, metrics
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from sklearn.neural_network import BernoulliRBM
from sklearn.naive_bayes import GaussianNB
from sklearn.pipeline import Pipeline
b... | 36.6 | 146 | 0.804645 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets, metrics
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from sklearn.neural_network import BernoulliRBM
from sklearn.naive_bayes import GaussianNB
from sklearn.pipeline import Pipeline
b... | true | true |
f75644643ee75a0d1d5c4ec9247bb491e659dac0 | 4,565 | py | Python | rllib/examples/remote_vector_env_with_custom_api.py | 77loopin/ray | 9322f6aab53f4ca5baf5a3573e1ffde12feae519 | [
"Apache-2.0"
] | 1 | 2022-01-10T07:41:17.000Z | 2022-01-10T07:41:17.000Z | rllib/examples/remote_vector_env_with_custom_api.py | 77loopin/ray | 9322f6aab53f4ca5baf5a3573e1ffde12feae519 | [
"Apache-2.0"
] | 61 | 2021-01-30T08:05:55.000Z | 2022-03-26T07:06:15.000Z | rllib/examples/remote_vector_env_with_custom_api.py | 77loopin/ray | 9322f6aab53f4ca5baf5a3573e1ffde12feae519 | [
"Apache-2.0"
] | 1 | 2021-05-19T03:08:37.000Z | 2021-05-19T03:08:37.000Z | """
This script demonstrates how one can specify custom env APIs in
combination with RLlib's `remote_worker_envs` setting, which
parallelizes individual sub-envs within a vector env by making each
one a ray Actor.
You can access your Env's API via a custom callback as shown below.
"""
import argparse
import gym
import... | 32.607143 | 77 | 0.667689 | import argparse
import gym
import os
import ray
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rllib.env.apis.task_settable_env import TaskSettableEnv
from ray.rllib.utils.test_utils import check_learning_achieved
from ray import tune
parser = argparse.ArgumentParser()
parser.add_argument(
"--ru... | true | true |
f756448235c5fd3bf4bbe999eb650e4235627436 | 1,495 | py | Python | DevNetworkPython/main.py | ManikHossain08/Metrics-Extraction-from-GitHub-MSR_Python | b846c8ea6d37246af1c202466b60c15d06c5ba8b | [
"MIT"
] | 1 | 2020-06-13T22:30:17.000Z | 2020-06-13T22:30:17.000Z | DevNetworkPython/main.py | ManikHossain08/Metrics-Extraction-from-GitHub-MSR | b846c8ea6d37246af1c202466b60c15d06c5ba8b | [
"MIT"
] | null | null | null | DevNetworkPython/main.py | ManikHossain08/Metrics-Extraction-from-GitHub-MSR | b846c8ea6d37246af1c202466b60c15d06c5ba8b | [
"MIT"
] | null | null | null | import os
import shutil
import git
import yaml
from configuration import Configuration
from repoLoader import getRepo
from aliasWorker import replaceAliases
from commitAnalysis import commitAnalysis
from centralityAnalysis import centralityAnalysis
from tagAnalysis import tagAnalysis
def main():
tr... | 28.207547 | 70 | 0.640134 | import os
import shutil
import git
import yaml
from configuration import Configuration
from repoLoader import getRepo
from aliasWorker import replaceAliases
from commitAnalysis import commitAnalysis
from centralityAnalysis import centralityAnalysis
from tagAnalysis import tagAnalysis
def main():
tr... | true | true |
f75644838540a24c9f13202569c7db8aa1446291 | 72 | py | Python | BinaryTimeseries/__init__.py | jonathanschilling/BinaryTimeseries | e8d6009f36699e22e61100f86a059b49c3a659e6 | [
"Apache-2.0"
] | 1 | 2020-03-20T23:35:50.000Z | 2020-03-20T23:35:50.000Z | BinaryTimeseries/__init__.py | jonathanschilling/BinaryTimeseries | e8d6009f36699e22e61100f86a059b49c3a659e6 | [
"Apache-2.0"
] | 1 | 2021-03-29T14:33:07.000Z | 2021-03-29T14:33:07.000Z | BinaryTimeseries/__init__.py | jonathanschilling/BinaryTimeseries | e8d6009f36699e22e61100f86a059b49c3a659e6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from .BinaryTimeseries import BinaryTimeseries
| 18 | 46 | 0.722222 |
from .BinaryTimeseries import BinaryTimeseries
| true | true |
f75644b0294403ffc439f429a9b0b99e67870f84 | 767 | py | Python | mysite/polls/models.py | hxcshr/learnDjango | ac828fad46238effdb2a114c9428ffde815ed657 | [
"MIT"
] | 1 | 2017-02-24T05:09:09.000Z | 2017-02-24T05:09:09.000Z | mysite/polls/models.py | hxcshr/learnDjango | ac828fad46238effdb2a114c9428ffde815ed657 | [
"MIT"
] | null | null | null | mysite/polls/models.py | hxcshr/learnDjango | ac828fad46238effdb2a114c9428ffde815ed657 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils import timezone
import datetime
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.Da... | 29.5 | 75 | 0.758801 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils import timezone
import datetime
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date publishe... | true | true |
f75644bbf70df6487cbf21e5949060da9fdd1dde | 2,113 | py | Python | sympy/assumptions/tests/test_refine.py | smichr/sympy | eda86926d98ab6cb7ec73e3cb8ea78ac15bddea3 | [
"BSD-3-Clause"
] | 7 | 2015-01-14T06:55:33.000Z | 2018-08-11T14:43:52.000Z | sympy/assumptions/tests/test_refine.py | smichr/sympy | eda86926d98ab6cb7ec73e3cb8ea78ac15bddea3 | [
"BSD-3-Clause"
] | 1 | 2018-02-19T04:56:04.000Z | 2018-02-19T04:56:04.000Z | sympy/assumptions/tests/test_refine.py | smichr/sympy | eda86926d98ab6cb7ec73e3cb8ea78ac15bddea3 | [
"BSD-3-Clause"
] | 1 | 2016-04-24T14:39:22.000Z | 2016-04-24T14:39:22.000Z | from sympy import Abs, exp, Expr, I, pi, Q, Rational, refine, S, sqrt
from sympy.abc import x, y, z
def test_Abs():
assert refine(Abs(x), Q.positive(x)) == x
assert refine(1 + Abs(x), Q.positive(x)) == 1 + x
assert refine(Abs(x), Q.negative(x)) == -x
assert refine(1 + Abs(x), Q.negative(x)) == 1 - x
... | 32.015152 | 71 | 0.52248 | from sympy import Abs, exp, Expr, I, pi, Q, Rational, refine, S, sqrt
from sympy.abc import x, y, z
def test_Abs():
assert refine(Abs(x), Q.positive(x)) == x
assert refine(1 + Abs(x), Q.positive(x)) == 1 + x
assert refine(Abs(x), Q.negative(x)) == -x
assert refine(1 + Abs(x), Q.negative(x)) == 1 - x
... | true | true |
f75644f42e5e7b8ebfc686886ca128375bf22e0a | 1,383 | py | Python | test/jax/test_vjp_batched.py | mmezic/netket | a9da8f2703d26056eb04e541d37911ec2315830f | [
"Apache-2.0"
] | null | null | null | test/jax/test_vjp_batched.py | mmezic/netket | a9da8f2703d26056eb04e541d37911ec2315830f | [
"Apache-2.0"
] | 26 | 2021-08-06T15:27:57.000Z | 2022-03-30T16:55:18.000Z | test/jax/test_vjp_batched.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | null | null | null | import pytest
import jax
import netket as nk
import numpy as np
from functools import partial
@pytest.mark.parametrize("jit", [False, True])
@pytest.mark.parametrize("batch_size", [None, 16, 10000, 1000000])
@pytest.mark.parametrize("return_forward", [False, True])
@pytest.mark.parametrize("batch_argnums", [1, (1,)]... | 28.8125 | 86 | 0.658713 | import pytest
import jax
import netket as nk
import numpy as np
from functools import partial
@pytest.mark.parametrize("jit", [False, True])
@pytest.mark.parametrize("batch_size", [None, 16, 10000, 1000000])
@pytest.mark.parametrize("return_forward", [False, True])
@pytest.mark.parametrize("batch_argnums", [1, (1,)]... | true | true |
f75645616023a9d8aefc844ea75c42ba4234b137 | 23,650 | py | Python | tests/related_resource/tests.py | numan/django-tastypie | 834f728b07ab1a008b281b12a2cab2987f26c99d | [
"BSD-3-Clause"
] | 1 | 2015-05-20T16:20:43.000Z | 2015-05-20T16:20:43.000Z | tests/related_resource/tests.py | numan/django-tastypie | 834f728b07ab1a008b281b12a2cab2987f26c99d | [
"BSD-3-Clause"
] | 3 | 2016-10-25T12:00:28.000Z | 2022-02-10T10:04:24.000Z | tests/related_resource/tests.py | numan/django-tastypie | 834f728b07ab1a008b281b12a2cab2987f26c99d | [
"BSD-3-Clause"
] | null | null | null | import django
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
import json
from django.core.urlresolvers import reverse
from core.models import Note, MediaBit
from core.tests.resources import HttpRequest
from core.tests.mocks import MockRequest
from tastypie ... | 37.127159 | 291 | 0.609049 | import django
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
import json
from django.core.urlresolvers import reverse
from core.models import Note, MediaBit
from core.tests.resources import HttpRequest
from core.tests.mocks import MockRequest
from tastypie ... | true | true |
f756459b62e6067809593d5111b123aa20819815 | 81 | py | Python | dash_frontend/constants.py | jihoonkang0829/Discrimination_Prediction | 5d6493f15b72c12ee1ca926be877a2b5ee6769d6 | [
"MIT"
] | null | null | null | dash_frontend/constants.py | jihoonkang0829/Discrimination_Prediction | 5d6493f15b72c12ee1ca926be877a2b5ee6769d6 | [
"MIT"
] | null | null | null | dash_frontend/constants.py | jihoonkang0829/Discrimination_Prediction | 5d6493f15b72c12ee1ca926be877a2b5ee6769d6 | [
"MIT"
] | 1 | 2021-06-02T13:53:49.000Z | 2021-06-02T13:53:49.000Z | # import pathlib
from pathlib import Path
ASSETS_PATH = Path(Path.cwd(), 'data') | 20.25 | 38 | 0.740741 |
from pathlib import Path
ASSETS_PATH = Path(Path.cwd(), 'data') | true | true |
f75646666a5e3415f86722bedf1d16cb270fbd32 | 356 | py | Python | 3rdParty/IronPython-2.7.3/Lib/distutils/__init__.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | 14 | 2016-04-11T15:37:33.000Z | 2021-08-13T11:32:42.000Z | 3rdParty/IronPython-2.7.3/Lib/distutils/__init__.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | 2 | 2019-07-01T12:39:41.000Z | 2020-11-09T11:40:54.000Z | 3rdParty/IronPython-2.7.3/Lib/distutils/__init__.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | 11 | 2016-07-01T02:21:06.000Z | 2020-11-23T08:29:22.000Z | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
__revision__ = "$Id$"
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__versi... | 17.8 | 73 | 0.674157 |
__revision__ = "$Id$"
__version__ = "2.7.1"
| true | true |
f756477178d52f54aa184ef8beef78bf25cdd435 | 1,306 | py | Python | coaffect/agents/emotional.py | aridyckovsky/coaffect | 12f33ee11a9fb51bbe100459d55c194417032c9b | [
"MIT"
] | null | null | null | coaffect/agents/emotional.py | aridyckovsky/coaffect | 12f33ee11a9fb51bbe100459d55c194417032c9b | [
"MIT"
] | null | null | null | coaffect/agents/emotional.py | aridyckovsky/coaffect | 12f33ee11a9fb51bbe100459d55c194417032c9b | [
"MIT"
] | null | null | null | """ Extend basic agent to an emotional agent.
"""
#: Dependencies
import numpy
import random
from .base import Agent
class EmotionalAgent(Agent):
""" Create emotional agent by extending and overriding base class Agent.
"""
def __init__(self, unique_id, experiment, memory=0):
""" Extended subcl... | 22.912281 | 77 | 0.580398 |
import numpy
import random
from .base import Agent
class EmotionalAgent(Agent):
def __init__(self, unique_id, experiment, memory=0):
super().__init__(unique_id, experiment)
if memory > 0:
self.memory = []
def perceive(self, situation):
try:
... | true | true |
f75647c354e6053fc185b95cbf907c8dacaec123 | 2,214 | py | Python | setup.py | c60evaporator/param_tuning_utility | 8518b76369dcc918172a87ab4c975ee3a12f7045 | [
"BSD-3-Clause"
] | null | null | null | setup.py | c60evaporator/param_tuning_utility | 8518b76369dcc918172a87ab4c975ee3a12f7045 | [
"BSD-3-Clause"
] | null | null | null | setup.py | c60evaporator/param_tuning_utility | 8518b76369dcc918172a87ab4c975ee3a12f7045 | [
"BSD-3-Clause"
] | null | null | null | # Author: Kenta Nakamura <c60evaporator@gmail.com>
# Copyright (c) 2020-2021 Kenta Nakamura
# License: BSD 3 clause
from setuptools import setup
import muscle_tuning
DESCRIPTION = "muscle-tuning: A hyperparameter tuning tool, easy to use even if your brain is made of muscle"
NAME = 'muscle-tuning'
AUTHOR = 'Kenta Nak... | 28.384615 | 109 | 0.664408 |
from setuptools import setup
import muscle_tuning
DESCRIPTION = "muscle-tuning: A hyperparameter tuning tool, easy to use even if your brain is made of muscle"
NAME = 'muscle-tuning'
AUTHOR = 'Kenta Nakamura'
AUTHOR_EMAIL = 'c60evaporator@gmail.com'
URL = 'https://github.com/c60evaporator/muscle-tuning'
LICENSE = ... | true | true |
f75648c376e3cd9e886a2c4df92926b60a88871e | 1,042 | py | Python | estimagic/exceptions.py | vishalbelsare/estimagic | afae1be3a1566056d11962c495b67e64bc4a0822 | [
"BSD-3-Clause"
] | 83 | 2019-09-26T04:44:03.000Z | 2022-03-17T20:24:02.000Z | estimagic/exceptions.py | vishalbelsare/estimagic | afae1be3a1566056d11962c495b67e64bc4a0822 | [
"BSD-3-Clause"
] | 243 | 2019-06-25T18:15:53.000Z | 2022-03-26T09:17:44.000Z | estimagic/exceptions.py | vishalbelsare/estimagic | afae1be3a1566056d11962c495b67e64bc4a0822 | [
"BSD-3-Clause"
] | 23 | 2019-07-03T11:16:55.000Z | 2022-03-07T00:57:38.000Z | try:
from better_exceptions import format_exception
except ImportError:
from traceback import format_exception
import sys
class TableExistsError(Exception):
pass
class StopOptimizationError(Exception):
def __init__(self, message, current_status):
super().__init__(message)
self.messag... | 25.414634 | 88 | 0.712092 | try:
from better_exceptions import format_exception
except ImportError:
from traceback import format_exception
import sys
class TableExistsError(Exception):
pass
class StopOptimizationError(Exception):
def __init__(self, message, current_status):
super().__init__(message)
self.messag... | true | true |
f7564a482e188b766a9fb123cdadf4f4e74ee9cb | 297 | py | Python | neopo/script.py | justicefreed/neopo | 6b3049af1ab90834e6d6c695cd6047a336af0209 | [
"MIT"
] | 22 | 2020-05-26T17:30:20.000Z | 2022-01-31T00:03:09.000Z | neopo/script.py | justicefreed/neopo | 6b3049af1ab90834e6d6c695cd6047a336af0209 | [
"MIT"
] | 11 | 2020-05-26T23:11:52.000Z | 2022-03-09T21:08:25.000Z | neopo/script.py | justicefreed/neopo | 6b3049af1ab90834e6d6c695cd6047a336af0209 | [
"MIT"
] | 6 | 2020-05-26T22:54:11.000Z | 2021-09-16T21:37:34.000Z | # Frontend for neopo scripting interface
import sys
# Local imports
from .common import ProcessError
from .command import script_command
def main():
try:
script_command([None, *sys.argv])
except ProcessError as error:
print(error)
if __name__ == "__main__":
main()
| 17.470588 | 41 | 0.693603 |
import sys
from .common import ProcessError
from .command import script_command
def main():
try:
script_command([None, *sys.argv])
except ProcessError as error:
print(error)
if __name__ == "__main__":
main()
| true | true |
f7564a643de4bec2ea7e504fafa92d995a42a277 | 3,890 | py | Python | AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/NewGraph_CreatedSuccessfully.py | whywhywhyw/o3de | 8e09f66799d4c8f188d45861d821e8656a554cb1 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-28T08:06:58.000Z | 2022-03-28T08:06:58.000Z | AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/NewGraph_CreatedSuccessfully.py | whywhywhyw/o3de | 8e09f66799d4c8f188d45861d821e8656a554cb1 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/NewGraph_CreatedSuccessfully.py | whywhywhyw/o3de | 8e09f66799d4c8f188d45861d821e8656a554cb1 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class Tests:
lc_tool_opened = (
"Landscape Canvas tool opened",
"Failed to open Landscape ... | 35.363636 | 113 | 0.731105 |
class Tests:
lc_tool_opened = (
"Landscape Canvas tool opened",
"Failed to open Landscape Canvas tool"
)
new_graph_created = (
"Successfully created new graph",
"Failed to create new graph"
)
graph_registered = (
"Graph registered with Landscape Canvas",
... | true | true |
f7564ad341dfa06b8cc417ee1d597ec715cabf15 | 1,719 | py | Python | tnn/calib/config.py | Savahi/tnn | 21cd0c0e1827b159ccfb8668495b25f3c9486c75 | [
"MIT"
] | null | null | null | tnn/calib/config.py | Savahi/tnn | 21cd0c0e1827b159ccfb8668495b25f3c9486c75 | [
"MIT"
] | null | null | null | tnn/calib/config.py | Savahi/tnn | 21cd0c0e1827b159ccfb8668495b25f3c9486c75 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from tnn.calcdata import CalcData
# количество бинов
CD = CalcData( 5 )
# длина истории
history_tail = 5
for i in range(history_tail):
# задаем индикаторы
CD.addLookBackOp( "rsi", i, 6 )
CD.addLookBackOp( "stochastic", i, 6 )
CD.addLookBackOp( "roc", i, 6 )
CD.addLookBackOp( "sma", i, 6... | 28.65 | 138 | 0.680047 |
from tnn.calcdata import CalcData
CD = CalcData( 5 )
history_tail = 5
for i in range(history_tail):
CD.addLookBackOp( "rsi", i, 6 )
CD.addLookBackOp( "stochastic", i, 6 )
CD.addLookBackOp( "roc", i, 6 )
CD.addLookBackOp( "sma", i, 6 )
CD.addLookBackOp( "return", i, 6 )
CD.addLookBackOp( "vol", i, 6 )
CD... | true | true |
f7564ae58a00ae117c887dd05fa282f8309afffc | 66,587 | py | Python | conda/resolve.py | sakibguy/conda | 892f9f6a196312765b515b0db53a5558566fe456 | [
"BSD-3-Clause"
] | null | null | null | conda/resolve.py | sakibguy/conda | 892f9f6a196312765b515b0db53a5558566fe456 | [
"BSD-3-Clause"
] | null | null | null | conda/resolve.py | sakibguy/conda | 892f9f6a196312765b515b0db53a5558566fe456 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict, OrderedDict, deque
import copy
from logging import DEBUG, getLogger
from .auxlib.collection import ... | 45.420873 | 138 | 0.576764 |
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict, OrderedDict, deque
import copy
from logging import DEBUG, getLogger
from .auxlib.collection import frozendict
from .auxlib.decorators import memoize, memoizemethod
from ._vendor.toolz import conc... | true | true |
f7564b3de7689c5160bdf52de82702fcc3c7cf12 | 3,184 | py | Python | superset/commands/utils.py | 7vikpeculiar/superset | 800ced5e257d5d83d6dbe4ced0e7318ac40d026f | [
"Apache-2.0"
] | 2 | 2021-12-21T15:57:16.000Z | 2022-01-31T02:22:02.000Z | superset/commands/utils.py | 7vikpeculiar/superset | 800ced5e257d5d83d6dbe4ced0e7318ac40d026f | [
"Apache-2.0"
] | 10 | 2022-01-05T01:31:07.000Z | 2022-03-16T01:09:46.000Z | superset/commands/utils.py | 7vikpeculiar/superset | 800ced5e257d5d83d6dbe4ced0e7318ac40d026f | [
"Apache-2.0"
] | 2 | 2021-12-21T13:41:18.000Z | 2021-12-26T22:16:43.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.597701 | 85 | 0.73147 |
from __future__ import annotations
from typing import List, Optional, TYPE_CHECKING
from flask_appbuilder.security.sqla.models import Role, User
from superset.commands.exceptions import (
DatasourceNotFoundValidationError,
OwnersNotFoundValidationError,
RolesNotFoundValidationError,
)
fro... | true | true |
f7564b48e1c0af3e5e5fddea32b1bef9e9f6cb4a | 15,213 | py | Python | bokeh/models/tests/test_annotations.py | aparamon/bokeh | cf6c97e35301adb15dd69eb24f4f8af5e75d64e1 | [
"BSD-3-Clause"
] | 1 | 2019-03-12T12:14:52.000Z | 2019-03-12T12:14:52.000Z | bokeh/models/tests/test_annotations.py | aparamon/bokeh | cf6c97e35301adb15dd69eb24f4f8af5e75d64e1 | [
"BSD-3-Clause"
] | null | null | null | bokeh/models/tests/test_annotations.py | aparamon/bokeh | cf6c97e35301adb15dd69eb24f4f8af5e75d64e1 | [
"BSD-3-Clause"
] | 3 | 2019-03-27T23:27:05.000Z | 2020-08-05T19:03:19.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 31.302469 | 101 | 0.585486 |
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest ; pytest
import mock
from datetime import datetime
from bokeh.core.properties import field, value
from bokeh.core.validation import check_integrity
from bokeh.models import (
ColumnDataSource, Arro... | true | true |
f7564b4d8f9c1e83e2ad3ef42388503c07722101 | 265 | py | Python | symposion_project/apps/symposion/review/management/commands/calculate_results.py | mzdaniel/symposion | b2f557ca1be3bd61db2d902a31d57049fb6855c5 | [
"MIT"
] | 1 | 2015-06-30T14:11:31.000Z | 2015-06-30T14:11:31.000Z | symposion_project/apps/symposion/review/management/commands/calculate_results.py | mzdaniel/symposion | b2f557ca1be3bd61db2d902a31d57049fb6855c5 | [
"MIT"
] | null | null | null | symposion_project/apps/symposion/review/management/commands/calculate_results.py | mzdaniel/symposion | b2f557ca1be3bd61db2d902a31d57049fb6855c5 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group
from symposion.review.models import ProposalResult
class Command(BaseCommand):
def handle(self, *args, **options):
ProposalResult.full_calculate()
| 22.083333 | 51 | 0.766038 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group
from symposion.review.models import ProposalResult
class Command(BaseCommand):
def handle(self, *args, **options):
ProposalResult.full_calculate()
| true | true |
f7564bc65610669b82dad0557708df2776e29db0 | 697 | py | Python | QQBot/bot.py | Mashiro-Sorata/UESTC-ESE-night-check-bot | eff90677b7ad1f5972c0825acddf647668c004b8 | [
"MIT"
] | 1 | 2021-02-01T15:08:17.000Z | 2021-02-01T15:08:17.000Z | QQBot/bot.py | Mashiro-Sorata/UESTC-ESE-night-check-bot | eff90677b7ad1f5972c0825acddf647668c004b8 | [
"MIT"
] | null | null | null | QQBot/bot.py | Mashiro-Sorata/UESTC-ESE-night-check-bot | eff90677b7ad1f5972c0825acddf647668c004b8 | [
"MIT"
] | 1 | 2021-02-01T15:10:45.000Z | 2021-02-01T15:10:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import win32api
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
nonebot.init()
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
nonebot.load_builtin_plugins()
nonebot.load_plugins("qqbot/plugins")... | 22.483871 | 121 | 0.694405 |
import win32api
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
nonebot.init()
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
nonebot.load_builtin_plugins()
nonebot.load_plugins("qqbot/plugins")
async def send_hello(bot):
await bot.c... | true | true |
f7564db5aa88f84b51645732cea43eb7b3a460c7 | 1,484 | bzl | Python | kotlin/rules/defs.bzl | buchgr/rules_kotlin | d99be44ed90e2ed6bcb488fd309ea7cb84406e66 | [
"Apache-2.0"
] | null | null | null | kotlin/rules/defs.bzl | buchgr/rules_kotlin | d99be44ed90e2ed6bcb488fd309ea7cb84406e66 | [
"Apache-2.0"
] | null | null | null | kotlin/rules/defs.bzl | buchgr/rules_kotlin | d99be44ed90e2ed6bcb488fd309ea7cb84406e66 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 39.052632 | 120 | 0.616577 |
REPO_ROOT = "io_bazel_rules_kotlin"
# The name of the Kotlin compiler workspace.
KOTLIN_REPO_ROOT = "com_github_jetbrains_kotlin"
########################################################################################################################
# Providers
########################################... | true | true |
f7564e5af4d2c9b43d70e0e893f523d6d2d64007 | 127 | py | Python | accounts/accounts/services/__init__.py | cul-it/arxiv-accounts | 9d237ffc7de4ac7f3c94ad615252681792f53fb5 | [
"MIT"
] | 11 | 2018-12-29T17:55:16.000Z | 2021-11-05T12:26:29.000Z | accounts/accounts/services/__init__.py | Https-github-com-sulaeman51/arxiv-auth | 754fa083b0c8b43932f7393f5a4ab67d9f9f0444 | [
"MIT"
] | 24 | 2019-01-25T18:19:21.000Z | 2022-02-04T01:04:29.000Z | accounts/accounts/services/__init__.py | Https-github-com-sulaeman51/arxiv-auth | 754fa083b0c8b43932f7393f5a4ab67d9f9f0444 | [
"MIT"
] | 13 | 2019-01-10T22:01:43.000Z | 2021-12-30T11:39:48.000Z | """Provides modules for interacting with external services."""
from . import legacy, users
from .sessions import SessionStore
| 25.4 | 62 | 0.787402 |
from . import legacy, users
from .sessions import SessionStore
| true | true |
f7564e8e433051a9ad2900a0ff4768b76ec08ead | 25,220 | py | Python | sdk/python/tests/compiler/compiler_tests.py | red-firefly/pipelines | deed8a88cb5b6b62a65c67d79ce128bf83d3adfd | [
"Apache-2.0"
] | 1 | 2019-10-12T07:59:24.000Z | 2019-10-12T07:59:24.000Z | sdk/python/tests/compiler/compiler_tests.py | red-firefly/pipelines | deed8a88cb5b6b62a65c67d79ce128bf83d3adfd | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/compiler/compiler_tests.py | red-firefly/pipelines | deed8a88cb5b6b62a65c67d79ce128bf83d3adfd | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 35.027778 | 140 | 0.647264 |
import kfp
import kfp.compiler as compiler
import kfp.dsl as dsl
import os
import shutil
import subprocess
import sys
import zipfile
import tarfile
import tempfile
import unittest
import yaml
from kfp.dsl._component import component
from kfp.dsl import ContainerOp, pipeline
from kfp.dsl.types import Inte... | true | true |
f7564ec1d0a7e165bd5bb1e5c535c22c7bf1fa95 | 5,554 | py | Python | nova/tests/api/openstack/compute/plugins/v3/test_evacuate.py | bopopescu/plumgrid-nova | 87579b67ed9a2d62f04d3540d6fb817cc002cead | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_evacuate.py | bopopescu/plumgrid-nova | 87579b67ed9a2d62f04d3540d6fb817cc002cead | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_evacuate.py | bopopescu/plumgrid-nova | 87579b67ed9a2d62f04d3540d6fb817cc002cead | [
"Apache-2.0"
] | 1 | 2020-07-24T08:52:14.000Z | 2020-07-24T08:52:14.000Z | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.781457 | 78 | 0.611811 |
import uuid
from oslo.config import cfg
import webob
from nova.compute import api as compute_api
from nova.compute import vm_states
from nova import context
from nova import exception
from nova.openstack.common import jsonutils
from nova import test
from nova.tests.api.openstack import fakes
CONF = cfg... | true | true |
f7564f124bf262fc586f2b49ac95ff9d29d6764d | 1,062 | py | Python | tests/test_networks/test_brokers/test_publishers/test_abc.py | Clariteia/minos_microservice_networks | 77f239429653272c5cb3447311513143f8521ed9 | [
"MIT"
] | 7 | 2021-04-12T15:40:11.000Z | 2022-03-04T13:46:01.000Z | tests/test_networks/test_brokers/test_publishers/test_abc.py | Clariteia/minos_microservice_networks | 77f239429653272c5cb3447311513143f8521ed9 | [
"MIT"
] | 275 | 2021-04-03T09:23:40.000Z | 2022-01-28T11:56:25.000Z | tests/test_networks/test_brokers/test_publishers/test_abc.py | Clariteia/minos_microservice_networks | 77f239429653272c5cb3447311513143f8521ed9 | [
"MIT"
] | null | null | null | import unittest
import aiopg
from minos.common.testing import (
PostgresAsyncTestCase,
)
from minos.networks import (
BrokerPublisherSetup,
)
from tests.utils import (
BASE_PATH,
)
class TestBrokerSetup(PostgresAsyncTestCase):
CONFIG_FILE_PATH = BASE_PATH / "test_config.yml"
def setUp(self) -> ... | 24.697674 | 86 | 0.592279 | import unittest
import aiopg
from minos.common.testing import (
PostgresAsyncTestCase,
)
from minos.networks import (
BrokerPublisherSetup,
)
from tests.utils import (
BASE_PATH,
)
class TestBrokerSetup(PostgresAsyncTestCase):
CONFIG_FILE_PATH = BASE_PATH / "test_config.yml"
def setUp(self) -> ... | true | true |
f7564fd7fa0fc6d9686194fc3f0a1a1809a4cfe9 | 3,773 | py | Python | research/audioset/vggish/vggish_smoke_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/audioset/vggish/vggish_smoke_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/audioset/vggish/vggish_smoke_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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 ... | 38.5 | 81 | 0.738404 |
from __future__ import print_function
import numpy as np
import tensorflow as tf
import vggish_input
import vggish_params
import vggish_postprocess
import vggish_slim
print('\nTesting your install of VGGish\n')
checkpoint_path = 'vggish_model.ckpt'
pca_params_path = 'vggish_pca_param... | true | true |
f756501c7b64385bcc1a1a7cff3246e0bd397556 | 2,306 | py | Python | paper/spiders/scirob.py | lvliangxiong/scirob-paper-download | 4357ab84caafbffbd9a28579125ceba2339769f8 | [
"MIT"
] | 4 | 2021-01-22T07:28:33.000Z | 2022-01-21T00:55:30.000Z | paper/spiders/scirob.py | lvliangxiong/PaperDownload | 4357ab84caafbffbd9a28579125ceba2339769f8 | [
"MIT"
] | null | null | null | paper/spiders/scirob.py | lvliangxiong/PaperDownload | 4357ab84caafbffbd9a28579125ceba2339769f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from paper.items import SciRobIssueItem
from scrapy.shell import inspect_response
class ScirobSpider(scrapy.Spider):
name = 'scirob'
base_url = "https://robotics.sciencemag.org/content/by/year/"
start_year = 2016
current_year = 2020
custom_settings = {
... | 39.084746 | 106 | 0.639202 |
import scrapy
from paper.items import SciRobIssueItem
from scrapy.shell import inspect_response
class ScirobSpider(scrapy.Spider):
name = 'scirob'
base_url = "https://robotics.sciencemag.org/content/by/year/"
start_year = 2016
current_year = 2020
custom_settings = {
"DOWNLOAD_TIMEOUT": 3... | true | true |
f75651172bc9236622d8edeceab07f6893810f44 | 600 | py | Python | dream/server/helpers.py | icyblade/dream | 818e77f1c25e51f8cd966f7aa4eb1bcd4207b208 | [
"MIT"
] | null | null | null | dream/server/helpers.py | icyblade/dream | 818e77f1c25e51f8cd966f7aa4eb1bcd4207b208 | [
"MIT"
] | null | null | null | dream/server/helpers.py | icyblade/dream | 818e77f1c25e51f8cd966f7aa4eb1bcd4207b208 | [
"MIT"
] | null | null | null | import json
import logging
import traceback
def helper(function):
"""Decorator to mark helper functions.
Will do nothing to the original function.
"""
return function
def flask_method(function):
"""Decorator to handle errors."""
def generate_errcode(*args, **kwargs):
try:
... | 21.428571 | 45 | 0.581667 | import json
import logging
import traceback
def helper(function):
return function
def flask_method(function):
def generate_errcode(*args, **kwargs):
try:
return function(*args, **kwargs)
except Exception as e:
logging.error(str(e))
traceback.print_exc()
... | true | true |
f756511a13cbac9dbbed9a7b8c45e1e3ab70a2da | 2,201 | py | Python | tests/__init__.py | idjaw/netman | 58ba898de6e450a24b4f1721ce274ad3e12f9d33 | [
"Apache-2.0"
] | 1 | 2016-01-28T17:56:51.000Z | 2016-01-28T17:56:51.000Z | tests/__init__.py | idjaw/netman | 58ba898de6e450a24b4f1721ce274ad3e12f9d33 | [
"Apache-2.0"
] | 2 | 2021-12-13T20:55:50.000Z | 2022-03-29T22:07:13.000Z | tests/__init__.py | idjaw/netman | 58ba898de6e450a24b4f1721ce274ad3e12f9d33 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Internap.
#
# 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, so... | 31.442857 | 121 | 0.711495 |
import logging
import warnings
from functools import wraps
from hamcrest.core.core.isequal import IsEqual
from netaddr import IPNetwork
from global_reactor import ThreadedReactor
from tests.adapters.model_list import available_models
from tests.adapters.shell.terminal_client_test import telnet_hook_to_re... | true | true |
f756511fbda48cba78d43340e522be9cae1cd50b | 390 | py | Python | settings.py | josemauro/topology | ae7b792e8516c5c5ff5bfd01779bfa4e5a9b210b | [
"MIT"
] | null | null | null | settings.py | josemauro/topology | ae7b792e8516c5c5ff5bfd01779bfa4e5a9b210b | [
"MIT"
] | 72 | 2017-09-29T19:31:51.000Z | 2021-05-28T18:10:15.000Z | settings.py | josemauro/topology | ae7b792e8516c5c5ff5bfd01779bfa4e5a9b210b | [
"MIT"
] | 15 | 2017-10-03T18:35:24.000Z | 2021-06-01T12:16:33.000Z | """Settings for the Topology NApp."""
# Set this option to true if you need the topology with bi-directional links
# DISPLAY_FULL_DUPLEX_LINKS = True
# Time (in seconds) to wait before setting a link as up
LINK_UP_TIMER = 10
# Time (in seconds) to wait retrieve box from storehouse
BOX_RESTORE_TIMER = 0.1
# Time (in s... | 32.5 | 76 | 0.771795 |
LINK_UP_TIMER = 10
BOX_RESTORE_TIMER = 0.1
INTERFACE_RESTORE_TIMER = 2
| true | true |
f75651d29fdbe6436817a27c5158f87bcdef6736 | 263 | py | Python | lectures/05-python-intro/examples/if-else.py | mattmiller899/biosys-analytics | ab24a4c7206ed9a865e896daa57cee3c4e62df1f | [
"MIT"
] | 4 | 2019-01-10T17:12:37.000Z | 2019-03-01T18:25:07.000Z | lectures/05-python-intro/examples/if-else.py | mattmiller899/biosys-analytics | ab24a4c7206ed9a865e896daa57cee3c4e62df1f | [
"MIT"
] | null | null | null | lectures/05-python-intro/examples/if-else.py | mattmiller899/biosys-analytics | ab24a4c7206ed9a865e896daa57cee3c4e62df1f | [
"MIT"
] | 33 | 2019-01-05T17:03:47.000Z | 2019-11-11T20:48:24.000Z | #!/usr/bin/env python3
"""conditions"""
name = input('What is your name? ')
age = int(input('Hi, ' + name + '. What is your age? '))
if age < 0:
print("That isn't possible.")
elif age < 18:
print('You are a minor.')
else:
print('You are an adult.')
| 20.230769 | 56 | 0.585551 |
name = input('What is your name? ')
age = int(input('Hi, ' + name + '. What is your age? '))
if age < 0:
print("That isn't possible.")
elif age < 18:
print('You are a minor.')
else:
print('You are an adult.')
| true | true |
f756524122e0a885958dfdc6bdd08db962c10f5c | 3,009 | py | Python | edk2toolext/invocables/edk2_update.py | matthewfcarlson/edk2-pytool-extensions | 60a6b32a8a9e8deaed7fd197779a27a8bbf44c84 | [
"BSD-2-Clause-Patent"
] | null | null | null | edk2toolext/invocables/edk2_update.py | matthewfcarlson/edk2-pytool-extensions | 60a6b32a8a9e8deaed7fd197779a27a8bbf44c84 | [
"BSD-2-Clause-Patent"
] | null | null | null | edk2toolext/invocables/edk2_update.py | matthewfcarlson/edk2-pytool-extensions | 60a6b32a8a9e8deaed7fd197779a27a8bbf44c84 | [
"BSD-2-Clause-Patent"
] | null | null | null | # @file Edk2Update
# Updates external dependencies for project_scope in workspace_path
# as listed in Platform Config file.
##
# Copyright (c) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import logging
from edk2toolext import edk2_logging
from edk2toolext.environment import self_describing... | 30.704082 | 118 | 0.679628 |
import logging
from edk2toolext import edk2_logging
from edk2toolext.environment import self_describing_environment
from edk2toolext.edk2_invocable import Edk2Invocable
class UpdateSettingsManager():
def GetActiveScopes(self):
raise NotImplementedError()
def GetWorkspaceRoot(self):
rai... | true | true |
f75652d2e66e2f4dffd62f36507c0911b2f53b66 | 36,875 | py | Python | pvrpm/core/simulation.py | FSEC-Photovoltaics/pvrpm-lcoe | dbe0bb30ffa1041ec004f84c57aac44f47bdf6d2 | [
"BSD-3-Clause"
] | 1 | 2022-03-29T16:03:26.000Z | 2022-03-29T16:03:26.000Z | pvrpm/core/simulation.py | FSEC-Photovoltaics/pvrpm-lcoe | dbe0bb30ffa1041ec004f84c57aac44f47bdf6d2 | [
"BSD-3-Clause"
] | 29 | 2022-02-05T17:27:07.000Z | 2022-03-06T23:53:50.000Z | pvrpm/core/simulation.py | FSEC-Photovoltaics/pvrpm-lcoe | dbe0bb30ffa1041ec004f84c57aac44f47bdf6d2 | [
"BSD-3-Clause"
] | 2 | 2022-01-13T23:35:19.000Z | 2022-03-21T15:46:05.000Z | import os
import time
import warnings
import multiprocessing as mp
from typing import List
import pandas as pd
import numpy as np
import scipy
import scipy.stats as stats
import matplotlib.pyplot as plt
from dateutil.relativedelta import relativedelta
from datetime import datetime
from tqdm import tqdm
from pvrpm.cor... | 39.396368 | 176 | 0.636502 | import os
import time
import warnings
import multiprocessing as mp
from typing import List
import pandas as pd
import numpy as np
import scipy
import scipy.stats as stats
import matplotlib.pyplot as plt
from dateutil.relativedelta import relativedelta
from datetime import datetime
from tqdm import tqdm
from pvrpm.cor... | true | true |
f756535e7e25a757810a33250dc4d8bd0eee3600 | 9,122 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200401/firewall_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20200401/firewall_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20200401/firewall_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 43.855769 | 950 | 0.66082 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['FirewallPolicy']
class FirewallPolicy(pulumi.CustomResource):
def __init__(__self__... | true | true |
f75653c5d77ebd935fdd5b4ed4eccf6177fc8988 | 1,545 | py | Python | dtf/migrations/0012_cascade_on_delete.py | siehr/django-testing-framework | 7e411227afff1a5463ebc73ae5cb2c537f0d4f69 | [
"MIT"
] | null | null | null | dtf/migrations/0012_cascade_on_delete.py | siehr/django-testing-framework | 7e411227afff1a5463ebc73ae5cb2c537f0d4f69 | [
"MIT"
] | 70 | 2021-03-06T14:36:42.000Z | 2022-03-30T10:00:54.000Z | dtf/migrations/0012_cascade_on_delete.py | siehr/django-testing-framework | 7e411227afff1a5463ebc73ae5cb2c537f0d4f69 | [
"MIT"
] | 1 | 2022-02-02T14:05:43.000Z | 2022-02-02T14:05:43.000Z | # Generated by Django 3.1b1 on 2020-12-10 17:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dtf', '0011_add_reference_sets_3'),
]
operations = [
migrations.AlterField(
model_name='project... | 38.625 | 149 | 0.642718 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dtf', '0011_add_reference_sets_3'),
]
operations = [
migrations.AlterField(
model_name='projectsubmissionproperty',
name='project'... | true | true |
f756560ea1a4dd795e8196db56402c4defc98945 | 200 | py | Python | yt_transcript/youtube_transcript_api/__main__.py | uxio-andrade/hackXLR8 | 4afab09638d37ddc2ba54b76b52097ba10b71770 | [
"MIT"
] | 773 | 2018-05-15T19:12:00.000Z | 2022-03-31T23:56:30.000Z | youtube_transcript_api/__main__.py | hbyyy/youtube-transcript-api | 361986e2211307ca796e6962b0aa4a892291f90a | [
"MIT"
] | 125 | 2018-07-14T18:50:25.000Z | 2022-03-30T15:36:34.000Z | youtube_transcript_api/__main__.py | hbyyy/youtube-transcript-api | 361986e2211307ca796e6962b0aa4a892291f90a | [
"MIT"
] | 145 | 2018-05-15T19:12:02.000Z | 2022-03-21T16:38:47.000Z | import sys
import logging
from ._cli import YouTubeTranscriptCli
def main():
logging.basicConfig()
print(YouTubeTranscriptCli(sys.argv[1:]).run())
if __name__ == '__main__':
main()
| 12.5 | 51 | 0.695 | import sys
import logging
from ._cli import YouTubeTranscriptCli
def main():
logging.basicConfig()
print(YouTubeTranscriptCli(sys.argv[1:]).run())
if __name__ == '__main__':
main()
| true | true |
f75656872fc86f50ad8c3000c9527d68ef327fde | 7,936 | py | Python | networkx/linalg/laplacianmatrix.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 1 | 2015-07-16T01:36:44.000Z | 2015-07-16T01:36:44.000Z | networkx/linalg/laplacianmatrix.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | null | null | null | networkx/linalg/laplacianmatrix.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | null | null | null | """Laplacian matrix of graphs.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric ... | 30.75969 | 99 | 0.602697 |
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric Hagberg <aric.hagberg@gmail.com>',
'Pieter Swart (swart@lanl.gov)',
'Dan Schult (dschult@colgate.edu)',
'Alejandro Weinstein <alejandro.weinste... | true | true |
f7565715ab3fa4b4efa564f2338a2fb47db3102e | 2,773 | py | Python | pvfit/common/constants.py | markcampanelli/pvfit | e526f3757279a3f8c41295aab94c1575ee9485fc | [
"MIT"
] | 4 | 2019-09-17T15:19:17.000Z | 2021-11-24T03:21:03.000Z | pvfit/common/constants.py | markcampanelli/pvfit | e526f3757279a3f8c41295aab94c1575ee9485fc | [
"MIT"
] | 3 | 2019-09-08T01:47:29.000Z | 2020-09-13T16:12:45.000Z | pvfit/common/constants.py | markcampanelli/pvfit | e526f3757279a3f8c41295aab94c1575ee9485fc | [
"MIT"
] | 2 | 2019-10-01T07:40:16.000Z | 2019-10-25T09:27:45.000Z | import inspect
import scipy.constants
from scipy.optimize import newton
from scipy.optimize.optimize import _minimize_scalar_bounded
# Some useful physical constants (CODATA 2018: https://physics.nist.gov/cuu/Constants/).
# elementary charge, 1.602176634e-19 C.
q_C = scipy.constants.value('elementary charge')
# Bol... | 35.551282 | 106 | 0.676524 | import inspect
import scipy.constants
from scipy.optimize import newton
from scipy.optimize.optimize import _minimize_scalar_bounded
q_C = scipy.constants.value('elementary charge')
k_B_J_per_K = scipy.constants.value('Boltzmann constant')
k_B_eV_per_K = scipy.constants.value('Boltzmann constant in eV/K')
c_... | true | true |
f75658633130464ba40a8b257b649b26cf926f5c | 37,491 | py | Python | maigret/maigret.py | courgettes975/maigret | 2a9558ca46498dfd910537d91a35cda2891ea831 | [
"MIT"
] | 4 | 2021-03-12T07:59:59.000Z | 2022-02-18T16:45:45.000Z | maigret/maigret.py | courgettes975/maigret | 2a9558ca46498dfd910537d91a35cda2891ea831 | [
"MIT"
] | 5 | 2021-06-02T04:31:55.000Z | 2022-03-12T00:57:13.000Z | maigret/maigret.py | JRRMDSG/maigret | 2a9558ca46498dfd910537d91a35cda2891ea831 | [
"MIT"
] | 1 | 2021-03-14T16:32:02.000Z | 2021-03-14T16:32:02.000Z | """
Maigret main module
"""
import aiohttp
import asyncio
import csv
import http.cookiejar as cookielib
import json
import logging
import os
import platform
import re
import requests
import ssl
import sys
import tqdm.asyncio
import xmind
from aiohttp_socks import ProxyConnector
from argparse import ArgumentParser, Raw... | 39.298742 | 153 | 0.577018 |
import aiohttp
import asyncio
import csv
import http.cookiejar as cookielib
import json
import logging
import os
import platform
import re
import requests
import ssl
import sys
import tqdm.asyncio
import xmind
from aiohttp_socks import ProxyConnector
from argparse import ArgumentParser, RawDescriptionHelpFormatter
fro... | true | true |
f75658debc5b90a9455a8638ef6f3ba91b12faca | 7,122 | py | Python | Computational Nanoscience 2013 - Final project/Code/plot_data.py | simo-tuomisto/portfolio | 7f70bdfe027fcab75970e5f8a81036ca905c893b | [
"MIT"
] | null | null | null | Computational Nanoscience 2013 - Final project/Code/plot_data.py | simo-tuomisto/portfolio | 7f70bdfe027fcab75970e5f8a81036ca905c893b | [
"MIT"
] | null | null | null | Computational Nanoscience 2013 - Final project/Code/plot_data.py | simo-tuomisto/portfolio | 7f70bdfe027fcab75970e5f8a81036ca905c893b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as mpl
from matplotlib.ticker import NullFormatter
import sys
from glob import glob
import re
import os
if __name__=="__main__":
# Plot these ranges
plotranges = {
5.0 : [0.009 , 0.011],
10.0: [0.007 , 0.011],
15.0: [0.005 , 0.010],
20.0: [0.005 , 0.010],
25.0: [0.00... | 32.669725 | 113 | 0.660489 | import numpy as np
import matplotlib.pyplot as mpl
from matplotlib.ticker import NullFormatter
import sys
from glob import glob
import re
import os
if __name__=="__main__":
plotranges = {
5.0 : [0.009 , 0.011],
10.0: [0.007 , 0.011],
15.0: [0.005 , 0.010],
20.0: [0.005 , 0.010],
25.0: [0.005 , 0.010],
30.0: ... | true | true |
f756590ed3511c90265b127a49d8a1fbbff1981a | 1,256 | py | Python | backend/models/mixins.py | XiaoYang1127/flask-server-in-python | e4567552dc74fad7c2478348861ceb8ff64322fa | [
"Apache-2.0"
] | 1 | 2021-03-31T13:09:03.000Z | 2021-03-31T13:09:03.000Z | backend/models/mixins.py | XiaoYang1127/flask-server-in-python | e4567552dc74fad7c2478348861ceb8ff64322fa | [
"Apache-2.0"
] | null | null | null | backend/models/mixins.py | XiaoYang1127/flask-server-in-python | e4567552dc74fad7c2478348861ceb8ff64322fa | [
"Apache-2.0"
] | null | null | null | import datetime
import json
from sqlalchemy.event import listens_for
from backend.models.base import db, Column
class CTimestampMixin(object):
created_at = Column(db.DateTime(True), default=db.func.now())
updated_at = Column(db.DateTime(True), default=db.func.now())
def serialize_time(self, column):
... | 27.911111 | 65 | 0.670382 | import datetime
import json
from sqlalchemy.event import listens_for
from backend.models.base import db, Column
class CTimestampMixin(object):
created_at = Column(db.DateTime(True), default=db.func.now())
updated_at = Column(db.DateTime(True), default=db.func.now())
def serialize_time(self, column):
... | true | true |
f7565a10e7a504c2df0a90c852e5c2eace167e1b | 4,120 | py | Python | django_project/settings.py | gabrielquenu/django_blog_project | 998cc726923447079477fc9932008fc956e00032 | [
"MIT"
] | null | null | null | django_project/settings.py | gabrielquenu/django_blog_project | 998cc726923447079477fc9932008fc956e00032 | [
"MIT"
] | null | null | null | django_project/settings.py | gabrielquenu/django_blog_project | 998cc726923447079477fc9932008fc956e00032 | [
"MIT"
] | null | null | null | """
Django settings for django_project project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from ... | 26.753247 | 91 | 0.71966 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-z4c#9vcmvhp8%#-1t=h%zv8as10*+$(*0r3n(@w*a!zk*k8l=t'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'blog.apps.BlogConfig',
'users.apps.UsersConfig',
... | true | true |
f7565c93e42de4bac89122bb8890760b18b05a4c | 7,002 | py | Python | project_src/app/forms.py | tsinghuariit/DMP | 03133fa8796e6318060f038edce2a8ef778754d9 | [
"Apache-2.0"
] | 3 | 2017-07-17T08:57:55.000Z | 2018-03-07T09:41:53.000Z | project_src/app/forms.py | KNIGHTTH0R/DMP-1 | 03133fa8796e6318060f038edce2a8ef778754d9 | [
"Apache-2.0"
] | null | null | null | project_src/app/forms.py | KNIGHTTH0R/DMP-1 | 03133fa8796e6318060f038edce2a8ef778754d9 | [
"Apache-2.0"
] | 4 | 2017-07-17T08:57:58.000Z | 2018-06-22T07:48:45.000Z | # coding=utf-8
from flask import flash
from flask_babel import gettext
from flask_wtf import Form
from wtforms import StringField, BooleanField, TextAreaField, PasswordField, \
validators
from flask_wtf.file import FileField, FileRequired
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.valid... | 43.222222 | 104 | 0.67595 |
from flask import flash
from flask_babel import gettext
from flask_wtf import Form
from wtforms import StringField, BooleanField, TextAreaField, PasswordField, \
validators
from flask_wtf.file import FileField, FileRequired
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators import D... | true | true |
f7565c943ff4ba2b5e010fb243f52722c9ee12a8 | 5,204 | py | Python | CIM15/IEC61970/Informative/InfOperations/ChangeSet.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 58 | 2015-04-22T10:41:03.000Z | 2022-03-29T16:04:34.000Z | CIM15/IEC61970/Informative/InfOperations/ChangeSet.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 12 | 2015-08-26T03:57:23.000Z | 2020-12-11T20:14:42.000Z | CIM15/IEC61970/Informative/InfOperations/ChangeSet.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 35 | 2015-01-10T12:21:03.000Z | 2020-09-09T08:18:16.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.424242 | 733 | 0.68063 |
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject
class ChangeSet(IdentifiedObject):
def __init__(self, NetworkDataSets=None, ChangeItems=None, status=None, Documents=None, *args, **kw_args):
self._NetworkDataSets = []
self.NetworkDataSets = [] if NetworkDataSet... | true | true |
f7565d68156890224cca1cec9bfdf8ff99f7e21f | 13,552 | py | Python | deepsnap/batch.py | Guangxuan-Xiao/deepsnap | b0b222c8093b6273c648c51585c9ebbb2f4112fa | [
"MIT"
] | null | null | null | deepsnap/batch.py | Guangxuan-Xiao/deepsnap | b0b222c8093b6273c648c51585c9ebbb2f4112fa | [
"MIT"
] | null | null | null | deepsnap/batch.py | Guangxuan-Xiao/deepsnap | b0b222c8093b6273c648c51585c9ebbb2f4112fa | [
"MIT"
] | null | null | null | import torch
from deepsnap.graph import Graph
from deepsnap.hetero_graph import HeteroGraph
from typing import (
Callable,
Dict,
List
)
class Batch(Graph):
r"""
A plain old python object modeling a batch of
:class:`deepsnap.graph.Graph` objects as one big (disconnected) graph,
with :class:... | 36.926431 | 79 | 0.540584 | import torch
from deepsnap.graph import Graph
from deepsnap.hetero_graph import HeteroGraph
from typing import (
Callable,
Dict,
List
)
class Batch(Graph):
def __init__(self, batch=None, **kwargs):
super(Batch, self).__init__(**kwargs)
self.batch = batch
self.__data_class__ = ... | true | true |
f7565d6f53546f8556204f62162542f27c1eb888 | 6,334 | py | Python | models_nonconvex_simple2/batch_nc.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_nonconvex_simple2/batch_nc.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_nonconvex_simple2/batch_nc.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 08/20/20 01:30:36
#
# Equation counts
# Total E G L N X C B
# 68 7 60 1 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 32.152284 | 120 | 0.597727 |
from pyomo.environ import *
model = m = ConcreteModel()
m.x1 = Var(within=Reals,bounds=(1,4),initialize=1)
m.x2 = Var(within=Reals,bounds=(1,4),initialize=1)
m.x3 = Var(within=Reals,bounds=(1,4),initialize=1)
m.x4 = Var(within=Reals,bounds=(1,4),initialize=1)
m.x5 = Var(within=Reals,bounds=(1,4),i... | true | true |
f7565e66153f8c452f5a2f6f65064164698a22fd | 1,712 | py | Python | data_blocks/cuvinte_sablon.py | slevi123/bacalaureat | ed016d0ab04cda7d166c36c0ff4cee63acdd6449 | [
"MIT"
] | 1 | 2022-03-09T06:46:18.000Z | 2022-03-09T06:46:18.000Z | data_blocks/cuvinte_sablon.py | slevi123/bacalaureat | ed016d0ab04cda7d166c36c0ff4cee63acdd6449 | [
"MIT"
] | null | null | null | data_blocks/cuvinte_sablon.py | slevi123/bacalaureat | ed016d0ab04cda7d166c36c0ff4cee63acdd6449 | [
"MIT"
] | null | null | null | from models import Substantiv, Verb, StructAlt
cuvinte_din_enigma_otiliei = [
[Substantiv,
lambda cuvant:cuvant["singular"]["nume"],
"search_value",
[
{"singular": {"nume": "", "nev": ""}},
{"singular": {"nume": "", "nev": ""}},
{"singular": {"nume": "",... | 33.568627 | 53 | 0.317757 | from models import Substantiv, Verb, StructAlt
cuvinte_din_enigma_otiliei = [
[Substantiv,
lambda cuvant:cuvant["singular"]["nume"],
"search_value",
[
{"singular": {"nume": "", "nev": ""}},
{"singular": {"nume": "", "nev": ""}},
{"singular": {"nume": "",... | true | true |
f7565ea1f06e52213c7c98c983a81fa8b020ab60 | 4,930 | py | Python | face_module/mtcnn_pytorch/src/get_nets.py | furkanc/Yolov3-Face-Recognition | d3074490a6a7bf83925319ed521b557919d0af7e | [
"MIT"
] | 4 | 2019-05-27T06:01:50.000Z | 2021-05-13T00:52:32.000Z | face_module/mtcnn_pytorch/src/get_nets.py | furkanc/Yolov3-Face-Recognition | d3074490a6a7bf83925319ed521b557919d0af7e | [
"MIT"
] | 1 | 2019-11-08T07:28:41.000Z | 2019-11-08T07:44:06.000Z | face_module/mtcnn_pytorch/src/get_nets.py | furkanc/Yolov3-Face-Recognition | d3074490a6a7bf83925319ed521b557919d0af7e | [
"MIT"
] | 1 | 2019-05-19T05:35:19.000Z | 2019-05-19T05:35:19.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import numpy as np
class Flatten(nn.Module):
def __init__(self):
super(Flatten, self).__init__()
def forward(self, x):
"""
Arguments:
x: a float tensor with shape [batch... | 29 | 79 | 0.506085 | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import numpy as np
class Flatten(nn.Module):
def __init__(self):
super(Flatten, self).__init__()
def forward(self, x):
x = x.transpose(3, 2).contiguous()
return x.view(x.... | true | true |
f756615778fe62058b5161629864358d5a0405c7 | 3,728 | py | Python | sudan-art/django-backend/sudan_art/views.py | osintalex/sudan-art | ad7b25fe02d45b62b67b1eb60930ae0cde0ffb9c | [
"CC-BY-4.0"
] | 1 | 2022-01-01T19:51:17.000Z | 2022-01-01T19:51:17.000Z | sudan-art/django-backend/sudan_art/views.py | osintalex/sudan-art | ad7b25fe02d45b62b67b1eb60930ae0cde0ffb9c | [
"CC-BY-4.0"
] | 10 | 2022-03-19T12:40:34.000Z | 2022-03-30T21:02:13.000Z | sudan-art/django-backend/sudan_art/views.py | osintalex/sudan-art | ad7b25fe02d45b62b67b1eb60930ae0cde0ffb9c | [
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Application views.
"""
# pylint: disable=W0223,E1101,W1203
import logging
from django.core.exceptions import ValidationError
from rest_framework import fields, filters, generics, serializers, status
from rest_framework.decorators import api_view, parser_classes
from rest_framework.paginat... | 35.504762 | 85 | 0.70735 |
import logging
from django.core.exceptions import ValidationError
from rest_framework import fields, filters, generics, serializers, status
from rest_framework.decorators import api_view, parser_classes
from rest_framework.pagination import PageNumberPagination
from rest_framework.parsers import FormParser, MultiP... | true | true |
f756615c00cbb335ecd24a2e36855b84220e055a | 338 | py | Python | autos/utils/hash.py | hans-t/autos | 4cb370187cb7a8104cedb1942a4c159033729677 | [
"MIT"
] | 1 | 2016-08-17T15:34:15.000Z | 2016-08-17T15:34:15.000Z | autos/utils/hash.py | hans-t/autos | 4cb370187cb7a8104cedb1942a4c159033729677 | [
"MIT"
] | 6 | 2016-08-17T15:34:55.000Z | 2021-04-30T20:38:05.000Z | autos/utils/hash.py | hans-t/autos | 4cb370187cb7a8104cedb1942a4c159033729677 | [
"MIT"
] | null | null | null | from hashlib import md5
from hashlib import sha1
def hash_str(string, hash_type='md5'):
byte = string.encode('UTF-8')
if hash_type == 'md5':
hasher = md5
elif hash_type == 'sha1':
hasher = sha1
else:
raise ValueError('Unknown hash type: {}'.format(hash_type))
return hasher(... | 24.142857 | 67 | 0.633136 | from hashlib import md5
from hashlib import sha1
def hash_str(string, hash_type='md5'):
byte = string.encode('UTF-8')
if hash_type == 'md5':
hasher = md5
elif hash_type == 'sha1':
hasher = sha1
else:
raise ValueError('Unknown hash type: {}'.format(hash_type))
return hasher(... | true | true |
f756622ffb2c3ae187fcbd69ad4a0a50abc817c6 | 519 | py | Python | mtw/fl_user/admin.py | subhasrim2001/medical-transcription-website | b8dd823384a9b9381497c319f379c84e6e2c8516 | [
"MIT"
] | null | null | null | mtw/fl_user/admin.py | subhasrim2001/medical-transcription-website | b8dd823384a9b9381497c319f379c84e6e2c8516 | [
"MIT"
] | null | null | null | mtw/fl_user/admin.py | subhasrim2001/medical-transcription-website | b8dd823384a9b9381497c319f379c84e6e2c8516 | [
"MIT"
] | null | null | null | from django.contrib import admin
from fl_user.models import Job_status
from django.contrib import admin
# Register your models here.
class CustomUserAdmin(admin.ModelAdmin):
list_display = ('Doctor_user','date_submitted','assign_first_level_user','is_asigned','transcription_completed', 'QA_passed')
search_fie... | 28.833333 | 129 | 0.747592 | from django.contrib import admin
from fl_user.models import Job_status
from django.contrib import admin
class CustomUserAdmin(admin.ModelAdmin):
list_display = ('Doctor_user','date_submitted','assign_first_level_user','is_asigned','transcription_completed', 'QA_passed')
search_fields = ('Doctor_user',)
r... | true | true |
f756624491bcf7a247efcc87bddc9fc039726bc6 | 12,190 | py | Python | test/integration/ggrc_basic_permissions/test_creator_program.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | null | null | null | test/integration/ggrc_basic_permissions/test_creator_program.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 12 | 2015-01-08T14:50:19.000Z | 2017-11-29T19:37:53.000Z | test/integration/ggrc_basic_permissions/test_creator_program.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 1 | 2015-01-08T13:25:09.000Z | 2015-01-08T13:25:09.000Z | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""
Test Creator role with Program scoped roles
"""
from integration.ggrc impor... | 32.768817 | 78 | 0.482034 |
from integration.ggrc import TestCase
from ggrc.models import all_models
from integration.ggrc.api_helper import Api
from integration.ggrc.generator import Generator
from integration.ggrc.generator import ObjectGenerator
from ggrc import db
class TestCreatorProgram(TestCase):
def setUp(self):
TestCase.se... | true | true |
f75663421848f4519418ed560ae776bd29f8f546 | 6,827 | py | Python | yt/frontends/halo_catalog/io.py | Xarthisius/yt | 321643c3abff64a6f132d98d0747f3558f7552a3 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-09-15T08:17:43.000Z | 2021-09-15T08:17:43.000Z | yt/frontends/halo_catalog/io.py | Xarthisius/yt | 321643c3abff64a6f132d98d0747f3558f7552a3 | [
"BSD-3-Clause-Clear"
] | 31 | 2017-04-19T21:07:18.000Z | 2017-04-20T01:08:43.000Z | yt/frontends/halo_catalog/io.py | stonnes/yt | aad3cfa3b4ebab7838352ab467275a27c26ff363 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-04-21T07:01:51.000Z | 2021-04-21T07:01:51.000Z | from collections import defaultdict
import numpy as np
from yt.frontends.gadget_fof.io import IOHandlerGadgetFOFHaloHDF5
from yt.funcs import parse_h5_attr
from yt.units.yt_array import uvstack
from yt.utilities.io_handler import BaseIOHandler
from yt.utilities.on_demand_imports import _h5py as h5py
class IOHandler... | 40.636905 | 88 | 0.582833 | from collections import defaultdict
import numpy as np
from yt.frontends.gadget_fof.io import IOHandlerGadgetFOFHaloHDF5
from yt.funcs import parse_h5_attr
from yt.units.yt_array import uvstack
from yt.utilities.io_handler import BaseIOHandler
from yt.utilities.on_demand_imports import _h5py as h5py
class IOHandler... | true | true |
f7566610b35cb0c8c50196fcfd8ace0a1057279c | 1,450 | py | Python | samples/generated_samples/aiplatform_generated_aiplatform_v1_vizier_service_get_study_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1_vizier_service_get_study_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_generated_aiplatform_v1_vizier_service_get_study_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"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 or... | 31.521739 | 85 | 0.75931 |
from google.cloud import aiplatform_v1
def sample_get_study():
client = aiplatform_v1.VizierServiceClient()
request = aiplatform_v1.GetStudyRequest(
name="name_value",
)
response = client.get_study(request=request)
print(response)
| true | true |
f756668fc5be73bda1e0c70f6cecf2ac45a6991a | 9,676 | py | Python | src/main.py | zdszero/SortVisualizer | 7288155ebb3cec602ad94a7674b50976967f7ea4 | [
"MIT"
] | 1 | 2020-05-26T15:49:12.000Z | 2020-05-26T15:49:12.000Z | src/main.py | ZDS1999/SortVisualizer | 7288155ebb3cec602ad94a7674b50976967f7ea4 | [
"MIT"
] | null | null | null | src/main.py | ZDS1999/SortVisualizer | 7288155ebb3cec602ad94a7674b50976967f7ea4 | [
"MIT"
] | null | null | null | from form import Ui_Widget
from algorithm import Sorter
from globals import dprint
import globals
from PySide2 import QtCore, QtWidgets, QtGui
import sys
import random
class Widget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.ui = Ui_Widget()
self.ui.setupUi(self)
... | 37.072797 | 100 | 0.602832 | from form import Ui_Widget
from algorithm import Sorter
from globals import dprint
import globals
from PySide2 import QtCore, QtWidgets, QtGui
import sys
import random
class Widget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.ui = Ui_Widget()
self.ui.setupUi(self)
... | true | true |
f75666f559e419868dd42ff96006aa19ccee8c35 | 2,047 | py | Python | snownlp/classification/bayes.py | raxxarr/snownlp | ebd38b8e2eb31ef5007a73fcc595ed1ca3c73f7c | [
"MIT"
] | null | null | null | snownlp/classification/bayes.py | raxxarr/snownlp | ebd38b8e2eb31ef5007a73fcc595ed1ca3c73f7c | [
"MIT"
] | null | null | null | snownlp/classification/bayes.py | raxxarr/snownlp | ebd38b8e2eb31ef5007a73fcc595ed1ca3c73f7c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import gzip
import marshal
from math import log, exp
from ..utils.frequency import AddOneProb
class Bayes(object):
def __init__(self):
self.d = {}
self.total = 0
def save(self, fname, iszip=True):
d = {}
... | 26.934211 | 74 | 0.448461 |
from __future__ import unicode_literals
import sys
import gzip
import marshal
from math import log, exp
from ..utils.frequency import AddOneProb
class Bayes(object):
def __init__(self):
self.d = {}
self.total = 0
def save(self, fname, iszip=True):
d = {}
d['total'] = self.... | true | true |
f75667e9e0cd2f72b9b14ded8a8272cadd6bbaa9 | 1,591 | py | Python | eslearn/machine_learning/test/GCNNCourseCodes/metrics.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | 46 | 2020-03-27T01:19:18.000Z | 2022-02-11T09:17:00.000Z | eslearn/machine_learning/test/GCNNCourseCodes/metrics.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | null | null | null | eslearn/machine_learning/test/GCNNCourseCodes/metrics.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | 5 | 2020-03-29T23:41:17.000Z | 2020-10-05T12:40:12.000Z | import tensorflow as tf
def masked_softmax_cross_entropy(preds, labels, mask):
"""Softmax cross-entropy loss with masking."""
loss = tf.nn.softmax_cross_entropy_with_logits(logits=preds, labels=labels)
mask = tf.cast(mask, dtype=tf.float32)
mask /= tf.reduce_mean(mask)
loss *= mask
return ... | 35.355556 | 83 | 0.719045 | import tensorflow as tf
def masked_softmax_cross_entropy(preds, labels, mask):
loss = tf.nn.softmax_cross_entropy_with_logits(logits=preds, labels=labels)
mask = tf.cast(mask, dtype=tf.float32)
mask /= tf.reduce_mean(mask)
loss *= mask
return tf.reduce_mean(loss)
def sigmoid_cross_entropy(pre... | true | true |
f756684cc9ecab28ad20d858db62322ba1c36d1a | 75,476 | py | Python | wagtail/admin/tests/pages/test_edit_page.py | danbentley/wagtail | 6ea0cc52f37ef5f6ed27b6f357fcce1efab90495 | [
"BSD-3-Clause"
] | null | null | null | wagtail/admin/tests/pages/test_edit_page.py | danbentley/wagtail | 6ea0cc52f37ef5f6ed27b6f357fcce1efab90495 | [
"BSD-3-Clause"
] | null | null | null | wagtail/admin/tests/pages/test_edit_page.py | danbentley/wagtail | 6ea0cc52f37ef5f6ed27b6f357fcce1efab90495 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import os
from unittest import mock
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core import mail
from django.core.files.base import ContentFile
from django.http import HttpRequest, HttpResponse
from django... | 43.030787 | 252 | 0.630942 | import datetime
import os
from unittest import mock
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core import mail
from django.core.files.base import ContentFile
from django.http import HttpRequest, HttpResponse
from django... | true | true |
f75669fa978e0a2d08ccb46041c531ca095c8cc9 | 11,670 | py | Python | mendeley/config_helpers.py | ScholarTools/ST_mendeley_python | 6a0dd3732958b9f9af7d3a0582bf8d380350fdbf | [
"MIT"
] | null | null | null | mendeley/config_helpers.py | ScholarTools/ST_mendeley_python | 6a0dd3732958b9f9af7d3a0582bf8d380350fdbf | [
"MIT"
] | 8 | 2021-02-08T20:39:22.000Z | 2021-11-02T18:43:59.000Z | mendeley/config_helpers.py | ScholarTools/ST_mendeley_python | 6a0dd3732958b9f9af7d3a0582bf8d380350fdbf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The configuration is a user specified file. This module works with those
user specified files.
The user must currently define a user_config.py file locally. This user_config
file can point to another file outside the repo that gets synced across
computers. More info on this can be fo... | 35.688073 | 157 | 0.584662 |
import sys
import os
import importlib.machinery
import inspect
from . import errors
from . import utils
from .utils import get_list_class_display as cld
def _print_error(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
#from . import utils
#from mendeley.errors import InvalidConfig... | true | true |
f7566ad645bebb62c0cefdc1535721f9ee6c909a | 2,215 | py | Python | hrim_qa/scripts/requester_py.py | peterpolidoro/HRIM | 148a6a5f88543ad1b62efecdccf7bbb2b744877b | [
"Apache-2.0"
] | 32 | 2018-02-05T15:32:19.000Z | 2019-02-14T03:16:38.000Z | hrim_qa/scripts/requester_py.py | peterpolidoro/HRIM | 148a6a5f88543ad1b62efecdccf7bbb2b744877b | [
"Apache-2.0"
] | 24 | 2018-02-06T15:41:56.000Z | 2019-02-18T15:42:35.000Z | hrim_qa/scripts/requester_py.py | peterpolidoro/HRIM | 148a6a5f88543ad1b62efecdccf7bbb2b744877b | [
"Apache-2.0"
] | 17 | 2019-02-21T17:27:31.000Z | 2022-01-21T02:28:16.000Z | #!/usr/bin/python3
import argparse
import importlib
import sys
def requester(service_pkg, service_name, namespace):
import rclpy
# Import the service
module = importlib.import_module(service_pkg + '.srv')
srv_mod = getattr(module, service_name)
req = srv_mod.Request()
resp = srv_mod.Response... | 35.725806 | 92 | 0.626637 |
import argparse
import importlib
import sys
def requester(service_pkg, service_name, namespace):
import rclpy
module = importlib.import_module(service_pkg + '.srv')
srv_mod = getattr(module, service_name)
req = srv_mod.Request()
resp = srv_mod.Response()
srv_fixtures = [[req, resp]]
... | true | true |
f7566ae4b05b8de83e30ed8de3aa05a545870e51 | 10,570 | py | Python | sequana/expdesign.py | brwnj/sequana | 58f6ca47815bf7253f27e4631d971a0a479c3a63 | [
"BSD-3-Clause"
] | null | null | null | sequana/expdesign.py | brwnj/sequana | 58f6ca47815bf7253f27e4631d971a0a479c3a63 | [
"BSD-3-Clause"
] | null | null | null | sequana/expdesign.py | brwnj/sequana | 58f6ca47815bf7253f27e4631d971a0a479c3a63 | [
"BSD-3-Clause"
] | 1 | 2019-10-11T18:21:05.000Z | 2019-10-11T18:21:05.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
# Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>,
# <d.desvillechabrol@gmail.com>
#
# Distributed un... | 31.272189 | 91 | 0.601041 |
r this in self.df.Index_Seq.values:
if isinstance(this, str):
indices = this.split("-")
index1.append(indices[0])
if len(indices) == 2:
index2.append(indices[1])
else:
index2.append(None)... | true | true |
f7566b1b6c0c05932b6f22c1c7f9d9c45cd1b1ed | 239 | py | Python | scripts/item/consume_2436749.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/item/consume_2436749.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/item/consume_2436749.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Created by MechAviv
# Knife Wound Damage Skin (30 Day) | (2436749)
if sm.addDamageSkin(2436749):
sm.chat("'Knife Wound Damage Skin (30 Day)' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() | 47.8 | 119 | 0.723849 |
if sm.addDamageSkin(2436749):
sm.chat("'Knife Wound Damage Skin (30 Day)' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() | true | true |
f7566b601c8fa0b37f052de9ec2e8b1a9852d33a | 9,372 | py | Python | hubspot/crm/objects/models/public_object_search_request.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | 1 | 2020-11-12T08:46:32.000Z | 2020-11-12T08:46:32.000Z | hubspot/crm/objects/models/public_object_search_request.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/objects/models/public_object_search_request.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
CRM Objects
CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported O... | 32.541667 | 1,327 | 0.599872 |
import pprint
import re
import six
from hubspot.crm.objects.configuration import Configuration
class PublicObjectSearchRequest(object):
openapi_types = {
"filter_groups": "list[FilterGroup]",
"sorts": "list[str]",
"query": "str",
"properties": "list[str]",
"limit":... | true | true |
f7566bac9bd290600d24b40875d1b678d8e7ce07 | 37,990 | py | Python | tensorflow/python/ops/while_v2.py | d813s909q/tensortflow | bf16a7511a2d29c460d4e1a771d53ef692a2d32b | [
"Apache-2.0"
] | 2 | 2020-03-20T20:05:13.000Z | 2020-03-20T20:05:15.000Z | tensorflow/python/ops/while_v2.py | wolves7/tensorflow | ae244e6dabeb6b879c5adb9ca4c2a85cb4722dc5 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/while_v2.py | wolves7/tensorflow | ae244e6dabeb6b879c5adb9ca4c2a85cb4722dc5 | [
"Apache-2.0"
] | 1 | 2020-05-15T06:20:58.000Z | 2020-05-15T06:20:58.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.878104 | 88 | 0.722295 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.framework import attr_value_pb2
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import func... | true | true |
f7566e1c1052ee9f99aeef4e4051027bb9624212 | 435 | py | Python | nanalib/nanalib/nanalib/doctype/author/author.py | mohamedhafezqo/nana_library | d429b2a1f2af4ba988e96c86e39985c19b8ffb51 | [
"MIT"
] | null | null | null | nanalib/nanalib/nanalib/doctype/author/author.py | mohamedhafezqo/nana_library | d429b2a1f2af4ba988e96c86e39985c19b8ffb51 | [
"MIT"
] | null | null | null | nanalib/nanalib/nanalib/doctype/author/author.py | mohamedhafezqo/nana_library | d429b2a1f2af4ba988e96c86e39985c19b8ffb51 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, nana and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Author(Document):
pass
@frappe.whitelist()
def test_function(doc_name):
author = frapp... | 19.772727 | 49 | 0.735632 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Author(Document):
pass
@frappe.whitelist()
def test_function(doc_name):
author = frappe.get_doc('Author', doc_name)
author.age = 23
author.save(ignore_permissions = True)
return doc_name
| true | true |
f7566e5a97202843842b8fae8dab83bea7396deb | 17,457 | py | Python | indy_node/server/node_bootstrap.py | eric-erki/indy-node | 7313dd4f948b059b01f992548bf253bde646b432 | [
"Apache-2.0"
] | null | null | null | indy_node/server/node_bootstrap.py | eric-erki/indy-node | 7313dd4f948b059b01f992548bf253bde646b432 | [
"Apache-2.0"
] | null | null | null | indy_node/server/node_bootstrap.py | eric-erki/indy-node | 7313dd4f948b059b01f992548bf253bde646b432 | [
"Apache-2.0"
] | null | null | null | from indy_node.persistence.attribute_store import AttributeStore
from indy_node.persistence.idr_cache import IdrCache
from indy_node.server.pool_config import PoolConfig
from indy_node.server.request_handlers.action_req_handlers.pool_restart_handler import PoolRestartHandler
from indy_node.server.request_handlers.actio... | 66.629771 | 129 | 0.717821 | from indy_node.persistence.attribute_store import AttributeStore
from indy_node.persistence.idr_cache import IdrCache
from indy_node.server.pool_config import PoolConfig
from indy_node.server.request_handlers.action_req_handlers.pool_restart_handler import PoolRestartHandler
from indy_node.server.request_handlers.actio... | true | true |
f7566f422c879480e110d43440af05b8d9e9813b | 1,813 | py | Python | janitor/package/chef/client.py | nilesh-naik/lambda-functions | 5daa2828914d23851538d5c3cb11f36b0f4bac52 | [
"MIT"
] | 77 | 2016-03-15T21:51:11.000Z | 2021-09-15T18:40:25.000Z | janitor/package/chef/client.py | nilesh-naik/lambda-functions | 5daa2828914d23851538d5c3cb11f36b0f4bac52 | [
"MIT"
] | 20 | 2016-04-15T18:40:57.000Z | 2021-06-01T18:59:56.000Z | janitor/package/chef/client.py | nilesh-naik/lambda-functions | 5daa2828914d23851538d5c3cb11f36b0f4bac52 | [
"MIT"
] | 53 | 2016-04-07T07:35:04.000Z | 2022-01-25T18:48:10.000Z | from chef.api import ChefAPI
from chef.base import ChefObject
class Client(ChefObject):
"""A Chef client object."""
url = '/clients'
def _populate(self, data):
self.platform = self.api and self.api.platform
self.private_key = None
if self.platform:
self.orgname = data.... | 30.728814 | 63 | 0.548814 | from chef.api import ChefAPI
from chef.base import ChefObject
class Client(ChefObject):
url = '/clients'
def _populate(self, data):
self.platform = self.api and self.api.platform
self.private_key = None
if self.platform:
self.orgname = data.get('orgname')
self.... | true | true |
f7566fe859d7fa01ea3c413cf42721e95d9a2510 | 966 | py | Python | tests/unit/frames/heartbeat_frame_test.py | simomo/haigha | 59f59e58fd6edb6a4dc2a9e89e7aeff8bfaceaf0 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/frames/heartbeat_frame_test.py | simomo/haigha | 59f59e58fd6edb6a4dc2a9e89e7aeff8bfaceaf0 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/frames/heartbeat_frame_test.py | simomo/haigha | 59f59e58fd6edb6a4dc2a9e89e7aeff8bfaceaf0 | [
"BSD-3-Clause"
] | null | null | null | '''
Copyright (c) 2011-2014, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
from chai import Chai
from haigha.frames import heartbeat_frame
from haigha.frames.heartbeat_frame import HeartbeatFrame
from haigha.frames.frame import Frame
class HeartbeatFrameTest... | 28.411765 | 73 | 0.693582 |
from chai import Chai
from haigha.frames import heartbeat_frame
from haigha.frames.heartbeat_frame import HeartbeatFrame
from haigha.frames.frame import Frame
class HeartbeatFrameTest(Chai):
def test_type(self):
assert_equals(8, HeartbeatFrame.type())
def test_parse(self):
frame = Heartbea... | true | true |
f756704c04df19e2dcc32ed2d6398938bff2a5b2 | 11,819 | py | Python | tests/CLI/modules/report_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | null | null | null | tests/CLI/modules/report_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | null | null | null | tests/CLI/modules/report_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | null | null | null | """
SoftLayer.tests.CLI.modules.report_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import testing
import json
from pprint import pprint as pp
class ReportTests(testing.TestCase):
def test_bandwidth_invalid_date(self):
resul... | 39.661074 | 101 | 0.482528 | from SoftLayer import testing
import json
from pprint import pprint as pp
class ReportTests(testing.TestCase):
def test_bandwidth_invalid_date(self):
result = self.run_command(
[
'report',
'bandwidth',
'--start=welp',
'--end=20... | true | true |
f75670f403facee60df3de85bd9b210fb3d985c9 | 906 | py | Python | setup.py | perdixsw/umpy | 758cb69c370c825b247ff8f7bec1cc1718181c92 | [
"MIT"
] | 1 | 2018-02-07T11:32:19.000Z | 2018-02-07T11:32:19.000Z | setup.py | perdixsw/umpy | 758cb69c370c825b247ff8f7bec1cc1718181c92 | [
"MIT"
] | null | null | null | setup.py | perdixsw/umpy | 758cb69c370c825b247ff8f7bec1cc1718181c92 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from setuptools import setup
setup(
name='umpy',
packages=['umpy',],
version='0.9.9',
url='https://www.github.com/perdixsw/umpy',
download_url='https://www.github.com/perdixsw/umpy/tarball/master',
author='Perdix Software',
author_email='ssmith@perdixsw.com',
description=('Simple unit of... | 31.241379 | 101 | 0.708609 |
from setuptools import setup
setup(
name='umpy',
packages=['umpy',],
version='0.9.9',
url='https://www.github.com/perdixsw/umpy',
download_url='https://www.github.com/perdixsw/umpy/tarball/master',
author='Perdix Software',
author_email='ssmith@perdixsw.com',
description=('Simple unit of measure conversion fo... | true | true |
f7567100c49c475fa2fcb034c8cb38952cac9897 | 5,303 | py | Python | finrl/pairlist/pairlistmanager.py | behnam71/FinRL-Library_Exchange | 13f05667a5fbed734ced350debfb42120f06e384 | [
"MIT"
] | 1 | 2022-01-17T17:49:00.000Z | 2022-01-17T17:49:00.000Z | finrl/pairlist/pairlistmanager.py | behnam71/FinRL-Library_Exchange | 13f05667a5fbed734ced350debfb42120f06e384 | [
"MIT"
] | null | null | null | finrl/pairlist/pairlistmanager.py | behnam71/FinRL-Library_Exchange | 13f05667a5fbed734ced350debfb42120f06e384 | [
"MIT"
] | null | null | null | """
PairList manager class
"""
import logging
from copy import deepcopy
from typing import Dict, List
from cachetools import TTLCache, cached
from finrl.constants import ListPairsWithTimeframes
from finrl.exceptions import OperationalException
from finrl.pairlist.IPairList import IPairList
from finrl.resolvers import... | 37.083916 | 103 | 0.607392 | import logging
from copy import deepcopy
from typing import Dict, List
from cachetools import TTLCache, cached
from finrl.constants import ListPairsWithTimeframes
from finrl.exceptions import OperationalException
from finrl.pairlist.IPairList import IPairList
from finrl.resolvers import PairListResolver
logger = log... | true | true |
f7567121323b7b9f341bfc25c2d36fd385f72ed2 | 540 | py | Python | manage.py | varkon/eparhiaodua | f2a2d6fd3c89748712e38f4035a720c6a7ad7fe3 | [
"Apache-2.0"
] | 2 | 2018-04-24T10:41:11.000Z | 2018-04-24T10:41:15.000Z | manage.py | varkon/eparhia | f2a2d6fd3c89748712e38f4035a720c6a7ad7fe3 | [
"Apache-2.0"
] | null | null | null | manage.py | varkon/eparhia | f2a2d6fd3c89748712e38f4035a720c6a7ad7fe3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eparhia.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eparhia.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's install... | true | true |
f75671bf5482466ffcd0709021b2efad074c22d7 | 287 | py | Python | src/com/python/io/BytesIO_Demo.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/io/BytesIO_Demo.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/io/BytesIO_Demo.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | '''
Created on 2016年8月4日
@author: Administrator
'''
from io import BytesIO
# write to BytesIO:
f = BytesIO()
f.write(b'hello')
f.write(b' ')
f.write(b'world!')
print(f.getvalue())
# read from BytesIO:
data = '人闲桂花落,夜静春山空。月出惊山鸟,时鸣春涧中。'.encode('utf-8')
f = BytesIO(data)
print(f.read()) | 15.944444 | 49 | 0.675958 | from io import BytesIO
f = BytesIO()
f.write(b'hello')
f.write(b' ')
f.write(b'world!')
print(f.getvalue())
data = '人闲桂花落,夜静春山空。月出惊山鸟,时鸣春涧中。'.encode('utf-8')
f = BytesIO(data)
print(f.read()) | true | true |
f75672c2e9cd54c985b3d5c625b32b21978a3bf0 | 3,139 | py | Python | Scripts/lines.py | larksq/Lane-Lines-Detection-and-Localization | f07d7feaca7c5e1132bf22c27745328968441ff0 | [
"MIT"
] | null | null | null | Scripts/lines.py | larksq/Lane-Lines-Detection-and-Localization | f07d7feaca7c5e1132bf22c27745328968441ff0 | [
"MIT"
] | null | null | null | Scripts/lines.py | larksq/Lane-Lines-Detection-and-Localization | f07d7feaca7c5e1132bf22c27745328968441ff0 | [
"MIT"
] | 1 | 2020-12-15T09:08:10.000Z | 2020-12-15T09:08:10.000Z | import numpy as np
class lines:
maxNum = 50
threshold = 1
insist = True
def __init__(self):
# was the line detected in the last iteration?
self.detected = False
# x values of the last n fits of the line
self.recent_xfitted = []
#average x values of the fitted l... | 30.475728 | 138 | 0.558458 | import numpy as np
class lines:
maxNum = 50
threshold = 1
insist = True
def __init__(self):
self.detected = False
self.recent_xfitted = []
self.bestx = None
self.best_fit = None
self.current_fit = [np.array([False])... | true | true |
f75674034e380b36646943d253087f2384c9e4dc | 3,801 | py | Python | python/examples/client_http.py | josusky/qpid-proton | 122355ab5eeed05c7fe1169653387afb1c9fdd95 | [
"Apache-2.0"
] | 2 | 2019-05-20T17:57:24.000Z | 2021-11-06T23:01:16.000Z | python/examples/client_http.py | josusky/qpid-proton | 122355ab5eeed05c7fe1169653387afb1c9fdd95 | [
"Apache-2.0"
] | 33 | 2021-04-27T21:40:31.000Z | 2021-06-30T17:52:17.000Z | python/examples/client_http.py | josusky/qpid-proton | 122355ab5eeed05c7fe1169653387afb1c9fdd95 | [
"Apache-2.0"
] | 7 | 2017-11-02T23:13:56.000Z | 2021-11-06T23:01:05.000Z | #!/usr/bin/env python
#
# 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
# "... | 32.767241 | 97 | 0.663773 |
from __future__ import print_function
import tornado.ioloop
import tornado.web
from tornado.gen import coroutine
from tornado.concurrent import Future
from proton import Message
from proton.handlers import MessagingHandler
from proton_tornado import Container
class Client(MessagingHandler):
def... | true | true |
f756740500996825bfe5444fedd8c58072139826 | 957 | py | Python | zeus/migrations/61a1763b9c8d_reindex_outcomes.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | zeus/migrations/61a1763b9c8d_reindex_outcomes.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | zeus/migrations/61a1763b9c8d_reindex_outcomes.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | """reindex_outcomes
Revision ID: 61a1763b9c8d
Revises: 340d5cc7e806
Create Date: 2019-08-09 12:47:22.165013
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "61a1763b9c8d"
down_revision = "340d5cc7e806"
branch_labels = ()
depends_on = None
def upgrade():
#... | 23.341463 | 65 | 0.646813 | from alembic import op
import sqlalchemy as sa
revision = "61a1763b9c8d"
down_revision = "340d5cc7e806"
branch_labels = ()
depends_on = None
def upgrade():
_created"],
unique=False,
)
| true | true |
f7567425ac74382ee7e51895f5fe4ac6bb9889f6 | 4,995 | py | Python | gbvision/utils/continuity/continues_shape_wrapper.py | computerboy0555/GBVision | 79fc9ba09865bfd9c7a39abaa3980c46ce090b07 | [
"Apache-2.0"
] | 16 | 2019-04-15T18:52:58.000Z | 2022-02-13T23:00:46.000Z | gbvision/utils/continuity/continues_shape_wrapper.py | computerboy0555/GBVision | 79fc9ba09865bfd9c7a39abaa3980c46ce090b07 | [
"Apache-2.0"
] | 2 | 2019-04-15T19:00:05.000Z | 2019-04-19T15:47:21.000Z | gbvision/utils/continuity/continues_shape_wrapper.py | computerboy0555/GBVision | 79fc9ba09865bfd9c7a39abaa3980c46ce090b07 | [
"Apache-2.0"
] | 3 | 2019-05-03T13:48:25.000Z | 2019-09-22T14:03:49.000Z | from typing import List, Dict, Callable, Union
from gbvision.constants.types import Frame, Shape
from gbvision.utils.continuity import ContinuesCircle
from gbvision.utils.continuity.continues_rect import ContinuesRect
from gbvision.utils.continuity import ContinuesRotatedRect
from gbvision.utils.continuity import Cont... | 44.20354 | 181 | 0.662062 | from typing import List, Dict, Callable, Union
from gbvision.constants.types import Frame, Shape
from gbvision.utils.continuity import ContinuesCircle
from gbvision.utils.continuity.continues_rect import ContinuesRect
from gbvision.utils.continuity import ContinuesRotatedRect
from gbvision.utils.continuity import Cont... | true | true |
f75674800390bc264d09c594ded40a61204bc1ad | 674 | py | Python | tests/pyre.pkg/parsing/exceptions.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/pyre.pkg/parsing/exceptions.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/pyre.pkg/parsing/exceptions.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
"""
Tests for all the exceptions raised by this package
"""
def test():
from pyre.parsing.exceptions import (
ParsingError, TokenizationError
)
try:
raise Parsi... | 16.047619 | 67 | 0.62908 |
def test():
from pyre.parsing.exceptions import (
ParsingError, TokenizationError
)
try:
raise ParsingError()
except ParsingError as error:
pass
try:
raise TokenizationError(text=None, locator=None)
except TokenizationError as error:
pass
... | true | true |
f7567489cf1dfdcc62898b30ebf479d71499aaec | 14,012 | py | Python | eeauditor/auditors/aws/AMI_Auditor.py | kbhagi/ElectricEye | 31960e1e1cfb75c5d354844ea9e07d5295442823 | [
"Apache-2.0"
] | 442 | 2020-03-15T20:56:36.000Z | 2022-03-31T22:13:07.000Z | eeauditor/auditors/aws/AMI_Auditor.py | kbhagi/ElectricEye | 31960e1e1cfb75c5d354844ea9e07d5295442823 | [
"Apache-2.0"
] | 57 | 2020-03-15T22:09:56.000Z | 2022-03-31T13:17:06.000Z | eeauditor/auditors/aws/AMI_Auditor.py | kbhagi/ElectricEye | 31960e1e1cfb75c5d354844ea9e07d5295442823 | [
"Apache-2.0"
] | 59 | 2020-03-15T21:19:10.000Z | 2022-03-31T15:01:31.000Z | #This file is part of ElectricEye.
#SPDX-License-Identifier: Apache-2.0
#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 un... | 47.020134 | 160 | 0.452541 |
import boto3
import datetime
from check_register import CheckRegister
registry = CheckRegister()
ec2 = boto3.client("ec2")
def describe_images(cache, awsAccountId):
response = cache.get("describe_images")
if response:
return response
cache["describe_images"] = ec2.describe_ima... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.