hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79091bcfd56bdba1a5823f454f617da8931533a4 | 204 | py | Python | trixi/logger/file/__init__.py | comeonfox/trixi | e25545104a2e17b1673f4990df5183d610259208 | [
"MIT"
] | 1 | 2018-11-30T21:53:36.000Z | 2018-11-30T21:53:36.000Z | trixi/logger/file/__init__.py | comeonfox/trixi | e25545104a2e17b1673f4990df5183d610259208 | [
"MIT"
] | null | null | null | trixi/logger/file/__init__.py | comeonfox/trixi | e25545104a2e17b1673f4990df5183d610259208 | [
"MIT"
] | null | null | null | from trixi.logger.file.numpyplotfilelogger import NumpyPlotFileLogger
from trixi.logger.file.pytorchplotfilelogger import PytorchPlotFileLogger
from trixi.logger.file.textfilelogger import TextFileLogger
| 51 | 73 | 0.897059 | from trixi.logger.file.numpyplotfilelogger import NumpyPlotFileLogger
from trixi.logger.file.pytorchplotfilelogger import PytorchPlotFileLogger
from trixi.logger.file.textfilelogger import TextFileLogger
| true | true |
79091c4835b89bd60b100b699a288e8a4e535277 | 8,043 | py | Python | docs/conf.py | josl/ASM_challenge | f6bc31ab29d7589e259e1f3a2acbb613db6f03f3 | [
"Apache-2.0"
] | 2 | 2015-11-12T11:18:11.000Z | 2015-11-12T22:29:59.000Z | docs/conf.py | josl/ASM_challenge | f6bc31ab29d7589e259e1f3a2acbb613db6f03f3 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | josl/ASM_challenge | f6bc31ab29d7589e259e1f3a2acbb613db6f03f3 | [
"Apache-2.0"
] | 1 | 2015-11-10T16:10:36.000Z | 2015-11-10T16:10:36.000Z | # -*- coding: utf-8 -*-
#
# 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.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
imp... | 33.65272 | 85 | 0.708566 |
import sys
import os
import inspect
from sphinx import apidoc
__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))
package = "asm_challenge"
namespace = []
namespace_pkg = ".".join([namespace[-1], package]) if namespace else package
extensions... | true | true |
79091ca70931c7b85c0a6b24ba9004a8dd2149d7 | 8,679 | py | Python | ptlflow/__init__.py | hmorimitsu/ptlflow | 26f753322aef91b95ad78e743d847064e5d531b9 | [
"Apache-2.0"
] | 78 | 2021-06-15T03:11:33.000Z | 2022-03-25T05:51:25.000Z | ptlflow/__init__.py | hmorimitsu/ptlflow | 26f753322aef91b95ad78e743d847064e5d531b9 | [
"Apache-2.0"
] | 12 | 2021-07-04T17:02:57.000Z | 2022-02-09T09:30:43.000Z | ptlflow/__init__.py | hmorimitsu/ptlflow | 26f753322aef91b95ad78e743d847064e5d531b9 | [
"Apache-2.0"
] | 3 | 2021-07-27T21:28:51.000Z | 2021-09-17T10:06:27.000Z | """Provide useful functions for using PTLFlow."""
# =============================================================================
# Copyright 2021 Henrique Morimitsu
#
# 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... | 34.440476 | 123 | 0.689019 |
__version__ = '0.2.5'
import logging
from argparse import Namespace
from pathlib import Path
from typing import List, Optional
import requests
import torch
from torch import hub
from ptlflow.models.base_model.base_model import BaseModel
from ptlflow.models.dicl.dicl import DICL
from ptlflow.models.f... | true | true |
79091d01f2a7d5c083961aea6c0a54a53f35e56c | 264 | py | Python | part_2-mvc_structures/app/routes.py | perogeremmer/latihan-flask | 4a0098d8f23595d2b092b35b2f9b15f8abcf8ff5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-09-18T17:48:34.000Z | 2021-09-18T17:48:34.000Z | part_2-mvc_structures/app/routes.py | perogeremmer/latihan-flask | 4a0098d8f23595d2b092b35b2f9b15f8abcf8ff5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | part_2-mvc_structures/app/routes.py | perogeremmer/latihan-flask | 4a0098d8f23595d2b092b35b2f9b15f8abcf8ff5 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from app import api, web
from app.controllers import MyController, MyViewController
api.add_resource(MyController.MyController, '/')
web.add_resource(MyViewController.MyViewController, '/')
web.add_resource(MyViewController.MySecondViewController, '/say-my-name') | 44 | 73 | 0.829545 | from app import api, web
from app.controllers import MyController, MyViewController
api.add_resource(MyController.MyController, '/')
web.add_resource(MyViewController.MyViewController, '/')
web.add_resource(MyViewController.MySecondViewController, '/say-my-name') | true | true |
79091d211abb1b5cb10893671591591a401bb86e | 1,374 | py | Python | startdialog.py | jibonaronno/Rhythm | 1c8670d99960b7379fdf6dd006339b96143e7d90 | [
"CC0-1.0"
] | null | null | null | startdialog.py | jibonaronno/Rhythm | 1c8670d99960b7379fdf6dd006339b96143e7d90 | [
"CC0-1.0"
] | null | null | null | startdialog.py | jibonaronno/Rhythm | 1c8670d99960b7379fdf6dd006339b96143e7d90 | [
"CC0-1.0"
] | null | null | null |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import QDialog, QApplication, QWidget, QVBoxLayout, QHBoxLayout, QGroupBox
from PyQt5 import uic
from os.path import join, dirname, abspath
from qtpy.QtCore import Slot, QTimer, QThread, Signal, QObject, Qt
#from PyQt5 import Qt
_ST_DLG = join(... | 31.227273 | 106 | 0.642649 |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import QDialog, QApplication, QWidget, QVBoxLayout, QHBoxLayout, QGroupBox
from PyQt5 import uic
from os.path import join, dirname, abspath
from qtpy.QtCore import Slot, QTimer, QThread, Signal, QObject, Qt
_ST_DLG = join(dirname(abspath(__fil... | true | true |
79091d9d2a7176661512c69cf03cbfc321ef7321 | 1,608 | py | Python | Test.py | YuriyAksenov/ImageRecognition | 70a45ca44eb54f66dac23951011fdf487d34bd79 | [
"MIT"
] | null | null | null | Test.py | YuriyAksenov/ImageRecognition | 70a45ca44eb54f66dac23951011fdf487d34bd79 | [
"MIT"
] | null | null | null | Test.py | YuriyAksenov/ImageRecognition | 70a45ca44eb54f66dac23951011fdf487d34bd79 | [
"MIT"
] | null | null | null | from ui import *
startUI()
# # - read the input data:
# import MnistLoader
# training_data, validation_data, test_data = MnistLoader.load_data_wrapper()
# training_data = list(training_data)
# # ---------------------
... | 10.374194 | 113 | 0.631219 | from ui import *
startUI()
| true | true |
79091d9e2ef838f4354bc146d6447b448633f8d5 | 42,131 | py | Python | kujenga/consensus/blockchain.py | Kujenga-Network/kujenga-blockchain | ef1cdaa46bf780be97c63efa99ee1695a190cdf1 | [
"Apache-2.0"
] | 4 | 2021-09-19T18:58:56.000Z | 2022-02-09T04:30:02.000Z | kujenga/consensus/blockchain.py | Kujenga-Network/kujenga-blockchain | ef1cdaa46bf780be97c63efa99ee1695a190cdf1 | [
"Apache-2.0"
] | 11 | 2021-09-14T01:07:54.000Z | 2021-10-04T17:06:12.000Z | kujenga/consensus/blockchain.py | Kujenga-Network/kujenga-blockchain | ef1cdaa46bf780be97c63efa99ee1695a190cdf1 | [
"Apache-2.0"
] | null | null | null | import asyncio
import dataclasses
import logging
import multiprocessing
from concurrent.futures.process import ProcessPoolExecutor
from enum import Enum
from typing import Dict, List, Optional, Set, Tuple, Union
from clvm.casts import int_from_bytes
from kujenga.consensus.block_body_validation import validate_block_b... | 45.399784 | 119 | 0.636396 | import asyncio
import dataclasses
import logging
import multiprocessing
from concurrent.futures.process import ProcessPoolExecutor
from enum import Enum
from typing import Dict, List, Optional, Set, Tuple, Union
from clvm.casts import int_from_bytes
from kujenga.consensus.block_body_validation import validate_block_b... | true | true |
79091dc535b4c7364005a9788cfe0cf496bafba7 | 90 | py | Python | venv/lib/python3.6/site-packages/django/apps/__init__.py | xiegudong45/typeidea | db6504a232d120d6ffa185730bd35b9b9ecffa6c | [
"Apache-2.0"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | checkerista/.env/Lib/site-packages/django/apps/__init__.py | LybaFatimaNasir/CS311S20PID02 | bc29a8c4c9ee508c74d231c015a57b1ca4dfcb39 | [
"MIT"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | checkerista/.env/Lib/site-packages/django/apps/__init__.py | LybaFatimaNasir/CS311S20PID02 | bc29a8c4c9ee508c74d231c015a57b1ca4dfcb39 | [
"MIT"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | from .config import AppConfig
from .registry import apps
__all__ = ['AppConfig', 'apps']
| 18 | 31 | 0.744444 | from .config import AppConfig
from .registry import apps
__all__ = ['AppConfig', 'apps']
| true | true |
79091dd365f46ef0db6b9df02f6aac6814c69002 | 9,630 | py | Python | mmrazor/models/architectures/components/backbones/darts_backbone.py | HIT-cwh/mmrazor | 2dad24044d7f1dad88f20221f8fc071dd40fdd4f | [
"Apache-2.0"
] | 553 | 2021-12-23T11:43:35.000Z | 2022-03-31T01:04:20.000Z | mmrazor/models/architectures/components/backbones/darts_backbone.py | HIT-cwh/mmrazor | 2dad24044d7f1dad88f20221f8fc071dd40fdd4f | [
"Apache-2.0"
] | 113 | 2021-12-23T12:09:06.000Z | 2022-03-30T10:13:42.000Z | mmrazor/models/architectures/components/backbones/darts_backbone.py | HIT-cwh/mmrazor | 2dad24044d7f1dad88f20221f8fc071dd40fdd4f | [
"Apache-2.0"
] | 76 | 2021-12-23T11:48:39.000Z | 2022-03-29T11:24:35.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import torch
import torch.nn as nn
from mmcls.models.builder import BACKBONES
from mmcv.cnn import build_activation_layer, build_norm_layer
from ...utils import Placeholder
class FactorizedReduce(nn.Module):
"""Reduce feature map size by factorized poi... | 34.028269 | 79 | 0.538733 |
import copy
import torch
import torch.nn as nn
from mmcls.models.builder import BACKBONES
from mmcv.cnn import build_activation_layer, build_norm_layer
from ...utils import Placeholder
class FactorizedReduce(nn.Module):
def __init__(self,
in_channels,
out_channels,
... | true | true |
79091e61bc4c4e5018302b20f6b679e0854e8d2f | 1,165 | py | Python | setup.py | stiletto/bnw | 46e38f379519689ad14d451de8e68acb7ee04405 | [
"BSD-2-Clause"
] | 23 | 2015-01-14T13:22:37.000Z | 2022-01-11T11:38:43.000Z | setup.py | stiletto/bnw | 46e38f379519689ad14d451de8e68acb7ee04405 | [
"BSD-2-Clause"
] | 31 | 2015-01-27T19:57:45.000Z | 2018-10-04T22:35:22.000Z | setup.py | stiletto/bnw | 46e38f379519689ad14d451de8e68acb7ee04405 | [
"BSD-2-Clause"
] | 11 | 2015-01-02T10:29:14.000Z | 2018-06-28T13:09:53.000Z | #!/usr/bin/env python
from setuptools import setup
setup(name='BnW',
version='0.1',
description='Microblogging service',
author='Stiletto',
author_email='blasux@blasux.ru',
url='http://github.com/stiletto/bnw',
packages=['bnw', 'bnw.core', 'bnw.formatting', 'bnw.handlers', 'bnw.scripts', 'bnw.... | 44.807692 | 183 | 0.615451 |
from setuptools import setup
setup(name='BnW',
version='0.1',
description='Microblogging service',
author='Stiletto',
author_email='blasux@blasux.ru',
url='http://github.com/stiletto/bnw',
packages=['bnw', 'bnw.core', 'bnw.formatting', 'bnw.handlers', 'bnw.scripts', 'bnw.search', 'bnw.web', '... | true | true |
79091e6dad491c3eaffe0db0b1d5c615a4a3e4ef | 1,131 | py | Python | ClemBot.Bot/bot/__init__.py | glitchedcoder/ClemBot | 5bc3f811d063f53098ed9d5bcf0194422ba3d7b3 | [
"MIT"
] | 32 | 2021-07-10T18:51:29.000Z | 2022-02-27T17:07:28.000Z | ClemBot.Bot/bot/__init__.py | glitchedcoder/ClemBot | 5bc3f811d063f53098ed9d5bcf0194422ba3d7b3 | [
"MIT"
] | 87 | 2021-06-29T05:11:35.000Z | 2022-03-27T14:37:14.000Z | ClemBot.Bot/bot/__init__.py | glitchedcoder/ClemBot | 5bc3f811d063f53098ed9d5bcf0194422ba3d7b3 | [
"MIT"
] | 21 | 2021-06-23T23:46:17.000Z | 2022-03-19T16:16:05.000Z | import os
import logging
import seqlog
from seqlog import StructuredRootLogger, StructuredLogger, ConsoleStructuredLogHandler
if bool(os.environ.get('PROD')):
# Production logging setup
url = os.environ.get('SEQ_URL')
key = os.environ.get('SEQ_BOT_KEY')
if not key:
raise Exception('SEQ_BOT_K... | 27.585366 | 86 | 0.678161 | import os
import logging
import seqlog
from seqlog import StructuredRootLogger, StructuredLogger, ConsoleStructuredLogHandler
if bool(os.environ.get('PROD')):
url = os.environ.get('SEQ_URL')
key = os.environ.get('SEQ_BOT_KEY')
if not key:
raise Exception('SEQ_BOT_KEY not found but SEQ_URL w... | true | true |
79091f7bf3e3c7224227d62b0127a0c8b5551430 | 1,584 | py | Python | scripts/vaspy-incar.py | arafune/vaspy | 36342eb9b2523fc5c878db5e269e77a51352364c | [
"BSD-3-Clause"
] | 10 | 2018-01-15T10:41:00.000Z | 2021-03-31T05:53:50.000Z | scripts/vaspy-incar.py | arafune/vaspy | 36342eb9b2523fc5c878db5e269e77a51352364c | [
"BSD-3-Clause"
] | null | null | null | scripts/vaspy-incar.py | arafune/vaspy | 36342eb9b2523fc5c878db5e269e77a51352364c | [
"BSD-3-Clause"
] | 3 | 2019-08-13T16:34:56.000Z | 2021-06-05T15:39:37.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to demonstrate vaspy.incar functionality.
"""
import argparse
import vaspy
import vaspy.incar
from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger
LOGLEVEL = DEBUG
logger = getLogger(__name__)
fmt = "%(asctime)s %(levelname)s %(name)s :%(messa... | 27.310345 | 87 | 0.703283 |
import argparse
import vaspy
import vaspy.incar
from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger
LOGLEVEL = DEBUG
logger = getLogger(__name__)
fmt = "%(asctime)s %(levelname)s %(name)s :%(message)s"
formatter = Formatter(fmt)
handler = StreamHandler()
handler.setLevel(LOGLEVEL)
logger.setLevel(L... | true | true |
790920f5a12e9eb9b517725359bd82e7d56d9f98 | 2,897 | py | Python | request_handler/appconfig.py | AsAsgard/trading_pr | d4290cf256504ffc3f15ede353e9e7dd19e1099f | [
"Apache-2.0"
] | 2 | 2019-05-04T08:23:28.000Z | 2019-07-03T21:53:13.000Z | request_handler/appconfig.py | AsAsgard/trading_pr | d4290cf256504ffc3f15ede353e9e7dd19e1099f | [
"Apache-2.0"
] | 7 | 2019-05-01T12:28:17.000Z | 2019-05-26T14:51:42.000Z | request_handler/appconfig.py | AsAsgard/trading_pr | d4290cf256504ffc3f15ede353e9e7dd19e1099f | [
"Apache-2.0"
] | 3 | 2019-05-01T14:01:36.000Z | 2020-10-13T05:07:25.000Z | #!/usr/bin/env python
# coding: utf-8
import logging.config
import os
# Конфигурация базы данных
DB_CONFIG = {
'username': 'root',
'password': os.environ.get('MYSQL_TRADING_PASS'),
'host': '127.0.0.1',
'dbname': 'trading_db',
}
# Конфигурация журналирования
LOGGING = {
'version': 1,
'format... | 25.637168 | 98 | 0.593027 |
import logging.config
import os
DB_CONFIG = {
'username': 'root',
'password': os.environ.get('MYSQL_TRADING_PASS'),
'host': '127.0.0.1',
'dbname': 'trading_db',
}
LOGGING = {
'version': 1,
'formatters': {
'main': {
'format': '[%(asctime)s] %(levelname)s %(module)s ... | true | true |
790921904856a0105c9416489732fe217404b20f | 13,224 | py | Python | qa/rpc-tests/llmq-is-cl-conflicts.py | cryptowithacause/cryptocause-coin | f68f3ed504094f8780db4d78d0aef2089a2198a9 | [
"MIT"
] | null | null | null | qa/rpc-tests/llmq-is-cl-conflicts.py | cryptowithacause/cryptocause-coin | f68f3ed504094f8780db4d78d0aef2089a2198a9 | [
"MIT"
] | null | null | null | qa/rpc-tests/llmq-is-cl-conflicts.py | cryptowithacause/cryptocause-coin | f68f3ed504094f8780db4d78d0aef2089a2198a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.blocktools import get_masternode_payment, create_coinbase, create_block
from test_framewo... | 39.00885 | 125 | 0.628176 |
from test_framework.blocktools import get_masternode_payment, create_coinbase, create_block
from test_framework.mininode import *
from test_framework.test_framework import cryptocauseTestFramework
from test_framework.util import *
from time import *
class TestNode(SingleNodeConnCB):
def __init__(self):
... | true | true |
7909232e43551fb2c8aa53bac61176526dfa96ed | 10,936 | py | Python | Katna/image_filters/text_detector.py | viddik13/katna | 12256602a5fd24368ffffe2c1a82a46a49215c15 | [
"MIT"
] | 125 | 2019-08-22T06:53:55.000Z | 2022-03-24T05:53:41.000Z | Katna/image_filters/text_detector.py | viddik13/katna | 12256602a5fd24368ffffe2c1a82a46a49215c15 | [
"MIT"
] | 19 | 2020-02-13T07:14:59.000Z | 2021-12-01T15:13:33.000Z | Katna/image_filters/text_detector.py | viddik13/katna | 12256602a5fd24368ffffe2c1a82a46a49215c15 | [
"MIT"
] | 28 | 2019-09-03T07:00:29.000Z | 2021-12-30T04:20:14.000Z | """
.. module:: Katna.image_filters.text_detector
:platform: OS X
:synopsis: This module is implementation of text detector filter
"""
import os
import cv2
import numpy as np
import time
import requests
import random
from imutils.object_detection import non_max_suppression
from Katna.image_filters.filter impor... | 40.058608 | 117 | 0.59263 |
import os
import cv2
import numpy as np
import time
import requests
import random
from imutils.object_detection import non_max_suppression
from Katna.image_filters.filter import Filter
import Katna.config as config
class TextDetector(Filter):
def __init__(self, weight=1.0):
super().__init__(weight)
... | true | true |
7909233748429a363bd6474889766b2fb68d7fbd | 13,121 | py | Python | client/python/unrealcv/__init__.py | Embracing/unrealcv | 19305da8554c3a0e683a5e27a1e487cc2cf42776 | [
"MIT"
] | 1,617 | 2016-09-10T04:41:33.000Z | 2022-03-31T20:03:28.000Z | client/python/unrealcv/__init__.py | Embracing/unrealcv | 19305da8554c3a0e683a5e27a1e487cc2cf42776 | [
"MIT"
] | 199 | 2016-09-13T09:40:59.000Z | 2022-03-16T02:37:23.000Z | client/python/unrealcv/__init__.py | Embracing/unrealcv | 19305da8554c3a0e683a5e27a1e487cc2cf42776 | [
"MIT"
] | 431 | 2016-09-10T03:20:35.000Z | 2022-03-19T13:44:21.000Z | '''
UnrealCV
========
Provides functions to interact with games built using Unreal Engine.
>>> import unrealcv
>>> (HOST, PORT) = ('localhost', 9000)
>>> client = unrealcv.Client((HOST, PORT))
'''
import sys, ctypes, struct, threading, socket, re, time, logging
try:
from Queue import Queue
except:
from queue i... | 38.478006 | 149 | 0.604146 | import sys, ctypes, struct, threading, socket, re, time, logging
try:
from Queue import Queue
except:
from queue import Queue
_L = logging.getLogger(__name__)
ler()
h.setFormatter(logging.Formatter('%(levelname)s:%(module)s:%(lineno)d:%(message)s'))
_L.addHandler(h)
_L.propagate = False
_L.setLevel(logging.INF... | true | true |
790923c2fd21bc6db4b5c791020ec0e65b80f376 | 8,014 | py | Python | python/ray/ray_constants.py | thavlik/ray | 9b9c7f86f7e2c0723b7e14e38cd52c69cc7e1c43 | [
"Apache-2.0"
] | 4 | 2019-10-18T17:44:58.000Z | 2021-04-14T14:37:21.000Z | python/ray/ray_constants.py | thavlik/ray | 9b9c7f86f7e2c0723b7e14e38cd52c69cc7e1c43 | [
"Apache-2.0"
] | 1 | 2022-03-30T17:52:44.000Z | 2022-03-30T17:52:44.000Z | python/ray/ray_constants.py | thavlik/ray | 9b9c7f86f7e2c0723b7e14e38cd52c69cc7e1c43 | [
"Apache-2.0"
] | 1 | 2020-06-26T07:54:25.000Z | 2020-06-26T07:54:25.000Z | """Ray constants used in the Python code."""
import logging
import math
import os
logger = logging.getLogger(__name__)
def env_integer(key, default):
if key in os.environ:
return int(os.environ[key])
return default
def direct_call_enabled():
return bool(int(os.environ.get("RAY_FORCE_DIRECT", "... | 39.673267 | 78 | 0.774644 |
import logging
import math
import os
logger = logging.getLogger(__name__)
def env_integer(key, default):
if key in os.environ:
return int(os.environ[key])
return default
def direct_call_enabled():
return bool(int(os.environ.get("RAY_FORCE_DIRECT", "1")))
ID_SIZE = 20
DEFAULT_OBJECT_STORE_... | true | true |
79092458d54f834a021361e4c5753435738c3bb6 | 222 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account_tax_cash_basis/models/__init__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account_tax_cash_basis/models/__init__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account_tax_cash_basis/models/__init__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import account_config_settings
import account_move
import account_partial_reconcile
import account_tax
import res_company
| 24.666667 | 74 | 0.815315 |
import account_config_settings
import account_move
import account_partial_reconcile
import account_tax
import res_company
| true | true |
7909246c63c81c1121878c80bf533febb6897be6 | 982 | py | Python | Level2/Lessons12951/gamjapark2.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level2/Lessons12951/gamjapark2.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level2/Lessons12951/gamjapark2.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | 1 | 2021-04-05T07:35:59.000Z | 2021-04-05T07:35:59.000Z | # JadenCase 문자열 만들기
def solution(s):
s = s.lower()
changed_words = []
print(s.split(" "))
for word in s.split(" "):
if len(word) == 0:
changed_words.append(word)
continue
elif len(word) == 1:
word = word[0].upper()
else:
word = wor... | 22.837209 | 45 | 0.546843 |
def solution(s):
s = s.lower()
changed_words = []
print(s.split(" "))
for word in s.split(" "):
if len(word) == 0:
changed_words.append(word)
continue
elif len(word) == 1:
word = word[0].upper()
else:
word = word[0].upper() + word... | true | true |
7909246c6f87492cdfbf5a4178c7937ebf4855d0 | 1,158 | py | Python | sigrhe_contract.py | ejgr-mtsiw/pw-html-parser | af44b1f163e02f285c2c7d86f1d838083c6546cf | [
"MIT"
] | null | null | null | sigrhe_contract.py | ejgr-mtsiw/pw-html-parser | af44b1f163e02f285c2c7d86f1d838083c6546cf | [
"MIT"
] | null | null | null | sigrhe_contract.py | ejgr-mtsiw/pw-html-parser | af44b1f163e02f285c2c7d86f1d838083c6546cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# (C)Eduardo Ribeiro - 1600820
class Contract:
id = 0
school_code = 0
school_name = ""
n_contract = 0
n_hours_per_week = 0
contract_end_date = ""
application_deadline = ""
recruitment_group = ""
county = ""
district = ""
clas... | 24.125 | 56 | 0.611399 |
class Contract:
id = 0
school_code = 0
school_name = ""
n_contract = 0
n_hours_per_week = 0
contract_end_date = ""
application_deadline = ""
recruitment_group = ""
county = ""
district = ""
class_project = ""
qualifications = ""
def __init__(
self,
... | true | true |
790924e95f876a790320a1c2ef3702feb736a0f3 | 328 | py | Python | Degree Distribution.py | monkee52/NCSSChallenge | e8849085e0578268dc5ce022b39c7d499884d810 | [
"BSD-2-Clause"
] | null | null | null | Degree Distribution.py | monkee52/NCSSChallenge | e8849085e0578268dc5ce022b39c7d499884d810 | [
"BSD-2-Clause"
] | null | null | null | Degree Distribution.py | monkee52/NCSSChallenge | e8849085e0578268dc5ce022b39c7d499884d810 | [
"BSD-2-Clause"
] | null | null | null | # Enter your code for "Degree Distribution" here.
import csv
degrees = []
students = []
for l in csv.DictReader(open("degrees.csv")):
degrees.append(l)
for l in csv.DictReader(open("students.csv")):
students.append(l)
students = sorted(students, key=lambda x: float(x["score"]))
students.reverse()
print(st... | 18.222222 | 60 | 0.698171 |
import csv
degrees = []
students = []
for l in csv.DictReader(open("degrees.csv")):
degrees.append(l)
for l in csv.DictReader(open("students.csv")):
students.append(l)
students = sorted(students, key=lambda x: float(x["score"]))
students.reverse()
print(students)
| true | true |
790925888ab503ef5ead5db6ac4f59663ab3665c | 5,499 | py | Python | spacy/tests/test_displacy.py | xettrisomeman/spaCy | 72f7f4e68a5076a87dd9402812bfb72e479237ed | [
"MIT"
] | null | null | null | spacy/tests/test_displacy.py | xettrisomeman/spaCy | 72f7f4e68a5076a87dd9402812bfb72e479237ed | [
"MIT"
] | null | null | null | spacy/tests/test_displacy.py | xettrisomeman/spaCy | 72f7f4e68a5076a87dd9402812bfb72e479237ed | [
"MIT"
] | null | null | null | import pytest
from spacy import displacy
from spacy.displacy.render import DependencyRenderer, EntityRenderer
from spacy.lang.fa import Persian
from spacy.tokens import Span, Doc
def test_displacy_parse_ents(en_vocab):
"""Test that named entities on a Doc are converted into displaCy's format."""
doc = Doc(en... | 38.1875 | 92 | 0.590653 | import pytest
from spacy import displacy
from spacy.displacy.render import DependencyRenderer, EntityRenderer
from spacy.lang.fa import Persian
from spacy.tokens import Span, Doc
def test_displacy_parse_ents(en_vocab):
doc = Doc(en_vocab, words=["But", "Google", "is", "starting", "from", "behind"])
doc.ents ... | true | true |
790925b5b59a83031217bbd4c92740713b911535 | 431 | py | Python | Python/Hora da Corrida - SBC 2019.py | Filipe-uefs/Algoritmos | 2443f133cd40781d0ad20ed248a53e279b0acba1 | [
"MIT"
] | null | null | null | Python/Hora da Corrida - SBC 2019.py | Filipe-uefs/Algoritmos | 2443f133cd40781d0ad20ed248a53e279b0acba1 | [
"MIT"
] | null | null | null | Python/Hora da Corrida - SBC 2019.py | Filipe-uefs/Algoritmos | 2443f133cd40781d0ad20ed248a53e279b0acba1 | [
"MIT"
] | null | null | null | #link (https://neps.academy/problem/443)
voltas,placas= input().split()
result = int(voltas) * int(placas)
numbers = []
resultado = result * float(str(0) + str('.') + str(1))
for x in range(2,11):
if int(resultado)==resultado:
numbers.append(int(resultado))
else:
numbers.append(int(resultado)+1... | 26.9375 | 58 | 0.607889 |
voltas,placas= input().split()
result = int(voltas) * int(placas)
numbers = []
resultado = result * float(str(0) + str('.') + str(1))
for x in range(2,11):
if int(resultado)==resultado:
numbers.append(int(resultado))
else:
numbers.append(int(resultado)+1)
resultado = result * float(str(0) ... | true | true |
790925ec72a5e89da2f9fd5db3424ad72f8d336d | 180 | py | Python | example/decode_image.py | Eye-Remocon/Face_Recognition | 256ba99e821b923679b85aba9a3febecb28258df | [
"MIT"
] | null | null | null | example/decode_image.py | Eye-Remocon/Face_Recognition | 256ba99e821b923679b85aba9a3febecb28258df | [
"MIT"
] | 8 | 2021-05-05T05:40:38.000Z | 2021-06-28T13:22:19.000Z | example/decode_image.py | Eye-Remocon/Face_Recognition | 256ba99e821b923679b85aba9a3febecb28258df | [
"MIT"
] | 3 | 2021-05-05T04:34:24.000Z | 2021-05-09T03:47:03.000Z | import base64
def decode_img(img_string):
img_data = base64.b64decode(img_string)
filename = "temp_img.jpg"
with open(filename, "wb") as f:
f.write(img_data)
| 20 | 43 | 0.677778 | import base64
def decode_img(img_string):
img_data = base64.b64decode(img_string)
filename = "temp_img.jpg"
with open(filename, "wb") as f:
f.write(img_data)
| true | true |
790926ac5bd77e6f1853dec33c30206d01fea08f | 1,248 | py | Python | multibar/core/variants/lib_info.py | Animatea/DiscordProgressbar | 654807f7eddcc19b0357fb11de700e09da0379da | [
"Apache-2.0"
] | 12 | 2021-03-16T17:01:07.000Z | 2021-04-26T19:16:13.000Z | multibar/core/variants/lib_info.py | Animatea/python-multibar | 654807f7eddcc19b0357fb11de700e09da0379da | [
"Apache-2.0"
] | 1 | 2021-09-12T21:38:40.000Z | 2022-02-22T20:54:15.000Z | multibar/core/variants/lib_info.py | Animatea/python-multibar | 654807f7eddcc19b0357fb11de700e09da0379da | [
"Apache-2.0"
] | 5 | 2021-09-10T13:30:37.000Z | 2021-12-31T19:26:53.000Z | """
Copyright [2021] [DenyS]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 24.470588 | 72 | 0.669872 |
import typing
__all__: typing.Sequence[str] = ("Info",)
T = typing.TypeVar("T")
class Info(typing.Generic[T]):
def __init__(self, value: T) -> None:
self.value = value
def __repr__(self) -> str:
return f"Info(value={self.value})"
def __str__(self) -> str:
return str(self.va... | true | true |
790926c5623b0254f0cc962a99f4ed0413033567 | 7,755 | py | Python | blog/routes.py | mlewan01/flaskblog01 | 19b5035a0c99ece4c9dddaf8e0fc396a8ce0b4c3 | [
"Apache-2.0"
] | null | null | null | blog/routes.py | mlewan01/flaskblog01 | 19b5035a0c99ece4c9dddaf8e0fc396a8ce0b4c3 | [
"Apache-2.0"
] | null | null | null | blog/routes.py | mlewan01/flaskblog01 | 19b5035a0c99ece4c9dddaf8e0fc396a8ce0b4c3 | [
"Apache-2.0"
] | null | null | null | import secrets
import os
from PIL import Image
from flask import render_template, url_for, flash, redirect, request, abort
from blog import app, db, bcrypt, mail
from blog.forms import (RegistrationForm, LoginForm, UpdateAccountForm, PostForm, \
RequestResetForm, ResetPasswordForm)
from blog.mod... | 37.283654 | 100 | 0.676209 | import secrets
import os
from PIL import Image
from flask import render_template, url_for, flash, redirect, request, abort
from blog import app, db, bcrypt, mail
from blog.forms import (RegistrationForm, LoginForm, UpdateAccountForm, PostForm, \
RequestResetForm, ResetPasswordForm)
from blog.mod... | true | true |
790926c7ee3b355a4183550658a3da6905cea595 | 18,661 | py | Python | qa/rpc-tests/test_framework/comptool.py | 86b/Abosom | 44dc7338b1a53b1121cb06e8aa28dca8088185af | [
"MIT"
] | 2 | 2020-07-15T17:38:28.000Z | 2020-08-02T17:00:24.000Z | qa/rpc-tests/test_framework/comptool.py | 86b/Abosom | 44dc7338b1a53b1121cb06e8aa28dca8088185af | [
"MIT"
] | 2 | 2020-03-11T20:41:04.000Z | 2020-08-16T13:49:37.000Z | qa/rpc-tests/test_framework/comptool.py | 86b/Abosom | 44dc7338b1a53b1121cb06e8aa28dca8088185af | [
"MIT"
] | 2 | 2020-06-10T04:48:10.000Z | 2020-07-24T10:52:48.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-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 .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
'''
This ... | 45.184019 | 149 | 0.600825 |
from .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
# on_headers: log the chain tip
# on_pong: update ping response map (for synchronization)
# on_getheaders: provide headers via BlockStore
# on_getdata: provide blocks via BlockStore
global mininode_lock
class Reje... | true | true |
7909281508b24be74f4d08069d650825511b6326 | 22,039 | py | Python | cleanrl/experiments/dqn2_atari_visual.py | manabukosaka/cleanrl | 31ae5f640ac7f7225375bc51759c4e8baa4880b4 | [
"MIT"
] | 1 | 2021-08-04T00:03:14.000Z | 2021-08-04T00:03:14.000Z | cleanrl/experiments/dqn2_atari_visual.py | manabukosaka/cleanrl | 31ae5f640ac7f7225375bc51759c4e8baa4880b4 | [
"MIT"
] | null | null | null | cleanrl/experiments/dqn2_atari_visual.py | manabukosaka/cleanrl | 31ae5f640ac7f7225375bc51759c4e8baa4880b4 | [
"MIT"
] | null | null | null | # https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial st... | 38.129758 | 171 | 0.632742 |
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
gym.Wrapper.__init__(self, env)
self.noop_max = noop_max
self.override_num_noops = None
... | true | true |
79092ae037401100239163d1bdc62803bb41e8eb | 612 | py | Python | Project Pattern/pattern_16.py | chandthash/nppy | 228116d4efa6d28a9cdab245c6c8045844e96211 | [
"MIT"
] | null | null | null | Project Pattern/pattern_16.py | chandthash/nppy | 228116d4efa6d28a9cdab245c6c8045844e96211 | [
"MIT"
] | null | null | null | Project Pattern/pattern_16.py | chandthash/nppy | 228116d4efa6d28a9cdab245c6c8045844e96211 | [
"MIT"
] | null | null | null | def pattern_sixteen(steps):
''' Pattern sixteen
9
9 8
9 8 7
9 8 7 6
9 8 7 6 5
9 8 7 6 5 4
9 8 7 6 5 4 3
9 8 7 6 5 4 3 2
9 8 7 6 5 4 3 2 1
'''
get_range = [str(i) for i in range(1, steps + 1)][::-1] # Getting range of nu... | 21.857143 | 112 | 0.48366 | def pattern_sixteen(steps):
get_range = [str(i) for i in range(1, steps + 1)][::-1]
for gr in range(1, len(get_range) + 1):
join = ' '.join(get_range[:gr])
print(join)
if __name__ == '__main__':
try:
pattern_sixteen(9)
except NameError:
print('Integer... | true | true |
79092d8f23c784b5f570fd6425bf38e9e338988f | 2,072 | py | Python | hw_asr/metric/cer_metric.py | ArseniyBolotin/asr_project | e026286df406bed20a45a82a8c961bad5446aa9a | [
"MIT"
] | null | null | null | hw_asr/metric/cer_metric.py | ArseniyBolotin/asr_project | e026286df406bed20a45a82a8c961bad5446aa9a | [
"MIT"
] | null | null | null | hw_asr/metric/cer_metric.py | ArseniyBolotin/asr_project | e026286df406bed20a45a82a8c961bad5446aa9a | [
"MIT"
] | null | null | null | from typing import List
import torch
from torch import Tensor
from hw_asr.base.base_metric import BaseMetric
from hw_asr.base.base_text_encoder import BaseTextEncoder
from hw_asr.metric.utils import calc_cer
class ArgmaxCERMetric(BaseMetric):
def __init__(self, text_encoder: BaseTextEncoder, *args, **kwargs):
... | 41.44 | 116 | 0.668436 | from typing import List
import torch
from torch import Tensor
from hw_asr.base.base_metric import BaseMetric
from hw_asr.base.base_text_encoder import BaseTextEncoder
from hw_asr.metric.utils import calc_cer
class ArgmaxCERMetric(BaseMetric):
def __init__(self, text_encoder: BaseTextEncoder, *args, **kwargs):
... | true | true |
79092fb8dc4a60159a099011d0f8734a3688e434 | 2,669 | py | Python | scripts/add_def_obstructions.py | grigoriy-chirkov/OpenLane | 374211966b12e2fa0930f33c44d04347df9705f6 | [
"Apache-2.0"
] | null | null | null | scripts/add_def_obstructions.py | grigoriy-chirkov/OpenLane | 374211966b12e2fa0930f33c44d04347df9705f6 | [
"Apache-2.0"
] | null | null | null | scripts/add_def_obstructions.py | grigoriy-chirkov/OpenLane | 374211966b12e2fa0930f33c44d04347df9705f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.3625 | 125 | 0.665043 |
import argparse
import re
import opendb as odb
parser = argparse.ArgumentParser(
description='Creates obstructions in def files.')
parser.add_argument('--lef', '-l',
nargs='+',
type=str,
default=None,
required=True,
... | true | true |
79092fecf728c4382b2f448ef5583fda1dd83b5d | 21,596 | py | Python | tf_encrypted/convert/register.py | dropoutlabs/tf-encrypted | 48c9dc7419163425e736ad05bb19980d134fc851 | [
"Apache-2.0"
] | 1 | 2019-06-14T17:40:37.000Z | 2019-06-14T17:40:37.000Z | tf_encrypted/convert/register.py | dropoutlabs/tf-encrypted | 48c9dc7419163425e736ad05bb19980d134fc851 | [
"Apache-2.0"
] | null | null | null | tf_encrypted/convert/register.py | dropoutlabs/tf-encrypted | 48c9dc7419163425e736ad05bb19980d134fc851 | [
"Apache-2.0"
] | null | null | null | """Registry for the TF Encrypted Converter."""
import array
import logging
import os
from typing import Any, List
from collections import OrderedDict
import yaml
import numpy as np
import tensorflow as tf
from ..layers import Conv2D, Relu, Sigmoid, Dense, AveragePooling2D, MaxPooling2D
from ..protocol.pond import Pon... | 29.144399 | 99 | 0.677348 | import array
import logging
import os
from typing import Any, List
from collections import OrderedDict
import yaml
import numpy as np
import tensorflow as tf
from ..layers import Conv2D, Relu, Sigmoid, Dense, AveragePooling2D, MaxPooling2D
from ..protocol.pond import PondPrivateTensor, PondMaskedTensor
def registry... | true | true |
7909304117b4d88707f4d39962d2e98e40792ef1 | 1,205 | py | Python | Semester I/Design and Analysis of Algorithm/Practical 04- Hiring Problem/HiringProblem.py | STreK7/MSc.-CS | 78484f5bbce9f5149da680b19626eb139cc5ca90 | [
"Apache-2.0"
] | null | null | null | Semester I/Design and Analysis of Algorithm/Practical 04- Hiring Problem/HiringProblem.py | STreK7/MSc.-CS | 78484f5bbce9f5149da680b19626eb139cc5ca90 | [
"Apache-2.0"
] | null | null | null | Semester I/Design and Analysis of Algorithm/Practical 04- Hiring Problem/HiringProblem.py | STreK7/MSc.-CS | 78484f5bbce9f5149da680b19626eb139cc5ca90 | [
"Apache-2.0"
] | 2 | 2021-10-12T14:01:39.000Z | 2022-01-23T14:28:55.000Z | import random
def HiringProblem(score, n):
sample_size = int(round(n / e))
print(f"\nRejecting first {sample_size} candidates as sample")
#finding best candidate in the sample set for benchmark
best_candidate = 0;
for i in range(1, sample_size):
if (score[i] > score[bes... | 29.390244 | 102 | 0.591701 | import random
def HiringProblem(score, n):
sample_size = int(round(n / e))
print(f"\nRejecting first {sample_size} candidates as sample")
best_candidate = 0;
for i in range(1, sample_size):
if (score[i] > score[best_candidate]):
best_candidate = i
... | true | true |
7909310895915b039888ed90749f0aacd8c9e71b | 1,174 | py | Python | heart.py | xxninjabunnyxx/pixel_pop_heart_challenge | 94fabffa969f4ab2374c68a3a722d975ee940001 | [
"MIT"
] | null | null | null | heart.py | xxninjabunnyxx/pixel_pop_heart_challenge | 94fabffa969f4ab2374c68a3a722d975ee940001 | [
"MIT"
] | 1 | 2022-02-18T15:24:57.000Z | 2022-02-18T15:24:57.000Z | heart.py | xxninjabunnyxx/pixel-pop-heart-challenge | 94fabffa969f4ab2374c68a3a722d975ee940001 | [
"MIT"
] | null | null | null | def pixel(num):
def f(s):
return s + '\033[{}m \033[0m'.format(num)
return f
def new_line(s):
return s + u"\n"
def build(*steps, string=""):
for step in steps:
string = step(string)
return string
def main():
cyan = pixel(46)
space = pixel('08')
heart = [new_line,
... | 36.6875 | 87 | 0.579216 | def pixel(num):
def f(s):
return s + '\033[{}m \033[0m'.format(num)
return f
def new_line(s):
return s + u"\n"
def build(*steps, string=""):
for step in steps:
string = step(string)
return string
def main():
cyan = pixel(46)
space = pixel('08')
heart = [new_line,
... | true | true |
7909314b0b6a03e6197837bea805cb1f5b58eb77 | 310 | py | Python | api/app/crud/crud_group.py | LukasPatzke/ambientHUE | 9a66cc965c25bc93c84e423dd74c48aa6737c453 | [
"MIT"
] | 2 | 2020-08-06T16:39:39.000Z | 2021-05-04T18:59:11.000Z | api/app/crud/crud_group.py | LukasPatzke/ambientHUE | 9a66cc965c25bc93c84e423dd74c48aa6737c453 | [
"MIT"
] | null | null | null | api/app/crud/crud_group.py | LukasPatzke/ambientHUE | 9a66cc965c25bc93c84e423dd74c48aa6737c453 | [
"MIT"
] | null | null | null | from sqlalchemy.orm import Session
from .base import CRUDBase
from app.models import Group
from app.schemas import GroupCreate, GroupUpdate
class CRUDGroup(CRUDBase[Group, GroupCreate, GroupUpdate]):
def count(self, db: Session) -> int:
return db.query(Group).count()
group = CRUDGroup(Group)
| 22.142857 | 59 | 0.751613 | from sqlalchemy.orm import Session
from .base import CRUDBase
from app.models import Group
from app.schemas import GroupCreate, GroupUpdate
class CRUDGroup(CRUDBase[Group, GroupCreate, GroupUpdate]):
def count(self, db: Session) -> int:
return db.query(Group).count()
group = CRUDGroup(Group)
| true | true |
7909321c9cd617ce693c13f3a722cffcce227512 | 2,656 | py | Python | oct/ansible/openshift-ansible/utils/setup.py | staebler/origin-ci-tool | 2cb86c3cad7a37450e711571ac75997118c899e5 | [
"Apache-2.0"
] | 23 | 2017-01-06T21:32:09.000Z | 2022-03-14T17:14:49.000Z | oct/ansible/openshift-ansible/utils/setup.py | staebler/origin-ci-tool | 2cb86c3cad7a37450e711571ac75997118c899e5 | [
"Apache-2.0"
] | 129 | 2017-01-06T18:29:51.000Z | 2022-01-27T17:37:21.000Z | oct/ansible/openshift-ansible/utils/setup.py | staebler/origin-ci-tool | 2cb86c3cad7a37450e711571ac75997118c899e5 | [
"Apache-2.0"
] | 52 | 2017-01-06T16:03:49.000Z | 2022-01-24T18:58:58.000Z | """A setuptools based setup module.
"""
# Always prefer setuptools over distutils
from setuptools import setup
setup(
name='ooinstall',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en... | 32.790123 | 86 | 0.670557 |
from setuptools import setup
setup(
name='ooinstall',
version="3.0.0",
description="Ansible wrapper for OpenShift Enterprise 3 installation.",
url="http://github.com/openshift/openshift-extras/tree/enterprise-3.0/oo-install",
# Author details
author="openshift@redhat.c... | true | true |
7909333124983a76b904ffaa880a21addb7e07ba | 8,739 | py | Python | qa/pull-tester/rpc-tests.py | LumoCash2018/LumoCash | 5fbaa077d63a643ce484ddf4fdada1fbc65651c6 | [
"MIT"
] | null | null | null | qa/pull-tester/rpc-tests.py | LumoCash2018/LumoCash | 5fbaa077d63a643ce484ddf4fdada1fbc65651c6 | [
"MIT"
] | 1 | 2018-10-14T23:28:11.000Z | 2018-10-14T23:28:11.000Z | qa/pull-tester/rpc-tests.py | LumoCash2018/LumoCash | 5fbaa077d63a643ce484ddf4fdada1fbc65651c6 | [
"MIT"
] | 1 | 2018-10-12T18:35:55.000Z | 2018-10-12T18:35:55.000Z | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
... | 31.663043 | 163 | 0.638174 |
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
forward all unrecognized arguments onto the individual test scripts, other
than:
- `-extended`: run the "extended" test suite in addition to the basic one.
- `-win`: signal that this is running in a Wi... | false | true |
790933eb734b7a0e9cc5ef4d08940e8e25bb9c30 | 378 | py | Python | sample/basic_quotes.py | wangjild/mootdx | 1471a708ba77e7d79de74f1ea763b3c8a060626f | [
"MIT"
] | 2 | 2020-02-29T03:25:15.000Z | 2020-07-09T10:30:49.000Z | sample/basic_quotes.py | wangjild/mootdx | 1471a708ba77e7d79de74f1ea763b3c8a060626f | [
"MIT"
] | 1 | 2020-07-14T08:46:14.000Z | 2020-07-14T09:17:19.000Z | sample/basic_quotes.py | wangjild/mootdx | 1471a708ba77e7d79de74f1ea763b3c8a060626f | [
"MIT"
] | 2 | 2021-03-10T02:54:00.000Z | 2021-03-29T09:03:15.000Z | # -*- coding: utf-8 -*-
from mootdx.quotes import Quotes
client = Quotes.factory(market='std') # 标准市场
# client = Quotes.factory(market='ext', multithread=True, heartbeat=True) # 扩展市场
quote = client.bars(symbol='600036', frequency=9, offset=10)
print(quote)
quote = client.index(symbol='000001', frequency=9)
print(qu... | 25.2 | 80 | 0.719577 |
from mootdx.quotes import Quotes
client = Quotes.factory(market='std')
e = client.bars(symbol='600036', frequency=9, offset=10)
print(quote)
quote = client.index(symbol='000001', frequency=9)
print(quote)
quote = client.minute(symbol='000001')
print(quote)
| true | true |
7909364c19c40145e3dff583813512095cee4f88 | 4,340 | py | Python | {{cookiecutter.project_name}}/server/settings/components/common.py | vovanbo/wemake-django-template | 5e7a77e335d647eaf209db5050284bc13f3200d1 | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/server/settings/components/common.py | vovanbo/wemake-django-template | 5e7a77e335d647eaf209db5050284bc13f3200d1 | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/server/settings/components/common.py | vovanbo/wemake-django-template | 5e7a77e335d647eaf209db5050284bc13f3200d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their config, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
from typing import Tuple
from server.settings.c... | 26.30303 | 72 | 0.698387 |
from typing import Tuple
from server.settings.components import BASE_DIR, config
SECRET_KEY = config('DJANGO_SECRET_KEY')
INSTALLED_APPS: Tuple[str, ...] = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.st... | true | true |
790936be6ee5889577f5423e7fb92cb06eff620d | 424 | py | Python | web/core/__init__.py | maximest-pierre/WebCore | 543bfb79c0737917d1bd2a148eb61761ab6f6319 | [
"MIT"
] | 56 | 2015-05-13T16:08:06.000Z | 2021-12-26T22:24:46.000Z | web/core/__init__.py | maximest-pierre/WebCore | 543bfb79c0737917d1bd2a148eb61761ab6f6319 | [
"MIT"
] | 104 | 2015-01-20T23:55:28.000Z | 2021-03-01T03:29:47.000Z | web/core/__init__.py | maximest-pierre/WebCore | 543bfb79c0737917d1bd2a148eb61761ab6f6319 | [
"MIT"
] | 12 | 2015-05-22T15:46:39.000Z | 2021-09-16T00:38:54.000Z | # encoding: utf-8
# ## Imports
from threading import local as __local
# Expose these as importable from the top-level `web.core` namespace.
from .application import Application
from .util import lazy
# ## Module Globals
__all__ = ['local', 'Application', 'lazy'] # Symbols exported by this package.
# This is to... | 21.2 | 96 | 0.735849 |
port local as __local
from .application import Application
from .util import lazy
n', 'lazy']
local = __local()
| true | true |
790936d8b88635db54ab70587e54a7c4d151073a | 51,129 | py | Python | userbot/modules/memes.py | konsolxnxx/Petercord-Userbotilham | ef9e98a913f857c967fdf0528bab405d72e2426c | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/memes.py | konsolxnxx/Petercord-Userbotilham | ef9e98a913f857c967fdf0528bab405d72e2426c | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/memes.py | konsolxnxx/Petercord-Userbotilham | ef9e98a913f857c967fdf0528bab405d72e2426c | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-03-26T09:08:24.000Z | 2021-03-26T09:08:24.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
import os
import urllib
import requests
from re import sub
from ... | 27.239744 | 193 | 0.500264 |
import os
import urllib
import requests
from re import sub
from cowpy import cow
from asyncio import sleep
from collections import deque
from random import choice, getrandbits, randint
from userbot import bot, CMD_HELP
from userbot.events import register
from userbot.modules.admin import get_user_from_event
MET... | true | true |
790937151c22417254dfaa34148a0640c7540f05 | 2,679 | py | Python | restclients/dao_implementation/catalyst.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | restclients/dao_implementation/catalyst.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | restclients/dao_implementation/catalyst.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | """
Contains Catalyst DAO implementations.
"""
from django.conf import settings
from restclients.mock_http import MockHTTP
from restclients.dao_implementation import get_timeout
from restclients.dao_implementation.live import get_con_pool, get_live_url
from restclients.dao_implementation.mock import get_mockdata_url
i... | 34.792208 | 77 | 0.658081 |
from django.conf import settings
from restclients.mock_http import MockHTTP
from restclients.dao_implementation import get_timeout
from restclients.dao_implementation.live import get_con_pool, get_live_url
from restclients.dao_implementation.mock import get_mockdata_url
import datetime
import hashlib
import pytz
cla... | true | true |
790938f4ade6cf753a74a4cd0631f47cbb2b2b20 | 1,029 | py | Python | scraper/storage_spiders/azoravn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/azoravn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/azoravn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='product-name']/h1",
'price' : "//p[@class='special-price']/span[@class='price']|//span[@class='regular-price']/span[@cla... | 34.3 | 117 | 0.609329 |
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='product-name']/h1",
'price' : "//p[@class='special-price']/span[@class='price']|//span[@class='regular-price']/span[@class='price']",
'category' : "//div[@class='breadcrumbs']/ul/li/a",
'd... | true | true |
790938f7e1357ee27418bae0c541ca6e8a26f23a | 4,883 | py | Python | shub_workflow/clone_job.py | curita/shub-workflow | 5450da1502f8c300be242609dc6ae67bd3702079 | [
"BSD-3-Clause"
] | null | null | null | shub_workflow/clone_job.py | curita/shub-workflow | 5450da1502f8c300be242609dc6ae67bd3702079 | [
"BSD-3-Clause"
] | null | null | null | shub_workflow/clone_job.py | curita/shub-workflow | 5450da1502f8c300be242609dc6ae67bd3702079 | [
"BSD-3-Clause"
] | null | null | null | """
Utility for cloning ScrapyCloud jobs
Features tagging of cloned from/to jobs (both source and destination) and avoids to clone source jobs already cloned.
By default cloned jobs are scheduled in the same project as source job. If --project-id is given, target project
is overriden.
"""
import logging
from shub_workf... | 32.125 | 120 | 0.612124 | import logging
from shub_workflow.script import BaseScript
from shub_workflow.utils import dash_retry_decorator
_LOG = logging.getLogger(__name__)
_LOG.setLevel(logging.INFO)
def _transform_cmd(job_cmd):
if isinstance(job_cmd, list):
return " ".join(["'%s'" % cmd for cmd in job_cmd[1:]])
return job... | true | true |
79093ae44bacb9494b8349f6098239d9b14a8d37 | 567 | py | Python | Glyph-Builders/lowercase_from_upper.py | m4rc1e/mf-glyphs-scripts | c5ed026e5b72a886f1e574f85659cdcae041e66a | [
"MIT"
] | 27 | 2015-09-01T00:19:34.000Z | 2021-12-05T01:59:01.000Z | Glyph-Builders/lowercase_from_upper.py | m4rc1e/mf-glyphs-scripts | c5ed026e5b72a886f1e574f85659cdcae041e66a | [
"MIT"
] | 26 | 2016-01-03T09:31:39.000Z | 2018-06-01T18:05:58.000Z | Glyph-Builders/lowercase_from_upper.py | m4rc1e/mf-glyphs-scripts | c5ed026e5b72a886f1e574f85659cdcae041e66a | [
"MIT"
] | 7 | 2016-01-03T07:09:04.000Z | 2018-04-06T00:24:14.000Z | #MenuTitle: Generate lowercase from uppercase
"""
Generate lowercase a-z from uppercase A-Z
TODO (M Foley) Generate all lowercase glyphs, not just a-z
"""
font = Glyphs.font
glyphs = list('abcdefghijklmnopqrstuvwxyz')
masters = font.masters
for glyph_name in glyphs:
glyph = GSGlyph(glyph_name)
glyph.updateGl... | 24.652174 | 58 | 0.714286 |
font = Glyphs.font
glyphs = list('abcdefghijklmnopqrstuvwxyz')
masters = font.masters
for glyph_name in glyphs:
glyph = GSGlyph(glyph_name)
glyph.updateGlyphInfo()
font.glyphs.append(glyph)
for idx,layer in enumerate(masters):
comp_name = glyph_name.upper()
component = GSComponen... | true | true |
79093b7e069f398d82b0a766f8ff00f20d754159 | 8,281 | py | Python | pyoomph/__main__.py | Akuli/oomph | 508d64e8eae69a904aab21ef49e0c75ec4a2cad0 | [
"MIT"
] | 2 | 2021-03-07T03:12:32.000Z | 2021-04-08T20:44:02.000Z | pyoomph/__main__.py | Akuli/oomph | 508d64e8eae69a904aab21ef49e0c75ec4a2cad0 | [
"MIT"
] | 167 | 2021-03-03T10:30:06.000Z | 2021-04-27T10:06:37.000Z | pyoomph/__main__.py | Akuli/oomph | 508d64e8eae69a904aab21ef49e0c75ec4a2cad0 | [
"MIT"
] | 1 | 2021-04-04T17:12:39.000Z | 2021-04-04T17:12:39.000Z | from __future__ import annotations
import argparse
import atexit
import itertools
import shlex
import shutil
import signal
import subprocess
import sys
import traceback
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from pyoomph import ast, ast2ir, ast_transformer, c_output, ir, parser
pytho... | 35.088983 | 88 | 0.643521 | from __future__ import annotations
import argparse
import atexit
import itertools
import shlex
import shutil
import signal
import subprocess
import sys
import traceback
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from pyoomph import ast, ast2ir, ast_transformer, c_output, ir, parser
pytho... | true | true |
79093cfb5e4feea5a49a917795cc271cb23118c8 | 373 | py | Python | records/migrations/0007_rename_date_records_created_date.py | Glucemy/Glucemy-back | c9fcf7996b3f13c67697aadd449e3e32afb1fa1b | [
"MIT"
] | null | null | null | records/migrations/0007_rename_date_records_created_date.py | Glucemy/Glucemy-back | c9fcf7996b3f13c67697aadd449e3e32afb1fa1b | [
"MIT"
] | null | null | null | records/migrations/0007_rename_date_records_created_date.py | Glucemy/Glucemy-back | c9fcf7996b3f13c67697aadd449e3e32afb1fa1b | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-04-06 17:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('records', '0006_alter_records_phasesday'),
]
operations = [
migrations.RenameField(
model_name='records',
old_name='date',
... | 19.631579 | 52 | 0.595174 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('records', '0006_alter_records_phasesday'),
]
operations = [
migrations.RenameField(
model_name='records',
old_name='date',
new_name='created_date',
),
... | true | true |
79093db4565f6064592c3384dbdbc12088b803e4 | 12,886 | bzl | Python | rules_daml/daml.bzl | FlashSheridan/daml | d7eb4580665d1ad07071b4eaa1814fd41251714a | [
"Apache-2.0"
] | null | null | null | rules_daml/daml.bzl | FlashSheridan/daml | d7eb4580665d1ad07071b4eaa1814fd41251714a | [
"Apache-2.0"
] | null | null | null | rules_daml/daml.bzl | FlashSheridan/daml | d7eb4580665d1ad07071b4eaa1814fd41251714a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("@build_environment//:configuration.bzl", "ghc_version", "sdk_version")
_damlc = attr.label(
allow_single_file = True,
default = Label("//compiler/damlc"),
executabl... | 29.622989 | 103 | 0.547649 |
load("@build_environment//:configuration.bzl", "ghc_version", "sdk_version")
_damlc = attr.label(
allow_single_file = True,
default = Label("//compiler/damlc"),
executable = True,
cfg = "host",
doc = "The DAML compiler.",
)
_zipper = attr.label(
allow_single_file = True,
default = Label... | true | true |
79093e2e65a2feba08c341fc369ebf687e9c2a11 | 5,588 | py | Python | pyxform/tests_v1/test_sheet_columns.py | medic/pyxform | cd76ce3ee43e3748656ff6e73cd119d238343113 | [
"BSD-2-Clause"
] | 3 | 2016-01-31T23:04:57.000Z | 2021-01-23T14:07:26.000Z | pyxform/tests_v1/test_sheet_columns.py | medic/pyxform | cd76ce3ee43e3748656ff6e73cd119d238343113 | [
"BSD-2-Clause"
] | 5 | 2017-08-22T13:43:16.000Z | 2021-05-13T02:52:40.000Z | pyxform/tests_v1/test_sheet_columns.py | medic/pyxform | cd76ce3ee43e3748656ff6e73cd119d238343113 | [
"BSD-2-Clause"
] | 3 | 2016-03-17T08:45:25.000Z | 2019-05-02T09:42:07.000Z | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class InvalidSurveyColumnsTests(PyxformTestCase):
def test_missing_name(self):
"""
every question needs a name (or alias of name)
"""
self.assertPyxformXform(
name='invalidcols',
ss_structure={'s... | 35.367089 | 75 | 0.411059 | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class InvalidSurveyColumnsTests(PyxformTestCase):
def test_missing_name(self):
self.assertPyxformXform(
name='invalidcols',
ss_structure={'survey': [{'type': 'text',
'label': 'label... | true | true |
79093e67e33c743f6ce430e95c32e02548597b3c | 5,417 | py | Python | content/actions/what-is-ec2-role/test_ec2_role_handler.py | varunsh-coder/dassana | fae1de20c7acdd10c9940f6cff3785943ba7f1f1 | [
"Apache-2.0"
] | 45 | 2021-08-03T00:35:10.000Z | 2022-03-31T05:51:49.000Z | content/actions/what-is-ec2-role/test_ec2_role_handler.py | varunsh-coder/dassana | fae1de20c7acdd10c9940f6cff3785943ba7f1f1 | [
"Apache-2.0"
] | 454 | 2021-08-02T22:56:48.000Z | 2021-12-20T21:09:44.000Z | content/actions/what-is-ec2-role/test_ec2_role_handler.py | varunsh-coder/dassana | fae1de20c7acdd10c9940f6cff3785943ba7f1f1 | [
"Apache-2.0"
] | 9 | 2021-09-02T04:52:19.000Z | 2021-12-22T18:11:52.000Z | import datetime
from typing import Dict, Tuple, Any
import boto3
from botocore.stub import Stubber
from dateutil.tz import tzutc
from dassana.common.aws_client import LambdaTestContext
from json import dumps
import pytest
@pytest.fixture()
def input_s3_with_website(s3_public_bucket_with_website, region):
return... | 37.358621 | 118 | 0.603101 | import datetime
from typing import Dict, Tuple, Any
import boto3
from botocore.stub import Stubber
from dateutil.tz import tzutc
from dassana.common.aws_client import LambdaTestContext
from json import dumps
import pytest
@pytest.fixture()
def input_s3_with_website(s3_public_bucket_with_website, region):
return... | true | true |
79093ea59eb4164a1713612ea65f0dbf5cab5488 | 9,165 | py | Python | src/signals.py | delos/dm-pta-mc | bce9ce815a518e1b47d1894fce3e003c5e649113 | [
"MIT"
] | null | null | null | src/signals.py | delos/dm-pta-mc | bce9ce815a518e1b47d1894fce3e003c5e649113 | [
"MIT"
] | null | null | null | src/signals.py | delos/dm-pta-mc | bce9ce815a518e1b47d1894fce3e003c5e649113 | [
"MIT"
] | null | null | null | """
Functions computing the signal shapes
"""
import numpy as np
from time import time
import src.constants as const
def subtract_signal(t, signal, fit_params=3):
"""
Returns the subtracted signal
"""
# fit dphi(t) to polynomials and subtract the contribution from n=0, 1 and 2
coef = np.p... | 27.522523 | 124 | 0.529078 |
import numpy as np
from time import time
import src.constants as const
def subtract_signal(t, signal, fit_params=3):
coef = np.polynomial.polynomial.polyfit(t, signal, fit_params - 1)
delta_signal = np.einsum(
"n,nj->j", coef, np.asarray([np.power(t, n) for n in range(fit_params)])
)
... | true | true |
79093f267726acc004aaf28a603df903376f96e9 | 2,887 | py | Python | test/functional/api/cas/installer.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | 1 | 2022-01-23T23:50:23.000Z | 2022-01-23T23:50:23.000Z | test/functional/api/cas/installer.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T22:05:26.000Z | 2022-03-21T22:05:26.000Z | test/functional/api/cas/installer.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
import logging
from tests import conftest
from core.test_run import TestRun
from api.cas import git
from api.cas import cas_module
from test_utils import os_utils
from test_utils.output import CmdException
def rsync_opencas_sour... | 28.303922 | 89 | 0.68133 |
import logging
from tests import conftest
from core.test_run import TestRun
from api.cas import git
from api.cas import cas_module
from test_utils import os_utils
from test_utils.output import CmdException
def rsync_opencas_sources():
TestRun.LOGGER.info("Copying Open CAS repository to DUT")
TestRun.ex... | true | true |
79093f5ff026604709ef317195ff407c082bacd8 | 2,876 | py | Python | tests/components/demo/test_fan.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | tests/components/demo/test_fan.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | tests/components/demo/test_fan.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """Test cases around the demo fan platform."""
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import fan
from homeassistant.const import STATE_OFF, STATE_ON
from tests.components.fan import common
FAN_ENTITY_ID = 'fan.living_room_fan'
def get_entity(hass):
"""... | 29.050505 | 74 | 0.714882 | import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import fan
from homeassistant.const import STATE_OFF, STATE_ON
from tests.components.fan import common
FAN_ENTITY_ID = 'fan.living_room_fan'
def get_entity(hass):
return hass.states.get(FAN_ENTITY_ID)
@pytest.fi... | true | true |
790940487406f760a0d61fe422f1afa8e6bc2856 | 14,212 | py | Python | appengine/monorail/services/chart_svc.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/services/chart_svc.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 16 | 2020-09-07T11:55:09.000Z | 2022-03-02T05:47:58.000Z | appengine/monorail/services/chart_svc.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""A service for querying data for charts.
Functions for querying the IssueSnapshot table and ... | 37.10705 | 79 | 0.675837 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import logging
import settings
import time
from framework import framework_helpers
from framework import sql
from search import search_helpers
from tracker import tracker_bizobj
from tracker import tracke... | true | true |
79094171d897f57a2a4f0df5c1978a00d2070601 | 720 | py | Python | iiits/migrations/0060_auto_20160717_0614.py | IIITS/iiits.ac.in | fd1bcd656a2f1a038d331b005224c546998a23a6 | [
"MIT"
] | 6 | 2016-02-27T04:35:28.000Z | 2020-06-09T04:18:38.000Z | iiits/migrations/0060_auto_20160717_0614.py | IIITS/iiits.ac.in | fd1bcd656a2f1a038d331b005224c546998a23a6 | [
"MIT"
] | null | null | null | iiits/migrations/0060_auto_20160717_0614.py | IIITS/iiits.ac.in | fd1bcd656a2f1a038d331b005224c546998a23a6 | [
"MIT"
] | 5 | 2016-03-01T07:28:20.000Z | 2021-01-19T10:51:58.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-07-17 06:14
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('iiits', '0059_auto_20160717_0609'),
]... | 25.714286 | 110 | 0.620833 |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('iiits', '0059_auto_20160717_0609'),
]
operations = [
migrations.AlterField(
mode... | true | true |
7909432811788a47dbfd11ff0adf09a38108980d | 5,966 | py | Python | valhalla/src/valhalla/core.py | DEMON1A/connectors | 86a1133735510154318030bcb971564e812e3ce0 | [
"Apache-2.0"
] | null | null | null | valhalla/src/valhalla/core.py | DEMON1A/connectors | 86a1133735510154318030bcb971564e812e3ce0 | [
"Apache-2.0"
] | null | null | null | valhalla/src/valhalla/core.py | DEMON1A/connectors | 86a1133735510154318030bcb971564e812e3ce0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""OpenCTI valhalla connector core module."""
import os
import yaml
import time
from typing import Any, Dict, Mapping, Optional
from datetime import datetime
from .knowledge import KnowledgeImporter
from .models import Status
from pycti import OpenCTIConnectorHelper, get_config_variable
from... | 36.157576 | 88 | 0.599397 |
import os
import yaml
import time
from typing import Any, Dict, Mapping, Optional
from datetime import datetime
from .knowledge import KnowledgeImporter
from .models import Status
from pycti import OpenCTIConnectorHelper, get_config_variable
from stix2 import TLP_WHITE, TLP_AMBER
from valhallaAPI.valhalla import V... | true | true |
79094328aad1e56498476572436d9a0a20e931b5 | 118 | py | Python | airbyte-integrations/connectors/source-orb/source_orb/__init__.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 22 | 2020-08-27T00:47:20.000Z | 2020-09-17T15:39:39.000Z | airbyte-integrations/connectors/source-orb/source_orb/__init__.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 116 | 2020-08-27T01:11:27.000Z | 2020-09-19T02:47:52.000Z | airbyte-integrations/connectors/source-orb/source_orb/__init__.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 1 | 2022-03-11T06:21:24.000Z | 2022-03-11T06:21:24.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from .source import SourceOrb
__all__ = ["SourceOrb"]
| 13.111111 | 56 | 0.694915 |
from .source import SourceOrb
__all__ = ["SourceOrb"]
| true | true |
7909440cc60247dfcd02ffa434cb072d166ba8f9 | 1,376 | py | Python | qurator/sbb_ned/models/evaluation.py | qurator-spk/sbb_ned | d4cfe249f72e48913f254a58fbe0dbe6e47bd168 | [
"Apache-2.0"
] | 6 | 2020-09-05T16:08:59.000Z | 2022-03-05T00:54:47.000Z | qurator/sbb_ned/models/evaluation.py | qurator-spk/sbb_ned | d4cfe249f72e48913f254a58fbe0dbe6e47bd168 | [
"Apache-2.0"
] | 6 | 2020-09-23T17:58:37.000Z | 2022-03-10T14:02:09.000Z | qurator/sbb_ned/models/evaluation.py | qurator-spk/sbb_ned | d4cfe249f72e48913f254a58fbe0dbe6e47bd168 | [
"Apache-2.0"
] | 2 | 2021-03-22T00:12:51.000Z | 2022-01-31T10:04:08.000Z | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def compute_lr(target_lr, n_epochs, train_set_size, batch_size, warmup):
total = (n_epochs - 1) * int(np.ceil(train_set_size / batch_size))
progress = [float(t) / total for t in range(0, total)]
factor = [p / warmup if p < w... | 28.666667 | 96 | 0.648983 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def compute_lr(target_lr, n_epochs, train_set_size, batch_size, warmup):
total = (n_epochs - 1) * int(np.ceil(train_set_size / batch_size))
progress = [float(t) / total for t in range(0, total)]
factor = [p / warmup if p < w... | true | true |
79094469e978444c608401df0f39d020f53a771e | 1,847 | py | Python | euca2ools/commands/cloudformation/liststackresources.py | salewski/euca2ools | 6b3f62f2cb1c54f14d3bfa5fd92dab3c0ecafecb | [
"BSD-2-Clause"
] | 30 | 2015-02-10T05:47:38.000Z | 2022-01-20T08:48:43.000Z | euca2ools/commands/cloudformation/liststackresources.py | salewski/euca2ools | 6b3f62f2cb1c54f14d3bfa5fd92dab3c0ecafecb | [
"BSD-2-Clause"
] | 16 | 2015-01-08T23:24:34.000Z | 2018-07-18T07:15:40.000Z | euca2ools/commands/cloudformation/liststackresources.py | salewski/euca2ools | 6b3f62f2cb1c54f14d3bfa5fd92dab3c0ecafecb | [
"BSD-2-Clause"
] | 19 | 2015-05-07T05:34:42.000Z | 2020-12-13T10:50:14.000Z | # Copyright 2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 46.175 | 76 | 0.769356 |
from requestbuilder import Arg
from euca2ools.commands.cloudformation import CloudFormationRequest
class ListStackResources(CloudFormationRequest):
DESCRIPTION = 'List all resources for a stack'
ARGS = [Arg('StackName', metavar='STACK',
help='name of the stack to list... | true | true |
790944dc37a4bce839bb96f93e2441e9f57866e1 | 136 | py | Python | simple_toolbelt/path.py | mbiemann/python-simple-toolbelt | ee8a52938078347f42d31d2a99fdcc60ca2cce9f | [
"MIT"
] | null | null | null | simple_toolbelt/path.py | mbiemann/python-simple-toolbelt | ee8a52938078347f42d31d2a99fdcc60ca2cce9f | [
"MIT"
] | null | null | null | simple_toolbelt/path.py | mbiemann/python-simple-toolbelt | ee8a52938078347f42d31d2a99fdcc60ca2cce9f | [
"MIT"
] | null | null | null | import os
def ensure_dir(path: str) -> str:
dirname = os.path.dirname(path)
os.makedirs(dirname, exist_ok=True)
return path | 22.666667 | 39 | 0.691176 | import os
def ensure_dir(path: str) -> str:
dirname = os.path.dirname(path)
os.makedirs(dirname, exist_ok=True)
return path | true | true |
790945f2c63c6d135a8af9d3cd69f61a073b26b5 | 1,218 | py | Python | TransformerNet/layers/Decoder_test.py | TeaKatz/Models_Corpus | 6d9e91eb97829e73d88ecfc4754492f6324ef383 | [
"MIT"
] | null | null | null | TransformerNet/layers/Decoder_test.py | TeaKatz/Models_Corpus | 6d9e91eb97829e73d88ecfc4754492f6324ef383 | [
"MIT"
] | null | null | null | TransformerNet/layers/Decoder_test.py | TeaKatz/Models_Corpus | 6d9e91eb97829e73d88ecfc4754492f6324ef383 | [
"MIT"
] | null | null | null | import tensorflow as tf
from TransformerNet.layers import Encoder, Decoder
def Decoder_test(*args, **kwargs):
inputs = tf.random.uniform((64, 62), dtype=tf.int64, minval=0, maxval=200) # (batch_size, input_seq_len)
enc_output = Encoder(num_layers=2, d_model=512, num_heads=8,
d... | 45.111111 | 111 | 0.602627 | import tensorflow as tf
from TransformerNet.layers import Encoder, Decoder
def Decoder_test(*args, **kwargs):
inputs = tf.random.uniform((64, 62), dtype=tf.int64, minval=0, maxval=200)
enc_output = Encoder(num_layers=2, d_model=512, num_heads=8,
d_ff=2048, input_vocab_size=850... | true | true |
79094657a029d6ecdd5652c70d7c9bffca65391c | 14,414 | py | Python | scipy/io/wavfile.py | jeremiedbb/scipy | 2bea64c334b18fd445a7945b350d7ace2dc22913 | [
"BSD-3-Clause"
] | 2 | 2020-06-20T14:11:14.000Z | 2020-10-12T07:11:36.000Z | scipy/io/wavfile.py | jeremiedbb/scipy | 2bea64c334b18fd445a7945b350d7ace2dc22913 | [
"BSD-3-Clause"
] | null | null | null | scipy/io/wavfile.py | jeremiedbb/scipy | 2bea64c334b18fd445a7945b350d7ace2dc22913 | [
"BSD-3-Clause"
] | null | null | null | """
Module to read / write wav files using NumPy arrays
Functions
---------
`read`: Return the sample rate (in samples/sec) and data from a WAV file.
`write`: Write a NumPy array as a WAV file.
"""
from __future__ import division, print_function, absolute_import
import sys
import numpy
import struct
import warnings... | 31.334783 | 78 | 0.548009 | from __future__ import division, print_function, absolute_import
import sys
import numpy
import struct
import warnings
__all__ = [
'WavFileWarning',
'read',
'write'
]
class WavFileWarning(UserWarning):
pass
WAVE_FORMAT_PCM = 0x0001
WAVE_FORMAT_IEEE_FLOAT = 0x0003
WAVE_FORMAT_EXTENSIBLE = 0xfffe
K... | true | true |
790946a5b7cd0becad3e0944422e311ff385860d | 6,662 | py | Python | tests/nnet3/nnet-compute-test.py | mxmpl/pykaldi | 0570307138c5391cc47b019450d08bcb9686dd98 | [
"Apache-2.0"
] | 916 | 2017-11-22T19:33:36.000Z | 2022-03-31T11:51:58.000Z | tests/nnet3/nnet-compute-test.py | mxmpl/pykaldi | 0570307138c5391cc47b019450d08bcb9686dd98 | [
"Apache-2.0"
] | 268 | 2018-01-16T22:06:45.000Z | 2022-03-29T03:24:41.000Z | tests/nnet3/nnet-compute-test.py | mxmpl/pykaldi | 0570307138c5391cc47b019450d08bcb9686dd98 | [
"Apache-2.0"
] | 260 | 2018-01-23T18:39:40.000Z | 2022-03-24T08:17:39.000Z | #!/usr/bin/env python
import random
import unittest
from kaldi.base.io import istringstream, ostringstream
from kaldi.cudamatrix import cuda_available, approx_equal_cu_matrix, CuMatrix
from kaldi.matrix import Matrix, Vector
from kaldi.matrix.functions import approx_equal
from kaldi.nnet3 import *
class TestNnetComp... | 40.375758 | 82 | 0.624287 |
import random
import unittest
from kaldi.base.io import istringstream, ostringstream
from kaldi.cudamatrix import cuda_available, approx_equal_cu_matrix, CuMatrix
from kaldi.matrix import Matrix, Vector
from kaldi.matrix.functions import approx_equal
from kaldi.nnet3 import *
class TestNnetCompute(unittest.TestCase... | true | true |
7909475aadf75da5fbcd516584081dbb378cca5c | 3,210 | py | Python | applauncher/configuration.py | maxpowel/applauncher | 31d51b68f08c7f9595b3b610a7b52f9ed657d851 | [
"Apache-2.0"
] | 3 | 2018-05-06T19:00:55.000Z | 2018-06-05T09:03:34.000Z | applauncher/configuration.py | maxpowel/applauncher | 31d51b68f08c7f9595b3b610a7b52f9ed657d851 | [
"Apache-2.0"
] | 10 | 2018-03-15T13:14:59.000Z | 2021-09-21T13:26:10.000Z | applauncher/configuration.py | maxpowel/applauncher | 31d51b68f08c7f9595b3b610a7b52f9ed657d851 | [
"Apache-2.0"
] | 2 | 2018-05-24T17:30:20.000Z | 2021-09-06T22:03:31.000Z | """Configuration format loaders"""
import locale
import os
from abc import ABC, abstractmethod
import yaml
from pydantic import create_model
def load_configuration(configuration_file_path, parameters_file_path, bundles):
"""Combines the configuration and parameters and build the configuration object"""
mappin... | 38.674699 | 119 | 0.65109 | import locale
import os
from abc import ABC, abstractmethod
import yaml
from pydantic import create_model
def load_configuration(configuration_file_path, parameters_file_path, bundles):
mappings = {}
for bundle in bundles:
if hasattr(bundle, "config_mapping"):
mappings.update(bundle.config... | true | true |
7909480692fe4406dc5d81e5ca4b3456bb280fcb | 5,899 | py | Python | src/shut/model/version.py | NiklasRosenstein/shut | 517bded2ff54306257d5622a08a1ba1ec967ffe5 | [
"MIT"
] | 5 | 2020-11-30T04:06:27.000Z | 2022-01-06T17:14:33.000Z | src/shut/model/version.py | NiklasRosenstein/shut | 517bded2ff54306257d5622a08a1ba1ec967ffe5 | [
"MIT"
] | 33 | 2020-09-07T16:58:14.000Z | 2022-02-13T00:59:28.000Z | src/shut/model/version.py | NiklasRosenstein/shut | 517bded2ff54306257d5622a08a1ba1ec967ffe5 | [
"MIT"
] | 2 | 2020-12-12T10:02:12.000Z | 2021-06-06T05:41:12.000Z | # -*- coding: utf8 -*-
# Copyright (c) 2021 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, mo... | 32.955307 | 103 | 0.698423 |
import logging
import re
from typing import Optional, Union
from databind.core import Converter, Context, Direction
from databind.core.mapper.objectmapper import ObjectMapper
from nr.utils.git import Git
from packaging.version import Version as _Version
logger = logging.getLogger(__name__)
clas... | true | true |
79094888287f3474ad5629d99bfe9b593a29fedb | 16,392 | py | Python | cogs/music.py | ROYAL-HarsH/HexBot | 572e3b26291f295f89bd0f7ad8ad5c03c4147470 | [
"MIT"
] | 123 | 2020-09-10T06:52:00.000Z | 2022-03-31T09:52:53.000Z | cogs/music.py | ROYAL-HarsH/HexBot | 572e3b26291f295f89bd0f7ad8ad5c03c4147470 | [
"MIT"
] | 6 | 2020-10-28T18:07:18.000Z | 2021-09-14T17:22:03.000Z | cogs/music.py | ROYAL-HarsH/HexBot | 572e3b26291f295f89bd0f7ad8ad5c03c4147470 | [
"MIT"
] | 29 | 2020-09-05T12:23:34.000Z | 2022-02-08T16:23:48.000Z | import math
import lavalink
import ksoftapi
import discord
from discord.ext import commands
class Music(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.kclient = bot.kclient
if not hasattr(bot, 'lavalink'):
bot.lavalink = lavalink.Client(bot.user.id)
bo... | 42.798956 | 141 | 0.596694 | import math
import lavalink
import ksoftapi
import discord
from discord.ext import commands
class Music(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.kclient = bot.kclient
if not hasattr(bot, 'lavalink'):
bot.lavalink = lavalink.Client(bot.user.id)
bo... | true | true |
790948b2ebce8cfa83196475fbc1ece91c2f3a2b | 2,529 | py | Python | django_pages/dashboard.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 3 | 2015-11-24T02:30:48.000Z | 2018-11-01T10:10:24.000Z | django_pages/dashboard.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 1 | 2015-04-18T16:37:36.000Z | 2015-04-18T16:37:36.000Z | django_pages/dashboard.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 2 | 2015-11-24T02:01:00.000Z | 2019-04-09T15:33:56.000Z | # -*- encoding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class DjangoPagesDashboard(Dashboard):
"""
Custom index dashboard for Django-pages
"""
def init_with_context... | 26.621053 | 59 | 0.451562 |
from django.utils.translation import ugettext_lazy as _
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class DjangoPagesDashboard(Dashboard):
def init_with_context(self, context):
site_name = get_admin_site_name(context)
self.child... | true | true |
790948f12fb2c097c5f715da10b669a2a2549d97 | 1,377 | py | Python | encoding/functions/rectify.py | Womcos/SCARF | b90251bc23410cb810a7082ca75147a7aae21dec | [
"MIT"
] | 1 | 2021-04-06T11:29:04.000Z | 2021-04-06T11:29:04.000Z | encoding/functions/rectify.py | Womcos/SCARF | b90251bc23410cb810a7082ca75147a7aae21dec | [
"MIT"
] | null | null | null | encoding/functions/rectify.py | Womcos/SCARF | b90251bc23410cb810a7082ca75147a7aae21dec | [
"MIT"
] | 1 | 2021-04-06T08:41:12.000Z | 2021-04-06T08:41:12.000Z |
"""Rectify function"""
import torch
from torch.autograd import Function
from encoding import cpu
if torch.cuda.device_count() > 0:
from encoding import gpu
__all__ = ['rectify']
class _rectify(Function):
@staticmethod
def forward(ctx, y, x, kernel_size, stride, padding, dilation, average):
ctx.s... | 32.023256 | 83 | 0.6122 |
import torch
from torch.autograd import Function
from encoding import cpu
if torch.cuda.device_count() > 0:
from encoding import gpu
__all__ = ['rectify']
class _rectify(Function):
@staticmethod
def forward(ctx, y, x, kernel_size, stride, padding, dilation, average):
ctx.save_for_backward(x)
... | true | true |
79094900117045887ff35ab105c9d4f49981c999 | 221 | py | Python | primeiros-exercicios/lpc002.py | miguelsndc/PythonFirstLooks | 1b4a1b4feaf3638fb4304ca0c42d332a64cab478 | [
"MIT"
] | 1 | 2020-10-30T12:57:38.000Z | 2020-10-30T12:57:38.000Z | primeiros-exercicios/lpc002.py | miguelsndc/python | 1b4a1b4feaf3638fb4304ca0c42d332a64cab478 | [
"MIT"
] | null | null | null | primeiros-exercicios/lpc002.py | miguelsndc/python | 1b4a1b4feaf3638fb4304ca0c42d332a64cab478 | [
"MIT"
] | null | null | null | h = input('Digite algo: ')
print(type(h))
print('É alfanumérico?',h.isalnum())
print('É decimal?',h.isdecimal())
print('É maiúsculo?',h.isupper())
print('É minúsculo?',h.islower())
print('É imprimível?',h.isprintable())
| 24.555556 | 38 | 0.674208 | h = input('Digite algo: ')
print(type(h))
print('É alfanumérico?',h.isalnum())
print('É decimal?',h.isdecimal())
print('É maiúsculo?',h.isupper())
print('É minúsculo?',h.islower())
print('É imprimível?',h.isprintable())
| true | true |
790949c1413a85ef6f95a0a35c479129b871ae5c | 13,031 | py | Python | scripts/ComunityDesign/taxonomicprofile.py | fplaza/CAMISIM | 4f2ab5e94773a355210568be946e732df7437cb6 | [
"Apache-2.0"
] | null | null | null | scripts/ComunityDesign/taxonomicprofile.py | fplaza/CAMISIM | 4f2ab5e94773a355210568be946e732df7437cb6 | [
"Apache-2.0"
] | null | null | null | scripts/ComunityDesign/taxonomicprofile.py | fplaza/CAMISIM | 4f2ab5e94773a355210568be946e732df7437cb6 | [
"Apache-2.0"
] | null | null | null | __author__ = 'hofmann'
__version__ = '0.0.2.1'
import os
from scripts.MetaDataTable.metadatatable import MetadataTable
from scripts.NcbiTaxonomy.ncbitaxonomy import NcbiTaxonomy
from scripts.Validator.validator import Validator
class TaxonomicProfile(Validator):
"""
Constructing taxonomic profiles from files... | 49.359848 | 130 | 0.659197 | __author__ = 'hofmann'
__version__ = '0.0.2.1'
import os
from scripts.MetaDataTable.metadatatable import MetadataTable
from scripts.NcbiTaxonomy.ncbitaxonomy import NcbiTaxonomy
from scripts.Validator.validator import Validator
class TaxonomicProfile(Validator):
_taxonomic_profile_version = "0.9.1"
def __i... | true | true |
79094a47130fbebad4d532fd2b26acc79d338c9c | 1,878 | py | Python | locations/spiders/aldi_uk.py | bealbrown/allhours | f750ee7644246a97bd16879f14115d7845f76b89 | [
"MIT"
] | null | null | null | locations/spiders/aldi_uk.py | bealbrown/allhours | f750ee7644246a97bd16879f14115d7845f76b89 | [
"MIT"
] | null | null | null | locations/spiders/aldi_uk.py | bealbrown/allhours | f750ee7644246a97bd16879f14115d7845f76b89 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import re
import json
from locations.hourstudy import inputoutput
class AldiUKSpider(scrapy.Spider):
name = "aldiuk"
allowed_domains = ['www.aldi.co.uk']
start_urls = (
'https://www.aldi.co.uk/sitemap/store',
)
def parse(self, response):
respo... | 39.125 | 159 | 0.571353 |
import scrapy
import re
import json
from locations.hourstudy import inputoutput
class AldiUKSpider(scrapy.Spider):
name = "aldiuk"
allowed_domains = ['www.aldi.co.uk']
start_urls = (
'https://www.aldi.co.uk/sitemap/store',
)
def parse(self, response):
response.selector.remove_nam... | true | true |
79094a923bcf0bd351933af93ab2684f6143ebc1 | 1,975 | py | Python | train_joint.py | locdoan12121997/Indoor_Segmentation | 7e90fceb92e1be035a5eedec6ee53bf343bcdab6 | [
"Apache-2.0"
] | 2 | 2020-03-27T14:50:12.000Z | 2022-03-30T02:40:21.000Z | train_joint.py | locdoan12121997/Indoor_Segmentation | 7e90fceb92e1be035a5eedec6ee53bf343bcdab6 | [
"Apache-2.0"
] | null | null | null | train_joint.py | locdoan12121997/Indoor_Segmentation | 7e90fceb92e1be035a5eedec6ee53bf343bcdab6 | [
"Apache-2.0"
] | null | null | null | from models.joint_fpn import JointFpn
from trainers.segmentation_trainer import SegmentationTrainer
from data_generators.joint_data_generator import JointDataGenerator
from data_generators.scenenet_rgbd_data_generator import ScenenetRGBDDataGenerator
from utils.config import process_config
from utils.dirs import create... | 32.377049 | 82 | 0.729114 | from models.joint_fpn import JointFpn
from trainers.segmentation_trainer import SegmentationTrainer
from data_generators.joint_data_generator import JointDataGenerator
from data_generators.scenenet_rgbd_data_generator import ScenenetRGBDDataGenerator
from utils.config import process_config
from utils.dirs import create... | true | true |
79094b1325f9f2bc6884b041da0987bd432b2b90 | 3,520 | py | Python | src/edubot/client.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/client.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/client.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 26.074074 | 79 | 0.646591 |
import os
import subprocess
class AbstractBrowser:
_binary = None
def __init__(self, url, user_data_dir):
self.user_data_dir = os.path.join(user_data_dir, self._binary)
self.url = url
if not os.path.exists(self.user_data_dir):
os.makedirs(self.user... | true | true |
79094b8da361144427c8e1c416c4560ff428ffa4 | 3,337 | py | Python | src/main/resources/arxan/UploadApplication.py | xebialabs-community/xlr-essential-app-protection-plugin | f68df83cca35bfe3f70c7de1f33ebafc98752bde | [
"MIT"
] | null | null | null | src/main/resources/arxan/UploadApplication.py | xebialabs-community/xlr-essential-app-protection-plugin | f68df83cca35bfe3f70c7de1f33ebafc98752bde | [
"MIT"
] | null | null | null | src/main/resources/arxan/UploadApplication.py | xebialabs-community/xlr-essential-app-protection-plugin | f68df83cca35bfe3f70c7de1f33ebafc98752bde | [
"MIT"
] | null | null | null | #
# Copyright 2021 XEBIALABS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, subli... | 48.362319 | 462 | 0.69104 |
import json
import requests
import org.slf4j.LoggerFactory as LoggerFactory
logger = LoggerFactory.getLogger("Arxan")
api_token_endpoint = "/v2/apaas/apps"
url = server.get('url') + "%s" % api_token_endpoint
headers = {
'Content-Type': "application/x-www-form-urlencoded"
}
with open(file_path, 'rb')... | true | true |
79094ba4c931ead41bcd45004879c5fa37426b73 | 822 | py | Python | ml_project/entities/train_pipeline_params.py | made-ml-in-prod-2021/marina-zav | 7b4b6e5f333707001e36dfb014dcd36bf975d969 | [
"FTL"
] | null | null | null | ml_project/entities/train_pipeline_params.py | made-ml-in-prod-2021/marina-zav | 7b4b6e5f333707001e36dfb014dcd36bf975d969 | [
"FTL"
] | null | null | null | ml_project/entities/train_pipeline_params.py | made-ml-in-prod-2021/marina-zav | 7b4b6e5f333707001e36dfb014dcd36bf975d969 | [
"FTL"
] | null | null | null | from dataclasses import dataclass
import yaml
from marshmallow_dataclass import class_schema
from .feature_params import FeatureParams
from .preprocess_params import PreprocessParams
from .split_params import SplittingParams
from .train_params import TrainingParams
@dataclass()
class TrainingPipelineParams:
inp... | 27.4 | 71 | 0.810219 | from dataclasses import dataclass
import yaml
from marshmallow_dataclass import class_schema
from .feature_params import FeatureParams
from .preprocess_params import PreprocessParams
from .split_params import SplittingParams
from .train_params import TrainingParams
@dataclass()
class TrainingPipelineParams:
inp... | true | true |
79094bb47bef7847079dcc4eb501ab993a68de94 | 344 | py | Python | mppsolar/outputs/baseoutput.py | 20after4/mpp-solar | 31181f69abd18137c8a7f2c088691d464fb75acb | [
"MIT"
] | null | null | null | mppsolar/outputs/baseoutput.py | 20after4/mpp-solar | 31181f69abd18137c8a7f2c088691d464fb75acb | [
"MIT"
] | null | null | null | mppsolar/outputs/baseoutput.py | 20after4/mpp-solar | 31181f69abd18137c8a7f2c088691d464fb75acb | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger("MPP-Solar")
class baseoutput:
def __str__(self):
return "baseoutput - the base class for the output processors, not used directly"
def get_kwargs(self, kwargs, key, default=None):
if not key in kwargs or not kwargs[key]:
return default
... | 22.933333 | 89 | 0.665698 | import logging
log = logging.getLogger("MPP-Solar")
class baseoutput:
def __str__(self):
return "baseoutput - the base class for the output processors, not used directly"
def get_kwargs(self, kwargs, key, default=None):
if not key in kwargs or not kwargs[key]:
return default
... | true | true |
79094be2c1880506031c887e98b8bf683679f18d | 203 | py | Python | upto7-12-2020/amstrongnospl.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | upto7-12-2020/amstrongnospl.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | upto7-12-2020/amstrongnospl.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | n=(input("Enter a number"))
a=len(n)
s=int(n)
sum=0
p=s
while s>0:
b=s%10
sum=sum+b**a
s=s//10
if sum==p:
print("It is an Amstrong Number")
else:
print("It is Not an Amstrong Number") | 15.615385 | 41 | 0.591133 | n=(input("Enter a number"))
a=len(n)
s=int(n)
sum=0
p=s
while s>0:
b=s%10
sum=sum+b**a
s=s//10
if sum==p:
print("It is an Amstrong Number")
else:
print("It is Not an Amstrong Number") | true | true |
79094c50813a8f89ddfeab75de69df4aacf7b75a | 17,699 | py | Python | fastinference/tabular/pd.py | floleuerer/fastinference | bab8251385416140cf2611016ea1b40c8f9032ff | [
"Apache-2.0"
] | 79 | 2020-06-08T02:08:06.000Z | 2022-02-07T11:01:59.000Z | fastinference/tabular/pd.py | floleuerer/fastinference | bab8251385416140cf2611016ea1b40c8f9032ff | [
"Apache-2.0"
] | 41 | 2020-06-20T17:00:29.000Z | 2022-02-03T12:43:58.000Z | fastinference/tabular/pd.py | floleuerer/fastinference | bab8251385416140cf2611016ea1b40c8f9032ff | [
"Apache-2.0"
] | 19 | 2020-06-14T19:39:37.000Z | 2021-05-30T14:33:26.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_tabular.pd.ipynb (unless otherwise specified).
__all__ = ['PartDep']
# Cell
from fastai.tabular.all import *
from .core import *
# Cell
from plotnine import *
# Cell
from IPython.display import clear_output
# Cell
class PartDep(Interpret):
"""
Calculate Pa... | 41.449649 | 117 | 0.598339 |
__all__ = ['PartDep']
from fastai.tabular.all import *
from .core import *
from plotnine import *
from IPython.display import clear_output
class PartDep(Interpret):
def __init__(self, learn, df, model_name: str, fields: list = (), coef: float = 1.0,
is_sorted: bool = True, use_log=False,... | true | true |
79094cde17adfcba18f15fdad7aac1cd83f9949d | 3,235 | py | Python | src/ggrc/snapshotter/rules.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-12T23:46:00.000Z | 2019-01-12T23:46:00.000Z | src/ggrc/snapshotter/rules.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/snapshotter/rules.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Generate rules for snapshoting"""
from ggrc.snapshotter.datastructures import Attr
class Types(object):
"""Get default types for snapshotting"""
# pylint: disable=too-few-public-methods
all = {... | 20.093168 | 78 | 0.590108 |
from ggrc.snapshotter.datastructures import Attr
class Types(object):
all = {
"AccessGroup",
"AccountBalance",
"Contract",
"Control",
"DataAsset",
"Facility",
"Market",
"Objective",
"OrgGroup",
"Policy",
"Process",
"Product",
"Pr... | true | true |
79094d19015e9b63c663e0d024f66a89371ff799 | 3,754 | py | Python | github/get/zup-insights/src/formula/formula.py | GuillaumeFalourd/formulas-insights | c43f8f96e28343ab0919e10d7dc26b2dfeb0792b | [
"Apache-2.0"
] | 5 | 2020-09-30T19:20:42.000Z | 2022-02-25T22:20:30.000Z | github/get/zup-insights/src/formula/formula.py | GuillaumeFalourd/formulas-insights | c43f8f96e28343ab0919e10d7dc26b2dfeb0792b | [
"Apache-2.0"
] | 5 | 2020-09-28T21:53:07.000Z | 2021-05-06T14:58:10.000Z | github/get/zup-insights/src/formula/formula.py | GuillaumeFalourd/formulas-insights | c43f8f96e28343ab0919e10d7dc26b2dfeb0792b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import datetime
import inquirer
import requests
import re
import csv
import os
import json
repositories = [
"beagle",
"beagle-web-react",
"beagle-web-core",
"beagle-web-angular",
"charlescd",
"charlescd-docs",
"horusec",
"horusec-engine-docs",
"ritchie-cli",
"... | 26.43662 | 177 | 0.546883 |
import datetime
import inquirer
import requests
import re
import csv
import os
import json
repositories = [
"beagle",
"beagle-web-react",
"beagle-web-core",
"beagle-web-angular",
"charlescd",
"charlescd-docs",
"horusec",
"horusec-engine-docs",
"ritchie-cli",
"ritchie-formulas",... | true | true |
79094d564680b1cedceb022e0d8bc957fd07bd8d | 486 | py | Python | Python/Sort_Visualizer/bubbleSort.py | HarshOza36/hacktoberfest2021 | c8e115815beb2d2372d0646b1c2c8eda3dac2972 | [
"CC0-1.0"
] | null | null | null | Python/Sort_Visualizer/bubbleSort.py | HarshOza36/hacktoberfest2021 | c8e115815beb2d2372d0646b1c2c8eda3dac2972 | [
"CC0-1.0"
] | null | null | null | Python/Sort_Visualizer/bubbleSort.py | HarshOza36/hacktoberfest2021 | c8e115815beb2d2372d0646b1c2c8eda3dac2972 | [
"CC0-1.0"
] | null | null | null | import time
def bubblesort_Alg(arr, drawData, timeSpeed):
for i in range(len(arr)-1):
for j in range(len(arr)-1):
if(arr[j] > arr[j+1]):
arr[j], arr[j+1] = arr[j+1], arr[j]
# To draw the bars
drawData(arr, ['red' if x == j or x == j +
... | 32.4 | 71 | 0.475309 | import time
def bubblesort_Alg(arr, drawData, timeSpeed):
for i in range(len(arr)-1):
for j in range(len(arr)-1):
if(arr[j] > arr[j+1]):
arr[j], arr[j+1] = arr[j+1], arr[j]
drawData(arr, ['red' if x == j or x == j +
... | true | true |
79094e0a91a0c10b1f15f7ca1f4ae92f88de0dcc | 1,679 | py | Python | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/155_Min_Stack.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/155_Min_Stack.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/155_Min_Stack.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self.stack1 = []
self.stack2 = []
def push(self, x):
"""
:type x: int
:rtype: void
"""
self.stack1.append(x)
if len(self.stack2) == 0... | 22.689189 | 109 | 0.48243 | class MinStack(object):
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, x):
self.stack1.append(x)
if len(self.stack2) == 0 or x <= self.stack2[-1]:
self.stack2.append(x)
def pop(self):
top = self.stack1[-1]
self.stack1.pop()... | true | true |
79094f65da54a8db48158acbd24fb4d77acac004 | 22,392 | py | Python | src/sage/combinat/designs/latin_squares.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/designs/latin_squares.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/designs/latin_squares.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
Mutually Orthogonal Latin Squares (MOLS)
The main function of this module is :func:`mutually_orthogonal_latin_squares`
and can be can be used to generate MOLS (or check that they exist)::
sage: MOLS = designs.mutually_orthogonal_latin_squares(4,8)
For more information on MOLS, see th... | 39.078534 | 117 | 0.535013 |
r"""
Mutually Orthogonal Latin Squares (MOLS)
The main function of this module is :func:`mutually_orthogonal_latin_squares`
and can be can be used to generate MOLS (or check that they exist)::
sage: MOLS = designs.mutually_orthogonal_latin_squares(4,8)
For more information on MOLS, see the :wikipedia:`Wikipedia... | false | true |
79094fa405e3f0bf9830f8c74721ee170ec3c33a | 9,137 | py | Python | qa/pull-tester/pull-tester.py | StarShares/StarShares | 523869ed7b391664d1b8cac61ad500b9ee8663a3 | [
"MIT"
] | 4 | 2017-02-10T06:48:28.000Z | 2021-03-06T02:58:33.000Z | qa/pull-tester/pull-tester.py | StarShares/StarShares | 523869ed7b391664d1b8cac61ad500b9ee8663a3 | [
"MIT"
] | null | null | null | qa/pull-tester/pull-tester.py | StarShares/StarShares | 523869ed7b391664d1b8cac61ad500b9ee8663a3 | [
"MIT"
] | 3 | 2017-02-10T06:48:29.000Z | 2020-10-26T03:27:50.000Z | #!/usr/bin/python
# Copyright (c) 2013 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
from urllib import urlopen
import requests
import getpass
from string import Template
im... | 47.097938 | 261 | 0.652731 |
import json
from urllib import urlopen
import requests
import getpass
from string import Template
import sys
import os
import subprocess
class RunError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def run(command, **kw... | true | true |
7909507130ecd4d26a35b2ea1fbaf5e56d26ab85 | 4,928 | py | Python | Lab6/Lab6.py | natalievolk/ESC190Labs | 4b254e9247d5ac44e378606bc604ee2c7f67a02c | [
"CNRI-Python"
] | null | null | null | Lab6/Lab6.py | natalievolk/ESC190Labs | 4b254e9247d5ac44e378606bc604ee2c7f67a02c | [
"CNRI-Python"
] | null | null | null | Lab6/Lab6.py | natalievolk/ESC190Labs | 4b254e9247d5ac44e378606bc604ee2c7f67a02c | [
"CNRI-Python"
] | null | null | null | # Lab 6
#
# We'll define a node of a binary tree and introduce some features of Python
# classes along the way
import random
class BST:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def insert(self, value):
'''
node.insert(5) is the ... | 23.578947 | 77 | 0.582589 |
# classes along the way
import random
class BST:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def insert(self, value):
if value < self.value:
if self.left == None:
self.left = BST(value)
else:
... | true | true |
7909509d4f39b3e67495046107e53a704636ebbe | 3,137 | py | Python | scripts/test.py | dumpram/stm32_real_time_test | 59b3e6bbd11498df032a180e06144c8046b14bbe | [
"MIT"
] | null | null | null | scripts/test.py | dumpram/stm32_real_time_test | 59b3e6bbd11498df032a180e06144c8046b14bbe | [
"MIT"
] | null | null | null | scripts/test.py | dumpram/stm32_real_time_test | 59b3e6bbd11498df032a180e06144c8046b14bbe | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# System imports
import argparse
import sys
import serial
# Data processing imports
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import seaborn as sns
def checkparams(pwm_freq, pwm_duty, num_samples):
check_ok = True
if pwm_freq < 20 or pwm_freq > 100:
... | 25.504065 | 73 | 0.613006 |
import argparse
import sys
import serial
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import seaborn as sns
def checkparams(pwm_freq, pwm_duty, num_samples):
check_ok = True
if pwm_freq < 20 or pwm_freq > 100:
print("Allowed PWM freq is between in [20, 100] kHz... | true | true |
7909526a408024180a4b4fccfa17d62f682c0aad | 8,149 | py | Python | contrib/devtools/update-translations.py | ALLMINER/elli | 9a21aaff9968ee023ba2017cc485d787ff24b038 | [
"MIT"
] | 4 | 2018-05-19T16:47:15.000Z | 2019-11-13T08:59:50.000Z | contrib/devtools/update-translations.py | ALLMINER/elli | 9a21aaff9968ee023ba2017cc485d787ff24b038 | [
"MIT"
] | 3 | 2018-05-09T14:39:32.000Z | 2018-08-23T22:07:09.000Z | contrib/devtools/update-translations.py | ALLMINER/elli | 9a21aaff9968ee023ba2017cc485d787ff24b038 | [
"MIT"
] | 19 | 2018-04-01T18:17:04.000Z | 2019-01-20T22:34:03.000Z | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | 38.620853 | 124 | 0.63382 |
from __future__ import division, print_function
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'elli_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
print... | true | true |
790952910036afe78590addee199c1ac59adeab4 | 4,580 | py | Python | tests/riscv/vector/vector_wide_operand_conflict_force.py | Imperas/force-riscv | c15bc18e4d70e6c2f50bad1e9176e13575de6081 | [
"Apache-2.0"
] | null | null | null | tests/riscv/vector/vector_wide_operand_conflict_force.py | Imperas/force-riscv | c15bc18e4d70e6c2f50bad1e9176e13575de6081 | [
"Apache-2.0"
] | null | null | null | tests/riscv/vector/vector_wide_operand_conflict_force.py | Imperas/force-riscv | c15bc18e4d70e6c2f50bad1e9176e13575de6081 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... | 40.175439 | 124 | 0.624672 |
from riscv.EnvRISCV import EnvRISCV
from riscv.GenThreadRISCV import GenThreadRISCV
from VectorTestSequence import VectorTestSequence
from base.ChoicesModifier import ChoicesModifier
:
super().__init__(aGenThread, aName)
self._mInstrList = (
'VNSRA.WI 'VNSRA.WV 'VNSR... | true | true |
7909535b9bf702e013d466744bbc0102744b4643 | 922 | py | Python | server/server.py | alimfeld/codenames | dcb8a09a031b953f68b5789ab7bcff3a01ea9e2e | [
"MIT"
] | null | null | null | server/server.py | alimfeld/codenames | dcb8a09a031b953f68b5789ab7bcff3a01ea9e2e | [
"MIT"
] | null | null | null | server/server.py | alimfeld/codenames | dcb8a09a031b953f68b5789ab7bcff3a01ea9e2e | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify, send_from_directory
import engine
app = Flask(__name__)
@app.route('/api/texts')
def texts():
return send_from_directory('i18n', 'ui.de.json');
@app.route('/api/codenames')
def codenames():
return jsonify(engine.codenames())
@app.route('/api/ready')
def ready():
... | 24.918919 | 62 | 0.649675 | from flask import Flask, request, jsonify, send_from_directory
import engine
app = Flask(__name__)
@app.route('/api/texts')
def texts():
return send_from_directory('i18n', 'ui.de.json');
@app.route('/api/codenames')
def codenames():
return jsonify(engine.codenames())
@app.route('/api/ready')
def ready():
... | true | true |
7909544692f2d29f705fe1f598e59f74529bf29e | 6,183 | py | Python | mparser.py | marco-aziz/mPulse | 0722da3c01a3a086e2d474840bbae829d9821438 | [
"MIT"
] | null | null | null | mparser.py | marco-aziz/mPulse | 0722da3c01a3a086e2d474840bbae829d9821438 | [
"MIT"
] | 4 | 2021-03-30T13:53:49.000Z | 2021-09-22T19:22:15.000Z | mparser.py | marco-aziz/mPulse | 0722da3c01a3a086e2d474840bbae829d9821438 | [
"MIT"
] | null | null | null | """
Based on REST Framework Parsers, optimized for csv
Parsers are used to parse the content of incoming HTTP requests.
They give us a generic way of being able to handle various media types
on the request, such as form content or json encoded data.
"""
import codecs
from urllib import parse
from django.conf import ... | 38.64375 | 122 | 0.613456 | import codecs
from urllib import parse
from django.conf import settings
from django.core.files.uploadhandler import StopFutureHandlers
from django.http import QueryDict
from django.http.multipartparser import ChunkIter
from django.http.multipartparser import \
MultiPartParser as DjangoMultiPartParser
from django.h... | true | true |
790954bc550462219b4cd2a72db6d5bd531ed27f | 1,515 | py | Python | halo_flask/models.py | yoramk2/halo_flask | d3daddb19b1236f50332c18c8a34ca129746549c | [
"MIT"
] | 1 | 2020-07-14T12:49:22.000Z | 2020-07-14T12:49:22.000Z | halo_flask/models.py | yoramk2/halo_flask | d3daddb19b1236f50332c18c8a34ca129746549c | [
"MIT"
] | null | null | null | halo_flask/models.py | yoramk2/halo_flask | d3daddb19b1236f50332c18c8a34ca129746549c | [
"MIT"
] | null | null | null | from __future__ import print_function
import datetime
import hashlib
import logging
from abc import ABCMeta
from halo_flask.classes import AbsBaseClass
from halo_flask.logs import log_json
from halo_flask.const import SYSTEMChoice,LOGChoice
from .settingsx import settingsx
settings = settingsx()
logger = logging.... | 28.584906 | 123 | 0.611881 | from __future__ import print_function
import datetime
import hashlib
import logging
from abc import ABCMeta
from halo_flask.classes import AbsBaseClass
from halo_flask.logs import log_json
from halo_flask.const import SYSTEMChoice,LOGChoice
from .settingsx import settingsx
settings = settingsx()
logger = logging.... | true | true |
7909551686d22dfe6e2f43c4c937014fd62945d1 | 21,563 | py | Python | src/ecn.py | mnoukhov/ecn | f1b838cfe2e27f7cc30cdf2e711b9a474b27a158 | [
"MIT"
] | 1 | 2021-05-05T18:28:13.000Z | 2021-05-05T18:28:13.000Z | src/ecn.py | mnoukhov/ecn | f1b838cfe2e27f7cc30cdf2e711b9a474b27a158 | [
"MIT"
] | null | null | null | src/ecn.py | mnoukhov/ecn | f1b838cfe2e27f7cc30cdf2e711b9a474b27a158 | [
"MIT"
] | null | null | null | import argparse
import datetime
import json
import os
import time
from os import path
import numpy as np
import torch
from absl import flags
from torch import optim
from pprint import pprint
import wandb
from src.alive_sieve import AliveSieve, SievePlayback
from src.nets import AgentModel
from src.rewards_lib import ... | 39.565138 | 118 | 0.58554 | import argparse
import datetime
import json
import os
import time
from os import path
import numpy as np
import torch
from absl import flags
from torch import optim
from pprint import pprint
import wandb
from src.alive_sieve import AliveSieve, SievePlayback
from src.nets import AgentModel
from src.rewards_lib import ... | true | true |
79095552abce67db07c09775dc986a97974c551c | 2,858 | py | Python | myProject/settings.py | anthonyc1/django-materialize-boilerplate | ba1ae43bf153647d7a26f665a13596f2b0217d0f | [
"MIT"
] | null | null | null | myProject/settings.py | anthonyc1/django-materialize-boilerplate | ba1ae43bf153647d7a26f665a13596f2b0217d0f | [
"MIT"
] | null | null | null | myProject/settings.py | anthonyc1/django-materialize-boilerplate | ba1ae43bf153647d7a26f665a13596f2b0217d0f | [
"MIT"
] | null | null | null | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the... | 25.517857 | 91 | 0.689293 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'aa!b!ug6opqr*_f60k&%orwoqus_ecvlgjtsn0y)c)1o7-_at&'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentt... | true | true |
790955e7b71fae23bcfcee0cd2a34e07e6164e1f | 14,067 | py | Python | Lib/multiprocessing/util.py | foxleoly/cpython | 7866690fc7fc1115553fa401a19dc6c95de54d82 | [
"0BSD"
] | null | null | null | Lib/multiprocessing/util.py | foxleoly/cpython | 7866690fc7fc1115553fa401a19dc6c95de54d82 | [
"0BSD"
] | 4 | 2021-12-01T00:05:19.000Z | 2022-03-27T04:53:40.000Z | Lib/multiprocessing/util.py | foxleoly/cpython | 7866690fc7fc1115553fa401a19dc6c95de54d82 | [
"0BSD"
] | null | null | null | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import os
import itertools
import sys
import weakref
import atexit
import threading # we want threading to install it's
... | 28.591463 | 79 | 0.629843 |
import os
import itertools
import sys
import weakref
import atexit
import threading
# cleanup function before multiprocessing does
from subprocess import _args_from_interpreter_flags
from . import process
__all__ = [
'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger... | true | true |
7909563a78a4e905ad64bf54c9107f01802bfe93 | 7,828 | py | Python | app.py | N1ght-Owls/reposi | bf26fe668d1ae5faf4559550aedd1e149a0bf51e | [
"MIT"
] | 16 | 2020-04-12T12:06:30.000Z | 2022-02-04T03:55:46.000Z | app.py | N1ght-Owls/hackathon | bf26fe668d1ae5faf4559550aedd1e149a0bf51e | [
"MIT"
] | 6 | 2020-04-14T17:53:28.000Z | 2021-02-07T18:30:23.000Z | app.py | N1ght-Owls/hackathon | bf26fe668d1ae5faf4559550aedd1e149a0bf51e | [
"MIT"
] | 1 | 2020-04-14T17:30:33.000Z | 2020-04-14T17:30:33.000Z | from werkzeug.wrappers import Request
from flask import Flask, redirect, url_for, request, flash
from flask_sqlalchemy import SQLAlchemy
import os
import requests
import random
from contact_form import ContactForm
from flask_dance.contrib.github import make_github_blueprint, github
from flask_dance.contrib.gitl... | 35.908257 | 161 | 0.624681 | from werkzeug.wrappers import Request
from flask import Flask, redirect, url_for, request, flash
from flask_sqlalchemy import SQLAlchemy
import os
import requests
import random
from contact_form import ContactForm
from flask_dance.contrib.github import make_github_blueprint, github
from flask_dance.contrib.gitl... | true | true |
7909563e27e264288c90f1e9cecfc98806506423 | 4,093 | py | Python | robogym/randomization/tests/test_randomization.py | 0xflotus/robogym | 5ec2fcbda9828941fe3072792dd25fb5a915bbbb | [
"MIT"
] | 288 | 2020-11-12T21:39:34.000Z | 2022-03-19T23:27:50.000Z | robogym/randomization/tests/test_randomization.py | 0xflotus/robogym | 5ec2fcbda9828941fe3072792dd25fb5a915bbbb | [
"MIT"
] | 3 | 2020-12-12T19:19:30.000Z | 2022-03-24T05:21:39.000Z | robogym/randomization/tests/test_randomization.py | 0xflotus/robogym | 5ec2fcbda9828941fe3072792dd25fb5a915bbbb | [
"MIT"
] | 31 | 2020-11-12T22:31:01.000Z | 2022-02-28T20:34:48.000Z | import unittest
import attr
import numpy as np
from robogym.randomization.env import (
EnvActionRandomizer,
EnvObservationRandomizer,
EnvParameterRandomizer,
EnvRandomization,
EnvSimulationRandomizer,
build_randomizable_param,
)
from robogym.randomization.observation import ObservationRandomiz... | 31.976563 | 87 | 0.658441 | import unittest
import attr
import numpy as np
from robogym.randomization.env import (
EnvActionRandomizer,
EnvObservationRandomizer,
EnvParameterRandomizer,
EnvRandomization,
EnvSimulationRandomizer,
build_randomizable_param,
)
from robogym.randomization.observation import ObservationRandomiz... | true | true |
7909564ae5e3998adfa59559eb47e2f30fa28f49 | 157 | py | Python | feed/views.py | njokuifeanyigerald/django-social-media-app | dc27873fd518b1dc79e179c359470f9a1a10478f | [
"MIT"
] | null | null | null | feed/views.py | njokuifeanyigerald/django-social-media-app | dc27873fd518b1dc79e179c359470f9a1a10478f | [
"MIT"
] | null | null | null | feed/views.py | njokuifeanyigerald/django-social-media-app | dc27873fd518b1dc79e179c359470f9a1a10478f | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
def feedHome(request):
return HttpResponse('<p>Welcome To My Social App</p>') | 26.166667 | 59 | 0.770701 | from django.shortcuts import render
from django.http import HttpResponse
def feedHome(request):
return HttpResponse('<p>Welcome To My Social App</p>') | true | true |
7909564d55bc80ff0d4e5ca9e58c97157c95b9fe | 875 | py | Python | plugins/salesforce/komand_salesforce/actions/create_record/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/salesforce/komand_salesforce/actions/create_record/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/salesforce/komand_salesforce/actions/create_record/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
from .schema import CreateRecordInput, CreateRecordOutput
# Custom imports below
class CreateRecord(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="create_record",
description="Create a new SObject record",
input=CreateReco... | 27.34375 | 76 | 0.595429 | import komand
from .schema import CreateRecordInput, CreateRecordOutput
class CreateRecord(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="create_record",
description="Create a new SObject record",
input=CreateRecordInput(),
... | true | true |
790956666b7ca4e00adb3f774cbf243ad7a6ef3c | 377 | py | Python | tdda/testtdda.py | Daniel-Mietchen/tdda | 98718ec3b4b253bba3b575d4b10a14a6d70576b8 | [
"MIT"
] | null | null | null | tdda/testtdda.py | Daniel-Mietchen/tdda | 98718ec3b4b253bba3b575d4b10a14a6d70576b8 | [
"MIT"
] | null | null | null | tdda/testtdda.py | Daniel-Mietchen/tdda | 98718ec3b4b253bba3b575d4b10a14a6d70576b8 | [
"MIT"
] | null | null | null | """
Run all TDDA tests
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from tdda.referencetest import ReferenceTestCase
from tdda.constraints.testconstraints import *
from tdda.rexpy.testrexpy import *
from tdda.referencetest.tests.alltests import *
... | 19.842105 | 48 | 0.803714 |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from tdda.referencetest import ReferenceTestCase
from tdda.constraints.testconstraints import *
from tdda.rexpy.testrexpy import *
from tdda.referencetest.tests.alltests import *
if __name__ == '__main__':
... | true | true |
790957106313de045f6ffacbf06a1dab51905223 | 100 | py | Python | programacion_avanzada/06.paquetes_y_modulos/package/sub_package2/mod4.py | soytupadrrre/Master_Python_Eip | c4774209d7dd15584233fe5d4cc01b1434c9316b | [
"MIT"
] | null | null | null | programacion_avanzada/06.paquetes_y_modulos/package/sub_package2/mod4.py | soytupadrrre/Master_Python_Eip | c4774209d7dd15584233fe5d4cc01b1434c9316b | [
"MIT"
] | null | null | null | programacion_avanzada/06.paquetes_y_modulos/package/sub_package2/mod4.py | soytupadrrre/Master_Python_Eip | c4774209d7dd15584233fe5d4cc01b1434c9316b | [
"MIT"
] | null | null | null | def module_name():
print("Soy el módulo 4")
if __name__ == "__main__":
print(module_name()) | 20 | 28 | 0.65 | def module_name():
print("Soy el módulo 4")
if __name__ == "__main__":
print(module_name()) | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.