hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3594e67f3f6ba6b208b98c777c26d71c1846ac | 3,771 | py | Python | contrib/macdeploy/custom_dsstore.py | DreamCoinOfficial/DreamCoin | 9e4b698a09bf99d0266e5429b71cfb96da6eac60 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | DreamCoinOfficial/DreamCoin | 9e4b698a09bf99d0266e5429b71cfb96da6eac60 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | DreamCoinOfficial/DreamCoin | 9e4b698a09bf99d0266e5429b71cfb96da6eac60 | [
"MIT"
] | 1 | 2018-10-07T17:59:36.000Z | 2018-10-07T17:59:36.000Z | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.819672 | 1,817 | 0.727128 | from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': b'{{300, 2... | true | true |
1c359556bb686048bce755e3be36b7b20e5dd626 | 1,203 | py | Python | machine_translation/fairseq/models/fairseq_encoder.py | wangjksjtu/autoassist-exp | 7c4599fb250c2041ab007965b083750875dd6ac9 | [
"BSD-3-Clause"
] | 10 | 2019-11-19T18:03:59.000Z | 2021-01-13T18:18:19.000Z | machine_translation/fairseq/models/fairseq_encoder.py | wangjksjtu/autoassist-exp | 7c4599fb250c2041ab007965b083750875dd6ac9 | [
"BSD-3-Clause"
] | null | null | null | machine_translation/fairseq/models/fairseq_encoder.py | wangjksjtu/autoassist-exp | 7c4599fb250c2041ab007965b083750875dd6ac9 | [
"BSD-3-Clause"
] | 2 | 2019-12-03T16:35:46.000Z | 2020-04-10T21:45:20.000Z | import torch.nn as nn
class FairseqEncoder(nn.Module):
"""Base class for encoders."""
def __init__(self, dictionary):
super().__init__()
self.dictionary = dictionary
def forward(self, src_tokens, src_lengths):
"""
Args:
src_tokens (LongTensor): tokens in the s... | 29.341463 | 78 | 0.610973 | import torch.nn as nn
class FairseqEncoder(nn.Module):
def __init__(self, dictionary):
super().__init__()
self.dictionary = dictionary
def forward(self, src_tokens, src_lengths):
raise NotImplementedError
def reorder_encoder_out(self, encoder_out, new_order):
raise NotIm... | true | true |
1c359585aff131855335a4ab58037aaa8370831c | 82,001 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"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 ... | 49.848632 | 231 | 0.692918 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class VirtualNetworkGatewaysOperations(object):
models = models
def __i... | true | true |
1c3595aa8db877c916c7a3a1c15d81b0908b0cae | 2,537 | py | Python | utils.py | henrykasim/CS6220_MGGCN | 0e5cf9eee0e85be2a4bc3ab39611a7378ce15999 | [
"Apache-2.0"
] | null | null | null | utils.py | henrykasim/CS6220_MGGCN | 0e5cf9eee0e85be2a4bc3ab39611a7378ce15999 | [
"Apache-2.0"
] | null | null | null | utils.py | henrykasim/CS6220_MGGCN | 0e5cf9eee0e85be2a4bc3ab39611a7378ce15999 | [
"Apache-2.0"
] | null | null | null | '''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math
import torch.nn as nn
import torch.nn.ini... | 26.989362 | 69 | 0.562475 | import os
import sys
import time
import math
import torch.nn as nn
import torch.nn.init as init
term_width = 80
TOTAL_BAR_LENGTH = 65.
last_time = time.time()
begin_time = last_time
def progress_bar(current, total, msg=None):
global last_time, begin_time
if current == 0:
begin_time = ti... | true | true |
1c359607fb2eed80bcacb219fec5540be158c144 | 2,235 | py | Python | homeassistant/components/lcn/scene.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 4 | 2016-06-22T12:00:41.000Z | 2018-06-11T20:31:25.000Z | homeassistant/components/lcn/scene.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/components/lcn/scene.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2019-07-06T00:43:13.000Z | 2021-01-16T13:27:06.000Z | """Support for LCN scenes."""
from typing import Any
import pypck
from homeassistant.components.scene import Scene
from homeassistant.const import CONF_ADDRESS, CONF_SCENE
from . import LcnEntity
from .const import (
CONF_CONNECTIONS,
CONF_OUTPUTS,
CONF_REGISTER,
CONF_TRANSITION,
DATA_LCN,
OU... | 28.653846 | 88 | 0.665324 | from typing import Any
import pypck
from homeassistant.components.scene import Scene
from homeassistant.const import CONF_ADDRESS, CONF_SCENE
from . import LcnEntity
from .const import (
CONF_CONNECTIONS,
CONF_OUTPUTS,
CONF_REGISTER,
CONF_TRANSITION,
DATA_LCN,
OUTPUT_PORTS,
)
from .helpers im... | true | true |
1c359721a50f00cc6c1003cf26fafa5d46e97b98 | 3,709 | py | Python | Scanner.py | hajin-kim/PLS_TinyAda_Compiler | 9c376eaeab87688fb5b6af4f925003c6559b7c1b | [
"MIT"
] | null | null | null | Scanner.py | hajin-kim/PLS_TinyAda_Compiler | 9c376eaeab87688fb5b6af4f925003c6559b7c1b | [
"MIT"
] | null | null | null | Scanner.py | hajin-kim/PLS_TinyAda_Compiler | 9c376eaeab87688fb5b6af4f925003c6559b7c1b | [
"MIT"
] | 1 | 2020-12-05T13:28:38.000Z | 2020-12-05T13:28:38.000Z | from Const import Const
from Token import Token
from Chario import Chario
class Scanner:
"""
The Scanner class recognizes and generates tokens
in a stream of characters and returns these tokens to the parser.
The Scanner class also detects any lexical errors.
"""
def __init__(self, chario):
self.chario = char... | 29.436508 | 111 | 0.669453 | from Const import Const
from Token import Token
from Chario import Chario
class Scanner:
def __init__(self, chario):
self.chario = chario
def StringToken(self):
self.chario.GetNextChar()
result = ""
while self.chario.PeekNextChar() != "\"":
result += self.chario.GetNextChar()
self.chario.GetNex... | true | true |
1c35977c3665ef7141eccc522715cb0dd0bafe4d | 22,875 | py | Python | make-the-country/population_builder.py | awyrough/make-the-country | 4019f66e4041062fb8f76f25b57f664a7308cf0d | [
"MIT"
] | null | null | null | make-the-country/population_builder.py | awyrough/make-the-country | 4019f66e4041062fb8f76f25b57f664a7308cf0d | [
"MIT"
] | null | null | null | make-the-country/population_builder.py | awyrough/make-the-country | 4019f66e4041062fb8f76f25b57f664a7308cf0d | [
"MIT"
] | null | null | null | from itertools import chain
import random as rd
import numpy as np
def treat_income(data):
"""
Convert to doubles, or zero if NaN
"""
try:
return float(data)
except:
return 0.0
def treat_demo(data):
"""
Convert to ***
"""
return data
def treat_group(data):
"""... | 38.061564 | 189 | 0.50706 | from itertools import chain
import random as rd
import numpy as np
def treat_income(data):
try:
return float(data)
except:
return 0.0
def treat_demo(data):
return data
def treat_group(data):
return data
def treat_family(data):
return data
def extract_income(income):
fami... | true | true |
1c35979d53d9bc6a3421f7b64d03efca03b07692 | 382 | py | Python | authapp/urls.py | tum0xa/geekbrains-django2-homework | 55a7a0aa60da2978ab4abd5d2dacf7af21b301cc | [
"MIT"
] | null | null | null | authapp/urls.py | tum0xa/geekbrains-django2-homework | 55a7a0aa60da2978ab4abd5d2dacf7af21b301cc | [
"MIT"
] | null | null | null | authapp/urls.py | tum0xa/geekbrains-django2-homework | 55a7a0aa60da2978ab4abd5d2dacf7af21b301cc | [
"MIT"
] | null | null | null | from django.urls import path
import authapp.views as authapp
app_name = 'authapp'
urlpatterns = [
path('login/', authapp.login, name='login'),
path('logout', authapp.logout, name='logout'),
path('register/', authapp.register, name='register'),
path('edit/', authapp.edit, name='edit'),
path('verify/... | 31.833333 | 76 | 0.675393 | from django.urls import path
import authapp.views as authapp
app_name = 'authapp'
urlpatterns = [
path('login/', authapp.login, name='login'),
path('logout', authapp.logout, name='logout'),
path('register/', authapp.register, name='register'),
path('edit/', authapp.edit, name='edit'),
path('verify/... | true | true |
1c3597d09aa6a31612e7f03092b8eca067dd16b3 | 8,226 | py | Python | Personalization/script_BolCom.py | CyrilShch/persona-training-scripts | 8f026fe29b35b7f217fbb58445181dc0569f3321 | [
"MIT"
] | null | null | null | Personalization/script_BolCom.py | CyrilShch/persona-training-scripts | 8f026fe29b35b7f217fbb58445181dc0569f3321 | [
"MIT"
] | null | null | null | Personalization/script_BolCom.py | CyrilShch/persona-training-scripts | 8f026fe29b35b7f217fbb58445181dc0569f3321 | [
"MIT"
] | null | null | null | # imports
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
import pan... | 38.260465 | 182 | 0.642232 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
import pandas as pd
... | true | true |
1c3598a66c4040a3519509163bc6019d2f7f3d7a | 8,965 | py | Python | api/environments/views.py | SolidStateGroup/Bullet-Train-API | ea47ccbdadf665a806ae4e0eff6ad1a2f1b0ba19 | [
"BSD-3-Clause"
] | null | null | null | api/environments/views.py | SolidStateGroup/Bullet-Train-API | ea47ccbdadf665a806ae4e0eff6ad1a2f1b0ba19 | [
"BSD-3-Clause"
] | null | null | null | api/environments/views.py | SolidStateGroup/Bullet-Train-API | ea47ccbdadf665a806ae4e0eff6ad1a2f1b0ba19 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.utils.decorators import method_decorator
from drf_yasg2 import openapi
from drf_yasg2.utils import swagger_auto_schema
from flag_engine.api.document_builders import build_environment_document
from rest_framework import mixins, ... | 33.451493 | 88 | 0.668265 | from __future__ import unicode_literals
import logging
from django.utils.decorators import method_decorator
from drf_yasg2 import openapi
from drf_yasg2.utils import swagger_auto_schema
from flag_engine.api.document_builders import build_environment_document
from rest_framework import mixins, status, viewsets
from re... | true | true |
1c35990dae6d9ff8d69a6e3ecdefe2a0bc11800f | 41,418 | py | Python | python/src/lib/python/pelix/ipopo/decorators.py | isandlaTech/cohorte-runtime | 686556cdde20beba77ae202de9969be46feed5e2 | [
"Apache-2.0"
] | 6 | 2015-04-28T16:51:08.000Z | 2017-07-12T11:29:00.000Z | pelix/src/main/python/pelix/ipopo/decorators.py | isandlaTech/cohorte-3rdparty | d39a1bf5d6d39550f8ee93770bcac55c5f098367 | [
"Apache-2.0"
] | 29 | 2015-02-24T11:11:26.000Z | 2017-08-25T08:30:18.000Z | python/src/lib/python/pelix/ipopo/decorators.py | isandlaTech/cohorte-runtime | 686556cdde20beba77ae202de9969be46feed5e2 | [
"Apache-2.0"
] | 1 | 2015-08-24T13:23:43.000Z | 2015-08-24T13:23:43.000Z | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Defines the iPOPO decorators classes to manipulate component factory classes
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.7
:status: Beta
..
Copyright 2014 isandlaTech
Licensed under the A... | 33.893617 | 80 | 0.608504 |
__version_info__ = (0, 5, 7)
__version__ = ".".join(str(x) for x in __version_info__)
__docformat__ = "restructuredtext en"
from pelix.utilities import is_string, to_iterable
from pelix.ipopo.contexts import FactoryContext, Requirement
import pelix.ipopo.constants as constants
import inspect
import logging
import ... | true | true |
1c359b29600fc3f07ff3aa05035e35f61decb956 | 2,531 | py | Python | data/ghosts/ared_scatter.py | Vlad-Shcherbina/icfpc2014-tbd | 8169102307808a80801bf5ee55688e41287990bf | [
"WTFPL"
] | 4 | 2015-01-14T11:35:08.000Z | 2020-01-19T19:14:40.000Z | data/ghosts/ared_scatter.py | Vlad-Shcherbina/icfpc2014-tbd | 8169102307808a80801bf5ee55688e41287990bf | [
"WTFPL"
] | null | null | null | data/ghosts/ared_scatter.py | Vlad-Shcherbina/icfpc2014-tbd | 8169102307808a80801bf5ee55688e41287990bf | [
"WTFPL"
] | null | null | null | # python aghost.py ../data/ghosts/ared_scatter.py >../data/ghosts/ared_scatter.ghc
import game
def run():
WALL = 0
EMPTY = 1
PILL = 2
POWER_PILL = 3
FRUIT = 4
LM_START = 5
GHOST_START = 6
mem.x, mem.y = get_ghost_coords(get_index())
mem.tx, mem.ty = get_lm_coords()
mem.vitali... | 27.215054 | 84 | 0.504939 |
import game
def run():
WALL = 0
EMPTY = 1
PILL = 2
POWER_PILL = 3
FRUIT = 4
LM_START = 5
GHOST_START = 6
mem.x, mem.y = get_ghost_coords(get_index())
mem.tx, mem.ty = get_lm_coords()
mem.vitality, mem.old_dir = get_ghost_status(get_index())
mem.best_closest = 0
mem.b... | true | true |
1c359c31473983caa5968f9bc90f6cd52f26c029 | 8,025 | py | Python | doc/conf.py | glhr/gammatone | 14fdcd37c0c3054e5c85ed8c53f2cdec6e5d2b99 | [
"BSD-3-Clause"
] | 176 | 2015-01-08T03:56:11.000Z | 2022-03-31T09:36:40.000Z | doc/conf.py | glhr/gammatone | 14fdcd37c0c3054e5c85ed8c53f2cdec6e5d2b99 | [
"BSD-3-Clause"
] | 9 | 2015-01-01T06:11:29.000Z | 2020-12-28T23:32:29.000Z | doc/conf.py | glhr/gammatone | 14fdcd37c0c3054e5c85ed8c53f2cdec6e5d2b99 | [
"BSD-3-Clause"
] | 64 | 2015-03-31T05:16:37.000Z | 2022-02-18T10:17:49.000Z | # -*- coding: utf-8 -*-
#
# gammatone documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 8 23:21:49 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 31.594488 | 80 | 0.708287 |
import sys, os
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Gammatone Filterbank Toolkit'
copyright = u'2014, Jason Heeris'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The sho... | true | true |
1c359d5e9ed626c478696e05e998f64373e2c26d | 5,087 | py | Python | dataset.py | aod321/new_train | 23bf0a64ac274433cbc372898d97ae9d1aa5f6cd | [
"BSD-2-Clause"
] | 16 | 2020-07-11T07:53:49.000Z | 2022-03-10T11:52:31.000Z | dataset.py | aod321/new_train | 23bf0a64ac274433cbc372898d97ae9d1aa5f6cd | [
"BSD-2-Clause"
] | 1 | 2020-08-12T07:57:47.000Z | 2021-08-31T15:08:23.000Z | dataset.py | aod321/new_train | 23bf0a64ac274433cbc372898d97ae9d1aa5f6cd | [
"BSD-2-Clause"
] | 1 | 2022-02-28T10:32:43.000Z | 2022-02-28T10:32:43.000Z | import numpy as np
import os
from torch.utils.data import Dataset
from skimage import io
import cv2
import torch
class HelenDataset(Dataset):
# HelenDataset
def __init__(self, txt_file, root_dir, parts_root_dir=None, transform=None):
"""
Args:
txt_file (string): Path to the txt fi... | 39.130769 | 116 | 0.553175 | import numpy as np
import os
from torch.utils.data import Dataset
from skimage import io
import cv2
import torch
class HelenDataset(Dataset):
def __init__(self, txt_file, root_dir, parts_root_dir=None, transform=None):
self.name_list = np.loadtxt(os.path.join(root_dir, txt_file), dtype="str", delimit... | true | true |
1c359ee05d301a0225cfaa3fa30c2d9d8f2e14e9 | 14,180 | py | Python | tests/components/mazda/test_config_flow.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | tests/components/mazda/test_config_flow.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | tests/components/mazda/test_config_flow.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Test the Mazda Connected Services config flow."""
from unittest.mock import patch
import aiohttp
from openpeerpower import config_entries, data_entry_flow, setup
from openpeerpower.components.mazda.config_flow import (
MazdaAccountLockedException,
MazdaAuthenticationException,
)
from openpeerpower.componen... | 33.443396 | 88 | 0.656488 | from unittest.mock import patch
import aiohttp
from openpeerpower import config_entries, data_entry_flow, setup
from openpeerpower.components.mazda.config_flow import (
MazdaAccountLockedException,
MazdaAuthenticationException,
)
from openpeerpower.components.mazda.const import DOMAIN
from openpeerpower.const... | true | true |
1c359f540801b70b7fd2d2cf16e53d8746b7b093 | 1,101 | py | Python | app/main/lib/shared_models/indian_sbert.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 11 | 2018-02-07T00:16:54.000Z | 2021-05-13T22:47:07.000Z | app/main/lib/shared_models/indian_sbert.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 47 | 2018-11-26T23:17:37.000Z | 2022-03-25T16:12:05.000Z | app/main/lib/shared_models/indian_sbert.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 9 | 2019-05-23T22:06:03.000Z | 2020-10-27T20:45:04.000Z | import requests
from sentence_transformers import SentenceTransformer
from flask import current_app as app
from app.main.lib.shared_models.shared_model import SharedModel
from app.main.lib.similarity_measures import angular_similarity
class IndianSbert(SharedModel):
def load(self):
model_name = self.optio... | 35.516129 | 95 | 0.673933 | import requests
from sentence_transformers import SentenceTransformer
from flask import current_app as app
from app.main.lib.shared_models.shared_model import SharedModel
from app.main.lib.similarity_measures import angular_similarity
class IndianSbert(SharedModel):
def load(self):
model_name = self.optio... | true | true |
1c35a1d2dbe619d8bc3b78661c7b4ad91e236806 | 2,500 | py | Python | mmdet/core/post_processing/bbox_nms.py | marinarierav-uab/foveabox | 1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:04:34.000Z | 2021-01-14T12:04:34.000Z | mmdet/core/post_processing/bbox_nms.py | marinarierav-uab/foveabox | 1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5 | [
"Apache-2.0"
] | null | null | null | mmdet/core/post_processing/bbox_nms.py | marinarierav-uab/foveabox | 1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5 | [
"Apache-2.0"
] | null | null | null | import torch
from mmdet.ops.nms import nms_wrapper
def multiclass_nms(multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None):
"""NMS for multi-class bboxes.
Args:
multi_bboxes (Ten... | 35.211268 | 99 | 0.5612 | import torch
from mmdet.ops.nms import nms_wrapper
def multiclass_nms(multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None):
num_classes = multi_scores.shape[1]
bboxes, labels = [], []
... | true | true |
1c35a247b4bb1cb6218f6cb0c90d1d9a63a5f510 | 9,603 | py | Python | tests/clvm/test_puzzles.py | AedgeCoin/aedge-blockchain2 | 8a690026e73b59572d6d40da5003bab1bbd71057 | [
"Apache-2.0"
] | 6 | 2021-10-12T03:51:57.000Z | 2022-02-09T04:28:48.000Z | tests/clvm/test_puzzles.py | AedgeCoin/aedge-blockchain2 | 8a690026e73b59572d6d40da5003bab1bbd71057 | [
"Apache-2.0"
] | 4 | 2021-10-11T18:36:46.000Z | 2021-10-17T18:18:16.000Z | tests/clvm/test_puzzles.py | AedgeCoin/aedge-blockchain2 | 8a690026e73b59572d6d40da5003bab1bbd71057 | [
"Apache-2.0"
] | 4 | 2021-11-05T17:20:37.000Z | 2022-03-16T02:59:05.000Z | from typing import Iterable, List, Tuple
from unittest import TestCase
from blspy import AugSchemeMPL, BasicSchemeMPL, G1Element, G2Element
from aedge.types.blockchain_format.program import Program
from aedge.types.blockchain_format.sized_bytes import bytes32
from aedge.types.coin_spend import CoinSpend
from aedge.ty... | 39.356557 | 111 | 0.75289 | from typing import Iterable, List, Tuple
from unittest import TestCase
from blspy import AugSchemeMPL, BasicSchemeMPL, G1Element, G2Element
from aedge.types.blockchain_format.program import Program
from aedge.types.blockchain_format.sized_bytes import bytes32
from aedge.types.coin_spend import CoinSpend
from aedge.ty... | true | true |
1c35a290382adab8e3e0c12672d1944211c3a49a | 2,958 | py | Python | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddCasterComponentRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddCasterComponentRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddCasterComponentRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | 1 | 2021-01-26T05:01:42.000Z | 2021-01-26T05:01:42.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.866667 | 79 | 0.768087 |
from aliyunsdkcore.request import RpcRequest
class AddCasterComponentRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'live', '2016-11-01', 'AddCasterComponent','live')
def get_ImageLayerContent(self):
return self.get_query_params().get('ImageLayerContent')
def set_ImageLayerContent(se... | true | true |
1c35a2c55a9edc93f75b27cf557964534bc944c3 | 16,462 | py | Python | codeformatter/lib/scssbeautifier/css/beautifier.py | ephenyxshop/sublimetext-codeformatter | f4af5682b3e28d7ec0b450808bc0c0ad6b017fa9 | [
"MIT"
] | 676 | 2015-01-01T03:56:14.000Z | 2022-03-31T18:20:47.000Z | python/cssbeautifier/css/beautifier.py | Houfeng/js-beautify | 0076b9f342875be32067725d61538086e902725e | [
"MIT"
] | 331 | 2015-01-02T19:31:30.000Z | 2022-03-19T03:24:29.000Z | python/cssbeautifier/css/beautifier.py | Houfeng/js-beautify | 0076b9f342875be32067725d61538086e902725e | [
"MIT"
] | 196 | 2015-01-02T20:48:12.000Z | 2022-03-13T06:48:19.000Z | from __future__ import print_function
import sys
import re
import copy
from .options import BeautifierOptions
from jsbeautifier.core.options import mergeOpts
from jsbeautifier.core.output import Output
from jsbeautifier.__version__ import __version__
#
# The MIT License (MIT)
# Copyright (c) 2007-2017 Einar Lielmanis... | 36.339956 | 137 | 0.537177 | from __future__ import print_function
import sys
import re
import copy
from .options import BeautifierOptions
from jsbeautifier.core.options import mergeOpts
from jsbeautifier.core.output import Output
from jsbeautifier.__version__ import __version__
def default_options():
return BeautifierOptions()
def be... | true | true |
1c35a3299e5dc555e4a406f196805aa546c90319 | 25,181 | py | Python | tensorflow_federated/python/core/impl/computation/function_utils.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:49:34.000Z | 2021-05-10T10:49:34.000Z | tensorflow_federated/python/core/impl/computation/function_utils.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/computation/function_utils.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.348112 | 91 | 0.713554 |
import functools
import inspect
import types
import typing
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union
from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.common_libs import structure
from tensorflow_federated.python.core.api im... | true | true |
1c35a34531ffadf1c4956f663b32f6b78f00ab93 | 8,020 | py | Python | train.py | sam1373/glow-tts | e38e9f0d149c55d3726b059802971145746d99cd | [
"MIT"
] | null | null | null | train.py | sam1373/glow-tts | e38e9f0d149c55d3726b059802971145746d99cd | [
"MIT"
] | null | null | null | train.py | sam1373/glow-tts | e38e9f0d149c55d3726b059802971145746d99cd | [
"MIT"
] | null | null | null | import os
import json
import argparse
import math
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.multiprocessing as mp
import torch.distributed as dist
from apex.parallel import Distribu... | 40.505051 | 230 | 0.673317 | import os
import json
import argparse
import math
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.multiprocessing as mp
import torch.distributed as dist
from apex.parallel import Distribu... | true | true |
1c35a46820e838ec02df61e6d7846407f0d6f7e6 | 1,562 | py | Python | tests/test_forced_phot_inject.py | askap-vast/forced_phot | 8f4307825781743755d189418a9cb9111aaf0b63 | [
"MIT"
] | null | null | null | tests/test_forced_phot_inject.py | askap-vast/forced_phot | 8f4307825781743755d189418a9cb9111aaf0b63 | [
"MIT"
] | null | null | null | tests/test_forced_phot_inject.py | askap-vast/forced_phot | 8f4307825781743755d189418a9cb9111aaf0b63 | [
"MIT"
] | null | null | null | import time
import warnings
from astropy import units as u, constants as c
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.io.fits.verify import VerifyWarning
from astropy.table import Table
import astropy.wcs
from astropy.utils.exceptions import AstropyWarning
from matplotlib import p... | 33.234043 | 86 | 0.741357 | import time
import warnings
from astropy import units as u, constants as c
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.io.fits.verify import VerifyWarning
from astropy.table import Table
import astropy.wcs
from astropy.utils.exceptions import AstropyWarning
from matplotlib import p... | true | true |
1c35a4b6d41045fe785dbc29ec44ff85ef64509a | 4,575 | py | Python | PyQuM/ver(1.1)/pyqum/display.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | PyQuM/ver(1.1)/pyqum/display.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | PyQuM/ver(1.1)/pyqum/display.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | # Loading Basics
from colorama import init, Back, Fore
init(autoreset=True) #to convert termcolor to wins color
from os.path import basename as bs
myname = bs(__file__).split('.')[0] # This py-script's name
from flask import Blueprint, render_template, request, redirect, Response, stream_with_context
import random, js... | 36.895161 | 149 | 0.558033 | from colorama import init, Back, Fore
init(autoreset=True) from os.path import basename as bs
myname = bs(__file__).split('.')[0]
from flask import Blueprint, render_template, request, redirect, Response, stream_with_context
import random, json, glob, time
import numpy as np
from pyqum import stream_template
bp = Bl... | true | true |
1c35a4f586b8f36ca18fe3a5c76fe04643e128f0 | 131 | py | Python | invest_scenario_generator_summary.py | phargogh/invest-natcap.invest-3 | ee96055a4fa034d9a95fa8ccc6259ab03264e6c1 | [
"BSD-3-Clause"
] | null | null | null | invest_scenario_generator_summary.py | phargogh/invest-natcap.invest-3 | ee96055a4fa034d9a95fa8ccc6259ab03264e6c1 | [
"BSD-3-Clause"
] | null | null | null | invest_scenario_generator_summary.py | phargogh/invest-natcap.invest-3 | ee96055a4fa034d9a95fa8ccc6259ab03264e6c1 | [
"BSD-3-Clause"
] | null | null | null | import invest_natcap.iui.modelui
if __name__ == '__main__':
invest_natcap.iui.modelui.main('scenario-generator-summary.json')
| 26.2 | 69 | 0.778626 | import invest_natcap.iui.modelui
if __name__ == '__main__':
invest_natcap.iui.modelui.main('scenario-generator-summary.json')
| true | true |
1c35a5a8ef74d6c695b4741787fb1b953ad1bb5e | 4,016 | py | Python | MODEL/model_bag_classifier.py | quincy-125/DigiPath_CLAM_TF | 8b7ab50caaca13f666268b0f4e071d123e190978 | [
"MIT"
] | 5 | 2021-05-10T17:23:46.000Z | 2022-02-27T22:33:03.000Z | MODEL/model_bag_classifier.py | quincy-125/DigiPath_CLAM_TF | 8b7ab50caaca13f666268b0f4e071d123e190978 | [
"MIT"
] | null | null | null | MODEL/model_bag_classifier.py | quincy-125/DigiPath_CLAM_TF | 8b7ab50caaca13f666268b0f4e071d123e190978 | [
"MIT"
] | 2 | 2020-12-12T00:15:21.000Z | 2021-05-10T17:23:57.000Z | import tensorflow as tf
import numpy as np
class S_Bag(tf.keras.Model):
def __init__(self, dim_compress_features=512, n_class=2):
super(S_Bag, self).__init__()
self.dim_compress_features = dim_compress_features
self.n_class = n_class
self.s_bag_model = tf.keras.models.Sequential()... | 38.615385 | 117 | 0.627241 | import tensorflow as tf
import numpy as np
class S_Bag(tf.keras.Model):
def __init__(self, dim_compress_features=512, n_class=2):
super(S_Bag, self).__init__()
self.dim_compress_features = dim_compress_features
self.n_class = n_class
self.s_bag_model = tf.keras.models.Sequential()... | true | true |
1c35a5b23716abd9d9b68128141ad5d8c46c52d4 | 16,669 | py | Python | dmd/dmd.py | HaldexBrake/ReducedOrderModeling | d56917f52018dabd317c1a9a583efe0b90cc9e7b | [
"Apache-2.0"
] | 2 | 2020-09-23T08:15:38.000Z | 2021-05-05T13:09:19.000Z | dmd/dmd.py | HaldexBrake/ReducedOrderModeling | d56917f52018dabd317c1a9a583efe0b90cc9e7b | [
"Apache-2.0"
] | null | null | null | dmd/dmd.py | HaldexBrake/ReducedOrderModeling | d56917f52018dabd317c1a9a583efe0b90cc9e7b | [
"Apache-2.0"
] | 1 | 2022-03-05T05:53:28.000Z | 2022-03-05T05:53:28.000Z | """
"""
from pyfmi import load_fmu
import numpy as np
from scipy.linalg import eig
from numpy.linalg import svd, solve, inv, norm
import matplotlib.pyplot as plt
from sympy import symbols, lambdify
def create_input_vec(time_vec, inp_type='sin', amp=10.0, freq=1.0, delta_time=1.0, duration=1):
"""Constructs an in... | 35.092632 | 140 | 0.601476 | from pyfmi import load_fmu
import numpy as np
from scipy.linalg import eig
from numpy.linalg import svd, solve, inv, norm
import matplotlib.pyplot as plt
from sympy import symbols, lambdify
def create_input_vec(time_vec, inp_type='sin', amp=10.0, freq=1.0, delta_time=1.0, duration=1):
if amp == 0:
u = Non... | true | true |
1c35a6637f534abf4a37763fe1915c35e18e1f94 | 10,705 | py | Python | fluid/DeepASR/train.py | phlrain/models | 59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea | [
"Apache-2.0"
] | 1 | 2018-09-12T09:36:44.000Z | 2018-09-12T09:36:44.000Z | fluid/DeepASR/train.py | phlrain/models | 59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea | [
"Apache-2.0"
] | null | null | null | fluid/DeepASR/train.py | phlrain/models | 59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea | [
"Apache-2.0"
] | 2 | 2018-06-14T13:59:36.000Z | 2018-11-14T12:34:47.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import argparse
import time
import paddle.fluid as fluid
import data_utils.augmentor.trans_mean_variance_norm as trans_mean_variance_norm
import data_utils.augmentor.tra... | 36.535836 | 89 | 0.58795 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import argparse
import time
import paddle.fluid as fluid
import data_utils.augmentor.trans_mean_variance_norm as trans_mean_variance_norm
import data_utils.augmentor.tra... | true | true |
1c35a6b02678f7ef62a5d7a45ee173d8bed8fcb8 | 3,308 | py | Python | Statstool-Desktop/SetupWindow.py | Declaminius/EU4-MP-Statstool | 2df7b7f08f1c97257dec325322a2e491ea856432 | [
"MIT"
] | 1 | 2020-10-06T14:48:32.000Z | 2020-10-06T14:48:32.000Z | Statstool-Desktop/SetupWindow.py | Declaminius/EU4-MP-Statstool | 2df7b7f08f1c97257dec325322a2e491ea856432 | [
"MIT"
] | 3 | 2021-09-08T02:36:13.000Z | 2022-03-12T00:50:09.000Z | Statstool-Desktop/SetupWindow.py | Declaminius/EU4-MP-Statstool | 2df7b7f08f1c97257dec325322a2e491ea856432 | [
"MIT"
] | 1 | 2020-09-26T15:31:24.000Z | 2020-09-26T15:31:24.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 25 02:14:51 2019
@author: Florian
"""
import PyQt5.QtWidgets as Widgets
import PyQt5.QtGui as Gui
import PyQt5.QtCore as Core
from parserfunctions import edit_parse
from Savegame import Savegame
from config import icon_dir, old_nations_list, new_nations_list
class Setup... | 33.414141 | 130 | 0.738513 |
import PyQt5.QtWidgets as Widgets
import PyQt5.QtGui as Gui
import PyQt5.QtCore as Core
from parserfunctions import edit_parse
from Savegame import Savegame
from config import icon_dir, old_nations_list, new_nations_list
class SetupWindow(Widgets.QMainWindow):
switch_window = Core.pyqtSignal()
def __init__(self):
... | true | true |
1c35a6b30dedb9e02bf92ea0967bf9cfc0bd983b | 1,793 | py | Python | otherUsefulScripts/compile_all_plots.py | MagnusHaughey/liverMitoDNAPipeline | 0d63a41ea626bca032473450e3d10d451744f175 | [
"MIT"
] | null | null | null | otherUsefulScripts/compile_all_plots.py | MagnusHaughey/liverMitoDNAPipeline | 0d63a41ea626bca032473450e3d10d451744f175 | [
"MIT"
] | null | null | null | otherUsefulScripts/compile_all_plots.py | MagnusHaughey/liverMitoDNAPipeline | 0d63a41ea626bca032473450e3d10d451744f175 | [
"MIT"
] | null | null | null |
import numpy as np
import glob
import subprocess
import sys
parent_dir = sys.argv[1]
all_files = []
for file in glob.glob(parent_dir + "/*scatterPlot.pdf"):
file = file.split("/")[-1]
all_files.append(file[:-20])
all_files = sorted(set(all_files))
#print(all_files)
#exit(0)
f = open(parent_dir + "/all_SNV_plo... | 51.228571 | 550 | 0.663134 |
import numpy as np
import glob
import subprocess
import sys
parent_dir = sys.argv[1]
all_files = []
for file in glob.glob(parent_dir + "/*scatterPlot.pdf"):
file = file.split("/")[-1]
all_files.append(file[:-20])
all_files = sorted(set(all_files))
f = open(parent_dir + "/all_SNV_plots.tex" , 'w')
f.write("\\... | true | true |
1c35a6e1e0a001f7ac58faac00836738f1d077db | 1,866 | py | Python | shap/benchmark/methods.py | JiechengZhao/shap | ec26a1e0ccdf0a3885943e63502cf479194c13d1 | [
"MIT"
] | null | null | null | shap/benchmark/methods.py | JiechengZhao/shap | ec26a1e0ccdf0a3885943e63502cf479194c13d1 | [
"MIT"
] | null | null | null | shap/benchmark/methods.py | JiechengZhao/shap | ec26a1e0ccdf0a3885943e63502cf479194c13d1 | [
"MIT"
] | null | null | null | from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from .. import TreeExplainer
from ..explainers import other
method_dict = {
"Linear SHAP (corr)": lambda model, X: LinearExplainer(model, X, nsamples=1000).shap_values,
"Linear SHAP (ind)": lambda model, X: LinearExp... | 43.395349 | 145 | 0.690782 | from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from .. import TreeExplainer
from ..explainers import other
method_dict = {
"Linear SHAP (corr)": lambda model, X: LinearExplainer(model, X, nsamples=1000).shap_values,
"Linear SHAP (ind)": lambda model, X: LinearExp... | true | true |
1c35a6e7cc220a027ff5cd4f4aaa716267fd3830 | 18,310 | py | Python | private/templates/EVASS/config.py | hitesh96db/eden | 8e1b22d7d4b92c0bce5b6172d57298949a2f0582 | [
"MIT"
] | null | null | null | private/templates/EVASS/config.py | hitesh96db/eden | 8e1b22d7d4b92c0bce5b6172d57298949a2f0582 | [
"MIT"
] | null | null | null | private/templates/EVASS/config.py | hitesh96db/eden | 8e1b22d7d4b92c0bce5b6172d57298949a2f0582 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
from gluon.validators import IS_NOT_EMPTY, IS_EMPTY_OR, IS_IN_SET
from s3 import... | 38.874735 | 147 | 0.593501 |
try:
from collections import OrderedDict
except:
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
from gluon.validators import IS_NOT_EMPTY, IS_EMPTY_OR, IS_IN_SET
from s3 import s3_date, S3Represent
T = current.T
settings = cu... | true | true |
1c35a8ea0984c9b012086dfb54aee13e6e258451 | 16,518 | py | Python | venv/Lib/site-packages/scipy/_lib/_util.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 6 | 2019-12-21T21:15:54.000Z | 2021-04-20T17:35:24.000Z | venv/Lib/site-packages/scipy/_lib/_util.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/Lib/site-packages/scipy/_lib/_util.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 3 | 2021-01-31T16:40:52.000Z | 2021-08-29T18:32:34.000Z | import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import math
import numpy as np
try:
from numpy.random import Generator as Generator
except ImportError:
class Generator(): # type: ignore[no-redef]
pass
def _lazywhere(cond, ... | 34.484342 | 84 | 0.618658 | import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import math
import numpy as np
try:
from numpy.random import Generator as Generator
except ImportError:
class Generator(): pass
def _lazywhere(cond, arrays, f, fillvalue=None... | true | true |
1c35a915fceb0b31f4541e4a9cb30f32209280a0 | 2,441 | py | Python | task-example.py | EverAzureRest/batch_examples | 7daec97a468770c3d07cdb02f67951e5be75c153 | [
"MIT"
] | null | null | null | task-example.py | EverAzureRest/batch_examples | 7daec97a468770c3d07cdb02f67951e5be75c153 | [
"MIT"
] | null | null | null | task-example.py | EverAzureRest/batch_examples | 7daec97a468770c3d07cdb02f67951e5be75c153 | [
"MIT"
] | null | null | null |
from datetime import datetime, timedelta
import azure.batch.batch_auth as batchauth
import azure.batch._batch_service_client as batch
import uuid
import datetime
import time
# Batch account credentials
BATCH_ACCOUNT_NAME = ''
BATCH_ACCOUNT_URL = ''
BATCH_ACCOUNT_KEY = ''
# Create a Batch service client. We'll now b... | 24.656566 | 90 | 0.711184 |
from datetime import datetime, timedelta
import azure.batch.batch_auth as batchauth
import azure.batch._batch_service_client as batch
import uuid
import datetime
import time
BATCH_ACCOUNT_NAME = ''
BATCH_ACCOUNT_URL = ''
BATCH_ACCOUNT_KEY = ''
# service in addition to Storage.
credentials = batchauth.SharedKeyCrede... | true | true |
1c35a9dccb3bab73f67b1b1fbe686f62f3c44b14 | 58,897 | py | Python | oscar/lib/python2.7/site-packages/django/test/testcases.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/test/testcases.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/test/testcases.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import difflib
import json
import posixpath
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util import safe_repr
fro... | 41.800568 | 118 | 0.596856 | from __future__ import unicode_literals
import difflib
import json
import posixpath
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util import safe_repr
fro... | true | true |
1c35aa1277ffe802f90bac0cd78c1c4a49041400 | 69,352 | py | Python | hack/test_errata.py | Davoska/cincinnati-graph-data | 3bc79fdcefa72f570e0757c0bfd46d4302543264 | [
"Apache-2.0"
] | null | null | null | hack/test_errata.py | Davoska/cincinnati-graph-data | 3bc79fdcefa72f570e0757c0bfd46d4302543264 | [
"Apache-2.0"
] | null | null | null | hack/test_errata.py | Davoska/cincinnati-graph-data | 3bc79fdcefa72f570e0757c0bfd46d4302543264 | [
"Apache-2.0"
] | null | null | null | import copy
import datetime
import os
import tempfile
import unittest
import urllib
from unittest.mock import MagicMock
from unittest.mock import patch
import errata
class GithubUserMock():
def __init__(self, login):
self.login = login
class GithubLabelMock():
def __init__(self, name):
self... | 40.509346 | 194 | 0.552818 | import copy
import datetime
import os
import tempfile
import unittest
import urllib
from unittest.mock import MagicMock
from unittest.mock import patch
import errata
class GithubUserMock():
def __init__(self, login):
self.login = login
class GithubLabelMock():
def __init__(self, name):
self... | true | true |
1c35aa5795469720903de6148dacc6c54b641b80 | 8,290 | py | Python | Tensorflow-master/experiments/2D_car/car_env.py | gustasvs/AI | 23360a8865e8211568594c2b2ced11dcdc9b0006 | [
"MIT"
] | 1 | 2022-02-03T18:21:28.000Z | 2022-02-03T18:21:28.000Z | Tensorflow-master/experiments/2D_car/car_env.py | gustasvs/AI | 23360a8865e8211568594c2b2ced11dcdc9b0006 | [
"MIT"
] | null | null | null | Tensorflow-master/experiments/2D_car/car_env.py | gustasvs/AI | 23360a8865e8211568594c2b2ced11dcdc9b0006 | [
"MIT"
] | null | null | null | import numpy as np
import pyglet
pyglet.clock.set_fps_limit(10000)
class CarEnv(object):
n_sensor = 5
action_dim = 1
state_dim = n_sensor
viewer = None
viewer_xy = (1080, 720)
sensor_max = 150.
start_point = [100, 100]
speed = 50.
dt = 0.1
def __init__(self, discrete_action=... | 34.39834 | 141 | 0.516164 | import numpy as np
import pyglet
pyglet.clock.set_fps_limit(10000)
class CarEnv(object):
n_sensor = 5
action_dim = 1
state_dim = n_sensor
viewer = None
viewer_xy = (1080, 720)
sensor_max = 150.
start_point = [100, 100]
speed = 50.
dt = 0.1
def __init__(self, discrete_action=... | true | true |
1c35acc60445d40021308b66c56037df70001c8a | 1,341 | py | Python | tests/test_0806-empty-lists-cartesian-fix.py | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 519 | 2019-10-17T12:36:22.000Z | 2022-03-26T23:28:19.000Z | tests/test_0806-empty-lists-cartesian-fix.py | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 924 | 2019-11-03T21:05:01.000Z | 2022-03-31T22:44:30.000Z | tests/test_0806-empty-lists-cartesian-fix.py | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 56 | 2019-12-17T15:49:22.000Z | 2022-03-09T20:34:06.000Z | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_empty_arrays_cartesian():
one = ak.Array([])
two = one = ak.Array([])
w... | 28.531915 | 87 | 0.61745 |
from __future__ import absolute_import
import pytest import numpy as np import awkward as ak
def test_empty_arrays_cartesian():
one = ak.Array([])
two = one = ak.Array([])
with pytest.raises(ValueError) as err:
ak.to_list(ak.cartesian([one, two]))
assert isinstance(err.value, ValueError... | true | true |
1c35ad0d92514753f02b80b801f52e4c875bc666 | 678 | py | Python | publichealth/home/migrations/0006_auto_20170308_2025.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 2 | 2020-10-29T16:27:21.000Z | 2021-06-07T12:47:46.000Z | publichealth/home/migrations/0006_auto_20170308_2025.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 11 | 2017-05-09T10:50:28.000Z | 2021-12-15T17:01:23.000Z | publichealth/home/migrations/0006_auto_20170308_2025.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 4 | 2017-04-24T13:06:55.000Z | 2021-06-04T02:18:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-08 19:25
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20170308_2023'),
]
operations = [
migr... | 25.111111 | 76 | 0.610619 | from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20170308_2023'),
]
operations = [
migrations.AlterField(
model_name='homepage',
name='b... | true | true |
1c35ad55636c2686b513661ccc358f40c7bd6bba | 1,571 | py | Python | tests/test_featurizers/test_fasttext_featurizer.py | tienhoang1994/rasa-nlu-examples | fe12dbc814d992382c1ca1d926b340139200928f | [
"Apache-2.0"
] | 1 | 2022-03-31T17:00:38.000Z | 2022-03-31T17:00:38.000Z | tests/test_featurizers/test_fasttext_featurizer.py | tienhoang1994/rasa-nlu-examples | fe12dbc814d992382c1ca1d926b340139200928f | [
"Apache-2.0"
] | null | null | null | tests/test_featurizers/test_fasttext_featurizer.py | tienhoang1994/rasa-nlu-examples | fe12dbc814d992382c1ca1d926b340139200928f | [
"Apache-2.0"
] | null | null | null | import pathlib
import pytest
from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
from .dense_featurizer_checks import dense_standard_test_combinations
from rasa_nlu_examples.featurizers.dense.fasttext_featurizer import FastTextFeaturizer
from rasa.engine.storage.resource import Resource
from rasa... | 32.061224 | 86 | 0.809675 | import pathlib
import pytest
from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
from .dense_featurizer_checks import dense_standard_test_combinations
from rasa_nlu_examples.featurizers.dense.fasttext_featurizer import FastTextFeaturizer
from rasa.engine.storage.resource import Resource
from rasa... | true | true |
1c35ae89ea08ad34a1f9ffe529f3f9ee74d3d51c | 1,203 | py | Python | venv/lib/python3.8/site-packages/test/test_api_service_out.py | akshitgoyal/csc398nlp | 6adf80cb7fa3737f88faf73a6e818da495b95ab4 | [
"MIT"
] | 1 | 2020-09-28T10:09:25.000Z | 2020-09-28T10:09:25.000Z | venv/lib/python3.8/site-packages/test/test_api_service_out.py | akshitgoyal/NLP-Research-Project | 6adf80cb7fa3737f88faf73a6e818da495b95ab4 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/test/test_api_service_out.py | akshitgoyal/NLP-Research-Project | 6adf80cb7fa3737f88faf73a6e818da495b95ab4 | [
"MIT"
] | 1 | 2020-07-01T18:46:20.000Z | 2020-07-01T18:46:20.000Z | # coding: utf-8
"""
NamSor API v2
NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 100 names at a time). Need something you can't fi... | 29.341463 | 385 | 0.720698 |
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.models.api_service_out import APIServiceOut from openapi_client.rest import ApiException
class TestAPIServiceOut(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def ... | true | true |
1c35aecec3f373c15ba7cd460b115cc89022eb60 | 111 | py | Python | datatrans/fooddata/__init__.py | KooCook/datatrans | 65c80da4d8a1ed67963b9d704b361c864cb1151b | [
"BSD-3-Clause"
] | 1 | 2020-10-24T04:07:42.000Z | 2020-10-24T04:07:42.000Z | datatrans/fooddata/__init__.py | KooCook/datatrans | 65c80da4d8a1ed67963b9d704b361c864cb1151b | [
"BSD-3-Clause"
] | null | null | null | datatrans/fooddata/__init__.py | KooCook/datatrans | 65c80da4d8a1ed67963b9d704b361c864cb1151b | [
"BSD-3-Clause"
] | null | null | null | from datatrans.fooddata import api
from datatrans.fooddata import detail
from datatrans.fooddata import search
| 27.75 | 37 | 0.864865 | from datatrans.fooddata import api
from datatrans.fooddata import detail
from datatrans.fooddata import search
| true | true |
1c35afab8a78f4681bf577dc3bbd6a8f18a92c36 | 657 | py | Python | kospeech/checkpoint/__init__.py | daiyaanarfeen/kospeech | 5aff5c7647e5cceceddf7b22c991777fc3792400 | [
"Apache-2.0"
] | 257 | 2020-06-06T14:20:47.000Z | 2021-08-12T05:01:39.000Z | kospeech/checkpoint/__init__.py | daiyaanarfeen/kospeech | 5aff5c7647e5cceceddf7b22c991777fc3792400 | [
"Apache-2.0"
] | 100 | 2020-06-08T00:39:28.000Z | 2021-08-04T11:22:02.000Z | kospeech/checkpoint/__init__.py | daiyaanarfeen/kospeech | 5aff5c7647e5cceceddf7b22c991777fc3792400 | [
"Apache-2.0"
] | 96 | 2020-06-10T06:12:52.000Z | 2021-08-09T14:40:01.000Z | # Copyright (c) 2020, Soohwan Kim. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 41.0625 | 74 | 0.768645 |
from kospeech.checkpoint.checkpoint import Checkpoint
| true | true |
1c35b01d681087d3df62b6a76903aa79019ea58d | 509 | py | Python | magPi_02_pygameGraphicsWindow.py | oniMoNaku/thePit | f82d2dc70346e6188fca493a4b9373aa99ccfa32 | [
"Unlicense"
] | null | null | null | magPi_02_pygameGraphicsWindow.py | oniMoNaku/thePit | f82d2dc70346e6188fca493a4b9373aa99ccfa32 | [
"Unlicense"
] | null | null | null | magPi_02_pygameGraphicsWindow.py | oniMoNaku/thePit | f82d2dc70346e6188fca493a4b9373aa99ccfa32 | [
"Unlicense"
] | null | null | null | # today is 389e
# the python pit
# magPi - 02
# OPEN A PYGAME GRAPHICS WINDOW
import os, pygame
from pygame.locals import *
pygame.init()
clock = pygame.time.Clock()
os.environ['SDL_VIDEO_WINDOW_POS'] = 'center'
# This title appears along the top of the graphics window
pygame.display.set_caption("The Title Of My Progr... | 33.933333 | 67 | 0.760314 |
import os, pygame
from pygame.locals import *
pygame.init()
clock = pygame.time.Clock()
os.environ['SDL_VIDEO_WINDOW_POS'] = 'center'
pygame.display.set_caption("The Title Of My Program")
screen = pygame.display.set_mode([400,200],0,32)
pygame.time.wait(5000) | true | true |
1c35b0a824439fa3f3b63575ab92750ffcf360c6 | 7,628 | py | Python | tests/unit/test_opentelemetry_tracing.py | jprice-quizlet/python-bigquery | dcfbac267fbf66d189b0cc7e76f4712122a74b7b | [
"Apache-2.0"
] | null | null | null | tests/unit/test_opentelemetry_tracing.py | jprice-quizlet/python-bigquery | dcfbac267fbf66d189b0cc7e76f4712122a74b7b | [
"Apache-2.0"
] | null | null | null | tests/unit/test_opentelemetry_tracing.py | jprice-quizlet/python-bigquery | dcfbac267fbf66d189b0cc7e76f4712122a74b7b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 35.812207 | 86 | 0.700708 |
import datetime
import sys
import mock
try:
import opentelemetry
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
InM... | true | true |
1c35b178ec8c60bfe97e723609f7a883c6a014de | 2,808 | py | Python | sensorflow/console.py | maxpowel/sensorflow-python | 7c6f23087fbff085c43dd6d3bc00ce8dae884484 | [
"MIT"
] | null | null | null | sensorflow/console.py | maxpowel/sensorflow-python | 7c6f23087fbff085c43dd6d3bc00ce8dae884484 | [
"MIT"
] | null | null | null | sensorflow/console.py | maxpowel/sensorflow-python | 7c6f23087fbff085c43dd6d3bc00ce8dae884484 | [
"MIT"
] | null | null | null | import sensorflow
import cmd
# example of config: ds18b20 0x28 0xFF 0x10 0x93 0x6F 0x14 0x4 0x11
# example of config: dht 11 14
# 28ff5d216d1404cd
# 28FF608D6F140451
# 28FF10936F140411
# Robohuerto
# dht 11 9
# dht 21 6
# ina219
print("Initializing...")
source = sensorflow.SerialSource()
serializer = sensorflow.JsonSer... | 26.742857 | 145 | 0.530627 | import sensorflow
import cmd
print("Initializing...")
source = sensorflow.SerialSource()
serializer = sensorflow.JsonSerializer()
sf = sensorflow.Sensorflow(source=source, serializer=serializer)
sf.ping()
def ds18b20(params):
return sensorflow.DS18B20Sensor([int(i, 0) for i in params])
def dht(params):
ret... | true | true |
1c35b191a748d9f7c658e46f2120c2f6153782c5 | 1,247 | py | Python | html2md/commands/KeepTag.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | null | null | null | html2md/commands/KeepTag.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | null | null | null | html2md/commands/KeepTag.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | 1 | 2021-11-08T01:53:55.000Z | 2021-11-08T01:53:55.000Z | import re
from html2md.commands.Command import Command
class KeepTag(Command):
"""
Command that keeps the original HTML tag. Any number of parameters can be passed for this Command. If no
parameters are passed, all attributes will be kept. If at least one parameter is passed, then only those
attribut... | 31.175 | 108 | 0.57097 | import re
from html2md.commands.Command import Command
class KeepTag(Command):
SHORT_TAGS = ["img", "br"]
def __init__(self, args):
super().__init__()
self._whitelist = []
for key, value in args.items():
self._whitelist.append(value)
def __copy__(self):
retu... | true | true |
1c35b406fe80a3f1d3c20b084895811eb57aef56 | 1,704 | py | Python | cluster/silhouette.py | thomas-mazumder/project5 | b8f2eda71dcfb550d030a2ee2d9b136005198aca | [
"MIT"
] | null | null | null | cluster/silhouette.py | thomas-mazumder/project5 | b8f2eda71dcfb550d030a2ee2d9b136005198aca | [
"MIT"
] | null | null | null | cluster/silhouette.py | thomas-mazumder/project5 | b8f2eda71dcfb550d030a2ee2d9b136005198aca | [
"MIT"
] | null | null | null | import numpy as np
from scipy.spatial.distance import cdist
class Silhouette:
def __init__(self, metric: str = "euclidean"):
"""
inputs:
metric: str
the name of the distance metric to use
"""
self._metric = metric
def score(self, X: np.ndarra... | 32.150943 | 94 | 0.545188 | import numpy as np
from scipy.spatial.distance import cdist
class Silhouette:
def __init__(self, metric: str = "euclidean"):
self._metric = metric
def score(self, X: np.ndarray, y: np.ndarray) -> np.ndarray:
s = np.zeros(X.shape[0])
distances = cdist(X, X, self._metric)
... | true | true |
1c35b41d2b552f2d8aeffa311e0ce09792ebbbc7 | 1,486 | py | Python | lingobarter/core/app.py | LeightonStreet/LingoBarter | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 7 | 2016-01-22T05:01:52.000Z | 2019-02-07T10:23:12.000Z | lingobarter/core/app.py | LeightonStreet/LeightonStreet | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 6 | 2016-03-26T23:32:47.000Z | 2016-04-01T07:10:42.000Z | lingobarter/core/app.py | LeightonStreet/LeightonStreet | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 1 | 2016-03-26T23:31:00.000Z | 2016-03-26T23:31:00.000Z | from flask import Flask, Blueprint
# noinspection PyProtectedMember
from flask.helpers import _endpoint_from_view_func
from lingobarter.core.config import LingobarterConfig
from lingobarter.utils.aliases import dispatch_aliases
class LingobarterApp(Flask):
"""
Implements customizations on Flask
- Config h... | 34.55814 | 87 | 0.709287 | from flask import Flask, Blueprint
from flask.helpers import _endpoint_from_view_func
from lingobarter.core.config import LingobarterConfig
from lingobarter.utils.aliases import dispatch_aliases
class LingobarterApp(Flask):
config_class = LingobarterConfig
def make_config(self, instance_relative=False):
... | true | true |
1c35b4d5930fa5ad8ea2fa1ce9f5dcc19f8380d7 | 3,523 | py | Python | MARS/test_single_stream.py | zzz2010/Contrib | d351d83da718145cef9f6c98598f7fedc027efe5 | [
"Apache-2.0"
] | 20 | 2020-03-13T13:40:32.000Z | 2022-03-10T07:31:48.000Z | MARS/test_single_stream.py | zzz2010/Contrib | d351d83da718145cef9f6c98598f7fedc027efe5 | [
"Apache-2.0"
] | 34 | 2020-02-20T11:04:58.000Z | 2022-03-12T00:54:26.000Z | MARS/test_single_stream.py | zzz2010/Contrib | d351d83da718145cef9f6c98598f7fedc027efe5 | [
"Apache-2.0"
] | 41 | 2020-02-14T09:34:39.000Z | 2022-03-10T07:31:42.000Z | #coding=utf-8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... | 39.58427 | 150 | 0.644905 |
import getpass
import os
import socket
import numpy as np
from PIL import Image, ImageFilter
import argparse
import time
import sys
import pdb
import math
from utils import *
from dataset.dataset import *
from dataset.preprocess_data import *
from models.model import generate_model
from opts import parse_opts
import... | true | true |
1c35b4de14d7b520bf863c15dc70dc198786a1fb | 1,443 | py | Python | components/forms.py | alexdeathway/Gecom | 2a0fc87887d73d15eba183625dc8a429defe851f | [
"MIT"
] | 7 | 2021-11-15T06:28:05.000Z | 2022-02-22T11:36:00.000Z | components/forms.py | alexdeathway/Gecom | 2a0fc87887d73d15eba183625dc8a429defe851f | [
"MIT"
] | 3 | 2021-11-02T16:10:49.000Z | 2022-02-01T08:30:38.000Z | components/forms.py | alexdeathway/Gecom | 2a0fc87887d73d15eba183625dc8a429defe851f | [
"MIT"
] | null | null | null | from django import forms
from .models import ComponentsModel
from games.models import OrganisationModel
class ComponentCreationForm(forms.ModelForm):
def __init__(self,*args, **kwargs):
request=kwargs.pop("request")
vendor=OrganisationModel.objects.filter(owner=request.user)
... | 29.44898 | 73 | 0.543313 | from django import forms
from .models import ComponentsModel
from games.models import OrganisationModel
class ComponentCreationForm(forms.ModelForm):
def __init__(self,*args, **kwargs):
request=kwargs.pop("request")
vendor=OrganisationModel.objects.filter(owner=request.user)
... | true | true |
1c35b57c2f4cfea93ddbdf6894d8b6e1688954c3 | 2,276 | py | Python | brl_gym/scripts/maze/run.py | gilwoolee/brl_gym | 9c0784e9928f12d2ee0528c79a533202d3afb640 | [
"BSD-3-Clause"
] | 2 | 2020-08-07T05:50:44.000Z | 2022-03-03T08:46:10.000Z | brl_gym/scripts/maze/run.py | gilwoolee/brl_gym | 9c0784e9928f12d2ee0528c79a533202d3afb640 | [
"BSD-3-Clause"
] | null | null | null | brl_gym/scripts/maze/run.py | gilwoolee/brl_gym | 9c0784e9928f12d2ee0528c79a533202d3afb640 | [
"BSD-3-Clause"
] | null | null | null | import os
import glob
#os.system('source ~/venv/brl/bin/activate')
rootdir = "/home/gilwoo/models/maze/"
algos = [x[0] for x in os.walk(rootdir) if "checkpoints" in x[0]]
num_trials = 500
dry_run = False
algo_to_alg = {
# "single_expert_rbpo": ["bppo2_expert", "Maze-entropy-hidden-no-reward-v0"],
# "entropy... | 38.576271 | 263 | 0.612039 | import os
import glob
rootdir = "/home/gilwoo/models/maze/"
algos = [x[0] for x in os.walk(rootdir) if "checkpoints" in x[0]]
num_trials = 500
dry_run = False
algo_to_alg = {
"bpo_noent": ["ppo2","Maze-no-entropy-v0", 0.0],
}
for algo in algos:
algname = algo.split("/")[... | true | true |
1c35b69db59c65edc0e17a2718112c7f160758e4 | 2,810 | py | Python | NewTests/test2LevelReconstruction.py | Yuval-H/iclr_17_compression | f9b04a6cb93e32d17c2f2548614690dee8840d78 | [
"MIT"
] | null | null | null | NewTests/test2LevelReconstruction.py | Yuval-H/iclr_17_compression | f9b04a6cb93e32d17c2f2548614690dee8840d78 | [
"MIT"
] | null | null | null | NewTests/test2LevelReconstruction.py | Yuval-H/iclr_17_compression | f9b04a6cb93e32d17c2f2548614690dee8840d78 | [
"MIT"
] | null | null | null |
import torch.nn.functional as F
import torch
from torchvision import transforms
import matplotlib.pyplot as plt
import os
from PIL import Image, ImageChops
import glob
import numpy as np
from model_new import *
from model import *
device = 'cuda' if torch.cuda.is_available() else 'cpu'
# Load the small images AE mo... | 38.493151 | 129 | 0.753737 |
import torch.nn.functional as F
import torch
from torchvision import transforms
import matplotlib.pyplot as plt
import os
from PIL import Image, ImageChops
import glob
import numpy as np
from model_new import *
from model import *
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model_orig_weights = '/home/a... | true | true |
1c35b6f97058cc0c4330c60686dccc5d255a7f0c | 780 | py | Python | tests/wallet/test_taproot.py | zcomputerwiz/profit-blockchain | d6d4337ea7c418c66f05f22a263e94190452aed6 | [
"Apache-2.0"
] | 7 | 2022-03-15T01:33:35.000Z | 2022-03-26T21:29:45.000Z | tests/wallet/test_taproot.py | zcomputerwiz/profit-blockchain | d6d4337ea7c418c66f05f22a263e94190452aed6 | [
"Apache-2.0"
] | 3 | 2022-03-19T23:02:18.000Z | 2022-03-19T23:02:19.000Z | tests/wallet/test_taproot.py | zcomputerwiz/profit-blockchain | d6d4337ea7c418c66f05f22a263e94190452aed6 | [
"Apache-2.0"
] | null | null | null | from profit.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
DEFAULT_HIDDEN_PUZZLE,
calculate_synthetic_offset,
calculate_synthetic_public_key,
)
from tests.core.make_block_generator import int_to_public_key
class TestTaproot:
def test_1(self):
for main_secret_exponent in range(500... | 37.142857 | 82 | 0.733333 | from profit.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
DEFAULT_HIDDEN_PUZZLE,
calculate_synthetic_offset,
calculate_synthetic_public_key,
)
from tests.core.make_block_generator import int_to_public_key
class TestTaproot:
def test_1(self):
for main_secret_exponent in range(500... | true | true |
1c35b7241c7dbc5dfd5192653c881704f6539a0f | 474 | py | Python | src/identity.py | Neotoxic-off/Obit | a1ecab8e1b49f3c65cdb0ab09d7b366712fb5c86 | [
"BSL-1.0"
] | 1 | 2021-12-31T15:46:45.000Z | 2021-12-31T15:46:45.000Z | src/identity.py | Neotoxic-off/Obit | a1ecab8e1b49f3c65cdb0ab09d7b366712fb5c86 | [
"BSL-1.0"
] | null | null | null | src/identity.py | Neotoxic-off/Obit | a1ecab8e1b49f3c65cdb0ab09d7b366712fb5c86 | [
"BSL-1.0"
] | null | null | null | from src.request import Request
class Identity:
def __init__(self):
self.request = Request()
def get(self, proxies):
result = None
print("[wait] checking identity")
result = self.request.get("https://ident.me", proxies)
if (result.status_code == 200):
print... | 27.882353 | 68 | 0.592827 | from src.request import Request
class Identity:
def __init__(self):
self.request = Request()
def get(self, proxies):
result = None
print("[wait] checking identity")
result = self.request.get("https://ident.me", proxies)
if (result.status_code == 200):
print... | true | true |
1c35b92ff10a96e3a19c0e13cad7b453da696748 | 6,910 | py | Python | recognize-from-microphone.py | ArpanBose11/Music_Recogniser_Omega | 584ca1e77436a54ac2589bb9be839ec392b8b2c2 | [
"MIT"
] | null | null | null | recognize-from-microphone.py | ArpanBose11/Music_Recogniser_Omega | 584ca1e77436a54ac2589bb9be839ec392b8b2c2 | [
"MIT"
] | null | null | null | recognize-from-microphone.py | ArpanBose11/Music_Recogniser_Omega | 584ca1e77436a54ac2589bb9be839ec392b8b2c2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
import sys
from argparse import RawTextHelpFormatter
from itertools import zip_longest as izip_longest
import numpy as np
from termcolor import colored
import libs.fingerprint as fingerprint
from libs.config import get_config
from libs.db_sqlite import SqliteDatabase
from libs.reader... | 28.089431 | 115 | 0.568596 | import argparse
import sys
from argparse import RawTextHelpFormatter
from itertools import zip_longest as izip_longest
import numpy as np
from termcolor import colored
import libs.fingerprint as fingerprint
from libs.config import get_config
from libs.db_sqlite import SqliteDatabase
from libs.reader_microphone import... | true | true |
1c35ba0c374f56cfcfb07200f010c3f7ffe0a64f | 3,736 | py | Python | src/ralph/ui/reports.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/ui/reports.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/ui/reports.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from django.db.models.sql.aggregates import Aggregate
from ralph.discovery.models import HistoryCost, Devic... | 32.206897 | 80 | 0.625 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from django.db.models.sql.aggregates import Aggregate
from ralph.discovery.models import HistoryCost, DeviceType
class SpanSum(Aggregate):
sql_func... | true | true |
1c35bae7b1f6110d35946c875695eb3d2011b0e3 | 4,496 | py | Python | bootcamp/articles/views.py | suhailvs/bootcamp | 23295a99085a843566367b73c134a83eb520c24d | [
"MIT"
] | null | null | null | bootcamp/articles/views.py | suhailvs/bootcamp | 23295a99085a843566367b73c134a83eb520c24d | [
"MIT"
] | null | null | null | bootcamp/articles/views.py | suhailvs/bootcamp | 23295a99085a843566367b73c134a83eb520c24d | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseForbidden, HttpResponseBadRequest, HttpResponse
from bootcamp.articles.models import Article, Tag, ArticleComment
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from bootcamp.articles.forms imp... | 35.68254 | 126 | 0.657028 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseForbidden, HttpResponseBadRequest, HttpResponse
from bootcamp.articles.models import Article, Tag, ArticleComment
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from bootcamp.articles.forms imp... | true | true |
1c35bcf3fe4ea9bab6b8ad290a59a43bd504079a | 11,508 | py | Python | BookReviewsSentimentAnalyzer.py | hoossainalik/goodreads-reviewer | b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27 | [
"MIT"
] | null | null | null | BookReviewsSentimentAnalyzer.py | hoossainalik/goodreads-reviewer | b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27 | [
"MIT"
] | null | null | null | BookReviewsSentimentAnalyzer.py | hoossainalik/goodreads-reviewer | b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27 | [
"MIT"
] | null | null | null | """-------------------------------------------
Package Name: BookReviewsSentimentAnalyzer
Author: Hussain Ali Khan
Version: 1.0.1
Last Modified: 12/02/2018
-------------------------------------------
"""
import sys
from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QMessageBox, QDesktopWidget
fr... | 39.010169 | 120 | 0.539277 |
import sys
from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QMessageBox, QDesktopWidget
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot, QTimer
import goodreads_api_client as gr
from PyQt5 import QtWidgets, QtGui
import requests
from requests import HTTPError
from bs4 import Beau... | true | true |
1c35bdf289ce9f23ba9e64b3a7ab60587588ed9e | 10,238 | py | Python | search/DrNAS/nb201space_progressive.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | 9 | 2021-04-21T08:14:03.000Z | 2021-11-26T11:52:40.000Z | search/DrNAS/nb201space_progressive.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | null | null | null | search/DrNAS/nb201space_progressive.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | 6 | 2021-05-19T02:36:43.000Z | 2021-12-03T07:21:37.000Z | import os
import torch
import torch.nn as nn
import torch.utils
import torch.backends.cudnn as cudnn
import xnas.core.logging as logging
import xnas.core.config as config
import xnas.core.meters as meters
import xnas.search_space.DrNAS.utils as utils
from xnas.core.builders import build_loss_fun, DrNAS_builder
from xn... | 32.814103 | 86 | 0.558312 | import os
import torch
import torch.nn as nn
import torch.utils
import torch.backends.cudnn as cudnn
import xnas.core.logging as logging
import xnas.core.config as config
import xnas.core.meters as meters
import xnas.search_space.DrNAS.utils as utils
from xnas.core.builders import build_loss_fun, DrNAS_builder
from xn... | true | true |
1c35be6009f1f3b90929631d9c03a85e7c351068 | 3,913 | py | Python | netbox/extras/admin.py | Netnod/netbox | 24344ccfafe6a6f6e71099fa2593a4eb8e737d5f | [
"Apache-2.0"
] | 1 | 2022-01-11T10:33:15.000Z | 2022-01-11T10:33:15.000Z | netbox/extras/admin.py | Netnod/netbox | 24344ccfafe6a6f6e71099fa2593a4eb8e737d5f | [
"Apache-2.0"
] | null | null | null | netbox/extras/admin.py | Netnod/netbox | 24344ccfafe6a6f6e71099fa2593a4eb8e737d5f | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib import admin
from netbox.admin import admin_site
from utilities.forms import LaxURLField
from .models import CustomField, CustomFieldChoice, CustomLink, Graph, ExportTemplate, TopologyMap, Webhook
def order_content_types(field):
"""
Order the list of available Con... | 25.083333 | 116 | 0.645029 | from django import forms
from django.contrib import admin
from netbox.admin import admin_site
from utilities.forms import LaxURLField
from .models import CustomField, CustomFieldChoice, CustomLink, Graph, ExportTemplate, TopologyMap, Webhook
def order_content_types(field):
queryset = field.queryset.order_by('app... | true | true |
1c35befc12f70e13e97a2aa569fc76e1372a6279 | 5,252 | py | Python | BluePlug/QtWork.py | liufeng3486/BluePlug | c7c5c769ed35c71ebc542d34848d6bf309abd051 | [
"MIT"
] | 1 | 2019-01-27T04:08:05.000Z | 2019-01-27T04:08:05.000Z | BluePlug/QtWork.py | liufeng3486/BluePlug | c7c5c769ed35c71ebc542d34848d6bf309abd051 | [
"MIT"
] | 5 | 2021-03-18T21:35:20.000Z | 2022-01-13T00:58:18.000Z | BluePlug/QtWork.py | liufeng3486/BluePlug | c7c5c769ed35c71ebc542d34848d6bf309abd051 | [
"MIT"
] | null | null | null | from PyQt5 import QtCore
from BluePlug.Base import *
import BluePlug.Init as Init
import BluePlug.Login as Login
from subprocess import Popen, PIPE, STDOUT
# import Answer,DailyQuest,PetFight,PlotCopy
# import SetInit
import BluePlug.MainQuest as MainQuest
# import CreateRole as CreateRole
import time,shutil
class Wor... | 34.781457 | 132 | 0.56588 | from PyQt5 import QtCore
from BluePlug.Base import *
import BluePlug.Init as Init
import BluePlug.Login as Login
from subprocess import Popen, PIPE, STDOUT
import BluePlug.MainQuest as MainQuest
import time,shutil
class Worker(QtCore.QThread):
sinOut = QtCore.pyqtSignal(str) sinOut2 = QtCore.pyqtSignal(str)
... | true | true |
1c35bf9c42a54b0ce049fb9e066a1d6d5b21b754 | 1,724 | py | Python | Setup/SendMail.py | djtorch26/DSP_FinalProject | 202d51778f79aaaf18573504c51dcc4c85021ac3 | [
"MIT"
] | null | null | null | Setup/SendMail.py | djtorch26/DSP_FinalProject | 202d51778f79aaaf18573504c51dcc4c85021ac3 | [
"MIT"
] | null | null | null | Setup/SendMail.py | djtorch26/DSP_FinalProject | 202d51778f79aaaf18573504c51dcc4c85021ac3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 22 09:29:36 2020
This works with python Version 3 only
@author: Dawson
"""
import os
import smtplib
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
gmail_user = ""
gmail... | 28.262295 | 137 | 0.667053 |
import os
import smtplib
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
gmail_user = ""
gmail_pwd = ""
to = "djtorch123@gmail.com"
def emailFile(file):
attach = file
if "test" in file:
sub... | true | true |
1c35bff77d70074ae8e9d66cad3a8a97caf271d0 | 451 | py | Python | libweasyl/libweasyl/alembic/versions/cbe0ea91af79_remove_non_original_audio_upload_report_.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 1 | 2019-02-15T04:21:48.000Z | 2019-02-15T04:21:48.000Z | libweasyl/libweasyl/alembic/versions/cbe0ea91af79_remove_non_original_audio_upload_report_.py | kfkitsune/wzl-test | 27297ccb42e24d652a29aa82f5a667c7d9a6d8de | [
"Apache-2.0"
] | 254 | 2017-12-23T19:36:43.000Z | 2020-04-14T21:46:13.000Z | libweasyl/libweasyl/alembic/versions/cbe0ea91af79_remove_non_original_audio_upload_report_.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 1 | 2017-12-23T18:42:16.000Z | 2017-12-23T18:42:16.000Z | # encoding: utf-8
"""Remove “Non-original audio upload” report type
Revision ID: cbe0ea91af79
Revises: c8c088918278
Create Date: 2016-08-11 01:21:10.906138
"""
# revision identifiers, used by Alembic.
revision = 'cbe0ea91af79'
down_revision = 'c8c088918278'
from alembic import op
def upgrade():
op.execute('U... | 18.791667 | 82 | 0.745011 |
revision = 'cbe0ea91af79'
down_revision = 'c8c088918278'
from alembic import op
def upgrade():
op.execute('UPDATE reportcomment SET violation = 2020 WHERE violation = 2100')
def downgrade():
raise Exception('Irreversible migration')
| true | true |
1c35bffd725f29b683628d85125e5290faeee3bc | 283 | py | Python | helloworld/demo/management/commands/what_time_is_it.py | mingregister/helloworld | fd3bf75e8567b5be8fc6b89cfb3c874fc1c58276 | [
"Apache-2.0"
] | 13 | 2018-08-25T22:02:24.000Z | 2021-11-13T22:09:44.000Z | helloworld/demo/management/commands/what_time_is_it.py | mingregister/helloworld | fd3bf75e8567b5be8fc6b89cfb3c874fc1c58276 | [
"Apache-2.0"
] | null | null | null | helloworld/demo/management/commands/what_time_is_it.py | mingregister/helloworld | fd3bf75e8567b5be8fc6b89cfb3c874fc1c58276 | [
"Apache-2.0"
] | 7 | 2018-08-27T20:17:02.000Z | 2022-02-28T01:11:38.000Z | from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = 'Displays current time'
def handle(self, *args, **kwargs):
time = timezone.now().strftime('%X')
self.stdout.write("It's now %s" % time)
| 28.3 | 51 | 0.681979 | from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = 'Displays current time'
def handle(self, *args, **kwargs):
time = timezone.now().strftime('%X')
self.stdout.write("It's now %s" % time)
| true | true |
1c35c00d8c1d4ca62b074e558a9ce9247f3099f5 | 3,604 | py | Python | src/site-packages/pyicloud/services/reminders.py | nficano/alexa-find-my-iphone | d4621fd9d891cd820167c0cfdee2dc69cecac3ce | [
"MIT"
] | 9 | 2018-06-10T20:32:10.000Z | 2021-11-21T03:54:41.000Z | pyicloud/services/reminders.py | memkeytm/pyicloud | 46e1253ca5f608035ce862627c69190fc61c5bb2 | [
"MIT"
] | 479 | 2019-07-30T11:47:46.000Z | 2021-08-03T10:43:11.000Z | pyicloud/services/reminders.py | memkeytm/pyicloud | 46e1253ca5f608035ce862627c69190fc61c5bb2 | [
"MIT"
] | 5 | 2018-09-14T18:00:18.000Z | 2020-11-04T07:26:35.000Z | from __future__ import absolute_import
from datetime import datetime, timedelta
import time
import uuid
import json
from tzlocal import get_localzone
class RemindersService(object):
def __init__(self, service_root, session, params):
self.session = session
self.params = params
self._servic... | 32.468468 | 79 | 0.450333 | from __future__ import absolute_import
from datetime import datetime, timedelta
import time
import uuid
import json
from tzlocal import get_localzone
class RemindersService(object):
def __init__(self, service_root, session, params):
self.session = session
self.params = params
self._servic... | true | true |
1c35c01a4e5d4244e1a3f8834e76867cd11b8334 | 771 | py | Python | classification/rebalancing.py | GT-RIPL/UNO-IC | 6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0 | [
"MIT"
] | 24 | 2020-11-11T03:49:50.000Z | 2022-03-21T04:23:32.000Z | classification/rebalancing.py | GT-RIPL/UNO-IC | 6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0 | [
"MIT"
] | 1 | 2021-07-15T02:46:34.000Z | 2021-07-15T02:46:34.000Z | classification/rebalancing.py | GT-RIPL/UNO-IC | 6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0 | [
"MIT"
] | 2 | 2021-02-04T01:28:19.000Z | 2021-02-25T09:20:27.000Z | import torch
def prior_recbalancing(logit,beta,s_prior,t_prior=None):
# logit (b,c,h,w): pre-softmax network output
# beta (1,): user controlled hyperparameter
# s_prior (1,c): source (training) data prior
# t_prior (1,c): target (test) data prior (most likely uniform)
prob = torch.nn.Softmax(dim=1)(logit)
... | 32.125 | 79 | 0.675746 | import torch
def prior_recbalancing(logit,beta,s_prior,t_prior=None):
prob = torch.nn.Softmax(dim=1)(logit)
inv_prior = 1/s_prior
inv_prior[inv_prior == float("inf")] = 0
inv_prior = inv_prior.unsqueeze(0).float()
if t_prior is None:
prob_r = prob*inv_prior
else:
prob_r ... | true | true |
1c35c09ad7a1f0eedac5ed226e72d2ede6b782d1 | 392 | py | Python | blog/migrations/0004_auto_20220105_0959.py | ns377792/Blog-in-django | 7bebbf7ce364f76a609fbe7c2815eacf2c47978e | [
"MIT"
] | null | null | null | blog/migrations/0004_auto_20220105_0959.py | ns377792/Blog-in-django | 7bebbf7ce364f76a609fbe7c2815eacf2c47978e | [
"MIT"
] | null | null | null | blog/migrations/0004_auto_20220105_0959.py | ns377792/Blog-in-django | 7bebbf7ce364f76a609fbe7c2815eacf2c47978e | [
"MIT"
] | 1 | 2022-01-16T09:14:55.000Z | 2022-01-16T09:14:55.000Z | # Generated by Django 2.2.12 on 2022-01-05 04:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20220105_0307'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='description... | 20.631579 | 51 | 0.604592 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20220105_0307'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='description',
field=models.CharField(max_length=... | true | true |
1c35c09ca8a8d96ab8bd36dfc9356abab5e3e5ce | 148 | py | Python | Python/Math/Power - Mod Power/solution.py | oleg-cherednik/hackerrank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 7 | 2020-04-02T16:18:46.000Z | 2021-02-12T14:06:44.000Z | Python/Math/Power - Mod Power/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | null | null | null | Python/Math/Power - Mod Power/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 11 | 2020-05-06T08:28:43.000Z | 2021-12-08T17:25:45.000Z | #!/bin/python3
if __name__ == '__main__':
a = int(input())
b = int(input())
m = int(input())
print(a ** b)
print(pow(a, b, m))
| 16.444444 | 26 | 0.493243 |
if __name__ == '__main__':
a = int(input())
b = int(input())
m = int(input())
print(a ** b)
print(pow(a, b, m))
| true | true |
1c35c11409bf4f95b165e08bfd0e51c3cf1849fd | 885 | py | Python | moto/glacier/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | moto/glacier/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | moto/glacier/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | from .responses import GlacierResponse
url_bases = [r"https?://glacier\.(.+)\.amazonaws.com"]
response = GlacierResponse()
url_paths = {
"{0}/(?P<account_number>.+)/vaults$": response.all_vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>[^/]+)$": response.vault_response,
"{0}/(?P<account... | 55.3125 | 132 | 0.674576 | from .responses import GlacierResponse
url_bases = [r"https?://glacier\.(.+)\.amazonaws.com"]
response = GlacierResponse()
url_paths = {
"{0}/(?P<account_number>.+)/vaults$": response.all_vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>[^/]+)$": response.vault_response,
"{0}/(?P<account... | true | true |
1c35c203c21c962485e649012e8eb15906f2f4ce | 2,157 | py | Python | contrib/examples/sensors/sample_polling_sensor.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2020-11-21T10:11:25.000Z | 2020-11-21T10:11:25.000Z | contrib/examples/sensors/sample_polling_sensor.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2015-06-08T15:27:11.000Z | 2015-06-08T15:27:11.000Z | contrib/examples/sensors/sample_polling_sensor.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | from st2reactor.sensor.base import PollingSensor
class SimplePollingSensor(PollingSensor):
"""
* self._sensor_service
- provides utilities like
get_logger() for writing to logs.
dispatch() for dispatching triggers into the system.
* self._config
- contains configura... | 38.517857 | 95 | 0.635605 | from st2reactor.sensor.base import PollingSensor
class SimplePollingSensor(PollingSensor):
def setup(self):
pass
def poll(self):
# health information about your instances:
# some_data = aws_client.get('')
# payload = self._to_payloa... | true | true |
1c35c2188225f1996dd0aacc01f3551ffbf9e18b | 20,878 | py | Python | tests/cli/test_init_sqlite.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | 1 | 2020-04-10T18:07:58.000Z | 2020-04-10T18:07:58.000Z | tests/cli/test_init_sqlite.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | null | null | null | tests/cli/test_init_sqlite.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | null | null | null | import os
import re
import shutil
import pytest
from click.testing import CliRunner
from sqlalchemy import create_engine
from great_expectations import DataContext
from great_expectations.cli import cli
from great_expectations.data_context.util import file_relative_path
from great_expectations.util import gen_directo... | 36.183709 | 101 | 0.670562 | import os
import re
import shutil
import pytest
from click.testing import CliRunner
from sqlalchemy import create_engine
from great_expectations import DataContext
from great_expectations.cli import cli
from great_expectations.data_context.util import file_relative_path
from great_expectations.util import gen_directo... | true | true |
1c35c23d2f75b4199e2713d59f34db2e7f69c57a | 3,951 | py | Python | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/CERT.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/CERT.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/CERT.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | 32.385246 | 78 | 0.643888 |
import struct
import base64
import dns.exception
import dns.dnssec
import dns.rdata
import dns.tokenizer
_ctype_by_value = {
1: 'PKIX',
2: 'SPKI',
3: 'PGP',
253: 'URI',
254: 'OID',
}
_ctype_by_name = {
'PKIX': 1,
'SPKI': 2,
'PGP': 3,
'URI': 253,
'OID': 254,
}
def _ctype_fro... | true | true |
1c35c2e143571df334c4f6293a81344f48ae102a | 632 | py | Python | tests/test_pytest_mypy.py | bochecha/pytest-mypy | c163fc321514c493bf6ea6c0dcf4459f0727d268 | [
"MIT"
] | null | null | null | tests/test_pytest_mypy.py | bochecha/pytest-mypy | c163fc321514c493bf6ea6c0dcf4459f0727d268 | [
"MIT"
] | null | null | null | tests/test_pytest_mypy.py | bochecha/pytest-mypy | c163fc321514c493bf6ea6c0dcf4459f0727d268 | [
"MIT"
] | null | null | null | def test_mypy_success(testdir):
testdir.makepyfile('''
def myfunc(x: int) -> int:
return x * 2
def test_myfunc():
assert myfunc(12)
''')
result = testdir.runpytest('--mypy', '-v')
assert result.ret == 0
def test_mypy_error(testdir):
testdir.makepyfile('''... | 21.066667 | 66 | 0.549051 | def test_mypy_success(testdir):
testdir.makepyfile('''
def myfunc(x: int) -> int:
return x * 2
def test_myfunc():
assert myfunc(12)
''')
result = testdir.runpytest('--mypy', '-v')
assert result.ret == 0
def test_mypy_error(testdir):
testdir.makepyfile('''... | true | true |
1c35c2e919e86cb1344d8a697147b9570d07f8c5 | 2,170 | py | Python | clients/bbg/blpapi-python/examples/unittests/market-data-notifier/src/token_generator.py | vegabook/dstreams | 9a2919b36ba2901522a61737a593fea28a655777 | [
"MIT"
] | 228 | 2017-06-20T16:14:06.000Z | 2022-03-30T02:04:47.000Z | clients/bbg/blpapi-python/examples/unittests/market-data-notifier/src/token_generator.py | vegabook/dstreams | 9a2919b36ba2901522a61737a593fea28a655777 | [
"MIT"
] | 3 | 2017-05-04T02:48:36.000Z | 2018-02-01T13:59:46.000Z | clients/bbg/blpapi-python/examples/unittests/market-data-notifier/src/token_generator.py | vegabook/dstreams | 9a2919b36ba2901522a61737a593fea28a655777 | [
"MIT"
] | 84 | 2017-11-21T14:56:20.000Z | 2022-03-31T15:22:22.000Z | """Sample token generator for testing."""
import blpapi
TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess")
TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure")
TOKEN = blpapi.Name("token")
# pylint: disable=too-few-public-methods
class TokenGenerator():
"""Generates a token for later authorization."""
d... | 38.75 | 76 | 0.710599 |
import blpapi
TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess")
TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure")
TOKEN = blpapi.Name("token")
class TokenGenerator():
def __init__(self, session):
self._session = session
def generate(self, event_queue=None):
token = None
if ... | true | true |
1c35c3189d23f65367d999d8662a458f07d02cbc | 755 | py | Python | tools/svg_to_pgn.py | Leviathan321/ChessDiagramRecognition | c46effa3a9d49ae29fa55e82733e7fc7ba41c043 | [
"MIT"
] | 6 | 2020-07-27T19:10:30.000Z | 2021-08-17T02:23:53.000Z | tools/svg_to_pgn.py | Leviathan321/ChessDiagramRecognition | c46effa3a9d49ae29fa55e82733e7fc7ba41c043 | [
"MIT"
] | 10 | 2020-06-17T15:19:26.000Z | 2021-01-01T23:13:01.000Z | tools/svg_to_pgn.py | Leviathan321/ChessDiagramRecognition | c46effa3a9d49ae29fa55e82733e7fc7ba41c043 | [
"MIT"
] | 7 | 2020-08-10T05:13:57.000Z | 2022-01-13T09:26:21.000Z | ################################################################################
# Convert a svg image to pgn format
################################################################################
import cairosvg
################################################################################
########################... | 32.826087 | 80 | 0.239735 | import cairosvg
def main():
print("Insert input file path:")
input_url: str = input()
print("Insert output file path:")
output_url: str = input()
cairosvg.svg2png(url=input_url, write_to=output_url)
main()
| true | true |
1c35c32dbe3e3aec380a3b6a46b5f030037d23e1 | 4,888 | py | Python | 1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py | alvarochiqui/edem | d28861b04d9053848e26c24056395e5381ed398e | [
"Apache-2.0"
] | null | null | null | 1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py | alvarochiqui/edem | d28861b04d9053848e26c24056395e5381ed398e | [
"Apache-2.0"
] | null | null | null | 1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py | alvarochiqui/edem | d28861b04d9053848e26c24056395e5381ed398e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 16 18:17:34 2021
@author: alvar
"""
#Importamos todas las librerias necesarias para el proyecto
import os #sistema operativo
import pandas as pd #gestionar datframes
import numpy as np #numeric python vectores
im... | 30.17284 | 96 | 0.740385 |
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt
os.chdir(r'C:\Users\alvar\Desktop\EDEM\2. GITHUB\edem\Estadistica Python\my project')
heart = pd.read_csv ('heart.csv', sep=',')
os.getcwd()
print(heart)
print(heart.head(... | true | true |
1c35c41f5fdc2320979c9ed9aff80941d45c4c7b | 2,986 | py | Python | credentials_test.py | chiriket/Password-Locker | da40d20b886fcef01cc053a0c46a8caf91111877 | [
"MIT"
] | null | null | null | credentials_test.py | chiriket/Password-Locker | da40d20b886fcef01cc053a0c46a8caf91111877 | [
"MIT"
] | null | null | null | credentials_test.py | chiriket/Password-Locker | da40d20b886fcef01cc053a0c46a8caf91111877 | [
"MIT"
] | null | null | null | import unittest # Importing the unittest module
from credentials import Credentials # Importing the credentials class
class TestCredentials(unittest.TestCase):
'''
Test class that defines test cases for the credential class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creatin... | 35.129412 | 100 | 0.659745 | import unittest from credentials import Credentials
class TestCredentials(unittest.TestCase):
def tearDown(self):
Credentials.credential_list = []
def setUp(self):
self.new_credentials = Credentials("Twitter","Chiri","pass123")
def test_init(self):
self.assertEqual(self... | true | true |
1c35c44907649702b009572b98943488db90e845 | 941 | py | Python | src/webservice/frame.py | AzemaBaptiste/SoundLandscape | a9a27606301dd3c9000474960668ea11bada1452 | [
"BSD-3-Clause"
] | 1 | 2019-05-13T22:05:06.000Z | 2019-05-13T22:05:06.000Z | src/webservice/frame.py | AzemaBaptiste/SoundLandscape | a9a27606301dd3c9000474960668ea11bada1452 | [
"BSD-3-Clause"
] | null | null | null | src/webservice/frame.py | AzemaBaptiste/SoundLandscape | a9a27606301dd3c9000474960668ea11bada1452 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import cv2
from flask import Blueprint
from src.data.webcam_images import VideoCamera
CAMERA_APP = Blueprint('camera_app', __name__)
@CAMERA_APP.route("/api/frame/get_camera_face", methods=["POST", "GET"])
def get_camera_face():
"""Get img from face.
:return: (str) f... | 22.404762 | 73 | 0.686504 | import base64
import cv2
from flask import Blueprint
from src.data.webcam_images import VideoCamera
CAMERA_APP = Blueprint('camera_app', __name__)
@CAMERA_APP.route("/api/frame/get_camera_face", methods=["POST", "GET"])
def get_camera_face():
CAMERA_FACE = VideoCamera(0)
frame = CAMERA_FACE.get_frame()
... | true | true |
1c35c513fb04c17f37bc0f40cdba4ccee9ab1721 | 1,042 | py | Python | setup.py | nuhamozaini/deepvec | a4019b685559d7aafce58d9e0b7afd0bb7d872d9 | [
"MIT"
] | 1 | 2019-04-04T08:53:21.000Z | 2019-04-04T08:53:21.000Z | setup.py | nuhamozaini/deepvec | a4019b685559d7aafce58d9e0b7afd0bb7d872d9 | [
"MIT"
] | null | null | null | setup.py | nuhamozaini/deepvec | a4019b685559d7aafce58d9e0b7afd0bb7d872d9 | [
"MIT"
] | null | null | null | from distutils.core import setup
from io import open
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name='deepvec',
packages=['deepvec'],
version='0.2',
license='MIT',
description='Tensorflow wrapper for classification',
long_description=long_description,
autho... | 32.5625 | 110 | 0.639155 | from distutils.core import setup
from io import open
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name='deepvec',
packages=['deepvec'],
version='0.2',
license='MIT',
description='Tensorflow wrapper for classification',
long_description=long_description,
autho... | true | true |
1c35c69d29f37b4c8fa1d900d63f1ab1b4805776 | 7,623 | py | Python | pl_examples/basic_examples/conv_sequential_example.py | skmatz/pytorch-lightning | fc6d4027334b8869f02a3bdca0a0846f1cf79928 | [
"Apache-2.0"
] | null | null | null | pl_examples/basic_examples/conv_sequential_example.py | skmatz/pytorch-lightning | fc6d4027334b8869f02a3bdca0a0846f1cf79928 | [
"Apache-2.0"
] | null | null | null | pl_examples/basic_examples/conv_sequential_example.py | skmatz/pytorch-lightning | fc6d4027334b8869f02a3bdca0a0846f1cf79928 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.581498 | 120 | 0.642398 | import math
from argparse import ArgumentParser
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import pytorch_lightning as pl
from pl_examples import cli_lightning_logo
from pytorch_lightning import Trainer
from pytorch_lightning.metrics.functional import accuracy
from pytorch_l... | true | true |
1c35c80dc11669568aa1e14f01fb8d018a0141ec | 10,831 | py | Python | Code/all-starter-code/linkedlist.py | Prones94/CS-1.3-Core-Data-Structures | 35c6b859dcde741cab0d2596ccf96a137dc3065a | [
"MIT"
] | null | null | null | Code/all-starter-code/linkedlist.py | Prones94/CS-1.3-Core-Data-Structures | 35c6b859dcde741cab0d2596ccf96a137dc3065a | [
"MIT"
] | null | null | null | Code/all-starter-code/linkedlist.py | Prones94/CS-1.3-Core-Data-Structures | 35c6b859dcde741cab0d2596ccf96a137dc3065a | [
"MIT"
] | null | null | null | #!python
class Node(object):
def __init__(self, data):
"""Initialize this node with the given data."""
self.data = data
self.next = None
def __repr__(self):
"""Return a string representation of this node."""
return 'Node({!r})'.format(self.data)
class LinkedList(obje... | 40.114815 | 79 | 0.575939 |
class Node(object):
def __init__(self, data):
self.data = data
self.next = None
def __repr__(self):
return 'Node({!r})'.format(self.data)
class LinkedList(object):
def __init__(self, iterable=None):
self.head = None self.tail = None self.size = 0 ... | true | true |
1c35c9661ac08bed450194c2318fc510b368dd9d | 71 | py | Python | atcoder/corp/ddcc2016_qa.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/corp/ddcc2016_qa.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/corp/ddcc2016_qa.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | A, B, C = map(int, input().split())
print('{:.20f}'.format(C * B / A))
| 23.666667 | 35 | 0.507042 | A, B, C = map(int, input().split())
print('{:.20f}'.format(C * B / A))
| true | true |
1c35c9e083095ca9cfbcb56a938324a7ae79c11b | 6,685 | py | Python | starterbot/lib/python2.7/site-packages/slackclient/_server.py | dshaps10/StarterBot | 95c2ad467ecd76650fc1b59daf5b894800d6f0e3 | [
"MIT"
] | null | null | null | starterbot/lib/python2.7/site-packages/slackclient/_server.py | dshaps10/StarterBot | 95c2ad467ecd76650fc1b59daf5b894800d6f0e3 | [
"MIT"
] | null | null | null | starterbot/lib/python2.7/site-packages/slackclient/_server.py | dshaps10/StarterBot | 95c2ad467ecd76650fc1b59daf5b894800d6f0e3 | [
"MIT"
] | null | null | null | from slackclient._slackrequest import SlackRequest
from slackclient._channel import Channel
from slackclient._user import User
from slackclient._util import SearchList
from ssl import SSLError
from websocket import create_connection
import json
class Server(object):
'''
The Server object owns the websocket c... | 31.384977 | 100 | 0.566492 | from slackclient._slackrequest import SlackRequest
from slackclient._channel import Channel
from slackclient._user import User
from slackclient._util import SearchList
from ssl import SSLError
from websocket import create_connection
import json
class Server(object):
def __init__(self, token, connect=True):
... | true | true |
1c35ca73c09d506e9d55236a5bc09733d95fafa5 | 2,793 | py | Python | QUANTAXIS/QAFetch/base.py | kingore/QUANTAXIS | ead08c4ccd4db6467d3a9a2533cef2fb6b6c95ad | [
"MIT"
] | 1 | 2018-02-21T05:00:57.000Z | 2018-02-21T05:00:57.000Z | QUANTAXIS/QAFetch/base.py | ariesii/QUANTAXIS | a09d8784619e39ae74e13689011b08cdcc8431c4 | [
"MIT"
] | null | null | null | QUANTAXIS/QAFetch/base.py | ariesii/QUANTAXIS | a09d8784619e39ae74e13689011b08cdcc8431c4 | [
"MIT"
] | 1 | 2018-03-24T16:05:04.000Z | 2018-03-24T16:05:04.000Z | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... | 40.478261 | 138 | 0.634085 |
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Upgrade-Insecure-Reque... | true | true |
1c35cd9adb0c85b88590392345e600e9bf237706 | 9,577 | py | Python | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | """
Super-resolution of CelebA using Generative Adversarial Networks.
The dataset can be downloaded from: https://www.dropbox.com/sh/8oqt9vytwxb3s4r/AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=0
(if not available there see if options are listed at http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)
Instrustion ... | 39.904167 | 173 | 0.677874 | import argparse
import os
import numpy as np
import math
import itertools
import sys
import torchvision.transforms as transforms
from torchvision.utils import save_image, make_grid
from torch.utils.data import DataLoader
from torch.autograd import Variable
from models import *
from datasets import *
import torch.nn... | true | true |
1c35cf2bc06adac2edb14614591c9dbe864c2054 | 1,447 | py | Python | luwu/utils/file_util.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 19 | 2021-01-30T03:04:31.000Z | 2022-01-09T10:33:12.000Z | luwu/utils/file_util.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 4 | 2021-04-15T02:10:53.000Z | 2021-06-24T12:17:29.000Z | luwu/utils/file_util.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 5 | 2021-03-02T07:29:12.000Z | 2022-01-09T10:32:49.000Z | # -*- coding: utf-8 -*-
# @Author : AaronJny
# @LastEditTime : 2021-03-15
# @FilePath : /LuWu/luwu/utils/file_util.py
# @Desc :
import os
import time
from uuid import uuid1
from glob import glob
from luwu.utils import cmd_util
from loguru import logger
def abspath(filepath):
if filepath:
... | 24.525424 | 75 | 0.630961 | import os
import time
from uuid import uuid1
from glob import glob
from luwu.utils import cmd_util
from loguru import logger
def abspath(filepath):
if filepath:
return os.path.abspath(os.path.expanduser(filepath))
else:
return ""
LUWU_TMP_DIR_ROOT = abspath("~/.luwu/tmp")
def mkdirs(dirpat... | true | true |
1c35d02c76912387c8c0d48ec77217aeb67083f6 | 1,469 | py | Python | server/routes/routes_home.py | prsolucoes/firedash | 31e4364088200a63bed5754c527061554c139a27 | [
"MIT"
] | 2 | 2019-10-04T21:52:40.000Z | 2019-11-05T20:11:04.000Z | server/routes/routes_home.py | prsolucoes/firedash | 31e4364088200a63bed5754c527061554c139a27 | [
"MIT"
] | 2 | 2021-05-08T00:40:24.000Z | 2021-05-08T00:40:42.000Z | server/routes/routes_home.py | paulo-coutinho/firedash | 31e4364088200a63bed5754c527061554c139a27 | [
"MIT"
] | 2 | 2019-09-16T15:45:25.000Z | 2019-10-04T21:52:44.000Z | import os
from flask import render_template, Blueprint, send_from_directory, current_app
from config.data import config_data
routes_home = Blueprint("home", __name__)
@routes_home.route("/", defaults={"path": ""})
@routes_home.route("/<path:path>")
def action_catch_all(path):
if config_data["web_cli_enabled"]:... | 28.25 | 140 | 0.641253 | import os
from flask import render_template, Blueprint, send_from_directory, current_app
from config.data import config_data
routes_home = Blueprint("home", __name__)
@routes_home.route("/", defaults={"path": ""})
@routes_home.route("/<path:path>")
def action_catch_all(path):
if config_data["web_cli_enabled"]:... | true | true |
1c35d050815b9cdf658203a170875c7e4d0749ff | 3,308 | py | Python | Athos/tests/tf/unittests/test_non_linear.py | mpc-msri-dev/EzPC | a489c49d5c92f51df0277a7e5751e1b8baeb0bc1 | [
"MIT"
] | null | null | null | Athos/tests/tf/unittests/test_non_linear.py | mpc-msri-dev/EzPC | a489c49d5c92f51df0277a7e5751e1b8baeb0bc1 | [
"MIT"
] | null | null | null | Athos/tests/tf/unittests/test_non_linear.py | mpc-msri-dev/EzPC | a489c49d5c92f51df0277a7e5751e1b8baeb0bc1 | [
"MIT"
] | null | null | null | '''
Authors: Pratik Bhatu.
Copyright:
Copyright (c) 2021 Microsoft Research
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... | 40.341463 | 87 | 0.726723 | import tensorflow as tf
import numpy as np
import pytest
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
from tests.utils import Config, Compiler, assert_almost_equal
@pytest.mark.skip(reason="[non-linear] Haven't made non-linear functionalities public")
@pytest.mark... | true | true |
1c35d0a3ab1bdafc146123180f084381439c529a | 1,784 | py | Python | rcc8_table.py | CaFaSa/ternary-projective-relations | 66e6a9b3792e950cf53d848c5a86170bc810fef4 | [
"MIT"
] | null | null | null | rcc8_table.py | CaFaSa/ternary-projective-relations | 66e6a9b3792e950cf53d848c5a86170bc810fef4 | [
"MIT"
] | 9 | 2018-09-18T11:04:05.000Z | 2019-01-23T15:19:19.000Z | rcc8_table.py | CaFaSa/ternary-projective-relations | 66e6a9b3792e950cf53d848c5a86170bc810fef4 | [
"MIT"
] | null | null | null | from collections import defaultdict
#T composition table
T=defaultdict(dict)
U={'DC','EC','EQ','TPP','NTPP','TPPi','NTPPi','PO'}
O={'EQ','TPP','NTPP','TPPi','NTTPi','PO'}
T['DC']={'DC':U, 'EC':{'DC','EC','PO','TPP','NTPP'},'PO':{'DC','EC','PO','TPP','NTPP'},'TPP':{'DC','EC','PO','TPP','NTPP'},'NTPP':{'DC','EC','PO'... | 74.333333 | 201 | 0.471973 | from collections import defaultdict
T=defaultdict(dict)
U={'DC','EC','EQ','TPP','NTPP','TPPi','NTPPi','PO'}
O={'EQ','TPP','NTPP','TPPi','NTTPi','PO'}
T['DC']={'DC':U, 'EC':{'DC','EC','PO','TPP','NTPP'},'PO':{'DC','EC','PO','TPP','NTPP'},'TPP':{'DC','EC','PO','TPP','NTPP'},'NTPP':{'DC','EC','PO','TPP','NTPP'},'TPPi'... | true | true |
1c35d0dd4fb4025d909ea5c166f05978e111964a | 265 | py | Python | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_32_None_LinearTrend_12__0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_32_None_LinearTrend_12__0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_32_None_LinearTrend_12__0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0); | 37.857143 | 160 | 0.728302 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0); | true | true |
1c35d117446b110efee6159784d102f5fd4ad147 | 343 | py | Python | aula4_pt1/views.py | ulisses9si/curso-flask | 2bde146f39d4eea78b98a8189ce76afd622ea54a | [
"Unlicense"
] | null | null | null | aula4_pt1/views.py | ulisses9si/curso-flask | 2bde146f39d4eea78b98a8189ce76afd622ea54a | [
"Unlicense"
] | null | null | null | aula4_pt1/views.py | ulisses9si/curso-flask | 2bde146f39d4eea78b98a8189ce76afd622ea54a | [
"Unlicense"
] | null | null | null | """Extensão Flask"""
from flask import Flask, request
def init_app(app: Flask):
"""Inicialização de extensões"""
@app.route("/")
def index():
print(request.args)
return "Esta rodando aguarde"
@app.route("/contato")
def contato():
return "<form><input type='t... | 21.4375 | 58 | 0.571429 | from flask import Flask, request
def init_app(app: Flask):
@app.route("/")
def index():
print(request.args)
return "Esta rodando aguarde"
@app.route("/contato")
def contato():
return "<form><input type='text'></input></form>"
| true | true |
1c35d1223d4b40e592b04a994e6978a0965730e4 | 2,794 | py | Python | guardianbot/interactions.py | shiftinv/GuardianBot | 2c5faef7ba4bf35e9f7fc814dd88f432f0af89da | [
"Apache-2.0"
] | 2 | 2021-11-21T12:30:44.000Z | 2021-11-22T13:39:27.000Z | guardianbot/interactions.py | shiftinv/GuardianBot | 2c5faef7ba4bf35e9f7fc814dd88f432f0af89da | [
"Apache-2.0"
] | null | null | null | guardianbot/interactions.py | shiftinv/GuardianBot | 2c5faef7ba4bf35e9f7fc814dd88f432f0af89da | [
"Apache-2.0"
] | null | null | null | from disnake.ext import commands
from typing import Callable, Dict, List, Optional, TypeVar, Union
from . import multicmd, types, utils
from .config import Config
class CustomSyncBot(commands.Bot):
async def _sync_application_command_permissions(self) -> None:
for command in self.application_commands:
... | 36.763158 | 126 | 0.653901 | from disnake.ext import commands
from typing import Callable, Dict, List, Optional, TypeVar, Union
from . import multicmd, types, utils
from .config import Config
class CustomSyncBot(commands.Bot):
async def _sync_application_command_permissions(self) -> None:
for command in self.application_commands:
... | true | true |
1c35d173246b53fefd76fea0ee73619eb3487e35 | 1,515 | py | Python | game/core/tools/roomSuport.py | Galtvam/projeto-de-redes | 351f84074ea8739de52f280e5f52f7d1da6af728 | [
"MIT"
] | 2 | 2019-05-30T23:14:52.000Z | 2021-03-31T04:43:55.000Z | game/core/tools/roomSuport.py | Galtvam/projeto-de-redes | 351f84074ea8739de52f280e5f52f7d1da6af728 | [
"MIT"
] | 1 | 2019-07-01T18:08:11.000Z | 2019-07-01T18:08:11.000Z | game/core/tools/roomSuport.py | Galtvam/projeto-de-redes | 351f84074ea8739de52f280e5f52f7d1da6af728 | [
"MIT"
] | null | null | null | #coding: utf-8
def extractListOfRooms(peersList):
rooms = {}
for peer in peersList:
if peer[2] and (peer[3] != None):
rooms[peer[3]] = peer
return rooms
def extractPlayersInRoom(roomID, peersList):
players = []
for peer in peersList:
if peer[2] and (peer[3] == roomID):
... | 24.047619 | 49 | 0.532673 |
def extractListOfRooms(peersList):
rooms = {}
for peer in peersList:
if peer[2] and (peer[3] != None):
rooms[peer[3]] = peer
return rooms
def extractPlayersInRoom(roomID, peersList):
players = []
for peer in peersList:
if peer[2] and (peer[3] == roomID):
nic... | true | true |
1c35d1b4130224fc95c6a593379fa7b96eb1a7ee | 8,013 | py | Python | pypegasus/base/ttypes.py | XiaoMi/pegasus-python-client | 877ed3bdc193d44d10dbe9b89b4f1acf3f681587 | [
"Apache-2.0"
] | 8 | 2018-07-19T09:33:44.000Z | 2022-03-27T15:59:53.000Z | pypegasus/base/ttypes.py | XiaoMi/pegasus-python-client | 877ed3bdc193d44d10dbe9b89b4f1acf3f681587 | [
"Apache-2.0"
] | 8 | 2018-03-02T08:11:10.000Z | 2022-02-11T03:38:33.000Z | pypegasus/base/ttypes.py | XiaoMi/pegasus-python-client | 877ed3bdc193d44d10dbe9b89b4f1acf3f681587 | [
"Apache-2.0"
] | 8 | 2018-02-27T07:38:28.000Z | 2021-03-25T02:53:19.000Z | #
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from aenum import Enum
import socket
import struct
from thrift.Thrift import TType
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
fro... | 24.135542 | 188 | 0.669911 |
from aenum import Enum
import socket
import struct
from thrift.Thrift import TType
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class blob:
thrift_spec = (
)
def read(self, iprot):
self.data... | true | true |
1c35d2067aef56bee8c2fb53ec03f7259ed5bb43 | 22,085 | py | Python | flightrl/stable-baselines3/stable_baselines3/common/logger.py | arsimone/flightmare | c546d9d54970c7ad803f3ada4c2ea64c51ab7287 | [
"MIT"
] | null | null | null | flightrl/stable-baselines3/stable_baselines3/common/logger.py | arsimone/flightmare | c546d9d54970c7ad803f3ada4c2ea64c51ab7287 | [
"MIT"
] | null | null | null | flightrl/stable-baselines3/stable_baselines3/common/logger.py | arsimone/flightmare | c546d9d54970c7ad803f3ada4c2ea64c51ab7287 | [
"MIT"
] | null | null | null | import datetime
import json
import os
import sys
import tempfile
import warnings
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, TextIO, Tuple, Union
import numpy as np
import pandas
import torch as th
try:
from torch.utils.tensorboard import SummaryWriter
except Import... | 31.237624 | 125 | 0.591578 | import datetime
import json
import os
import sys
import tempfile
import warnings
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, TextIO, Tuple, Union
import numpy as np
import pandas
import torch as th
try:
from torch.utils.tensorboard import SummaryWriter
except Import... | true | true |
1c35d30f441730bd6bc9b240eade1dd952b106d9 | 594 | py | Python | examples/rockblock_send_text.py | OperatorFoundation/Adafruit_CircuitPython_RockBlock | d98b530faba55e71a1872ddaaab0ae507e86362c | [
"MIT"
] | null | null | null | examples/rockblock_send_text.py | OperatorFoundation/Adafruit_CircuitPython_RockBlock | d98b530faba55e71a1872ddaaab0ae507e86362c | [
"MIT"
] | null | null | null | examples/rockblock_send_text.py | OperatorFoundation/Adafruit_CircuitPython_RockBlock | d98b530faba55e71a1872ddaaab0ae507e86362c | [
"MIT"
] | null | null | null | # pylint: disable=wrong-import-position
import time
# CircuitPython / Blinka
import board
uart = board.UART()
uart.baudrate = 19200
# via USB cable
# import serial
# uart = serial.Serial("/dev/ttyUSB0", 19200)
from adafruit_rockblock import RockBlock
rb = RockBlock(uart)
# set the text
rb.text_out = "hello world"... | 18 | 45 | 0.710438 | import time
import board
uart = board.UART()
uart.baudrate = 19200
from adafruit_rockblock import RockBlock
rb = RockBlock(uart)
rb.text_out = "hello world"
print("Talking to satellite...")
status = rb.satellite_transfer()
retry = 0
while status[0] > 8:
time.sleep(10)
status = rb.satellite_transfer()
... | true | true |
1c35d361c6c540bfb4a02dbd495449ea98ed33fb | 1,041 | py | Python | audio.py | Anti-Counter021/Discord-Audio-bot | 1e10b8f2ffb12304269e9ca2dd40da5ea282adf6 | [
"MIT"
] | null | null | null | audio.py | Anti-Counter021/Discord-Audio-bot | 1e10b8f2ffb12304269e9ca2dd40da5ea282adf6 | [
"MIT"
] | null | null | null | audio.py | Anti-Counter021/Discord-Audio-bot | 1e10b8f2ffb12304269e9ca2dd40da5ea282adf6 | [
"MIT"
] | null | null | null | import asyncio
import discord
import youtube_dl.utils
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'restrictfilenames': True,
'noplaylist': True,
'nocheckcertificate': True,
'ignoreerrors': False,
'logtostderr': False,
'quiet': True... | 26.025 | 104 | 0.642651 | import asyncio
import discord
import youtube_dl.utils
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'restrictfilenames': True,
'noplaylist': True,
'nocheckcertificate': True,
'ignoreerrors': False,
'logtostderr': False,
'quiet': True... | true | true |
1c35d45a02f04139580da7a76ff13868f9a6fc6e | 9,795 | py | Python | captcha.py | Zhas1ke/Captcha_Generator | 72be27f298b8475643f037082b06b453a2dc9b78 | [
"MIT"
] | null | null | null | captcha.py | Zhas1ke/Captcha_Generator | 72be27f298b8475643f037082b06b453a2dc9b78 | [
"MIT"
] | null | null | null | captcha.py | Zhas1ke/Captcha_Generator | 72be27f298b8475643f037082b06b453a2dc9b78 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import string
import math
import os
import uuid
import random
##############################################
grad_img = cv2.imread('grad.png')
def sp_noise(image,prob):
'''
Add salt and pepper noise to image
prob: Probability of the noise
'''
output = np.zeros(image.sh... | 33.775862 | 119 | 0.528229 | import numpy as np
import cv2
import string
import math
import os
import uuid
import random
grad_img = cv2.imread('grad.png')
def sp_noise(image,prob):
output = np.zeros(image.shape,np.uint8)
thres = 1 - prob
for i in range(image.shape[0]):
for j in range(image.shape[1]):
rdn = random.... | true | true |
1c35d4ca457d208328b483d9b22e632210ef3f26 | 3,896 | py | Python | aws_lambda/lambda_function.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 11 | 2019-10-30T08:14:49.000Z | 2021-09-28T07:46:58.000Z | aws_lambda/lambda_function.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 15 | 2019-09-09T07:31:41.000Z | 2022-03-11T23:54:18.000Z | aws_lambda/lambda_function.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 2 | 2019-10-31T21:10:27.000Z | 2022-02-14T19:39:57.000Z | import io
import re
from os import listdir, getenv
import json
import base64
import numpy as np
import cv2
from PIL import Image
from matchvec import predict_class, predict_objects, predict_anonym
from urllib.request import urlopen
from requests_toolbelt.multipart import decoder
pattern = re.compile('(?<=form-data; na... | 36.754717 | 95 | 0.497177 | import io
import re
from os import listdir, getenv
import json
import base64
import numpy as np
import cv2
from PIL import Image
from matchvec import predict_class, predict_objects, predict_anonym
from urllib.request import urlopen
from requests_toolbelt.multipart import decoder
pattern = re.compile('(?<=form-data; na... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.