hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2e54a1a5dfb8670a48456dadbf819fd0df054a | 4,909 | py | Python | tests/components/homematicip_cloud/test_config_flow.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | tests/components/homematicip_cloud/test_config_flow.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:25:50.000Z | 2022-03-11T23:27:53.000Z | tests/components/homematicip_cloud/test_config_flow.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2018-09-14T07:34:09.000Z | 2018-09-29T12:57:10.000Z | """Tests for HomematicIP Cloud config flow."""
from unittest.mock import patch
from homeassistant.components.homematicip_cloud import hap as hmipc
from homeassistant.components.homematicip_cloud import config_flow, const
from tests.common import MockConfigEntry, mock_coro
async def test_flow_works(hass):
"""Tes... | 32.509934 | 73 | 0.652475 | from unittest.mock import patch
from homeassistant.components.homematicip_cloud import hap as hmipc
from homeassistant.components.homematicip_cloud import config_flow, const
from tests.common import MockConfigEntry, mock_coro
async def test_flow_works(hass):
config = {
const.HMIPC_HAPID: 'ABC123',
... | true | true |
1c2e563df760ccb6ee133e043950867149d7c623 | 335 | py | Python | NyaaPy/__init__.py | jennisu/NyaaPy | 98bdda06c9e104da93ba4882b54eae22864a3844 | [
"MIT"
] | null | null | null | NyaaPy/__init__.py | jennisu/NyaaPy | 98bdda06c9e104da93ba4882b54eae22864a3844 | [
"MIT"
] | null | null | null | NyaaPy/__init__.py | jennisu/NyaaPy | 98bdda06c9e104da93ba4882b54eae22864a3844 | [
"MIT"
] | null | null | null | # Info about the module
__version__ = '0.6.0'
__author__ = 'Juanjo Salvador'
__email__ = 'juanjosalvador@netc.eu'
__url__ = 'http://juanjosalvador.me'
__copyright__ = '2017 Juanjo Salvador'
__license__ = 'MIT license'
from NyaaPy.nyaa import Nyaa
from NyaaPy.pantsu import Pantsu
from NyaaPy.sukebei import SukebeiNyaa,... | 27.916667 | 53 | 0.785075 |
__version__ = '0.6.0'
__author__ = 'Juanjo Salvador'
__email__ = 'juanjosalvador@netc.eu'
__url__ = 'http://juanjosalvador.me'
__copyright__ = '2017 Juanjo Salvador'
__license__ = 'MIT license'
from NyaaPy.nyaa import Nyaa
from NyaaPy.pantsu import Pantsu
from NyaaPy.sukebei import SukebeiNyaa, SukebeiPantsu
| true | true |
1c2e565e4d02626f8384068e317e7bf0892e6770 | 74,175 | py | Python | scripts/mpylib/_base/mnode.py | mpynode/node-designer | ec620f1388337bc0a4e5664d80e1ea6ade8b410e | [
"Unlicense"
] | 63 | 2019-03-18T03:44:28.000Z | 2021-12-31T07:51:09.000Z | scripts/mpylib/_base/mnode.py | mpynode/node-designer | ec620f1388337bc0a4e5664d80e1ea6ade8b410e | [
"Unlicense"
] | 2 | 2019-03-19T10:39:02.000Z | 2020-02-25T06:39:12.000Z | scripts/mpylib/_base/mnode.py | mpynode/node-designer | ec620f1388337bc0a4e5664d80e1ea6ade8b410e | [
"Unlicense"
] | 19 | 2019-03-18T08:05:05.000Z | 2022-01-11T08:37:45.000Z | """
Author: Gene Hansen
This module contains the MNode class and all standalone functions that support
the MNode class. MNode provides an object oriented interface for querying/editing DG nodes inside Maya.
An instance of the MNode class provides storage and access to a single Maya node. MNode uses
a MObject pointer a... | 30.091278 | 130 | 0.598611 | """
Author: Gene Hansen
This module contains the MNode class and all standalone functions that support
the MNode class. MNode provides an object oriented interface for querying/editing DG nodes inside Maya.
An instance of the MNode class provides storage and access to a single Maya node. MNode uses
a MObject pointer a... | false | true |
1c2e57e31ee9856cdbed3b2440d6bec2260be61a | 42,956 | py | Python | zerver/tests/test_home.py | rohanj-02/zulip | fc0488fdb1b83bffea4a300656d7bb7f5e6ab581 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_home.py | rohanj-02/zulip | fc0488fdb1b83bffea4a300656d7bb7f5e6ab581 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_home.py | rohanj-02/zulip | fc0488fdb1b83bffea4a300656d7bb7f5e6ab581 | [
"Apache-2.0"
] | null | null | null | import calendar
import urllib
from datetime import timedelta
from typing import Any
from unittest.mock import patch
import orjson
from django.conf import settings
from django.http import HttpResponse
from django.utils.timezone import now as timezone_now
from corporate.models import Customer, CustomerPlan
from zerver.... | 38.803975 | 100 | 0.634184 | import calendar
import urllib
from datetime import timedelta
from typing import Any
from unittest.mock import patch
import orjson
from django.conf import settings
from django.http import HttpResponse
from django.utils.timezone import now as timezone_now
from corporate.models import Customer, CustomerPlan
from zerver.... | true | true |
1c2e57eb478b88cc278197b05dd422c8b7eec2cb | 2,421 | py | Python | src/ZPublisher/interfaces.py | tseaver/Zope-RFA | 08634f39b0f8b56403a2a9daaa6ee4479ef0c625 | [
"ZPL-2.1"
] | 2 | 2015-12-21T10:34:56.000Z | 2017-09-24T11:07:58.000Z | src/ZPublisher/interfaces.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | src/ZPublisher/interfaces.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | from zope.interface import Interface, Attribute
#############################################################################
# Publication events
# These are events notified in 'ZPublisher.Publish.publish'.
class IPubEvent(Interface):
'''Base class for publication events.
Publication events are notified in... | 33.164384 | 83 | 0.701776 | from zope.interface import Interface, Attribute
| true | true |
1c2e5941f1479ba49f53eb4c158724816054820e | 3,858 | py | Python | linkedin_jobs_scraper/utils/chrome_driver.py | magahet/py-linkedin-jobs-scraper | f0d69053455e68bd8a74ab2d79ab2c27b5e3f7d4 | [
"MIT"
] | 85 | 2020-10-21T04:09:23.000Z | 2022-03-23T00:29:33.000Z | linkedin_jobs_scraper/utils/chrome_driver.py | magahet/py-linkedin-jobs-scraper | f0d69053455e68bd8a74ab2d79ab2c27b5e3f7d4 | [
"MIT"
] | 24 | 2020-11-18T10:10:32.000Z | 2022-03-19T17:30:25.000Z | linkedin_jobs_scraper/utils/chrome_driver.py | magahet/py-linkedin-jobs-scraper | f0d69053455e68bd8a74ab2d79ab2c27b5e3f7d4 | [
"MIT"
] | 23 | 2020-11-18T09:31:13.000Z | 2022-03-25T03:50:52.000Z | import urllib3
import json
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options
from linkedin_jobs_scraper.utils.logger import debug
def get_default_driver_options(width=1472, height=828, headless=True) -> Options:
"""
... | 32.420168 | 111 | 0.708657 | import urllib3
import json
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options
from linkedin_jobs_scraper.utils.logger import debug
def get_default_driver_options(width=1472, height=828, headless=True) -> Options:
chrom... | true | true |
1c2e59e65ce3964676a548c7c0827f760fd7b88b | 1,176 | py | Python | clean.py | braedynl/DasCrazy | 02a3e41631929eaf402116d25299ec252f6fee2f | [
"MIT"
] | 1 | 2021-07-26T05:46:17.000Z | 2021-07-26T05:46:17.000Z | clean.py | braedynl/DasCrazy | 02a3e41631929eaf402116d25299ec252f6fee2f | [
"MIT"
] | null | null | null | clean.py | braedynl/DasCrazy | 02a3e41631929eaf402116d25299ec252f6fee2f | [
"MIT"
] | null | null | null | import pandas as pd
from util import load
def main(raw_filename: str, clean_filename: str) -> None:
raw_data = load(raw_filename)
clean_data = pd.DataFrame(columns=raw_data.columns)
# First chat message to signal a "das crazy" moment
indicator_row = None
for _, row in raw_data.iterrows():
... | 31.783784 | 87 | 0.610544 | import pandas as pd
from util import load
def main(raw_filename: str, clean_filename: str) -> None:
raw_data = load(raw_filename)
clean_data = pd.DataFrame(columns=raw_data.columns)
indicator_row = None
for _, row in raw_data.iterrows():
message = row["message"].lower()
if "c... | true | true |
1c2e5aa505ad967025a5ad570c9e300b8bc1dfaf | 5,096 | py | Python | xarray/tests/test_coding.py | jhamman/xarray-test-docs | c54123772817875678ec7ad769e6d4d6612aeb92 | [
"Apache-2.0"
] | 2,257 | 2016-01-06T01:52:47.000Z | 2022-03-30T10:36:31.000Z | xarray/tests/test_coding.py | jhamman/xarray-test-docs | c54123772817875678ec7ad769e6d4d6612aeb92 | [
"Apache-2.0"
] | 4,934 | 2016-01-05T00:06:37.000Z | 2022-03-31T23:57:36.000Z | xarray/tests/test_coding.py | jhamman/xarray-test-docs | c54123772817875678ec7ad769e6d4d6612aeb92 | [
"Apache-2.0"
] | 925 | 2016-01-07T12:18:45.000Z | 2022-03-28T07:42:09.000Z | from contextlib import suppress
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from xarray.coding import variables
from xarray.conventions import decode_cf_variable, encode_cf_variable
from . import assert_allclose, assert_equal, assert_identical, requires_dask
with suppress(ImportError):
... | 34.432432 | 84 | 0.701334 | from contextlib import suppress
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from xarray.coding import variables
from xarray.conventions import decode_cf_variable, encode_cf_variable
from . import assert_allclose, assert_equal, assert_identical, requires_dask
with suppress(ImportError):
... | true | true |
1c2e5aafe3ab159eff123db0b0e741b4a314b731 | 1,966 | py | Python | internal/notes/builtin-SAVE/packages/r-rmpfr/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/r-rmpfr/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/r-rmpfr/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 45.72093 | 78 | 0.677518 | true | true | |
1c2e5af9ef58185b398507efc2256af2097a2184 | 587 | py | Python | card_utils/games/poker/__init__.py | cdrappi/card_utils | dd12d3be22774cf35d7a6ce6b5f05ff6ee527929 | [
"MIT"
] | null | null | null | card_utils/games/poker/__init__.py | cdrappi/card_utils | dd12d3be22774cf35d7a6ce6b5f05ff6ee527929 | [
"MIT"
] | null | null | null | card_utils/games/poker/__init__.py | cdrappi/card_utils | dd12d3be22774cf35d7a6ce6b5f05ff6ee527929 | [
"MIT"
] | null | null | null | """ poker specific constants """
broadway_ranks = {'T', 'J', 'Q', 'K', 'A'}
STRAIGHT_FLUSH = 'straight flush'
QUADS = 'four of a kind'
FULL_HOUSE = 'full house'
FLUSH = 'flush'
STRAIGHT = 'straight'
THREE_OF_A_KIND = 'three of a kind'
TWO_PAIR = 'two pair'
ONE_PAIR = 'one pair'
HIGH_CARD = 'high card'
hand_order = {... | 18.935484 | 50 | 0.643952 |
broadway_ranks = {'T', 'J', 'Q', 'K', 'A'}
STRAIGHT_FLUSH = 'straight flush'
QUADS = 'four of a kind'
FULL_HOUSE = 'full house'
FLUSH = 'flush'
STRAIGHT = 'straight'
THREE_OF_A_KIND = 'three of a kind'
TWO_PAIR = 'two pair'
ONE_PAIR = 'one pair'
HIGH_CARD = 'high card'
hand_order = {
HIGH_CARD: 0,
ONE_PAIR: ... | true | true |
1c2e5b04acf80c8fcbf410c24c15edcad6285238 | 20,265 | py | Python | dashboard/dashboard/common/utils.py | ncalexan/catapult | d21a98f0ee0bc0394eb93922d0b274fd6ac281d5 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/common/utils.py | ncalexan/catapult | d21a98f0ee0bc0394eb93922d0b274fd6ac281d5 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/common/utils.py | ncalexan/catapult | d21a98f0ee0bc0394eb93922d0b274fd6ac281d5 | [
"BSD-3-Clause"
] | 1 | 2019-04-21T23:48:15.000Z | 2019-04-21T23:48:15.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""General functions which are useful throughout this project."""
import json
import logging
import os
import re
import time
import urllib
from apiclient i... | 30.986239 | 80 | 0.702048 |
import json
import logging
import os
import re
import time
import urllib
from apiclient import discovery
from apiclient import errors
from google.appengine.api import app_identity
from google.appengine.api import memcache
from google.appengine.api import oauth
from google.appengine.api import urlfetch
from google... | true | true |
1c2e5da54ed921047d2d2dc98db94232bc973fcc | 1,992 | py | Python | packages/Python/lldbsuite/test/commands/expression/import-std-module/stack/TestStack.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | packages/Python/lldbsuite/test/commands/expression/import-std-module/stack/TestStack.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | packages/Python/lldbsuite/test/commands/expression/import-std-module/stack/TestStack.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | """
Tests std::stack functionality.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestStack(TestBase):
mydir = TestBase.compute_mydir(__file__)
# FIXME: This should work on more setups, so remove these
# skipIf's in the future... | 39.84 | 80 | 0.611446 |
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestStack(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(["libc++"])
@skipIf(compiler=no_match("clang"))
@skipIf(oslist=no_match(["linux"]))
... | true | true |
1c2e5dc72d3bbd38b07704a9269c71b9217a32ae | 8,929 | py | Python | RE/grb2fig.py | reic/groupLearning-Python-100-Days | 91746e6ee3acf2dbf0e9d324f6c6ce3cb91ed131 | [
"MIT"
] | 4 | 2020-05-21T06:50:52.000Z | 2020-09-07T05:39:24.000Z | RE/grb2fig.py | reic/groupLearning-Python-100-Days | 91746e6ee3acf2dbf0e9d324f6c6ce3cb91ed131 | [
"MIT"
] | 1 | 2020-05-24T07:26:56.000Z | 2020-05-25T00:06:02.000Z | RE/grb2fig.py | reic/groupLearning-Python-100-Days | 91746e6ee3acf2dbf0e9d324f6c6ce3cb91ed131 | [
"MIT"
] | 1 | 2020-11-05T13:03:42.000Z | 2020-11-05T13:03:42.000Z | import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import concurrent.futures
def grb_aggr(files, grb_xlsFileName):
dft = []
for file in files:
dft.append(pd.read_excel(file))
df = pd.concat(dft, ignore_index=True)
# 輸出合併檔
df.to_excel(grb_xlsFileName, index=Fal... | 37.834746 | 202 | 0.586628 | import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import concurrent.futures
def grb_aggr(files, grb_xlsFileName):
dft = []
for file in files:
dft.append(pd.read_excel(file))
df = pd.concat(dft, ignore_index=True)
df.to_excel(grb_xlsFileName, index=False)
... | true | true |
1c2e5de7d7bc7f5f29dee40434b610461ea5fa0b | 8,903 | py | Python | ludwig/serve.py | majacQ/ludwig | 237d832b85d224ef6d1ea53eface5479449caba3 | [
"Apache-2.0"
] | null | null | null | ludwig/serve.py | majacQ/ludwig | 237d832b85d224ef6d1ea53eface5479449caba3 | [
"Apache-2.0"
] | null | null | null | ludwig/serve.py | majacQ/ludwig | 237d832b85d224ef6d1ea53eface5479449caba3 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | 31.129371 | 101 | 0.599124 |
import argparse
import json
import logging
import os
import sys
import tempfile
import pandas as pd
from imageio import imread
from ludwig.api import LudwigModel
from ludwig.constants import COLUMN, AUDIO
from ludwig.contrib import contrib_command, contrib_import
from ludwig.globals import LUDWIG_VERS... | true | true |
1c2e5e21c0f2b7137d89603c9202cf6fefca9953 | 1,837 | py | Python | server/main/management/commands/fix_permissions.py | coll-gate/collgate | 8c2ff1c59adda2bf318040f588c05263317a2812 | [
"MIT"
] | 2 | 2017-07-04T16:19:09.000Z | 2019-08-16T04:54:47.000Z | server/main/management/commands/fix_permissions.py | coll-gate/collgate | 8c2ff1c59adda2bf318040f588c05263317a2812 | [
"MIT"
] | null | null | null | server/main/management/commands/fix_permissions.py | coll-gate/collgate | 8c2ff1c59adda2bf318040f588c05263317a2812 | [
"MIT"
] | 1 | 2018-04-13T08:28:09.000Z | 2018-04-13T08:28:09.000Z | # -*- coding: utf-8; -*-
#
# @file fix_permissions.py
# @brief
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2016-09-01
# @copyright Copyright (c) 2016 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
"""Add permissions for proxy model.
This is needed because of the bug https://code.djangoproject.com/tick... | 35.326923 | 79 | 0.684812 |
from __future__ import unicode_literals, absolute_import, division
import sys
from django.contrib.auth.management import _get_all_permissions
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from... | true | true |
1c2e5e917fc2f3c6f9a285d882f2ed99ff462e22 | 7,277 | py | Python | scripts_dql/script17.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | 1 | 2020-06-14T13:50:28.000Z | 2020-06-14T13:50:28.000Z | scripts_dql/script17.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | scripts_dql/script17.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | # Same as script 15, but there are only 5 actions options, hence the DQN has a smaller output layer.
import sys
import os
lucas_path = os.environ['LUCAS_PATH']
sys.path.insert(1, lucas_path)
from general import general as gen
from devices.devices import node, base_station, mobile_user, d2d_user, d2d_node_type
from p... | 39.983516 | 149 | 0.682699 |
import sys
import os
lucas_path = os.environ['LUCAS_PATH']
sys.path.insert(1, lucas_path)
from general import general as gen
from devices.devices import node, base_station, mobile_user, d2d_user, d2d_node_type
from pathloss import pathloss
from plots.plots import plot_positions, plot_spectral_effs
from q_learning.e... | true | true |
1c2e5eaa434e78501ffc85e65c2a4f21a98ed90f | 2,009 | py | Python | tests/test_pyvmomi_tasks.py | NavyaPalle/vlab_inf_common | 2a220e5543c168f364adf3ab2677bcfd52e5beb3 | [
"Apache-2.0"
] | 1 | 2019-04-10T16:17:27.000Z | 2019-04-10T16:17:27.000Z | tests/test_pyvmomi_tasks.py | NavyaPalle/vlab_inf_common | 2a220e5543c168f364adf3ab2677bcfd52e5beb3 | [
"Apache-2.0"
] | 3 | 2019-03-28T17:39:36.000Z | 2019-05-22T17:08:35.000Z | tests/test_pyvmomi_tasks.py | NavyaPalle/vlab_inf_common | 2a220e5543c168f364adf3ab2677bcfd52e5beb3 | [
"Apache-2.0"
] | 1 | 2020-08-27T11:48:33.000Z | 2020-08-27T11:48:33.000Z | # -*- coding: UTF-8 -*-
"""Unittests for the vlab_inf_common.vmware.tasks module"""
import unittest
from unittest.mock import patch, MagicMock
import vlab_inf_common.vmware.tasks as task_lib
class TestConsumeTask(unittest.TestCase):
"""A set of test cases for the ``consume_task`` function"""
@patch.object(ta... | 33.483333 | 99 | 0.658537 |
import unittest
from unittest.mock import patch, MagicMock
import vlab_inf_common.vmware.tasks as task_lib
class TestConsumeTask(unittest.TestCase):
@patch.object(task_lib, 'time')
def test_happy_path(self, fake_time):
fake_task = MagicMock()
fake_task.info.error = None
fake_task.inf... | true | true |
1c2e5f1a6f2675d5bde9f8ba22a467e54251eb41 | 1,279 | py | Python | Module02/Guess_the_Primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Nathan-Ona | e09f761f837ba7c6c2bfa223a9ed9e987b6260be | [
"MIT"
] | null | null | null | Module02/Guess_the_Primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Nathan-Ona | e09f761f837ba7c6c2bfa223a9ed9e987b6260be | [
"MIT"
] | null | null | null | Module02/Guess_the_Primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Nathan-Ona | e09f761f837ba7c6c2bfa223a9ed9e987b6260be | [
"MIT"
] | null | null | null | # imports the random module that allows for the generation of random values
import random
# Creates divider for program
print('---------------------------')
print(' GUESS THE PRIMER! ')
print('---------------------------')
print()
# Generates random DNA sequence
DNA_goal = random.choice('ACGT')
DNA_goal += rand... | 38.757576 | 104 | 0.659109 |
import random
print('---------------------------')
print(' GUESS THE PRIMER! ')
print('---------------------------')
print()
DNA_goal = random.choice('ACGT')
DNA_goal += random.choice('ACGT')
DNA_goal += random.choice('ACGT')
DNA_goal += random.choice('ACGT')
DNA_goal += random.choice('ACGT')
X = 2
user_nam... | true | true |
1c2e5ff93c9e3a3ea5ad94041810c30dd27d4bfd | 686 | py | Python | src/healthcare/azext_healthcare/_client_factory.py | feiskyer/azure-cli-extensions | a5e1d20c15031ef11c0e388993ea4e86603b33bb | [
"MIT"
] | null | null | null | src/healthcare/azext_healthcare/_client_factory.py | feiskyer/azure-cli-extensions | a5e1d20c15031ef11c0e388993ea4e86603b33bb | [
"MIT"
] | null | null | null | src/healthcare/azext_healthcare/_client_factory.py | feiskyer/azure-cli-extensions | a5e1d20c15031ef11c0e388993ea4e86603b33bb | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.733333 | 94 | 0.587464 |
def cf_healthcare(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from .vendored_sdks.healthcareapis import HealthcareApisManagementClient
return get_mgmt_service_client(cli_ctx, HealthcareApisManagementClient)
def cf_services(cli_ctx, *_):
return cf_heal... | true | true |
1c2e60291d6a6365d4e7b03e7f1fb39162c03e54 | 8,957 | py | Python | odoo/addons/base/tests/test_search.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | odoo/addons/base/tests/test_search.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | odoo/addons/base/tests/test_search.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class test_search(TransactionCase):
def test_00_search_order(self):
# Create 6 partners with a given name, and a given creation order to
# ensure the o... | 59.317881 | 168 | 0.620074 |
from odoo.tests.common import TransactionCase
class test_search(TransactionCase):
def test_00_search_order(self):
Partner = self.env['res.partner']
c = Partner.create({'name': 'test_search_order_C'})
d = Partner.create({'name': 'test_search_order_D'... | true | true |
1c2e603e05c399fbbfce0c3827f887ed09dab251 | 2,178 | py | Python | dp/188.py | fimh/dsa-py | 383c9e9a36304a63668449043b1217aede93dd1e | [
"MIT"
] | 1 | 2019-12-17T09:23:51.000Z | 2019-12-17T09:23:51.000Z | dp/188.py | fimh/dsa-py | 383c9e9a36304a63668449043b1217aede93dd1e | [
"MIT"
] | null | null | null | dp/188.py | fimh/dsa-py | 383c9e9a36304a63668449043b1217aede93dd1e | [
"MIT"
] | null | null | null | """
Question: Best Time to Buy and Sell Stock IV
Difficulty: Hard
Link: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/
Ref: https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/
You are given an integer array prices where prices[i] is the price of a given stock on the i... | 29.835616 | 165 | 0.566575 | from typing import List
class Solution:
def maxProfit(self, k: int, prices: List[int]) -> int:
if len(prices) <= 1:
return 0
times = k
dp = [[[0 for _ in range(2)] for _ in range(times + 1)] for _ in range(len(prices))]
for k in range(times + 1):
dp[0][k]... | true | true |
1c2e603f21f291adba5b57dfc58e8f9764fba114 | 11,169 | py | Python | Sklearn_scipy_numpy/source/sklearn/feature_extraction/tests/test_image.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Sklearn_scipy_numpy/source/sklearn/feature_extraction/tests/test_image.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Sklearn_scipy_numpy/source/sklearn/feature_extraction/tests/test_image.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from scipy import misc
from nose.tools import assert_equal, assert_true
from numpy.testing import asse... | 35.683706 | 79 | 0.64491 |
import numpy as np
import scipy as sp
from scipy import ndimage
from scipy import misc
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn.feature_extraction.image import (
img_to_graph, grid_to_graph, extract_patches_2d,
reconstruct_from_patches_2d, Patch... | true | true |
1c2e603f860b366c183495d66f427a52370e54a5 | 8,379 | py | Python | pippin/snana_fit.py | skuhl99/Pippin | 3cbf4feed71a380eecd57a42b972f9723ae1abd1 | [
"MIT"
] | null | null | null | pippin/snana_fit.py | skuhl99/Pippin | 3cbf4feed71a380eecd57a42b972f9723ae1abd1 | [
"MIT"
] | null | null | null | pippin/snana_fit.py | skuhl99/Pippin | 3cbf4feed71a380eecd57a42b972f9723ae1abd1 | [
"MIT"
] | null | null | null | import inspect
import os
import logging
import shutil
import subprocess
import time
import pandas as pd
from pippin.base import ConfigBasedExecutable
from pippin.config import chown_dir, mkdirs
from pippin.dataprep import DataPrep
from pippin.snana_sim import SNANASimulation
from pippin.task import Task
class SNANAL... | 45.538043 | 159 | 0.622151 | import inspect
import os
import logging
import shutil
import subprocess
import time
import pandas as pd
from pippin.base import ConfigBasedExecutable
from pippin.config import chown_dir, mkdirs
from pippin.dataprep import DataPrep
from pippin.snana_sim import SNANASimulation
from pippin.task import Task
class SNANAL... | true | true |
1c2e60cc093706b62834ad86a94e249ff1421971 | 1,095 | py | Python | raythena/utils/logging.py | dougbenjamin/ray | 6f01cb1af4eb2fdd3c32fb3ebf21bb6405c4b540 | [
"Apache-2.0"
] | 3 | 2019-10-08T22:56:35.000Z | 2021-07-21T23:31:48.000Z | raythena/utils/logging.py | dougbenjamin/ray | 6f01cb1af4eb2fdd3c32fb3ebf21bb6405c4b540 | [
"Apache-2.0"
] | 4 | 2020-07-07T12:30:08.000Z | 2020-09-25T14:18:38.000Z | raythena/utils/logging.py | dougbenjamin/ray | 6f01cb1af4eb2fdd3c32fb3ebf21bb6405c4b540 | [
"Apache-2.0"
] | 5 | 2020-07-06T12:10:36.000Z | 2022-03-09T22:25:25.000Z | import logging
import os
import sys
from raythena.utils.config import Config
def configure_logger(config: Config, file_logging: bool = True) -> None:
"""
Configure the logging format and handlers.
Args:
config: application config
file_logging: if True, write logs to 'config.logging.logfi... | 27.375 | 91 | 0.632877 | import logging
import os
import sys
from raythena.utils.config import Config
def configure_logger(config: Config, file_logging: bool = True) -> None:
if config.logging['level'].lower() == 'debug':
log_level = logging.DEBUG
else:
log_level = config.logging['level'].upper()
handlers = list... | true | true |
1c2e6185f1083da1c3e89b821714bfff2b3c1517 | 28,916 | py | Python | scipy/special/tests/test_data.py | HumHongeKamyaab/scipy | ce61e02e912d15ea28b37ea036334b9ba266ebb5 | [
"BSD-3-Clause"
] | null | null | null | scipy/special/tests/test_data.py | HumHongeKamyaab/scipy | ce61e02e912d15ea28b37ea036334b9ba266ebb5 | [
"BSD-3-Clause"
] | null | null | null | scipy/special/tests/test_data.py | HumHongeKamyaab/scipy | ce61e02e912d15ea28b37ea036334b9ba266ebb5 | [
"BSD-3-Clause"
] | null | null | null | import os
import numpy as np
from numpy import arccosh, arcsinh, arctanh
from numpy.testing import suppress_warnings
import pytest
from scipy.special import (
lpn, lpmn, lpmv, lqn, lqmn, sph_harm, eval_legendre, eval_hermite,
eval_laguerre, eval_genlaguerre, binom, cbrt, expm1, log1p, zeta,
jn, jv, jvp, y... | 46.118022 | 135 | 0.664857 | import os
import numpy as np
from numpy import arccosh, arcsinh, arctanh
from numpy.testing import suppress_warnings
import pytest
from scipy.special import (
lpn, lpmn, lpmv, lqn, lqmn, sph_harm, eval_legendre, eval_hermite,
eval_laguerre, eval_genlaguerre, binom, cbrt, expm1, log1p, zeta,
jn, jv, jvp, y... | true | true |
1c2e62b0fc97c13f9605dc60ea7eadd17f276dde | 483 | py | Python | prep_ons_nuts_gva.py | aeturrell/uk-economy-app | 915272d9843f5bf4ad6ace1d5353e7ae58a7b6be | [
"MIT"
] | null | null | null | prep_ons_nuts_gva.py | aeturrell/uk-economy-app | 915272d9843f5bf4ad6ace1d5353e7ae58a7b6be | [
"MIT"
] | null | null | null | prep_ons_nuts_gva.py | aeturrell/uk-economy-app | 915272d9843f5bf4ad6ace1d5353e7ae58a7b6be | [
"MIT"
] | null | null | null | import pandas as pd
import os
fname = "regionalgrossvalueaddedbalancedbyindustryallnutslevelregions.xlsx"
df = pd.read_excel(os.path.join('scratch', fname),
sheet_name='Table1b',
skiprows=0)
df.columns = df.iloc[0, :]
df = df.iloc[1:, :]
df = df[df['SIC07 code'] == 'Total']
df = ... | 32.2 | 75 | 0.610766 | import pandas as pd
import os
fname = "regionalgrossvalueaddedbalancedbyindustryallnutslevelregions.xlsx"
df = pd.read_excel(os.path.join('scratch', fname),
sheet_name='Table1b',
skiprows=0)
df.columns = df.iloc[0, :]
df = df.iloc[1:, :]
df = df[df['SIC07 code'] == 'Total']
df = ... | true | true |
1c2e649ff99586fff51de52322950e772745dde5 | 3,165 | py | Python | tests/operators/vector/test_smooth_l1_loss_grad_001.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/operators/vector/test_smooth_l1_loss_grad_001.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/operators/vector/test_smooth_l1_loss_grad_001.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.032258 | 114 | 0.612006 |
import datetime
import os
from base import TestBase
import pytest
from test_run.smooth_l1_loss_grad_run import smooth_l1_loss_grad_run
| true | true |
1c2e6507af08539c77c856e95f6d4852bc06d2f2 | 9,590 | py | Python | tests/test_integration.py | repo-helper/formate | 45e4b4fe29af144db714ea90c92cf6e7035ae301 | [
"MIT"
] | 1 | 2022-03-19T07:39:58.000Z | 2022-03-19T07:39:58.000Z | tests/test_integration.py | repo-helper/formate | 45e4b4fe29af144db714ea90c92cf6e7035ae301 | [
"MIT"
] | 14 | 2021-01-25T23:10:04.000Z | 2021-06-29T19:55:38.000Z | tests/test_integration.py | repo-helper/formate | 45e4b4fe29af144db714ea90c92cf6e7035ae301 | [
"MIT"
] | null | null | null | # stdlib
import re
from typing import Union, no_type_check
# 3rd party
import click
import pytest
from _pytest.capture import CaptureResult
from coincidence.regressions import AdvancedDataRegressionFixture, AdvancedFileRegressionFixture
from coincidence.selectors import max_version, min_version, not_pypy, only_pypy
fr... | 25.710456 | 96 | 0.727216 |
import re
from typing import Union, no_type_check
import click
import pytest
from _pytest.capture import CaptureResult
from coincidence.regressions import AdvancedDataRegressionFixture, AdvancedFileRegressionFixture
from coincidence.selectors import max_version, min_version, not_pypy, only_pypy
from consolekit.termi... | true | true |
1c2e65d33801a4fa744793960df341bf946c28ad | 32 | py | Python | {{cookiecutter.package_name}}/{{cookiecutter.package_name}}/__init__.py | simongarisch/cookiecutter_streamlit | 2ef3dafdbc5505b601a0f8aee8fcbf8d0cdbf537 | [
"MIT"
] | 5 | 2020-08-26T03:43:24.000Z | 2021-11-08T10:45:27.000Z | {{cookiecutter.package_name}}/{{cookiecutter.package_name}}/__init__.py | simongarisch/cookiecutter_streamlit | 2ef3dafdbc5505b601a0f8aee8fcbf8d0cdbf537 | [
"MIT"
] | 1 | 2020-08-26T03:42:37.000Z | 2020-08-26T03:42:37.000Z | {{cookiecutter.package_name}}/{{cookiecutter.package_name}}/__init__.py | simongarisch/cookiecutter_streamlit | 2ef3dafdbc5505b601a0f8aee8fcbf8d0cdbf537 | [
"MIT"
] | null | null | null | from . import app # noqa: F401
| 16 | 31 | 0.65625 | from . import app
| true | true |
1c2e67114bdb46bf67592b33e2fdbd16e1e9438f | 5,933 | py | Python | tensorflow/python/ops/math_grad_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 1 | 2016-12-12T09:46:14.000Z | 2016-12-12T09:46:14.000Z | tensorflow/python/ops/math_grad_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/math_grad_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 1 | 2019-11-04T11:58:30.000Z | 2019-11-04T11:58:30.000Z | # Copyright 2016 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... | 38.777778 | 80 | 0.629698 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class SquaredDifferenceOpTest(tf.test.TestCase):
def _testGrad(self, left_shape, right_shape):
if len(left_shape) > len(right_shape):
ou... | true | true |
1c2e67b756b49f212be2f8f1f244e49bdf436db0 | 10,309 | py | Python | rllib/algorithms/maml/maml.py | Gekho457/ray | bed660b085fa9949bca71160addfc0a69931c64b | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/maml/maml.py | Gekho457/ray | bed660b085fa9949bca71160addfc0a69931c64b | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/maml/maml.py | Gekho457/ray | bed660b085fa9949bca71160addfc0a69931c64b | [
"Apache-2.0"
] | null | null | null | import logging
import numpy as np
from typing import Type
from ray.rllib.utils.sgd import standardized
from ray.rllib.agents import with_common_config
from ray.rllib.agents.trainer import Trainer
from ray.rllib.evaluation.metrics import get_learner_stats
from ray.rllib.evaluation.worker_set import WorkerSet
from ray.r... | 36.299296 | 88 | 0.652052 | import logging
import numpy as np
from typing import Type
from ray.rllib.utils.sgd import standardized
from ray.rllib.agents import with_common_config
from ray.rllib.agents.trainer import Trainer
from ray.rllib.evaluation.metrics import get_learner_stats
from ray.rllib.evaluation.worker_set import WorkerSet
from ray.r... | true | true |
1c2e67d0008f1ba063945db94e9b653a9657eba1 | 1,805 | py | Python | pelenet/experiments/nestcomparison.py | sagacitysite/pelene | e8d4112264acb44954c52053b4e3f9d63b46bdd6 | [
"MIT"
] | 10 | 2021-02-09T16:42:37.000Z | 2022-01-10T07:37:00.000Z | pelenet/experiments/nestcomparison.py | sagacitysite/pelene | e8d4112264acb44954c52053b4e3f9d63b46bdd6 | [
"MIT"
] | null | null | null | pelenet/experiments/nestcomparison.py | sagacitysite/pelene | e8d4112264acb44954c52053b4e3f9d63b46bdd6 | [
"MIT"
] | 3 | 2021-02-10T18:12:31.000Z | 2021-09-13T07:40:01.000Z | # Loihi modules
import nxsdk.api.n2a as nx
# Official modules
import numpy as np
import logging
from copy import deepcopy
import os
# Pelenet modules
from ..system import System
from ..system.datalog import Datalog
from ..parameters import Parameters
from ..utils import Utils
from ..plots import Plot
from .readout im... | 29.590164 | 114 | 0.623823 |
import nxsdk.api.n2a as nx
import numpy as np
import logging
from copy import deepcopy
import os
from ..system import System
from ..system.datalog import Datalog
from ..parameters import Parameters
from ..utils import Utils
from ..plots import Plot
from .readout import ReadoutExperiment
from ..network import Reser... | true | true |
1c2e69214588e0c2a8ef0926fa72d22d8951e59d | 39,094 | py | Python | cmake/tribits/ci_support/cdash_analyze_and_report.py | jschueller/seacas | 14c34ae08b757cba43a3a03ec0f129c8a168a9d3 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"NetCDF",
"BSL-1.0",
"X11",
"BSD-3-Clause"
] | 82 | 2016-02-04T18:38:25.000Z | 2022-03-29T03:01:49.000Z | cmake/tribits/ci_support/cdash_analyze_and_report.py | jschueller/seacas | 14c34ae08b757cba43a3a03ec0f129c8a168a9d3 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"NetCDF",
"BSL-1.0",
"X11",
"BSD-3-Clause"
] | 206 | 2015-11-20T01:57:47.000Z | 2022-03-31T21:12:04.000Z | cmake/tribits/ci_support/cdash_analyze_and_report.py | jschueller/seacas | 14c34ae08b757cba43a3a03ec0f129c8a168a9d3 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"NetCDF",
"BSL-1.0",
"X11",
"BSD-3-Clause"
] | 68 | 2016-01-13T22:46:51.000Z | 2022-03-31T06:25:05.000Z | #!/usr/bin/env python
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Govern... | 39.211635 | 119 | 0.709521 |
import sys
import pprint
import datetime
from FindGeneralScriptSupport import *
from GeneralScriptSupport import *
import CDashQueryAnalyzeReport as CDQAR
import cdash_build_testing_date as CBTD
from gitdist import addOptionParserChoiceOption
usageHelp = r"""cdash_analyze... | true | true |
1c2e695906c0fb5c3f800e9224c11c0972d8ec9d | 1,114 | py | Python | examples/debugging_server.py | FelixSchwarz/pymta | ac9b3e23e136bc1387fb9c359eabe6087e5264c8 | [
"MIT"
] | null | null | null | examples/debugging_server.py | FelixSchwarz/pymta | ac9b3e23e136bc1387fb9c359eabe6087e5264c8 | [
"MIT"
] | 6 | 2018-10-11T09:01:48.000Z | 2020-10-07T08:15:40.000Z | examples/debugging_server.py | FelixSchwarz/pymta | ac9b3e23e136bc1387fb9c359eabe6087e5264c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# SPDX-License-Identifier: MIT
"""This module contains an equivalent of Python's DebuggingServer which just
prints all received messages to STDOUT and discards them afterwards."""
import os
import sys
from pymta import PythonMTA, IMessageDeliverer
class STDOUTDeliverer(... | 24.755556 | 76 | 0.645422 |
"""This module contains an equivalent of Python's DebuggingServer which just
prints all received messages to STDOUT and discards them afterwards."""
import os
import sys
from pymta import PythonMTA, IMessageDeliverer
class STDOUTDeliverer(IMessageDeliverer):
def new_message_accepted(self, msg):
print... | false | true |
1c2e6992c079c51b2cb74c6f2314e9a5c7023d15 | 2,904 | py | Python | linkedin-automation/index.py | tusharnankani/Social-Scheduler | 24975ed280047946359ee29052ab315e701aa6c1 | [
"MIT"
] | 16 | 2020-08-10T11:35:30.000Z | 2022-02-15T20:38:19.000Z | linkedin-automation/index.py | tusharnankani/Social-Scheduler | 24975ed280047946359ee29052ab315e701aa6c1 | [
"MIT"
] | 73 | 2020-08-01T23:27:13.000Z | 2020-11-03T05:21:22.000Z | linkedin-automation/index.py | tusharnankani/Social-Scheduler | 24975ed280047946359ee29052ab315e701aa6c1 | [
"MIT"
] | 50 | 2020-08-10T14:14:51.000Z | 2021-12-18T08:33:39.000Z | import os,random,sys,time
#from urllib.parse import urlparse
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
browser = webdriver.Chrome('./driver/chromedriver.exe')
browser.get('https://www.linkedin.com/uas/login')
file=open('./config.txt')
lines=file.readlines()
username=lines[0]
passwo... | 33 | 103 | 0.681474 | import os,random,sys,time
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
browser = webdriver.Chrome('./driver/chromedriver.exe')
browser.get('https://www.linkedin.com/uas/login')
file=open('./config.txt')
lines=file.readlines()
username=lines[0]
password=lines[1]
elementID = browser.... | true | true |
1c2e6a7ca5d9a4aed44dd6bb4ca4cb9a9faf31d0 | 204 | py | Python | Source_Code/Python/testing6.py | fenglwh/instruments | 7886158d1ed97fe6bfe372a55f4fca107e834311 | [
"MIT"
] | null | null | null | Source_Code/Python/testing6.py | fenglwh/instruments | 7886158d1ed97fe6bfe372a55f4fca107e834311 | [
"MIT"
] | 3 | 2018-09-21T00:57:21.000Z | 2018-09-21T01:49:40.000Z | Source_Code/Python/testing6.py | fenglwh/instruments | 7886158d1ed97fe6bfe372a55f4fca107e834311 | [
"MIT"
] | null | null | null | import visa
rs=visa.ResourceManager()
instrument=rs.open_resource("GPIB::20::INSTR")
print('init ok')
instrument.write('CONF:WLAN:SIGN1:CONN:CCODe:CCC?')
print(instrument.read())
instrument.write('*GTL') | 25.5 | 51 | 0.759804 | import visa
rs=visa.ResourceManager()
instrument=rs.open_resource("GPIB::20::INSTR")
print('init ok')
instrument.write('CONF:WLAN:SIGN1:CONN:CCODe:CCC?')
print(instrument.read())
instrument.write('*GTL') | true | true |
1c2e6d289f4ec58a738045f39a1e1dabf66fac88 | 1,614 | py | Python | tests/test_hashcrypto.py | janbrohl/hashcrypto | ba32a7f43992e25a4b199f7f427fc48f3f237353 | [
"BSD-3-Clause"
] | 1 | 2017-03-19T09:13:00.000Z | 2017-03-19T09:13:00.000Z | tests/test_hashcrypto.py | janbrohl/hashcrypto | ba32a7f43992e25a4b199f7f427fc48f3f237353 | [
"BSD-3-Clause"
] | 1 | 2018-05-12T10:36:53.000Z | 2018-05-12T10:36:53.000Z | tests/test_hashcrypto.py | janbrohl/hashcrypto | ba32a7f43992e25a4b199f7f427fc48f3f237353 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, unicode_literals
import unittest
import hashcrypto
import io
def notrandom(n,start=0):
return bytearray(0xff&i for i in range(start,start+n))
class TestCipherModes(unittest.TestCase):
def setUp(self):
self.inbytes=notrandom(1000)
self.key=notrandom(20)
... | 28.821429 | 62 | 0.687113 | from __future__ import print_function, unicode_literals
import unittest
import hashcrypto
import io
def notrandom(n,start=0):
return bytearray(0xff&i for i in range(start,start+n))
class TestCipherModes(unittest.TestCase):
def setUp(self):
self.inbytes=notrandom(1000)
self.key=notrandom(20)
... | true | true |
1c2e6df6c8dac011078fe392b64fca0a921b7ab0 | 2,515 | py | Python | src/ukw_tools/extern/video_annotations.py | Maddonix/ukw_tools | faaef987d06b232a32745fb497ed705f73f07aa3 | [
"MIT"
] | null | null | null | src/ukw_tools/extern/video_annotations.py | Maddonix/ukw_tools | faaef987d06b232a32745fb497ed705f73f07aa3 | [
"MIT"
] | null | null | null | src/ukw_tools/extern/video_annotations.py | Maddonix/ukw_tools | faaef987d06b232a32745fb497ed705f73f07aa3 | [
"MIT"
] | null | null | null | from bson import ObjectId
from ..classes.video_segmentation import VideoSegmentation
def convert_extern_annotation(annotation):
# video_segmentation = {}
annotation_by_label = {}
label_annotation_index = {}
dates = [_.date for _ in annotation]
max_date = max(dates)
# create a dict with all lab... | 35.928571 | 93 | 0.675149 | from bson import ObjectId
from ..classes.video_segmentation import VideoSegmentation
def convert_extern_annotation(annotation):
annotation_by_label = {}
label_annotation_index = {}
dates = [_.date for _ in annotation]
max_date = max(dates)
for i, _annotation in enumerate(annotation):
... | true | true |
1c2e6e24b71793733105f5765e661a2c5fcb9aa6 | 4,102 | py | Python | azure/mgmt/storage/v2015_06_15/operations/usage_operations.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/storage/v2015_06_15/operations/usage_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/storage/v2015_06_15/operations/usage_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.825243 | 144 | 0.626524 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class UsageOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
... | true | true |
1c2e6e50911c13e2d434c53394dcaf827b8110e0 | 1,145 | py | Python | constant/DaemonConstant.py | handsomezhou/PyDemo | 47bf4a87caba6307ffad557bf7abcbd978604469 | [
"Apache-2.0"
] | null | null | null | constant/DaemonConstant.py | handsomezhou/PyDemo | 47bf4a87caba6307ffad557bf7abcbd978604469 | [
"Apache-2.0"
] | null | null | null | constant/DaemonConstant.py | handsomezhou/PyDemo | 47bf4a87caba6307ffad557bf7abcbd978604469 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021/5/25
# @Author : handsomezhou
from util import TimeUtil
PY_DEMO_DAEMON_CHECK_INTERVAL_TIME_SEC = int(15)
PY_DEMO_CHECK_INTERVAL_TIME_SEC = int(20)
#PyDemo心跳时间更新最小间隔时间秒
PY_DEMO_HEARTBEAT_TIME_UPDATE_MIN_INTERVAL_TIME_SEC=int(30)
#PyDemo心跳时间更新最小间隔时间毫秒
PY_DEMO_HEARTBEAT_TIME_UPDAT... | 38.166667 | 133 | 0.908297 |
from util import TimeUtil
PY_DEMO_DAEMON_CHECK_INTERVAL_TIME_SEC = int(15)
PY_DEMO_CHECK_INTERVAL_TIME_SEC = int(20)
PY_DEMO_HEARTBEAT_TIME_UPDATE_MIN_INTERVAL_TIME_SEC=int(30)
PY_DEMO_HEARTBEAT_TIME_UPDATE_MIN_INTERVAL_TIME_MS=TimeUtil.sec2ms(PY_DEMO_HEARTBEAT_TIME_UPDATE_MIN_INTERVAL_TIME_SEC)
PY_DEMO_HEARTB... | true | true |
1c2e6ebb189720cacb8e35400a05b9d29c27f0fd | 2,925 | py | Python | bin/fix_requests/fix_request_4208.py | PRIMAVERA-H2020/pre-proc | 0c47636cbe32a13a9544f3e5ce9f4c778dc55078 | [
"BSD-3-Clause"
] | null | null | null | bin/fix_requests/fix_request_4208.py | PRIMAVERA-H2020/pre-proc | 0c47636cbe32a13a9544f3e5ce9f4c778dc55078 | [
"BSD-3-Clause"
] | null | null | null | bin/fix_requests/fix_request_4208.py | PRIMAVERA-H2020/pre-proc | 0c47636cbe32a13a9544f3e5ce9f4c778dc55078 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
fix_request_4208.py
EC-Earth-Consortium.*.highresSST-present.r1i1p1f1.6hrPlev.wap4
Set the cell_methods "area: time: mean"
"""
import argparse
import logging.config
import sys
import django
django.setup()
from pre_proc_app.models import DataRequest, FileFix
__version__ = '0.1.0b1'
DEFAU... | 25.884956 | 80 | 0.571282 |
import argparse
import logging.config
import sys
import django
django.setup()
from pre_proc_app.models import DataRequest, FileFix
__version__ = '0.1.0b1'
DEFAULT_LOG_LEVEL = logging.WARNING
DEFAULT_LOG_FORMAT = '%(levelname)s: %(message)s'
logger = logging.getLogger(__name__)
def parse_args():
parser = ar... | true | true |
1c2e6f90232b3e315ce68699f89badcb1998a267 | 4,622 | py | Python | wagtail/admin/menu.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 3 | 2019-05-14T13:43:08.000Z | 2021-11-09T11:27:18.000Z | wagtail/admin/menu.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 4 | 2021-03-19T00:33:36.000Z | 2022-03-11T23:47:17.000Z | wagtail/admin/menu.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 1 | 2021-08-13T15:38:43.000Z | 2021-08-13T15:38:43.000Z | from django.forms import Media, MediaDefiningClass
from django.forms.utils import flatatt
from django.template.loader import render_to_string
from django.templatetags.static import static
from django.utils.safestring import mark_safe
from django.utils.text import slugify
from wagtail.core import hooks
class MenuItem... | 36.109375 | 107 | 0.676763 | from django.forms import Media, MediaDefiningClass
from django.forms.utils import flatatt
from django.template.loader import render_to_string
from django.templatetags.static import static
from django.utils.safestring import mark_safe
from django.utils.text import slugify
from wagtail.core import hooks
class MenuItem... | true | true |
1c2e6fcef6dc4f8cf45a1ffb8f2bd2bb9f47c2d7 | 1,157 | py | Python | dashlib/mnb_makevote.py | chaeplin/dash-mnb | edf965f590de57c4b3ed5136dc46961f2673e41c | [
"MIT"
] | 18 | 2017-02-20T19:38:52.000Z | 2021-03-24T23:39:47.000Z | dashlib/mnb_makevote.py | chaeplin/dash-mnb | edf965f590de57c4b3ed5136dc46961f2673e41c | [
"MIT"
] | 3 | 2017-03-10T15:32:34.000Z | 2017-12-12T10:58:14.000Z | dashlib/mnb_makevote.py | chaeplin/dash-mnb | edf965f590de57c4b3ed5136dc46961f2673e41c | [
"MIT"
] | 5 | 2017-03-10T22:37:06.000Z | 2020-10-22T20:35:26.000Z | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
import time
import random
from dash_utils import *
from mnb_misc import *
from mnb_signing import *
def make_vote(
alias,
proposal_hash,
vote,
mnconfig):
print('%s : %s : %s ' % (alias, vote, prop... | 21.830189 | 61 | 0.575627 | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
import time
import random
from dash_utils import *
from mnb_misc import *
from mnb_signing import *
def make_vote(
alias,
proposal_hash,
vote,
mnconfig):
print('%s : %s : %s ' % (alias, vote, prop... | true | true |
1c2e711a531de4bb38415cef5b318c047f0e40ef | 539 | py | Python | cc_vary_header/records/mappings/__init__.py | equadon/cookiecutter-instance-vary-header | 6a774f6eceb5bdef07245433eae6702f4306d1ba | [
"MIT"
] | null | null | null | cc_vary_header/records/mappings/__init__.py | equadon/cookiecutter-instance-vary-header | 6a774f6eceb5bdef07245433eae6702f4306d1ba | [
"MIT"
] | null | null | null | cc_vary_header/records/mappings/__init__.py | equadon/cookiecutter-instance-vary-header | 6a774f6eceb5bdef07245433eae6702f4306d1ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CERN.
#
# CC Vary Header is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Mappings.
Mappings define how records and their fields will be indexed in Elasticsearch.
The provided record-v1... | 31.705882 | 78 | 0.764378 |
from __future__ import absolute_import, print_function
| true | true |
1c2e717c8a47d6c7d51f81414765e9b73312c608 | 940 | py | Python | boa_test/example/demo/IteratorTest.py | mixbee/neo-boa | da7366c26c7b8e60afb9ac27439a1da37b0be355 | [
"MIT"
] | 4 | 2018-08-22T03:30:34.000Z | 2019-04-16T10:54:08.000Z | boa_test/example/demo/IteratorTest.py | mixbee/neo-boa | da7366c26c7b8e60afb9ac27439a1da37b0be355 | [
"MIT"
] | 3 | 2018-09-03T09:19:26.000Z | 2019-01-24T00:06:29.000Z | boa_test/example/demo/IteratorTest.py | mixbee/neo-boa | da7366c26c7b8e60afb9ac27439a1da37b0be355 | [
"MIT"
] | 12 | 2018-07-19T06:36:44.000Z | 2019-05-13T05:45:58.000Z | from boa.interop.Neo.Iterator import *
def Main(testNum):
items = {
'a': 1,
'c': 4,
'f': 13
}
vals = IterCreate(items)
if testNum == 1:
while IterNext(vals):
print("next!")
print("ok done")
return True
if testNum == 2:
cou... | 15.932203 | 38 | 0.446809 | from boa.interop.Neo.Iterator import *
def Main(testNum):
items = {
'a': 1,
'c': 4,
'f': 13
}
vals = IterCreate(items)
if testNum == 1:
while IterNext(vals):
print("next!")
print("ok done")
return True
if testNum == 2:
cou... | true | true |
1c2e74341ab2c5299f6ccdc750677bace94844cc | 874 | py | Python | InvenTree/stock/migrations/0057_stock_location_item_owner.py | carlos-riquelme/InvenTree | 724dd2a9c82e4c10e14bd6aba8f48553b183fef9 | [
"MIT"
] | 656 | 2017-03-29T22:06:14.000Z | 2022-03-30T11:23:52.000Z | InvenTree/stock/migrations/0057_stock_location_item_owner.py | carlos-riquelme/InvenTree | 724dd2a9c82e4c10e14bd6aba8f48553b183fef9 | [
"MIT"
] | 1,545 | 2017-04-10T23:26:04.000Z | 2022-03-31T18:32:10.000Z | InvenTree/stock/migrations/0057_stock_location_item_owner.py | fablabbcn/InvenTree | 1d7ea7716cc96c6ffd151c822b01cd1fb5dcfecd | [
"MIT"
] | 196 | 2017-03-28T03:06:21.000Z | 2022-03-28T11:53:29.000Z | # Generated by Django 3.0.7 on 2021-01-11 21:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0005_owner_model'),
('stock', '0056_stockitem_expiry_date'),
]
operations = [
migrations.A... | 33.615385 | 181 | 0.648741 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0005_owner_model'),
('stock', '0056_stockitem_expiry_date'),
]
operations = [
migrations.AddField(
model_name='stockitem',
... | true | true |
1c2e79341d86580e2a9ea356f0068245887be687 | 7,871 | py | Python | tf2_gnn/data/jsonl_graph_dataset.py | dahburj/tf2-gnn | ac6247c44957b35a478de4bbe13c0c96e82f0ba1 | [
"MIT"
] | null | null | null | tf2_gnn/data/jsonl_graph_dataset.py | dahburj/tf2-gnn | ac6247c44957b35a478de4bbe13c0c96e82f0ba1 | [
"MIT"
] | null | null | null | tf2_gnn/data/jsonl_graph_dataset.py | dahburj/tf2-gnn | ac6247c44957b35a478de4bbe13c0c96e82f0ba1 | [
"MIT"
] | 1 | 2021-04-22T12:46:26.000Z | 2021-04-22T12:46:26.000Z | """General dataset class for datasets stored as JSONLines files."""
import logging
from typing import Any, Dict, Iterator, List, Optional, Tuple, Set
import numpy as np
from dpu_utils.utils import RichPath
from .graph_dataset import DataFold, GraphDataset, GraphSampleType, GraphSample
logger = logging.getLogger(__na... | 44.721591 | 99 | 0.650362 | import logging
from typing import Any, Dict, Iterator, List, Optional, Tuple, Set
import numpy as np
from dpu_utils.utils import RichPath
from .graph_dataset import DataFold, GraphDataset, GraphSampleType, GraphSample
logger = logging.getLogger(__name__)
class JsonLGraphDataset(GraphDataset[GraphSampleType]):
... | true | true |
1c2e797e399706d5a8b5cbb79669143ef784f79c | 1,117 | py | Python | setup.py | ragnarok22/ptb-django-cookiecutter | 4a06df669052ec24fcca47c01c50bc20fc0a8561 | [
"BSD-3-Clause"
] | 18 | 2021-06-23T07:41:26.000Z | 2022-02-04T07:56:39.000Z | setup.py | ragnarok22/ptb-django-cookiecutter | 4a06df669052ec24fcca47c01c50bc20fc0a8561 | [
"BSD-3-Clause"
] | 5 | 2021-07-11T03:24:58.000Z | 2021-11-01T20:17:38.000Z | setup.py | ragnarok22/ptb-django-cookiecutter | 4a06df669052ec24fcca47c01c50bc20fc0a8561 | [
"BSD-3-Clause"
] | 7 | 2021-08-10T20:36:03.000Z | 2021-12-13T18:35:57.000Z | # !/usr/bin/env python
from distutils.core import setup
setup(
name='ptb-django-cookiecutter',
packages=[],
version='0.1.1',
description='A simple cookiecutter to create Python Telegram bot, wrapped with Django.',
author='Carlos Lugones',
license='MIT',
author_email='contact@lugodev.com',
... | 36.032258 | 92 | 0.617726 |
from distutils.core import setup
setup(
name='ptb-django-cookiecutter',
packages=[],
version='0.1.1',
description='A simple cookiecutter to create Python Telegram bot, wrapped with Django.',
author='Carlos Lugones',
license='MIT',
author_email='contact@lugodev.com',
url='https://github... | true | true |
1c2e79ee0b9008d2c20846f2ec4ec284300d3e86 | 539 | py | Python | website2.0/website/urls.py | mrava87/EAGE_Hackatoon_2017 | 68fbe6922f191e6b15827e47b37f931eaaca3104 | [
"MIT"
] | 13 | 2017-06-17T17:49:40.000Z | 2021-07-30T17:20:24.000Z | website2.0/website/urls.py | mrava87/EAGE_Hackatoon_2017 | 68fbe6922f191e6b15827e47b37f931eaaca3104 | [
"MIT"
] | 1 | 2017-05-31T16:43:37.000Z | 2017-06-01T10:53:48.000Z | website2.0/website/urls.py | mrava87/EAGE_Hackatoon_2017 | 68fbe6922f191e6b15827e47b37f931eaaca3104 | [
"MIT"
] | 3 | 2017-05-31T16:37:59.000Z | 2017-10-04T16:19:13.000Z | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'website.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', include('mainapp.urls')),
url(r'^upload-',... | 28.368421 | 52 | 0.627087 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
urlpatterns = patterns('',
url(r'^$', include('mainapp.urls')),
url(r'^upload-', include('mainapp.urls')),
url(r'^admin/', include(admin.site.urls)),
)
urlpatterns += patter... | true | true |
1c2e7a1c8137d6dc414e3592f39f7bf82cd596df | 3,409 | py | Python | settings.py | TheLortex/rust-mcts | 10d0700cef7df7059b7cbacc609d173580203fa9 | [
"MIT"
] | 3 | 2020-10-24T03:25:16.000Z | 2021-06-30T05:36:58.000Z | settings.py | TheLortex/rust-mcts | 10d0700cef7df7059b7cbacc609d173580203fa9 | [
"MIT"
] | null | null | null | settings.py | TheLortex/rust-mcts | 10d0700cef7df7059b7cbacc609d173580203fa9 | [
"MIT"
] | 1 | 2021-03-27T09:13:31.000Z | 2021-03-27T09:13:31.000Z |
def dir_name(config, method):
if config.game.kind == "Breakthrough":
return "{}-breakthrough-{}".format(method, config.game.size)
elif config.game.kind == "Gym":
return "{}-gym-{}".format(method, config.game.name)
else:
print("Unknown game in config file.")
exit(-1)
def get... | 30.711712 | 119 | 0.592549 |
def dir_name(config, method):
if config.game.kind == "Breakthrough":
return "{}-breakthrough-{}".format(method, config.game.size)
elif config.game.kind == "Gym":
return "{}-gym-{}".format(method, config.game.name)
else:
print("Unknown game in config file.")
exit(-1)
def get... | true | true |
1c2e7aa04b523bbaa95397b7ab53e8cdc6334804 | 3,722 | py | Python | timm/scheduler/scheduler_factory.py | RobbieEarle/pytorch-image-models | a43fafef8ca62a6347832d71ade045ae86b8a96f | [
"Apache-2.0"
] | null | null | null | timm/scheduler/scheduler_factory.py | RobbieEarle/pytorch-image-models | a43fafef8ca62a6347832d71ade045ae86b8a96f | [
"Apache-2.0"
] | null | null | null | timm/scheduler/scheduler_factory.py | RobbieEarle/pytorch-image-models | a43fafef8ca62a6347832d71ade045ae86b8a96f | [
"Apache-2.0"
] | 1 | 2021-01-07T15:04:35.000Z | 2021-01-07T15:04:35.000Z | """ Scheduler Factory
Hacked together by / Copyright 2020 Ross Wightman
"""
from .cosine_lr import CosineLRScheduler
from .tanh_lr import TanhLRScheduler
from .step_lr import StepLRScheduler
from .plateau_lr import PlateauLRScheduler
from torch.optim.lr_scheduler import OneCycleLR
import math
def create_scheduler(arg... | 37.59596 | 104 | 0.585975 | from .cosine_lr import CosineLRScheduler
from .tanh_lr import TanhLRScheduler
from .step_lr import StepLRScheduler
from .plateau_lr import PlateauLRScheduler
from torch.optim.lr_scheduler import OneCycleLR
import math
def create_scheduler(args, optimizer, dataset_train):
num_epochs = args.epochs
if getattr(a... | true | true |
1c2e7ba7d4fe1255704b12f9560527ef0aa657fb | 2,139 | py | Python | aesara/compile/compilelock.py | hs2361/aesara | 16f98e4fd69db92e0c2cde9dd97a0d005235deea | [
"BSD-3-Clause"
] | null | null | null | aesara/compile/compilelock.py | hs2361/aesara | 16f98e4fd69db92e0c2cde9dd97a0d005235deea | [
"BSD-3-Clause"
] | null | null | null | aesara/compile/compilelock.py | hs2361/aesara | 16f98e4fd69db92e0c2cde9dd97a0d005235deea | [
"BSD-3-Clause"
] | null | null | null | """
Locking mechanism to ensure no two compilations occur simultaneously
in the same compilation directory (which can cause crashes).
"""
import os
import threading
import typing
from contextlib import contextmanager
import filelock
from aesara.configdefaults import config
__all__ = [
"force_unlock",
"lock_... | 25.771084 | 89 | 0.654511 | import os
import threading
import typing
from contextlib import contextmanager
import filelock
from aesara.configdefaults import config
__all__ = [
"force_unlock",
"lock_ctx",
]
class ThreadFileLocks(threading.local):
def __init__(self):
self._locks = {}
local_mem = ThreadFileLocks()
def f... | true | true |
1c2e7e382fe94223338339592e2ee6790d0d70e6 | 3,486 | py | Python | homeassistant/components/camera/verisure.py | adolfoeliazat/voidhomecontrol | 6d733253811c553912e46e24debec818b28b0688 | [
"Apache-2.0"
] | 1 | 2020-08-14T15:01:33.000Z | 2020-08-14T15:01:33.000Z | homeassistant/components/camera/verisure.py | adolfoeliazat/voidhomecontrol | 6d733253811c553912e46e24debec818b28b0688 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/camera/verisure.py | adolfoeliazat/voidhomecontrol | 6d733253811c553912e46e24debec818b28b0688 | [
"Apache-2.0"
] | 1 | 2020-08-26T20:54:14.000Z | 2020-08-26T20:54:14.000Z | """
Camera that loads a picture from a local file.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.verisure/
"""
import errno
import logging
import os
from homeassistant.components.camera import Camera
from homeassistant.const import EVENT_HOMEASS... | 35.212121 | 74 | 0.64257 | import errno
import logging
import os
from homeassistant.components.camera import Camera
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.components.verisure import HUB as hub
from homeassistant.components.verisure import CONF_SMARTCAM
_LOGGER = logging.getLogger(__name__)
def setup_platf... | true | true |
1c2e7e3bd7241c6969ca5f5b6f23ddc6d82a0548 | 201 | py | Python | matplotlib/plot()/plot1.py | programmer1017/python | 3dce528be121ced032157c9d800b4770989889bf | [
"MIT"
] | null | null | null | matplotlib/plot()/plot1.py | programmer1017/python | 3dce528be121ced032157c9d800b4770989889bf | [
"MIT"
] | null | null | null | matplotlib/plot()/plot1.py | programmer1017/python | 3dce528be121ced032157c9d800b4770989889bf | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
plt.plot([2, 3, 5, 10])
# plot: 점을 찍는다 .[2, 3, 4, 10]은 y좌표로 간주된다.
# 또한 여기서 x좌표는 따로 지정하지 않았기 때문에 자동으로 각각 [0, 1, 2, 3]으로 간주되어 그래프가 그려진다.
plt.show()
# show: 창에 그래프를 띄운다. | 22.333333 | 68 | 0.631841 | import matplotlib.pyplot as plt
plt.plot([2, 3, 5, 10])
plt.show()
| true | true |
1c2e7eccd1f9668a71a63ddb467c7d69dbc9acc0 | 2,447 | py | Python | src/git_portfolio/use_cases/git_use_case.py | admdev8/git-portfolio | 4269923bac2d31c9058b76bb6facfdadd4045603 | [
"MIT"
] | 1 | 2020-10-19T13:11:32.000Z | 2020-10-19T13:11:32.000Z | src/git_portfolio/use_cases/git_use_case.py | admdev8/git-portfolio | 4269923bac2d31c9058b76bb6facfdadd4045603 | [
"MIT"
] | 179 | 2020-12-15T06:37:58.000Z | 2022-03-31T08:06:51.000Z | src/git_portfolio/use_cases/git_use_case.py | admdev8/git-portfolio | 4269923bac2d31c9058b76bb6facfdadd4045603 | [
"MIT"
] | null | null | null | """Local git use case."""
import os
import pathlib
import subprocess # noqa: S404
from typing import List
from typing import Tuple
from typing import Union
import git_portfolio.response_objects as res
class GitUseCase:
"""Execution of git use case."""
def __init__(self) -> None:
"""Constructor."""
... | 33.986111 | 87 | 0.541479 | import os
import pathlib
import subprocess
from typing import List
from typing import Tuple
from typing import Union
import git_portfolio.response_objects as res
class GitUseCase:
def __init__(self) -> None:
self.err_output = self._check_git_install()
@staticmethod
def _check_git_install() ->... | true | true |
1c2e7fe6679d6cec764138b6a3d8661cf7766095 | 2,645 | py | Python | UVa Online Judge/v3/397.py | mjenrungrot/algorithm | e0e8174eb133ba20931c2c7f5c67732e4cb2b703 | [
"MIT"
] | 1 | 2021-12-08T08:58:43.000Z | 2021-12-08T08:58:43.000Z | UVa Online Judge/v3/397.py | mjenrungrot/algorithm | e0e8174eb133ba20931c2c7f5c67732e4cb2b703 | [
"MIT"
] | null | null | null | UVa Online Judge/v3/397.py | mjenrungrot/algorithm | e0e8174eb133ba20931c2c7f5c67732e4cb2b703 | [
"MIT"
] | null | null | null | # =============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 397.py
# Description: UVa Online Judge - 397
# =============================================================================
def parse_numb... | 23.201754 | 79 | 0.404537 |
def parse_number(x, offset):
output = ""
curr = offset
while curr < len(x):
if x[curr] == " ":
curr += 1
continue
if len(output) == 0 and x[curr] in "-+":
output += x[curr]
curr += 1
elif x[curr].isdigit():
output +... | true | true |
1c2e81784d7e477d6f9aa422144604717a0d293e | 1,513 | py | Python | ELB/RequestCount.py | nbari/aws | e76a8f32f814c6c2bb6e1c7417166f16b083c193 | [
"BSD-3-Clause"
] | null | null | null | ELB/RequestCount.py | nbari/aws | e76a8f32f814c6c2bb6e1c7417166f16b083c193 | [
"BSD-3-Clause"
] | 1 | 2020-09-15T11:27:00.000Z | 2020-09-15T11:27:00.000Z | ELB/RequestCount.py | nbari/aws | e76a8f32f814c6c2bb6e1c7417166f16b083c193 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-cloudwatch-metrics.html
"""
import datetime
import os
import sys
from boto.ec2 import cloudwatch
AWS_REGION = os.environ['EC2_REGION']
AWS_ACCESS_KEY = os.environ['AWS_ACCESS_KEY']
AWS_SECRET_KEY = os.environ['AWS_SE... | 24.403226 | 97 | 0.55651 |
"""
http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-cloudwatch-metrics.html
"""
import datetime
import os
import sys
from boto.ec2 import cloudwatch
AWS_REGION = os.environ['EC2_REGION']
AWS_ACCESS_KEY = os.environ['AWS_ACCESS_KEY']
AWS_SECRET_KEY = os.environ['AWS_SECRET_KEY']
PERIOD = 6... | false | true |
1c2e81898fee54dc6d2391d56188977c7058f6de | 873 | py | Python | String/AlgoExpert/Medium/10_minimum-characters-for-words.py | sounak95/100_days_of_code | 50fbf088ce6ab2137aa216a30e3b3f828b278a22 | [
"Apache-2.0"
] | null | null | null | String/AlgoExpert/Medium/10_minimum-characters-for-words.py | sounak95/100_days_of_code | 50fbf088ce6ab2137aa216a30e3b3f828b278a22 | [
"Apache-2.0"
] | null | null | null | String/AlgoExpert/Medium/10_minimum-characters-for-words.py | sounak95/100_days_of_code | 50fbf088ce6ab2137aa216a30e3b3f828b278a22 | [
"Apache-2.0"
] | null | null | null |
def countCharFreq(string):
charFreq={}
for ch in string:
if ch in charFreq:
charFreq[ch]+=1
else:
charFreq[ch]=1
return charFreq
def updateMaxFreq(charFreq, maxCharFreq):
for ch in charFreq:
if ch in maxCharFreq:
maxCharFreq[ch]= max(charF... | 20.302326 | 79 | 0.60252 |
def countCharFreq(string):
charFreq={}
for ch in string:
if ch in charFreq:
charFreq[ch]+=1
else:
charFreq[ch]=1
return charFreq
def updateMaxFreq(charFreq, maxCharFreq):
for ch in charFreq:
if ch in maxCharFreq:
maxCharFreq[ch]= max(charF... | true | true |
1c2e829f76a0ecd0a9354921fb8cf2b2cf7783c3 | 447 | py | Python | tools/python/boutiques/tests/test_pprint.py | jerdra/boutiques | f6ee252fd1332ec686dc76dc12e52a0d69c685c3 | [
"MIT"
] | null | null | null | tools/python/boutiques/tests/test_pprint.py | jerdra/boutiques | f6ee252fd1332ec686dc76dc12e52a0d69c685c3 | [
"MIT"
] | null | null | null | tools/python/boutiques/tests/test_pprint.py | jerdra/boutiques | f6ee252fd1332ec686dc76dc12e52a0d69c685c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import os.path as op
from unittest import TestCase
from boutiques import __file__ as bfile
from six import string_types
import boutiques as bosh
class TestPPrint(TestCase):
def test_doesntcrash(self):
fil = op.join(op.split(bfile)[0],
'schema/example... | 24.833333 | 63 | 0.711409 |
import os
import os.path as op
from unittest import TestCase
from boutiques import __file__ as bfile
from six import string_types
import boutiques as bosh
class TestPPrint(TestCase):
def test_doesntcrash(self):
fil = op.join(op.split(bfile)[0],
'schema/examples/test_pretty_print.j... | true | true |
1c2e8320ab12fd5dfaf27f520054c3b13732220f | 919 | py | Python | funcional.py | ludimila/LearnFunctionalPython | 80275371d1c6cee5a17ab98e1c36242ffeb4644c | [
"MIT"
] | null | null | null | funcional.py | ludimila/LearnFunctionalPython | 80275371d1c6cee5a17ab98e1c36242ffeb4644c | [
"MIT"
] | null | null | null | funcional.py | ludimila/LearnFunctionalPython | 80275371d1c6cee5a17ab98e1c36242ffeb4644c | [
"MIT"
] | null | null | null | #open
#filter tirar linhas em branco - filter
#map
#map remove new lines
#lower
#map remove punctuation
from functools import partial
from string import punctuation
from re import sub
from collections import Counter
#from multprocessing.dummy import Pool
def pipe(*funcs):
def inner(arg):
result = arg
... | 20.886364 | 78 | 0.681175 |
from functools import partial
from string import punctuation
from re import sub
from collections import Counter
def pipe(*funcs):
def inner(arg):
result = arg
for func in funcs:
result = func(result)
return result
return inner
remove_blank_lines = partial(filte... | true | true |
1c2e8380043de9ea543efb9b099a5d397f7be960 | 4,030 | py | Python | onnx/backend/test/case/node/bitshift.py | How-Wang/onnx | c940fa3fea84948e46603cab2f86467291443beb | [
"Apache-2.0"
] | 1 | 2022-02-04T07:45:14.000Z | 2022-02-04T07:45:14.000Z | onnx/backend/test/case/node/bitshift.py | How-Wang/onnx | c940fa3fea84948e46603cab2f86467291443beb | [
"Apache-2.0"
] | null | null | null | onnx/backend/test/case/node/bitshift.py | How-Wang/onnx | c940fa3fea84948e46603cab2f86467291443beb | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class BitShift(Base):
@staticme... | 29.632353 | 50 | 0.507196 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class BitShift(Base):
@staticmethod
def export_right_unit8() -> None:
... | true | true |
1c2e83de294b08d097eda13bb958e629ecbb541e | 7,059 | py | Python | ParamGenerator/Phoenics/BayesianNeuralNetwork/pymc3_interface.py | Tabor-Research-Group/ChemOS | 50117f572e95e68dc4dccb624cedb28dbfc6e419 | [
"Apache-2.0"
] | 37 | 2018-03-20T21:23:11.000Z | 2022-03-26T08:19:20.000Z | ParamGenerator/Phoenics/BayesianNeuralNetwork/pymc3_interface.py | Tabor-Research-Group/ChemOS | 50117f572e95e68dc4dccb624cedb28dbfc6e419 | [
"Apache-2.0"
] | 1 | 2021-06-29T10:03:22.000Z | 2021-06-29T10:03:22.000Z | ParamGenerator/Phoenics/BayesianNeuralNetwork/pymc3_interface.py | Tabor-Research-Group/ChemOS | 50117f572e95e68dc4dccb624cedb28dbfc6e419 | [
"Apache-2.0"
] | 10 | 2018-05-16T21:04:05.000Z | 2021-10-15T18:14:06.000Z | #!/usr/bin/env python
__author__ = 'Florian Hase'
#========================================================================
import numpy as np
import theano
import theano.tensor as T
import pymc3 as pm
from Utils.utils import VarDictParser
#from BayesianNeuralNetwork.distributions import DiscreteLaplace
#======... | 41.523529 | 170 | 0.696274 |
__author__ = 'Florian Hase'
import numpy as np
import theano
import theano.tensor as T
import pymc3 as pm
from Utils.utils import VarDictParser
class Pymc3Network(VarDictParser):
def __init__(self, var_dicts, observed_params, observed_losses, batch_size, model_details):
VarDictParser.__init__(self, var_... | true | true |
1c2e84f9242aa5d5ab7410159ed00ce8f79e48be | 460 | py | Python | Matplotlib/Part 4/Part4.py | aritraroy24/Learning_NumPy_SciPy | cd33fbcb7dee11547b7c6e30692866373fb0ea5b | [
"MIT"
] | null | null | null | Matplotlib/Part 4/Part4.py | aritraroy24/Learning_NumPy_SciPy | cd33fbcb7dee11547b7c6e30692866373fb0ea5b | [
"MIT"
] | null | null | null | Matplotlib/Part 4/Part4.py | aritraroy24/Learning_NumPy_SciPy | cd33fbcb7dee11547b7c6e30692866373fb0ea5b | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
plt.style.use("fivethirtyeight")
hours = [1, 2, 3, 4, 5, 6, 7, 8, 9]
dev1 = [8, 6, 5, 5, 4, 2, 1, 1, 0]
dev2 = [0, 1, 2, 2, 2, 4, 4, 4, 4]
dev3 = [0, 1, 1, 1, 2, 2, 3, 3, 4]
labels = ['Dev1', 'Dev2', 'Dev3']
colors = ['#6d904f', '#fc4f30', '#008fd5']
plt.stackplot(hours, dev1... | 20.909091 | 68 | 0.591304 | from matplotlib import pyplot as plt
plt.style.use("fivethirtyeight")
hours = [1, 2, 3, 4, 5, 6, 7, 8, 9]
dev1 = [8, 6, 5, 5, 4, 2, 1, 1, 0]
dev2 = [0, 1, 2, 2, 2, 4, 4, 4, 4]
dev3 = [0, 1, 1, 1, 2, 2, 3, 3, 4]
labels = ['Dev1', 'Dev2', 'Dev3']
colors = ['#6d904f', '#fc4f30', '#008fd5']
plt.stackplot(hours, dev1... | true | true |
1c2e85128466df3e710be0f1ad094ceda7965972 | 10,591 | py | Python | PythonExercises.py | jaxalbert/PythonExperiments | e5c658be1969b59be9a85a969db0e298f7e23bd6 | [
"MIT"
] | 2 | 2018-03-05T06:14:35.000Z | 2019-01-08T15:32:30.000Z | PythonExercises.py | jaxalbert/PythonExperiments | e5c658be1969b59be9a85a969db0e298f7e23bd6 | [
"MIT"
] | null | null | null | PythonExercises.py | jaxalbert/PythonExperiments | e5c658be1969b59be9a85a969db0e298f7e23bd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
def stemWord(w):
"""Renders a word in to its generic form.
This function is used preprocess words for NLP.
It removes all trailing punctuation marks "';-?.,!:".
It also removes the possessive "'s" from words.
And it converts it to all lower case
Args:
w (... | 35.901695 | 147 | 0.589274 |
def stemWord(w):
w=w.split("'")[0]#Separates and eliminates all after the "'"
w=[letter for letter in w if not (letter in ';-?.,!:')]
return ''.join(w).lower()
class LanguageModel:
@staticmethod
def getWordFreq(txt):
list1 = txt.split()
newlist = []
dic = {}
... | true | true |
1c2e8556fed0cb0df722a9c46df711a1dc400983 | 14,733 | py | Python | yolov3_tf2/models.py | makra89/Quake_AI | 8df69c75b117079f5e40929341c4638e741de11d | [
"BSD-3-Clause"
] | 4 | 2022-02-10T22:13:37.000Z | 2022-03-27T18:44:38.000Z | yolov3_tf2/models.py | makra89/Quake_AI | 8df69c75b117079f5e40929341c4638e741de11d | [
"BSD-3-Clause"
] | 14 | 2021-08-29T13:36:12.000Z | 2021-09-22T05:22:57.000Z | yolov3_tf2/models.py | makra89/Quake_AI | 8df69c75b117079f5e40929341c4638e741de11d | [
"BSD-3-Clause"
] | 1 | 2021-11-21T21:01:31.000Z | 2021-11-21T21:01:31.000Z | import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import (
Add,
Concatenate,
Conv2D,
Input,
Lambda,
LeakyReLU,
MaxPool2D,
UpSampling2D,
ZeroPadding2D,
BatchNormalization,
)
from tensorflow.keras.regularizers import l2
from ... | 36.924812 | 110 | 0.602525 | import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import (
Add,
Concatenate,
Conv2D,
Input,
Lambda,
LeakyReLU,
MaxPool2D,
UpSampling2D,
ZeroPadding2D,
BatchNormalization,
)
from tensorflow.keras.regularizers import l2
from ... | true | true |
1c2e85af5584072a15c79fa37c6fdbe8727dadbf | 1,399 | py | Python | extended_maven_pck.py | singhpraveen2010/experimental | 5fff00d8137ae069af3a66e5c4ebaff39f7acf80 | [
"MIT"
] | 1 | 2018-11-17T19:00:04.000Z | 2018-11-17T19:00:04.000Z | extended_maven_pck.py | singhpraveen2010/experimental | 5fff00d8137ae069af3a66e5c4ebaff39f7acf80 | [
"MIT"
] | 1 | 2017-12-28T04:53:56.000Z | 2018-02-15T07:54:42.000Z | extended_maven_pck.py | sara-02/junk | 3c23165eafb600b7af2d15231fb9508e2f26bbc6 | [
"MIT"
] | null | null | null | import glob
import json
def open_file(filename):
with open(filename, 'r') as f:
data = json.load(f)
return data
def save_file(filename, json_data):
with open(filename, 'w') as f:
json.dump(json_data, f, indent=True)
def create_extended_list(data, glob_name):
pck_list = data[0]['packag... | 27.431373 | 57 | 0.621158 | import glob
import json
def open_file(filename):
with open(filename, 'r') as f:
data = json.load(f)
return data
def save_file(filename, json_data):
with open(filename, 'w') as f:
json.dump(json_data, f, indent=True)
def create_extended_list(data, glob_name):
pck_list = data[0]['packag... | false | true |
1c2e86674db23f39db6bd3763d114c2f1fca0050 | 2,508 | py | Python | test_jsondb.py | andreixk/SimpleRecipeManagerAPI | 240d536fc6783005c8fb48f54a75dfb7654b7680 | [
"MIT"
] | null | null | null | test_jsondb.py | andreixk/SimpleRecipeManagerAPI | 240d536fc6783005c8fb48f54a75dfb7654b7680 | [
"MIT"
] | null | null | null | test_jsondb.py | andreixk/SimpleRecipeManagerAPI | 240d536fc6783005c8fb48f54a75dfb7654b7680 | [
"MIT"
] | null | null | null | import pytest
from fastapi.testclient import TestClient
from unittest import mock
from unittest.mock import mock_open
import json
from jsondb import PrimitiveStorage, ObjectStorage
from conftest import Stub
class TestStorage():
@pytest.mark.parametrize('Storage,fake_data', [
(PrimitiveStorage, ['a','b']), ... | 41.8 | 86 | 0.639155 | import pytest
from fastapi.testclient import TestClient
from unittest import mock
from unittest.mock import mock_open
import json
from jsondb import PrimitiveStorage, ObjectStorage
from conftest import Stub
class TestStorage():
@pytest.mark.parametrize('Storage,fake_data', [
(PrimitiveStorage, ['a','b']), ... | true | true |
1c2e8693a0bd5d8977f78731eb94fec0b7bbd19d | 22,241 | py | Python | test/functional/test_framework/util.py | minblock/watacoin | 39b64687af9237feed324ee01e330e153aa5bc36 | [
"MIT"
] | null | null | null | test/functional/test_framework/util.py | minblock/watacoin | 39b64687af9237feed324ee01e330e153aa5bc36 | [
"MIT"
] | null | null | null | test/functional/test_framework/util.py | minblock/watacoin | 39b64687af9237feed324ee01e330e153aa5bc36 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | 38.882867 | 140 | 0.652309 |
from base64 import b64encode
from binascii import hexlify, unhexlify
from decimal import Decimal, ROUND_DOWN
import hashlib
import inspect
import json
import logging
import os
import random
import re
from subprocess import CalledProcessError
import time
from . import coverage
from .authproxy import AuthServicePro... | true | true |
1c2e869b0603b84c2ae7af7ba218f65b9f92ec56 | 17,754 | py | Python | wagl/data.py | ASVincent/wagl | cf3a72e53e53f3a7b2f2b5308068069b1b714f2a | [
"Apache-2.0"
] | null | null | null | wagl/data.py | ASVincent/wagl | cf3a72e53e53f3a7b2f2b5308068069b1b714f2a | [
"Apache-2.0"
] | null | null | null | wagl/data.py | ASVincent/wagl | cf3a72e53e53f3a7b2f2b5308068069b1b714f2a | [
"Apache-2.0"
] | 1 | 2019-01-23T00:51:56.000Z | 2019-01-23T00:51:56.000Z | """
Data access functions
---------------------
"""
from __future__ import absolute_import
from os.path import join as pjoin, basename, dirname
import subprocess
import tempfile
import logging
import numpy as np
import h5py
import rasterio
from rasterio.crs import CRS
from rasterio.warp import reproject
from rasterio... | 34.340426 | 77 | 0.611299 |
from __future__ import absolute_import
from os.path import join as pjoin, basename, dirname
import subprocess
import tempfile
import logging
import numpy as np
import h5py
import rasterio
from rasterio.crs import CRS
from rasterio.warp import reproject
from rasterio.enums import Resampling
from wagl.geobox import Gri... | true | true |
1c2e87352e339ee35eb0dfb1569501950c26402b | 388 | py | Python | nudni/wsgi.py | misli/nudni | a0c03cd3104a57d5104dd1f593a777a3571fca4d | [
"BSD-3-Clause"
] | 2 | 2017-11-18T11:12:10.000Z | 2017-11-18T11:12:12.000Z | nudni/wsgi.py | misli/nudni | a0c03cd3104a57d5104dd1f593a777a3571fca4d | [
"BSD-3-Clause"
] | null | null | null | nudni/wsgi.py | misli/nudni | a0c03cd3104a57d5104dd1f593a777a3571fca4d | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for nudni project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | 22.823529 | 78 | 0.783505 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nudni.settings")
application = get_wsgi_application()
| true | true |
1c2e875a17af7e0890ffebcddd9c7877a9fa8af2 | 1,168 | py | Python | setup.py | yucelkilic/ASTRiDE | cca4e3ee0d907c3675d8f2dcf9246acf69027dae | [
"MIT"
] | null | null | null | setup.py | yucelkilic/ASTRiDE | cca4e3ee0d907c3675d8f2dcf9246acf69027dae | [
"MIT"
] | null | null | null | setup.py | yucelkilic/ASTRiDE | cca4e3ee0d907c3675d8f2dcf9246acf69027dae | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='astride',
version='0.3.5',
description='Automated Streak Detection for High Velocity Objects',
long_description=readme(),
platforms=['any'],
packages=find_packages()... | 34.352941 | 76 | 0.598459 | from setuptools import find_packages, setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='astride',
version='0.3.5',
description='Automated Streak Detection for High Velocity Objects',
long_description=readme(),
platforms=['any'],
packages=find_packages()... | true | true |
1c2e878fc87fe5d8f0093738d896b1c599ff30cc | 3,195 | py | Python | cobrinha trabalhadeira/lab06/lab6MT.py | ansattz/solving_sto | 4f66a0a78fdbfe101f07e0f7cb8f7c8b595f16b9 | [
"MIT"
] | null | null | null | cobrinha trabalhadeira/lab06/lab6MT.py | ansattz/solving_sto | 4f66a0a78fdbfe101f07e0f7cb8f7c8b595f16b9 | [
"MIT"
] | null | null | null | cobrinha trabalhadeira/lab06/lab6MT.py | ansattz/solving_sto | 4f66a0a78fdbfe101f07e0f7cb8f7c8b595f16b9 | [
"MIT"
] | null | null | null | # Douglas Vieira
# @ansattz
#1 - Não delete nem modifique esta linha
def lettercount(s):
phrase = str.split(s)
letters = len(phrase)
return letters
#Casos de teste da questão 1 - Não delete nem modifique esta linha
print(lettercount("Vamos terminar este lab hoje mesmo"))
# 2 - Não delete nem modifique ... | 28.783784 | 179 | 0.650704 |
def lettercount(s):
phrase = str.split(s)
letters = len(phrase)
return letters
print(lettercount("Vamos terminar este lab hoje mesmo"))
def phrasecount(s):
fpoint = str.replace(s,'...','.')
phtype1 = str.count(fpoint,'.')
phtype2 = str.count(s,'!')
phtype3 = str.count(s,'?')
... | true | true |
1c2e88c6ed8136dab2b63811698e0b327fcdc54f | 3,758 | py | Python | dl/scan/part_tflite.py | showkeyjar/beauty | 7c944cf896c899d9e23b2e50e293103bb03fe6cd | [
"MulanPSL-1.0"
] | 1 | 2022-01-29T12:32:38.000Z | 2022-01-29T12:32:38.000Z | dl/scan/part_tflite.py | showkeyjar/beauty | 7c944cf896c899d9e23b2e50e293103bb03fe6cd | [
"MulanPSL-1.0"
] | null | null | null | dl/scan/part_tflite.py | showkeyjar/beauty | 7c944cf896c899d9e23b2e50e293103bb03fe6cd | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import numpy as np
import cv2
from os.path import dirname, join
import tensorflow as tf
"""
判断人脸部位
"""
# Load TFLite model and allocate tensors.
model_file = join(dirname(__file__), "face_part.tflite")
interpreter = tf.compat.v1.lite.Interpreter(model_path=model_file)
# Ge... | 40.847826 | 184 | 0.61868 |
import numpy as np
import cv2
from os.path import dirname, join
import tensorflow as tf
model_file = join(dirname(__file__), "face_part.tflite")
interpreter = tf.compat.v1.lite.Interpreter(model_path=model_file)
input_details = interpreter.get_input_details()
print("input:", input_details)
output_details = inter... | true | true |
1c2e88e126f2fb3f6cce316611db58129c930a48 | 391 | py | Python | django_projects/chat_app_channels/chatapp/chatapp/asgi.py | phiratio/lpthw | a32240d4355fb331805d515f96e1d009914e5c47 | [
"MIT"
] | 1 | 2021-04-21T09:38:38.000Z | 2021-04-21T09:38:38.000Z | django_projects/chat_app_channels/chatapp/chatapp/asgi.py | phiratio/lpthw | a32240d4355fb331805d515f96e1d009914e5c47 | [
"MIT"
] | 34 | 2019-12-16T16:53:24.000Z | 2022-01-13T02:29:30.000Z | django_projects/chat_app_channels/chatapp/chatapp/asgi.py | phiratio/lpthw | a32240d4355fb331805d515f96e1d009914e5c47 | [
"MIT"
] | null | null | null | """
ASGI config for chatapp project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chatapp.settings')
application = get_asgi_application()
| true | true |
1c2e88eb86dd7141662fd801b624b54caf1cf2ef | 1,370 | py | Python | backend/database/migration.py | GCETTB-HYLAND-Hackathon2012-22/Miracurol-Rebuild | a6748e93b45872efdbaca013388dd6277824a9a5 | [
"Apache-2.0"
] | null | null | null | backend/database/migration.py | GCETTB-HYLAND-Hackathon2012-22/Miracurol-Rebuild | a6748e93b45872efdbaca013388dd6277824a9a5 | [
"Apache-2.0"
] | null | null | null | backend/database/migration.py | GCETTB-HYLAND-Hackathon2012-22/Miracurol-Rebuild | a6748e93b45872efdbaca013388dd6277824a9a5 | [
"Apache-2.0"
] | null | null | null | import pathlib
from alembic import command
from alembic.config import Config as AlembicConfig
from sqlalchemy.engine import make_url
from backend.commons.enums import Config
from backend.utils.config_utils import read_config
def run_migrations(downgrade_first: bool = False) -> None:
script_location: str = f'{re... | 35.128205 | 89 | 0.729197 | import pathlib
from alembic import command
from alembic.config import Config as AlembicConfig
from sqlalchemy.engine import make_url
from backend.commons.enums import Config
from backend.utils.config_utils import read_config
def run_migrations(downgrade_first: bool = False) -> None:
script_location: str = f'{re... | true | true |
1c2e897ad5c9e8578ce18e6f53c03911e852907f | 700 | py | Python | brain/src/sm_main.py | FabianFalck/de_niro | 1f9d05b7232cb9e76eff975e5ef1c8bf3fb5cde6 | [
"MIT"
] | 7 | 2019-06-12T03:36:15.000Z | 2021-06-27T18:39:40.000Z | brain/src/sm_main.py | Hankfirst/de_niro | 1f9d05b7232cb9e76eff975e5ef1c8bf3fb5cde6 | [
"MIT"
] | null | null | null | brain/src/sm_main.py | Hankfirst/de_niro | 1f9d05b7232cb9e76eff975e5ef1c8bf3fb5cde6 | [
"MIT"
] | 3 | 2019-06-12T03:35:36.000Z | 2021-06-27T04:37:31.000Z | #!/usr/bin/env python
"""
Main thread for running the state machine.
Author: Sagar Doshi
Date: 05/2018
"""
import rospy
import smach_ros
import unittest
import threading
import time
# Custom modules import
import sm_mach
if __name__ == "__main__":
rospy.init_node('fezzik_state_machine')
# Create the state... | 20 | 85 | 0.715714 |
import rospy
import smach_ros
import unittest
import threading
import time
import sm_mach
if __name__ == "__main__":
rospy.init_node('fezzik_state_machine')
sm = sm_mach.init_sm()
# containers, so only need to add this to the top-level state machine
sis = smach_ros.IntrospectionServer(... | true | true |
1c2e8983ec719dce811b9524bf40526bfd2eedb5 | 193 | py | Python | py_tdlib/constructors/set_scope_notification_settings.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/set_scope_notification_settings.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/set_scope_notification_settings.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Method
class setScopeNotificationSettings(Method):
scope = None # type: "NotificationSettingsScope"
notification_settings = None # type: "scopeNotificationSettings"
| 27.571429 | 66 | 0.797927 | from ..factory import Method
class setScopeNotificationSettings(Method):
scope = None
notification_settings = None
| true | true |
1c2e8a2ecb1994da7171f9cf7c06b1e07ef5eb21 | 717 | py | Python | testutils/decorators.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 53 | 2020-07-01T23:11:59.000Z | 2022-03-31T19:10:28.000Z | testutils/decorators.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 5 | 2020-11-25T19:48:57.000Z | 2022-02-27T23:50:18.000Z | testutils/decorators.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 5 | 2020-08-29T16:43:59.000Z | 2022-01-17T19:05:30.000Z | # -*- coding: utf-8 -*-
import functools
import testutils.helpers as helpers
def as_someone(user_types):
"""Decorator to mimic different user roles.
"""
def the_decorator(func):
@functools.wraps(func)
def func_wrapper(view, *args, **kwargs):
cached_user = view.user
... | 32.590909 | 84 | 0.608089 |
import functools
import testutils.helpers as helpers
def as_someone(user_types):
def the_decorator(func):
@functools.wraps(func)
def func_wrapper(view, *args, **kwargs):
cached_user = view.user
for user_type in user_types:
view.user_type = user_type
... | true | true |
1c2e8be0c07c4c79c57782db9882b7b968cd8d52 | 7,198 | py | Python | models.py | mrdbarros/csgo_analyze | a4d7487bd56a14a99dc762920965060a5a43fa15 | [
"Apache-2.0"
] | null | null | null | models.py | mrdbarros/csgo_analyze | a4d7487bd56a14a99dc762920965060a5a43fa15 | [
"Apache-2.0"
] | 4 | 2020-06-17T20:24:53.000Z | 2021-09-28T03:55:45.000Z | models.py | mrdbarros/csgo_analyze | a4d7487bd56a14a99dc762920965060a5a43fa15 | [
"Apache-2.0"
] | null | null | null | import data_loading
import torch
def emb_sz_rule(n_cat):
"Rule of thumb to pick embedding size corresponding to `n_cat`"
return min(600, round(1.6 * n_cat ** 0.56))
class LinBnDrop(torch.nn.Sequential):
"Module grouping `BatchNorm1d`, `Dropout` and `Linear` layers"
def __init__(self, n_in, n_out... | 45.556962 | 137 | 0.634065 | import data_loading
import torch
def emb_sz_rule(n_cat):
return min(600, round(1.6 * n_cat ** 0.56))
class LinBnDrop(torch.nn.Sequential):
def __init__(self, n_in, n_out, bn=True, p=0., act=None, lin_first=False):
layers = [torch.nn.BatchNorm1d(n_in)] if bn else []
if p != 0: layers.appe... | true | true |
1c2e8bf63583af76879137c28d1e1bfd7558d730 | 5,464 | py | Python | quantumGAN/deprecated_files/discriminator_minimax.py | tomiock/qGAN | fb98a2b5286eb479665ade353efa40bd6e55dc36 | [
"Apache-2.0"
] | 1 | 2021-06-14T09:33:32.000Z | 2021-06-14T09:33:32.000Z | quantumGAN/deprecated_files/discriminator_minimax.py | tomiock/gGAN | fb98a2b5286eb479665ade353efa40bd6e55dc36 | [
"Apache-2.0"
] | 7 | 2021-06-14T12:21:40.000Z | 2021-10-01T07:29:01.000Z | quantumGAN/deprecated_files/discriminator_minimax.py | tomiock/qGAN | fb98a2b5286eb479665ade353efa40bd6e55dc36 | [
"Apache-2.0"
] | null | null | null | """DISCRIMINATOR BCE"""
import json
import random
from typing import Dict, List
import numpy as np
from quantumGAN.functions import minimax_derivative_fake, minimax_derivative_real, sigmoid, \
sigmoid_prime
def load(filename):
f = open(filename, "r")
data = json.load(f)
f.close()
# cost = getattr(sys.modules[_... | 35.947368 | 93 | 0.646962 | import json
import random
from typing import Dict, List
import numpy as np
from quantumGAN.functions import minimax_derivative_fake, minimax_derivative_real, sigmoid, \
sigmoid_prime
def load(filename):
f = open(filename, "r")
data = json.load(f)
f.close()
net = ClassicalDiscriminatorMINIMAX(None, None, data... | true | true |
1c2e8da7f1a8c7cb5c1ba3839e249911f1c92d46 | 271 | py | Python | 18_Math3/Step01/wowo0709.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | 18_Math3/Step01/wowo0709.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | 3 | 2020-11-04T05:38:53.000Z | 2021-03-02T02:15:19.000Z | 18_Math3/Step01/wowo0709.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | while(1):
a,b = map(int,input().split())
if a==0 and b==0:
exit(0)
elif (a!=0 and b==0) or (a==0 and b!=0):
print('neither')
elif a%b==0:
print('multiple')
elif b%a==0:
print('factor')
else:
print('neither') | 22.583333 | 44 | 0.457565 | while(1):
a,b = map(int,input().split())
if a==0 and b==0:
exit(0)
elif (a!=0 and b==0) or (a==0 and b!=0):
print('neither')
elif a%b==0:
print('multiple')
elif b%a==0:
print('factor')
else:
print('neither') | true | true |
1c2e8db06813e97495b935f3a62d070441bf6d9a | 1,756 | py | Python | code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/synthetics_basic_auth_ntlm_type.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/synthetics_basic_auth_ntlm_type.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/synthetics_basic_auth_ntlm_type.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import (
ModelSimple,
cached_property,
... | 27.4375 | 142 | 0.612756 |
from datadog_api_client.v1.model_utils import (
ModelSimple,
cached_property,
)
class SyntheticsBasicAuthNTLMType(ModelSimple):
allowed_values = {
"value": {
"NTLM": "ntlm",
},
}
validations = {}
@cached_property
def openapi_types():
return {
... | true | true |
1c2e8e6321d95ddbf511a3d098115f8a1538a5ba | 549 | py | Python | yamtbx/dataproc/xds/command_line/xds_integrate_lp_to_xparm.py | 7l2icj/kamo_clone | 5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6 | [
"BSD-3-Clause"
] | 16 | 2016-05-20T11:19:40.000Z | 2021-01-01T19:44:23.000Z | yamtbx/dataproc/xds/command_line/xds_integrate_lp_to_xparm.py | 7l2icj/kamo_clone | 5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6 | [
"BSD-3-Clause"
] | 4 | 2017-03-10T00:51:11.000Z | 2021-02-07T17:18:46.000Z | yamtbx/dataproc/xds/command_line/xds_integrate_lp_to_xparm.py | 7l2icj/kamo_clone | 5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6 | [
"BSD-3-Clause"
] | 9 | 2016-12-15T16:00:06.000Z | 2021-09-10T08:34:14.000Z | #!/usr/bin/env yamtbx.python
"""
(c) RIKEN 2015. All rights reserved.
Author: Keitaro Yamashita
This software is released under the new BSD License; see LICENSE.
"""
import os
from yamtbx.dataproc.xds.xparm import get_xparm_from_integrate_lp
def run(integrate_lp, frame_num):
xparm_str = get_xparm_from_integrate... | 23.869565 | 68 | 0.724954 |
import os
from yamtbx.dataproc.xds.xparm import get_xparm_from_integrate_lp
def run(integrate_lp, frame_num):
xparm_str = get_xparm_from_integrate_lp(integrate_lp, frame_num)
open("XPARM.XDS.%.4d"%frame_num, "w").write(xparm_str)
if __name__ == "__main__":
import sys
integrate_lp = sys.argv[1]
... | true | true |
1c2e8ee4df75228959da73fbbd7d2db0011e6712 | 430 | py | Python | Week2/problem1.py | AustinKladke/6.00.1x-MIT-CS-Python | 0f9e2840fdd5f005bae2a53a3b8a251e0635654e | [
"MIT"
] | null | null | null | Week2/problem1.py | AustinKladke/6.00.1x-MIT-CS-Python | 0f9e2840fdd5f005bae2a53a3b8a251e0635654e | [
"MIT"
] | null | null | null | Week2/problem1.py | AustinKladke/6.00.1x-MIT-CS-Python | 0f9e2840fdd5f005bae2a53a3b8a251e0635654e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 7 11:40:18 2021
@author: akladke
"""
#balance = 42
balance = 484
annualInterestRate = 0.2
monthlyPaymentRate = 0.04
for i in range(0, 12):
min_payment = balance * monthlyPaymentRate
unpaid_balance = balance - min_payment
interest = annualInterestRate/12 * u... | 23.888889 | 53 | 0.702326 |
balance = 484
annualInterestRate = 0.2
monthlyPaymentRate = 0.04
for i in range(0, 12):
min_payment = balance * monthlyPaymentRate
unpaid_balance = balance - min_payment
interest = annualInterestRate/12 * unpaid_balance
balance = round(unpaid_balance + interest, 2)
print("Remaining balance: {}".form... | true | true |
1c2e8f5126310bf5dc00013e478e20cf77af87a8 | 1,858 | py | Python | Hash.py | V3noM-Cyber/Hashjokar | 9d29bbdee22e29488074bc2b16178d91cee2778e | [
"MIT"
] | null | null | null | Hash.py | V3noM-Cyber/Hashjokar | 9d29bbdee22e29488074bc2b16178d91cee2778e | [
"MIT"
] | null | null | null | Hash.py | V3noM-Cyber/Hashjokar | 9d29bbdee22e29488074bc2b16178d91cee2778e | [
"MIT"
] | null | null | null | import hashlib
from colorama import init
from time import *
from termcolor import colored
import sys
import os
import hashlib, binascii
from colorama import Fore, Back, Style
hash = ""
init()
print( Fore.RED+'''
●🔥════════════════════════◄►═══════════════════🔥●
██╗░░░██╗██████╗░███╗░░██╗░█████╗░███╗░░░███╗
██║░... | 29.967742 | 70 | 0.453714 | import hashlib
from colorama import init
from time import *
from termcolor import colored
import sys
import os
import hashlib, binascii
from colorama import Fore, Back, Style
hash = ""
init()
print( Fore.RED+'''
●🔥════════════════════════◄►═══════════════════🔥●
██╗░░░██╗██████╗░███╗░░██╗░█████╗░███╗░░░███╗
██║░... | true | true |
1c2e8f59e079c1df103e60b7754c0feb424f213c | 363 | py | Python | doc/tutorials/data/03_halide_basic.py | Hconk/AutoKernel | edfb409efe37e2aea5350961e3a8160c11856853 | [
"Apache-2.0"
] | 754 | 2020-11-11T06:34:26.000Z | 2022-03-29T03:45:36.000Z | doc/tutorials/data/03_halide_basic.py | Hconk/AutoKernel | edfb409efe37e2aea5350961e3a8160c11856853 | [
"Apache-2.0"
] | 16 | 2020-12-01T03:27:01.000Z | 2021-08-13T06:20:58.000Z | doc/tutorials/data/03_halide_basic.py | Hconk/AutoKernel | edfb409efe37e2aea5350961e3a8160c11856853 | [
"Apache-2.0"
] | 82 | 2020-11-12T00:14:45.000Z | 2022-03-27T09:22:08.000Z |
#!/usr/bin/python3
import halide as hl
x, y = hl.Var("x"), hl.Var("y")
func = hl.Func("func")
func[x,y] = x + 10*y
#func.trace_stores()
out = func.realize(3, 4) # width, height = 3,4
print("=============================")
for j in range(out.height()):
for i in range(out.width()):
print("out[x=%i,y=%i... | 16.5 | 49 | 0.517906 |
import halide as hl
x, y = hl.Var("x"), hl.Var("y")
func = hl.Func("func")
func[x,y] = x + 10*y
out = func.realize(3, 4)
print("=============================")
for j in range(out.height()):
for i in range(out.width()):
print("out[x=%i,y=%i]=%i"%(i,j,out[i,j]))
print("Success!")
| true | true |
1c2e90a0f9ba63d07086acc94891fb7c5086ab1e | 4,403 | py | Python | usaspending_api/etl/transaction_loaders/data_load_helpers.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/etl/transaction_loaders/data_load_helpers.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/etl/transaction_loaders/data_load_helpers.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | from datetime import datetime
import os
import re
import boto3
import csv
import logging
from django.conf import settings
logger = logging.getLogger("console")
def capitalize_if_string(val):
try:
return val.upper()
except AttributeError:
return val
# 10/31/2019: According to PO direction, ... | 35.796748 | 121 | 0.633205 | from datetime import datetime
import os
import re
import boto3
import csv
import logging
from django.conf import settings
logger = logging.getLogger("console")
def capitalize_if_string(val):
try:
return val.upper()
except AttributeError:
return val
def false_if_null(val):
if val is No... | true | true |
1c2e90c332fe1e210457721c098a7ba2d97cb487 | 7,344 | py | Python | src/external_model.py | alex-calderwood/twine_generation | 8a3ba3779bffeb7a0b18bfd0960685b26bd4e5e8 | [
"BSD-4-Clause-UC"
] | 2 | 2021-11-18T07:28:09.000Z | 2022-03-23T13:56:18.000Z | src/external_model.py | alex-calderwood/twine_generation | 8a3ba3779bffeb7a0b18bfd0960685b26bd4e5e8 | [
"BSD-4-Clause-UC"
] | null | null | null | src/external_model.py | alex-calderwood/twine_generation | 8a3ba3779bffeb7a0b18bfd0960685b26bd4e5e8 | [
"BSD-4-Clause-UC"
] | null | null | null | import openai
import os
import time
import twee_utils as utils
# Load your API key from an environment variable or secret management service
openai.api_key = os.getenv("OPENAI_API_KEY")
ZERO_SHOT = open('src/zero_shot.txt', 'r').read()
class TwineGenerator:
def __init__(self, model='context', verbose=True):
... | 45.614907 | 1,616 | 0.651144 | import openai
import os
import time
import twee_utils as utils
openai.api_key = os.getenv("OPENAI_API_KEY")
ZERO_SHOT = open('src/zero_shot.txt', 'r').read()
class TwineGenerator:
def __init__(self, model='context', verbose=True):
self.model = model.lower()
self.verbose = bool(verbose)
... | true | true |
1c2e9132a54de644c28ae19522b0d1693090fb3f | 10,968 | py | Python | models/llc_score.py | litosly/RankingOptimizationApprochtoLLC | b6b79fb1364fcc481aa84093a8e8399966b19d02 | [
"MIT"
] | 5 | 2020-10-10T02:11:16.000Z | 2021-11-08T22:55:34.000Z | models/llc_score.py | litosly/RankingOptimizationApprochtoLLC | b6b79fb1364fcc481aa84093a8e8399966b19d02 | [
"MIT"
] | null | null | null | models/llc_score.py | litosly/RankingOptimizationApprochtoLLC | b6b79fb1364fcc481aa84093a8e8399966b19d02 | [
"MIT"
] | 2 | 2020-10-22T14:50:43.000Z | 2021-08-15T07:00:43.000Z | from prediction.predictor import predict_scores, predict_vector
from sklearn.linear_model import LinearRegression
from utils.critique import LP1SimplifiedOptimize
from utils.keyphrase_selection import *
import numpy as np
from tqdm import tqdm
class LP1Simplified(object):
def __init__(self, keyphrase_freq, item_... | 60.596685 | 185 | 0.535284 | from prediction.predictor import predict_scores, predict_vector
from sklearn.linear_model import LinearRegression
from utils.critique import LP1SimplifiedOptimize
from utils.keyphrase_selection import *
import numpy as np
from tqdm import tqdm
class LP1Simplified(object):
def __init__(self, keyphrase_freq, item_... | true | true |
1c2e91ad8c46cbfb50cd64e65f5ea767cbea1915 | 4,982 | py | Python | sld-api-backend/helpers/get_data.py | guorenxi/Stack-Lifecycle-Deployment | 2780441cb692392993116cf94c14a94ae8edbc6c | [
"MIT"
] | null | null | null | sld-api-backend/helpers/get_data.py | guorenxi/Stack-Lifecycle-Deployment | 2780441cb692392993116cf94c14a94ae8edbc6c | [
"MIT"
] | null | null | null | sld-api-backend/helpers/get_data.py | guorenxi/Stack-Lifecycle-Deployment | 2780441cb692392993116cf94c14a94ae8edbc6c | [
"MIT"
] | null | null | null | from fastapi import HTTPException
from celery.result import AsyncResult
from datetime import datetime
from functools import wraps
from croniter import croniter
import redis
from crud import stacks as crud_stacks
from crud import deploys as crud_deploys
from crud import user as crud_users
from crud import activityLogs ... | 32.776316 | 117 | 0.642914 | from fastapi import HTTPException
from celery.result import AsyncResult
from datetime import datetime
from functools import wraps
from croniter import croniter
import redis
from crud import stacks as crud_stacks
from crud import deploys as crud_deploys
from crud import user as crud_users
from crud import activityLogs ... | true | true |
1c2e91e14d21753133705a1872b6a3cc03cf96d4 | 1,675 | py | Python | Autoencoding/save32by32ForAll.py | MiningMyBusiness/SketchyExperiments | 11f3baee63a984501b9707aa58420540b19db59f | [
"MIT"
] | 2 | 2019-01-31T19:56:50.000Z | 2019-03-21T12:26:57.000Z | Autoencoding/save32by32ForAll.py | MiningMyBusiness/SketchyExperiments | 11f3baee63a984501b9707aa58420540b19db59f | [
"MIT"
] | null | null | null | Autoencoding/save32by32ForAll.py | MiningMyBusiness/SketchyExperiments | 11f3baee63a984501b9707aa58420540b19db59f | [
"MIT"
] | null | null | null | ## Name: Save 32 by 32 image vector
## Description: Reads in the matrix representation of the images
## for each class and resizes each image from 256 by 256
## to 32 by 32 and then converts it to a vector with
## 1024 elements (32*32). A stack of these vectors (matrix)
## ... | 34.895833 | 80 | 0.654328 | smallerImgs[i, :] = resizeAndVectorize(imgStack_mat[:, :, i], newSize)
return smallerImgs
def resizeAndVectorize(thisImg, newSize):
resized = cv2.resize(thisImg, (newSize, newSize),
interpolation=cv2.INTER_AREA)
resized = np.reshape(resized, newSize**2)
resized = resi... | true | true |
1c2e9290459d49bd1262122f8dd1051edf6b6a31 | 1,516 | py | Python | crypto_data_app/__init__.py | gldeng/crypto-data-app | 4460ffd2417a02605862b66073e172519ea5fbd7 | [
"MIT"
] | null | null | null | crypto_data_app/__init__.py | gldeng/crypto-data-app | 4460ffd2417a02605862b66073e172519ea5fbd7 | [
"MIT"
] | null | null | null | crypto_data_app/__init__.py | gldeng/crypto-data-app | 4460ffd2417a02605862b66073e172519ea5fbd7 | [
"MIT"
] | null | null | null | from flask_redis import FlaskRedis
from flask import Flask
from flask_restful import Resource, Api
from datetime import datetime
def create_app(config_pyfile):
app = Flask(__name__, instance_relative_config=False)
app.config.from_pyfile(config_pyfile)
redis_store = FlaskRedis(app, strict=False)
api =... | 31.583333 | 88 | 0.525066 | from flask_redis import FlaskRedis
from flask import Flask
from flask_restful import Resource, Api
from datetime import datetime
def create_app(config_pyfile):
app = Flask(__name__, instance_relative_config=False)
app.config.from_pyfile(config_pyfile)
redis_store = FlaskRedis(app, strict=False)
api =... | true | true |
1c2e930bbcde5c690c5b9f48f7f7e63d0c74e976 | 2,587 | py | Python | Space Invaders/utilities/deus_ex.py | msutic/python_project_alpha | 5fed153babf294ce5f5714de8f711b1a5943d2d5 | [
"MIT"
] | 1 | 2021-01-08T00:38:02.000Z | 2021-01-08T00:38:02.000Z | Space Invaders/utilities/deus_ex.py | msutic/python_project_alpha | 5fed153babf294ce5f5714de8f711b1a5943d2d5 | [
"MIT"
] | 4 | 2021-01-12T20:07:19.000Z | 2021-03-19T22:21:31.000Z | Space Invaders/utilities/deus_ex.py | msutic/python_project_alpha | 5fed153babf294ce5f5714de8f711b1a5943d2d5 | [
"MIT"
] | null | null | null | from time import time, sleep
from PyQt5.QtCore import pyqtSignal, QThread, pyqtSlot
from PyQt5.QtWidgets import QLabel
from config import cfg
class DeusEx(QThread):
empower = pyqtSignal(QLabel)
collision_occured = pyqtSignal(QLabel, QLabel, int)
def __init__(self):
super().__init__()
... | 33.166667 | 90 | 0.526479 | from time import time, sleep
from PyQt5.QtCore import pyqtSignal, QThread, pyqtSlot
from PyQt5.QtWidgets import QLabel
from config import cfg
class DeusEx(QThread):
empower = pyqtSignal(QLabel)
collision_occured = pyqtSignal(QLabel, QLabel, int)
def __init__(self):
super().__init__()
... | true | true |
1c2e93b8c4720408303fc37f202fa46b4a4ef25f | 5,329 | py | Python | confidnet/loaders/loader.py | luoyan407/predict_trustworthiness_smallscale | b7e1e2a68b0aee9b484228d1b5686f7252919e97 | [
"Apache-2.0"
] | 149 | 2019-10-01T14:04:05.000Z | 2022-03-24T12:25:15.000Z | confidnet/loaders/loader.py | luoyan407/predict_trustworthiness_smallscale | b7e1e2a68b0aee9b484228d1b5686f7252919e97 | [
"Apache-2.0"
] | 10 | 2019-12-12T09:45:50.000Z | 2021-12-27T04:45:22.000Z | confidnet/loaders/loader.py | luoyan407/predict_trustworthiness_smallscale | b7e1e2a68b0aee9b484228d1b5686f7252919e97 | [
"Apache-2.0"
] | 30 | 2019-12-02T16:25:22.000Z | 2022-02-16T10:48:47.000Z | from pathlib import Path
import numpy as np
import torch
from torch.utils.data.sampler import SubsetRandomSampler
from confidnet.augmentations import get_composed_augmentations
from confidnet.utils.logger import get_logger
LOGGER = get_logger(__name__, level="DEBUG")
class AbstractDataLoader:
def __init__(s... | 42.632 | 128 | 0.605555 | from pathlib import Path
import numpy as np
import torch
from torch.utils.data.sampler import SubsetRandomSampler
from confidnet.augmentations import get_composed_augmentations
from confidnet.utils.logger import get_logger
LOGGER = get_logger(__name__, level="DEBUG")
class AbstractDataLoader:
def __init__(s... | true | true |
1c2e9443cf5eb3a35aeb948b351e7d6cdc5b1396 | 13,537 | py | Python | plugins/modules/oci_analytics_private_access_channel.py | slmjy/oci-ansible-collection | 349c91e2868bf4706a6e3d6fb3b47fc622bfe11b | [
"Apache-2.0"
] | 108 | 2020-05-19T20:46:10.000Z | 2022-03-25T14:10:01.000Z | plugins/modules/oci_analytics_private_access_channel.py | slmjy/oci-ansible-collection | 349c91e2868bf4706a6e3d6fb3b47fc622bfe11b | [
"Apache-2.0"
] | 90 | 2020-06-14T22:07:11.000Z | 2022-03-07T05:40:29.000Z | plugins/modules/oci_analytics_private_access_channel.py | slmjy/oci-ansible-collection | 349c91e2868bf4706a6e3d6fb3b47fc622bfe11b | [
"Apache-2.0"
] | 42 | 2020-08-30T23:09:12.000Z | 2022-03-25T16:58:01.000Z | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 36.785326 | 150 | 0.650218 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_analytics_private_access_channel
short_description: Manage a PrivateAcce... | true | true |
1c2e95f5e12bce802fd887828e3ab4159233eaa3 | 414 | py | Python | reapit/reapit/doctype/item_sync_settings/item_sync_settings.py | rtdany10/reapit | aba62ac13fb1a81da9e2e182506712416b63aa92 | [
"MIT"
] | null | null | null | reapit/reapit/doctype/item_sync_settings/item_sync_settings.py | rtdany10/reapit | aba62ac13fb1a81da9e2e182506712416b63aa92 | [
"MIT"
] | null | null | null | reapit/reapit/doctype/item_sync_settings/item_sync_settings.py | rtdany10/reapit | aba62ac13fb1a81da9e2e182506712416b63aa92 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Wahni Green Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemSyncSettings(Document):
def validate(self):
if self.enabled:
if not... | 29.571429 | 63 | 0.768116 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemSyncSettings(Document):
def validate(self):
if self.enabled:
if not (self.api_endpoint and self.price_list):
frappe.throw("Invalid endpoint or price list.")
| true | true |
1c2e972200daba906a25b9d9ebe3ed09289c0ab6 | 10,914 | py | Python | tests/test_scrape_ew_and_errew.py | mwanakijiji/rrlfe2 | 0637b348b8d3e54ff34c56caa8b4c6fdac1c699e | [
"MIT"
] | null | null | null | tests/test_scrape_ew_and_errew.py | mwanakijiji/rrlfe2 | 0637b348b8d3e54ff34c56caa8b4c6fdac1c699e | [
"MIT"
] | 18 | 2022-01-13T14:43:57.000Z | 2022-03-24T12:52:41.000Z | tests/test_scrape_ew_and_errew.py | mwanakijiji/rrlfe | 4a822bb499bd0af4543f8b34d9322e812a5a3d2c | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
import sys, os
from configparser import ConfigParser, ExtendedInterpolation
import pandas as pd
import astropy
current_dir = os.path.dirname(__file__)
target_dir = os.path.abspath(os.path.join(current_dir, "../"))
sys.path.insert(0, target_dir)
# import more things with change... | 52.724638 | 208 | 0.723566 | import matplotlib
matplotlib.use('Agg')
import sys, os
from configparser import ConfigParser, ExtendedInterpolation
import pandas as pd
import astropy
current_dir = os.path.dirname(__file__)
target_dir = os.path.abspath(os.path.join(current_dir, "../"))
sys.path.insert(0, target_dir)
from modules import *
from modu... | true | true |
1c2e97e86be84acb21ba351d83b002528e614107 | 23,642 | py | Python | src/translate.py | CloudRenderVR/human-motion-prediction-pytorch-uncertainty | cb96f3b2d8a2b54916b2f3f76c1c9b982af5b46b | [
"MIT"
] | null | null | null | src/translate.py | CloudRenderVR/human-motion-prediction-pytorch-uncertainty | cb96f3b2d8a2b54916b2f3f76c1c9b982af5b46b | [
"MIT"
] | null | null | null | src/translate.py | CloudRenderVR/human-motion-prediction-pytorch-uncertainty | cb96f3b2d8a2b54916b2f3f76c1c9b982af5b46b | [
"MIT"
] | null | null | null |
"""Simple code for training an RNN for motion prediction."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import random
import sys
import time
import h5py
import numpy as np
from six.moves import xrange # pylint: disable=redefined... | 39.469115 | 169 | 0.641232 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import random
import sys
import time
import h5py
import numpy as np
from six.moves import xrange
import data_utils
import seq2seq_model
import torch
import torch.optim as optim
from t... | true | true |
1c2e97f80754cf03aef7cce4dbf0e63f4c25eeb5 | 141 | py | Python | solutions/Video_analysis/webservice/service/__init__.py | xiaogaozi/bootcamp | d1a4b69edc3f7e31ce3809043128348aa3597df6 | [
"Apache-2.0"
] | 1 | 2021-04-06T06:13:20.000Z | 2021-04-06T06:13:20.000Z | solutions/Video_analysis/webservice/service/__init__.py | xiaogaozi/bootcamp | d1a4b69edc3f7e31ce3809043128348aa3597df6 | [
"Apache-2.0"
] | null | null | null | solutions/Video_analysis/webservice/service/__init__.py | xiaogaozi/bootcamp | d1a4b69edc3f7e31ce3809043128348aa3597df6 | [
"Apache-2.0"
] | null | null | null | import logging
logging.basicConfig(filename='app.log', filemode='w', format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
| 47 | 125 | 0.723404 | import logging
logging.basicConfig(filename='app.log', filemode='w', format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
| true | true |
1c2e9876fc598b4fe18d987e5b29e7d59029c28a | 2,224 | py | Python | hw3/hwserver.py | michaelbonds19/csc321 | 06dc460eb236f2177b158680e96a6f181eeb3418 | [
"MIT"
] | null | null | null | hw3/hwserver.py | michaelbonds19/csc321 | 06dc460eb236f2177b158680e96a6f181eeb3418 | [
"MIT"
] | null | null | null | hw3/hwserver.py | michaelbonds19/csc321 | 06dc460eb236f2177b158680e96a6f181eeb3418 | [
"MIT"
] | null | null | null | #
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
while True:
# Wait for next request from client
message = socket.recv(... | 23.410526 | 72 | 0.631295 |
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
while True:
message = socket.recv()
print("Received request: %s" % message)
time.sleep(1)
socket.send(b"World")
import zmq
from random import randrange
conte... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.